<commit_before>class CustomPage < Item
  key :template_name, String

  acts_as_uri :title,
              :target => :uri,
              :only_when_blank => true

  class << self
    def from_template(template = nil, *args)
      self.new(*args)
    end
  end

  def can_have_a_node?
    true
  end

  def page_template
    nil
  end

  def template
    @template ||= template_name.present? ? PageFileTemplate.new(template_name) : PageFileTemplate.default
  end

end<commit_msg>Custom page can have node if published and no node for it exists<commit_after>class CustomPage < Item
  key :template_name, String

  acts_as_uri :title,
              :target => :uri,
              :only_when_blank => true

  class << self
    def from_template(template = nil, *args)
      self.new(*args)
    end
  end

  def can_have_a_node?
    published? && node.blank?
  end

  def page_template
    nil
  end

  def template
    @template ||= template_name.present? ? PageFileTemplate.new(template_name) : PageFileTemplate.default
  end

end
{'fraction_non_alphanumeric': 0.08284600389863547, 'fraction_numerical': 0.0, 'mean_word_length': 2.775735294117647, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '3917166', 'n_tokens_mistral': 331, 'n_tokens_neox': 320, 'n_words': 86}