Skip to content

Instantly share code, notes, and snippets.

View davidefiocco's full-sized avatar

Davide Fiocco davidefiocco

View GitHub Profile
@rdapaz
rdapaz / win32com.client.py
Last active March 24, 2026 02:36
Fix for module win32com.gen_py has no attribute 'CLSIDToPackageMap'
# If errors are found, do this
# clear contents of C:\Users\<username>\AppData\Local\Temp\gen_py
# that should fix it, to test it type
import win32com.client
app = win32com.client.gencache.EnsureDispatch('Word.Application')
app.Visible = True
@Tushar-N
Tushar-N / pad_packed_demo.py
Last active October 27, 2024 15:17
How to use pad_packed_sequence in pytorch<1.1.0
import torch
import torch.nn as nn
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
seqs = ['gigantic_string','tiny_str','medium_str']
# make <pad> idx 0
vocab = ['<pad>'] + sorted(set(''.join(seqs)))
# make model
@jacquerie
jacquerie / grobid.py
Created October 30, 2015 15:46
Python-driven GROBID retraining
#!/usr/bin/env python
# -*- coding: utf8 -*-
import os
import grobid_core
import grobid_trainer
if __name__ == '__main__':
@jakevdp
jakevdp / CategoricalCMAP.ipynb
Last active June 8, 2025 22:34
Example of a categorical color map in matplotlib
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.