def __init__(self, target=None, args=[], kwargs={}, parent=None):

    def _run(c):
        _tls.current_fiber = self
        try:
            return target(*args, **kwargs)
        finally:
            cont = self._cont
            self._cont = None
            self._ended = True
            _continuation.permute(cont, self._get_active_parent()._cont)
    self._func = _run
    if (parent is None):
        parent = current()
    self._thread_id = threading.current_thread().ident
    if (self._thread_id != parent._thread_id):
        raise error('parent cannot be on a different thread')
    self.parent = parent
def __init__(self, target=None, args=[], kwargs={}, parent=None):

    def _run(c):
        _tls.current_fiber = self
        try:
            return target(*args, **kwargs)
        finally:
            cont = self._cont
            self._cont = None
            self._ended = True
            _continuation.permute(cont, self._get_active_parent()._cont)
    self._func = _run
    if (parent is None):
        parent = current()
    self._thread_id = threading.current_thread().ident
    if (self._thread_id != parent._thread_id):
        raise error('parent cannot be on a different thread')
    self.parent = parent