def _extract_base(self, element):
if isinstance(element, list):<EOL><INDENT>return [self._extract_base(x) for x in element]<EOL><DEDENT>base = self.checker.is_url_valid(url=element, return_base=True)<EOL>if base:<EOL><INDENT>return base<EOL><DEDENT>if "<STR_LIT:/>" in element:<EOL><INDENT>return element.split("<STR_LIT:/>")[<NUM_LIT:0>]<EOL><DEDENT>return element<EOL>
Extract the base of the given element.

.. example:
    given "hello/world?world=beautiful" return "hello"

:param element: The element we are working with.
:type element: str|list