def get_hlc(dw_type, age):
    """Calculates the linearly derived heat loss coeeficients
    depending on age and dwelling type

    Arguments
    ----------
    dw_type : int
        Dwelling type
    age : int
        Age of dwelling

    Returns
    -------
    hls : Heat loss coefficient [W/m2 * K]

    Notes
    -----
    Source: Linear trends derived from Table 3.17 ECUK Tables
    https://www.gov.uk/government/collections/energy-consumption-in-the-uk
    """
    if dw_type is None or age is None:
        return None
    else:
        linear_fits_hlc = {'detached': [-0.0223, 48.292], 'semi_detached':
            [-0.0223, 48.251], 'terraced': [-0.0223, 48.063], 'flat': [-
            0.0223, 47.02], 'bungalow': [-0.0223, 48.261]}
        hlc = linear_fits_hlc[dw_type][0] * age + linear_fits_hlc[dw_type][1]
        return hlc
