Except as otherwise specifically provided, the district attorney of each judicial district in the state of Colorado, and each of his assistants and deputies, shall be allowed to collect and receive from each of the counties in his district the expenses necessarily incurred in the discharge of his official duties for the benefit of such county.