index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
60,544 | drrros/frtest | refs/heads/master | /polls/urls.py | from django.urls import path
from polls.views.admin import PollCreateAPIView, QuestionCreateAPIView, PollChangeAPIView, QuestionChangeAPIView, \
PollListAdminAPIView, QuestionChoiceCreateAPIView, QuestionChoiceChangeAPIView
from polls.views.client import ActivePollAPIView, AnswerAPIView, GetAnswerAPIView
urlpatte... | {"/polls/serializers.py": ["/polls/models.py"], "/polls/views/admin.py": ["/polls/models.py", "/polls/serializers.py"], "/polls/urls.py": ["/polls/views/admin.py", "/polls/views/client.py"], "/polls/tests.py": ["/polls/models.py", "/polls/serializers.py"], "/polls/admin.py": ["/polls/models.py"], "/polls/views/client.p... |
60,545 | drrros/frtest | refs/heads/master | /polls/tests.py | from django.contrib.auth.models import User
from django.urls import reverse
from django.utils import timezone
from rest_framework import status
from rest_framework.test import APITestCase
from .models import Poll, Answer, Question, QuestionChoice
from .serializers import PollSerializer
class PollTest(APITestCase):
... | {"/polls/serializers.py": ["/polls/models.py"], "/polls/views/admin.py": ["/polls/models.py", "/polls/serializers.py"], "/polls/urls.py": ["/polls/views/admin.py", "/polls/views/client.py"], "/polls/tests.py": ["/polls/models.py", "/polls/serializers.py"], "/polls/admin.py": ["/polls/models.py"], "/polls/views/client.p... |
60,546 | drrros/frtest | refs/heads/master | /polls/admin.py | from django.contrib import admin
# Register your models here.
from polls.models import Question, Poll, QuestionChoice, Answer
admin.site.register(Question)
admin.site.register(Poll)
admin.site.register(Answer)
admin.site.register(QuestionChoice)
| {"/polls/serializers.py": ["/polls/models.py"], "/polls/views/admin.py": ["/polls/models.py", "/polls/serializers.py"], "/polls/urls.py": ["/polls/views/admin.py", "/polls/views/client.py"], "/polls/tests.py": ["/polls/models.py", "/polls/serializers.py"], "/polls/admin.py": ["/polls/models.py"], "/polls/views/client.p... |
60,547 | drrros/frtest | refs/heads/master | /polls/migrations/0001_initial.py | # Generated by Django 2.2.10 on 2021-03-25 21:38
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Question',
fields=[
... | {"/polls/serializers.py": ["/polls/models.py"], "/polls/views/admin.py": ["/polls/models.py", "/polls/serializers.py"], "/polls/urls.py": ["/polls/views/admin.py", "/polls/views/client.py"], "/polls/tests.py": ["/polls/models.py", "/polls/serializers.py"], "/polls/admin.py": ["/polls/models.py"], "/polls/views/client.p... |
60,548 | drrros/frtest | refs/heads/master | /polls/views/client.py | from django.utils import timezone
from rest_framework import generics
from polls.models import Poll, Answer
from polls.serializers import PollSerializer, AnswerSerializer
class ActivePollAPIView(generics.ListAPIView):
serializer_class = PollSerializer
def get_queryset(self):
return Poll.objects.filt... | {"/polls/serializers.py": ["/polls/models.py"], "/polls/views/admin.py": ["/polls/models.py", "/polls/serializers.py"], "/polls/urls.py": ["/polls/views/admin.py", "/polls/views/client.py"], "/polls/tests.py": ["/polls/models.py", "/polls/serializers.py"], "/polls/admin.py": ["/polls/models.py"], "/polls/views/client.p... |
60,549 | drrros/frtest | refs/heads/master | /polls/models.py | from django.db import models
# Create your models here.
class Question(models.Model):
TYPE_CHOICES = (
('text', 'Ответ текстом'),
('choice', 'Ответ выбором одного варианта'),
('multiple_choice', 'Ответ со многими вариантами'),
)
text = models.CharField(
verbose_name='Текс... | {"/polls/serializers.py": ["/polls/models.py"], "/polls/views/admin.py": ["/polls/models.py", "/polls/serializers.py"], "/polls/urls.py": ["/polls/views/admin.py", "/polls/views/client.py"], "/polls/tests.py": ["/polls/models.py", "/polls/serializers.py"], "/polls/admin.py": ["/polls/models.py"], "/polls/views/client.p... |
60,555 | fuzeman/stash.py | refs/heads/master | /stash/caches/c_memory.py | from stash.caches.core.base import Cache
from stash.lib import six as six
class MemoryCache(Cache):
__key__ = 'memory'
def __init__(self, initial=None):
super(MemoryCache, self).__init__()
self.data = initial or {}
def iteritems(self):
return self.data.iteritems()
def items... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,556 | fuzeman/stash.py | refs/heads/master | /tests/archives/sqlite_tests.py | from stash import Stash, SqliteArchive
from stash.lib.six.moves import xrange
import pytest
def fetch(cursor, query):
result = cursor.execute(query)
return dict(list(result))
def test_construct():
st = Stash(SqliteArchive(':memory:', 'one'))
assert type(st.archive) is SqliteArchive
assert st.a... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,557 | fuzeman/stash.py | refs/heads/master | /stash/caches/__init__.py | from stash.caches.c_memory import MemoryCache
__all__ = ['MemoryCache']
| {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,558 | fuzeman/stash.py | refs/heads/master | /stash/archives/core/base.py | from stash.core.modules.base import MappingModule
import collections
class Archive(MappingModule):
__group__ = 'archive'
@property
def serializer(self):
return self.stash.serializer
def dumps(self, value):
return self.serializer.dumps(value)
def loads(self, value):
retu... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,559 | fuzeman/stash.py | refs/heads/master | /tests/archives/apsw_tests.py | from stash import Stash, ApswArchive
from stash.lib.six.moves import xrange
from stash.lib import six
import pytest
def fetch(cursor, query):
result = cursor.execute(query)
return dict(list(result))
def test_construct():
st = Stash(ApswArchive(':memory:', 'one'))
assert type(st.archive) is ApswArc... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,560 | fuzeman/stash.py | refs/heads/master | /stash/archives/a_apsw.py | from stash.archives.core.base import Archive
from stash.lib import six as six
from collections import Mapping
from contextlib import closing
import collections
try:
import apsw
except ImportError:
apsw = None
if six.PY3:
def buffer(value):
return value
class ApswArchive(Archive):
__key__ = ... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,561 | fuzeman/stash.py | refs/heads/master | /setup.py | from stash import __version__
from setuptools import setup, find_packages
setup(
name='stash.py',
version=__version__,
license='MIT',
url='https://github.com/fuzeman/stash.py',
author='Dean Gardiner',
author_email='me@dgardiner.net',
description='Dictionary-style storage interface with a... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,562 | fuzeman/stash.py | refs/heads/master | /tests/serializers/jsonpickle_tests.py | from stash import JsonPickleSerializer
def test_basic():
serializer = JsonPickleSerializer()
assert serializer.dumps(1234) == '1234'
assert serializer.dumps('1234') == '"1234"'
def test_loads():
serializer = JsonPickleSerializer()
assert serializer.loads('1234') == 1234
assert serializer.l... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,563 | fuzeman/stash.py | refs/heads/master | /stash/archives/a_sqlite.py | from stash.archives.core.base import Archive
from contextlib import closing
try:
import sqlite3
except ImportError:
sqlite3 = None
class SqliteArchive(Archive):
__key__ = 'sqlite'
def __init__(self, db, table):
super(SqliteArchive, self).__init__()
if sqlite3 is None:
... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,564 | fuzeman/stash.py | refs/heads/master | /stash/algorithms/core/prime_context.py | from stash.lib.six.moves import _thread
class PrimeContext(object):
def __init__(self, algorithm=None, buffer=None):
self._algorithm = algorithm
self._buffer = buffer
@property
def buffer(self):
return self._buffer
def __enter__(self):
if self._algorithm is None:
... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,565 | fuzeman/stash.py | refs/heads/master | /stash/serializers/__init__.py | from stash.serializers.s_jsonpickle import JsonPickleSerializer
from stash.serializers.s_msgpack import MessagePackSerializer
from stash.serializers.s_none import NoneSerializer
from stash.serializers.s_pickle import PickleSerializer
__all__ = [
'JsonPickleSerializer',
'MessagePackSerializer',
'NoneSeriali... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,566 | fuzeman/stash.py | refs/heads/master | /stash/core/modules/base.py | from stash.core.modules.manager import ModuleManager
from stash.lib import six
from abc import ABCMeta
from collections import MutableMapping
class ModuleMeta(type):
def __init__(cls, *args, **kwargs):
if not cls.__module__.endswith('.base'):
ModuleManager.register(cls)
super(ModuleM... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,567 | fuzeman/stash.py | refs/heads/master | /stash/core/modules/manager.py | from stash.lib import six
from stash.lib.six.moves.urllib import parse as urlparse
import inspect
import logging
log = logging.getLogger(__name__)
class ModuleManager(object):
modules = {}
@classmethod
def construct(cls, stash, group, value):
if isinstance(value, six.string_types):
... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,568 | fuzeman/stash.py | refs/heads/master | /stash/algorithms/__init__.py | from stash.algorithms.lru import LruAlgorithm
__all__ = ['LruAlgorithm']
| {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,569 | fuzeman/stash.py | refs/heads/master | /stash/serializers/s_jsonpickle.py | from stash.serializers.core.base import Serializer
try:
import jsonpickle
except ImportError:
jsonpickle = None
class JsonPickleSerializer(Serializer):
__key__ = 'jsonpickle'
def dumps(self, value):
if jsonpickle is None:
raise Exception('"jsonpickle" library is not available')
... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,570 | fuzeman/stash.py | refs/heads/master | /tests/serializers/pickle_tests.py | from stash import PickleSerializer
from stash.lib import six
#
# Pickle v0
#
def test_0_basic():
serializer = PickleSerializer(protocol=0)
assert serializer.loads(serializer.dumps(1234)) == 1234
assert serializer.loads(serializer.dumps('1234')) == '1234'
def test_0_unicode():
serializer = PickleSer... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,571 | fuzeman/stash.py | refs/heads/master | /stash/serializers/s_msgpack.py | from stash.serializers.core.base import Serializer
import stash.lib.six as six
try:
import msgpack
except ImportError:
msgpack = None
class MessagePackSerializer(Serializer):
__key__ = 'msgpack'
def dumps(self, value):
if msgpack is None:
raise Exception('"msgpack" library is no... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,572 | fuzeman/stash.py | refs/heads/master | /stash/core/helpers.py | def to_integer(value, default=None):
try:
return int(value)
except:
return default
| {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,573 | fuzeman/stash.py | refs/heads/master | /stash/archives/__init__.py | from stash.archives.a_apsw import ApswArchive
from stash.archives.a_memory import MemoryArchive
from stash.archives.a_sqlite import SqliteArchive
__all__ = ['ApswArchive', 'MemoryArchive', 'SqliteArchive']
| {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,574 | fuzeman/stash.py | refs/heads/master | /stash/__init__.py | from stash.algorithms import *
from stash.archives import *
from stash.caches import *
from stash.serializers import *
from stash.main import Stash
__version__ = '1.2.0'
__all__ = [
'Stash',
'LruAlgorithm',
'ApswArchive', 'MemoryArchive', 'SqliteArchive',
'MemoryCache',
'JsonPickleSerializer', 'N... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,575 | fuzeman/stash.py | refs/heads/master | /stash/algorithms/core/base.py | from stash.core.modules.base import Module
import collections
class Algorithm(Module):
__group__ = 'algorithm'
@property
def archive(self):
return self.stash.archive
@property
def cache(self):
return self.stash.cache
def compact(self, force=False):
raise NotImplemen... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,576 | fuzeman/stash.py | refs/heads/master | /stash/algorithms/lru.py | from stash.algorithms.core.base import Algorithm
from stash.algorithms.core.prime_context import PrimeContext
from stash.core.helpers import to_integer
from stash.lib.six.moves import xrange, _thread
try:
from llist import dllist
except ImportError:
try:
from pyllist import dllist
except ImportErro... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,577 | fuzeman/stash.py | refs/heads/master | /stash/serializers/s_none.py | from stash.serializers.core.base import Serializer
class NoneSerializer(Serializer):
__key__ = 'none'
def dumps(self, value):
return value
def loads(self, value):
return value
| {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,578 | fuzeman/stash.py | refs/heads/master | /stash/main.py | from stash.core.modules.manager import ModuleManager
from collections import MutableMapping
class Stash(MutableMapping):
def __init__(self, archive, algorithm='lru:///', serializer='none:///', cache='memory:///', key_transform=None):
# Construct modules
self.archive = ModuleManager.construct(self... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,579 | fuzeman/stash.py | refs/heads/master | /examples/pickle_serializer.py | import logging
logging.basicConfig(level=logging.DEBUG)
from stash import Stash
if __name__ == '__main__':
s = Stash('sqlite:///pickle_serializer.db?table=stash', 'lru:///?capacity=5', 'pickle:///')
for x in xrange(5):
s[str(x)] = x
for x in xrange(2):
s[str(x)] = x
for x in xrange... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,580 | fuzeman/stash.py | refs/heads/master | /stash/serializers/core/base.py | from stash.core.modules.base import Module
class Serializer(Module):
__group__ = 'serializer'
def dumps(self, value):
raise NotImplementedError
def loads(self, value):
raise NotImplementedError
| {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,581 | fuzeman/stash.py | refs/heads/master | /stash/archives/a_memory.py | from stash.archives.core.base import Archive
class MemoryArchive(Archive):
__key__ = 'memory'
def __init__(self, initial=None):
super(MemoryArchive, self).__init__()
self.data = initial or {}
def save(self):
pass
def __delitem__(self, key):
key = self.key_encode(key... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,582 | fuzeman/stash.py | refs/heads/master | /stash/serializers/s_pickle.py | from stash.core.helpers import to_integer
from stash.serializers.core.base import Serializer
import stash.lib.six as six
try:
import cPickle as pickle
except ImportError:
import pickle
from stash.lib.six import BytesIO
class PickleSerializer(Serializer):
__key__ = 'pickle'
def __init__(self, proto... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,583 | fuzeman/stash.py | refs/heads/master | /stash/caches/core/base.py | from stash.core.modules.base import MappingModule
import collections
class Cache(MappingModule):
__group__ = 'cache'
def delete(self, keys):
if not keys:
return
if not isinstance(keys, collections.Iterable):
keys = [keys]
for key in keys:
del sel... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,584 | fuzeman/stash.py | refs/heads/master | /tests/algorithms/lru_tests.py | from stash import Stash, LruAlgorithm, MemoryArchive, MemoryCache
from stash.lib.six.moves import xrange
def test_construct():
st = Stash(MemoryArchive(), LruAlgorithm)
assert type(st.algorithm) is LruAlgorithm
st = Stash(MemoryArchive(), 'lru:///')
assert type(st.algorithm) is LruAlgorithm
st =... | {"/stash/caches/c_memory.py": ["/stash/caches/core/base.py"], "/tests/archives/sqlite_tests.py": ["/stash/__init__.py"], "/stash/caches/__init__.py": ["/stash/caches/c_memory.py"], "/stash/archives/core/base.py": ["/stash/core/modules/base.py"], "/tests/archives/apsw_tests.py": ["/stash/__init__.py"], "/stash/archives/... |
60,618 | potehinre/snmp_poller | refs/heads/master | /config.py | # -*- coding: utf-8 -*-
#Название опрашиваемого интерфейса, если такого интерфейса у сервера нету , ставится -1
INTERFACE_NAME = "eth0"
COMMUNITY_STRING = 'public'
SNMP_PORT = 161
#Спустя какое количество времени удалять статистику в секундах.
DELETE_STAT_AFTER = 60 * 30
#Список опрашиваемых серверов
SERVER_NAMES = ("d... | {"/snmp_poller.py": ["/config.py"]} |
60,619 | potehinre/snmp_poller | refs/heads/master | /snmp_poller.py | # -*- coding:utf-8 -*-
import mysql.connector
import sys
import os
import time
from pysnmp.entity.rfc3413.oneliner import cmdgen
from pysnmp.error import PySnmpError
from config import INTERFACE_NAME, COMMUNITY_STRING, SNMP_PORT, SERVER_NAMES, DB_SETTINGS, DELETE_STAT_AFTER
IN_OCTETS_OID = "1.3.6.1.2.1.2.2.1.10"
OUT_OC... | {"/snmp_poller.py": ["/config.py"]} |
60,620 | FFCoder/PythonCallServer | refs/heads/master | /server.py | import json
import time
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
from requests import exceptions
from models import *
from ParseHandler import handler
watchFolder = ""
parseAppId = ""
parseRESTKey = ""
class MyHandler(PatternMatchingEventHandler):
patterns ... | {"/models.py": ["/utils.py"]} |
60,621 | FFCoder/PythonCallServer | refs/heads/master | /utils.py | class MCESException(Exception):
pass
| {"/models.py": ["/utils.py"]} |
60,622 | FFCoder/PythonCallServer | refs/heads/master | /models.py | from utils import MCESException
from dateutil.parser import parse
import uuid
class Unit(object):
"""This is a model to represent a [Fire,EMS,Rescue,Etc.] Unit
Attributes:
name: Name of the unit
stationNumber: int containing Station Number that the unit belongs to.
"""
def __init__(... | {"/models.py": ["/utils.py"]} |
60,623 | FFCoder/PythonCallServer | refs/heads/master | /ParseHandler.py | import json,requests
class handler(object):
def __init__(self,call,parseAPPID,parseRESTKey):
self.call = call
self.appid = parseAPPID
self.restkey = parseRESTKey
def send(self):
headers= {"X-Parse-Application-Id": self.appid,
"X-Parse-REST-API-Key": self.restkey}
... | {"/models.py": ["/utils.py"]} |
60,626 | GjergjiSh/hand-sign-detection-opencv | refs/heads/master | /FingerDistanceTracker.py | import cv2
import time
import numpy as np
import HandTrackingModule as htm
import math
#hand detector instance
detector = htm.HandDetector(detection_confidence=0.7)
#camera stream
camera_width, camera_height = 640, 480
cap = cv2.VideoCapture(0)
cap.set(3, camera_width)
cap.set(4, camera_width)
#to calc fps
pTime = 0... | {"/FingerDistanceTracker.py": ["/HandTrackingModule.py"]} |
60,627 | GjergjiSh/hand-sign-detection-opencv | refs/heads/master | /HandTrackingModule.py | import cv2
import mediapipe as mp
import time
class HandDetector():
def __init__(self, mode=False, max_hands=2, detection_confidence=0.5, track_confdence=0.5):
self.mode = mode
self.max_hands = max_hands
self.detection_confidence = detection_confidence
self.track_confdence = track_... | {"/FingerDistanceTracker.py": ["/HandTrackingModule.py"]} |
60,628 | ComputerScientist-01/Tile-Matching-Game | refs/heads/master | /app.py | import pygame
import game_config as gc
from pygame import display, event, image
from time import sleep
from animal import Animal
def find_index_from_xy(x, y):
row = y // gc.IMAGE_SIZE
col = x // gc.IMAGE_SIZE
index = row * gc.NUM_TILES_SIDE + col
return row, col, index
pygame.init()
# u... | {"/app.py": ["/game_config.py", "/animal.py"], "/animal.py": ["/game_config.py"]} |
60,629 | ComputerScientist-01/Tile-Matching-Game | refs/heads/master | /animal.py | import random
import os
import game_config as gc
from pygame import image, transform
animals_count = dict((a, 0) for a in gc.ASSET_FILES)
#creating a dictionary to keep count of animals
#setting all the values to 0 for all the keys
#the keys are going to be all the files from our asset dir
def available_ani... | {"/app.py": ["/game_config.py", "/animal.py"], "/animal.py": ["/game_config.py"]} |
60,630 | ComputerScientist-01/Tile-Matching-Game | refs/heads/master | /game_config.py | import os
IMAGE_SIZE = 128
#defining the image size
SCREEN_SIZE = 512
#defining the screen size
NUM_TILES_SIDE = 4
NUM_TILES_TOTAL = 16
# total tiles in the game
MARGIN = 8
#margin between one image and another
ASSET_DIR = 'assets'
#defining the assset directory
ASSET_FILES = [x for x in os.listdi... | {"/app.py": ["/game_config.py", "/animal.py"], "/animal.py": ["/game_config.py"]} |
60,631 | tjyiiuan/Graduate-Courses | refs/heads/master | /EECE5639-Computer-Vision/Project-2/libs/Harris.py | # -*- coding: utf-8 -*-
import numpy as np
from .misc import Gen_Gaussian_Filter, apply_2d_filter, calculate_gradient
class Harris_Corner_Detector(object):
"""Apply Harris corner detector to image.
Parameters
----------
image: array-like
Target image.
neighbor: int, default 7
... | {"/EECE5639-Computer-Vision/Project-2/libs/Harris.py": ["/EECE5639-Computer-Vision/Project-2/libs/misc.py"], "/EECE5639-Computer-Vision/Project-1/libs/Detector.py": ["/EECE5639-Computer-Vision/Project-1/libs/FilterApp.py", "/EECE5639-Computer-Vision/Project-1/libs/misc.py"], "/EECE5639-Computer-Vision/Project-2/libs/Co... |
60,632 | tjyiiuan/Graduate-Courses | refs/heads/master | /EECE5639-Computer-Vision/Project-2/libs/misc.py | # -*- coding: utf-8 -*-
import glob
import numpy as np
import matplotlib.image as mpimg
__all__ = ["Gen_Gaussian_Filter", "Load_Images", "rgb2gray",
"calculate_gradient", "normalized_correlation"]
def Gen_Gaussian_Filter(dim, sigma, size=0):
"""Generate 1D or 2D Gaussian filter.
Parameters
... | {"/EECE5639-Computer-Vision/Project-2/libs/Harris.py": ["/EECE5639-Computer-Vision/Project-2/libs/misc.py"], "/EECE5639-Computer-Vision/Project-1/libs/Detector.py": ["/EECE5639-Computer-Vision/Project-1/libs/FilterApp.py", "/EECE5639-Computer-Vision/Project-1/libs/misc.py"], "/EECE5639-Computer-Vision/Project-2/libs/Co... |
60,633 | tjyiiuan/Graduate-Courses | refs/heads/master | /EECE5639-Computer-Vision/Project-2/main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import logging
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
from libs.misc import Load_Images
from libs.Mosaic import Image_Mosaicing
image_path = r".\\DanaOffice\\"
parameters = {"method": "Sobel",
"corner_neighbor": 7,
... | {"/EECE5639-Computer-Vision/Project-2/libs/Harris.py": ["/EECE5639-Computer-Vision/Project-2/libs/misc.py"], "/EECE5639-Computer-Vision/Project-1/libs/Detector.py": ["/EECE5639-Computer-Vision/Project-1/libs/FilterApp.py", "/EECE5639-Computer-Vision/Project-1/libs/misc.py"], "/EECE5639-Computer-Vision/Project-2/libs/Co... |
60,634 | tjyiiuan/Graduate-Courses | refs/heads/master | /EECE5639-Computer-Vision/Project-1/libs/Detector.py | # -*- coding: utf-8 -*-
import os
import numpy as np
import matplotlib.pylab as plt
#import matplotlib.image as mpimg
plt.rcParams['figure.figsize'] = 15, 6
#plt.rcParams['figure.dpi'] = 300
from .FilterApp import FilterApp
from .misc import Gen_Gaussian_Filter, Gen_Box_Filter
class MotionDetector(object):
... | {"/EECE5639-Computer-Vision/Project-2/libs/Harris.py": ["/EECE5639-Computer-Vision/Project-2/libs/misc.py"], "/EECE5639-Computer-Vision/Project-1/libs/Detector.py": ["/EECE5639-Computer-Vision/Project-1/libs/FilterApp.py", "/EECE5639-Computer-Vision/Project-1/libs/misc.py"], "/EECE5639-Computer-Vision/Project-2/libs/Co... |
60,635 | tjyiiuan/Graduate-Courses | refs/heads/master | /EECE5639-Computer-Vision/Project-3/main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from libs.misc import Load_Images
from libs.Flow import Dense_Optical_Flow
image_path = r".\\toys\\"
parameters = {"smooth": "Gaussian",
"sigma": 1.4,
"method": "Prewitt"}
if __name__ == "__main__":
raw_images = Load_Images(image_path, ... | {"/EECE5639-Computer-Vision/Project-2/libs/Harris.py": ["/EECE5639-Computer-Vision/Project-2/libs/misc.py"], "/EECE5639-Computer-Vision/Project-1/libs/Detector.py": ["/EECE5639-Computer-Vision/Project-1/libs/FilterApp.py", "/EECE5639-Computer-Vision/Project-1/libs/misc.py"], "/EECE5639-Computer-Vision/Project-2/libs/Co... |
60,636 | tjyiiuan/Graduate-Courses | refs/heads/master | /EECE5639-Computer-Vision/Homework-2/hw2.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pylab as plt
import matplotlib.image as mpimg
plt.rcParams['figure.figsize'] = 15, 6
#plt.rcParams['figure.dpi'] = 300
NUMBER = 10
IMG_SHAPE = (256, 256)
GREY_LEVEL = 128
MU = 0
SIGMA = 2
class Homework2(object):
def __init_... | {"/EECE5639-Computer-Vision/Project-2/libs/Harris.py": ["/EECE5639-Computer-Vision/Project-2/libs/misc.py"], "/EECE5639-Computer-Vision/Project-1/libs/Detector.py": ["/EECE5639-Computer-Vision/Project-1/libs/FilterApp.py", "/EECE5639-Computer-Vision/Project-1/libs/misc.py"], "/EECE5639-Computer-Vision/Project-2/libs/Co... |
60,637 | tjyiiuan/Graduate-Courses | refs/heads/master | /EECE5639-Computer-Vision/Homework-4/libs/misc.py | # -*- coding: utf-8 -*-
import numpy as np
__all__ = ["compute_ssd",
"compute_correlation",
"compute_normalized_correlation"]
def compute_ssd(image, template):
"""Compute SSD between image and template.
Parameters
----------
image: array-like
The target image
t... | {"/EECE5639-Computer-Vision/Project-2/libs/Harris.py": ["/EECE5639-Computer-Vision/Project-2/libs/misc.py"], "/EECE5639-Computer-Vision/Project-1/libs/Detector.py": ["/EECE5639-Computer-Vision/Project-1/libs/FilterApp.py", "/EECE5639-Computer-Vision/Project-1/libs/misc.py"], "/EECE5639-Computer-Vision/Project-2/libs/Co... |
60,638 | tjyiiuan/Graduate-Courses | refs/heads/master | /EECE5639-Computer-Vision/Project-1/main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pylab as plt
#import matplotlib.image as mpimg
plt.rcParams['figure.figsize'] = 15, 6
#plt.rcParams['figure.dpi'] = 300
from libs.misc import Load_Images
from libs.Detector import MotionDetector
frame_path = r".\\Office\\"
test_ca... | {"/EECE5639-Computer-Vision/Project-2/libs/Harris.py": ["/EECE5639-Computer-Vision/Project-2/libs/misc.py"], "/EECE5639-Computer-Vision/Project-1/libs/Detector.py": ["/EECE5639-Computer-Vision/Project-1/libs/FilterApp.py", "/EECE5639-Computer-Vision/Project-1/libs/misc.py"], "/EECE5639-Computer-Vision/Project-2/libs/Co... |
60,639 | tjyiiuan/Graduate-Courses | refs/heads/master | /EECE5639-Computer-Vision/Homework-3/hw3.py | # -*- coding: utf-8 -*-
import warnings
import numpy as np
import matplotlib.pylab as plt
from matplotlib.lines import Line2D
from libs.FilterApp import FilterApp
from libs import misc
warnings.filterwarnings("ignore")
plt.rcParams['figure.figsize'] = 8, 8
#plt.rcParams['figure.dpi'] = 300
#%%
class Homework3(obje... | {"/EECE5639-Computer-Vision/Project-2/libs/Harris.py": ["/EECE5639-Computer-Vision/Project-2/libs/misc.py"], "/EECE5639-Computer-Vision/Project-1/libs/Detector.py": ["/EECE5639-Computer-Vision/Project-1/libs/FilterApp.py", "/EECE5639-Computer-Vision/Project-1/libs/misc.py"], "/EECE5639-Computer-Vision/Project-2/libs/Co... |
60,640 | tjyiiuan/Graduate-Courses | refs/heads/master | /EECE5639-Computer-Vision/Project-2/libs/Correspondences.py | # -*- coding: utf-8 -*-
import logging
import numpy as np
from .misc import normalized_correlation, homo_project, euclidean_disance
class Correspond(object):
def __init__(self, image1, image2, r1, r2, threshold=0, neighbor=3):
self.image1 = image1
self.image2 = image2
self.r1 = r1
... | {"/EECE5639-Computer-Vision/Project-2/libs/Harris.py": ["/EECE5639-Computer-Vision/Project-2/libs/misc.py"], "/EECE5639-Computer-Vision/Project-1/libs/Detector.py": ["/EECE5639-Computer-Vision/Project-1/libs/FilterApp.py", "/EECE5639-Computer-Vision/Project-1/libs/misc.py"], "/EECE5639-Computer-Vision/Project-2/libs/Co... |
60,641 | tjyiiuan/Graduate-Courses | refs/heads/master | /EECE5639-Computer-Vision/Project-1/libs/misc.py | # -*- coding: utf-8 -*-
import glob
import numpy as np
import matplotlib.image as mpimg
def EST_NOISE(images):
"""Implementation of EST_NOISE in Chapter 2 of Trucco and Verri."""
num = images.shape[0]
m_e_bar = sum(images)/num
m_sigma = np.sqrt(sum((images - m_e_bar)**2) / (num - 1))
return m_sig... | {"/EECE5639-Computer-Vision/Project-2/libs/Harris.py": ["/EECE5639-Computer-Vision/Project-2/libs/misc.py"], "/EECE5639-Computer-Vision/Project-1/libs/Detector.py": ["/EECE5639-Computer-Vision/Project-1/libs/FilterApp.py", "/EECE5639-Computer-Vision/Project-1/libs/misc.py"], "/EECE5639-Computer-Vision/Project-2/libs/Co... |
60,642 | tjyiiuan/Graduate-Courses | refs/heads/master | /EECE5639-Computer-Vision/Project-3/libs/misc.py | # -*- coding: utf-8 -*-
import glob
import numpy as np
import matplotlib.image as mpimg
__all__ = ["Gen_Gaussian_Filter", "Load_Images", "rgb2gray", "gradient"]
def Gen_Gaussian_Filter(dim, sigma, size=0):
"""Generate 1D or 2D Gaussian filter.
Parameters
----------
dim: int
Dimension of... | {"/EECE5639-Computer-Vision/Project-2/libs/Harris.py": ["/EECE5639-Computer-Vision/Project-2/libs/misc.py"], "/EECE5639-Computer-Vision/Project-1/libs/Detector.py": ["/EECE5639-Computer-Vision/Project-1/libs/FilterApp.py", "/EECE5639-Computer-Vision/Project-1/libs/misc.py"], "/EECE5639-Computer-Vision/Project-2/libs/Co... |
60,643 | tjyiiuan/Graduate-Courses | refs/heads/master | /EECE5639-Computer-Vision/Homework-3/libs/misc.py | # -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pylab as plt
def solve_2_eigenvalues(matrix):
a, b, c, d = matrix.reshape((1, -1))[0, :]
l = 1
m = - a - d
n = a * d - b * c
delta = np.sqrt(m**2 - 4 * l * n)
if delta > 0:
delta = np.sqrt(delta)
x1 = (- m + delt... | {"/EECE5639-Computer-Vision/Project-2/libs/Harris.py": ["/EECE5639-Computer-Vision/Project-2/libs/misc.py"], "/EECE5639-Computer-Vision/Project-1/libs/Detector.py": ["/EECE5639-Computer-Vision/Project-1/libs/FilterApp.py", "/EECE5639-Computer-Vision/Project-1/libs/misc.py"], "/EECE5639-Computer-Vision/Project-2/libs/Co... |
60,644 | tjyiiuan/Graduate-Courses | refs/heads/master | /EECE5639-Computer-Vision/Homework-4/hw4.py | # -*- coding: utf-8 -*-
import numpy as np
from libs.misc import *
class Homework4(object):
def __init__(self):
pass
def solve_p2(self):
"""Solve problem #1."""
f = np.array([[0, 0, 0, 0, 0, 0, 0, 0],
[0, 2, 4, 2, 0, 0, 0, 0],
[0,... | {"/EECE5639-Computer-Vision/Project-2/libs/Harris.py": ["/EECE5639-Computer-Vision/Project-2/libs/misc.py"], "/EECE5639-Computer-Vision/Project-1/libs/Detector.py": ["/EECE5639-Computer-Vision/Project-1/libs/FilterApp.py", "/EECE5639-Computer-Vision/Project-1/libs/misc.py"], "/EECE5639-Computer-Vision/Project-2/libs/Co... |
60,645 | tjyiiuan/Graduate-Courses | refs/heads/master | /EECE5639-Computer-Vision/Project-2/libs/Mosaic.py | # -*- coding: utf-8 -*-
import logging
from cv2 import warpPerspective
import numpy as np
import matplotlib.pylab as plt
plt.rcParams['figure.figsize'] = 15, 6
from .misc import rgb2gray, homo_project
from .Harris import Harris_Corner_Detector
from .Correspondences import Correspond
class Image_Mosaicing(object):
... | {"/EECE5639-Computer-Vision/Project-2/libs/Harris.py": ["/EECE5639-Computer-Vision/Project-2/libs/misc.py"], "/EECE5639-Computer-Vision/Project-1/libs/Detector.py": ["/EECE5639-Computer-Vision/Project-1/libs/FilterApp.py", "/EECE5639-Computer-Vision/Project-1/libs/misc.py"], "/EECE5639-Computer-Vision/Project-2/libs/Co... |
60,646 | tjyiiuan/Graduate-Courses | refs/heads/master | /EECE5639-Computer-Vision/Project-3/libs/Flow.py | # -*- coding: utf-8 -*-
import cv2
import numpy as np
import matplotlib.pylab as plt
plt.rcParams['figure.figsize'] = 9, 9
from .misc import rgb2gray, Gen_Gaussian_Filter, apply_2d_filter, gradient, solve_mateq, norm_minmax
class Dense_Optical_Flow(object):
"""Produce a mosaic containing the union of all pixels ... | {"/EECE5639-Computer-Vision/Project-2/libs/Harris.py": ["/EECE5639-Computer-Vision/Project-2/libs/misc.py"], "/EECE5639-Computer-Vision/Project-1/libs/Detector.py": ["/EECE5639-Computer-Vision/Project-1/libs/FilterApp.py", "/EECE5639-Computer-Vision/Project-1/libs/misc.py"], "/EECE5639-Computer-Vision/Project-2/libs/Co... |
60,647 | tjyiiuan/Graduate-Courses | refs/heads/master | /EECE5639-Computer-Vision/Project-1/libs/FilterApp.py | # -*- coding: utf-8 -*-
import numpy as np
class FilterApp(object):
def __init__(self):
pass
@staticmethod
def apply_1d_filter(bfilter, timage):
"""Apply given 1D filter onto an image.
Parameters
----------
bfilter: 1D array-like
The f... | {"/EECE5639-Computer-Vision/Project-2/libs/Harris.py": ["/EECE5639-Computer-Vision/Project-2/libs/misc.py"], "/EECE5639-Computer-Vision/Project-1/libs/Detector.py": ["/EECE5639-Computer-Vision/Project-1/libs/FilterApp.py", "/EECE5639-Computer-Vision/Project-1/libs/misc.py"], "/EECE5639-Computer-Vision/Project-2/libs/Co... |
60,650 | ttimon7/Kivy_OpenGL | refs/heads/master | /glmodel.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import kivy
from kivy.graphics import *
from kivy.graphics import Color, Ellipse
from kivy.graphics.transformation import Matrix
from kivy.graphics.opengl import *
from kivy.resources import resource_find
kivy.require('1.9.1') # replace with your current kivy version !
impo... | {"/glmodel.py": ["/colored_output.py"], "/main.py": ["/colored_output.py", "/glmodel.py"]} |
60,651 | ttimon7/Kivy_OpenGL | refs/heads/master | /colored_output.py | #!/usr/bin/python3
class BColors:
""" Class Decription
Container for ANSI Escape Characters
"""
# '\033[1;30mGray like Ghost\033[1;m'
# '\033[1;31mRed like Radish\033[1;m'
# '\033[1;32mGreen like Grass\033[1;m'
# '\033[1;33mYellow like Yolk\033[1;m'
# '\033[1;34mBlue like Blood\033[1;... | {"/glmodel.py": ["/colored_output.py"], "/main.py": ["/colored_output.py", "/glmodel.py"]} |
60,652 | ttimon7/Kivy_OpenGL | refs/heads/master | /main.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import kivy
from kivy.app import App
from kivy.config import Config
from kivy.graphics import *
from kivy.graphics import Color, Ellipse
from kivy.graphics.transformation import Matrix
from kivy.graphics.opengl import *
from kivy.resources import resource_find
from kivy.lang ... | {"/glmodel.py": ["/colored_output.py"], "/main.py": ["/colored_output.py", "/glmodel.py"]} |
60,655 | Ipsedo/PolyhedronGAN | refs/heads/main | /utils.py | import sys
import os
def block_print():
sys.stdout = open(os.devnull, 'w')
# Restore
def enable_print():
sys.stdout = sys.__stdout__
| {"/train.py": ["/networks.py"], "/read_model.py": ["/utils.py"]} |
60,656 | Ipsedo/PolyhedronGAN | refs/heads/main | /train.py | import networks
import torch as th
from tqdm import tqdm
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser("Main - train")
parser.add_argument("--tensor-file", type=str, required=True)
args = parser.parse_args()
data = th.load(args.tensor_file)
rand_channel = 32
... | {"/train.py": ["/networks.py"], "/read_model.py": ["/utils.py"]} |
60,657 | Ipsedo/PolyhedronGAN | refs/heads/main | /read_model.py | import voxlib.voxelize as voxel
import stl
import numpy as np
from voxelfuse.voxel_model import VoxelModel, Axes
import tqdm
import utils
import torch as th
import torch.nn.functional as fun
import matplotlib.pyplot as plt
import os
import argparse
def gen_rand_rotation(stl_path: str, out_file: str) -> None:
... | {"/train.py": ["/networks.py"], "/read_model.py": ["/utils.py"]} |
60,658 | Ipsedo/PolyhedronGAN | refs/heads/main | /networks.py | import torch as th
import torch.nn as nn
class ReLU1(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x: th.Tensor) -> th.Tensor:
return th.minimum(
th.maximum(th.tensor(0., device=x.device), x),
th.tensor(1., device=x.device)
)
class Gene... | {"/train.py": ["/networks.py"], "/read_model.py": ["/utils.py"]} |
60,688 | ahmedbendev/Reclamation-Client | refs/heads/master | /users/custom_validators.py | from django.utils.translation import gettext as _, ngettext # https://docs.python.org/2/library/gettext.html#gettext.ngettext
from django.core.exceptions import ValidationError
import re
from difflib import SequenceMatcher
from pathlib import Path
import gzip
# https://docs.djangoproject.com/en/2.0/_modules/django/... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,689 | ahmedbendev/Reclamation-Client | refs/heads/master | /users/migrations/0007_adress.py | # Generated by Django 2.2 on 2019-04-25 10:56
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0006_auto_20190423_1328'),
]
operations = [
migrations.CreateModel(
name='Adress',
... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,690 | ahmedbendev/Reclamation-Client | refs/heads/master | /requets/urls.py | from django.urls import path
from . import views
urlpatterns = [
path('',views.home,name="home"),
path('create_requete/',views.choose_problem,name="create_requete"),
path('create_requete_telephonique/',views.RequetCreateView.as_view(),name="create_requete_telephonique"),
path('create_requete_internet/'... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,691 | ahmedbendev/Reclamation-Client | refs/heads/master | /users/migrations/0005_auto_20190417_1459.py | # Generated by Django 2.2 on 2019-04-17 12:59
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0004_auto_20190417_1408'),
]
operations = [
migrations.RemoveField(
model_name='profile'... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,692 | ahmedbendev/Reclamation-Client | refs/heads/master | /manager/views.py | from datetime import datetime
from django.shortcuts import render ,redirect ,get_object_or_404
from django.contrib import auth
from django.urls import reverse
from django.http import HttpResponse
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.views.generic imp... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,693 | ahmedbendev/Reclamation-Client | refs/heads/master | /requets/admin.py | from django.contrib import admin
from .models import Requet
# Register your models here.
admin.site.register(Requet)
| {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,694 | ahmedbendev/Reclamation-Client | refs/heads/master | /requets/migrations/0008_auto_20190417_1408.py | # Generated by Django 2.2 on 2019-04-17 12:08
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('requets', '0007_auto_20190417_1407'),
]
operations = [
migrations.AlterField(
... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,695 | ahmedbendev/Reclamation-Client | refs/heads/master | /manager/serializers.py | from requets.models import Requet
from rest_framework import serializers
class ReclamationSerializer(serializers.ModelSerializer):
class Meta:
model = Requet
fields = ["pk",]
| {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,696 | ahmedbendev/Reclamation-Client | refs/heads/master | /users/models.py | from django.db import models
from django.contrib.auth.models import User
from requets.models import Requet
# Create your models here.
class Profile(models.Model):
owner = models.OneToOneField(User ,on_delete = models.CASCADE)
location = models.CharField(max_length = 100)
phone_number = models.CharField(m... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,697 | ahmedbendev/Reclamation-Client | refs/heads/master | /requets/migrations/0017_requet_fix_confirm.py | # Generated by Django 2.2 on 2019-04-26 13:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('requets', '0016_notification'),
]
operations = [
migrations.AddField(
model_name='requet',
name='fix_confirm',
... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,698 | ahmedbendev/Reclamation-Client | refs/heads/master | /users/migrations/0002_auto_20190417_1351.py | # Generated by Django 2.2 on 2019-04-17 11:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Company',
fields=[
('id', mode... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,699 | ahmedbendev/Reclamation-Client | refs/heads/master | /requets/migrations/0013_auto_20190424_1224.py | # Generated by Django 2.2 on 2019-04-24 10:24
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('requets', '0012_auto_20190423_1537'),
]
operations = [
migrations.AlterField(
model_name='requet',
... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,700 | ahmedbendev/Reclamation-Client | refs/heads/master | /requets/views.py | from django.shortcuts import render , redirect ,get_object_or_404
from django.urls import reverse
from django.views.generic import CreateView , DeleteView , ListView ,DetailView
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin , UserPassesTestMixin
from django.contrib.auth.d... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,701 | ahmedbendev/Reclamation-Client | refs/heads/master | /users/admin.py | from django.contrib import admin
from .models import Profile ,Personne ,Company , Address
# Register your models here.
admin.site.register(Profile)
admin.site.register(Personne)
admin.site.register(Company)
admin.site.register(Address)
| {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,702 | ahmedbendev/Reclamation-Client | refs/heads/master | /requets/migrations/0009_auto_20190417_1459.py | # Generated by Django 2.2 on 2019-04-17 12:59
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('users', '0005_auto_20190417_1459'),
('requets', '0008_auto_20190417_1408'),
]
operations... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,703 | ahmedbendev/Reclamation-Client | refs/heads/master | /requets/apps.py | from django.apps import AppConfig
class RequetsConfig(AppConfig):
name = 'requets'
| {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,704 | ahmedbendev/Reclamation-Client | refs/heads/master | /requets/models.py | from django.db import models
from django.contrib.auth.models import User
from django.utils import timezone
from django.db.models import Count
from django.db.models import Q
# Create your models here.
class Requet(models.Model):
client = models.ForeignKey(User , on_delete = models.CASCADE , related_name = "requets... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,705 | ahmedbendev/Reclamation-Client | refs/heads/master | /users/views.py | from django.shortcuts import render ,redirect , get_object_or_404
from django.contrib.auth.models import User
from .models import Profile ,Personne ,Company , Address
from requets.models import Requet
from .forms import( AddressPersonneChangeForm ,UserForm ,
ProfileForm , UserChangeInfoForm ,
... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,706 | ahmedbendev/Reclamation-Client | refs/heads/master | /users/urls.py | from django.urls import path , include
from . import views
from django.contrib.auth.views import (
PasswordResetView,
PasswordResetConfirmView,
PasswordResetDoneView,
... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,707 | ahmedbendev/Reclamation-Client | refs/heads/master | /users/migrations/0004_auto_20190417_1408.py | # Generated by Django 2.2 on 2019-04-17 12:08
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('requets', '0008_auto_20190417_1408'),
('users', '0003_auto_20190417_1407'),
]
operations = [
migratio... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,708 | ahmedbendev/Reclamation-Client | refs/heads/master | /requets/forms.py | from django import forms
from .models import Requet
class RequetForm(forms.ModelForm):
class Meta:
model = Requet
fields = ["problem","content",]
CHOICES = [
("Coupage telephonique", "Coupage telephonique"),
("Autre Problem" ,"Autre Problem"),
]
widgets = ... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,709 | ahmedbendev/Reclamation-Client | refs/heads/master | /requets/migrations/0001_initial.py | # Generated by Django 2.2 on 2019-04-15 11:58
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
opera... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,710 | ahmedbendev/Reclamation-Client | refs/heads/master | /requets/migrations/0007_auto_20190417_1407.py | # Generated by Django 2.2 on 2019-04-17 12:07
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('requets', '0006_auto_20190417_1354'),
]
operations = [
migrations.CreateModel(
... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,711 | ahmedbendev/Reclamation-Client | refs/heads/master | /users/forms.py | from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm , UserChangeForm
from .models import Profile ,Personne ,Company ,Address
from django.utils.translation import gettext_lazy as _
class UserForm(UserCreationForm):
class Meta:
model ... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,712 | ahmedbendev/Reclamation-Client | refs/heads/master | /manager/permissions.py | from rest_framework import permissions
class IsManager(permissions.BasePermission):
"""
Custom permission to only allow owners of an object to edit it.
"""
def has_permission(self, request, view):
if request.user.profile.group == "admin":
return True
return False
| {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,713 | ahmedbendev/Reclamation-Client | refs/heads/master | /users/migrations/0003_auto_20190417_1407.py | # Generated by Django 2.2 on 2019-04-17 12:07
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0002_auto_20190417_1351'),
]
operations = [
migrations.DeleteModel(
name='Company',
),
migrations.DeleteModel(
... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,714 | ahmedbendev/Reclamation-Client | refs/heads/master | /manager/forms.py | from django import forms
from requets.models import Requet , Notification
from users.models import Profile ,Address
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from django.utils.translation import gettext_lazy as _
class EditRequetForm(forms.ModelForm):
def... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,715 | ahmedbendev/Reclamation-Client | refs/heads/master | /manager/urls.py | from django.urls import path
from . import views
urlpatterns = [
path("",views.login_manager,name="login_manager"),
path("home/",views.home,name="manager_home"),
path("requets/",views.RequetsListView.as_view(),name="manager_requets"),
path("aprove_requet/<int:id>/",views.aprove,name="aprove_requet"),
... | {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
60,716 | ahmedbendev/Reclamation-Client | refs/heads/master | /users/migrations/0008_auto_20190425_1318.py | # Generated by Django 2.2 on 2019-04-25 11:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0007_adress'),
]
operations = [
migrations.RenameModel(
old_name='Adress',
new_name='Address',
),
]
| {"/manager/views.py": ["/manager/permissions.py", "/manager/forms.py", "/requets/models.py", "/users/models.py", "/manager/serializers.py"], "/requets/admin.py": ["/requets/models.py"], "/manager/serializers.py": ["/requets/models.py"], "/users/models.py": ["/requets/models.py"], "/requets/views.py": ["/users/forms.py"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.