def run(): if (len(sys.argv) != 3): print("Too few/not enough arguments.") return json = sys.argv[1] lever_list = sys.argv[2] applicant = Applicant() applicant.read_from_json(json) auto_lever = Auto_Lever() lever_urls = open(lever_list, 'r').readlines() lever_failed = open('failed' + os.sep + 'lever_failed.txt', 'w') for url in lever_urls: auto_lever.load_url(url) auto_lever.load_applicant(applicant) try: response = auto_lever.run() if (response != 'success'): print(response, file=lever_failed) print() except: print("Oops! Something went wrong. Skipping URL...") print(url.strip(), file=lever_failed) lever_failed.close()
def get_applicant(self, applicantID): r = self.session.get("%sapi/Applicant/%s" % (self.url, applicantID), headers=self.headers) if r.status_code != 200: raise JSONError("Status code %s returned. Json returned: \n\n%s" % (r.status_code, r.text)) applicant_json = json.loads(json.dumps(r.text)) return Applicant(json_data=applicant_json)
def __init__(self, email: str) -> None: self.failed_email_user_id = 0 self.bot_email = email self.queue_from_bot = email self.applicant = Applicant() self.loop = asyncio.get_event_loop() self.current_appeal: Optional[dict] = None self.stop_timer = Timer(self.stop_appeal_sending, self.loop) self.captcha_solver = CaptchaSolver() self.user_captcha_text: Optional[str] = None
def create_applicants(self, scores, real_scores, ir_limit): applicants = [] for i in range(0, self.size): applicants.append( Applicant(self, scores[i], real_scores[i], ir_limit)) return applicants
self.quality = max(min(r.gauss(50, 30), 100), 1) # on a scale 0-100 self.number_to_interview = 10 * tname.openings self.observe_1 = r.gauss(1, .2) self.observe_2 = tname.observe_2 = (r.gauss(1, .1)- tname.observe_1) self.observed_1 = r.gauss(1, .2) self.observed_2 = (r.gauss(1, .1)- tname.observed_1) # based on applicant interviewed, percentage self.num_to_rank = 7 * tname.openings self.accept_range = [.7, None] # as a % [.5, 1.5] if [.7, None] then there is no upper limit #Make the list of Applicants print('Make a list of Applicants') all_applicants = [] for x in range(1, 5000): tname = 'app'+str(x) tname = Applicant() tname.name = x # Comment out the Following to use defualt tname.quality = max(min(r.gauss(50, 20), 100), 1) # on a scale 0-100 tname.observe_1 = r.gauss(1, .2) # as a percentage, Applicant error in observing the institutions quality tname.observe_2 = (r.gauss(1, .1)- tname.observe_1) tname.observed_1 = r.gauss(1, .2) # as a percentage, Institutions error (as seen) in observing the applicants quality tname.observed_2 = (r.gauss(1, .1)- tname.observed_1) # CORRECT change to observed_1 after interview default = 1 tname.applied_to_range = [.8, 1.2] # as a percentage, for example [0.8, 1.2] tname.num_applied_to = 12 # the maximum number that the applicant applies to all_applicants.append(tname) #Add Applicant to the list of Applicants # Import institution mAtch data # Make the list of Institutions print('importing institution data')
def get_applicants(cls): from applicant import Applicant return [ Applicant(raw_applicant) for raw_applicant in cls.applicants_data ]