def explore(self, student_summary=[], professors_list=[], search_papers=10, return_papers=3): if professors_list == []: professors_list = self.preProcessor.read_authors_from_file() if student_summary == []: # TODO: return an error message student_summary = ["student work is empty !"] oas = OverAllSimilarity(student_summary=student_summary) resmerg = ResultMerger() for author in tqdm(professors_list): # retrieving an author articles from arxiv. config in arxivsearch resp = self.ArxivSearch.fetch_articles_by_author( author, max_results=search_papers) # TODO: check response status # new professor prof = Professor(author) # pars arxiv response for each professor prof.pars_arxiv_response(resp['entries']) # export professors only summary per article professor_articles_summaries = prof.export_articles_summaries_list( ) # calculate over all similarity along with a list of each article similarity professor_similarities = oas.calculate_overall_similarity( professor_articles_summaries) # adding list of similarities to each professors article list prof.parse_similarity_list(professor_similarities) # adding the completed professor object to result merger object resmerg.append_professor(prof) # printing resultMerger final results return resmerg.export_final_json(return_papers)
def scrape_professor(school_name, faculty_url, extracts_title, extracts_name, extracts_cv_url = None, extracts_personal_url = None, extracts_gscholar_url = None, extracts_papers = None): """ :return: a Professor object or None if it's not a tenure track faculty """ tree = get_tree(faculty_url) if tree is None: return None job_title = strip_whitespace(extracts_title(tree)) if job_title is None: print("WARNING: job title not found on "+faculty_url) return None if not title_is_tenure_track(job_title): return None name = extracts_name(tree) cv_link = None if extracts_cv_url is None else extracts_cv_url(faculty_url, tree) personal_url = None if extracts_personal_url is None else extracts_personal_url(faculty_url, tree) google_scholar_url = None if extracts_gscholar_url is None else extracts_gscholar_url(faculty_url, tree) prof = Professor(name=name, title=job_title, cv_url=cv_link, school=school_name, faculty_directory_url=faculty_url, personal_url=personal_url, google_scholar_url=google_scholar_url) if extracts_papers is not None: paper_list_url, papers = extracts_papers(faculty_url, tree) # save paper list to disk if paper_list_url and papers and len(papers) > 0: prof.paper_list_url = paper_list_url save_paper_list('paper_list', prof, papers) return prof
def test_confirmacao_matricula(): aluno = Aluno('Lucas', 1701419) turma = Turma('Tecnologia Web') matricula = Matricula(aluno, turma) professor = Professor('Professor', 1) assert professor.confirmar_matricula(matricula) == False
def excluirProfessor(self): prof = Professor() prof.idprofessor = self.txtidprofessor.get() self.lblmsg["text"] = prof.deleteProfessor() self.txtidprofessor.delete(0, END) self.txtnome.delete(0, END) self.txtcpf.delete(0, END) self.txtdepartamento.delete(0, END)
def create_all_profs(self, classes): for c in classes: professor = c['professor'] professor_id = professor['id'] matched = False for p in self.professors: if professor_id == p.get_id(): matched = True if matched == False: self.professors.append( Professor(professor['first_name'], professor['last_name'], professor['id']))
def profSearch(self, profid): cursor = self._connection.cursor() stmtStr = 'SELECT profs.name, profs.email, profs.bio, profs.pic_links FROM profs WHERE profs.prof_id = %s' cursor.execute(stmtStr, (profid, )) rows = cursor.fetchall() for row in rows: name = row[0] contact = row[1] bio = row[2] picLink = row[3] areas = [] projects = [] titles = [] links = [] stmtStr = 'SELECT areas.area FROM areas WHERE areas.prof_id = %s' cursor.execute(stmtStr, (profid, )) areas = cursor.fetchall() if len(areas) == 0: areas = 'No research areas found.' stmtStr = 'SELECT projects.title FROM projects WHERE projects.prof_id = %s' cursor.execute(stmtStr, (profid, )) projects = cursor.fetchall() if len(projects) == 0: projects = 'No projects found.' stmtStr = 'SELECT past_theses.title, past_theses.link FROM past_theses WHERE past_theses.prof_id = %s' cursor.execute(stmtStr, (profid, )) rows = cursor.fetchall() for row in rows: titles.append(row[0]) links.append(row[1]) if contact == 'NaN': contact = 'No contact provided.' if bio == 'NaN': bio = 'No bio provided.' if len(titles) == 0: titles = 'This advisor has no previous works advised.' links = '' cursor.close() professor = Professor(name, bio, areas, projects, titles, links, contact, picLink) return professor
def inserirProfessor(self): prof = Professor() prof.nome = self.txtnome.get() prof.cpf = self.txtcpf.get() prof.departamento = self.txtdepartamento.get() self.lblmsg["text"] = prof.insertProfessor() self.txtidprofessor.delete(0, END) self.txtnome.delete(0, END) self.txtcpf.delete(0, END) self.txtdepartamento.delete(0, END)
def alterarProfessor(self): prof = Professor() prof.idprofessor = self.txtidprofessor.get() prof.nome = self.txtnome.get() prof.cpf = self.txtcpf.get() prof.departamento = self.txtdepartamento.get() self.lblmsg["text"] = prof.updateProfessor self.txtidprofessor.delete(0, END) self.txtnome.delete(0, END) self.txtcpf.delete(0, END) self.txtdepartamento.delete(0, END)
def buscarProfessor(self): prof = Professor() idprofessor = self.txtidprofessor.get() self.lblmsg["text"] = prof.selectProfessor(idprofessor) self.txtidprofessor.delete(0, END) self.txtidprofessor.insert(INSERT, prof.idprofessor) self.txtnome.delete(0, END) self.txtnome.insert(INSERT, prof.nome) self.txtcpf.delete(0, END) self.txtcpf.insert(INSERT, prof.cpf) self.txtdepartamento.delete(0, END) self.txtdepartamento.insert(INSERT, prof.departamento)
def main(): student1 = Student('Anty', 20) student1.accept_task(1) student1.accept_task(2) student1.accept_task(3) student2 = Student('Mary', 14) student1.age += 1 student2.name = 'Alice' student2.accept_test(12) student1.accept_test(7) student1.print_info() student2.print_info() pprint(student1.__dict__) professor1 = Professor('Dr.Who', 30) professor1.print_info()
def profResults(): prof = Professor('', '', '', '', '', '', '', '') profid = request.args.get('profid') database = Database() database.connect() prof = database.profSearch(profid) database.disconnect() titles = prof.getTitles() links = prof.getLinks() pic = prof.getPicLink() html = render_template('profpage.html', profid = profid, prof = prof, pic = pic, titles = titles, links = links) response = make_response(html) return(response)
def main(): student1 = Student('Ivan', 18) print(type(student1), id(student1)) student2 = Student('Mariya', 18) print(type(student2), id(student2)) #student1.name = 'Ivan Ivanov' #student1.age = 18 print(student1.name, student1.age) student1.age += 1 print(student1.name, student1.age) print(student2.name, student2.age) student2.name = 'Alice' print(student2.name, student2.age) student1.accept_task(1) student1.accept_task(3) student1.accept_task(5) student1.print_info() student2.accept_test(12) student2.print_info() # print(type(Student)) # # pp(student1.__dict__) # student1.__dict__['name'] = 'IVAN' # print(student1.name) # # pp(Student.__dict__) prof1 = Professor('Dr. Who', 42) prof1.salary = 1000 prof1.print_info() print(prof1) print(prof1.salary)
from professor import Professor from disciplina import Disciplina from aluno import Aluno p1 = Professor(nome='pablo', email='pablo', ra=12, celular=9999) d1 = Disciplina(nome='lp2', cargaHoraria=80, mensalidade=100, professor=p1) a = Aluno(nome='pablo', email='pablo', ra='123', celular='0999999', desconto=50) a.adicionaDisciplina(d1) a.diminuirDesconto(25) print(a.retornaValorMensalidade()) print(a.retornaCargaHoraria())
from professor import Professor from course_uni import Course from student import Student professor1 = Professor(1, 'John') professor2 = Professor(2, 'Robert') professor3 = Professor(3, 'Angela') professor4 = Professor(4, 'Jimmy') professor5 = Professor(5, 'Ravi') professor6 = Professor(6, 'Joe') English = Course(1, 'English') Artificial_Intelligence = Course(2, 'Artificial Intelligence') Machine_Learning = Course(3, 'Machine Learning') Ethical_Hacking = Course(4, 'Ethical Hacking') Javascript = Course(5, 'Javascript') Physics = Course(6, 'Physics') Calculus = Course(7, 'Calculus') student_1 = Student(100, 'Cynthia', 'Brook') student_2 = Student(101, 'Keith', 'Brewer') student_3 = Student(102, 'Mehmet', 'Faulkner') student_4 = Student(103, 'Anabel', 'Molloy') student_5 = Student(104, 'Macy', 'Clark') student_6 = Student(105, 'Aisha', 'Berger') student_7 = Student(106, 'Niall', 'Farrington') student_8 = Student(107, 'Beulah', 'Esparza') student_9 = Student(108, 'Dorsey', 'Montgomery') student_10 = Student(109, 'Felicia', 'Ward')
def addProfessor(self, first, last, dob, phonenumber, address, salary): _professor = Professor(self, first, last, dob, phonenumber, address, salary) self.professors.append(_professor) return _professor
from sala import Sala from aluno import Aluno from professor import Professor a1 = Aluno("Wellington", "Sistemas", 9456839, "3245-0090", "*****@*****.**") a2 = Aluno("Dani", "Sistemas", 9456839, "3245-0090", "*****@*****.**") a3 = Aluno("Thomaz", "Licenciatura em Computação", 9456839, "3245-0090", "*****@*****.**") p = Professor("Alex Zissou", "3245-6788", "*****@*****.**") alunos = [a1, a2, a3] professores = [p] sala = Sala("19", "IEGA", professores, alunos, 2) def test_criar_sala(): assert sala.quantidade_chaves == 2 def test_imprimir_dados(): assert sala.imprimir_dados() == 0
from disciplina import Disciplina from professor import Professor from alunos import Aluno p1 = Professor(nome='Fernando', ra='123456') p2 = Disciplina(nome='LP2', cargaHoraria=80, mensalidade=200, professor=p1) p1.adicionaDisciplina(p2) al = Aluno(nome='alvaro', email='*****@*****.**', ra='1701718', celular='11952210677', desconto=10) al.adicionaDisciplina(p2) al.adicionaDisciplina( Disciplina(nome='LP3', cargaHoraria=40, mensalidade=120, professor=p1)) print(al.retornaCargaHoraria()) print(al.retornaValorMensalidade())
except NoSuchElementException: # this is probably a working paper continue match = re.findall( r"\"(.*)\"", citation) # article titles are inside quotes if len(match) == 0: # this is a book, which we don't record continue title = match[0] papers.append( Paper(title=title, authors=authors, venue=venue, year=year, scholar_citations=r['scholar_citations'], wos_citations=r['wos_citations'], id=r['citation_id'])) return papers if __name__ == '__main__': # for some reason, running this in the IDE requires me to set the geckodriver path with GoogleScholar('/usr/local/bin/geckodriver') as scholar: print( scholar.scrape_profile( 'https://scholar.google.com/citations?user=a1ngrCIAAAAJ&hl=en') ) print( scholar.scrape_search_results( Professor(school='Northwestern', name='Nabil Al-Najjar')))
from professor import Professor p = Professor("abc", "m", ["python", "hadoop"]) p.display_details() p1 = Professor("def", "m", []) p1.display_details()
#!/usr/bin/env python # -*- coding: utf-8 -*- from person import Person from student import Student from professor import Professor pe = Person("person1") st = Student("student1", 15) pr = Professor("professor1") pe.info() st.info() pr.info()
def adicionar_professor(self,nome,telefone, email): p = Professor(nome,telefone,email) self.lista_professores.append(p)
from student import Student from professor import Professor class PhotoSession: def take_photo(individual): if not (isinstance(individual, Student) or isinstance(individual, Professor)): print("Cannot take photo") else: print("Name : {0}\tGender : {1} has clicked a photo".format( individual.name, individual.gender)) if isinstance(individual, Student): print("Roll no : {0}".format(individual.rollno)) if __name__ == '__main__': p = Professor(name='Ekta', gender='F', subjects=["Maths", "French"]) PhotoSession.take_photo(p) s = Student("ABC", 1, "M", 98) PhotoSession.take_photo(s) PhotoSession.take_photo(5)
from professor import Professor from student import Student from contact import Contact from person import Person # p = Person(name='mehul', gender='m') # cannot do that! p1 = Professor(name='mehul chopra', gender='m', subjects=['Maths', 'Programming'],\ contact=Contact(email='*****@*****.**', mobile='0987907907')) ''' 1) RAM 90345 2) Professor.__init__(90345, name, gender, subjects) ''' s1 = Student(name='jane', gender='f', roll=10, marks=90) s1.giveAttendance() p1.giveAttendance() '''print(p1.getEmail()) print(p1.getMobile()) print(s1.getEmail())''' # print(s1.getPrettyDetails()) # print(p1.getPrettyDetails()) # print(p1.name) '''Professor and Student objects belong to a common category of people in the college. They share common properties (name, gender) '''
from address import Address from course import Course from enroll import Enroll from professor import Professor from student import Student address = Address('Korea', "KB", "Daegu", "Bukgu", "754023 ") std = Student('P', 'SC', 1974, '010-123', address) professor = Professor('SC', 'Park', 1974, '010-223', address, 8000) course = Course('Python', 'p12', 200, 30, professor) enroll = Enroll(std, course)
from professor import Professor name=input("\nEnter the name of professor : ") gender=input("Gender : ") subject=input("Subject : ") print("---------Details---------") p=Professor(name,gender,subject) #p is object p.displayDetails()
print("{} consegue fazer os seguintes truques: {}".format( domestico.nome, domestico.truques)) print("{} consegue fazer os seguintes truques: {}".format( farejador.nome, farejador.truques)) # É possível criar um novo atributo na instância de uma classe, mesmo que não tenha # sido declarado previamente na classe pessoa.animal = domestico # Porém, o objeto 'outraPessoa' não terá o atributo 'animal'. print(pessoa.nome + " tem um cachorro chamado " + pessoa.animal.nome) print("------------") prof = Professor("Jota", {'123': 'Sinais', '456': 'Programação'}) print(prof) print("------------") prof.matricula = "76080-1" # todos atributos são públicos por definição print(prof) print("------------") profa = Professor("Juteide", {'444': 'Algébra', '433': 'Web'}, "12345-6") print(profa) print(profa.listarDisciplinas()) print("------------")
from student import Student from professor import Professor from photosession import takephoto s1 = Student(name='mehul', gender='m', roll=10, marks=90) # Student.__init__(4003, name='mehul', gender='m', roll=10, marks=90) p1 = Professor(name='fatih', gender='m', subjects=['Physics', 'Maths'], contactnos=['9879897', '9878686878']) # Professor.__init__(4005, name='fatih', gender='m', subjects=['Physics','Maths']) # print(s1.name) # print(p1.name) # print(s1.getdetails()) # Student.getdetails(s1) # print(p1.getdetails()) # Professor.getdetails(p1) name = 'mehul' print(name) # print(name.__str__()) print(p1) print(s1) # print(p1.__str__()) takephoto(s1)
student1.print_info() student2.print_info() student3.print_info() # pprint.pprint(Student.__dict__) # pprint.pprint(student1.__dict__) student1.__dict__['name'] = 'William' print(student1.__dict__['name']) print(student1.name) print( '====================================================================================' ) print('NEW') print( '====================================================================================' ) pr1 = Professor('Donald Knuth', 42) pr1.print_info() pr1.salary = 1000 pr1.print_info() print(pr1.groups) # # print(pr1.get_group()) pr1._groups = ["Math", "CS", "ML", "AI"] # print(pr1.get_group()) print(pr1.group) print(student1.__str__()) student_str = str(student1) print(student_str)
student3 = Student('Kaung3', 'Oo', '5_10_1993', '1234', address1, international=True) student4 = Student('Kaung4', 'Oo', '5_10_1993', '1234', address1, international=True) prof1_addr = Address('US', 'FL', 'Orlando', '99 Lake Street', '043432') prof1 = Professor('Kong', 'King', '5_10_1887', '4321', prof1_addr, 80e3) course1 = Course('Intro ECE', 'ECE101', 6, 2, prof1) prof1.add_course(course1) enroll_course(student1, course1) enroll_course(student2, course1) enroll_course(student3, course1) enroll_course(student4, course1) enroll_course(student4, course1) enroll_course(student4, course1)
elif op == 2: if ip < 2: clear() name = input("Digite o nome da pessoa: ") phone = input("Digite o telefone: ") email = input("Digite o email: ") course = int(input("Digite o curso: ")) salary = int(input("Digite o numero de salario: ")) print("Digite o dia de ingresso: ") ano = int(input("digite o ano")) mes = int(input("digite o mes")) dia = int(input("digite o dia")) sd = [ano, mes, dia] c = [name, email, phone, email, course, sd] professor.append(c) p = Professor(name, phone, email, course, salary, sd) delta = p.work_days(sd, s) s.append(delta) salar = p.additional_health_hazard(salary, course) pa.append(salar) ip = ip + 1 else: print("Professores maximos cadastrados") elif op == 3: clear() opc = int( input( "Digite qual opção que deseja ver :\n1- Para estudantes\n2-Para professores\nEscolhe logo porra: " )) if opc == 1: