<commit_before>#!/usr/bin/python
# -*- coding: <encoding name> -*-


class auth:

    def __init__(self):
        return

    def check_auth(self, user, password):
        """
        Verify authentication credentials
        """<commit_msg>Added helpers for checking email validity and provided fields<commit_after>#!/usr/bin/python
# -*- coding: <encoding name> -*-

import re


class auth:

    def __init__(self):
        return

    def check_fields(self, user=None, password=None):
        """
        check if fields are provided and are not empty
        """

        if not user or not password:
            return False

        if len(user) == 0 or len(password) == 0:
            return False

        return True

    def check_mail(self, email=None):
        """
        Verify that the provided email is valid
        """

        regex = r"[^@]+@[^@]+\.[^@]+"
        if not re.match(regex, email):
            return False
        else:
            return True

        return True

    def check_auth(self, user, password):
        """
        Verify authentication credentials
        """
{'fraction_non_alphanumeric': 0.11472448057813911, 'fraction_numerical': 0.0018066847335140017, 'mean_word_length': 1.877922077922078, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '1146995', 'n_tokens_mistral': 311, 'n_tokens_neox': 292, 'n_words': 96}