Whoever, being or expecting to be a public servant, accepts or obtains, agrees to accept, or attempts to obtain from any person, for himself or for any other person, any gratification whatever, other than legal remuneration, as a motive or reward for doing or forbearing to do any official act or for showing or forbearing to show, in the exercise of his official functions, favour or disfavour to any person, or for rendering or attempting to render any service or disservice to any person, with the Federal, or any Provincial Government or Legislature or with any public servant, as such, shall be punished with imprisonment of either description for a term which may extend to three years or with fine or with both.