<commit_before>import mimetypes
import uuid
from pygments import highlight
from pygments.lexers import guess_lexer_for_filename
from pygments.formatters import HtmlFormatter
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.core.validators import URLValidator
from subdomains.utils import reverse
from .utils import url_hash_from_pk


class Media(models.Model):
    MEDIA_TYPES = (
        ("IMG", "Image"),
        ("URL", "Link"),
        ("TXT", "Text"),
        ("ARC", "Archive"),
        ("AUD", "Audio"),
        ("VID", "Video"),
        ("ETC", "Other")
    )

    MEDIA_TYPES_PLURAL = (
        ("IMG", "Images"),
        ("URL", "Links"),
        ("TXT", "Text"),
        ("ARC", "Archives"),
        ("AUD", "Audio"),
        ("VID", "Video"),
        ("ETC", "Other")
    )

    _random_filename = lambda i, f: str(uuid.uuid4()) + "/" + f

    url_hash = models.CharField(max_length=100, blank=True)
    name = models.CharField(max_length=500)
    target_url = models.URLField(max_length=2048, blank=True)
    target_file = models.FileField(upload_to=_random_filename, blank=True)
    view_count = models.IntegerField(default=0)
    upload_date = models.DateTimeField(auto_now_add=True)
    user = models.ForeignKey(User)
    media_type = models.CharField(max_length=3, choices=MEDIA_TYPES, blank=True)
    syntax_highlighted = models.TextField(blank=True)

    # all prefixed by "application/"
    ARCHIVE_MIME_TYPES = ["x-cpio",
                          "x-shar",
                          "x-tar",
                          "x-bzip2",
                          "x-gzip",
                          "x-lzip",
                          "x-lzma",<commit_msg>Remove dashes from uuids<commit_after>import mimetypes
import uuid
from pygments import highlight
from pygments.lexers import guess_lexer_for_filename
from pygments.formatters import HtmlFormatter
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.core.validators import URLValidator
from subdomains.utils import reverse
from .utils import url_hash_from_pk


class Media(models.Model):
    MEDIA_TYPES = (
        ("IMG", "Image"),
        ("URL", "Link"),
        ("TXT", "Text"),
        ("ARC", "Archive"),
        ("AUD", "Audio"),
        ("VID", "Video"),
        ("ETC", "Other")
    )

    MEDIA_TYPES_PLURAL = (
        ("IMG", "Images"),
        ("URL", "Links"),
        ("TXT", "Text"),
        ("ARC", "Archives"),
        ("AUD", "Audio"),
        ("VID", "Video"),
        ("ETC", "Other")
    )

    _random_filename = lambda i, f: str(uuid.uuid4()).replace("-", "") + "/" + f

    url_hash = models.CharField(max_length=100, blank=True)
    name = models.CharField(max_length=500)
    target_url = models.URLField(max_length=2048, blank=True)
    target_file = models.FileField(upload_to=_random_filename, blank=True)
    view_count = models.IntegerField(default=0)
    upload_date = models.DateTimeField(auto_now_add=True)
    user = models.ForeignKey(User)
    media_type = models.CharField(max_length=3, choices=MEDIA_TYPES, blank=True)
    syntax_highlighted = models.TextField(blank=True)

    # all prefixed by "application/"
    ARCHIVE_MIME_TYPES = ["x-cpio",
                          "x-shar",
                          "x-tar",
                          "x-bzip2",
                          "x-gzip",
                          "x-lzip",
                          "x-lzma",
{'fraction_non_alphanumeric': 0.13180592991913748, 'fraction_numerical': 0.007547169811320755, 'mean_word_length': 2.578592092574735, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5496099', 'n_tokens_mistral': 1183, 'n_tokens_neox': 1147, 'n_words': 244}