Skip to content

Commit

Permalink
minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
haoyueping authored Jul 7, 2023
1 parent e7e9c12 commit 97ddd5b
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions ppref/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,6 @@
from scipy.stats import kendalltau


def send_email(subject=None, body=None):
subject = subject or 'Running experiment'

current_time = datetime.now().strftime("%Y-%m-%d %H:%M")
body = body or f'Experiment result at {current_time}'

s_from = '[email protected]'
s_to = '[email protected]'

email_text = f'From: {s_from}\nTo: {s_to}\nSubject: {subject}\n\n{body}'

with smtplib.SMTP_SSL('smtp.gmail.com', 465) as server:
server.ehlo()
server.login(s_from, 'pYmail--4--exp')
server.sendmail(s_from, s_to, email_text)
server.close()

print('Email sent!')


def normalize_weights(weights: Sequence[float]) -> Union[List[float], ndarray]:
"""These weights should add up to 1, so that they are a distribution."""
weight_sum = sum(weights)
Expand Down

0 comments on commit 97ddd5b

Please sign in to comment.