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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dimagi/commcare-hq | corehq/extensions/interface.py | 1 | 5498 | import importlib
import inspect
import itertools
import logging
from contextlib import contextmanager
from enum import Enum
from dimagi.utils.logging import notify_exception
from dimagi.utils.modules import to_function
logger = logging.getLogger("commcare.extensions")
class ExtensionError(Exception):
pass
cla... | bsd-3-clause | 3f1874e4353b78356779b9f422cfd85c | 31.341176 | 100 | 0.618952 | 4.451822 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/projects/migrations/0031_fix_migration_projectstatuslog_creation_20170721_1637.py | 1 | 1247 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-07-21 14:37
from __future__ import unicode_literals
from django.db import migrations, connection
def forward(apps, schema_editor):
with connection.cursor() as cursor:
cursor.execute("SELECT applied FROM django_migrations WHERE name='0010_fix_ex... | bsd-3-clause | e66885b2cf76e4f894eed3c584dedd46 | 34.628571 | 114 | 0.694467 | 3.778788 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/time_based/migrations/0058_auto_20210224_1027.py | 1 | 1063 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2021-01-14 09:56
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 | 43ca159e08f5456c8c4398203472e617 | 26.973684 | 94 | 0.647225 | 4.072797 | false | false | false | false |
dimagi/commcare-hq | corehq/messaging/scheduling/scheduling_partitioned/tests/test_dbaccessors_non_partitioned.py | 1 | 9230 | import uuid
from django.db import DEFAULT_DB_ALIAS
from corehq.form_processor.tests.utils import only_run_with_non_partitioned_database
from corehq.messaging.scheduling.scheduling_partitioned.dbaccessors import (
get_alert_schedule_instance,
get_timed_schedule_instance,
save_alert_schedule_instance,
s... | bsd-3-clause | fe11a207b15da739b1764587e7ae7f07 | 40.022222 | 108 | 0.682124 | 3.879781 | false | true | false | false |
dimagi/commcare-hq | corehq/tests/util/artifact.py | 1 | 1235 | import os
import logging
from contextlib import contextmanager
logger = logging.getLogger(__name__)
ROOT_ARTIFACTS_DIR = "artifacts"
@contextmanager
def artifact(filename, stream, mode="b", sub_name=None):
"""Context manager for writing artifact files on failure/error.
:param filename: name of the artifact... | bsd-3-clause | 91852bb5e3e9d79ccc9a1aa2812abf52 | 34.285714 | 78 | 0.646964 | 3.933121 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/projects/migrations/0069_auto_20180316_1553.py | 1 | 1283 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-03-16 14:53
from __future__ import unicode_literals
import bluebottle.utils.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects', '0068_auto_20180306_1614'),
]
operations ... | bsd-3-clause | f316671164092868906606321679fbb9 | 31.897436 | 162 | 0.599376 | 4.179153 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/funding/models.py | 1 | 23992 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import random
import string
from builtins import object
from builtins import range
from babel.numbers import get_currency_name
from django.core.cache import cache
from django.core.exceptions import ValidationError
from django.db import conn... | bsd-3-clause | dc6d0cff99e42282616c12a07af3aad8 | 30.989333 | 119 | 0.628168 | 4.15878 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/app_manager/migrations/0009_resourceoverride.py | 1 | 1077 | # Generated by Django 1.11.22 on 2019-11-01 22:02
from django.core.management import call_command
from django.db import migrations, models
from corehq.util.django_migrations import skip_on_fresh_install
class Migration(migrations.Migration):
dependencies = [
('app_manager', '0008_remove_uses_master_app... | bsd-3-clause | d09e48cecb27bf7dddfd0b10b2390fc9 | 33.741935 | 114 | 0.588672 | 4.033708 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/data_interfaces/migrations/0006_case_rule_refactor.py | 1 | 4903 | # Generated by Django 1.10.6 on 2017-04-04 12:54
import django.db.models.deletion
from django.db import migrations, models
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('data_interfaces', '0005_remove_match_type_choices'),
]
operations = [
migrations.... | bsd-3-clause | 44a4661644ed84f64f39870214776b78 | 39.188525 | 138 | 0.567408 | 4.586529 | false | false | false | false |
dimagi/commcare-hq | corehq/ex-submodules/casexml/apps/phone/data_providers/case/livequery.py | 1 | 15756 | """Restore logic implementation aiming to minimize database queries
Example case graphs with outcomes:
a <--ext-- d(owned) >> a b d
<--ext-- b
e(owned) --ext--> a(closed) >> a b e
--ext--> b
b(closed) <--chi-- a(owned) >> a b c
<--ext-- c
a(closed) <--ext--... | bsd-3-clause | 3be06335ed13cab4346ea95f23145050 | 36.514286 | 115 | 0.603833 | 3.864606 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/events/migrations/0004_add_permissions.py | 1 | 1384 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-05-15 10:40
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 | 7bf292540211eb13472b045520254377 | 27.244898 | 83 | 0.567919 | 4.393651 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/projects/migrations/0031_add_project_roles.py | 1 | 1127 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-08-10 20:09
from __future__ import unicode_literals
import bluebottle.utils.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
... | bsd-3-clause | 4089fd71c5834c53ada1642002f1cc16 | 37.862069 | 225 | 0.674357 | 3.820339 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/hqwebapp/session_details_endpoint/views.py | 1 | 3146 | import json
from django.http import Http404, HttpResponse, HttpResponseBadRequest, JsonResponse
from django.utils.decorators import method_decorator
from django.views import View
from django.views.decorators.csrf import csrf_exempt
from corehq import toggles
from corehq.apps.domain.auth import formplayer_auth
from co... | bsd-3-clause | c8982ad724a31cf55e005d67ec9fd817 | 37.839506 | 105 | 0.674507 | 4.038511 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/linked_domain/migrations/0018_auto_20210806_1526.py | 1 | 1341 | # Generated by Django 2.2.24 on 2021-08-06 15:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('linked_domain', '0017_add_tableau_choice_20210720_1908'),
]
operations = [
migrations.AlterField(
model_name='domainlinkhistory... | bsd-3-clause | f3d884b2bdfc8e5e2a21a836c110af16 | 37.314286 | 91 | 0.525727 | 4.530405 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/userreports/forms.py | 1 | 1412 | from django import forms
from django.utils.translation import gettext_lazy as _
from crispy_forms import layout as crispy
from corehq.apps.hqwebapp.crispy import HQFormHelper
from corehq.apps.userreports.models import UCRExpression
from corehq.apps.userreports.ui.fields import JsonField
class UCRExpressionForm(form... | bsd-3-clause | fed9bfd61d230142abb6e56717c731c3 | 31.837209 | 105 | 0.594901 | 4.069164 | false | false | false | false |
dimagi/commcare-hq | corehq/messaging/smsbackends/grapevine/models.py | 1 | 8527 | from xml.etree import cElementTree as ElementTree
from django.http import HttpResponse
from tastypie.authentication import Authentication
from tastypie.authorization import Authorization
from tastypie.resources import Resource
from tastypie.serializers import Serializer
from tastypie.throttle import CacheThrottle
from... | bsd-3-clause | a645195b93b619ce1d423e2a670ccce7 | 31.545802 | 99 | 0.628122 | 3.886509 | false | false | false | false |
onepercentclub/bluebottle | scripts/tne_campaign_ranking.py | 1 | 1881 | from datetime import date
import xlsxwriter
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from bluebottle.funding.models import Funding, Donor
from bluebottle.geo.models import Location
OFFICE_NAME = 'Mogadishu'
TARGET = 500
DEADLINES = [date(2022, 8, 20), date(2022, ... | bsd-3-clause | 5cf058f3114c781965c1ca3f5b0e1ff1 | 28.390625 | 109 | 0.56034 | 4.08913 | false | false | false | false |
dimagi/commcare-hq | corehq/blobs/management/commands/emergency_restore_blobs_for_domain.py | 1 | 3267 | # credit to Danny Roberts for the bulk of this code
from gzip import GzipFile
from io import BytesIO
from django.core.management import BaseCommand
from corehq.blobs import get_blob_db
from corehq.blobs.models import BlobMeta, DeletedBlobMeta
from corehq.form_processor.models.forms import XFormInstance
class Comman... | bsd-3-clause | b5de3d0cf130187c4a9bc4b691a8190e | 36.551724 | 114 | 0.712886 | 3.41023 | false | true | false | false |
dimagi/commcare-hq | corehq/util/public_only_requests/public_only_requests.py | 1 | 1355 | import requests
from requests.adapters import HTTPAdapter
def get_public_only_session(domain_name, src):
session = requests.Session()
make_session_public_only(session, domain_name, src)
return session
def make_session_public_only(session, domain_name, src):
"""
Modifies `session` to validate url... | bsd-3-clause | ca06750a5170507d0734d959d8a8b691 | 40.060606 | 100 | 0.721033 | 3.938953 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/funding/tests/test_api.py | 1 | 67859 | import json
from datetime import timedelta
from io import BytesIO
import mock
import munch
import stripe
from django.contrib.auth.models import Group
from django.urls import reverse
from django.utils.timezone import now
from moneyed import Money
from openpyxl import load_workbook
from rest_framework import status
from... | bsd-3-clause | cd391a0fac53ed28d3f36d3cc97a38d7 | 35.207577 | 120 | 0.565531 | 4.075011 | false | true | false | false |
onepercentclub/bluebottle | bluebottle/cms/migrations/0034_auto_20171017_1549.py | 1 | 2175 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-10-17 13:49
from __future__ import unicode_literals
import bluebottle.utils.fields
from django.db import migrations, models
import django.db.models.manager
class Migration(migrations.Migration):
dependencies = [
('cms', '0033_auto_20171017_135... | bsd-3-clause | c77f8ac4b0540c3d45b7f67cc959f77b | 35.864407 | 154 | 0.590345 | 4.182692 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/userreports/indicators/factory.py | 1 | 6076 | from django.utils.translation import gettext as _
from jsonobject.exceptions import BadValueError
from corehq.apps.userreports.exceptions import BadSpecError
from corehq.apps.userreports.expressions.factory import ExpressionFactory
from corehq.apps.userreports.filters import (
CustomFilter,
SinglePropertyValu... | bsd-3-clause | 38112e7bd19fcddabe421083b8b7cab0 | 30.481865 | 101 | 0.658986 | 4.086079 | false | false | false | false |
dimagi/commcare-hq | corehq/pillows/mappings/xform_mapping.py | 1 | 7616 | from corehq.apps.es.forms import form_adapter
from corehq.pillows.core import DATE_FORMATS_STRING, DATE_FORMATS_ARR
from corehq.pillows.mappings.const import NULL_VALUE
from corehq.util.elastic import prefix_for_tests
from pillowtop.es_utils import ElasticsearchIndexInfo, XFORM_HQ_INDEX_NAME
XFORM_INDEX = form_adapter... | bsd-3-clause | 7bf657bccf8ad4ad943239a9b3f3cf89 | 31.969697 | 86 | 0.329438 | 4.977778 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/hqcase/api/get_bulk.py | 1 | 2768 | import dataclasses
from dataclasses import dataclass, field
from corehq.apps.es.case_search import CaseSearchES, case_search_adapter
from corehq.apps.hqcase.api.core import UserError, serialize_es_case
from corehq.apps.hqcase.api.get_list import MAX_PAGE_SIZE
@dataclass
class BulkFetchResults:
cases: list = fiel... | bsd-3-clause | 0373d962fcd9326759fbd779165b146b | 31.186047 | 92 | 0.677384 | 3.447073 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/users/bulk_download.py | 1 | 17577 | import uuid
from django.conf import settings
from django.utils.translation import gettext
from corehq.apps.enterprise.models import EnterpriseMobileWorkerSettings
from couchexport.writers import Excel2007ExportWriter
from soil import DownloadBase
from soil.util import expose_download, get_download_file_path
from cor... | bsd-3-clause | 5bbb82a649950e4fbc1ed739d3e7283b | 36.082278 | 111 | 0.648063 | 3.642147 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/hqadmin/management/commands/clean_2fa_sessions.py | 1 | 3913 | from distutils.version import LooseVersion
from getpass import getpass
from importlib import import_module
from pkg_resources import DistributionNotFound, get_distribution
from django.conf import settings
from django.core.cache import caches
from django.core.management.base import BaseCommand
class Command(BaseComma... | bsd-3-clause | c8673b58118d9ea397270f5af000d700 | 32.444444 | 101 | 0.626885 | 4.02572 | false | false | false | false |
dimagi/commcare-hq | custom/reports/mc/reports/models.py | 1 | 4466 | import json
from corehq.apps.fixtures.models import LookupTable, LookupTableRow
from corehq.apps.reports.filters.base import BaseReportFilter
from django.urls import reverse
class AsyncDrillableFilter(BaseReportFilter):
# todo: add documentation
# todo: cleanup template
"""
example_hierarchy = [{"type... | bsd-3-clause | 88e48294f10ae49fd46d84dace6935f0 | 38.875 | 115 | 0.512315 | 3.94523 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/ivr/migrations/0001_initial.py | 1 | 3352 | import django.db.models.deletion
from django.db import migrations, models
import dimagi.utils.couch.migration
class Migration(migrations.Migration):
dependencies = [
('sms', '0012_add_lastreadmessage_expectedcallback'),
]
operations = [
migrations.CreateModel(
name='Call',
... | bsd-3-clause | b6cf8c7e9cb0470e225c159df84446eb | 58.857143 | 142 | 0.599344 | 4 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/api/domain_metadata.py | 1 | 6313 | import logging
from tastypie import fields
from tastypie.exceptions import NotFound
from tastypie.resources import ModelResource, Resource
from dimagi.utils.dates import force_to_datetime
from corehq.apps.accounting.models import Subscription
from corehq.apps.api.resources import CouchResourceMixin, HqBaseResource
f... | bsd-3-clause | 63b45d6f228c8d94391869a370ec25f5 | 37.969136 | 114 | 0.609377 | 4.123449 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/funding/migrations/0053_auto_20200320_1457.py | 1 | 1092 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2020-03-20 13:57
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('funding', '0052_auto_20200205_1710'),
]
operations = [
migrations.AddField... | bsd-3-clause | 0f7ac1f2cd3f22a638ffd87f0ff2ac22 | 35.4 | 202 | 0.627289 | 4.316206 | false | false | false | false |
dimagi/commcare-hq | corehq/ex-submodules/dimagi/utils/rate_limit.py | 1 | 1605 | from dimagi.utils.couch.cache.cache_core import get_redis_client
# todo: should this be replaced project_limits.RateLimiter?
def rate_limit(key, actions_allowed=60, how_often=60):
"""
A simple util to be used for rate limiting, using redis as a backend.
key - a unique key which describes the action you a... | bsd-3-clause | 46feee3d60d311dffcfdebfae0b1ab24 | 37.214286 | 81 | 0.685358 | 3.98263 | false | false | false | false |
dimagi/commcare-hq | corehq/messaging/smsbackends/mach/forms.py | 1 | 1186 | from django.forms.fields import *
from corehq.apps.sms.forms import BackendForm
from dimagi.utils.django.fields import TrimmedCharField
from django.core.exceptions import ValidationError
from crispy_forms import layout as crispy
from django.utils.translation import gettext_lazy as _
class MachBackendForm(BackendForm)... | bsd-3-clause | 3fd6c58bce88e62f266f669a185a5b4c | 28.65 | 73 | 0.623103 | 4.205674 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/time_based/migrations/0005_application.py | 1 | 1755 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2020-10-21 11:15
from __future__ import unicode_literals
import bluebottle.files.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('files', '0007_auto_20201021... | bsd-3-clause | 3979da9c41ed036cbf2d5e5bb93e2575 | 53.84375 | 604 | 0.65584 | 4.208633 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/activities/models.py | 1 | 10463 | import uuid
from builtins import str, object
from django.contrib.contenttypes.fields import GenericRelation
from django.db import models
from django.template.defaultfilters import slugify
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from djchoices.choices import DjangoChoice... | bsd-3-clause | 23c2c95c6954c60ce5a299d45f9ee42c | 30.89939 | 103 | 0.65507 | 4.160239 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/sso/models.py | 1 | 19475 | from django.db import models
from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
from django.urls import reverse
from corehq.apps.accounting.models import BillingAccount, Subscription
from corehq.apps.sso import certificates
from corehq.apps.sso.exceptions import ServicePro... | bsd-3-clause | cf84f31ccd66bac46fe1ca11c8aede5a | 37.640873 | 114 | 0.671784 | 4.173811 | false | false | false | false |
dimagi/commcare-hq | corehq/form_processor/track_related.py | 1 | 2581 | from collections import defaultdict
class TrackRelatedChanges(object):
def __init__(self):
self.create_models = defaultdict(list)
self.update_models = defaultdict(list)
self.delete_models = defaultdict(list)
def has_tracked_models(self, model_class=None):
return any((
... | bsd-3-clause | fc5e46da7665dbb84b3c2d4716f1cfec | 35.352113 | 89 | 0.649748 | 3.806785 | false | false | false | false |
onepercentclub/bluebottle | bluebottle/utils/admin.py | 1 | 6945 | import csv
import datetime
from builtins import str
import six
from django.contrib import admin
from django.contrib.admin.models import CHANGE, LogEntry
from django.contrib.admin.views.main import ChangeList
from django.contrib.contenttypes.models import ContentType
from django.db.models.aggregates import Sum
from dja... | bsd-3-clause | cbcc028ffb98312d0de020d0771cb2cd | 33.552239 | 93 | 0.640605 | 4.186257 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/products/models.py | 1 | 10235 | from datetime import datetime
from decimal import Decimal
from django.db import models
from django.utils.translation import gettext as _
import jsonfield
from couchdbkit.exceptions import ResourceNotFound
from dimagi.ext.couchdbkit import (
BooleanProperty,
DateTimeProperty,
DecimalProperty,
DictProp... | bsd-3-clause | f54aa29cc9b5363206d7fe514ceeaabc | 29.014663 | 105 | 0.58681 | 4.127016 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/oauth_integrations/tests/test_util.py | 1 | 2776 | from datetime import datetime
from django.test import SimpleTestCase, TestCase
from django.contrib.auth.models import User
from google.oauth2.credentials import Credentials
from corehq.apps.oauth_integrations.models import GoogleApiToken
from corehq.apps.oauth_integrations.utils import get_token, load_credentials, s... | bsd-3-clause | 83fe661adaa9b76ae15c42059b2c3706 | 30.191011 | 110 | 0.627882 | 4.118694 | false | true | false | false |
onepercentclub/bluebottle | bluebottle/collect/migrations/0006_auto_20210927_1047.py | 1 | 2243 | # Generated by Django 2.2.24 on 2021-09-27 08:47
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('geo', '0027_auto_20210927_1047'),
('collect', '0005_auto_20210922_1502'),
]
operations = [
migrati... | bsd-3-clause | 037f777d211c82bc1d3c8ae95bf8d83d | 79.107143 | 819 | 0.700401 | 4.296935 | false | false | false | false |
dimagi/commcare-hq | corehq/ex-submodules/dimagi/utils/couch/debugdb/debugdatabase.py | 1 | 7563 | __author__ = 'dmyung'
from datetime import datetime
from couchdbkit import Database
from dimagi.utils.couch.debugdb import tidy_stacktrace, SQL_WARNING_THRESHOLD, process_key, ms_from_timedelta
#taken from the django debug toolbar sql panel
import traceback
import couchdbkit
from couchdbkit import resource, ResourceNo... | bsd-3-clause | ae9bf09a250aa8675db22633265df4d8 | 31.182979 | 109 | 0.538146 | 4.169239 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/linked_domain/migrations/0013_auto_20201005_2215.py | 1 | 1435 | # Generated by Django 2.2.16 on 2020-10-05 22:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('linked_domain', '0012_auto_20200929_0809'),
]
operations = [
migrations.AlterField(
model_name='domainlinkhistory',
... | bsd-3-clause | a083aed09a6404629dec3f5b930270b6 | 48.482759 | 113 | 0.432753 | 5.583658 | false | false | false | false |
dimagi/commcare-hq | corehq/apps/users/urls.py | 1 | 10514 | from django.conf.urls import include, re_path as url
from corehq.apps.domain.utils import grandfathered_domain_re
from corehq.apps.reports.dispatcher import UserManagementReportDispatcher
from .views import (
DefaultProjectUserSettingsView,
EditWebUserView,
EnterpriseUsersView,
InviteWebUserView,
... | bsd-3-clause | 5c02ea13832b37fe262389f205722d19 | 40.070313 | 115 | 0.653985 | 3.208422 | false | false | true | false |
strands-project/mongodb_store | mongodb_store/tests/test_replication.py | 1 | 4431 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: furushchev <furushchev@jsk.imi.i.u-tokyo.ac.jp>
import os
from bson import json_util
import pymongo
import rospy
import subprocess
import unittest
from mongodb_store.util import import_MongoClient, wait_for_mongo
from mongodb_store.message_store import MessageSto... | bsd-3-clause | 71c52ba685108788870f1d3fe2f5a4ed | 38.918919 | 89 | 0.633717 | 4.050274 | false | true | false | false |
strands-project/mongodb_store | mongodb_store/src/mongodb_store/message_store.py | 1 | 12718 | from __future__ import absolute_import
import rospy
import mongodb_store_msgs.srv as dc_srv
import mongodb_store.util as dc_util
from mongodb_store_msgs.msg import StringPair, StringPairList, SerialisedMessage, Insert
from bson import json_util
from bson.objectid import ObjectId
import json
import copy
class MessageS... | bsd-3-clause | cac8749c759f779fd3fcf8134619501d | 45.586081 | 205 | 0.609844 | 4.267785 | false | false | false | false |
uwescience/myria-web | appengine/networkx/readwrite/json_graph/adjacency.py | 14 | 2989 | # Copyright (C) 2011 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from copy import deepcopy
from itertools import count,repeat
import json
import networkx as nx
__author__ = """Aric Hagberg (hagberg@lanl.... | bsd-3-clause | f0dcd155f8fdb25a79cc71a0f069d14e | 25.927928 | 78 | 0.590498 | 3.793147 | false | false | false | false |
uwescience/myria-web | appengine/networkx/algorithms/isomorphism/matchhelpers.py | 35 | 12220 | """Functions which help end users define customize node_match and
edge_match functions to use during isomorphism checks.
"""
from itertools import permutations
import types
import networkx as nx
__all__ = ['categorical_node_match',
'categorical_edge_match',
'categorical_multiedge_match',
... | bsd-3-clause | 49dc119310ff97a5a00c3f8977014a21 | 34.317919 | 86 | 0.617512 | 3.981753 | false | false | false | false |
uwescience/myria-web | appengine/networkx/utils/rcm.py | 15 | 4562 | """
Cuthill-McKee ordering of graph nodes to produce sparse matrices
"""
# Copyright (C) 2011 by
# Aric Hagberg <hagberg@lanl.gov>
# All rights reserved.
# BSD license.
from operator import itemgetter
import networkx as nx
__author__ = """\n""".join(['Aric Hagberg <aric.hagberg@gmail.com>'])
__all__ = ['cu... | bsd-3-clause | 7e7fe4c9c862763c00cb6a35bbaf1b0a | 29.413333 | 77 | 0.600833 | 3.511932 | false | false | false | false |
uwescience/myria-web | appengine/networkx/algorithms/centrality/tests/test_load_centrality.py | 3 | 7544 | #!/usr/bin/env python
from nose.tools import *
import networkx as nx
class TestLoadCentrality:
def setUp(self):
G=nx.Graph();
G.add_edge(0,1,weight=3)
G.add_edge(0,2,weight=2)
G.add_edge(0,3,weight=6)
G.add_edge(0,4,weight=4)
G.add_edge(1,3,weight=5)
G.add... | bsd-3-clause | 11b518c2d312d9683d084598eef486ea | 28.818182 | 76 | 0.462089 | 2.897081 | false | true | false | false |
uwescience/myria-web | appengine/networkx/tests/test.py | 96 | 1244 | #!/usr/bin/env python
import sys
from os import path,getcwd
def run(verbosity=1,doctest=False,numpy=True):
"""Run NetworkX tests.
Parameters
----------
verbosity: integer, optional
Level of detail in test reports. Higher numbers provide more detail.
doctest: bool, optional
True to... | bsd-3-clause | 7b82f5ff9670a8273b6ea08d1945b164 | 26.644444 | 78 | 0.611736 | 4.160535 | false | true | false | false |
uwescience/myria-web | appengine/networkx/algorithms/link_analysis/pagerank_alg.py | 3 | 12801 | """
PageRank analysis of graph structure.
"""
# Copyright (C) 2004-2010 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
# NetworkX:http://networkx.lanl.gov/.
import networkx as nx
from networkx.exception... | bsd-3-clause | 3af7eb800d088d98601ae8f0d1f86e78 | 31.823077 | 90 | 0.624639 | 3.823477 | false | false | false | false |
uwescience/myria-web | appengine/networkx/algorithms/centrality/tests/test_betweenness_centrality.py | 85 | 17053 | #!/usr/bin/env python
from nose.tools import *
import networkx as nx
def weighted_G():
G=nx.Graph();
G.add_edge(0,1,weight=3)
G.add_edge(0,2,weight=2)
G.add_edge(0,3,weight=6)
G.add_edge(0,4,weight=4)
G.add_edge(1,3,weight=5)
G.add_edge(1,5,weight=5)
G.add_edge(2,4,weight=1)
G.add_e... | bsd-3-clause | e4c905893137d5969fd7344e7aa22848 | 35.911255 | 80 | 0.455756 | 3.260612 | false | true | false | false |
uwescience/myria-web | appengine/networkx/algorithms/bipartite/spectral.py | 76 | 2538 | # -*- coding: utf-8 -*-
"""
Spectral bipartivity measure.
"""
import networkx as nx
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
# Copyright (C) 2011 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
__a... | bsd-3-clause | 7668364107dc9a3a707cc3418a6d9620 | 27.818182 | 76 | 0.606073 | 3.745938 | false | false | false | false |
uwescience/myria-web | appengine/networkx/algorithms/centrality/current_flow_closeness.py | 3 | 4287 | """
Current-flow closeness centrality measures.
"""
# Copyright (C) 2010 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
__author__ = """Aric Hagberg <aric.hagberg@gmail.com>"""
__all__ = ['current_flow_cl... | bsd-3-clause | e2d6011c0a84b9ce087368d48568863b | 32.492188 | 79 | 0.627245 | 3.705272 | false | false | false | false |
uwescience/myria-web | appengine/networkx/algorithms/assortativity/mixing.py | 93 | 6746 | #-*- coding: utf-8 -*-
"""
Mixing matrices for node attributes and degree.
"""
import networkx as nx
from networkx.utils import dict_to_numpy_array
from networkx.algorithms.assortativity.pairs import node_degree_xy, \
node_attribute_xy
__author__ = ' '.join(['Aric Hagberg <aric.hagberg@gmail.com>'])
__all__ = ['att... | bsd-3-clause | c5198411e000f6c99c2a29c6b7beada3 | 26.201613 | 80 | 0.607916 | 3.97525 | false | false | false | false |
uwescience/myria-web | appengine/networkx/linalg/attrmatrix.py | 78 | 15994 | """
Functions for constructing matrix-like objects from graph attributes.
"""
__all__ = ['attr_matrix', 'attr_sparse_matrix']
import networkx as nx
def _node_value(G, node_attr):
"""Returns a function that returns a value from G.node[u].
We return a function expecting a node as its sole argument. Th... | bsd-3-clause | b7e94d24dc4ff3ca3fea11f28063d70d | 33.921397 | 88 | 0.587533 | 3.883924 | false | false | false | false |
uwescience/myria-web | appengine/networkx/readwrite/json_graph/tests/test_adjacency.py | 14 | 1269 | import json
from nose.tools import assert_equal, assert_raises, assert_not_equal,assert_true
import networkx as nx
from networkx.readwrite.json_graph import *
class TestAdjacency:
def test_graph(self):
G = nx.path_graph(4)
H = adjacency_graph(adjacency_data(G))
nx.is_isomorphic(G,H)
d... | bsd-3-clause | ae0c351e0a70f1db4529995752e2678b | 29.95122 | 80 | 0.583136 | 3.148883 | false | true | false | false |
uwescience/myria-web | appengine/networkx/algorithms/boundary.py | 49 | 2604 | """
Routines to find the boundary of a set of nodes.
Edge boundaries are edges that have only one end
in the set of nodes.
Node boundaries are nodes outside the set of nodes
that have an edge to a node in the set.
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)\nPieter Swart (swart@lanl.gov)\nDan Schult (dschu... | bsd-3-clause | f899d9ac07dc4b112980e86417164d5c | 24.529412 | 115 | 0.623272 | 3.35567 | false | false | false | false |
uwescience/myria-web | appengine/networkx/algorithms/centrality/eigenvector.py | 3 | 5085 | """
Eigenvector centrality.
"""
# Copyright (C) 2004-2011 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
__author__ = "\n".join(['Aric Hagberg (hagberg@lanl.gov)',
... | bsd-3-clause | f928fcb67943fad279833c8ce6f77139 | 28.393064 | 79 | 0.611996 | 3.719824 | false | false | false | false |
uwescience/myria-web | appengine/networkx/algorithms/clique.py | 3 | 16137 | """
=======
Cliques
=======
Find and manipulate cliques of graphs.
Note that finding the largest clique of a graph has been
shown to be an NP-complete problem; the algorithms here
could take a long time to run.
http://en.wikipedia.org/wiki/Clique_problem
"""
__author__ = """Dan Schult (dschult@colgate.edu)"""
# ... | bsd-3-clause | ba26ce1c3120822ad3115279867fb0c0 | 29.913793 | 78 | 0.591436 | 3.533392 | false | false | false | false |
uwescience/myria-web | appengine/networkx/readwrite/graphml.py | 3 | 19224 | """
*******
GraphML
*******
Read and write graphs in GraphML format.
This implementation does not support mixed graphs (directed and unidirected
edges together), hyperedges, nested graphs, or ports.
"GraphML is a comprehensive and easy-to-use file format for graphs. It
consists of a language core to describe the st... | bsd-3-clause | 5ec33b44c904184f197dbc1ea04916e9 | 36.328155 | 80 | 0.567 | 3.984249 | false | false | false | false |
uwescience/myria-web | appengine/networkx/linalg/spectrum.py | 35 | 2271 | """
Eigenvalue spectrum of graphs.
"""
# Copyright (C) 2004-2011 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
__author__ = "\n".join(['Aric Hagberg (hagberg@lanl.gov)',
... | bsd-3-clause | cb045accd16b646882f0975bf5af718f | 24.233333 | 68 | 0.613827 | 3.929066 | false | false | false | false |
xia2/xia2 | src/xia2/Modules/SSX/data_integration_standard.py | 1 | 29598 | from __future__ import annotations
import functools
import json
import logging
import math
import os
import pathlib
import subprocess
from dataclasses import asdict, dataclass, field
from typing import List, Optional, Tuple
import numpy as np
import libtbx.easy_mp
from dials.algorithms.clustering.unit_cell import Cl... | bsd-3-clause | 7f970b39e6d251c41fdb28e753ad9651 | 35.9975 | 127 | 0.631799 | 3.816142 | false | false | false | false |
xia2/xia2 | src/xia2/Wrappers/Dials/Reindex.py | 1 | 3848 | from __future__ import annotations
import logging
import os
from xia2.Driver.DriverFactory import DriverFactory
logger = logging.getLogger("xia2.Wrappers.Dials.Reindex")
def Reindex(DriverType=None):
"""A factory for ReindexWrapper classes."""
DriverInstance = DriverFactory.Driver(DriverType)
class R... | bsd-3-clause | bbc1ef330cb9abbc3b673cb9d7292832 | 36.72549 | 82 | 0.575364 | 4.237885 | false | false | false | false |
xia2/xia2 | src/xia2/lib/SymmetryLib.py | 1 | 4740 | # A library of things to help with simple symmetry operation stuff.
#
# FIXED 17/NOV/06 add a method in here to give a list of likely, and then
# less likely, spacegroups based on an input spacegroup.
# For instance, if the input spacegroup is P 41 21 2 then
# another lik... | bsd-3-clause | 8af08357cadd451c00b547d3ef8ffe80 | 24.621622 | 78 | 0.512447 | 3.246575 | false | false | false | false |
xia2/xia2 | src/xia2/Wrappers/Dials/Merge.py | 1 | 3558 | from __future__ import annotations
import logging
from xia2.Driver.DriverFactory import DriverFactory
logger = logging.getLogger("xia2.Wrappers.Dials.Merge")
def DialsMerge(DriverType=None):
"""A factory for DialsMergeWrapper classes."""
DriverInstance = DriverFactory.Driver(DriverType)
class DialsMe... | bsd-3-clause | 342dd69ea78e0238056ef20a7bd0bbdb | 30.767857 | 86 | 0.571669 | 4.286747 | false | false | false | false |
xia2/xia2 | src/xia2/Modules/Indexer/IndexerSelectImages.py | 1 | 2000 | # Code for the selection of images for autoindexing - selecting lone images
# from a list or wedges from a list, for XDS.
from __future__ import annotations
import logging
logger = logging.getLogger("xia2.Modules.Indexer.IndexerSelectImages")
def index_select_images_lone(phi_width, images):
"""Select images c... | bsd-3-clause | fd859ce6fd5b0d297bfd96f4255af83d | 27.571429 | 86 | 0.601 | 3.454231 | false | false | false | false |
xia2/xia2 | src/xia2/Wrappers/Dials/ExportXDSASCII.py | 1 | 1741 | from __future__ import annotations
import logging
from xia2.Driver.DriverFactory import DriverFactory
logger = logging.getLogger("xia2.Wrappers.Dials.ExportXDSASCII")
def ExportXDSASCII(DriverType=None):
"""A factory for ExportXDSASCIISWrapper classes."""
DriverInstance = DriverFactory.Driver(DriverType)
... | bsd-3-clause | 55c60d204252191c7f12c56f4c58aa35 | 32.480769 | 81 | 0.639288 | 4.011521 | false | false | false | false |
xia2/xia2 | src/xia2/cli/plot_multiplicity.py | 1 | 12688 | from __future__ import annotations
import json
import sys
import iotbx.phil
from cctbx.miller.display import render_2d, scene
from dials.util import Sorry
from iotbx.gui_tools.reflections import get_array_description
from iotbx.reflection_file_reader import any_reflection_file
from scitbx.array_family import flex
c... | bsd-3-clause | 2f686234311a281abbbbe4e44e696db5 | 33.016086 | 129 | 0.493064 | 3.844848 | false | false | false | false |
xia2/xia2 | src/xia2/Wrappers/Dials/ImportXDS.py | 1 | 3161 | from __future__ import annotations
import os
from xia2.Driver.DriverFactory import DriverFactory
def ImportXDS(DriverType=None):
"""A factory for ImportXDSWrapper classes."""
DriverInstance = DriverFactory.Driver(DriverType)
class ImportXDSWrapper(DriverInstance.__class__):
def __init__(self):... | bsd-3-clause | 2116e86030ddb4d610ac86cf31ae4530 | 34.920455 | 87 | 0.554571 | 4.047375 | false | false | false | false |
xia2/xia2 | src/xia2/Wrappers/Phenix/LatticeSymmetry.py | 1 | 6087 | from __future__ import annotations
from xia2.Driver.DriverFactory import DriverFactory
from xia2.Handlers.Syminfo import spacegroup_number_to_name
from xia2.lib.SymmetryLib import lauegroup_to_lattice
def LatticeSymmetry(DriverType=None):
"""A factory for the LatticeSymmetry wrappers."""
DriverInstance = Dr... | bsd-3-clause | dc610e3bc221202e1b6dd1f9101d86cc | 35.232143 | 88 | 0.469361 | 4.696759 | false | false | false | false |
xia2/xia2 | src/xia2/Modules/SSX/xia2_ssx_reduce.py | 1 | 6275 | from __future__ import annotations
import logging
from pathlib import Path
import iotbx.phil
from libtbx import Auto
from libtbx.introspection import number_of_processors
from xia2.Modules.SSX.data_reduction_definitions import ReductionParams
from xia2.Modules.SSX.data_reduction_interface import get_reducer
from xia... | bsd-3-clause | 647a40ae205b84cdf909306da9409bd7 | 34.252809 | 88 | 0.66502 | 3.78012 | false | false | false | false |
xia2/xia2 | src/xia2/Modules/SSX/data_integration_programs.py | 1 | 24606 | from __future__ import annotations
import copy
import json
import logging
import os
from dataclasses import dataclass
from functools import reduce
from pathlib import Path
from typing import List, Optional, Tuple
import iotbx.phil
from cctbx import crystal, sgtbx, uctbx
from dials.algorithms.clustering.unit_cell impo... | bsd-3-clause | 5cba784f769aab954d77fe96ea48854a | 41.133562 | 113 | 0.578558 | 3.804855 | false | false | false | false |
xia2/xia2 | src/xia2/cli/overload.py | 1 | 4525 | from __future__ import annotations
import json
import sys
import timeit
from collections import Counter
import iotbx.phil
from dials.util.options import ArgumentParser, flatten_experiments
from libtbx import easy_mp
from scitbx.array_family import flex
help_message = """
Examples::
xia2.overload (data_master.h5|... | bsd-3-clause | fe9dad784a5e4a1f15356c56acc0ac63 | 28.193548 | 87 | 0.525083 | 4.022222 | false | false | false | false |
xia2/xia2 | src/xia2/Modules/Indexer/XDSIndexerII.py | 1 | 13662 | # An reimplementation of the XDS indexer to work for harder cases, for example
# cases where the whole sweep needs to be read into memory in IDXREF to get
# a decent indexing solution (these do happen) and also cases where the
# crystal is highly mosaic. Perhaps. This will now be directly inherited from
# the original ... | bsd-3-clause | d91db4d70414ebf876d9528c6e219313 | 34.671018 | 87 | 0.576197 | 3.789736 | false | false | false | false |
xia2/xia2 | src/xia2/cli/multiplex.py | 1 | 5586 | from __future__ import annotations
import logging
import random
import sys
import numpy as np
import iotbx.phil
from dials.array_family import flex
from dials.util.exclude_images import exclude_image_ranges_for_scaling
from dials.util.multi_dataset_handling import (
assign_unique_identifiers,
parse_multiple_... | bsd-3-clause | fa51e8b0539aefe4e0a84ba33f1cccbf | 31.643275 | 100 | 0.727159 | 3.605943 | false | false | false | false |
xia2/xia2 | src/xia2/Wrappers/Dials/ExportMMCIF.py | 1 | 3007 | from __future__ import annotations
import logging
from xia2.Driver.DriverFactory import DriverFactory
logger = logging.getLogger("xia2.Wrappers.Dials.ExportMMCIF")
def ExportMMCIF(DriverType=None):
"""A factory for ExportMMCIFWrapper classes."""
DriverInstance = DriverFactory.Driver(DriverType)
class... | bsd-3-clause | 1542cb58bf65573e62bcdb3fcb3c8638 | 34.797619 | 80 | 0.615896 | 4.170596 | false | false | false | false |
xia2/xia2 | src/xia2/Wrappers/Dials/SearchBeamPosition.py | 1 | 2368 | from __future__ import annotations
import logging
import os
from xia2.Driver.DriverFactory import DriverFactory
from xia2.Handlers.Phil import PhilIndex
logger = logging.getLogger("xia2.Wrappers.Dials.SearchBeamPosition")
def SearchBeamPosition(DriverType=None):
"""A factory for SearchBeamPosition classes."""
... | bsd-3-clause | 2089ce536eca690670e343d7a9cf39e0 | 32.352113 | 85 | 0.61402 | 3.9401 | false | false | false | false |
xia2/xia2 | src/xia2/Experts/Filenames.py | 1 | 1106 | # An expert who knows about how file names are structured on a number of
# platforms... this handles them mostly as strings, which of course they
# are...
from __future__ import annotations
import os
def windows_environment_vars_to_unix(token):
"""Transmogrify windows environment tokens (e.g. %WINDIR%) to
... | bsd-3-clause | 57edacfafa2d83f9bea229650aa3bea9 | 24.136364 | 72 | 0.61302 | 3.921986 | false | false | false | false |
xia2/xia2 | src/xia2/Wrappers/XIA/Report.py | 1 | 1815 | from __future__ import annotations
import logging
import os
import shutil
from xia2.Driver.DriverFactory import DriverFactory
logger = logging.getLogger("xia2.Wrappers.XIA.Report")
def Report(DriverType=None):
"""A factory for ReportWrapper classes."""
DriverInstance = DriverFactory.Driver(DriverType)
... | bsd-3-clause | b87403e7cab66d628c1867d84280c7d2 | 30.293103 | 76 | 0.591736 | 4.069507 | false | false | false | false |
xia2/xia2 | src/xia2/Applications/xia2_helpers.py | 1 | 4081 | from __future__ import annotations
import glob
import logging
import os
import shutil
import uuid
from xia2.Driver.DriverFactory import DriverFactory
from xia2.lib.bits import auto_logfiler
from xia2.Wrappers.XIA.Integrate import Integrate as XIA2Integrate
logger = logging.getLogger("xia2.Applications.xia2_helpers")... | bsd-3-clause | 8e959efca58d1a30bd1af4d716660ef8 | 31.388889 | 80 | 0.650821 | 3.198276 | false | false | false | false |
xia2/xia2 | tests/Modules/Indexer/test_DIALS_indexer.py | 1 | 2528 | from __future__ import annotations
import os
import sys
from unittest import mock
import pytest
from dxtbx.model import ExperimentList
from xia2.Handlers.Phil import PhilIndex
from xia2.Modules.Indexer.DialsIndexer import DialsIndexer
from xia2.Schema.XCrystal import XCrystal
from xia2.Schema.XSample import XSample... | bsd-3-clause | 747a733386ecd09ee68a59d85107dfa8 | 33.162162 | 83 | 0.704509 | 3.15212 | false | true | false | false |
xia2/xia2 | tests/Modules/Scaler/test_CCP4ScalerA.py | 1 | 3230 | from __future__ import annotations
import os
import sys
from unittest import mock
def test_ccp4_scalerA(regression_test, ccp4, dials_data, run_in_tmp_path):
from xia2.Handlers.Phil import PhilIndex
PhilIndex.params.xia2.settings.multiprocessing.nproc = 1
template = dials_data("centroid_test_data", path... | bsd-3-clause | 22a1767b0b88281332b338bb0291cc60 | 33.731183 | 83 | 0.711765 | 3.166667 | false | true | false | false |
xia2/xia2 | src/xia2/Wrappers/CCP4/Ctruncate.py | 1 | 6043 | from __future__ import annotations
import logging
import os
from xia2.Driver.DriverFactory import DriverFactory
from xia2.Handlers.Citations import Citations
from xia2.lib.bits import transpose_loggraph
logger = logging.getLogger("xia2.Wrappers.CCP4.Ctruncate")
def Ctruncate(DriverType=None):
"""A factory for ... | bsd-3-clause | a96b13ad11d2df448e77ef61b185bf2d | 29.675127 | 86 | 0.500083 | 4.304131 | false | false | false | false |
xia2/xia2 | tests/command_line/test_to_shelx.py | 1 | 1108 | from __future__ import annotations
import subprocess
def test_to_shelx(dials_data, tmp_path):
l_cyst = dials_data("l_cysteine_4_sweeps_scaled", pathlib=True)
# First create an unmerged mtz.
expt = l_cyst / "scaled_30.expt"
refls = l_cyst / "scaled_30.refl"
result = subprocess.run(
["dial... | bsd-3-clause | 00fce639100d3f1b1bc69636ba2f2860 | 30.657143 | 76 | 0.620036 | 2.885417 | false | true | false | false |
menpo/menpo | menpo/visualize/textutils.py | 2 | 7332 | import sys
from collections import deque
from datetime import datetime
from time import time
def progress_bar_str(percentage, bar_length=20, bar_marker="=", show_bar=True):
r"""
Returns an `str` of the specified progress percentage. The percentage is
represented either in the form of a progress bar or in ... | bsd-3-clause | 5c4db0c457060413f0ed768e63030789 | 31.878924 | 87 | 0.592199 | 3.948304 | false | false | false | false |
menpo/menpo | menpo/transform/homogeneous/base.py | 2 | 15465 | from warnings import warn
import numpy as np
from menpo.base import Vectorizable, MenpoDeprecationWarning
from menpo.transform.base import (
Alignment,
ComposableTransform,
VComposable,
VInvertible,
)
class HomogFamilyAlignment(Alignment):
r"""
Simple subclass of Alignment that adds the abil... | bsd-3-clause | 8e8e0a8012ab9e64e76c519abba99ef9 | 32.546638 | 83 | 0.589848 | 4.43759 | false | false | false | false |
menpo/menpo | menpo/landmark/labels/human/face_3d.py | 2 | 3003 | from collections import OrderedDict
import numpy as np
from ..base import labeller_func, validate_input, connectivity_from_array
@labeller_func(group_label="face_bu3dfe_83")
def face_bu3dfe_83_to_face_bu3dfe_83(pcloud):
r"""
Apply the BU-3DFE (Binghamton University 3D Facial Expression)
Database 83-point... | bsd-3-clause | 87512535718446445c12df79e0147f65 | 31.641304 | 80 | 0.668665 | 3.487805 | false | false | false | false |
menpo/menpo | menpo/transform/base/composable.py | 2 | 11232 | from menpo.transform.base import Transform
from functools import reduce
class ComposableTransform(Transform):
r"""
:map:`Transform` subclass that enables native composition, such that the
behavior of multiple :map:`Transform` s is composed together in a natural
way.
"""
@property
def comp... | bsd-3-clause | 7f1f6fce8b173898788ec101bb273f1b | 33.243902 | 84 | 0.593305 | 4.577017 | false | false | false | false |
menpo/menpo | menpo/transform/homogeneous/rotation.py | 2 | 19578 | # Parts of this code taken from:
#
# Copyright (c) 2006-2015, Christoph Gohlke
# Copyright (c) 2006-2015, The Regents of the University of California
# Produced at the Laboratory for Fluorescence Dynamics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are p... | bsd-3-clause | 91b8037e9bb11e9887acb671171d6692 | 33.712766 | 88 | 0.558944 | 4.119949 | false | false | false | false |
menpo/menpo | menpo/transform/base/__init__.py | 2 | 9702 | import warnings
import numpy as np
from menpo.base import Copyable, MenpoDeprecationWarning
class Transform(Copyable):
r"""
Abstract representation of any spatial transform.
Provides a unified interface to apply the transform with
:meth:`apply_inplace` and :meth:`apply`.
All Transforms support ... | bsd-3-clause | 0abd1be4f921a6c340a218afc2570f48 | 31.125828 | 80 | 0.589569 | 4.50627 | false | false | false | false |
menpo/menpo | menpo/image/interpolation.py | 2 | 5037 | import numpy as np
from menpo.transform import Homogeneous
# Store out a transform that simply switches the x and y axis
xy_yx = Homogeneous(np.array([[0.0, 1.0, 0.0], [1.0, 0.0, 0.0], [0.0, 0.0, 1.0]]))
def scipy_interpolation(pixels, points_to_sample, mode="constant", order=1, cval=0.0):
r"""
Interpolatio... | bsd-3-clause | 6bf8dccab3cd617e6a51e5dbca784594 | 33.979167 | 87 | 0.588048 | 4.215063 | false | false | false | false |
menpo/menpo | menpo/image/base.py | 2 | 131364 | from typing import Iterable, Optional
from warnings import warn
import PIL.Image as PILImage
import numpy as np
from menpo.base import MenpoDeprecationWarning, Vectorizable, copy_landmarks_and_path
from menpo.landmark import Landmarkable
from menpo.shape import PointCloud, bounding_box
from menpo.transform import (
... | bsd-3-clause | e74d0061d0ffb4d8975c5f4fb37c4525 | 36.922633 | 92 | 0.561554 | 4.452866 | false | false | false | false |
diefenbach/django-lfs | lfs/manage/property_groups/views.py | 1 | 12530 | import json
from django.contrib.auth.decorators import permission_required
from django.core.paginator import EmptyPage
from django.core.paginator import Paginator
from django.urls import reverse
from django.db.models import Q
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django... | bsd-3-clause | f71456d407e3089b746352d9a68cfd89 | 35.213873 | 124 | 0.654509 | 3.940252 | false | false | false | false |
diefenbach/django-lfs | lfs/voucher/models.py | 1 | 6149 | import datetime
from django.contrib.auth.models import User
from django.db import models
from django.db.models import F
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from lfs.tax.models import Tax
from lfs.voucher.settings import KIND_OF_CHOICES
from lfs.voucher.settings im... | bsd-3-clause | 1b1192eb6a08935dc83248bd94bf708d | 33.9375 | 117 | 0.63181 | 4.045395 | false | false | false | false |
diefenbach/django-lfs | lfs/cart/views.py | 1 | 18548 | # python imports
import json
# django imports
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.urls import reverse
from django.http import Http404
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.shortcuts import render
from... | bsd-3-clause | 08a305616c669041fb374d95e26a4466 | 37.008197 | 189 | 0.630149 | 3.945544 | false | false | false | false |
diefenbach/django-lfs | lfs/manage/product/accessories.py | 1 | 8811 | import json
from django.contrib.auth.decorators import permission_required
from django.core.paginator import EmptyPage
from django.core.paginator import Paginator
from django.db.models import Q
from django.http import HttpResponse
from django.template.loader import render_to_string
from django.utils.translation import... | bsd-3-clause | cd7fc89b99f195e0fd01029cf311f011 | 33.964286 | 124 | 0.649302 | 3.938757 | false | false | false | false |
diefenbach/django-lfs | lfs/manage/product/categories.py | 1 | 3030 | import json
# django imports
from django.contrib.auth.decorators import permission_required
from django.http import HttpResponse
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
# lfs imports
from lfs.caching.utils import lfs_get_object_or_404
from lfs.core.u... | bsd-3-clause | 3f385609e7981531a3198e5222bb6fa6 | 31.580645 | 91 | 0.672277 | 4.202497 | false | false | false | false |
diefenbach/django-lfs | lfs/marketing/tests.py | 1 | 10081 | from datetime import timedelta
from django.test import TestCase
from django.utils import timezone
from lfs.addresses.models import Address
from lfs.catalog.models import Category
from lfs.catalog.models import Product
import lfs.marketing.utils
from lfs.marketing.models import Topseller
from lfs.marketing.utils impor... | bsd-3-clause | 30ec518500c224d6601d18d6ad42dc25 | 33.642612 | 98 | 0.629203 | 3.340292 | false | true | false | false |
clips/pattern | examples/02-db/02-datasheet.py | 1 | 2054 | from __future__ import print_function
from __future__ import unicode_literals
from builtins import str, bytes, dict, int
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
from pattern.db import Datasheet, INTEGER, STRING
from pattern.db import uid, pprint
# The main purpos... | bsd-3-clause | 258c48a01b6b3ca41d983409f9b756f2 | 32.672131 | 89 | 0.695716 | 3.345277 | false | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.