<s> import sys <EOL> import os <EOL> try : <EOL> import sublime <EOL> except Exception : <EOL> pass <EOL> NEW_ACCOUNT_TXT = '<STR_LIT>' <EOL> LINKED_ACCOUNT_TXT = """<STR_LIT>""" <EOL> def name ( ) : <EOL> if sys . version_info < ( <NUM_LIT:3> , <NUM_LIT:0> ) : <EOL> py_version = <NUM_LIT:2> <EOL> else : <EOL> py_version = <NUM_LIT:3> <EOL> return '<STR_LIT>' % py_version <EOL> def codename ( ) : <EOL> return '<STR_LIT>' <EOL> def ok_cancel_dialog ( dialog ) : <EOL> return sublime . ok_cancel_dialog ( dialog ) <EOL> def error_message ( msg ) : <EOL> sublime . error_message ( msg ) <EOL> def status_message ( msg ) : <EOL> sublime . status_message ( msg ) <EOL> def platform ( ) : <EOL> return sublime . platform ( ) <EOL> def set_timeout ( f , timeout ) : <EOL> sublime . set_timeout ( f , timeout ) <EOL> def call_timeouts ( ) : <EOL> return <EOL> def message_dialog ( msg ) : <EOL> sublime . message_dialog ( msg ) <EOL> def open_file ( file ) : <EOL> win = sublime . active_window ( ) <EOL> if win : <EOL> win . open_file ( file ) <EOL> def get_line_endings ( path = None ) : <EOL> ending = sublime . load_settings ( '<STR_LIT>' ) . get ( '<STR_LIT>' ) <EOL> if ending == '<STR_LIT>' : <EOL> return os . linesep <EOL> if ending == '<STR_LIT>' : <EOL> return '<STR_LIT:\r\n>' <EOL> return '<STR_LIT:\n>' <EOL> def select_auth ( * args ) : <EOL> window , auths , cb = args <EOL> if not auths : <EOL> return cb ( None ) <EOL> auths = dict ( auths ) <EOL> for k , v in auths . items ( ) : <EOL> v [ '<STR_LIT:host>' ] = k <EOL> if len ( auths ) == <NUM_LIT:1> : <EOL> return cb ( list ( auths . values ( ) ) [ <NUM_LIT:0> ] ) <EOL> opts = [ [ h , '<STR_LIT>' % a . get ( '<STR_LIT:username>' ) ] for h , a in auths . items ( ) ] <EOL> opts . append ( [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> def on_account ( index ) : <EOL> if index < <NUM_LIT:0> or index >= len ( auths ) : <EOL> return cb ( None ) <EOL> host = opts [ index ] [ <NUM_LIT:0> ] <EOL> return cb ( auths [ host ] ) <EOL> flags = <NUM_LIT:0> <EOL> if hasattr ( sublime , '<STR_LIT>' ) : <EOL> flags |= sublime . KEEP_OPEN_ON_FOCUS_LOST <EOL> return window . show_quick_panel ( opts , on_account , flags ) </s>
