Failed

notebooks.Visualizations.ipynb./mnt/data/jenkins/workspace/DARIAH-Topics/notebooks/Visualizations.ipynb (from pytest)

Failing for the past 1 build (Since #511 )
Took 2.5 sec.

Error Message

nbconvert.preprocessors.execute.CellExecutionError: An error occurred while executing the following cell: ------------------ meta = pd.concat([metadata.fname2metadata(path, pattern=pattern) for path in path_to_corpus.glob('*.txt')]) meta[:5] # by adding '[:5]' to the variable, only the first 5 elements will be printed ------------------  #x1B[0;31m---------------------------------------------------------------------------#x1B[0m #x1B[0;31mAttributeError#x1B[0m                            Traceback (most recent call last) #x1B[0;32m<ipython-input-3-9f07ddf53acf>#x1B[0m in #x1B[0;36m<module>#x1B[0;34m()#x1B[0m #x1B[0;32m----> 1#x1B[0;31m #x1B[0mmeta#x1B[0m #x1B[0;34m=#x1B[0m #x1B[0mpd#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mconcat#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0;34m[#x1B[0m#x1B[0mmetadata#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mfname2metadata#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0mpath#x1B[0m#x1B[0;34m,#x1B[0m #x1B[0mpattern#x1B[0m#x1B[0;34m=#x1B[0m#x1B[0mpattern#x1B[0m#x1B[0;34m)#x1B[0m #x1B[0;32mfor#x1B[0m #x1B[0mpath#x1B[0m #x1B[0;32min#x1B[0m #x1B[0mpath_to_corpus#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mglob#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0;34m'*.txt'#x1B[0m#x1B[0;34m)#x1B[0m#x1B[0;34m]#x1B[0m#x1B[0;34m)#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m #x1B[0m#x1B[1;32m      2#x1B[0m #x1B[0mmeta#x1B[0m#x1B[0;34m[#x1B[0m#x1B[0;34m:#x1B[0m#x1B[0;36m5#x1B[0m#x1B[0;34m]#x1B[0m #x1B[0;31m# by adding '[:5]' to the variable, only the first 5 elements will be printed#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m  #x1B[0;32m<ipython-input-3-9f07ddf53acf>#x1B[0m in #x1B[0;36m<listcomp>#x1B[0;34m(.0)#x1B[0m #x1B[0;32m----> 1#x1B[0;31m #x1B[0mmeta#x1B[0m #x1B[0;34m=#x1B[0m #x1B[0mpd#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mconcat#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0;34m[#x1B[0m#x1B[0mmetadata#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mfname2metadata#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0mpath#x1B[0m#x1B[0;34m,#x1B[0m #x1B[0mpattern#x1B[0m#x1B[0;34m=#x1B[0m#x1B[0mpattern#x1B[0m#x1B[0;34m)#x1B[0m #x1B[0;32mfor#x1B[0m #x1B[0mpath#x1B[0m #x1B[0;32min#x1B[0m #x1B[0mpath_to_corpus#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mglob#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0;34m'*.txt'#x1B[0m#x1B[0;34m)#x1B[0m#x1B[0;34m]#x1B[0m#x1B[0;34m)#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m #x1B[0m#x1B[1;32m      2#x1B[0m #x1B[0mmeta#x1B[0m#x1B[0;34m[#x1B[0m#x1B[0;34m:#x1B[0m#x1B[0;36m5#x1B[0m#x1B[0;34m]#x1B[0m #x1B[0;31m# by adding '[:5]' to the variable, only the first 5 elements will be printed#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m  #x1B[0;32m~/shiningpanda/jobs/62c67c92/virtualenvs/d41d8cd9/lib/python3.5/site-packages/metadata_toolbox/utils.py#x1B[0m in #x1B[0;36mfname2metadata#x1B[0;34m(fname, pattern)#x1B[0m #x1B[1;32m     60#x1B[0m     """ #x1B[1;32m     61#x1B[0m     #x1B[0mlog#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mdebug#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0;34m"Extracting metadata from filename '{0}' with pattern '{1}' ..."#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mformat#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0mfname#x1B[0m#x1B[0;34m,#x1B[0m #x1B[0mpattern#x1B[0m#x1B[0;34m)#x1B[0m#x1B[0;34m)#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m #x1B[0;32m---> 62#x1B[0;31m     #x1B[0mbasename#x1B[0m#x1B[0;34m,#x1B[0m #x1B[0m_#x1B[0m #x1B[0;34m=#x1B[0m #x1B[0mos#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mpath#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0msplitext#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0mos#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mpath#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mbasename#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0mfname#x1B[0m#x1B[0;34m)#x1B[0m#x1B[0;34m)#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m #x1B[0m#x1B[1;32m     63#x1B[0m     #x1B[0mmetadata#x1B[0m #x1B[0;34m=#x1B[0m #x1B[0mparse#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0mpattern#x1B[0m#x1B[0;34m,#x1B[0m #x1B[0mbasename#x1B[0m#x1B[0;34m)#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m #x1B[1;32m     64#x1B[0m     #x1B[0;32mif#x1B[0m #x1B[0mmetadata#x1B[0m #x1B[0;32mis#x1B[0m #x1B[0;32mnot#x1B[0m #x1B[0;32mNone#x1B[0m#x1B[0;34m:#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m  #x1B[0;32m~/shiningpanda/jobs/62c67c92/virtualenvs/d41d8cd9/lib/python3.5/posixpath.py#x1B[0m in #x1B[0;36mbasename#x1B[0;34m(p)#x1B[0m #x1B[1;32m    137#x1B[0m     #x1B[0;34m"""Returns the final component of a pathname"""#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m #x1B[1;32m    138#x1B[0m     #x1B[0msep#x1B[0m #x1B[0;34m=#x1B[0m #x1B[0m_get_sep#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0mp#x1B[0m#x1B[0;34m)#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m #x1B[0;32m--> 139#x1B[0;31m     #x1B[0mi#x1B[0m #x1B[0;34m=#x1B[0m #x1B[0mp#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mrfind#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0msep#x1B[0m#x1B[0;34m)#x1B[0m #x1B[0;34m+#x1B[0m #x1B[0;36m1#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m #x1B[0m#x1B[1;32m    140#x1B[0m     #x1B[0;32mreturn#x1B[0m #x1B[0mp#x1B[0m#x1B[0;34m[#x1B[0m#x1B[0mi#x1B[0m#x1B[0;34m:#x1B[0m#x1B[0;34m]#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m #x1B[1;32m    141#x1B[0m #x1B[0;34m#x1B[0m#x1B[0m  #x1B[0;31mAttributeError#x1B[0m: 'PosixPath' object has no attribute 'rfind' AttributeError: 'PosixPath' object has no attribute 'rfind'

Stacktrace

self = <CallInfo when='call' exception: An error occurred while executing the following cell:
------------------
meta = pd.co...uteError#x1B[0m: 'PosixPath' object has no attribute 'rfind'
AttributeError: 'PosixPath' object has no attribute 'rfind'
>
func = <function call_runtest_hook.<locals>.<lambda> at 0x7fdcff53e730>
when = 'call', treat_keyboard_interrupt_as_exception = False

    def __init__(self, func, when, treat_keyboard_interrupt_as_exception=False):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

../../shiningpanda/jobs/62c67c92/virtualenvs/d41d8cd9/lib/python3.5/site-packages/_pytest/runner.py:194: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   return CallInfo(lambda: ihook(item=item, **kwds), when=when,
                    treat_keyboard_interrupt_as_exception=item.config.getvalue("usepdb"))

../../shiningpanda/jobs/62c67c92/virtualenvs/d41d8cd9/lib/python3.5/site-packages/_pytest/runner.py:179: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <_HookCaller 'pytest_runtest_call'>, args = ()
kwargs = {'item': <RunNb '/mnt/data/jenkins/workspace/DARIAH-Topics/notebooks/Visualizations.ipynb'>}
notincall = set()

    def __call__(self, *args, **kwargs):
        if args:
            raise TypeError("hook calling supports only keyword arguments")
        assert not self.is_historic()
        if self.argnames:
            notincall = set(self.argnames) - set(['__multicall__']) - set(
                kwargs.keys())
            if notincall:
                warnings.warn(
                    "Argument(s) {} which are declared in the hookspec "
                    "can not be found in this hook call"
                    .format(tuple(notincall)),
                    stacklevel=2,
                )
>       return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)

