(
    symbol: str,
    allowed_infix: str,
    disallowed_infix: Optional[str] = None
)
return any([allowed_infix in currency for currency in parts])
This function is to keep everything that has allowed_infix=REP, but
    excpude everything that has disallowed_infix=DREP, except for when you encounter something like: REPV2/DREP

    Returns True if this symbol is allowed to be in the list.

    Args:
        symbol (str): the symbol to evaluate
        allowed_infix (str): the allowed infix for both currencies in this symbol
        disallowed_infix (Optional[str], optional): the disallowed infix for when the other currency is does not have the allowed infix. Defaults to None.

    Returns:
        bool:
This function is to keep everything that has allowed_infix=REP, but
    excpude everything that has disallowed_infix=DREP, except for when you encounter something like: REPV2/DREP
This function is to keep everything that has allowed_infix = REP but excpude everything that has disallowed_infix = DREP except for when you encounter something like : REPV2 / DREP
def is_symbol_match(
    symbol: str,
    allowed_infix: str,
    disallowed_infix: Optional[str] = None
) -> bool:
    """This function is to keep everything that has allowed_infix=REP, but
    excpude everything that has disallowed_infix=DREP, except for when you encounter something like: REPV2/DREP

    Returns True if this symbol is allowed to be in the list.

    Args:
        symbol (str): the symbol to evaluate
        allowed_infix (str): the allowed infix for both currencies in this symbol
        disallowed_infix (Optional[str], optional): the disallowed infix for when the other currency is does not have the allowed infix. Defaults to None.

    Returns:
        bool:
    """
    parts = symbol.split('/')

    if disallowed_infix:
        for i, currency in enumerate(parts):
            if disallowed_infix in currency:
                # if one currency contains for instance disallowed_infix=DREP,
                # then the other currency must contain allowed_infix=REP to be allowed, else disallow
                return allowed_infix in parts[i + 1 % 2]

    return any([allowed_infix in currency for currency in parts])
def is_symbol_match ( symbol : str , allowed_infix : str , disallowed_infix : Optional [ str ] = None ) -> bool : parts = symbol . split ( '/' ) if disallowed_infix : for i , currency in enumerate ( parts ) : if disallowed_infix in currency : # if one currency contains for instance disallowed_infix=DREP, # then the other currency must contain allowed_infix=REP to be allowed, else disallow return allowed_infix in parts [ i + 1 % 2 ] return any ( [ allowed_infix in currency for currency in parts ] )