src stringlengths 721 1.04M |
|---|
from mod_base import*
class AutoChanMode(Listener):
"""Automatically manage channel modes according to config."""
def init(self):
self.events = [
IRC_EVT_CHAN_USER_MODE_CHANGE,
IRC_EVT_CHAN_MODE_CHANGE,
]
self.all_modes = "... |
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from builtins import str as unicode
from quark_runtime import *
_lazyImport.plug("generics.ccc")
import quark.reflect
class TLSContextInitializer(_QObject):
def _in... |
#!/usr/bin/python
##############################################
###Python template
###Author: Elizabeth Lee
###Date: 6/18/14
###Function: Export zOR retrospective and early warning classifications into csv file format (SDI and ILINet, national and regional for SDI)
### Use nation-level peak-based retrospective classi... |
# -*- coding: utf-8 -*-
from __future__ import with_statement
import base64
import collections
import itertools
import json
import os
import re
import sys
import unidecode
import urllib2
from boto.ec2 import connect_to_region
from boto.exception import EC2ResponseError
import boto.ec2.autoscale
from fabric.api impor... |
"""Classes related to preparing members for the next calibration iteration
"""
import os
import numpy as np
import esutil
from ..catalog import Entry, Catalog
from ..galaxy import GalaxyCatalog
from ..utilities import read_members
from ..configuration import Configuration
class PrepMembers(object):
"""
Class ... |
import os
import sys
import shlex
import shutil
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
from setuptools.command.sdist import sdist as SDistCommand
from pip.req import parse_requirements
import container
class PlaybookAsTests(TestCommand):
user_options = ... |
#!/usr/bin/python3
import sys
import BaseHTTPServer
import cgi
import json
import threading
import urllib2
import time
from bs4 import BeautifulSoup
from pymongo import MongoClient
import datetime
reload(sys)
sys.setdefaultencoding('utf-8')
num_retry = 12
period = int(3600*12)
con = MongoClient... |
# This file is part of Fail2Ban.
#
# Fail2Ban 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 2 of the License, or
# (at your option) any later version.
#
# Fail2Ban is distributed in the hope t... |
# -*- 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):
# Deleting model 'Skills'
db.delete_table(u'tasks_skills')
# Adding model 'Skill'
db.create... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.golf.GolfGlobals
from direct.directnotify import DirectNotifyGlobal
import random
MAX_PLAYERS_PER_HOLE = 4
GOLF_BALL_RADIUS = 0.25
GOLF_BALL_VOLUME = 4.0 / 3.0 * 3.14159 * GOLF_BALL_RADIUS ** 3
GOLF_BALL_MASS = 0.5
GOLF_BALL_DENSITY = GOLF_BALL_... |
#------------------------------------------------------------------------------
# franca_parser: franca_ast.py
#
# AST node classes: AST node classes for Franca IDL (*.fidl).
# Builds an AST to be used in other tools.
#
# This code is *heavlily* inspired by 'pycparser' by Eli Bendersky
# (https://gi... |
'''
vidzi resolveurl plugin
Copyright (C) 2014 Eldorado
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, either version 3 of the License, or
(at your option) any later version.
This program is distri... |
# Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file.
from urllib.parse import quote
import requests
import json
import base64
import logging
import uuid
import datetime
# Used for debug logging
logger = logging.getLogger('clientcreds')
# Set to F... |
#
# Copyright 2015 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 as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in th... |
################################################################################
#
# _/_/_/_/_/ _/_/_/ _/ _/_/_/
# _/ _/ _/ _/_/ _/ _/
# _/ _/ _/ _/ _/ _/ _/
# _/ _/_/_/ _/_/_/_/ _/_/_/
# _/ _/ _/ _/ _/ _/
# ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
# TODO: put package requireme... |
#
# HMM emission related functions
#
from math import exp, log
#=============================================================================
def parsimony_ancestral_seq(tree, seqs, pos):
"""Calculates ancestral sequence for a local tree using parsimony"""
ancestral = {}
sets = {}
# do unweight pa... |
# -*- coding: utf-8 -*-
import os
from os import mkdir, rmdir, system, walk, stat as os_stat, listdir, readlink, makedirs, error as os_error, symlink, access, F_OK, R_OK, W_OK
from stat import S_IMODE
from re import compile
from enigma import eEnv
try:
from os import chmod
have_chmod = True
except:
have_chmod = Fal... |
"""
mflpf module. Contains the ModflowLpf class. Note that the user can access
the ModflowLpf class as `flopy.modflow.ModflowLpf`.
Additional information for this MODFLOW package can be found at the `Online
MODFLOW Guide
<http://water.usgs.gov/ogw/modflow/MODFLOW-2005-Guide/index.html?lpf.htm>`_.
"""
impo... |
import StringIO
import os
import datetime
import stat
from shutil import copyfile
from time import sleep
from smb.smb_constants import SMB_FILE_ATTRIBUTE_DIRECTORY
from smb.smb_structs import OperationFailure
from smb.SMBConnection import SMBConnection
from smbutils import list_shares, windowfy, split_smb_path
__au... |
from __future__ import absolute_import
from builtins import object
from math import *
from proteus import *
from proteus.default_p import *
try:
from .risingBubble import *
except:
from risingBubble import *
from proteus.mprans import PresInit
name = "pressureInitial"
#LevelModelType = PresInit.LevelModel
coef... |
# this file is only used for continuous evaluation test!
import os
import sys
sys.path.append(os.environ['ceroot'])
from kpi import CostKpi, DurationKpi, AccKpi
# NOTE kpi.py should shared in models in some way!!!!
train_cost_kpi = CostKpi('train_cost', 0.05, 0, actived=True)
train_duration_kpi = DurationKpi('train_... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# This file has been created by ARSF Data Analysis Node and
# is licensed under the MIT Licence. A copy of this
# licence is available to download with this file.
#
# Author: Robin Wilson
# Created: 2015-11-16
import sys
import numpy as np
# Python 2/3 imports
try:
... |
import os
import sys
import time
'''
@author: msune,cbermudo,omoya
@organization: i2CAT, OFELIA FP7
PolicyEngine Condition class
Encapsulates logic of a simple condition
'''
'''Supported operators'''
_collectionOperators= ["in"]
_logicalOperators = ["&&","||"]
_rangeOperators = ["[]","{}"]
_comparisonOp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_django-ai
------------
Tests for `django-ai` models module.
"""
import random
import numpy as np
from bayespy.nodes import Gaussian
from django.test import (TestCase, )
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions impor... |
# coding:utf-8
"""The domain-specific adapters.
An adapter is an object that provides domain-specific apis for another object,
called adaptee.
Examples are: XMLValidator and XMLPacker objects, which provide SciELO PS
validation behaviour and packaging functionality, respectively.
"""
from __future__ import unicode_li... |
import scrapy
import urlparse
from gradsearch.items import Professor
class PrincetonEESpider(scrapy.Spider):
name = "princeton_ee"
allowed_domains = ["princeton.edu"]
start_urls = ["http://ee.princeton.edu/people/faculty"]
def cleanup(self, sel):
return sel.xpath('normalize-space(text())').extract()
def parse... |
from setuptools import setup
from setuptools.extension import Extension
try:
from Cython.Distutils import build_ext
from Cython.Build import cythonize
except ImportError:
use_cython = False
else:
use_cython = True
cmdclass = { }
ext_modules = [ ]
if use_cython:
ext_modules += [
#Extension... |
import json
from time import sleep
from unittest import TestCase
from cassandra.cluster import Cluster
from flask import Flask, session
from cassandra_flask_sessions import CassandraSessionInterface, AbstractConnectionProvider
class ConnectionProvider(AbstractConnectionProvider):
_connection = Cluster(['127.0.... |
from . import upload
from werkzeug.security import safe_join
from werkzeug import secure_filename
from flask import request, jsonify, url_for, current_app, abort, send_from_directory
import hashlib
from datetime import datetime
# for CKEDITOR
@upload.route('/upload_image', methods=['POST'])
def upload_image():
... |
#!/usr/bin/python
#--------------------------------------
# ___ ___ _ ____
# / _ \/ _ \(_) __/__ __ __
# / , _/ ___/ /\ \/ _ \/ // /
# /_/|_/_/ /_/___/ .__/\_, /
# /_/ /___/
#
# Stepper Motor Test
#
# A simple script to control
# a stepper motor.
#
# Author : Matt Hawkins
... |
# This file is part of snowboard.
#
# snowboard 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.
#
# snowboard is distributed in the hop... |
#!/usr/bin/env python3
'''
Build Daemon for the Neutron compilation process.
Designed to run on Debian (Linux) enviroments; this will fail on other OSes.
Copyright Alex Potter 2015.
'''
import sys
import subprocess
import time
import datetime
import os
import sqlite3
import threading
import re
import itertools
impor... |
import dryscrape, re, sys
from bs4 import BeautifulSoup
class EmailCrawler:
"""
Takes a domain name and prints out a list of email addresses found on that web page
or a lower level web page with the same given domain name.
Stores emails, paths, and visited_paths as sets to avoid duplicates.
Uses Dr... |
# -*- coding: utf-8 -*-
"""
Calendaring Page Views
"""
import sys
import os
import uuid
import logging
from datetime import date, datetime, timedelta
from webapp2 import uri_for
from google.appengine.api import users
import app.config as config
from app.base_view import RequestHandler
from app.decorators import cach... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
from __future__ import absolute_import
from __future__ import with_statement
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
'''
2D spatial power spectral density
'''
def psd2d(data,spacing = 0.4):
'''
2D po... |
###############################################################################
# Copyright (C) 2009, 2010, 2011, 2012 by Kapil Arya, Gene Cooperman, #
# Tyler Denniston, and Ana-Maria Visan #
# {kapil,gene,tyler,amvisan}@ccs.neu.edu #
... |
from unittest.mock import MagicMock, patch
import pytest
from UM.Math.Color import Color
from UM.Math.Matrix import Matrix
from UM.Mesh.MeshBuilder import MeshBuilder
from UM.Mesh.MeshData import MeshData
from UM.View.RenderBatch import RenderBatch
test_addItem_data = [
{"item": {"transformation": Matrix(), "me... |
import math
from math import radians
import random
from random import randint
import ast
import bmesh
import mathutils
from mathutils import Vector, Euler
"""
lifted from: http://www.4dsolutions.net/ocn/lsystems.html
"""
class Lturtle:
import mathutils
from mathutils import Vector, Euler
Xvec = Vector... |
from collections import defaultdict
import datetime
import logging
import operator
import random
from django.contrib.auth import get_user_model
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound
from django.utils.timezone import utc
from django.views.generic import CreateView, DetailView
... |
# Copyright 2007 Google Inc.
#
# 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; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the ho... |
#
# Copyright 2015-2016 IBM 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 wr... |
import prairielearn as pl
import lxml.html
from html import escape
import chevron
import sympy
import random
import math
import python_helper_sympy as phs
def get_variables_list(variables_string):
if variables_string is not None:
variables_list = [variable.strip() for variable in variables_string.split(',... |
import os
import sys
config = {
"platform": "win32",
"stage_product": "firefox",
"update_platform": "WINNT_x86-msvc",
"mozconfig": "%(branch)s/browser/config/mozconfigs/win32/l10n-mozconfig",
"bootstrap_env": {
"MOZ_OBJDIR": "obj-l10n",
"EN_US_BINARY_URL": "%(en_us_binary_url)s",
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2016-2019 Matt Hostetter.
#
# This 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, or (at your option)
# any later version.
#
# Thi... |
from database import db
from flask import abort, make_response, Response
from flask.ext.login import current_user
from flask.ext.cache import Cache
from functools import wraps
class CommonErrors:
BAD_REQUEST = ({'error': 'Bad request.'}, 400)
INVALID_ID = ({'error': 'Invalid id.'}, 404)
NO_ACCESS = ({'error': 'Ins... |
import os
import csv
import json
import pymongo
from kagen import utils
from kagen.utils import config
from datetime import datetime
logger = utils.get_logger("youtube")
def work():
dtf = "%Y-%m-%dT%H:%M:%S.%fZ"
yt_key = config["keys"]["youtube_key"]
yt_user = config["run"]["youtube_user"]
youtube =... |
#!/usr/bin/env python
import sys,image
from subprocess import call
if len(sys.argv) < 2:
print "Specify a maskfile."
sys.exit()
maskfile = sys.argv[-1]
spacing = 2
size = 399
maskimagefile = sys.argv[-1][:-4]+'.mhd'
spacingstr = str(spacing)
sizeinvox = str(size/spacing)
call(["rtkdrawgeometricphantom","--phantom... |
import unittest
import time
import zephyr
from zephyr import hxm
from zephyr.message import HxMMessage
class MonotonicSequenceModuloCorrectionTest(unittest.TestCase):
def test_simple_case(self):
correction = hxm.MonotonicSequenceModuloCorrection(10.0)
self.assertEqual(correction.process(... |
# -*- coding: utf-8 -*-
class NavigationType(object):
UKNOWN = 0
PLAYLIST = 1
ALBUM = 2
ARTIST = 3
SEARCH = 4
class NavigationCommand(object):
def __init__(self, uri, tracks=[], playlist=None, html=""):
self.__uri = uri
self.__playlist = playlist
self.__html = html
... |
"""myblog URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... |
from dataactcore.models.stagingModels import Appropriation
from dataactcore.models.domainModels import SF133
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns
_FILE = 'a8_appropriations'
_TAS = 'a8_appropriations_tas'
def test_column_headers(database):
expected_subset = {'uniqueid_TA... |
# -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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, either version 3 of the License, or
(at your option) any l... |
from __future__ import unicode_literals
from .accounts import Account
from .accounts.financial import AccountDetailsFinancial
from .accounts.gaap import AccountDetailsGAAP
from .accounts.ifrs import AccountDetailsIFRS
from .accounts.insurance import AccountDetailsInsurance
from .accounts.statutory import AccountDetail... |
# We can test part of the module without zlib.
try:
import zlib
except ImportError:
zlib = None
import io
import os
import sys
import imp
import time
import shutil
import struct
import zipfile
import unittest
from tempfile import TemporaryFile
from random import randint, random
from unittest import skipUnles... |
import unittest
from dateobjects import Date, Year, DayDelta, MonthDelta, YearDelta
class TestDayDeltaDate(unittest.TestCase):
def test_DayDelta_add_Date(self):
self.assertEqual(Date(1, 1, 10), DayDelta(9) + Date(1, 1, 1))
def test_Date_add_DayDelta(self):
self.assertEqual(Date(1, 1, 10), ... |
import numpy as np
class Perceptron(object):
"""Perceptron classifier.
Parameters
------------
eta : float
Learning rate (between 0.0 and 1.0)
n_iter : int
Passes over the training dataset.
Attributes
-----------
w_ : 1d-array
Weig... |
"""Unit test"""
import unittest
import re
import io
from datetime import datetime, timedelta
from flask import request, session
from . import ctx
from .zenmai_test_utils import create_issue, create_comment, create_attached_file, create_user, \
login, logout, delete_all_issues
from web.m... |
from Sire.Mol import *
from Sire.IO import *
from Sire.Vol import *
from Sire.FF import *
from Sire.MM import *
from Sire.CAS import *
from Sire.Maths import *
from Sire.Qt import *
from Sire.Units import *
from Sire.System import *
from Sire.Move import *
from Sire.Stream import *
import sys
mols = PDB().read("test... |
class GellishDict(dict):
''' A dictionary for names in a context that refer to the denoted concepts.
The roles of the names are indicated by alias relation_type_UIDs, such as for <is a code for>:
key = name_in_context(tuple) = (languageUID, communityUID, name).
value = value_triple = (UID... |
"""
SSL Middleware
Stephen Zabel
This middleware answers the problem of redirecting to (and from) a SSL secured path
by stating what paths should be secured in urls.py file. To secure a path, add the
additional view_kwarg 'SSL':True to the view_kwargs.
For example
urlpatterns = patterns('some_site.some_app.views',
... |
#===============================================================================
# obus-python - obus client python module.
#
# @file protocol.py
#
# @brief obus python looper
#
# @author yves-marie.morgan@parrot.com
#
# Copyright (c) 2013 Parrot S.A.
# All rights reserved.
#
# Redistribution and use in source and bina... |
# -*- coding: utf-8 -*-
from __future__ import division
# Copyright (C) 2012 Matthew Hampton
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at ... |
# encoding: 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 'Key.net'
db.add_column('key_key', 'net', self.gf('django.db.models.fields.BooleanField')(d... |
"""empty message
Revision ID: f7f3dbae07bb
Revises: 1e4e2ceb943c
Create Date: 2019-06-05 17:52:42.855915
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'f7f3dbae07bb'
down_revision = '1e4e2ceb943c'
branch_labels = None
depe... |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2009 Luca Beltrame <einar@heavensinferno.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, under
# version 2 of the License, or (at your option) any later version.
#
# ... |
# coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import si... |
#!/usr/bin/env python
import codecs
import os
import sys
import geoip2
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
packages = ['geoip2']
requirements = [i.strip() for i in ... |
from dpconverge.data_set import DataSet
from dpconverge.data_collection import DataCollection
import sys
import numpy as np
import flowio
import flowutils
fcs_files = [
sys.argv[1],
sys.argv[2]
]
spill_text = """4, Blue B-A, Blue A-A, Red C-A, Green E-A,
1, 6.751e-3, 0, 2.807e-3,
0, 1, 0.03, 0,
0, 5.559e-3, 1... |
"""The description for an FMOD Studio Event."""
from ctypes import byref, c_int, c_void_p, create_string_buffer
from .event_instance import EventInstance
from .studio_object import StudioObject
from .enums import LOADING_STATE
class EventDescription(StudioObject):
"""The description for an FMOD Studio Event.
... |
#
# This file is part of Plinth.
#
# This program 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
# License, or (at your option) any later version.
#
# This program is distribute... |
#!/usr/bin/python
# Copyright (C) 2016 Google 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
from __future__ import divisi... |
import pytest
@pytest.fixture
def target(testapp, organism):
item = {
'label': 'ATF4',
'target_organism': organism['@id'],
'investigated_as': ['transcription factor'],
}
return testapp.post_json('/target', item).json['@graph'][0]
@pytest.fixture
def base_target(testapp, organism)... |
# 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 ... |
# -*- coding: utf-8 -*-
import wx
from ..common.path import resource_filename
from .translator import Translator
from ..common.i18n import N_
class BaseView(Translator):
"""Base class for all views.
This class come with helper functions to configure the view.
Class Attributes:
LIGHT_GRAY (wx.C... |
'''brainfuck interpreter adapted from (public domain) code at
http://brainfuck.sourceforge.net/brain.py'''
import re
import random
from util import hook
BUFFER_SIZE = 5000
MAX_STEPS = 1000000
@hook.command
def bf(inp):
".bf <prog> -- executes brainfuck program <prog>"""
program = re.sub('[^][<>+-.,]', ''... |
import os, sys, traceback
import maya.cmds as cmds
from functools import partial
#Needs refactoring
from ..utils.funcs import selection
from DTL.api import Safe
"""
#------------------------------------------------------------
def buildChannelMatrixFromUI():
'''Helper Function to build the channel matrix from th... |
# Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... |
#!/usr/bin/env python
import rospy
from Queue import Queue, Empty
from strands_executive_msgs.msg import Task
from task_executor.base_executor import BaseTaskExecutor
from task_executor.sm_base_executor import AbstractTaskExecutor
class FIFOTaskExecutor(AbstractTaskExecutor):
def __init__(self):
# init n... |
import unittest, time, sys
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
localhost = h2o.decide_if_localhost()
if (localhost):
... |
# -*- coding: utf-8 -*-
# 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, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that... |
# Copyright (c) 2012 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.
'''Support for formatting an RC file for compilation.
'''
from __future__ import print_function
import os
import re
from functools import partial
impo... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-10 13:14
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('testapp', '0004_book_view_book_permission'),
]
ope... |
# coding: utf-8
# Copyright (C) 2016 Bruno Abude Cardoso
#
# Imagem Cinemática 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.
#
# Imag... |
# -*- coding: utf-8 -*-
import os
import time
from datetime import datetime
import click
import pythoncom
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.alert import Alert
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.w... |
# Copyright (c) 2006 Seo Sanghyeon
# This code is derived from PyPy's implementation of array module.
# The main change is the use of .NET array as storage instead of Python list.
# 2006-11-11 sanxiyn Bare minimum to run pycrypto's randpool
# 2006-11-26 sanxiyn Added fromlist, fromstring, tolist, tostring
# ... |
import ccookie
import os
import hashlib
import sys
from time import sleep
import datetime
from Crypto.Cipher import AES
from Crypto.Random import random
from Crypto import Random
from random import SystemRandom
import string
os.environ['SERVER_NAME']='Test Server Name'
os.environ['REMOTE_ADDR']='255.255.255.255'
print... |
# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
__metaclass__ = type
from lp.registry.interfaces.person import PersonVisibility
from lp.services.mail.notificationrecipientset import NotificationRecipientSet
from lp.testing... |
import tables as pt
import numpy as np
import loopy as lpy
import shutil as sh # move
import os.path as pth # exists
def readhdf5(fname, path='/'):
"""
.. py:function:: writehdf5(fname, path='/')
The function traverse HDF5 files and creates structured dictionary.
:param fname: File name to read.
... |
#Script to rum Hmmer on Dicty Protiens
#Run it keeping in mind that HMM(s) from a particular DPM human holmolog protien are all checked against every Protien from Dicty
#Author : prakhar gaur
#date : Wed 16 July IST 2015
import os
import argparse
import csv
parser = argparse.ArgumentParser()
parser.add_argument('-C',... |
#!/usr/local/bin/python
"""
SORTING ALGORITHMS
+ Bubble Sort
+ Selection Sort
This program will test *num* entries as an unsorted array, and sort them as well
as log the time taken to understand the performances of varous sorting algorithms.
"""
#******************************************************************... |
"""
PyStratum
"""
import configparser
from pydoc import locate
from cleo import Command, Input, Output
from pystratum.RoutineLoader import RoutineLoader
from pystratum.style.PyStratumStyle import PyStratumStyle
class LoaderCommand(Command):
"""
Command for loading stored routines into a MySQL/MsSQL/PgSQL in... |
"""
Created on May 20, 2014
@author: StarlitGhost
"""
import re
from twisted.plugin import IPlugin
from zope.interface import implementer
from desertbot.message import IRCMessage
from desertbot.moduleinterface import IModule
from desertbot.modules.commandinterface import BotCommand
from desertbot.response import IRC... |
#! /usr/bin/env python3
# -*- coding:Utf8 -*-
#--------------------------------------------------------------------------------------------------------------
# All necessary import:
#--------------------------------------------------------------------------------------------------------------
import os, sys, glob
#fr... |
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
import collections
import operator
from django.db import transaction
from django.db.models import F, Q
from django.utils.six.moves import reduce
from django.utils.text import camel_case_to_spaces, capfirst
from yepes.contrib.datamigrations.exceptions im... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from setuptools import setup
def get_pkg_from_git_url(link):
"""
Given a pip-compatible git-requirement, output a setup.py-compatible
install requirement.
'git+https://github.com/user/pkg.git@branch' ->
'pkg'
"""
try:
... |
from sympy.parsing.maxima import parse_maxima
from sympy import Rational, Abs, Symbol, sin, cos, E, oo, log, factorial
from sympy.abc import x
n = Symbol('n', integer=True)
def test_parser():
assert Abs(parse_maxima('float(1/3)') - 0.333333333) < 10**(-5)
assert parse_maxima('13^26') == 917333301932686166583... |
# This file is part of Scapy
# Copyright (C) 2007, 2008, 2009 Arnaud Ebalard
# 2015, 2016, 2017 Maxence Tury
# This program is published under a GPLv2 license
"""
TLS cipher suites.
A comprehensive list of specified cipher suites can be consulted at:
https://www.iana.org/assignments/tls-parameters/tls-p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.