../../shiningpanda/jobs/62c67c92/virtualenvs/d41d8cd9/lib/python3.5/site-packages/pluggy/__init__.py:617: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <_pytest.config.PytestPluginManager object at 0x7fdd2e3c82b0>
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<pluggy.HookImpl object at 0x7fdd2c23aef0>, <pluggy.HookImpl object at 0x7fdd29e111d0>, <pluggy.HookImpl object at 0x7fdd29dd55f8>]
kwargs = {'item': <RunNb '/mnt/data/jenkins/workspace/DARIAH-Topics/notebooks/Visualizations.ipynb'>}

    def _hookexec(self, hook, methods, kwargs):
        # called from all hookcaller instances.
        # enable_tracing will set its own wrapping function at self._inner_hookexec
>       return self._inner_hookexec(hook, methods, kwargs)

../../shiningpanda/jobs/62c67c92/virtualenvs/d41d8cd9/lib/python3.5/site-packages/pluggy/__init__.py:222: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

hook = <_HookCaller 'pytest_runtest_call'>
methods = [<pluggy.HookImpl object at 0x7fdd2c23aef0>, <pluggy.HookImpl object at 0x7fdd29e111d0>, <pluggy.HookImpl object at 0x7fdd29dd55f8>]
kwargs = {'item': <RunNb '/mnt/data/jenkins/workspace/DARIAH-Topics/notebooks/Visualizations.ipynb'>}

    self._inner_hookexec = lambda hook, methods, kwargs: \
        hook.multicall(
            methods, kwargs,
>           firstresult=hook.spec_opts.get('firstresult'),
        )

