def is_python_script(script_text, filename):
 if (filename.endswith('.py') or filename.endswith('.pyw')):
  return True
 if is_python(script_text, filename):
  return True
 if script_text.startswith('#!'):
  return ('python' in script_text.splitlines()[0].lower())
 return False

def is_python_script ( script_text , filename ) : if ( filename . endswith ( '.py' ) or filename . endswith ( '.pyw' ) ) : return True if is_python ( script_text , filename ) : return True if script_text . startswith ( '#!' ) : return ( 'python' in script_text . splitlines ( ) [ 0 ] . lower ( ) ) return False
is this text .