Skip to content

Instantly share code, notes, and snippets.

@tripulse
Last active October 4, 2020 05:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tripulse/d86fff1507252f896c681d7d939f0274 to your computer and use it in GitHub Desktop.
Save tripulse/d86fff1507252f896c681d7d939f0274 to your computer and use it in GitHub Desktop.
Guru Rajashekhar style upvote generator (^^^^^^^^^^*$&$*&*#$&)
from random import choice, choices
def upvote(upvote = '^',
numbers = '93475100809635819407912381031',
others = '~!@#$%^&*()`{}|":?><][;/.,',
weights = [0.2, 0.75, 0.05]):
"""Generate Guru Rajshekhar style upvotes.
:param upvote: a character representing upvote
:param numbers: random numbers (possibly phone numbers)
:param others: other characters for decorating output
:param weights: relative weights for [upvote, numbers, others],
these are parameters for probability distribution
"""
upvote = str(upvote)[:1] or '^'
numbers = str(numbers) or '^' # guru rajashekhar nambar
others = str(others) or '^'
weights = [*map(float, weights)] # convert to float implicitly
while True:
yield choice(choices((upvote, numbers, others), weights)[0])
@telugu-boy
Copy link

br mek numbars m0r likeli

@telugu-boy
Copy link

'-'

@telugu-boy
Copy link

''
"

_

@tripulse
Copy link
Author

tripulse commented Oct 4, 2020

Guru rajasekhar master. Number....
Call 9347510080

@tripulse
Copy link
Author

tripulse commented Oct 4, 2020

br mek numbars m0r likeli

occ '-' done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment