<commit_before><?php

/**
 * Copyright 2014 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

namespace Saber\Math\Vector {

	use \Saber\Core;
	use \Saber\Data\Double;
	use \Saber\Data\Int32;
	use \Saber\Data\Real;
	use \Saber\Data\Vector;

	final class Module extends Core\Module {


		#region Methods -> Object Oriented -> Numeric Operations

		/**
		 * This method returns the average of all elements in the list.
		 *
		 * @access public
		 * @static
		 * @param Vector\Type $xs                                   the vector to be processed
		 * @return Double\Type                                      the result
		 */
		public static function average(Vector\Type $xs) {
			if ($xs->__isEmpty()) {
				return Double\Type::zero();
			}
			return Double\Module::divide(static::sum($xs), $xs->length()->toDouble());
		}

		/**
		 * This method returns the product of all elements in the list.
		 *
		 * @access public
		 * @static
		 * @param Vector\Type $xs                                   the vector to be processed
		 * @return Double\Type                                      the result
		 */
		public static function product(Vector\Type $xs) {
			if ($xs->__isEmpty()) {
				return Double\Type::one();
			}
			return Double\Module::multiply($xs->head()->toDouble(), static::product($xs->tail()));
		}

		/**
		 * This method returns the sum of all elements in the list.
		 *
		 * @access public
		 * @static
		 * @param Vector\Type $xs                                   the vector to be processed
		 * @return Double\Type                                      the result
		 */
		public static function sum(Vector\Type $xs) {
			if ($xs->__isEmpty()) {
				return Double\Type::zero();
			}
			return Double\Module::add($xs->head()->toDouble(), static::sum($xs->tail()));
		}

		#endregion

	}

}<commit_msg>Removed unneeded region.<commit_after><?php

/**
 * Copyright 2014 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

namespace Saber\Math\Vector {

	use \Saber\Core;
	use \Saber\Data\Double;
	use \Saber\Data\Int32;
	use \Saber\Data\Real;
	use \Saber\Data\Vector;

	final class Module extends Core\Module {

		/**
		 * This method returns the average of all elements in the list.
		 *
		 * @access public
		 * @static
		 * @param Vector\Type $xs                                   the vector to be processed
		 * @return Double\Type                                      the result
		 */
		public static function average(Vector\Type $xs) {
			if ($xs->__isEmpty()) {
				return Double\Type::zero();
			}
			return Double\Module::divide(static::sum($xs), $xs->length()->toDouble());
		}

		/**
		 * This method returns the product of all elements in the list.
		 *
		 * @access public
		 * @static
		 * @param Vector\Type $xs                                   the vector to be processed
		 * @return Double\Type                                      the result
		 */
		public static function product(Vector\Type $xs) {
			if ($xs->__isEmpty()) {
				return Double\Type::one();
			}
			return Double\Module::multiply($xs->head()->toDouble(), static::product($xs->tail()));
		}

		/**
		 * This method returns the sum of all elements in the list.
		 *
		 * @access public
		 * @static
		 * @param Vector\Type $xs                                   the vector to be processed
		 * @return Double\Type                                      the result
		 */
		public static function sum(Vector\Type $xs) {
			if ($xs->__isEmpty()) {
				return Double\Type::zero();
			}
			return Double\Module::add($xs->head()->toDouble(), static::sum($xs->tail()));
		}

	}

}
{'fraction_non_alphanumeric': 0.11712299000434594, 'fraction_numerical': 0.004345936549326379, 'mean_word_length': 2.2369901547116737, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3935446', 'n_tokens_mistral': 1417, 'n_tokens_neox': 1210, 'n_words': 435}