content string |
|---|
"""
Verifying the completer will properly complete various forms of dictionaries.
"""
import sys
import re
import unittest
from test.support import import_module
# just grab what we need from the other...
from editline.tests.test_lineeditor import CompletionsBase, CompletionsCommon
#
# Check Dictionary support
#
c... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
LDMP - A QGIS plugin
This plugin supports monitoring and reporting of land degradation to the UNCCD
and in support of the SDG Land Degradation Neutrality (LDN) target.
-------------... |
# merger/__init__.py
from flask import Flask, jsonify, make_response
from flask.ext.bcrypt import Bcrypt
from flask.ext.sqlalchemy import SQLAlchemy
from merger.config import BaseConfig
# config
app = Flask(__name__)
app.config.from_object(BaseConfig)
bcrypt = Bcrypt(app)
db = SQLAlchemy(app)
@app.route('/')
def ... |
"""Tests for per-course verification status on the dashboard. """
from datetime import datetime, timedelta
import unittest
import ddt
from mock import patch
from pytz import UTC
from django.core.urlresolvers import reverse
from django.conf import settings
from student.helpers import (
VERIFY_STATUS_NEED_TO_VERIFY... |
__author__ = 'Irwan Fathurrahman <<EMAIL>>'
__date__ = '29/05/17'
import shapefile
import struct
from campaign_manager.data_providers._abstract_data_provider import (
AbstractDataProvider
)
class ShapefileProvider(AbstractDataProvider):
"""Provider from overpass"""
@staticmethod
class MultiPolygonFo... |
import os
import fixtures
import testtools
import __builtin__
setattr(__builtin__, '_', lambda x: x)
_TRUE_VALUES = ('true', '1', 'yes')
class TestCase(testtools.TestCase):
"""Test case base class for all unit tests."""
def setUp(self):
"""Run before each test method to initialize test environmen... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
################################################################################
# Documentation
################################################################################
ANSIBLE_METADATA = {'metadata_version': '1.1', 'statu... |
import urlparse
from openscrapers.modules import cleantitle
from openscrapers.modules import client
from openscrapers.modules import source_utils
class source:
def __init__(self):
self.priority = 1
self.language = ['pl']
self.domains = ['boxfilm.pl']
self.base_link = 'https://www... |
from string import uppercase, digits
from ispmanccp.lib.base import *
from ispmanccp.models.accounts import *
class AccountsController(BaseController):
#@beaker_cache(expire='never')
def index(self):
"""Main Index."""
nav_1st_half = ['All']
nav_1st_half.extend(list(digits))
c.... |
import logging
import time
from mint import mint_error
from mint.rest.db import manager
log = logging.getLogger(__name__)
class SystemManager(manager.Manager):
def addSystem(self, targetSystemId, cloudName, cloudType):
targetId = self.db.targetMgr.getTargetId(cloudType, cloudName)
managedSystemI... |
import argparse
import collections
import re
import sys
from operator import itemgetter
import string
import unidecode
import glob
import os
import cchardet as chardet
all_characters = string.ascii_lowercase + " 9\'-\n"
n_characters = len(all_characters)
count = collections.defaultdict(int)
outputlist = ''
def chargr... |
# -*- 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):
# Changing field 'BusinessUnit.key'
db.alter_column(u'server_businessunit', 'key', self.gf('django.db.model... |
from . import coins, messages
from .tools import CallException, expect, normalize_nfc, session
@expect(messages.PublicKey)
def get_public_node(
client,
n,
ecdsa_curve_name=None,
show_display=False,
coin_name=None,
script_type=messages.InputScriptType.SPENDADDRESS,
):
return client.call(
... |
"""
NFS module
Process the NFS layer and return the correct NFS object. The function returns
either a NULL(), CB_NULL, COMPOUND or CB_COMPOUND object.
"""
import nfstest_config as c
from packet.utils import *
from packet.nfs.nfsbase import *
from packet.nfs.nfs3 import NFS3args,NFS3res
from packet.nfs.nfs4 import COMP... |
""" CPUs Analysis Module """
import matplotlib.pyplot as plt
import pylab as pl
import pandas as pd
from analysis_module import AnalysisModule
class CpusAnalysis(AnalysisModule):
"""
Support for CPUs Signals Analysis
:param trace: input Trace object
:type trace: :mod:`libs.utils.Trace`
"""
... |
import sys
import glob
import os
import re
def extractName(path):
return os.path.splitext(os.path.basename(path))[0]
def writeLine(fo, content, indent=0):
buf = ' ' * indent + content + '\n'
fo.write(buf)
def regroup(l, n):
return [ l[i:i+n] for i in range(0, len(l), n) ]
def removeComments(code):
... |
'''
Created on Apr 30, 2015
@author: jchirag
'''
<<<<<<< HEAD
# from xoze.snapvideo import VideoHost
from xoze.snapvideo import VideoHost, Video, STREAM_QUAL_HD_720, STREAM_QUAL_SD
from xoze.utils import http, encoders
=======
#from xoze.snapvideo import VideoHost
from xoze.snapvideo import VideoHost, Video, STREAM_QU... |
import json
from calendar import timegm
from datetime import datetime, timedelta
from django.conf import settings
from django.core import signing
from django.test import RequestFactory
import jwt
import mock
from freezegun import freeze_time
from rest_framework.exceptions import AuthenticationFailed
from rest_frame... |
import os
import sys
##
# Defaulting to local settings module for a single dev machine.
# Override this to be a new module in stackdio/settings or you
# may pass in this as an environment variable.
##
DEFAULT_SETTINGS_MODULE = 'stackdio.server.settings.development'
if __name__ == '__main__':
os.environ.setdefault... |
import os.path
import random
import numpy as np
import numpy.linalg as LA
from PIL import Image
path = '../Code/DataSets/NYURaw/'
class Dataset:
def __init__(self,subset=1.0):
self.Indices = []
for i in range(1,252885):
rgb = path+'RGB/'+str(i).zfill(6)+'.png'
norm... |
import csv
import models
import utils
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
pd.options.display.float_format = '${:,.10f}'.format
from sklearn.utils import shuffle
from sklearn.model_selection import train_test_split
from scipy.misc import imread
from keras.models import Sequential
... |
# -*- coding: utf-8 -*-
import unittest
import wx
from outwiker.gui.controls.toolbar2 import ToolBar2Container
from outwiker.gui.toolbarscontroller import ToolBarsController
from test.basetestcases import BaseOutWikerMixin
class ToolBarsControllerTest(unittest.TestCase, BaseOutWikerMixin):
def setUp(self):
... |
from ctypes import *
import os
# Function definitions for C api
buffer_operation_func_t = CFUNCTYPE(c_int32, POINTER(c_uint8), c_uint32)
check_operation_func_t = CFUNCTYPE(c_int32)
# transport struct definition for C api
class TM_transport(Structure):
_fields_ = [("read", buffer_operation_func_t),
(... |
"""module ``django_extra_form_fields``
provides several additional form fields:
* StrippedNonEmptyCharField
* NextUrlField (and an accompanying method ``get_next_url``)
* UserNameField
* UserEmailField
"""
from __future__ import absolute_import
import logging
import re
import urllib
from django import forms
from djang... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#*********
# Purpose:
#
# + θ§£ζ YAHOO εΊιι ι’
#
# Licence: LGPL3
#*********
from html.parser import HTMLParser
from urllib.request import Request, urlopen
import random
import time
import re
import logging
import logging.config
logging.config.fileConf... |
# flake8: noqa
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'FlipbookPage.image'
db.add_column(u'flipbo... |
"""AirPlay device authentication tests with fake device."""
import binascii
import pytest
from pyatv.airplay.auth import AirPlayPairingProcedure, AirPlayPairingVerifier
from pyatv.airplay.srp import LegacyCredentials, SRPAuthHandler
from pyatv.exceptions import AuthenticationError
from tests.fake_device.airplay imp... |
"""Python wrapper for post training quantization with calibration."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.util.lazy_loader import LazyLoader
# Lazy load since some of the performance benchmark skylark rules
# break depende... |
"""
Main window, root notebook, navigation history
"""
import gtk
import gobject
import pango
from os.path import join
from general_dialogs import Approve_Deny_Dialog_2
from pathname import ICON_DIR, get_dir
from plugins import get_plugin_by_type
from support import debug, normal_mode, set_debug_mode, warning, get_ver... |
""" Track module
Provides:
o Track - Container for a single track on the diagram, containing
FeatureSet and GraphSet objects
For drawing capabilities, this module uses reportlab to draw and write
the diagram:
http://www.reportlab.com
For dealing with biological information, ... |
""" This script holds several utilities related to atmospheric computations. """
def geometric_to_geopotential(z, r0):
"""Converts from given geometric altitude to geopotential one.
Parameters
----------
z: ~astropy.units.Quantity
Geometric altitude.
r0: ~astropy.units.Quantity
Pl... |
"""
Various complex queries that have been problematic in the past.
"""
from __future__ import unicode_literals
import threading
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
class DumbCategory(models.Model):
pass
class ProxyCategory(Du... |
#Advent of Code December 9
#Written by C Shi - icydoge AT gmail dot com
#Implementing TSP algorithm
def get_dict_min(dicti, disjoint_list):
#Get the minimum key value in dicti where the key is not in disjoint_list
minkey = ''
minvalue = None
for item in dicti:
if item not in disjoint_list:
... |
#!/usr/bin/env python
import warnings
import re
import subprocess
import yaml
import six
import pandas as pd
import numpy as np
import rosbag
from roslib.message import get_message_class
def bag_to_dataframe(bag_name, include=None, exclude=None, parse_header=False, seconds=False):
'''
Read in a rosbag file... |
import collections
from errno import EAGAIN
from socket import error as sockerr, socket as socket_
class AsyncPacketSock:
"""Interface for asynchronously interfacing with DGRAM-like socks
public attributes (read-only):
fl: wrapped filelike
bufsize: buffer size passed to recvfrom()
public attrib... |
"""Unit test for checking fields in mapping and unmapping."""
import unittest
from ddt import data, ddt, unpack
from ggrc import utils
class BaseTestMappingRules(unittest.TestCase):
"""Base TestCase for mapping and unmapping check."""
rules = {}
def assertRules(self, model, *rules): # pylint: disable=C010... |
from novaclient.tests.unit import utils
from novaclient.tests.unit.v2 import fakes
from novaclient.v2 import services
class ServicesTest(utils.TestCase):
def setUp(self):
super(ServicesTest, self).setUp()
self.cs = self._get_fake_client()
self.service_type = self._get_service_type()
d... |
"""
Very-Very-Orienteering Map Generator
====================================
This is a Very-Very-Orienteering Map Generator. If you don't know these kind of
orienteering training: Try it out! It's fun!
"""
import distribute_setup
# automatically install distribute if the user does not have it installed
distribute_se... |
import uuid
from deform import Button, Form, ValidationFailure
from pyramid.httpexceptions import (
HTTPBadRequest,
HTTPFound,
HTTPNotFound,
)
from pyramid.httpexceptions import HTTPUnauthorized
from pyramid.view import view_config
from pyramid_sqlalchemy import Session
from sqlalchemy.orm.exc import No... |
from pythonforandroid.recipe import CythonRecipe, IncludedFilesBehaviour
from pythonforandroid.util import current_directory
from pythonforandroid import logger
from os.path import join
class AndroidRecipe(IncludedFilesBehaviour, CythonRecipe):
# name = 'android'
version = None
url = None
src_filena... |
from ircBase import *
from random import randint
from datetime import date
import re
#Define the images to link
fourdeez_images = []
fourdeez_images.append('https://www.dropbox.com/s/zxzd30en1g6w0gk/Fourdeeezzzz%20Ape.png')
fourdeez_images.append('https://www.dropbox.com/s/8yvynoqzgflm053/Fourdeeezzzz%20Busey.png')
fo... |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <headingcell level=1>
# COMT Standards Compliance Test
# <markdowncell>
# Crawl a THREDDS catalog, and try loading all OPeNDAP urls with pyugrid and Iris
# <codecell>
import matplotlib.tri as tri
import datetime as dt
# <codecell>
import cartopy.crs as ccrs
i... |
# coding=utf-8
from __future__ import unicode_literals
from .. import Provider as PersonProvider
class Provider(PersonProvider):
formats = (
'{{first_name}} {{last_name}}', '{{first_name}} {{last_name}}',
'{{first_name}} {{last_name}}',
'{{first_name}} {{last_name}}',
'{{first_nam... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import pytest
import matplotlib
def pytest_configure(config):
matplotlib.use('agg')
matplotlib._called_from_pytest = True
matplotlib._init_tests()
def pytest_unconfigure(config):
matplotlib... |
from setuptools import setup, find_packages
import os
version = '0.1'
setup(name='uwosh.flashpage',
version=version,
description="Adds a new content type that allows you to embed flash videos into the content",
long_description=open("README.txt").read() + "\n" +
open(os.path.j... |
from __future__ import division
import inspect
import re
from functools import wraps, partial
from collections import defaultdict
from pdb import set_trace
from copy import copy
from step import piped as step_into
from stop_as_final_func import piped as stop_as_final_func
__all__ = ('verbose', 'endverbose', 'step',... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/gugu/w/calibre/src/calibre/gui2/wizard/send_email.ui'
#
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
ex... |
import unittest
from dungeon import Dungeon
from orc import Orc
from hero import Hero
from weapon import Weapon
import os
class TestDungeon(unittest.TestCase):
def setUp(self):
self.filename = 'dungeon.txt'
self.file_to_read = open(self.filename, 'w')
field = ["S.##......", "#.##..###.", "... |
"""seahub/api2/views.py::Repo api tests.
"""
import json
from django.core.urlresolvers import reverse
from seahub.share.models import FileShare, UploadLinkShare
from seahub.test_utils import BaseTestCase
class RepoTest(BaseTestCase):
def test_can_fetch(self):
self.login_as(self.user)
resp = self... |
''' main.py '''
import argparse
import atexit
import getpass
import os
import shutil
import sys
import time
import traceback
import heron.common.src.python.utils.log as log
import heron.tools.common.src.python.utils.config as config
import heron.tools.cli.src.python.help as cli_help
import heron.tools.cli.src.python.a... |
#!/usr/bin/python
# vim: encoding=utf-8
#expand *.in files
#this script is only intended for building from git, not for building from the released tarball, which already includes all necessary files
import os
import sys
import re
import string
import subprocess
import optparse
def get_version(srcroot):
... |
#!/usr/bin/env python3
from mpd import MPDClient
from RPi import GPIO
from datetime import datetime
from time import sleep
from subprocess import call
from luma.core.interface.serial import i2c
from luma.core.render import canvas
from luma.oled.device import ssd1306, ssd1325, ssd1331, sh1106
import time
from PIL impor... |
#!/usr/bin/python3 -i
import RPi.GPIO as GPIO
import time
import threading
GPIO.setmode(GPIO.BOARD)
#class control:
# GPIO.setmode(GPIO.BOARD)
# def change(self,arg):
# GPIO.remove_event_detect(self.IN)
# while GPIO.input(self.IN): 1
# if self.flag11: GPIO.output(self.OUT,GPIO.HIGH)
# ... |
#!/usr/bin/env python
"""
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");... |
from __future__ import unicode_literals
from functools import update_wrapper
from django import http
from django.core.exceptions import ImproperlyConfigured
from django.template.response import TemplateResponse
from django.utils.log import getLogger
from django.utils.decorators import classonlymethod
from django.utils... |
#!/usr/bin/env python
"""
A simple demo to display a lot of hexagons
This was an example someone had on the wxPython-users list
"""
import wx
import wx.lib.colourdb
## import local version:
#import sys
#sys.path.append("..")
#from floatcanvas import NavCanvas, FloatCanvas
## import installed version
from wx.lib.fl... |
#vim: fileencoding=utf8
from __future__ import division, print_function
from gevent import monkey; monkey.patch_all()
import gevent
import gevent.pool
from rays import *
from rays.compat import *
import time
app = Application()
APP_DIR = os.path.dirname(__file__)
app.config([
("debug", True),
("AsyncExtension", ... |
from pySDC.implementations.collocation_classes.gauss_radau_right import CollGaussRadau_Right
from pySDC.implementations.controller_classes.controller_nonMPI import controller_nonMPI
from pySDC.implementations.problem_classes.HeatEquation_1D_FD_forced import heat1d_forced
from pySDC.implementations.sweeper_classes.imex_... |
import pytest
from polyaxon.connections.schemas import V1K8sResourceSchema
from polyaxon.env_vars.keys import (
POLYAXON_KEYS_API_VERSION,
POLYAXON_KEYS_AUTH_TOKEN,
POLYAXON_KEYS_AUTHENTICATION_TYPE,
POLYAXON_KEYS_HEADER,
POLYAXON_KEYS_HEADER_SERVICE,
POLYAXON_KEYS_HOST,
POLYAXON_KEYS_IS_MA... |
import traceback
import sys
import webbrowser
import os
from PySide.QtCore import *
from PySide.QtGui import *
from widgets import scriptEditor_UIs as ui, tabWidget, outputWidget, about, shortcuts
from widgets.pythonSyntax import design
reload(tabWidget)
reload(outputWidget)
import sessionManager
import settingsManager... |
import numpy as np
from pylab import grid
import matplotlib.pyplot as plt
from pylab import savefig
def plot_acquisition(bounds,input_dim,model,Xdata,Ydata,acquisition_function,suggested_sample, filename = None):
'''
Plots of the model and the acquisition function in 1D and 2D examples.
'''
# P... |
import pandas as pd
train_data = pd.read_csv('../data/labeledTrainData.tsv', sep='\t')
test_data = pd.read_csv('../data/testData.tsv', sep='\t')
import matplotlib.pyplot as plt
train_data['review_length'] = train_data.review.apply(len)
test_data['review_length'] = test_data.review.apply(len)
# p = plt.hist(train_data... |
from __future__ import print_function
import sys
import logging
from collections import defaultdict
from contextlib import contextmanager
from mock import MagicMock as Mock
from swift.common import utils
from swift.common.utils import NOTICE
from oio.api.object_storage import ObjectStorageApi
from oio.account.client im... |
# -*- coding: utf-8 -*-
import decimal
def isNum(value): # Einai to value arithmos, i den einai ?
""" use: Returns False if value is not a number , True otherwise
input parameters :
1.value : the value to check against.
output: True or False
"""
try:
float(value)
... |
#!/usr/bin/env python3
import unittest
import os.path
import sys
sys.path.append(os.path.abspath(os.path.join(__file__, '..')))
from indenttest import IndentTest
class Test(IndentTest):
LANGUAGE = 'Haskell'
INDENT_WIDTH = 4
@unittest.skip("Haskell not supported yet")
def test_dontIndent1(self):
... |
from adapter import Dog, Cat, Human, Car, Adapter
import sys
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
class ClassTest(unittest.TestCase):
@classmethod
def setUpClass(self):
self.dog = Dog()
self.cat = Cat()
self.human = Human()
... |
"""
Rio PL interpreter
------------------
Author: Eduardo de Oliveira Padoan
Email: <EMAIL>
"""
import os
import sys
from rpython.rlib.parsing.ebnfparse import parse_ebnf
# GOAL SYNTAX
##############
# exp ::= { message | terminator }
# message ::= symbol [arguments]
# arguments ::= "(" [exp [ { "," ... |
import logging
import re
import threading
import paramiko
#from adminapi.dataset import query
from django.core.management.base import BaseCommand
from administrator.models import SSHKey
from controller.models import LoadGenerator
logger = logging.getLogger(__name__)
def get_host_info(host, load_generators_info):
... |
#!/usr/bin/python
import os
import psycopg2
import sys
file = open("/home/" + os.getlogin() + "/.pgpass", "r")
pgpasses = []
for line in file:
pgpasses.append(line.rstrip("\n").split(":"))
file.close()
for pgpass in pgpasses:
#print str(pgpass)
if pgpass[0] == "54.236.235.110" and pgpass[3] == "geonode":
sr... |
import demistomock as demisto # noqa
from CommonServerPython import * # noqa
import json
import traceback
from typing import Dict, Any, Tuple, List, Optional
''' STANDALONE FUNCTION '''
def value_to_markdown(v: Any) -> Optional[str]:
if v is None:
return "*empty*"
if isinstance(v, int) or isinst... |
from azure.keyvault.keys.crypto import CryptographyClient
from _shared.test_case import KeyVaultTestCase
from _test_case import client_setup, get_decorator, KeysTestCase
all_api_versions = get_decorator(only_vault=True)
class TestCryptoExamples(KeysTestCase, KeyVaultTestCase):
def __init__(self, *args, **kwarg... |
from azure.cli.core.commands import CliCommandType
from azure.cli.command_modules.aro._client_factory import cf_aro
from azure.cli.command_modules.aro._format import aro_show_table_format
from azure.cli.command_modules.aro._format import aro_list_table_format
from azure.cli.command_modules.aro._help import helps # pyl... |
# -*- coding: utf-8 -*-
"""
This file contains a gui to show data from a simple data source.
Qudi 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 ve... |
"""
recursely
"""
__version__ = "0.1"
__description__ = "Recursive importer for Python submodules"
__author__ = "Karol Kuczmarski"
__license__ = "Simplified BSD"
import sys
from recursely._compat import IS_PY3
from recursely.importer import RecursiveImporter
from recursely.utils import SentinelList
__all__ = ['ins... |
import logging
from flask_jwt_extended import current_user
from flask_restful import Resource
from marshmallow import fields
from sqlalchemy import or_
from sqlalchemy.exc import DatabaseError
from sqlalchemy.orm import joinedload
from werkzeug.exceptions import UnprocessableEntity
from scuevals_api.models import Per... |
from __future__ import absolute_import
import shutil
import os
import functools
from mock import MagicMock, patch, call
def rm_f(path):
try:
# Assume it's a directory
shutil.rmtree(path, ignore_errors=True)
except OSError:
# Directory delete failed, so it's likely a file
os.r... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the event filter expression parser expression classes."""
from __future__ import unicode_literals
import unittest
from plaso.filters import expressions
from plaso.lib import errors
from tests import test_lib as shared_test_lib
class ExpressionTest(shared... |
from datetime import datetime, timedelta
import calendar
import dateutil.rrule
import pytz
from .. import log
from ..compat import to_unicode
from .exceptions import UnsupportedRecursion
logger = log.logger
def expand(vevent, href=''):
"""
Constructs a list of start and end dates for all recurring instanc... |
"""
pygments.lexers.c_cpp
~~~~~~~~~~~~~~~~~~~~~
Lexers for C/C++ languages.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, using, \
this, inherit, default, word... |
"""Script for testing qa.qa_config"""
import unittest
import tempfile
import shutil
import os
from ganeti import utils
from ganeti import serializer
from ganeti import constants
from ganeti import compat
from qa import qa_config
from qa import qa_error
import testutils
class TestTestEnabled(unittest.TestCase):
... |
import cStringIO
from pathod import language
from pathod.language import writer
def test_send_chunk():
v = "foobarfoobar"
for bs in range(1, len(v) + 2):
s = cStringIO.StringIO()
writer.send_chunk(s, v, bs, 0, len(v))
assert s.getvalue() == v
for start in range(len(v)):
... |
import unittest
import numpy as np
import scipy.linalg
from pyscf.pbc.gto import Cell
from pyscf.pbc.tools import k2gamma
from pyscf.pbc.scf import rsjk
cell = Cell().build(
a = np.eye(3)*1.8,
atom = '''He 0. 0. 0.
He 0.4917 0.4917 0.4917''',
basis = {'He': [[0, [2.5, ... |
"""This example gets all user team associations (i.e. teams) for a given user.
"""
# Import appropriate modules from the client library.
from googleads import ad_manager
USER_ID = 'INSERT_USER_ID_HERE'
def main(client, user_id):
# Initialize appropriate service.
user_team_association_service = client.GetService... |
{
'name': 'Stock Planning Procurement Generated By Plan',
"version": "8.0.1.0.0",
"license": 'AGPL-3',
'author': 'OdooMRP team,'
'AvanzOSC,'
'Serv. Tecnol. Avanzados - Pedro M. Baeza',
'website': "http://www.odoomrp.com",
"contributors": [
"Pedro M. Baeza <<EM... |
import urllib2, re, sys, bs4, time
from datetime import datetime
from dateutil.relativedelta import relativedelta
import trueskill
import pickle
#local imports
import getd1teams
import redis, uuid
#Globals
TODAY = "03/14/15"
USE_HFA = True #use home field advantage
ELO_ITERS = 50
USE_EXP_DECAY = False
FLUSH_DB = Fa... |
#!/usr/bin/python
import numpy as np
from ctypes import c_int, c_double, c_char_p
import ctypes
import os
from . import common as PPU
from . import cpp_utils
# ==============================
# ============================== interface to C++ core
# ==============================
cpp_name='ProbeParticle'
#cpp_utils... |
import sys
import itk
if len(sys.argv) != 3:
print("Usage: " + sys.argv[0] + " [input_filename] [output_filename]")
sys.exit(1)
input_filename = sys.argv[1]
output_filename = sys.argv[2]
PixelType = itk.RGBPixel[itk.UC]
input_image = itk.imread(input_filename, pixel_type=PixelType)
ImageType = type(input_i... |
from cfn_pyplates import core
from errors import RespawnResourceError
class Tag(core.JSONableDict):
"""
Creates RDS Tag
:param key: String
:param value: String
"""
# ----------------------------------------------------------------------------------------------------------
# T... |
#! /usr/bin/env python
"""Unit tests for SCardBeginTransaction/SCardEndTransaction.
This test case can be executed individually, or with all other test cases
thru testsuite_scard.py.
__author__ = "http://www.gemalto.com"
Copyright 2001-2010 gemalto
Author: Jean-Daniel Aussel, mailto:<EMAIL>
This file is part of pys... |
#!/usr/local/bin/env python
#=============================================================================================
# MODULE DOCSTRING
#=============================================================================================
"""
Analyze YANK output file.
"""
#============================================... |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsNetworkContentFetcher
.. note:: 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 versio... |
import logging
from candelabra.provider.virtualbox import VirtualboxMachineNode
from candelabra.tests import CandelabraTestBase, skipTravis
from candelabra.topology.root import TopologyRoot, DEFAULT_NAT_INTERFACE_NAME
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
@skipTravis
class Ma... |
import os
import unittest
from unittest import TestCase
from context import woogenerator
from woogenerator.coldata import ColDataProductMeridian
from woogenerator.parsing.woo import ImportWooProduct, CsvParseWoo, CsvParseTT, WooProdList
from woogenerator.utils import TimeUtils, Registrar, SanitationUtils
from context... |
import numpy as np
class ContingencyTable:
def __init__(self, a, b, c, d):
"""Initializes a contingency table of the following form:
Event
Yes No
Forecast Yes a b
No c d
"""
self.table = np.array([[a, b], [c,... |
__version__ = '0.0.3'
from bs4 import BeautifulSoup
import requests
from datetime import datetime
from pync import Notifier
cafes = ['νμ볡μ§κ΄ νμμλΉ',
'νμνκ΄ μ€μλΉ',
'κ΅μ§μμλΉ',
'μ¬λλ°©',
'μ κ΅μ§μμλΉ',
'μνμμλΉ',
'μ 2μνκ΄ μλΉ',
'νμνν¬']
days = ['μμμΌ', 'νμμΌ', 'μμμΌ', 'λͺ©μμΌ', 'κΈμμΌ... |
__copyright__ = "Copyright 2017 Birkbeck, University of London"
__author__ = "Martin Paul Eve & Andy Byers"
__license__ = "AGPL v3"
__maintainer__ = "Birkbeck Centre for Technology and Publishing"
from django.conf.urls import url
from preprint import views
urlpatterns = [
url(r'^$',
views.preprints_hom... |
"""Alpao deformable mirrors SDK.
"""
import ctypes
import os
from ctypes import c_char_p, c_double, c_int, c_size_t, c_uint32
if os.name in ("nt", "ce"):
SDK = ctypes.WinDLL("ASDK")
else:
# Not actually tested yet
SDK = ctypes.CDLL("libasdk.so")
class DM(ctypes.Structure):
pass
pDM = ctypes.POINT... |
import os, sqlite3
from higgins.core.upgradedb.logger import logger
def check_version(dbpath):
from higgins.core.models import DB_VERSION
# if db doesn't exist, then create a new one
if not os.access(dbpath, os.F_OK):
version = 0
else:
version = None
db = sqlite3.connect(dbpath)
... |
from __future__ import absolute_import
import logging
from telemetry import decorators
from telemetry.core import cros_interface
from telemetry.core import platform
from telemetry.core import util
from telemetry.internal.forwarders import cros_forwarder
from telemetry.internal.platform import cros_device
from telemetr... |
import sys
import os
import collections
import numpy as np
import argparse
from pymatgen import Structure
from pymatgen.io.vasp import inputs
from pymatgen.core.periodic_table import get_el_sp
import seekpath
from interface.QE import QEParser
from GenDisplacement import AlamodeDisplace
ALAMODE_root = "~/src/alamode"
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.