#NEWLINE# @ staticmethod #NEWLINE# def get_tags( problem_link ) : #NEWLINE# #INDENT# url = problem_link . split ( '/' ) #NEWLINE# url = url [ 2 : ] #NEWLINE# url . insert ( 1 , 'api/contests' ) #NEWLINE# if ( len ( url ) == 4 ) : #NEWLINE# #INDENT# url . insert ( 2 , 'PRACTICE' ) #NEWLINE# #UNINDENT# url = ( 'https://' + '/' . join ( url ) ) #NEWLINE# response = get_request ( url ) #NEWLINE# if ( ( response == ( - 1 ) ) or ( response == { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) : #NEWLINE# #INDENT# return [ '-' ] #NEWLINE# #UNINDENT# t = response . json ( ) #NEWLINE# all_tags = [ ] #NEWLINE# try : #NEWLINE# #INDENT# tags = t [ 'tags' ] #NEWLINE# all_as = BeautifulSoup ( str ( tags ) ) . find_all ( 'a' ) #NEWLINE# for i in all_as : #NEWLINE# #INDENT# all_tags . append ( i . contents [ 0 ] . strip ( ) ) #NEWLINE# #UNINDENT# return all_tags #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# return all_tags