repo_name stringlengths 7 65 | path stringlengths 5 185 | copies stringlengths 1 4 | size stringlengths 4 6 | content stringlengths 977 990k | license stringclasses 14
values | hash stringlengths 32 32 | line_mean float64 7.18 99.4 | line_max int64 31 999 | alpha_frac float64 0.25 0.95 | ratio float64 1.5 7.84 | autogenerated bool 1
class | config_or_test bool 2
classes | has_no_keywords bool 2
classes | has_few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
brython-dev/brython | www/src/Lib/unittest/signals.py | 1020 | 2403 | import signal
import weakref
from functools import wraps
__unittest = True
class _InterruptHandler(object):
def __init__(self, default_handler):
self.called = False
self.original_handler = default_handler
if isinstance(default_handler, int):
if default_handler == signal.SIG_D... | bsd-3-clause | a92ca70bf3fc4d747f97f7537938c45b | 32.84507 | 75 | 0.605909 | 4.47486 | false | false | false | false |
brython-dev/brython | www/src/Lib/random.py | 1 | 31991 | """Random variable generators.
bytes
-----
uniform bytes (values between 0 and 255)
integers
--------
uniform within range
sequences
---------
pick random element
pick random sample
pick weighted random sample
generate random p... | bsd-3-clause | 86ea304009192008826100b3e765bec2 | 34.506104 | 97 | 0.556313 | 4.121489 | false | false | false | false |
brython-dev/brython | www/src/Lib/encodings/bz2_codec.py | 214 | 2249 | """Python 'bz2_codec' Codec - bz2 compression encoding.
This codec de/encodes from bytes to bytes and is therefore usable with
bytes.transform() and bytes.untransform().
Adapted by Raymond Hettinger from zlib_codec.py which was written
by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs
import bz2 # this code... | bsd-3-clause | 0ce8cc38e6e2b3664d7c420e34449339 | 27.833333 | 70 | 0.666963 | 4.037702 | false | false | false | false |
brython-dev/brython | www/src/Lib/encodings/utf_16_le.py | 860 | 1037 | """ Python 'utf-16-le' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
encode = codecs.utf_16_le_encode
def decode(input, errors='strict'):
return codecs.utf_16_le_decode(input, errors, True)
class IncrementalEncod... | bsd-3-clause | 1f99020a31cb295af4eed457ab212635 | 23.690476 | 61 | 0.712633 | 3.898496 | false | false | false | false |
brython-dev/brython | www/src/Lib/encodings/iso8859_5.py | 35 | 13322 | """ Python Character Mapping Codec iso8859_5 generated from 'MAPPINGS/ISO8859/8859-5.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,i... | bsd-3-clause | 595f11b8482fe8853230d5fdd1ad2b70 | 41.394137 | 107 | 0.51764 | 3.093823 | false | false | false | false |
brython-dev/brython | scripts/make_stdlib_static.py | 1 | 2896 | # Create file stdlib_paths.js : static mapping between module names and paths
# in the standard library
import os
import git
libfolder = os.path.join(os.path.dirname(os.getcwd()), 'www', 'src')
simple_javascript_template_string = """;(function($B){\n
$B.stdlib = {}
"""
with open(os.path.join(libfolder, 'stdlib_paths... | bsd-3-clause | abdd0a26de278c45e64034d55b8b527d | 33.891566 | 77 | 0.515539 | 3.37923 | false | false | false | false |
brython-dev/brython | www/src/Lib/test/test_codecencodings_cn.py | 11 | 3950 | #
# test_codecencodings_cn.py
# Codec encoding tests for PRC encodings.
#
from test import multibytecodec_support
import unittest
class Test_GB2312(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'gb2312'
tstring = multibytecodec_support.load_teststring('gb2312')
codectests = (
#... | bsd-3-clause | 32f557f3411f708a934629689d86d1aa | 40.145833 | 85 | 0.567089 | 2.474937 | false | true | false | false |
brython-dev/brython | www/src/Lib/_struct.py | 1 | 15809 | #
# This module is a pure Python version of pypy.module.struct.
# It is only imported if the vastly faster pypy.module.struct is not
# compiled in. For now we keep this version for reference and
# because pypy.module.struct is not ootype-backend-friendly yet.
#
# this module 'borrowed' from
# https://bitbucket.org/py... | bsd-3-clause | 63293654e15a63fda3e6f021a53e91c6 | 31.197556 | 91 | 0.54722 | 3.480625 | false | false | false | false |
brython-dev/brython | www/src/Lib/_codecs_jp.py | 1 | 1174 | from encoding_cp932 import encoding_table, decoding_table # JS module in libs
### Codec APIs
class Codec:
def encode(self, input, errors='strict'):
b = []
for pos, car in enumerate(input):
cp = ord(car)
try:
code = encoding_table[cp]
high = ... | bsd-3-clause | c57e21f6d122d829413702e11608589c | 27.634146 | 77 | 0.441227 | 4.463878 | false | false | false | false |
brython-dev/brython | www/src/Lib/test/test_urllibnet.py | 4 | 9547 | import unittest
from test import support
from test.support import os_helper
from test.support import socket_helper
import contextlib
import socket
import urllib.parse
import urllib.request
import os
import email.message
import time
support.requires('network')
class URLTimeoutTest(unittest.TestCase):
# XXX this... | bsd-3-clause | 93cffd4949cf55b3821b30bbfd604ded | 40.329004 | 86 | 0.608149 | 4.367338 | false | true | false | false |
brython-dev/brython | www/src/Lib/statistics.py | 1 | 47565 | """
Basic statistics module.
This module provides functions for calculating statistics of data, including
averages, variance, and standard deviation.
Calculating averages
--------------------
================== ==================================================
Function Description
================== ==... | bsd-3-clause | 0cc8fd8c2e7ad7dab523ef239ba91a11 | 33.366329 | 108 | 0.597776 | 3.601348 | false | false | false | false |
brython-dev/brython | www/src/Lib/email/message.py | 3 | 47951 | # Copyright (C) 2001-2007 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Basic message object for the email package object model."""
__all__ = ['Message', 'EmailMessage']
import binascii
import re
import quopri
from io import BytesIO, StringIO
# Intrapackage imports
from email ... | bsd-3-clause | 3fe8634d20c3bae06a9b68eea019d1b6 | 38.9575 | 96 | 0.586477 | 4.454571 | false | false | false | false |
brython-dev/brython | www/tests/compression/test_deflate.py | 2 | 2553 | import zlib
import deflate
import lz77
compresser = zlib.compressobj(wbits=15)
text = """Pleurez, doux alcyons, ô vous, oiseaux sacrés,
Oiseaux chers à Thétis, doux alcyons, pleurez.
Elle a vécu, Myrto, la jeune Tarentine.
Un vaisseau la portait aux bords de Camarine.
Là l'hymen, les chansons, les flûtes, lentement,... | bsd-3-clause | 433934e38300b01cdd37d2fff574b8a3 | 27.179775 | 56 | 0.679298 | 2.501996 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/userreports/reports/util.py | 1 | 3503 | from memoized import memoized
from couchexport.export import export_from_tables
from corehq.apps.userreports.columns import get_expanded_column_config
from corehq.apps.userreports.models import get_report_config
def get_expanded_columns(column_configs, data_source_config):
return {
column_config.column_... | bsd-3-clause | df98c4605368c317cd5a095ea4113cc2 | 31.738318 | 109 | 0.631173 | 3.922732 | false | true | false | false |
dimagi/commcare-hq | corehq/apps/domain/views/internal.py | 1 | 19674 | import copy
from django.conf import settings
from django.contrib import messages
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import redirect
from django.template.loader import render_to_string
from django.urls import reverse
from django.utils.decorators import method_decorator
from djan... | bsd-3-clause | df17831aeb140fa30c8d4fcaf90778bf | 38.269461 | 114 | 0.629155 | 3.970535 | false | false | false | false |
dimagi/commcare-hq | corehq/ex-submodules/dimagi/utils/management/commands/prime_views.py | 1 | 2761 | from couchdbkit.exceptions import ResourceNotFound
# http://www.gevent.org/gevent.monkey.html#module-gevent.monkey
from gevent import monkey; monkey.patch_all()
import sys
import gevent
from gevent.pool import Pool
from django.core.management.base import BaseCommand
from django.conf import settings
setattr(settings, '... | bsd-3-clause | 8abae0e553a3e69bbba70ea08373319e | 32.670732 | 117 | 0.572981 | 3.792582 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/segments/migrations/0007_auto_20220119_0945.py | 1 | 3107 | # Generated by Django 2.2.24 on 2022-01-19 08:45
from django.db import migrations
from django.utils.text import slugify
def migrate_extra_fields_to_segments(apps, schema_editor):
Member = apps.get_model('members', 'Member')
SegmentType = apps.get_model('segments', 'SegmentType')
Segment = apps.get_model(... | bsd-3-clause | add9abf647744dc9a413b0b50da6d12e | 35.988095 | 101 | 0.54168 | 4.496382 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/formplayer_api/management/commands/prime_formplayer_restores.py | 1 | 6540 | import csv
import inspect
import sys
from argparse import RawTextHelpFormatter
from datetime import datetime
from dateutil.relativedelta import relativedelta
from django.core.management.base import BaseCommand
from corehq.apps.users.models import CouchUser
from corehq.util.argparse_types import validate_range
from cu... | bsd-3-clause | 7fbcbe78fbd33f493f3e3b875ae54327 | 43.189189 | 114 | 0.569266 | 3.913824 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/cms/migrations/0004_projectsmapcontent.py | 1 | 1330 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-12-07 11:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.manager
from fluent_contents.models.managers import ContentItemManager
class Migration(migrations.Migrati... | bsd-3-clause | 9479a2388945df888f7f58eca65c3192 | 34.945946 | 209 | 0.6 | 4.079755 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/domain/migrations/0013_accountconfirmationsettings_squashed_0016_alter_smsaccountconfirmationsettings_project_name.py | 1 | 1158 | # Generated by Django 3.2.13 on 2022-07-06 13:34
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
replaces = [('domain', '0013_accountconfirmationsettings'), ('domain', '0014_alter_accountconfirmationsettings_project_name'), ('domain', '0015_rename_ac... | bsd-3-clause | cd18085d9bc8e5749388121a5d967423 | 45.32 | 286 | 0.677029 | 4.226277 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/funding_vitepay/tests/test_api.py | 1 | 2411 | import json
from django.urls import reverse
from mock import patch
from rest_framework import status
from bluebottle.funding.tests.factories import FundingFactory, DonorFactory
from bluebottle.funding_vitepay.models import VitepayPaymentProvider
from bluebottle.funding_vitepay.tests.factories import VitepayPaymentPro... | bsd-3-clause | 8c7088a44acbb3e41098fe9a0364a4b3 | 39.183333 | 107 | 0.637495 | 4.135506 | false | true | false | false |
dimagi/commcare-hq | corehq/util/management/commands/mark_email_as_bounced.py | 1 | 1710 | import datetime
from django.core.management.base import BaseCommand
from corehq.util.models import (
BouncedEmail,
PermanentBounceMeta,
BounceSubType,
)
class Command(BaseCommand):
help = "Force an email to be marked as Permanently Bounced and blocked " \
"from receiving any further email... | bsd-3-clause | a850ad73afaa0d4cb77d37739398893b | 31.884615 | 79 | 0.611111 | 3.949192 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/userreports/reports/filters/values.py | 1 | 16451 | import datetime
from django.urls import reverse
import sqlalchemy
from memoized import memoized
from sqlagg.filters import (
ANDFilter,
BasicFilter,
BetweenFilter,
EQFilter,
GTEFilter,
GTFilter,
INFilter,
ISNULLFilter,
LTEFilter,
LTFilter,
NOTEQFilter,
NOTNULLFilter,
... | bsd-3-clause | 1bb16e0728cc29afbb9c015a77043a51 | 31.770916 | 114 | 0.583673 | 4.142785 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/funding_pledge/admin.py | 1 | 1402 | from django.contrib import admin
from django.utils.translation import gettext_lazy as _
from bluebottle.funding.admin import PaymentChildAdmin, PaymentProviderChildAdmin, BankAccountChildAdmin
from bluebottle.funding.models import PaymentProvider, Payment
from bluebottle.funding_pledge.models import PledgePayment, Ple... | bsd-3-clause | 9eed3e7c7f23c43abf117bd0d76d0e8b | 33.195122 | 104 | 0.740371 | 4.087464 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/funding/migrations/0023_add_permissions.py | 1 | 1414 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-08-28 07:04
from __future__ import unicode_literals
from django.db import migrations, connection
from bluebottle.utils.utils import update_group_permissions
from bluebottle.clients import properties
from bluebottle.clients.models import Client
from bluebo... | bsd-3-clause | 08d072d9020883752b2ce92a84b4851a | 27.28 | 85 | 0.557284 | 4.195846 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/smsbillables/tests/test_billable_creation.py | 1 | 2946 | from decimal import Decimal
from django.test import TestCase
from corehq.apps.sms.api import create_billable_for_sms
from corehq.apps.sms.models import OUTGOING
from corehq.apps.smsbillables.models import SmsBillable, SmsGatewayFee
from corehq.apps.smsbillables.tests.utils import create_sms, short_text, long_text
fro... | bsd-3-clause | cf943653e202fb1ce5276fbd0b30ab0d | 33.658824 | 109 | 0.65241 | 3.511323 | false | true | false | false |
dimagi/commcare-hq | corehq/apps/domain/shortcuts.py | 1 | 1655 | """
Shortcuts for working with domains and users.
"""
from django.contrib.auth.models import User
from corehq.apps.domain.models import Domain
def create_domain(name, active=True):
"""Create domain without secure submissions for tests"""
return Domain.get_or_create_with_name(name=name, is_active=active,
... | bsd-3-clause | 31627a9b4deab1c30c0fa6d8a189d6d1 | 30.226415 | 75 | 0.673112 | 3.653422 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/time_based/migrations/0047_migrate_to_slots.py | 1 | 1879 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2021-01-06 14:09
from __future__ import unicode_literals
from django.db import migrations
from django.utils.timezone import now
def map_status(status):
mapping = {
'draft': 'draft',
'submitted': 'draft',
'needs_work': 'draft',
... | bsd-3-clause | 9230e315723cba7b36688f45cbff49c7 | 27.044776 | 79 | 0.57637 | 4.014957 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/initiatives/migrations/0001_initial.py | 1 | 3393 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-03-29 10:01
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('bb_pro... | bsd-3-clause | 2c139e1f861402a23437d8e72ee08504 | 74.4 | 672 | 0.652815 | 3.908986 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/users/views/__init__.py | 1 | 54332 | import json
from collections import defaultdict
from datetime import datetime
from django.conf import settings
import langcodes
import six.moves.urllib.error
import six.moves.urllib.parse
import six.moves.urllib.request
from couchdbkit.exceptions import ResourceNotFound
from crispy_forms.utils import render_crispy_for... | bsd-3-clause | 2476103604305979f62d86950d7e095f | 36.941341 | 116 | 0.630991 | 3.919492 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/domain/views/base.py | 1 | 6137 | from django.contrib import messages
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import redirect, render
from django.urls import reverse
from django.utils.translation import gettext as _
from memoized import memoized
from corehq.apps.accounting.mixins import BillingModalsMixin
from core... | bsd-3-clause | 7eb3a73187a492ecbbd94d4440db4f45 | 37.597484 | 108 | 0.676715 | 3.816542 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/segments/migrations/0010_auto_20211123_1533.py | 1 | 1720 | # Generated by Django 2.2.24 on 2021-11-23 14:33
import bluebottle.utils.fields
import bluebottle.utils.validators
import colorfield.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('segments', '0009_auto_20211122_1527'),
]
operations = [
... | bsd-3-clause | 9b1a3c511a492afcdf80b2fbbe42344d | 46.777778 | 386 | 0.663372 | 3.865169 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/app_manager/management/commands/import_app.py | 1 | 2999 | from getpass import getpass
from django.core.management.base import BaseCommand, CommandError
from django.urls import reverse
import requests
from requests.auth import HTTPDigestAuth
from corehq.apps.app_manager.models import import_app
class Command(BaseCommand):
help = ("Import an app from another Commcare i... | bsd-3-clause | 471c64e54b61ff8b0ea3aaf3f42a731a | 30.904255 | 95 | 0.536179 | 4.212079 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/styleguide/views/__init__.py | 1 | 14864 | import os
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.views.generic import *
from corehq.apps.styleguide.example_forms import (
BasicCrispyForm,
CheckboxesForm,
)
def styleguide_default(request):
return Htt... | bsd-3-clause | 2fa468578564ef5da3cfa16ea44ad862 | 38.849866 | 115 | 0.457818 | 4.395033 | false | false | false | false |
dimagi/commcare-hq | corehq/util/workbook_reading/adapters/generic.py | 1 | 1156 | from contextlib import contextmanager
from corehq.util.workbook_reading import SpreadsheetFileExtError
from .csv import open_csv_workbook
from .xls import open_xls_workbook
from .xlsx import open_xlsx_workbook
extensions_to_functions_dict = {
'csv': open_csv_workbook,
'xls': open_xls_workbook,
'xlsx': ope... | bsd-3-clause | 90fa3a7eee8804a567d1cb907025d5e9 | 34.030303 | 94 | 0.679066 | 4.070423 | false | false | false | false |
dimagi/commcare-hq | corehq/form_processor/submission_post.py | 1 | 29766 | import logging
from collections import namedtuple
from ddtrace import tracer
from django.db import IntegrityError
from django.http import (
HttpRequest,
HttpResponse,
HttpResponseForbidden,
)
from django.conf import settings
from django.urls import reverse
from django.utils.translation import gettext as _
... | bsd-3-clause | d751c6be6445679796dc6db74ce98214 | 44.717358 | 115 | 0.6219 | 4.207238 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/time_based/messages.py | 1 | 22939 | # -*- coding: utf-8 -*-
from datetime import timedelta
from django.contrib.admin.options import get_content_type_for_model
from django.template import defaultfilters
from django.utils.timezone import get_current_timezone, now
from django.utils.translation import pgettext_lazy as pgettext
from pytz import timezone
fro... | bsd-3-clause | 84d587a00d12e4a04645c584532080ea | 27.63875 | 98 | 0.628388 | 4.210033 | false | false | false | false |
dimagi/commcare-hq | corehq/ex-submodules/casexml/apps/case/xml/generator.py | 1 | 8779 | import settings
from casexml.apps.case.xml import V1, V2, V3, check_version, V2_NAMESPACE
from lxml import etree as ElementTree
import logging
from dimagi.utils.parsing import json_format_datetime, json_format_date
from dateutil.parser import parse as parse_datetime
from corehq.toggles import MM_CASE_PROPERTIES
from c... | bsd-3-clause | 0d35b33eff8586e8092a699cfdbbb116 | 32.895753 | 104 | 0.626267 | 3.784052 | false | false | false | false |
dimagi/commcare-hq | custom/abt/reports/filters_2020.py | 1 | 3236 | from django.utils.translation import gettext_lazy
from corehq.apps.reports.filters.base import BaseSingleOptionFilter
from custom.abt.reports.fixture_utils import (
get_data_type_ids_by_tag,
get_fixture_dicts,
)
class VectorLinkLocFilter(BaseSingleOptionFilter):
default_text = 'All'
def get_level_2s... | bsd-3-clause | 60f92e41f5820bb46d60a35a8e743d8a | 30.417476 | 78 | 0.560569 | 3.1387 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/auditcare/utils/export.py | 1 | 6550 | import csv
from datetime import datetime, timedelta
from itertools import chain
from django.contrib.auth.models import User
from django.db.models import ForeignKey, Min
import attr
from dimagi.utils.parsing import string_to_datetime
from corehq.apps.users.models import Invitation, WebUser
from corehq.util.models im... | bsd-3-clause | d92f3303c4defcad394173ad42ec53f8 | 30.642512 | 106 | 0.64229 | 3.751432 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/funding/migrations/0005_auto_20190604_1501.py | 1 | 1369 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-06-04 13:01
from __future__ import unicode_literals
import bluebottle.utils.fields
from decimal import Decimal
from django.db import migrations
import djmoney.models.fields
class Migration(migrations.Migration):
dependencies = [
('funding', '... | bsd-3-clause | df3324a0f1244a92a41e8116677ec3c7 | 35.026316 | 149 | 0.611395 | 3.792244 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/bb_projects/migrations/0001_initial.py | 2 | 2322 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-05-23 13:25
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Project... | bsd-3-clause | 617ce548f3e7483ca869d3df1be7a45e | 46.387755 | 141 | 0.580534 | 4.51751 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/collect/migrations/0002_auto_20210920_0917.py | 1 | 1432 | # Generated by Django 2.2.24 on 2021-09-20 07:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('collect', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='CollectActivity',
options={'permiss... | bsd-3-clause | 8102dcefbd3de0967594a08e328ef0c1 | 43.75 | 102 | 0.61243 | 4.649351 | false | false | false | false |
dimagi/commcare-hq | corehq/motech/fhir/admin.py | 1 | 3276 | import json
from django.contrib import admin
from corehq.motech.fhir.models import (
FHIRImportConfig,
FHIRImportResourceProperty,
FHIRImportResourceType,
FHIRResourceProperty,
FHIRResourceType,
ResourceTypeRelationship,
)
class FHIRResourcePropertyInline(admin.TabularInline):
model = FH... | bsd-3-clause | f2eb5808507439f37113fe236cdcae6a | 25.852459 | 76 | 0.653846 | 3.932773 | false | true | false | false |
onepercentclub/bluebottle | bluebottle/segments/tests/test_admin.py | 1 | 6150 | from django.contrib.admin.sites import AdminSite
from django.urls import reverse
from bluebottle.segments.admin import SegmentAdmin
from bluebottle.segments.models import Segment
from bluebottle.segments.tests.factories import SegmentTypeFactory, SegmentFactory
from bluebottle.test.factory_models.accounts import BlueB... | bsd-3-clause | 6d00e1b923b3e6e5dd89e73609a42ca4 | 40.275168 | 93 | 0.684065 | 3.972868 | false | true | false | false |
dimagi/commcare-hq | corehq/sql_db/jsonops.py | 1 | 3554 | """
JSON and JSONB functions and operators for PostgreSQL
Reference: https://www.postgresql.org/docs/10/functions-json.html
In particular, `JsonGet`, `JsonSet`, and `JsonDelete` can be nested to perform
multiple transformation operations on a JSONB value.
For example, the following expression renames the top-level "... | bsd-3-clause | f19b45db08778c436a6b9f695dfcf9c0 | 30.451327 | 78 | 0.634778 | 3.741053 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/userreports/reports/builder/__init__.py | 1 | 2248 |
DEFAULT_CASE_PROPERTY_DATATYPES = {
"name": "string",
"modified_on": "datetime",
"opened_on": "datetime",
"owner_id": "string",
"user_id": "string",
}
FORM_QUESTION_DATATYPE_MAP = {
"Select": "single",
"MSelect": "multiple"
}
FORM_METADATA_PROPERTIES = [
('username', 'Text'),
('us... | bsd-3-clause | ea62bcfd44fd6dc39c1d874ff8daafd1 | 25.761905 | 87 | 0.557384 | 3.810169 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/funding/migrations/0042_auto_20191104_1154.py | 1 | 1231 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-11-04 10:54
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('funding', '0041_payout_currency'),
]
operations = [
... | bsd-3-clause | 26d2cfba8c75e584c855e0a1ce61400d | 29.02439 | 74 | 0.590577 | 4.509158 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/projects/migrations/0023_auto_20170323_1227.py | 1 | 1431 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-03-23 11:27
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('projects', '0022_project_r... | bsd-3-clause | 1cede2dc112ecd4a71f17f8082a6c3f5 | 37.675676 | 225 | 0.638714 | 4.271642 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/hqadmin/views/data.py | 1 | 3591 | import json
from django.http import HttpResponse
from django.shortcuts import render
from django.utils.translation import gettext as _
from corehq.apps.domain.decorators import require_superuser
from corehq.apps.es.es_query import ESQuery
from corehq.apps.es.registry import get_registry
from corehq.apps.hqwebapp.doc_... | bsd-3-clause | 12c1bd36a367be55a6f49945bedd8990 | 32.560748 | 102 | 0.617098 | 3.442953 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/payments_voucher/migrations/0002_auto_20210302_1417.py | 1 | 1084 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2021-03-02 13:17
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('payments_logger', '0002_auto_20210302_1417'),
('payments', '0007_auto_20210302_1417'),
... | bsd-3-clause | 449f27b968b603bdd616a1148bf2c3a6 | 24.209302 | 55 | 0.52952 | 4.42449 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/hqadmin/management/commands/cchq_prbac_revoke_privs.py | 1 | 5173 | import logging
from django.core.management.base import BaseCommand
from django_prbac.models import Role
from corehq.apps.accounting.models import SoftwarePlanVersion
from corehq.apps.accounting.utils import revoke_privs_for_grantees
from corehq.apps.hqadmin.management.commands.cchq_prbac_grandfather_privs import _con... | bsd-3-clause | ba9a91dcf261ebbce2a4e74e50d756d7 | 37.894737 | 115 | 0.568916 | 4.141713 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/organizations/serializers.py | 1 | 2351 | from builtins import object
from rest_framework import serializers
from bluebottle.organizations.models import Organization, OrganizationContact
from bluebottle.bluebottle_drf2.serializers import (
ImageSerializer
)
from rest_framework_json_api.serializers import ModelSerializer
from bluebottle.utils.fields impo... | bsd-3-clause | 56e04abd647eccbda8266b19317a6c32 | 33.573529 | 84 | 0.702254 | 4.386194 | false | false | false | false |
dimagi/commcare-hq | corehq/util/workbook_json/excel_importer.py | 1 | 2744 | import logging
from datetime import datetime, timedelta
from django.conf import settings
from soil import DownloadBase
from corehq.util.workbook_json.excel import WorkbookJSONReader
class UnknownFileRefException(Exception):
pass
class ExcelImporter(object):
"""
Base class for `SingleExcelImporter` and... | bsd-3-clause | 40fd0362c964e1fe02535555b5a82edd | 33.3 | 110 | 0.64395 | 3.784828 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/looker/migrations/0003_init_looker_embeds.py | 1 | 1212 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-06-06 10:25
from __future__ import unicode_literals
from django.db import migrations
from django.core.management import call_command
def generate_looker_embeds(apps, schema_editor):
ProjectPlatformSettings = apps.get_model('projects', 'ProjectPlatform... | bsd-3-clause | ce451cd38dac0da1069ebbbbb9379485 | 28.560976 | 147 | 0.693894 | 3.61791 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/payouts/migrations/0005_auto_20160721_1114.py | 1 | 1163 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-07-21 09:14
from __future__ import unicode_literals
from django.db import migrations
def add_financial_group(apps, schema_editor):
ProjectPayout = apps.get_model('payouts', 'ProjectPayout')
from django.contrib.auth.models import Group, Permission
... | bsd-3-clause | dcfa1c1d79bc98abec742fbe132c78b0 | 28.075 | 77 | 0.700774 | 3.73955 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/app_manager/tests/test_bulk_ui_translation.py | 1 | 4676 | from distutils.version import StrictVersion
from io import BytesIO
from django.test import SimpleTestCase
from couchexport.export import export_raw
from corehq.apps.app_manager.models import Application
from corehq.apps.app_manager.ui_translations import (
get_default_translations_for_download,
process_ui_tr... | bsd-3-clause | eb6cb6efd404ff888f9f23ea61601653 | 45.76 | 114 | 0.576133 | 4.076722 | false | true | false | false |
dimagi/commcare-hq | corehq/apps/userreports/migrations/0009_rename_ucr_tables.py | 1 | 2693 | import sys
from collections import defaultdict
from django.db import migrations
from corehq.apps.userreports.models import (
DataSourceConfiguration,
StaticDataSourceConfiguration,
)
from corehq.apps.userreports.util import (
LEGACY_UCR_TABLE_PREFIX,
get_table_name,
)
from corehq.sql_db.connections im... | bsd-3-clause | 4f1cec3532f4cb7d0ec5eb3e85ac299a | 30.313953 | 95 | 0.683253 | 3.644114 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/domain/forms.py | 1 | 105740 | import datetime
import io
import json
import logging
import uuid
from django import forms
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import SetPasswordForm
from django.contrib.auth.hashers import UNUSABLE_PASSWORD_P... | bsd-3-clause | eb66487f796622f5429f4aba77c547e3 | 39.842024 | 114 | 0.587148 | 4.255645 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/time_based/migrations/0051_auto_20210114_1055.py | 1 | 2436 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2021-01-14 09:55
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('time_based', '0050_auto_20210112_1515'),
]
operat... | bsd-3-clause | 6f40eb68c0bd6ed58ec06df11f5df3cd | 83 | 858 | 0.706076 | 4.114865 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/app_manager/app_schemas/form_metadata.py | 1 | 19285 | from collections import OrderedDict, defaultdict
from jsonobject import (
BooleanProperty,
DictProperty,
JsonObject,
ListProperty,
ObjectProperty,
StringProperty,
)
from corehq.apps.app_manager.app_schemas.app_case_metadata import (
AppCaseMetadata,
FormQuestionResponse,
LoadSavePr... | bsd-3-clause | bb18ffe96cb574c00391a2a6573912ef | 39.77167 | 105 | 0.61789 | 4.071142 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/app_manager/migrations/0003_auto_20190326_0853.py | 1 | 1407 | # Generated by Django 1.11.20 on 2019-03-26 08:53
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('locations', '0017_locationrelation_last_modified'),
('app_manager', '0002_latestenabledbuildprofiles'),
]
... | bsd-3-clause | 1c82a294b2df4ef9ad1c92de359dd57a | 40.382353 | 114 | 0.576404 | 4.438486 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/time_based/migrations/0023_auto_20201103_1510.py | 1 | 1861 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-05-24 09:59
from __future__ import unicode_literals
from django.db import migrations, connection
from bluebottle.utils.utils import update_group_permissions
from bluebottle.clients import properties
from bluebottle.clients.models import Client
from bluebo... | bsd-3-clause | 2b19a9f06f92279b52572820375b4a27 | 31.086207 | 93 | 0.576034 | 4.409953 | false | false | false | false |
dimagi/commcare-hq | corehq/blobs/management/commands/blob_storage_report.py | 1 | 16087 | import csv
import logging
import re
import sys
from collections import defaultdict, OrderedDict
from contextlib import contextmanager
from functools import partial
from itertools import chain
from six.moves.urllib.parse import unquote
from couchdbkit.exceptions import ResourceNotFound
from django.core.management impo... | bsd-3-clause | 4c8085059cc5ca152e19e9bed580bd2d | 33.820346 | 90 | 0.577982 | 3.702417 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/app_manager/views/app_summary.py | 1 | 22568 | import io
from collections import namedtuple
from django.conf import settings
from django.http import Http404
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.utils.translation import gettext_lazy as _
from django.views.generic import View
from django.contrib import messa... | bsd-3-clause | 8600a402cd263685cab42fbf732125dd | 36.364238 | 115 | 0.559864 | 4.063378 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/data_interfaces/interfaces.py | 1 | 9696 | from django.contrib.humanize.templatetags.humanize import naturaltime
from django.urls import reverse
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.utils.translation import gettext as _
from django.utils.translation import gettext_lazy, gettext_noop
from memoized im... | bsd-3-clause | 23d92cbd24313bbef680afe4a5704cf1 | 39.739496 | 104 | 0.627991 | 4.172117 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/token_auth/auth/booking.py | 1 | 6958 |
from future import standard_library
standard_library.install_aliases()
from urllib.parse import urlencode
from builtins import chr
import base64
import hashlib
import hmac
import logging
import re
from datetime import timedelta
import string
from datetime import datetime
from django.utils.dateparse import parse_date... | bsd-3-clause | 7e2b2a982c1d9be10773b47dcd31f5cc | 34.141414 | 105 | 0.64142 | 4.04065 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/fixtures/tasks.py | 1 | 1969 | import datetime
from django.conf import settings
from django.template.loader import render_to_string
from soil import DownloadBase
from corehq.apps.celery import task
from corehq.apps.fixtures.download import prepare_fixture_download
from corehq.apps.fixtures.upload import upload_fixture_file
from corehq.apps.hqweba... | bsd-3-clause | f5ed9e9f9babf24824cd9ae677427284 | 32.372881 | 94 | 0.691214 | 3.653061 | false | false | false | false |
dimagi/commcare-hq | corehq/ex-submodules/pillowtop/tests/test_form_change_providers.py | 1 | 1582 | import itertools
import uuid
from django.test import TestCase
from corehq.form_processor.backends.sql.dbaccessors import doc_type_to_state
from corehq.form_processor.tests.utils import create_form_for_test, FormProcessorTestUtils
from pillowtop.reindexer.change_providers.form import SqlDomainXFormChangeProvider
cla... | bsd-3-clause | 34885a2a7f35651003fe39476835bca0 | 38.55 | 90 | 0.700379 | 3.775656 | false | true | false | false |
dimagi/commcare-hq | corehq/apps/user_importer/importer.py | 1 | 36489 | import logging
import string
import random
from collections import defaultdict, namedtuple
from datetime import datetime
from django.db import DEFAULT_DB_ALIAS
from corehq.apps.enterprise.models import EnterpriseMobileWorkerSettings
from corehq.apps.users.util import generate_mobile_username
from dimagi.utils.logging... | bsd-3-clause | 90d0f1297cf59ce858deb821e5999995 | 40.277149 | 113 | 0.586588 | 4.163985 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/auditcare/migrations/0002_uniques.py | 1 | 2537 | # Generated by Django 2.2.16 on 2021-03-24 11:38
from itertools import groupby
from django.db import migrations, models
from ..models import AccessAudit, HttpAccept, NavigationEventAudit, UserAgent, ViewName
model_map = {
HttpAccept: [AccessAudit],
UserAgent: [AccessAudit, NavigationEventAudit],
ViewNam... | bsd-3-clause | 273512851665fb73afff3d7e5fd2ba1b | 29.566265 | 87 | 0.583366 | 3.797904 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/data_analytics/management/commands/add_to_malt_table.py | 1 | 1122 | from django.core.management.base import BaseCommand
import csv
from corehq.apps.data_analytics.models import MALTRow
class Command(BaseCommand):
"""
Adds csv data to malt table for given files
e.g. ./manage.py add_to_malt_table example.csv
"""
help = 'Adds data to MALT table from given f... | bsd-3-clause | a3ac9386f49c340f884e74067a412cd1 | 30.166667 | 93 | 0.510695 | 4.298851 | false | false | false | false |
dimagi/commcare-hq | corehq/form_processor/tests/test_sql_update_strategy.py | 1 | 8947 | from django.test import TestCase
from freezegun import freeze_time
from unittest.mock import patch
from testil import eq
from corehq.util.soft_assert.core import SoftAssert
from casexml.apps.case.exceptions import ReconciliationError
from casexml.apps.case.xml.parser import CaseUpdateAction, KNOWN_PROPERTIES
from core... | bsd-3-clause | a007ca9e9dabaf8ad01ace8656be3f3e | 39.121076 | 94 | 0.66268 | 3.741949 | false | true | false | false |
dimagi/commcare-hq | corehq/apps/hqcase/management/commands/initialize_es_indices.py | 1 | 2371 | from django.core.management import BaseCommand
from corehq.apps.es.registry import get_registry, registry_entry
from corehq.elastic import get_es_new
from pillowtop.reindexer.reindexer import (
prepare_index_for_reindex,
prepare_index_for_usage,
clean_index
)
class Command(BaseCommand):
help = """
... | bsd-3-clause | aa44597340eac817d2f7f7ddb89ca02e | 31.930556 | 86 | 0.539013 | 4.751503 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/hqmedia/tasks.py | 1 | 13739 | import itertools
import json
import os
import re
import tempfile
import zipfile
from wsgiref.util import FileWrapper
from django.conf import settings
from django.utils.translation import gettext as _
from celery.utils.log import get_task_logger
from dimagi.utils.logging import notify_exception
from soil import Downl... | bsd-3-clause | 8002c05451815776704668411ff9fe81 | 41.015291 | 120 | 0.60412 | 3.954807 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/utils/tests/test_functional.py | 1 | 1968 | from django.urls import reverse
from django.contrib.auth.models import Group
from django.template.response import TemplateResponse
from django.http.response import HttpResponseForbidden
from django.test.client import RequestFactory
from bluebottle.test.utils import BluebottleTestCase
from bluebottle.test.factory_model... | bsd-3-clause | 00b8a08c8a1493203c2bae21236c3c6f | 33.526316 | 109 | 0.694614 | 4.353982 | false | true | false | false |
onepercentclub/bluebottle | bluebottle/funding_pledge/models.py | 1 | 2278 | from __future__ import absolute_import
from builtins import object
from django.db import models
from django.utils.translation import gettext_lazy as _
from bluebottle.funding.models import Payment, PaymentProvider, BankAccount
class PledgePayment(Payment):
provider = 'pledge'
def refund(self):
pass
... | bsd-3-clause | b00ede0eb00bf9cfd2390845a0f6da65 | 29.783784 | 78 | 0.662862 | 3.975567 | false | false | false | false |
dimagi/commcare-hq | corehq/messaging/smsbackends/apposit/views.py | 1 | 1148 | import json
from corehq.apps.sms.api import incoming
from corehq.apps.sms.views import IncomingBackendView
from corehq.messaging.smsbackends.apposit.models import SQLAppositBackend
from django.http import HttpResponse, HttpResponseBadRequest
class AppositIncomingView(IncomingBackendView):
urlname = 'apposit_incom... | bsd-3-clause | bd250eabc96877e6a9c8ede4aa6b1788 | 30.888889 | 85 | 0.651568 | 4.236162 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/api/resources/messaging_event/pagination.py | 1 | 2685 | import logging
from base64 import b64encode
from urllib.parse import urlencode
from corehq.apps.api.resources.messaging_event.serializers import serialize_event
from corehq.apps.api.resources.messaging_event.utils import get_limit_offset
from corehq.util import reverse
LAST_OBJECT_ID = "last_object_id"
logger = logg... | bsd-3-clause | e1ee8908b0f797268471f5062c78ed9d | 35.780822 | 111 | 0.65959 | 3.880058 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/userreports/transforms/custom/date.py | 1 | 2177 | import calendar
from datetime import date, datetime
from ethiopian_date import EthiopianDateConverter
from dimagi.utils.dates import force_to_datetime
def get_month_display(month_index):
try:
return calendar.month_name[int(month_index)]
except (KeyError, ValueError, TypeError):
return ""
d... | bsd-3-clause | 90f2948d77596af7b33128f4cba3fdb5 | 26.2125 | 110 | 0.651355 | 3.534091 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/app_manager/suite_xml/sections/menus.py | 1 | 11596 | """
MenuContributor
---------------
Menus *approximately* correspond to HQ modules.
Menus *almost* correspond to command lists, the screens in CommCare that ask the user to select a form or sub-menu.
However, if the suite contains multiple ``<menu>`` elements with the same ``id``, they will be concatenated and
displa... | bsd-3-clause | b58567d381dc918ad671098fbe119d40 | 41.47619 | 115 | 0.605985 | 4.034795 | false | false | false | false |
dimagi/commcare-hq | corehq/ex-submodules/pillowtop/management/commands/update_es_settings.py | 1 | 2244 | from django.core.management.base import BaseCommand, CommandError
from corehq.elastic import get_es_new
from corehq.pillows.utils import get_all_expected_es_indices
class Command(BaseCommand):
help = "Update dynamic settings for existing elasticsearch indices."
def add_arguments(self, parser):
parse... | bsd-3-clause | 353099dd486c7aa7d9c6d744af1bce42 | 36.4 | 104 | 0.56016 | 4.218045 | false | false | false | false |
dimagi/commcare-hq | corehq/form_processor/migrations/0060_convert_case_ids_to_foreign_keys.py | 1 | 2783 | from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('form_processor', '0059_remove_ledgervalue_location_id'),
]
operations = [
# The other way to convert a field to a foreign key involves creating a new column
# doing a data migrati... | bsd-3-clause | fd2e3dd295aaae6104fdc15bb1ba6dd6 | 43.174603 | 109 | 0.521739 | 4.669463 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/export/models/incremental.py | 1 | 5873 | from uuid import uuid4
from django.db import models
from couchexport.models import Format
from corehq.apps.export.dbaccessors import get_properly_wrapped_export_instance
from corehq.apps.export.export import (
ExportFile,
get_export_query,
get_export_writer,
write_export_instance,
)
from corehq.apps.... | bsd-3-clause | 67fc8b3fc47bd4a138bafb63ec6dd877 | 34.593939 | 115 | 0.674442 | 3.92318 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/initiatives/migrations/0018_auto_20191106_0928.py | 1 | 2363 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-11-06 08:28
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import multiselectfield.db.fields
class Migration(migrations.Migration):
dependencies = [
... | bsd-3-clause | 4f7c842ffab273a02550a8d86ea1fb17 | 44.442308 | 246 | 0.629285 | 3.938333 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/sms/migrations/0003_add_backend_models.py | 1 | 7399 | from django.db import migrations, models
import jsonfield.fields
import dimagi.utils.couch.migration
class Migration(migrations.Migration):
dependencies = [
('sms', '0002_add_selfregistrationinvitation'),
]
operations = [
migrations.CreateModel(
name='SQLMobileBackend',
... | bsd-3-clause | 01d07c72502026b18ec236f77f5f2b48 | 34.572115 | 415 | 0.487093 | 4.650534 | false | false | false | false |
dimagi/commcare-hq | corehq/form_processor/models/util.py | 1 | 1551 | from collections import namedtuple
from functools import lru_cache
from itertools import groupby
from corehq.util.metrics import metrics_counter
def fetchall_as_namedtuple(cursor):
"Return all rows from a cursor as a namedtuple generator"
Result = _get_result_tuple(tuple(col[0] for col in cursor.description)... | bsd-3-clause | 63284e25d163a557a03ce86574b00bf1 | 32 | 98 | 0.69568 | 3.541096 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/linked_domain/management/commands/unlink_apps.py | 1 | 2368 | from django.core.management.base import BaseCommand
from couchdbkit import ResourceNotFound
from corehq.apps.app_manager.models import Application
from corehq.apps.linked_domain.models import DomainLink, DomainLinkHistory
class Command(BaseCommand):
help = "Unlinks linked project spaces and converts the downstr... | bsd-3-clause | 7e0a05b7cdb122afaf3b94982d4ce119 | 37.193548 | 106 | 0.619088 | 4.251346 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/cms/migrations/0051_auto_20171024_1631.py | 1 | 3129 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-10-24 14:31
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cms', '0050_auto_20171024_1623'),
]
operations = [
migrations.AlterField(
... | bsd-3-clause | 321f73aa7fabfb05bed77612734f975a | 33.766667 | 74 | 0.563439 | 4.239837 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/impact/migrations/0011_auto_20200812_1038.py | 1 | 1042 | from __future__ import unicode_literals
from django.db import migrations, connection
from bluebottle.utils.utils import update_group_permissions
from bluebottle.clients import properties
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
def add_group_permissions(apps, sc... | bsd-3-clause | 90b8534cbcfd1b795861d47a0bb90c83 | 26.421053 | 79 | 0.633397 | 4.378151 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/organizations/tests/test_api.py | 1 | 11107 |
from future import standard_library
standard_library.install_aliases()
from urllib.parse import urlencode
import json
from django.urls import reverse
from rest_framework import status
from bluebottle.organizations.models import Organization
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
fr... | bsd-3-clause | 93954950b63bc3ece6e26d6d35dd704d | 33.493789 | 99 | 0.603403 | 4.218382 | false | true | false | false |
dimagi/commcare-hq | corehq/toggles/shortcuts.py | 1 | 2930 | from couchdbkit import ResourceNotFound
from django.conf import settings
from .models import Toggle
def toggle_enabled(slug, item, namespace=None):
"""
Given a toggle and a username, whether the toggle is enabled for that user
"""
from corehq.toggles import NAMESPACE_EMAIL_DOMAIN
if namespace == ... | bsd-3-clause | a4c91be28e499b1f0dd1b1285b61279b | 35.17284 | 101 | 0.66587 | 3.845144 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/pages/content_plugins.py | 1 | 1124 | from django.utils.translation import gettext_lazy as _
from fluent_contents.extensions import plugin_pool, ContentPlugin
from bluebottle.pages.models import ImageTextItem, DocumentItem, ActionItem, ColumnsItem, ImageTextRoundItem
@plugin_pool.register
class ImageTextPlugin(ContentPlugin):
model = ImageTextItem
... | bsd-3-clause | f42308acf9eaab65659032ac3c6c4edc | 27.1 | 108 | 0.759786 | 3.836177 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/hqadmin/management/commands/republish_doc_changes.py | 1 | 2669 | import csv
from django.core.management import BaseCommand, CommandError
from memoized import memoized
from corehq.apps.change_feed import data_sources, topics
from corehq.apps.change_feed.producer import producer
from corehq.apps.hqadmin.management.commands.stale_data_in_es import DataRow, HEADER_ROW, get_csv_args
fr... | bsd-3-clause | ef82dd1ffc450a922cffd1d8ecf4fb06 | 36.069444 | 102 | 0.65118 | 3.553928 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/users/models.py | 1 | 116453 | import hmac
import json
import logging
import re
from collections import namedtuple
from datetime import datetime, date
from hashlib import sha1
from typing import List
from uuid import uuid4
from xml.etree import cElementTree as ElementTree
from django.conf import settings
from django.contrib.auth.models import User
... | bsd-3-clause | fa1222eda9f10503a3b0a31d0fa4e408 | 36.969677 | 114 | 0.616618 | 4.027704 | false | false | false | false |
dimagi/commcare-hq | corehq/sql_db/operations.py | 1 | 5753 | import os
import re
from django.conf import settings
from django.db import router
from django.db.migrations import RunPython, RunSQL
from django.template import engines
import attr
from corehq.util.django_migrations import noop_migration
NOOP = object()
class IndexRenameOperationException(Exception):
pass
c... | bsd-3-clause | 5bc244fcda6aa4aace552831675d3775 | 34.294479 | 102 | 0.652703 | 4.059986 | false | false | false | false |
dimagi/commcare-hq | corehq/messaging/scheduling/models/content.py | 1 | 18514 | import jsonfield as old_jsonfield
from contextlib import contextmanager
from copy import deepcopy
from datetime import datetime
from corehq import toggles
from corehq.apps.accounting.utils import domain_is_on_trial
from corehq.apps.app_manager.dbaccessors import get_app, get_latest_released_app
from corehq.apps.app_ma... | bsd-3-clause | 394d9d757637633f203c87ca4c6d6712 | 38.987041 | 114 | 0.643999 | 4.178289 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/userreports/reports/factory.py | 1 | 9217 | import json
from django.conf import settings
from django.utils.translation import gettext as _
from jsonobject.exceptions import BadValueError
from corehq.apps.userreports.const import (
AGGGREGATION_TYPE_ARRAY_AGG_LAST_VALUE,
)
from corehq.apps.userreports.exceptions import BadSpecError
from corehq.apps.userrep... | bsd-3-clause | af520d09eea3d587f83d23fd76f7a7c4 | 37.890295 | 112 | 0.685364 | 3.65754 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/linked_domain/view_helpers.py | 1 | 14273 | from django.utils.translation import gettext as _
from corehq.apps.app_manager.dbaccessors import get_brief_apps_in_domain
from corehq.apps.app_manager.util import is_linked_app
from corehq.apps.fixtures.models import LookupTable
from corehq.apps.linked_domain.const import (
DOMAIN_LEVEL_DATA_MODELS,
FEATURE_F... | bsd-3-clause | 2d0d1c34c5929f0f7b3b7a569d8bf933 | 33.227818 | 112 | 0.654032 | 3.762984 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/registry/signals.py | 1 | 1763 | from django.dispatch import Signal, receiver
from corehq.apps.registry.notifications import (
send_invitation_email,
send_invitation_response_email,
send_grant_email,
)
data_registry_activated = Signal() # providing args: registry
data_registry_deactivated = Signal() # providing args: registry
data_regi... | bsd-3-clause | d5a2f18ba57c8d17dce92cbe6c75dbd5 | 45.394737 | 101 | 0.757232 | 3.832609 | false | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.