<commit_before>from nazs.core.models import Model
from nazs.network.util import getifaddrs

from django.db import models
from django.utils.translation import ugettext as _


class Interface(Model):
    """
    Network Interfaces, both physical and virtual
    """

    # Only manage system interfaces matching this filter
    NAME_FILTER = ('eth', 'wlan')

    ETHERNET = 'ethernet'

    TYPE_CHOICES = (
        (ETHERNET, _('Ethernet')),
    )

    UNCONFIGURED = 'notset'
    STATIC = 'static'
    DHCP = 'dhcp'

    MODE_CHOICES = (
        (UNCONFIGURED, _('Unconfigured')),
        (STATIC, _('Static')),
        (DHCP, _('DHCP')),
    )

    # Interface name (eth0, eth0:1 br0, etc..)
    name = models.CharField(max_length=10)

    # Type (ethernet, vlan, bridge...)
    type = models.CharField(choices=TYPE_CHOICES,
                            max_length=10,
                            default=ETHERNET)

    # Mode (dhcp, static, bridged...)
    mode = models.CharField(choices=MODE_CHOICES,
                            max_length=10,
                            default=UNCONFIGURED)

    # IP Address (Ignored in DHCP)
    address = models.GenericIPAddressField(protocol='IPv4',
                                           null=True,
                                           blank=True)

    # Netmask (Ignored in DHCP)
    netmask = models.GenericIPAddressField(protocol='IPv4',
                                           null=True,<commit_msg>Interface name is not editable<commit_after>from nazs.core.models import Model
from nazs.network.util import getifaddrs

from django.db import models
from django.utils.translation import ugettext as _


class Interface(Model):
    """
    Network Interfaces, both physical and virtual
    """

    # Only manage system interfaces matching this filter
    NAME_FILTER = ('eth', 'wlan')

    ETHERNET = 'ethernet'

    TYPE_CHOICES = (
        (ETHERNET, _('Ethernet')),
    )

    UNCONFIGURED = 'notset'
    STATIC = 'static'
    DHCP = 'dhcp'

    MODE_CHOICES = (
        (UNCONFIGURED, _('Unconfigured')),
        (STATIC, _('Static')),
        (DHCP, _('DHCP')),
    )

    # Interface name (eth0, eth0:1 br0, etc..)
    name = models.CharField(max_length=10, editable=False)

    # Type (ethernet, vlan, bridge...)
    type = models.CharField(choices=TYPE_CHOICES,
                            max_length=10,
                            default=ETHERNET)

    # Mode (dhcp, static, bridged...)
    mode = models.CharField(choices=MODE_CHOICES,
                            max_length=10,
                            default=UNCONFIGURED)

    # IP Address (Ignored in DHCP)
    address = models.GenericIPAddressField(protocol='IPv4',
                                           null=True,
                                           blank=True)

    # Netmask (Ignored in DHCP)
    netmask = models.GenericIPAddressField(protocol='IPv4',
                                           null=True,
{'fraction_non_alphanumeric': 0.1036936631650288, 'fraction_numerical': 0.008132836326668925, 'mean_word_length': 1.8494208494208495, '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': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6502163', 'n_tokens_mistral': 899, 'n_tokens_neox': 838, 'n_words': 190}