index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
35,059,238 | hendrix/hendrix | refs/heads/main | /examples/django_hx_chatserver/example_app/chat/views.py | from django.shortcuts import render
from .models import ChatMessage
# Create your views here.
def home(request, chat_channel_name=None):
"""
if we have a chat_channel_name kwarg,
have the response include that channel name
so the javascript knows to subscribe to that
channel...
... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,239 | hendrix/hendrix | refs/heads/main | /test/debug_test_application.py | '''
Runs the test WSGI application on a real HendrixDeploy.
Useful for poking and prodding to discover how to cover those hard-to-reach
parts of the service flow.
'''
from twisted.internet import reactor
from hendrix.deploy.base import HendrixDeploy
from resources import application
if __name__ == "__main__":
t... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,240 | hendrix/hendrix | refs/heads/main | /hendrix/mechanics/concurrency/__init__.py | import threading
from hendrix.mechanics.concurrency.exceptions import ThreadHasNoResponse
def get_response_for_thread(thread=None):
if not thread:
thread = threading.current_thread()
try:
response = thread.response_object
except AttributeError:
raise ThreadHasNoResponse('thread %... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,241 | hendrix/hendrix | refs/heads/main | /examples/django_hx_chatserver/example_app/chat/models.py | from django.db import models
from django.template import loader
from django.utils import timezone
from hendrix.contrib.concurrency.signals import message_signal
from hendrix.experience import hey_joe
# Create your models here.
class ChatMessage(models.Model):
"""
a model that stores chat history
""... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,242 | hendrix/hendrix | refs/heads/main | /hendrix/ux.py | """
A module to encapsulate the user experience logic
"""
from __future__ import with_statement
import os
import re
import subprocess
import sys
import time
import traceback
import chalk
from twisted.logger import globalLogPublisher
from watchdog.events import FileSystemEventHandler
from watchdog.observers import Ob... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,243 | hendrix/hendrix | refs/heads/main | /hendrix/deploy/base.py | import importlib
import os
import pickle
import shutil
import time
from os import environ
from socket import AF_INET
import autobahn
import chalk
from twisted.application.internet import TCPServer, SSLServer
from twisted.internet import reactor
from twisted.internet.defer import DeferredLock
from twisted.python.thread... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,244 | hendrix/hendrix | refs/heads/main | /hendrix/contrib/__init__.py | class SettingsError(Exception):
"Because we don't to inherit ImproperlyConfigured..."
pass
| {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,245 | hendrix/hendrix | refs/heads/main | /hendrix/contrib/concurrency/messaging.py | import copy
import json
import uuid
import warnings
warnings.warn("hendrix.contrib.concurrency.messaging is being deprecated. Use hendrix.experience.hey_joe instead.",
DeprecationWarning)
class RecipientManager(object):
"""
This class manages all the transports addressable by a single add... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,246 | hendrix/hendrix | refs/heads/main | /hendrix/deploy/tls.py | import chalk
from autobahn.twisted.websocket import listenWS
from twisted.internet import reactor
from twisted.internet.ssl import PrivateCertificate, DefaultOpenSSLContextFactory
from twisted.protocols.tls import TLSMemoryBIOFactory
from hendrix.facilities.services import HendrixTCPServiceWithTLS
from .base import He... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,247 | hendrix/hendrix | refs/heads/main | /hendrix/defaults.py | import os
CACHE_PORT = 8080
HTTP_PORT = 8000
HTTPS_PORT = 4430
DEFAULT_MAX_AGE = 3600
DEFAULT_LOG_PATH = os.path.dirname(__file__)
DEFAULT_LOG_FILE = os.path.join(DEFAULT_LOG_PATH, 'default-hendrix.log')
| {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,248 | hendrix/hendrix | refs/heads/main | /test/test_resources.py | import unittest
from twisted.web.resource import getChildForRequest, NoResource
from twisted.web.test.requesthelper import DummyRequest
try:
from unittest import mock
except ImportError:
import mock
from hendrix.facilities.resources import HendrixResource, NamedResource, WSGIResource
class TestHendrixResou... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,249 | hendrix/hendrix | refs/heads/main | /hendrix/deploy/cache.py | from hendrix.contrib.services.cache import CacheService
from .base import HendrixDeploy
class HendrixDeployCache(HendrixDeploy):
"""
HendrixDeploy encapsulates the necessary information needed to deploy
the HendrixService on a single or multiple processes.
"""
def addServices(self):
super... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,250 | hendrix/hendrix | refs/heads/main | /hendrix/contrib/resources/static.py | import os
from django.conf import settings
from django.contrib.staticfiles import finders
from hendrix.facilities.resources import DjangoStaticResource
def generate_resources_for_location(disk_root, url):
for root, dirs, files in os.walk(disk_root):
yield DjangoStaticResource(
root,
... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,251 | hendrix/hendrix | refs/heads/main | /hendrix/experience/hey_joe.py | import json
import uuid
from collections import defaultdict
from itertools import chain
from autobahn.twisted import WebSocketServerFactory
from autobahn.twisted.websocket import WebSocketServerProtocol
from twisted.internet import threads
from twisted.logger import Logger
from hendrix.contrib.concurrency.signals imp... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,252 | hendrix/hendrix | refs/heads/main | /hendrix/facilities/gather.py | import importlib
def get_additional_services(settings_module):
"""
if HENDRIX_SERVICES is specified in settings_module,
it should be a list twisted internet services
example:
HENDRIX_SERVICES = (
('myServiceName', 'apps.offload.services.TimeService'),
... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,253 | hendrix/hendrix | refs/heads/main | /hendrix/contrib/cache/resource.py | try:
import cStringIO
except ImportError:
from io import BytesIO as cStringIO
try:
import urlparse
except ImportError:
from urllib.parse import urlparse
from twisted.internet import reactor
from twisted.web import proxy, client
from twisted.web.server import NOT_DONE_YET
from hendrix.utils import res... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,254 | hendrix/hendrix | refs/heads/main | /hendrix/management/commands/hx.py | from django.core.management.base import BaseCommand
from hendrix.options import HX_OPTION_LIST
from hendrix.ux import launch
class Command(BaseCommand):
option_list = HX_OPTION_LIST
def handle(self, *args, **options):
launch(*args, **options)
| {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,255 | hendrix/hendrix | refs/heads/main | /hendrix/contrib/cache/backends/__init__.py | """
Fuck YEAH. enthusiasm.
"""
try:
import urlparse
except ImportError:
from urllib.parse import urlparse
from hendrix.contrib.cache import compressBuffer, decompressBuffer
PREFIX = "/CACHE"
class CacheBackend(object):
"The api to use when creating a cache backend"
@property
def cache(self):
... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,256 | hendrix/hendrix | refs/heads/main | /test/test_testing_utils.py | import pytest
from hendrix.experience import crosstown_traffic
from hendrix.utils.test_utils import AsyncTestMixin, crosstownTaskListDecoratorFactory
def test_assert_num_tasks():
a_mixin = AsyncTestMixin()
a_mixin.sub_setUp()
a_mixin.assertNumCrosstownTasks(0)
def some_task():
pass
thro... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,257 | hendrix/hendrix | refs/heads/main | /hendrix/facilities/protocols.py | import sys
if sys.platform == 'win32':
from twisted.internet.iocpreactor.tcp import Server
else:
from twisted.internet.unix import Server
class DeployServerProtocol(Server):
"""
A process protocol for interprocess communication between
HendrixDeploy and its workers.
"""
def __init__(self... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,258 | hendrix/hendrix | refs/heads/main | /hendrix/mechanics/concurrency/decorators.py | import threading
from twisted.internet import reactor
from twisted.internet.threads import deferToThreadPool
from twisted.logger import Logger
from hendrix.mechanics.concurrency import get_response_for_thread
from hendrix.mechanics.concurrency.exceptions import ThreadHasNoResponse
class _ThroughToYou(object):
l... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,259 | hendrix/hendrix | refs/heads/main | /examples/django_nyc_demo/run.py | from twisted.conch.telnet import TelnetTransport, TelnetProtocol
from twisted.internet.protocol import ServerFactory
from hendrix.deploy.base import HendrixDeploy
from hendrix.experience import hey_joe
class TelnetToWebsocket(TelnetProtocol):
def dataReceived(self, data):
hey_joe.send('noodly_messages',... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,260 | hendrix/hendrix | refs/heads/main | /hendrix/facilities/response.py | import threading
from twisted.internet import reactor
from twisted.logger import Logger
from twisted.web.wsgi import _WSGIResponse
from hendrix.utils import responseInColor
class HendrixWSGIResponse(_WSGIResponse):
log = Logger()
def __init__(self, *args, **kwargs):
self.crosstown_tasks = []
... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,261 | hendrix/hendrix | refs/heads/main | /hendrix/contrib/services/cache.py | from twisted.web import server
from hendrix.contrib.cache.resource import CacheProxyResource
from hendrix.facilities.services import HendrixTCPService
class CacheService(HendrixTCPService):
def __init__(self, host, from_port, to_port, path, *args, **kwargs):
resource = CacheProxyResource(host, to_port, ... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,262 | hendrix/hendrix | refs/heads/main | /test/testproject/settings.py | DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.',
'NAME': '',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
ALLOWED_HOSTS = []
TIME_ZONE = 'America/Chicago'
LANGUAGE_CODE = 'en-us'
USE_I18N = True
USE_L10N ... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,263 | hendrix/hendrix | refs/heads/main | /test/test_hx_launcher.py | from hendrix.options import HendrixOptionParser
from hendrix.ux import main
def test_no_arguments_gives_help_text(mocker):
class MockFile(object):
@classmethod
def write(cls, whatever):
cls.things_written = whatever
class MockStdOut(object):
@classmethod
def write... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,264 | hendrix/hendrix | refs/heads/main | /hendrix/contrib/cache/__init__.py | try:
import cStringIO
except ImportError:
from io import BytesIO as cStringIO
import gzip
from datetime import datetime
try:
import urlparse
except ImportError:
from urllib.parse import urlparse
from time import strptime
from twisted.web.resource import Resource
def compressBuffer(buffer):
"""
... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,265 | hendrix/hendrix | refs/heads/main | /hendrix/mechanics/concurrency/exceptions.py | class ThreadHasNoResponse(RuntimeError):
pass
class RedisException(AttributeError):
"""
Raised if a user tries to use redis-only features without redis available.
"""
| {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,266 | hendrix/hendrix | refs/heads/main | /test/test_crosstown_traffic.py | import threading
import pytest
import pytest_twisted
from six.moves.queue import Queue
from twisted.internet import reactor
from twisted.internet.address import IPv4Address
from twisted.internet.threads import deferToThreadPool
from twisted.logger import Logger
from twisted.python.threadpool import ThreadPool
from twi... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,267 | hendrix/hendrix | refs/heads/main | /examples/tls_server/gen-ec.py | import datetime
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.x509.oid import NameOID
ec_key = ... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,268 | hendrix/hendrix | refs/heads/main | /test/test_deploy.py | from .utils import HendrixTestCase
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from twisted.application import service
from twisted.internet import tcp
from twisted.logger import Logger
log = Logger()
class DeployTests(HendrixTestCase):
"Tests HendrixDeploy"
def... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,269 | hendrix/hendrix | refs/heads/main | /hendrix/contrib/concurrency/resources.py | import json
import uuid
from twisted.internet import threads
from twisted.internet.protocol import Protocol
from hendrix.facilities.resources import NamedResource
from .messaging import hxdispatcher
def send_django_signal(transport, data):
from .signals import message_signal
message_signal.send(None, dispat... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,270 | hendrix/hendrix | refs/heads/main | /examples/django_nyc_demo/noodles/views.py | import time
from django.shortcuts import render
from hendrix.experience import crosstown_traffic, hey_joe
def my_noodles(request):
llama = "Another noodle"
@crosstown_traffic()
def my_long_thing():
for i in range(5):
print("another noodle on the python console")
time.sle... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,271 | hendrix/hendrix | refs/heads/main | /examples/django_hx_chatserver/example_app/run.py | from hendrix.deploy.base import HendrixDeploy
from hendrix.experience import hey_joe
deployer = HendrixDeploy(options={'wsgi': 'example_app.wsgi.application', 'http_port': 7575})
websocket_service = hey_joe.WebSocketService("127.0.0.1", 9000)
deployer.add_non_tls_websocket_service(websocket_service)
deployer.run()
| {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,272 | hendrix/hendrix | refs/heads/main | /hendrix/deploy/hybrid.py | from .cache import HendrixDeployCache
from .tls import HendrixDeployTLS
class HendrixDeployHybrid(HendrixDeployTLS, HendrixDeployCache):
pass
| {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,273 | hendrix/hendrix | refs/heads/main | /performance-tools/simple_multi.py | import multiprocessing
def thing():
print
"yay!"
multiprocessing.Process(target=thing).start()
| {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,274 | hendrix/hendrix | refs/heads/main | /examples/django_hx_chatserver/example_app/example_app/urls.py | from chat.views import home
from django.conf import settings
from django.conf.urls import url
from django.conf.urls.static import static
from django.contrib import admin
urlpatterns = [
url(r'^(?P<chat_channel_name>\w+)$', home, name='home'),
url(r'^$', home, name='home'),
... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,275 | hendrix/hendrix | refs/heads/main | /hendrix/contrib/cache/backends/memory_cache.py | """
local memory cache backend
"""
from hendrix.contrib.cache import CachedResource
from . import CacheBackend
class MemoryCacheBackend(CacheBackend):
_cache = {}
@property
def cache(self):
return self._cache
def addResource(self, content, uri, headers):
"""
Adds the a hendri... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,276 | hendrix/hendrix | refs/heads/main | /performance-tools/perf_client1.py | import requests
counter = 0
for counter in range(5000):
r = requests.get('http://localhost:8000/fib/%s' % counter)
print
"%s - %s" % (counter, r)
| {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,277 | hendrix/hendrix | refs/heads/main | /hendrix/facilities/resources.py | import sys
import chalk
from twisted.logger import Logger
from twisted.web import resource, static
from twisted.web.server import NOT_DONE_YET
from twisted.web.wsgi import WSGIResource
from hendrix.facilities.response import HendrixWSGIResponse, LoudWSGIResponse
class HendrixWSGIResource(WSGIResource):
Response... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,278 | hendrix/hendrix | refs/heads/main | /setup.py | import errno
import os
import sys
from setuptools import setup, find_packages
from setuptools.command.install import install
from hendrix import __version__
def file_name(rel_path):
dir_path = os.path.dirname(__file__)
return os.path.join(dir_path, rel_path)
def read(rel_path):
with open(file_name(rel... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,279 | hendrix/hendrix | refs/heads/main | /test/test_ux.py | import os
import sys
from hendrix import ux
from hendrix.contrib import SettingsError
from hendrix.deploy.base import HendrixDeploy
from hendrix.options import options as hx_options
from .utils import HendrixTestCase
try:
from unittest.mock import patch
except ImportError:
from mock import patch
class TestM... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,280 | hendrix/hendrix | refs/heads/main | /examples/tls_server/gen-rsa.py | import datetime
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.x509.oid import NameOID
rsa_key ... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,281 | hendrix/hendrix | refs/heads/main | /hendrix/utils/__init__.py | import os
import sys
import tempfile
from importlib import import_module
import chalk
import six
HENDRIX_DIR = os.path.dirname(os.path.abspath(__file__))
# Default PID Directory
PID_DIR = tempfile.mkdtemp(prefix='hendrix-')
SHARE_PATH = os.path.join(
os.path.dirname(sys.executable),
'share/hendrix'
)
def... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,282 | hendrix/hendrix | refs/heads/main | /hendrix/options.py | import os
from optparse import make_option, OptionParser
from hendrix import defaults
def cleanOptions(options):
"""
Takes an options dict and returns a tuple containing the daemonize boolean,
the reload boolean, and the parsed list of cleaned options as would be
expected to be passed to hx
"""
... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,283 | hendrix/hendrix | refs/heads/main | /hendrix/utils/test_utils/__init__.py | from hendrix.experience import crosstown_traffic
from hendrix.mechanics.concurrency.decorators import _ThroughToYou
def crosstownTaskListDecoratorFactory(list_to_populate):
class TaskListThroughToYou(_ThroughToYou):
def __init__(self, *args, **kwargs):
self.crosstown_task_list = list_to_popul... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,284 | hendrix/hendrix | refs/heads/main | /hendrix/logger.py | import io
from twisted.logger import (
ILogObserver, jsonFileLogObserver, FilteringLogObserver,
LogLevelFilterPredicate, LogLevel
)
from zope.interface import provider
from .defaults import DEFAULT_LOG_FILE
@provider(ILogObserver)
def hendrixObserver(path=DEFAULT_LOG_FILE, log_level=LogLevel.warn):
json... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,285 | hendrix/hendrix | refs/heads/main | /examples/tls_server/run_server.py | # A sample server using TLS with either RSA or EC.
# To use this, first run either gen-ec.py or gen-rsa.py (or both).
import sys
from hendrix.deploy.tls import HendrixDeployTLS
from hendrix.experience import hey_joe
sys.path.append("../django_nyc_demo")
from hendrix_demo.wsgi import application as hendrix_demo_app
... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,286 | hendrix/hendrix | refs/heads/main | /test/test_request_behavior.py | import io
import os
import pytest_twisted
import requests
from twisted.internet import threads
from hendrix.deploy.base import HendrixDeploy
from hendrix.facilities.resources import MediaResource
from .resources import application
@pytest_twisted.inlineCallbacks
def test_max_upload_bytes():
statics_path = 'pat... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,287 | hendrix/hendrix | refs/heads/main | /hendrix/experience/crosstown_traffic.py | import sys
from twisted.internet import reactor
from twisted.python.threadpool import ThreadPool
class ModuleCaller(object):
decorator = None
def __init__(self, decorator=None):
from hendrix.mechanics.concurrency.decorators import _ThroughToYou
self.decorator = decorator or self.decorator or... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,288 | hendrix/hendrix | refs/heads/main | /hendrix/utils/conf.py | import os
import jinja2
import yaml
from . import SHARE_PATH
def generateInitd(conf_file):
"""
Helper function to generate the text content needed to create an init.d
executable
"""
allowed_opts = [
'virtualenv', 'project_path', 'settings', 'processes',
'http_port', 'cache', 'cac... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,289 | hendrix/hendrix | refs/heads/main | /hendrix/contrib/concurrency/signals.py | """
Signals for easy use in django projects
"""
try:
from django import dispatch
short_task = dispatch.Signal()
long_task = dispatch.Signal()
message_signal = dispatch.Signal()
USE_DJANGO_SIGNALS = True
except ImportError:
USE_DJANGO_SIGNALS = False | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,290 | hendrix/hendrix | refs/heads/main | /performance-tools/gunicorn_worker_test.py | from gunicorn.app.wsgiapp import WSGIApplication
w = WSGIApplication()
w.run()
| {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,291 | hendrix/hendrix | refs/heads/main | /test/test_hey_joe.py | from twisted.internet.testing import StringTransportWithDisconnection
from hendrix.experience import hey_joe
def test_websocket_mechanics():
"""
Shows that we can put our protocol (hey_joe._WayDownSouth) and factory (hey_joe.WebSocketService)
together, along with a transport, and properly open a websocke... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,292 | hendrix/hendrix | refs/heads/main | /performance-tools/pyramid_with_crosstown_traffic.py | import os
import sys
import threading
import time
from multiprocessing import Pool
import requests
from pyramid.config import Configurator
from pyramid.response import Response
# begin chdir armor
up = os.path.dirname(os.path.abspath(__file__))
testdir = os.path.dirname(up)
hendrix_app_dir = os.path.dirname(testdir)
... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,293 | hendrix/hendrix | refs/heads/main | /test/resources.py | from multiprocessing import Queue
from twisted.logger import Logger
from hendrix.experience import crosstown_traffic
from hendrix.mechanics.concurrency import get_response_for_thread, get_tasks_to_follow_current_response
log = Logger()
class TestNameSpace(object):
async_task_was_done = Queue()
async_task_w... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,294 | hendrix/hendrix | refs/heads/main | /test/test_tls_requests.py | import datetime
import os
from ipaddress import IPv4Address
import pytest_twisted
import requests
from OpenSSL.SSL import TLSv1_2_METHOD
from OpenSSL.crypto import X509 as openssl_X509
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hash... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,295 | hendrix/hendrix | refs/heads/main | /test/utils.py | import io
import unittest
from twisted.internet import reactor
from twisted.logger import eventsFromJSONLogFile
from hendrix.contrib import SettingsError
from hendrix.defaults import *
from hendrix.deploy.base import HendrixDeploy
from hendrix.utils import get_pid
TEST_SETTINGS = 'test.testproject.settings'
def it... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,296 | hendrix/hendrix | refs/heads/main | /performance-tools/simple_delay_server.py | import os
import sys
import time
from pyramid.config import Configurator
from pyramid.response import Response
from twisted.internet import reactor
from twisted.python.threadpool import ThreadPool
tp = reactor.suggestThreadPoolSize(1000)
# begin chdir armor
up = os.path.dirname(os.path.abspath(__file__))
testdir = o... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,059,297 | hendrix/hendrix | refs/heads/main | /examples/tls_server/run_client.py | # This shows that your tls server is running and properly serving. To test the TLS websocket via WSS, load the URL
# in a browser and allow a temporary verification exemption for the cert.
import requests
response = requests.get("https://localhost:8443/my_noodles", verify="rsa-certificate.pem")
assert response.statu... | {"/hendrix/facilities/services.py": ["/hendrix/facilities/resources.py"], "/examples/django_hx_chatserver/example_app/chat/views.py": ["/examples/django_hx_chatserver/example_app/chat/models.py"], "/test/debug_test_application.py": ["/hendrix/deploy/base.py"], "/hendrix/mechanics/concurrency/__init__.py": ["/hendrix/me... |
35,122,911 | sumeet-with-2e/n-chess | refs/heads/main | /venv1/lib/python3.10/site-packages/openai/version.py | VERSION = "0.27.4"
| {"/playchess.py": ["/driver.py", "/board_functions.py"], "/driver.py": ["/board_functions.py"]} |
35,122,912 | sumeet-with-2e/n-chess | refs/heads/main | /board_functions.py | import chess as ch
import chess.svg as svg
def make_board():
board = ch.Board()
boardgui = svg.board(board=board)
return board
def show_board(board):
boardgui = svg.board(board=board)
return boardgui
def is_valid(board):
if (board.is_valid() and
not board.is_checkmate() and
... | {"/playchess.py": ["/driver.py", "/board_functions.py"], "/driver.py": ["/board_functions.py"]} |
35,122,913 | sumeet-with-2e/n-chess | refs/heads/main | /playchess.py | from flask import Flask, redirect, url_for, request, render_template
from svglib.svglib import svg2rlg
import driver as dr
import board_functions as bf
app = Flask(__name__)
@app.route('/')
def home():
#boardgui = svg2rlg('board.svg')
return render_template('base.html')
@app.route('/pvp')
def pvp():
svgb... | {"/playchess.py": ["/driver.py", "/board_functions.py"], "/driver.py": ["/board_functions.py"]} |
35,122,914 | sumeet-with-2e/n-chess | refs/heads/main | /driver.py | import board_functions as bf
#import engine
def player_vs_player(board):
bf.board_reset(board)
return bf.show_board(board)
while bf.is_valid(board):
print('''
Enter Move:
''')
move = input()
board = bf.board_update(board, move)
# print svg board
... | {"/playchess.py": ["/driver.py", "/board_functions.py"], "/driver.py": ["/board_functions.py"]} |
35,122,915 | sumeet-with-2e/n-chess | refs/heads/main | /engine.py | import chess.engine
engine = chess.engine.SimpleEngine.popen_uci("stockfish-mv")
| {"/playchess.py": ["/driver.py", "/board_functions.py"], "/driver.py": ["/board_functions.py"]} |
35,174,485 | joicodes/Skybot | refs/heads/master | /test/test_app.py | import unittest
import requests
import random
# import app
import xml.etree.ElementTree as ET
from twilio.rest import Client
rand_num = str(random.randint(100000000000, 111111111111))
class AppTests(unittest.TestCase):
'''
def test_new_user(self):
req = requests.post('https://cuskybot.herokuapp.com... | {"/test/test_database.py": ["/database.py"], "/app.py": ["/database.py"], "/database.py": ["/app.py"], "/match.py": ["/app.py"]} |
35,174,486 | joicodes/Skybot | refs/heads/master | /database.py | import datetime
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import sqlalchemy
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import sessionmaker, relationship
from app import db
class User(db.Model):
""" S... | {"/test/test_database.py": ["/database.py"], "/app.py": ["/database.py"], "/database.py": ["/app.py"], "/match.py": ["/app.py"]} |
35,174,487 | joicodes/Skybot | refs/heads/master | /cost.py | import json
import requests
def get_cost(location, num_passengers):
""" Provides Skybot with Lyft cost from Columbia to needed airport
Args:
location (str): JFK, LGA, or EWR
num_passengers (int): number of passengers
Return:
cost (str): cost of the lyft ride
"""
# Gets th... | {"/test/test_database.py": ["/database.py"], "/app.py": ["/database.py"], "/database.py": ["/app.py"], "/match.py": ["/app.py"]} |
35,174,488 | joicodes/Skybot | refs/heads/master | /test/test_database.py | from database import *
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import unittest
import sqlalchemy
import sys
sys.path.append('Skybot/')
engine = create_engine('postgres://ehepwtnqjcfntn:04461d661ce43b16602000fb490e32ece1f3558bddac8f4c6059886544f7c7cd@ec2-107-21-125-209.compute-1.ama... | {"/test/test_database.py": ["/database.py"], "/app.py": ["/database.py"], "/database.py": ["/app.py"], "/match.py": ["/app.py"]} |
35,174,489 | joicodes/Skybot | refs/heads/master | /app.py | import datetime
import os
import random
import re
import unittest
from datetime import datetime
import requests
import json
import sendgrid
import sqlalchemy
from flask import Flask
from flask import redirect
from flask import request
from flask_sqlalchemy import SQLAlchemy
from sendgrid.helpers.mail import *
from sql... | {"/test/test_database.py": ["/database.py"], "/app.py": ["/database.py"], "/database.py": ["/app.py"], "/match.py": ["/app.py"]} |
35,174,490 | joicodes/Skybot | refs/heads/master | /match.py | import unittest
from datetime import datetime
import sqlalchemy
from sqlalchemy import create_engine
from sqlalchemy import exists
from sqlalchemy.orm import sessionmaker
from app import *
'''
engine = create_engine(
'postgres://ehepwtnqjcfntn:04461d661ce43b16602000fb490e32ece1f3558bddac8f4c6059886544f7c7cd@ec2-... | {"/test/test_database.py": ["/database.py"], "/app.py": ["/database.py"], "/database.py": ["/app.py"], "/match.py": ["/app.py"]} |
35,241,380 | Aryan-Naveen/dronePoseEstimation | refs/heads/master | /visualize.py | import matplotlib.pyplot as plt
import numpy as np
fusion_techniques = ["bayesian", "ellipsoidal", "covariance intersection", "inverse covariance intersection", "probablistic consistent"]
def visualize(error, time, covariances, technique):
home_dir_png = "results/images/"
home_dir_pdf = "results/"
di... | {"/computations.py": ["/utils.py"], "/main.py": ["/data_input.py", "/computations.py", "/visualize.py"]} |
35,241,381 | Aryan-Naveen/dronePoseEstimation | refs/heads/master | /main.py | from data_input import DataLoader
from data_structure import Data
from computations import *
import numpy as np
from tqdm import tqdm
import matplotlib.pyplot as plt
from visualize import visualize
from data_fusion import Data_fusion
def pinv(H, y):
return np.linalg.inv(H.T @ H) @ H.T @ y
fusion_techniques = ["ba... | {"/computations.py": ["/utils.py"], "/main.py": ["/data_input.py", "/computations.py", "/visualize.py"]} |
35,249,239 | rikardg/whathappened | refs/heads/master | /app/character/tftl/mechanics.py | import os
from ..core import CharacterMechanics
from ..schema import validate
CHARACTER_SCHEMA = os.path.join(
os.path.dirname(__file__), '../schema/tftl.json')
class TftlMechanics(CharacterMechanics):
def validate(self):
return validate(self.parent.body, CHARACTER_SCHEMA)
def version(self):
... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,240 | rikardg/whathappened | refs/heads/master | /app/auth/models.py | import logging
from time import time
import jwt
from flask_login import UserMixin
from flask import current_app
from sqlalchemy.orm import relationship
from sqlalchemy.sql.schema import Column, ForeignKey
from sqlalchemy.sql.sqltypes import Integer, String
from werkzeug.security import check_password_hash, generate_pas... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,241 | rikardg/whathappened | refs/heads/master | /app/character/__init__.py | from flask import Blueprint
from flask_assets import Environment
bp = Blueprint('character', __name__, template_folder="templates",
static_folder="static")
api = Blueprint('characterapi', __name__, template_folder="templates")
from . import routes # noqa: E402, F401 isort:skip
@bp.app_template_filt... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,242 | rikardg/whathappened | refs/heads/master | /app/profile.py | from app.content.models import Folder
import logging
from flask import (
Blueprint, render_template
)
from flask_login import login_required, current_user
from app.database import session
bp = Blueprint('profile', __name__, template_folder='templates')
# from app.character.models import Character # noqa F401
fro... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,243 | rikardg/whathappened | refs/heads/master | /migrations/versions/f047bb8f937f_add_handout_status.py | """Add handout status
Revision ID: f047bb8f937f
Revises: fae26f355099
Create Date: 2020-10-11 09:18:37.215880
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f047bb8f937f'
down_revision = 'fae26f355099'
branch_labels = None
depends_on = None
def upgrade():
... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,244 | rikardg/whathappened | refs/heads/master | /app/campaign/views.py | from typing import Text, Union
from flask import render_template, request, redirect, url_for
from flask_login import current_user
from flask.views import View
from flask_login.utils import login_required
from werkzeug.exceptions import abort
from werkzeug.wrappers import Response
import logging
import markdown2
from ... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,245 | rikardg/whathappened | refs/heads/master | /config.py | """App default config."""
import os
from dotenv import load_dotenv
BASEDIR = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(BASEDIR, '.env'))
class Config():
"""Settings to be overridden with env variables."""
SECRET_KEY = os.environ.get('SECRET_KEY') or 'development'
SQLALCHEMY_DAT... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,246 | rikardg/whathappened | refs/heads/master | /app/character/forms.py | import logging
from flask_wtf import FlaskForm
from wtforms import StringField, BooleanField, HiddenField
from wtforms import ValidationError, SubmitField
from wtforms.fields.core import Field
from wtforms.validators import DataRequired
import json
from app.forms.fields import JsonField
logger = logging.getLogger(__n... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,247 | rikardg/whathappened | refs/heads/master | /app/campaign/__init__.py | from flask import Blueprint
from flask_assets import Environment
bp = Blueprint('campaign', __name__,
template_folder='templates',
static_folder='static')
apibp = Blueprint('campaignapi', __name__, template_folder='templates')
from . import routes # noqa: F401,E402 isort:skip
from . im... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,248 | rikardg/whathappened | refs/heads/master | /app/character/coc7e/utils.py | import math
from .. import bp
@bp.app_template_filter('half')
def half(value):
if not value:
return 0
if type(value) == str:
try:
value = int(value, 10)
except ValueError:
return 0
return math.floor(value / 2)
@bp.app_template_filter('fifth')
def fifth(va... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,249 | rikardg/whathappened | refs/heads/master | /app/userassets/models.py | import os
import uuid
import logging
from flask import url_for, current_app
from sqlalchemy import event
from sqlalchemy.orm import backref, relationship
from sqlalchemy.sql.schema import Column, ForeignKey
from sqlalchemy.sql.sqltypes import Integer, String
from app.database import Base
from app.models import GUID
fr... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,250 | rikardg/whathappened | refs/heads/master | /app/content/forms.py | from flask_login import current_user
from wtforms.fields.simple import HiddenField, SubmitField
from flask_wtf.form import FlaskForm
from wtforms.fields.core import StringField
from wtforms.validators import DataRequired, UUID, Optional
from app.forms.fields.alchemy import QuerySelectField
class NewFolderForm(FlaskF... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,251 | rikardg/whathappened | refs/heads/master | /migrations/versions/a425da83bea3_add_messages_to_campaign.py | """Add messages to campaign
Revision ID: a425da83bea3
Revises: 27799ac97853
Create Date: 2021-01-31 16:20:15.256849
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a425da83bea3'
down_revision = '27799ac97853'
branch_labels = None
depends_on = None
def upgrad... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,252 | rikardg/whathappened | refs/heads/master | /app/campaign/models.py | import enum
from flask import url_for
from datetime import datetime
from sqlalchemy.orm import backref, relationship
from sqlalchemy.sql.schema import ForeignKey, Table, Column
from sqlalchemy.sql.sqltypes import Boolean, DateTime
from sqlalchemy.sql.sqltypes import Enum, Integer, String, Text
from app.database import... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,253 | rikardg/whathappened | refs/heads/master | /migrations/versions/186d10393f49_add_campaign_settings.py | """Add campaign settings
Revision ID: 186d10393f49
Revises: 8b29c4eb9589
Create Date: 2021-01-05 21:05:19.783990
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '186d10393f49'
down_revision = '8b29c4eb9589'
branch_labels = None
depends_on = None
def upgrade()... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,254 | rikardg/whathappened | refs/heads/master | /app/utils/schema.py | import copy
from typing import Union
from packaging.version import Version, LegacyVersion, parse
SheetVersion = Union[Version, LegacyVersion]
def up_or_down(from_version: SheetVersion, to_version: SheetVersion) -> int:
if from_version > to_version:
return -1
if to_version > from_version:
re... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,255 | rikardg/whathappened | refs/heads/master | /app/character/coc7e/forms.py | from wtforms import SelectField
from ..forms import CreateForm
from . import GameTypes
class CreateForm(CreateForm):
gametype = SelectField('Type', choices=GameTypes, )
| {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,256 | rikardg/whathappened | refs/heads/master | /tests/coc7e/test_coc7e.py | """Test functions specific to Call of Cthulhu."""
import os
import json
import pytest
from app.auth.models import User # noqa
from app.campaign.models import Campaign # noqa
from app.character.coc7e import CoCMechanics
from app.character.coc7e import new_character
from app.character.coc7e import CHARACTER_SCHEMA
f... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,257 | rikardg/whathappened | refs/heads/master | /app/userassets/forms.py | from flask_login import current_user
from flask import url_for
from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileRequired, FileAllowed
from wtforms import SubmitField
from wtforms.fields.core import StringField
from wtforms.fields.simple import HiddenField
from wtforms.validators import DataRe... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,258 | rikardg/whathappened | refs/heads/master | /tests/test_auth.py | from flask import session
from app.auth.models import User
def test_register(app, db):
client = app.test_client()
assert client.get('/auth/register').status_code == 200
response = client.post(
'/auth/register', data={'username': 'a',
'email': 't@t.com',
... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,259 | rikardg/whathappened | refs/heads/master | /migrations/versions/b10c98640b7c_add_content_folders.py | """Add content folders
Revision ID: b10c98640b7c
Revises: a425da83bea3
Create Date: 2021-04-27 22:42:23.571828
"""
from alembic import op
import sqlalchemy as sa
from app.database.fields import GUID
# revision identifiers, used by Alembic.
revision = 'b10c98640b7c'
down_revision = 'a425da83bea3'
branch_labels = None... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,260 | rikardg/whathappened | refs/heads/master | /app/email.py | from threading import Thread
from flask_mail import Message
from flask import current_app, Flask
from app import mail
from typing import List
def send_async_email(app: Flask, msg: str):
with app.app_context():
mail.send(msg)
def send_mail(subject: str,
sender: str,
recipients... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,261 | rikardg/whathappened | refs/heads/master | /app/character/routes.py | import os
from app.character import core
from app.character.core import CHARACTER_SCHEMA_DIR, GameSystems
from app.character.schema import load_schema, sub_schema
import logging
from flask import render_template, request
from flask import redirect, url_for, jsonify
from flask_login import login_required, current_user
... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,262 | rikardg/whathappened | refs/heads/master | /app/database/__init__.py | import math
from sqlalchemy import create_engine, MetaData
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
Session = sessionmaker(autocommit=False, autoflush=True)
session = scoped_session(Session)
convention = {
"ix": 'ix_%(column_0_label)s',
"u... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,263 | rikardg/whathappened | refs/heads/master | /app/character/coc7e/__init__.py | import logging
import json
import jinja2
import time
from typing import Literal
from .mechanics import CoCMechanics
from .mechanics import CHARACTER_SCHEMA # noqa F401
from ..core import register_game
logger = logging.getLogger(__name__)
# This is not pretty
GameType = Literal["Classic (1920's)", "Modern"]
GameT... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,264 | rikardg/whathappened | refs/heads/master | /migrations/versions/71a3d1badc2e_add_campaigns.py | """Add campaigns
Revision ID: 71a3d1badc2e
Revises: 15525e328d2d
Create Date: 2020-10-04 14:11:35.762861
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '71a3d1badc2e'
down_revision = '15525e328d2d'
branch_labels = None
depends_on = None
def upgrade():
# ... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
35,249,265 | rikardg/whathappened | refs/heads/master | /migrations/versions/ac772b7261d0_add_metadata_naming_conventions.py | """Add metadata naming conventions
Revision ID: ac772b7261d0
Revises: c99e163f4457
Create Date: 2020-11-29 18:20:25.867829
"""
from alembic import op
import sqlalchemy as sa
from alembic import context
# revision identifiers, used by Alembic.
revision = 'ac772b7261d0'
down_revision = 'c99e163f4457'
branch_labels = N... | {"/app/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/app/auth/models.py": ["/app/__init__.py", "/app/database/__init__.py"], "/tests/test_factory.py": ["/tests/conftest.py", "/app/__init__.py"], "/app/character/coc7e/__init__.py": ["/app/character/core.py", "/app/character/coc7e/mechanics.py", "/app/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.