def suggest_type(full_text, text_before_cursor):
    """Takes the full_text that is typed so far and also the text before the
    cursor to suggest completion type and scope.

    Returns a tuple with a type of entity ('table', 'column' etc) and a scope.
    A scope for a column category will be a list of tables.
    """

    word_before_cursor = last_word(text_before_cursor,
            include='many_punctuations')

    identifier = None

    # here should be removed once sqlparse has been fixed
    try:
        # If we've partially typed a word then word_before_cursor won't be an empty
        # string. In that case we want to remove the partially typed string before
        # sending it to the sqlparser. Otherwise the last token will always be the
        # partially typed string which renders the smart completion useless because
        # it will always return the list of keywords as completion.
        if word_before_cursor:
            if word_before_cursor.endswith(
                    '(') or word_before_cursor.startswith('\\'):
                parsed = sqlparse.parse(text_before_cursor)
            else:
                parsed = sqlparse.parse(
                    text_before_cursor[:-len(word_before_cursor)])

                # word_before_cursor may include a schema qualification, like
                # "schema_name.partial_name" or "schema_name.", so parse it
                # separately
                p = sqlparse.parse(word_before_cursor)[0]

                if p.tokens and isinstance(p.tokens[0], Identifier):
                    identifier = p.tokens[0]
        else:
            parsed = sqlparse.parse(text_before_cursor)
    except (TypeError, AttributeError):
        return [{'type': 'keyword'}]

    if len(parsed) > 1:
        # Multiple statements being edited -- isolate the current one by
        # cumulatively summing statement lengths to find the one that bounds the
        # current position
        current_pos = len(text_before_cursor)
        stmt_start, stmt_end = 0, 0

        for statement in parsed:
            stmt_len = len(str(statement))
            stmt_start, stmt_end = stmt_end, stmt_end + stmt_len

            if stmt_end >= current_pos:
                text_before_cursor = full_text[stmt_start:current_pos]
                full_text = full_text[stmt_start:]
                break

    elif parsed:
        # A single statement
        statement = parsed[0]
    else:
        # The empty string
        statement = None

    # Check for special commands and handle those separately
    if statement:
        # Be careful here because trivial whitespace is parsed as a statement,
        # but the statement won't have a first token
        tok1 = statement.token_first()
        if tok1 and (tok1.value == 'source' or tok1.value.startswith('\\')):
            return suggest_special(text_before_cursor)

    last_token = statement and statement.token_prev(len(statement.tokens))[1] or ''

    return suggest_based_on_last_token(last_token, text_before_cursor,
                                       full_text, identifier)

suggest_type(full_text='SELECT  FROM tabl', text_before_cursor='SELECT ')

'SELECT  FROM tabl'

'SELECT  FROM tabl'

(<Statement 'SELECT ' at 0x7F95D0DD9D60>,)


def _readSetElementInfoRecord(fp):

        SetNames = []
        ElementList = []
        SetStatus = []

        nbyte = HarFileIO._getEntrySize(fp)

        # read the data, has to be in chunks as it is dependent on interanl size specifications
        dataForm = '=' + '4siii12si'

        V = HarFileIO._unpack_data(fp, dataForm)

        if fb(V[0]) != '    ':
            raise RuntimeError("Encountered characters at first four positions at SetEl")

        NSets = V[3]
        Coefficient = fb(V[4])
        setKnown=V[5]!=0
        if not setKnown:
            dataForm = '=i'
        else:
            dataForm = "=" + str(NSets * 12) + 's' + str(NSets) + 's' + str(NSets) + 'i' + 'i'

        V = HarFileIO._unpack_data(fp, dataForm)
        if setKnown:
            SetNames = [fb(V[0][i:i + 12]) for i in range(0, NSets * 12, 12)]
            SetStatus = [fb(V[1][i:i + 1]) for i in range(0, NSets)]

        Nexplicit = V[-1]
        dataForm = '=' + str(Nexplicit * 12) + 's'
        V = HarFileIO._unpack_data(fp, dataForm)

        if Nexplicit > 0:
            dataForm = '=' + str(Nexplicit * 12) + 's'
            V = HarFileIO._unpack_data(fp, dataForm)

            ElementList = [fb(V[-1][i:i + 12]) for i in range(0, NSets * 12, 12)]

        HarFileIO._checkRead(fp, nbyte)

        return Coefficient, SetNames, SetStatus, ElementList

_readSetElementInfoRecord(fp=<_io.BufferedReader name='/local/rcs/XXX/code/pytrace-collector/logs/pypibugs/tried/GEMPACKsoftware+HARPY/GEMPACKsoftware+HARPY/test_remove_header_array.har'>)

(b'SimpleSet   SimpleSet2  ', b'kk', 0, 0, 0)


def _get_logger(name):
    """Gets a logger by name, or creates and configures it for the first time."""
    logger = logging.getLogger(name)
    logger.setLevel(logging.INFO)
    # If the logger is configured, skip the configure
    if not logger.handlers and not logging.getLogger().handlers:
        handler = logging.StreamHandler(sys.stderr)
        logger.addHandler(handler)
    return logger

_get_logger(name='hyperopt.utils')


SetStatus = [fb(V[1][i:i + 1]) for i in range(0, NSets)]


def class_to_tg(sub_class: str):
    trans = {"Online": "_online", "Offline": "_offline"}

    for upper, lower in trans.items():
        sub_class = sub_class.replace(upper, lower)

    return sub_class.lower()

class_to_tg(sub_class='YYeTsOffline')

{'Online': '_online', 'Offline': '_offline'}


def authenticate(pattern, email):
    if '|' in pattern:
        return email in pattern.split('|')
    if '*' in pattern:
        pattern = re.escape(pattern).replace(r'\.\*', r"[A-Za-z0-9!#$%&'*+/=?^_`{|}~.\-]*")
        return re.fullmatch(pattern, email)
    return pattern == email

authenticate(pattern='.*@example.com', email='one@example.com')


def type_correct_with(cdict, cfg_tuple):
    """Use type hints of the cfg tuple to cast parameters i.e. attributes into their intended types"""
    # TODO: This would be cleaner, if the config would use Schema or derivative in the
    # first place and use its validation process
    res = {}
    for k, v in cdict.items():
        typename = getattr(cfg_tuple, k)
        res.update({k: type(typename)(v)})
    return res

type_correct_with(cdict={'bar': '42'}, cfg_tuple={})


def clasifier(optimizer):
    X, y = make_classification(
        n_samples=1000, n_features=100, n_informative=75, random_state=1111, n_classes=2, class_sep=2.5
    )
    y = one_hot(y)

    X -= np.mean(X, axis=0)
    X /= np.std(X, axis=0)
    X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.15, random_state=1111)

    model = NeuralNet(
        layers=[
            Dense(128, Parameters(init="uniform")),
            Activation("relu"),
            Dropout(0.5),
            Dense(64, Parameters(init="normal")),
            Activation("relu"),
            Dense(2),
            Activation("softmax"),
        ],
        loss="categorical_crossentropy",
        optimizer=optimizer,
        metric="accuracy",
        batch_size=64,
        max_epochs=10,
    )
    model.fit(X_train, y_train)
    predictions = model.predict(X_test)
    return roc_auc_score(y_test[:, 0], predictions[:, 0])

clasifier(optimizer={rho=0.95, eps=1e-08, lr=1.0})

{verbose=True, shuffle=False, optimizer=<mla.neuralnet.optimizers.Adadelta object at 0x7f43904a38e0>, layers=[<mla.neuralnet.layers.basic.Dense object at 0x7f43904a3610>, <mla.neuralnet.layers.basic.Activation object at 0x7f43904a33d0>, <mla.neuralnet.layers.basic.Dropout object at 0x7f43904a32b0>, <mla.neuralnet.layers.basic.Dense object at 0x7f43904a3c70>, <mla.neuralnet.layers.basic.Activation object at 0x7f43904a3550>, <mla.neuralnet.layers.basic.Dense object at 0x7f43904a3820>, <mla.neuralnet.layers.basic.Activation object at 0x7f43904a3730>], batch_size=64, max_epochs=10, _n_layers=0, log_metric=True, metric_name='accuracy', bprop_entry=-1, training=False, _initialized=False}


def __remove_ip_object(self, ip_object):

        if ip_object not in self.__description:
            raise IPObjectNotInSpaceError(
                "cannot remove undescribed IP object"
            )

        if isinstance(ip_object, IPAddressTuple):

            supernet = self.__parent_supernet[ip_object]
            self.__children_ip_object[supernet].remove(ip_object)
            del self.__parent_supernet[ip_object]
            del self.__description[ip_object]

        elif isinstance(ip_object, IPNetworkTuple):

            supernet = self.__parent_supernet[ip_object]
            children_of_supernet = (
                self.__children_ip_object.setdefault(supernet, set())
            )

            for child in self.__children_ip_object[ip_object]:
                self.__parent_supernet[child] = supernet
                children_of_supernet.add(child)

            del self.__children_ip_object[ip_object]
            del self.__parent_supernet[ip_object]
            del self.__description[ip_object]

        else:

            raise TypeError("ip_parameter must be a valid IP object")

        return True

__remove_ip_object(self=AddressSpace(_AddressSpace__strict=False, _AddressSpace__description={IPv4Address('203.0.113.128'): 'an IPv4 test net address'}, _AddressSpace__networks={}, _AddressSpace__addresses={4: {IPv4Address('203.0.113.128')}}, _AddressSpace__parent_supernet={IPv4Address('203.0.113.128'): None}, _AddressSpace__children_ip_object={None: {IPv4Address('203.0.113.128')}}), ip_object=IPv4Address('203.0.113.128'), self._AddressSpace__addresses={4: {IPv4Address('203.0.113.128')}}, self._AddressSpace__children_ip_object={None: {IPv4Address('203.0.113.128')}}, self._AddressSpace__description={IPv4Address('203.0.113.128'): 'an IPv4 test net address'}, self._AddressSpace__networks={}, self._AddressSpace__parent_supernet={IPv4Address('203.0.113.128'): None}, self._AddressSpace__strict=False)

AddressSpace(_AddressSpace__strict=False, _AddressSpace__description={IPv4Address('203.0.113.128'): 'an IPv4 test net address'}, _AddressSpace__networks={}, _AddressSpace__addresses={4: {IPv4Address('203.0.113.128')}}, _AddressSpace__parent_supernet={IPv4Address('203.0.113.128'): None}, _AddressSpace__children_ip_object={None: set()})

