<commit_before><?php
/**
 * Widget Framework
 *
 * @copyright   Copyright (c) 2008-2012 <NAME>
 * @license     http://www.opensource.org/licenses/apache2.0.php Apache License
 */

namespace Widget;

/**
 * ArrayWidget
 *
 * @package     Widget
 * @author      <NAME> <<EMAIL>>
 */
class ArrayWidget extends WidgetProvider implements \ArrayAccess, \Countable, \IteratorAggregate
{
    /**
     * The variable to store array
     *
     * @var array
     */
    protected $data = array();

    /**
     * Check if the offset exists
     *
     * @param  string $offset
     * @return bool
     */
    public function offsetExists($offset)
    {
        return isset($this->data[$offset]);
    }

    /**
     * Get the offset value
     *
     * @param  string $offset
     * @return mixed
     */
    public function offsetGet($offset)
    {
        return isset($this->data[$offset]) ? $this->data[$offset] : null;
    }

    /**
     * Set the offset value
     *
     * @param string $offset
     * @param mixed  $value
     */
    public function offsetSet($offset, $value)
    {
        return $this->data[$offset] = $value;
    }

    /**
     * Unset the offset
     *
     * @param string $offset
     */
    public function offsetUnset($offset)
    {
        unset($this->data[$offset]);
    }

    /**
     * Merge data from array
     *
     * @param  array            $array
     * @return Widget_ArrayWidget
     */
    public function fromArray(array $array = array())
    {
        $this->data = $array;

        return $this;
    }

    /**
     * Return the source array of the object
     *
     * @return array
     */
    public function toArray()
    {
        return $this->data;
    }

    /**
     * Return the length of data
     *
     * @return int the length of data
     */
    public function count()
    {
        return count($this->data);
    }

    /**
     * Returns an iterator for data
     *
     * @return \ArrayIterator
     */
    public function getIterator()
    {
        return new \ArrayIterator($this->data);
    }
}<commit_msg>added keys method for arrayWdget class<commit_after><?php
/**
 * Widget Framework
 *
 * @copyright   Copyright (c) 2008-2012 <NAME>
 * @license     http://www.opensource.org/licenses/apache2.0.php Apache License
 */

namespace Widget;

/**
 * ArrayWidget
 *
 * @package     Widget
 * @author      <NAME> <<EMAIL>>
 */
class ArrayWidget extends WidgetProvider implements \ArrayAccess, \Countable, \IteratorAggregate
{
    /**
     * The variable to store array
     *
     * @var array
     */
    protected $data = array();

    /**
     * Check if the offset exists
     *
     * @param  string $offset
     * @return bool
     */
    public function offsetExists($offset)
    {
        return isset($this->data[$offset]);
    }

    /**
     * Get the offset value
     *
     * @param  string $offset
     * @return mixed
     */
    public function offsetGet($offset)
    {
        return isset($this->data[$offset]) ? $this->data[$offset] : null;
    }

    /**
     * Set the offset value
     *
     * @param string $offset
     * @param mixed  $value
     */
    public function offsetSet($offset, $value)
    {
        return $this->data[$offset] = $value;
    }

    /**
     * Unset the offset
     *
     * @param string $offset
     */
    public function offsetUnset($offset)
    {
        unset($this->data[$offset]);
    }

    /**
     * Merge data from array
     *
     * @param  array            $array
     * @return Widget_ArrayWidget
     */
    public function fromArray(array $array = array())
    {
        $this->data = $array;

        return $this;
    }

    /**
     * Return the source array of the object
     *
     * @return array
     */
    public function toArray()
    {
        return $this->data;
    }

    /**
     * Return the length of data
     *
     * @return int the length of data
     */
    public function count()
    {
        return count($this->data);
    }

    /**
     * Returns an iterator for data
     *
     * @return \ArrayIterator
     */
    public function getIterator()
    {
        return new \ArrayIterator($this->data);
    }
    
    /**
     * Returns the data keys.
     * 
     * @return array
     */
    public function keys()
    {
        return array_keys($this->data);
    }
}
{'fraction_non_alphanumeric': 0.12788550323176362, 'fraction_numerical': 0.0046168051708217915, 'mean_word_length': 1.7633928571428572, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1044822', 'n_tokens_mistral': 1298, 'n_tokens_neox': 1279, 'n_words': 330}