<commit_before>module Gql::Runtime
  module Functions
    module Update

      def TIME_SERIE_VALUE(*keys)
        converter_id, time_curve_key, year = keys.flatten
        scope.graph.time_curves[converter_id.to_i][time_curve_key.to_sym][year.to_i] rescue nil
      end

      # Run multiple (update) queries.
      #
      # @example Multiple UPDATE statements inside one input
      #   EACH(
      #     UPDATE( foo, ... ),
      #     UPDATE( bar, ... )
      #   )
      #
      def EACH(*value_terms)
        value_terms.each do |value_term|
          value_term
        end
      end




      # == Remark about default_unit<commit_msg>Updated TIME_SERIE_VALUE to allow 2 or 3 arguments.<commit_after>module Gql::Runtime
  module Functions
    module Update

      # Lookup a named time series value by year.
      #
      # @example
      #     TIME_SERIE_VALUE(gas_reserves, 2030)
      #
      # @example useage in inputs with USER_INPUT()
      #     TIME_SERIE_VALUE(gas_reserves,USER_INPUT())
      #
      def TIME_SERIE_VALUE(*keys)
        keys = keys.flatten
        # TODO: make this method generic and indepenent from how many parameters are passed.
        if keys.length == 2
          time_curve_key, year = keys
          scope.graph.time_curves[time_curve_key.to_sym][year.to_i] rescue nil
        else
          converter_id, time_curve_key, year = keys
          scope.graph.time_curves[converter_id.to_i][time_curve_key.to_sym][year.to_i] rescue nil
        end
      end

      # Run multiple (update) queries.
      #
      # @example Multiple UPDATE statements inside one input
      #   EACH(
      #     UPDATE( foo, ... ),
      #     UPDATE( bar, ... )
      #   )
      #
      def EACH(*value_terms)
        value_terms.each do |value_term|
          value_term
        end
      end




      # == Remark about default_unit
{'fraction_non_alphanumeric': 0.08436324556689952, 'fraction_numerical': 0.0037614185921547557, 'mean_word_length': 1.983974358974359, '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': '3301439', 'n_tokens_mistral': 609, 'n_tokens_neox': 567, 'n_words': 136}