def __init__(self,
                 PHANTOMJS_COOKIE_DIR=None,
                 PHANTOMJS_PDF_DIR=None,
                 PHANTOMJS_BIN=None,
                 PHANTOMJS_GENERATE_PDF=None,
                 KEEP_PDF_FILES=None):
        """Arguments:
            PHANTOMJS_COOKIE_DIR = Directory where the temp cookies will be saved.
            PHANTOMJS_PDF_DIR = Directory where you want to the PDF to be saved temporarily.
            PHANTOMJS_BIN = Path to PhantomsJS binary.
            PHANTOMJS_GENERATE_PDF = Path to generate_pdf.js file.
            KEEP_PDF_FILES = Option to not delete the PDF file after rendering it.
            PHANTOMJS_FORMAT = Page size to use.
            PHANTOMJS_ORIENTATION = How the page will be positioned when printing.
            PHANTOMJS_MARGIN = The margins of the PDF.
        """
        self.PHANTOMJS_COOKIE_DIR = PHANTOMJS_COOKIE_DIR
        self.PHANTOMJS_PDF_DIR = PHANTOMJS_PDF_DIR
        self.PHANTOMJS_BIN = PHANTOMJS_BIN
        self.PHANTOMJS_GENERATE_PDF = PHANTOMJS_GENERATE_PDF
        self.KEEP_PDF_FILES = KEEP_PDF_FILES

        for attr in [
                'PHANTOMJS_COOKIE_DIR',
                'PHANTOMJS_PDF_DIR',
                'PHANTOMJS_BIN',
                'PHANTOMJS_GENERATE_PDF',
                'KEEP_PDF_FILES',
                'PHANTOMJS_FORMAT',
                'PHANTOMJS_ORIENTATION',
                'PHANTOMJS_MARGIN']:
            if getattr(self, attr, None) is None:
                value = getattr(settings, attr, None)
                if value is None:
                    value = DEFAULT_SETTINGS[attr]
                setattr(self, attr, value)

        assert os.path.isfile(self.PHANTOMJS_BIN), \
            self.PHANTOMJS_BIN % "%s doesnt exist, read the docs for more info."
        for dir_ in [self.PHANTOMJS_COOKIE_DIR, self.PHANTOMJS_PDF_DIR]:
            if not os.path.isdir(dir_):
                os.makedirs(dir_)
dataset/ETHPy150Open BananaDesk/django-phantom-pdf/phantom_pdf/generator.py/RequestToPDF.__init__/swapped operands of `%`