<commit_before># coding=UTF-8
from optparse import make_option
import sys
import datetime, string
import urllib, re
from random import choice
from urlparse import urlparse
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
# methodmint
from applications.models import Application
from methods.models import Method

class Command(BaseCommand):
    option_list = BaseCommand.option_list + (
        )

    def handle(self, *args, **options):
        objs = []
        objs.extend( [Application])
        objs.extend( [Method] * 20 ) # Compensate for relative numbers of each
        
        obj = choice(objs).objects.exclude(created_by__id=1).order_by('?')[0]

        print "Simulating edit to %s" % obj

        obj.updated_at = datetime.datetime.now()
        obj.save()

        <commit_msg>Activity tweaks; not uid=0 (can do those activities myself)<commit_after># coding=UTF-8
from optparse import make_option
import sys
import datetime, string
import urllib, re
from random import choice
from urlparse import urlparse
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
# methodmint
from applications.models import Application
from methods.models import Method

class Command(BaseCommand):
    option_list = BaseCommand.option_list + (
        )

    def handle(self, *args, **options):
        objs = []
        objs.extend( [Application])
        objs.extend( [Method] * 20 ) # Compensate for relative numbers of each
        
        obj = choice(objs).objects.filter(created_by__id__gt=2).order_by('?')[0]

        print "Simulating edit to %s" % obj

        obj.updated_at = datetime.datetime.now()
        obj.save()

        
{'fraction_non_alphanumeric': 0.08682782437099161, 'fraction_numerical': 0.005426739023186976, 'mean_word_length': 3.5778781038374716, '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': '3949361', 'n_tokens_mistral': 572, 'n_tokens_neox': 555, 'n_words': 174}