../../shiningpanda/jobs/62c67c92/virtualenvs/d41d8cd9/lib/python3.5/site-packages/pluggy/__init__.py:216: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

hook_impls = [<pluggy.HookImpl object at 0x7fdd2c23aef0>, <pluggy.HookImpl object at 0x7fdd29e111d0>, <pluggy.HookImpl object at 0x7fdd29dd55f8>]
caller_kwargs = {'item': <RunNb '/mnt/data/jenkins/workspace/DARIAH-Topics/notebooks/Visualizations.ipynb'>}
firstresult = False

    def _multicall(hook_impls, caller_kwargs, firstresult=False):
        """Execute a call into multiple python functions/methods and return the
        result(s).
    
        ``caller_kwargs`` comes from _HookCaller.__call__().
        """
        __tracebackhide__ = True
        results = []
        excinfo = None
        try:  # run impl and wrapper setup functions in a loop
            teardowns = []
            try:
                for hook_impl in reversed(hook_impls):
                    try:
                        args = [caller_kwargs[argname] for argname in hook_impl.argnames]
                    except KeyError:
                        for argname in hook_impl.argnames:
                            if argname not in caller_kwargs:
                                raise HookCallError(
                                    "hook call must provide argument %r" % (argname,))
    
                    if hook_impl.hookwrapper:
                        try:
                            gen = hook_impl.function(*args)
                            next(gen)   # first yield
                            teardowns.append(gen)
                        except StopIteration:
                            _raise_wrapfail(gen, "did not yield")
                    else:
                        res = hook_impl.function(*args)
                        if res is not None:
                            results.append(res)
                            if firstresult:  # halt further impl calls
                                break
            except BaseException:
                excinfo = sys.exc_info()
        finally:
            if firstresult:  # first result hooks return a single value
                outcome = _Result(results[0] if results else None, excinfo)
            else:
                outcome = _Result(results, excinfo)
    
            # run all wrapper post-yield blocks
            for gen in reversed(teardowns):
                try:
                    gen.send(outcome)
                    _raise_wrapfail(gen, "has second yield")
                except StopIteration:
                    pass
    
