# Path: opt_einsum/parser.py
# def get_symbol(i: int) -> str:
#     """Get the symbol corresponding to int ``i`` - runs through the usual 52
#     letters before resorting to unicode characters, starting at ``chr(192)``.
# 
#     **Examples:**
# 
#     ```python
#     get_symbol(2)
#     #> 'c'
# 
#     get_symbol(200)
#     #> 'Ŕ'
# 
#     get_symbol(20000)
#     #> '京'
#     ```
#     """
#     if i < 52:
#         return _einsum_symbols_base[i]
#     return chr(i + 140)
# 
# Path: opt_einsum/typing.py



from typing import Any, Collection, Dict, FrozenSet, Iterable, List, Optional, Tuple, Union, overload
from .parser import get_symbol
from .typing import ArrayIndexType, PathType
import numpy as np
        The total number of FLOPS required for the contraction.

    Examples
    --------

    >>> flop_count('abc', False, 1, {'a': 2, 'b':3, 'c':5})
    30

    >>> flop_count('abc', True, 2, {'a': 2, 'b':3, 'c':5})
    60

    """

    overall_size = compute_size_by_dict(idx_contraction, size_dictionary)
    op_factor = max(1, num_terms - 1)
    if inner:
        op_factor += 1

    return overall_size * op_factor


def rand_equation(
    n: int,
    reg: int,
    n_out: int = 0,
    d_min: int = 2,
    d_max: int = 9,
    seed: Optional[int] = None,
    global_dim: bool = False,
    return_size_dict: bool = False,

# Path: opt_einsum/parser.py
# def get_symbol(i: int) -> str:
#     """Get the symbol corresponding to int ``i`` - runs through the usual 52
#     letters before resorting to unicode characters, starting at ``chr(192)``.
# 
#     **Examples:**
# 
#     ```python
#     get_symbol(2)
#     #> 'c'
# 
#     get_symbol(200)
#     #> 'Ŕ'
# 
#     get_symbol(20000)
#     #> '京'
#     ```
#     """
#     if i < 52:
#         return _einsum_symbols_base[i]
#     return chr(i + 140)
# 
# Path: opt_einsum/typing.py



# Path: opt_einsum/helpers.py
from typing import Any, Collection, Dict, FrozenSet, Iterable, List, Optional, Tuple, Union, overload
from .parser import get_symbol
from .typing import ArrayIndexType, PathType
import numpy as np

        The total number of FLOPS required for the contraction.

    Examples
    --------

    >>> flop_count('abc', False, 1, {'a': 2, 'b':3, 'c':5})
    30

    >>> flop_count('abc', True, 2, {'a': 2, 'b':3, 'c':5})
    60

    """

    overall_size = compute_size_by_dict(idx_contraction, size_dictionary)
    op_factor = max(1, num_terms - 1)
    if inner:
        op_factor += 1

    return overall_size * op_factor


def rand_equation(
    n: int,
    reg: int,
    n_out: int = 0,
    d_min: int = 2,
    d_max: int = 9,
    seed: Optional[int] = None,
    global_dim: bool = False,
    return_size_dict: bool = False,

) -> Union[Tuple[str, PathType, Dict[str, int]], Tuple[str, PathType]]: