code: def from_spec(spec, kwargs=None):
          
          network = util.get_object(
              obj=spec,
              default_object=LayeredNetwork,
              kwargs=kwargs
          )
          assert isinstance(network, Network)
          return network
docs: Creates a network from a specification dict.