<commit_before>class Indocker::Networks::NetworkMetadataRepository
  include SmartIoC::Iocify

  bean :network_metadata_repository
  
  def put(network_metadata)
    if all.any? {|n| n.name == network_metadata.name}
      raise Indocker::Errors::NetworkAlreadyDefined, network_metadata.name 
    end

    all.push(network_metadata)
  end

  def find_by_name(name)
    network_metadata = @all.detect {|network| network.name == name.to_s}
    raise Indocker::Errors::NetworkIsNotDefined unless network_metadata

    network_metadata
  end

  def clear
    @all = []
  end

  def all
    @all ||= []
  end

  def method_missing(method)
    find_by_name(method)<commit_msg>Fix error in networks metadata repository<commit_after>class Indocker::Networks::NetworkMetadataRepository
  include SmartIoC::Iocify

  bean :network_metadata_repository
  
  def put(network_metadata)
    if all.any? {|n| n.name == network_metadata.name}
      raise Indocker::Errors::NetworkAlreadyDefined, network_metadata.name 
    end

    all.push(network_metadata)
  end

  def find_by_name(name)
    network_metadata = all.detect {|network| network.name == name.to_s}
    raise Indocker::Errors::NetworkIsNotDefined unless network_metadata

    network_metadata
  end

  def clear
    @all = []
  end

  def all
    @all ||= []
  end

  def method_missing(method)
    find_by_name(method)
{'fraction_non_alphanumeric': 0.09010989010989011, 'fraction_numerical': 0.0, 'mean_word_length': 4.059259259259259, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5558343', 'n_tokens_mistral': 441, 'n_tokens_neox': 421, 'n_words': 90}