src
stringlengths
721
1.04M
"""A helper class to manage the logical flow of Questions. """ import time import random class Registrar(object): def __init__(self): self.registry = {} self.orphaned = {} self.branched = {} self.entry = None self.cursor = None self.running = None def _make_u...
#!/usr/bin/env python # This script translates and separates the traces computed with UPPAAL model checking and the tracer tool (libutap). The traces are originally in a *.xtr file format. The specified automata transitions are separated from the global traces (the human, the setting of gaze, pressure and location), an...
# # Copyright (c) 2008--2014 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
# Copyright 2020 Google LLC # # 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 writing, s...
import cookielib, socket, urllib, urllib2, urllib, sys from urllib import urlretrieve from shutil import copyfile from .views.SubscriptsViews import getIntereses from twisted.internet import reactor from twisted.python import log import json, os import pickle import threading from autobahn.websocket import WebSocketSe...
#!/usr/bin/env python from __future__ import print_function import signal import sys, os, datetime, time, json, traceback, csv import multiprocessing, multiprocessing.queues, subprocess, re, ctypes, codecs from optparse import OptionParser from ._backup import * import rethinkdb as r # Used because of API difference...
import xmltodict catalogo = '''<?xml version="1.0" encoding="UTF-8"?> <CATALOG> <CD> <TITLE>Empire Burlesque</TITLE> <ARTIST>Bob Dylan</ARTIST> <COUNTRY>USA</COUNTRY> <COMPANY>Columbia</COMPANY> <PRICE>10.90</PRICE> <YEAR>1985</YEAR> </CD> <CD> <TITLE>Hide your heart</TITLE> <ARTIST>Bonnie Tyler</AR...
# -*- coding: utf-8 -*- ############################################################################## # # Odoo, Open Source Management Solution # Copyright (C) 2010 - 2014 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify # ...
from flask import flash, redirect, render_template, url_for from flask_login import login_required from retrotechclub import app, db from retrotechclub.models import Company, GameMaster, GameRelease, Platform from retrotechclub.forms import GameMasterForm, GameReleaseForm @app.route('/games') def game_masters_list():...
# -*- coding: utf-8 -*- from functools import partial from openprocurement.edge.utils import ( context_unpack, decrypt, encrypt, APIResource, json_view ) from openprocurement.edge.utils import eaopresource from openprocurement.edge.design import ( by_dateModified_view_ViewDefinition, real_b...
# -*- coding: utf-8 -*- """ Test downloading scientific articles' infomration from the web. Created on Sun Apr 19 20:46:55 2015 @author: alek """ import os, requests, re, difflib, time, numpy, subprocess, networkx, matplotlib.pyplot import nltk, string, sklearn.metrics, sklearn.cluster try: from selenium import ...
import claripy from typing import List, Tuple, Set, Dict, Optional from angr.storage.memory_object import SimMemoryObject, SimLabeledMemoryObject from .multi_values import MultiValues class CooperationBase: """ Any given subclass of this class which is not a subclass of MemoryMixin should have the property t...
# Mark Gatheman <markrg@protonmail.com> # # This file is part of Hydrus. # # Hydrus is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # ...
from django.db.models import CharField, Max from django.db.models.functions import Lower from django.test import TestCase, skipUnlessDBFeature from .models import Celebrity, Fan, Staff, StaffTag, Tag @skipUnlessDBFeature('can_distinct_on_fields') @skipUnlessDBFeature('supports_nullable_unique_constraints') class Dis...
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. DEPS = [ 'archive', 'recipe_engine/json', 'recipe_engine/path', 'recipe_engine/platform', 'recipe_engine/properties', ] TEST_HASH_MAIN='5e3250aadd...
from fontTools import ttLib from fontTools.misc.textTools import safeEval from fontTools.ttLib.tables.DefaultTable import DefaultTable import sys import os import logging log = logging.getLogger(__name__) class TTXParseError(Exception): pass BUFSIZE = 0x4000 class XMLReader(object): def __init__(self, fileOrPat...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
""" Linear mixed effects models are regression models for dependent data. They can be used to estimate regression relationships involving both means and variances. These models are also known as multilevel linear models, and hierarchical linear models. The MixedLM class fits linear mixed effects models to data, and p...
# Copyright 2018 Virgil Dupras # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from core.tests.testutil import eq_ from core.gui.tree import Tree, Node d...
""" Post processing tools """ import os import numpy as np def extrac4dir(dir_path, search): """ Extrar the epsilon, mean free path, total time and efficienci of all file in some directory. Parameters ---------- dir_path : str Path to the directory with the outputs files. search : list ...
import requests import random class MatchCourse: def __init__(self): self.url = "https://hackbulgaria.com/api/students/" self.records = [] self.courses = None def get_info(self): self.records = requests.get(self.url, verify=False) if self.records.status_code != 200: ...
""" Template module for Players Copy this module up one level and name it as you like, then use it as a template to create your own Player class. To make the default account login default to using a Player of your new type, change settings.BASE_PLAYER_TYPECLASS to point to your new class, e.g. settings.BASE_PLAYER_...
import sys from importlib.abc import MetaPathFinder from importlib.util import spec_from_file_location from pathlib import Path class GUIFinder(MetaPathFinder): def __init__(self, name, fallback=None): self._path = Path(__file__).parent.parent / name self._fallback_path = None if fallba...
'''System info related sensor implementations.''' from sensors.sbase import SensorBase from datetime import datetime class NetTraffic(SensorBase): '''Measures the average rx and tx throughput of a network interface.''' def __init__(self, scfg): super().__init__(scfg) self.device = scfg['de...
import unittest import Net import transformations as trans import Rhino.Geometry as geom import rhinoscriptsyntax as rs reload(Net) reload(trans) def setUpModule(): print("---- net ----") def tearDownModule(): print("---- module torn down ----") remove_objects() def remove_objects(): rs.DeleteObject...
""" Copyright [2009-2017] EMBL-European Bioinformatics Institute 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you ca...
# Copyright (C) 2014-2017 Saggi Mizrahi, Red Hat Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, but # WITHOU...
import Geometry from random import random from demo import FpsDisplay class ColorfulSphere(Geometry.Sphere): def __init__(self): Geometry.Sphere.__init__(self) self.boundary = 5 def step(self): if self.position[0] > self.boundary or self.position[0] < -self.boundary: ...
from __future__ import division from collections import namedtuple from datetime import datetime import sys import simplejson from django.conf import settings from dimagi.utils.chunked import chunked from dimagi.utils.modules import to_function from pillowtop.exceptions import PillowNotFoundError from pillowtop.log...
# # Copyright (C) 2017 FreeIPA Contributors see COPYING for license # """ Test the `session_storage.py` module. """ import pytest from ipapython import session_storage @pytest.mark.skip_ipaclient_unittest @pytest.mark.needs_ipaapi class test_session_storage(object): """ Test the session storage interface ...
#!/usr/bin/python2.5 # # Copyright 2010 the Melange authors. # # 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...
import os import sys import ycm_core def DirectoryOfThisScript(): return os.path.dirname(os.path.abspath(__file__)) preferred_build_type = 'debug' flags = [ '-std=c++11' ,'-Wall' ,'-Wextra' ,'-Wconversion' ,'-Wno-deprecated' ,'-I%s' % os.path.join(DirectoryOfThisScript(), 'build', preferr...
from .... import sim_options as o from ....state_plugins.sim_action_object import SimActionObject from ....state_plugins.sim_action import SimActionData from . import SimIRStmt, SimStatementError class SimIRStmt_LoadG(SimIRStmt): def _execute(self): addr = self._translate_expr(self.stmt.addr) alt ...
from supriya.system.SupriyaValueObject import SupriyaValueObject class BufferProxy(SupriyaValueObject): """ A buffer proxy. Acts as a singleton reference to a buffer on the server, tracking the state of a single buffer id and responding to `/b_info` messages. Multiple Buffer instances reference a...
# Author: Emmanuel Odeke <odeke@ualberta.ca> # Resource file for constants import sys ############################CONSTANTS#################################### UALBERTA_DOMAIN_KEY = "ualberta.ca" DATE_KEY = "date" LAST_NAME_KEY = "lastname" FIRST_NAME_KEY = "firstname" SPEED_CODE_KEY = "speedCode" #code for acco...
# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from datetime import datetime from typing import Optional, Dict, TYPE_CHECKING, Callable from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot, pyqtProperty, QTimer, Q_ENUMS from UM.Logger import Logger from UM.Message im...
from sklearn.model_selection import train_test_split from sklearn.neural_network import MLPClassifier import pandas from pandas import DataFrame import pandas.io.sql as psql import KnowledgeBase import NeuralNetworkController import DecisionTreeController import RandomForestController import SVMController import random...
# -*- coding: utf-8 -*- # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net> # This program is free software: you can r...
# coding=utf-8 """ ``fish_crypt`` 包含的是一些加密、编码数据的函数,比如 MD5、SHA256 的计算。 原来这些方法属于 fish_common 模块, 因 fish_common 过于杂乱,故重新进行分类整理。 """ # 2019.01.21 v1.1.6 created by Hu Jun import hashlib import hmac import base64 # 2018.5.8 edit by David Yi, edit from Jia Chunying,#19026 # 2018.6.12 edit by Hu Jun, edit from Jia Chuny...
from django.core.urlresolvers import reverse from django.db import models from model_utils.models import TimeStampedModel from contacts.models import Contact,Address class Product(models.Model): name = models.CharField(max_length=255) COLOUR_CHOICES = ( ('NR', 'Navy/Red'), ('NB', 'Navy/Blue')...
# This file is part of Booktype. # Copyright (c) 2012 Aleksandar Erkalovic <aleksandar.erkalovic@sourcefabric.org> # # Booktype is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the Li...
# Copyright 2018 The TensorFlow Authors. 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 applica...
#!/usr/bin/env python # encoding=utf8 # The publish confirm test client import sys reload(sys) sys.setdefaultencoding('utf8') import gevent from gevent import monkey monkey.patch_all() from haigha.connections.rabbit_connection import RabbitConnection from haigha.message import Message class Client(object): """T...
# -*- coding: utf-8 -*- # Resource object code # # Created: ven 7. mar 16:51:28 2014 # by: The Resource Compiler for PyQt (Qt v4.7.1) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = "\ \x00\x00\x05\x23\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x...
# -*- coding: utf-8 -*- """ Created on Sun Feb 05 16:26:55 2017 @author: uricar.michal """ import sys # sys.path.append("D:/GitHub/clandmark/install/share/clandmark/python/") sys.path.append("D:/GitHub/clandmark/build_win10/install/share/clandmark/python") from py_flandmark import PyFlandmark from py_featurePool imp...
""" Tests for interaction with db for slogans """ import asyncio import asyncpg from asynctest import TestCase, ignore_loop from server.const import connection_url from server.slogan_manager import SloganManager from server.util import random_string class SloganManagerTest(TestCase): @classmethod def setUp...
from io import StringIO import unittest from ..processor import process_render class ProcessorTest(unittest.TestCase): maxDiff = None def test_basics(self): html = """ <head> <link href="style.css"> <style>body { }</style> <script>blah</script> </head> <body> <img src="fig.gif"> <img src="data:foo"> ...
# -*- coding: utf-8 -*- #!/usr/bin/python # Based on https://github.com/peterwalker78/twitterbot import tweepy import datetime import time from os import environ import pymongo # Twitter parameters try: consumer_key = environ['TWITTER_CONSUMER_KEY'] consumer_secret = environ['TWITTER_CONSUMER_SECRET'] ...
import sys sys.path.append('../src') from tiles import * from tile import * class Test(object): def __init__(self): self.board = "" def gen_board(self, tiles): segments = [] rows = [[0,1], [2,3,4,5], [6,7,8,9,10,11], [12,13,14,15,16...
# Copyright 2021 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
import pytest import networkx as nx from networkx.utils import pairwise def validate_path(G, s, t, soln_len, path): assert path[0] == s assert path[-1] == t if not G.is_multigraph(): computed = sum(G[u][v].get('weight', 1) for u, v in pairwise(path)) assert soln_len == computed else:...
"""RFC 6962 client API.""" import base64 import json import collections from ct.client.db import database from ct.crypto import verify from ct.proto import client_pb2 import gflags import httplib import httplib2 import logging import random import urllib import urlparse from twisted.internet import defer from twisted....
from flask import Flask from flask import render_template from flask import Response from flask import request import time import random import json import sys import play app = Flask(__name__) record = [] last_score = 0 @app.route("/") def display(): return render_template('index.html') @app.route("/move", methods...
#!/usr/bin/env python # Copyright 2015-2016 Yelp 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 ...
# # Copyright (C) 2013-2018 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
import yaml import os import logging import sys __author__ = 'johlyh' primary_config = 'libsolace.yaml', try: primary_config = os.environ['LIBSOLACE_CONFIG'] except Exception, e: pass __yamlfiles__ = [ "%s" % primary_config, '/etc/libsolace/libsolace.yaml', '/opt/libsolace/libsolace.yaml' ] __do...
from argparse import ArgumentParser from typing import Any from django.conf import settings from django.contrib.auth import get_backends from django.core.management.base import BaseCommand from django_auth_ldap.backend import LDAPBackend, _LDAPUser # Quick tool to test whether you're correctly authenticating to LDAP...
import player import random class Monster(player.Player): def __init__(self, game, location, name, description): player.Player.__init__(self, game, location) self.name = name self.description = description # print self.actions def get_input(self): # print "I am in...
import codecs import os from collections import OrderedDict import math import operator f = codecs.open("scores.csv","r") sports = {} for line in f: parts = line.strip().split(",") sports[parts[0]] = parts[1:] print(parts) print(sports) def get_sports_vec(): for k in sports.keys(): ...
#!/usr/bin/env python3 ################################################################################# # # # Copyright (c) 2016 Allen Majewski (altoidnerd) # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Softw...
import shutil import os import time import suffixtree def scan_kmer(read): global K offset, seq1, seq2 = read.split("\t") ret = [] for base in seq1: if base not in "ACGTN": return ret for base in seq2: if base not in "ACGTN": return ret for idx in range(len(seq1) - K + 1): ...
#!/usr/bin/python # -*- coding: UTF-8 # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. */ # Authors: # Michael Berg-Mohnicke <michael.berg@zalf.de> # # Maintainers: # C...
''' Created on Aug 21, 2014 @author: moloyc ''' import re import os import yaml import platform import datetime import shutil from netaddr import IPNetwork import netifaces from propLoader import propertyFileLocation TWO_STAGE_CONFIGURATOR_DEFAULT_ATTEMPT=5 TWO_STAGE_CONFIGURATOR_DEFAULT_INTERVAL=30 # in seconds TWO...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# -*- coding: utf-8 """ Functions to send email reminders to users. """ from django.core.mail import SMTPConnection, EmailMessage from django.contrib.auth.decorators import login_required from django.template import Context, loader from django.utils import translation from django.conf import settings from models impor...
#!/usr/bin/env python # test mail: chutter@uos.de import rospy import thread, threading import time import numpy as np from sensor_msgs.msg import Joy, LaserScan from geometry_msgs.msg import Twist, Vector3 from std_msgs.msg import String as StringMsg from simple_follower.msg import position as PositionMsg class la...
""" Google Cloud Messaging Previously known as C2DM Documentation is available on the Android Developer website: https://developer.android.com/google/gcm/index.html """ import json try: from urllib.request import Request, urlopen from urllib.parse import urlencode except ImportError: # Python 2 support from urlli...
# Lint as: python3 # Copyright 2018 The TensorFlow Authors. 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 ...
# Copyright (c) 2015-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. # # @nolint import unitte...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2014 The Plaso Project Authors. # Please see the AUTHORS file for details on individual authors. # # 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 L...
## INFO ######################################################################## ## ## ## COUBLET ## ## ======= ...
# Built-in modules # import os, time, inspect, getpass from collections import OrderedDict # Internal modules # from plumbing.common import split_thousands, camel_to_snake from plumbing.cache import property_cached # First party modules # from autopaths import Path from autopaths.file_path import FilePath ...
# -*- coding:utf-8 -*- # 转换系数 from __future__ import unicode_literals import sys, os pwd = sys.path[0] # 获取当前执行脚本的位置 os.path.abspath(os.path.join(pwd, os.pardir,'Data')) # -*- coding:utf-8 -*- ''' global variables ''' XLXS_FILE_PATH = os.path.abspath(os.path.join(pwd, os.pardir, 'Data', 'New_Industry.xlsx')) CO2_FI...
configs = {} configs['app_key'] = 'cbe36a100c9977c74c296a6777e920ec' configs['enviroment'] = 'development' configs['appid'] = '12353' configs['content'] = '【CQUT-CHAT】您的验证码是:' def save_config(key, value): configs[key] = value def get_config(key): return configs.get(key) username_invalid = { 'code': 1, 'ms...
# -*- coding:utf-8 -*- import uuid import time import datetime import json from flask import current_app from flask import abort from sqlalchemy import or_ from extensions import db from extensions import rd from models.ci import CI from models.ci_relation import CIRelation from models.ci_type import CITypeAttribu...
from django.contrib.auth.decorators import login_required from datetime import datetime from django.shortcuts import render, redirect from reports.forms import ReportChildrenPerMentorAndDestinationForm, ReportChildrenPerSchoolByDestinationAndShiftForm, \ ReportPaymentsByDateAndTypeForm, SumsByDestinationForm, \ ...
import json from datetime import datetime, timedelta from unittest import mock import actstream.actions from actstream.models import Follow from nose.tools import eq_, ok_, raises from rest_framework.test import APIClient from rest_framework.exceptions import APIException from taggit.models import Tag from kitsune.su...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
#!/usr/bin/python3 import threading, random, time, xmlrpc.client, sys #import network from nettools import netcontrol from log import logger import env ########################################## # NodeMgr # Description : manage the physical nodes # 1. list running nodes now # ...
""" Utility functions related to concat """ import numpy as np import pandas._libs.tslib as tslib from pandas import compat from pandas.core.dtypes.common import ( is_categorical_dtype, is_sparse, is_datetimetz, is_datetime64_dtype, is_timedelta64_dtype, is_period_dtype, is_object_dtype, ...
import smbus2 as smbus import time import math import RPi.GPIO """ ## License The MIT License (MIT) Copyright (c) 2016 Frederic Aguiard 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 re...
from __future__ import unicode_literals import datetime import operator try: from urllib.parse import urlencode except ImportError: # python 2 from urllib import urlencode from django.core.urlresolvers import reverse from django.db import models, transaction from django.db.models import Q from django.db.mod...
#!/usr/bin/python3.3 import unittest import sys sys.path.append("/home/hazel/Documents/new_linux_paradise/paradise_office_site/sandbox_v1.0/cygnet_maker/cy_data_validation") from datetime import datetime from date_time import DateTime class DateTimeTestCase(unittest.TestCase): ''' Tests with numbered degrees of bad...
#---------------------------------------------------------------------------------------- # Copyright, 2013: # # Stefano Ermon - Cornell University , ermonste@cs.cornell.edu # Ashish Sabharwal - IBM Watson Research Center , ashish.sabharwal@us.ibm.com #-----------------------------------------------------------...
# ============================================================================= # Authors: PAR Government # Organization: DARPA # # Copyright (c) 2016 PAR Government # All rights reserved. # # # adapted from https://github.com/enmasse/jpeg_read #==========================================================================...
from __future__ import division, print_function import glob import sys from os.path import join, split, abspath import os import importlib from unittest import SkipTest import inspect import textwrap import numpy as np class DelayImportError(ImportError, SkipTest): pass MESSAGES = dict() MESSAGES['mbuild'] = ...
import requests import yaml import json import logging import os import time import hashlib import httpagentparser import urllib2 from .config import get_shareabouts_config from django.shortcuts import render from django.conf import settings from django.core.cache import cache from django.core.mail import send_mail fro...
#!/usr/bin/env python # coding=utf-8 """ The manager """ import json import os import re from time import strptime, mktime import bottle from datetime import datetime from docker import Client from docker.errors import APIError from hostmanager import HOSTS_PATH from lib import FlashMsgPlugin, Hosts, group_container...
import json import pytest from dynaconf import LazySettings from dynaconf.loaders.json_loader import DynaconfEncoder from dynaconf.loaders.json_loader import load settings = LazySettings(environments=True, ENV_FOR_DYNACONF="PRODUCTION") JSON = """ { "a": "a,b", "default": { "password": "@int 99999...
#!/usr/bin/env python3 import json from .creatures import Player players_file_path = "./data/players.json" class PersistenceController(object): players = {} instance = None def __init__(self): PersistenceController.instance = self self.players = self.load_players() def is_registered(self, user): if str(us...
# vim: set fileencoding=utf-8 : # # (C) 2015 Jonathan Toppins <jtoppins@cumulusnetworks.com> # (C) 2016 Guido Günther <agx@sigxcpu.org> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; e...
"""Setup module for the healthcare_deid DLP pipeline. All of the code necessary to run the pipeline is packaged into a source distribution that is uploaded to the --staging_location specified on the command line. The source distribution is then installed on the workers before they start running. When remotely execut...
#!/usr/bin/env python3 ############################################################################### # Module Imports ############################################################################### import concurrent.futures import logging import peewee import queue from itertools import islice ###################...
# Copyright (C) 2016 Jamie Acosta, Jennifer Weand, Juan Soto, Mark Eby, Mark Smith, Andres Olivas # # This file is part of DssVisualizer. # # DssVisualizer is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, eit...
# Copyright 2018 GoDaddy # # 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 ...
import modeller class SalignData(object): """Data returned from the 'alignment.salign' method""" def __init__(self, aln_score, qscorepct): self.aln_score = aln_score self.qscorepct = qscorepct def _salign_fw_local_gaps1(aln, feature_weights, ogp, egp, matrix_offset): """Local alignment wi...
#-*- coding:utf-8 –*- import sqlite3,os,time,json class sql(object): """处理数据库的类""" def __init__(self): """获取数据库连接""" super(sql, self).__init__() db = 'monsters.db' self.conn = sqlite3.connect(db) print "Open",db,"Success" def __del__(self): """关闭数据库连接""" self.conn.close() def show_table(self, tab...
"""Tests the lets_do_dns.acme_dns_auth.authenticate.py module.""" from mock import call, ANY import pytest from lets_do_dns.environment import Environment from lets_do_dns.acme_dns_auth.authenticate import Authenticate def test_properly_initializes_resource(mocker): stub_environment = mocker.MagicMock( ...
""" Numba-specific errors and warnings. """ import abc import contextlib import os import sys import warnings import numba.core.config import numpy as np from collections import defaultdict from numba.core.utils import chain_exception from functools import wraps from abc import abstractmethod # Filled at the end __a...