def filter_section_bears_by_languages(bears, languages):
 new_bears = {}
 languages = (set((language.lower() for language in languages)) | {'all'})
 for section in bears.keys():
  new_bears[section] = tuple((bear for bear in bears[section] if ({language.lower() for language in bear.LANGUAGES} & languages)))
 return new_bears

def filter_section_bears_by_languages ( bears , languages ) : new_bears = { } languages = ( set ( ( language . lower ( ) for language in languages ) ) | { 'all' } ) for section in bears . keys ( ) : new_bears [ section ] = tuple ( ( bear for bear in bears [ section ] if ( { language . lower ( ) for language in bear . LANGUAGES } & languages ) ) ) return new_bears
filters the bears by languages .