<commit_before>from .default import default
from ..compiler.compile_eval import compile_eval
import re

class pixels(default):
    def _parse(self, value):
        if value is None:
            return None

        m = re.match('(.*)(px|m|u)$', value)
        if m:
            return ( m.group(1), m.group(2) )

        return ( value, 'px' )


    def compile(self, prop):
        v = self._parse(prop['value'])

        if v is None:
            return None

        if v[1] == 'px':
            return repr(v[0])

        return self.compile_check(compile_eval([ 'f:metric', 'v:' + v[0] + v[1] ], self.stat))

    def stat_value(self, prop):
        v = self._parse(prop['value'])

        if v is None:
            return None

        if v[1] == 'px':
            return v[0]

        return True
<commit_msg>Types::pixels: '' is not a valid value<commit_after>from .default import default
from ..compiler.compile_eval import compile_eval
import re

class pixels(default):
    def _parse(self, value):
        if value is None:
            return None

        m = re.match('(.*)(px|m|u)$', value)
        if m:
            return ( m.group(1), m.group(2) )

        return ( value, 'px' )


    def compile(self, prop):
        v = self._parse(prop['value'])

        if v is None:
            return None

        if v[1] == 'px':
            return repr(v[0])

        return self.compile_check(compile_eval([ 'f:metric', 'v:' + v[0] + v[1] ], self.stat))

    def stat_value(self, prop):
        v = self._parse(prop['value'])

        if v is None:
            return None

        if v[0] == '':
            return None

        if v[1] == 'px':
            return v[0]

        return True

{'fraction_non_alphanumeric': 0.14092777451556077, 'fraction_numerical': 0.009982384028185555, 'mean_word_length': 1.7843137254901962, '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': '3709601', 'n_tokens_mistral': 558, 'n_tokens_neox': 530, 'n_words': 155}