Write a function, has_cycle, that takes in an object representing the adjacency list of a directed graph. The function should return a boolean indicating whether or not the graph contains a cycle.
has_cycle({
"a": ["b"],
"b": ["c"],
"c": ["a"],
}) # -> Truehas_cycle({
"a": ["b", "c"],
"b": ["c"],
"c": ["d"],
"d": [],
}) # -> Falsehas_cycle({
"a": ["b", "c"],
"b": [],
"c": [],
"e": ["f"],
"f": ["e"],
}) # -> Truehas_cycle({
"q": ["r", "s"],
"r": ["t", "u"],
"s": [],
"t": [],
"u": [],
"v": ["w"],
"w": [],
"x": ["w"],
}) # -> Falsehas_cycle({
"a": ["b"],
"b": ["c"],
"c": ["a"],
"g": [],
}) # -> Truehas_cycle({
"a": ["b"],
"b": ["c"],
"c": ["d"],
"d": ["b"],
}) # -> True