def parse_sources(sources):
    """
    Given a string of data sources; the second field in a line from a
    collectd types database, return a list of dictionaries describing those
    data sources.

    The sources should be delimited by spaces and, optionally, a comma
    (",") right after each list-entry.

    Each data-source is defined by a quadruple made up of the data-source
    name, type, minimal and maximal values, delimited by colons (":"):
    ds-name:ds-type:min:max. ds-type may be either ABSOLUTE, COUNTER,
    DERIVE, or GAUGE. min and max define the range of valid values for data
    stored for this data-source.
    """
    fields = ('name', 'type', 'min', 'max')
    sources = sources.replace(',', ' ').split()
    return [dict(zip(fields, source.split(':'))) for source in sources]