# coding: utf-8

from __future__ import unicode_literals


import decimal


def get_first_or_none(list_):
    return next(iter(list_), None)


def rounded_decimal(value, places=2):
    rounder = decimal.Decimal(10) ** -places
    return value.quantize(rounder)
