717 F.2d 466
Weldon WIGGINS, Plaintiff,v.COUNTY OF ALAMEDA;  Lynn Dyer, Sheriff, and Board ofSupervisors of the County of Alameda, et al., Defendants.Weldon WIGGINS, Petitioner,v.DEPARTMENT OF CORRECTIONS OF the STATE OF CALIFORNIA,Respondent-Appellant,andUnited States of America and United States Marshals'Service, Real Parties in Interest-Appellees.
Nos. 82-4531, 82-4532.
United States Court of Appeals,Ninth Circuit.
Argued and Submitted May 12, 1983.Decided Aug. 18, 1983.

Paul D. Gifford, Deputy Atty. Gen., San Francisco, Cal., for respondent-appellant.
Linda Jan S. Pack, Dept. of Justice, Washington, D.C., for real parties in interest-appellees.
Appeal from the United States District Court for the Northern District of California.
Before PECK,* FLETCHER, and PREGERSON, Circuit Judges.
PER CURIAM:


1
This is an appeal by the Department of Corrections of the State of California (State) from an order of United States Magistrate requiring the department to transport, guard, and pay all expenses associated with securing the presence of Weldon Wiggins, a state prison inmate, at the trial of his federal civil rights suit against the County of Alameda, see Weldon Wiggins v. County of Alameda, Nos. 82-4399 & 82-4400 (9th Cir. appeal filed Sept. 16, 1982).  On appeal, the State argues that the district court abused its discretion by requiring the State to bear the costs of securing Wiggins' presence at his trial in federal court.


2
* JURISDICTION


3
Both parties assert that this court has jurisdiction to hear the State's appeal.  Generally, an appeal to this court from a judgment entered in a case tried by consent before a magistrate is authorized in those situations in which an appeal would have been authorized if the judgment had been entered by a district court.  See 28 U.S.C. Sec. 636(c)(3) (Supp. IV 1980).  Under 28 U.S.C. Sec. 1291 (1976), the court of appeals has jurisdiction over all "final decisions of the district courts."    The parties suggest that the magistrate's order appealed from in this case would be reviewable under section 1291 and the collateral order doctrine of Cohen v. Beneficial Industrial Loan Corp., 337 U.S. 541, 69 S.Ct. 1221, 93 L.Ed. 1528 (1949), even though it is not a final judgment on the merits of Wiggins' civil rights suit.  They seek to characterize the appeal as an interlocutory appeal on an issue collateral to the underlying suit against the County of Alameda.


4
In Story v. Robinson, 689 F.2d 1176 (3d Cir.1982), the Third Circuit considered a similar interlocutory appeal by the Commonwealth of Pennsylvania.  In that case, the district court had ordered the Commonwealth to bear a part of the costs of housing and transporting to federal court a state prisoner who was the plaintiff in a federal civil suit.  The Third Circuit determined that it had jurisdiction of the Commonwealth's appeal, reasoning as follows:


5
The orders appealed from were entered in a pending civil action which has not yet resulted in a final judgment.  The Commonwealth contends, however, that the order from which it appeals is a final order within 28 U.S.C. Sec. 1291.  Since it fully resolves a dispute between the Commonwealth and the United States Marshal Service, ... it is a final order collateral to the main action.   Cohen v. Beneficial Loan Corp., 337 U.S. 541 [69 S.Ct. 1221, 93 L.Ed. 1528] (1949)....    Thus [the appeal is] properly before us.


6
Id. at 1177-78;  see also Coopers & Lybrand v. Livesay, 437 U.S. 463, 468, 98 S.Ct. 2454, 2457, 57 L.Ed.2d 351 (1978);  Ballard v. Spradley, 557 F.2d 476, 479 (5th Cir.1977).  The magistrate's order of Sept. 8, 1982, in this case, resolved finally the State's efforts to avoid the costs associated with securing Wiggins' presence at the trial of his civil rights action.  Such an allocation of costs to the State was completely collateral to the issues raised in the underlying civil rights suit.  Under these circumstances, we agree with the decision of the Third Circuit in Story that the order is a collateral order under Cohen and hold that we have jurisdiction to hear the State's appeal under section 636(c)(3).

II

7
ALLOCATION OF COSTS UNDER A WRIT OF HABEAS CORPUS AD TESTIFICANDUM


8
The State argues that the magistrate abused his discretion when he ordered the State to bear all of the expenses associated with securing the presence of Wiggins, the State prisoner-plaintiff, at the trial of Wiggins' federal civil rights suit.  The State argues that, even if the magistrate determined correctly that Wiggins' testimony was necessary, the allocation to the State of all the costs of providing this testimony, rather than dividing the costs between the State and the United States, was an abuse of discretion.1


9
The Third Circuit's decision in Story v. Robinson provides an accurate guide for analysis of this question.2   In Story, the State appealed from a district court order requiring it to produce, at its own expense, a state prisoner called as a witness in a federal civil rights trial.  The district court ordered the State to produce the witness at the state detention center closest to the federal courthouse.  The United States was to be responsible for transporting the prisoner from the state facility to the federal court and back.  689 F.2d at 1177.  The State argued that it could not be required to pay the costs of transporting the state prisoner to the closest state facility.  The Third Circuit rejected the State's argument.  It reasoned that federal statutes authorized the district court writ and order and that no federal statute required the United States to bear the costs of compliance with the writ or authorized reimbursement to the State for the costs it had incurred.  The court considered and rejected arguments by the State that various federal statutes pertaining to the duties of federal marshals, including 28 U.S.C. Secs. 567(2), 569(a), 569(b), & 571, required the United States either to transport and guard the prisoner or to reimburse the State for the costs of securing the prisoner's attendance in federal court.  689 F.2d at 1179-80.


