


def __UpperCAmelCase       (		__A			)						->					bool:



       '''simple docstring'''





       UpperCAmelCase__										=     set()
       # To detect a back edge, keep track of vertices currently in the recursion stack
       UpperCAmelCase__										=     set()
       return any(
           node not in visited and depth_first_search(__A ,						__A ,						__A ,						__A			)
           for node in graph			)





def __UpperCAmelCase       (		__A ,						__A ,						__A ,						__A			)						->					bool:



       '''simple docstring'''





       visited.add(__A			)
       rec_stk.add(__A			)

       for node in graph[vertex]:
              if node not in visited:
                     if depth_first_search(__A ,						__A ,						__A ,						__A			):
                            return True
              elif node in rec_stk:
                     return True

    # The node needs to be removed from recursion stack before function ends
       rec_stk.remove(__A			)
       return False


if __name__ == "__main__":
    from doctest import testmod

    testmod()









from __future__ import annotations





def __UpperCAmelCase       (		__A ,						__A ,						__A ,						)						->					tuple:



       '''simple docstring'''





       if (electron_conc, hole_conc, intrinsic_conc).count(0			) != 1:
              raise ValueError("You cannot supply more or less than 2 values"			)
       elif electron_conc < 0:
              raise ValueError("Electron concentration cannot be negative in a semiconductor"			)
       elif hole_conc < 0:
              raise ValueError("Hole concentration cannot be negative in a semiconductor"			)
       elif intrinsic_conc < 0:
              raise ValueError(
                  "Intrinsic concentration cannot be negative in a semiconductor"			)
       elif electron_conc == 0:
              return (
                  "electron_conc",
                  intrinsic_conc**2 / hole_conc,
              )
       elif hole_conc == 0:
              return (
                  "hole_conc",
                  intrinsic_conc**2 / electron_conc,
              )
       elif intrinsic_conc == 0:
              return (
                  "intrinsic_conc",
                  (electron_conc * hole_conc) ** 0.5,
              )
       else:
              return (-1, -1)


if __name__ == "__main__":
    import doctest

    doctest.testmod()





