code: def process(self, input_file: str, index: int) -> ():
      print(f"Processing {input_file} for fabric")
      output_file = os.path.join(self.output_dir, input_file)
      output_img_dir = (
          self.media_dir + "/" + self._sentence_to_snake(input_file)
      )
      full_input_file = os.path.join(self.input_dir, input_file)
      notebook_path = self.notebooks[index]["path"]
      metadata = self.notebooks[index]["metadata"]
      self._validate_metadata(metadata)
  
      def callback(el):
          if el.contents[0].has_attr("class"):
              return (
                  el.contents[0]["class"][0].split("-")[-1]
                  if len(el.contents) >= 1
                  else None
              )
          else:
              return el["class"][0] if el.has_attr("class") else None
  
      def convert_soup_to_md(soup, **options):
          return MarkdownConverter(**options).convert_soup(soup)
  
      if str(input_file).endswith(".rst"):
          output_file = self._sentence_to_snake(
              str(output_file).replace(".rst", ".md")
          )
          html = self._read_rst(full_input_file)
          parsed_html = markdown.markdown(
              html,
              extensions=[
                  "markdown.extensions.tables",
                  "markdown.extensions.fenced_code",
              ],
          )
          parsed_html = BeautifulSoup(
              parsed_html, features="html.parser"
          )
          parsed_html = self._download_and_replace_images(
              parsed_html,
              None,
              output_img_dir,
              os.path.dirname(output_file),
              notebook_path,
              True,
          )
          parsed_html = self._convert_to_markdown_links(parsed_html)
  
      elif str(input_file).endswith(".ipynb"):
          output_file = self._sentence_to_snake(
              str(output_file).replace(".ipynb", ".md")
          )
          parsed = read(full_input_file, as_version=4)
  
          c = Config()
          c.TagRemovePreprocessor.remove_cell_tags = (self.hide_tag,)
          c.TagRemovePreprocessor.enabled = True
          c.MarkdownExporter.preprocessors = [
              "nbconvert.preprocessors.TagRemovePreprocessor"
          ]
          md, resources = MarkdownExporter(config=c).from_notebook_node(
              parsed
          )
  
          html = markdown.markdown(
              md,
              extensions=[
                  "markdown.extensions.tables",
                  "markdown.extensions.fenced_code",
              ],
          )
          parsed_html = BeautifulSoup(html)
          # Download images and place them in media directory while updating their links
          parsed_html = self._download_and_replace_images(
              parsed_html,
              resources,
              output_img_dir,
              os.path.dirname(output_file),
              None,
              False,
          )
  
      # Remove StatementMeta
      for element in parsed_html.find_all(
          text=re.compile("StatementMeta\(.*?Available\)")
      ):
          element.extract()
          warnings.warn(
              f"Found StatementMeta in {input_file}, please check if you want it in the notebook.",
              UserWarning,
          )
  
      # Remove extra CSS styling info
      for style_tag in parsed_html.find_all("style"):
          style_tag.extract()
  
      # Convert from HTML to MD
      new_md = convert_soup_to_md(
          parsed_html,
          code_language_callback=callback,
          heading_style=ATX,
          escape_underscores=False,
      )
      # Post processing
      new_md = f"{self._generate_metadata_header(metadata)}\n{new_md}"
      output_md = self._remove_content(new_md)
  
      os.makedirs(dirname(output_file), exist_ok=True)
      with open(output_file, "w+", encoding="utf-8") as f:
          f.write(output_md)
  
imports: import os
  import pathlib
  import re
  import shutil
  import warnings
  from datetime import datetime
  from os.path import basename, dirname
  from typing import List
  from urllib.parse import urlparse
  import markdown
  import pypandoc
  import requests
  from bs4 import BeautifulSoup
  from docgen.core import Channel, ParallelChannel
  from markdownify import ATX, MarkdownConverter
  from nbconvert import MarkdownExporter
  from nbformat import read
  from traitlets.config import Config
label_desc: Use image node_id 12 for calling the FabricChannel obj's underlying member method code with example usage: obj.process(input_file, index) and returns: MarkdownConverter, unknown, unknown