<commit_before>
import bcrypt


def hash_pwd(password):
    return bcrypt.hashpw(password, bcrypt.gensalt())


def check_pwd(password, hashed):
    return bcrypt.hashpw(password, hashed) == hashed


def fb_image_url(fbid, size='small'):
    url = 'https://graph.facebook.com/{}/picture?type={}'.format(fbid, size)

    if size != 'small':
        url = 'https://graph.facebook.com/{}/picture?width={}&height={}'.format(fbid, size, size)
    return url


def robohash_image_url(email, size='50'):
    url = 'https://robohash.org/{}.jpg?gravatar=yes&size={}x{}'.format(
        email, size, size)
    return url

def image_html(user, size):
    """
    use robohash.org and have it default to gravatar if the user has one
    """
    if user.facebook:
        fbid = user.facebook['id']
        url = fb_image_url(fbid, size)<commit_msg>fix tests<commit_after>
import bcrypt


def hash_pwd(password):
    return bcrypt.hashpw(password, bcrypt.gensalt())


def check_pwd(password, hashed):
    return bcrypt.hashpw(password, hashed) == hashed


def fb_image_url(fbid, size='small'):
    url = 'https://graph.facebook.com/{}/picture?type={}'.format(fbid, size)

    print size != 'small'
    if size != 'small' and size != 'square':
        url = 'https://graph.facebook.com/{}/picture?width={}&height={}'.format(fbid, size, size)
    return url


def robohash_image_url(email, size='50'):
    url = 'https://robohash.org/{}.jpg?gravatar=yes&size={}x{}'.format(
        email, size, size)
    return url

def image_html(user, size):
    """
    use robohash.org and have it default to gravatar if the user has one
    """
    if user.facebook:
        fbid = user.facebook['id']
        url = fb_image_url(fbid, size)
{'fraction_non_alphanumeric': 0.16112084063047286, 'fraction_numerical': 0.002335084646818447, 'mean_word_length': 3.5105263157894737, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3173287', 'n_tokens_mistral': 600, 'n_tokens_neox': 582, 'n_words': 132}