Module ImportFrom alias ImportFrom alias ImportFrom alias Import alias Import alias Assign NameStore Str FunctionDef arguments args NameParam defaults body If UnaryOpNot Call AttributeLoad NameLoad attr body Return NameLoad Return BoolOpAnd CompareEq SubscriptLoad Call AttributeLoad NameLoad attr Slice Num Num Str BoolOpOr CompareIn Str NameLoad CompareIn Str NameLoad CompareIn Str NameLoad CompareIn Str NameLoad decorator_list ClassDef bases Call AttributeLoad NameLoad attr Str TupleLoad Str Str Str body Expr Str Assign NameStore TupleLoad FunctionDef arguments args NameParam defaults body Return CompareIsNot AttributeLoad NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Assign NameStore UnaryOpNot NameLoad Return CompareIs AttributeLoad NameLoad attr NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If Call AttributeLoad NameLoad attr Str body Assign NameStore NameLoad Assign NameStore NameLoad orelse Assign NameStore Str Assign NameStore NameLoad Assign NameStore BinOpAdd NameLoad NameLoad If CompareEq NameLoad NameLoad body Assign NameStore NameLoad orelse If Call NameLoad NameLoad body Assign NameStore NameLoad orelse Assign NameStore NameLoad Assign NameStore BinOpAdd NameLoad NameLoad Return Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr body If BoolOpOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Return Num orelse Return Num If Call AttributeLoad NameLoad attr NameLoad body Return Num Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return Num decorator_list FunctionDef arguments args NameParam defaults NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Num If AttributeLoad NameLoad attr body Assign NameStore Str orelse Assign NameStore Str For NameStore AttributeLoad NameLoad attr body With Call NameLoad NameLoad Str NameStore body Assign NameStore Call NameLoad NameLoad keyword AttributeLoad NameLoad attr AugAssignBitOr NameStore NameLoad If NameLoad body Expr Call NameLoad Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Return NameLoad decorator_list If CompareEq NameLoad Str body Expr Call NameLoad Call NameLoad
N/A __future__ absolute_import __future__ print_function __future__ unicode_literals N/A argparse N/A collections N/A expected_pragma # -*- coding: utf-8 -*-
 has_coding N/A N/A line N/A N/A N/A N/A N/A N/A line strip N/A N/A False N/A N/A N/A N/A N/A N/A line lstrip N/A 0 1 # N/A N/A unicode line N/A encoding line N/A coding: line N/A coding= line N/A ExpectedContents N/A N/A N/A collections namedtuple ExpectedContents N/A shebang rest pragma_status N/A N/A 
    pragma_status:
    - True: has exactly the coding pragma expected
    - False: missing coding pragma entirely
    - None: has a coding pragma, but it does not match
     N/A __slots__ N/A has_any_pragma N/A N/A self N/A N/A N/A N/A N/A self pragma_status False N/A property is_expected_pragma N/A N/A self remove N/A N/A N/A expected_pragma_status N/A remove N/A N/A N/A self pragma_status expected_pragma_status N/A N/A _get_expected_contents N/A N/A first_line second_line rest N/A N/A N/A N/A N/A first_line startswith #! N/A N/A shebang first_line N/A potential_coding second_line N/A N/A shebang N/A potential_coding first_line N/A rest N/A second_line rest N/A N/A potential_coding expected_pragma N/A N/A pragma_status True N/A N/A N/A has_coding potential_coding N/A N/A pragma_status None N/A N/A pragma_status False N/A rest N/A potential_coding rest N/A N/A ExpectedContents shebang shebang rest rest pragma_status pragma_status N/A fix_encoding_pragma N/A N/A f remove N/A False N/A N/A expected N/A _get_expected_contents N/A N/A f readline N/A N/A f readline N/A N/A f read N/A N/A N/A N/A N/A expected rest strip N/A N/A N/A N/A expected has_any_pragma N/A expected shebang N/A N/A N/A N/A f seek 0 N/A N/A N/A f truncate N/A N/A N/A f write N/A 1 N/A N/A 0 N/A N/A N/A expected is_expected_pragma remove N/A N/A 0 N/A N/A N/A f seek 0 N/A N/A N/A f truncate N/A N/A N/A f write N/A expected shebang N/A N/A remove N/A N/A N/A N/A f write expected_pragma N/A N/A N/A f write N/A expected rest N/A 1 N/A main N/A N/A argv N/A None N/A N/A parser N/A N/A argparse ArgumentParser Fixes the encoding pragma of python files N/A N/A N/A parser add_argument filenames nargs * help Filenames to fix N/A N/A N/A parser add_argument --remove action store_true help Remove the encoding pragma (Useful in a python3-only codebase) N/A args N/A N/A parser parse_args argv N/A retv 0 N/A N/A args remove N/A N/A fmt Removed encoding pragma from {filename} N/A N/A fmt Added `{pragma}` to {filename} N/A filename N/A args filenames N/A N/A N/A open filename r+b f N/A N/A file_ret N/A fix_encoding_pragma f remove N/A args remove N/A retv file_ret N/A file_ret N/A N/A N/A print N/A N/A fmt format pragma expected_pragma filename filename N/A retv N/A N/A N/A __name__ __main__ N/A N/A N/A exit N/A main