import hashlib


def get_seed(mnemonic_bytes, passphrase=None):
    """
    This function creates a mnemonic seed from bytes encoded mnemonic.
    Passphrase is optional
    """
    if passphrase is not None:
        salt = ("mnemonic" + passphrase).encode("utf8")
    else:
        salt = "mnemonic".encode("utf8")
    seed = hashlib.pbkdf2_hmac(
        'sha512',
        mnemonic_bytes,
        salt,
        2048,
    )
    return seed