<commit_before>Emptor
===============
A convenient check for empty collections.

EMPTOR CAVEAT
---------------------
Emptor is a hack.  It's merely a shorter expression for those who want to consider empty collections to be falsy.  Calling

  $ this._or\_ that
  
Returns the first object that's either a non-empty collection (collections are assumed if the operand responds_to :empty?) or a non-collection that's truthy (in the Colbertian sense). So:

  $ []._or\_ [1,2,3]
  # => [1,2,3]
  
  $ "yep"._or\_ [1,2,3]
  # => "yep"
  
One example of usage would be while performing an ActiveRecord find with scoping, where you'd like to return an unscoped set if the first set turns out empty. 

This:

  $ User.all.with_photos.present? ? User.all.with_photos : User.all
  
Becomes:

  $ User.all.with_photos._or\_ User.all
  
That's all, folks.

  <commit_msg>Better examples<commit_after>Emptor
===============
A convenient conditional that excludes empty objects (Enumerables, in general).

EMPTOR CAVEAT
---------------------
Emptor is a hack.  It's merely a shorter expression for those who want to consider empty collections to be falsy.  Calling

  $ this._or\_ that
  
Returns the first object that's either a non-empty collection (collections are assumed if the operand responds_to :empty?) or a non-collection that's truthy (in the Colbertian sense). So:

  $ []._or\_ [1,2,3]
  # => [1,2,3]
  
  $ "yep"._or\_ [1,2,3]
  # => "yep"
  
  $ []._or\_ []
  # => nil
  
One example of usage would be while performing an ActiveRecord find with scoping, where you'd like to return an unscoped set if the first set turns out empty. 

This:

  $ User.all.with_photos.present? ? User.all.with_photos : User.all
  
Becomes:

  $ User.all.with_photos._or\_ User.all
  
That's all, folks.

  
{'fraction_non_alphanumeric': 0.13269876819708848, 'fraction_numerical': 0.010078387458006719, 'mean_word_length': 3.1850117096018735, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '3889872', 'n_tokens_mistral': 599, 'n_tokens_neox': 569, 'n_words': 213}