content string |
|---|
# -*- coding:utf-8 -*-
#定义函数默认值为空
def ten(arg1 = ' ',arg2 = ' '):
global frequency #定义为全局变量
frequency = frequency + 1
print "函数第%s次被调用:" % frequency
print "参数1:%s" % arg1
print "参数2: %s" % arg2
print "谢谢你的实验!@#$$$$$$$$$$\n"
#变量计算运行几次 默认为0
frequency = 0
#第一次输入两个字符串
print "10呵呵,1... |
from openerp.osv import osv, fields
class sale_order(osv.osv):
_inherit = 'sale.order'
def _prepare_invoice(self, cr, uid, order, lines, context=None):
res=super(sale_order,self)._prepare_invoice(cr,uid,order,lines,context=context)
res.update({'shop_id':order.shop_id.id})
return res |
import os
import ctypes
import copy
import struct
import windows
from windows import winproxy
from windows import utils
import windows.generated_def as gdef
from windows.winobject import process
from windows.winobject import network
from windows.winobject import registry
from windows.winobject import exception
fro... |
__author__ = 'oerb'
from django.contrib import admin
from menues.models import Menu, Image, MetaInfos
from django.contrib.sites.models import Site
from usrsettings.models import Setting
from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin
class SettingInline(admin.StackedInline... |
"""
Model fields for working with trees.
"""
__all__ = ('TreeForeignKey', 'TreeOneToOneField', 'TreeManyToManyField')
from django.db import models
from mptt2.forms import TreeNodeChoiceField, TreeNodeMultipleChoiceField
class TreeForeignKey(models.ForeignKey):
"""
Extends the foreign key, but uses mptt's ``... |
'''Events for `pyglet.window`.
See `WindowEventHandler` for a description of the window event types.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: event.py 1118 2007-08-07 22:25:59Z Alex.Holkner $'
import sys
from pyglet.window import key
from pyglet.window import mouse
class WindowExitHandler(object)... |
"""Tests for the VMF library."""
from srctools.vmf import Entity, VMF
from pytest import raises
def test_fixup_basic() -> None:
"""Test ent.fixup functionality."""
obj = object() # Arbitrary example object.
ent = VMF().create_ent('any')
assert len(ent.fixup) == 0
assert list(ent.fixup) == []
... |
import logging
from cached_property import threaded_cached_property
from .credentials import BaseCredentials, OAuth2Credentials
from .protocol import RetryPolicy, FailFast
from .transport import AUTH_TYPE_MAP, OAUTH2
from .util import split_url
from .version import Version
log = logging.getLogger(__name__)
class C... |
# -*- coding: utf-8 -*-
import json
import peewee as pw
from flask import jsonify, request, Response
from flask.ext.restful import Resource
from contracts_api.api.models import Flow
from contracts_api.api.serializers import FlowSchema
class FlowList(Resource):
def get(self):
flows = Flow.select()
... |
from essentia_test import *
from numpy import random, pi, sort
class TestDissonance(TestCase):
def testEmpty(self):
# silent frames should have no dissonance
self.assertAlmostEqual(Dissonance()([],[]), 0)
def testOne(self):
pass
def testDiffSizeInputs(self):
self.assertCo... |
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 Nathanael C. Fritz
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from socket import _fileobject
import socket
class FileSocket(_fileobject):
"""
Create a file object wrapper for a socket to work aro... |
import random
import numpy as np
from rl.action import Action
from rl.agent.agent import Agent
from rl.domain import Domain
from rl.state import State
from rl.task import Task
from rl.valuefunction import FeatureExtractor
from rl.valuefunction.linear import LinearVFA
class TrueOnlineSarsaLambdaVFA(Agent):
def _... |
# -*- coding: utf8 -*-
import re
from subprocess import Popen, PIPE
from mybs import SelStr
from comm import DWM, echo, start
# https://tools.ietf.org/html/rfc8216#page-15
class M3U8(DWM):
handle_list = ['\.m3u8']
def query_info(self, url):
# https://vip.pp63.org/20180615/20jqyayZ/hls/index.m3u8
... |
from website.processing import get_conf
from gpio_app.process import set_para, get_para, board_bmc, export, unexport
import json
from bson import json_util
import traceback
from time import time
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpRespo... |
passports = []
current = {}
with open('in', 'r') as f:
for line in f.readlines():
# end of passport, save and prepare for the next one
if line == '\n':
passports.append(current)
current = {}
# process single line
raw_data = line.split()
for item in ... |
'''File: paratt_cython.py an implementation of the paratt algorithm in cython
should yield a speed increase > 2.
Programmed by: Matts Bjorck
Last changed: 2008 11 23
'''
from numpy import *
paratt_ext_built = False
debug = False
try:
import genx.models.lib.paratt_ext as paratt_ext
paratt_ext_built = True
excep... |
"""
Utility functions for implementating module naming schemes.
@author: Stijn De Weirdt (Ghent University)
@author: Dries Verdegem (Ghent University)
@author: Kenneth Hoste (Ghent University)
@author: Pieter De Baets (Ghent University)
@author: Jens Timmerman (Ghent University)
@author: Fotis Georgatos (Uni.Lu)
"""
i... |
"""Guided IG implementation for Tensorflow 1."""
from .base import TF1CoreSaliency
from ..core import guided_ig as core_guided_ig
class GuidedIG(TF1CoreSaliency):
r"""Implements Guided IG implementation for Tensorflow 1.
https://arxiv.org/TBD
"""
def __init__(self, graph, session, y, x):
super(GuidedIG,... |
from itertools import zip_longest
from io import BytesIO
from hypothesis.strategies import sampled_from
from hypothesis import given, HealthCheck, settings
from segpy import textual_reel_header
from segpy.binary_reel_header import BinaryReelHeader
from segpy.encoding import ASCII, EBCDIC
from segpy.header import are_eq... |
import pylab
import random
random.seed(0)
####################
# Helper functions #
####################
def flipCoin(numFlips):
'''
Returns the result of numFlips coin flips of a biased coin.
numFlips (int): the number of times to flip the coin.
returns: a list of length numFlips, w... |
import sys
from io import BytesIO
import telegram
from flask import Flask, request, send_file
from fsm import TocMachine
API_TOKEN = '382007842:AAFTBsCoN1FiN-J7HtuJudBwWfC50-qAdjQ'
WEBHOOK_URL = 'WEBHOOK_URL/hook'
app = Flask(__name__)
bot = telegram.Bot(token=API_TOKEN)
machine = TocMachine(
states=[
... |
import numpy as np
import pandas as pd
class DataGrid:
def __init__(self, records, group_by=None):
# build data frame
df = pd.DataFrame.from_dict(records)
# columns that will be interpreted as paramers
params = sorted(set(df.columns) - set(['data']))
if group_by is None:
... |
'''Helpers for writing the BigQuery SQL grammar concisely.
In a recursive descent parser, grammar rules are functions. Instead of needing to write each rule
as a function, the helpers in this module allow us to be more concise.
The apply_rule function removes the requirement that all rules are functions, so long as ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This script can be used to change one image to another or remove an image.
Syntax: python image.py image_name [new_image_name]
If only one command-line parameter is provided then that image will be removed;
if two are provided, then the first image will be replaced by the... |
from __future__ import division
import pandas as pd
import numpy as np
import warnings
def get_percent_alloc(values):
"""
Determines a portfolio's allocations.
Parameters
----------
values : pd.DataFrame
Contains position values or amounts.
Returns
-------
allocations : pd.D... |
#!/usr/bin/env python
from subprocess import Popen, PIPE
import json
import shlex
from itertools import *
from operator import *
import csv
import sys
import yaml
spec = open('csv_spec.yml')
csv_columns = yaml.load(spec.read())['race']
spec.close()
filename = (len(sys.argv) == 2 and sys.argv[1]) or "BYAW0P3YPS31LXW0... |
from ethoscope_node.utils.configuration import EthoscopeConfiguration
from ethoscope_node.utils.backups_helpers import GenericBackupWrapper, BackupClass, receive_devices
from ethoscope_node.utils.device_scanner import EthoscopeScanner
import logging
import optparse
import traceback
import os
server = "localhost"
info... |
"""
Form Widget classes specific to the Django admin site.
"""
import django.utils.copycompat as copy
from django import forms
from django.forms.widgets import RadioFieldRenderer
from django.forms.util import flatatt
from django.utils.html import escape
from django.utils.text import truncate_words
from django.utils.t... |
from sqlalchemy import *
from sqlalchemy import testing
from sqlalchemy.dialects import mysql
from sqlalchemy.testing import AssertsCompiledSQL, eq_, fixtures
from sqlalchemy.testing.schema import Table, Column
class _UpdateFromTestBase(object):
@classmethod
def define_tables(cls, metadata):
Table('my... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('core', '... |
"""Roles sub-commands"""
from tabulate import tabulate
from airflow.utils import cli as cli_utils
from airflow.www.app import cached_app
def roles_list(args):
"""Lists all existing roles"""
appbuilder = cached_app().appbuilder # pylint: disable=no-member
roles = appbuilder.sm.get_all_roles()
print("... |
#!/usr/bin/env python
from __future__ import print_function
from getpass import getpass
import sys
from subprocess import Popen, PIPE
from tempfile import mkdtemp
from shutil import rmtree
import shlex
import smtplib
import os
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from emai... |
from flask import request, render_template, url_for, redirect, Response
from datetime import date, timedelta
import json
from sqlalchemy import extract
from . import main
from .. import db
from .forms import PlanForm, LEVELS, DAYS
from .builder import get_plan
from ..models import Workout
from .calendar import Workou... |
import os
from django.contrib.gis.utils import LayerMapping
from whyqd.wiqi.models import Wiqi, Geomap
from django.contrib.auth.models import User
uip = "192.168.0.9"
u = User.objects.all()[0]
world_mapping = {
'fips' : 'FIPS',
'iso2' : 'ISO2',
'iso3' : 'ISO3',
'un' : 'UN',
'name' : 'NAME',
'a... |
from pspecs import Context, let
class DescribeLet(Context):
A = 1
def let_a(self): return self.A
def let_b(self): return 2
def let_sum(self): return self.b + self.a
def it_should_evaluate_let_blocks_as_attributes(self):
assert self.sum == 3
def it_should_prefer_overwritten_attributes... |
"""
Copyright (c) 2016, Pietro Piscione, Luigi De Bianchi, Giulio Micheloni
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 must retain the above copyright
noti... |
from pygame import *
from bullet import *
import math
class Tile:
def __init__(self, x, y, tile_name, color, size, sprite=None, hp=0, passable=True, light_source=False, tile_price=0):
self.tile_name = tile_name
self.x = x
self.y = y
self.hp = hp
self.full_hp = hp
se... |
"""
Svg reader.
"""
from __future__ import absolute_import
#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module.
import __init__
from fabmetheus_utilities.geometry.creation import lineation
from fabmetheus_utilit... |
# Standard Library
from gettext import gettext as _
# Lutris Modules
from lutris.runners.runner import Runner
from lutris.util import system
class osmose(Runner):
human_name = _("Osmose")
description = _("Sega Master System Emulator")
platforms = [_("Sega Master System")]
runner_executable = "osmose/... |
import unittest
import base
import absent
import pyxb_114.utils.domutils
pyxb_114.utils.domutils.BindingDOMSupport.DeclareNamespace(base.Namespace, 'base')
class TestTrac0119 (unittest.TestCase):
def testRoundTrip (self):
c = absent.doit('hi')
m = base.Message(c)
xmls = m.toxml("utf-8")
... |
import re
from collections import OrderedDict
from django import forms
from django.contrib import auth
from django.contrib.auth import get_user_model
from django.utils.encoding import force_text
from django.utils.translation import gettext_lazy as _
from account.conf import settings
from account.hooks import hookset
... |
# -*- coding: utf-8 -*-
from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo
class UploadableChFolder(SimpleCrypter):
__name__ = "UploadableChFolder"
__type__ = "crypter"
__version__ = "0.06"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?uploadable\.ch... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
Delaunay.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
******************************... |
import os
from copy import copy
from py2exe.build_exe import py2exe as _py2exe
from py2exe.py2exe_util import depends
from pygtk2exe.win32 import winbase
# copied from py2exe's build_exe.py
def _fancy_split(str, sep=","):
# a split which also strips whitespace from the items
# passing a list or tuple will r... |
import tensorflow as tf
from bvlc_alexnet_fc7 import AlexNet
import nt
import numpy as np
import os
import time
import cv2
import image_io
import sys
import math
# the dimension of the final layer = feature dim
NN_DIM = 100
# TEST_TXT = 'file_list_fine_tune_train.txt'
TEST_TXT = 'file_list_fine_tune_test_nba_dunk.txt'... |
#!/usr/bin/python
"""
title : termopi.py
description : Displays the status of the resources (cpu load and memory usage) consumed by a Raspberry Pi
computer and the resources consumed by one or more containrs instantiated in the Pi.
source :
author : Adisorn Lertsinsr... |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <<EMAIL>>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
MagicMock,
patch,
)
# Import Salt Libs
from salt.modules import augea... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Protokol pro posilani a prijimani dat ze Stellaria
# http://yoestuve.es/blog/communications-between-python-and-stellarium-stellarium-telescope-protocol/
#
import select
import asyncore
import socket
import time
import rospy
from std_msgs.msg import String
from std_m... |
import os
from fate_arch.computing import ComputingEngine
from fate_arch.federation import FederationEngine
from fate_arch.storage import StorageEngine
from fate_arch.common import file_utils, log, EngineType
from fate_flow.entity.runtime_config import RuntimeConfig
from fate_arch.common.conf_utils import get_base_con... |
# -*- coding: utf-8 -*-
from tests.utils import (CDNTestCase, TEST_JQUERY_VERSION,
CDNStaticTestAssertionsMixin, TEST_BOOTSTRAP_VERSION)
class CDNStaticTest(CDNStaticTestAssertionsMixin, CDNTestCase):
def test_cdn_js_with_debug_unknown_file(self):
with self.settings(DEBUG=True):... |
# -*- coding: utf-8 -*-
import re
from django.forms import ValidationError, ModelForm, Form, CharField, PasswordInput, TextInput
from django.utils.translation import ugettext_lazy as _
from accounts.models import MyUser
class SignUpForm(ModelForm):
"""
Регистрационная форма.
"""
password = CharField... |
import torch
from .Module import Module
from .utils import clear
class RReLU(Module):
def __init__(self, lower=1. / 8, upper=1. / 3, inplace=False):
super(RReLU, self).__init__()
self.lower = lower
self.upper = upper
self.inplace = inplace
assert self.lower <= self.upper ... |
from django.db import models
from alert.search.models import Court
class urlToHash(models.Model):
"""A class to hold URLs and the hash of their contents. This could be added
to the Court table, except that courts often have more than one URL they
parse.
"""
id = models.CharField(
"the ID o... |
"""File system plugin."""
from glances.plugins.glances_plugin import GlancesPlugin
import psutil
# SNMP OID
# The snmpd.conf needs to be edited.
# Add the following to enable it on all disk
# ...
# includeAllDisks 10%
# ...
# The OIDs are as follows (for the first disk)
# Path where the disk is mounted: .1.3.6.1.4.1... |
from flask import Flask, render_template, request, redirect, url_for
import pymongo
import yaml
app = Flask(__name__)
mongodb_uri = 'mongodb://5chackathon:<EMAIL>:41367/hackweek'
db_name = 'hackweek'
connection = pymongo.Connection(mongodb_uri)
db=connection[db_name]
MAJORS = yaml.load(file('majors.yaml', 'r'))
@a... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Common functions
import os, sys
import requests
import json
lib_path = os.path.abspath( os.path.join( '..', '..', 'lib' ) )
sys.path.append(lib_path)
from commons import *
from overpasser import *
from routing import *
from feriados import *
from make_json import *
debugMe... |
"""
the question is whether the robot's movement is bounded when the instructions are repeated infinitely
at the end of the instructions, the robot will be some distance from the origin
facing one of 4 directions relative to its original heading
if the distance is 0, it's bounded regardless of direction
if the distance... |
from __future__ import print_function
import json
import struct
import re
import base64
import httplib
import sys
settings = {}
class DobbscoinRPC:
def __init__(self, host, port, username, password):
authpair = "%s:%s" % (username, password)
self.authhdr = "Basic %s" % (base64.b64encode(authpair))
self.conn = ... |
from __future__ import print_function
from __future__ import unicode_literals
import time
from netmiko.ssh_connection import SSHConnection
from netmiko.netmiko_globals import MAX_BUFFER
class HuaweiSSH(SSHConnection):
def session_preparation(self):
'''
Prepare the session after the connection has... |
"""
Copy & Paste from Parrot Bebop commands
(possible usage also as parsing command log files)
usage:
./commands.py <cmd log file>
"""
import time
import struct
from threading import Thread,Event,Lock
from collections import defaultdict
def moveCmd( speed, turn ):
# ARCOMMANDS_ID_PROJECT_JUMPINGSUMO = ... |
import commands
import os
cutPath = "/home/jcavner/TashiTestOcc/prepForMasks/philippines.shp"
#for scen in scens:
#for yr in yrs:
#listtifs = commands.getoutput('ls /home/jcavner/worldclim_lwr48/future/NIES/%s/%s/*.tif' % (scen,yr))
listtifs = commands.getoutput('ls /home/jcavner/TashiTestOcc/climate/bboxCut/*.ti... |
import frappe
import unittest, copy
from frappe.test_runner import make_test_objects
from frappe.core.doctype.version.version import get_diff
class TestVersion(unittest.TestCase):
def test_get_diff(self):
frappe.set_user('Administrator')
test_records = make_test_objects('Event', reset = True)
old_doc = frappe.g... |
from PyQt5 import QtCore
from dotplot.gui.chooser import Chooser
def test_chooser(qtbot):
chooser = Chooser(default_db='ncbi')
qtbot.addWidget(chooser)
active_option = chooser.databases['ncbi']
assert active_option.button.isChecked()
assert chooser.id_input.placeholderText() == 'example: ' + ac... |
from msrest.serialization import Model
class LocationCapabilities(Model):
"""The capabilities for a location.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar name: The location name.
:vartype name: str
:ivar status: Azure SQL Database's status fo... |
from django.conf import settings
from django.template import response
from django.views.generic import base
from . import models
class IndexView(base.View):
def obter_destaques(self):
qs = models.Destaque.objects.select_related()
return qs.order_by('-data')[:14]
def get(self, request):
... |
### A sample pygster parser file that can be used to count the number
### of response codes found in an Apache access log.
###
### For example:
### sudo ./pygster --dry-run --output=ganglia SamplePygster /var/log/httpd/access_log
###
###
import csv
import datetime
import dateutil.parser
import simplejson as json
i... |
from orbkit.display import display
def vmd_network_creator(filename,cube_files=None,render=False,exit=False,
iso=(-0.01,0.01),abspath=False,mo_options='',**kwargs):
'''Creates a VMD script file from a list of cube files provided.
**Parameters:**
filename : str
Contains the base name... |
"""System for Modular Analysis and Continuous Queries.
See http://smacq.sourceforge.net/
"""
import libpysmacq
import time, sys
# TODO:
# Change all instances of raise Exception to raise More_Appropriate_Exception
class SmacqQuery: # {{{
"""Executes one or more queries in the SMACQ (System for Modular Analysis... |
import tensorflow as tf
import hyperchamber as hc
from hypergan.losses.base_loss import BaseLoss
class StandardLoss(BaseLoss):
def required(self):
return "reduce".split()
def _create(self, d_real, d_fake):
ops = self.ops
config = self.config
gan = self.gan
generator_... |
from __future__ import division
import numpy as np
from keras.models import Sequential, Model
from keras.optimizers import SGD
from keras_extensions.logging import log_to_file
from keras_extensions.rbm import RBM
from keras_extensions.layers import SampleBernoulli
from keras_extensions.initializations import... |
import proto # type: ignore
__protobuf__ = proto.module(
package="google.ads.googleads.v8.errors",
marshal="google.ads.googleads.v8",
manifest={"IdErrorEnum",},
)
class IdErrorEnum(proto.Message):
r"""Container for enum describing possible id errors. """
class IdError(proto.Enum):
r... |
import pyrax
import argparse
import os
import sys
import os.path
DEFAULT_HTML = (
"""<!DOCTYPE html>
<html>
<head>
<title>Challenge Ate</title>
</head>
<body>
<h1>Challenge 8, hey-oh!</h1><br/>
<h3>i <3 internets</h3>
</body>
</html>
""")
pyrax.set_setting('iden... |
from django.forms.models import modelform_factory
from django.template.loader import render_to_string
from rest_framework.renderers import HTMLFormRenderer
from fancypages.dashboard import forms
class BlockFormRenderer(HTMLFormRenderer):
template_name = "fancypages/api/block_form.html"
def get_form_class(s... |
import os
from contextlib import contextmanager
import tempfile
import shutil
import requests
from .identifiers import Pid
from .files import Fileset, FilesetBin
@contextmanager
def open_url(base_url, images=True):
"""
Context manager for remote access to a bin. Stages
files to a temporary directory and ... |
# coding: utf-8
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
from rest_framework import test, status
from rest_framework.authtoken.models import Token
from .. import models
from .. import views
from .helpers import AuthTestCaseMixin
class CheckToken(Au... |
import os
import re
def validate(branch):
config = {}
config["WORKDIR"] = os.environ.get('WRKDIR')
if config["WORKDIR"] == None:
print 'Environment variable WRKDIR is not set, setting it to current working directory'
config["WORKDIR"] = os.getcwd()
os.environ["WRKDIR"] = os.getcwd()
if not os.path.exists(co... |
# -*- coding: utf-8 -*-
"""
sphinx.ext.intersphinx
~~~~~~~~~~~~~~~~~~~~~~
Insert links to objects documented in remote Sphinx documentation.
This works as follows:
* Each Sphinx HTML build creates a file named "objects.inv" that contains a
mapping from object names to URIs relative to the H... |
# -*- coding: utf-8 -*-
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 'Book.user'
db.add_column('books_book', 'user',
self.gf('django.db.mode... |
from __future__ import absolute_import, unicode_literals
from functools import reduce
from six import BytesIO
from xlsxwriter import Workbook
from .utils import apply_outer_border_to_range
class ModelWorkbookException(Exception):
pass
class ModelWorkbook(object):
"""
A helper for expressing Django mo... |
"""Base objects to be exported for use in Controllers"""
from paste.registry import StackedObjectProxy
from pylons.config import config
from pylons.legacy import h, jsonify, Controller, Response
__all__ = ['c', 'g', 'cache', 'request', 'response', 'session', 'jsonify',
'Controller', 'Response']
def __figu... |
"""Resource based permissions.
Revision ID: 2c6edca13270
Revises: 849da589634d
Create Date: 2020-10-21 00:18:52.529438
"""
import logging
from airflow.security import permissions
from airflow.www.app import create_app
# revision identifiers, used by Alembic.
revision = '2c6edca13270'
down_revision = '849da589634d'
... |
class CWrapPlugin(object):
def initialize(self, cwrap):
pass
def get_type_check(self, arg, option):
pass
def get_type_unpack(self, arg, option):
pass
def get_return_wrapper(self, option):
pass
def get_wrapper_template(self, declaration):
pass
def get... |
#!/usr/bin/python
import sys
import os
import getopt
import collections
def main():
params = parseArgs()
pop_assign = dict()
seqs = dict()
#parse popmap file for dictionary of sample assignments
if params.popmap:
print("Parsing popmap file...")
pop_assign = parsePopmap(params.popmap)
else:
print("ERROR:... |
"""Asterisk call detail record testing
This module implements an Asterisk CDR parser.
Copyright (C) 2010, Digium, Inc.
Terry Wilson<<EMAIL>>
This program is free software, distributed under the terms of
the GNU General Public License Version 2.
"""
import sys
from . import astcsv
import logging
LOGGER = logging.ge... |
import errno
import json
import os
import sqlite3
import sys
from cylc.flow.rundb import CylcSuiteDAO
from cylc.flow.task_state import (
TASK_STATUS_SUBMITTED, TASK_STATUS_SUBMIT_RETRYING,
TASK_STATUS_RUNNING, TASK_STATUS_SUCCEEDED, TASK_STATUS_FAILED,
TASK_STATUS_RETRYING)
class CylcSuiteDBChecker(object... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Blockstack
~~~~~
copyright: (c) 2014-2015 by Halfmoon Labs, Inc.
copyright: (c) 2016 by Blockstack.org
This file is part of Blockstack
Blockstack is free software: you can redistribute it and/or modify
it under the terms of the GNU General... |
#!/usr/bin/env python2
from __future__ import print_function
import os
import re
import sys
import fnmatch
import tempfile
import subprocess
from datetime import datetime
# import Plogbook
# # External package import (things that don't come with python and are optional)
# Markdown2 is for markdown to html conversion... |
# third-party imports
import pytest
# local imports
from shpkpr.template import InvalidJSONError
from shpkpr.template import MissingTemplateError
from shpkpr.template import UndefinedError
from shpkpr.template import load_values_from_environment
from shpkpr.template import render_json_template
from shpkpr.template_fil... |
import os
import numpy as np
import pyvo as vo
import warnings
from astropy.table import Table, Column, MaskedColumn, vstack, setdiff
from astropy.coordinates import SkyCoord
from astropy import units as u
#from astroquery.gaia import Gaia
from .solve import PlateSolution
from ..conf import read_conf
from ..database im... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals
from xml.etree import ElementTree
import xml.sax.saxutils as saxutils
import os, copy, random
from .util import uid
class Item(object):
def __init__(self, **kwargs):
self.content = {
'title' ... |
import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... |
"""
Tests for the sync course runs management command.
"""
import ddt
import mock
from django.core.management import call_command
from openedx.core.djangoapps.catalog.tests.factories import CourseRunFactory
from openedx.core.djangoapps.catalog.management.commands.sync_course_runs import Command as sync_command
from o... |
"""
Django settings for feature_request project.
Generated by 'django-admin startproject' using Django 1.9.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
impo... |
#coding=utf8
import smtplib, json, time
from email.mime.text import MIMEText
RECEIVE_ACCOUNT = '<EMAIL>'
class MailNotification():
def __init__(self):
pass
def __enter__(self):
self.receiveAccount = RECEIVE_ACCOUNT
self.get_account()
self.connect_host()
return self
... |
import math
from random import gauss
from scipy import special
from dates import get_previous_day, get_next_day
def get_missing_data_point(required_dates, daily_data, date):
"""
Calculate a suitable data point with relevant probability from known info
"""
if get_previous_day(date) in daily_data and g... |
"""Test Benchmarks Matrix generator."""
from __future__ import absolute_import, unicode_literals
from numpy import matrix
from pylocating.benchmarks.matrix_generator import \
generate_matrix_of_points_in_cube
class TestBenchmarksMatrixGenerator(object):
"""Test Benchmarks Matrix generator."""
def test... |
import os
import inspect
from gen import CodeGeneratorBase
from spec import Type, Availability, Constant, Define, Parameter, Method, Class
import textwrap
from datetime import datetime
import pathlib
import argparse
from xml.sax.saxutils import escape
class XMLConstant(Constant):
def __init__(self, other):
... |
from IECoreDelightPreviewTest import *
from DelightRenderTest import DelightRenderTest
from InteractiveDelightRenderTest import InteractiveDelightRenderTest
from ModuleTest import ModuleTest
if __name__ == "__main__":
import unittest
unittest.main() |
import os
import time
import unittest
from king_phisher.testing import KingPhisherServerTestCase
from king_phisher.utilities import random_string
class ServerTests(KingPhisherServerTestCase):
def test_http_method_get(self):
for phile in self.web_root_files(3, include_templates=False):
http_response = self.http_... |
import simplejson as json
import sys
from flask import Blueprint, request, jsonify
import config
from sqlalchemy import func
import gevent
from app import log
# Import models
from app.models import (
Stream,
StreamLot,
Lot,
LotUser,
Owner,
User,
Tweet,
TweetHashtag,
Hashtag,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.