10
We agree with the reasoning in Story.    Where there is no statutory authority requiring the United States to transport and guard a prisoner called as a witness by a validly issued federal writ or authorizing reimbursement to the state for the costs of compliance with such a writ, then there is no basis upon which the state can seek compensation for its expenses.


11
Ballard v. Spradley does not compel a contrary conclusion.  In Ballard, the Fifth Circuit did approve an allocation of costs between state and federal security agencies, but it stated:


12
We expressly reject the Marshals Service's contention that the interests of Florida so outweigh those of the federal government that Florida should be required to bear complete responsibility for the prisoners' transportation.  The rights invoked are federal in nature, and prisoners' habeas and writ rights actions play an equal, vital role of "importance in our constitutional scheme...."


13
Id. at 481 (quoting Wolff v. McDonnell, 418 U.S. 539, 577, 94 S.Ct. 2963, 2985, 41 L.Ed.2d 935 (1974)).  We do not believe this language compels the conclusion that the magistrate in the instant case abused his discretion in allocating to the State of California all of the costs associated with bringing Wiggins to testify at the trial of his civil suit.  We can find no authority for the proposition, implicit in the Fifth Circuit's language, that the question of who should pay for a state prisoner's presence is to be determined by reference to the varying interests of the parties that may be held responsible for these costs.  Instead, the proper inquiry is whether Congress, which authorized district courts to issue writs of habeas corpus ad testificandum, ever authorized reimbursement for the costs of compliance with a writ.  We have not found any such Congressional authorization, nor has appellant cited to us a statute that would authorize reimbursement.  Enactment of a statute, compliance with which will require a state or entity to incur costs, does not in itself create a right to reimbursement.  We conclude that a district court judge has the discretion to allocate the costs of compliance with a writ ad testificandum in any number of combinations.  These combinations include the clearly preferable sharing of costs approved in Ballard and Story as well as imposing full costs on the United States, see 28 U.S.C. Secs. 567(2), 569(b), or, as in the instant case, imposing the full costs on the state.


14
We decry the inability of state and federal officials to resolve such matters fairly and equitably, but we have been cited no authority to support a holding that the magistrate abused his discretion in issuing the order imposing on the State all costs of bringing plaintiff Wiggins into court to testify at the trial of his civil rights suit.


15
AFFIRMED.



*
 Hon. John W. Peck, Senior United States Circuit Judge, sitting by designation


1
 The district court's power to issue a writ of habeas corpus ad testificandum to secure the testimony of a state prisoner witness is beyond dispute.   See Ballard v. Spradley, 557 F.2d 476, 480 (5th Cir.1977).  In Ballard v. Spradley, the Fifth Circuit discussed the factors which should guide a district court in determining whether to issue the writ to bring a state prisoner witness into federal court
When determining whether it should issue a writ of habeas corpus ad testificandum in such instances, the district court must exercise its discretion based upon consideration of such factors as whether the prisoner's presence will substantially further the resolution of the case, the security risks presented by the prisoner's presence, the expense of the prisoner's transportation and safekeeping, and whether the suit can be stayed until the prisoner is released without prejudice to the cause asserted.
577 F.2d at 480.  The magistrate here explicitly relied on these factors in determining whether to issue the ad testificandum writ to secure Wiggins' presence at the trial of his civil rights suit.  Since the State does not argue the magistrate erred in his determination that the benefits of Wiggins' presence and testimony at the trial of his civil rights suits justified issuance of an ad testificandum writ, the narrow question presented on this appeal is whether the magistrate abused his discretion in allocating to the State, a non-party, the costs of securing Wiggins' attendance at trial, once the magistrate had determined that a writ of habeas corpus ad testificandum should be issued for Wiggins.


2
 We do not find Ford v. Carballo, 577 F.2d 404 (7th Cir.1978), an appropriate guide.  In Ford, the Seventh Circuit concluded that the district court's authority to issue the challenged writ was to be found only in 28 U.S.C. Sec. 1651(a) (All Writs Act).  From this premise, the court proceeded to decide the case before it by analogy to cases decided under Sec. 1651(a).  These cases hold that the power of the federal courts to issue writs under Sec. 1651(a) extends only to writs which do not impose unreasonable burdens on nonparties.   See, e.g., United States v. New York Telephone Co., 434 U.S. 159, 172, 98 S.Ct. 364, 372, 54 L.Ed.2d 376.  We believe, however, that the Seventh Circuit was mistaken in looking solely to the cases decided under section 1651(a) for guidance in evaluating a writ of habeas corpus ad testificandum.    The ad testificandum writ is specifically and independently authorized by 28 U.S.C. Sec. 2241(c)(5).  Thus, the principles developed under Sec. 1651(a), including the rule of New York Telephone, do not control review of the instant writ


