<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_sources(self, category=None, language=None, country=None):
 """ Optional parameters: (str) category - The category you want to get headlines for! Valid values are: 				 'business','entertainment','general','health','science','sports','technology' 		(str) language - The 2-letter ISO-639-1 code of the language you want to get headlines for. Valid values are: 				'ar','de','en','es','fr','he','it','nl','no','pt','ru','se','ud','zh' (str) country - The 2-letter ISO 3166-1 code of the country you want to get headlines! Valid values are: 'ae','ar','at','au','be','bg','br','ca','ch','cn','co','cu','cz','de','eg','fr','gb','gr', 'hk','hu','id','ie','il','in','it','jp','kr','lt','lv','ma','mx','my','ng','nl','no','nz', 'ph','pl','pt','ro','rs','ru','sa','se','sg','si','sk','th','tr','tw','ua','us' 				(str) category - The category you want to get headlines for! Valid values are: 						'business','entertainment','general','health','science','sports','technology' """


        # Define Payload
        payload = {}

        # Language
        if language is not None:
            if type(language) == str:
                if language in const.languages:
                    payload['language'] = language
                else:
                    raise ValueError('invalid language')
            else:
                raise TypeError('language param should be of type str')

        # Country
        if country is not None:
            if type(country) == str:
                if country in const.countries:
                    payload['country'] = country
                else:
                    raise ValueError('invalid country')
            else:
                raise TypeError('country param should be of type str')

                # Category
        if category is not None:
            if type(category) == str:
                if category in const.categories:
                    payload['category'] = category
                else:
                    raise ValueError('invalid category')
            else:
                raise TypeError('category param should be of type str')

        # Send Request
        r = requests.get(const.SOURCES_URL, auth=self.auth, timeout=30, params=payload)

        # Check Status of Request
        if r.status_code != requests.codes.ok:
            raise NewsAPIException(r.json())

        return r.json()