code
stringlengths
1
199k
from servicediscovery.client.client import ServiceClient, RegisteredServiceClient from servicediscovery.client.server import ServiceRegistry __all__ = ['ServiceClient', 'RegisteredServiceClient', 'ServiceRegistry']
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('job_board', '0017_auto_20161225_0344'), ] operations = [ migrations.AddField( model_name='siteconfig', name='mailchimp_api_key', ...
import os import sys import tensorflow as tf import numpy as np def get_weights(name, shape, stddev, trainable = True): return tf.get_variable('weights{}'.format(name), shape, initializer = tf.random_normal_initializer(stddev = stddev), trainable = trainable) de...
import unittest import httpretty import json from six.moves.urllib.parse import urlparse, unquote from pysnow.response import Response from pysnow.client import Client from pysnow.attachment import Attachment from requests.exceptions import HTTPError from pysnow.exceptions import ( ResponseError, NoResults, ...
from __future__ import print_function import json import boto3 print('Loading function') # def lambda_handler(event, context): # #print("Received event: " + json.dumps(event, indent=2)) # # print("value1 = " + event['key1']) # # print("value2 = " + event['key2']) # # prin...
from __future__ import unicode_literals import pytest from dtypes.stack import Stack @pytest.fixture def base_stack(): return Stack([1, 2, 3]) def test_construct_from_iterable_valid(base_stack): expected_output = "(1, 2, 3)" assert base_stack.__str__() == expected_output def test_construct_from_nested_itera...
import os PROJECT_ROOT = os.path.join(os.path.dirname(__file__), '..', '..') SECRET_KEY = '6()*&j-ww(=j1&etsd%ws053m#wi_a+oas_hp1y*#4bp7!+w&y' INTERNAL_IPS = '127.0.0.1' EMAIL_HOST = 'mail.stowers.org' EMAIL_PORT = 25 DEFAULT_FROM_EMAIL = 'contact@track' EMAIL_DOMAIN = 'stowers.org' DEFAULT_APPS = ( 'django.contrib...
import dill as pickle import pandas as pd import numpy as np import time from datetime import datetime """ This module is responsible for processing each json object into the different features necessary for the prediction model module so that the random forest ensemble can make predictions on newly downloaded tweets, ...
import unittest from dart.model.dataset import Column, DataFormat, Dataset, DatasetData, DataType, RowFormat, FileFormat, LoadType from dart.model.exception import DartValidationException from dart.schema.base import default_and_validate from dart.schema.dataset import dataset_schema class TestDatasetSchema(unittest.Te...
"""Creates a passphrase through PRNG dicerolls. Needs the number of words and at least one word list. """ import random import argparse import csv import os __author__ = "Elliott Fawcett" __copyright__ = "Copyright (c) 2014, elliottcf" __license__ = "MIT" __version__= "0.1" __maintainer__ = "Elliott Fawcett" __status__...
def loop1(x): a = 0 for i in range(x): x a += i return a print(loop1(1)) print(loop1(2)) print(loop1(3)) print(loop1(4)) print(loop1(5)) print(loop1(6)) print(loop1(7))
import io import types import beretta import kyoto.conf import kyoto.utils.berp try: # Python 2.x file = file except NameError: # Python 3.x file = io.IOBase def send(source): if isinstance(source, file): while source: chunk = source.read(kyoto.conf.settings.READ_CHUNK_SIZE) ...
from inspect import isgeneratorfunction def is_generator(obj): return callable(obj) and ( isgeneratorfunction(obj) or isgeneratorfunction(getattr(obj, "__call__")) )
r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base.exceptions import TwilioException from twilio.http.response import Response class StepTestCase(IntegrationTestCase): def ...
"""Commands: "!notifications on/off", "!addnotification", "!delnotification".""" import json from twisted.internet import reactor from bot.commands.abstract.command import Command from bot.paths import NOTIFICATIONS_FILE from bot.utilities.permission import Permission from bot.utilities.tools import is_call_id_active c...
import pyglet from pyglet.gl import * import rabbyt import sys def create_shadow(sprite, texture, x=0, y=0, rot=0, red=0, green=0, blue=0, alpha=1): shadow = rabbyt.Sprite(texture, scale=sprite.scale) shadow.rgb = red, green, blue shadow.alpha = sprite.attrgetter('alpha') * alpha shado...
import numpy as np import numpy.ma as ma import pylab as plt import cmocean as cm from scipy import linalg from scipy.interpolate import interp2d,interp1d from scipy.optimize import curve_fit,leastsq,least_squares from scipy.optimize import minimize from scipy import ndimage from scipy.stats import pearsonr from scipy ...
"""Generate a python model equivalent to the generated verilog""" __author__ = "Jon Dawson" __copyright__ = "Copyright (C) 2013, Jonathan P Dawson" __version__ = "0.1" import chips_c import sys import math import register_map from chips.compiler.exceptions import StopSim, BreakSim, ChipsAssertionFail from chips.compile...
''' Compute the smallest multiple of set of numbers Status: Accepted ''' from math import gcd def main(): """Read input and print output""" while True: try: product = 1 for term in [int(i) for i in input().split()]: common = gcd(product, term) prod...
''' setup tools ''' from setuptools import setup, find_packages setup( name='kibana-logger', version=":versiontools:kibana_logger:", description="module to simply log in syslog with CEE/json format for analysing by kibana", long_description="", keywords='kibana, syslog, cee, json', author='Allan...
""" Test for pytimeseries library """ from transformer import transformer from AR import AR from AR import AR_Ridge_2 from AR import AR_Lasso from AR import AR_ElasticNet from HoltWinters import HoltWinters import pandas import matplotlib ts = pandas.Series.from_csv('champagne.csv', index_col = 0, header = 0) model = H...
from django.contrib.auth.decorators import user_passes_test from stronghold import conf, utils try: from django.utils.deprecation import MiddlewareMixin except ImportError: MiddlewareMixin = object class LoginRequiredMiddleware(MiddlewareMixin): """ Restrict access to users that for which STRONGHOLD_USE...
from mitmproxy.net.http import Headers from mitmproxy.net.http import multipart import pytest def test_decode(): boundary = 'somefancyboundary' headers = Headers( content_type='multipart/form-data; boundary=' + boundary ) content = ( "--{0}\n" "Content-Disposition: form-data; nam...
import os import re from django import template from django.conf import settings from django.contrib.staticfiles import finders from django.contrib.staticfiles.templatetags.staticfiles import static register = template.Library() DEFAULT_HTML_TAGS = { '.css': '<link rel="stylesheet" href="{}">', '.js': '<script ...
from frontend import app from flask import render_template @app.route('/') def index(): return render_template('index.html')
import argparse import requests import sys import re import warnings import multiprocessing as mp try: from urllib import urlencode except ImportError: from urllib.parse import urlencode import xmltodict def get_desc(): desc = 'Convert between various gene or protein IDs' return desc def parse_args(test...
import os import sys import setuptools from distutils.command.clean import clean as _clean from distutils.command.build import build as _build from setuptools.command.sdist import sdist as _sdist from setuptools.command.build_ext import build_ext as _build_ext try: import multiprocessing assert multiprocessing ...
""" _______ |_TO_DO_| Be sure to do powerups for guns and stuff Be shure to start work on a light bike game SPACE FIGHTERS! Verson 0.1 BETA! """ import pygame, sys, time, random from pygame.locals import * pygame.init() disappear = 0 WHITE = (255,255,255) S1speed = 3 S2s...
from __future__ import division, absolute_import, print_function, unicode_literals from oucfeed.crawler import util from oucfeed.crawler.newsspider import NewsSpider class Spider(NewsSpider): """继续教育学院 这个网站的列表页有一个和其他的不太一样,日期时间那里,看上去很明显 难以用同一个XPath提取,因此放弃从列表页提取日期时间 注意这个网站使用了<base>标签,相对url的解析需参考其中的url ...
from django.contrib import admin class DepositWithdrawalFilter(admin.SimpleListFilter): """ A simple filter to select deposits, withdrawals or empty transactions """ title = 'Transaction type' parameter_name = 'amount' def lookups(self, request, model_admin): """ Tuples with valu...
import weakref class Signal: def __init__(self): self.__receivers = [] def connect(self, receiver, weak=True): lookup_key = self.__make_id(receiver) if weak: receiver = weakref.ref(receiver, self.disconnect) if lookup_key in self.__receivers: return ...
import pytest from protolite import encoder class decoding(object): message_foo = dict([ (1, dict([ ('type', 'string'), ('name', 'body'), ('scope', 'optional'), ])), (2, dict([ ('type', 'string'), ('name', 'messages'), (...
import time from lib.query import Query class TopicModel(Query): def __init__(self, db): self.db = db self.table_name = "topic" super(TopicModel, self).__init__() def get_all_topics(self, num = 16, current_page = 1): join = "LEFT JOIN user AS author_user ON topic.author_id = auth...
"""JSKOS mapping writer.""" from __future__ import unicode_literals, print_function import json import six from .base import LinkWriter name = 'jskos' extension = '.ndjson' class Writer(LinkWriter): def expand_link(self, link, token, field): if field in self.meta and self.meta[field]: return {'u...
import usb.core from time import sleep DELAY = 0.01 class rocket: def __init__(self): self.connect() def connect(self): self.r = usb.core.find(idVendor=0x2123, idProduct=0x1010) self.r.set_configuration() def up(self, seconds=DELAY): self.r.ctrl_transfer(0x21,0x09,0,0,[0x02,0...
import math from core import dthandler from core.common import BaseHandler, authorized, clear_cache_by_pathlist, getAttr from model.categories import Categories from model.showtypes import ShowTypes try: import json except: import simplejson as json class CategoryController(BaseHandler): @authorized() d...
from future import standard_library standard_library.install_aliases() from io import BytesIO import pytest from django.core.files import File from django.test import TestCase from google.cloud.storage import Client from google.cloud.storage.blob import Blob from mixer.main import mixer from mock import create_autospec...
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.md'), encoding...
"""A chart parser and some grammars. (Chapter 22)""" from collections import defaultdict import urllib.request import re def Rules(**rules): """Create a dictionary mapping symbols to alternative sequences. >>> Rules(A = "B C | D E") {'A': [['B', 'C'], ['D', 'E']]} """ for (lhs, rhs) in rules.items()...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Category.color' db.add_column('blogs_category', 'color', self.gf('django.db.models.fields.TextFie...
import eyed3 import os def updateID3(metadata): audiofile = eyed3.load(metadata["fileName"]) # audiofile.initTag() audiofile.tag.title = metadata["title"] print("Title: " + metadata["title"]) audiofile.tag.artist = metadata["artist"] print("Artist: " + metadata["artist"]) audiofile.tag.album = metadata["album"] ...
__all__ = ['components', 'core', 'serial', 'simplification']
try: from pyproj import Proj, transform ### utility methods for projection - pyproj support ######################################## pLatlon = Proj(init='epsg:4326') p32633 = Proj(init='epsg:32633') pGoogle = Proj(init='epsg:3857') def project_to_unit(proj, x, y): '''Projects any coordinate system to a...
def number(bus_stops): return sum([a[0] - a[1] for a in bus_stops])
import psycopg2 import peewee from aiohttp import web from aiohttp_session import get_session from aiowing import settings from aiowing.apps.admin.models import User class Handler(web.View): async def get_current_user(self): """Current user""" session = await get_session(self.request) email ...
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="layout.updatemenu.font", **kwargs ): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_name=par...
import pandas as pd from sklearn.ensemble import RandomForestClassifier from sklearn.ensemble import GradientBoostingClassifier from sklearn.ensemble import BaggingClassifier from sklearn.ensemble import AdaBoostClassifier from sklearn.ensemble import ExtraTreesClassifier from sklearn.neural_network import MLPClassifie...
from nodetraq.tests import * class TestAuthController(TestController): def test_index(self): response = self.app.get(url(controller='auth', action='index')) # Test response...
from django.contrib import admin from .models import * admin.site.register(StorageGraph) admin.site.register(Layout) admin.site.register(Taxonomy)
import pytest from thefuck.rules.git_pull import match, get_new_command from tests.utils import Command @pytest.fixture def stderr(): return '''There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details git pull <remote> <branch> If y...
import pytest import json import tempfile import pyethereum.trie as trie from tests.utils import new_db from pyethereum.slogging import get_logger, configure_logging logger = get_logger() configure_logging(':trace') def check_testdata(data_keys, expected_keys): assert set(data_keys) == set(expected_keys), \ ...
def createMail(sender, recipient, subject, html, text): ''' A slightly modified version of Recipe #67083, included here for completeness ''' import MimeWriter, mimetools, cStringIO out = cStringIO.StringIO() htmlin = cStringIO.StringIO(html) txtin = cStringIO.StringIO(text) writer = ...
from horse import build_app application = build_app(name=__name__, debug=True).web_app if __name__ == "__main__": application.run()
import psutil import socket import platform from uuid import getnode from Server import Server def get_drive_mountpoints(): return [drive.mountpoint for drive in psutil.disk_partitions()] def mock_server(): mocked_server = Server() return mocked_server def discover(): discovery_data = {} discovery_d...
"""models.py: Blog database tables and columns.""" import os from datetime import datetime from django.conf import settings from django.db import models from django.utils.text import slugify from markdown import markdown class Category(models.Model): title = models.CharField(max_length=70) slug = models.SlugFie...
from Tkinter import * import os import tkFileDialog import tkMessageBox def clear(win): win.spctab.sttsobj.clear() win.spctab.polobj.clear() def reload(win): win.spctab.sttsobj.reload() win.spctab.polobj.reload() def save(): ruleflname=tkFileDialog.asksaveasfilename(filetypes=[("Firewall Rules",".rules")],defaulte...
from django.test import TestCase, Client from django.conf import settings from datetime import datetime from pytz import UTC from dj_twilio_sms import utils from dj_twilio_sms.models import OutgoingSMS class SmsSendingTest(TestCase): def test_send_sms(self): result = utils.send_sms( request=None...
import numpy as np import matplotlib.pyplot as plt from sklearn import datasets from sklearn.tree import DecisionTreeClassifier from sklearn import model_selection from sklearn.metrics import confusion_matrix def plot_cm(target_names, cm, cm_norm): plt.figure(figsize=(10, 5)) plt.title(u'Matriz de Confusão') ...
import socket import urllib.request import urllib.parse from urllib.error import URLError import json import time import datetime __author__ = 'RFS4ever' __homepage__ = 'https://github.com/RFS4ever/pyDdnsPod' __version__ = '0.5' timeout = 10 socket.setdefaulttimeout(timeout) current_ip = None config = { 'ddns_api_u...
""" Quickly threw together an NN controller for a project. Carries over from parametric CL controller implementations. Needs a lot of cleanup. """ from __future__ import division import numpy as np import numpy.linalg as npl class NN_controller: def __init__(self, dt, q0, target, path_type, kp, kd, n, kv, kw, ...
__version__ = "0.0.1" default_app_config = "bettertexts.apps.ImprovetextAppConfig"
import subprocess word="In de hal van kasteel Elseneur." stdout, stderr = subprocess.Popen( ['cowsay', word]).communicate() word="Stil nu! De schone Ophelia! Nimf, gedenk in uw gebeden al mijn zonden." stdout, stderr = subprocess.Popen( ['cowsay', word]).communicate() word="Ede...
""" DjangoCodeMirror template tags and filters for assets """ import copy, json from django import template from django.conf import settings from django.utils.encoding import force_unicode from django.utils.safestring import mark_safe from djangocodemirror import settings_local register = template.Library() class HtmlA...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import puzzle.models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('puzzle', '0002_...
''' Created on 25.03.2013 @author: lehmann ''' from pyads import * from PyQt4.QtCore import * from PyQt4.QtGui import * import sys class MainForm(QDialog): def _initADS(self): self.adsPort = adsPortOpen() self.adsAdr = adsGetLocalAddress() self.adsAdr.setPort(PORT_SPS1) def __init__(self...
from django.conf.urls import patterns, include, url from django.contrib import admin from home import views urlpatterns = patterns('', # Examples: # url(r'^$', 'pisite.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^logs/', include('logs.urls', namespace="logs")), url(r'^mo...
from rest_framework.permissions import IsAuthenticatedOrReadOnly from rest_framework.viewsets import GenericViewSet from rest_framework.mixins import ListModelMixin, RetrieveModelMixin, \ UpdateModelMixin from .models import User from .serializers import UserSerializer from core.api_utils import IsOwnerOrReadOnlyUs...
from ..layers.core import Layer from ..utils.theano_utils import shared_zeros from .. import initializations import theano.tensor as T class BatchNormalization(Layer): ''' Reference: Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift http...
import json import time from decimal import Decimal from dashticker import redis_key from dashticker.ws import Client, Handler def on_message(data, redis): market = 'USD_BTC' if data['type'] != 'ticker': return ticker = { 'source': 'coinapult', 'market': market, 'timestamp': ...
from __future__ import unicode_literals import swapper from django.conf import settings from django.db import models from accelerator_abstract.models.accelerator_model import AcceleratorModel HOUR_IS_PAST_MESSAGE = "This office hour is in the past" HOUR_HAS_BEEN_CANCELED_MESSAGE = "This office hour has been canceled" H...
from net_layers import * from utils import get_idx_from_sent,make_idx_data_cv import cPickle,time,sys from collections import OrderedDict theano_rng = RandomStreams(rng.randint(2 ** 30)) def dropout(input,dropout_rate): corrupted_matrix = theano_rng.binomial( size = input.shape, ...
import csv import datetime import json import logging import urlparse import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) from io import BytesIO from django.conf import settings from django.core.exceptions import Vali...
from setuptools import setup import opterator setup( name="opterator", version=opterator.__version__, py_modules=['opterator', 'test_opterator'], author="Dusty Phillips", author_email="dusty@buchuki.com", license="MIT", keywords="opterator option parse parser options", url="http://github...
import config import re import unittest class ConfigTest(unittest.TestCase): @classmethod def add_validate_categories_test(cls, cfg): def test(self): # Categories must have underscores instead of spaces. self.assertNotIn(' ', cfg.hidden_category) self.assertNotIn(' ',...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "maji_sys.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
import random import weakref from redis.client import Redis from redis.connection import ConnectionPool, Connection from redis.exceptions import (ConnectionError, ResponseError, ReadOnlyError, TimeoutError) from redis._compat import iteritems, nativestr, xrange class MasterNotFoundError(Co...
"""barcode.base """ from __future__ import unicode_literals from barcode.writer import SVGWriter class Barcode(object): name = '' raw = None digits = 0 default_writer = SVGWriter default_writer_options = { 'module_width': 0.2, 'module_height': 15.0, 'quiet_zone': 6.5, ...
if __name__ == "__main__": from edaboweb.edaboweb import app, engine from edaboweb.mb_database import init_db from edaboweb.db_models import db init_db(engine) with app.app_context(): db.init_app(app) db.create_all() app.run(debug=True)
from io import BytesIO from unittest.mock import Mock, call from uuid import UUID import pytest from botocore.exceptions import ClientError as BotoClientError from flask import url_for from notifications_python_client.errors import HTTPError from app.s3_client.s3_logo_client import ( LETTER_TEMP_LOGO_LOCATION, ...
import json from TM1py.Objects.User import User from TM1py.Services.ObjectService import ObjectService class SecurityService(ObjectService): """ Service to handle Security stuff """ def __init__(self, rest): super().__init__(rest) def determine_actual_user_name(self, user_name): return s...
""" Python setup file for the companies app. """ import os from setuptools import setup, find_packages import companies as app dev_requires = [ 'flake8', ] install_requires = [ # User should install requirements ] def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read...
""" WSGI config for foreign_guides project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "foreign_guides.settings") from dja...
import nvksupport import subprocess import tempfile import random import sys import os ffmpeg_dir = 'ffmpeg-3.3.1-win64-shared' mediaInfo_dir = 'MediaInfo' mediaInfo_exec = os.path.join(mediaInfo_dir, 'MediaInfo.exe') ffmpeg_exec = os.path.join(ffmpeg_dir, 'bin', 'ffmpeg.exe') ffmpeg_exec = 'ffmpeg' ffprobe_exec = os.p...
import liblo import numpy class Pattern(object): def __init__(self, tracks=8, steps=16): self.steps = numpy.zeros((steps, tracks), bool) self.muted = numpy.zeros(tracks, bool) @property def num_tracks(self): return self.steps.shape[1] @property def num_steps(self): re...
import unittest from ROOM.room import Room, LivingSpace class LivingSpaceTest(unittest.TestCase): def setUp(self): self.some_living_space = LivingSpace('Yellow') def test_LivingSpace_inherits_Room(self): self.assertTrue(issubclass(LivingSpace, Room), msg='LivingSpace is not inheriting from Room'...
from experiments.launcher import run_from_code from experiments import mnist_variations, synthetic, mnist_background_transfer if __name__ == '__main__': # run_from_code(experiment=synthetic, model='avb', pretrained_model=None, noise_mode='product') # run_from_code(experiment=mnist_variations, n_datasets=2, mode...
from django_recurrences.db.models.mixins import AbstractRecurrenceModelMixin class RecurrenceTestModel(AbstractRecurrenceModelMixin): """Test model that implements."""
import abjad from abjad.tools import spannertools class ClefSpanner(spannertools.Spanner): r'''Clef spanner. :: >>> staff = abjad.Staff("c' d' e' f' g' a' b' c''") >>> clef = abjad.Clef('treble') >>> abjad.attach(clef, staff[0]) >>> print(format(staff)) \new Staff { ...
import ResModel_pyramid import tensorflow as tf import numpy as np import re from yolo.net.net import Net class YoloTinyNet(Net): def __init__(self, common_params, net_params, test=False): """ common params: a params dict net_params : a params dict """ super(YoloTinyNet, self).__init__(common_pa...
import os import cPickle as pickle import numpy as np from utility_tools import retrieve_most_recent_fname from plot_embedding_tools import plot_vec, plot_zoom_vec def retrieve_most_recent_pkl(): fpath = os.path.join('models', 'rock-letter', 'chord2vec') fname = retrieve_most_recent_fname(fpath) with open(f...
from __future__ import division, print_function from ._version import version_info, __version__
import os import re import io import requests import numpy as np import tensorflow as tf from zipfile import ZipFile from tensorflow.python.framework import ops ops.reset_default_graph() tf.app.flags.DEFINE_string("storage_folder", "temp", "Where to store model and data.") tf.app.flags.DEFINE_float('learning_rate', 0.0...
import feedparser import urllib import sys DOWNLOADS_DIR = '/home/gberg/podcasts/' DOWNLOADED_LIST_FILE = '/home/gberg/.podyoink/downloaded.list' PODCAST_URLS = ['http://downloads.bbc.co.uk/podcasts/radio4/fricomedy/rss.xml','http://downloads.bbc.co.uk/podcasts/radio4/comedy/rss.xml','http://downloads.bbc.co.uk/podcast...
from .conversation import * from .forum import * from .pipe import *
from org.gluu.service.cdi.util import CdiUtil from org.gluu.oxauth.security import Identity from org.gluu.model.custom.script.type.auth import PersonAuthenticationType from org.gluu.oxauth.service import AuthenticationService from org.gluu.oxauth.service.common import UserService from org.gluu.service import CacheServi...
import json import logging import typing import urllib.request from discord.ext import commands from discord.ext.commands import CommandError, Context from cogbot import checks from cogbot.cog_bot import CogBot log = logging.getLogger(__name__) class FAQEntry: def __init__(self, key: str, tags: typing.Iterable[str]...
import json import time from requests.exceptions import RequestException, ConnectionError, Timeout from steam_alerts import logger from steam_alerts.messaging_service import MessagingService, MockMessagingService from steam_alerts.person import Person from steam_alerts.steam_service import SteamService, status_types cl...
from collections import Counter def find_it(seq): for k, v in Counter(seq).iteritems(): if v % 2: return k
from django.test import TestCase from django.urls import reverse from monitor.tests.utils.http_client_mixin import HTTPClientMixin class TestTokenRetrieveView(HTTPClientMixin, TestCase): def test_get(self): url = reverse('monitor:token') response = self.client.get(url) self.assertEqual(respo...
""" Onshape REST API The Onshape REST API consumed by all clients. # noqa: E501 The version of the OpenAPI document: 1.113 Contact: api-support@onshape.zendesk.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F40...