code: def _from_any(cls, spec):
          
          if isinstance(spec, str):
              spec = cls.from_file(spec)
          elif isinstance(spec, dict):
              spec = cls.from_dict(spec)
          elif not isinstance(spec, cls):
              raise context.TypeError("spec must be either an ApplicationSpec, "
                                      "path, or dict, got "
                                      "%s" % type(spec).__name__)
          return spec
docs: Generic creation method for all types accepted as ``spec``