






def 				snake_case__							(							UpperCAmelCase							:  dict       ):
    lowerCAmelCase__   :set[int]      							=				set()
    # To detect a back edge, keep track of vertices currently in the recursion stack
    lowerCAmelCase__   :set[int]      							=				set()
    return any(
        node not in visited and depth_first_search(UpperCAmelCase    ,			UpperCAmelCase    ,			UpperCAmelCase    ,			UpperCAmelCase       )
        for node in graph       )


def 				snake_case__							(							UpperCAmelCase							:  dict    ,			UpperCAmelCase							:  int    ,			UpperCAmelCase							:  set    ,			UpperCAmelCase							:  set       ):
    visited.add(UpperCAmelCase       )
    rec_stk.add(UpperCAmelCase       )

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

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


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

 testmod()











import re


def 				snake_case__							(							UpperCAmelCase							:  str       ):
    return [char.split() for char in re.split(R"[^ a-z A-Z 0-9 \s]"    ,			str_       )]


def 				snake_case__							(							UpperCAmelCase							:  str       ):
    lowerCAmelCase__   :List[Any]      							=				split_input(str_       )
    return "".join(
        ["".join([char.capitalize() for char in sub_str]       ) for sub_str in string_split]       )


def 				snake_case__							(							UpperCAmelCase							:  str    ,			UpperCAmelCase							:  bool    ,			UpperCAmelCase							:  str       ):
    try:
        lowerCAmelCase__   :Dict      							=				split_input(UpperCAmelCase       )
        if upper:
            lowerCAmelCase__   :Dict      							=				"".join(
                [
                    separator.join([char.upper() for char in sub_str]       )
                    for sub_str in string_split
                ]       )
        else:
            lowerCAmelCase__   :Any      							=				"".join(
                [
                    separator.join([char.lower() for char in sub_str]       )
                    for sub_str in string_split
                ]       )
        return res_str
    except IndexError:
        return "not valid string"


def 				snake_case__							(							UpperCAmelCase							:  str       ):
    return to_simple_case(UpperCAmelCase       )


def 				snake_case__							(							UpperCAmelCase							:  str       ):
    try:
        lowerCAmelCase__   :Any      							=				to_simple_case(UpperCAmelCase       )
        return res_str[0].lower() + res_str[1:]
    except IndexError:
        return "not valid string"


def 				snake_case__							(							UpperCAmelCase							:  str    ,			UpperCAmelCase							:  bool       ):
    return to_complex_case(UpperCAmelCase    ,			UpperCAmelCase    ,			"_"       )


def 				snake_case__							(							UpperCAmelCase							:  str    ,			UpperCAmelCase							:  bool       ):
    return to_complex_case(UpperCAmelCase    ,			UpperCAmelCase    ,			"-"       )


if __name__ == "__main__":
 __import__("""doctest""").testmod()



