code stringlengths 1 199k |
|---|
from django.db import models
class RiverOutfall(models.Model):
name = models.TextField()
lat = models.FloatField(null=True)
lon = models.FloatField(null=True)
class RiverCso(models.Model):
river_outfall = models.ForeignKey("RiverOutfall")
open_time = models.DateTimeField()
close_time = models.Da... |
width = 75
height = 75
data = [
0x00,0x00,0x00,0x00,0x00,0xe0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0xf0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x03,0xf0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x03,0xf8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x07,0xf8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x0... |
import time
from pygame.locals import *
import gui
MOUSE_LEFT_BUTTON = 1
MOUSE_MIDDLE_BUTTON = 2
MOUSE_RIGHT_BUTTON = 3
MOUSE_WHEELUP = 4
MOUSE_WHEELDOWN = 5
class Screen(object):
"""Base gui screen class
every game screen class should inherit from this one
"""
__triggers = []
__old... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
'''
All things computer vision.
'''
import cv2
from mousetrap.i18n import _
from mousetrap.image import Image
import mousetrap.plugins.interface as interface
import loggin... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import libdnf
import hawkey
from dnf.i18n import _
import dnf.exceptions
import json
VERSION_MAJOR = 0
VERSION_MINOR = 0
VERSION = "%s.%s" % (VERSION_MAJOR, VERSION_MINOR)
"""
The version of the stored t... |
import tempfile
from Utils import runCommand
from SpecParser import SpecParser
from Base import Base
class RemoteSpecParser(Base):
def __init__(self, branch, package):
Base.__init__(self)
self.branch = branch
self.package = package
self.sp_obj = None
def parse(self):
f = tempfile.NamedTemporaryFile(delete=T... |
from Components.Converter.Converter import Converter
from Components.Element import cached
from Tools.Directories import fileExists
from Poll import Poll
import time
import os
class YWeather(Poll, Converter, object):
weather_city = '711665'
time_update = 20
time_update_ms = 30000
city = ... |
import time
import os
try:
import enigma
from Components.config import config
except:
print "Cannot import enigma"
from Directories import resolveFilename, SCOPE_HDD
def getTrashFolder():
# Returns trash folder without symlinks
return os.path.realpath(os.path.join(resolveFilename(SCOPE_HDD), ".Trash"))
def createT... |
from __future__ import division, absolute_import, print_function, unicode_literals
from awlsim.common.compat import *
from awlsim.core.instructions.main import * #@nocy
from awlsim.core.operators import *
class AwlInsn_ASSERT_LT(AwlInsn): #+cdef
__slots__ = ()
def __init__(self, cpu, rawInsn):
AwlInsn.__init__(self... |
"""Implement registries for formatter."""
import os
from flask_registry import (
ModuleAutoDiscoveryRegistry,
PkgResourcesDirDiscoveryRegistry,
RegistryProxy,
)
from invenio.ext.registry import ModuleAutoDiscoverySubRegistry
from invenio.utils.datastructures import LazyDict
import yaml
format_templates_dire... |
import os
import sys
import time
import linecache
import traceback
import logging
from os import path
from logging import Logger, Formatter, Handler, DEBUG, INFO, WARNING, ERROR
from conduct import colors
LOGFMT = '%(asctime)s : %(levelname)-7s : %(name)-25s: %(message)s'
DATEFMT = '%H:%M:%S'
DATESTAMP_FMT = '%Y-%m-%d'... |
from scapy.all import *
import sys, urllib , os, subprocess, random
from itertools import *
import Global_Vars
class pacifyIpv4Http:
def writeIPv4HttpRule(self, sid_id_http, http_method, http_uri_string, \
http_content_all, directory, src_name):
##creating and writing a sid.rules file
rule_file = open('%s/%... |
from sos.plugins import Plugin, UbuntuPlugin
class Maas(Plugin, UbuntuPlugin):
"""Ubuntu Metal-As-A-Service
"""
plugin_name = 'maas'
profiles = ('sysmgmt',)
option_list = [
('profile-name',
'The name with which you will later refer to this remote', '', False),
('url', 'The U... |
"""Prepare release news from git log.
Prepares release news from git log messages, breaking release news
into (1) sections (e.g. Security fixes, detected from commit labels)
and (2) modules (e.g. search, detected from commit log headlines).
"""
from __future__ import absolute_import, print_function, unicode_literals
im... |
import logging
from operator import methodcaller
from typing import List
from django.core.exceptions import ObjectDoesNotExist
from kobo.django.xmlrpc.decorators import user_passes_test
from tcms.issuetracker.models import Issue
from tcms.management.models import TCMSEnvValue, TestTag
from tcms.testcases.models import ... |
import virtconv.formats as formats
import virtconv.vmcfg as vmcfg
import virtconv.diskcfg as diskcfg
import virtconv.netdevcfg as netdevcfg
from virtinst import virtimage
from xml.sax.saxutils import escape
import re
import logging
ide_letters = list("abcdefghijklmnopqrstuvwxyz")
pv_boot_template = \
""" <boot type="x... |
"""Zenodo JSON schema."""
from __future__ import absolute_import, print_function, unicode_literals
from flask_babelex import lazy_gettext as _
from invenio_pidrelations.serializers.utils import serialize_relations
from invenio_pidstore.models import PersistentIdentifier
from marshmallow import Schema, ValidationError, ... |
import logging
from django.core.management.base import BaseCommand
from payment.postfinance_connector import ISO2022Parser
log = logging.getLogger('tq')
class Command(BaseCommand):
help = '(re)parse ISO 20022 files, ignoring duplicates'
def add_arguments(self, parser):
parser.add_argument(
'... |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import os
import xml.etree.ElementTree
from xml.etree.cElementTree import ElementTree, Element, SubElement
from xml.etree.cElementTree import fromstring, tostring
import f... |
from ABE_ADCDACPi import ADCDACPi
import time
import math
"""
================================================
ABElectronics ADCDAC Pi 2-Channel ADC, 2-Channel DAC | DAC sine wave generator demo
Version 1.0 Created 17/05/2014
Version 1.1 16/11/2014 updated code and functions to PEP8 format
run with: python demo-dacsine... |
import re
from ANNarchy.core import Global
from ANNarchy.core.PopulationView import PopulationView
from ANNarchy.models.Synapses import DefaultSpikingSynapse, DefaultRateCodedSynapse
reserved_variables = [
't',
'dt',
't_pre',
't_post',
't_last',
'last_spike',
'rk_post',
'rk_pre',
'i'... |
QgsMapLayer.LayerType = QgsMapLayerType
QgsMapLayer.VectorLayer = QgsMapLayerType.VectorLayer
QgsMapLayer.VectorLayer.__doc__ = ""
QgsMapLayer.RasterLayer = QgsMapLayerType.RasterLayer
QgsMapLayer.RasterLayer.__doc__ = ""
QgsMapLayer.PluginLayer = QgsMapLayerType.PluginLayer
QgsMapLayer.PluginLayer.__doc__ = ""
QgsMapL... |
from distutils.core import setup, Extension
from distutils.sysconfig import parse_makefile
from DistUtilsExtra.command import *
import glob, os, string
files = map(lambda source: "python/"+source,
string.split(parse_makefile("python/makefile")["APT_PKG_SRC"]))
apt_pkg = Extension("apt_pkg", files, libraries... |
"""
Script to fetch test status info from sqlit data base. Before use this
script, avocado We must be lanuch with '--journal' option.
"""
import os
import sys
import sqlite3
import argparse
from avocado.core import data_dir
from dateutil import parser as dateparser
def colour_result(result):
"""Colour result in the... |
from __future__ import unicode_literals
__author__ = "mozman <mozman@gmx.at>"
from .headervars import VARMAP
from ..ac1018 import AC1018Factory
class AC1021Factory(AC1018Factory):
HEADERVARS = dict(VARMAP) |
"""
clang/llvm detection.
"""
import os, sys
from waflib import Configure, Options, Utils
from waflib.Tools import ccroot, ar
from waflib.Configure import conf
@conf
def find_clang(conf):
"""
Find the program clang, and if present, try to detect its version number
"""
cc = conf.find_program(['clang', 'c... |
import math
import wx
import eos.db
import gui.mainFrame
from gui import globalEvents as GE
from gui.fitCommands.calc.cargo.remove import CalcRemoveCargoCommand
from gui.fitCommands.helpers import CargoInfo, InternalCommandHistory
from service.market import Market
class GuiRemoveCargosCommand(wx.Command):
def __ini... |
"""
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 it will be useful,
but WITHOUT ... |
"""
Waf tool for ChibiOS build
"""
from waflib import Errors, Logs, Task, Utils
from waflib.TaskGen import after_method, before_method, feature
import os
import shutil
import sys
import re
import pickle
_dynamic_env_data = {}
def _load_dynamic_env_data(bld):
bldnode = bld.bldnode.make_node('modules/ChibiOS')
tm... |
import sys,os
from email.Utils import COMMASPACE, formatdate
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from email.MIMEImage import MIMEImage
from email.MIMEImage import MIMEImage
from email.MIMEBase import MIMEBase
from email import Encoders
import smtplib
import XmlDict
function... |
"""
Just for backwards-compatibility
"""
from indico.util.contextManager import * |
from elan import *
Configurator.Start()
Configurator.Wait()
sleep(3)
Configurator.media.Click()
Configurator.interfacetemplates.Click()
for i in range(100):
try:
Configurator.ComboBox.Select(0,1)
break
except:
sleep(2)
print("Try again")
Configurator.apply.Click()
Configurator.Cl... |
from Cryptodome.Util.py3compat import bord
from Cryptodome.Util._raw_api import (load_pycryptodome_raw_lib,
VoidPointer, SmartPointer,
create_string_buffer,
get_raw_buffer, c_size_t,
c... |
"""Testing i18n template search and interpolation."""
from __future__ import absolute_import, print_function, unicode_literals
__metaclass__ = type
__all__ = [
]
import os
import shutil
import tempfile
import unittest
from pkg_resources import resource_filename
from zope.component import getUtility
from mailman.app... |
import time
import os
import sys
import json
import ConfigParser
import base64
import argparse
import requests
from flask import Flask
from flask import request
from faraday.proxyio import faradaybasicproxyio
from faraday.proxyio import faradaycommands
from faraday.proxyio import deviceconfig
from classes import helper... |
import re
import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def read(relpath):
"""
Return string containing the contents of the file at *relpath* relative to
this file.
"""
cwd = os.path.dirname(__file__)
abspath = os.path.join(cwd,os.path.n... |
"""
Python script 'process_NCEI_03_prcp_180d.py'
by Matthew Garcia, PhD student
Dept. of Forest and Wildlife Ecology
University of Wisconsin - Madison
matt.e.garcia@gmail.com
Copyright (C) 2015-2016 by Matthew Garcia
Licensed Gnu GPL v3; see 'LICENSE_GnuGPLv3.txt' for complete terms
Send questions, bug reports, any rel... |
from gnuradio import gr, gr_unittest
import random, numpy
from gnuradio import digital, blocks, channels
class qa_linear_equalizer(gr_unittest.TestCase):
def unpack_values(self, values_in, bits_per_value, bits_per_symbol):
# verify that 8 is divisible by bits_per_symbol
m = bits_per_value / bits_per... |
from __future__ import absolute_import
import six
import github.GithubObject
import github.HookResponse
class Hook(github.GithubObject.CompletableGithubObject):
"""
This class represents Hooks. The reference can be found here http://developer.github.com/v3/repos/hooks
"""
def __repr__(self):
ret... |
def interactiveConsole(a,b=None):
'''
Useful function for debugging
Placing interactiveConsole(locals(),globals()) into code will
drop into an interactive console when run
'''
import code
d = {}
if b:
d.update(b)
d.update(a)
c=code.InteractiveConsole(locals=d)... |
import os
import sys
import string
from samba.net import Net
from samba import enable_net_export_keytab
from samba import tests
from samba.param import LoadParm
enable_net_export_keytab()
def open_bytes(filename):
if sys.version_info[0] == 3:
return open(filename, errors='ignore')
else:
return o... |
import andbug.command, andbug.screed
import andbug.vm
def stepComplete(t):
t = t[0]
with andbug.screed.section("Single step complete in %s, suspended." % t):
showCallStack(t, 1)
def showCallStack(t, count = 0):
if count >= len(t.frames) or count <= 0:
count = len(t.frames)
for f in t.fra... |
from __future__ import print_function
import sys
from DIRAC.Core.Base import Script
from DIRAC.FrameworkSystem.Client.ProxyUpload import CLIParams, uploadProxy
__RCSID__ = "$Id$"
if __name__ == "__main__":
cliParams = CLIParams()
cliParams.registerCLISwitches()
Script.parseCommandLine()
retVal = uploadProxy(cli... |
type = "passive"
def handler(fit, container, context):
level = container.level if "skill" in context else 1
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Missile Launcher Operation"),
"cpu", container.getModifiedItemAttr("cpuNeedBonus") * level) |
import mpi4py, petsc4py
from petsc4py import PETSc
import numpy as np
import pytest
import gridPy
import geometryPy
petsc4py.init()
petscComm = petsc4py.PETSc.COMM_WORLD
comm = petscComm.tompi4py()
rank = comm.Get_rank()
numProcs = comm.Get_size()
PETSc.Sys.Print("Using %d procs" % numProcs)
N1 = int(pytest.config.ge... |
import math
from gi.repository import Gtk
class Eye(Gtk.DrawingArea):
def __init__(self, fill_color):
Gtk.DrawingArea.__init__(self)
self.connect("draw", self.draw)
self.x, self.y = 0, 0
self.fill_color = fill_color
def has_padding(self):
return True
def has_left_cent... |
'''This module contains the ChatTextEdit class'''
import logging
import PyQt4.QtGui as QtGui
import PyQt4.QtCore as QtCore
from e3.common import MessageFormatter
import gui
from gui.base import Plus
from gui.base import Desktop
log = logging.getLogger('qt4ui.widgets.ChatOutput')
class ChatOutput (gui.base.OutputText, Q... |
from __future__ import (unicode_literals, division, absolute_import,
print_function)
'''
Created on 29 Jun 2012
@author: charles
'''
import socket, select, json, os, traceback, time, sys, random
import posixpath
from collections import defaultdict
import hashlib, threading
import Queue
from func... |
import subprocess
from distutils.version import LooseVersion
from unittest import SkipTest
from django.core.cache import cache
from django.test import TestCase
from django.test.utils import override_settings
import weblate.vcs.gpg
from weblate.utils.checks import check_data_writable
from weblate.utils.unittest import t... |
import factory
from api import models
class ClientFactory(factory.DjangoModelFactory):
class Meta:
model = models.Client
name = 'Coaxis'
@factory.django.mute_signals(models.post_save)
class UserFactory(factory.DjangoModelFactory):
class Meta:
model = models.MyUser
email = factory.Sequenc... |
import logging
import re
import salt.client
from netaddr import IPNetwork, IPAddress
log = logging.getLogger(__name__)
def ping(cluster = None, exclude = None, **kwargs):
"""
Ping all addresses from all addresses on all minions. If cluster is passed,
restrict addresses to public and cluster networks.
N... |
"DiskCache: disk and file backed cache."
from .core import Cache, Disk, UnknownFileWarning, EmptyDirWarning, Timeout
from .core import DEFAULT_SETTINGS, EVICTION_POLICY
from .fanout import FanoutCache
from .persistent import Deque, Index
__all__ = [
'Cache',
'Disk',
'UnknownFileWarning',
'EmptyDirWarnin... |
from .models import *
from django.contrib import admin
from django.db import models
from website.base.form import TinyMCEAdminMixin
from django.utils.translation import ugettext_lazy as _
from mediastore.admin import ModelAdmin
class SessionAdmin(TinyMCEAdminMixin, ModelAdmin):
list_display = ('title','day_of_week'... |
from cuon.Databases.SingleData import SingleData
import logging
import pygtk
pygtk.require('2.0')
import gtk
import gtk.glade
import gobject
class SingleProposalMisc(SingleData):
def __init__(self, allTables):
SingleData.__init__(self)
# tables.dbd and address
self.sNameOfTable = "proposalm... |
import wx
import eos.db
import gui.mainFrame
from gui import globalEvents as GE
from gui.fitCommands.calc.module.projectedAdd import CalcAddProjectedModuleCommand
from gui.fitCommands.helpers import InternalCommandHistory, ModuleInfo
from service.fit import Fit
class GuiAddProjectedModuleCommand(wx.Command):
def __... |
from django.conf.urls import patterns, url
from . import views
urlpatterns = patterns(
'',
url(r'^$', views.home, name='home'),
url(r'^(?P<pk>\d+)/edit/$', views.edit, name='edit'),
url(r'^new/$', views.new, name='new'),
) |
'''u413 - an open-source BBS/transmit/PI-themed forum
Copyright (C) 2012 PiMaster
Copyright (C) 2012 EnKrypt
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... |
from .backend import RegionsjobBackend
__all__ = ['RegionsjobBackend'] |
import pypom
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
from features.pages.common import CommonPageMixin
from features.fields.fields import InputField, SelectField, ButtonField
class SearchEntityPage(CommonPageMixin, pypom.Page):
URL_TEMPLATE = '/entit... |
import unittest
from .volume_cubic_inches_to_metric import cubic_inches_to_metric
class VolumeTestCase(unittest.TestCase):
def test(self):
text = (
"Total volume is 100.50 cubic inches for this land. "
"Total volume is 15.7 cubic in for this land. "
"Total volume is 1 Cub... |
from rest_framework import serializers
from models import SurveyDraft
from taggit.models import Tag
class WritableJSONField(serializers.Field):
""" Serializer for JSONField -- required to make field writable"""
""" ALSO REQUIRED because the default JSONField serialization includes the
`u` prefix on strings ... |
"""
This file blocks all the routes defined automatically by cms_form.
"""
from odoo import http
from odoo.addons.cms_form.controllers.main import (
CMSFormController,
CMSWizardFormController,
CMSSearchFormController,
)
class UwantedCMSFormController(CMSFormController):
@http.route()
def cms_form(se... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('orentapp', '0016_auto_20150422_1803'),
]
operations = [
migrations.AddField(
model_name='product',
name='step',
field... |
from openerp import fields, models,osv
from base_olims_model import BaseOLiMSModel
from openerp.tools.translate import _
from fields.string_field import StringField
from fields.text_field import TextField
from fields.widget.widget import TextAreaWidget
schema = (StringField('Title',
required=1,
),
... |
import mysite.profile.models
import django.contrib.auth.models
for user in django.contrib.auth.models.User.objects.all():
user.email = ''
user.password = ''
user.save()
for pfe in mysite.profile.models.PortfolioEntry.objects.all():
if pfe.is_deleted:
pfe.delete()
for citation in mysite.profile.m... |
from superdesk.resource import Resource
from content_api import MONGO_PREFIX
class CompaniesResource(Resource):
"""
Company schema
"""
schema = {
"name": {"type": "string", "unique": True, "required": True},
"sd_subscriber_id": {"type": "string"},
"is_enabled": {"type": "boolean"... |
from . import computed_purchase_order |
"""Mercator proposal."""
from adhocracy_core.resources import add_resource_type_to_registry
from adhocracy_core.resources import process
from adhocracy_core.resources import proposal
from adhocracy_core.sheets.geo import IPoint
from adhocracy_core.sheets.geo import ILocationReference
from adhocracy_core.sheets.image im... |
import sys
from pts.core.simulation.simulation import createsimulations
from pts.core.plot.wavemovie import makewavemovie
xlim = None
ylim = None
from_percentile = 30
to_percentile = 100
print "Starting makewavemovie..."
argument = sys.argv[1] if len(sys.argv) > 1 else ""
for simulation in createsimulations(argument):
... |
import copy
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from django_countries import countries
import accounts
import third_party_auth
from edxmako.shortcuts import marketing_link... |
from unittest import mock
from django.test import SimpleTestCase
from program_management.ddd import command
from program_management.ddd.domain.service.identity_search import ProgramTreeVersionIdentitySearch
from program_management.ddd.repositories.program_tree_version import ProgramTreeVersionRepository
from program_ma... |
import logging
from lxml import etree
from superdesk.metadata.item import ITEM_TYPE, CONTENT_TYPE, FORMATS, FORMAT
from superdesk.etree import parse_html
from superdesk.text_utils import get_text
from superdesk.publish import registered_transmitters
formatters = []
logger = logging.getLogger(__name__)
class FormatterRe... |
import os,sys
oldvers = '4.3.0 "Cardinal"'
newvers = '5.0.0 "Raven"'
os.system('rm -rf version.txt')
os.system("grep -IFwr '%s' *|grep -vF '.svn' |grep -v ISC > version.txt"%oldvers)
filelist = []
f = open('version.txt','r')
for line in f.readlines():
candidate = line.split(':')[0]
if not candidate in filelist and ... |
from spack import *
import sys
import os
class Nwchem(Package):
"""High-performance computational chemistry software"""
homepage = "http://www.nwchem-sw.org"
url = "http://www.nwchem-sw.org/images/Nwchem-6.6.revision27746-src.2015-10-20.tar.gz"
tags = ['ecp', 'ecp-apps']
version('6.8', '50b1811... |
import sys, os, glob, distutils.file_util
DOCS_PATH="../../docs/latex/wx"
def scanTexFiles(callback):
count = 0
for f in glob.glob(DOCS_PATH + '/*.tex'):
file = open(f, "r")
if not file:
print "could not open %s" % f
continue
print "opened file %s" % f
cou... |
from django.db import models
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
import datetime
class Article(models.Model):
title = models.CharField(max_length=255)
brief = models.CharField(null=True,blank=True,max_length=255)
category = models.ForeignKey("Catego... |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobileTe... |
import os
import json
import logging
import unittest
from pycaching import Geocaching
from pycaching.utfgrid import UTFGrid, GridCoordinateBlock
from pycaching.errors import Error
from test.test_geocaching import _username, _password
_this_folder = os.path.dirname(__file__)
sample_files = {i: os.path.join(_this_folder,... |
import unittest
from magnumfe import *
set_log_active(False)
class CacheTest(unittest.TestCase):
def test_initial_update(self):
mesh = UnitCubeMesh(1,1,1)
state = State(mesh)
cache = Cache()
self.assertTrue(cache.requires_update(state))
def test_change_state(self):
mesh = UnitCubeMesh(1,1,1)
... |
from graphicsUtils import *
import math, time
from game import Directions
DEFAULT_GRID_SIZE = 30.0
INFO_PANE_HEIGHT = 35
BACKGROUND_COLOR = formatColor(0,0,0)
WALL_COLOR = formatColor(0.0/255.0, 51.0/255.0, 255.0/255.0)
INFO_PANE_COLOR = formatColor(.4,.4,0)
SCORE_COLOR = formatColor(.9, .9, .9)
PACMAN_OUTLINE_WIDTH = ... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import pytest
from pants.backend.core.tasks.list_goals import ListGoals
from pants.backend.core.tasks.task import Task
from pants.goal.goal import Goal
from pants.goal.... |
import os
from flask import request
from website.addons.dataverse.client import get_study, get_files, \
get_dataverse, connect_from_settings
from website.project.decorators import must_be_contributor_or_public
from website.project.decorators import must_have_addon
from website.util import rubeus
def dataverse_hgrid... |
from django.contrib.contenttypes.models import ContentType
import json
from django.http import Http404, HttpResponse
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required, user_passes_test
from django.core.urlresolvers import reverse... |
"""TensorSignature class and utilities."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
from tensorflow.python.ops import array_ops
class Te... |
import unittest
class Test0017(unittest.TestCase):
def test_problem(self):
one_to_nine = [3, 3, 5, 4, 4, 3, 5, 5, 4]
ten_to_nineteen = [3, 6, 6, 8, 8, 7, 7, 9, 8, 8]
twenty_to_ninety = [6, 6, 5, 5, 5, 7, 6, 6]
words_len = 0
sum_1_to_9 = sum(one_to_nine)
sum_10_to_19 =... |
from oslo_log import log as logging
from tempest_lib import exceptions as lib_exc
from tempest.common import fixed_network
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest import config
from tempest.scenario import manager
from tempest import test
CONF = config.CONF
LOG = logg... |
import copy
import django
from django.core.urlresolvers import reverse
from django import http
from mox3.mox import IgnoreArg # noqa
from mox3.mox import IsA # noqa
import six
from openstack_dashboard import api
from openstack_dashboard.test import helpers as test
from openstack_dashboard.usage import quotas
class Ro... |
from __future__ import absolute_import
from __future__ import print_function
from chaco.label import Label
from six.moves import map
from pychron.core.ui import set_qt
set_qt()
from chaco.abstract_overlay import AbstractOverlay
from kiva.fonttools import str_to_font
from traits.api import HasTraits, Instance, Float, Fi... |
import errno
import os
import stat
import warnings
from os_brick.remotefs import remotefs as remotefs_brick
from oslo_concurrency import processutils
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import fileutils
from oslo_utils import units
from cinder import exception
from cinder.i18... |
import os
import shutil
from subprocess import call
def main():
# Clean the build directory
if os.path.isdir('./build'):
shutil.rmtree('./build')
# Freeze it
call('python setup.py build')
# Zip it up - 7-zip provides better compression than the zipfile module
# Make sure the 7-zip folder... |
"""Python API for composing notebook elements
The Python representation of a notebook is a nested structure of
dictionary subclasses that support attribute access
(IPython.utils.ipstruct.Struct). The functions in this module are merely
helpers to build the structs in the right form.
"""
from ..notebooknode import from_... |
"""Show the current failures in the repository."""
import sys
from cliff import command
import testtools
from stestr import output
from stestr.repository import util
from stestr import results
from stestr import user_config
class Failing(command.Command):
"""Show the current failures known by the repository.
Wi... |
from .user import User |
'''
1.create private vpc router network with cidr
2.check dhcp ip address
@author Antony WeiJiang
'''
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.operations.resource_operations as res_ops
import zsta... |
import sys
import unittest
from libcloud.test import MockHttp
from libcloud.test.file_fixtures import DNSFileFixtures
from libcloud.test.secrets import DNS_PARAMS_BUDDYNS
from libcloud.dns.drivers.buddyns import BuddyNSDNSDriver
from libcloud.utils.py3 import httplib
from libcloud.dns.types import ZoneDoesNotExistError... |
import os
import random
from neutron.agent.linux import ovs_lib
from neutron.agent.linux import utils
from neutron.common import constants as n_const
from neutron.tests import base
BR_PREFIX = 'test-br'
class BaseLinuxTestCase(base.BaseTestCase):
def setUp(self, root_helper='sudo'):
super(BaseLinuxTestCase,... |
import numpy as np
from scipy.io.wavfile import write
a = np.fromfile('/tmp/file.raw', dtype='int16')
write('/tmp/file.wav', 16000, a) |
import git
import os
import string
def latest_commit_sha(repo, path):
"""That the last commit sha for a given path in repo"""
log_message = repo.git.log("-1", path)
commit_sha = log_message.split('\n')[0].split(' ')[1]
return commit_sha
def parse_manifest(manifest, repo, repo_name):
# For each relea... |
"""Test Home Assistant json utility functions."""
from json import JSONEncoder
import os
import sys
from tempfile import mkdtemp
import unittest
from unittest.mock import Mock
import pytest
from homeassistant.exceptions import HomeAssistantError
from homeassistant.util.json import SerializationError, load_json, save_js... |
"""Libvirt volume driver for iSCSI"""
from os_brick import exception as os_brick_exception
from os_brick.initiator import connector
from oslo_log import log as logging
import nova.conf
from nova import utils
from nova.virt.libvirt.volume import volume as libvirt_volume
LOG = logging.getLogger(__name__)
CONF = nova.conf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.