<commit_before><?php

/**
 * This file is part of the DigitalOceanV2 library.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace DigitalOceanV2\Entity;

/**
 * @author <NAME> <<EMAIL>>
 */
class Droplet extends AbstractEntity
{
    /**
     * @var integer
     */
    public $id;

    /**
     * @var string
     */
    public $name;

    /**
     * @var Region
     */
    public $region;

    /**
     * @var Image
     */
    public $image;

    /**
     * @var Kernel
     */
    public $kernel;

    /**
     * @var Size
     */
    public $size;

    /**
     * @var boolean
     */
    public $locked;

    /**
     * @var string
     */
    public $createdAt;

    /**
     * @var string
     */
    public $status;

    /**
     * @var Network[]
     */
    public $networks;

    /**
     * @var integer[]
     */
    public $backupIds;

    /**
     * @var integer[]
     */
    public $snapshotIds;

    /**
     * @var integer[]
     */
    public $actionIds;

    /**
     * @param \stdClass|array $parameters
     */
    public function build($parameters)
    {
        foreach ($parameters as $property => $value) {
            switch ($property) {
                case 'networks':
                    foreach ($value->v4 as $subProperty => $subValue) {
                        $this->networks[] = new Network($subValue);
                    }

                    foreach ($value->v6 as $subProperty => $subValue) {
                        $this->networks[] = new Network($subValue);
                    }
                    break;

                case 'kernel':
                    $this->kernel = new Kernel($value);
                    break;

                case 'size':
                    $this->size = new Size($value);
                    break;
<commit_msg>Fixes bug #16<commit_after><?php

/**
 * This file is part of the DigitalOceanV2 library.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace DigitalOceanV2\Entity;

/**
 * @author <NAME> <<EMAIL>>
 */
class Droplet extends AbstractEntity
{
    /**
     * @var integer
     */
    public $id;

    /**
     * @var string
     */
    public $name;

    /**
     * @var Region
     */
    public $region;

    /**
     * @var Image
     */
    public $image;

    /**
     * @var Kernel
     */
    public $kernel;

    /**
     * @var Size
     */
    public $size;

    /**
     * @var boolean
     */
    public $locked;

    /**
     * @var string
     */
    public $createdAt;

    /**
     * @var string
     */
    public $status;

    /**
     * @var Network[]
     */
    public $networks;

    /**
     * @var integer[]
     */
    public $backupIds;

    /**
     * @var integer[]
     */
    public $snapshotIds;

    /**
     * @var integer[]
     */
    public $actionIds;

    /**
     * @param \stdClass|array $parameters
     */
    public function build($parameters)
    {
        foreach ($parameters as $property => $value) {
            switch ($property) {
                case 'networks':
                    if($value->v4){
                        foreach ($value->v4 as $subProperty => $subValue) {
                            $this->networks[] = new Network($subValue);
                        }
                    }
                    if($value->v6){
                        foreach ($value->v6 as $subProperty => $subValue) {
                            $this->networks[] = new Network($subValue);
                        }
                    }
                    break;

                case 'kernel':
                    $this->kernel = new Kernel($value);
                    break;

                case 'size':
                    $this->size = new Size($value);
                    break;

{'fraction_non_alphanumeric': 0.13736402732102201, 'fraction_numerical': 0.0030356691120667846, 'mean_word_length': 1.2414965986394557, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 35, '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': '1035664', 'n_tokens_mistral': 1151, 'n_tokens_neox': 1090, 'n_words': 276}