#NEWLINE# def from_department_and_password( department , password ) : #NEWLINE# #INDENT# extractor = Extractor . create ( username = ( '%s-extractor' % department . name . replace ( ' ' , '_' ) ) , email = 'extractor@example.com' , password = password ) #NEWLINE# extractor . departments . append ( department ) #NEWLINE# extractor . roles . append ( Role . create ( name = 'extractor' ) ) #NEWLINE# extractor . save ( ) #NEWLINE# envs = extractor . generate_envs ( password ) #NEWLINE# return ( extractor , envs )