
139 Cal.App.3d 906 (1983)
189 Cal. Rptr. 105
THE PEOPLE, Plaintiff and Appellant,
v.
LANCE ROBERT UNDERWOOD, Defendant and Respondent.
Docket No. 14469.
Court of Appeals of California, Fourth District, Division Two.
February 14, 1983.
*908 COUNSEL
Dennis Kottmeier, District Attorney, and Joseph A. Burns, Deputy District Attorney, for Plaintiff and Appellant.
Charles E. Ward, Public Defender, Littleton M. Gunn and James M. Dorr, Deputy Public Defenders, for Defendant and Respondent.
OPINION
KNOX, J.[*]
Defendant Lance Robert Underwood was charged with a single count of forgery (Pen. Code, § 470). The complaint was dismissed by the municipal court because a live lineup had not been held before the preliminary hearing. The People then sought reinstatement of the felony complaint through a motion under section 871.5 of the Penal Code. The People appeal the superior court's denial of their motion to reinstate the complaint.

PROCEDURAL FACTS
A felony charge of forgery, section 470 of the Penal Code, was filed on September 30, 1981, in the San Bernardino County Municipal Court District, Central Division. On October 27, 1981, defendant appeared in the municipal court, not in custody, had the public defender appointed to represent him and was released on his own recognizance. The matter was set for prepreliminary hearing on November 4 and for preliminary hearing on November 6, 1981. On November 4, the prepreliminary hearing was continued to November 19, 1981, and the preliminary hearing to November 23.
On November 19, defendant moved for a live lineup over the district attorney's objection. After arguments by the parties, the magistrate stated that he thought a lineup should properly be ordered and he found that a lineup could resolve the identification question. He then continued the case to December 2 for further proceedings before Judge Isaeff regarding the lineup issue.
During the course of the special proceedings before her on December 2, Judge Isaeff took extensive testimony, heard arguments, and announced certain findings continuing the matter further to December 14 for further proceedings in the lineup issue. The preliminary hearing date was reset for January 7, 1982, at that time.
*909 On December 14, 1981, Judge Isaeff heard additional evidence and arguments from counsel and ordered that a lineup be held before the preliminary hearing would be allowed to take place.
On January 7, 1982, the case was continued to January 8 and on that date the complaint was dismissed by reason of the fact that a lineup had not been held.
On January 18, 1982, the People filed a motion pursuant to Penal Code section 871.5 to compel reinstatement of a dismissed complaint. The matter was heard by the superior court on February 10 and on the same day the court denied the People's motion finding that the lower court in dismissing the case had not abused its discretion. The People appeal the superior court's denial of their motion to reinstate.

STATEMENT OF FACTS
Defendant Lance Robert Underwood made a timely request for a live lineup on November 19, 1981, before Municipal Court Judge John Kennedy. Concerning the issue of identity, counsel for the defendant by way of an offer of proof, stated that the incident in question involved a transaction of short duration where a bank teller had accepted a forged document. A handwriting analysis of the forged document compared to the defendant's handwriting was inconclusive. In addition, defense counsel was in possession of a statement made under penalty of perjury from a witness who could testify to the fact that the defendant's hair was cut very closely at the time the check was passed. A photograph of the defendant selected by the teller from a photographic lineup showed the defendant with long hair. The teller had not seen or known the defendant before the alleged offense.
The district attorney argued that the defendant had already been identified through a photographic lineup. In addition, the check had been stolen from the defendant's uncle and written on his account at a time when the defendant had access to his uncle's house and could have obtained his account number. At the close of his argument, the district attorney stated, "And also it would be the burden of  as we're still going through with these motions  of conducting an out-of-custody line-up." The court responded, "Well, I think  the second part I really don't think I should fairly consider in deciding the threshold question of whether I think under Evans[1] a line-up should properly be ordered, and I do think that it should be properly ordered. So I'll find for the record that a line-up will be  could be  could resolve the identification question.
*910 "And now as far as the second half of it, the out-of-custody part of it, would it be suggested that I put this on Judge Isaeff's calendar on December second?"
The case was then assigned to a different magistrate, Judge Isaeff, for further proceedings on how to handle the "out-of-custody" part of it.
Before the defendant presented his lineup motion to Judge Kennedy on November 19, 1981, special lineup proceedings had been held in Judge Isaeff's department on November 2 and 3 in other cases involving similar out-of-custody lineup issues. The special lineup proceedings were an outgrowth of the San Bernardino County Sheriff's policy of not conducting lineups for out-of-custody defendants notwithstanding meritorious lineup motions. At these proceedings extensive testimony was taken including testimony from a representative of the sheriff's department, the district attorney, and a representative from the San Bernardino Police Department relative to the burdens involved in conducting out-of-custody lineups. The testimony in these hearings on November 2 and 3 was incorporated by stipulation into the record for the People's section 871.5 motion before the superior court.
At the time of the December 2 special proceedings on the out-of-custody lineup issue, the court heard further testimony and then made the following findings at the conclusion of the hearing: (1) that the court could not properly order the sheriff to conduct the lineups; (2) that there was an equal protection problem because of the fact that in-custody defendants are afforded lineups in meritorious cases but out-of-custody defendants are not; and (3) the Evans case states that it is the defendant's right to have a pretrial lineup in an appropriate case. Notwithstanding the district attorney's repeated requests, the court specifically declined to make a finding relative to the burdens that an out-of-custody lineup would place on the prosecution, the People and the police. The court continued the matter to December 14 to enable the defendant himself to make an effort to come up with a suitable group of lineup look-alikes who would be willing to take part in a lineup.
On December 14 after hearing still additional testimony on the lineup question the court made an order that a pretrial lineup must be held before a preliminary hearing could take place. The court again specifically declined to make a finding on the burden issue stating that that issue had already necessarily been decided by the lineup judge before she had received the case.[2] The court *911 assumed that the judge who had heard the original lineup motion on November 19 had considered the requirements of the Evans case and in so doing had decided first, that the defendant was entitled to a lineup, and second, had dealt with the question of whether or not the benefits to be derived from the accused would outweigh the burden on the prosecution, police and witnesses of conducting an out-of-custody lineup. The court's view was that it was not deciding whether or not a lineup would occur, only how it should take place. On January 8, 1982, a lineup had not been held and since the statutory time had only been waived to that date, the complaint was dismissed pursuant to section 859b of the Penal Code.

PEOPLE'S CONTENTIONS
The People urge that (1) the special hearing magistrate's order prohibiting a preliminary hearing until a live lineup had been conducted was error as a matter of law in that it was based upon the mistaken belief that a lineup motion had in fact been granted and because the order lacked specificity and was arbitrary. They further contend (2) that assuming that a lineup motion had been granted the court committed error amounting to an abuse of discretion because neither magistrate properly considered the burden on the prosecution; and (3) the order granting the lineup was improper because the prosecution was not in a position to compel an out-of-custody lineup.

DISCUSSION
(1a) The broad question we are called upon to decide here is whether or not the superior court ruled properly in denying the People's motion to reinstate their complaint.
(2a) Initially it should be noted that in permitting a People's appeal from an adverse ruling on a Penal Code section 871.5 motion "The only ground for *912 the motion shall be that, as a matter of law, the magistrate erroneously dismissed the action...." (Pen. Code, § 871.5.)[3]
Thus, in deciding whether or not the superior court ruled properly we must determine if the magistrate in dismissing the case erred as a matter of law. The magistrate dismissed the complaint because a live lineup had not been held in accordance with the court order.
(3) In considering the question of whether the magistrate erred as a matter of law we note at the outset that the lower court ruling must be upheld if supported by substantial evidence and the evidence must be viewed in a light most favorable to the respondent. (People v. Lawler (1973) 9 Cal.3d 156, 160 [107 Cal. Rptr. 13, 507 P.2d 621].) Moreover, the court stated further in People v. Butler (1980) 104 Cal. App.3d 868, 878, fn. 2 [162 Cal. Rptr. 913], that "When a finding of fact is attacked on the ground that there is no substantial evidence to sustain it, the power of an appellate court begins and ends with the determination as to whether there is any substantial evidence, contradicted or uncontradicted, which will support the finding of fact. [Citations.]" (Quoting Green Trees Enterprises, Inc. v. Palm Springs Alpine Estates, Inc. (1967) 66 Cal.2d 782, 784-785 [59 Cal. Rptr. 141, 427 P.2d 805]; original italics.)
(1b) The superior court in denying the People's motion to reinstate found that there was no abuse of discretion by the lower court in dismissing the action.[4] (4) In this light, we first address the People's initial contention that the *913 dismissal order was error because the lineup motion had never been granted. They urge that the dismissal of the case was error as a matter of law because it was mistakenly assumed that a valid court order had previously been made for a live lineup by Judge Kennedy. The People argue that the very language of Judge Kennedy's order of November 19 indicates that the court only intended to make a finding on the threshold question of whether or not a live lineup would be appropriate given the facts of the case; that it was manifestly the court's intent to pass the lineup issue on to a second magistrate for resolution and for consideration of whether or not the burden on the prosecution outweighed the benefits to be derived by the accused.
Defendant, in arguing that the court did grant the motion, asserts that the record shows that Judge Kennedy did not make the order contingent upon any other finding or ruling and that there was no indication that his ruling was preliminary or that the final decision would await the outcome of any future hearing. That further, no future decision on the burden question was necessarily contemplated by the fact that future proceedings were to be held. While not a paragon of clarity, we feel that the superior court could have reasonably concluded from what was said that the judge intended to grant the lineup motion and did grant the motion.
(2b) We next consider the People's contention that, assuming that the court did grant the defendant's lineup motion, the court's order was fatally defective because the burden on the People of conducting such a lineup was not considered by the magistrate as required by the Evans case. In Evans, prior to his prosecution for robbery and other offenses, the defendant moved that he be accorded the right to be identified pursuant to a live lineup. The court there, although indicating that in the interest of fair play the motion should be granted, denied it on the ground that the court lacked the discretion to order the People to conduct such a lineup. On defendant's application, the Supreme Court issued a writ of mandate directing the trial court to vacate its order denying the motion and to proceed in accordance with their opinion. The court held: "We conclude in view of the foregoing that due process requires in an appropriate case that an accused, upon timely requests therefor, be afforded a pretrial lineup in which witnesses to the alleged criminal conduct can participate. The right to a lineup arises, however, only when eyewitness identification is shown to be a material issue and there exists a reasonable likelihood of a mistaken identification which a lineup would tend to resolve." (Evans v. Superior Court, supra, 11 Cal.3d at p. 625; fn. omitted.)
The court went on to say that "The questions whether eyewitness identification is a material issue and whether fundamental fairness requires a lineup in a *914 particular case are inquiries which necessarily rest for determination within the broad discretion of the magistrate or trial judge. [Citation.] We do not hold, accordingly, that in every case where there has not been a pretrial lineup the accused may, on demand, compel the People to arrange for one. Rather, as in all due process determinations, the resolution here to be made is one which must be arrived at after consideration not only of the benefits to be derived by the accused and the reasonableness of his request but also after considering the burden to be imposed on the prosecution, the police, the court and the witnesses." (Ibid., italics added.)
There is no contention that the motion was not timely made. Neither do the People contend on appeal that identification was not a material issue or that there was not a reasonable likelihood of mistaken identification under the facts. They do contend, and we feel correctly, that neither magistrate followed the mandate in the Evans decision in failing to consider the burden issue as set forth in the last paragraph of that holding.
Since two orders are involved we first consider the order of Judge Isaeff of December 14 ordering that a live lineup take place before the preliminary hearing could be held. The People contend that the record clearly indicates that the court expressly declined to consider the burden issue. As indicated in the Statement of Facts, ante, it was the court's understanding that pursuant to the Evans decision it was the province of the court granting the lineup motion to consider the burden issue. We conclude from a reading of the colloquy between counsel and the court[5] on that date that Judge Isaeff did not weigh the burdens of conducting a lineup as against the benefits to be derived by the accused as set forth in Evans.
We next consider the original lineup order granted by Judge Kennedy on November 19. The defendant argues that defense counsel did raise the burden issue at that time and that Judge Kennedy, at least impliedly, must have considered the issue before making his ruling. He asserts that Judge Kennedy was aware of the ongoing problem that existed with the San Bernardino Sheriff's Department in conducting out-of-custody lineups and knew of the special lineup proceedings already under way in Judge Isaeff's court. That he further was aware of the Evans decision, and therefore the language in the Evans decision, noting "parenthetically" that "The burden on the police is a nominal one, as the facilities, resources and other individuals who may be used in conducting a lineup are generally available. The procedure is one which uniquely falls within police expertise and routine practices." (Id., at pp. 625-626.) The defense argues that given the facts confronting the court it is reasonable to conclude that *915 the court went through the thought process of weighing the burdens as known to him at that time versus the obvious benefits to be derived by the defendant.
The People respond by asserting that this conclusion is faulty because of the affirmative statements made by the court at the time of its ruling expressly declining to consider the burden issue.[6] We concur that the only reasonable inference to be drawn from the record is that Judge Kennedy deferred the burden issue to Judge Isaeff for her resolution. Judge Isaeff, on the other hand, operating under the mistaken belief that Judge Kennedy had considered that issue in his originial granting of the motion, did not consider that issue.
Having concluded that neither judge went through the required weighing process, we next consider whether or not this omission constituted an abuse of discretion. In light of the holding in Evans we feel that it did. The rationale for affording a defendant a live lineup in appropriate cases is one of fundamental due process and as Evans pointed out "[A]s in all due process determinations, the resolution here to be made is one which must be arrived at after consideration not only of the benefits to be derived by the accused ... but also after considering the burden to be imposed on the prosecution...." (Id., at p. 625; italics added.)
Since we reverse on the basis indicated we do not consider the People's final contention that had the magistrate considered the facts presented on the burden issue it would have been error to grant the lineup motion as a matter of law. This issue is one that must be resolved by the magistrate in the exercise of sound discretion.
We do point out, however, that in considering the burden on the prosecution it would be incorrect to assume the magistrate lacks authority to order the sheriff to conduct a lineup. An out-of-custody defendant is either on bail or O.R. and has a right to surrender himself or herself to the proper custodial authority. In fact the defendant here offered to do just that. In addition, for good cause a magistrate has the authority to order a defendant into temporary custody for purposes of a lineup. As soon as the defendant is in custody the magistrate may order the custodial officer to conduct a lineup. If the custodial officer should refuse to comply, the superior court is empowered to issue a peremptory writ of mandate compelling obedience to the order. The right to a pretrial lineup is, as noted, based on due process considerations and no custodial officer may refuse to conduct an ordered lineup on the basis of inconvenience or undue expense. It is the magistrate, not the custodial officer, to whom the balancing of need versus burden is committed.
*916 Since the magistrate's order dismissing the complaint herein was based on Judge Kennedy's order granting the lineup motion, having found that the granting of that motion was an abuse of discretion, we finally conclude that the order of dismissal was error as a matter of law. (1c) The superior court's ruling is therefore reversed with directions to reinstate the complaint against the defendant.
Morris, P.J., and Kaufman, J., concurred.
NOTES
[*]   Assigned by the Chairperson of the Judicial Council.
[1]  Referring to Evans v. Superior Court (1974) 11 Cal.3d 617 [114 Cal. Rptr. 121, 522 P.2d 681].
[2]  "Mr. Burns: Does Your Honor's line-up order today imply that you have considered the benefits to be derived by the defendant, the accused, from a line-up, and the reasonableness of his request for one, in that you have also considered the burden such a line-up order may impose upon the prosecution, the police, the Court and the witnesses, and that you have found that the former are such as to overcome the latter?

