code: def snake_case(a_string):
      
  
      partial = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', a_string)
      return re.sub('([a-z0-9])([A-Z])', r'\1_\2', partial).lower()
docs: Returns a snake cased version of a string.
  
      :param a_string: any :class:`str` object.
  
      Usage:
          >>> snake_case('FooBar')
          "foo_bar"