Python __builtin__.zip() Examples

The following are 30 code examples of __builtin__.zip(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module __builtin__ , or try the search function .
Example #1
Source File: fypp.py    From fypp with BSD 2-Clause "Simplified" License 6 votes vote down vote up
def _get_conditional_content(self, fname, spans, conditions, contents):
        out = []
        ieval = []
        peval = []
        multiline = (spans[0][0] != spans[-1][1])
        for condition, content, span in zip(conditions, contents, spans):
            try:
                cond = bool(self._evaluate(condition, fname, span[0]))
            except Exception as exc:
                msg = "exception occurred when evaluating '{0}'"\
                      .format(condition)
                raise FyppFatalError(msg, fname, span, exc)
            if cond:
                if self._linenums and not self._diverted and multiline:
                    out.append(linenumdir(span[1], fname))
                outcont, ievalcont, pevalcont = self._render(content)
                ieval += _shiftinds(ievalcont, len(out))
                peval += pevalcont
                out += outcont
                break
        if self._linenums and not self._diverted and multiline:
            out.append(linenumdir(spans[-1][1], fname))
        return out, ieval, peval 
Example #2
Source File: menus.py    From skiptracer with Apache License 2.0 5 votes vote down vote up
def profiler(self):
        os.system('clear')
        Logo().banner()
        fname = raw_input("\t[Whats the target's first name? - ex: Alice]: ")
        lname = raw_input("\t[Whats the target's last name? - ex: Smith]: ")
        bi.name = fname + " " + lname
        bi.agerange = raw_input(
            "\t[Whats the target's age range? - ex: 18-100]: ")
        bi.apprage = raw_input(
            "\t[Whats the target's suspected age? - ex: 18]: ")
        bi.state = raw_input(
            "\t[Whats state does the target's live in? - ex: (FL|Florida)]: ")
        bi.city = raw_input(
            "\t[Whats city does the target's live in? - ex: Orlando]: ")
        bi.zip = raw_input(
            "\t[Whats the zipcode the target's lives in? - ex: 12345]: ")
        bi.phone = raw_input(
            "\t[What is a known phone number for the target's? - ex: 1234567890]: ")
        bi.screenname = raw_input(
            "\t[What are the known aliasis of the target's? - ex: (Ac1dBurn|Zer0cool)]: ")
        bi.plate = raw_input(
            "\t[Does the target's have a known license plate? - ex: (ABC1234|XYZ123)]: ")
        bi.email = raw_input(
            "\t[What is the target's email address? - ex: username@domain.tld]: ")
        not raw_input("\nPress 'ENTER' key now to continue")
        self.intromenu() 
Example #3
Source File: __coconut__.py    From pyprover with Apache License 2.0 5 votes vote down vote up
def __repr__(self):
        return "zip(%s)" % (", ".join((_coconut.repr(i) for i in self.iters)),) 
Example #4
Source File: setup.py    From pyprover with Apache License 2.0 5 votes vote down vote up
def _coconut_igetitem(iterable, index):
    if isinstance(iterable, (_coconut_reversed, _coconut_map, _coconut.zip, _coconut_enumerate, _coconut_count, _coconut.abc.Sequence)):
        return iterable[index]
    if not _coconut.isinstance(index, _coconut.slice):
        if index < 0:
            return _coconut.collections.deque(iterable, maxlen=-index)[0]
        return _coconut.next(_coconut.itertools.islice(iterable, index, index + 1))
    if index.start is not None and index.start < 0 and (index.stop is None or index.stop < 0) and index.step is None:
        queue = _coconut.collections.deque(iterable, maxlen=-index.start)
        if index.stop is not None:
            queue = _coconut.list(queue)[:index.stop - index.start]
        return queue
    if (index.start is not None and index.start < 0) or (index.stop is not None and index.stop < 0) or (index.step is not None and index.step < 0):
        return _coconut.list(iterable)[index]
    return _coconut.itertools.islice(iterable, index.start, index.stop, index.step) 
Example #5
Source File: setup.py    From pyprover with Apache License 2.0 5 votes vote down vote up
def __new__(cls, *iterables):
        new_zip = _coconut.zip.__new__(cls, *iterables)
        new_zip.iters = iterables
        return new_zip 
Example #6
Source File: compatibility_utils.py    From fb2mobi with MIT License 5 votes vote down vote up
def lzip(*args, **kwargs):
        return list(zip(*args, **kwargs)) 
Example #7
Source File: python.py    From Splunking-Crime with GNU Affero General Public License v3.0 5 votes vote down vote up
def lzip(*args, **kwargs):
        return list(zip(*args, **kwargs)) 
Example #8
Source File: __init__.py    From Splunking-Crime with GNU Affero General Public License v3.0 5 votes vote down vote up
def lzip(*args, **kwargs):
        return list(zip(*args, **kwargs)) 
Example #9
Source File: __init__.py    From jx-sqlite with Mozilla Public License 2.0 5 votes vote down vote up
def transpose(*args):
        return list(zip(*args)) 
Example #10
Source File: fypp.py    From fypp with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def _get_iterated_content(self, fname, spans, loopvars, loopiter, content):
        out = []
        ieval = []
        peval = []
        try:
            iterobj = iter(self._evaluate(loopiter, fname, spans[0][0]))
        except Exception as exc:
            msg = "exception occurred when evaluating '{0}'"\
                .format(loopiter)
            raise FyppFatalError(msg, fname, spans[0], exc)
        multiline = (spans[0][0] != spans[-1][1])
        for var in iterobj:
            if len(loopvars) == 1:
                self._define(loopvars[0], var)
            else:
                for varname, value in zip(loopvars, var):
                    self._define(varname, value)
            if self._linenums and not self._diverted and multiline:
                out.append(linenumdir(spans[0][1], fname))
            outcont, ievalcont, pevalcont = self._render(content)
            ieval += _shiftinds(ievalcont, len(out))
            peval += pevalcont
            out += outcont
        if self._linenums and not self._diverted and multiline:
            out.append(linenumdir(spans[1][1], fname))
        return out, ieval, peval 
Example #11
Source File: fypp.py    From fypp with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def define(self, name, value):
        '''Define a Python entity.

        Args:
            name (str): Name of the entity.
            value (Python object): Value of the entity.

        Raises:
            FyppFatalError: If name starts with the reserved prefix or if it is
                a reserved name.
        '''
        varnames = self._get_variable_names(name)
        if len(varnames) == 1:
            value = (value,)
        elif len(varnames) != len(value):
            msg = 'value for tuple assignment has incompatible length'
            raise FyppFatalError(msg)
        for varname, varvalue in zip(varnames, value):
            self._check_variable_name(varname)
            if self._locals is None:
                self._globals[varname] = varvalue
            else:
                if varname in self._globalrefs:
                    self._globals[varname] = varvalue
                else:
                    self._locals[varname] = varvalue
                self._scope[varname] = varvalue 
Example #12
Source File: fypp.py    From fypp with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def _argsplit_fortran(argtxt):
    txt = _INLINE_EVAL_REGION_REGEXP.sub(_blank_match, argtxt)
    splitpos = [-1]
    quote = None
    closing_brace_stack = []
    closing_brace = None
    for ind, char in enumerate(txt):
        if quote:
            if char == quote:
                quote = None
            continue
        if char in _QUOTES_FORTRAN:
            quote = char
            continue
        if char in _OPENING_BRACKETS_FORTRAN:
            closing_brace_stack.append(closing_brace)
            ind = _OPENING_BRACKETS_FORTRAN.index(char)
            closing_brace = _CLOSING_BRACKETS_FORTRAN[ind]
            continue
        if char in _CLOSING_BRACKETS_FORTRAN:
            if char == closing_brace:
                closing_brace = closing_brace_stack.pop(-1)
                continue
            else:
                msg = "unexpected closing delimiter '{0}' in expression '{1}' "\
                      "at position {2}".format(char, argtxt, ind + 1)
                raise FyppFatalError(msg)
        if not closing_brace and char == _ARGUMENT_SPLIT_CHAR_FORTRAN:
            splitpos.append(ind)
    if quote or closing_brace:
        msg = "open quotes or brackets in expression '{0}'".format(argtxt)
        raise FyppFatalError(msg)
    splitpos.append(len(txt))
    fragments = [argtxt[start + 1 : end]
                 for start, end in zip(splitpos, splitpos[1:])]
    return fragments 
Example #13
Source File: __coconut__.py    From pyprover with Apache License 2.0 5 votes vote down vote up
def __new__(cls, *iterables):
        new_zip = _coconut.zip.__new__(cls, *iterables)
        new_zip.iters = iterables
        return new_zip 
Example #14
Source File: __init__.py    From elasticintel with GNU General Public License v3.0 5 votes vote down vote up
def lzip(*args, **kwargs):
        return list(zip(*args, **kwargs)) 
Example #15
Source File: noniterators.py    From gimp-plugin-export-layers with GNU General Public License v3.0 5 votes vote down vote up
def oldzip(*args, **kwargs):
        return list(builtins.zip(*args, **kwargs)) 
Example #16
Source File: __init__.py    From gimp-plugin-export-layers with GNU General Public License v3.0 5 votes vote down vote up
def lzip(*args, **kwargs):
        return list(zip(*args, **kwargs)) 
Example #17
Source File: __init__.py    From coffeegrindsize with MIT License 5 votes vote down vote up
def lzip(*args, **kwargs):
        return list(zip(*args, **kwargs)) 
Example #18
Source File: noniterators.py    From arissploit with GNU General Public License v3.0 5 votes vote down vote up
def oldzip(*args, **kwargs):
        return list(builtins.zip(*args, **kwargs)) 
Example #19
Source File: __init__.py    From arissploit with GNU General Public License v3.0 5 votes vote down vote up
def lzip(*args, **kwargs):
        return list(zip(*args, **kwargs)) 
Example #20
Source File: noniterators.py    From Tautulli with GNU General Public License v3.0 5 votes vote down vote up
def oldzip(*args, **kwargs):
        return list(builtins.zip(*args, **kwargs)) 
Example #21
Source File: __init__.py    From Tautulli with GNU General Public License v3.0 5 votes vote down vote up
def lzip(*args, **kwargs):
        return list(zip(*args, **kwargs)) 
Example #22
Source File: noniterators.py    From V1EngineeringInc-Docs with Creative Commons Attribution Share Alike 4.0 International 5 votes vote down vote up
def oldzip(*args, **kwargs):
        return list(builtins.zip(*args, **kwargs)) 
Example #23
Source File: __init__.py    From V1EngineeringInc-Docs with Creative Commons Attribution Share Alike 4.0 International 5 votes vote down vote up
def lzip(*args, **kwargs):
        return list(zip(*args, **kwargs)) 
Example #24
Source File: __init__.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def lzip(*args, **kwargs):
        return list(zip(*args, **kwargs)) 
Example #25
Source File: pandas_py3k.py    From kgsgo-dataset-preprocessor with Mozilla Public License 2.0 5 votes vote down vote up
def lzip(*args, **kwargs):
        return list(zip(*args, **kwargs)) 
Example #26
Source File: noniterators.py    From misp42splunk with GNU Lesser General Public License v3.0 5 votes vote down vote up
def oldzip(*args, **kwargs):
        return list(builtins.zip(*args, **kwargs)) 
Example #27
Source File: __init__.py    From misp42splunk with GNU Lesser General Public License v3.0 5 votes vote down vote up
def lzip(*args, **kwargs):
        return list(zip(*args, **kwargs)) 
Example #28
Source File: noniterators.py    From misp42splunk with GNU Lesser General Public License v3.0 5 votes vote down vote up
def oldzip(*args, **kwargs):
        return list(builtins.zip(*args, **kwargs)) 
Example #29
Source File: __init__.py    From misp42splunk with GNU Lesser General Public License v3.0 5 votes vote down vote up
def lzip(*args, **kwargs):
        return list(zip(*args, **kwargs)) 
Example #30
Source File: __init__.py    From recruit with Apache License 2.0 5 votes vote down vote up
def lzip(*args, **kwargs):
        return list(zip(*args, **kwargs))