In California, parents showing signs of being unfit, i.e. using drugs, not taking proper care of their child, etc., how would one go about petitioning for temporary custody of the child in question? CPS has already been called out on one occasion. The grandparents of the child have both agreed that the parents cannot be left alone with the baby and have her at their houses every night.
Child Abuse Lawyer
The answer to your question is: "It depends...." You say CPS has already been called out. Well that can mean lots of things. Just the fact that CPS is called or comes out does not prove anything either way. What was the result of the CPS investigation if any? Why did CPS not take the child? Did CPS request a voluntary case plan or placement?
If Child Protective Services does not see a substantial risk of physical or emotional harm or neglect, then the other route in California would be to file a Probate Guardianship. Would the parents agree with this? If not, then you might need to go through a contest and be prepared to make your case.
Go to the Superior Court web site for your county, fish around a while and you will find that the Probate forms are all on-line and there should be a helpful tutorial on how to complete them and get them filed and served. In probate cases, there are tons of forms and properly noticing certain family members is essential to having the case go forward.
There will be a fee to file the Guardianship and a fee for an investigation which will need to be conducted. You can hire an attorney in your area to help you, but many families proceed without one - it depends on your situation. The most important thing is to be honest and transparent in everything you present.
Good luck and good for you for protecting your grandchild.