When an attorney refuses to deliver over money or papers, to a person from or for whom he or she has received them in the course of professional employment, whether in an action or not, he or she may be required by an order of the court in which an action, if any, was prosecuted, or if no action was prosecuted, then by order of any judge of a court of record, to do so within a specified time, or show cause why he or she should not be punished for a contempt.