AddressSpace(_AddressSpace__strict=False, _AddressSpace__description={IPv4Address('203.0.113.128'): 'an IPv4 test net address'}, _AddressSpace__networks={}, _AddressSpace__addresses={4: {IPv4Address('203.0.113.128')}}, _AddressSpace__parent_supernet={}, _AddressSpace__children_ip_object={None: set()})

AddressSpace(_AddressSpace__strict=False, _AddressSpace__description={}, _AddressSpace__networks={}, _AddressSpace__addresses={4: {IPv4Address('203.0.113.128')}}, _AddressSpace__parent_supernet={}, _AddressSpace__children_ip_object={None: set()})


def str2datetime(string):
    """
    Convert a normalized Benthos timestamp to a datetime object

    Parameters
    ----------
    string : str
        String to convert
    """

    if string == "0000-00-00T24:60:60Z":
        return None

    ms = string[20:-1]
    ms += "000000"[:6 - len(ms)]
    return datetime.datetime(
        int(string[:4]),
        int(string[5:7]),
        int(string[8:10]),
        int(string[11:13]),
        int(string[14:16]),
        int(string[17:19]),
        int(ms))

str2datetime(string='1970-01-01T00:00:00.0Z')


def next_player_move(self, letter_location_set):
        player_to_move_id, player_rack = get_current_player_data(
            self.move_number,
            self.player_rack_list
        )

        is_legal_move = move_is_legal(self.board,
                                      self.move_number,
                                      letter_location_set,
                                      player_rack)

        if is_legal_move:
            if move_successfully_challenged():
                letter_location_set = set()

            for move_letter, board_location in letter_location_set:
                tile_index = get_rack_tile_index(player_rack, move_letter)
                tile_obj = player_rack.pop(tile_index)
                self.board[board_location] = tile_obj

            move_score = score_move(letter_location_set, self.board)
            self.player_score_list_list[player_to_move_id].append(move_score)
            self._refill_player_rack(player_rack)
            self._cancel_bonus_squares(letter_location_set)

            if len(player_rack) == 0 and len(self.tile_bag) == 0:  # Final move
                last_move_score_list = score_end_of_game(self.player_rack_list,
                                                         player_to_move_id)

                for i, last_move_score in enumerate(last_move_score_list):
                    self.player_score_list_list[i].append(last_move_score)

                conclude_game(self.player_score_list_list)

            self.move_number += 1
            return True
        else:
            return False

