Deuteronomy.
Chapter 17.
You must not sacrifice to Yahweh your God an ox or a sheep in which is any blemish or anything bad, for that would be an abomination to Yahweh your God. 
If there is found among you, within any of your city gates that Yahweh your God is giving you, any man or woman who does what is evil in the sight of Yahweh your God and transgresses his covenant, 
anyone who has gone and worshiped other gods and bowed down to them, either the sun, the moon, or any of the host of heaven—nothing that I have commanded— 
and if you are told about this, or if you have heard of it, then you must make a careful investigation. If it is true and certain that such an abomination has been done in Israel, this is what you should do. 
You must bring that man or woman, who has done this evil thing, to your city gates, that very man or woman, and you must stone that person to death. 
At the mouth of two witnesses, or three witnesses, will he who must die be put to death; but at the mouth of only one witness he must not be put to death. 
The hand of the witnesses must be the first to put him to death, and afterward the hand of all the people; and you will remove the evil from among you. 
If a matter arises that is too hard for you to judge—perhaps a question of murder or accidental death, of one person's right and another person's right, or a question of one kind of harm done, or another kind of matter, matters of controversy within your city gates—then you must go up to the place that Yahweh your God will choose as his sanctuary. 
You must go to the priests, the descendants of Levi, and to the judge who will be serving at that time; you will seek their advice, and they will give you the verdict. 
You must follow the law given to you at the place Yahweh will choose as his sanctuary. You will be careful to do everything that they direct you to do. 
Follow the law they teach you, and do according to the decisions they give you. Do not turn aside from what they tell you, to the right hand or to the left. 
Anyone who acts arrogantly, in not listening to the priest who is standing to serve before Yahweh your God, or in not listening to the judge—that man will die; you will put away the evil from Israel. 
All the people must hear and fear, and act arrogantly no more. 
When you have come to the land that Yahweh your God gives you, and when you take possession of it and begin to live in it, and then you say, 'I will set a king over myself, like all the nations that are round about me,' 
then you must surely set as king over yourself someone whom Yahweh your God will choose. You must set as king over yourself someone from among your brothers. You may not put a foreigner, who is not your brother, over yourself. 
But he must not multiply horses for himself, nor cause the people to return to Egypt so that he may multiply horses, for Yahweh had said to you, 'You will never return that way again.' 
He must not take many wives for himself, so that his heart does not turn away. He must not accumulate large amounts of silver and gold. 
When he sits on the throne of his kingdom, he must write for himself in a scroll a copy of this law, from the law that is before the priests, who are Levites. 
The scroll must be with him, and he must read in it all the days of his life, so that he may learn to honor Yahweh his God, so as to keep all the words of this law and these statutes, to observe them. 
He must do this so that his heart is not lifted up above his brothers, and so that he does not turn away from the commandments, to the right hand or to the left; for the purpose that he may prolong his days in his kingdom, he and his children, among Israel. 
