content stringlengths 0 894k | type stringclasses 2
values |
|---|---|
import os
import shutil
import tempfile
import ply.yacc as yacc
import sympy
from . import _node as node
from ._qasmerror import QasmError
from ._qasmlexer import QasmLexer
class QasmParser(object):
pass
def __init__(self, filename):
pass
def __enter__(self):
pass
def __exit__(... | python |
from django.db import DatabaseError
from django.test import TestCase
from app.models import BigInteger
class BigIntegerTests(TestCase):
def setUp(self):
self.int0_id = BigInteger.objects.create(big_integer=0).id
self.int1_id = BigInteger.objects.create(big_integer=1111).id
def test_create_in... | python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'burndown.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_CWidgetBurndown(object):
def setupUi(self, CWidgetBurndown):
... | python |
import unittest
from mock import MagicMock
from abeja.datasets.dataset import Dataset, Datasets
from abeja.datasets.dataset_item import DatasetItems
class TestDataset(unittest.TestCase):
def setUp(self):
self.organization_id = '1234567890120'
self.dataset_id = '1234567890121'
self.datase... | python |
model.add(Dense(total_words, activation='softmax')) | python |
from django.urls import path, include
from snippets import views
from rest_framework.urlpatterns import format_suffix_patterns
urlpatterns = [
path('pure/snippets/', views.pure_snippet_list),
path('pure/snippets/<int:pk>/', views.pure_snippet_detail),
path('func/snippets/', views.func_api_view_snippet_lis... | python |
import logging
import sys
from pathlib import Path
import yaml
def get_version() -> str:
"""Checks _version.py or build metadata for package version.
Returns:
str: Version string.
"""
try:
from ._version import version
return version
except ModuleNotFoundError:
... | python |
from discord.ext import commands
import asyncio
import discord
class Vcwhite(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_voice_state_update(self, member, before, after):
#通知の対象としたいチャンネルidを入力
allow_01 = self.bot.get_chann... | python |
import unittest
from biolinkml.generators.pythongen import PythonGenerator
from tests.test_issues.environment import env
from tests.utils.python_comparator import validate_python
class Issue39UnitTest(unittest.TestCase):
@unittest.skip("issue_38.yaml clinical profile conflicts with latest Biolink Model")
de... | python |
# Copyright 1999-2020 Alibaba Group Holding 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... | python |
"""Module for representing, moving, shifting, stretching plotting and otherwise
manipulating line segments in a convenient fashion.
Caleb Levy, 2015.
"""
import numpy as np
from .coordinates import Point, Coordinates
__all__ = ["Line"]
def parabola(sep, h, cut_short=0., n=100):
""" Return the array of x + 1j*... | python |
from django.db import models
from newsroom.models import Article
from filebrowser.fields import FileBrowseField
from .common import SCHEDULE_RESULTS
# Create your models here.
class TwitterHandle(models.Model):
name = models.CharField(max_length=200, unique=True)
slug = models.SlugField(max_length=200, uniqu... | python |
import pytest
import numpy as np
from funkyAD.helpers import count_recursive, unpack, nodify, recursive_append
from funkyAD.base import Node
def test_count_recursive_nparray():
x = np.array([2,3,1,0])
assert count_recursive(x)==4
def test_count_recursive_list():
x = [1,2,3]
assert count_recursive(x)=... | python |
# Copyright (c) 2018 Stefan Marr <http://www.stefan-marr.de/>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, mo... | python |
#Crear una carpeta que se llame clases y adentro poner los$
# archivos dino.py persona.py
# Crear una clase Persona() que tenga como atributos nombre, edad
# y profesion. Al instanciar la clase tiene que saludar igual que el
# dino diciendo sus atributos
# Agregar un metodo a la clase persona, que se llame cumpleanh... | python |
import re
class ReDict(dict):
"""
Special dictionary which expects values to be *set* with regular expressions
(REs) as keys, and expects values to be retreived using input text for an
RE as keys. The value corresponding to the regular expression which matches
the input text will be returned. In th... | python |
# The MIT License (MIT)
#
# Copyright (c) 2018 UMONS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, m... | python |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 12 13:34:49 2020
@author: lukepinkel
"""
import numba
import numpy as np
import scipy as sp
import scipy.special
SQRT2 = np.sqrt(2)
ROOT2PI = np.sqrt(2.0 * np.pi)
def poisson_logp(x, mu, logp=True):
p = sp.special.xlogy(x, mu) - sp.special.gam... | python |
# -*- coding: utf-8 -*-
import json
import os
import sys
import codecs
import io
import logging
logging.basicConfig(
filename='2_error.log',
filemode='w',
level='INFO',
format='[%(levelname)s] %(asctime)s: %(message)s'
)
asset_folder = 'assets'
def cmd(line):
return ' '+line
def print_console(... | python |
"""
Configuration file for
https://github.com/karlicoss/HPI/
https://github.com/seanbreckenridge/HPI/
[Human Programming Interface]
"""
import sys
import tempfile
from os import environ, path, listdir
from typing import Optional, Callable, List, Sequence
from pathlib import Path
from my.core.common import PathIsh, Pa... | python |
# DExTer : Debugging Experience Tester
# ~~~~~~ ~ ~~ ~ ~~
#
# Copyright (c) 2018 by SN Systems Ltd., Sony Interactive Entertainment Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# ... | python |
from krogon.config import Config
from datetime import datetime
from datetime import timedelta
import krogon.yaml as yaml
import krogon.either as E
from base64 import b64decode
import json
import re
from krogon.k8s.providers.k8s_provider import K8sProvider
class GKEProvider(K8sProvider):
def __init__(self,
... | python |
# INTEL CONFIDENTIAL
#
# Copyright (C) 2021 Intel Corporation
#
# This software and the related documents are Intel copyrighted materials, and
# your use of them is governed by the express license under which they were provided to
# you ("License"). Unless the License provides otherwise, you may not use, modify, copy,
... | python |
from typing import Optional
from django.utils.crypto import get_random_string
from django.db import transaction
from rest_framework_simplejwt.tokens import RefreshToken
from treeckle.common.constants import REFRESH, ACCESS, TOKENS, USER
from users.models import User, UserInvite
from users.logic import requester_to_... | python |
#!/home/jepoy/anaconda3/bin/python
## at terminal which python
import platform
print("This is python version {}".format(platform.python_version())) | python |
"""Test the interactive test runner."""
import six
if six.PY2:
import mock
else:
from unittest import mock
import pytest
from testplan import defaults
from testplan import report
from testplan import runners
from testplan import runnable
from testplan.common import entity
from testplan.testing import filteri... | python |
from typing import List
from datetime import datetime
from numpy import datetime64
from pandas import DataFrame
from dolphindb import (
session,
DBConnectionPool,
PartitionedTableAppender,
Table
)
from vnpy.trader.constant import Exchange, Interval
from vnpy.trader.object import BarData, TickData
from... | python |
from __future__ import absolute_import
__author__ = "akniazev"
from collections import OrderedDict | python |
"""
File: similarity.py
Name: Po Kai Feng
----------------------------
This program compares short dna sequence, s2,
with sub sequences of a long dna sequence, s1
The way of approaching this task is the same as
what people are doing in the bio industry.
"""
def main():
"""
User will types a long DNA sequence.... | python |
# Generated by Django 3.2 on 2021-04-15 17:40
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Member',
fields=[
('id', models.BigAutoField(... | python |
import abjad
import collections
import importlib
import itertools
import os
from abjad.tools import abctools
from abjad.tools import indicatortools
from abjad.tools import instrumenttools
from abjad.tools import lilypondfiletools
from abjad.tools import markuptools
from abjad.tools import mathtools
from abjad.tools imp... | python |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#
# P A G E B O T N A N O
#
# Copyright (c) 2020+ Buro Petr van Blokland + Claudia Mens
# www.pagebot.io
# Licensed under MIT conditions
#
# Supporting DrawBot, www.drawbot.com
# ---... | python |
"""
Streaming newline delimited JSON I/O.
Calling `newlinejson.open()` returns a loaded instance of `NLJReader()`, or
`NLJWriter()` that acts as a file-like object. See `help()` on each for more
information.
Example:
import newlinejson as nlj
with nlj.open('sample-data/dictionaries.json') as src, \\
... | python |
'''
商品详情页面
'''
from common.base import Base
good_url ='http://ecshop.itsoso.cn/goods.php?id=304'
class Buy_Good(Base):
'''页面点击立即购买'''
# 商品名字
good_name_loc=('class name','goods_style_name')
# 商品牌子
good_brand_loc=('css selector','a[href="brand.php?id=20"]')
# 购买数量框
number_loc=('id','number'... | python |
import requests
import re
import threading
from bs4 import BeautifulSoup as bs
class Crawler():
def __init__(self, seed):
self.seed = seed
self.data_path = './data/'
def make_filename(self,url):
""" Extracts domain from a url.
Prepend data_path and append '.html'
:param url: string
return <domain>.... | python |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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 applicab... | python |
import os
import numpy as np
import cv2 as cv
# Set up path to OpenCV's Haar Cascades for face detection.
cascade_path = "C:/Python372/Lib/site-packages/cv2/data/"
face_detector = cv.CascadeClassifier(cascade_path +
'haarcascade_frontalface_default.xml')
# Set up path to training i... | python |
from django.contrib.auth import get_user_model
from django.test import TestCase #an extension of Python’s TestCase
from django.urls import reverse, resolve
from .models import (
PostJobModel,
ApplicationModel
)
from .views import (
createJobView,
JobListView,
JobsDetailView,
SearchResultsList... | python |
import logging
import time
import celery
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.query_utils import Q
from genes.canonical_transcripts.canonical_transcript_manager import CanonicalTranscriptManager
from genes.gene_matching import GeneSymbolMatcher
from genes.models import GeneCover... | python |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础计算平台 available.
Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
You may o... | python |
from typing import Any
import numpy
from scipy.stats import poisson
from .PropertyGenerator import PropertyGenerator
class PoissonNumberGenerator(PropertyGenerator):
def __init__(self, mu: float, return_int: bool = False):
"""
Init a NumberGenerator which will output number taken from a skewed n... | python |
#!/usr/bin/env python3
import sys
import argparse
import numpy as np
from firedrake import *
# recover stage3/:
# ./solve.py -refine 0 -mz 8 -marginheight 0.0
# performance demo (1 min run time on my thelio)
# tmpg -n 12 ./solve.py -s_snes_converged_reason -mx 4000 -refine 2 -s_snes_monitor -s_snes_atol 1.0e... | python |
# Copyright (c) 2015, Dataent Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import dataent
def execute():
attach_fields = (dataent.db.sql("""select parent, fieldname from `tabDocField` where fieldtype in ('Attach', 'Attach Image')""") +
dataent.db.sq... | python |
###############################################################
#
# ADIABATIC_FLAME - A freely-propagating, premixed flat flame
#
###############################################################
#import :
from cantera import *
from matplotlib.pylab import *
import numpy
#Functions :
####################... | python |
from mysqlhelper import DBConnection
link_bd = DBConnection(user="dacrover_user",
password="dacrover_pass",
host="itsuki.e",
port=3306,
database= "dacrover")
reminder_target = link_bd.select('reminders', where="`ReminderUser` = 'Тагир'", json=True)
if (len(reminder_target) > 0):
reminder_tar... | python |
# coding: utf-8
"""
flyteidl/service/admin.proto
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: version not set
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import r... | python |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
from django.contrib import admin
from croisee import models
class WordInline(admin.TabularInline):
model = models.Word
class DictionaryAdmin(admin.ModelAdmin):
list_display = ('name','language','descriptio... | python |
###############################################################################
# Caleydo - Visualization for Molecular Biology - http://caleydo.org
# Copyright (c) The Caleydo Team. All rights reserved.
# Licensed under the new BSD license, available at http://caleydo.org/license
######################################... | python |
import CIM2Matpower
# from scipy.io import savemat
cim_to_matpower_filename = 'CIM_to_Matpower_import'
cimfiles = ['./UCTE10_20090319_modified_EQ.xml',
'./UCTE10_20090319_modified_TP.xml',
'./UCTE10_20090319_modified_SV.xml']
boundary_profiles = []
mpc = CIM2Matpower.cim_to_mpc(cimfiles, b... | python |
"""
Parameterized models of the stellar mass - halo mass relation (SMHM).
"""
from __future__ import division, print_function
from __future__ import absolute_import, unicode_literals
import os
import numpy as np
from astropy.table import Table
__all__ = ['behroozi10_ms_to_mh', 'behroozi10_evolution',
'... | python |
__all__ = ["Dog", "test1", "name"]
class Animal(object):
pass
class Dog(Animal):
pass
class Cat(Animal):
pass
def test1():
print("test1")
def test2():
print("test2")
def test3():
print("test3")
name = "小明"
age = "22"
| python |
from flickr.flickr import search
| python |
# Copyright 2016 Red Hat, Inc.
#
# 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... | python |
from config import appconfig
def uniqueName(base_name):
return time.strftime('%Y%m%d%H%M%S', time.localtime()) + base_name
def isImageByExtension(image_name):
return '.' in image_name and image_name.rsplit('.', 1)[1].lower() in appconfig.IMAGE_EXTENSIONS
| python |
import parse
import logging
import click
from render import Render
logging.basicConfig(level = logging.INFO)
@click.command()
@click.option('--default', '-d', help='Generate the default blog template')
@click.option('--resume','-r', help='Generate a resume template')
def build(default, resume):
Renderer = Render... | python |
import asyncio
import itertools
from decimal import Decimal
from typing import Tuple, Union
from hq2redis.exceptions import SecurityNotFoundError
from hq2redis.reader import get_security_price
from motor.motor_asyncio import AsyncIOMotorDatabase
from pydantic import ValidationError
from pymongo import DeleteOne, Updat... | python |
import logging
import inspect
def logger(filename: str, name: str) -> logging.Logger:
"""configure task logger
"""
logger = logging.getLogger(name)
logger.setLevel(logging.DEBUG)
fh = logging.FileHandler(filename)
formatter = logging.Formatter(
'%(asctime)s %(name)s %(levelname)s: %(me... | python |
from random import uniform
import lepy
from PySide2Wrapper.PySide2Wrapper.window import MainWindow
from PySide2Wrapper.PySide2Wrapper.widget import OpenGLWidget
from PySide2Wrapper.PySide2Wrapper.app import Application
class SimpleScene:
cells_num = [3, 2]
def __init__(self):
self.engine = None
... | python |
import unittest
import socket
import tcp
from multiprocessing import Process
from time import sleep
import os
import subprocess
import signal
'''
test_tcp.py can be run on command line by inputting the following
sudo python3 tcp/test_tcp.py
NOTE: THE TCP THREAD NEVER TERMINATES BECAUSE THE TCP THREAD IS IN A WHILE LO... | python |
"""
The MIT License (MIT)
Copyright (c) 2015 Zagaran, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge... | python |
from __future__ import print_function
import os
import random
import sys
import time
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torch.nn.parameter import Parameter
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
matplotlib.style.use('ggp... | python |
# coding: utf-8
"""
Xero Payroll UK
This is the Xero Payroll API for orgs in the UK region. # noqa: E501
OpenAPI spec version: 2.4.0
Contact: api@xero.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
from xero_python.models import BaseModel
class LeavePeriod(Base... | python |
import time
import os
import sys
import getopt
import pytz
import re
import time
from datetime import datetime
from dotenv import load_dotenv
from monitoring import Monitoring
from untils import toBytes
load_dotenv()
class DockerMonitoring(Monitoring):
def __init__(self, database, settings):
super().__in... | python |
# -*- coding: utf-8 -*-
"""Example 0 (no style, no lint, no documentation).
First version of the example code (slide 10a), prior to applying any tool.
"""
def Calculate(A, B= {}, print = True):
if A == None:
if print:
print('error: A is not valid')
return
elif A != None:
... | python |
import numpy as np
cimport numpy as np
cimport cython
from .utils import fillna, to_ndarray
from .c_utils cimport c_min, c_sum, c_sum_axis_0, c_sum_axis_1
cpdef ChiMerge(feature, target, n_bins = None, min_samples = None, min_threshold = None, nan = -1, balance = True):
"""Chi-Merge
Args:
feature (array-like): fe... | python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayCommerceTransportEtcInfoModifyModel(object):
def __init__(self):
self._biz_agreement_no = None
self._card_no = None
self._device_no = None
self._order_id = N... | python |
# Copyright (c) Microsoft Corporation.
#
# 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 agreed to in writ... | python |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | python |
from pathlib import Path
from typing import NamedTuple, List, Dict, Any
from os import fsync, rename
from .instrumentation_id import InstrumentationId
from util.atomic_file import atomic_write
def get_intrumentation_ids(config: Dict[str, Any]) -> List[InstrumentationId]:
intrumentation_ids = []
if config["ins... | python |
'''
Version: 2.0
Autor: CHEN JIE
Date: 2020-10-12 15:29:23
LastEditors: CHEN JIE
LastEditTime: 2020-10-17 15:54:29
language:
Deep learning framework:
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
from .node import NodeOp
from .dag_layer import DAGLayer
from .sep_conv import SeparableConv2d
... | python |
from django.http import HttpResponse, HttpResponseRedirect
from django.conf import settings
from django.contrib.auth import login
from django.contrib.sites.shortcuts import get_current_site
from django.utils.encoding import force_bytes, force_text
from django.utils.http import urlsafe_base64_encode, urlsafe_base64_deco... | python |
import numpy as np
import scipy.sparse as ss
import pandas as pd
import anndata as ad
def filter_genecounts_percent(adata, cell_fraction, median_count_above_zero):
"""
filter function for counts
:param adata: anndata object to be filtered
:param pheno: phenotype to filter on
:param percent_ce... | python |
#! /data/sever/python/bin/python
# -*- coding:utf-8 -*-
"""
@author: 'root'
@date: '9/30/16'
"""
__author__ = 'root'
import time
import datetime
from lib.utils import format_list
from lib.mongo import MongoClient
from lib.crawler import Crawler
from lib.excel import Excel
M = MongoClient()
def f():
with open('/... | python |
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 25 18:54:45 2022
@author: balas
"""
import requests
from bs4 import BeautifulSoup
import pandas as pd
def extract(location,tag, page):
#Using User Agent,sometimes you will find that the webserver blocks certain user agents.
#This is mostly because ... | python |
import pathlib
from setuptools import setup
from src.hyperfit import __version__
here = pathlib.Path(__file__).parent.resolve()
# Get the long description from the README file
long_description = (here / "README.md").read_text(encoding="utf-8")
setup(
name="hyperfit",
version=__version__,
description="Pro... | python |
from __future__ import absolute_import
import pytest
from DeploymentDirector.director import Context
from DeploymentDirector.rules import Match
# def pytest_generate_tests(metafunc):
# if 'context' in metafunc.fixturenames:
# metafunc.parametrize("context", envs.keys(), indirect=True)
envs={
'complete': {
... | python |
from django.db import models
class ShortenedUrl(models.Model):
id = models.BigIntegerField(primary_key=True)
long_url = models.TextField(blank=False, null=False)
| python |
#!/usr/bin/env python3
'''
Converted to Python 6/00 by Jason Petrone
/*
* Copyright (c) 1993-1997, Silicon Graphics, Inc.
* ALL RIGHTS RESERVED
* Permission to use, copy, modify, and distribute this software for
* any purpose and without fee is hereby granted, provided that the above
* copyright notice appear ... | python |
"""Support for GitHub."""
from datetime import timedelta
import logging
import github
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_NAME,
CONF_ACCESS_TOKEN,
CONF_NAME,
CONF_PATH,
CONF_URL,
)
import homeassistant.helpers.... | python |
import os
import numpy as np
import gym
import ray
from ray.rllib.models import ModelCatalog
from ray.tune.registry import register_env
from rl4rs.env.slate import SlateRecEnv, SlateState
from rl4rs.env.seqslate import SeqSlateRecEnv, SeqSlateState
from rl4rs.utils.rllib_print import pretty_print
from rl4rs.nets.rllib.... | python |
"""Tasks module
All tasks run via external message queue (via celery) are defined
within.
NB: a celery worker must be started for these to ever return. See
`celery_worker.py`
"""
from datetime import datetime
from functools import wraps
import json
from traceback import format_exc
from celery.utils.log import get_... | python |
if x == 3:
print("bye") | python |
from django.apps import AppConfig
class SteveConfig(AppConfig):
name = 'steve'
| python |
name = input("What is the name of the gift giver?")
present = input("What is the present they gave you?")
print()
age = input("How old were you on your birthday?")
yourName = input("What is your name?")
print("Dear " + name + ", ")
print("")
print("Thank you for the " + present + ". ")
print("I really like it. I can't... | python |
from enum import Enum
class IndType(Enum):
CONFIRMED = 'Confirmed'
DECEASED = 'Deceased'
RECOVERED = 'Recovered' | python |
"""
An exceptionally lousy site spider
Ken Kinder <ken@kenkinder.com>
This module gives an example of how the TaskClient interface to the
IPython controller works. Before running this script start the IPython controller
and some engines using something like::
ipcluster -n 4
"""
from twisted.python.failure impor... | python |
# -*- coding: utf-8 -*-
import sys
from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
import os
SQLALCHEMY_DATABASE_URI = None
if 'DATABASE_URI' in os.environ:
SQLALCHEMY_DATABASE_URI = os.getenv("DATABASE_URI")
else:
SQ... | python |
"""
Storage containers for durable queues and (planned) durable topics.
"""
import abc
import logging
import threading
from coilmq.util.concurrency import synchronized
__authors__ = ['"Hans Lellelid" <hans@xmpl.org>']
__copyright__ = "Copyright 2009 Hans Lellelid"
__license__ = """Licensed under the Apache License, V... | python |
#!/usr/bin/env python3
# Copyright (C) 2015-2016 Ben Klein. All rights reserved.
#
# This application is licensed under the GNU GPLv3 License, included with
# this application source.
import sys
global DEBUG
DEBUG = True
if DEBUG:
print("Debugging enabled.")
print("Called with system args: " + str(sys.ar... | python |
import pyqtgraph as pg
from pyqtgraph import QtCore, QtGui
from .. import definitions as defs
from .. import functions
class FinWindow(pg.GraphicsLayoutWidget):
def __init__(self, title, **kwargs):
self.title = title
pg.mkQApp()
super().__init__(**kwargs)
self.setWindowTitle(title)... | python |
import os
import re
from setuptools import setup
PWD = os.path.dirname(__file__)
with open(os.path.join(PWD, 'sshtunnel_requests', '__init__.py')) as f:
VERSION = (re.compile(r""".*__version__ = ["'](.*?)['"]""",
re.S).match(f.read()).group(1))
def parse_requirements_file(filename):
... | python |
# Generated by Django 3.1.5 on 2021-03-28 18:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('challenge', '0004_match_log_file_token'),
]
operations = [
migrations.AlterField(
model_name='match',
name='status',... | python |
# -*- coding: utf-8 -*-
# Copyright (c) 2006-2018, Alexis Royer, http://alexis.royer.free.fr/CLI
#
# All rights reserved.
#
# 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 m... | python |
# -*- coding: utf-8 -*-
import os
from jsonschema import ValidationError
from app_factory.base import AppZero
from gluon import current
class Table(AppZero):
_definition_path = os.path.join(
current.request.folder, "static", "json", "model", "dal", "table.json"
)
_schema_name = "table.schema.j... | python |
import os
from codecs import open
from setuptools import setup, find_packages
try: # for pip >= 10
from pip._internal.req import parse_requirements
except ImportError:
from pip.req import parse_requirements
here = os.path.abspath(os.path.dirname(__file__))
install_requirements = parse_requirements('requirement... | python |
import os
import glob
import re
from setup_app import paths
from setup_app.utils import base
from setup_app.static import AppType, InstallOption
from setup_app.config import Config
from setup_app.utils.setup_utils import SetupUtils
from setup_app.installers.base import BaseInstaller
class JythonInstaller(BaseInstalle... | python |
# Copyright 2016-2020 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
#
# or in the "license" f... | python |
import socket, time, threading, sys, signal, errno
from threading import Thread
if (len(sys.argv) < 2):
print "Server usage: python server.py PORT"
sys.exit(0)
MIN_THREADS = 2 # Minimum number of workers at start and at any point
MAX_THREADS = 32 # Maximum number of workers
TOLERANCE = 2 # Minimum difference ... | python |
import os
import sys
import json
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
class WindowObj6CornernetLiteModelParam(QtWidgets.QWidget):
backward_6_cornernet_lite_valdata_param = QtCore.pyqtSignal();
forward_hyper_param = QtCore.pyqtSignal();
def __init__(... | python |
"""FreeBSD Ports Collection module.
This module provides an interface to interact with the FreeBSD Ports Collection, and means of discovering ports
therein.
"""
from os import environ
from typing import Callable, ClassVar, List, Optional
from pathlib import Path
from .make import make, make_var
from .port import Port,... | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.