next_player_move(self=  abcdefghijklmno1 _______________2 _______________3 _______________4 _______________5 _______________6 _______________7 _______________8 _______★_______9 _______________10_______________11_______________12_______________13_______________14_______________15_______________[[Q, E, O, S, G, H, E, B, A, K, E, R], [R, Z, L, A, U, L, A], [W, C, E, T, N, E, E], [T, R, O, B, T, N, N]]Moves played: 0Player 1's move72 tiles remain in bagPlayer 1: 0Player 2: 0Player 3: 0Player 4: 0, letter_location_set={('K', ('j', 8)), ('B', ('h', 8)), ('A', ('i', 8)), ('E', ('k', 8)), ('R', ('l', 8))}, self.board=  abcdefghijklmno1 _______________2 _______________3 _______________4 _______________5 _______________6 _______________7 _______________8 _______★_______9 _______________10_______________11_______________12_______________13_______________14_______________15_______________, self.move_number=0, self.player_rack_list=[[Q, E, O, S, G, H, E, B, A, K, E, R], [R, Z, L, A, U, L, A], [W, C, E, T, N, E, E], [T, R, O, B, T, N, N]], self.player_score_list_list=[[], [], [], []], self.tile_bag=[*, *, A, A, A, A, A, A, A, B, C, D, D, D, D, E, E, E, E, E, E, E, F, F, G, G, H, I, I, I, I, I, I, I, I, I, J, K, L, L, M, M, N, N, N, O, O, O, O, O, O, P, P, R, R, R, R, S, S, S, T, T, T, U, U, U, V, V, W, X, Y, Y])


def replace_part_with_missing_leading_whitespace(whole_lines, part_lines, replace_lines):
    # GPT often messes up leading whitespace.
    # It usually does it uniformly across the ORIG and UPD blocks.
    # Either omitting all leading whitespace, or including only some of it.

    # Outdent everything in part_lines and replace_lines by the max fixed amount possible
    leading = [len(p) - len(p.lstrip()) for p in part_lines if p.strip()] + [
        len(p) - len(p.lstrip()) for p in replace_lines if p.strip()
    ]

    if leading and min(leading):
        num_leading = min(leading)
        part_lines = [p[num_leading:] if p.strip() else p for p in part_lines]
        replace_lines = [p[num_leading:] if p.strip() else p for p in replace_lines]

    # can we find an exact match not including the leading whitespace
    num_part_lines = len(part_lines)

    for i in range(len(whole_lines) - num_part_lines + 1):
        add_leading = match_but_for_leading_whitespace(
            whole_lines[i : i + num_part_lines], part_lines
        )

        if add_leading is None:
            continue

        replace_lines = [add_leading + rline if rline.strip() else rline for rline in replace_lines]
        whole_lines = whole_lines[:i] + replace_lines + whole_lines[i + num_part_lines :]
        return "".join(whole_lines)

    return None

replace_part_with_missing_leading_whitespace(whole_lines=['    line1\n', '    line2\n', '    line3\n'], part_lines=[' line1\n', ' line2\n'], replace_lines=[' new_line1\n', '     new_line2\n'])

['    new_line1\n', '        new_line2\n', '    line3\n']

['    new_line1\n', '        new_line2\n']


V = HarFileIO._unpack_data(fp, dataForm)

(b'SimpleSet   SimpleSet2  ', b'kk', 0, 0, 0)


def all_valid_hooks(hooks: List[Hook]) -> bool:
    hook_names = [_name(hook) for hook in _normal_hooks(hooks)]
    valid_names = GUET_HOOKS == hook_names
    valid_content = all([hook.is_guet_hook() for hook in _normal_hooks(hooks)])
    if not (valid_names and valid_content):
        hook_names = [_name(hook).replace('-guet', '') for hook in _dash_guet_normal_hooks(hooks)]
        valid_names = GUET_HOOKS == hook_names
        valid_content = all([hook.is_guet_hook() for hook in _dash_guet_normal_hooks(hooks)])
        return valid_names and valid_content
    return True

all_valid_hooks(hooks=[<Mock id='140465523545424'>, <Mock id='140465523545520'>, <Mock id='140465523546288'>])


def _replace_includesvg(content, svg_inkscape_files):
  def repl_svg(matchobj):
    svg_path = matchobj.group(2)
    svg_filename = os.path.basename(svg_path)
    # search in svg_inkscape split if pdf_tex file is available
    matching_pdf_tex_files = _keep_pattern(
        svg_inkscape_files, ['/' + svg_filename + '-tex.pdf_tex']
    )
    if len(matching_pdf_tex_files) == 1:
      options = '' if matchobj.group(1) is None else matchobj.group(1)
      return f'\\includeinkscape{options}{{{matching_pdf_tex_files[0]}}}'
    else:
      return matchobj.group(0)

  content = regex.sub(r'\\includesvg(\[.*?\])?{(.*?)}', repl_svg, content)

  return content

_replace_includesvg(content='Foo\\includesvg{test2}\nFoo', svg_inkscape_files=['ext_svg/test1-tex.pdf_tex', 'ext_svg/test2-tex.pdf_tex'])

<function _replace_includesvg.<locals>.repl_svg at 0x7f1855304550>

'Foo\\includeinkscape{ext_svg/test2-tex.pdf_tex}\nFoo'


def replace_most_similar_chunk(whole, part, replace):
    """Best efforts to find the `part` lines in `whole` and replace them with `replace`"""

    whole, whole_lines = prep(whole)
    part, part_lines = prep(part)
    replace, replace_lines = prep(replace)

    res = perfect_or_whitespace(whole_lines, part_lines, replace_lines)
    if res:
        return res

    # drop leading empty line, GPT sometimes adds them spuriously (issue #25)
    if len(part_lines) > 2 and not part_lines[0].strip():
        skip_blank_line_part_lines = part_lines[1:]
        res = perfect_or_whitespace(whole_lines, skip_blank_line_part_lines, replace_lines)
        if res:
            return res

    # Try to handle when it elides code with ...
    try:
        res = try_dotdotdots(whole, part, replace)
        if res:
            return res
    except ValueError:
        pass

    return
    # Try fuzzy matching
    res = replace_closest_edit_distance(whole_lines, part, part_lines, replace_lines)
    if res:
        return res

replace_most_similar_chunk(whole='two\n', part='two\n', replace='three\n')


def _readREFullObj(fp, array, dtype):

        nbyte = HarFileIO._getEntrySize(fp)
        dataForm = '=4sii'

        V = HarFileIO._unpack_data(fp, dataForm)

        if fb(V[0]) != '    ':
            raise Exception("Encountered characters at read7D[1]")

        nrec = V[1]
        NDim = V[2]
        dataForm = "=" + ('i' * NDim)

        V = HarFileIO._unpack_data(fp, dataForm)

        if nbyte != HarFileIO._getEntrySize(fp):
            raise RuntimeError("Header corrupted read7D[0] @ %d" % fp.tell())

        oldshape = array.shape
        array = array.flatten('F')
        idata = 0
        while nrec > 1:
            nbyte = HarFileIO._getEntrySize(fp)
            dataForm = '4s15i'
            V = HarFileIO._unpack_data(fp, dataForm)

            if fb(V[0]) != '    ':
                raise RuntimeError("Encountered characters at first four positions at)SetEl")

            if nbyte != HarFileIO._getEntrySize(fp):
                raise RuntimeError('read7D data[2] corrupted')

            nbyte = HarFileIO._getEntrySize(fp)
            ndata = (nbyte - 8) // struct.calcsize(dtype)
            dataForm = '4si' + str(ndata) + dtype
            V = HarFileIO._unpack_data(fp, dataForm)

            if nbyte != HarFileIO._getEntrySize(fp):
                raise RuntimeError('read7D data[2])corrupted')

            if fb(V[0]) != '    ':
                raise RuntimeError("Encountered characters at read7D[2]")

            nrec = V[1]
            array[idata:idata + ndata] = V[2:]
            idata += ndata
        array = array.reshape(oldshape, order='F')
        return array

_readREFullObj(fp=<_io.BufferedReader name='/local/rcs/XXX/code/pytrace-collector/logs/pypibugs/tried/GEMPACKsoftware+HARPY/GEMPACKsoftware+HARPY/test_remove_header_array.har'>, array=array([[0., 0.],       [0., 0.]], dtype=float32), dtype='f')


def generate_k(order, secexp, hash_func, data, retry_gen=0, extra_entropy=b''):
    '''
        order - order of the DSA generator used in the signature
        secexp - secure exponent (private key) in numeric form
        hash_func - reference to the same hash function used for generating hash
        data - hash in binary form of the signing data
        retry_gen - int - how many good 'k' values to skip before returning
        extra_entropy - extra added data in binary form as per section-3.6 of
            rfc6979
    '''

    qlen = bit_length(order)
    holen = hash_func().digest_size
    rolen = (qlen + 7) / 8
    bx = number_to_string(secexp, order) + bits2octets(data, order) + \
        extra_entropy

    # Step B
    v = b'\x01' * holen

    # Step C
    k = b'\x00' * holen

    # Step D

    k = hmac.new(k, v + b'\x00' + bx, hash_func).digest()

    # Step E
    v = hmac.new(k, v, hash_func).digest()

    # Step F
    k = hmac.new(k, v + b'\x01' + bx, hash_func).digest()

    # Step G
    v = hmac.new(k, v, hash_func).digest()

    # Step H
    while True:
        # Step H1
        t = b''

        # Step H2
        while len(t) < rolen:
            v = hmac.new(k, v, hash_func).digest()
            t += v

        # Step H3
        secret = bits2int(t, qlen)

        if secret >= 1 and secret < order:
            if retry_gen <= 0:
                return secret
            else:
                retry_gen -= 1

        k = hmac.new(k, v + b'\x00', hash_func).digest()
        v = hmac.new(k, v, hash_func).digest()

generate_k(order=115792089237316195423570985008687907852837564279074904382605163141518161494337, secexp=11806252235961651298089590628336806290921645495320214372650577192963691649562, hash_func=<built-in function openssl_sha256>, data=b'\xa7?\xcf3\x96@\x92\x92\x07(\x1f\xb8\xe08\x88H\x06\xe2\xeb\x08@\xf2$V\x94\xdb\xba\x1d\\\xc8\x9ee', retry_gen=0, extra_entropy=b'')


idx_pad1_fill = _get_idx(ndim, dim, slice(-pw[1], None, None))


def from_isi_citation(cls, reference: str) -> "Article":
        match = ISI_CITATION_PATTERN.match(reference)
        if not match:
            raise InvalidReference(reference)
        data = {key: [value] for key, value in match.groupdict().items() if value}
        processed = parse_all(data)
        return cls(
            title=processed.get("title"),
            authors=processed.get("authors", []),
            year=processed.get("year"),
            journal=processed.get("source_abbreviation"),
            volume=processed.get("volume"),
            page=processed.get("beginning_page"),
            doi=processed.get("DOI"),
            extra=processed,
            sources={reference},
        )

from_isi_citation(cls=<class 'wostools.article.Article'>, reference='L Antuan, 2008, P IEEE, V69, P1810, DOI DOI 10.1109/JPROC.2008.2004315')

<re.Match object; span=(0, 70), match='L Antuan, 2008, P IEEE, V69, P1810, DOI DOI 10.11>


def make_fragment(obj):
    if utils.is_group(obj):
        name = file_or_grp_name(obj)
        ct = make_list(item_for_group(name, obj))
    elif isinstance(obj, (str, Path)) and h5py.is_hdf5(obj):
        with h5py.File(obj, 'r') as f:
            return make_fragment(f)
    else:
        raise TypeError("Unknown object type: {!r}".format(obj))

    # Expand first level
    first_chkbx = ct.children.children[0].children.children[0] # Yuck
    first_chkbx.checked = True

    tv = Division(ct)
    tv.add_css_classes("h5glance-css-treeview")
    tv.id = next(treeview_ids)
    return tv

make_fragment(obj=<HDF5 file "example.h5" (mode r+)>)

{element_name='ul', _attributes={}, _css_classes=set(), _styles={}, _data=<htmlgen.element._ElementDataProxy object at 0x7f59ca2b9340>, children=<htmlgen.generator.HTMLChildGenerator object at 0x7f59ca2b96a0>}

{element_name='input', _attributes={'type': 'checkbox', 'id': 'h5glance-expand-switch-0'}, _css_classes=set(), _styles={}, _data=<htmlgen.element._ElementDataProxy object at 0x7f59ca2b9670>}

{element_name='input', _attributes={'type': 'checkbox', 'id': 'h5glance-expand-switch-0', 'checked': 'checked'}, _css_classes=set(), _styles={}, _data=<htmlgen.element._ElementDataProxy object at 0x7f59ca2b9670>}

{element_name='div', _attributes={}, _css_classes=set(), _styles={}, _data=<htmlgen.element._ElementDataProxy object at 0x7f59ca2fff40>, children=<htmlgen.generator.HTMLChildGenerator object at 0x7f59ca2ff1c0>}

{element_name='div', _attributes={}, _css_classes={'h5glance-css-treeview'}, _styles={}, _data=<htmlgen.element._ElementDataProxy object at 0x7f59ca2fff40>, children=<htmlgen.generator.HTMLChildGenerator object at 0x7f59ca2ff1c0>}

{element_name='div', _attributes={'id': 'h5glance-container-0'}, _css_classes={'h5glance-css-treeview'}, _styles={}, _data=<htmlgen.element._ElementDataProxy object at 0x7f59ca2fff40>, children=<htmlgen.generator.HTMLChildGenerator object at 0x7f59ca2ff1c0>}


def encode(self, input: Tensor) -> List[Tensor]:
        """
        Encodes the input by passing through the encoder network
        and returns the latent codes.
        :param input: (Tensor) Input tensor to encoder [N x C x H x W]
        :return: (Tensor) List of latent codes
        """
        result = self.encoder(input)

        result = torch.flatten(result, start_dim=1)
        result = self.fc(result)
        # Split the result into mu and var components
        # of the latent Gaussian distribution
        mu = self.fc_mu(result)
        log_var = self.fc_var(result)

        return [mu, log_var]

encode(self=BetaTCVAE(  (encoder): Sequential(    (0): Sequential(      (0): Conv2d(3, 32, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))      (1): LeakyReLU(negative_slope=0.01)    )    (1): Sequential(      (0): Conv2d(32, 32, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))      (1): LeakyReLU(negative_slope=0.01)    )    (2): Sequential(      (0): Conv2d(32, 32, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))      (1): LeakyReLU(negative_slope=0.01)    )    (3): Sequential(      (0): Conv2d(32, 32, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))      (1): LeakyReLU(negative_slope=0.01)    )  )  (fc): Linear(in_features=512, out_features=256, bias=True)  (fc_mu): Linear(in_features=256, out_features=64, bias=True)  (fc_var): Linear(in_features=256, out_features=64, bias=True)  (decoder_input): Linear(in_features=64, out_features=512, bias=True)  (decoder): Sequential(    (0): Sequential(      (0): ConvTranspose2d(32, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))      (1): LeakyReLU(negative_slope=0.01)    )    (1): Sequential(      (0): ConvTranspose2d(32, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))      (1): LeakyReLU(negative_slope=0.01)    )    (2): Sequential(      (0): ConvTranspose2d(32, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))      (1): LeakyReLU(negative_slope=0.01)    )  )  (final_layer): Sequential(    (0): ConvTranspose2d(32, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))    (1): LeakyReLU(negative_slope=0.01)    (2): Conv2d(32, 3, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))    (3): Tanh()  )), input=tensor([[[[ 5.3185e-01, -3.9774e-01,  3.6972e-01,  ...,  1.1367e+00,            1.1521e+00, -1.6743e+00],          [ 2.0578e+00,  1.9519e+00, -2.8100e+00,  ..., -5.8015e-01,           -1.3863e+00,  2.3038e-01],          [ 7.4288e-01,  6.0677e-01, -3.6157e-01,  ...,  2.7795e-01,           -1.0206e+00,  8.1242e-02],          ...,          [-7.0247e-01,  1.4037e+00, -1.1149e+00,  ..., -1.4894e+00,           -2.4559e-01, -1.8430e+00],          [-9.3718e-01, -1.2054e+00,  1.2919e+00,  ..., -5.7453e-01,            3.6835e-01, -7.4638e-01],          [-2.2104e-01, -5.9905e-01,  8.6197e-01,  ..., -3.7539e-01,           -1.2531e+00,  1.1781e-01]],         [[-2.0944e+00, -7.4385e-01, -9.7033e-01,  ..., -7.8675e-02,           -7.4620e-02, -1.6986e+00],          [ 4.0385e-01, -1.2824e+00,  6.0149e-02,  ..., -3.6837e-01,           -1.0242e-01, -8.2039e-02],          [-9.8629e-01, -7.1538e-01,  1.9335e+00,  ...,  9.1957e-01,            5.5281e-01,  1.2864e+00],          ...,          [ 7.5726e-02,  2.4742e-01, -2.4193e-01,  ...,  8.5353e-01,           -2.7577e-01, -2.6538e+00],          [-9.8466e-03, -9.5950e-01,  7.3757e-02,  ...,  8.5767e-02,            1.4790e+00,  5.5942e-01],          [ 1.2253e+00, -7.8919e-01, -2.9739e-01,  ..., -3.1689e-01,           -5.6716e-01,  7.9165e-01]],         [[-4.0525e-01, -8.3349e-01,  5.2918e-01,  ...,  7.9677e-01,           -1.0793e+00, -3.8235e-01],          [ 1.7477e+00,  2.9892e-01, -1.1484e+00,  ...,  9.3641e-01,            9.4447e-01, -1.2406e+00],          [ 1.4655e-01, -2.0048e+00, -1.4054e+00,  ..., -5.4709e-01,            2.0894e-01,  1.0476e-01],          ...,          [ 1.0665e-01,  1.9868e-01,  2.2229e-01,  ..., -2.8227e-01,            1.0278e+00,  1.2411e-01],          [-9.5577e-01,  1.8679e-01,  1.3016e+00,  ..., -9.7086e-01,           -1.0557e+00,  6.7745e-02],          [ 1.4790e+00, -2.0436e+00, -1.1996e+00,  ..., -6.4002e-01,            2.2152e+00, -9.9841e-01]]],        [[[ 1.5455e-01,  2.8293e+00,  1.5297e+00,  ..., -8.6605e-01,            1.0608e+00,  1.1515e-01],          [ 1.4160e+00, -1.0184e+00,  9.7726e-01,  ...,  1.1619e+00,            6.8690e-01,  1.3305e+00],          [ 1.0506e+00, -7.1100e-01,  1.3180e-01,  ..., -4.9396e-02,            5.1341e-02,  8.4380e-01],          ...,          [ 2.1367e-02,  8.5591e-01,  7.2118e-03,  ...,  9.6486e-01,            3.9966e-01,  2.8569e-01],          [ 1.5647e+00, -1.1883e-01, -6.4004e-02,  ..., -1.3983e+00,           -4.6075e-01,  8.1895e-02],          [ 1.7330e+00,  4.0375e-01, -1.6357e-01,  ...,  3.0821e-03,            5.5183e-01,  8.5084e-01]],         [[-1.5776e+00,  5.9163e-01,  1.3641e+00,  ...,  5.6345e-01,            8.4972e-01, -6.4639e-01],          [ 1.3402e+00, -1.6378e-01, -1.1405e+00,  ...,  1.0874e-01,           -1.8486e+00, -5.0235e-01],          [ 5.7208e-01,  1.6543e+00,  1.3152e-01,  ...,  1.2373e+00,            8.2186e-01,  4.3303e-01],          ...,          [-1.1077e+00,  1.7493e-01,  6.4322e-01,  ..., -7.8351e-01,           -5.3578e-01,  1.4140e+00],          [-9.0306e-01,  1.8420e+00, -1.0662e+00,  ..., -5.9949e-02,            1.3193e+00,  3.2077e-02],          [ 5.4261e-01, -4.4406e-02,  4.6330e-02,  ..., -9.6119e-01,            6.7180e-01, -4.8122e-02]],         [[ 8.6250e-01, -6.7066e-02, -3.5274e-01,  ...,  1.9979e-01,           -1.6411e+00, -5.3606e-01],          [ 1.1685e+00, -2.0047e-01,  3.0468e-01,  ..., -1.0746e+00,           -9.1865e-01, -1.1219e+00],          [ 7.6191e-01, -3.8277e-01,  6.3079e-01,  ..., -2.4246e+00,           -2.6817e-01,  7.6165e-01],          ...,          [-7.7297e-01, -4.5526e-01, -6.6731e-03,  ..., -1.3138e+00,           -7.1513e-01, -4.9017e-01],          [ 1.0308e+00,  1.2848e+00,  5.1048e-01,  ..., -1.6668e+00,           -2.1581e-01,  1.3934e+00],          [-1.3691e+00,  9.5055e-01,  9.4900e-01,  ..., -2.6176e-02,            5.8659e-01, -2.2248e+00]]],        [[[ 6.9125e-01, -1.0737e+00, -6.2224e-01,  ..., -6.9978e-01,           -1.5117e-01,  1.2280e+00],          [ 8.1159e-01, -4.8034e-01,  4.1112e-01,  ...,  6.2597e-01,            9.8856e-01,  3.8114e-01],          [ ...7472e+00],          [-5.3230e-01, -1.8319e+00, -1.4415e+00,  ...,  1.5285e+00,            5.9762e-01,  6.3045e-01],          [-8.2676e-01,  1.1276e-01,  6.3077e-01,  ...,  8.4853e-01,           -6.3750e-01,  4.9089e-01]]],        [[[ 4.3172e-01, -1.0873e+00, -9.0388e-01,  ..., -3.2324e-01,           -4.4410e-01, -7.3016e-01],          [ 1.3609e+00, -2.0047e-01, -1.1894e+00,  ...,  3.1399e-01,            1.9187e-01, -1.2643e-01],          [-8.1190e-01,  3.9284e-01, -1.2749e+00,  ..., -7.3253e-01,           -2.4893e+00,  2.9426e-01],          ...,          [-3.4773e-01,  7.2801e-01,  4.3619e-01,  ..., -6.3637e-01,            1.1142e+00, -4.1677e-01],          [ 2.0785e+00, -2.3168e+00,  7.7228e-02,  ...,  2.9332e-01,            2.2538e+00,  1.2741e+00],          [ 2.5713e-01,  2.7087e-01, -8.5220e-01,  ..., -8.5929e-01,            2.1949e-01,  1.3974e-01]],         [[ 1.3550e+00, -1.0758e+00,  1.1293e+00,  ..., -1.0205e+00,           -1.4944e-01, -1.2729e-01],          [-1.4885e+00, -3.5000e-01, -1.6846e+00,  ..., -1.0720e+00,           -2.9126e+00, -1.1050e-01],          [-2.5364e+00,  1.5951e+00, -3.5153e-01,  ...,  1.3554e+00,            9.6909e-01, -5.9874e-01],          ...,          [ 1.6880e+00, -3.5601e-01, -1.3960e+00,  ...,  1.3715e-01,           -5.1912e-01, -5.8030e-01],          [ 4.0335e-01,  6.5779e-01, -5.9033e-01,  ...,  6.4427e-01,           -6.5489e-01,  1.4476e+00],          [-6.4476e-01, -9.0709e-01, -5.4367e-01,  ..., -2.2654e-01,            2.4975e+00,  1.5439e+00]],         [[-5.2828e-01, -1.0348e-01,  3.0785e-01,  ..., -2.1140e+00,           -1.5042e+00,  8.4573e-02],          [-1.1699e+00, -8.7621e-01,  1.2186e+00,  ...,  1.0481e+00,            6.7535e-01, -2.4795e+00],          [-2.1606e-01,  1.4074e+00,  4.5803e-01,  ..., -4.9758e-01,           -5.3421e-02, -1.6878e+00],          ...,          [-8.0470e-01, -6.5579e-02, -1.4215e+00,  ..., -9.2709e-01,           -1.3101e+00, -6.3970e-01],          [ 8.2744e-01,  6.1637e-01,  7.9837e-03,  ..., -1.1195e+00,           -1.0946e+00,  9.7312e-01],          [-1.7113e+00, -1.2098e+00,  1.0424e-01,  ..., -2.6068e-01,           -7.1830e-01,  1.0582e+00]]],        [[[ 1.2083e+00,  2.2576e-01,  2.2029e+00,  ...,  1.6064e-01,           -6.7711e-01, -8.1935e-01],          [-1.5649e+00,  1.8701e-01,  6.6335e-01,  ..., -3.2193e-01,            1.7482e+00,  1.2873e+00],          [ 2.4682e-01, -3.3585e-02, -7.3295e-01,  ..., -9.7423e-01,           -5.0875e-01,  1.5034e+00],          ...,          [-1.6163e-04, -3.4227e-02, -2.4157e-01,  ..., -1.0951e+00,            5.8072e-01,  2.5867e-01],          [ 5.9858e-01, -1.4594e+00, -4.2557e-01,  ..., -1.4083e+00,            1.0062e+00, -2.6702e+00],          [ 2.2283e-02,  1.9899e-01, -3.1685e-01,  ..., -9.9946e-01,           -3.1641e-01, -2.1764e+00]],         [[ 2.8564e-01,  4.7435e-01,  1.3970e+00,  ...,  1.4685e-01,            5.1340e-01,  4.2743e-01],          [-1.1349e+00,  1.7398e-01,  8.5008e-02,  ..., -3.1036e-01,            1.3757e+00, -1.1701e+00],          [-5.9442e-01,  3.3539e-01,  1.0349e+00,  ..., -2.2516e+00,            5.1274e-01, -2.2695e-02],          ...,          [ 2.6707e-01, -3.9661e-02,  7.8258e-01,  ...,  1.6181e-02,           -1.0170e+00, -5.4829e-01],          [-6.0622e-01,  1.5736e+00, -7.9128e-01,  ..., -1.1797e-01,           -1.4455e+00,  8.4701e-01],          [-1.5520e+00, -1.6892e+00, -7.7782e-01,  ..., -4.0195e-01,           -4.3646e-01,  2.6970e-01]],         [[ 6.9032e-01,  7.9203e-01,  4.5647e-02,  ...,  6.9158e-01,            8.2187e-01,  2.1916e+00],          [ 8.0458e-01,  1.4788e+00, -1.6513e-01,  ...,  1.0400e+00,            9.9060e-01, -3.3930e-02],          [ 1.4022e-01, -8.6108e-01, -3.1557e-01,  ...,  5.9925e-01,            1.8452e+00,  1.8993e+00],          ...,          [ 9.7114e-01,  2.4893e-01,  8.9429e-01,  ...,  1.3282e+00,           -6.3248e-02,  4.3927e-02],          [-9.2447e-01,  3.5266e-01,  5.7714e-01,  ...,  1.0636e+00,            2.2731e-01, -8.6034e-01],          [-1.1792e+00,  2.3629e-01, -1.5843e+00,  ..., -3.3812e-01,           -1.5923e+00, -5.8710e-01]]]]), self._backward_hooks=OrderedDict(), self._backward_pre_hooks=OrderedDict(), self._buffers=OrderedDict(), self._forward_hooks=OrderedDict(), self._forward_hooks_always_called=OrderedDict(), self._forward_hooks_with_kwargs=OrderedDict(), self._forward_pre_hooks=OrderedDict(), self._forward_pre_hooks_with_kwargs=OrderedDict(), self._is_full_backward_hook=None, self._load_state_dict_post_hooks=OrderedDict(), self._load_state_dict_pre_hooks=OrderedDict(), self._modules=OrderedDict([('encoder', Sequential(  (0): Sequential(    (0): Conv2d(3, 32, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))    (1): LeakyReLU(negative_slope=0.01)  )  (1): Sequential(    (0): Conv2d(32, 32, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))    (1): LeakyReLU(negative_slope=0.01)  )  (2): Sequential(    (0): Conv2d(32, 32, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))    (1): LeakyReLU(negative_slope=0.01)  )  (3): Sequential(    (0): Conv2d(32, 32, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))    (1): LeakyReLU(negative_slope=0.01)  ))), ('fc', Linear(in_features=512, out_features=256, bias=True)), ('fc_mu', Linear(in_features=256, out_features=64, bias=True)), ('fc_var', Linear(in_features=256, out_features=64, bias=True)), ('decoder_input', Linear(in_features=64, out_features=512, bias=True)), ('decoder', Sequential(  (0): Sequential(    (0): ConvTranspose2d(32, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))    (1): LeakyReLU(negative_slope=0.01)  )  (1): Sequential(    (0): ConvTranspose2d(32, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))    (1): LeakyReLU(negative_slope=0.01)  )  (2): Sequential(    (0): ConvTranspose2d(32, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))    (1): LeakyReLU(negative_slope=0.01)  ))), ('final_layer', Sequential(  (0): ConvTranspose2d(32, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))  (1): LeakyReLU(negative_slope=0.01)  (2): Conv2d(32, 3, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))  (3): Tanh()))]), self._non_persistent_buffers_set=set(), self._parameters=OrderedDict(), self._state_dict_hooks=OrderedDict(), self._state_dict_pre_hooks=OrderedDict(), self.alpha=1.0, self.anneal_steps=100, self.beta=6.0, self.gamma=1.0, self.latent_dim=64, self.training=True)

