"""updates subreddit css with compiled sass"""
import subprocess
import praw

def css() -> str:
    """compiles sass and returns css"""
    res: subprocess.CompletedProcess = subprocess.run(
        "sass index.scss --style compressed --quiet", stdout=subprocess.PIPE
        )
    return res.stdout

def update(reddit: praw.Reddit, style: str) -> None:
    """update subreddit stylesheet"""
    sub: praw.models.Subreddit = reddit.subreddit("neoliberal")
    sub.wiki("config/stylesheet").update(style)
    return

def main() -> None:
    """main function"""
    reddit: praw.Reddit = praw.Reddit()
    style: str = css()
    update(reddit, style)
    return

if __name__ == '__main__':
    main()

"""updates subreddit css with compiled sass"""
import subprocess
import time

import praw

def css() -> str:
    """compiles sass and returns css"""
    res: subprocess.CompletedProcess = subprocess.run(
        "sass index.scss --style compressed --quiet", stdout=subprocess.PIPE
        )
    return res.stdout

def uid() -> str:
    """return date and time"""
    return "Subreddit upload on {}".format(time.strftime("%c"))

def update(reddit: praw.Reddit, style: str) -> None:
    """update subreddit stylesheet"""
    reddit.subreddit("neoliberal").stylesheet.update(style, reason=uid())
    return

def main() -> None:
    """main function"""
    reddit: praw.Reddit = praw.Reddit()
    style: str = css()
    update(reddit, style)
    return

if __name__ == '__main__':
    main()

Use direct subreddit stylesheet update function
Use direct subreddit stylesheet update function

Instead of updating the wiki, uses the praw-defined function.

Also adds an UID function for subreddit reason

  """updates subreddit css with compiled sass"""
  import subprocess
+ import time
+ 
  import praw
  
  def css() -> str:
      """compiles sass and returns css"""
      res: subprocess.CompletedProcess = subprocess.run(
          "sass index.scss --style compressed --quiet", stdout=subprocess.PIPE
          )
      return res.stdout
  
+ def uid() -> str:
+     """return date and time"""
+     return "Subreddit upload on {}".format(time.strftime("%c"))
+ 
  def update(reddit: praw.Reddit, style: str) -> None:
      """update subreddit stylesheet"""
+     reddit.subreddit("neoliberal").stylesheet.update(style, reason=uid())
-     sub: praw.models.Subreddit = reddit.subreddit("neoliberal")
-     sub.wiki("config/stylesheet").update(style)
      return
  
  def main() -> None:
      """main function"""
      reddit: praw.Reddit = praw.Reddit()
      style: str = css()
      update(reddit, style)
      return
  
  if __name__ == '__main__':
      main()
  
Use direct subreddit stylesheet update function
## Code Before:
"""updates subreddit css with compiled sass"""
import subprocess
import praw

def css() -> str:
    """compiles sass and returns css"""
    res: subprocess.CompletedProcess = subprocess.run(
        "sass index.scss --style compressed --quiet", stdout=subprocess.PIPE
        )
    return res.stdout

def update(reddit: praw.Reddit, style: str) -> None:
    """update subreddit stylesheet"""
    sub: praw.models.Subreddit = reddit.subreddit("neoliberal")
    sub.wiki("config/stylesheet").update(style)
    return

def main() -> None:
    """main function"""
    reddit: praw.Reddit = praw.Reddit()
    style: str = css()
    update(reddit, style)
    return

if __name__ == '__main__':
    main()

## Instruction:
Use direct subreddit stylesheet update function
## Code After:
"""updates subreddit css with compiled sass"""
import subprocess
import time

import praw

def css() -> str:
    """compiles sass and returns css"""
    res: subprocess.CompletedProcess = subprocess.run(
        "sass index.scss --style compressed --quiet", stdout=subprocess.PIPE
        )
    return res.stdout

def uid() -> str:
    """return date and time"""
    return "Subreddit upload on {}".format(time.strftime("%c"))

def update(reddit: praw.Reddit, style: str) -> None:
    """update subreddit stylesheet"""
    reddit.subreddit("neoliberal").stylesheet.update(style, reason=uid())
    return

def main() -> None:
    """main function"""
    reddit: praw.Reddit = praw.Reddit()
    style: str = css()
    update(reddit, style)
    return

if __name__ == '__main__':
    main()