>           return outcome.get_result()

../../shiningpanda/jobs/62c67c92/virtualenvs/d41d8cd9/lib/python3.5/site-packages/pluggy/callers.py:201: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pluggy.callers._Result object at 0x7fdcff4aeb00>

    def get_result(self):
        """Get the result(s) for this hook call.
    
            If the hook was marked as a ``firstresult`` only a single value
            will be returned otherwise a list of results.
            """
        __tracebackhide__ = True
        if self._excinfo is None:
            return self._result
        else:
            ex = self._excinfo
            if _py3:
>               raise ex[1].with_traceback(ex[2])

../../shiningpanda/jobs/62c67c92/virtualenvs/d41d8cd9/lib/python3.5/site-packages/pluggy/callers.py:76: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

hook_impls = [<pluggy.HookImpl object at 0x7fdd2c23aef0>, <pluggy.HookImpl object at 0x7fdd29e111d0>, <pluggy.HookImpl object at 0x7fdd29dd55f8>]
caller_kwargs = {'item': <RunNb '/mnt/data/jenkins/workspace/DARIAH-Topics/notebooks/Visualizations.ipynb'>}
firstresult = False

    def _multicall(hook_impls, caller_kwargs, firstresult=False):
        """Execute a call into multiple python functions/methods and return the
        result(s).
    
        ``caller_kwargs`` comes from _HookCaller.__call__().
        """
        __tracebackhide__ = True
        results = []
        excinfo = None
        try:  # run impl and wrapper setup functions in a loop
            teardowns = []
            try:
                for hook_impl in reversed(hook_impls):
                    try:
                        args = [caller_kwargs[argname] for argname in hook_impl.argnames]
                    except KeyError:
                        for argname in hook_impl.argnames:
                            if argname not in caller_kwargs:
                                raise HookCallError(
                                    "hook call must provide argument %r" % (argname,))
    
                    if hook_impl.hookwrapper:
                        try:
                            gen = hook_impl.function(*args)
                            next(gen)   # first yield
                            teardowns.append(gen)
                        except StopIteration:
                            _raise_wrapfail(gen, "did not yield")
                    else:
>                       res = hook_impl.function(*args)

../../shiningpanda/jobs/62c67c92/virtualenvs/d41d8cd9/lib/python3.5/site-packages/pluggy/callers.py:180: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

item = <RunNb '/mnt/data/jenkins/workspace/DARIAH-Topics/notebooks/Visualizations.ipynb'>

    def pytest_runtest_call(item):
        _update_current_test_var(item, 'call')
        sys.last_type, sys.last_value, sys.last_traceback = (None, None, None)
        try:
>           item.runtest()

../../shiningpanda/jobs/62c67c92/virtualenvs/d41d8cd9/lib/python3.5/site-packages/_pytest/runner.py:110: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <RunNb '/mnt/data/jenkins/workspace/DARIAH-Topics/notebooks/Visualizations.ipynb'>

    def runtest(self):
        self._skip()
        with io.open(self.name,encoding='utf8') as nb:
            notebook = nbformat.read(nb, as_version=4)
    
            # TODO: which kernel? run in pytest's or use new one (make it option)
            _timeout = self.parent.parent.config.getini('cell_timeout')
            kwargs = dict(timeout=int(_timeout) if _timeout!='' else 300,
                          allow_errors=False,
                          # or sys.version_info[1] ?
                          kernel_name='python')
    
            ep = ExecutePreprocessor(**kwargs)
            with cwd(os.path.dirname(self.name)): # jupyter notebook always does this, right?
