repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
ChristianTremblay/BAC0 | BAC0/core/utils/notes.py | note_and_log | def note_and_log(cls):
"""
This will be used as a decorator on class to activate
logging and store messages in the variable cls._notes
This will allow quick access to events in the web app.
A note can be added to cls._notes without logging if passing
the argument log=false to function note()
... | python | def note_and_log(cls):
"""
This will be used as a decorator on class to activate
logging and store messages in the variable cls._notes
This will allow quick access to events in the web app.
A note can be added to cls._notes without logging if passing
the argument log=false to function note()
... | [
"def",
"note_and_log",
"(",
"cls",
")",
":",
"if",
"hasattr",
"(",
"cls",
",",
"\"DEBUG_LEVEL\"",
")",
":",
"if",
"cls",
".",
"DEBUG_LEVEL",
"==",
"\"debug\"",
":",
"file_level",
"=",
"logging",
".",
"DEBUG",
"console_level",
"=",
"logging",
".",
"DEBUG",
... | This will be used as a decorator on class to activate
logging and store messages in the variable cls._notes
This will allow quick access to events in the web app.
A note can be added to cls._notes without logging if passing
the argument log=false to function note()
Something can be logged without ad... | [
"This",
"will",
"be",
"used",
"as",
"a",
"decorator",
"on",
"class",
"to",
"activate",
"logging",
"and",
"store",
"messages",
"in",
"the",
"variable",
"cls",
".",
"_notes",
"This",
"will",
"allow",
"quick",
"access",
"to",
"events",
"in",
"the",
"web",
"... | train | https://github.com/ChristianTremblay/BAC0/blob/8d95b065ea068524a08f5b0c34322ebeeba95d06/BAC0/core/utils/notes.py#L88-L223 |
ChristianTremblay/BAC0 | BAC0/core/functions/discoverPoints.py | discoverPoints | def discoverPoints(bacnetapp, address, devID):
"""
Discover the BACnet points in a BACnet device.
:param bacnetApp: The app itself so we can call read
:param address: address of the device as a string (ex. '2:5')
:param devID: device ID of the bacnet device as a string (ex. '1001')
:returns: a... | python | def discoverPoints(bacnetapp, address, devID):
"""
Discover the BACnet points in a BACnet device.
:param bacnetApp: The app itself so we can call read
:param address: address of the device as a string (ex. '2:5')
:param devID: device ID of the bacnet device as a string (ex. '1001')
:returns: a... | [
"def",
"discoverPoints",
"(",
"bacnetapp",
",",
"address",
",",
"devID",
")",
":",
"pss",
"=",
"bacnetapp",
".",
"read",
"(",
"\"{} device {} protocolServicesSupported\"",
".",
"format",
"(",
"address",
",",
"devID",
")",
")",
"deviceName",
"=",
"bacnetapp",
"... | Discover the BACnet points in a BACnet device.
:param bacnetApp: The app itself so we can call read
:param address: address of the device as a string (ex. '2:5')
:param devID: device ID of the bacnet device as a string (ex. '1001')
:returns: a tuple with deviceName, pss, objList, df
* *device... | [
"Discover",
"the",
"BACnet",
"points",
"in",
"a",
"BACnet",
"device",
"."
] | train | https://github.com/ChristianTremblay/BAC0/blob/8d95b065ea068524a08f5b0c34322ebeeba95d06/BAC0/core/functions/discoverPoints.py#L28-L139 |
regebro/svg.path | src/svg/path/path.py | CubicBezier.is_smooth_from | def is_smooth_from(self, previous):
"""Checks if this segment would be a smooth segment following the previous"""
if isinstance(previous, CubicBezier):
return (self.start == previous.end and
(self.control1 - self.start) == (previous.end - previous.control2))
else:... | python | def is_smooth_from(self, previous):
"""Checks if this segment would be a smooth segment following the previous"""
if isinstance(previous, CubicBezier):
return (self.start == previous.end and
(self.control1 - self.start) == (previous.end - previous.control2))
else:... | [
"def",
"is_smooth_from",
"(",
"self",
",",
"previous",
")",
":",
"if",
"isinstance",
"(",
"previous",
",",
"CubicBezier",
")",
":",
"return",
"(",
"self",
".",
"start",
"==",
"previous",
".",
"end",
"and",
"(",
"self",
".",
"control1",
"-",
"self",
"."... | Checks if this segment would be a smooth segment following the previous | [
"Checks",
"if",
"this",
"segment",
"would",
"be",
"a",
"smooth",
"segment",
"following",
"the",
"previous"
] | train | https://github.com/regebro/svg.path/blob/cb58e104e5aa3472be205c75da59690db30aecc9/src/svg/path/path.py#L83-L89 |
regebro/svg.path | src/svg/path/path.py | CubicBezier.point | def point(self, pos):
"""Calculate the x,y position at a certain position of the path"""
return ((1 - pos) ** 3 * self.start) + \
(3 * (1 - pos) ** 2 * pos * self.control1) + \
(3 * (1 - pos) * pos ** 2 * self.control2) + \
(pos ** 3 * self.end) | python | def point(self, pos):
"""Calculate the x,y position at a certain position of the path"""
return ((1 - pos) ** 3 * self.start) + \
(3 * (1 - pos) ** 2 * pos * self.control1) + \
(3 * (1 - pos) * pos ** 2 * self.control2) + \
(pos ** 3 * self.end) | [
"def",
"point",
"(",
"self",
",",
"pos",
")",
":",
"return",
"(",
"(",
"1",
"-",
"pos",
")",
"**",
"3",
"*",
"self",
".",
"start",
")",
"+",
"(",
"3",
"*",
"(",
"1",
"-",
"pos",
")",
"**",
"2",
"*",
"pos",
"*",
"self",
".",
"control1",
")... | Calculate the x,y position at a certain position of the path | [
"Calculate",
"the",
"x",
"y",
"position",
"at",
"a",
"certain",
"position",
"of",
"the",
"path"
] | train | https://github.com/regebro/svg.path/blob/cb58e104e5aa3472be205c75da59690db30aecc9/src/svg/path/path.py#L91-L96 |
regebro/svg.path | src/svg/path/path.py | CubicBezier.length | def length(self, error=ERROR, min_depth=MIN_DEPTH):
"""Calculate the length of the path up to a certain position"""
start_point = self.point(0)
end_point = self.point(1)
return segment_length(self, 0, 1, start_point, end_point, error, min_depth, 0) | python | def length(self, error=ERROR, min_depth=MIN_DEPTH):
"""Calculate the length of the path up to a certain position"""
start_point = self.point(0)
end_point = self.point(1)
return segment_length(self, 0, 1, start_point, end_point, error, min_depth, 0) | [
"def",
"length",
"(",
"self",
",",
"error",
"=",
"ERROR",
",",
"min_depth",
"=",
"MIN_DEPTH",
")",
":",
"start_point",
"=",
"self",
".",
"point",
"(",
"0",
")",
"end_point",
"=",
"self",
".",
"point",
"(",
"1",
")",
"return",
"segment_length",
"(",
"... | Calculate the length of the path up to a certain position | [
"Calculate",
"the",
"length",
"of",
"the",
"path",
"up",
"to",
"a",
"certain",
"position"
] | train | https://github.com/regebro/svg.path/blob/cb58e104e5aa3472be205c75da59690db30aecc9/src/svg/path/path.py#L98-L102 |
regebro/svg.path | src/svg/path/path.py | QuadraticBezier.is_smooth_from | def is_smooth_from(self, previous):
"""Checks if this segment would be a smooth segment following the previous"""
if isinstance(previous, QuadraticBezier):
return (self.start == previous.end and
(self.control - self.start) == (previous.end - previous.control))
els... | python | def is_smooth_from(self, previous):
"""Checks if this segment would be a smooth segment following the previous"""
if isinstance(previous, QuadraticBezier):
return (self.start == previous.end and
(self.control - self.start) == (previous.end - previous.control))
els... | [
"def",
"is_smooth_from",
"(",
"self",
",",
"previous",
")",
":",
"if",
"isinstance",
"(",
"previous",
",",
"QuadraticBezier",
")",
":",
"return",
"(",
"self",
".",
"start",
"==",
"previous",
".",
"end",
"and",
"(",
"self",
".",
"control",
"-",
"self",
... | Checks if this segment would be a smooth segment following the previous | [
"Checks",
"if",
"this",
"segment",
"would",
"be",
"a",
"smooth",
"segment",
"following",
"the",
"previous"
] | train | https://github.com/regebro/svg.path/blob/cb58e104e5aa3472be205c75da59690db30aecc9/src/svg/path/path.py#L126-L132 |
zeekay/flask-uwsgi-websocket | flask_uwsgi_websocket/websocket.py | WebSocket.register_blueprint | def register_blueprint(self, blueprint, **options):
'''
Registers a blueprint on the WebSockets.
'''
first_registration = False
if blueprint.name in self.blueprints:
assert self.blueprints[blueprint.name] is blueprint, \
'A blueprint\'s name collision ... | python | def register_blueprint(self, blueprint, **options):
'''
Registers a blueprint on the WebSockets.
'''
first_registration = False
if blueprint.name in self.blueprints:
assert self.blueprints[blueprint.name] is blueprint, \
'A blueprint\'s name collision ... | [
"def",
"register_blueprint",
"(",
"self",
",",
"blueprint",
",",
"*",
"*",
"options",
")",
":",
"first_registration",
"=",
"False",
"if",
"blueprint",
".",
"name",
"in",
"self",
".",
"blueprints",
":",
"assert",
"self",
".",
"blueprints",
"[",
"blueprint",
... | Registers a blueprint on the WebSockets. | [
"Registers",
"a",
"blueprint",
"on",
"the",
"WebSockets",
"."
] | train | https://github.com/zeekay/flask-uwsgi-websocket/blob/d0264d220d570a37100ef01be10a0f01fef1e9df/flask_uwsgi_websocket/websocket.py#L151-L165 |
mgedmin/findimports | findimports.py | adjust_lineno | def adjust_lineno(filename, lineno, name):
"""Adjust the line number of an import.
Needed because import statements can span multiple lines, and our lineno
is always the first line number.
"""
line = linecache.getline(filename, lineno)
# Hack warning: might be fooled by comments
rx = re.com... | python | def adjust_lineno(filename, lineno, name):
"""Adjust the line number of an import.
Needed because import statements can span multiple lines, and our lineno
is always the first line number.
"""
line = linecache.getline(filename, lineno)
# Hack warning: might be fooled by comments
rx = re.com... | [
"def",
"adjust_lineno",
"(",
"filename",
",",
"lineno",
",",
"name",
")",
":",
"line",
"=",
"linecache",
".",
"getline",
"(",
"filename",
",",
"lineno",
")",
"# Hack warning: might be fooled by comments",
"rx",
"=",
"re",
".",
"compile",
"(",
"r'\\b%s\\b'",
"%... | Adjust the line number of an import.
Needed because import statements can span multiple lines, and our lineno
is always the first line number. | [
"Adjust",
"the",
"line",
"number",
"of",
"an",
"import",
"."
] | train | https://github.com/mgedmin/findimports/blob/c20a50b497390fed15aa3835476f4fad57313e8a/findimports.py#L89-L101 |
mgedmin/findimports | findimports.py | find_imports | def find_imports(filename):
"""Find all imported names in a given file.
Returns a list of ImportInfo objects.
"""
with open(filename) as f:
root = ast.parse(f.read(), filename)
visitor = ImportFinder(filename)
visitor.visit(root)
return visitor.imports | python | def find_imports(filename):
"""Find all imported names in a given file.
Returns a list of ImportInfo objects.
"""
with open(filename) as f:
root = ast.parse(f.read(), filename)
visitor = ImportFinder(filename)
visitor.visit(root)
return visitor.imports | [
"def",
"find_imports",
"(",
"filename",
")",
":",
"with",
"open",
"(",
"filename",
")",
"as",
"f",
":",
"root",
"=",
"ast",
".",
"parse",
"(",
"f",
".",
"read",
"(",
")",
",",
"filename",
")",
"visitor",
"=",
"ImportFinder",
"(",
"filename",
")",
"... | Find all imported names in a given file.
Returns a list of ImportInfo objects. | [
"Find",
"all",
"imported",
"names",
"in",
"a",
"given",
"file",
"."
] | train | https://github.com/mgedmin/findimports/blob/c20a50b497390fed15aa3835476f4fad57313e8a/findimports.py#L316-L325 |
mgedmin/findimports | findimports.py | find_imports_and_track_names | def find_imports_and_track_names(filename, warn_about_duplicates=False,
verbose=False):
"""Find all imported names in a given file.
Returns ``(imports, unused)``. Both are lists of ImportInfo objects.
"""
with open(filename) as f:
root = ast.parse(f.read(), fil... | python | def find_imports_and_track_names(filename, warn_about_duplicates=False,
verbose=False):
"""Find all imported names in a given file.
Returns ``(imports, unused)``. Both are lists of ImportInfo objects.
"""
with open(filename) as f:
root = ast.parse(f.read(), fil... | [
"def",
"find_imports_and_track_names",
"(",
"filename",
",",
"warn_about_duplicates",
"=",
"False",
",",
"verbose",
"=",
"False",
")",
":",
"with",
"open",
"(",
"filename",
")",
"as",
"f",
":",
"root",
"=",
"ast",
".",
"parse",
"(",
"f",
".",
"read",
"("... | Find all imported names in a given file.
Returns ``(imports, unused)``. Both are lists of ImportInfo objects. | [
"Find",
"all",
"imported",
"names",
"in",
"a",
"given",
"file",
"."
] | train | https://github.com/mgedmin/findimports/blob/c20a50b497390fed15aa3835476f4fad57313e8a/findimports.py#L328-L341 |
mgedmin/findimports | findimports.py | ModuleGraph.parsePathname | def parsePathname(self, pathname):
"""Parse one or more source files.
``pathname`` may be a file name or a directory name.
"""
if os.path.isdir(pathname):
for root, dirs, files in os.walk(pathname):
dirs.sort()
files.sort()
for... | python | def parsePathname(self, pathname):
"""Parse one or more source files.
``pathname`` may be a file name or a directory name.
"""
if os.path.isdir(pathname):
for root, dirs, files in os.walk(pathname):
dirs.sort()
files.sort()
for... | [
"def",
"parsePathname",
"(",
"self",
",",
"pathname",
")",
":",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"pathname",
")",
":",
"for",
"root",
",",
"dirs",
",",
"files",
"in",
"os",
".",
"walk",
"(",
"pathname",
")",
":",
"dirs",
".",
"sort",
"... | Parse one or more source files.
``pathname`` may be a file name or a directory name. | [
"Parse",
"one",
"or",
"more",
"source",
"files",
"."
] | train | https://github.com/mgedmin/findimports/blob/c20a50b497390fed15aa3835476f4fad57313e8a/findimports.py#L417-L433 |
mgedmin/findimports | findimports.py | ModuleGraph.writeCache | def writeCache(self, filename):
"""Write the graph to a cache file."""
with open(filename, 'wb') as f:
pickle.dump(self.modules, f) | python | def writeCache(self, filename):
"""Write the graph to a cache file."""
with open(filename, 'wb') as f:
pickle.dump(self.modules, f) | [
"def",
"writeCache",
"(",
"self",
",",
"filename",
")",
":",
"with",
"open",
"(",
"filename",
",",
"'wb'",
")",
"as",
"f",
":",
"pickle",
".",
"dump",
"(",
"self",
".",
"modules",
",",
"f",
")"
] | Write the graph to a cache file. | [
"Write",
"the",
"graph",
"to",
"a",
"cache",
"file",
"."
] | train | https://github.com/mgedmin/findimports/blob/c20a50b497390fed15aa3835476f4fad57313e8a/findimports.py#L435-L438 |
mgedmin/findimports | findimports.py | ModuleGraph.readCache | def readCache(self, filename):
"""Load the graph from a cache file."""
with open(filename, 'rb') as f:
self.modules = pickle.load(f) | python | def readCache(self, filename):
"""Load the graph from a cache file."""
with open(filename, 'rb') as f:
self.modules = pickle.load(f) | [
"def",
"readCache",
"(",
"self",
",",
"filename",
")",
":",
"with",
"open",
"(",
"filename",
",",
"'rb'",
")",
"as",
"f",
":",
"self",
".",
"modules",
"=",
"pickle",
".",
"load",
"(",
"f",
")"
] | Load the graph from a cache file. | [
"Load",
"the",
"graph",
"from",
"a",
"cache",
"file",
"."
] | train | https://github.com/mgedmin/findimports/blob/c20a50b497390fed15aa3835476f4fad57313e8a/findimports.py#L440-L443 |
mgedmin/findimports | findimports.py | ModuleGraph.parseFile | def parseFile(self, filename):
"""Parse a single file."""
modname = self.filenameToModname(filename)
module = Module(modname, filename)
self.modules[modname] = module
if self.trackUnusedNames:
module.imported_names, module.unused_names = \
find_imports... | python | def parseFile(self, filename):
"""Parse a single file."""
modname = self.filenameToModname(filename)
module = Module(modname, filename)
self.modules[modname] = module
if self.trackUnusedNames:
module.imported_names, module.unused_names = \
find_imports... | [
"def",
"parseFile",
"(",
"self",
",",
"filename",
")",
":",
"modname",
"=",
"self",
".",
"filenameToModname",
"(",
"filename",
")",
"module",
"=",
"Module",
"(",
"modname",
",",
"filename",
")",
"self",
".",
"modules",
"[",
"modname",
"]",
"=",
"module",... | Parse a single file. | [
"Parse",
"a",
"single",
"file",
"."
] | train | https://github.com/mgedmin/findimports/blob/c20a50b497390fed15aa3835476f4fad57313e8a/findimports.py#L445-L461 |
mgedmin/findimports | findimports.py | ModuleGraph.filenameToModname | def filenameToModname(self, filename):
"""Convert a filename to a module name."""
for ext in reversed(self._exts):
if filename.endswith(ext):
filename = filename[:-len(ext)]
break
else:
self.warn(filename, '%s: unknown file name extension',... | python | def filenameToModname(self, filename):
"""Convert a filename to a module name."""
for ext in reversed(self._exts):
if filename.endswith(ext):
filename = filename[:-len(ext)]
break
else:
self.warn(filename, '%s: unknown file name extension',... | [
"def",
"filenameToModname",
"(",
"self",
",",
"filename",
")",
":",
"for",
"ext",
"in",
"reversed",
"(",
"self",
".",
"_exts",
")",
":",
"if",
"filename",
".",
"endswith",
"(",
"ext",
")",
":",
"filename",
"=",
"filename",
"[",
":",
"-",
"len",
"(",
... | Convert a filename to a module name. | [
"Convert",
"a",
"filename",
"to",
"a",
"module",
"name",
"."
] | train | https://github.com/mgedmin/findimports/blob/c20a50b497390fed15aa3835476f4fad57313e8a/findimports.py#L463-L481 |
mgedmin/findimports | findimports.py | ModuleGraph.findModuleOfName | def findModuleOfName(self, dotted_name, level, filename, extrapath=None):
"""Given a fully qualified name, find what module contains it."""
if dotted_name.endswith('.*'):
return dotted_name[:-2]
name = dotted_name
# extrapath is None only in a couple of test cases; in real l... | python | def findModuleOfName(self, dotted_name, level, filename, extrapath=None):
"""Given a fully qualified name, find what module contains it."""
if dotted_name.endswith('.*'):
return dotted_name[:-2]
name = dotted_name
# extrapath is None only in a couple of test cases; in real l... | [
"def",
"findModuleOfName",
"(",
"self",
",",
"dotted_name",
",",
"level",
",",
"filename",
",",
"extrapath",
"=",
"None",
")",
":",
"if",
"dotted_name",
".",
"endswith",
"(",
"'.*'",
")",
":",
"return",
"dotted_name",
"[",
":",
"-",
"2",
"]",
"name",
"... | Given a fully qualified name, find what module contains it. | [
"Given",
"a",
"fully",
"qualified",
"name",
"find",
"what",
"module",
"contains",
"it",
"."
] | train | https://github.com/mgedmin/findimports/blob/c20a50b497390fed15aa3835476f4fad57313e8a/findimports.py#L483-L511 |
mgedmin/findimports | findimports.py | ModuleGraph.isModule | def isModule(self, dotted_name, extrapath=None):
"""Is ``dotted_name`` the name of a module?"""
try:
return self._module_cache[(dotted_name, extrapath)]
except KeyError:
pass
if dotted_name in sys.modules or dotted_name in self.builtin_modules:
return ... | python | def isModule(self, dotted_name, extrapath=None):
"""Is ``dotted_name`` the name of a module?"""
try:
return self._module_cache[(dotted_name, extrapath)]
except KeyError:
pass
if dotted_name in sys.modules or dotted_name in self.builtin_modules:
return ... | [
"def",
"isModule",
"(",
"self",
",",
"dotted_name",
",",
"extrapath",
"=",
"None",
")",
":",
"try",
":",
"return",
"self",
".",
"_module_cache",
"[",
"(",
"dotted_name",
",",
"extrapath",
")",
"]",
"except",
"KeyError",
":",
"pass",
"if",
"dotted_name",
... | Is ``dotted_name`` the name of a module? | [
"Is",
"dotted_name",
"the",
"name",
"of",
"a",
"module?"
] | train | https://github.com/mgedmin/findimports/blob/c20a50b497390fed15aa3835476f4fad57313e8a/findimports.py#L513-L560 |
mgedmin/findimports | findimports.py | ModuleGraph.isPackage | def isPackage(self, dotted_name, extrapath=None):
"""Is ``dotted_name`` the name of a package?"""
candidate = self.isModule(dotted_name + '.__init__', extrapath)
if candidate:
candidate = candidate[:-len(".__init__")]
return candidate | python | def isPackage(self, dotted_name, extrapath=None):
"""Is ``dotted_name`` the name of a package?"""
candidate = self.isModule(dotted_name + '.__init__', extrapath)
if candidate:
candidate = candidate[:-len(".__init__")]
return candidate | [
"def",
"isPackage",
"(",
"self",
",",
"dotted_name",
",",
"extrapath",
"=",
"None",
")",
":",
"candidate",
"=",
"self",
".",
"isModule",
"(",
"dotted_name",
"+",
"'.__init__'",
",",
"extrapath",
")",
"if",
"candidate",
":",
"candidate",
"=",
"candidate",
"... | Is ``dotted_name`` the name of a package? | [
"Is",
"dotted_name",
"the",
"name",
"of",
"a",
"package?"
] | train | https://github.com/mgedmin/findimports/blob/c20a50b497390fed15aa3835476f4fad57313e8a/findimports.py#L562-L567 |
mgedmin/findimports | findimports.py | ModuleGraph.packageOf | def packageOf(self, dotted_name, packagelevel=None):
"""Determine the package that contains ``dotted_name``."""
if '.' not in dotted_name:
return dotted_name
if not self.isPackage(dotted_name):
dotted_name = '.'.join(dotted_name.split('.')[:-1])
if packagelevel:
... | python | def packageOf(self, dotted_name, packagelevel=None):
"""Determine the package that contains ``dotted_name``."""
if '.' not in dotted_name:
return dotted_name
if not self.isPackage(dotted_name):
dotted_name = '.'.join(dotted_name.split('.')[:-1])
if packagelevel:
... | [
"def",
"packageOf",
"(",
"self",
",",
"dotted_name",
",",
"packagelevel",
"=",
"None",
")",
":",
"if",
"'.'",
"not",
"in",
"dotted_name",
":",
"return",
"dotted_name",
"if",
"not",
"self",
".",
"isPackage",
"(",
"dotted_name",
")",
":",
"dotted_name",
"=",... | Determine the package that contains ``dotted_name``. | [
"Determine",
"the",
"package",
"that",
"contains",
"dotted_name",
"."
] | train | https://github.com/mgedmin/findimports/blob/c20a50b497390fed15aa3835476f4fad57313e8a/findimports.py#L569-L577 |
mgedmin/findimports | findimports.py | ModuleGraph.listModules | def listModules(self):
"""Return an alphabetical list of all modules."""
modules = list(self.modules.items())
modules.sort()
return [module for name, module in modules] | python | def listModules(self):
"""Return an alphabetical list of all modules."""
modules = list(self.modules.items())
modules.sort()
return [module for name, module in modules] | [
"def",
"listModules",
"(",
"self",
")",
":",
"modules",
"=",
"list",
"(",
"self",
".",
"modules",
".",
"items",
"(",
")",
")",
"modules",
".",
"sort",
"(",
")",
"return",
"[",
"module",
"for",
"name",
",",
"module",
"in",
"modules",
"]"
] | Return an alphabetical list of all modules. | [
"Return",
"an",
"alphabetical",
"list",
"of",
"all",
"modules",
"."
] | train | https://github.com/mgedmin/findimports/blob/c20a50b497390fed15aa3835476f4fad57313e8a/findimports.py#L590-L594 |
mgedmin/findimports | findimports.py | ModuleGraph.packageGraph | def packageGraph(self, packagelevel=None):
"""Convert a module graph to a package graph."""
packages = {}
for module in self.listModules():
package_name = self.packageOf(module.modname, packagelevel)
if package_name not in packages:
dirname = os.path.dirna... | python | def packageGraph(self, packagelevel=None):
"""Convert a module graph to a package graph."""
packages = {}
for module in self.listModules():
package_name = self.packageOf(module.modname, packagelevel)
if package_name not in packages:
dirname = os.path.dirna... | [
"def",
"packageGraph",
"(",
"self",
",",
"packagelevel",
"=",
"None",
")",
":",
"packages",
"=",
"{",
"}",
"for",
"module",
"in",
"self",
".",
"listModules",
"(",
")",
":",
"package_name",
"=",
"self",
".",
"packageOf",
"(",
"module",
".",
"modname",
"... | Convert a module graph to a package graph. | [
"Convert",
"a",
"module",
"graph",
"to",
"a",
"package",
"graph",
"."
] | train | https://github.com/mgedmin/findimports/blob/c20a50b497390fed15aa3835476f4fad57313e8a/findimports.py#L596-L611 |
mgedmin/findimports | findimports.py | ModuleGraph.collapseCycles | def collapseCycles(self):
"""Create a graph with cycles collapsed.
Collapse modules participating in a cycle to a single node.
"""
# This algorithm determines Strongly Connected Components. Look it up.
# It is adapted to suit our data structures.
# Phase 0: prepare the ... | python | def collapseCycles(self):
"""Create a graph with cycles collapsed.
Collapse modules participating in a cycle to a single node.
"""
# This algorithm determines Strongly Connected Components. Look it up.
# It is adapted to suit our data structures.
# Phase 0: prepare the ... | [
"def",
"collapseCycles",
"(",
"self",
")",
":",
"# This algorithm determines Strongly Connected Components. Look it up.",
"# It is adapted to suit our data structures.",
"# Phase 0: prepare the graph",
"imports",
"=",
"{",
"}",
"for",
"u",
"in",
"self",
".",
"modules",
":",
... | Create a graph with cycles collapsed.
Collapse modules participating in a cycle to a single node. | [
"Create",
"a",
"graph",
"with",
"cycles",
"collapsed",
"."
] | train | https://github.com/mgedmin/findimports/blob/c20a50b497390fed15aa3835476f4fad57313e8a/findimports.py#L634-L699 |
mgedmin/findimports | findimports.py | ModuleGraph.printImportedNames | def printImportedNames(self):
"""Produce a report of imported names."""
for module in self.listModules():
print("%s:" % module.modname)
print(" %s" % "\n ".join(imp.name for imp in module.imported_names)) | python | def printImportedNames(self):
"""Produce a report of imported names."""
for module in self.listModules():
print("%s:" % module.modname)
print(" %s" % "\n ".join(imp.name for imp in module.imported_names)) | [
"def",
"printImportedNames",
"(",
"self",
")",
":",
"for",
"module",
"in",
"self",
".",
"listModules",
"(",
")",
":",
"print",
"(",
"\"%s:\"",
"%",
"module",
".",
"modname",
")",
"print",
"(",
"\" %s\"",
"%",
"\"\\n \"",
".",
"join",
"(",
"imp",
".",... | Produce a report of imported names. | [
"Produce",
"a",
"report",
"of",
"imported",
"names",
"."
] | train | https://github.com/mgedmin/findimports/blob/c20a50b497390fed15aa3835476f4fad57313e8a/findimports.py#L701-L705 |
mgedmin/findimports | findimports.py | ModuleGraph.printImports | def printImports(self):
"""Produce a report of dependencies."""
for module in self.listModules():
print("%s:" % module.label)
if self.external_dependencies:
imports = list(module.imports)
else:
imports = [modname for modname in module.i... | python | def printImports(self):
"""Produce a report of dependencies."""
for module in self.listModules():
print("%s:" % module.label)
if self.external_dependencies:
imports = list(module.imports)
else:
imports = [modname for modname in module.i... | [
"def",
"printImports",
"(",
"self",
")",
":",
"for",
"module",
"in",
"self",
".",
"listModules",
"(",
")",
":",
"print",
"(",
"\"%s:\"",
"%",
"module",
".",
"label",
")",
"if",
"self",
".",
"external_dependencies",
":",
"imports",
"=",
"list",
"(",
"mo... | Produce a report of dependencies. | [
"Produce",
"a",
"report",
"of",
"dependencies",
"."
] | train | https://github.com/mgedmin/findimports/blob/c20a50b497390fed15aa3835476f4fad57313e8a/findimports.py#L707-L717 |
mgedmin/findimports | findimports.py | ModuleGraph.printUnusedImports | def printUnusedImports(self):
"""Produce a report of unused imports."""
for module in self.listModules():
names = [(unused.lineno, unused.name)
for unused in module.unused_names]
names.sort()
for lineno, name in names:
if not self.... | python | def printUnusedImports(self):
"""Produce a report of unused imports."""
for module in self.listModules():
names = [(unused.lineno, unused.name)
for unused in module.unused_names]
names.sort()
for lineno, name in names:
if not self.... | [
"def",
"printUnusedImports",
"(",
"self",
")",
":",
"for",
"module",
"in",
"self",
".",
"listModules",
"(",
")",
":",
"names",
"=",
"[",
"(",
"unused",
".",
"lineno",
",",
"unused",
".",
"name",
")",
"for",
"unused",
"in",
"module",
".",
"unused_names"... | Produce a report of unused imports. | [
"Produce",
"a",
"report",
"of",
"unused",
"imports",
"."
] | train | https://github.com/mgedmin/findimports/blob/c20a50b497390fed15aa3835476f4fad57313e8a/findimports.py#L719-L731 |
mgedmin/findimports | findimports.py | ModuleGraph.printDot | def printDot(self):
"""Produce a dependency graph in dot format."""
print("digraph ModuleDependencies {")
print(" node[shape=box];")
allNames = set()
nameDict = {}
for n, module in enumerate(self.listModules()):
module._dot_name = "mod%d" % n
name... | python | def printDot(self):
"""Produce a dependency graph in dot format."""
print("digraph ModuleDependencies {")
print(" node[shape=box];")
allNames = set()
nameDict = {}
for n, module in enumerate(self.listModules()):
module._dot_name = "mod%d" % n
name... | [
"def",
"printDot",
"(",
"self",
")",
":",
"print",
"(",
"\"digraph ModuleDependencies {\"",
")",
"print",
"(",
"\" node[shape=box];\"",
")",
"allNames",
"=",
"set",
"(",
")",
"nameDict",
"=",
"{",
"}",
"for",
"n",
",",
"module",
"in",
"enumerate",
"(",
"s... | Produce a dependency graph in dot format. | [
"Produce",
"a",
"dependency",
"graph",
"in",
"dot",
"format",
"."
] | train | https://github.com/mgedmin/findimports/blob/c20a50b497390fed15aa3835476f4fad57313e8a/findimports.py#L733-L758 |
marianoguerra/rst2html5 | html5css3/html.py | quote | def quote(text):
"""encode html entities"""
text = unicode(text)
return text.translate({
ord('&'): u'&',
ord('<'): u'<',
ord('"'): u'"',
ord('>'): u'>',
ord('@'): u'@',
0xa0: u' '}) | python | def quote(text):
"""encode html entities"""
text = unicode(text)
return text.translate({
ord('&'): u'&',
ord('<'): u'<',
ord('"'): u'"',
ord('>'): u'>',
ord('@'): u'@',
0xa0: u' '}) | [
"def",
"quote",
"(",
"text",
")",
":",
"text",
"=",
"unicode",
"(",
"text",
")",
"return",
"text",
".",
"translate",
"(",
"{",
"ord",
"(",
"'&'",
")",
":",
"u'&'",
",",
"ord",
"(",
"'<'",
")",
":",
"u'<'",
",",
"ord",
"(",
"'\"'",
")",
"... | encode html entities | [
"encode",
"html",
"entities"
] | train | https://github.com/marianoguerra/rst2html5/blob/667f2c384e7b9315e86e894a455062660d7b0334/html5css3/html.py#L19-L28 |
marianoguerra/rst2html5 | html5css3/html.py | _create_tags | def _create_tags(ctx):
"create all classes and put them in ctx"
for (tag, info) in _TAGS.items():
class_name = tag.title()
quote_, compact, self_closing, docs = info
def __init__(self, *childs, **attrs):
TagBase.__init__(self, childs, attrs)
cls = type(class_name, ... | python | def _create_tags(ctx):
"create all classes and put them in ctx"
for (tag, info) in _TAGS.items():
class_name = tag.title()
quote_, compact, self_closing, docs = info
def __init__(self, *childs, **attrs):
TagBase.__init__(self, childs, attrs)
cls = type(class_name, ... | [
"def",
"_create_tags",
"(",
"ctx",
")",
":",
"for",
"(",
"tag",
",",
"info",
")",
"in",
"_TAGS",
".",
"items",
"(",
")",
":",
"class_name",
"=",
"tag",
".",
"title",
"(",
")",
"quote_",
",",
"compact",
",",
"self_closing",
",",
"docs",
"=",
"info",... | create all classes and put them in ctx | [
"create",
"all",
"classes",
"and",
"put",
"them",
"in",
"ctx"
] | train | https://github.com/marianoguerra/rst2html5/blob/667f2c384e7b9315e86e894a455062660d7b0334/html5css3/html.py#L256-L275 |
marianoguerra/rst2html5 | html5css3/html.py | tag_from_element | def tag_from_element(el):
"""
Convert an Element into a Tag.
``el`` is an instance of ``Element``. Returns an instance of the
corresponding subclass of ``TagBase``.
"""
tag = el.tag
namespace = None
if tag.startswith('{'):
# Strip namespace of the form "{namespace}tag"
n... | python | def tag_from_element(el):
"""
Convert an Element into a Tag.
``el`` is an instance of ``Element``. Returns an instance of the
corresponding subclass of ``TagBase``.
"""
tag = el.tag
namespace = None
if tag.startswith('{'):
# Strip namespace of the form "{namespace}tag"
n... | [
"def",
"tag_from_element",
"(",
"el",
")",
":",
"tag",
"=",
"el",
".",
"tag",
"namespace",
"=",
"None",
"if",
"tag",
".",
"startswith",
"(",
"'{'",
")",
":",
"# Strip namespace of the form \"{namespace}tag\"",
"namespace",
",",
"tag",
"=",
"tag",
"[",
"1",
... | Convert an Element into a Tag.
``el`` is an instance of ``Element``. Returns an instance of the
corresponding subclass of ``TagBase``. | [
"Convert",
"an",
"Element",
"into",
"a",
"Tag",
"."
] | train | https://github.com/marianoguerra/rst2html5/blob/667f2c384e7b9315e86e894a455062660d7b0334/html5css3/html.py#L280-L304 |
marianoguerra/rst2html5 | html5css3/html.py | html_to_tags | def html_to_tags(code):
"""
Convert HTML code to tags.
``code`` is a string containing HTML code. The return value is a
list of corresponding instances of ``TagBase``.
"""
code = ('<div>' + code + '</div>').encode('utf8')
el = ET.fromstring(code)
return [tag_from_element(c) for c in el] | python | def html_to_tags(code):
"""
Convert HTML code to tags.
``code`` is a string containing HTML code. The return value is a
list of corresponding instances of ``TagBase``.
"""
code = ('<div>' + code + '</div>').encode('utf8')
el = ET.fromstring(code)
return [tag_from_element(c) for c in el] | [
"def",
"html_to_tags",
"(",
"code",
")",
":",
"code",
"=",
"(",
"'<div>'",
"+",
"code",
"+",
"'</div>'",
")",
".",
"encode",
"(",
"'utf8'",
")",
"el",
"=",
"ET",
".",
"fromstring",
"(",
"code",
")",
"return",
"[",
"tag_from_element",
"(",
"c",
")",
... | Convert HTML code to tags.
``code`` is a string containing HTML code. The return value is a
list of corresponding instances of ``TagBase``. | [
"Convert",
"HTML",
"code",
"to",
"tags",
"."
] | train | https://github.com/marianoguerra/rst2html5/blob/667f2c384e7b9315e86e894a455062660d7b0334/html5css3/html.py#L307-L316 |
marianoguerra/rst2html5 | html5css3/__init__.py | HTMLTranslator._init_math_handler | def _init_math_handler(self):
"""
Parse math configuration and set up math handler.
"""
fields = self.settings.math_output.split(None, 1)
name = fields[0].lower()
option = fields[1] if len(fields) > 1 else None
if name == 'html':
option = self.settings... | python | def _init_math_handler(self):
"""
Parse math configuration and set up math handler.
"""
fields = self.settings.math_output.split(None, 1)
name = fields[0].lower()
option = fields[1] if len(fields) > 1 else None
if name == 'html':
option = self.settings... | [
"def",
"_init_math_handler",
"(",
"self",
")",
":",
"fields",
"=",
"self",
".",
"settings",
".",
"math_output",
".",
"split",
"(",
"None",
",",
"1",
")",
"name",
"=",
"fields",
"[",
"0",
"]",
".",
"lower",
"(",
")",
"option",
"=",
"fields",
"[",
"1... | Parse math configuration and set up math handler. | [
"Parse",
"math",
"configuration",
"and",
"set",
"up",
"math",
"handler",
"."
] | train | https://github.com/marianoguerra/rst2html5/blob/667f2c384e7b9315e86e894a455062660d7b0334/html5css3/__init__.py#L495-L538 |
marianoguerra/rst2html5 | html5css3/__init__.py | HTMLTranslator.append_default_stylesheets | def append_default_stylesheets(self):
"""
Appends the default styles defined on the translator settings.
"""
for style in utils.get_stylesheet_list(self.settings):
self.css(style) | python | def append_default_stylesheets(self):
"""
Appends the default styles defined on the translator settings.
"""
for style in utils.get_stylesheet_list(self.settings):
self.css(style) | [
"def",
"append_default_stylesheets",
"(",
"self",
")",
":",
"for",
"style",
"in",
"utils",
".",
"get_stylesheet_list",
"(",
"self",
".",
"settings",
")",
":",
"self",
".",
"css",
"(",
"style",
")"
] | Appends the default styles defined on the translator settings. | [
"Appends",
"the",
"default",
"styles",
"defined",
"on",
"the",
"translator",
"settings",
"."
] | train | https://github.com/marianoguerra/rst2html5/blob/667f2c384e7b9315e86e894a455062660d7b0334/html5css3/__init__.py#L540-L545 |
marianoguerra/rst2html5 | html5css3/__init__.py | HTMLTranslator.css | def css(self, path):
"""
Link/embed CSS file.
"""
if self.settings.embed_content:
content = codecs.open(path, 'r', encoding='utf8').read()
tag = Style(content, type="text/css")
else:
tag = Link(href=path, rel="stylesheet", type_="text/css")
... | python | def css(self, path):
"""
Link/embed CSS file.
"""
if self.settings.embed_content:
content = codecs.open(path, 'r', encoding='utf8').read()
tag = Style(content, type="text/css")
else:
tag = Link(href=path, rel="stylesheet", type_="text/css")
... | [
"def",
"css",
"(",
"self",
",",
"path",
")",
":",
"if",
"self",
".",
"settings",
".",
"embed_content",
":",
"content",
"=",
"codecs",
".",
"open",
"(",
"path",
",",
"'r'",
",",
"encoding",
"=",
"'utf8'",
")",
".",
"read",
"(",
")",
"tag",
"=",
"S... | Link/embed CSS file. | [
"Link",
"/",
"embed",
"CSS",
"file",
"."
] | train | https://github.com/marianoguerra/rst2html5/blob/667f2c384e7b9315e86e894a455062660d7b0334/html5css3/__init__.py#L547-L556 |
ggaughan/pipe2py | pipe2py/lib/pprint2.py | repr_args | def repr_args(args):
"""formats a list of function arguments prettily but as working code
(kwargs are tuples (argname, argvalue)
"""
res = []
for x in args:
if isinstance(x, tuple) and len(x) == 2:
key, value = x
# todo: exclude this key if value is its default
... | python | def repr_args(args):
"""formats a list of function arguments prettily but as working code
(kwargs are tuples (argname, argvalue)
"""
res = []
for x in args:
if isinstance(x, tuple) and len(x) == 2:
key, value = x
# todo: exclude this key if value is its default
... | [
"def",
"repr_args",
"(",
"args",
")",
":",
"res",
"=",
"[",
"]",
"for",
"x",
"in",
"args",
":",
"if",
"isinstance",
"(",
"x",
",",
"tuple",
")",
"and",
"len",
"(",
"x",
")",
"==",
"2",
":",
"key",
",",
"value",
"=",
"x",
"# todo: exclude this key... | formats a list of function arguments prettily but as working code
(kwargs are tuples (argname, argvalue) | [
"formats",
"a",
"list",
"of",
"function",
"arguments",
"prettily",
"but",
"as",
"working",
"code"
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/lib/pprint2.py#L20-L33 |
ggaughan/pipe2py | pipe2py/lib/pprint2.py | repr_arg | def repr_arg(d):
"""formats a function argument prettily but as working code
unicode encodable as ascii is formatted as str"""
if isinstance(d, dict):
# if d can be expressed in key=value syntax:
return "{%s}" % ", ".join(
"%s: %s" % (repr_arg(k), repr_arg(v)) for k, v in d.item... | python | def repr_arg(d):
"""formats a function argument prettily but as working code
unicode encodable as ascii is formatted as str"""
if isinstance(d, dict):
# if d can be expressed in key=value syntax:
return "{%s}" % ", ".join(
"%s: %s" % (repr_arg(k), repr_arg(v)) for k, v in d.item... | [
"def",
"repr_arg",
"(",
"d",
")",
":",
"if",
"isinstance",
"(",
"d",
",",
"dict",
")",
":",
"# if d can be expressed in key=value syntax:",
"return",
"\"{%s}\"",
"%",
"\", \"",
".",
"join",
"(",
"\"%s: %s\"",
"%",
"(",
"repr_arg",
"(",
"k",
")",
",",
"repr... | formats a function argument prettily but as working code
unicode encodable as ascii is formatted as str | [
"formats",
"a",
"function",
"argument",
"prettily",
"but",
"as",
"working",
"code"
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/lib/pprint2.py#L36-L52 |
ggaughan/pipe2py | pipe2py/lib/pprint2.py | str_args | def str_args(args):
"""formats a list of function arguments prettily not as code
(kwargs are tuples (argname, argvalue)
"""
res = []
for x in args:
if isinstance(x, tuple) and len(x) == 2:
key, value = x
if value and str_arg(value):
res += ["%s=%s" % ... | python | def str_args(args):
"""formats a list of function arguments prettily not as code
(kwargs are tuples (argname, argvalue)
"""
res = []
for x in args:
if isinstance(x, tuple) and len(x) == 2:
key, value = x
if value and str_arg(value):
res += ["%s=%s" % ... | [
"def",
"str_args",
"(",
"args",
")",
":",
"res",
"=",
"[",
"]",
"for",
"x",
"in",
"args",
":",
"if",
"isinstance",
"(",
"x",
",",
"tuple",
")",
"and",
"len",
"(",
"x",
")",
"==",
"2",
":",
"key",
",",
"value",
"=",
"x",
"if",
"value",
"and",
... | formats a list of function arguments prettily not as code
(kwargs are tuples (argname, argvalue) | [
"formats",
"a",
"list",
"of",
"function",
"arguments",
"prettily",
"not",
"as",
"code"
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/lib/pprint2.py#L55-L68 |
ggaughan/pipe2py | pipe2py/lib/pprint2.py | str_arg | def str_arg(d):
"""formats a function argument prettily not as code
dicts are expressed in {key=value} syntax
strings are formatted using str in quotes not repr"""
if not d:
return None
if isinstance(d, dict):
if len(d) == 2 and d.get('type') == 'text' and 'value' in d:
... | python | def str_arg(d):
"""formats a function argument prettily not as code
dicts are expressed in {key=value} syntax
strings are formatted using str in quotes not repr"""
if not d:
return None
if isinstance(d, dict):
if len(d) == 2 and d.get('type') == 'text' and 'value' in d:
... | [
"def",
"str_arg",
"(",
"d",
")",
":",
"if",
"not",
"d",
":",
"return",
"None",
"if",
"isinstance",
"(",
"d",
",",
"dict",
")",
":",
"if",
"len",
"(",
"d",
")",
"==",
"2",
"and",
"d",
".",
"get",
"(",
"'type'",
")",
"==",
"'text'",
"and",
"'va... | formats a function argument prettily not as code
dicts are expressed in {key=value} syntax
strings are formatted using str in quotes not repr | [
"formats",
"a",
"function",
"argument",
"prettily",
"not",
"as",
"code"
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/lib/pprint2.py#L71-L93 |
ggaughan/pipe2py | pipe2py/modules/pipehash.py | asyncPipeHash | def asyncPipeHash(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that asynchronously hashes the given text. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : twisted Deferred iterable of items or strings
Returns
-------
_OUTPUT : twisted.int... | python | def asyncPipeHash(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that asynchronously hashes the given text. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : twisted Deferred iterable of items or strings
Returns
-------
_OUTPUT : twisted.int... | [
"def",
"asyncPipeHash",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"splits",
"=",
"yield",
"asyncGetSplits",
"(",
"_INPUT",
",",
"conf",
",",
"*",
"*",
"cdicts",
"(",
"opts",
... | A string module that asynchronously hashes the given text. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : twisted Deferred iterable of items or strings
Returns
-------
_OUTPUT : twisted.internet.defer.Deferred generator of hashed strings | [
"A",
"string",
"module",
"that",
"asynchronously",
"hashes",
"the",
"given",
"text",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipehash.py#L28-L43 |
ggaughan/pipe2py | pipe2py/modules/pipetail.py | pipe_tail | def pipe_tail(context=None, _INPUT=None, conf=None, **kwargs):
"""Returns a specified number of items from the bottom of a feed.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
kwargs -- terminal, if the truncation value is wi... | python | def pipe_tail(context=None, _INPUT=None, conf=None, **kwargs):
"""Returns a specified number of items from the bottom of a feed.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
kwargs -- terminal, if the truncation value is wi... | [
"def",
"pipe_tail",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conf",
"=",
"DotDict",
"(",
"conf",
")",
"limit",
"=",
"conf",
".",
"get",
"(",
"'count'",
",",
"func",
"="... | Returns a specified number of items from the bottom of a feed.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
kwargs -- terminal, if the truncation value is wired in
conf : count -- length of the truncated feed, if specified ... | [
"Returns",
"a",
"specified",
"number",
"of",
"items",
"from",
"the",
"bottom",
"of",
"a",
"feed",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipetail.py#L14-L32 |
ggaughan/pipe2py | pipe2py/lib/topsort.py | get_graph_component | def get_graph_component(graph):
""" Identify strongly connected components in a graph using
Tarjan's algorithm.
graph should be a dictionary mapping node names to
lists of successor nodes.
"""
components = map(partial(_visit, graph=graph), graph)
node_component = dict(_gen_node_... | python | def get_graph_component(graph):
""" Identify strongly connected components in a graph using
Tarjan's algorithm.
graph should be a dictionary mapping node names to
lists of successor nodes.
"""
components = map(partial(_visit, graph=graph), graph)
node_component = dict(_gen_node_... | [
"def",
"get_graph_component",
"(",
"graph",
")",
":",
"components",
"=",
"map",
"(",
"partial",
"(",
"_visit",
",",
"graph",
"=",
"graph",
")",
",",
"graph",
")",
"node_component",
"=",
"dict",
"(",
"_gen_node_component",
"(",
"components",
")",
")",
"grap... | Identify strongly connected components in a graph using
Tarjan's algorithm.
graph should be a dictionary mapping node names to
lists of successor nodes. | [
"Identify",
"strongly",
"connected",
"components",
"in",
"a",
"graph",
"using",
"Tarjan",
"s",
"algorithm",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/lib/topsort.py#L58-L71 |
ggaughan/pipe2py | pipe2py/modules/pipestrregex.py | asyncPipeStrregex | def asyncPipeStrregex(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that asynchronously replaces text using regexes. Each
has the general format: "In [field] replace [regex pattern] with [text]".
Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT :... | python | def asyncPipeStrregex(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that asynchronously replaces text using regexes. Each
has the general format: "In [field] replace [regex pattern] with [text]".
Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT :... | [
"def",
"asyncPipeStrregex",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"splits",
"=",
"yield",
"asyncGetSplits",
"(",
"_INPUT",
",",
"conf",
"[",
"'RULE'",
"]",
",",
"*",
"*",... | A string module that asynchronously replaces text using regexes. Each
has the general format: "In [field] replace [regex pattern] with [text]".
Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : twisted Deferred iterable of items or strings
conf : {
'RULE': [
... | [
"A",
"string",
"module",
"that",
"asynchronously",
"replaces",
"text",
"using",
"regexes",
".",
"Each",
"has",
"the",
"general",
"format",
":",
"In",
"[",
"field",
"]",
"replace",
"[",
"regex",
"pattern",
"]",
"with",
"[",
"text",
"]",
".",
"Loopable",
"... | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipestrregex.py#L33-L59 |
ggaughan/pipe2py | pipe2py/modules/pipestrregex.py | pipe_strregex | def pipe_strregex(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that replaces text using regexes. Each has the general
format: "In [field] replace [regex pattern] with [text]". Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : iterable of items or s... | python | def pipe_strregex(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that replaces text using regexes. Each has the general
format: "In [field] replace [regex pattern] with [text]". Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : iterable of items or s... | [
"def",
"pipe_strregex",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"splits",
"=",
"get_splits",
"(",
"_INPUT",
",",
"conf",
"[",
"'RULE'",
"]",
",",
"*",
"*",
"cdicts",
"(",... | A string module that replaces text using regexes. Each has the general
format: "In [field] replace [regex pattern] with [text]". Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : iterable of items or strings
conf : {
'RULE': [
{
'match... | [
"A",
"string",
"module",
"that",
"replaces",
"text",
"using",
"regexes",
".",
"Each",
"has",
"the",
"general",
"format",
":",
"In",
"[",
"field",
"]",
"replace",
"[",
"regex",
"pattern",
"]",
"with",
"[",
"text",
"]",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipestrregex.py#L67-L91 |
ggaughan/pipe2py | pipe2py/modules/pipexpathfetchpage.py | pipe_xpathfetchpage | def pipe_xpathfetchpage(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that fetches the content of a given website as DOM nodes or a
string. Loopable.
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : dict
URL -- url object cont... | python | def pipe_xpathfetchpage(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that fetches the content of a given website as DOM nodes or a
string. Loopable.
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : dict
URL -- url object cont... | [
"def",
"pipe_xpathfetchpage",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conf",
"=",
"DotDict",
"(",
"conf",
")",
"urls",
"=",
"utils",
".",
"listize",
"(",
"conf",
"[",
"'... | A source that fetches the content of a given website as DOM nodes or a
string. Loopable.
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : dict
URL -- url object contain the URL to download
xpath -- xpath to extract
html5 -- use htm... | [
"A",
"source",
"that",
"fetches",
"the",
"content",
"of",
"a",
"given",
"website",
"as",
"DOM",
"nodes",
"or",
"a",
"string",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipexpathfetchpage.py#L17-L82 |
ggaughan/pipe2py | pipe2py/lib/utils.py | extract_dependencies | def extract_dependencies(pipe_def=None, pipe_generator=None):
"""Extract modules used by a pipe"""
if pipe_def:
pydeps = gen_dependencies(pipe_def)
elif pipe_generator:
pydeps = pipe_generator(Context(describe_dependencies=True))
else:
raise Exception('Must supply at least one kw... | python | def extract_dependencies(pipe_def=None, pipe_generator=None):
"""Extract modules used by a pipe"""
if pipe_def:
pydeps = gen_dependencies(pipe_def)
elif pipe_generator:
pydeps = pipe_generator(Context(describe_dependencies=True))
else:
raise Exception('Must supply at least one kw... | [
"def",
"extract_dependencies",
"(",
"pipe_def",
"=",
"None",
",",
"pipe_generator",
"=",
"None",
")",
":",
"if",
"pipe_def",
":",
"pydeps",
"=",
"gen_dependencies",
"(",
"pipe_def",
")",
"elif",
"pipe_generator",
":",
"pydeps",
"=",
"pipe_generator",
"(",
"Con... | Extract modules used by a pipe | [
"Extract",
"modules",
"used",
"by",
"a",
"pipe"
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/lib/utils.py#L74-L83 |
ggaughan/pipe2py | pipe2py/lib/utils.py | extract_input | def extract_input(pipe_def=None, pipe_generator=None):
"""Extract inputs required by a pipe"""
if pipe_def:
pyinput = gen_input(pipe_def)
elif pipe_generator:
pyinput = pipe_generator(Context(describe_input=True))
else:
raise Exception('Must supply at least one kwarg!')
retu... | python | def extract_input(pipe_def=None, pipe_generator=None):
"""Extract inputs required by a pipe"""
if pipe_def:
pyinput = gen_input(pipe_def)
elif pipe_generator:
pyinput = pipe_generator(Context(describe_input=True))
else:
raise Exception('Must supply at least one kwarg!')
retu... | [
"def",
"extract_input",
"(",
"pipe_def",
"=",
"None",
",",
"pipe_generator",
"=",
"None",
")",
":",
"if",
"pipe_def",
":",
"pyinput",
"=",
"gen_input",
"(",
"pipe_def",
")",
"elif",
"pipe_generator",
":",
"pyinput",
"=",
"pipe_generator",
"(",
"Context",
"("... | Extract inputs required by a pipe | [
"Extract",
"inputs",
"required",
"by",
"a",
"pipe"
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/lib/utils.py#L86-L95 |
ggaughan/pipe2py | pipe2py/lib/utils.py | pythonise | def pythonise(id, encoding='ascii'):
"""Return a Python-friendly id"""
replace = {'-': '_', ':': '_', '/': '_'}
func = lambda id, pair: id.replace(pair[0], pair[1])
id = reduce(func, replace.iteritems(), id)
id = '_%s' % id if id[0] in string.digits else id
return id.encode(encoding) | python | def pythonise(id, encoding='ascii'):
"""Return a Python-friendly id"""
replace = {'-': '_', ':': '_', '/': '_'}
func = lambda id, pair: id.replace(pair[0], pair[1])
id = reduce(func, replace.iteritems(), id)
id = '_%s' % id if id[0] in string.digits else id
return id.encode(encoding) | [
"def",
"pythonise",
"(",
"id",
",",
"encoding",
"=",
"'ascii'",
")",
":",
"replace",
"=",
"{",
"'-'",
":",
"'_'",
",",
"':'",
":",
"'_'",
",",
"'/'",
":",
"'_'",
"}",
"func",
"=",
"lambda",
"id",
",",
"pair",
":",
"id",
".",
"replace",
"(",
"pa... | Return a Python-friendly id | [
"Return",
"a",
"Python",
"-",
"friendly",
"id"
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/lib/utils.py#L98-L104 |
ggaughan/pipe2py | pipe2py/lib/utils.py | etree_to_dict | def etree_to_dict(element):
"""Convert an eTree xml into dict imitating how Yahoo Pipes does it.
todo: further investigate white space and multivalue handling
"""
i = dict(element.items())
content = element.text.strip() if element.text else None
i.update({'content': content}) if content else No... | python | def etree_to_dict(element):
"""Convert an eTree xml into dict imitating how Yahoo Pipes does it.
todo: further investigate white space and multivalue handling
"""
i = dict(element.items())
content = element.text.strip() if element.text else None
i.update({'content': content}) if content else No... | [
"def",
"etree_to_dict",
"(",
"element",
")",
":",
"i",
"=",
"dict",
"(",
"element",
".",
"items",
"(",
")",
")",
"content",
"=",
"element",
".",
"text",
".",
"strip",
"(",
")",
"if",
"element",
".",
"text",
"else",
"None",
"i",
".",
"update",
"(",
... | Convert an eTree xml into dict imitating how Yahoo Pipes does it.
todo: further investigate white space and multivalue handling | [
"Convert",
"an",
"eTree",
"xml",
"into",
"dict",
"imitating",
"how",
"Yahoo",
"Pipes",
"does",
"it",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/lib/utils.py#L146-L170 |
ggaughan/pipe2py | pipe2py/lib/utils.py | broadcast | def broadcast(_INPUT, *funcs, **kwargs):
"""copies an iterable and delivers the items to multiple functions
/--> foo2bar(_INPUT) --> \
/ \
_INPUT ---> foo2baz(_INPUT) ---> _OUTPUT
\ /
\--> foo2qux(_INPUT) --> /
One... | python | def broadcast(_INPUT, *funcs, **kwargs):
"""copies an iterable and delivers the items to multiple functions
/--> foo2bar(_INPUT) --> \
/ \
_INPUT ---> foo2baz(_INPUT) ---> _OUTPUT
\ /
\--> foo2qux(_INPUT) --> /
One... | [
"def",
"broadcast",
"(",
"_INPUT",
",",
"*",
"funcs",
",",
"*",
"*",
"kwargs",
")",
":",
"map_func",
"=",
"kwargs",
".",
"get",
"(",
"'map_func'",
",",
"_map_func",
")",
"apply_func",
"=",
"kwargs",
".",
"get",
"(",
"'apply_func'",
",",
"_apply_func",
... | copies an iterable and delivers the items to multiple functions
/--> foo2bar(_INPUT) --> \
/ \
_INPUT ---> foo2baz(_INPUT) ---> _OUTPUT
\ /
\--> foo2qux(_INPUT) --> /
One way to construct such a flow in code would be::... | [
"copies",
"an",
"iterable",
"and",
"delivers",
"the",
"items",
"to",
"multiple",
"functions"
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/lib/utils.py#L217-L238 |
ggaughan/pipe2py | pipe2py/lib/utils.py | dispatch | def dispatch(splits, *funcs, **kwargs):
"""takes multiple iterables (returned by dispatch or broadcast) and delivers
the items to multiple functions
/-----> _INPUT1 --> double(_INPUT1) --> \
/ \
splits ------> _INPUT2 --> triple(_INPUT2) ---> _OU... | python | def dispatch(splits, *funcs, **kwargs):
"""takes multiple iterables (returned by dispatch or broadcast) and delivers
the items to multiple functions
/-----> _INPUT1 --> double(_INPUT1) --> \
/ \
splits ------> _INPUT2 --> triple(_INPUT2) ---> _OU... | [
"def",
"dispatch",
"(",
"splits",
",",
"*",
"funcs",
",",
"*",
"*",
"kwargs",
")",
":",
"map_func",
"=",
"kwargs",
".",
"get",
"(",
"'map_func'",
",",
"_map_func",
")",
"apply_func",
"=",
"kwargs",
".",
"get",
"(",
"'apply_func'",
",",
"_apply_func",
"... | takes multiple iterables (returned by dispatch or broadcast) and delivers
the items to multiple functions
/-----> _INPUT1 --> double(_INPUT1) --> \
/ \
splits ------> _INPUT2 --> triple(_INPUT2) ---> _OUTPUT
\ ... | [
"takes",
"multiple",
"iterables",
"(",
"returned",
"by",
"dispatch",
"or",
"broadcast",
")",
"and",
"delivers",
"the",
"items",
"to",
"multiple",
"functions"
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/lib/utils.py#L241-L262 |
ggaughan/pipe2py | pipe2py/lib/utils.py | get_input | def get_input(context, conf):
"""Gets a user parameter, either from the console or from an outer
submodule/system
Assumes conf has name, default, prompt and debug
"""
name = conf['name']['value']
prompt = conf['prompt']['value']
default = conf['default']['value'] or conf['debug']['va... | python | def get_input(context, conf):
"""Gets a user parameter, either from the console or from an outer
submodule/system
Assumes conf has name, default, prompt and debug
"""
name = conf['name']['value']
prompt = conf['prompt']['value']
default = conf['default']['value'] or conf['debug']['va... | [
"def",
"get_input",
"(",
"context",
",",
"conf",
")",
":",
"name",
"=",
"conf",
"[",
"'name'",
"]",
"[",
"'value'",
"]",
"prompt",
"=",
"conf",
"[",
"'prompt'",
"]",
"[",
"'value'",
"]",
"default",
"=",
"conf",
"[",
"'default'",
"]",
"[",
"'value'",
... | Gets a user parameter, either from the console or from an outer
submodule/system
Assumes conf has name, default, prompt and debug | [
"Gets",
"a",
"user",
"parameter",
"either",
"from",
"the",
"console",
"or",
"from",
"an",
"outer",
"submodule",
"/",
"system"
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/lib/utils.py#L295-L314 |
ggaughan/pipe2py | pipe2py/lib/utils.py | url_quote | def url_quote(url):
"""Ensure url is valid"""
try:
return quote(url, safe=URL_SAFE)
except KeyError:
return quote(encode(url), safe=URL_SAFE) | python | def url_quote(url):
"""Ensure url is valid"""
try:
return quote(url, safe=URL_SAFE)
except KeyError:
return quote(encode(url), safe=URL_SAFE) | [
"def",
"url_quote",
"(",
"url",
")",
":",
"try",
":",
"return",
"quote",
"(",
"url",
",",
"safe",
"=",
"URL_SAFE",
")",
"except",
"KeyError",
":",
"return",
"quote",
"(",
"encode",
"(",
"url",
")",
",",
"safe",
"=",
"URL_SAFE",
")"
] | Ensure url is valid | [
"Ensure",
"url",
"is",
"valid"
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/lib/utils.py#L370-L375 |
ggaughan/pipe2py | pipe2py/lib/utils.py | multi_substitute | def multi_substitute(word, rules):
""" Apply multiple regex rules to 'word'
http://code.activestate.com/recipes/
576710-multi-regex-single-pass-replace-of-multiple-regexe/
"""
flags = rules[0]['flags']
# Create a combined regex from the rules
tuples = ((p, r['match']) for p, r in enumerate(... | python | def multi_substitute(word, rules):
""" Apply multiple regex rules to 'word'
http://code.activestate.com/recipes/
576710-multi-regex-single-pass-replace-of-multiple-regexe/
"""
flags = rules[0]['flags']
# Create a combined regex from the rules
tuples = ((p, r['match']) for p, r in enumerate(... | [
"def",
"multi_substitute",
"(",
"word",
",",
"rules",
")",
":",
"flags",
"=",
"rules",
"[",
"0",
"]",
"[",
"'flags'",
"]",
"# Create a combined regex from the rules",
"tuples",
"=",
"(",
"(",
"p",
",",
"r",
"[",
"'match'",
"]",
")",
"for",
"p",
",",
"r... | Apply multiple regex rules to 'word'
http://code.activestate.com/recipes/
576710-multi-regex-single-pass-replace-of-multiple-regexe/ | [
"Apply",
"multiple",
"regex",
"rules",
"to",
"word",
"http",
":",
"//",
"code",
".",
"activestate",
".",
"com",
"/",
"recipes",
"/",
"576710",
"-",
"multi",
"-",
"regex",
"-",
"single",
"-",
"pass",
"-",
"replace",
"-",
"of",
"-",
"multiple",
"-",
"r... | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/lib/utils.py#L397-L486 |
ggaughan/pipe2py | pipe2py/modules/pipeitembuilder.py | asyncPipeItembuilder | def asyncPipeItembuilder(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that asynchronously builds an item. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : asyncPipe like object (twisted Deferred iterable of items)
conf : {
'attrs': [
... | python | def asyncPipeItembuilder(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that asynchronously builds an item. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : asyncPipe like object (twisted Deferred iterable of items)
conf : {
'attrs': [
... | [
"def",
"asyncPipeItembuilder",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"pkwargs",
"=",
"cdicts",
"(",
"opts",
",",
"kwargs",
")",
"asyncFuncs",
"=",
"yield",
"asyncGetSplits",
... | A source that asynchronously builds an item. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : asyncPipe like object (twisted Deferred iterable of items)
conf : {
'attrs': [
{'key': {'value': 'title'}, 'value': {'value': 'new title'}},
{'key':... | [
"A",
"source",
"that",
"asynchronously",
"builds",
"an",
"item",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipeitembuilder.py#L23-L49 |
ggaughan/pipe2py | pipe2py/modules/pipeitembuilder.py | pipe_itembuilder | def pipe_itembuilder(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that builds an item. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items
conf : {
'attrs': [
{'key': {'value': <'title'>}, 'value'... | python | def pipe_itembuilder(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that builds an item. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items
conf : {
'attrs': [
{'key': {'value': <'title'>}, 'value'... | [
"def",
"pipe_itembuilder",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"funcs",
"=",
"get_splits",
"(",
"None",
",",
"conf",
"[",
"'attrs'",
"]",
",",
"*",
"*",
"cdicts",
"("... | A source that builds an item. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items
conf : {
'attrs': [
{'key': {'value': <'title'>}, 'value': {'value': <'chair'>}},
{'key': {'value': <'color'>}, 'value': {... | [
"A",
"source",
"that",
"builds",
"an",
"item",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipeitembuilder.py#L53-L77 |
ggaughan/pipe2py | pipe2py/modules/pipeloop.py | asyncPipeLoop | def asyncPipeLoop(context=None, _INPUT=None, conf=None, embed=None, **kwargs):
"""An operator that asynchronously loops over the input and performs the
embedded submodule. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : asyncPipe like object (twisted Deferred itera... | python | def asyncPipeLoop(context=None, _INPUT=None, conf=None, embed=None, **kwargs):
"""An operator that asynchronously loops over the input and performs the
embedded submodule. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : asyncPipe like object (twisted Deferred itera... | [
"def",
"asyncPipeLoop",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"embed",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"cust_func",
"=",
"get_cust_func",
"(",
"context",
",",
"conf",
",",
"embed",
","... | An operator that asynchronously loops over the input and performs the
embedded submodule. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : asyncPipe like object (twisted Deferred iterable of items)
embed : the submodule, i.e., asyncPipe*(context, _INPUT, conf)
... | [
"An",
"operator",
"that",
"asynchronously",
"loops",
"over",
"the",
"input",
"and",
"performs",
"the",
"embedded",
"submodule",
".",
"Not",
"loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipeloop.py#L89-L119 |
ggaughan/pipe2py | pipe2py/modules/pipeloop.py | pipe_loop | def pipe_loop(context=None, _INPUT=None, conf=None, embed=None, **kwargs):
"""An operator that loops over the input and performs the embedded
submodule. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
embed :... | python | def pipe_loop(context=None, _INPUT=None, conf=None, embed=None, **kwargs):
"""An operator that loops over the input and performs the embedded
submodule. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
embed :... | [
"def",
"pipe_loop",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"embed",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"cust_func",
"=",
"get_cust_func",
"(",
"context",
",",
"conf",
",",
"embed",
",",
... | An operator that loops over the input and performs the embedded
submodule. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
embed : the submodule, i.e., pipe_*(context, _INPUT, conf)
Most modules, with the... | [
"An",
"operator",
"that",
"loops",
"over",
"the",
"input",
"and",
"performs",
"the",
"embedded",
"submodule",
".",
"Not",
"loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipeloop.py#L123-L153 |
ggaughan/pipe2py | pipe2py/modules/pipefetchpage.py | pipe_fetchpage | def pipe_fetchpage(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that fetches the content of a given web site as a string.
Loopable.
context : pipe2py.Context object
_INPUT : pipeforever asyncPipe or an iterable of items or fields
conf : dict
URL -- url object contain the URL... | python | def pipe_fetchpage(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that fetches the content of a given web site as a string.
Loopable.
context : pipe2py.Context object
_INPUT : pipeforever asyncPipe or an iterable of items or fields
conf : dict
URL -- url object contain the URL... | [
"def",
"pipe_fetchpage",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conf",
"=",
"DotDict",
"(",
"conf",
")",
"split_token",
"=",
"conf",
".",
"get",
"(",
"'token'",
",",
"*... | A source that fetches the content of a given web site as a string.
Loopable.
context : pipe2py.Context object
_INPUT : pipeforever asyncPipe or an iterable of items or fields
conf : dict
URL -- url object contain the URL to download
from -- string from where to start the input
to ... | [
"A",
"source",
"that",
"fetches",
"the",
"content",
"of",
"a",
"given",
"web",
"site",
"as",
"a",
"string",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipefetchpage.py#L50-L117 |
ggaughan/pipe2py | pipe2py/modules/pipefetchdata.py | pipe_fetchdata | def pipe_fetchdata(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that fetches and parses an XML or JSON file. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : {
'URL': {'value': <url>},
... | python | def pipe_fetchdata(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that fetches and parses an XML or JSON file. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : {
'URL': {'value': <url>},
... | [
"def",
"pipe_fetchdata",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# todo: iCal and KML",
"funcs",
"=",
"get_splits",
"(",
"None",
",",
"conf",
",",
"*",
"*",
"cdicts",
"(",
... | A source that fetches and parses an XML or JSON file. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : {
'URL': {'value': <url>},
'path': {'value': <dot separated path to data list>}
}
Yields... | [
"A",
"source",
"that",
"fetches",
"and",
"parses",
"an",
"XML",
"or",
"JSON",
"file",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipefetchdata.py#L89-L132 |
ggaughan/pipe2py | pipe2py/modules/pipefetch.py | asyncPipeFetch | def asyncPipeFetch(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that asynchronously fetches and parses one or more feeds to
return the feed entries. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : asyncPipe like object (twisted Deferred iterable of item... | python | def asyncPipeFetch(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that asynchronously fetches and parses one or more feeds to
return the feed entries. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : asyncPipe like object (twisted Deferred iterable of item... | [
"def",
"asyncPipeFetch",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"splits",
"=",
"yield",
"asyncGetSplits",
"(",
"_INPUT",
",",
"conf",
"[",
"'URL'",
"]",
",",
"*",
"*",
"... | A source that asynchronously fetches and parses one or more feeds to
return the feed entries. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : asyncPipe like object (twisted Deferred iterable of items)
conf : {
'URL': [
{'type': 'url', 'value': <url1... | [
"A",
"source",
"that",
"asynchronously",
"fetches",
"and",
"parses",
"one",
"or",
"more",
"feeds",
"to",
"return",
"the",
"feed",
"entries",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipefetch.py#L51-L74 |
ggaughan/pipe2py | pipe2py/modules/pipefetch.py | pipe_fetch | def pipe_fetch(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that fetches and parses one or more feeds to return the
entries. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : {
'URL': [... | python | def pipe_fetch(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that fetches and parses one or more feeds to return the
entries. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : {
'URL': [... | [
"def",
"pipe_fetch",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"splits",
"=",
"get_splits",
"(",
"_INPUT",
",",
"conf",
"[",
"'URL'",
"]",
",",
"*",
"*",
"cdicts",
"(",
"... | A source that fetches and parses one or more feeds to return the
entries. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : {
'URL': [
{'type': 'url', 'value': <url1>},
{'type': 'ur... | [
"A",
"source",
"that",
"fetches",
"and",
"parses",
"one",
"or",
"more",
"feeds",
"to",
"return",
"the",
"entries",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipefetch.py#L86-L109 |
ggaughan/pipe2py | pipe2py/modules/pipefilter.py | pipe_filter | def pipe_filter(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that filters for source items matching the given rules.
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : {
'MODE':... | python | def pipe_filter(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that filters for source items matching the given rules.
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : {
'MODE':... | [
"def",
"pipe_filter",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conf",
"=",
"DotDict",
"(",
"conf",
")",
"test",
"=",
"kwargs",
".",
"pop",
"(",
"'pass_if'",
",",
"None",
... | An operator that filters for source items matching the given rules.
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : {
'MODE': {'value': <'permit' or 'block'>},
'COMBINE': {'value': <'and' o... | [
"An",
"operator",
"that",
"filters",
"for",
"source",
"items",
"matching",
"the",
"given",
"rules",
".",
"Not",
"loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipefilter.py#L80-L152 |
ggaughan/pipe2py | pipe2py/modules/pipesplit.py | pipe_split | def pipe_split(context, _INPUT, conf, splits, **kwargs):
"""An operator that splits a source into identical copies. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : dict
splits : number of copies
Y... | python | def pipe_split(context, _INPUT, conf, splits, **kwargs):
"""An operator that splits a source into identical copies. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : dict
splits : number of copies
Y... | [
"def",
"pipe_split",
"(",
"context",
",",
"_INPUT",
",",
"conf",
",",
"splits",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"Split",
"(",
"context",
",",
"_INPUT",
",",
"conf",
",",
"splits",
",",
"*",
"*",
"kwargs",
")"
] | An operator that splits a source into identical copies. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : dict
splits : number of copies
Yields
------
_OUTPUT, _OUTPUT2... : copies of all source... | [
"An",
"operator",
"that",
"splits",
"a",
"source",
"into",
"identical",
"copies",
".",
"Not",
"loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipesplit.py#L33-L47 |
ggaughan/pipe2py | pipe2py/modules/pipedatebuilder.py | pipe_datebuilder | def pipe_datebuilder(context=None, _INPUT=None, conf=None, **kwargs):
"""A date module that converts a text string into a datetime value. Useful
as terminal data. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items
conf : {'DATE... | python | def pipe_datebuilder(context=None, _INPUT=None, conf=None, **kwargs):
"""A date module that converts a text string into a datetime value. Useful
as terminal data. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items
conf : {'DATE... | [
"def",
"pipe_datebuilder",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conf",
"=",
"DotDict",
"(",
"conf",
")",
"for",
"item",
"in",
"_INPUT",
":",
"_input",
"=",
"DotDict",
... | A date module that converts a text string into a datetime value. Useful
as terminal data. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items
conf : {'DATE': {'type': 'datetime', 'value': '12/2/2014'}}
Yields
------
_OU... | [
"A",
"date",
"module",
"that",
"converts",
"a",
"text",
"string",
"into",
"a",
"datetime",
"value",
".",
"Useful",
"as",
"terminal",
"data",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipedatebuilder.py#L25-L60 |
ggaughan/pipe2py | pipe2py/twisted/utils.py | asyncImap | def asyncImap(asyncCallable, *iterables):
"""itertools.imap for deferred callables
"""
deferreds = imap(asyncCallable, *iterables)
return gatherResults(deferreds, consumeErrors=True) | python | def asyncImap(asyncCallable, *iterables):
"""itertools.imap for deferred callables
"""
deferreds = imap(asyncCallable, *iterables)
return gatherResults(deferreds, consumeErrors=True) | [
"def",
"asyncImap",
"(",
"asyncCallable",
",",
"*",
"iterables",
")",
":",
"deferreds",
"=",
"imap",
"(",
"asyncCallable",
",",
"*",
"iterables",
")",
"return",
"gatherResults",
"(",
"deferreds",
",",
"consumeErrors",
"=",
"True",
")"
] | itertools.imap for deferred callables | [
"itertools",
".",
"imap",
"for",
"deferred",
"callables"
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/twisted/utils.py#L86-L90 |
ggaughan/pipe2py | pipe2py/twisted/utils.py | asyncStarCmap | def asyncStarCmap(asyncCallable, iterable):
"""itertools.starmap for deferred callables using cooperative multitasking
"""
results = []
yield coopStar(asyncCallable, results.append, iterable)
returnValue(results) | python | def asyncStarCmap(asyncCallable, iterable):
"""itertools.starmap for deferred callables using cooperative multitasking
"""
results = []
yield coopStar(asyncCallable, results.append, iterable)
returnValue(results) | [
"def",
"asyncStarCmap",
"(",
"asyncCallable",
",",
"iterable",
")",
":",
"results",
"=",
"[",
"]",
"yield",
"coopStar",
"(",
"asyncCallable",
",",
"results",
".",
"append",
",",
"iterable",
")",
"returnValue",
"(",
"results",
")"
] | itertools.starmap for deferred callables using cooperative multitasking | [
"itertools",
".",
"starmap",
"for",
"deferred",
"callables",
"using",
"cooperative",
"multitasking"
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/twisted/utils.py#L94-L99 |
ggaughan/pipe2py | pipe2py/twisted/utils.py | asyncStarPmap | def asyncStarPmap(asyncCallable, iterable):
"""itertools.starmap for deferred callables using parallel cooperative
multitasking
"""
results = []
yield asyncStarParallel(asyncCallable, results.append, iterable)
returnValue(results) | python | def asyncStarPmap(asyncCallable, iterable):
"""itertools.starmap for deferred callables using parallel cooperative
multitasking
"""
results = []
yield asyncStarParallel(asyncCallable, results.append, iterable)
returnValue(results) | [
"def",
"asyncStarPmap",
"(",
"asyncCallable",
",",
"iterable",
")",
":",
"results",
"=",
"[",
"]",
"yield",
"asyncStarParallel",
"(",
"asyncCallable",
",",
"results",
".",
"append",
",",
"iterable",
")",
"returnValue",
"(",
"results",
")"
] | itertools.starmap for deferred callables using parallel cooperative
multitasking | [
"itertools",
".",
"starmap",
"for",
"deferred",
"callables",
"using",
"parallel",
"cooperative",
"multitasking"
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/twisted/utils.py#L103-L109 |
ggaughan/pipe2py | pipe2py/twisted/utils.py | asyncStarMap | def asyncStarMap(asyncCallable, iterable):
"""itertools.starmap for deferred callables
"""
deferreds = starmap(asyncCallable, iterable)
return gatherResults(deferreds, consumeErrors=True) | python | def asyncStarMap(asyncCallable, iterable):
"""itertools.starmap for deferred callables
"""
deferreds = starmap(asyncCallable, iterable)
return gatherResults(deferreds, consumeErrors=True) | [
"def",
"asyncStarMap",
"(",
"asyncCallable",
",",
"iterable",
")",
":",
"deferreds",
"=",
"starmap",
"(",
"asyncCallable",
",",
"iterable",
")",
"return",
"gatherResults",
"(",
"deferreds",
",",
"consumeErrors",
"=",
"True",
")"
] | itertools.starmap for deferred callables | [
"itertools",
".",
"starmap",
"for",
"deferred",
"callables"
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/twisted/utils.py#L112-L116 |
ggaughan/pipe2py | pipe2py/modules/piperssitembuilder.py | pipe_rssitembuilder | def pipe_rssitembuilder(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that builds an rss item. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever asyncPipe or an iterable of items or fields
conf : {
'mediaContentType': {'type': 'text', '... | python | def pipe_rssitembuilder(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that builds an rss item. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever asyncPipe or an iterable of items or fields
conf : {
'mediaContentType': {'type': 'text', '... | [
"def",
"pipe_rssitembuilder",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"get_value",
"=",
"partial",
"(",
"utils",
".",
"get_value",
",",
"*",
"*",
"kwargs",
")",
"pkwargs",
... | A source that builds an rss item. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever asyncPipe or an iterable of items or fields
conf : {
'mediaContentType': {'type': 'text', 'value': ''},
'mediaContentHeight': {'type': 'text', 'value': ''},
... | [
"A",
"source",
"that",
"builds",
"an",
"rss",
"item",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/piperssitembuilder.py#L20-L63 |
ggaughan/pipe2py | pipe2py/modules/pipestrconcat.py | asyncPipeStrconcat | def asyncPipeStrconcat(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that asynchronously builds a string. Loopable. No direct
input.
Parameters
----------
context : pipe2py.Context object
_INPUT : asyncPipe like object (twisted Deferred iterable of items)
conf : {
... | python | def asyncPipeStrconcat(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that asynchronously builds a string. Loopable. No direct
input.
Parameters
----------
context : pipe2py.Context object
_INPUT : asyncPipe like object (twisted Deferred iterable of items)
conf : {
... | [
"def",
"asyncPipeStrconcat",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"splits",
"=",
"yield",
"asyncGetSplits",
"(",
"_INPUT",
",",
"conf",
"[",
"'part'",
"]",
",",
"*",
"*"... | A string module that asynchronously builds a string. Loopable. No direct
input.
Parameters
----------
context : pipe2py.Context object
_INPUT : asyncPipe like object (twisted Deferred iterable of items)
conf : {
'part': [
{'value': <'<img src="'>},
{'subkey': <'i... | [
"A",
"string",
"module",
"that",
"asynchronously",
"builds",
"a",
"string",
".",
"Loopable",
".",
"No",
"direct",
"input",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipestrconcat.py#L28-L50 |
ggaughan/pipe2py | pipe2py/modules/pipestrconcat.py | pipe_strconcat | def pipe_strconcat(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that builds a string. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items
conf : {
'part': [
{'value': '<img src="'},
... | python | def pipe_strconcat(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that builds a string. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items
conf : {
'part': [
{'value': '<img src="'},
... | [
"def",
"pipe_strconcat",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"splits",
"=",
"get_splits",
"(",
"_INPUT",
",",
"conf",
"[",
"'part'",
"]",
",",
"*",
"*",
"cdicts",
"("... | A string module that builds a string. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items
conf : {
'part': [
{'value': '<img src="'},
{'subkey': 'img.src'},
{'value': '">'}
]
}
... | [
"A",
"string",
"module",
"that",
"builds",
"a",
"string",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipestrconcat.py#L54-L75 |
ggaughan/pipe2py | pipe2py/modules/pipeuniq.py | asyncPipeUniq | def asyncPipeUniq(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that asynchronously filters out non unique items according
to the specified field. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : twisted Deferred iterable of items
conf : {'fiel... | python | def asyncPipeUniq(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that asynchronously filters out non unique items according
to the specified field. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : twisted Deferred iterable of items
conf : {'fiel... | [
"def",
"asyncPipeUniq",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"_input",
"=",
"yield",
"_INPUT",
"asyncFuncs",
"=",
"yield",
"asyncGetSplits",
"(",
"None",
",",
"conf",
",",... | An operator that asynchronously filters out non unique items according
to the specified field. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : twisted Deferred iterable of items
conf : {'field': {'type': 'text', 'value': <field to be unique>}}
returns
----... | [
"An",
"operator",
"that",
"asynchronously",
"filters",
"out",
"non",
"unique",
"items",
"according",
"to",
"the",
"specified",
"field",
".",
"Not",
"loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipeuniq.py#L31-L50 |
ggaughan/pipe2py | pipe2py/modules/pipeuniq.py | pipe_uniq | def pipe_uniq(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that filters out non unique items according to the specified
field. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
kwargs -- othe... | python | def pipe_uniq(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that filters out non unique items according to the specified
field. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
kwargs -- othe... | [
"def",
"pipe_uniq",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"funcs",
"=",
"get_splits",
"(",
"None",
",",
"conf",
",",
"*",
"*",
"cdicts",
"(",
"opts",
",",
"kwargs",
"... | An operator that filters out non unique items according to the specified
field. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
kwargs -- other inputs, e.g. to feed terminals for rule values
conf : {'field': ... | [
"An",
"operator",
"that",
"filters",
"out",
"non",
"unique",
"items",
"according",
"to",
"the",
"specified",
"field",
".",
"Not",
"loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipeuniq.py#L54-L72 |
ggaughan/pipe2py | pipe2py/modules/pipeunion.py | asyncPipeUnion | def asyncPipeUnion(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that asynchronously merges multiple source together.
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : asyncPipe like object (twisted Deferred iterable of items)
conf : unused
... | python | def asyncPipeUnion(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that asynchronously merges multiple source together.
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : asyncPipe like object (twisted Deferred iterable of items)
conf : unused
... | [
"def",
"asyncPipeUnion",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"_input",
"=",
"yield",
"_INPUT",
"_OUTPUT",
"=",
"get_output",
"(",
"_input",
",",
"*",
"*",
"kwargs",
")"... | An operator that asynchronously merges multiple source together.
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : asyncPipe like object (twisted Deferred iterable of items)
conf : unused
Keyword arguments
-----------------
_OTHER1 : asyncPipe like objec... | [
"An",
"operator",
"that",
"asynchronously",
"merges",
"multiple",
"source",
"together",
".",
"Not",
"loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipeunion.py#L26-L47 |
ggaughan/pipe2py | pipe2py/modules/pipeunion.py | pipe_union | def pipe_union(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that merges multiple source together. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : unused
Keyword arguments
-----... | python | def pipe_union(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that merges multiple source together. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : unused
Keyword arguments
-----... | [
"def",
"pipe_union",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"_OUTPUT",
"=",
"get_output",
"(",
"_INPUT",
",",
"*",
"*",
"kwargs",
")",
"return",
"_OUTPUT"
] | An operator that merges multiple source together. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : unused
Keyword arguments
-----------------
_OTHER1 : pipe2py.modules pipe like object
_OTHER2... | [
"An",
"operator",
"that",
"merges",
"multiple",
"source",
"together",
".",
"Not",
"loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipeunion.py#L51-L70 |
ggaughan/pipe2py | pipe2py/modules/pipesort.py | pipe_sort | def pipe_sort(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that sorts the input source according to the specified key.
Not loopable. Not lazy.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
kwargs -- ot... | python | def pipe_sort(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that sorts the input source according to the specified key.
Not loopable. Not lazy.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
kwargs -- ot... | [
"def",
"pipe_sort",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"test",
"=",
"kwargs",
".",
"pop",
"(",
"'pass_if'",
",",
"None",
")",
"_pass",
"=",
"utils",
".",
"get_pass",... | An operator that sorts the input source according to the specified key.
Not loopable. Not lazy.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
kwargs -- other inputs, e.g. to feed terminals for rule values
conf : {
... | [
"An",
"operator",
"that",
"sorts",
"the",
"input",
"source",
"according",
"to",
"the",
"specified",
"key",
".",
"Not",
"loopable",
".",
"Not",
"lazy",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipesort.py#L40-L72 |
ggaughan/pipe2py | pipe2py/modules/pipecreaterss.py | pipe_createrss | def pipe_createrss(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that converts a source into an RSS stream. Not loopable.
"""
conf = DotDict(conf)
for item in _INPUT:
item = DotDict(item)
yield {
value: item.get(conf.get(key, **kwargs))
for ke... | python | def pipe_createrss(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that converts a source into an RSS stream. Not loopable.
"""
conf = DotDict(conf)
for item in _INPUT:
item = DotDict(item)
yield {
value: item.get(conf.get(key, **kwargs))
for ke... | [
"def",
"pipe_createrss",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conf",
"=",
"DotDict",
"(",
"conf",
")",
"for",
"item",
"in",
"_INPUT",
":",
"item",
"=",
"DotDict",
"("... | An operator that converts a source into an RSS stream. Not loopable. | [
"An",
"operator",
"that",
"converts",
"a",
"source",
"into",
"an",
"RSS",
"stream",
".",
"Not",
"loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipecreaterss.py#L40-L51 |
ggaughan/pipe2py | pipe2py/modules/pipefetchsitefeed.py | pipe_fetchsitefeed | def pipe_fetchsitefeed(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that fetches and parses the first feed found on one or more
sites. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : URL -- u... | python | def pipe_fetchsitefeed(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that fetches and parses the first feed found on one or more
sites. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : URL -- u... | [
"def",
"pipe_fetchsitefeed",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conf",
"=",
"DotDict",
"(",
"conf",
")",
"urls",
"=",
"utils",
".",
"listize",
"(",
"conf",
"[",
"'U... | A source that fetches and parses the first feed found on one or more
sites. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : URL -- url
Yields
------
_OUTPUT : items | [
"A",
"source",
"that",
"fetches",
"and",
"parses",
"the",
"first",
"feed",
"found",
"on",
"one",
"or",
"more",
"sites",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipefetchsitefeed.py#L18-L52 |
ggaughan/pipe2py | pipe2py/modules/piperegex.py | asyncPipeRegex | def asyncPipeRegex(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that asynchronously replaces text in items using regexes.
Each has the general format: "In [field] replace [match] with [replace]".
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT ... | python | def asyncPipeRegex(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that asynchronously replaces text in items using regexes.
Each has the general format: "In [field] replace [match] with [replace]".
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT ... | [
"def",
"asyncPipeRegex",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"splits",
"=",
"yield",
"asyncGetSplits",
"(",
"_INPUT",
",",
"conf",
"[",
"'RULE'",
"]",
",",
"*",
"*",
... | An operator that asynchronously replaces text in items using regexes.
Each has the general format: "In [field] replace [match] with [replace]".
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : asyncPipe like object (twisted Deferred iterable of items)
conf : {
... | [
"An",
"operator",
"that",
"asynchronously",
"replaces",
"text",
"in",
"items",
"using",
"regexes",
".",
"Each",
"has",
"the",
"general",
"format",
":",
"In",
"[",
"field",
"]",
"replace",
"[",
"match",
"]",
"with",
"[",
"replace",
"]",
".",
"Not",
"loopa... | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/piperegex.py#L47-L79 |
ggaughan/pipe2py | pipe2py/modules/piperegex.py | pipe_regex | def pipe_regex(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that replaces text in items using regexes. Each has the
general format: "In [field] replace [match] with [replace]". Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe ... | python | def pipe_regex(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that replaces text in items using regexes. Each has the
general format: "In [field] replace [match] with [replace]". Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe ... | [
"def",
"pipe_regex",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"splits",
"=",
"get_splits",
"(",
"_INPUT",
",",
"conf",
"[",
"'RULE'",
"]",
",",
"*",
"*",
"cdicts",
"(",
... | An operator that replaces text in items using regexes. Each has the
general format: "In [field] replace [match] with [replace]". Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : {
'RULE': [
... | [
"An",
"operator",
"that",
"replaces",
"text",
"in",
"items",
"using",
"regexes",
".",
"Each",
"has",
"the",
"general",
"format",
":",
"In",
"[",
"field",
"]",
"replace",
"[",
"match",
"]",
"with",
"[",
"replace",
"]",
".",
"Not",
"loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/piperegex.py#L100-L129 |
ggaughan/pipe2py | pipe2py/modules/pipestrreplace.py | asyncPipeStrreplace | def asyncPipeStrreplace(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that asynchronously replaces text. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : twisted Deferred iterable of items or strings
conf : {
'RULE': [
{
... | python | def asyncPipeStrreplace(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that asynchronously replaces text. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : twisted Deferred iterable of items or strings
conf : {
'RULE': [
{
... | [
"def",
"asyncPipeStrreplace",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"splits",
"=",
"yield",
"asyncGetSplits",
"(",
"_INPUT",
",",
"conf",
"[",
"'RULE'",
"]",
",",
"*",
"*... | A string module that asynchronously replaces text. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : twisted Deferred iterable of items or strings
conf : {
'RULE': [
{
'param': {'value': <match type: 1=first, 2=last, 3=every>},
... | [
"A",
"string",
"module",
"that",
"asynchronously",
"replaces",
"text",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipestrreplace.py#L38-L62 |
ggaughan/pipe2py | pipe2py/modules/pipestrreplace.py | pipe_strreplace | def pipe_strreplace(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that replaces text. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : iterable of items or strings
conf : {
'RULE': [
{
'param': {'value': <match t... | python | def pipe_strreplace(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that replaces text. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : iterable of items or strings
conf : {
'RULE': [
{
'param': {'value': <match t... | [
"def",
"pipe_strreplace",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"splits",
"=",
"get_splits",
"(",
"_INPUT",
",",
"conf",
"[",
"'RULE'",
"]",
",",
"*",
"*",
"kwargs",
")... | A string module that replaces text. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : iterable of items or strings
conf : {
'RULE': [
{
'param': {'value': <match type: 1=first, 2=last, 3=every>},
'find': {'value': <text to ... | [
"A",
"string",
"module",
"that",
"replaces",
"text",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipestrreplace.py#L70-L94 |
ggaughan/pipe2py | pipe2py/modules/pipetruncate.py | asyncPipeUniq | def asyncPipeUniq(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that asynchronously returns a specified number of items from
the top of a feed. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : twisted Deferred iterable of items
conf : {
... | python | def asyncPipeUniq(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that asynchronously returns a specified number of items from
the top of a feed. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : twisted Deferred iterable of items
conf : {
... | [
"def",
"asyncPipeUniq",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"_input",
"=",
"yield",
"_INPUT",
"asyncFuncs",
"=",
"yield",
"asyncGetSplits",
"(",
"None",
",",
"conf",
",",... | An operator that asynchronously returns a specified number of items from
the top of a feed. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : twisted Deferred iterable of items
conf : {
'start': {'type': 'number', value': <starting location>}
'count':... | [
"An",
"operator",
"that",
"asynchronously",
"returns",
"a",
"specified",
"number",
"of",
"items",
"from",
"the",
"top",
"of",
"a",
"feed",
".",
"Not",
"loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipetruncate.py#L20-L49 |
ggaughan/pipe2py | pipe2py/modules/pipetruncate.py | pipe_truncate | def pipe_truncate(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that returns a specified number of items from the top of a
feed. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
kwargs -- ter... | python | def pipe_truncate(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that returns a specified number of items from the top of a
feed. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
kwargs -- ter... | [
"def",
"pipe_truncate",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"funcs",
"=",
"get_splits",
"(",
"None",
",",
"conf",
",",
"*",
"*",
"cdicts",
"(",
"opts",
",",
"kwargs",... | An operator that returns a specified number of items from the top of a
feed. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
kwargs -- terminal, if the truncation value is wired in
conf : {
'start': {... | [
"An",
"operator",
"that",
"returns",
"a",
"specified",
"number",
"of",
"items",
"from",
"the",
"top",
"of",
"a",
"feed",
".",
"Not",
"loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipetruncate.py#L53-L85 |
ggaughan/pipe2py | pipe2py/modules/pipestringtokenizer.py | asyncPipeStringtokenizer | def asyncPipeStringtokenizer(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that asynchronously splits a string into tokens
delimited by separators. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : twisted Deferred iterable of items or strings
c... | python | def asyncPipeStringtokenizer(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that asynchronously splits a string into tokens
delimited by separators. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : twisted Deferred iterable of items or strings
c... | [
"def",
"asyncPipeStringtokenizer",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conf",
"[",
"'delimiter'",
"]",
"=",
"conf",
".",
"pop",
"(",
"'to-str'",
",",
"dict",
".",
"get... | A string module that asynchronously splits a string into tokens
delimited by separators. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : twisted Deferred iterable of items or strings
conf : {
'to-str': {'value': <delimiter>},
'dedupe': {'type': 'bool', ... | [
"A",
"string",
"module",
"that",
"asynchronously",
"splits",
"a",
"string",
"into",
"tokens",
"delimited",
"by",
"separators",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipestringtokenizer.py#L46-L69 |
ggaughan/pipe2py | pipe2py/modules/pipeexchangerate.py | asyncPipeExchangerate | def asyncPipeExchangerate(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that asynchronously retrieves the current exchange rate
for a given currency pair. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : twisted Deferred iterable of items or string... | python | def asyncPipeExchangerate(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that asynchronously retrieves the current exchange rate
for a given currency pair. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : twisted Deferred iterable of items or string... | [
"def",
"asyncPipeExchangerate",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"offline",
"=",
"conf",
".",
"get",
"(",
"'offline'",
",",
"{",
"}",
")",
".",
"get",
"(",
"'value... | A string module that asynchronously retrieves the current exchange rate
for a given currency pair. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : twisted Deferred iterable of items or strings (base currency)
conf : {
'quote': {'value': <'USD'>},
'defau... | [
"A",
"string",
"module",
"that",
"asynchronously",
"retrieves",
"the",
"current",
"exchange",
"rate",
"for",
"a",
"given",
"currency",
"pair",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipeexchangerate.py#L100-L125 |
ggaughan/pipe2py | pipe2py/modules/pipeexchangerate.py | pipe_exchangerate | def pipe_exchangerate(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that retrieves the current exchange rate for a given
currency pair. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : iterable of items or strings (base currency)
conf : {
... | python | def pipe_exchangerate(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that retrieves the current exchange rate for a given
currency pair. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : iterable of items or strings (base currency)
conf : {
... | [
"def",
"pipe_exchangerate",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"offline",
"=",
"conf",
".",
"get",
"(",
"'offline'",
",",
"{",
"}",
")",
".",
"get",
"(",
"'value'",
... | A string module that retrieves the current exchange rate for a given
currency pair. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : iterable of items or strings (base currency)
conf : {
'quote': {'value': <'USD'>},
'default': {'value': <'USD'>},
... | [
"A",
"string",
"module",
"that",
"retrieves",
"the",
"current",
"exchange",
"rate",
"for",
"a",
"given",
"currency",
"pair",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipeexchangerate.py#L145-L169 |
ggaughan/pipe2py | pipe2py/modules/pipestrtransform.py | pipe_strtransform | def pipe_strtransform(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that splits a string into tokens delimited by
separators. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : iterable of items or strings
conf : {'transformation': {value': <'swa... | python | def pipe_strtransform(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that splits a string into tokens delimited by
separators. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : iterable of items or strings
conf : {'transformation': {value': <'swa... | [
"def",
"pipe_strtransform",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"splits",
"=",
"get_splits",
"(",
"_INPUT",
",",
"conf",
",",
"*",
"*",
"cdicts",
"(",
"opts",
",",
"k... | A string module that splits a string into tokens delimited by
separators. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : iterable of items or strings
conf : {'transformation': {value': <'swapcase'>}}
Returns
-------
_OUTPUT : generator of tokenized string... | [
"A",
"string",
"module",
"that",
"splits",
"a",
"string",
"into",
"tokens",
"delimited",
"by",
"separators",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipestrtransform.py#L51-L68 |
ggaughan/pipe2py | pipe2py/modules/pipeprivateinput.py | pipe_privateinput | def pipe_privateinput(context=None, _INPUT=None, conf=None, **kwargs):
"""An input that prompts the user for some text and yields it forever.
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : unused
conf : {
'name': {'value': 'parameter name'},
'p... | python | def pipe_privateinput(context=None, _INPUT=None, conf=None, **kwargs):
"""An input that prompts the user for some text and yields it forever.
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : unused
conf : {
'name': {'value': 'parameter name'},
'p... | [
"def",
"pipe_privateinput",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"value",
"=",
"utils",
".",
"get_input",
"(",
"context",
",",
"conf",
")",
"while",
"True",
":",
"yield"... | An input that prompts the user for some text and yields it forever.
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : unused
conf : {
'name': {'value': 'parameter name'},
'prompt': {'value': 'User prompt'},
'default': {'value': 'default value'... | [
"An",
"input",
"that",
"prompts",
"the",
"user",
"for",
"some",
"text",
"and",
"yields",
"it",
"forever",
".",
"Not",
"loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipeprivateinput.py#L13-L35 |
ggaughan/pipe2py | pipe2py/modules/pipedateformat.py | pipe_dateformat | def pipe_dateformat(context=None, _INPUT=None, conf=None, **kwargs):
"""Formats a datetime value. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipedatebuilder pipe like object (iterable of date timetuples)
conf : {
'format': {'value': <'%B %d, %Y'>},
... | python | def pipe_dateformat(context=None, _INPUT=None, conf=None, **kwargs):
"""Formats a datetime value. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipedatebuilder pipe like object (iterable of date timetuples)
conf : {
'format': {'value': <'%B %d, %Y'>},
... | [
"def",
"pipe_dateformat",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conf",
"=",
"DotDict",
"(",
"conf",
")",
"loop_with",
"=",
"kwargs",
".",
"pop",
"(",
"'with'",
",",
"N... | Formats a datetime value. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipedatebuilder pipe like object (iterable of date timetuples)
conf : {
'format': {'value': <'%B %d, %Y'>},
'timezone': {'value': <'EST'>}
}
Yields
------
_OUTPUT : f... | [
"Formats",
"a",
"datetime",
"value",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipedateformat.py#L15-L49 |
ggaughan/pipe2py | pipe2py/modules/pipesubelement.py | pipe_subelement | def pipe_subelement(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator extracts select sub-elements from a feed. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : {'path': {'value': <element pat... | python | def pipe_subelement(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator extracts select sub-elements from a feed. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : {'path': {'value': <element pat... | [
"def",
"pipe_subelement",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"path",
"=",
"DotDict",
"(",
"conf",
")",
".",
"get",
"(",
"'path'",
",",
"*",
"*",
"kwargs",
")",
"fo... | An operator extracts select sub-elements from a feed. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : {'path': {'value': <element path>}}
Yields
------
_OUTPUT : items | [
"An",
"operator",
"extracts",
"select",
"sub",
"-",
"elements",
"from",
"a",
"feed",
".",
"Not",
"loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipesubelement.py#L14-L38 |
ggaughan/pipe2py | pipe2py/modules/pipefeedautodiscovery.py | pipe_feedautodiscovery | def pipe_feedautodiscovery(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that searches for and returns feed links found in a page.
Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : URL -- url
... | python | def pipe_feedautodiscovery(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that searches for and returns feed links found in a page.
Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : URL -- url
... | [
"def",
"pipe_feedautodiscovery",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conf",
"=",
"DotDict",
"(",
"conf",
")",
"urls",
"=",
"utils",
".",
"listize",
"(",
"conf",
"[",
... | A source that searches for and returns feed links found in a page.
Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : URL -- url
Yields
------
_OUTPUT : items | [
"A",
"source",
"that",
"searches",
"for",
"and",
"returns",
"feed",
"links",
"found",
"in",
"a",
"page",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipefeedautodiscovery.py#L14-L46 |
ggaughan/pipe2py | pipe2py/modules/pipeurlinput.py | pipe_urlinput | def pipe_urlinput(context=None, _INPUT=None, conf=None, **kwargs):
"""An input that prompts the user for a url and yields it forever.
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : unused
conf : {
'name': {'value': 'parameter name'},
'prompt': ... | python | def pipe_urlinput(context=None, _INPUT=None, conf=None, **kwargs):
"""An input that prompts the user for a url and yields it forever.
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : unused
conf : {
'name': {'value': 'parameter name'},
'prompt': ... | [
"def",
"pipe_urlinput",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"value",
"=",
"utils",
".",
"get_input",
"(",
"context",
",",
"conf",
")",
"value",
"=",
"utils",
".",
"ur... | An input that prompts the user for a url and yields it forever.
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : unused
conf : {
'name': {'value': 'parameter name'},
'prompt': {'value': 'User prompt'},
'default': {'value': 'default value'},
... | [
"An",
"input",
"that",
"prompts",
"the",
"user",
"for",
"a",
"url",
"and",
"yields",
"it",
"forever",
".",
"Not",
"loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipeurlinput.py#L13-L36 |
ggaughan/pipe2py | pipe2py/modules/pipeyql.py | pipe_yql | def pipe_yql(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that issues YQL queries. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : yqlquery -- YQL query
# todo: handle envURL
Yields
... | python | def pipe_yql(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that issues YQL queries. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : yqlquery -- YQL query
# todo: handle envURL
Yields
... | [
"def",
"pipe_yql",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# todo: get from a config/env file",
"url",
"=",
"\"http://query.yahooapis.com/v1/public/yql\"",
"conf",
"=",
"DotDict",
"("... | A source that issues YQL queries. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : yqlquery -- YQL query
# todo: handle envURL
Yields
------
_OUTPUT : query results | [
"A",
"source",
"that",
"issues",
"YQL",
"queries",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipeyql.py#L17-L64 |
ggaughan/pipe2py | pipe2py/modules/pipenumberinput.py | pipe_numberinput | def pipe_numberinput(context=None, _INPUT=None, conf=None, **kwargs):
"""An input that prompts the user for a number and yields it forever.
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : not used
conf : {
'name': {'value': 'parameter name'},
'p... | python | def pipe_numberinput(context=None, _INPUT=None, conf=None, **kwargs):
"""An input that prompts the user for a number and yields it forever.
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : not used
conf : {
'name': {'value': 'parameter name'},
'p... | [
"def",
"pipe_numberinput",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"value",
"=",
"utils",
".",
"get_input",
"(",
"context",
",",
"conf",
")",
"try",
":",
"value",
"=",
"i... | An input that prompts the user for a number and yields it forever.
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : not used
conf : {
'name': {'value': 'parameter name'},
'prompt': {'value': 'User prompt'},
'default': {'value': 'default value... | [
"An",
"input",
"that",
"prompts",
"the",
"user",
"for",
"a",
"number",
"and",
"yields",
"it",
"forever",
".",
"Not",
"loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipenumberinput.py#L13-L40 |
ggaughan/pipe2py | pipe2py/modules/pipeurlbuilder.py | pipe_urlbuilder | def pipe_urlbuilder(context=None, _INPUT=None, conf=None, **kwargs):
"""A url module that builds a url. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : {
'PARAM': [
{'key': {'value': <'order'... | python | def pipe_urlbuilder(context=None, _INPUT=None, conf=None, **kwargs):
"""A url module that builds a url. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : {
'PARAM': [
{'key': {'value': <'order'... | [
"def",
"pipe_urlbuilder",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"pkwargs",
"=",
"cdicts",
"(",
"opts",
",",
"kwargs",
")",
"get_params",
"=",
"get_funcs",
"(",
"conf",
".... | A url module that builds a url. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : {
'PARAM': [
{'key': {'value': <'order'>}, 'value': {'value': <'desc'>}},
{'key': {'value': <'page'>}, ... | [
"A",
"url",
"module",
"that",
"builds",
"a",
"url",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipeurlbuilder.py#L29-L57 |
ggaughan/pipe2py | pipe2py/modules/pipecsv.py | pipe_csv | def pipe_csv(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that fetches and parses a csv file to yield items. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : URL -- url
skip -- number of h... | python | def pipe_csv(context=None, _INPUT=None, conf=None, **kwargs):
"""A source that fetches and parses a csv file to yield items. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : URL -- url
skip -- number of h... | [
"def",
"pipe_csv",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conf",
"=",
"DotDict",
"(",
"conf",
")",
"conf_sep",
"=",
"conf",
"[",
"'separator'",
"]",
"conf_mode",
"=",
"... | A source that fetches and parses a csv file to yield items. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipeforever pipe or an iterable of items or fields
conf : URL -- url
skip -- number of header rows to skip
col_mode -- column name source: row=header... | [
"A",
"source",
"that",
"fetches",
"and",
"parses",
"a",
"csv",
"file",
"to",
"yield",
"items",
".",
"Loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipecsv.py#L24-L87 |
ggaughan/pipe2py | pipe2py/modules/piperename.py | asyncPipeRename | def asyncPipeRename(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that asynchronously renames or copies fields in the input
source. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : asyncPipe like object (twisted Deferred iterable of items)
conf... | python | def asyncPipeRename(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that asynchronously renames or copies fields in the input
source. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : asyncPipe like object (twisted Deferred iterable of items)
conf... | [
"def",
"asyncPipeRename",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"splits",
"=",
"yield",
"asyncGetSplits",
"(",
"_INPUT",
",",
"conf",
"[",
"'RULE'",
"]",
",",
"*",
"*",
... | An operator that asynchronously renames or copies fields in the input
source. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : asyncPipe like object (twisted Deferred iterable of items)
conf : {
'RULE': [
{
'op': {'value': 'rename... | [
"An",
"operator",
"that",
"asynchronously",
"renames",
"or",
"copies",
"fields",
"in",
"the",
"input",
"source",
".",
"Not",
"loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/piperename.py#L44-L70 |
ggaughan/pipe2py | pipe2py/modules/piperename.py | pipe_rename | def pipe_rename(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that renames or copies fields in the input source.
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : {
'RULE': [
... | python | def pipe_rename(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that renames or copies fields in the input source.
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : {
'RULE': [
... | [
"def",
"pipe_rename",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"splits",
"=",
"get_splits",
"(",
"_INPUT",
",",
"conf",
"[",
"'RULE'",
"]",
",",
"*",
"*",
"cdicts",
"(",
... | An operator that renames or copies fields in the input source.
Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : {
'RULE': [
{
'op': {'value': 'rename or copy'},
... | [
"An",
"operator",
"that",
"renames",
"or",
"copies",
"fields",
"in",
"the",
"input",
"source",
".",
"Not",
"loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/piperename.py#L74-L100 |
ggaughan/pipe2py | pipe2py/modules/pipereverse.py | pipe_reverse | def pipe_reverse(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that reverses the order of source items. Not loopable. Not
lazy.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : unused
Yields
... | python | def pipe_reverse(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that reverses the order of source items. Not loopable. Not
lazy.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : unused
Yields
... | [
"def",
"pipe_reverse",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"item",
"in",
"reversed",
"(",
"list",
"(",
"_INPUT",
")",
")",
":",
"yield",
"item"
] | An operator that reverses the order of source items. Not loopable. Not
lazy.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : unused
Yields
------
_OUTPUT : items | [
"An",
"operator",
"that",
"reverses",
"the",
"order",
"of",
"source",
"items",
".",
"Not",
"loopable",
".",
"Not",
"lazy",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipereverse.py#L11-L26 |
ggaughan/pipe2py | pipe2py/modules/pipecount.py | pipe_count | def pipe_count(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that counts the number of _INPUT items and yields it
forever. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : not used
... | python | def pipe_count(context=None, _INPUT=None, conf=None, **kwargs):
"""An operator that counts the number of _INPUT items and yields it
forever. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : not used
... | [
"def",
"pipe_count",
"(",
"context",
"=",
"None",
",",
"_INPUT",
"=",
"None",
",",
"conf",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"count",
"=",
"len",
"(",
"list",
"(",
"_INPUT",
")",
")",
"# todo: check all operators (not placeable in loops)",
"w... | An operator that counts the number of _INPUT items and yields it
forever. Not loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : pipe2py.modules pipe like object (iterable of items)
conf : not used
Yields
------
_OUTPUT : number of items in the feed
Exam... | [
"An",
"operator",
"that",
"counts",
"the",
"number",
"of",
"_INPUT",
"items",
"and",
"yields",
"it",
"forever",
".",
"Not",
"loopable",
"."
] | train | https://github.com/ggaughan/pipe2py/blob/4767d6d1fd354d2a35e6528594b8deb8a033eed4/pipe2py/modules/pipecount.py#L12-L39 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.