<s> from sys import getdefaultencoding , version_info <EOL> from subprocess import Popen , PIPE <EOL> basestr = ( str , unicode ) if version_info [ <NUM_LIT:0> ] == <NUM_LIT:2> else ( str , ) <EOL> default_encoding = getdefaultencoding ( ) <EOL> def run ( * args , ** kw ) : <EOL> p = Popen ( stdout = PIPE , stderr = PIPE , shell = True , * args , ** kw ) <EOL> out , err = p . communicate ( ) <EOL> ret = p . poll ( ) <EOL> if ret : <EOL> cmd = kw . get ( '<STR_LIT:args>' ) <EOL> if cmd is None : <EOL> cmd = args [ <NUM_LIT:0> ] <EOL> if out : <EOL> out = out . decode ( default_encoding ) <EOL> out = out . rstrip ( '<STR_LIT:\n>' ) <EOL> return ret , out <EOL> def to_clipboard ( s ) : <EOL> '''<STR_LIT>''' <EOL> try : <EOL> from . pyperclip import copy <EOL> except : <EOL> raise Exception ( '<STR_LIT>' ) <EOL> copy ( s ) <EOL> def shorten_hashes ( res , length = <NUM_LIT:7> ) : <EOL> for key in '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:object>' , '<STR_LIT>' , '<STR_LIT>' : <EOL> if key in res and isinstance ( res [ key ] , basestr ) : <EOL> res [ key ] = res [ key ] [ : length ] </s>
