<commit_before>#include <object/date.hh>
#include <object/global.hh>

namespace object
{
  /*---------------.
  | Construction.  |
  `---------------*/

  Date::Date()
  {
    proto_add(proto ? proto : Object::proto);
    time_t time;
    ::time(&time);
    split(time);
  }

  Date::Date(time_t time)
  {
    proto_add(proto ? proto : Object::proto);
    split(time);
  }

  Date::Date(rDate time)
    : stamp_(time)
    , year_(time->year_)
    , month_(time->month_)
    , day_(time->day_)
    , hour_(time->hour_)
    , min_(time->min_)
    , sec_(time->sec_)
  {
    CAPTURE_GLOBAL(Orderable);
    proto_add(Orderable);
    proto_add(proto);
  }

  void
  Date::init(const objects_type& args)
  {
    check_arg_count(args.size(), 0, 1);

    if (!args.empty())
      split(from_urbi<unsigned>(args[0]));
    else
    {
      time_t time;
      ::time(&time);
      split(time);
    }
  }

  void
  Date::split(time_t time)
  {
    struct tm date;
    localtime_r(&time, &date);
    stamp_ = time;<commit_msg>Style changes.<commit_after>#include <object/date.hh>
#include <object/global.hh>

namespace object
{
  /*---------------.
  | Construction.  |
  `---------------*/

  Date::Date()
  {
    proto_add(proto ? proto : Object::proto);
    split(time(0));
  }

  Date::Date(time_t time)
  {
    proto_add(proto ? proto : Object::proto);
    split(time);
  }

  Date::Date(rDate time)
    : stamp_(time)
    , year_(time->year_)
    , month_(time->month_)
    , day_(time->day_)
    , hour_(time->hour_)
    , min_(time->min_)
    , sec_(time->sec_)
  {
    CAPTURE_GLOBAL(Orderable);
    proto_add(Orderable);
    proto_add(proto);
  }

  void
  Date::init(const objects_type& args)
  {
    check_arg_count(args.size(), 0, 1);

    if (!args.empty())
      split(from_urbi<unsigned>(args[0]));
    else
      split(time(0));
  }

  void
  Date::split(time_t time)
  {
    struct tm date;
    localtime_r(&time, &date);
    stamp_ = time;
{'fraction_non_alphanumeric': 0.19588688946015423, 'fraction_numerical': 0.004113110539845758, 'mean_word_length': 2.4688057040998217, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 21, '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': '4779968', 'n_tokens_mistral': 728, 'n_tokens_neox': 714, 'n_words': 110}