content stringlengths 5 1.05M |
|---|
"""Managers for emencia.django.newsletter"""
from django.db import models
class ContactManager(models.Manager):
"""Manager for the contacts"""
def subscribers(self):
"""Return all subscribers"""
return self.get_query_set().filter(subscriber=True)
def unsubscribers(self):
"""Retur... |
# @Title: 到最近的人的最大距离 (Maximize Distance to Closest Person)
# @Author: KivenC
# @Date: 2018-07-18 09:56:00
# @Runtime: 40 ms
# @Memory: N/A
class Solution(object):
def maxDistToClosest(self, seats):
"""
:type seats: List[int]
:rtype: int
"""
count, res = 0, 0
for sea... |
import json
import unittest
from libmodel.django.extra_data_model import ExtraDataModel
from libmodel.django.extra_data_model import ExtraDataState
class StringTestCase(unittest.TestCase):
def test_get_extra_data_string_from_string_state(self):
m = ExtraDataModel()
m._extra_data_state = ExtraDat... |
'''
Here is the solution come from the leetcode explanation which remind me of upgrade the dimensionality.
In a N x N grid representing a field of cherries, each cell is one of three possible integers.
0 means the cell is empty, so you can pass through;
1 means the cell contains a cherry, that you can pick up and ... |
# !/usr/bin/python
# -*- coding:utf-8 -*-
# ***********************************************************************
# Author: Zhichang Fu
# Created Time: 2018-08-25 11:04:06
# Function:
# Exception module
# ***********************************************************************
class UnknownDB(Exception):
"""r... |
from email.header import decode_header
def decode(s):
"""
For some reason I can't get the decoding to work while retrieving from gmail. This should work on the output from
SQL, e.g.
subject_in_hebrew = trialDB.retrieveFromDB()[2]['subject']
decode(heb)
:param s: string encoded in utf-8
:ret... |
from urllib.parse import urlparse
class Connection:
def __new__(cls, url, echo=False):
info = urlparse(url)
if info.scheme == 'sqlite':
path = info.path
if info.hostname:
path = info.hostname + info.path
from .sqlite import SqliteConnection
... |
# -*- coding: utf-8 -*-
'''
The pop top level module
'''
# Import python libs
import os
INSTALL_DIR = os.path.dirname(os.path.realpath(__file__))
# ----- Detect System Encoding -------------------------------------------------------------------------------------->
# This will install a globally available variable w... |
from perylune.orbcalc import *
def test_deg2rad_case():
rad = OrbCalc.deg2rad(360)
assert rad == math.pi*2
def test_constant_rho():
assert OrbCalc.getRho() == 180.0/math.pi
def test_constant_earth_radius():
assert OrbCalc.getEarthRadius() == 6378137
assert OrbCalc.getConst('earth-radius') == 63... |
from aocd import data
from aoc.year2019.intcode import Intcode
from aoc.utils import ints
i = Intcode(ints(data))
print(i.all_outputs(1))
i = Intcode(ints(data))
print(i.all_outputs(2))
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Allocator by sorting distance from known worker location
"""
import sys
import argparse
import pandas as pd
import numpy as np
from allocator.distance_matrix import (euclidean_distance_matrix,
haversine_distance_matrix,
... |
"""This is oldowan.structure.read."""
__all__ = ['read_structure']
from oldowan.structure.iterate import iterate_structure
from oldowan.structure.iterate import iterate_structure_results
def read_structure(something, what='guess', raw=False):
"""Read Structure format."""
items = []
for item in iterate_st... |
import pandas
import numpy
import copy
from APIs import APIs
class Node(object):
def __init__(self, rows, memory_str, memory_num, header_str, header_num, must_have, must_not_have):
# For intermediate results
self.memory_str = memory_str
self.memory_num = memory_num
self.memory_bool ... |
import flow_sensor_app
import live_plot
from data_reader import DataReader
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Filename: matchphone.py
'''
dig.phone.matchphone
@author: Andrew Philpot
@version 2.5
wat phone matching module
needs to get its data from watpara
Usage:
Options:
\t-h, --help:\tprint help to STDOUT and quit
\t-v, --verbose:\tverbose output
\t-s, --source:\tsource default ... |
import torch
#device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
device = torch.device("cpu") |
def set_config_default_item(config: dict, key, default) -> dict:
if not key in config.keys():
config[key] = default
return config |
# Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
from django.conf.urls import url
from .views import (
CampusView,
ELevelsView,
EventsView,
GoodiesView,
HackathonsView,
SchoolsView,
)
urlpatterns = [
url(r'^schools/$', SchoolsView.as_view(), name='schools'),
url(r'^schools/(?P<pk>\d+)/campus/$', CampusView.as_view(), name='campus'),... |
from flask import Blueprint, current_app, render_template
# from flask_login import login_required, current_user
view = Blueprint('view', __name__, url_prefix='/view',
static_url_path="/static",
static_folder='../../frontend/static',
template_folder="../../frontend"
)
@view.route("/", meth... |
from flask import Blueprint, Response
from api_modules.server.models.base import Account, save_entity, get_entities, update_entity
import json
user_blueprint = Blueprint('account', __name__, url_prefix='/account')
def build_filter(args,):
condictions = []
code = args.get('code', None)
if code:
con... |
def write(msg):
size = len(msg)
print('=' * size)
print (msg)
print ('=' * size)
write ("Hello World, I'm here")
write ("My name is Ana Luisa and I'm learning functions in python")
|
from avista_base.api import bp
from flask import request, jsonify
from avista_data.role import Role
from avista_base.auth import role_required
import avista_base.service as svc
@bp.route('/api/config/<section_id>', methods=['GET'])
@role_required(Role.ADMIN)
def read_config(section_id):
try:
response_obje... |
# Copyright (c) 2012 Stellenbosch University, 2012
# This source code is released under the Academic Free License 3.0
# See https://github.com/gvrooyen/SocialLearning/blob/master/LICENSE for the full text of the license.
# Author: G-J van Rooyen <gvrooyen@sun.ac.za>
"""
Command-line script used to post genetic program... |
# @version: 2.1 <= python
# Version 2.1 added display hooks, which are needed for this to work.
import sys as _sys
try:
import builtins as _builtins
except ImportError:
import __builtin__ as _builtins
try:
object
except NameError: # Python 2.1
class object:
pass
class _QuitOnDisplay(object... |
from typing import Dict, Optional
from bs4 import BeautifulSoup
from django.http import HttpRequest
from django.utils.html import escape
from zerver.lib.cache import cache_with_key, open_graph_description_cache_key
def html_to_text(content: str, tags: Optional[Dict[str, str]]=None) -> str:
bs = BeautifulSoup(con... |
# Copyright (c) 2003-2009 Ralph Meijer
# See LICENSE for details.
"""
Tests for {wokkel.data_form}.
"""
from twisted.trial import unittest
from twisted.words.xish import domish
from twisted.words.protocols.jabber import jid
from wokkel import data_form
NS_X_DATA = 'jabber:x:data'
class OptionTest(unittest.TestCase... |
from io import BytesIO
import aiogram.utils.markdown as md
from PIL import Image
from aiogram import Dispatcher
from aiogram.dispatcher import FSMContext
from aiogram.dispatcher.filters import Text
from aiogram.types import Message, CallbackQuery, ContentType
from pyzbar.pyzbar import decode
from lenta.client import ... |
import webbrowser
from datetime import datetime
from locale import getdefaultlocale
from logging import getLogger
from typing import Dict, List, Tuple
from kivy.uix.widget import Widget
from kivymd.app import MDApp
from naturtag.app import alert
from naturtag.constants import OBS_CACHE_EXPIRY_HOURS, PLACES_BASE_URL
f... |
from .run import main
# TODO: nechapu, tohle volani je tady zbytecne
main()
|
def insertion_sort(nums):
for i in range(len(nums) - 1):
for j in range(i + 1, 0, -1):
if nums[j] < nums[j - 1]:
tmp = nums[j]
nums[j] = nums[j - 1]
nums[j - 1] = tmp
else:
break
if __name__ == '__main__':
nums = [... |
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
from ..misc import find_closest
from ..signal import signal_formatpeaks
from .eda_findpeaks import eda_findpeaks
from .eda_fixpeaks import eda_fixpeaks
def eda_peaks(eda_phasic, sampling_rate=1000, method="neurokit", amplitude_min=0.1):
"""Identify ... |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
import argparse
import random
import copy
import logging
import sys
import os
script_n = os.path.basename(__file__).split('.')[0]
# from run_tests_210327 import *
from run_tests_210413 import *
from shuffle_210404 import shuffle
from global_random_model2 import GlobalRandomModel
'''
'''
os.makedirs(script_n, exist... |
from django.test import TestCase
from .models import BlogPost,Comment
# Create your tests here.
import unittest
class BlogTest(unittest.TestCase):
def setUp(self):
self.new_category=Blog(blog = 'science')
def test_cat(self):
self.assertTrue(self.new_blog is not None) |
import io
from abc import ABC, abstractmethod
from datetime import date
from decimal import Decimal
from itertools import groupby
from typing import Dict, Iterable, List, Optional, Tuple
import fitz
from correpy.domain.entities.brokerage_note import BrokerageNote
from correpy.domain.entities.security import Security
... |
"""Install JSON Model"""
# pylint: disable=no-self-argument,no-self-use; noqa: N805
# standard library
from typing import List, Optional
# third-party
from pydantic import BaseModel, validator
from semantic_version import Version
class TemplateConfigModel(BaseModel):
"""App Template Config Model."""
contrib... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
1792. Hamming Code
Time limit: 1.0 second
Memory limit: 64 MB
[Description]
Let us consider four disks intersecting as in the figure. Each of the three shapes formed by the intersection of three
disks will be called a petal.
Write zero or one on each of the disks. Then wr... |
from pprint import pprint
from androguard.session import Session
from androguard.misc import AnalyzeAPK
a, d, dx = AnalyzeAPK('/home/branden/apks/dendroid.apk', session=Session())
print('here')
acts = a.get_activities()
print('here2')
print(acts)
|
# from qmla.exploration_strategies.nv_centre_spin_characterisation.nv_centre_alternate_true_model import *
# from qmla.exploration_strategies.nv_centre_spin_characterisation.nv_centre_no_transverse_terms import *
# from qmla.exploration_strategies.nv_centre_spin_characterisation.nv_centre_large_spin_bath import *
# fro... |
import os
import json
import numpy as np
import pandas as pd
import tempfile
from collections import defaultdict
from typing import Tuple, Dict
from alto.utils import run_command
from .bcl_utils import lane_manager, path_is_flowcell, transfer_flowcell
def read_wdl_inputs(input_json: str) -> dict:
"""Load inputs... |
"""This module includes the classes for supporting W3C trace context propagation.
See also https://www.w3.org/TR/trace-context/.
"""
import re
try:
from opentelemetry import trace
except ImportError:
pass
from .base import TraceContext, TraceContextExtractor
from ..fields import StringField
_KEY_WITHOUT_VE... |
# Generated by Django 3.2.6 on 2021-08-26 17:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0008_rename_usercontacts_usercontact'),
]
operations = [
migrations.AlterField(
model_name='usercontact',
n... |
from typing import List, Any
import json
from . import utils
class AmbiLight():
def __init__(
self,
id: str,
name: str,
friendly_name: str,
light_id: str,
lux_sensor_id: str,
lux_target_id: str,
motion_sensor_id: str,
lux_minimum: int=None,
... |
import cirq
import numpy as np
import pytest
from zquantum.core.circuits import GateOperation, import_from_cirq
from zquantum.core.decompositions import (
PowerGateToPhaseAndRotation,
decompose_cirq_circuit,
)
class TestDecompositionOfPowerGates:
@pytest.mark.parametrize("target_qubit", [cirq.LineQubit(0)... |
"""
Simple Tkinter Python GUI app
"""
import Tkinter
import tkMessageBox
top = Tkinter.Tk()
#button with message box callback
def helloCallBack():
tkMessageBox.showinfo( "Hello Python", "Hello World")
B = Tkinter.Button(top, text ="Hello", command = helloCallBack)
B.pack()
#canvas with circle arc
C = Tkinter.C... |
from collections import OrderedDict
expected = [
OrderedDict(
[
("type", u"journal"),
("id", u"bib71"),
("date", u"2004"),
(
"authors",
[
OrderedDict(
[
("... |
import attr
from typing import List
from .event import Event
@attr.s
class EventListWithCount:
"""
:param result : the list of events
:param count : the number of events in result
"""
count = attr.ib(type=int)
result = attr.ib(type=List[Event], default=attr.Factory(list))
|
'''
Copyright (C) 2014 Parrot SA
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following di... |
from typing import List
class Solution_two_pointer_mine: # or sliding window
def numSubarrayProductLessThanK(self, nums: List[int], k: int) -> int:
a, b = 0, 0
prod = 1
total = 0
while b <= len(nums) - 1:
prod *= nums[b]
while prod >= k and a <= len(nums) - 1:... |
# -*- coding: utf-8 -*-
'''
File Name: serializers.py
Author: WillDX
mail: xiang.dai@shuyun.com
Created Time: 2015年06月26日 星期五 10时00分53秒
'''
from models import *
from rest_framework import serializers
from rest_framework import fields
class SqlpassPowerSerializer(serializers.ModelSerializer):
class Meta:
m... |
import discord
from discord.ext import commands
from discord.role import Role
class Events(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_member_join(self, member: discord.Member):
guild = await self.client.fetch_guild(815689898756407... |
#!/usr/bin/env python3
import sys
import time
import numpy
import shutil
import pandas
import scipy.constants
class Player:
def __init__(self, ceil_h, x_pos, yh_pos):
self.ch = ceil_h #Represents the height of the ceiling from the ground.
self.x = x_pos #The random xpos that's assigned at initializ... |
"""
Network port scan functions
"""
from __future__ import print_function
import datetime
import socket
import ssl
import struct
import sys
from collections import OrderedDict
class ScanFailed(Exception):
"""
The scan operation encountered a failure
"""
def __init__(self, *args, **kwargs):
try... |
import random
import string
from project.user_provision import getJsonResponse
from project.plugin import inviteMessage, removalMessage, getCLIgroups
from azure.graphrbac.models.graph_error import GraphErrorException
from azure.graphrbac.models import UserCreateParameters, PasswordProfile
from azure.graphrbac import G... |
# coding: utf-8
from django.conf import settings as s
from django.utils.translation import gettext_lazy as _
from django_ulogin.exceptions import SchemeNotFound
ALLOWED_PROVIDERS = (
('vkontakte', _('V Kontakte')),
('odnoklassniki', _('Odnoklassniki')),
('mailru', _('Mail.Ru')),
('yandex', _('Yandex'... |
#!/usr/bin/env python
# coding: utf-8
# # Exploratory Data Analysis
# ## Importing Libraries and Data
# In[1]:
#Importing libraries
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from IPython import get_ipython
get_ipython().run_line_magic('matplotlib', 'inline')
imp... |
import urllib
import json
import requests
from lxml import etree
import settings
import string
import random
from datetime import datetime
import os
import tempfile
from rdflib import Graph, URIRef, Namespace, RDF, RDFS, XSD, Literal
from itertools import izip_longest
def get_all_service_metadata_records(xml_file, pr... |
#!/usr/bin/env python
#
# proposals.py: generate an RST file (proposals.rst) from queries to github.com/matrix.org/matrix-doc/issues.
import requests
import re
from datetime import datetime
# a list of the labels we care about
LABELS_LIST=[
'proposal-in-review',
'proposed-final-comment-period',
'final-com... |
DEBUG = False
ASSETS_DEBUG = False
APP_NAME = 'nomenklatura'
SQLALCHEMY_DATABASE_URI = 'sqlite:///master.sqlite3'
# GITHUB_CLIENT_ID = ''
# GITHUB_CLIENT_SECRET = ''
|
#!/usr/bin/env -S python3 -u
import secrets
import codecs
import time
def get_flag():
with open("/tmp/pw_flag", 'rt') as f:
print(f.read())
# initialize password
def init_password():
global password
global sample_password
# seems super secure, right?
password = "%08x" % secrets.randbits(3... |
"""Test the default parser used for parsing OWL ontologies."""
import os
import re
import shutil
import tempfile
import yaml
from pathlib import Path
import responses
import rdflib
import unittest2 as unittest
from rdflib.compare import isomorphic
from osp.core.ontology.namespace_registry import NamespaceRegistry
fr... |
from odmantic.query import QueryExpression
from tests.zoo.book_embedded import Book, Publisher
from tests.zoo.tree import TreeKind, TreeModel
def test_embedded_eq():
pub = Publisher(name="O'Reilly Media", founded=1980, location="CA")
assert (Book.publisher == pub) == {
"publisher": {
"$eq"... |
"""
The Vis module contains visualation functions for the tree objects.
"""
from __future__ import print_function, division
import numpy as np
from matplotlib.pyplot import subplots
def grid_lines(node,dims=[0,1],slice_=None):
"""
Output the pair of lines which split the cell.
Parameters
-------... |
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SubmitField
class LoginForm(FlaskForm):
username = StringField("Username")
password = PasswordField("Password")
submit = SubmitField("Sign In")
|
import os
import py_imu_trajectory
def test_binding():
assert py_imu_trajectory.test_binding() == "Hello binders!"
def test_ahrs():
current_file_path = os.path.dirname(os.path.realpath(__file__))
test_file_path = os.path.join(current_file_path, "test_data.csv")
output = py_imu_trajectory.get_imu_ahrs_... |
#! /usr/bin/env python3
from vasppy import procar
from vasppy.outcar import reciprocal_lattice_from_outcar
import argparse
#def x_axis( cartesian_k_points ):
# if cartesian_k_points is not None:
# x_axis = [ 0.0 ]
# for i in range( 1, len(cartesian_k_points) ):
# d = cartesian_k_points[i -... |
import json
import os
import re
import pandas as pd
from nltk import conlltags2tree, Tree
from nltk.tokenize.treebank import TreebankWordDetokenizer
def to_json():
dirname = os.path.dirname(__file__)
df = pd.read_csv(os.path.join(dirname, '../../../../data/mit_movies_corpus/cased/engtest_cased.csv'))
gro... |
class LimComAgent():
def __init__(self, iD):
self.iD = iD # agent-specific tag that may be assigned to an agent
self.lowest = self.iD # lowest agent tag that has been viewed
self.ord = 1 # ordering when algorithm is finished
self.parent = None # parent when executing depth-f... |
from sqlalchemy.orm import declarative_base
from sqlalchemy import Table, Column, Integer, String, DateTime
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy import MetaData, func
from config import *
meta = MetaData()
tweets = Table(
'tweet', meta,
Column('id', Inte... |
import json
import sys
from parser import Parser
from messages import DEEP_1_0
data = 'test_data'
with Parser(data, DEEP_1_0) as reader:
for message in reader:
message = str(message)
print(type(message))
print(message)
text = json.loads(message)
print(text, file=writer)
|
import copy
import torch
import random
import argparse
import numpy as np
import networkx as nx
import torch.nn as nn
import torch.nn.functional as F
from torch_geometric.nn import SAGEConv
from torch.utils.data import DataLoader
from torch_geometric.datasets import Planetoid
from torch.nn import Sequential, Linear, R... |
import FWCore.ParameterSet.Config as cms
# reco hit production
from RecoPPS.Local.ctppsDiamondRecHits_cfi import ctppsDiamondRecHits
# local track fitting
from RecoPPS.Local.ctppsDiamondLocalTracks_cfi import ctppsDiamondLocalTracks
ctppsDiamondLocalReconstructionTask = cms.Task(
ctppsDiamondRecHits,
ctppsDi... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Fsk Demodulation
# Generated: Thu May 14 16:11:07 2020
##################################################
from gnuradio import analog
from gnuradio import blocks
from gnuradio impor... |
# Generated by Django 2.0.3 on 2018-05-21 01:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0013_auto_20180521_0049'),
]
operations = [
migrations.AlterField(
model_name='universityprogram',
name='tit... |
from tacticalrmm.test import TacticalTestCase
from .serializers import InstalledSoftwareSerializer
from model_bakery import baker
from unittest.mock import patch
from .models import InstalledSoftware, ChocoLog
from agents.models import Agent
class TestSoftwareViews(TacticalTestCase):
def setUp(self):
self... |
from .BaseDriver import BaseDriver
from .mail.BaseMailDriver import BaseMailDriver
from .mail.Mailable import Mailable
from .authentication.AuthCookieDriver import AuthCookieDriver
from .authentication.AuthJwtDriver import AuthJwtDriver
from .authentication.AuthTokenDriver import AuthTokenDriver
from .upload.BaseUpload... |
from SLRMap import SLRMap
from grammar import get_formula_type, FormulaType
class Mask:
"""
Class for representing variables with outer and inner representation.
For example, any identifier or integer in this grammar will be present as 'i' to the SLR analyzer,
but when generating quaternary, we still... |
#! /usr/bin/env python3
# coding: utf-8
import argparse
import os
import shutil
import subprocess
import sys
from pathlib import Path
from tempfile import NamedTemporaryFile, mkdtemp
def unique(pathlist):
uniqued = list()
[uniqued.append(v) for v in pathlist if v not in uniqued]
return uniqued
def c... |
#!/usr/bin/env python3
# based on shell script aws-api dependant : https://aws.amazon.com/articles/high-availability-for-amazon-vpc-nat-instances-an-example/
#
import boto3
import requests
import json
import logging
import sys
from logging.handlers import RotatingFileHandler
import time
from pprint import pprint
impo... |
#Faça um programa que leia a largura e a altura de uma parede em metros, calcule a sua área e a quantidade de tinta necessária para pintá-la, sabendo que cada litro de tinta, pinta uma área de 2m^2
altura = float(input('Digite a altura em metros: '))
largura = float(input('Digite a largura em metros: '))
area = largur... |
from gridworld.worlds.cliff import CliffWorld
all_worlds = [CliffWorld()]
|
from django.conf import settings
def before_send(event, hint):
if 'exc_info' in hint:
exc_type, exc_value, tb = hint['exc_info']
sentry_ignore_errors = getattr(settings, 'SENTRY_IGNORE_ERRORS', None)
if sentry_ignore_errors and isinstance(exc_value, sentry_ignore_errors):
retu... |
import os
import os.path
from datetime import datetime
import time
import logging
from pwd import getpwnam
from tshark import Tshark
class PcapToCsvTask:
def __init__(self, fields, output_directory, user=None):
self._tshark = Tshark(fields)
self._output_directory = output_directory
self._... |
import json
import mimetypes
import string
from backports.tempfile import TemporaryDirectory
from django.test import override_settings
from django.urls import reverse
from django_webtest import WebTestMixin
from hypothesis import given, settings
from hypothesis.extra.django import TestCase
from hypothesis.strategies i... |
"""
.. module:: CMetricAccuracy
:synopsis: Performance Metric: Accuracy
.. moduleauthor:: Marco Melis <marco.melis@unica.it>
"""
import sklearn.metrics as skm
from secml.array import CArray
from secml.ml.peval.metrics import CMetric
class CMetricAccuracy(CMetric):
"""Performance evaluation metric: Accuracy.... |
from flask import Flask
def create_app():
app = Flask(__name__, instance_relative_config=True)
with app.app_context():
import routes
from dashboards.dashboard_template_1 import dashboard_template_1
app = dashboard_template_1(app)
return app
|
from .base import *
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
ALLOWED_HOSTS = [
'www.eosform.app',
'eosform.app',
]
sentry_sdk.init(
dsn=env.str('SENTRY_DSN'),
environment=env.str('SENTRY_ENVIRONMENT'),
release=env.str('SENTRY_RELEASE'),
integrations=[Djang... |
from __future__ import print_function
from __future__ import absolute_import
from .ControlCommon import *
import sys
from .OSService import OSServiceManagement
from .OSPackage import OSPackageManagement
def complete_service_name(prefix, parsed_args, **kwargs):
arcconf = get_parsed_arcconf(parsed_args.config)
... |
from fuzzycategory import FuzzyCategory
import math
import unittest
class FuzzyCategoryTest(unittest.TestCase) :
def test_uncorpused(self) :
fuzzy = FuzzyCategory('name', [{'name' : 'thomas',
'occupation' : 'welder'},
{'name' : 'judy',... |
from django.test import TestCase
from .setup import setup_fixtures
from apps.surveys18.models import Survey, ShortTermHire, WorkType, Month
class ModelTestCase(TestCase):
@classmethod
def setUpTestData(cls):
# load fixtures
setup_fixtures()
def test_create_population(self):
survey... |
from Core.dbconn import get_database_connection
def get_dates():
dates = []
for i in [7, 6, 5, 4, 3, 2, 1, 0]:
dates.append(get_date_of_timedelta(i))
return dates
def get_signup_data_sevendays_influencer():
dbconnection = get_database_connection()
cursor = dbconnection.cursor()
cu... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 2 18:48:59 2019
@author: Kazuki
AvSigVersion を datetime とみなし、日毎の EngineVersion 等のシェアを計る
"""
import numpy as np
import pandas as pd
import os, gc
from glob import glob
from multiprocessing import cpu_count, Pool
import utils
utils.start(__file__... |
from .simulation_tools import *
from .write_region_file import *
|
"""pymoku example: Basic Spectrum Analyzer
This example demonstrates how you can use the Spectrum Analyzer instrument to
to retrieve a single spectrum data frame over a set frequency span.
(c) 2017 Liquid Instruments Pty. Ltd.
"""
from pymoku import Moku
from pymoku.instruments import SpectrumAnalyzer
# Connect to y... |
from openpyxl import load_workbook
from mtree import MTree
wb = load_workbook(filename = 'covid_kaggle_dataset.xlsx')
sheet = wb.active
rows = sheet.max_row
class Patient:
def __init__(self, id, data, dimensions):
self.id = id
self.data = []
for i in data:
if i == None:
self.data.append(float(0))
el... |
from django.contrib import admin
from .models import *
# Register your models here.
admin.site.register(Article)
admin.site.register(Group)
admin.site.register(Review)
admin.site.register(Reply)
admin.site.register(File)
admin.site.register(GroupArticle)
admin.site.register(GroupArticleReview) |
import pygame
import sys
from .background import slow_bg_obj
from models.icon_button import IconButton
from models.controls import audio_cfg, display_cfg
from models.scores import scores
from utils.assets import Assets
from config import config
from constants import Image, Font, Text, Colors
def score_board():
s... |
#!/usr/bin/python
#! -*- encoding=utf-8 -*-
import os
import re
import shutil
import time
class_pattern_spi = re.compile('class\s(\w+)\s')
class_pattern_api = re.compile('class\s\w+\s(\w+)\s')
method_pattern = re.compile("virtual\s(\w+)\s(\w+)\((.*)\)")
COMMON_H = 'common_macro.h'
XTP_INCLUDE_PATH = '../include/XTP... |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.