content stringlengths 4 20k |
|---|
from django.contrib import admin
from django.contrib.sites.models import Site
from django.contrib.sites.admin import SiteAdmin as BaseSiteAdmin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from .models import Conf, SitePermission
class ConfInline(admin.StackedInline):
... |
# -*- coding: utf-8 -*-
"""Test logentries module."""
#
# (C) Pywikibot team, 2015-2016
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
import datetime
import pywikibot
from pywikibot.logentries import LogEntryFactory
from pywikibot.tools import (
Me... |
"""Read and write notebooks in JSON format.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distribute... |
import gnome15.g15locale as g15locale
_ = g15locale.get_translation("voip-mumble", modfile = __file__).ugettext
import gnome15.g15driver as g15driver
import gnome15.util.g15convert as g15convert
import ts3
from threading import Thread
from threading import Lock
from threading import RLock
from threading import Semapho... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
Copyright (C),2014-2015, YTC, www.bjfulinux.cn
Created on 2015-04-06 15:04
@author: ytc <EMAIL>
@version: 1.0
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 ... |
"""
WSGI config for courtside project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`... |
from xmodule.modulestore.django import modulestore
from xmodule.course_module import CourseDescriptor
from django.conf import settings
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from microsite_configuration import microsite
def get_visible_courses():
"""
Return the set of CourseDescriptors ... |
import abc
import typing
import pkg_resources
import google.auth # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.api_core import operations_v1 # type: ignore
from google.auth import credentials as ga_credentials # type: i... |
"""Functional tests for Stack and ParallelStack Ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework i... |
"""Support for Neato sensors."""
from datetime import timedelta
import logging
from pybotvac.exceptions import NeatoRobotException
from homeassistant.components.sensor import DEVICE_CLASS_BATTERY
from homeassistant.helpers.entity import Entity
from .const import NEATO_DOMAIN, NEATO_LOGIN, NEATO_ROBOTS, SCAN_INTERVAL... |
import pango,gtk,gobject
import re, xml.sax.saxutils
from TextBufferMarkup import PangoBuffer
from gourmet.gdebug import *
class LinkedPangoBuffer (PangoBuffer):
href_regexp = re.compile(r"<a href=['\"]([^'\"]+)['\"][^>]*>(.*?)</a>")
url_markup = 'underline="single" color="blue"'
url_props = [('underlin... |
"""
The tests here are ports from the original SANS2DReductionGUI.py test suite. Not all tests can be ported since they
include details about the ReductionSingleton
"""
from __future__ import (absolute_import, division, print_function)
import systemtesting
from mantid.kernel import (config)
from mantid.api import (Fil... |
# -*- coding: utf-8
from woo import utils,pack,export,geom,timing,bodiesHandling
import time,numpy
radRAD=[23.658, #5000 elements
40.455, #25000 elements
50.97, #50000 elements
64.218, #100000 elements
80.91] #200000 elements
#109.811] #500000 elements
iterN=[12000, #5000 elements
2500, #2... |
# -*- coding: utf-8 -*-
from module.plugins.internal.SimpleHoster import SimpleHoster
class DataportCz(SimpleHoster):
__name__ = "DataportCz"
__type__ = "hoster"
__version__ = "0.46"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?dataport\.cz/file/(.+)'
__config__ = [("activated", "... |
import logging
import ibmsecurity.utilities.tools
logger = logging.getLogger(__name__)
def get(isdsAppliance, ip_addr, check_mode=False, force=False):
"""
Get hostnames for a host record
"""
return isdsAppliance.invoke_get("Retrieving hostnames for a host record",
... |
from __future__ import unicode_literals
import os
from django.contrib.auth.models import User
from django.contrib.auth.forms import (UserCreationForm, AuthenticationForm,
PasswordChangeForm, SetPasswordForm, UserChangeForm, PasswordResetForm)
from django.core import mail
from django.forms.fields import Field, Emai... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import sys
import pytest
from nose.plugins.skip import SkipTest
if sys.version_info < (2, 7):
raise SkipTest("F5 Ansible modules require Python >= 2.7")
from ansible.compat.tests import unittest
from ans... |
#!/usr/bin/env python
import csv
import os
try:
import unittest2 as unittest
except ImportError:
import unittest
import agate
import agatecharts
TEST_FILENAME = '.test.png'
class TestLineChart(unittest.TestCase):
def setUp(self):
text_type = agate.Text()
number_type = agate.Number()
... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat import unittest
from units.compat.mock import patch, MagicMock
from ansible.errors import AnsibleError, AnsibleParserError
from ansible.executor.task_executor import TaskExecutor, remove_omit
from ansible.playbook... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
r_colors_stddev.py
------------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
**********************... |
import os
import shutil
from datetime import datetime
from contextlib import contextmanager
from cloudify_rest_client.exceptions import CloudifyClientError
from ..cli import cfy, helptexts
from ..blueprint import get_blueprint_path_and_id
from . import blueprints, install, deployments
from ..constants import DEFAULT_... |
"""POSIX specific tests."""
import datetime
import errno
import os
import re
import subprocess
import time
import psutil
from psutil import AIX
from psutil import BSD
from psutil import LINUX
from psutil import MACOS
from psutil import OPENBSD
from psutil import POSIX
from psutil import SUNOS
from psutil.tests import... |
from collections import defaultdict
import json, subprocess, sys, re, magic, csv, os, logging
#STRAWMAN FIXME
#THIS WOULD BE A PROGRAMMATICALLY INGESTED JSON ON MODULE LOAD IN REAL LIFE
#DONT HATE THIS PART
#programs = defaultdict(dict)
#programs['bwa']={"default":"/opt/common/CentOS_6/bwa/bwa-0.7.12/bwa",
# ... |
"""aiobfd: BFD Control Packet"""
# pylint: disable=I0011,E0632,R0902
import logging
import bitstring
log = logging.getLogger(__name__) # pylint: disable=I0011,C0103
MIN_PACKET_SIZE = 24
MIN_AUTH_PACKET_SIZE = 26
STATE_ADMIN_DOWN = 0 # AdminDown
STATE_DOWN = 1 # Down
'''
0 ... |
# coding=utf-8
from collections import OrderedDict
from django.db import models
from videoclases.models.homework import Homework
from videoclases.models.pedagogical_questions.question import Question
from django.utils import timezone
from pyexcel_xls import save_data
from io import StringIO
class PedagogicalQuestio... |
import io
import os
import setuptools
# Package metadata.
name = "google-cloud-webrisk"
description = "Google Cloud Web Risk API client library"
version = "1.3.0"
# Should be one of:
# 'Development Status :: 3 - Alpha'
# 'Development Status :: 4 - Beta'
# 'Development Status :: 5 - Production/Stable'
release_status... |
from pywb.utils.wbexception import AccessException
from pywb.cdx.cdxops import cdx_load
from pywb.cdx.query import CDXQuery
from pytest import raises
KEY = 'com,example)/'
#================================================================
def raise_access_exception(cdx_iter, query):
if query.key == KEY:
r... |
from optparse import OptionParser
import os
parser = OptionParser(usage = "%prog -i INPUT_FILE",
description = 'This script converts SU2 ASCII restart files generated with a version prior v7 to the CSV format')
parser.add_option("-i", "--inputfile", dest="infile",
help="ASCII restart file (*.... |
#!/usr/bin/env python
"""
Testing of code to find nodes.
Currently only nearest neighbor.
"""
from __future__ import (absolute_import, division, print_function)
import numpy as np
from .utilities import twenty_one_triangles
def test_locate_node(twenty_one_triangles):
"""Test finding a single node."""
u... |
# -*- coding: utf-8 -*-
import io
import pytest
from shells_kitchen import argument, topic, Interpreter
from testutils.utils import create_cmd, debug_cmd
TEXT_FOO = "foo!"
TEXT_BAR = "foo!"
TEXT_BAZ = "baz!"
@pytest.fixture
def cmd():
cmd = create_cmd()
@cmd.command
def foo(interpreter):
"Thi... |
test = {
'name': 'shopping-cart',
'points': 0,
'suites': [
{
'cases': [
{
'code': r"""
sqlite> SELECT * FROM shopping_cart LIMIT 15;
CAKE!|0
cornbread, cornbread, cornbread, cornbread, cornbread|0
cranberries, cranberries, cranberries, cornbread,... |
#! /usr/local/bin/python3
# https://github.com/jackchi/interview-prep
# Airbnb HackerRank Practice Question
# You are working on a computer simulation of a robot. The Robot moves on an infinite plane, starting from position (0,0)
# G tells the robot to take one step forward
# L turns the robot left
# R turns the robot... |
# coding=utf-8
"""InaSAFE Disaster risk tool by Australian Aid - Metadata for Flood Vector
Impact on OSM Buildings using QGIS libraries.
Contact : <EMAIL>
.. 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 F... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from gevent import monkey
#monkey.patch_all()
monkey.patch_all(thread=False)
import logging
import click
import Queue
from abc import abstractmethod
from threading import Thread
from collections import deque
imp... |
from drf_yasg2.inspectors import SwaggerAutoSchema
from drf_yasg2.openapi import Info, Contact
from drf_yasg2.views import get_schema_view
from rest_framework.permissions import AllowAny
from ksg_nett import settings
SchemaView = get_schema_view(
permission_classes=(AllowAny,),
public=True,
info=Info(
... |
"""
Classify / provide details for objects generated from a Globus
Galaxy workflow processing batch performed by the BRI Bioinformatics
Core.
"""
import logging
import os
import datetime
from .. import util
from .. import parsing
from .. import io
from .. import database
from .. import qc
from .. import model as docs
... |
import os
import click
from tower_cli import get_resource
from tower_cli.cli import types
from collections import OrderedDict
try:
unicode
except NameError:
unicode = str
basestring = str
ATTR_TO_SHOW = [
'name',
'type',
'help_text',
'read_only',
'unique',
'filterable',
'requ... |
"""SCons.Tool.sunc++
Tool-specific initialization for C++ on SunOS / Solaris.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby grant... |
#!/usr/bin/python
import urllib2
import cv
import sys
if __name__ == "__main__":
laplace = None
colorlaplace = None
planes = [ None, None, None ]
capture = None
if len(sys.argv) == 1:
capture = cv.CreateCameraCapture(0)
elif len(sys.argv) == 2 and sys.argv[1].isdigit():
cap... |
from benchmarks import silk_flags
from measurements import smoothness
from telemetry import test
class SmoothnessTop25(test.Test):
"""Measures rendering statistics while scrolling down the top 25 web pages.
http://www.chromium.org/developers/design-documents/rendering-benchmarks"""
test = smoothness.Smoothness... |
class DeviceMixin(object):
'''Manage BigIP device cluster in a general way.'''
def get_device_info(self, bigip):
'''Get device information about a specific BigIP device.
:param bigip: bigip object --- device to inspect
:returns: bigip object
'''
coll = bigip.tm.cm.devi... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from pycket import impersonators as imp
from pycket import values
from pycket import vector
from pycket.cont import call_cont
from pycket.error import SchemeException
from pycket.prims.expose import default, expose, ma... |
#!/usr/bin/env python
__all__ = [ "SparkfunLCD" ]
import serial
class SparkfunLCD:
def __sendCommand(self, command):
self.__serial.write(self.__escape_chr)
self.__serial.write(self.__command_list[command])
def __sendValue(self, value):
self.__serial.write(chr(value))
def __init_... |
# -*- coding: utf-8 -*-
# Vortex 2016
import os,re,sys,urllib,urllib2,xbmcplugin,xbmcgui,xbmcaddon,xbmc,urlparse,cookielib,base64
from resources.lib.modules import client
from resources.lib.modules import cloudflare
from resources.lib.modules import control
from resources.lib.modules import cache
from resource... |
import sys
PY2 = sys.version_info[0] == 2
if PY2:
def is_string(item):
return isinstance(item, (str, unicode))
else:
from robot.utils import is_string
def is_truthy(item):
if is_string(item):
return item.upper() not in ('FALSE', 'NO', '', 'NONE')
return bool(item)
def is_falsy(ite... |
#!/usr/bin/python3
import apt
import apt_pkg
import os
import shutil
import tempfile
import unittest
import unattended_upgrade
class LogInstallProgressMock(unattended_upgrade.LogInstallProgress):
# klass data so that we can verify in the test as the actual
# object is destroyed
DATA = []
# overwri... |
from six.moves import http_client
from drift.systesthelper import DriftBaseTestCase, big_number
from driftbase.tests import has_key
class UsersTest(DriftBaseTestCase):
"""
Tests for the /users endpoint
"""
def test_users(self):
self.auth()
resp = self.get("/")
m... |
import json
import os
import random
import string
from yatcobot.config import Config
tests_path = path = os.path.dirname(os.path.abspath(__file__))
def get_random_string(length=10):
return ''.join([random.choice(string.ascii_letters + string.digits) for n in range(length)])
def create_post(id=None, userid=Non... |
import abc
import jsonschema
from watcher.common import clients
from watcher.common.loader import loadable
class BaseAction(loadable.Loadable, metaclass=abc.ABCMeta):
# NOTE(jed): by convention we decided
# that the attribute "resource_id" is the unique id of
# the resource to which the Action applies t... |
import ctypes
import gc
from clang.cindex import CursorKind
from clang.cindex import TemplateArgumentKind
from clang.cindex import TranslationUnit
from clang.cindex import TypeKind
from .util import get_cursor
from .util import get_cursors
from .util import get_tu
kInput = """\
struct s0 {
int a;
int b;
};
struc... |
from openerp.tests.common import TransactionCase
class BaseCase(TransactionCase):
def setUp(self):
super(BaseCase, self).setUp()
# Data Object
self.obj_hr_expense = self.env['hr.expense.expense']
# Data Account
self.account = self.env["account.account"].create({
... |
from django.views.generic import TemplateView, ListView, CreateView
from django.conf import settings
from django.db.models import Max
from django.shortcuts import get_object_or_404
from braces.views import LoginRequiredMixin
import requests
import pprint
import re
import datetime
from dateutil import parser
from .mod... |
"""
Test class for MSFT OCS ManagementInterface
"""
import mock
from ironic.common import boot_devices
from ironic.common import exception
from ironic.conductor import task_manager
from ironic.drivers.modules.msftocs import common as msftocs_common
from ironic.drivers.modules.msftocs import msftocsclient
from ironic.... |
from odoo import models, fields, api
from odoo.tools.float_utils import float_round
class AmbumovilService(models.AbstractModel):
_name = "ambumovil.service"
@api.model
def get_ambulance_stock(self, code):
company_id = self.env.user.company_id.id
quants = self.env['stock.quant'].search([
... |
import os
import pyblish.api
import pyblish_maya
@pyblish.api.log
class CollectModel(pyblish.api.Collector):
"""Inject all models from the scene into the context"""
def process(self, context):
from maya import cmds
if not os.environ["TASK"] == "modeling":
return self.log.info("No... |
#!/usr/bin/env python
#from sumatra.projects import load_project
#from sumatra.parameters import build_parameters
#from sumatra.decorators import capture
from ruffus import *
import sys
import os
import time
import datetime
import drmaa
from omics_pipe.utils import *
from omics_pipe.modules.fastqc import... |
from Numberjack import *
def get_model(data):
orders = Matrix(data.get("Orders"), data.get("Orders"))
colours = Matrix(data.get("Colours"), data.get("Orders"))
slabs = VarArray(data.get("Orders"), data.get("SlabSizes"))
model = Model(
# Objective
Minimise(Sum(slabs)),
# Mainta... |
# encoding: utf-8
"""nanotube.py - Window for setting up Carbon nanotubes and similar tubes.
"""
import gtk
from ase.gui.widgets import pack, cancel_apply_ok, oops
from ase.gui.setupwindow import SetupWindow
from ase.gui.pybutton import PyButton
from ase.structure import nanotube
import ase
import numpy as np
introte... |
import json
from fsgs.drivers.mamedriver import MameDriver
from fsgs.option import Option
from fsgs.platform import Platform
from fsgs.platforms.arcade.arcadeplatform import ArcadeLoader
NEOGEO_PLATFORM_ID = "neogeo"
NEOGEO_PLATFORM_NAME = "Neo-Geo"
NEOGEO_MODEL_MVS = "mvs"
NEOGEO_MODEL_MVS_US = "mvs/us"
NEOGEO_MODEL... |
"""
Django settings for infoscheme project.
Generated by 'django-admin startproject' using Django 1.8.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build p... |
"""
Digital Signature Algorithm (DSA)
| From: "NIST proposed in Aug 1991 for use in DSS."
| Published in: FIPS 186
| Available from:
| Notes:
* type: signature
* setting: integer groups
:Authors: J. Ayo Akinyele
:Date: 5/2011
"""
from charm.toolbox.integergroup import IntegerGroupQ
from... |
#!/usr/bin/env python3
"""
Created on 2013年11月17日
@author: qcg
"""
from os import listdir
from os.path import isfile, join, split, splitext, abspath
import shutil
root = '.'
root = abspath(root)
# for dirname,subdirs,filenames in os.walk(root):
# for d in subdirs:
# print(os.path.join(dirname, d))
# ... |
"""Settings for the third-party auth module.
Defers configuration of settings so we can inspect the provider registry and
create settings placeholders for only those values actually needed by a given
deployment. Required by Django; consequently, this file must not invoke the
Django armature.
The flow for settings reg... |
from solum.common import exception
from solum.objects import base
from solum.openstack.common import log as logging
LOG = logging.getLogger(__name__)
class Service(base.CrudMixin):
# Version 1.0: Initial version
VERSION = '1.0'
@classmethod
def _raise_not_found(cls, item_id):
"""Raise a not... |
#! A simple Psi 4 input script to compute MP2 from a RHF reference
import psi4
import time
import numpy as np
mol = psi4.geometry("""
H 0.5288 0.1610 0.9359
C 0.0000 0.0000 0.0000
H 0.2051 0.8240 -0.6786
H 0.3345 -0.9314 -0.4496
H -1.0685 -0.0... |
import logging
import requests
import json
import html2text
import hashlib
from operator import attrgetter
import model
import utils
requests.packages.urllib3.disable_warnings()
class ZendeskRequest(object):
_default_url = 'https://{}/api/v2/help_center/' + utils.to_zendesk_locale(model.DEFAULT_LOCALE) + '/{}'
... |
#-*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
PRJ_PATH = os.path.abspath(os.path.curdir)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Alice Bloggs', '<EMAIL>'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ... |
# 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 'DocumentVersion.signature_file'
db.add_column('documents_documentversion', 'signature_file... |
"""
Functions to test if two floats are equal to within relative and absolute
tolerances. This dynamically chooses a cython implementation if available.
"""
from debtcollector import removals
from numpy import allclose as _allclose, isinf
from dit import ditParams
__all__ = (
'close',
'allclose',
)
@remov... |
from Peach.transformer import Transformer
class HexString(Transformer):
"""Transform a string of bytes into the specified hex format.
Example:
gen = Static("AAAABBBB").setTransformer(HexString())
print gen.getValue()
41 41 41 41 42 42 42 42
gen = Static("AAAABBBB").setTransformer(HexStr... |
import math
import geometry as geom
from meshutils import mesh
import sfepy.base.progressbar as progressbar
def numlist2str(x):
s=""
for i in x:
s+="%d "%i
return s[:-1]
def getinsidepoint(pts):
direct=(pts[0]+pts[1]+pts[2])/3-pts[0]
return pts[0]+0.001*direct
def write_tetgen(g,filenam... |
from datetime import date
from dateutil.easter import easter
from dateutil.relativedelta import relativedelta as rd, FR, TH, MO, SU
from holidays.constants import JAN, MAR, APR, MAY, JUN, AUG, SEP, NOV, DEC
from holidays.holiday_base import HolidayBase
class Switzerland(HolidayBase):
PROVINCES = ['AG', 'AR', 'A... |
from StringIO import StringIO
import unittest
from compbio import phylo
from compbio.vis import transsvg
from rasmus.testing import make_clean_dir
from rasmus import treelib
stree_newick = """((((sde1:1,sde2:1):2,sdd:3):1,(spy1:2,spy2:2):2):1,see:5);"""
smapfile = StringIO("""\
SDE1* sde1
SDEG* sde2
SDD* sdd
SpyM3... |
from gettext import gettext as _
import logging
import os
from mongoengine import Q
from pulp.plugins.util.publish_step import PluginStep, \
AtomicDirectoryPublishStep, SaveTarFilePublishStep
from pulp.plugins.util import misc as plugin_utils
from pulp.server.controllers import repository as repo_controller
from ... |
"""Convenience classes for GTK."""
import sys
try:
import gtk
except RuntimeError, e:
if str(e) == "could not open display":
print "Could not connect to an X display"
sys.exit()
import os
import gobject
class WrappedTextView(gtk.TextView):
"""A custom TextView wid... |
# -*- coding: utf-8 -*-
from operator import itemgetter
from helpers.OperacoesTexto import *
"""
Indexação
1. Separação de palavras:
Extrair do início do documento o título, autor.
Varrer todo texto e sempre quando encontrar um espaço ou um símbolo especial considera uma palavra encerrada; (Obs.... |
#!/usr/bin/env python2.7
# coding: utf-8
# page.py
# ページ ハンドラ
# Last Change: 2011/11/14 16:57:25 +0900.
import os
import urllib
from google.appengine.ext import webapp
from google.appengine.ext.webapp import blobstore_handlers
from type import *
from util import *
import util
# ページのベースハンドラ
class PageBaseH... |
__author__ = 'thorwhalen'
import functools
class ParseSearchTerms(object):
def __init__(self,
html_pull=None,
html_pull_failure_action=None,
parser=None,
parser_failure_action=None,
parse_diagnosis=None,
parse_d... |
"""Initial htmengine
Revision ID: 57ab75d58038
Revises: None
Create Date: 2014-12-09 10:51:09.476572
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# Revision identifiers, used by Alembic. Do not change.
revision = '57ab75d58038'
down_revision = None
def upgrade():
""" ... |
import httplib2
import pprint
import sys
from apiclient.discovery import build
from oauth2client.client import SignedJwtAssertionCredentials
from apiclient import errors
# Email of the Service Account.
SERVICE_ACCOUNT_EMAIL = '<EMAIL>'
# Path to the Service Account's Private Key file.
SERVICE_ACCOUNT_PKCS12_FILE_PAT... |
# -*- coding: utf-8 -*-
"""ensure_no_update_service command.
@author: Tobias Hunger <<EMAIL>>
"""
from cleanroom.command import Command
from cleanroom.location import Location
from cleanroom.systemcontext import SystemContext
import typing
class EnsureNoUpdateServiceCommand(Command):
"""The ensure_no_update_s... |
from __future__ import division
# import iris tests first so that some things can be initialised before importing anything else
import iris.tests as tests
import unittest
import numpy as np
import iris.coords
from iris.coords import Cell
class TestCells(unittest.TestCase):
def setUp(self):
self.cell1 ... |
import random
from axelrod import Player, Game
"""IPD Strategies: http://www.prisoners-dilemma.com/strategies.html"""
class WinStayLoseShift(Player):
"""Win-Stay Lose-Shift, also called Pavlov."""
name = 'Win-Stay Lose-Shift'
classifier = {
'memory_depth': 1, # Memory-one Four-Vector = (1, 0, ... |
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... |
#!/usr/bin/env python3
import os, sys, yaml
from urllib.request import urlretrieve
class Settings_obj(yaml.YAMLObject):
yaml_tag = u'!MethFlow_Settings'
def __init__(self, **kwargs):
variables = ['shared', 'assemblies', 'adapters', 'output']
for var in variables:
if var i... |
from django.conf.urls import url
from django.contrib.auth import views as auth_views
from . import views
from . import views
urlpatterns = [
url(r'^login/$', auth_views.login, {'template_name': 'users\login.html'}, name='login'),
url(r'^password_reset/$', auth_views.password_reset, {'template_name': 'users\pa... |
#!/usr/bin/env python
"""Windows specific actions.
Most of these actions share an interface (in/out rdfvalues) with linux actions
of the same name. Windows-only actions are registered with the server via
libs/server_stubs.py
"""
import binascii
import ctypes
import logging
from typing import Text
import pythoncom
im... |
__author__ = "Andre Merzky, Ole Weidner"
__copyright__ = "Copyright 2013, The SAGA Project"
__license__ = "MIT"
import time
import saga
import radical.utils.testing as testing
import saga.utils.test_config as sutc
from copy import deepcopy
# --------------------------------------------------------------------... |
import simplegui
import random
print "Adam and David Blackjack has loaded"
CARD_SIZE = (73, 98)
CARD_CENTER = (36.5, 49)
card_images = simplegui.load_image("http://commondatastorage.googleapis.com/codeskulptor-assets/cards.jfitz.png")
CARD_BACK_SIZE = (71, 96)
CARD_BACK_CENTER = (35.5, 48)
card_back = simplegui.load_im... |
import math, Logger, utils.myMath, \
Mixer
MEMOIZED_CNT = 1000
class BayesianModelAvgMixer(Mixer.Mixer):
"""Make prediction using dirichlet-multinomials combined with bayesian
model averaging"""
def __init__(self):
Mixer.Mixer.__init__(self)
self.weights = {}
self.logFactTable = [0.0]... |
import pickle
if __name__ == "__main__":
"""
Let's you input the name of a server that has had its chat logged by the bot
and have it create a file of all users and their messages sent.
"""
server = ""
while server != "q":
server = input("What is the name of the server you will... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'RFIDScanDlg.ui'
#
# Created by: PyQt5 UI code generator 5.4.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_RFIDScanDlg(object):
def setupUi(self, RFIDScanDlg):
RFI... |
"""Implementation of gcloud bigquery tables show-rows.
"""
from googlecloudsdk.api_lib.bigquery import bigquery
from googlecloudsdk.api_lib.bigquery import schema_and_rows
from googlecloudsdk.calliope import base
from surface import bigquery as commands
class TablesShowRows(base.Command):
"""Displays selected rows... |
#!/usr/bin/env python
"""
Uses the official Khronos-XML specs to generate a
GL/GLES/EGL/GLX/WGL Loader made for your needs. Glad currently supports
the languages C, D and Volt.
"""
from __future__ import print_function
from collections import namedtuple
import importlib
from glad.spec import SPECS
import glad.lang
... |
#!/usr/bin/env python
# encoding: utf-8
import os
import re
import sys
import time
import json
import pprint
import hashlib
import argparse
import subprocess
from abc import ABCMeta, abstractmethod
from collections import namedtuple, Counter
CFG = namedtuple('Config', [
# How often to run the program on the dat... |
"""
Representation of a quiz
"""
import jinja2
default_quiz_template = jinja2.Template("""
{{ quiz_name }} (version: {{ quiz_version }})
{{ preamble }}
{% for question in questions %}
Question #{{ loop.index }}:
{{ question.render_question()}}
{% endfor %}
""")
default_marking_sheet_template = jinja2.Templa... |
import os
import csv
import operator
import itertools
import re
import logging
from mako.lookup import TemplateLookup
from mako.template import Template
from liboozie.oozie_api import get_oozie
from oozie.models2 import Job
from liboozie.submission2 import Submission
from indexer.conf import CONFIG_INDEXING_TEMPLATE... |
from testmodule import *
import sys
class TestWrites(TestRunner):
def __init__(self):
super().__init__()
def mthd(self):
import pysharkbite
securityOps = super().getSecurityOperations()
auths = pysharkbite.Authorizations()
auths.addAuthorization("blah1")
auths.addAuthorization("blah2")
sec... |
import logging
from odoo import models, fields
from odoo.addons.connector.unit.mapper import (mapping,
only_create,
none,
)
from ..unit.backend_adapter import CarepointCRUDAdapter... |
from ducktape.mark import matrix
from ducktape.mark.resource import cluster
from ducktape.utils.util import wait_until
from kafkatest.services.kafka import config_property
from kafkatest.services.zookeeper import ZookeeperService
from kafkatest.services.kafka import KafkaService
from kafkatest.services.verifiable_prod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.