in_b.data, train_b.target, test_size=val_pct, random_state=random_state
        )

    # decode based on supplied encoding
    if encoding is None:
        encoding = TU.detect_encoding(x_train)
        U.vprint(&#34;detected encoding: %s&#34; % (encoding), verbose=verbose)

    try:
        x_train = [x.decode(encoding) for x in x_train]
        x_test = [x.decode(encoding) for x in x_test]
    except:
        U.vprint(
            &#34;Decoding with %s failed 1st attempt - using %s with skips&#34;
       