def vert_init_commodities(vertex_df, commodities, sources=None, inplace=True):
    """Add commodity columns to the vertex DataFrame
    with zeros to vertices without commodity source and
    source capacity at the vertices provided by `sources`.

    Parameters
    ----------
    vertex_df : (Geo)DataFrame
        vertex dataframe input
    commodities : list of str
        Like ('Elec', 'Gas', 'Heat')
    sources : list of tuples, optional
        Init the source nodes.
        Tuple form:(Commodity, Index, Value)
    inplace : Boolean, default: True
        If False, vertex_df is not changed and the result is returned.

    Returns
    -------
    None or DataFrame
        DataFrame if inplace == False

    Raises
    ------
    ValueError
        If parameters differ from awaited

    Example
    --------
    ::

        comms = ('Elec', 'Gas')
        sources = [('Elec', 0, 1000), ('Gas', 1, 500)]
        vert_init_commodities(vert, comms, sources)
    """
    if inplace:
        vdf = vertex_df
    else:
        vdf = vertex_df.copy()

    for commo in commodities:
        vdf[commo] = len(vdf) * [0]
    if sources:
        for s in sources:
            is_well_typed = (isinstance(s[0], str) and
                             abs(s[1]) >= 0 and
                             abs(s[2]) >= 0)
            has_good_dims = (len(s) == 3) and s[1] < len(vdf)
            if is_well_typed and has_good_dims:
                vdf.set_value(index=s[1], col=s[0], value=s[2])
            else:
                raise ValueError('Parameter problem in function call.\n' +
                                 'Type is good: {}\n'.format(is_well_typed) +
                                 'Dims are good: {}\n'.format(has_good_dims) +
                                 'Source: {}'.format(s))
        if not inplace:
            return vdf