text stringlengths 17 737k |
|---|
from ..base import StoredMessagesBackend
from ..exceptions import MessageTypeNotSupported, MessageDoesNotExist
from ...models import Inbox, Message, MessageArchive
from django.db import models
from django.contrib.contenttypes.models import ContentType
class DefaultBackend(StoredMessagesBackend):
"""
"""
d... |
"""SConsProject
The SConsProject module proposes a way to easily create the compilation system
of your project with the minimum of information. It's an helper around SCons.
"""
from SCons.Environment import *
from SCons.Script import *
import sys
from time import *
import atexit
import os
import socket
import strin... |
"""
Copyright 2011 Ryan Fobel
This file is part of dmf_control_board.
dmf_control_board 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.
dm... |
from binaryninja.architecture import Architecture
from binaryninja.lowlevelil import LowLevelILLabel, LLIL_TEMP, LowLevelILInstruction
from binaryninja.function import RegisterInfo, InstructionInfo, InstructionTextToken
from binaryninja.binaryview import BinaryView
from binaryninja.types import Symbol
from binaryninja.... |
import numpy as np
import cv2
import os
try:
IMREAD_UNCHANGED = cv2.CV_LOAD_IMAGE_UNCHANGED
except AttributeError:
IMREAD_UNCHANGED = cv2.IMREAD_UNCHANGED
def init_cityscapes(cityscapes_root):
'''
Append the right paths to the sys paths in order to use the provided cityscapes scripts.
- `cityscap... |
#
# Copyright (c) 2004 Specifix, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/li... |
#!/usr/bin/python
# coding: utf-8
# Copyright (c) 2013 Mountainstorm
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use,... |
# Class Client shamelessly copied from
# http://arstechnica.com/open-source/guides/2010/04/tutorial-use-twitters-new-real-time-stream-api-in-python.ars/2
import pycurl
import os,sys
#import simplejson as json
from optparse import OptionParser
import time
from datetime import datetime
import os
import gzip
import threa... |
from sfa.util.xrn import get_authority, urn_to_hrn
from sfa.util.sfalogging import logger
MAXINT = 2L**31-1
class SlabSlices:
rspec_to_slice_tag = {'max_rate':'net_max_rate'}
def __init__(self, driver):
self.driver = driver
def get_peer(self, xrn):
hrn, hrn_type ... |
import os
import paramiko
import scp
from dcos import http
import shakedown
def get_transport(host, username, key):
""" Create a transport object
:param host: the hostname to connect to
:type host: str
:param username: SSH username
:type username: str
:param key: key obj... |
# ------------------------------------------------------------
# MC911 - Compiler construction laboratory.
# IC - UNICAMP
#
# RA094139 - Marcelo Mingatos de Toledo
# RA093175 - Victor Fernando Pompeo Barbosa
#
# lyaparser.py
# Parser and AST builder for the Lya scripting language.
#
# ----------------------------------... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import csvkit
import os
import sys
import sqlite3
import datetime
import urllib, json
import time
import requests
import sqlite3
import yaml
# Load the config file.
config = yaml.safe_load(open('config.yml'))
if os.path.isfile(config['data_file']) is False:
print confi... |
"""
The aim of this script is to visualize the data stored in the SQLite db from sims
The questions that this script should answer are:
1- list existing fields in the DB
2- list unique values in each field
3- count how many trials exist per triplet (duration, h, SNR)
4- for fixed triplet, compute the average differenc... |
# Utils.py
# Some tools.
from django.http import HttpResponse
from django.conf import settings
from django import http
from webengine.utils.exceptions import *
class _CheckRenderMode(object):
"""
Callable object that will act like a decorator.
Wraps calls to view methods.
Determine which ... |
#!/usr/bin/env python3
import pickle
import sys
import os
import zipfile
from optparse import OptionParser
import testcommon
import time
#Prevent user settings or plugins from impacting unit tests
os.environ["BN_DISABLE_USER_PLUGINS"] = "True"
os.environ["BN_DISABLE_USER_SETTINGS"] = "True"
os.environ["BN_DISABLE_REPO... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Automated Certificate Manager using ACME
# Copyright (c) Markus Hauschild, 2016.
import acme_tiny
import datetime
import dateutil.parser
import dateutil.relativedelta
import os
import re
import shutil
import subprocess
import tempfile
import yaml
ACME_DIR="/etc/acme/... |
# -*- coding: utf-8 -*-
import argparse
import logging
import os
import subprocess
from string import Template
from utils.artifact import Artifact
import sqlite3
from feature_selection.feature_selection import slugify
LOG = logging.getLogger(__name__)
SPATIAL_SQL = '''
UPDATE 'points' SET geom=GeomFromGPB(geom);
UP... |
#!/usr/bin/python
# (C) Copyright 2016-2017 IBM Corp.
#
# 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 ... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns(
'',
url(r'^$', 'lists.views.home_page', name='home'),
# url(r'^blog/', include('blog.urls')),
# url(r'^admin/', include(admin.site.urls)),
)
|
# -*- encoding: utf-8
"""
Editor class for extending viewer with text editing features.
"""
import re
from . import helpers
from .line import Line
from .cursor import Cursor
from .viewer import Viewer
class State:
"""Store editor state for undo/redo."""
def __init__(self, editor=None):
self.cursors... |
#
# 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 WITHOUT ANY WARRANTY; without even the implied warranty of
#... |
'''
Created on Feb 10, 2015
@author: David Zwicker <dzwicker@seas.harvard.edu>
This module contains math functions
'''
from __future__ import division
from collections import Counter
import fractions
import math
import numpy as np
from scipy import interpolate
from scipy.stats import itemfreq
from ..misc import e... |
"""
Django-AlphaFilter provides an admin widget for alphabetical filtering that
works like date_hierarchy and an template tag for use elsewhere.
"""
__version_info__ = {
'major': 0,
'minor': 8,
'micro': 0,
'releaselevel': 'final',
'serial': 0
}
def get_version():
"""
Return the formatted ... |
# Copyright (c) 2022, Djaodjin Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... |
import psycopg2
import sys
from connect import connect_to_db
# add new date, temp, cycle day, LH test from arguments in command line
# filename counts as first arg
args = sys.argv
date = args[1]
temp = args[2]
cd = args[3]
lh = args[4]
# adding items to data
data = (date, temp, cd, lh)
# connect to database
conn = ... |
"""
===============================================
message - Message handling for the Pushover API
===============================================
This module defines functions and classes used for handling messages sent to the Pushover servers. Messages can be sent
using either the MessageManager class or calling t... |
"""
Provides several classes that define the selection function in different ways.
All selection function classes are derived from the :class:`~Selection` abstract base class.
This should not be instantiated directly, but provides the structure for its subclasses. Namely,
each subclass should provide a single method, ... |
import eventlet.hubs.hub
import greenlet
import logging
import signal
import sys
socket = eventlet.patcher.original('socket')
threading = eventlet.patcher.original('threading')
logger = logging.getLogger('aiogreen')
try:
import asyncio
if sys.platform == 'win32':
from asyncio.windows_utils import soc... |
# -*- test-case-name: vumi.persist.tests.test_txriak_manager -*-
"""A manager implementation on top of txriak."""
from riakasaurus.riak import RiakClient, RiakObject, RiakMapReduce, RiakLink
import riakasaurus
from twisted.internet.defer import (
inlineCallbacks, gatherResults, maybeDeferred, succeed)
from distu... |
""" module with high-level functions to help
perform complex tasks
"""
from __future__ import print_function, division
import os
import multiprocessing as mp
import subprocess as sp
import platform
import time
import warnings
import struct
import socket
import shutil
import copy
import numpy as np
import pandas as pd
... |
"""
pointcloud
Read in and store point clouds.
"""
import numpy as np
from laspy.file import File
from laspy.header import Header, VLR
from collections import namedtuple
from .exceptions import EmptyPointCloud
_HEADER_DEFAULT = {'data_format_id': 3,
'x_scale': 2.5e-4,
'y_scale':... |
# 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, software
# distributed under the Li... |
#!/usr/bin/env python
# ftpserver.py
#
# pyftpdlib is released under the MIT license, reproduced below:
# ======================================================================
# Copyright (C) 2007 Giampaolo Rodola' <g.rodola@gmail.com>
#
# All Rights Reserved
#
# Permission to use, copy, mo... |
#!/usr/bin/python
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2007 Alex Holkner
# All rights reserved.
#
# Redistribution and use in _al_source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are ... |
from django.db import models
from django.utils import timezone
from core.models.application import Application
from core.models.instance import Instance
from core.models.user import AtmosphereUser
from core.models.volume import Volume
from threepio import logger
class Project(models.Model):
"""
A Project is... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
"""
py3compat, based on jinja2._compat
~~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: Copyright 2013 by ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import argparse
import codecs
from collections import OrderedDict, namedtuple, deque
import csv
import datetime
import gc
from math import sqrt
import os
import random
import platform
import subprocess
import sys
from threading import Thread
from time impo... |
from Tkinter import *
class InstallerAPI(object):
def check_version(self):
pass
def get_items(self):
return [
{'id': 1, 'name': "Item 1", 'installed': True},
{'id': 2, 'name': "Item 2", 'installed': False},
{'id': 3, 'name': "Item 3", 'installed': False}
... |
#!/usr/bin/python
# mhite@hotmail.com
# 9/12/2015
import argparse
import collections
import datetime
import logging
import math
import os
import plistlib
import sqlite3
import time
import urllib
__VERSION__ = '1.0.1'
DEFAULT_SQLITE = os.path.expanduser('~/Library/Application Support/Swinsian/Library.sqlite')
DEFAULT... |
# -- coding: utf-8 --
# Copyright 2018 Olivier Scholder <o.scholder@gmail.com>
from __future__ import absolute_import
from . import Block
import numpy as np
import struct
import os.path
import zlib
import re
import os
from .utils.misc import deprecated, aliased, alias, PB
from warnings import warn
class InvalidRAWda... |
# Author: Michele Mattioni
# Mon Jan 26 05:54:30 GMT 2009
import math
from neuron import h, nrn
import ecellControl as eC
from synapse import Synapse
class Spine():
"""
Class spine. Create a spine with head neck and psd
"""
def __init__(self, id,
filename_bioch_mod="../bioche... |
# 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, software
# d... |
# coding: utf-8
'''
support library to write SQLite FTS3 tokenizer
'''
from __future__ import print_function, unicode_literals
import sys
import struct
import warnings
from .tokenizer import (ffi, dll, get_db_from_connection, SQLITE_OK,
SQLITE_DONE)
from .error import Error
SQLITE_DBCONFIG_ENA... |
"""
SQLObject
---------
:author: Ian Bicking <ianb@colorstudy.com>
SQLObject is a object-relational mapper. See SQLObject.html or
SQLObject.txt for more.
Modified by:
* Daniel Savard, Xsoli Inc <sqlobject xsoli.com> 7 Feb 2004
Added support for simple table inheritance.
* Oleg Broytmann, SIA "ANK" <phd@phd.pp.r... |
# -*- coding: utf-8 -*-
########################################################################
#
# License: BSD
# Created: 2005-05-24
# Author: Ivan Vilata i Balaguer - ivan@selidor.net
#
# $Id$
#
########################################################################
"""Utilities for PyTables' test suites."""
fr... |
import daemon
import datetime
import feedparser
import logging
import os
import time
import re
import urllib
import settings
from middleware.mii_sql import FeedDownloaded, get_serie_episode, get_serie_season, db
from sorter.sorter import is_serie
logging.basicConfig(filename='example.log', level=logging.DEBUG)
def ... |
"""Python wrapper for GTA Orange's vehicle functions
Subscribable built-in events:
+===============+=========================+====================================+
| name | vehicle-local arguments | global arguments |
+===============+=========================+===============================... |
import chess
import sys
import copy
def minimax(board, move, depth, isMax):
if depth > 0:
if isMax:
best_value, best_move = (sys.maxsize*-1,None)
else:
best_value, best_move = (sys.maxsize,None)
for legal_move in board.legal_moves:
board_cpy = copy.deepco... |
'''
Created on Jul 19, 2013
@author: Nathan Schneider (nschneid)
'''
from __future__ import print_function, division, absolute_import
import sys, os, re, fileinput, codecs, json
from collections import defaultdict, Counter
from heapq import heappush, heappop
import morph
_lexicons = {}
def load_lexicons(lexfiles):
... |
import os
import re
import sys
import time
import urllib.error
import urllib.parse
import urllib.request
from datetime import datetime
from functools import wraps
from platform import python_version
from twisted.internet import task
from syncplay import utils, constants, version, revision, release_number
from syncpl... |
# -*- coding: utf-8 -*-
import sys, os, random
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import matplotlib
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar
from matplotlib.figure impor... |
#PyjsArray - Copyright (C) 2013 James Garnon
#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... |
"""
vim mock object for easier testing of vim plugins written in Python.
"""
import sys
from vimmock.mocked import VimMock
VERSION = (0, 1, 1)
__all__ = ['VimMock']
__version__ = '.'.join((str(each) for each in VERSION[:4]))
def get_version():
"""
Returns shorter version (digit parts only) as string.
""... |
import fcntl
import os
import re
import socket
import struct
import ctypes
import array
import math
"""
This file makes the following assumptions about data structures:
struct ifreq
{
union
{
char ifrn_name[16];
} ifr_ifrn;
union {
struct sockaddr ifru_addr;
struct so... |
from datetime import datetime
from angular_flask.core import db
from angular_flask import app
class Post(db.Model):
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(80))
body = db.Column(db.Text)
pub_date = db.Column(db.DateTime)
def __init__(self, title, body, pub_date=N... |
# -*- coding: utf-8 -*-
import re
from anima import logger
from anima.ui.base import AnimaDialogBase, ui_caller
from anima.ui.lib import QtCore, QtWidgets
MULTI_VALUE_ENUM = "---Multiple_Values---"
def UI(app_in=None, executor=None, **kwargs):
"""
:param app_in: A Qt Application instance, which you can pa... |
import numpy as np
import itertools
from collections import namedtuple, Iterable
try:
from itaps import iMesh, iBase, iMeshExtensions
except ImportError:
raise ImportError("The mesh module requires imports of iMesh, iBase, and"
" iMeshExtensions from PyTAPS")
# dictionary of lamba functions for mesh... |
# -*- coding: utf-8 -*-
import platform
name = "Fourth Evaz"
version = (0, 2, 3)
source = "https://github.com/shacknetisp/fourthevaz"
def gitstr():
"""
Get the git master commit ID.
If not in a git repository, return an empty str.
"""
try:
return "%s" % (open('.git/refs/heads/master').read... |
import scikits.audiolab as alab
import numpy as np
import Nsound as ns
import os
class Soundwrite:
""" Prepare a file stream (self.out) for writing.
(Just a handler class for the Audiolab classes.) """
def __init__(self, rate, chans=1, fmt="wav", enc="pcm24", name="sound"):
self.__update(rate, chans, fm... |
#
# This file is part of pySMT.
#
# Copyright 2014 Andrea Micheli and Marco Gario
#
# 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 core.model.direction import Direction
from gi.repository import Gtk
from gi.overrides import Gdk
from core.model.commands.engine import SetState
from core.model.game_state import GameState
import os
class MainWindowController(object):
def __init__(self, game_engine, data_dir, current_theme="classic"):
... |
import logging
import virtool.gen
import virtool.utils
logger = logging.getLogger(__name__)
class Collection:
"""
A proxy for a MongoDB collection. Provides asynchronous access to the collection and dispatches all changes to
listening clients. Used as a base class to construct proxies for each Mongo co... |
from __future__ import print_function # Python 2 and 3 print compatibility
import warnings
from decorator import decorator
from hail.expr import Type, TGenotype, TString, TVariant
from hail.typecheck import *
from hail.java import *
from hail.keytable import KeyTable
from hail.representation import Interval, Pedigr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# __init__.py
"""
A module to simulate optical transfer functions and point spread functions
If this file is run as a script (python -m pyotf.otf) it will compare
the HanserPSF to the SheppardPSF in a plot.
https://en.wikipedia.org/wiki/Optical_transfer_function
https://e... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
from spambl import (UnknownCodeError, NXDOMAIN, HpHosts,
GoogleSafeBrowsing, UnathorizedAPIKeyError, HostCollection,
SimpleClassificationCodeResolver, SumClassificationCodeResolver, Hostname, IpAddress,
... |
#!/usr/bin/python
"""
Jutda Helpdesk - A Django powered ticket tracker for small enterprise.
(c) Copyright 2008 Jutda. All Rights Reserved. See LICENSE for details.
scripts/get_email.py - Designed to be run from cron, this script checks the
POP and IMAP boxes defined for the queues within a
... |
import sys
import os
import errno
import warnings
import inspect
import re
import collections
import weakref
import copy
def Initial(*args):
"""Declare an initial condition (see Model.initial)."""
return SelfExporter.default_model.initial(*args)
def MatchOnce(pattern):
"""Make a ComplexPattern match-once... |
"""
An event in the scheduler component that will call the service
when the sun rises or sets with an offset.
The sun evnt need to have the type 'sun', which service to call,
which event (sunset or sunrise) and the offset.
{
"type": "sun",
"service": "switch.turn_on",
"event": "sunset",
"offset": "-01:... |
# -*- coding: utf-8 -*-
import logging
from datetime import datetime
from .base import View
from pyramid.httpexceptions import HTTPFound
from pyramid.url import route_url
from pyramid.settings import asbool
from pyvac.models import Request, VacationType, User
# from pyvac.helpers.i18n import trans as _
from pyvac.he... |
#!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Exercise the wallet. Ported from wallet.sh.
# Does the following:
# a) creates 3 nodes, with an empty... |
import unittest
from Decode import Decoder
import Frames
class TestDecoder(unittest.TestCase):
"""
"""
def setUp(self):
self.decoder = Decoder()
def test_decoder_get_frame_class(self):
command = 'SEND'
self.assertEquals(self.decoder.get_frame_class(command), Frames.SEND)
d... |
# Import the base Widget class and the traitlets Unicode class.
from IPython.html.widgets.widget import Widget, DOMWidget
from IPython.utils.traitlets import (Unicode, Int, Instance, Enum, List, Float,
Any, CFloat, Bool, This, CInt, TraitType)
import numpy
import math
def vector3(... |
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.utils import timezone
import json
import logging
from queue.models import Submission
from queue.views import compose_reply
... |
import numpy as np
from mmap import mmap
def value_by_label_sep_pos(mm,label,sep=b'=',pos=-1,dtype=float,from_start=False):
""" find the value of the line 'keyword = value' in memory map 'mm' by default """
if from_start:
mm.seek(0)
# end if
# accomodate python3
if type(label) is ... |
###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... |
#!/usr/bin/env python
# Copyright (c) 2013, Carnegie Mellon University
# All rights reserved.
# Authors: Michael Koval <mkoval@cs.cmu.edu>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of sourc... |
import os
try:
import pygit2
PYGIT2 = True
except ImportError:
PYGIT2 = False
try:
from _sysctl import *
except ImportError:
pass
VERSION = (0, 1, 0, 'beta', 2)
def get_version(version=None):
"""Derives a PEP386-compliant version number from VERSION."""
if version is None:
versi... |
try:
# Python < 2.7
import unittest2 as unittest
except ImportError:
import unittest
from lala import config
from ConfigParser import SafeConfigParser, NoSectionError
from os import remove
class TestConfig(unittest.TestCase):
@classmethod
def setUpClass(cls):
config._CFG = SafeConfigParse... |
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 15 11:28:53 2016
@author: ih3
"""
import numpy
from scipy.optimize import brentq
from scipy.integrate import odeint
from copy import deepcopy
from .state import State
def rarefaction_dwdp(w, p, q_known, wavenumber):
r"""
There is a tricky point here that needs i... |
# Copyright (C) 2013-2016 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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.a... |
# coding: utf-8
import atexit
import glob
import importlib
import os.path
import queue
import threading
import time
import modder
class ModManager(object):
def __init__(self, mod_directory=None):
if not mod_directory:
mod_directory = os.path.join(os.path.dirname(__file__), 'mods')
se... |
# libavg - Media Playback Engine.
# Copyright (C) 2003-2008 Ulrich von Zadow
#
# 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 of the License, or (at your option) any l... |
import sys
import inspect
import weakref
from contextlib import contextmanager
from collections import OrderedDict
import numpy as np
from scipy.spatial import cKDTree
_SHAPE_ASSERTIONS = True
def assert_shape(arr, shape, label='array'):
'''
Raises a ValueError if `arr` does not have the specified shape
Par... |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation t... |
"""
Test the search interface.
"""
from test.fixtures import make_test_env, make_fake_space
from wsgi_intercept import httplib2_intercept
import wsgi_intercept
import httplib2
import simplejson
from tiddlyweb.model.user import User
from tiddlyweb.model.tiddler import Tiddler
def setup_module(module):
make_test_... |
#!/usr/bin/env python
"""
Copyright (c) 2011, Scott Burns
All rights reserved.
"""
from urllib import urlencode
from urllib2 import Request, urlopen, URLError
class RCAPIError(Exception):
pass
class RCRequest(object):
"""Private class wrapping the REDCap API
see https://redcap.vanderbilt.edu/api/h... |
from osv import osv, fields
from tools import debug
import time
from dateutil import parser
class rent_canton(osv.osv):
_name = 'rent.canton'
_description = 'Canton for the State'
_columns = {
'state_id' : fields.many2one('res.country.state','Province',required=True),
'name' : fields.char('Canton Nam... |
from osv import osv, fields
from tools import debug
import time
import pooler
from dateutil import parser
from datetime import date
import calendar
from tools.translate import _
class rent_canton(osv.osv):
_name = 'rent.canton'
_description = 'Canton for the State'
_columns = {
'state_id' : fields.many2one('... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The module aims to handle gentoo arch-specific processes automatically.
TODO: rewrite it using appropriate bugzilla rest-api class"""
import argparse
import os
import re
import sys
from bugzilla import bugtracker
def check_existence(path):
"""The function perfo... |
from django.conf import settings
from django.http import JsonResponse
from django.template.loader import get_template, render_to_string
from django.utils.encoding import force_text
from sculpt.json_tools import to_json
import copy
import json
#
# success-ish responses
#
# AJAX mixed response: one or more of results, ... |
# -*- coding: utf-8 -*-
"""
Tests for the page module.
"""
#
# (C) Pywikipedia bot team, 2008
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
import unittest
import pywikibot
import pywikibot.page
site = pywikibot.Site('en', 'wikipedia')
mainpage = pywikibot.Page(pywikibot.page.Link("Main... |
from unittest import TestCase
from molecupy import exceptions
from molecupy.atomic import CovalentBond, Atom
class BondTest(TestCase):
def check_valid_covalent_bond(self, covalent_bond):
self.assertIsInstance(covalent_bond, CovalentBond)
self.assertIsInstance(covalent_bond.atoms, set)
self... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists... |
import json
import mock
import unittest
import requests_mock
from datetime import datetime
from erply_api import Erply, ErplyAuth, ErplyAPILimitException
try:
# Python 3
from urllib.parse import urlparse, parse_qs
except ImportError:
# Python 2
from urlparse import urlparse, parse_qs
@requests_mock.... |
"""Tests all major functionality of the isort library
Should be ran using py.test by simply running py.test in the isort project directory
"""
import os
import os.path
import posixpath
import subprocess
import sys
import sysconfig
from tempfile import NamedTemporaryFile
from typing import Any, Dict, Iterator, List, Se... |
from graphlite import V
def test_find(graph):
assert list(graph.find(V(1).knows)) == [2, 3, 4]
assert list(graph.find(V().knows(1))) == [2, 3]
def test_union(graph):
assert list(graph.find(V(1).knows)
.union(V(2).knows)) == [1, 2, 3, 4]
def test_intersection(graph):
assert lis... |
#!/usr/bin/env /usr/bin/python3
import unittest
from kmeldb import mounts
# import argparse
# import os
import sys
if sys.platform.startswith('linux'):
from kmeldb.linux_dir_parser import DirWalker
elif sys.platform == 'darwin':
from kmeldb.mac_dir_parser import DirWalker
elif sys.platform == 'win32':
pass... |
from __future__ import with_statement
import sys
import time
import unittest
import greenhouse
import greenhouse.poller
from test_base import TESTING_TIMEOUT, StateClearingTestCase
class EventsTestCase(StateClearingTestCase):
def test_isSet(self):
ev = greenhouse.Event()
assert not ev.is_set()
... |
import argparse
import tempfile
import warnings
from itertools import product
from tempfile import NamedTemporaryFile, TemporaryDirectory
from unittest.mock import patch
import numpy as np
import pandas as pd
from numpy.testing import assert_almost_equal
from itertools import count
from nose.tools import assert_dict... |
import unittest
import os
import json
import numpy
from molml.utils import get_connections
from molml.utils import get_graph_distance
from molml.utils import LazyValues, SMOOTHING_FUNCTIONS
from molml.utils import get_coulomb_matrix, get_element_pairs
from molml.utils import deslugify, _get_form_indices, get_index_ma... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.