





'''simple docstring'''


import random


def 	__a(SCREAMING_SNAKE_CASE_  :					int		,       SCREAMING_SNAKE_CASE_  :					float		,       SCREAMING_SNAKE_CASE_  :					bool = False    ):



    '''simple docstring'''





    _lowerCAmelCase				=	{i: [] for i in range(snake_case_    )}

    # if probability is greater or equal than 1, then generate a complete graph
    if probability >= 1:
        return complete_graph(snake_case_    )
    # if probability is lower or equal than 0, then return a graph without edges
    if probability <= 0:
        return graph

    # for each couple of nodes, add an edge from u to v
    # if the number randomly generated is greater than probability probability
    for i in range(snake_case_    ):
        for j in range(i + 1		,       snake_case_    ):
            if random.random() < probability:
                graph[i].append(snake_case_    )
                if not directed:
                    # if the graph is undirected, add an edge in from j to i, either
                    graph[j].append(snake_case_    )
    return graph


def 	__a(SCREAMING_SNAKE_CASE_  :					int    ):



    '''simple docstring'''





    return {
        i: [j for j in range(snake_case_    ) if i != j] for i in range(snake_case_    )
    }


if __name__ == "__main__":
       import doctest

       doctest.testmod()









'''simple docstring'''


from __future__ import annotations


def 	__a(SCREAMING_SNAKE_CASE_  :					float		,       SCREAMING_SNAKE_CASE_  :					float		,       SCREAMING_SNAKE_CASE_  :					float    ):



    '''simple docstring'''





    if (voltage, current, resistance).count(0    ) != 1:
        raise ValueError("One and only one argument must be 0"    )
    if resistance < 0:
        raise ValueError("Resistance cannot be negative"    )
    if voltage == 0:
        return {"voltage": float(current * resistance    )}
    elif current == 0:
        return {"current": voltage / resistance}
    elif resistance == 0:
        return {"resistance": voltage / current}
    else:
        raise ValueError("Exactly one argument must be 0"    )


if __name__ == "__main__":
       import doctest

       doctest.testmod()


