code: def mode_name(mode):
      '''Tries best-effortly to get the right mode name'''
  
      if mode:
          l = mode.lower()
  
          if l in ('java', ):
              return ('clike', 'text/x-java')
          if l in ('c', ):
              return ('clike', 'text/x-csrc')
          if l in ('c++', 'cxx'):
              return ('clike', 'text/x-c++src')
          if l in ('csharp', 'c#'):
              return ('clike', 'text/x-csharp')
  
          if l in ('sh', 'bash', ):
              return ('shell', 'text/x-sh')
  
          if l in codemirror_modes:
              return (l, None)
  
      return (None, Nonef mode_name(mode):
      '''Tries best-effortly to get the right mode name'''
  
      if mode:
          l = mode.lower()
  
          if l in ('java', ):
              return ('clike', 'text/x-java')
          if l in ('c', ):
              return ('clike', 'text/x-csrc')
          if l in ('c++', 'cxx'):
              return ('clike', 'text/x-c++src')
          if l in ('csharp', 'c#'):
              return ('clike', 'text/x-csharp')
  
          if l in ('sh', 'bash', ):
              return ('shell', 'text/x-sh')
  
          if l in codemirror_modes:
              return (l, None)
  
      return (None, None)
docs: Tries best-effortly to get the right mode name