code: def extract(path_to_hex, output_path=None):
      
      with open(path_to_hex, 'r') as hex_file:
          python_script = extract_script(hex_file.read())
          if output_path:
              with open(output_path, 'w') as output_file:
                  output_file.write(python_script)
          else:
              print(python_script)
docs: Given a path_to_hex file this function will attempt to extract the
      embedded script from it and save it either to output_path or stdout