def __init__(self, site_name='', site_url='', username=''):
        """Initialize Pybooru.

        Keyword arguments:
            site_name (str): The site name in 'SITE_LIST', default sites.
            site_url (str): URL of on Moebooru/Danbooru based sites.
            username (str): Your username of the site (Required only for
                            functions that modify the content).

        Raises:
            PybooruError: When 'site_name' and 'site_url' are empty.
        """
        # Attributes
        self.__site_name = ''  # for site_name property
        self.__site_url = ''  # for site_url property
        self.username = username
        self.last_call = {}

        # Set HTTP Client
        self.client = requests.Session()
        headers = {'user-agent': 'Pybooru/{0}'.format(__version__),
                   'content-type': 'application/json; charset=utf-8'}
        self.client.headers = headers

        # Validate site_name or site_url
        if site_name:
            self.site_name = site_name
        elif site_url:
            self.site_url = site_url
        else:
            raise PybooruError("Unexpected empty arguments, specify parameter "
                               "'site_name' or 'site_url'.")
def __init__ ( self , site_name = '' , site_url = '' , username = '' ) : self . __site_name = '' self . __site_url = '' self . username = username self . last_call = { } self . client = requests . Session ( ) headers = { 'user-agent' : 'Pybooru/{0}' . format ( __version__ ) , 'content-type' : 'application/json; charset=utf-8' } self . client . headers = headers if site_name : self . site_name = site_name elif site_url : self . site_url = site_url else : raise PybooruError ( "Unexpected empty arguments, specify parameter " "'site_name' or 'site_url'." )
Initialize Pybooru.

        Keyword arguments:
            site_name (str): The site name in 'SITE_LIST', default sites.
            site_url (str): URL of on Moebooru/Danbooru based sites.
            username (str): Your username of the site (Required only for
                            functions that modify the content).

        Raises:
            PybooruError: When 'site_name' and 'site_url' are empty.