Hadith.5704 - Asim ibn Humaid narrated from Muhammad ibn Qays from Abu Jafar Imam Muhammad ibn Ali Al-Baqir عليه السلام who said:
"Shurayh the judge was once sitting in his court when a woman approached him and said:
'O' judge, rule between me and my opponent.'
He (Shurayh) asked her: 'And who is your opponent?'
She replied: 'You.'
Shurayh said: 'Make way for her,' so they made space, and she entered.
He (Shurayh) asked her: 'What is your grievance?'
She said: 'I possess what belongs to men and what belongs to women.'
Shurayh said: 'The Commander of the Faithful عليه السلام rules according to how one urinates.'
She replied: 'I urinate from both, and both function together.'
Shurayh said: 'By Allah سبحانه وتعالى, I have never heard anything more astonishing than this.'
She said: 'And there is something even more astonishing.'
He asked: 'And what is that?'
She said: 'My husband had intercourse with me, and I bore him a child, and I had intercourse with my female servant, and she bore me a child.'
Shurayh struck one of his hands against the other in amazement and then went to the Commander of the Faithful عليه السلام and said:
'O' Commander of the Faithful, something has come before me that I have never heard of anything more astonishing.'
He (Shurayh) then narrated the woman's story to Imam Ali ibn Abi Talib عليه السلام.
The Commander of the Faithful عليه السلام asked the woman about it, and she confirmed it.
Imam Ali ibn Abi Talib عليه السلام asked her: 'And who is your husband?'
She replied: 'So-and-so.'
Imam Ali ibn Abi Talib عليه السلام sent for the man and asked him: 'Do you know this woman?'
He replied: 'Yes, she is my wife.'
Imam Ali عليه السلام then questioned him about what she had said, and the man confirmed it.
Imam Ali عليه السلام said to him: 'You are bolder than a lion rider for approaching her in this condition.'"
Then Imam Ali عليه السلام said: "O' Qanbar, take her into a room with a woman and count her ribs."
Her husband said: "O' Commander of the Faithful عليه السلام, I do not feel secure leaving her with a man, nor do I trust leaving her with a woman."
Imam Ali عليه السلام said: "Bring me Dinar, the eunuch," who was among the righteous people of Kufa and whom Imam Ali عليه السلام trusted.
Imam Ali ibn Abi Talib عليه السلام said to him: "O' Dinar, take her into a room, have her remove her clothing, instruct her to wrap herself with a waistcloth, and count her ribs."
Dinar did so and found that she had seventeen ribs - nine on the right side and eight on the left.
Then Imam Ali ibn Abi Talib عليه السلام dressed her in men's clothing, placed a cap on her head, gave her sandals, draped a cloak over her, and asigned her among the men.
Her husband said: "O' Commander of the Faithful عليه السلام, she is my cousin, and she has borne me a child, and now you are assigning her among the men?"
Imam Ali ibn Abi Talib عليه السلام replied: "I have ruled over her with the judgment of Allah سبحانه وتعالى, the Mighty and Majestic. Indeed, Allah سبحانه وتعالى, Blessed and Exalted, created Hawwa (Eve) from the farthest left rib of Adam, and the ribs of men are fewer, whereas the ribs of women are complete."