parameters: (self, cc_content, path)
docstring: Generate files and folders from matlab wrapper content.
  
          Args:
              cc_content: The content to generate formatted as
                  (file_name, file_content) or
                  (folder_name, [(file_name, file_content)])
              path: The path to the files parent folder within the main folder
docstring_summary: Generate files and folders from matlab wrapper content.
docstring_tokens: Generate files and folders from matlab wrapper content .
function: def generate_content(self, cc_content, path):
          """
          Generate files and folders from matlab wrapper content.
  
          Args:
              cc_content: The content to generate formatted as
                  (file_name, file_content) or
                  (folder_name, [(file_name, file_content)])
              path: The path to the files parent folder within the main folder
          """
          for c in cc_content:
              if isinstance(c, list):
                  if len(c) == 0:
                      continue
  
                  path_to_folder = osp.join(path, c[0][0])
  
                  if not osp.isdir(path_to_folder):
                      try:
                          os.makedirs(path_to_folder, exist_ok=True)
                      except OSError:
                          pass
  
                  for sub_content in c:
                      self.generate_content(sub_content[1], path_to_folder)
  
              elif isinstance(c[1], list):
                  path_to_folder = osp.join(path, c[0])
  
                  if not osp.isdir(path_to_folder):
                      try:
                          os.makedirs(path_to_folder, exist_ok=True)
                      except OSError:
                          pass
                  for sub_content in c[1]:
                      path_to_file = osp.join(path_to_folder, sub_content[0])
                      with open(path_to_file, 'w') as f:
                          f.write(sub_content[1])
              else:
                  path_to_file = osp.join(path, c[0])
  
                  if not osp.isdir(path_to_file):
                      try:
                          os.mkdir(path)
                      except OSError:
                          pass
  
                  with open(path_to_file, 'w') as f:
                      f.write(c[1])
function_tokens: def generate_content ( self , cc_content , path ) : for c in cc_content : if isinstance ( c , list ) : if len ( c ) == 0 : continue path_to_folder = osp . join ( path , c [ 0 ] [ 0 ] ) if not osp . isdir ( path_to_folder ) : try : os . makedirs ( path_to_folder , exist_ok = True ) except OSError : pass for sub_content in c : self . generate_content ( sub_content [ 1 ] , path_to_folder ) elif isinstance ( c [ 1 ] , list ) : path_to_folder = osp . join ( path , c [ 0 ] ) if not osp . isdir ( path_to_folder ) : try : os . makedirs ( path_to_folder , exist_ok = True ) except OSError : pass for sub_content in c [ 1 ] : path_to_file = osp . join ( path_to_folder , sub_content [ 0 ] ) with open ( path_to_file , 'w' ) as f : f . write ( sub_content [ 1 ] ) else : path_to_file = osp . join ( path , c [ 0 ] ) if not osp . isdir ( path_to_file ) : try : os . mkdir ( path ) except OSError : pass with open ( path_to_file , 'w' ) as f : f . write ( c [ 1 ] )