import networkx as nx

PLUGIN_VERSION = 0


def method(data, name, **kwargs):
    """Return an arbitrary network generated by NetworkX package.

    This method uses an arbitrary NetworkX generator to create a
    network, which may be analyzed in further steps.

    Parameters
    ----------
    data
        Method does not use this parameter. It is there only for formal
        purposes.
    name : str
        Name of the networks generator.
    **kwargs
        Arguments of the generator (for example `n` and `p` for the
        `erdos_renyi_graph`).

    Returns
    -------
    networkx.Graph
        A network created via the specified generator.

    See Also
    --------
    https://networkx.org/documentation/stable/reference/generators.html
    """

    gen = getattr(nx, name)
    G = gen(**kwargs)
    return {'data': G}
