<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_valid_har(har_data):
 """ Return list of valid HAR entries. :rtype: list """

    new_entries = []
    entries = har_data.get('log', {}).get('entries', [])
    logger.debug('[+] Detected %(n)d entries in HAR', {'n': len(entries)})

    for entry in entries:
        url = entry['request']['url']
        if not is_url_allowed(url):
            continue

        response = entry['response']['content']
        if not is_valid_mimetype(response):
            continue

        if response.get('text'):
            charset = get_charset(response)
            response['text'] = base64.b64decode(response['text']).decode(charset)
        else:
            response['text'] = ''

        new_entries.append(entry)

        logger.debug('[+] Added URL: %(url)s ...', {'url': url[:100]})

    return new_entries