Overview Write a Python script that reads lines of MIPS assembly code from a file (with specific formatting constraints, detailed below) and writes the corresponding MIPS machine code for those instructions to an output file. The input file should be passed as a command line argument to the Python script using Python argparse. Input File Format The input file may contain instructions in the following types: - R type-add, sub, sll, srl, slt - I-Type-addi, beq, bne, lw, sw - J type: Not needed in this project!Formatting Constraints The input file contains a single instruction per line, with the opcode in lowercase characters followed by whitespace (a single space character, or any combination of whitespace characters, or tabs), followed by the arguments. The arguments are separated by commas without any whitespace between them. The registers are specified using either a dollar sign followed by a number between 0 and 31 (e.g. $3) or using a dollar sign followed by an alias (e.g. $v1). The immediate values are in decimal form only. The immediate values may be negative so make sure to convert them to two's complement. The end of a line is denoted with a Unixstyle line ending (n) and any further leading or trailing whitespace from each line should be ignored. If an invalid input line (not conforming to the formatting constraints and/or instruction not in this assignment) is encountered, append !!! Invalid Input !!! n to the output file exactly as it is written, with no leading or trailing spaces, close the output file, and terminate program execution gracefully. See the Output Format below for specific instructions.Output File Format The output from the program should be written to the file out_code.txt. The program should create this file if it does not yet exist, and overwrite if it does already exist. Each line of the output file should contain 32 characters, each of which is an ASCII 0 or an ASCII 1, followed at the end by a newline character (n). The output for each line specifies the 32-bit MIPS machine code for the corresponding MIPS instruction line in the input file, beginning with the most significant bit. Remember that in the event of invalid input, the error message !!! Invalid Input !!! n should be written to out_code.txt before gracefully closing the file and exiting the program.Requirements 1. The code must use Python argparse to input the text file. 2. The code must include a succinct description of the converter at the top of the file using triple quotes. Put appropriate code comments to promote readability. 3. The code must be modular using two or more functions. Sample Inputs and Outputs To develop and troubleshoot the MIPS to machine language converter, use the following MIPS codes and their corresponding outputs. The TA will use these to verify your code..