This tutorial demonstrates how to sample random numbers from arbitrary, user-defined distributions using Metropolis Monte-Carlo method. We show both the Python implementation of the algorithm and its implementation in one of the C++-defined functions in Libra.