Each county board of supervisors may specify a rate to be charged for the care of city prisoners, which rate shall not exceed the average cost to the county of caring for one prisoner per day. In calculating this average cost, the value of the farm products used in other county institutions and in supplying the needs of paupers, incompetents, poor and indigent persons and persons incapacitated by age, disease or accident shall be deducted from the cost of maintenance, and the cost of the original investment in establishing an industrial farm shall not be included. The reasonable value of services rendered by city prisoners to the extent that such services inure to the benefit of the county shall be deducted from the average cost of caring for city prisoners. Cities may, under terms and conditions suitable to the board of supervisors, be assigned prisoners for the purposes authorized by Section 36904 of the Government Code. By mutual agreement between cities and the county, the rate may be changed from time to time.
Ca. Pen. Code § 4124