<s> import spotipy <EOL> import sys <EOL> import pprint <EOL> if len ( sys . argv ) > <NUM_LIT:1> : <EOL> artist_name = sys . argv [ <NUM_LIT:1> ] <EOL> else : <EOL> artist_name = '<STR_LIT>' <EOL> sp = spotipy . Spotify ( ) <EOL> result = sp . search ( q = '<STR_LIT>' + artist_name , type = '<STR_LIT>' ) <EOL> try : <EOL> name = result [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ <NUM_LIT:0> ] [ '<STR_LIT:name>' ] <EOL> uri = result [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ <NUM_LIT:0> ] [ '<STR_LIT>' ] <EOL> related = sp . artist_related_artists ( uri ) <EOL> print ( '<STR_LIT>' , name ) <EOL> for artist in related [ '<STR_LIT>' ] : <EOL> print ( '<STR_LIT:U+0020>' , artist [ '<STR_LIT:name>' ] ) <EOL> except : <EOL> print ( "<STR_LIT>" ) </s>
