import re


def identify_url(url):
    """Identify from which site a url is.

    Return values:
    'letras'   for 'letras.mus.br'
    'vagalume' for 'vagalume.com.br'
    'unknown'  if not able to identify.
    """

    if not isinstance(url, str):
        raise ValueError('url is not a string')
    url = url.strip()
    pattern = re.compile(r'^https?://.+\..+$')
    if pattern.search(url) == None:
        raise ValueError('not a webpage')

    sources = {
        'letras': r'letras\.mus\.br',
        'vagalume': r'vagalume\.com\.br'
    }
    for key in sources:
        pattern = re.compile(sources[key])
        if pattern.search(url) != None:
            return key

    return 'unknown'