parameters: (script_text, filename)
return_statement: return False
docstring: Is this text, as a whole, a Python script? (as opposed to shell/bat/etc.
docstring_summary: Is this text, as a whole, a Python script? (as opposed to shell/bat/etc.
docstring_tokens: Is this text as a whole a Python script? ( as opposed to shell / bat / etc .
function: def is_python_script(script_text, filename):
      """Is this text, as a whole, a Python script? (as opposed to shell/bat/etc.
      """
      if filename.endswith('.py') or filename.endswith('.pyw'):
          return True  # extension says it's Python
      if is_python(script_text, filename):
          return True  # it's syntactically valid Python
      if script_text.startswith('#!'):
          # It begins with a '#!' line, so check if 'python' is in it somewhere
          return 'python' in script_text.splitlines()[0].lower()
  
      return False
function_tokens: def is_python_script ( script_text , filename ) : if filename . endswith ( '.py' ) or filename . endswith ( '.pyw' ) : return True # extension says it's Python if is_python ( script_text , filename ) : return True # it's syntactically valid Python if script_text . startswith ( '#!' ) : # It begins with a '#!' line, so check if 'python' is in it somewhere return 'python' in script_text . splitlines ( ) [ 0 ] . lower ( ) return False