Input: tensor([[[[ 5.3185e-01, -3.9774e-01,  3.6972e-01,  ...,  1.1367e+00,            1.1521e+00, -1.6743e+00],          [ 2.0578e+00,  1.9519e+00, -2.8100e+00,  ..., -5.8015e-01,           -1.3863e+00,  2.3038e-01],          [ 7.4288e-01,  6.0677e-01, -3.6157e-01,  ...,  2.7795e-01,           -1.0206e+00,  8.1242e-02],          ...,          [-7.0247e-01,  1.4037e+00, -1.1149e+00,  ..., -1.4894e+00,           -2.4559e-01, -1.8430e+00],          [-9.3718e-01, -1.2054e+00,  1.2919e+00,  ..., -5.7453e-01,            3.6835e-01, -7.4638e-01],          [-2.2104e-01, -5.9905e-01,  8.6197e-01,  ..., -3.7539e-01,           -1.2531e+00,  1.1781e-01]],         [[-2.0944e+00, -7.4385e-01, -9.7033e-01,  ..., -7.8675e-02,           -7.4620e-02, -1.6986e+00],          [ 4.0385e-01, -1.2824e+00,  6.0149e-02,  ..., -3.6837e-01,           -1.0242e-01, -8.2039e-02],          [-9.8629e-01, -7.1538e-01,  1.9335e+00,  ...,  9.1957e-01,            5.5281e-01,  1.2864e+00],          ...,          [ 7.5726e-02,  2.4742e-01, -2.4193e-01,  ...,  8.5353e-01,           -2.7577e-01, -2.6538e+00],          [-9.8466e-03, -9.5950e-01,  7.3757e-02,  ...,  8.5767e-02,            1.4790e+00,  5.5942e-01],          [ 1.2253e+00, -7.8919e-01, -2.9739e-01,  ..., -3.1689e-01,           -5.6716e-01,  7.9165e-01]],         [[-4.0525e-01, -8.3349e-01,  5.2918e-01,  ...,  7.9677e-01,           -1.0793e+00, -3.8235e-01],          [ 1.7477e+00,  2.9892e-01, -1.1484e+00,  ...,  9.3641e-01,            9.4447e-01, -1.2406e+00],          [ 1.4655e-01, -2.0048e+00, -1.4054e+00,  ..., -5.4709e-01,            2.0894e-01,  1.0476e-01],          ...,          [ 1.0665e-01,  1.9868e-01,  2.2229e-01,  ..., -2.8227e-01,            1.0278e+00,  1.2411e-01],          [-9.5577e-01,  1.8679e-01,  1.3016e+00,  ..., -9.7086e-01,           -1.0557e+00,  6.7745e-02],          [ 1.4790e+00, -2.0436e+00, -1.1996e+00,  ..., -6.4002e-01,            2.2152e+00, -9.9841e-01]]],        [[[ 1.5455e-01,  2.8293e+00,  1.5297e+00,  ..., -8.6605e-01,            1.0608e+00,  1.1515e-01],          [ 1.4160e+00, -1.0184e+00,  9.7726e-01,  ...,  1.1619e+00,            6.8690e-01,  1.3305e+00],          [ 1.0506e+00, -7.1100e-01,  1.3180e-01,  ..., -4.9396e-02,            5.1341e-02,  8.4380e-01],          ...,          [ 2.1367e-02,  8.5591e-01,  7.2118e-03,  ...,  9.6486e-01,            3.9966e-01,  2.8569e-01],          [ 1.5647e+00, -1.1883e-01, -6.4004e-02,  ..., -1.3983e+00,           -4.6075e-01,  8.1895e-02],          [ 1.7330e+00,  4.0375e-01, -1.6357e-01,  ...,  3.0821e-03,            5.5183e-01,  8.5084e-01]],         [[-1.5776e+00,  5.9163e-01,  1.3641e+00,  ...,  5.6345e-01,            8.4972e-01, -6.4639e-01],          [ 1.3402e+00, -1.6378e-01, -1.1405e+00,  ...,  1.0874e-01,           -1.8486e+00, -5.0235e-01],          [ 5.7208e-01,  1.6543e+00,  1.3152e-01,  ...,  1.2373e+00,            8.2186e-01,  4.3303e-01],          ...,          [-1.1077e+00,  1.7493e-01,  6.4322e-01,  ..., -7.8351e-01,           -5.3578e-01,  1.4140e+00],          [-9.0306e-01,  1.8420e+00, -1.0662e+00,  ..., -5.9949e-02,            1.3193e+00,  3.2077e-02],          [ 5.4261e-01, -4.4406e-02,  4.6330e-02,  ..., -9.6119e-01,            6.7180e-01, -4.8122e-02]],         [[ 8.6250e-01, -6.7066e-02, -3.5274e-01,  ...,  1.9979e-01,           -1.6411e+00, -5.3606e-01],          [ 1.1685e+00, -2.0047e-01,  3.0468e-01,  ..., -1.0746e+00,           -9.1865e-01, -1.1219e+00],          [ 7.6191e-01, -3.8277e-01,  6.3079e-01,  ..., -2.4246e+00,           -2.6817e-01,  7.6165e-01],          ...,          [-7.7297e-01, -4.5526e-01, -6.6731e-03,  ..., -1.3138e+00,           -7.1513e-01, -4.9017e-01],          [ 1.0308e+00,  1.2848e+00,  5.1048e-01,  ..., -1.6668e+00,           -2.1581e-01,  1.3934e+00],          [-1.3691e+00,  9.5055e-01,  9.4900e-01,  ..., -2.6176e-02,            5.8659e-01, -2.2248e+00]]],        [[[ 6.9125e-01, -1.0737e+00, -6.2224e-01,  ..., -6.9978e-01,           -1.5117e-01,  1.2280e+00],          [ 8.1159e-01, -4.8034e-01,  4.1112e-01,  ...,  6.2597e-01,            9.8856e-01,  3.8114e-01],          [ ...7472e+00],          [-5.3230e-01, -1.8319e+00, -1.4415e+00,  ...,  1.5285e+00,            5.9762e-01,  6.3045e-01],          [-8.2676e-01,  1.1276e-01,  6.3077e-01,  ...,  8.4853e-01,           -6.3750e-01,  4.9089e-01]]],        [[[ 4.3172e-01, -1.0873e+00, -9.0388e-01,  ..., -3.2324e-01,           -4.4410e-01, -7.3016e-01],          [ 1.3609e+00, -2.0047e-01, -1.1894e+00,  ...,  3.1399e-01,            1.9187e-01, -1.2643e-01],          [-8.1190e-01,  3.9284e-01, -1.2749e+00,  ..., -7.3253e-01,           -2.4893e+00,  2.9426e-01],          ...,          [-3.4773e-01,  7.2801e-01,  4.3619e-01,  ..., -6.3637e-01,            1.1142e+00, -4.1677e-01],          [ 2.0785e+00, -2.3168e+00,  7.7228e-02,  ...,  2.9332e-01,            2.2538e+00,  1.2741e+00],          [ 2.5713e-01,  2.7087e-01, -8.5220e-01,  ..., -8.5929e-01,            2.1949e-01,  1.3974e-01]],         [[ 1.3550e+00, -1.0758e+00,  1.1293e+00,  ..., -1.0205e+00,           -1.4944e-01, -1.2729e-01],          [-1.4885e+00, -3.5000e-01, -1.6846e+00,  ..., -1.0720e+00,           -2.9126e+00, -1.1050e-01],          [-2.5364e+00,  1.5951e+00, -3.5153e-01,  ...,  1.3554e+00,            9.6909e-01, -5.9874e-01],          ...,          [ 1.6880e+00, -3.5601e-01, -1.3960e+00,  ...,  1.3715e-01,           -5.1912e-01, -5.8030e-01],          [ 4.0335e-01,  6.5779e-01, -5.9033e-01,  ...,  6.4427e-01,           -6.5489e-01,  1.4476e+00],          [-6.4476e-01, -9.0709e-01, -5.4367e-01,  ..., -2.2654e-01,            2.4975e+00,  1.5439e+00]],         [[-5.2828e-01, -1.0348e-01,  3.0785e-01,  ..., -2.1140e+00,           -1.5042e+00,  8.4573e-02],          [-1.1699e+00, -8.7621e-01,  1.2186e+00,  ...,  1.0481e+00,            6.7535e-01, -2.4795e+00],          [-2.1606e-01,  1.4074e+00,  4.5803e-01,  ..., -4.9758e-01,           -5.3421e-02, -1.6878e+00],          ...,          [-8.0470e-01, -6.5579e-02, -1.4215e+00,  ..., -9.2709e-01,           -1.3101e+00, -6.3970e-01],          [ 8.2744e-01,  6.1637e-01,  7.9837e-03,  ..., -1.1195e+00,           -1.0946e+00,  9.7312e-01],          [-1.7113e+00, -1.2098e+00,  1.0424e-01,  ..., -2.6068e-01,           -7.1830e-01,  1.0582e+00]]],        [[[ 1.2083e+00,  2.2576e-01,  2.2029e+00,  ...,  1.6064e-01,           -6.7711e-01, -8.1935e-01],          [-1.5649e+00,  1.8701e-01,  6.6335e-01,  ..., -3.2193e-01,            1.7482e+00,  1.2873e+00],          [ 2.4682e-01, -3.3585e-02, -7.3295e-01,  ..., -9.7423e-01,           -5.0875e-01,  1.5034e+00],          ...,          [-1.6163e-04, -3.4227e-02, -2.4157e-01,  ..., -1.0951e+00,            5.8072e-01,  2.5867e-01],          [ 5.9858e-01, -1.4594e+00, -4.2557e-01,  ..., -1.4083e+00,            1.0062e+00, -2.6702e+00],          [ 2.2283e-02,  1.9899e-01, -3.1685e-01,  ..., -9.9946e-01,           -3.1641e-01, -2.1764e+00]],         [[ 2.8564e-01,  4.7435e-01,  1.3970e+00,  ...,  1.4685e-01,            5.1340e-01,  4.2743e-01],          [-1.1349e+00,  1.7398e-01,  8.5008e-02,  ..., -3.1036e-01,            1.3757e+00, -1.1701e+00],          [-5.9442e-01,  3.3539e-01,  1.0349e+00,  ..., -2.2516e+00,            5.1274e-01, -2.2695e-02],          ...,          [ 2.6707e-01, -3.9661e-02,  7.8258e-01,  ...,  1.6181e-02,           -1.0170e+00, -5.4829e-01],          [-6.0622e-01,  1.5736e+00, -7.9128e-01,  ..., -1.1797e-01,           -1.4455e+00,  8.4701e-01],          [-1.5520e+00, -1.6892e+00, -7.7782e-01,  ..., -4.0195e-01,           -4.3646e-01,  2.6970e-01]],         [[ 6.9032e-01,  7.9203e-01,  4.5647e-02,  ...,  6.9158e-01,            8.2187e-01,  2.1916e+00],          [ 8.0458e-01,  1.4788e+00, -1.6513e-01,  ...,  1.0400e+00,            9.9060e-01, -3.3930e-02],          [ 1.4022e-01, -8.6108e-01, -3.1557e-01,  ...,  5.9925e-01,            1.8452e+00,  1.8993e+00],          ...,          [ 9.7114e-01,  2.4893e-01,  8.9429e-01,  ...,  1.3282e+00,           -6.3248e-02,  4.3927e-02],          [-9.2447e-01,  3.5266e-01,  5.7714e-01,  ...,  1.0636e+00,            2.2731e-01, -8.6034e-01],          [-1.1792e+00,  2.3629e-01, -1.5843e+00,  ..., -3.3812e-01,           -1.5923e+00, -5.8710e-01]]]])