"The Court: Mr. Burns, I think that that is one of the decisions you have to address yourself to when you're initially making a determination of whether or not the defendant has a right to have a line-up. If I'm reading that case correctly. Therefore, if that is true, then this Court did not reach that particular language in the case, because that was already decided before this Court got the case.
"In other words, this Court did not decide that a line-up must happen. This Court was trying to decide how should the line-up take place? Do you understand what I'm saying, Mr. Burns?
"Mr. Burns: Yes, I do. I believe, Your Honor. Do I correctly state the fact then that by stating that your Honor did not make the weighing or the reasonableness and benefit to the defendant versus the burdens on the People in announcing the order you've made today?
"The Court: Only insofar as determining how the line-up should proceed. But this Court did not consider those two items in determining whether a line-up should be held.
"Mr. Burns: I think I understand it.
"The Court: Okay."
[3]  Insofar as it is relevant herein, section 871.5 reads:

"When an action ... is dismissed by a magistrate pursuant to [Pen. Code] Section 859b [which, inter alia, requires holding of preliminary examination within 10 days of arraignment or plea unless the defendant waives his speedy preliminary hearing right or good cause for a continuance is found] ..., the prosecutor may make a motion in the superior court within 10 days to compel the magistrate to reinstate the complaint.... The only ground for the motion shall be that, as a matter of law, the magistrate erroneously dismissed the action.... [Par.] The superior court shall hear and determine the motion on the basis of the record of the proceedings before the magistrate. If the motion is litigated to decision by the prosecutor, the prosecution is prohibited from refiling the dismissed action, or portion thereof....
".... .... .... .... .... ...
"Pursuant to paragraph (9) of subdivision (a) of [Pen. Code] Section 1238 the people may take an appeal from the denial of the motion by the superior court to reinstate the complaint...."
[4]  "I guess here we are concerned what happened down below, what considerations were given to the case, how it was handled, whether it was error of such magnitude on the part of the magistrate that would require this Court to overrule it.

"I would state I don't agree with the conclusions reached by the magistrate or magistrates in this case. In looking it over, I would have to come to a conclusion and a finding that the lineup was properly refused on the basis that the sheriff didn't have that facility.
"But I think, on the other hand, that when you take the whole proceeding as a whole with Judge Kennedy and Judge Isaeff, and all of the considerations, four different hearings, four different transcripts, transcripts involving testimony of parties who, while they may not have been parties of record, were at least represented by counsel  and that included the Sheriff's Office  I think that I cannot say there was abuse of discretion."
[5]  See footnote 2.
[6]  See Statement of Facts.
