Skip to content

Instantly share code, notes, and snippets.

View ntamas's full-sized avatar

Tamás Nepusz ntamas

  • CollMot Robotics Ltd.
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ntamas on github.
  • I am ntamas (https://keybase.io/ntamas) on keybase.
  • I have a public key ASClM5botlxl4Q__0JMBdMM0fFqQAIxFMLAH00CCU0hffwo

To claim this, I am signing this object:

@ntamas
ntamas / hlc.py
Created November 19, 2013 09:54
Hierarchical link clustering algorithm of Ahn et al (see http://barabasilab.neu.edu/projects/linkcommunities/), implemented using Python and igraph for fun.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Hierarchical link clustering
============================
:Author: Tamás Nepusz
This is an implementation of the hierarchical link clustering algorithm of Ahn
et al. The results provided by this implementation match those of the original
@ntamas
ntamas / walker.py
Last active April 15, 2020 14:37
Weighted sampling with replacement using Walker's alias method - NumPy version
#!/usr/bin/env python
from numpy import arange, array, bincount, ndarray, ones, where
from numpy.random import seed, random, randint
__author__ = "Tamas Nepusz, Denis Bzowy"
__version__ = "27jul2011"
class WalkerRandomSampling(object):
"""Walker's alias method for random objects with different probablities.
@ntamas
ntamas / complementerset.py
Created February 16, 2011 16:13
complementerset object for Python
class complementerset(object):
"""This object behaves more or less like a set, with one exception,
the membership checking. For a `complementerset` object, you can
define the elements which are *not* in the set, everything else is
contained in it. The semantics of the operators are the same as for
sets.
Usage example::
>>> s = complementerset()
"""
``vuvuzela.py`` adds the glorious sound of the vuvuzela to any
Python program.
Based on the excellent idea of Chris Williams. See also:
<http://search.cpan.org/~bingos/Acme-Vuvuzela-0.02>
Usage::
>>> import vuvuzela