def GuessLanguage(filename):
  """ Attempts to Guess Langauge of `filename`. Essentially, we do a
  filename.rsplit('.', 1), and a lookup into a dictionary of extensions."""
  try:
    (_, extension) = filename.rsplit('.', 1)
  except __HOLE__:
    raise ValueError("Could not guess language as '%s' does not have an \
        extension"%filename)

  return {'c'   : 'c'
         ,'py'  : 'python'}[extension]
dataset/ETHPy150Open spranesh/Redhawk/redhawk/utils/util.py/GuessLanguage