Input: tensor([[[[ 5.3185e-01, -3.9774e-01,  3.6972e-01,  ...,  1.1367e+00,            1.1521e+00, -1.6743e+00],          [ 2.0578e+00,  1.9519e+00, -2.8100e+00,  ..., -5.8015e-01,           -1.3863e+00,  2.3038e-01],          [ 7.4288e-01,  6.0677e-01, -3.6157e-01,  ...,  2.7795e-01,           -1.0206e+00,  8.1242e-02],          ...,          [-7.0247e-01,  1.4037e+00, -1.1149e+00,  ..., -1.4894e+00,           -2.4559e-01, -1.8430e+00],          [-9.3718e-01, -1.2054e+00,  1.2919e+00,  ..., -5.7453e-01,            3.6835e-01, -7.4638e-01],          [-2.2104e-01, -5.9905e-01,  8.6197e-01,  ..., -3.7539e-01,           -1.2531e+00,  1.1781e-01]],         [[-2.0944e+00, -7.4385e-01, -9.7033e-01,  ..., -7.8675e-02,           -7.4620e-02, -1.6986e+00],          [ 4.0385e-01, -1.2824e+00,  6.0149e-02,  ..., -3.6837e-01,           -1.0242e-01, -8.2039e-02],          [-9.8629e-01, -7.1538e-01,  1.9335e+00,  ...,  9.1957e-01,            5.5281e-01,  1.2864e+00],          ...,          [ 7.5726e-02,  2.4742e-01, -2.4193e-01,  ...,  8.5353e-01,           -2.7577e-01, -2.6538e+00],          [-9.8466e-03, -9.5950e-01,  7.3757e-02,  ...,  8.5767e-02,            1.4790e+00,  5.5942e-01],          [ 1.2253e+00, -7.8919e-01, -2.9739e-01,  ..., -3.1689e-01,           -5.6716e-01,  7.9165e-01]],         [[-4.0525e-01, -8.3349e-01,  5.2918e-01,  ...,  7.9677e-01,           -1.0793e+00, -3.8235e-01],          [ 1.7477e+00,  2.9892e-01, -1.1484e+00,  ...,  9.3641e-01,            9.4447e-01, -1.2406e+00],          [ 1.4655e-01, -2.0048e+00, -1.4054e+00,  ..., -5.4709e-01,            2.0894e-01,  1.0476e-01],          ...,          [ 1.0665e-01,  1.9868e-01,  2.2229e-01,  ..., -2.8227e-01,            1.0278e+00,  1.2411e-01],          [-9.5577e-01,  1.8679e-01,  1.3016e+00,  ..., -9.7086e-01,           -1.0557e+00,  6.7745e-02],          [ 1.4790e+00, -2.0436e+00, -1.1996e+00,  ..., -6.4002e-01,            2.2152e+00, -9.9841e-01]]],        [[[ 1.5455e-01,  2.8293e+00,  1.5297e+00,  ..., -8.6605e-01,            1.0608e+00,  1.1515e-01],          [ 1.4160e+00, -1.0184e+00,  9.7726e-01,  ...,  1.1619e+00,            6.8690e-01,  1.3305e+00],          [ 1.0506e+00, -7.1100e-01,  1.3180e-01,  ..., -4.9396e-02,            5.1341e-02,  8.4380e-01],          ...,          [ 2.1367e-02,  8.5591e-01,  7.2118e-03,  ...,  9.6486e-01,            3.9966e-01,  2.8569e-01],          [ 1.5647e+00, -1.1883e-01, -6.4004e-02,  ..., -1.3983e+00,           -4.6075e-01,  8.1895e-02],          [ 1.7330e+00,  4.0375e-01, -1.6357e-01,  ...,  3.0821e-03,            5.5183e-01,  8.5084e-01]],         [[-1.5776e+00,  5.9163e-01,  1.3641e+00,  ...,  5.6345e-01,            8.4972e-01, -6.4639e-01],          [ 1.3402e+00, -1.6378e-01, -1.1405e+00,  ...,  1.0874e-01,           -1.8486e+00, -5.0235e-01],          [ 5.7208e-01,  1.6543e+00,  1.3152e-01,  ...,  1.2373e+00,            8.2186e-01,  4.3303e-01],          ...,          [-1.1077e+00,  1.7493e-01,  6.4322e-01,  ..., -7.8351e-01,           -5.3578e-01,  1.4140e+00],          [-9.0306e-01,  1.8420e+00, -1.0662e+00,  ..., -5.9949e-02,            1.3193e+00,  3.2077e-02],          [ 5.4261e-01, -4.4406e-02,  4.6330e-02,  ..., -9.6119e-01,            6.7180e-01, -4.8122e-02]],         [[ 8.6250e-01, -6.7066e-02, -3.5274e-01,  ...,  1.9979e-01,           -1.6411e+00, -5.3606e-01],          [ 1.1685e+00, -2.0047e-01,  3.0468e-01,  ..., -1.0746e+00,           -9.1865e-01, -1.1219e+00],          [ 7.6191e-01, -3.8277e-01,  6.3079e-01,  ..., -2.4246e+00,           -2.6817e-01,  7.6165e-01],          ...,          [-7.7297e-01, -4.5526e-01, -6.6731e-03,  ..., -1.3138e+00,           -7.1513e-01, -4.9017e-01],          [ 1.0308e+00,  1.2848e+00,  5.1048e-01,  ..., -1.6668e+00,           -2.1581e-01,  1.3934e+00],          [-1.3691e+00,  9.5055e-01,  9.4900e-01,  ..., -2.6176e-02,            5.8659e-01, -2.2248e+00]]],        [[[ 6.9125e-01, -1.0737e+00, -6.2224e-01,  ..., -6.9978e-01,           -1.5117e-01,  1.2280e+00],          [ 8.1159e-01, -4.8034e-01,  4.1112e-01,  ...,  6.2597e-01,            9.8856e-01,  3.8114e-01],          [ ...7472e+00],          [-5.3230e-01, -1.8319e+00, -1.4415e+00,  ...,  1.5285e+00,            5.9762e-01,  6.3045e-01],          [-8.2676e-01,  1.1276e-01,  6.3077e-01,  ...,  8.4853e-01,           -6.3750e-01,  4.9089e-01]]],        [[[ 4.3172e-01, -1.0873e+00, -9.0388e-01,  ..., -3.2324e-01,           -4.4410e-01, -7.3016e-01],          [ 1.3609e+00, -2.0047e-01, -1.1894e+00,  ...,  3.1399e-01,            1.9187e-01, -1.2643e-01],          [-8.1190e-01,  3.9284e-01, -1.2749e+00,  ..., -7.3253e-01,           -2.4893e+00,  2.9426e-01],          ...,          [-3.4773e-01,  7.2801e-01,  4.3619e-01,  ..., -6.3637e-01,            1.1142e+00, -4.1677e-01],          [ 2.0785e+00, -2.3168e+00,  7.7228e-02,  ...,  2.9332e-01,            2.2538e+00,  1.2741e+00],          [ 2.5713e-01,  2.7087e-01, -8.5220e-01,  ..., -8.5929e-01,            2.1949e-01,  1.3974e-01]],         [[ 1.3550e+00, -1.0758e+00,  1.1293e+00,  ..., -1.0205e+00,           -1.4944e-01, -1.2729e-01],          [-1.4885e+00, -3.5000e-01, -1.6846e+00,  ..., -1.0720e+00,           -2.9126e+00, -1.1050e-01],          [-2.5364e+00,  1.5951e+00, -3.5153e-01,  ...,  1.3554e+00,            9.6909e-01, -5.9874e-01],          ...,          [ 1.6880e+00, -3.5601e-01, -1.3960e+00,  ...,  1.3715e-01,           -5.1912e-01, -5.8030e-01],          [ 4.0335e-01,  6.5779e-01, -5.9033e-01,  ...,  6.4427e-01,           -6.5489e-01,  1.4476e+00],          [-6.4476e-01, -9.0709e-01, -5.4367e-01,  ..., -2.2654e-01,            2.4975e+00,  1.5439e+00]],         [[-5.2828e-01, -1.0348e-01,  3.0785e-01,  ..., -2.1140e+00,           -1.5042e+00,  8.4573e-02],          [-1.1699e+00, -8.7621e-01,  1.2186e+00,  ...,  1.0481e+00,            6.7535e-01, -2.4795e+00],          [-2.1606e-01,  1.4074e+00,  4.5803e-01,  ..., -4.9758e-01,           -5.3421e-02, -1.6878e+00],          ...,          [-8.0470e-01, -6.5579e-02, -1.4215e+00,  ..., -9.2709e-01,           -1.3101e+00, -6.3970e-01],          [ 8.2744e-01,  6.1637e-01,  7.9837e-03,  ..., -1.1195e+00,           -1.0946e+00,  9.7312e-01],          [-1.7113e+00, -1.2098e+00,  1.0424e-01,  ..., -2.6068e-01,           -7.1830e-01,  1.0582e+00]]],        [[[ 1.2083e+00,  2.2576e-01,  2.2029e+00,  ...,  1.6064e-01,           -6.7711e-01, -8.1935e-01],          [-1.5649e+00,  1.8701e-01,  6.6335e-01,  ..., -3.2193e-01,            1.7482e+00,  1.2873e+00],          [ 2.4682e-01, -3.3585e-02, -7.3295e-01,  ..., -9.7423e-01,           -5.0875e-01,  1.5034e+00],          ...,          [-1.6163e-04, -3.4227e-02, -2.4157e-01,  ..., -1.0951e+00,            5.8072e-01,  2.5867e-01],          [ 5.9858e-01, -1.4594e+00, -4.2557e-01,  ..., -1.4083e+00,            1.0062e+00, -2.6702e+00],          [ 2.2283e-02,  1.9899e-01, -3.1685e-01,  ..., -9.9946e-01,           -3.1641e-01, -2.1764e+00]],         [[ 2.8564e-01,  4.7435e-01,  1.3970e+00,  ...,  1.4685e-01,            5.1340e-01,  4.2743e-01],          [-1.1349e+00,  1.7398e-01,  8.5008e-02,  ..., -3.1036e-01,            1.3757e+00, -1.1701e+00],          [-5.9442e-01,  3.3539e-01,  1.0349e+00,  ..., -2.2516e+00,            5.1274e-01, -2.2695e-02],          ...,          [ 2.6707e-01, -3.9661e-02,  7.8258e-01,  ...,  1.6181e-02,           -1.0170e+00, -5.4829e-01],          [-6.0622e-01,  1.5736e+00, -7.9128e-01,  ..., -1.1797e-01,           -1.4455e+00,  8.4701e-01],          [-1.5520e+00, -1.6892e+00, -7.7782e-01,  ..., -4.0195e-01,           -4.3646e-01,  2.6970e-01]],         [[ 6.9032e-01,  7.9203e-01,  4.5647e-02,  ...,  6.9158e-01,            8.2187e-01,  2.1916e+00],          [ 8.0458e-01,  1.4788e+00, -1.6513e-01,  ...,  1.0400e+00,            9.9060e-01, -3.3930e-02],          [ 1.4022e-01, -8.6108e-01, -3.1557e-01,  ...,  5.9925e-01,            1.8452e+00,  1.8993e+00],          ...,          [ 9.7114e-01,  2.4893e-01,  8.9429e-01,  ...,  1.3282e+00,           -6.3248e-02,  4.3927e-02],          [-9.2447e-01,  3.5266e-01,  5.7714e-01,  ...,  1.0636e+00,            2.2731e-01, -8.6034e-01],          [-1.1792e+00,  2.3629e-01, -1.5843e+00,  ..., -3.3812e-01,           -1.5923e+00, -5.8710e-01]]]])