>               ep.preprocess(notebook,{})

../../shiningpanda/jobs/62c67c92/virtualenvs/d41d8cd9/lib/python3.5/site-packages/pytest_nbsmoke.py:136: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <nbconvert.preprocessors.execute.ExecutePreprocessor object at 0x7fdcff4ae0f0>
nb = {'metadata': {'language_info': {'nbconvert_exporter': 'python', 'pygments_lexer': 'ipython3', 'mimetype': 'text/x-pyth...show(interactive_barchart_per_document, notebook_handle=True)", 'metadata': {'scrolled': False}, 'cell_type': 'code'}]}
resources = {}

    def preprocess(self, nb, resources):
        """
            Preprocess notebook executing each code cell.
    
            The input argument `nb` is modified in-place.
    
            Parameters
            ----------
            nb : NotebookNode
                Notebook being executed.
            resources : dictionary
                Additional resources used in the conversion process. For example,
                passing ``{'metadata': {'path': run_path}}`` sets the
                execution path to ``run_path``.
    
            Returns
            -------
            nb : NotebookNode
                The executed notebook.
            resources : dictionary
                Additional resources used in the conversion process.
            """
        path = resources.get('metadata', {}).get('path', '')
        if path == '':
            path = None
    
        # clear display_id map
        self._display_id_map = {}
    
        # from jupyter_client.manager import start_new_kernel
    
        def start_new_kernel(startup_timeout=60, kernel_name='python', **kwargs):
            km = self.kernel_manager_class(kernel_name=kernel_name)
            km.start_kernel(**kwargs)
            kc = km.client()
            kc.start_channels()
            try:
                kc.wait_for_ready(timeout=startup_timeout)
            except RuntimeError:
                kc.stop_channels()
                km.shutdown_kernel()
                raise
    
            return km, kc
    
        kernel_name = nb.metadata.get('kernelspec', {}).get('name', 'python')
        if self.kernel_name:
            kernel_name = self.kernel_name
        self.log.info("Executing notebook with kernel: %s" % kernel_name)
        self.km, self.kc = start_new_kernel(
            startup_timeout=self.startup_timeout,
            kernel_name=kernel_name,
            extra_arguments=self.extra_arguments,
            cwd=path)
        self.kc.allow_stdin = False
        self.nb = nb
    
        try:
>           nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources)

../../shiningpanda/jobs/62c67c92/virtualenvs/d41d8cd9/lib/python3.5/site-packages/nbconvert/preprocessors/execute.py:262: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <nbconvert.preprocessors.execute.ExecutePreprocessor object at 0x7fdcff4ae0f0>
nb = {'metadata': {'language_info': {'nbconvert_exporter': 'python', 'pygments_lexer': 'ipython3', 'mimetype': 'text/x-pyth...show(interactive_barchart_per_document, notebook_handle=True)", 'metadata': {'scrolled': False}, 'cell_type': 'code'}]}
resources = {}

    def preprocess(self, nb, resources):
        """
            Preprocessing to apply on each notebook.
    
            Must return modified nb, resources.
    
            If you wish to apply your preprocessing to each cell, you might want
            to override preprocess_cell method instead.
    
            Parameters
            ----------
            nb : NotebookNode
                Notebook being converted
            resources : dictionary
                Additional resources used in the conversion process.  Allows
                preprocessors to pass variables into the Jinja engine.
            """
        for index, cell in enumerate(nb.cells):
>           nb.cells[index], resources = self.preprocess_cell(cell, resources, index)

../../shiningpanda/jobs/62c67c92/virtualenvs/d41d8cd9/lib/python3.5/site-packages/nbconvert/preprocessors/base.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <nbconvert.preprocessors.execute.ExecutePreprocessor object at 0x7fdcff4ae0f0>
cell = {'execution_count': 3, 'outputs': [{'evalue': "'PosixPath' object has no attribute 'rfind'", 'output_type': 'error', '...5] # by adding '[:5]' to the variable, only the first 5 elements will be printed", 'metadata': {}, 'cell_type': 'code'}
resources = {}, cell_index = 2

    def preprocess_cell(self, cell, resources, cell_index):
        """
            Executes a single code cell. See base.py for details.
    
            To execute all cells see :meth:`preprocess`.
            """
        if cell.cell_type != 'code':
            return cell, resources
    
        reply, outputs = self.run_cell(cell, cell_index)
        cell.outputs = outputs
    
        if not self.allow_errors:
            for out in outputs:
                if out.output_type == 'error':
>                   raise CellExecutionError.from_cell_and_msg(cell, out)
E                   nbconvert.preprocessors.execute.CellExecutionError: An error occurred while executing the following cell:
E                   ------------------
E                   meta = pd.concat([metadata.fname2metadata(path, pattern=pattern) for path in path_to_corpus.glob('*.txt')])
E                   meta[:5] # by adding '[:5]' to the variable, only the first 5 elements will be printed
E                   ------------------
E                   
E                   #x1B[0;31m---------------------------------------------------------------------------#x1B[0m
E                   #x1B[0;31mAttributeError#x1B[0m                            Traceback (most recent call last)
E                   #x1B[0;32m<ipython-input-3-9f07ddf53acf>#x1B[0m in #x1B[0;36m<module>#x1B[0;34m()#x1B[0m
E                   #x1B[0;32m----> 1#x1B[0;31m #x1B[0mmeta#x1B[0m #x1B[0;34m=#x1B[0m #x1B[0mpd#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mconcat#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0;34m[#x1B[0m#x1B[0mmetadata#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mfname2metadata#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0mpath#x1B[0m#x1B[0;34m,#x1B[0m #x1B[0mpattern#x1B[0m#x1B[0;34m=#x1B[0m#x1B[0mpattern#x1B[0m#x1B[0;34m)#x1B[0m #x1B[0;32mfor#x1B[0m #x1B[0mpath#x1B[0m #x1B[0;32min#x1B[0m #x1B[0mpath_to_corpus#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mglob#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0;34m'*.txt'#x1B[0m#x1B[0;34m)#x1B[0m#x1B[0;34m]#x1B[0m#x1B[0;34m)#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m
E                   #x1B[0m#x1B[1;32m      2#x1B[0m #x1B[0mmeta#x1B[0m#x1B[0;34m[#x1B[0m#x1B[0;34m:#x1B[0m#x1B[0;36m5#x1B[0m#x1B[0;34m]#x1B[0m #x1B[0;31m# by adding '[:5]' to the variable, only the first 5 elements will be printed#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m
E                   
E                   #x1B[0;32m<ipython-input-3-9f07ddf53acf>#x1B[0m in #x1B[0;36m<listcomp>#x1B[0;34m(.0)#x1B[0m
E                   #x1B[0;32m----> 1#x1B[0;31m #x1B[0mmeta#x1B[0m #x1B[0;34m=#x1B[0m #x1B[0mpd#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mconcat#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0;34m[#x1B[0m#x1B[0mmetadata#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mfname2metadata#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0mpath#x1B[0m#x1B[0;34m,#x1B[0m #x1B[0mpattern#x1B[0m#x1B[0;34m=#x1B[0m#x1B[0mpattern#x1B[0m#x1B[0;34m)#x1B[0m #x1B[0;32mfor#x1B[0m #x1B[0mpath#x1B[0m #x1B[0;32min#x1B[0m #x1B[0mpath_to_corpus#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mglob#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0;34m'*.txt'#x1B[0m#x1B[0;34m)#x1B[0m#x1B[0;34m]#x1B[0m#x1B[0;34m)#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m
E                   #x1B[0m#x1B[1;32m      2#x1B[0m #x1B[0mmeta#x1B[0m#x1B[0;34m[#x1B[0m#x1B[0;34m:#x1B[0m#x1B[0;36m5#x1B[0m#x1B[0;34m]#x1B[0m #x1B[0;31m# by adding '[:5]' to the variable, only the first 5 elements will be printed#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m
E                   
E                   #x1B[0;32m~/shiningpanda/jobs/62c67c92/virtualenvs/d41d8cd9/lib/python3.5/site-packages/metadata_toolbox/utils.py#x1B[0m in #x1B[0;36mfname2metadata#x1B[0;34m(fname, pattern)#x1B[0m
E                   #x1B[1;32m     60#x1B[0m     """
E                   #x1B[1;32m     61#x1B[0m     #x1B[0mlog#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mdebug#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0;34m"Extracting metadata from filename '{0}' with pattern '{1}' ..."#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mformat#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0mfname#x1B[0m#x1B[0;34m,#x1B[0m #x1B[0mpattern#x1B[0m#x1B[0;34m)#x1B[0m#x1B[0;34m)#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m
E                   #x1B[0;32m---> 62#x1B[0;31m     #x1B[0mbasename#x1B[0m#x1B[0;34m,#x1B[0m #x1B[0m_#x1B[0m #x1B[0;34m=#x1B[0m #x1B[0mos#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mpath#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0msplitext#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0mos#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mpath#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mbasename#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0mfname#x1B[0m#x1B[0;34m)#x1B[0m#x1B[0;34m)#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m
E                   #x1B[0m#x1B[1;32m     63#x1B[0m     #x1B[0mmetadata#x1B[0m #x1B[0;34m=#x1B[0m #x1B[0mparse#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0mpattern#x1B[0m#x1B[0;34m,#x1B[0m #x1B[0mbasename#x1B[0m#x1B[0;34m)#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m
E                   #x1B[1;32m     64#x1B[0m     #x1B[0;32mif#x1B[0m #x1B[0mmetadata#x1B[0m #x1B[0;32mis#x1B[0m #x1B[0;32mnot#x1B[0m #x1B[0;32mNone#x1B[0m#x1B[0;34m:#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m
E                   
E                   #x1B[0;32m~/shiningpanda/jobs/62c67c92/virtualenvs/d41d8cd9/lib/python3.5/posixpath.py#x1B[0m in #x1B[0;36mbasename#x1B[0;34m(p)#x1B[0m
E                   #x1B[1;32m    137#x1B[0m     #x1B[0;34m"""Returns the final component of a pathname"""#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m
E                   #x1B[1;32m    138#x1B[0m     #x1B[0msep#x1B[0m #x1B[0;34m=#x1B[0m #x1B[0m_get_sep#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0mp#x1B[0m#x1B[0;34m)#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m
E                   #x1B[0;32m--> 139#x1B[0;31m     #x1B[0mi#x1B[0m #x1B[0;34m=#x1B[0m #x1B[0mp#x1B[0m#x1B[0;34m.#x1B[0m#x1B[0mrfind#x1B[0m#x1B[0;34m(#x1B[0m#x1B[0msep#x1B[0m#x1B[0;34m)#x1B[0m #x1B[0;34m+#x1B[0m #x1B[0;36m1#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m
E                   #x1B[0m#x1B[1;32m    140#x1B[0m     #x1B[0;32mreturn#x1B[0m #x1B[0mp#x1B[0m#x1B[0;34m[#x1B[0m#x1B[0mi#x1B[0m#x1B[0;34m:#x1B[0m#x1B[0;34m]#x1B[0m#x1B[0;34m#x1B[0m#x1B[0m
E                   #x1B[1;32m    141#x1B[0m #x1B[0;34m#x1B[0m#x1B[0m
E                   
E                   #x1B[0;31mAttributeError#x1B[0m: 'PosixPath' object has no attribute 'rfind'
E                   AttributeError: 'PosixPath' object has no attribute 'rfind'

../../shiningpanda/jobs/62c67c92/virtualenvs/d41d8cd9/lib/python3.5/site-packages/nbconvert/preprocessors/execute.py:286: CellExecutionError