<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_host_ipv4(name=None, mac=None, allow_array=False, **api_opts):
    '''
    Get ipv4 address from host record.

    Use `allow_array` to return possible multiple values.

    CLI Examples:

    .. code-block:: bash

        salt-call infoblox.get_host_ipv4 host=localhost.domain.com
        salt-call infoblox.get_host_ipv4 mac=00:50:56:84:6e:ae
    '''
    data = get_host(name=name, mac=mac, **api_opts)
    if data and 'ipv4addrs' in data:
        l = []
        for a in data['ipv4addrs']:
            if 'ipv4addr' in a:
                l.append(a['ipv4addr'])
        if allow_array:
            return l
        if l:
            return l[0]
    return None