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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
trailofbits/llvm-sanitizer-tutorial | d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99 | llvm/tools/clang/bindings/python/clang/cindex.py | python | Token.extent | (self) | return conf.lib.clang_getTokenExtent(self._tu, self) | The SourceRange this Token occupies. | The SourceRange this Token occupies. | [
"The",
"SourceRange",
"this",
"Token",
"occupies",
"."
] | def extent(self):
"""The SourceRange this Token occupies."""
return conf.lib.clang_getTokenExtent(self._tu, self) | [
"def",
"extent",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getTokenExtent",
"(",
"self",
".",
"_tu",
",",
"self",
")"
] | https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/tools/clang/bindings/python/clang/cindex.py#L3307-L3309 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/dygraph/dygraph_to_static/partial_program.py | python | PartialProgramLayer._train_program | (self) | return train_program | Lazy initialized property of train_program. | Lazy initialized property of train_program. | [
"Lazy",
"initialized",
"property",
"of",
"train_program",
"."
] | def _train_program(self):
"""
Lazy initialized property of train_program.
"""
train_program = self._append_backward_desc(self._origin_main_program)
# Note: Only set grad type once after initializing train program. So we
# put it here.
self._set_grad_type(self._par... | [
"def",
"_train_program",
"(",
"self",
")",
":",
"train_program",
"=",
"self",
".",
"_append_backward_desc",
"(",
"self",
".",
"_origin_main_program",
")",
"# Note: Only set grad type once after initializing train program. So we",
"# put it here.",
"self",
".",
"_set_grad_type... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/dygraph/dygraph_to_static/partial_program.py#L172-L181 | |
vmtk/vmtk | 927331ad752265199390eabbbf2e07cdc2b4bcc6 | vtkVmtk/Utilities/Stellar_1.0/meshconvert.py | python | readSurf | (fileName) | return points, tris | read .surf file format, containing the surface faces of a tet mesh
as output by NETGEN | read .surf file format, containing the surface faces of a tet mesh
as output by NETGEN | [
"read",
".",
"surf",
"file",
"format",
"containing",
"the",
"surface",
"faces",
"of",
"a",
"tet",
"mesh",
"as",
"output",
"by",
"NETGEN"
] | def readSurf(fileName):
"""read .surf file format, containing the surface faces of a tet mesh
as output by NETGEN"""
inFileName = fileName + '.surf'
# open input .surf file
infile = open(inFileName)
# read first line, make sure it's right
header = infile.readline().strip()
assert(he... | [
"def",
"readSurf",
"(",
"fileName",
")",
":",
"inFileName",
"=",
"fileName",
"+",
"'.surf'",
"# open input .surf file",
"infile",
"=",
"open",
"(",
"inFileName",
")",
"# read first line, make sure it's right",
"header",
"=",
"infile",
".",
"readline",
"(",
")",
".... | https://github.com/vmtk/vmtk/blob/927331ad752265199390eabbbf2e07cdc2b4bcc6/vtkVmtk/Utilities/Stellar_1.0/meshconvert.py#L444-L478 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/wheel.py | python | Wheel.__init__ | (self, filename) | :raises InvalidWheelFilename: when the filename is invalid for a wheel | :raises InvalidWheelFilename: when the filename is invalid for a wheel | [
":",
"raises",
"InvalidWheelFilename",
":",
"when",
"the",
"filename",
"is",
"invalid",
"for",
"a",
"wheel"
] | def __init__(self, filename):
"""
:raises InvalidWheelFilename: when the filename is invalid for a wheel
"""
wheel_info = self.wheel_file_re.match(filename)
if not wheel_info:
raise InvalidWheelFilename(
"%s is not a valid wheel filename." % filename
... | [
"def",
"__init__",
"(",
"self",
",",
"filename",
")",
":",
"wheel_info",
"=",
"self",
".",
"wheel_file_re",
".",
"match",
"(",
"filename",
")",
"if",
"not",
"wheel_info",
":",
"raise",
"InvalidWheelFilename",
"(",
"\"%s is not a valid wheel filename.\"",
"%",
"f... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/wheel.py#L601-L623 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/jinja2/debug.py | python | ProcessedTraceback.exc_info | (self) | return self.exc_type, self.exc_value, self.frames[0] | Exception info tuple with a proxy around the frame objects. | Exception info tuple with a proxy around the frame objects. | [
"Exception",
"info",
"tuple",
"with",
"a",
"proxy",
"around",
"the",
"frame",
"objects",
"."
] | def exc_info(self):
"""Exception info tuple with a proxy around the frame objects."""
return self.exc_type, self.exc_value, self.frames[0] | [
"def",
"exc_info",
"(",
"self",
")",
":",
"return",
"self",
".",
"exc_type",
",",
"self",
".",
"exc_value",
",",
"self",
".",
"frames",
"[",
"0",
"]"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/debug.py#L117-L119 | |
PixarAnimationStudios/USD | faed18ce62c8736b02413635b584a2f637156bad | pxr/usdImaging/usdviewq/selectionDataModel.py | python | SelectionDataModel.setPrimPath | (self, path, instance=ALL_INSTANCES) | Clear the prim selection then add a single prim path back to the
selection. If an instance is given, only add that instance. | Clear the prim selection then add a single prim path back to the
selection. If an instance is given, only add that instance. | [
"Clear",
"the",
"prim",
"selection",
"then",
"add",
"a",
"single",
"prim",
"path",
"back",
"to",
"the",
"selection",
".",
"If",
"an",
"instance",
"is",
"given",
"only",
"add",
"that",
"instance",
"."
] | def setPrimPath(self, path, instance=ALL_INSTANCES):
"""Clear the prim selection then add a single prim path back to the
selection. If an instance is given, only add that instance.
"""
with self.batchPrimChanges:
self.clearPrims()
self.addPrimPath(path, instance) | [
"def",
"setPrimPath",
"(",
"self",
",",
"path",
",",
"instance",
"=",
"ALL_INSTANCES",
")",
":",
"with",
"self",
".",
"batchPrimChanges",
":",
"self",
".",
"clearPrims",
"(",
")",
"self",
".",
"addPrimPath",
"(",
"path",
",",
"instance",
")"
] | https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/selectionDataModel.py#L628-L634 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | qa/tasks/ceph_manager.py | python | OSDThrasher.do_optrack_toggle | (self) | Loops and toggle op tracking to all osds.
Loop delay is controlled by the config value optrack_toggle_delay. | Loops and toggle op tracking to all osds. | [
"Loops",
"and",
"toggle",
"op",
"tracking",
"to",
"all",
"osds",
"."
] | def do_optrack_toggle(self):
"""
Loops and toggle op tracking to all osds.
Loop delay is controlled by the config value optrack_toggle_delay.
"""
delay = float(self.optrack_toggle_delay)
osd_state = "true"
self.log("starting do_optrack_toggle with a delay of {0}"... | [
"def",
"do_optrack_toggle",
"(",
"self",
")",
":",
"delay",
"=",
"float",
"(",
"self",
".",
"optrack_toggle_delay",
")",
"osd_state",
"=",
"\"true\"",
"self",
".",
"log",
"(",
"\"starting do_optrack_toggle with a delay of {0}\"",
".",
"format",
"(",
"delay",
")",
... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/ceph_manager.py#L1303-L1323 | ||
neopenx/Dragon | 0e639a7319035ddc81918bd3df059230436ee0a1 | Dragon/python/dragon/tools/db.py | python | LMDB.put | (self, key, value) | Put the item.
Parameters
----------
key : str
The key.
value : str
The value.
Returns
-------
None | Put the item. | [
"Put",
"the",
"item",
"."
] | def put(self, key, value):
"""Put the item.
Parameters
----------
key : str
The key.
value : str
The value.
Returns
-------
None
"""
self._buffer.append((wrapper_str(key), value))
self._cur_put += 1
... | [
"def",
"put",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"self",
".",
"_buffer",
".",
"append",
"(",
"(",
"wrapper_str",
"(",
"key",
")",
",",
"value",
")",
")",
"self",
".",
"_cur_put",
"+=",
"1",
"if",
"(",
"self",
".",
"_cur_put",
">=",
... | https://github.com/neopenx/Dragon/blob/0e639a7319035ddc81918bd3df059230436ee0a1/Dragon/python/dragon/tools/db.py#L107-L124 | ||
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/cherrypy/lib/sessions.py | python | Session.setdefault | (self, key, default=None) | return self._data.setdefault(key, default) | D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D. | D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D. | [
"D",
".",
"setdefault",
"(",
"k",
"[",
"d",
"]",
")",
"-",
">",
"D",
".",
"get",
"(",
"k",
"d",
")",
"also",
"set",
"D",
"[",
"k",
"]",
"=",
"d",
"if",
"k",
"not",
"in",
"D",
"."
] | def setdefault(self, key, default=None):
"""D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D."""
if not self.loaded: self.load()
return self._data.setdefault(key, default) | [
"def",
"setdefault",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"loaded",
":",
"self",
".",
"load",
"(",
")",
"return",
"self",
".",
"_data",
".",
"setdefault",
"(",
"key",
",",
"default",
")"
] | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/lib/sessions.py#L304-L307 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TUNGraph.New | (*args) | return _snap.TUNGraph_New(*args) | New() -> PUNGraph
New(int const & Nodes, int const & Edges) -> PUNGraph
Parameters:
Nodes: int const &
Edges: int const & | New() -> PUNGraph
New(int const & Nodes, int const & Edges) -> PUNGraph | [
"New",
"()",
"-",
">",
"PUNGraph",
"New",
"(",
"int",
"const",
"&",
"Nodes",
"int",
"const",
"&",
"Edges",
")",
"-",
">",
"PUNGraph"
] | def New(*args):
"""
New() -> PUNGraph
New(int const & Nodes, int const & Edges) -> PUNGraph
Parameters:
Nodes: int const &
Edges: int const &
"""
return _snap.TUNGraph_New(*args) | [
"def",
"New",
"(",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TUNGraph_New",
"(",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L3443-L3453 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/training/optimizer.py | python | Optimizer._create_slots | (self, var_list) | Create all slots needed by the variables.
Args:
var_list: A list of `Variable` objects. | Create all slots needed by the variables. | [
"Create",
"all",
"slots",
"needed",
"by",
"the",
"variables",
"."
] | def _create_slots(self, var_list):
"""Create all slots needed by the variables.
Args:
var_list: A list of `Variable` objects.
"""
# No slots needed by default
pass | [
"def",
"_create_slots",
"(",
"self",
",",
"var_list",
")",
":",
"# No slots needed by default",
"pass"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/training/optimizer.py#L395-L402 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Tools/offlinedoc/buildqhelp.py | python | crawl | () | return 0 | downloads an entire wiki site | downloads an entire wiki site | [
"downloads",
"an",
"entire",
"wiki",
"site"
] | def crawl():
"downloads an entire wiki site"
# tests ###############################################
if os.system(QHELPCOMPILER +' -v'):
print ("Error: QAssistant not fully installed, exiting.")
return 1
# run ########################################################
qhp = bui... | [
"def",
"crawl",
"(",
")",
":",
"# tests ###############################################",
"if",
"os",
".",
"system",
"(",
"QHELPCOMPILER",
"+",
"' -v'",
")",
":",
"print",
"(",
"\"Error: QAssistant not fully installed, exiting.\"",
")",
"return",
"1",
"# run #############... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Tools/offlinedoc/buildqhelp.py#L47-L74 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | MenuBar.GetMenuCount | (*args, **kwargs) | return _core_.MenuBar_GetMenuCount(*args, **kwargs) | GetMenuCount(self) -> size_t | GetMenuCount(self) -> size_t | [
"GetMenuCount",
"(",
"self",
")",
"-",
">",
"size_t"
] | def GetMenuCount(*args, **kwargs):
"""GetMenuCount(self) -> size_t"""
return _core_.MenuBar_GetMenuCount(*args, **kwargs) | [
"def",
"GetMenuCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MenuBar_GetMenuCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L12276-L12278 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/vis/visualization.py | python | VisualizationScene.setTimeCallback | (self,cb) | Sets a callback in updateTime() to set the current time | Sets a callback in updateTime() to set the current time | [
"Sets",
"a",
"callback",
"in",
"updateTime",
"()",
"to",
"set",
"the",
"current",
"time"
] | def setTimeCallback(self,cb):
"""Sets a callback in updateTime() to set the current time"""
self.timeCallback = cb | [
"def",
"setTimeCallback",
"(",
"self",
",",
"cb",
")",
":",
"self",
".",
"timeCallback",
"=",
"cb"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/vis/visualization.py#L3857-L3859 | ||
baidu/AnyQ | d94d450d2aaa5f7ed73424b10aa4539835b97527 | tools/simnet/train/tf/layers/tf_layers.py | python | EmbeddingWithVSumLayer.__init__ | (self, vocab_size, emb_dim) | init function | init function | [
"init",
"function"
] | def __init__(self, vocab_size, emb_dim):
"""
init function
"""
self.vocab_size = vocab_size
self.emb_dim = emb_dim
init_scope = math.sqrt(6.0 / (vocab_size + emb_dim))
emb_shape = [self.vocab_size, self.emb_dim]
self.embedding = tf.Variable(tf.random_unifo... | [
"def",
"__init__",
"(",
"self",
",",
"vocab_size",
",",
"emb_dim",
")",
":",
"self",
".",
"vocab_size",
"=",
"vocab_size",
"self",
".",
"emb_dim",
"=",
"emb_dim",
"init_scope",
"=",
"math",
".",
"sqrt",
"(",
"6.0",
"/",
"(",
"vocab_size",
"+",
"emb_dim",... | https://github.com/baidu/AnyQ/blob/d94d450d2aaa5f7ed73424b10aa4539835b97527/tools/simnet/train/tf/layers/tf_layers.py#L429-L438 | ||
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/osr.py | python | _swig_add_metaclass | (metaclass) | return wrapper | Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass | Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass | [
"Class",
"decorator",
"for",
"adding",
"a",
"metaclass",
"to",
"a",
"SWIG",
"wrapped",
"class",
"-",
"a",
"slimmed",
"down",
"version",
"of",
"six",
".",
"add_metaclass"
] | def _swig_add_metaclass(metaclass):
"""Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
def wrapper(cls):
return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
return wrapper | [
"def",
"_swig_add_metaclass",
"(",
"metaclass",
")",
":",
"def",
"wrapper",
"(",
"cls",
")",
":",
"return",
"metaclass",
"(",
"cls",
".",
"__name__",
",",
"cls",
".",
"__bases__",
",",
"cls",
".",
"__dict__",
".",
"copy",
"(",
")",
")",
"return",
"wrap... | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/osr.py#L52-L56 | |
nsnam/ns-3-dev-git | efdb2e21f45c0a87a60b47c547b68fa140a7b686 | src/visualizer/visualizer/core.py | python | Channel.get_position | (self) | return (self.canvas_item.get_property("center_x"), self.canvas_item.get_property("center_y")) | !
Initializer function.
@param self: class object.
@return x / y position. | !
Initializer function. | [
"!",
"Initializer",
"function",
"."
] | def get_position(self):
"""!
Initializer function.
@param self: class object.
@return x / y position.
"""
return (self.canvas_item.get_property("center_x"), self.canvas_item.get_property("center_y")) | [
"def",
"get_position",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"canvas_item",
".",
"get_property",
"(",
"\"center_x\"",
")",
",",
"self",
".",
"canvas_item",
".",
"get_property",
"(",
"\"center_y\"",
")",
")"
] | https://github.com/nsnam/ns-3-dev-git/blob/efdb2e21f45c0a87a60b47c547b68fa140a7b686/src/visualizer/visualizer/core.py#L553-L560 | |
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/fuzzbunch/pyreadline/modes/emacs.py | python | EmacsMode.revert_line | (self, e) | Undo all changes made to this line. This is like executing the
undo command enough times to get back to the beginning. | Undo all changes made to this line. This is like executing the
undo command enough times to get back to the beginning. | [
"Undo",
"all",
"changes",
"made",
"to",
"this",
"line",
".",
"This",
"is",
"like",
"executing",
"the",
"undo",
"command",
"enough",
"times",
"to",
"get",
"back",
"to",
"the",
"beginning",
"."
] | def revert_line(self, e): # (M-r)
'''Undo all changes made to this line. This is like executing the
undo command enough times to get back to the beginning.'''
pass | [
"def",
"revert_line",
"(",
"self",
",",
"e",
")",
":",
"# (M-r)",
"pass"
] | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/modes/emacs.py#L478-L481 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/internal/containers.py | python | MessageMap.__init__ | (self, message_listener, message_descriptor, key_checker,
entry_descriptor) | Args:
message_listener: A MessageListener implementation.
The ScalarMap will call this object's Modified() method when it
is modified.
key_checker: A type_checkers.ValueChecker instance to run on keys
inserted into this container.
value_checker: A type_checkers.ValueChecker ins... | Args:
message_listener: A MessageListener implementation.
The ScalarMap will call this object's Modified() method when it
is modified.
key_checker: A type_checkers.ValueChecker instance to run on keys
inserted into this container.
value_checker: A type_checkers.ValueChecker ins... | [
"Args",
":",
"message_listener",
":",
"A",
"MessageListener",
"implementation",
".",
"The",
"ScalarMap",
"will",
"call",
"this",
"object",
"s",
"Modified",
"()",
"method",
"when",
"it",
"is",
"modified",
".",
"key_checker",
":",
"A",
"type_checkers",
".",
"Val... | def __init__(self, message_listener, message_descriptor, key_checker,
entry_descriptor):
"""
Args:
message_listener: A MessageListener implementation.
The ScalarMap will call this object's Modified() method when it
is modified.
key_checker: A type_checkers.ValueChecker... | [
"def",
"__init__",
"(",
"self",
",",
"message_listener",
",",
"message_descriptor",
",",
"key_checker",
",",
"entry_descriptor",
")",
":",
"self",
".",
"_message_listener",
"=",
"message_listener",
"self",
".",
"_message_descriptor",
"=",
"message_descriptor",
"self",... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/internal/containers.py#L532-L549 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetActiveArchs | (self, configname) | return xcode_archs_default.ActiveArchs(
config_settings.get('ARCHS'),
config_settings.get('VALID_ARCHS'),
config_settings.get('SDKROOT')) | Returns the architectures this target should be built for. | Returns the architectures this target should be built for. | [
"Returns",
"the",
"architectures",
"this",
"target",
"should",
"be",
"built",
"for",
"."
] | def GetActiveArchs(self, configname):
"""Returns the architectures this target should be built for."""
config_settings = self.xcode_settings[configname]
xcode_archs_default = GetXcodeArchsDefault()
return xcode_archs_default.ActiveArchs(
config_settings.get('ARCHS'),
config_settings.get(... | [
"def",
"GetActiveArchs",
"(",
"self",
",",
"configname",
")",
":",
"config_settings",
"=",
"self",
".",
"xcode_settings",
"[",
"configname",
"]",
"xcode_archs_default",
"=",
"GetXcodeArchsDefault",
"(",
")",
"return",
"xcode_archs_default",
".",
"ActiveArchs",
"(",
... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py#L420-L427 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py3/google/protobuf/internal/containers.py | python | RepeatedScalarFieldContainer.__eq__ | (self, other) | return other == self._values | Compares the current instance with another one. | Compares the current instance with another one. | [
"Compares",
"the",
"current",
"instance",
"with",
"another",
"one",
"."
] | def __eq__(self, other):
"""Compares the current instance with another one."""
if self is other:
return True
# Special case for the same type which should be common and fast.
if isinstance(other, self.__class__):
return other._values == self._values
# We are presumably comparing against ... | [
"def",
"__eq__",
"(",
"self",
",",
"other",
")",
":",
"if",
"self",
"is",
"other",
":",
"return",
"True",
"# Special case for the same type which should be common and fast.",
"if",
"isinstance",
"(",
"other",
",",
"self",
".",
"__class__",
")",
":",
"return",
"o... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/internal/containers.py#L340-L348 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/utils/unpacking.py | python | is_within_directory | (directory, target) | return prefix == abs_directory | Return true if the absolute path of target is within the directory | [] | def is_within_directory(directory, target):
# type: (str, str) -> bool
"""
Return true if the absolute path of target is within the directory
"""
abs_directory = os.path.abspath(directory)
abs_target = os.path.abspath(target)
prefix = os.path.commonprefix([abs_directory, abs_target]... | [
"def",
"is_within_directory",
"(",
"directory",
",",
"target",
")",
":",
"# type: (str, str) -> bool",
"abs_directory",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"directory",
")",
"abs_target",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"target",
")",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/utils/unpacking.py#L169-L187 | ||
mhammond/pywin32 | 44afd86ba8485194df93234639243252deeb40d5 | isapi/threaded_extension.py | python | ThreadPoolExtension.HandleDispatchError | (self, ecb) | Handles errors in the Dispatch method.
When a Dispatch method call fails, this method is called to handle
the exception. The default implementation formats the traceback
in the browser. | Handles errors in the Dispatch method. | [
"Handles",
"errors",
"in",
"the",
"Dispatch",
"method",
"."
] | def HandleDispatchError(self, ecb):
"""Handles errors in the Dispatch method.
When a Dispatch method call fails, this method is called to handle
the exception. The default implementation formats the traceback
in the browser.
"""
ecb.HttpStatusCode = isapicon.HSE_STATUS_... | [
"def",
"HandleDispatchError",
"(",
"self",
",",
"ecb",
")",
":",
"ecb",
".",
"HttpStatusCode",
"=",
"isapicon",
".",
"HSE_STATUS_ERROR",
"# control_block.LogData = \"we failed!\"",
"exc_typ",
",",
"exc_val",
",",
"exc_tb",
"=",
"sys",
".",
"exc_info",
"(",
")",
... | https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/isapi/threaded_extension.py#L144-L188 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/boost/boost_1_68_0/tools/build/src/build/virtual_target.py | python | AbstractFileTarget.__adjust_name | (self, specified_name) | Given the target name specified in constructor, returns the
name which should be really used, by looking at the <tag> properties.
The tag properties come in two flavour:
- <tag>value,
- <tag>@rule-name
In the first case, value is just added to name
In the second case,... | Given the target name specified in constructor, returns the
name which should be really used, by looking at the <tag> properties.
The tag properties come in two flavour:
- <tag>value,
- <tag> | [
"Given",
"the",
"target",
"name",
"specified",
"in",
"constructor",
"returns",
"the",
"name",
"which",
"should",
"be",
"really",
"used",
"by",
"looking",
"at",
"the",
"<tag",
">",
"properties",
".",
"The",
"tag",
"properties",
"come",
"in",
"two",
"flavour",... | def __adjust_name(self, specified_name):
"""Given the target name specified in constructor, returns the
name which should be really used, by looking at the <tag> properties.
The tag properties come in two flavour:
- <tag>value,
- <tag>@rule-name
In the first case, val... | [
"def",
"__adjust_name",
"(",
"self",
",",
"specified_name",
")",
":",
"assert",
"isinstance",
"(",
"specified_name",
",",
"basestring",
")",
"if",
"self",
".",
"action_",
":",
"ps",
"=",
"self",
".",
"action_",
".",
"properties",
"(",
")",
"else",
":",
"... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/tools/build/src/build/virtual_target.py#L532-L584 | ||
gnina/gnina | b9ae032f52fc7a8153987bde09c0efa3620d8bb6 | caffe/python/caffe/io.py | python | array_to_datum | (arr, label=None) | return datum | Converts a 3-dimensional array to datum. If the array has dtype uint8,
the output data will be encoded as a string. Otherwise, the output data
will be stored in float format. | Converts a 3-dimensional array to datum. If the array has dtype uint8,
the output data will be encoded as a string. Otherwise, the output data
will be stored in float format. | [
"Converts",
"a",
"3",
"-",
"dimensional",
"array",
"to",
"datum",
".",
"If",
"the",
"array",
"has",
"dtype",
"uint8",
"the",
"output",
"data",
"will",
"be",
"encoded",
"as",
"a",
"string",
".",
"Otherwise",
"the",
"output",
"data",
"will",
"be",
"stored"... | def array_to_datum(arr, label=None):
"""Converts a 3-dimensional array to datum. If the array has dtype uint8,
the output data will be encoded as a string. Otherwise, the output data
will be stored in float format.
"""
datum = caffe_pb2.Datum()
if arr.ndim != 3:
datum.shape = arr.shape
... | [
"def",
"array_to_datum",
"(",
"arr",
",",
"label",
"=",
"None",
")",
":",
"datum",
"=",
"caffe_pb2",
".",
"Datum",
"(",
")",
"if",
"arr",
".",
"ndim",
"!=",
"3",
":",
"datum",
".",
"shape",
"=",
"arr",
".",
"shape",
"else",
":",
"datum",
".",
"ch... | https://github.com/gnina/gnina/blob/b9ae032f52fc7a8153987bde09c0efa3620d8bb6/caffe/python/caffe/io.py#L66-L82 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/pdb.py | python | Pdb.do_up | (self, arg) | u(p) [count]
Move the current frame count (default one) levels up in the
stack trace (to an older frame). | u(p) [count]
Move the current frame count (default one) levels up in the
stack trace (to an older frame). | [
"u",
"(",
"p",
")",
"[",
"count",
"]",
"Move",
"the",
"current",
"frame",
"count",
"(",
"default",
"one",
")",
"levels",
"up",
"in",
"the",
"stack",
"trace",
"(",
"to",
"an",
"older",
"frame",
")",
"."
] | def do_up(self, arg):
"""u(p) [count]
Move the current frame count (default one) levels up in the
stack trace (to an older frame).
"""
if self.curindex == 0:
self.error('Oldest frame')
return
try:
count = int(arg or 1)
except Va... | [
"def",
"do_up",
"(",
"self",
",",
"arg",
")",
":",
"if",
"self",
".",
"curindex",
"==",
"0",
":",
"self",
".",
"error",
"(",
"'Oldest frame'",
")",
"return",
"try",
":",
"count",
"=",
"int",
"(",
"arg",
"or",
"1",
")",
"except",
"ValueError",
":",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/pdb.py#L930-L947 | ||
stellar-deprecated/stellard | 67eabb2217bdfa9a6ea317f62338fb6bca458c90 | src/protobuf/python/google/protobuf/text_format.py | python | _Tokenizer.ConsumeFloat | (self) | return result | Consumes an floating point number.
Returns:
The number parsed.
Raises:
ParseError: If a floating point number couldn't be consumed. | Consumes an floating point number. | [
"Consumes",
"an",
"floating",
"point",
"number",
"."
] | def ConsumeFloat(self):
"""Consumes an floating point number.
Returns:
The number parsed.
Raises:
ParseError: If a floating point number couldn't be consumed.
"""
try:
result = ParseFloat(self.token)
except ValueError, e:
raise self._ParseError(str(e))
self.NextToke... | [
"def",
"ConsumeFloat",
"(",
"self",
")",
":",
"try",
":",
"result",
"=",
"ParseFloat",
"(",
"self",
".",
"token",
")",
"except",
"ValueError",
",",
"e",
":",
"raise",
"self",
".",
"_ParseError",
"(",
"str",
"(",
"e",
")",
")",
"self",
".",
"NextToken... | https://github.com/stellar-deprecated/stellard/blob/67eabb2217bdfa9a6ea317f62338fb6bca458c90/src/protobuf/python/google/protobuf/text_format.py#L459-L473 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | PropertyGridManager.IsPropertySelected | (*args, **kwargs) | return _propgrid.PropertyGridManager_IsPropertySelected(*args, **kwargs) | IsPropertySelected(self, PGPropArg id) -> bool | IsPropertySelected(self, PGPropArg id) -> bool | [
"IsPropertySelected",
"(",
"self",
"PGPropArg",
"id",
")",
"-",
">",
"bool"
] | def IsPropertySelected(*args, **kwargs):
"""IsPropertySelected(self, PGPropArg id) -> bool"""
return _propgrid.PropertyGridManager_IsPropertySelected(*args, **kwargs) | [
"def",
"IsPropertySelected",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridManager_IsPropertySelected",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L3546-L3548 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | MimeTypesManager.Unassociate | (*args, **kwargs) | return _misc_.MimeTypesManager_Unassociate(*args, **kwargs) | Unassociate(self, FileType ft) -> bool | Unassociate(self, FileType ft) -> bool | [
"Unassociate",
"(",
"self",
"FileType",
"ft",
")",
"-",
">",
"bool"
] | def Unassociate(*args, **kwargs):
"""Unassociate(self, FileType ft) -> bool"""
return _misc_.MimeTypesManager_Unassociate(*args, **kwargs) | [
"def",
"Unassociate",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"MimeTypesManager_Unassociate",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L2689-L2691 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/imaplib.py | python | ParseFlags | (resp) | return tuple(mo.group('flags').split()) | Convert IMAP4 flags response to python tuple. | Convert IMAP4 flags response to python tuple. | [
"Convert",
"IMAP4",
"flags",
"response",
"to",
"python",
"tuple",
"."
] | def ParseFlags(resp):
"""Convert IMAP4 flags response to python tuple."""
mo = Flags.match(resp)
if not mo:
return ()
return tuple(mo.group('flags').split()) | [
"def",
"ParseFlags",
"(",
"resp",
")",
":",
"mo",
"=",
"Flags",
".",
"match",
"(",
"resp",
")",
"if",
"not",
"mo",
":",
"return",
"(",
")",
"return",
"tuple",
"(",
"mo",
".",
"group",
"(",
"'flags'",
")",
".",
"split",
"(",
")",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/imaplib.py#L1371-L1379 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/ops.py | python | control_dependencies | (control_inputs) | Wrapper for `Graph.control_dependencies()` using the default graph.
See `tf.Graph.control_dependencies`
for more details.
When eager execution is enabled, any callable object in the `control_inputs`
list will be called.
Args:
control_inputs: A list of `Operation` or `Tensor` objects which must be
... | Wrapper for `Graph.control_dependencies()` using the default graph. | [
"Wrapper",
"for",
"Graph",
".",
"control_dependencies",
"()",
"using",
"the",
"default",
"graph",
"."
] | def control_dependencies(control_inputs):
"""Wrapper for `Graph.control_dependencies()` using the default graph.
See `tf.Graph.control_dependencies`
for more details.
When eager execution is enabled, any callable object in the `control_inputs`
list will be called.
Args:
control_inputs: A list of `Ope... | [
"def",
"control_dependencies",
"(",
"control_inputs",
")",
":",
"if",
"context",
".",
"executing_eagerly",
"(",
")",
":",
"if",
"control_inputs",
":",
"# Excute any pending callables.",
"for",
"control",
"in",
"control_inputs",
":",
"if",
"callable",
"(",
"control",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/ops.py#L5226-L5254 | ||
sigmaai/self-driving-golf-cart | 8d891600af3d851add27a10ae45cf3c2108bb87c | ros/src/ros_carla_bridge/carla_ros_bridge/src/carla_ros_bridge/communication.py | python | Communication.update_clock | (self, carla_timestamp) | perform the update of the clock
:param carla_timestamp: the current carla time
:type carla_timestamp: carla.Timestamp
:return: | perform the update of the clock | [
"perform",
"the",
"update",
"of",
"the",
"clock"
] | def update_clock(self, carla_timestamp):
"""
perform the update of the clock
:param carla_timestamp: the current carla time
:type carla_timestamp: carla.Timestamp
:return:
"""
self.ros_timestamp = rospy.Time.from_sec(
carla_timestamp.elapsed_seconds)
... | [
"def",
"update_clock",
"(",
"self",
",",
"carla_timestamp",
")",
":",
"self",
".",
"ros_timestamp",
"=",
"rospy",
".",
"Time",
".",
"from_sec",
"(",
"carla_timestamp",
".",
"elapsed_seconds",
")",
"self",
".",
"publish_message",
"(",
"'clock'",
",",
"Clock",
... | https://github.com/sigmaai/self-driving-golf-cart/blob/8d891600af3d851add27a10ae45cf3c2108bb87c/ros/src/ros_carla_bridge/carla_ros_bridge/src/carla_ros_bridge/communication.py#L91-L101 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/pimp.py | python | PimpDatabase.listnames | (self) | return rv | Return a list of names of all packages in the database. | Return a list of names of all packages in the database. | [
"Return",
"a",
"list",
"of",
"names",
"of",
"all",
"packages",
"in",
"the",
"database",
"."
] | def listnames(self):
"""Return a list of names of all packages in the database."""
rv = []
for pkg in self._packages:
rv.append(pkg.fullname())
rv.sort()
return rv | [
"def",
"listnames",
"(",
"self",
")",
":",
"rv",
"=",
"[",
"]",
"for",
"pkg",
"in",
"self",
".",
"_packages",
":",
"rv",
".",
"append",
"(",
"pkg",
".",
"fullname",
"(",
")",
")",
"rv",
".",
"sort",
"(",
")",
"return",
"rv"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/pimp.py#L443-L450 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/head.py | python | _MultiClassHead.create_model_fn_ops | (self,
features,
mode,
labels=None,
train_op_fn=None,
logits=None,
logits_input=None,
scope=None) | See `Head`. | See `Head`. | [
"See",
"Head",
"."
] | def create_model_fn_ops(self,
features,
mode,
labels=None,
train_op_fn=None,
logits=None,
logits_input=None,
scope=None):
"""See `Head... | [
"def",
"create_model_fn_ops",
"(",
"self",
",",
"features",
",",
"mode",
",",
"labels",
"=",
"None",
",",
"train_op_fn",
"=",
"None",
",",
"logits",
"=",
"None",
",",
"logits_input",
"=",
"None",
",",
"scope",
"=",
"None",
")",
":",
"with",
"variable_sco... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/head.py#L1055-L1085 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/Paste/paste/util/findpackage.py | python | find_package | (dir) | Given a directory, finds the equivalent package name. If it
is directly in sys.path, returns ''. | Given a directory, finds the equivalent package name. If it
is directly in sys.path, returns ''. | [
"Given",
"a",
"directory",
"finds",
"the",
"equivalent",
"package",
"name",
".",
"If",
"it",
"is",
"directly",
"in",
"sys",
".",
"path",
"returns",
"."
] | def find_package(dir):
"""
Given a directory, finds the equivalent package name. If it
is directly in sys.path, returns ''.
"""
dir = os.path.abspath(dir)
orig_dir = dir
path = map(os.path.abspath, sys.path)
packages = []
last_dir = None
while 1:
if dir in path:
... | [
"def",
"find_package",
"(",
"dir",
")",
":",
"dir",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"dir",
")",
"orig_dir",
"=",
"dir",
"path",
"=",
"map",
"(",
"os",
".",
"path",
".",
"abspath",
",",
"sys",
".",
"path",
")",
"packages",
"=",
"[",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/Paste/paste/util/findpackage.py#L7-L25 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/PublicKey/RSA.py | python | RsaKey.__init__ | (self, **kwargs) | Build an RSA key.
:Keywords:
n : integer
The modulus.
e : integer
The public exponent.
d : integer
The private exponent. Only required for private keys.
p : integer
The first factor of the modulus. Only required for private... | Build an RSA key. | [
"Build",
"an",
"RSA",
"key",
"."
] | def __init__(self, **kwargs):
"""Build an RSA key.
:Keywords:
n : integer
The modulus.
e : integer
The public exponent.
d : integer
The private exponent. Only required for private keys.
p : integer
The first factor ... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"input_set",
"=",
"set",
"(",
"kwargs",
".",
"keys",
"(",
")",
")",
"public_set",
"=",
"set",
"(",
"(",
"'n'",
",",
"'e'",
")",
")",
"private_set",
"=",
"public_set",
"|",
"set",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/PublicKey/RSA.py#L75-L103 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/botocore/session.py | python | Session.get_available_services | (self) | return self.get_component('data_loader')\
.list_available_services(type_name='service-2') | Return a list of names of available services. | Return a list of names of available services. | [
"Return",
"a",
"list",
"of",
"names",
"of",
"available",
"services",
"."
] | def get_available_services(self):
"""
Return a list of names of available services.
"""
return self.get_component('data_loader')\
.list_available_services(type_name='service-2') | [
"def",
"get_available_services",
"(",
"self",
")",
":",
"return",
"self",
".",
"get_component",
"(",
"'data_loader'",
")",
".",
"list_available_services",
"(",
"type_name",
"=",
"'service-2'",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/session.py#L565-L570 | |
sonyxperiadev/WebGL | 0299b38196f78c6d5f74bcf6fa312a3daee6de60 | Tools/Scripts/webkitpy/style/checkers/cpp.py | python | _rfind_in_lines | (regex, lines, start_position, not_found_position) | Does a reverse find starting at start position and going backwards until
a match is found.
Returns the position where the regex ended. | Does a reverse find starting at start position and going backwards until
a match is found. | [
"Does",
"a",
"reverse",
"find",
"starting",
"at",
"start",
"position",
"and",
"going",
"backwards",
"until",
"a",
"match",
"is",
"found",
"."
] | def _rfind_in_lines(regex, lines, start_position, not_found_position):
"""Does a reverse find starting at start position and going backwards until
a match is found.
Returns the position where the regex ended.
"""
# Put the regex in a group and proceed it with a greedy expression that
# matches ... | [
"def",
"_rfind_in_lines",
"(",
"regex",
",",
"lines",
",",
"start_position",
",",
"not_found_position",
")",
":",
"# Put the regex in a group and proceed it with a greedy expression that",
"# matches anything to ensure that we get the last possible match in a line.",
"last_in_line_regex"... | https://github.com/sonyxperiadev/WebGL/blob/0299b38196f78c6d5f74bcf6fa312a3daee6de60/Tools/Scripts/webkitpy/style/checkers/cpp.py#L197-L219 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBDebugger.SetTerminalWidth | (self, term_width) | return _lldb.SBDebugger_SetTerminalWidth(self, term_width) | SetTerminalWidth(SBDebugger self, uint32_t term_width) | SetTerminalWidth(SBDebugger self, uint32_t term_width) | [
"SetTerminalWidth",
"(",
"SBDebugger",
"self",
"uint32_t",
"term_width",
")"
] | def SetTerminalWidth(self, term_width):
"""SetTerminalWidth(SBDebugger self, uint32_t term_width)"""
return _lldb.SBDebugger_SetTerminalWidth(self, term_width) | [
"def",
"SetTerminalWidth",
"(",
"self",
",",
"term_width",
")",
":",
"return",
"_lldb",
".",
"SBDebugger_SetTerminalWidth",
"(",
"self",
",",
"term_width",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L4189-L4191 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | build/android/pylib/utils/report_results.py | python | _LogToFlakinessDashboard | (results, test_type, test_package,
flakiness_server) | Upload results to the flakiness dashboard | Upload results to the flakiness dashboard | [
"Upload",
"results",
"to",
"the",
"flakiness",
"dashboard"
] | def _LogToFlakinessDashboard(results, test_type, test_package,
flakiness_server):
"""Upload results to the flakiness dashboard"""
logging.info('Upload results for test type "%s", test package "%s" to %s' %
(test_type, test_package, flakiness_server))
# TODO(frankf): En... | [
"def",
"_LogToFlakinessDashboard",
"(",
"results",
",",
"test_type",
",",
"test_package",
",",
"flakiness_server",
")",
":",
"logging",
".",
"info",
"(",
"'Upload results for test type \"%s\", test package \"%s\" to %s'",
"%",
"(",
"test_type",
",",
"test_package",
",",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/pylib/utils/report_results.py#L37-L62 | ||
clementine-player/Clementine | 111379dfd027802b59125829fcf87e3e1d0ad73b | dist/cpplint.py | python | _ClassifyInclude | (fileinfo, include, is_system) | return _OTHER_HEADER | Figures out what kind of header 'include' is.
Args:
fileinfo: The current file cpplint is running over. A FileInfo instance.
include: The path to a #included file.
is_system: True if the #include used <> rather than "".
Returns:
One of the _XXX_HEADER constants.
For example:
>>> _ClassifyIn... | Figures out what kind of header 'include' is. | [
"Figures",
"out",
"what",
"kind",
"of",
"header",
"include",
"is",
"."
] | def _ClassifyInclude(fileinfo, include, is_system):
"""Figures out what kind of header 'include' is.
Args:
fileinfo: The current file cpplint is running over. A FileInfo instance.
include: The path to a #included file.
is_system: True if the #include used <> rather than "".
Returns:
One of the _... | [
"def",
"_ClassifyInclude",
"(",
"fileinfo",
",",
"include",
",",
"is_system",
")",
":",
"# This is a list of all standard c++ header files, except",
"# those already checked for above.",
"is_cpp_h",
"=",
"include",
"in",
"_CPP_HEADERS",
"if",
"is_system",
":",
"if",
"is_cpp... | https://github.com/clementine-player/Clementine/blob/111379dfd027802b59125829fcf87e3e1d0ad73b/dist/cpplint.py#L4387-L4443 | |
InsightSoftwareConsortium/ITK | 87acfce9a93d928311c38bc371b666b515b9f19d | Modules/ThirdParty/pygccxml/src/pygccxml/declarations/calldef_members.py | python | operator_t.symbol | (self) | return self.name[operator_t.OPERATOR_WORD_LEN:].strip() | operator's symbol. For example: operator+, symbol is equal to '+ | operator's symbol. For example: operator+, symbol is equal to '+ | [
"operator",
"s",
"symbol",
".",
"For",
"example",
":",
"operator",
"+",
"symbol",
"is",
"equal",
"to",
"+"
] | def symbol(self):
"""operator's symbol. For example: operator+, symbol is equal to '+'"""
return self.name[operator_t.OPERATOR_WORD_LEN:].strip() | [
"def",
"symbol",
"(",
"self",
")",
":",
"return",
"self",
".",
"name",
"[",
"operator_t",
".",
"OPERATOR_WORD_LEN",
":",
"]",
".",
"strip",
"(",
")"
] | https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Modules/ThirdParty/pygccxml/src/pygccxml/declarations/calldef_members.py#L147-L149 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/utils/hipify/hipify_python.py | python | find_bracket_group | (input_string, start) | return find_closure_group(input_string, start, group=["{", "}"]) | Finds the first balanced parantheses. | Finds the first balanced parantheses. | [
"Finds",
"the",
"first",
"balanced",
"parantheses",
"."
] | def find_bracket_group(input_string, start):
"""Finds the first balanced parantheses."""
return find_closure_group(input_string, start, group=["{", "}"]) | [
"def",
"find_bracket_group",
"(",
"input_string",
",",
"start",
")",
":",
"return",
"find_closure_group",
"(",
"input_string",
",",
"start",
",",
"group",
"=",
"[",
"\"{\"",
",",
"\"}\"",
"]",
")"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/utils/hipify/hipify_python.py#L468-L470 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/pkg_resources/_vendor/packaging/specifiers.py | python | BaseSpecifier.__ne__ | (self, other) | Returns a boolean representing whether or not the two Specifier like
objects are not equal. | Returns a boolean representing whether or not the two Specifier like
objects are not equal. | [
"Returns",
"a",
"boolean",
"representing",
"whether",
"or",
"not",
"the",
"two",
"Specifier",
"like",
"objects",
"are",
"not",
"equal",
"."
] | def __ne__(self, other):
"""
Returns a boolean representing whether or not the two Specifier like
objects are not equal.
""" | [
"def",
"__ne__",
"(",
"self",
",",
"other",
")",
":"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/pkg_resources/_vendor/packaging/specifiers.py#L44-L48 | ||
geemaple/leetcode | 68bc5032e1ee52c22ef2f2e608053484c487af54 | leetcode/86.partition-list.py | python | Solution.partition | (self, head, x) | return left_head.next | :type head: ListNode
:type x: int
:rtype: ListNode | :type head: ListNode
:type x: int
:rtype: ListNode | [
":",
"type",
"head",
":",
"ListNode",
":",
"type",
"x",
":",
"int",
":",
"rtype",
":",
"ListNode"
] | def partition(self, head, x):
"""
:type head: ListNode
:type x: int
:rtype: ListNode
"""
if head is None:
return None
left_head = ListNode(0)
left_head.next = head
right_head = ListNode(0)
left = left_head
ri... | [
"def",
"partition",
"(",
"self",
",",
"head",
",",
"x",
")",
":",
"if",
"head",
"is",
"None",
":",
"return",
"None",
"left_head",
"=",
"ListNode",
"(",
"0",
")",
"left_head",
".",
"next",
"=",
"head",
"right_head",
"=",
"ListNode",
"(",
"0",
")",
"... | https://github.com/geemaple/leetcode/blob/68bc5032e1ee52c22ef2f2e608053484c487af54/leetcode/86.partition-list.py#L8-L40 | |
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/gyp/msvs_emulation.py | python | MsvsSettings.AdjustIncludeDirs | (self, include_dirs, config) | return [self.ConvertVSMacros(p, config=config) for p in includes] | Updates include_dirs to expand VS specific paths, and adds the system
include dirs used for platform SDK and similar. | Updates include_dirs to expand VS specific paths, and adds the system
include dirs used for platform SDK and similar. | [
"Updates",
"include_dirs",
"to",
"expand",
"VS",
"specific",
"paths",
"and",
"adds",
"the",
"system",
"include",
"dirs",
"used",
"for",
"platform",
"SDK",
"and",
"similar",
"."
] | def AdjustIncludeDirs(self, include_dirs, config):
"""Updates include_dirs to expand VS specific paths, and adds the system
include dirs used for platform SDK and similar."""
config = self._TargetConfig(config)
includes = include_dirs + self.msvs_system_include_dirs[config]
includes.extend(self._Set... | [
"def",
"AdjustIncludeDirs",
"(",
"self",
",",
"include_dirs",
",",
"config",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"includes",
"=",
"include_dirs",
"+",
"self",
".",
"msvs_system_include_dirs",
"[",
"config",
"]",
"includes... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/msvs_emulation.py#L315-L321 | |
niwinz/phantompy | ae25ddb6791e13cb7c35126971c410030ee5dfda | phantompy/context.py | python | Config.set_object_cache_capacity | (self, min_dead_capacity, max_dead, total_capacity) | Set webkit object cache capacity. | Set webkit object cache capacity. | [
"Set",
"webkit",
"object",
"cache",
"capacity",
"."
] | def set_object_cache_capacity(self, min_dead_capacity, max_dead, total_capacity):
"""
Set webkit object cache capacity.
"""
lib.ph_context_set_object_cache_capacity(min_dead_capacity, max_dead, total_capacity) | [
"def",
"set_object_cache_capacity",
"(",
"self",
",",
"min_dead_capacity",
",",
"max_dead",
",",
"total_capacity",
")",
":",
"lib",
".",
"ph_context_set_object_cache_capacity",
"(",
"min_dead_capacity",
",",
"max_dead",
",",
"total_capacity",
")"
] | https://github.com/niwinz/phantompy/blob/ae25ddb6791e13cb7c35126971c410030ee5dfda/phantompy/context.py#L167-L171 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_vim.py | python | EditraCommander.EndSelection | (self) | Set the selection to start from the starting position as it was set
by StartSelection to the current caret position
It doesn't matter whether the starting position is before or after the
ending position | Set the selection to start from the starting position as it was set
by StartSelection to the current caret position | [
"Set",
"the",
"selection",
"to",
"start",
"from",
"the",
"starting",
"position",
"as",
"it",
"was",
"set",
"by",
"StartSelection",
"to",
"the",
"current",
"caret",
"position"
] | def EndSelection(self):
"""Set the selection to start from the starting position as it was set
by StartSelection to the current caret position
It doesn't matter whether the starting position is before or after the
ending position
"""
self.stc.SetSelection(self._Anchor, ... | [
"def",
"EndSelection",
"(",
"self",
")",
":",
"self",
".",
"stc",
".",
"SetSelection",
"(",
"self",
".",
"_Anchor",
",",
"self",
".",
"_GetPos",
"(",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_vim.py#L265-L273 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/gyp/pylib/gyp/generator/android.py | python | AndroidMkWriter.ComputeOutput | (self, spec) | return os.path.join(path, self.ComputeOutputBasename(spec)) | Return the 'output' (full output path) of a gyp spec.
E.g., the loadable module 'foobar' in directory 'baz' will produce
'$(obj)/baz/libfoobar.so' | Return the 'output' (full output path) of a gyp spec. | [
"Return",
"the",
"output",
"(",
"full",
"output",
"path",
")",
"of",
"a",
"gyp",
"spec",
"."
] | def ComputeOutput(self, spec):
"""Return the 'output' (full output path) of a gyp spec.
E.g., the loadable module 'foobar' in directory 'baz' will produce
'$(obj)/baz/libfoobar.so'
"""
if self.type == 'executable':
# We install host executables into shared_intermediate_dir so they can be
... | [
"def",
"ComputeOutput",
"(",
"self",
",",
"spec",
")",
":",
"if",
"self",
".",
"type",
"==",
"'executable'",
":",
"# We install host executables into shared_intermediate_dir so they can be",
"# run by gyp rules that refer to PRODUCT_DIR.",
"path",
"=",
"'$(gyp_shared_intermedia... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/generator/android.py#L664-L690 | |
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | src/bindings/python/src/compatibility/ngraph/opset1/ops.py | python | cosh | (node: NodeInput, name: Optional[str] = None) | return _get_node_factory_opset1().create("Cosh", [node]) | Apply hyperbolic cosine function on the input node element-wise.
:param node: One of: input node, array or scalar.
:param name: Optional new name for output node.
:return: New node with cosh operation applied on it. | Apply hyperbolic cosine function on the input node element-wise. | [
"Apply",
"hyperbolic",
"cosine",
"function",
"on",
"the",
"input",
"node",
"element",
"-",
"wise",
"."
] | def cosh(node: NodeInput, name: Optional[str] = None) -> Node:
"""Apply hyperbolic cosine function on the input node element-wise.
:param node: One of: input node, array or scalar.
:param name: Optional new name for output node.
:return: New node with cosh operation applied on it.
"""
return _g... | [
"def",
"cosh",
"(",
"node",
":",
"NodeInput",
",",
"name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
")",
"->",
"Node",
":",
"return",
"_get_node_factory_opset1",
"(",
")",
".",
"create",
"(",
"\"Cosh\"",
",",
"[",
"node",
"]",
")"
] | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/src/bindings/python/src/compatibility/ngraph/opset1/ops.py#L469-L476 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/genpy/src/genpy/generate_numpy.py | python | unpack_numpy | (var, count, dtype, buff) | return var + " = numpy.frombuffer(%s, dtype=%s, count=%s)"%(buff, dtype, count) | create numpy deserialization code | create numpy deserialization code | [
"create",
"numpy",
"deserialization",
"code"
] | def unpack_numpy(var, count, dtype, buff):
"""
create numpy deserialization code
"""
return var + " = numpy.frombuffer(%s, dtype=%s, count=%s)"%(buff, dtype, count) | [
"def",
"unpack_numpy",
"(",
"var",
",",
"count",
",",
"dtype",
",",
"buff",
")",
":",
"return",
"var",
"+",
"\" = numpy.frombuffer(%s, dtype=%s, count=%s)\"",
"%",
"(",
"buff",
",",
"dtype",
",",
"count",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/genpy/src/genpy/generate_numpy.py#L59-L63 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exodus3.in.py | python | exodus.put_face_count_per_polyhedra | (self, blkID, entityCounts) | return True | put in a count of faces in for each polyhedra in an elem block
>>> status = exo.put_face_count_per_polyhedra(blkID, entityCounts)
Parameters
----------
<int> blkID id of the block to be added
if array_type == 'ctype':
<list<float>> enti... | put in a count of faces in for each polyhedra in an elem block | [
"put",
"in",
"a",
"count",
"of",
"faces",
"in",
"for",
"each",
"polyhedra",
"in",
"an",
"elem",
"block"
] | def put_face_count_per_polyhedra(self, blkID, entityCounts):
"""
put in a count of faces in for each polyhedra in an elem block
>>> status = exo.put_face_count_per_polyhedra(blkID, entityCounts)
Parameters
----------
<int> blkID id of the block to ... | [
"def",
"put_face_count_per_polyhedra",
"(",
"self",
",",
"blkID",
",",
"entityCounts",
")",
":",
"ebType",
"=",
"ctypes",
".",
"c_int",
"(",
"get_entity_type",
"(",
"'EX_ELEM_BLOCK'",
")",
")",
"entity_counts",
"=",
"(",
"ctypes",
".",
"c_int",
"*",
"len",
"... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus3.in.py#L4633-L4659 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/idlelib/editor.py | python | EditorWindow.__extra_help_callback | (self, helpfile) | return display_extra_help | Create a callback with the helpfile value frozen at definition time | Create a callback with the helpfile value frozen at definition time | [
"Create",
"a",
"callback",
"with",
"the",
"helpfile",
"value",
"frozen",
"at",
"definition",
"time"
] | def __extra_help_callback(self, helpfile):
"Create a callback with the helpfile value frozen at definition time"
def display_extra_help(helpfile=helpfile):
if not helpfile.startswith(('www', 'http')):
helpfile = os.path.normpath(helpfile)
if sys.platform[:3] == 'w... | [
"def",
"__extra_help_callback",
"(",
"self",
",",
"helpfile",
")",
":",
"def",
"display_extra_help",
"(",
"helpfile",
"=",
"helpfile",
")",
":",
"if",
"not",
"helpfile",
".",
"startswith",
"(",
"(",
"'www'",
",",
"'http'",
")",
")",
":",
"helpfile",
"=",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/editor.py#L921-L934 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/sans/algorithm_detail/convert_to_q.py | python | _load_sigma_moderator_workspace | (file_name) | return convert_alg.getProperty("OutputWorkspace").value | Gets the sigma moderator workspace.
:param file_name: the file name of the sigma moderator
:returns the sigma moderator workspace | Gets the sigma moderator workspace.
:param file_name: the file name of the sigma moderator
:returns the sigma moderator workspace | [
"Gets",
"the",
"sigma",
"moderator",
"workspace",
".",
":",
"param",
"file_name",
":",
"the",
"file",
"name",
"of",
"the",
"sigma",
"moderator",
":",
"returns",
"the",
"sigma",
"moderator",
"workspace"
] | def _load_sigma_moderator_workspace(file_name):
"""
Gets the sigma moderator workspace.
:param file_name: the file name of the sigma moderator
:returns the sigma moderator workspace
"""
load_name = "LoadRKH"
load_option = {"Filename": file_name,
"OutputWorkspace": EMPTY_NA... | [
"def",
"_load_sigma_moderator_workspace",
"(",
"file_name",
")",
":",
"load_name",
"=",
"\"LoadRKH\"",
"load_option",
"=",
"{",
"\"Filename\"",
":",
"file_name",
",",
"\"OutputWorkspace\"",
":",
"EMPTY_NAME",
",",
"\"FirstColumnValue\"",
":",
"\"Wavelength\"",
"}",
"l... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/algorithm_detail/convert_to_q.py#L215-L234 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exodus2.in.py | python | exodus.set_side_set_variable_truth_table | (self, table) | return self.__ex_put_sset_var_tab(table) | status = \\
exo.set_side_set_variable_truth_table(ssvar_truth_tab)
-> stores a truth table indicating which variables are defined for
all side sets and all side set variables; variable index cycles
faster than side set index
input value(s):
<list<bool>... | status = \\
exo.set_side_set_variable_truth_table(ssvar_truth_tab) | [
"status",
"=",
"\\\\",
"exo",
".",
"set_side_set_variable_truth_table",
"(",
"ssvar_truth_tab",
")"
] | def set_side_set_variable_truth_table(self, table):
"""
status = \\
exo.set_side_set_variable_truth_table(ssvar_truth_tab)
-> stores a truth table indicating which variables are defined for
all side sets and all side set variables; variable index cycles
faste... | [
"def",
"set_side_set_variable_truth_table",
"(",
"self",
",",
"table",
")",
":",
"self",
".",
"get_side_set_ids",
"(",
")",
"numBlks",
"=",
"len",
"(",
"self",
".",
"sideSetIds",
")",
"numVars",
"=",
"int",
"(",
"self",
".",
"__ex_get_var_param",
"(",
"\"s\"... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus2.in.py#L2854-L2874 | |
alibaba/graph-learn | 54cafee9db3054dc310a28b856be7f97c7d5aee9 | graphlearn/python/nn/dataset.py | python | Dataset.iterator | (self) | return self.__iter__() | Get an iterator, which generates `Data` objects. | Get an iterator, which generates `Data` objects. | [
"Get",
"an",
"iterator",
"which",
"generates",
"Data",
"objects",
"."
] | def iterator(self):
"""Get an iterator, which generates `Data` objects.
"""
return self.__iter__() | [
"def",
"iterator",
"(",
"self",
")",
":",
"return",
"self",
".",
"__iter__",
"(",
")"
] | https://github.com/alibaba/graph-learn/blob/54cafee9db3054dc310a28b856be7f97c7d5aee9/graphlearn/python/nn/dataset.py#L67-L70 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/frame.py | python | Frame.skew | (
self, axis=None, skipna=None, level=None, numeric_only=None, **kwargs
) | return self._reduce(
"skew",
axis=axis,
skipna=skipna,
level=level,
numeric_only=numeric_only,
**kwargs,
) | Return unbiased Fisher-Pearson skew of a sample.
Parameters
----------
skipna: bool, default True
Exclude NA/null values when computing the result.
Returns
-------
Series
Notes
-----
Parameters currently not supported are `axis`, `le... | Return unbiased Fisher-Pearson skew of a sample. | [
"Return",
"unbiased",
"Fisher",
"-",
"Pearson",
"skew",
"of",
"a",
"sample",
"."
] | def skew(
self, axis=None, skipna=None, level=None, numeric_only=None, **kwargs
):
"""
Return unbiased Fisher-Pearson skew of a sample.
Parameters
----------
skipna: bool, default True
Exclude NA/null values when computing the result.
Returns
... | [
"def",
"skew",
"(",
"self",
",",
"axis",
"=",
"None",
",",
"skipna",
"=",
"None",
",",
"level",
"=",
"None",
",",
"numeric_only",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"axis",
"not",
"in",
"(",
"0",
",",
"\"index\"",
",",
"None",
... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/frame.py#L4211-L4266 | |
moai/moai-dev | 0ba7c678311d1fa9dbc091f60665e95e54169fdf | 3rdparty/libwebp-0.4.1/swig/libwebp.py | python | wrap_WebPEncodeLosslessBGR | (*args) | return _libwebp.wrap_WebPEncodeLosslessBGR(*args) | private, do not call directly. | private, do not call directly. | [
"private",
"do",
"not",
"call",
"directly",
"."
] | def wrap_WebPEncodeLosslessBGR(*args):
"""private, do not call directly."""
return _libwebp.wrap_WebPEncodeLosslessBGR(*args) | [
"def",
"wrap_WebPEncodeLosslessBGR",
"(",
"*",
"args",
")",
":",
"return",
"_libwebp",
".",
"wrap_WebPEncodeLosslessBGR",
"(",
"*",
"args",
")"
] | https://github.com/moai/moai-dev/blob/0ba7c678311d1fa9dbc091f60665e95e54169fdf/3rdparty/libwebp-0.4.1/swig/libwebp.py#L123-L125 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/py_compile.py | python | main | (args=None) | return rv | Compile several source files.
The files named in 'args' (or on the command line, if 'args' is
not specified) are compiled and the resulting bytecode is cached
in the normal manner. This function does not search a directory
structure to locate source files; it only compiles files named
explicitly. ... | Compile several source files. | [
"Compile",
"several",
"source",
"files",
"."
] | def main(args=None):
"""Compile several source files.
The files named in 'args' (or on the command line, if 'args' is
not specified) are compiled and the resulting bytecode is cached
in the normal manner. This function does not search a directory
structure to locate source files; it only compiles ... | [
"def",
"main",
"(",
"args",
"=",
"None",
")",
":",
"if",
"args",
"is",
"None",
":",
"args",
"=",
"sys",
".",
"argv",
"[",
"1",
":",
"]",
"rv",
"=",
"0",
"if",
"args",
"==",
"[",
"'-'",
"]",
":",
"while",
"True",
":",
"filename",
"=",
"sys",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/py_compile.py#L173-L209 | |
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Plugins/pvblot/blot_common.py | python | find_insensitive | (str, lst) | return None | Finds string str in list of strings lst ignoring case and spaces. If the string is
found, returns the actual value of the string. Otherwise, returns None. | Finds string str in list of strings lst ignoring case and spaces. If the string is
found, returns the actual value of the string. Otherwise, returns None. | [
"Finds",
"string",
"str",
"in",
"list",
"of",
"strings",
"lst",
"ignoring",
"case",
"and",
"spaces",
".",
"If",
"the",
"string",
"is",
"found",
"returns",
"the",
"actual",
"value",
"of",
"the",
"string",
".",
"Otherwise",
"returns",
"None",
"."
] | def find_insensitive(str, lst):
"""
Finds string str in list of strings lst ignoring case and spaces. If the string is
found, returns the actual value of the string. Otherwise, returns None.
"""
str = str.upper().replace(" ", "")
for entry in lst:
if entry.upper().replace(" ", "") == s... | [
"def",
"find_insensitive",
"(",
"str",
",",
"lst",
")",
":",
"str",
"=",
"str",
".",
"upper",
"(",
")",
".",
"replace",
"(",
"\" \"",
",",
"\"\"",
")",
"for",
"entry",
"in",
"lst",
":",
"if",
"entry",
".",
"upper",
"(",
")",
".",
"replace",
"(",
... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Plugins/pvblot/blot_common.py#L94-L103 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/smtplib.py | python | SMTP.set_debuglevel | (self, debuglevel) | Set the debug output level.
A non-false value results in debug messages for connection and for all
messages sent to and received from the server. | Set the debug output level. | [
"Set",
"the",
"debug",
"output",
"level",
"."
] | def set_debuglevel(self, debuglevel):
"""Set the debug output level.
A non-false value results in debug messages for connection and for all
messages sent to and received from the server.
"""
self.debuglevel = debuglevel | [
"def",
"set_debuglevel",
"(",
"self",
",",
"debuglevel",
")",
":",
"self",
".",
"debuglevel",
"=",
"debuglevel"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/smtplib.py#L271-L278 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pythonwin/pywin/framework/scriptutils.py | python | GetActiveFileName | (bAutoSave = 1) | return pathName | Gets the file name for the active frame, saving it if necessary.
Returns None if it cant be found, or raises KeyboardInterrupt. | Gets the file name for the active frame, saving it if necessary.
Returns None if it cant be found, or raises KeyboardInterrupt. | [
"Gets",
"the",
"file",
"name",
"for",
"the",
"active",
"frame",
"saving",
"it",
"if",
"necessary",
".",
"Returns",
"None",
"if",
"it",
"cant",
"be",
"found",
"or",
"raises",
"KeyboardInterrupt",
"."
] | def GetActiveFileName(bAutoSave = 1):
"""Gets the file name for the active frame, saving it if necessary.
Returns None if it cant be found, or raises KeyboardInterrupt.
"""
pathName = None
active = GetActiveView()
if active is None:
return None
try:
doc = active.GetDocument()
pathName = doc.GetPathName()... | [
"def",
"GetActiveFileName",
"(",
"bAutoSave",
"=",
"1",
")",
":",
"pathName",
"=",
"None",
"active",
"=",
"GetActiveView",
"(",
")",
"if",
"active",
"is",
"None",
":",
"return",
"None",
"try",
":",
"doc",
"=",
"active",
".",
"GetDocument",
"(",
")",
"p... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pythonwin/pywin/framework/scriptutils.py#L151-L183 | |
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | lldb/examples/python/jump.py | python | parse_linespec | (linespec, frame, result) | return addr_list | Handles a subset of GDB-style linespecs. Specifically:
number - A line in the current file
+offset - The line /offset/ lines after this line
-offset - The line /offset/ lines before this line
filename:number - Line /number/ in file /filename/
function ... | Handles a subset of GDB-style linespecs. Specifically: | [
"Handles",
"a",
"subset",
"of",
"GDB",
"-",
"style",
"linespecs",
".",
"Specifically",
":"
] | def parse_linespec(linespec, frame, result):
"""Handles a subset of GDB-style linespecs. Specifically:
number - A line in the current file
+offset - The line /offset/ lines after this line
-offset - The line /offset/ lines before this line
filename:number -... | [
"def",
"parse_linespec",
"(",
"linespec",
",",
"frame",
",",
"result",
")",
":",
"breakpoint",
"=",
"None",
"target",
"=",
"frame",
".",
"GetThread",
"(",
")",
".",
"GetProcess",
"(",
")",
".",
"GetTarget",
"(",
")",
"matched",
"=",
"False",
"if",
"(",... | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/examples/python/jump.py#L7-L104 | |
epiqc/ScaffCC | 66a79944ee4cd116b27bc1a69137276885461db8 | llvm/utils/Reviewing/find_interesting_reviews.py | python | PhabObjectCache.populate_cache_from_disk | (self, directory=DEFAULT_DIRECTORY) | FIXME: consider if serializing to JSON would bring interoperability
advantages over serializing to pickle. | FIXME: consider if serializing to JSON would bring interoperability
advantages over serializing to pickle. | [
"FIXME",
":",
"consider",
"if",
"serializing",
"to",
"JSON",
"would",
"bring",
"interoperability",
"advantages",
"over",
"serializing",
"to",
"pickle",
"."
] | def populate_cache_from_disk(self, directory=DEFAULT_DIRECTORY):
"""
FIXME: consider if serializing to JSON would bring interoperability
advantages over serializing to pickle.
"""
try:
f = open(self._get_pickle_name(directory), "rb")
except IOError as err:
... | [
"def",
"populate_cache_from_disk",
"(",
"self",
",",
"directory",
"=",
"DEFAULT_DIRECTORY",
")",
":",
"try",
":",
"f",
"=",
"open",
"(",
"self",
".",
"_get_pickle_name",
"(",
"directory",
")",
",",
"\"rb\"",
")",
"except",
"IOError",
"as",
"err",
":",
"pri... | https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/llvm/utils/Reviewing/find_interesting_reviews.py#L67-L84 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | build/android/pylib/flag_changer.py | python | FlagChanger.AddFlags | (self, flags) | Appends flags to the command line if they aren't already there.
Args:
flags: A list of flags to add on, eg. ['--single-process']. | Appends flags to the command line if they aren't already there. | [
"Appends",
"flags",
"to",
"the",
"command",
"line",
"if",
"they",
"aren",
"t",
"already",
"there",
"."
] | def AddFlags(self, flags):
"""Appends flags to the command line if they aren't already there.
Args:
flags: A list of flags to add on, eg. ['--single-process'].
"""
if flags:
assert flags[0] != 'chrome'
# Avoid appending flags that are already present.
for flag in flags:
if fl... | [
"def",
"AddFlags",
"(",
"self",
",",
"flags",
")",
":",
"if",
"flags",
":",
"assert",
"flags",
"[",
"0",
"]",
"!=",
"'chrome'",
"# Avoid appending flags that are already present.",
"for",
"flag",
"in",
"flags",
":",
"if",
"flag",
"not",
"in",
"self",
".",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/pylib/flag_changer.py#L54-L67 | ||
google/perfetto | fe68c7a7f7657aa71ced68efb126dcac4107c745 | infra/ci/worker/worker.py | python | try_acquire_job | (job_id) | Transactionally acquire the given job.
Returns the job JSON object if it managed to acquire and put it into the
STARTED state, None if another worker got there first. | Transactionally acquire the given job. | [
"Transactionally",
"acquire",
"the",
"given",
"job",
"."
] | def try_acquire_job(job_id):
''' Transactionally acquire the given job.
Returns the job JSON object if it managed to acquire and put it into the
STARTED state, None if another worker got there first.
'''
logging.debug('Trying to acquire job %s', job_id)
uri = '%s/jobs/%s.json' % (DB, job_id)
job, etag =... | [
"def",
"try_acquire_job",
"(",
"job_id",
")",
":",
"logging",
".",
"debug",
"(",
"'Trying to acquire job %s'",
",",
"job_id",
")",
"uri",
"=",
"'%s/jobs/%s.json'",
"%",
"(",
"DB",
",",
"job_id",
")",
"job",
",",
"etag",
"=",
"req",
"(",
"'GET'",
",",
"ur... | https://github.com/google/perfetto/blob/fe68c7a7f7657aa71ced68efb126dcac4107c745/infra/ci/worker/worker.py#L42-L61 | ||
ArduPilot/ardupilot | 6e684b3496122b8158ac412b609d00004b7ac306 | Tools/scripts/build_binaries.py | python | build_binaries.build_AP_Periph | (self, tag) | build AP_Periph binaries | build AP_Periph binaries | [
"build",
"AP_Periph",
"binaries"
] | def build_AP_Periph(self, tag):
'''build AP_Periph binaries'''
boards = self.AP_Periph_boards()
self.build_vehicle(tag,
"AP_Periph",
boards,
"AP_Periph",
"AP_Periph") | [
"def",
"build_AP_Periph",
"(",
"self",
",",
"tag",
")",
":",
"boards",
"=",
"self",
".",
"AP_Periph_boards",
"(",
")",
"self",
".",
"build_vehicle",
"(",
"tag",
",",
"\"AP_Periph\"",
",",
"boards",
",",
"\"AP_Periph\"",
",",
"\"AP_Periph\"",
")"
] | https://github.com/ArduPilot/ardupilot/blob/6e684b3496122b8158ac412b609d00004b7ac306/Tools/scripts/build_binaries.py#L576-L583 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/arraypad.py | python | _view_roi | (array, original_area_slice, axis) | return array[sl] | Get a view of the current region of interest during iterative padding.
When padding multiple dimensions iteratively corner values are
unnecessarily overwritten multiple times. This function reduces the
working area for the first dimensions so that corners are excluded.
Parameters
----------
ar... | Get a view of the current region of interest during iterative padding. | [
"Get",
"a",
"view",
"of",
"the",
"current",
"region",
"of",
"interest",
"during",
"iterative",
"padding",
"."
] | def _view_roi(array, original_area_slice, axis):
"""
Get a view of the current region of interest during iterative padding.
When padding multiple dimensions iteratively corner values are
unnecessarily overwritten multiple times. This function reduces the
working area for the first dimensions so tha... | [
"def",
"_view_roi",
"(",
"array",
",",
"original_area_slice",
",",
"axis",
")",
":",
"axis",
"+=",
"1",
"sl",
"=",
"(",
"slice",
"(",
"None",
")",
",",
")",
"*",
"axis",
"+",
"original_area_slice",
"[",
"axis",
":",
"]",
"return",
"array",
"[",
"sl",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/arraypad.py#L60-L85 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | Dialog.IsModal | (*args, **kwargs) | return _windows_.Dialog_IsModal(*args, **kwargs) | IsModal(self) -> bool | IsModal(self) -> bool | [
"IsModal",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsModal(*args, **kwargs):
"""IsModal(self) -> bool"""
return _windows_.Dialog_IsModal(*args, **kwargs) | [
"def",
"IsModal",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"Dialog_IsModal",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L799-L801 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextBuffer.InsertParagraphsWithUndo | (*args, **kwargs) | return _richtext.RichTextBuffer_InsertParagraphsWithUndo(*args, **kwargs) | InsertParagraphsWithUndo(self, long pos, RichTextParagraphLayoutBox paragraphs, RichTextCtrl ctrl,
int flags=0) -> bool | InsertParagraphsWithUndo(self, long pos, RichTextParagraphLayoutBox paragraphs, RichTextCtrl ctrl,
int flags=0) -> bool | [
"InsertParagraphsWithUndo",
"(",
"self",
"long",
"pos",
"RichTextParagraphLayoutBox",
"paragraphs",
"RichTextCtrl",
"ctrl",
"int",
"flags",
"=",
"0",
")",
"-",
">",
"bool"
] | def InsertParagraphsWithUndo(*args, **kwargs):
"""
InsertParagraphsWithUndo(self, long pos, RichTextParagraphLayoutBox paragraphs, RichTextCtrl ctrl,
int flags=0) -> bool
"""
return _richtext.RichTextBuffer_InsertParagraphsWithUndo(*args, **kwargs) | [
"def",
"InsertParagraphsWithUndo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBuffer_InsertParagraphsWithUndo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L2503-L2508 | |
nvdla/sw | 79538ba1b52b040a4a4645f630e457fa01839e90 | umd/external/protobuf-2.6/python/google/protobuf/internal/encoder.py | python | MessageSizer | (field_number, is_repeated, is_packed) | Returns a sizer for a message field. | Returns a sizer for a message field. | [
"Returns",
"a",
"sizer",
"for",
"a",
"message",
"field",
"."
] | def MessageSizer(field_number, is_repeated, is_packed):
"""Returns a sizer for a message field."""
tag_size = _TagSize(field_number)
local_VarintSize = _VarintSize
assert not is_packed
if is_repeated:
def RepeatedFieldSize(value):
result = tag_size * len(value)
for element in value:
l... | [
"def",
"MessageSizer",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
")",
":",
"tag_size",
"=",
"_TagSize",
"(",
"field_number",
")",
"local_VarintSize",
"=",
"_VarintSize",
"assert",
"not",
"is_packed",
"if",
"is_repeated",
":",
"def",
"RepeatedField... | https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/google/protobuf/internal/encoder.py#L295-L313 | ||
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Tool/rpmutils.py | python | updateRpmDicts | (rpmrc, pyfile) | Read the given rpmrc file with RPM definitions and update the
info dictionaries in the file pyfile with it.
The arguments will usually be 'rpmrc.in' from a recent RPM source
tree, and 'rpmutils.py' referring to this script itself.
See also usage() below. | Read the given rpmrc file with RPM definitions and update the
info dictionaries in the file pyfile with it.
The arguments will usually be 'rpmrc.in' from a recent RPM source
tree, and 'rpmutils.py' referring to this script itself.
See also usage() below. | [
"Read",
"the",
"given",
"rpmrc",
"file",
"with",
"RPM",
"definitions",
"and",
"update",
"the",
"info",
"dictionaries",
"in",
"the",
"file",
"pyfile",
"with",
"it",
".",
"The",
"arguments",
"will",
"usually",
"be",
"rpmrc",
".",
"in",
"from",
"a",
"recent",... | def updateRpmDicts(rpmrc, pyfile):
""" Read the given rpmrc file with RPM definitions and update the
info dictionaries in the file pyfile with it.
The arguments will usually be 'rpmrc.in' from a recent RPM source
tree, and 'rpmutils.py' referring to this script itself.
See also usage... | [
"def",
"updateRpmDicts",
"(",
"rpmrc",
",",
"pyfile",
")",
":",
"try",
":",
"# Read old rpmutils.py file",
"with",
"open",
"(",
"pyfile",
",",
"\"r\"",
")",
"as",
"f",
":",
"oldpy",
"=",
"f",
".",
"readlines",
"(",
")",
"# Read current rpmrc.in file",
"with"... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Tool/rpmutils.py#L474-L532 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/web-page-replay/dnsproxy.py | python | PrivateIpFilter.__init__ | (self, real_dns_lookup, http_archive) | Initialize PrivateIpDnsLookup.
Args:
real_dns_lookup: a function that resolves a host to an IP.
http_archive: an instance of a HttpArchive
Hosts is in the archive will always resolve to the web_proxy_ip | Initialize PrivateIpDnsLookup. | [
"Initialize",
"PrivateIpDnsLookup",
"."
] | def __init__(self, real_dns_lookup, http_archive):
"""Initialize PrivateIpDnsLookup.
Args:
real_dns_lookup: a function that resolves a host to an IP.
http_archive: an instance of a HttpArchive
Hosts is in the archive will always resolve to the web_proxy_ip
"""
self.real_dns_lookup =... | [
"def",
"__init__",
"(",
"self",
",",
"real_dns_lookup",
",",
"http_archive",
")",
":",
"self",
".",
"real_dns_lookup",
"=",
"real_dns_lookup",
"self",
".",
"http_archive",
"=",
"http_archive",
"self",
".",
"InitializeArchiveHosts",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/dnsproxy.py#L118-L128 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/distribute/step_fn.py | python | Step.__call__ | (self) | Perform one step of this training algorithm. | Perform one step of this training algorithm. | [
"Perform",
"one",
"step",
"of",
"this",
"training",
"algorithm",
"."
] | def __call__(self):
"""Perform one step of this training algorithm."""
raise NotImplementedError("must be implemented in descendants") | [
"def",
"__call__",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"must be implemented in descendants\"",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/step_fn.py#L34-L36 | ||
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | src/arch/isa_parser/isa_parser.py | python | ISAParser.p_nonpositional_param_list_0 | (self, t) | nonpositional_param_list : keyword_param_list COMMA excess_args_param | nonpositional_param_list : keyword_param_list COMMA excess_args_param | [
"nonpositional_param_list",
":",
"keyword_param_list",
"COMMA",
"excess_args_param"
] | def p_nonpositional_param_list_0(self, t):
'nonpositional_param_list : keyword_param_list COMMA excess_args_param'
t[0] = t[1] + t[3] | [
"def",
"p_nonpositional_param_list_0",
"(",
"self",
",",
"t",
")",
":",
"t",
"[",
"0",
"]",
"=",
"t",
"[",
"1",
"]",
"+",
"t",
"[",
"3",
"]"
] | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/arch/isa_parser/isa_parser.py#L1123-L1125 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | FileCtrl.SetPath | (*args, **kwargs) | return _controls_.FileCtrl_SetPath(*args, **kwargs) | SetPath(self, String path) -> bool | SetPath(self, String path) -> bool | [
"SetPath",
"(",
"self",
"String",
"path",
")",
"-",
">",
"bool"
] | def SetPath(*args, **kwargs):
"""SetPath(self, String path) -> bool"""
return _controls_.FileCtrl_SetPath(*args, **kwargs) | [
"def",
"SetPath",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"FileCtrl_SetPath",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L7671-L7673 | |
wenwei202/caffe | f54a74abaf6951d8485cbdcfa1d74a4c37839466 | scripts/cpp_lint.py | python | GetLineWidth | (line) | Determines the width of the line in column positions.
Args:
line: A string, which may be a Unicode string.
Returns:
The width of the line in column positions, accounting for Unicode
combining characters and wide characters. | Determines the width of the line in column positions. | [
"Determines",
"the",
"width",
"of",
"the",
"line",
"in",
"column",
"positions",
"."
] | def GetLineWidth(line):
"""Determines the width of the line in column positions.
Args:
line: A string, which may be a Unicode string.
Returns:
The width of the line in column positions, accounting for Unicode
combining characters and wide characters.
"""
if isinstance(line, unicode):
width =... | [
"def",
"GetLineWidth",
"(",
"line",
")",
":",
"if",
"isinstance",
"(",
"line",
",",
"unicode",
")",
":",
"width",
"=",
"0",
"for",
"uc",
"in",
"unicodedata",
".",
"normalize",
"(",
"'NFC'",
",",
"line",
")",
":",
"if",
"unicodedata",
".",
"east_asian_w... | https://github.com/wenwei202/caffe/blob/f54a74abaf6951d8485cbdcfa1d74a4c37839466/scripts/cpp_lint.py#L3437-L3456 | ||
SIPp/sipp | f44d0cf5dec0013eff8fd7b4da885d455aa82e0e | cpplint.py | python | CheckAltTokens | (filename, clean_lines, linenum, error) | Check alternative keywords being used in boolean expressions.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Check alternative keywords being used in boolean expressions. | [
"Check",
"alternative",
"keywords",
"being",
"used",
"in",
"boolean",
"expressions",
"."
] | def CheckAltTokens(filename, clean_lines, linenum, error):
"""Check alternative keywords being used in boolean expressions.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call ... | [
"def",
"CheckAltTokens",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# Avoid preprocessor lines",
"if",
"Match",
"(",
"r'^\\s*#'",
",",
"line",
")",
":",
"retur... | https://github.com/SIPp/sipp/blob/f44d0cf5dec0013eff8fd7b4da885d455aa82e0e/cpplint.py#L2738-L2767 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/site_scons/libdeps.py | python | __get_syslibdeps | (node) | return getattr(node.attributes, cached_var_name) | Given a SCons Node, return its system library dependencies.
These are the depencencies listed with SYSLIBDEPS, and are linked using -l. | Given a SCons Node, return its system library dependencies. | [
"Given",
"a",
"SCons",
"Node",
"return",
"its",
"system",
"library",
"dependencies",
"."
] | def __get_syslibdeps(node):
""" Given a SCons Node, return its system library dependencies.
These are the depencencies listed with SYSLIBDEPS, and are linked using -l.
"""
cached_var_name = syslibdeps_env_var + '_cached'
if not hasattr(node.attributes, cached_var_name):
syslibdeps = node.ge... | [
"def",
"__get_syslibdeps",
"(",
"node",
")",
":",
"cached_var_name",
"=",
"syslibdeps_env_var",
"+",
"'_cached'",
"if",
"not",
"hasattr",
"(",
"node",
".",
"attributes",
",",
"cached_var_name",
")",
":",
"syslibdeps",
"=",
"node",
".",
"get_env",
"(",
")",
"... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/site_scons/libdeps.py#L142-L161 | |
CaoWGG/TensorRT-YOLOv4 | 4d7c2edce99e8794a4cb4ea3540d51ce91158a36 | onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py | python | TranslationUnit.get_includes | (self) | return iter(includes) | Return an iterable sequence of FileInclusion objects that describe the
sequence of inclusions in a translation unit. The first object in
this sequence is always the input file. Note that this method will not
recursively iterate over header files included through precompiled
headers. | Return an iterable sequence of FileInclusion objects that describe the
sequence of inclusions in a translation unit. The first object in
this sequence is always the input file. Note that this method will not
recursively iterate over header files included through precompiled
headers. | [
"Return",
"an",
"iterable",
"sequence",
"of",
"FileInclusion",
"objects",
"that",
"describe",
"the",
"sequence",
"of",
"inclusions",
"in",
"a",
"translation",
"unit",
".",
"The",
"first",
"object",
"in",
"this",
"sequence",
"is",
"always",
"the",
"input",
"fil... | def get_includes(self):
"""
Return an iterable sequence of FileInclusion objects that describe the
sequence of inclusions in a translation unit. The first object in
this sequence is always the input file. Note that this method will not
recursively iterate over header files includ... | [
"def",
"get_includes",
"(",
"self",
")",
":",
"def",
"visitor",
"(",
"fobj",
",",
"lptr",
",",
"depth",
",",
"includes",
")",
":",
"if",
"depth",
">",
"0",
":",
"loc",
"=",
"lptr",
".",
"contents",
"includes",
".",
"append",
"(",
"FileInclusion",
"("... | https://github.com/CaoWGG/TensorRT-YOLOv4/blob/4d7c2edce99e8794a4cb4ea3540d51ce91158a36/onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py#L2585-L2603 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/platform/tf_logging.py | python | _GetNextLogCountPerToken | (token) | return _log_counter_per_token[token] | Wrapper for _log_counter_per_token.
Args:
token: The token for which to look up the count.
Returns:
The number of times this function has been called with
*token* as an argument (starting at 0) | Wrapper for _log_counter_per_token. | [
"Wrapper",
"for",
"_log_counter_per_token",
"."
] | def _GetNextLogCountPerToken(token):
"""Wrapper for _log_counter_per_token.
Args:
token: The token for which to look up the count.
Returns:
The number of times this function has been called with
*token* as an argument (starting at 0)
"""
global _log_counter_per_token # pylint: disable=global-va... | [
"def",
"_GetNextLogCountPerToken",
"(",
"token",
")",
":",
"global",
"_log_counter_per_token",
"# pylint: disable=global-variable-not-assigned",
"_log_counter_per_token",
"[",
"token",
"]",
"=",
"1",
"+",
"_log_counter_per_token",
".",
"get",
"(",
"token",
",",
"-",
"1"... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/platform/tf_logging.py#L124-L136 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/specs/python/summaries.py | python | _combine_filter | (x) | A filter for combining successive layers with similar names. | A filter for combining successive layers with similar names. | [
"A",
"filter",
"for",
"combining",
"successive",
"layers",
"with",
"similar",
"names",
"."
] | def _combine_filter(x):
"""A filter for combining successive layers with similar names."""
last_name = None
last_total = 0
last_shape = None
for name, total, shape in x:
name = re.sub("/.*", "", name)
if name == last_name:
last_total += total
continue
if last_name is not None:
yi... | [
"def",
"_combine_filter",
"(",
"x",
")",
":",
"last_name",
"=",
"None",
"last_total",
"=",
"0",
"last_shape",
"=",
"None",
"for",
"name",
",",
"total",
",",
"shape",
"in",
"x",
":",
"name",
"=",
"re",
".",
"sub",
"(",
"\"/.*\"",
",",
"\"\"",
",",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/specs/python/summaries.py#L210-L226 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/traci/_routeprobe.py | python | RouteProbeDomain.getEdgeID | (self, probeID) | return self._getUniversal(tc.VAR_ROAD_ID, probeID) | getEdgeID(string) -> string
Returns the edge id of the given route probe | getEdgeID(string) -> string
Returns the edge id of the given route probe | [
"getEdgeID",
"(",
"string",
")",
"-",
">",
"string",
"Returns",
"the",
"edge",
"id",
"of",
"the",
"given",
"route",
"probe"
] | def getEdgeID(self, probeID):
"""getEdgeID(string) -> string
Returns the edge id of the given route probe
"""
return self._getUniversal(tc.VAR_ROAD_ID, probeID) | [
"def",
"getEdgeID",
"(",
"self",
",",
"probeID",
")",
":",
"return",
"self",
".",
"_getUniversal",
"(",
"tc",
".",
"VAR_ROAD_ID",
",",
"probeID",
")"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_routeprobe.py#L31-L35 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/gyp/pylib/gyp/MSVSSettings.py | python | _Type.ValidateMSBuild | (self, value) | Verifies that the value is legal for MSBuild.
Args:
value: the value to check for this type.
Raises:
ValueError if value is not valid for MSBuild. | Verifies that the value is legal for MSBuild. | [
"Verifies",
"that",
"the",
"value",
"is",
"legal",
"for",
"MSBuild",
"."
] | def ValidateMSBuild(self, value):
"""Verifies that the value is legal for MSBuild.
Args:
value: the value to check for this type.
Raises:
ValueError if value is not valid for MSBuild.
""" | [
"def",
"ValidateMSBuild",
"(",
"self",
",",
"value",
")",
":"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/MSVSSettings.py#L84-L92 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/plotting/_matplotlib/timeseries.py | python | format_dateaxis | (subplot, freq, index) | Pretty-formats the date axis (x-axis).
Major and minor ticks are automatically set for the frequency of the
current underlying series. As the dynamic mode is activated by
default, changing the limits of the x axis will intelligently change
the positions of the ticks. | Pretty-formats the date axis (x-axis). | [
"Pretty",
"-",
"formats",
"the",
"date",
"axis",
"(",
"x",
"-",
"axis",
")",
"."
] | def format_dateaxis(subplot, freq, index):
"""
Pretty-formats the date axis (x-axis).
Major and minor ticks are automatically set for the frequency of the
current underlying series. As the dynamic mode is activated by
default, changing the limits of the x axis will intelligently change
the pos... | [
"def",
"format_dateaxis",
"(",
"subplot",
",",
"freq",
",",
"index",
")",
":",
"from",
"matplotlib",
"import",
"pylab",
"# handle index specific formatting",
"# Note: DatetimeIndex does not use this",
"# interface. DatetimeIndex uses matplotlib.date directly",
"if",
"isinstance",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/plotting/_matplotlib/timeseries.py#L269-L311 | ||
Caffe-MPI/Caffe-MPI.github.io | df5992af571a2a19981b69635115c393f18d1c76 | scripts/cpp_lint.py | python | ReverseCloseExpression | (clean_lines, linenum, pos) | return (line, 0, -1) | If input points to ) or } or ] or >, finds the position that opens it.
If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the
linenum/pos that correspond to the opening of the expression.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to ... | If input points to ) or } or ] or >, finds the position that opens it. | [
"If",
"input",
"points",
"to",
")",
"or",
"}",
"or",
"]",
"or",
">",
"finds",
"the",
"position",
"that",
"opens",
"it",
"."
] | def ReverseCloseExpression(clean_lines, linenum, pos):
"""If input points to ) or } or ] or >, finds the position that opens it.
If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the
linenum/pos that correspond to the opening of the expression.
Args:
clean_lines: A CleansedLines instance ... | [
"def",
"ReverseCloseExpression",
"(",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"endchar",
"=",
"line",
"[",
"pos",
"]",
"if",
"endchar",
"not",
"in",
"')}]>'",
":",
"return",
"("... | https://github.com/Caffe-MPI/Caffe-MPI.github.io/blob/df5992af571a2a19981b69635115c393f18d1c76/scripts/cpp_lint.py#L1327-L1369 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/decimal.py | python | _convert_other | (other, raiseit=False, allow_float=False) | return NotImplemented | Convert other to Decimal.
Verifies that it's ok to use in an implicit construction.
If allow_float is true, allow conversion from float; this
is used in the comparison methods (__eq__ and friends). | Convert other to Decimal. | [
"Convert",
"other",
"to",
"Decimal",
"."
] | def _convert_other(other, raiseit=False, allow_float=False):
"""Convert other to Decimal.
Verifies that it's ok to use in an implicit construction.
If allow_float is true, allow conversion from float; this
is used in the comparison methods (__eq__ and friends).
"""
if isinstance(other, Decima... | [
"def",
"_convert_other",
"(",
"other",
",",
"raiseit",
"=",
"False",
",",
"allow_float",
"=",
"False",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"Decimal",
")",
":",
"return",
"other",
"if",
"isinstance",
"(",
"other",
",",
"(",
"int",
",",
"lon... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/decimal.py#L5835-L5852 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pyparsing/py3/pyparsing/core.py | python | trace_parse_action | (f: ParseAction) | return z | Decorator for debugging parse actions.
When the parse action is called, this decorator will print
``">> entering method-name(line:<current_source_line>, <parse_location>, <matched_tokens>)"``.
When the parse action completes, the decorator will print
``"<<"`` followed by the returned value, or any exce... | Decorator for debugging parse actions. | [
"Decorator",
"for",
"debugging",
"parse",
"actions",
"."
] | def trace_parse_action(f: ParseAction) -> ParseAction:
"""Decorator for debugging parse actions.
When the parse action is called, this decorator will print
``">> entering method-name(line:<current_source_line>, <parse_location>, <matched_tokens>)"``.
When the parse action completes, the decorator will ... | [
"def",
"trace_parse_action",
"(",
"f",
":",
"ParseAction",
")",
"->",
"ParseAction",
":",
"f",
"=",
"_trim_arity",
"(",
"f",
")",
"def",
"z",
"(",
"*",
"paArgs",
")",
":",
"thisFunc",
"=",
"f",
".",
"__name__",
"s",
",",
"l",
",",
"t",
"=",
"paArgs... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pyparsing/py3/pyparsing/core.py#L5586-L5630 | |
runtimejs/runtime | 0a6e84c30823d35a4548d6634166784260ae7b74 | deps/v8/tools/run_perf.py | python | AccumulateResults | (
graph_names, trace_configs, iter_output, trybot, no_patch, calc_total) | return res | Iterates over the output of multiple benchmark reruns and accumulates
results for a configured list of traces.
Args:
graph_names: List of names that configure the base path of the traces. E.g.
['v8', 'Octane'].
trace_configs: List of "TraceConfig" instances. Each trace config defines
... | Iterates over the output of multiple benchmark reruns and accumulates
results for a configured list of traces. | [
"Iterates",
"over",
"the",
"output",
"of",
"multiple",
"benchmark",
"reruns",
"and",
"accumulates",
"results",
"for",
"a",
"configured",
"list",
"of",
"traces",
"."
] | def AccumulateResults(
graph_names, trace_configs, iter_output, trybot, no_patch, calc_total):
"""Iterates over the output of multiple benchmark reruns and accumulates
results for a configured list of traces.
Args:
graph_names: List of names that configure the base path of the traces. E.g.
... | [
"def",
"AccumulateResults",
"(",
"graph_names",
",",
"trace_configs",
",",
"iter_output",
",",
"trybot",
",",
"no_patch",
",",
"calc_total",
")",
":",
"measurements",
"=",
"[",
"trace",
".",
"CreateMeasurement",
"(",
"trybot",
",",
"no_patch",
")",
"for",
"tra... | https://github.com/runtimejs/runtime/blob/0a6e84c30823d35a4548d6634166784260ae7b74/deps/v8/tools/run_perf.py#L240-L285 | |
Slicer/Slicer | ba9fadf332cb0303515b68d8d06a344c82e3e3e5 | Modules/Scripted/DICOMPlugins/DICOMEnhancedUSVolumePlugin.py | python | DICOMEnhancedUSVolumePluginClass.examine | (self,fileLists) | return loadables | Returns a list of DICOMLoadable instances
corresponding to ways of interpreting the
fileLists parameter. | Returns a list of DICOMLoadable instances
corresponding to ways of interpreting the
fileLists parameter. | [
"Returns",
"a",
"list",
"of",
"DICOMLoadable",
"instances",
"corresponding",
"to",
"ways",
"of",
"interpreting",
"the",
"fileLists",
"parameter",
"."
] | def examine(self,fileLists):
""" Returns a list of DICOMLoadable instances
corresponding to ways of interpreting the
fileLists parameter.
"""
loadables = []
for files in fileLists:
loadables += self.examineFiles(files)
return loadables | [
"def",
"examine",
"(",
"self",
",",
"fileLists",
")",
":",
"loadables",
"=",
"[",
"]",
"for",
"files",
"in",
"fileLists",
":",
"loadables",
"+=",
"self",
".",
"examineFiles",
"(",
"files",
")",
"return",
"loadables"
] | https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Modules/Scripted/DICOMPlugins/DICOMEnhancedUSVolumePlugin.py#L40-L49 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Fem/feminout/convert2TetGen.py | python | export | (objectslist, filename) | Called when freecad exports a mesh to poly format | Called when freecad exports a mesh to poly format | [
"Called",
"when",
"freecad",
"exports",
"a",
"mesh",
"to",
"poly",
"format"
] | def export(objectslist, filename):
"""Called when freecad exports a mesh to poly format"""
for obj in objectslist:
if isinstance(obj, Mesh.Feature):
exportMeshToTetGenPoly(obj.Mesh, filename, False)
break | [
"def",
"export",
"(",
"objectslist",
",",
"filename",
")",
":",
"for",
"obj",
"in",
"objectslist",
":",
"if",
"isinstance",
"(",
"obj",
",",
"Mesh",
".",
"Feature",
")",
":",
"exportMeshToTetGenPoly",
"(",
"obj",
".",
"Mesh",
",",
"filename",
",",
"False... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/feminout/convert2TetGen.py#L180-L185 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/pytables.py | python | Table.read_metadata | (self, key: str) | return None | return the meta data array for this key | return the meta data array for this key | [
"return",
"the",
"meta",
"data",
"array",
"for",
"this",
"key"
] | def read_metadata(self, key: str):
""" return the meta data array for this key """
if getattr(getattr(self.group, "meta", None), key, None) is not None:
return self.parent.select(self._get_metadata_path(key))
return None | [
"def",
"read_metadata",
"(",
"self",
",",
"key",
":",
"str",
")",
":",
"if",
"getattr",
"(",
"getattr",
"(",
"self",
".",
"group",
",",
"\"meta\"",
",",
"None",
")",
",",
"key",
",",
"None",
")",
"is",
"not",
"None",
":",
"return",
"self",
".",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/pytables.py#L3348-L3352 | |
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | BitVecRef.__lshift__ | (self, other) | return BitVecRef(Z3_mk_bvshl(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx) | Create the Z3 expression left shift `self << other`
>>> x, y = BitVecs('x y', 32)
>>> x << y
x << y
>>> (x << y).sexpr()
'(bvshl x y)'
>>> simplify(BitVecVal(2, 3) << 1)
4 | Create the Z3 expression left shift `self << other` | [
"Create",
"the",
"Z3",
"expression",
"left",
"shift",
"self",
"<<",
"other"
] | def __lshift__(self, other):
"""Create the Z3 expression left shift `self << other`
>>> x, y = BitVecs('x y', 32)
>>> x << y
x << y
>>> (x << y).sexpr()
'(bvshl x y)'
>>> simplify(BitVecVal(2, 3) << 1)
4
"""
a, b = _coerce_exprs(self, othe... | [
"def",
"__lshift__",
"(",
"self",
",",
"other",
")",
":",
"a",
",",
"b",
"=",
"_coerce_exprs",
"(",
"self",
",",
"other",
")",
"return",
"BitVecRef",
"(",
"Z3_mk_bvshl",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"a",
".",
"as_ast",
"(",
")",
",",... | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L3822-L3834 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | FWCore/ParameterSet/python/Config.py | python | Process.schedule_ | (self) | return self.__schedule | returns the schedule that has been added to the Process or None if none have been added | returns the schedule that has been added to the Process or None if none have been added | [
"returns",
"the",
"schedule",
"that",
"has",
"been",
"added",
"to",
"the",
"Process",
"or",
"None",
"if",
"none",
"have",
"been",
"added"
] | def schedule_(self):
"""returns the schedule that has been added to the Process or None if none have been added"""
return self.__schedule | [
"def",
"schedule_",
"(",
"self",
")",
":",
"return",
"self",
".",
"__schedule"
] | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/FWCore/ParameterSet/python/Config.py#L305-L307 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/wsgiref/util.py | python | is_hop_by_hop | (header_name) | return _hoppish(header_name.lower()) | Return true if 'header_name' is an HTTP/1.1 "Hop-by-Hop" header | Return true if 'header_name' is an HTTP/1.1 "Hop-by-Hop" header | [
"Return",
"true",
"if",
"header_name",
"is",
"an",
"HTTP",
"/",
"1",
".",
"1",
"Hop",
"-",
"by",
"-",
"Hop",
"header"
] | def is_hop_by_hop(header_name):
"""Return true if 'header_name' is an HTTP/1.1 "Hop-by-Hop" header"""
return _hoppish(header_name.lower()) | [
"def",
"is_hop_by_hop",
"(",
"header_name",
")",
":",
"return",
"_hoppish",
"(",
"header_name",
".",
"lower",
"(",
")",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/wsgiref/util.py#L163-L165 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/command/sdist.py | python | sdist.get_archive_files | (self) | return self.archive_files | Return the list of archive files created when the command
was run, or None if the command hasn't run yet. | Return the list of archive files created when the command
was run, or None if the command hasn't run yet. | [
"Return",
"the",
"list",
"of",
"archive",
"files",
"created",
"when",
"the",
"command",
"was",
"run",
"or",
"None",
"if",
"the",
"command",
"hasn",
"t",
"run",
"yet",
"."
] | def get_archive_files(self):
"""Return the list of archive files created when the command
was run, or None if the command hasn't run yet.
"""
return self.archive_files | [
"def",
"get_archive_files",
"(",
"self",
")",
":",
"return",
"self",
".",
"archive_files"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/command/sdist.py#L491-L495 | |
google/skia | 82d65d0487bd72f5f7332d002429ec2dc61d2463 | tools/skp/webpages_playback.py | python | SkPicturePlayback._GetChromiumSkpFileName | (self, page_set, site) | return basename[:MAX_SKP_BASE_NAME_LEN] + '.skp' | Returns the SKP file name for Chromium page sets. | Returns the SKP file name for Chromium page sets. | [
"Returns",
"the",
"SKP",
"file",
"name",
"for",
"Chromium",
"page",
"sets",
"."
] | def _GetChromiumSkpFileName(self, page_set, site):
"""Returns the SKP file name for Chromium page sets."""
# /path/to/http___mobile_news_sandbox_pt0 -> http___mobile_news_sandbox_pt0
_, webpage = os.path.split(site)
# http___mobile_news_sandbox_pt0 -> mobile_news_sandbox_pt0
for prefix in ('http___'... | [
"def",
"_GetChromiumSkpFileName",
"(",
"self",
",",
"page_set",
",",
"site",
")",
":",
"# /path/to/http___mobile_news_sandbox_pt0 -> http___mobile_news_sandbox_pt0",
"_",
",",
"webpage",
"=",
"os",
".",
"path",
".",
"split",
"(",
"site",
")",
"# http___mobile_news_sandb... | https://github.com/google/skia/blob/82d65d0487bd72f5f7332d002429ec2dc61d2463/tools/skp/webpages_playback.py#L407-L419 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8/tools/jsmin.py | python | JavaScriptMinifier.RemoveSpaces | (self, m) | return replacement | Returns literal strings unchanged, replaces other inputs with group 2.
Other inputs are replaced with the contents of capture 1. This is either
a single space or an empty string.
Args:
m: The match object returned by re.search.
Returns:
The string that should be inserted instead of the m... | Returns literal strings unchanged, replaces other inputs with group 2. | [
"Returns",
"literal",
"strings",
"unchanged",
"replaces",
"other",
"inputs",
"with",
"group",
"2",
"."
] | def RemoveSpaces(self, m):
"""Returns literal strings unchanged, replaces other inputs with group 2.
Other inputs are replaced with the contents of capture 1. This is either
a single space or an empty string.
Args:
m: The match object returned by re.search.
Returns:
The string that s... | [
"def",
"RemoveSpaces",
"(",
"self",
",",
"m",
")",
":",
"entire_match",
"=",
"m",
".",
"group",
"(",
"0",
")",
"replacement",
"=",
"m",
".",
"group",
"(",
"1",
")",
"if",
"re",
".",
"match",
"(",
"r\"'.*'$\"",
",",
"entire_match",
")",
":",
"return... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8/tools/jsmin.py#L178-L200 | |
microsoft/clang | 86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5 | bindings/python/clang/cindex.py | python | Type.get_fields | (self) | return iter(fields) | Return an iterator for accessing the fields of this type. | Return an iterator for accessing the fields of this type. | [
"Return",
"an",
"iterator",
"for",
"accessing",
"the",
"fields",
"of",
"this",
"type",
"."
] | def get_fields(self):
"""Return an iterator for accessing the fields of this type."""
def visitor(field, children):
assert field != conf.lib.clang_getNullCursor()
# Create reference to TU so it isn't GC'd before Cursor.
field._tu = self._tu
fields.append... | [
"def",
"get_fields",
"(",
"self",
")",
":",
"def",
"visitor",
"(",
"field",
",",
"children",
")",
":",
"assert",
"field",
"!=",
"conf",
".",
"lib",
".",
"clang_getNullCursor",
"(",
")",
"# Create reference to TU so it isn't GC'd before Cursor.",
"field",
".",
"_... | https://github.com/microsoft/clang/blob/86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5/bindings/python/clang/cindex.py#L2382-L2395 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | caffe2/python/rnn_cell.py | python | MultiRNNCell.__init__ | (self, cells, residual_output_layers=None, **kwargs) | cells: list of RNNCell instances, from input to output side.
name: string designating network component (for scoping)
residual_output_layers: list of indices of layers whose input will
be added elementwise to their output elementwise. (It is the
responsibility of the client code to ens... | cells: list of RNNCell instances, from input to output side. | [
"cells",
":",
"list",
"of",
"RNNCell",
"instances",
"from",
"input",
"to",
"output",
"side",
"."
] | def __init__(self, cells, residual_output_layers=None, **kwargs):
'''
cells: list of RNNCell instances, from input to output side.
name: string designating network component (for scoping)
residual_output_layers: list of indices of layers whose input will
be added elementwise to... | [
"def",
"__init__",
"(",
"self",
",",
"cells",
",",
"residual_output_layers",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"MultiRNNCell",
",",
"self",
")",
".",
"__init__",
"(",
"*",
"*",
"kwargs",
")",
"self",
".",
"cells",
"=",
"ce... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/rnn_cell.py#L922-L970 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.