<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def calculate_size(self, modules_per_line, number_of_lines, dpi=300):
 """Calculates the size of the barcode in pixel. :parameters: modules_per_line : Integer Number of modules in one line. number_of_lines : Integer Number of lines of the barcode. dpi : Integer DPI to calculate. :returns: Width and height of the barcode in pixel. :rtype: Tuple """

        width = 2 * self.quiet_zone + modules_per_line * self.module_width
        height = 2.0 + self.module_height * number_of_lines
        if self.font_size and self.text:
            height += pt2mm(self.font_size) / 2 + self.text_distance
        return int(mm2px(width, dpi)), int(mm2px(height, dpi))