# Buggy code
def declare_dependencies():
    for dep in DEPENDENCIES_BASE:
        # Detect if dependency is optional
        if dep.get("optional", False):
            optional = True
        else:
            optional = False

        add(
            dep["modname"],
            dep["package_name"],
            dep["features"],
            dep["required_version"],
            optional=optional,
        )


# Traceback (AssertionErrorWARNING)
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/pyls_jsonrpc/endpoint.py", line 113, in consume
self._handle_request(message['id'], message['method'], message.get('params'))
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/pyls_jsonrpc/endpoint.py", line 182, in _handle_request
handler_result = handler(params)
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/pyls_jsonrpc/dispatchers.py", line 23, in handler
return method(**(params or {}))
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/pyls/python_ls.py", line 319, in m_text_document__completion
return self.completions(textDocument['uri'], position)
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/pyls/python_ls.py", line 237, in completions
completions = self._hook('pyls_completions', doc_uri, position=position)
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/pyls/python_ls.py", line 153, in _hook
return hook_handlers(config=self.config, workspace=workspace, document=doc, **kwargs)
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/pluggy/manager.py", line 92, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/pluggy/manager.py", line 335, in traced_hookexec
return outcome.get_result()
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
raise ex[1].with_traceback(ex[2])
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/pluggy/callers.py", line 52, in from_call
result = func()
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/pluggy/manager.py", line 333, in <lambda>
outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/pluggy/manager.py", line 86, in <lambda>
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
return outcome.get_result()
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
raise ex[1].with_traceback(ex[2])
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
res = hook_impl.function(*args)
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/pyls/plugins/jedi_completion.py", line 68, in pyls_completions
return [_format_completion(d, include_params) for d in definitions] or None
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/pyls/plugins/jedi_completion.py", line 68, in <listcomp>
return [_format_completion(d, include_params) for d in definitions] or None
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/pyls/plugins/jedi_completion.py", line 98, in _format_completion
'documentation': _utils.format_docstring(d.docstring()),
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/jedi/api/classes.py", line 479, in docstring
return super(Completion, self).docstring(raw=raw, fast=fast)
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/jedi/api/classes.py", line 242, in docstring
return _Help(self._name).docstring(fast=fast, raw=raw)
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/jedi/api/classes.py", line 756, in docstring
signature_text = _format_signatures(context)
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/jedi/api/classes.py", line 715, in _format_signatures
for signature in context.get_signatures()
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/jedi/evaluate/context/klass.py", line 229, in get_signatures
return [sig.bind(self) for sig in init_funcs.get_signatures()]
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/jedi/evaluate/context/klass.py", line 229, in <listcomp>
return [sig.bind(self) for sig in init_funcs.get_signatures()]
File "/home/apostolos/miniconda3/envs/forex/lib/python3.7/site-packages/jedi/evaluate/signature.py", line 107, in bind
assert not self.is_bound

AssertionErrorWARNING:spyder.widgets.github.backend:Failed to send bug report on Github. response={'code': 401, 'json': {'message': 'Bad credentials', 'documentation_url': 'https://developer.github.com/v3'}}

# Fixed code
def declare_dependencies():
    for dep in DESCRIPTIONS:
        # Detect if dependency is optional
        if dep.get("optional", False):
            optional = True
        else:
            optional = False

        add(
            dep["modname"],
            dep["package_name"],
            dep["features"],
            dep["required_version"],
            optional=optional,
        )