content stringlengths 4 20k |
|---|
"""
Core module that handles the conversion from notebook to HTML
Plus some utilities
"""
from __future__ import absolute_import, print_function, division
import re
# IPython must be >4.0
# BeautifulSoup4 is required
from bs4 import BeautifulSoup
from pygments.formatters import HtmlFormatter
from nbconvert.exporte... |
import unittest
import csv
import random
from amaasutils.random_utils import random_string
from amaascore.csv_upload.data import Uploader
class DividendUploaderTest(unittest.TestCase):
def setUp(self):
self.longMessage = True # Print complete error message on failure
self.asset_manager_id = self... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 27 13:01:03 2015
@author: prlz77
@version: 0.1
"""
from scipy.io import loadmat
import numpy as np
from bilinear_interpolate import *
import os
import sys
import argparse
parser = argparse.ArgumentParser(description='Convert matconvnet into caffe model.')
parser.add_arg... |
#!/usr/bin/python
def main():
module = AnsibleModule(
argument_spec=dict(
ipa_admin_user=dict(default="admin", no_log=True),
ipa_admin_password=dict(required=True, no_log=True),
cn=dict(required=True),
uid=dict(required=True),
state=dict(default="... |
import time
import json
import binascii
import contextlib
import tornado.stack_context
from Crypto.PublicKey import RSA
from Crypto.Hash import SHA512
from Crypto.Signature import PKCS1_v1_5
current_idendata = (None,None)
class Auth:
def __init__(self):
global current_idendata
self._cache_hashma... |
import functools
from tempest import clients
from tempest.common.utils import data_utils
from tempest import config
from tempest import exceptions as exc
from tempest import test
CONF = config.CONF
def creates(resource):
"""Decorator that adds resources to the appropriate cleanup list."""
def decorator(f):... |
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Screens.Standby import TryQuitMainloop
from Screens.Console import Console
from Components.ActionMap import ActionMap
from Components.Sources.List import List
from Components.Label import Label
from ... |
"""Disk Config extension."""
from webob import exc
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.api.openstack import xmlutil
from nova.openstack.common.gettextutils import _
from nova.openstack.common import strutils
ALIAS = 'OS-DCF'
XMLNS_DCF = "http://docs.openstack.org/c... |
# -*- coding: utf-8 -*-
import pytest
import numpy as np
import json
import zmq
import struct
from .. import array as array_api
from ..message import ArrayMessage
from ...utils.sandwich import unsandwich_unicode
@pytest.fixture(params=[0,1,6])
def framecount(request):
"""The framecount to be sent as the message.... |
import logging
import os
import stat
import subprocess
import urlgrabber.grabber as grabber
import urllib2
import urlparse
import ftplib
import tempfile
from virtinst import _gettext as _
# This is a generic base class for fetching/extracting files from
# a media source, such as CD ISO, NFS server, or HTTP/FTP server
... |
import urllib
from oslo_log import log as logging
from oslo_serialization import jsonutils
import requests
import six
LOG = logging.getLogger(__name__)
class APIResponse(object):
"""Decoded API Response
This provides a decoded version of the Requests response which
include a json decoded body, far mor... |
"""Operations for linear algebra."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.p... |
# -*- coding: utf-8 -*-
"""
===============================================================================
module __Physics__: Base class for mananging pore-scale Physics properties
===============================================================================
"""
from OpenPNM.Base import logging
from OpenPNM.Networ... |
from splinter.browser import Browser
from time import sleep
import traceback
class Buy_Tickets(object):
# 定义实例属性,初始化
def __init__(self, username, passwd, order, passengers, dtime, starts, ends):
self.username = username
self.passwd = passwd
# 车次,0代表所有车次,依次从上到下,1代表所有车次,依次类推
self... |
from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.contrib.auth import login, logout, authenticate
from django.contrib.auth.forms import UserCreationForm
def logout_view(request):
"""Log the user out."""
logout(request)
... |
# -*- coding: utf-8 -*-
import attr
from cfme.utils.log import logger_wrap
from cfme.utils.quote import quote
from cfme.utils.wait import wait_for
from .plugin import AppliancePlugin, AppliancePluginException
class SystemdException(AppliancePluginException):
pass
@attr.s
class SystemdService(AppliancePlugin):
... |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
f... |
""" Test all Progress functions """
import json
import unittest
import unittest.mock as umock
from io import StringIO
from test.util import helper as test_helper
import foscambackup.util.helper as helper
from foscambackup.constant import Constant
from foscambackup.progress import Progress
from test.mocks import mock_f... |
import xml.etree.ElementTree as ET
import numpy as np
import pdb
# Read and write model related file
# Note that
# log sparse matrix: must be list consists of 3 lists, representing row_idx,
# col_idx, and log_val, respectively.
# log sparse 3d array: must be list consists of 4 lists, representing row_idx,
# col_idx, l... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_request,
compat_urlparse,
)
from ..utils import (
clean_html,
int_or_none,
parse_iso8601,
unescapeHTML,
)
class BlipTVIE(InfoExtractor):
_VALID_URL = ... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import argparse
import collections
import datetime
import itertools
import backtrader as bt
class SMACrossOver(bt.Signal):
params = (('p1', 10), ('p2', 30),)
def __init__(self):
sma1 = bt.in... |
"""Generic wrapper for read-eval-print-loops, a.k.a. interactive shells
"""
import os.path
import signal
import sys
import pexpect
PY3 = (sys.version_info[0] >= 3)
if PY3:
basestring = str
PEXPECT_PROMPT = u'[PEXPECT_PROMPT>'
PEXPECT_CONTINUATION_PROMPT = u'[PEXPECT_PROMPT+'
class REPLWrapper(object):
"""W... |
#!/usr/bin/python
import json
import csv
import sys
import os
class add_extended_publisher_data:
def __init__( self ):
# data from https://docs.google.com/spreadsheets/d/18IZ8KVdKIhyCeHHsJdAFxDScTReq4csw2LMXLYVBJZA/edit?usp=sharing
self.publisher_extended_data = {}
curr_p... |
#!/usr/bin/python
# MiloCreek BP MiloCreek
# Version 3.0 6/11/2014
#
# Local Execute Objects for RasPiConnect
# to add Execute objects, modify this file
#
#
#
# system imports
import sys
import subprocess
import os
import time
# RasPiConnectImports
import Config
import Validate
import BuildResponse
import R... |
import os
from app import App
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
MSG_BODY = "mysqldump backup"
class Smtp(object):
"""
https://docs.python.org/2/library/email-examples.html
"""
def __init__(self, a... |
from __future__ import unicode_literals
from future.builtins import filter, str
try:
from urllib.parse import urljoin
except ImportError: # Python 2
from urlparse import urljoin
from django.core.urlresolvers import resolve, reverse
from django.db import models
from django.utils.encoding import python_2_uni... |
import envi.registers as e_reg
import envi.archs.i386 as e_i386
# NOTE: all REX_R registers must *directly* follow their 3 bit variants
# in the table below
amd64regs = [
("rax",64),("rcx",64),("rdx",64),("rbx",64),("rsp",64),("rbp",64),("rsi",64),("rdi",64),
# The amd64 extended GP regs
("r8",64),("... |
"""Module that defines a wrapper object which logs comparisons.
This uses functools to generate rich comparison functions.
Equivalence test does not log as sorts never do equal test directly,
and with that every comparison logs exactly once.
"""
from functools import total_ordering
@total_ordering
class ComparisonL... |
"""
noseperf.wrappers.base
~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 DISQUS
:license: Apache License 2.0, see LICENSE for more details.
"""
from __future__ import absolute_import
import inspect
import time
from noseperf.stacks import get_stack_info, iter_stack_frames, frames_after_module
class Wrapper(object):
... |
"""RPC Implemention, originally written for the Python Idle IDE
For security reasons, GvR requested that Idle's Python execution server process
connect to the Idle process, which listens for the connection. Since Idle has
has only one client per server, this was not a limitation.
+--------------------------------... |
import argparse
import os
import subprocess
from typing import Any
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import BaseCommand, CommandError, CommandParser
from zerver.forms import check_subdomain_available
from zerver.lib.import_realm import do... |
import os
data_dir = os.environ.get("WEKAMOOC_DATA")
if data_dir is None:
data_dir = "." + os.sep + "data"
import tempfile
import weka.core.jvm as jvm
import weka.core.converters as converters
from weka.core.converters import Loader
from weka.core.classes import Random
from weka.classifiers import Classifier, Eval... |
import tensorflow as tf
import numpy as np
from btgym.algorithms.utils import batch_stack, batch_gather
from btgym.research.mldg.aac_1 import AMLDG_1
from btgym.research.mldg.memory import LocalMemory
class AMLDG_1d(AMLDG_1):
"""
AMLDG_1 + tunable g1 + t2d methods
"""
def __init__(
self,... |
import ast
import tenacity
from oslo_log import log as logging
from heat.common import exception
from heat.objects import sync_point as sync_point_object
LOG = logging.getLogger(__name__)
KEY_SEPERATOR = ':'
def _dump_list(items, separator=', '):
return separator.join(map(str, items))
def make_key(*compone... |
# cbpro/WebsocketClient.py
# original author: Daniel Paquin
# mongo "support" added by Drew Rice
#
#
# Template object to receive messages from the Coinbase Websocket Feed
from __future__ import print_function
import json
import base64
import hmac
import hashlib
import time
from threading import Thread
from websocket ... |
# unused: growable prime sieve
class Sieve:
def __init__(self):
self.bits = [0] * 16
self.primes = []
self.pos = 2
self.offset = 0
def expand(self):
length = len(self.bits) + self.offset
newlen = length * 2
self.bits = (newlen) * [0]
self.offset ... |
import re
import os
import logging
from autotest.client import utils
from autotest.client import lv_utils
from autotest.client.shared import error
from virttest import libvirt_storage
from virttest import utils_test
from virttest import virsh
from provider import libvirt_version
def run(test, params, env):
"""
... |
import numpy as np
from absl import flags
from fully_supervised.lib.train import ClassifyFullySupervised
from libml import data
from libml.augment import AugmentPoolCTA
from libml.ctaugment import CTAugment
from libml.train import ClassifySemi
FLAGS = flags.FLAGS
flags.DEFINE_integer('adepth', 2, 'Augmentation depth... |
# Create your views here.
import email
import json
import smtplib
import sys
from pprint import pprint
from django.shortcuts import render, render_to_response, HttpResponse
#, JsonResponse Django 1.7
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from django.temp... |
#!/usr/bin/env python
import struct
import serial
from time import sleep
import math
from pprint import pprint
import os
#SMORA = 'L'
SMORA = 'XL'
def retrieve_online_samples():
print "* Sending bytes..."
ser.write(struct.pack(">BHH", 0xFE, 200, 200))
print "* Waiting for answer..."
fd = open('statist... |
"""
gettext for openstack-common modules.
Usual usage in an openstack.common module:
from murano.openstack.common.gettextutils import _
"""
import copy
import functools
import gettext
import locale
from logging import handlers
import os
from babel import localedata
import six
_AVAILABLE_LANGUAGES = {}
# FIXME... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutClassMethods in the Ruby Koans
#
from runner.koan import *
class AboutClassAttributes(Koan):
class Dog:
pass
def test_objects_are_objects(self):
fido = self.Dog()
self.assertEqual(True, isinstance(fido, object))
def... |
import abc
from nova.virt import images
from nova.virt.libvirt import utils as libvirt_utils
class Snapshot(object):
@abc.abstractmethod
def create(self):
"""Create new snapshot"""
pass
@abc.abstractmethod
def extract(self, target, out_format):
"""Extract snapshot content to ... |
import sys
import time
import json
import requests
import pywiki
#Paramètres
version = "1.02"
src_lang = "en"
dst_lang = "fr"
searched_template = "Template:ja-noun"
editintro_template = "Utilisateur:Thibaut120094/template_ja"
# Main
def main():
pw_src = pywiki.Pywiki(src_lang+"wikit-NeoBOT")
pw_dst = pywiki.Pywik... |
#!/usr/bin/env python
import subprocess, shlex
import os
import time
import sys, gc
import signal
import atexit
from time import sleep
import sqlite3 as lite
con = None
procs = {}
def exit_handler(myprocs):
for ip, proc in myprocs.items():
if proc is not None:
print ip
os.killpg(p... |
from core_serializers import fields
import copy
import pytest
class ValidAndInvalidValues:
"""
Base class for testing valid and invalid field values.
"""
def setup(self):
self.field = copy.copy(self.base_field)
def test_valid_values(self):
"""
Ensure that valid values retu... |
"""
Manager for loading/accesing input device mappings.
"""
import json
import logging
import glob
import os
import copy
from .singleton import Singleton
from cflib.utils.callbacks import Caller
import cfclient
__author__ = 'Bitcraze AB/Allyn Bauer'
__all__ = ['ConfigManager']
logger = logging.getLogger(__name__)
... |
from pyjamas.ui.Label import Label
from pyjamas.ui.HTML import HTML
from pyjamas.ui.Grid import Grid
from pyjamas.ui.VerticalPanel import VerticalPanel
import utils
import go
class UserList(VerticalPanel):
def __init__(self, names):
VerticalPanel.__init__(self, Spacing=8, StyleName='userlist-error-box')
... |
import roles
class Universe:
def __init__(self, playerassignment, multiverse):
self.assignment = playerassignment
self.multiverse = multiverse
self.deadplayers = []
self.history = []
def getPlayerRole(self,player):
return self.assignment[player]
def isDead(self,player):
return player in... |
import re
import locale
locale.setlocale(locale.LC_ALL, "")
class ListUtils:
@staticmethod
def sampling(selection, offset=0, limit=None):
return selection[offset:(limit + offset if limit is not None else None)]
@staticmethod
def optimize_list(collection):
"""
Optimizes a col... |
import nose
import ckanext.dcatapit.harvesters.utils as utils
eq_ = nose.tools.eq_
ok_ = nose.tools.ok_
csw_harvester_config = {
"dataset_themes":"OP_DATPRO",
"dataset_places":"ITA_BZO",
"dataset_languages":"{ITA,DEU}",
"frequency":"UNKNOWN",
"agents":{
"publisher":{
"code":"p_... |
from __future__ import absolute_import;
from pymfony.component.config.definition import ConfigurationInterface;
from pymfony.component.config.definition.builder import TreeBuilder;
"""
"""
class ExampleConfiguration(ConfigurationInterface):
def getConfigTreeBuilder(self):
treeBuilder = TreeBuilder();
... |
"""
Contains a CLICommand that outputs help information.
Uses the following from :py:class:`swiftly.cli.context.CLIContext`:
======================= ============================================
io_manager For directing output.
======================= ============================================
"""
""... |
from mint.django_rest.rbuilder import errors
class InventoryError(errors.RbuilderError):
status = 400
class InvalidNetworkInformation(InventoryError):
"The system does not have valid network information"
status = 400
class UnknownEventType(InventoryError):
"An unknown event type was specified: %(even... |
# -*- coding: utf-8 -*-
import datetime
import time
import feedparser
from web.util.db import db
class Feed(db.Document):
title = db.StringField(required=True, default="No title")
link = db.StringField()
content = db.StringField()
summary = db.Stri... |
from freetype import *
import numpy as np
from PIL import Image
def render(filename = "Vera.ttf", hinting = (False,False), gamma = 1.5, lcd=False):
text = "A Quick Brown Fox Jumps Over The Lazy Dog 0123456789"
W,H,D = 680, 280, 1
Z = np.zeros( (H,W), dtype=np.ubyte )
face = Face(filename)
pen = V... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import json
import logging
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Text
from ras... |
from oslo_log import log as logging
from designate.backend import base
from designate import exceptions
from designate.i18n import _LI
from designate_infoblox.impl_infoblox import connector
from designate_infoblox.impl_infoblox import object_manipulator
LOG = logging.getLogger(__name__)
class InfobloxBackend(base.B... |
# Calling syntax: nodesetpoint.py [MQTT server address]
from __future__ import division, print_function
import numpy as np
import sys
from obnpy.obnnode import *
node = None # This will be the node object
setpoint = 0.0 # The current setpoint value
def initNode(): ... |
# -*- coding: utf-8 -*-
import os
import datetime
import httplib as http
from urllib2 import urlopen
from flask import request, make_response
from modularodm import Q
from framework.exceptions import HTTPError
from framework.flask import redirect
from framework.auth.utils import privacy_info_handle
from framework.u... |
from unittest.mock import Mock
import pandas as pd
import pytest
import pytz
from qstrader.portcon.order_sizer.dollar_weighted import (
DollarWeightedCashBufferedOrderSizer
)
@pytest.mark.parametrize(
"cash_buffer_perc,expected",
[
(-1.0, None),
(0.0, 0.0),
(0.5, 0.5),
(... |
'''
Cron trigger test case
@author: Huiyugeng
'''
import datetime
from task import task
from task import task_container
from task.trigger import cron_trigger
from example.jobs import time_job
from example.jobs import hello_job
container = task_container.TaskContainer()
def test_cron_trigger():
#start ... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import urllib.parse
from askomics.libaskomics.utils import pformat_generic_object
class AbstractedRelation(object):
"""
An AbstractedRelation represents the relations of the database.
There are two kinds of relations:
- ObjectProperty ... |
# cachans.py ---
#
# Description:
# Last-Updated: Sat Dec 8 15:48:17 2012 (+0530)
# By: subha
# Update #: 296
# URL:
# Keywords:
# Compatibility:
#
#
# Commentary:
#
#
#
#
# Change log:
#
#
#
#
# Code:
from numpy import where, exp, array
import moose
from channelbase import *
class ... |
import os.path
import typing as T
import click
# NOTE: imports are executed inside functions so missing dependencies don't break all commands
@click.group()
def cfgrib_cli() -> None:
pass
@cfgrib_cli.command("selfcheck")
def selfcheck() -> None:
from .messages import eccodes_version
print("Found: ecC... |
bl_info = {
"name": "BoltFactory",
"author": "Aaron Keith",
"version": (3, 9),
"blender": (2, 63, 0),
"location": "View3D > Add > Mesh",
"description": "Add a bolt or nut",
"wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
"Scripts/Add_Mesh/BoltFactory",
"tracke... |
from amfast.encode import encode, encode_packet
from amfast.context import EncoderContext
from amfast.class_def import ClassDefMapper
class Encoder(object):
"""A wrapper class for convenient access to amfast.encode.encode.
Encoder
========
* amf3 - bool - True to encode as AMF3.
* use_collection... |
''' Nose test running
Implements test and bench functions for modules.
'''
import os
import sys
import warnings
def get_package_name(filepath):
# find the package name given a path name that's part of the package
fullpath = filepath[:]
pkg_name = []
while 'site-packages' in filepath:
filepath... |
"""
Along with apiutils, implements an API-validating and versioning scheme for
rpc calls.
The ApiProxy is instantiated with a reference to the class of the server it is
communicating with, and uses that information to determine the expected format
of the parameters to the class. It freezes classes appropriately, ... |
import urllib
import sickbeard
from sickbeard import logger, common
from sickbeard.notifiers.xbmc import XBMCNotifier
from sickbeard.exceptions import ex
from xml.dom import minidom
class PLEXNotifier(XBMCNotifier):
def notify_snatch(self, ep_name):
if sickbeard.PLEX_NOTIFY_ONSNATCH:
... |
import os
from tests.beeswax.impala_beeswax import ImpalaBeeswaxException
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
from tests.common.impala_cluster import ImpalaCluster
from tests.common.skip import *
from tests.util.filesystem_utils import get_fs_path
from subprocess import c... |
#!/usr/env python
import matplotlib.pyplot as plt
import numpy as np
from astropy import table
from scipy import signal
if __name__ == "__main__":
'''
Correlation of 2 time series in an ascii file
'''
print '''
Time delay calculation between 2 time series
NOTE FOR USING 2 FILES:
The... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
from . import jims
from . import joes
counter = 0 # Global
class AboutScope(Koan):
#
# NOTE:
# Look in jims.py and joes.py to see definitions of Dog used
# for this set of tests
#
def test_dog_is_not_available_in_th... |
import os, subprocess, yaml
from test_api import get_test_paths, get_contents, config_path
def run_command(*args, **kwargs):
stdin_pipe = None
if kwargs.get('stdin_content'):
stdin_content = kwargs.pop('stdin_content')
stdin_pipe, stdin_pipe_write = os.pipe()
os.write(stdin_pipe_write,... |
import random
from string import ascii_letters, digits
from django import forms
from django.contrib.auth.models import User, Group
from django.contrib.sites.models import Site
from django.core.mail import send_mail
from django.template import loader, Context
from .models import UserProfile
class ProfileForm(forms.F... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This script runs stand-alone thermo estimation using RMG for a list of species in a
thermo input file. It generates an output.txt file containing the chemkin format
thermochemistry as well as a ThermoLibrary file containing the enthalpy, entropy, and
heat capacity dat... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2, 7):
pytestmark = pytest.mark.skip("F5 Ansible modules require Python >= 2.7")
from ansible.module_utils.basic import AnsibleModule
from ansible_collect... |
from __future__ import absolute_import
from typing import Any, Callable, Iterable, Tuple, Text
from collections import defaultdict
import datetime
import pytz
import six
from django.db.models import Q, QuerySet
from django.template import loader
from django.conf import settings
from zerver.lib.notifications import b... |
# operations.py
"""
Module operations
"""
#TODO: Guideline write an operation: arguments and return values for good history
import ctypes
import collections
import settings
import history
import wrappers
import __builtin__
from ROOT import THStack
class OperationError(Exception): pass
class TooFewWrpsError(Operation... |
import pandas as pd
from math import isnan
from datetime import datetime
class Result:
'''Result represents the live or backtest result of a successfully executed algorithm'''
def __init__(self, json):
'''Creates a new instance of Result'''
tag = 'result'
# LiveResults special... |
# -*- coding: utf-8 -*-
import unittest
from os import path
import txtflar
sample_dir = path.dirname(path.realpath(__file__)) + "/samples"
def sample(filepath):
return sample_dir + "/" + filepath
class TestRosettxta(unittest.TestCase):
tests = [
('en',
'eng-xx-doctor-who-2005-s02e04.srt... |
import cgi
import sys
from month import month_thai_short
DAY = 0
MONTH = 1
YEAR = 2
MONTH_NUM = 12
HEAD_ROW_NUM = 2
class Drawer(object):
def __init__(self, out, specs, max_x = 1024, max_y = 800):
self.max_x = max_x
self.max_y = max_y
self.out = out
self.specs = specs
if 'w... |
# -*- coding: utf-8 -*-
import re
import unittest
from mock import patch
import compare_string_to_template
class TestMakeRegexp(unittest.TestCase):
def setUp(self):
pass
def test_make_regexp_empty(self):
regexp = compare_string_to_template.make_regexp('')
self.assertIsNotNone(rege... |
#!/usr/bin/env python
from setuptools import setup, find_packages
import os
from cacheback import __version__
PACKAGE_DIR = os.path.abspath(os.path.dirname(__file__))
os.chdir(PACKAGE_DIR)
setup(name='django-cacheback',
version=__version__,
url='https://github.com/codeinthehole/django-cacheback',
... |
from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api import client
from sentry.api.bases.group import GroupEndpoint
from sentry.api.helpers.environments import get_environments
class GroupEventsOldestEndpoint(GroupEndpoint):
def get(self, request, group):
"... |
#!/usr/bin/env python3
# -*- coding: utf-8, vim: expandtab:ts=4 -*-
"""
Multi-Word Units (MWUs) Extractor based on (Silva and Lopes, 1999)
Luís Gomes <<EMAIL>>
Bibliography:
Joaquim Ferreira da Silva and Gabriel Pereira Lopes. A Local Maxima method
and a Fair Dispersion Normalization fo... |
from __future__ import print_function # so that print(blah) will work in console
from ie_stats import *
from GUIDefines import *
import GemRB
from GemRB import * # we dont want to have to type 'GemRB.Command' instead of simply 'Command'
def OnLoad():
consoleWin = GemRB.LoadWindow(0, "console", WINDOW_TOP|WINDOW_HCEN... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""rna_rosetta_min.py - a script to do minimization
The script takes the number of structures and the analyzed silence file and does the maths.
Job names will be as your silent file preceding with ~, .e.g ``~tha``.
http://www.sciencedirect.com/science/article/pii/S007668... |
#!/usr/bin/env python
"""Compute the Weissman Score of a compression algorithm.
The Weissman Score is a fictional performance score for lossless data
compression algorithms devised by Tsachy Weissman and Vinith Misra at
Stanford University and used in the HBO comedy series *Silicon Valley*.
The Weissman score W is co... |
"""Generation of Treadmill manifests from cell events.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import json
import logging
import os
import treadmill
from treadmill import appcfg
from treadmill i... |
import six
from ctypes import c_ulong, c_ushort, c_void_p, c_ulonglong, POINTER,\
Structure, c_wchar_p, WINFUNCTYPE, windll, byref, cast
class Status(object):
SEC_E_OK = 0
SEC_I_CONTINUE_NEEDED = 0x00090312
SEC_I_COMPLETE_AND_CONTINUE = 0x00090314
SEC_I_INCOMPLETE_CREDENTIALS = 0x00090320
SEC_... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
ClipByMask.py
---------------------
Date : September 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander bruy at gmail dot com
****************... |
'''
@author: Pengtao.Zhang
'''
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_util as test_util
from zstackwoodpecker.operations import net_operations as net_ops
import zstackwoodpecker.operations.image_operations as img_ops
import zstackwood... |
from django.test import TestCase
from django.core.management import call_command
from common.utils import BaseAuthenticatedClient
from frontend.forms import LoginForm, DashboardForm
from frontend.views import customer_dashboard, index, \
login_view, logout_view
from frontend.constants import SEARCH_TYPE
from newfi... |
from twisted.names import client, server, dns
from oonib.config import config
class DNSTestHelper(server.DNSServerFactory):
def __init__(self, authorities=None,
caches=None, clients=None,
verbose=0):
try:
host, port = config.helpers.dns.split(':')
... |
from setuptools import setup
from setuptools import find_packages
VERSION = '0.0.1'
additional_args = {
'zip_safe': False,
'packages': find_packages(),
'entry_points': {
'console_scripts': [
'crawl = crawler.crawl:main'
],
}
}
setup(
name='wcrawler',
version=VERSIO... |
"""Vroom vim management."""
import ast
from io import StringIO
import json
import re
import subprocess
import tempfile
import time
# Regex for quoted python string literal. From pyparsing.quotedString.reString.
QUOTED_STRING_RE = re.compile(r'''
(?:"(?:[^"\n\r\\]|(?:"")|(?:\\x[0-9a-fA-F]+)|(?:\\.))*")|
(?:'(?:[^'... |
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <<EMAIL>>'
__docformat__ = 'restructuredtext en'
from PyQt5.Qt import QWidget, pyqtSignal
from calibre.gui2 import error_dialog, question_dialog
... |
# -*- coding: utf8 -*-
import json
from django.contrib.auth.models import Permission
from django.test.client import RequestFactory
from unittest.mock import patch, Mock
from nose.tools import eq_
from parameterized import parameterized
from kitsune.journal.models import Record
from kitsune.sumo.utils import (
ch... |
# -*- coding: utf-8 -*-
import json
import os
from django.conf import settings
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
from s3direct.forms import LocalUploadForm
from s3direct.utils import create_upload_data
@csr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.