from bs4 import BeautifulSoup


def get_head_from_soup(soup:BeautifulSoup):
    """
    Extract the <head> tag from a BeautifulSoup object.

    Args: 
        input (BeautifulSoup): markup language as BeautifulSoup object
    Returns: 
        head (str): <head> of the page
    Modules: 
        bs4 (BeautifulSoup)
    """
    # get the head:
    head = soup.find('head')
    # convert to string:
    head = str(head).strip()
    return head