<commit_before>from os.path import join
from enum import Enum
from typing import Dict, List  # NOQA

from n0core.model import Model
from n0core.model import _Dependency # NOQA


class VM(Model):
    """VM manage memory and CPU resource.

    Example:
        ```yaml
        id: 13bae4ae-67f3-456a-ab05-a217d7cf0861
        type: resource/vm/kvm
        name: hogehoge
        state: running
        arch: amd64
        vcpus: 2
        memory: 4 * 1024 * 1024 * 1024
        vnc_password: <PASSWORD>
        dependencies:
        - model:
            id: 0a0615bf-8d26-4e9f-bfbc-bbd0890fcd4f
            type: resource/nic
            name: port
            state: attached
            hw_addr: ffffffffffff
            ip_addrs:
              - 192.168.0.1
              - fd00:c2b6:b24b:be67:2827:688d:e6a1:6a3b
            dependencies:
              - model:
                  id: 0f97b5a3-bff2-4f13-9361-9f9b4fab3d65
                  type: resource/network/vlan
                  name: hogehoge
                  meta:
                    n0stack/n0core/resource/network/vlan_id: 100
                  state: up
                  bridge: nvlan0f97b5a3
                  subnets:
                  - cidr: 192.168.0.0/24
                    dhcp:
                      range: 192.168.0.1, 192.168.0.127
                      nameservers:
                        - 192.168.0.254
                      gateway: 192.168.0.254
              label: n0stack/n0core/port/network
          label: n0stack/n0core/resource/vm/attachments
        - model:
            type: resource/volume/local
            id: 486274b2-49e4-4bcd-a60d-4f627ce8c041
            state: allocated
            name: hogehoge
            size: 10gb
            url: file:///data/hoge
          label: n0stack/n0core/resource/vm/attachments
          property:
            n0stack/n0core/resource/vm/boot_priority: 1
        ```

    Label:
        n0stack/n0core/resource/vm/attachments: Attachemt resource

    Property:
        n0stack/n0core/resource/vm/boot_priority: Boot priority of volume.

    Args:
        id: UUID
        type:
        state:
        arch: CPU architecture.
        vcpus: Number of CPU cores.
        memory: Size of memory bytes.
        vnc_password: <PASSWORD>.
        meta:
        dependencies: List of dependency to
    """

    STATES = Enum("STATES", ["POWEROFF", "RUNNING", "SAVED", "DELETED"])

    def __init__(self,
                 id,              # type: str
                 type,            # type: str<commit_msg>add vm states<commit_after>from os.path import join
from enum import Enum
from typing import Dict, List  # NOQA

from n0core.model import Model
from n0core.model import _Dependency # NOQA


class VM(Model):
    """VM manage memory and CPU resource.

    Example:
        ```yaml
        id: 13bae4ae-67f3-456a-ab05-a217d7cf0861
        type: resource/vm/kvm
        name: hogehoge
        state: running
        arch: amd64
        vcpus: 2
        memory: 4 * 1024 * 1024 * 1024
        vnc_password: <PASSWORD>
        dependencies:
        - model:
            id: 0a0615bf-8d26-4e9f-bfbc-bbd0890fcd4f
            type: resource/nic
            name: port
            state: attached
            hw_addr: ffffffffffff
            ip_addrs:
              - 192.168.0.1
              - fd00:c2b6:b24b:be67:2827:688d:e6a1:6a3b
            dependencies:
              - model:
                  id: 0f97b5a3-bff2-4f13-9361-9f9b4fab3d65
                  type: resource/network/vlan
                  name: hogehoge
                  meta:
                    n0stack/n0core/resource/network/vlan_id: 100
                  state: up
                  bridge: nvlan0f97b5a3
                  subnets:
                  - cidr: 192.168.0.0/24
                    dhcp:
                      range: 192.168.0.1, 192.168.0.127
                      nameservers:
                        - 192.168.0.254
                      gateway: 192.168.0.254
              label: n0stack/n0core/port/network
          label: n0stack/n0core/resource/vm/attachments
        - model:
            type: resource/volume/local
            id: 486274b2-49e4-4bcd-a60d-4f627ce8c041
            state: allocated
            name: hogehoge
            size: 10gb
            url: file:///data/hoge
          label: n0stack/n0core/resource/vm/attachments
          property:
            n0stack/n0core/resource/vm/boot_priority: 1
        ```

    States:
        - poweroff
        - runnnig
        - saved
        - deleted

    Labels:
        n0stack/n0core/resource/vm/attachments: Attachemt resource

    Properties:
        n0stack/n0core/resource/vm/boot_priority: Boot priority of volume.

    Args:
        id: UUID
        type:
        state:
        arch: CPU architecture.
        vcpus: Number of CPU cores.
        memory: Size of memory bytes.
        vnc_password: <PASSWORD>.
        meta:
        dependencies: List of dependency to
    """

    STATES = Enum("STATES", ["POWEROFF", "RUNNING", "SAVED", "DELETED"])

    def __init__(self,
                 id,              # type: str
                 type,            # type: str
{'fraction_non_alphanumeric': 0.08280007756447547, 'fraction_numerical': 0.07446189645142524, 'mean_word_length': 1.3098969995521719, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 12, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2822705', 'n_tokens_mistral': 1838, 'n_tokens_neox': 1583, 'n_words': 336}