def src(filename):
 if (filename is None):
  return filename
 if (sys.platform.startswith('java') and filename.endswith('$py.class')):
  return '.'.join((filename[:(-9)], 'py'))
 (base, ext) = os.path.splitext(filename)
 if (ext in ('.pyc', '.pyo', '.py')):
  return '.'.join((base, 'py'))
 return filename

def src ( filename ) : if ( filename is None ) : return filename if ( sys . platform . startswith ( 'java' ) and filename . endswith ( '$py.class' ) ) : return '.' . join ( ( filename [ : ( - 9 ) ] , 'py' ) ) ( base , ext ) = os . path . splitext ( filename ) if ( ext in ( '.pyc' , '.pyo' , '.py' ) ) : return '.' . join ( ( base , 'py' ) ) return filename
find the python source file for a .