Skip to content

Instantly share code, notes, and snippets.

View davidfarrugia's full-sized avatar

David Farrugia davidfarrugia

View GitHub Profile
@davidfarrugia
davidfarrugia / hangar_commit.py
Created January 5, 2022 22:11
Hangar DVC commit usage example
import pickle
# get the WriterCheckout
master = repo.checkout(write=True)
# Add a New Column
master.add_bytes_column(name='data')
# Add the Data
master['data'][0] = pickle.dumps(df, protocol=4)
@davidfarrugia
davidfarrugia / hangar_intro.py
Created January 5, 2022 22:06
Getting started with Hangar DVC
from hangar import Repository
import os
repo_name = 'test'
if not os.path.isdir(repo_name):
print(f'{repo_name} directory was not found. Creating an empty directory.')
os.makedirs(repo_name)
repo = Repository(path=repo_name)
@davidfarrugia
davidfarrugia / test.py
Created August 7, 2021 11:46
A toy-example of multithreading in Python
import threading
import os
import time
from urllib.parse import urlparse
from urllib.request import urlretrieve
from typing import List
from numpy import round
IMGS_URL_LIST = \
['https://dl.dropboxusercontent.com/s/2fu69d8lfesbhru/pexels-photo-48603.jpeg',