def patch_terminal_size(monkeypatch):
    term_width = '250'
    term_height = '60'
    monkeypatch.setitem(os.environ, 'COLUMNS', term_width)
    monkeypatch.setitem(os.environ, 'LINES', term_height)

patch_terminal_size(monkeypatch={_setattr=[], _setitem=[], _cwd=None, _savesyspath=None})

{_setattr=[], _setitem=[(environ({'SHELL': '/bin/bash', 'LSCOLORS': 'Gxfxcxdxbxegedabagacad', 'USER_ZDOTDIR': '/home/XXX', 'COLORTERM': 'truecolor', 'LESS': '-R', 'TERM_PROGRAM_VERSION': '3.2a', 'GVM_VERSION': '1.0.22', 'CONDA_EXE': '/local/rcs/XXX/miniforge3/bin/conda', '_CE_M': '', 'TMUX': '/tmp/tmux-19200/default,59951,3', 'PKG_CONFIG_PATH': '/home/XXX/.gvm/pkgsets/go1.19.1/global/overlay/lib/pkgconfig:/home/XXX/.gvm/pkgsets/go1.19.1/global/overlay/lib/pkgconfig:', '_P9K_TTY': '/dev/pts/20', 'GVM_PATH_BACKUP': '/home/XXX/.gvm/bin:/local/rcs/XXX/miniforge3/envs/mal/bin:/local/rcs/XXX/miniforge3/condabin:/home/XXX/.gdrive-downloader:/local/arise/XXX/miniforge3/bin:/home/XXX/.gvm/pkgsets/go1.19.1/global/bin:/home/XXX/.gvm/gos/go1.19.1/bin:/home/XXX/.gvm/pkgsets/go1.19.1/global/overlay/bin:/home/XXX/.gvm/bin:/home/XXX/.vscode-server/cli/servers/Stable-31c37ee8f63491495ac49e43b8544550fbae4533/server/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/XXX/.local/bin:/home/XXX/.local/bin:/home/XXX/.local/bin', 'P9K_TTY': 'old', 'LC_FIG_SET_PARENT': '4c022497-5122-4b80-b325-c89bab32302a', 'PWD': '/local/rcs/XXX/code/pytrace-collector/logs/pypibugs/tried/AmmsA+Githeat/AmmsA+Githeat', 'LOGNAME': 'XXX', 'XDG_SESSION_TYPE': 'tty', 'CONDA_PREFIX': '/local/rcs/XXX/miniforge3/envs/AmmsA+Githeat', 'VSCODE_GIT_ASKPASS_NODE': '/home/XXX/.vscode-server/cli/servers/Stable-31c37ee8f63491495ac49e43b8544550fbae4533/server/node', 'MOTD_SHOWN': 'pam', 'VSCODE_INJECTION': '1', 'GVM_OVERLAY_PREFIX': '/home/XXX/.gvm/pkgsets/go1.19.1/global/overlay', 'HOME': '/home/XXX', 'LANG': 'en_US.UTF-8', 'DYLD_LIBRARY_PATH': '/home/XXX/.gvm/pkgsets/go1.19.1/global/overlay/lib:/home/XXX/.gvm/pkgsets/go1.19.1/global/overlay/lib', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:', 'gvm_pkgset_name': 'global', 'SSL_CERT_DIR': '/usr/lib/ssl/certs', 'CONDA_PROMPT_MODIFIER': '(AmmsA+Githeat) ', 'GIT_ASKPASS': '/home/XXX/.vscode-server/cli/servers/Stable-31c37ee8f63491495ac49e43b8544550fbae4533/server/extensions/git/dist/askpass.sh', 'GVM_ROOT': '/home/XXX/.gvm', 'SSH_CONNECTION': '127.0.0.1 39996 127.0.0.1 22', 'GOROOT': '/home/XXX/.gvm/gos/go1.19.1', 'NVM_DIR': '/local/rcs/XXX/.nvm', 'VSCODE_GIT_ASKPASS_EXTRA_ARGS': '', 'XDG_SESSION_CLASS': 'user', 'PYTHONPATH': ':/local/rcs/XXX/code/pytrace-collector:/local/rcs/XXX/code/pytrace-collector/logs/pypibugs/tried/AmmsA+Githeat/AmmsA+Githeat', 'TERM': 'screen', 'ZSH': '/home/XXX/.oh-my-zsh', '_CE_CONDA': '', 'V...deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:', 'gvm_pkgset_name': 'global', 'SSL_CERT_DIR': '/usr/lib/ssl/certs', 'CONDA_PROMPT_MODIFIER': '(AmmsA+Githeat) ', 'GIT_ASKPASS': '/home/XXX/.vscode-server/cli/servers/Stable-31c37ee8f63491495ac49e43b8544550fbae4533/server/extensions/git/dist/askpass.sh', 'GVM_ROOT': '/home/XXX/.gvm', 'SSH_CONNECTION': '127.0.0.1 39996 127.0.0.1 22', 'GOROOT': '/home/XXX/.gvm/gos/go1.19.1', 'NVM_DIR': '/local/rcs/XXX/.nvm', 'VSCODE_GIT_ASKPASS_EXTRA_ARGS': '', 'XDG_SESSION_CLASS': 'user', 'PYTHONPATH': ':/local/rcs/XXX/code/pytrace-collector:/local/rcs/XXX/code/pytrace-collector/logs/pypibugs/tried/AmmsA+Githeat/AmmsA+Githeat', 'TERM': 'screen', 'ZSH': '/home/XXX/.oh-my-zsh', '_CE_CONDA': '', 'VSCODE_NONCE': 'd0bc7031-48a3-4719-8bb5-ef236ddd0016', 'ZDOTDIR': '/home/XXX', 'USER': 'XXX', 'TMUX_PANE': '%3', 'VSCODE_GIT_IPC_HANDLE': '/run/user/19200/vscode-git-13d67c6199.sock', 'CONDA_SHLVL': '3', 'SHLVL': '3', 'PAGER': 'less', '_P9K_SSH_TTY': '/dev/pts/20', 'XDG_SESSION_ID': '43', 'CONDA_PYTHON_EXE': '/local/rcs/XXX/miniforge3/bin/python', 'LD_LIBRARY_PATH': '/home/XXX/.gvm/pkgsets/go1.19.1/global/overlay/lib:/home/XXX/.gvm/pkgsets/go1.19.1/global/overlay/lib', 'XDG_RUNTIME_DIR': '/run/user/19200', 'SSL_CERT_FILE': '/usr/lib/ssl/certs/ca-certificates.crt', 'SSH_CLIENT': '127.0.0.1 46946 22', 'CONDA_DEFAULT_ENV': 'AmmsA+Githeat', 'P9K_SSH': '1', 'LC_ALL': 'en_US.UTF-8', 'VSCODE_GIT_ASKPASS_MAIN': '/home/XXX/.vscode-server/cli/servers/Stable-31c37ee8f63491495ac49e43b8544550fbae4533/server/extensions/git/dist/askpass-main.js', 'XDG_DATA_DIRS': '/usr/local/share:/usr/share:/var/lib/snapd/desktop', 'BROWSER': '/home/XXX/.vscode-server/cli/servers/Stable-31c37ee8f63491495ac49e43b8544550fbae4533/server/bin/helpers/browser.sh', 'PATH': '/home/XXX/.gdrive-downloader:/local/arise/XXX/miniforge3/bin:/home/XXX/.gvm/pkgsets/go1.19.1/global/bin:/home/XXX/.gvm/gos/go1.19.1/bin:/home/XXX/.gvm/pkgsets/go1.19.1/global/overlay/bin:/home/XXX/.gvm/bin:/local/rcs/XXX/miniforge3/envs/AmmsA+Githeat/bin:/local/rcs/XXX/miniforge3/condabin:/home/XXX/.gdrive-downloader:/local/arise/XXX/miniforge3/bin:/home/XXX/.vscode-server/cli/servers/Stable-31c37ee8f63491495ac49e43b8544550fbae4533/server/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/XXX/.local/bin:/home/XXX/.local/bin', 'DBUS_SESSION_BUS_ADDRESS': 'unix:path=/run/user/19200/bus', 'gvm_go_name': 'go1.19.1', 'CONDA_PREFIX_1': '/local/rcs/XXX/miniforge3', 'CONDA_PREFIX_2': '/local/rcs/XXX/miniforge3/envs/mal', 'OLDPWD': '/local/rcs/XXX/code/pytrace-collector', 'GOPATH': '/home/XXX/.gvm/pkgsets/go1.19.1/global', 'TERM_PROGRAM': 'tmux', 'VSCODE_IPC_HOOK_CLI': '/run/user/19200/vscode-ipc-518d6355-acaf-4714-a359-be3fe9f21e09.sock', '_': '/local/rcs/XXX/miniforge3/envs/AmmsA+Githeat/bin/python', 'PYTEST_CURRENT_TEST': 'test/test_interactive.py::test_print_left_header (setup)', 'COLUMNS': '250', 'LINES': '60'}), 'LINES', <notset>)], _cwd=None, _savesyspath=None}

{_setattr=[], _setitem=[(environ({'SHELL': '/bin/bash', 'LSCOLORS': 'Gxfxcxdxbxegedabagacad', 'USER_ZDOTDIR': '/home/XXX', 'COLORTERM': 'truecolor', 'LESS': '-R', 'TERM_PROGRAM_VERSION': '3.2a', 'GVM_VERSION': '1.0.22', 'CONDA_EXE': '/local/rcs/XXX/miniforge3/bin/conda', '_CE_M': '', 'TMUX': '/tmp/tmux-19200/default,59951,3', 'PKG_CONFIG_PATH': '/home/XXX/.gvm/pkgsets/go1.19.1/global/overlay/lib/pkgconfig:/home/XXX/.gvm/pkgsets/go1.19.1/global/overlay/lib/pkgconfig:', '_P9K_TTY': '/dev/pts/20', 'GVM_PATH_BACKUP': '/home/XXX/.gvm/bin:/local/rcs/XXX/miniforge3/envs/mal/bin:/local/rcs/XXX/miniforge3/condabin:/home/XXX/.gdrive-downloader:/local/arise/XXX/miniforge3/bin:/home/XXX/.gvm/pkgsets/go1.19.1/global/bin:/home/XXX/.gvm/gos/go1.19.1/bin:/home/XXX/.gvm/pkgsets/go1.19.1/global/overlay/bin:/home/XXX/.gvm/bin:/home/XXX/.vscode-server/cli/servers/Stable-31c37ee8f63491495ac49e43b8544550fbae4533/server/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/XXX/.local/bin:/home/XXX/.local/bin:/home/XXX/.local/bin', 'P9K_TTY': 'old', 'LC_FIG_SET_PARENT': '4c022497-5122-4b80-b325-c89bab32302a', 'PWD': '/local/rcs/XXX/code/pytrace-collector/logs/pypibugs/tried/AmmsA+Githeat/AmmsA+Githeat', 'LOGNAME': 'XXX', 'XDG_SESSION_TYPE': 'tty', 'CONDA_PREFIX': '/local/rcs/XXX/miniforge3/envs/AmmsA+Githeat', 'VSCODE_GIT_ASKPASS_NODE': '/home/XXX/.vscode-server/cli/servers/Stable-31c37ee8f63491495ac49e43b8544550fbae4533/server/node', 'MOTD_SHOWN': 'pam', 'VSCODE_INJECTION': '1', 'GVM_OVERLAY_PREFIX': '/home/XXX/.gvm/pkgsets/go1.19.1/global/overlay', 'HOME': '/home/XXX', 'LANG': 'en_US.UTF-8', 'DYLD_LIBRARY_PATH': '/home/XXX/.gvm/pkgsets/go1.19.1/global/overlay/lib:/home/XXX/.gvm/pkgsets/go1.19.1/global/overlay/lib', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:', 'gvm_pkgset_name': 'global', 'SSL_CERT_DIR': '/usr/lib/ssl/certs', 'CONDA_PROMPT_MODIFIER': '(AmmsA+Githeat) ', 'GIT_ASKPASS': '/home/XXX/.vscode-server/cli/servers/Stable-31c37ee8f63491495ac49e43b8544550fbae4533/server/extensions/git/dist/askpass.sh', 'GVM_ROOT': '/home/XXX/.gvm', 'SSH_CONNECTION': '127.0.0.1 39996 127.0.0.1 22', 'GOROOT': '/home/XXX/.gvm/gos/go1.19.1', 'NVM_DIR': '/local/rcs/XXX/.nvm', 'VSCODE_GIT_ASKPASS_EXTRA_ARGS': '', 'XDG_SESSION_CLASS': 'user', 'PYTHONPATH': ':/local/rcs/XXX/code/pytrace-collector:/local/rcs/XXX/code/pytrace-collector/logs/pypibugs/tried/AmmsA+Githeat/AmmsA+Githeat', 'TERM': 'screen', 'ZSH': '/home/XXX/.oh-my-zsh', '_CE_CONDA': '', 'VSCODE_NONCE': 'd0bc7031-48a3-4719-8bb5-ef236ddd0016', 'ZDOTDIR': '/home/XXX', 'USER': 'XXX', 'TMUX_PANE': '%3', 'VSCODE_GIT_IPC_HANDLE': '/run/user/19200/vscode-git-13d67c6199.sock', 'CONDA_SHLVL': '3', 'SHLVL': '3', 'PAGER': 'less', '_P9K_SSH_TTY': '/dev/pts/20', 'XDG_SESSION_ID': '43', 'CONDA_PYTHON_EXE': '/local/rcs/XXX/miniforge3/bin/python', 'LD_LIBRARY_PATH': '/home/XXX/.gvm/pkgsets/go1.19.1/global/overlay/lib:/home/XXX/.gvm/pkgsets/go1.19.1/global/overlay/lib', 'XDG_RUNTIME_DIR': '/run/user/19200', 'SSL_CERT_FILE': '/usr/lib/ssl/certs/ca-certificates.crt', 'SSH_CLIENT': '127.0.0.1 46946 22', 'CONDA_DEFAULT_ENV': 'AmmsA+Githeat', 'P9K_SSH': '1', 'LC_ALL': 'en_US.UTF-8', 'VSCODE_GIT_ASKPASS_MAIN': '/home/XXX/.vscode-server/cli/servers/Stable-31c37ee8f63491495ac49e43b8544550fbae4533/server/extensions/git/dist/askpass-main.js', 'XDG_DATA_DIRS': '/usr/local/share:/usr/share:/var/lib/snapd/desktop', 'BROWSER': '/home/XXX/.vscode-server/cli/servers/Stable-31c37ee8f63491495ac49e43b8544550fbae4533/server/bin/helpers/browser.sh', 'PATH': '/home/XXX/.gdrive-downloader:/local/arise/XXX/miniforge3/bin:/home/XXX/.gvm/pkgsets/go1.19.1/global/bin:/home/XXX/.gvm/gos/go1.19.1/bin:/home/XXX/.gvm/pkgsets/go1.19.1/global/overlay/bin:/home/XXX/.gvm/bin:/local/rcs/XXX/miniforge3/envs/AmmsA+Githeat/bin:/local/rcs/XXX/miniforge3/condabin:/home/XXX/.gdrive-downloader:/local/arise/XXX/miniforge3/bin:/home/XXX/.vscode-server/cli/servers/Stable-31c37ee8f63491495ac49e43b8544550fbae4533/server/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/XXX/.local/bin:/home/XXX/.local/bin', 'DBUS_SESSION_BUS_ADDRESS': 'unix:path=/run/user/19200/bus', 'gvm_go_name': 'go1.19.1', 'CONDA_PREFIX_1': '/local/rcs/XXX/miniforge3', 'CONDA_PREFIX_2': '/local/rcs/XXX/miniforge3/envs/mal', 'OLDPWD': '/local/rcs/XXX/code/pytrace-collector', 'GOPATH': '/home/XXX/.gvm/pkgsets/go1.19.1/global', 'TERM_PROGRAM': 'tmux', 'VSCODE_IPC_HOOK_CLI': '/run/user/19200/vscode-ipc-518d6355-acaf-4714-a359-be3fe9f21e09.sock', '_': '/local/rcs/XXX/miniforge3/envs/AmmsA+Githeat/bin/python', 'PYTEST_CURRENT_TEST': 'test/test_interactive.py::test_print_left_header (setup)', 'COLUMNS': '250'}), 'COLUMNS', <notset>)], _cwd=None, _savesyspath=None}


X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.15, random_state=1111)


def _parse_time(t):
    t = " ".join(token.strip() for token in t.lower().split(" "))
    try:
        try:
            _t = time.strptime(t, "%b %d %Y")
        except ValueError:
            _t = time.strptime(t, "%b %d %H:%M")
    except ValueError:
        # Unknown time format
        return None

    year = _t.tm_year if _t.tm_year != 1900 else time.localtime().tm_year
    month = _t.tm_mon
    day = _t.tm_mday
    hour = _t.tm_hour
    minutes = _t.tm_min
    dt = datetime.datetime(year, month, day, hour, minutes, tzinfo=UTC)

    epoch_time = (dt - epoch_dt).total_seconds()
    return epoch_time

_parse_time(t='Jan 18  2006')

time.struct_time(tm_year=2006, tm_mon=1, tm_mday=18, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=18, tm_isdst=-1)

datetime.datetime(2006, 1, 18, 0, 0, tzinfo=<UTC>)