code: def snake(s):
      
      if len(s) < 2:
          return s.lower()
      out = s[0].lower()
      for c in s[1:]:
          if c.isupper():
              out += "_"
              c = c.lower()
          out += c
      return out
docs: Convert from title or camelCase to snake_case.