<s> import os <EOL> import subprocess <EOL> def in_path ( name ) : <EOL> """<STR_LIT>""" <EOL> for dirname in os . environ [ '<STR_LIT>' ] . split ( os . pathsep ) : <EOL> if os . path . exists ( os . path . join ( dirname , name ) ) : <EOL> return True <EOL> return False <EOL> def npm_exists ( name ) : <EOL> """<STR_LIT>""" <EOL> cwd = os . getcwd ( ) <EOL> path = os . path . join ( cwd , '<STR_LIT>' , '<STR_LIT>' , name ) <EOL> return os . path . exists ( path ) <EOL> def composer_exists ( name ) : <EOL> """<STR_LIT>""" <EOL> cwd = os . getcwd ( ) <EOL> path = os . path . join ( cwd , '<STR_LIT>' , '<STR_LIT>' , name ) <EOL> return os . path . exists ( path ) <EOL> def bundle_exists ( name ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> installed = subprocess . check_output ( [ '<STR_LIT>' , '<STR_LIT:list>' ] ) <EOL> except subprocess . CalledProcessError or OSError : <EOL> return False <EOL> return name in installed </s>
