src stringlengths 721 1.04M |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "James Eric Pruitt"
__all__ = [ "serialize", "deserialize" ]
__version__ = "2009.11.04"
import collections
itertable = {}
for t in [set, frozenset, list, tuple, dict]:
itertable[t] = t.__name__
itertable[t.__name__] = t
supporteddict = {
int: (r... |
#!/usr/bin/python3
##########################################
# File Name:main.py
# Author:Group 3
# Date:10/24/14
# Class:360
# Assignment:Tic-Tac-Toe
# Purpose:to run the game
########################################
from game import *
"""
The Main Module
"""
def main() :
""""initiliaze a new game and set the name... |
#!python
__author__ = "Curtis L. Olson < curtolson {at} flightgear {dot} org >"
__url__ = "http://gallinazo.flightgear.org"
__version__ = "1.0"
__license__ = "GPL v2"
import fileinput
import math
import string
import spline
import Polygon
import Polygon.Shapes
import Polygon.Utils
class Cutpos:
def __init__(se... |
# /usr/bin/env python
# Copyright 2013, 2014 Justis Grant Peters and Sagar Jauhari
# This file is part of BCIpy.
#
# BCIpy 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
... |
"""
Implementation and management of scan objects.
A scan object (e.g. :class:`artiq.language.scan.LinearScan`) represents a
one-dimensional sweep of a numerical range. Multi-dimensional scans are
constructed by combining several scan objects.
Iterate on a scan object to scan it, e.g. ::
for variable in self.sca... |
"""Base class for MultiGraph."""
# Copyright (C) 2004-2016 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from copy import deepcopy
import networkx as nx
from networkx.classes.graph import Graph
from network... |
import torch
import numbers
import string
import numpy as np
import array
import genevo as g
import math
from ..common import GTestCase
class OptimizationCases(GTestCase):
def run_simple_problem_test(self, opt_factory):
max_iteration = 50
target = 42.0
treshold = 0.1
def fitness_fu... |
# ===============================================================================
# Copyright 2016 dgketchum
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance
# with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
import pytz
from data.fixtures.test_data import SimpleAssignmentTestData, LTITestData
from compair.tests.test_compair import ComPAIRLearningRecordTestCase
from compair.core import db
from flask_login import current_app
from compair.learning_... |
""" Create portable serialized representations of Python <code> Objects"""
import new
import pickle
def co_dumps(s):
"""pickles a code object,arg s is the string with code
returns the code object pickled as a string"""
co = compile(s,'<string>','exec')
co_tup=[co.co_argcount,co.co_nlocals, co.co_stac... |
# -*- coding: utf-8
from django.apps import AppConfig
import logging
class DjangoSafariNotificationsConfig(AppConfig):
name = 'django_safari_notifications'
verbose_name = 'Safari Push Notifications'
version = 'v1'
service_base = 'push'
userinfo_key = 'userinfo'
logger = logging.getLogger('djan... |
from django.apps.registry import Apps
from django.db import models
# Because we want to test creation and deletion of these as separate things,
# these models are all inserted into a separate Apps so the main test
# runner doesn't migrate them.
new_apps = Apps()
class Author(models.Model):
name = models.CharFie... |
"""
A widget containing a collection of panels with tools
for designing the rig blueprint.
"""
from pulse.vendor.Qt import QtWidgets
from .designviews.controls import ControlsPanel
from .designviews.general import GeneralPanel
from .designviews.joints import JointsPanel, JointOrientsPanel
from .designviews.sym import... |
#!/usr/bin/env python3
# encoding: UTF-8
import os
import pkgutil
import sys
from xml.sax.saxutils import escape as xmlescape
if sys.version_info.major == 3:
import urllib.request as urllibreq
else:
import urllib2 as urllibreq
def send_dlna_action(device, data, action):
action_data = pkgutil.get_data(
... |
#!python
# -*- encoding: utf-8 -*-
# F_cashFlow_B_pnl.py
# Greg Wilson, 2012
# gwilson.sq1@gmail.com
# This software is part of the Public Domain.
# This file is part of the NOVUS Entrepreneurship Training Program.
# NOVUS is free software: you can redistribute it and/or modify
# it under the terms of the ... |
#!/usr/bin/env python3
# Copyright (c) 2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool descendants/ancestors information update.
Test mempool update of transaction descendants/ances... |
# tipi_editor
#
# TIPI web administration
#
# Corey J. Anderson ElectricLab.com 2017
# et al.
import os
import logging
import uuid
from ti_files import ti_files
from subprocess import call
logger = logging.getLogger(__name__)
basicSuffixes = ('.b99', '.bas', '.xb')
tipi_disk_base = '/home/tipi/tipi_disk'
def load... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... |
from django.shortcuts import render
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from video.form import *
from video.models import Video,Comment
from django.contrib.auth.decorators import login_required
import ... |
# -*- coding: utf-8 -*-
"""
Routines for quality control of GeoDanmark map data
Copyright (C) 2016
Developed by Septima.dk for the Danish Agency for Data Supply and Efficiency
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... |
import re
import datetime
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from django.utils.six import text_type as str
from django.test import TestCase
from django.contrib.admin.sites import AdminSite
from django.test.client import RequestFactory
from django.core.urlr... |
# -*- coding: utf-8 -*-
# @Author: massimo
# @Date: 2016-03-10 17:09:49
# @Last Modified by: massimo
# @Last Modified time: 2016-03-11 15:54:15
import numpy as np
import theano
import theano.tensor as T
from collections import OrderedDict
import gzip
import cPickle as pkl # python 2.x
import time
def load_gz(gz... |
#!/usr/bin/env python
""" Drone Pilot - Control of MRUAV """
""" pix-hover-controller.py: Script that calculates pitch and roll movements for a vehicle
with a pixhawk flight controller and a MoCap system in order to keep a specified position. """
__author__ = "Aldo Vargas"
__copyright__ = "Copyright 2016 Altax.ne... |
# -*- coding: utf-8 -*-
# This file is part of the hdnet package
# Copyright 2014 the authors, see file AUTHORS.
# Licensed under the GPLv3, see file LICENSE for details
import os
import numpy as np
from hdnet.spikes import Spikes
from hdnet.util import hdlog
from test_tmppath import TestTmpPath
class TestSpikes(T... |
"""private_base will be populated from puppet and placed in this directory"""
import logging
import os
import dj_database_url
from lib.settings_base import CACHE_PREFIX, ES_INDEXES, KNOWN_PROXIES, LOGGING
from .. import splitstrip
import private_base as private
ENGAGE_ROBOTS = False
EMAIL_BACKEND = 'django.core.m... |
#
# Foris
# Copyright (C) 2019 CZ.NIC, z.s.p.o. <http://www.nic.cz>
#
# 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.
#
... |
import numpy as np
np.random.seed(1337)
from keras.models import Sequential, model_from_json
import json
import argparse
np.set_printoptions(threshold=np.inf)
parser = argparse.ArgumentParser(description='This is a simple script to dump Keras model into simple format suitable for porting into pure C++ model')
parser.... |
# coding: utf-8
import subprocess
import tempfile
import os
def register_schtasks(task_name, path, user, password=None, admin=True):
command = ["schtasks.exe", "/Create", "/RU", user]
if password:
command += ["/RP", password]
command += [
"/SC", "ONLOGON", "/TN", task_name, "/... |
import json
import logging
import os
import sys
import uuid
from pika import spec
from tornado import concurrent, locks, testing, web
from sprockets.mixins import amqp
from tests import base
LOGGER = logging.getLogger(__name__)
def setUpModule():
try:
with open('build/test-environment') as f:
... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
from decimal import Decimal
import os.path
import pytest
AWS_DYNAMODB_CONFIG_PATH = os.path.join(os.path.dirname(__file__), 'dynamodb.yml')
@pytest.fixture
def fake_config():
import cc_dynamodb
cc_dynamodb.set_config(
table_config=AWS_DYNAMODB_CONFIG_PATH,
aws_access_key_id='<KEY>',
... |
import json
import unittest
from unittest.mock import MagicMock
from pyenvi import PyEnvi
from pyenvi.exceptions import *
class PyEnviTest(unittest.TestCase):
"""
PyEnviTest: a test class for PyEnvi.
TODO: These tests are a little sketchy, due to the static nature of PyEnvi.
Furthermore, they do not t... |
"""
analysis/info.py
Functions to plot and analyze information theory-related results
Contributors: salvadordura@gmail.com
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from __future__ import absolute_import
try:
basestring
except NameError:
... |
import time
import json
import pickle
import sys
from .log import null_logger, ERROR
__all__ = ['DEFAULT_PORT', 'STOP', 'KILL', 'STATUS', 'bytes', 'basestring',
'show_err', 'FirstBytesCorruptionError', 'FirstBytesProtocol',
'JSONCodec', 'PickleCodec']
DEFAULT_PORT = 54543
if bytes is str:
... |
# gizela
#
# Copyright (C) 2010 Michal Seidl, Tomas Kubin
# Author: Tomas Kubin <tomas.kubin@fsv.cvut.cz>
# URL: <http://slon.fsv.cvut.cz/gizela>
#
# $Id$
from gizela.pyplot.FigureLayoutErrEll import FigureLayoutErrEll
from gizela.pyplot.PlotPoint import PlotPoint
from gizela.util.Error import Error
#import mat... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Feature manipulation utilities"""
from warnings import warn
import numpy as np
import scipy.signal
from .._cache import cache
from ..util.exceptions import ParameterError
__all__ = ['delta', 'stack_memory']
@cache(level=40)
def delta(data, width=9, order=1, axis=-1, ... |
from django.utils.translation import ugettext_noop as _
from api import status
from api.api_views import APIView
from api.exceptions import PreconditionRequired, ObjectAlreadyExists
from api.task.response import SuccessTaskResponse
from api.utils.db import get_object
from api.dc.utils import remove_dc_binding_virt_obj... |
"""
various help tools for the IPOL demo environment
"""
import os
import time
from datetime import datetime
import gzip as _gzip
#
# TINY STUFF
#
prod = lambda l : reduce(lambda a, b : a * b, l, 1)
#
# BASE_APP REUSE
#
def app_expose(function):
"""
shortcut to expose app actions from the base class
""... |
#!/usr/bin/python
import os, sys
import hashlib
import MySQLdb
import MySQLdb.cursors
from datetime import datetime
import time
import shutil
import magic
import argparse
import re
sys.path.append('%s/../lib' %(os.path.dirname(__file__)))
import metahivesettings.settings
#from metahive.scanners mport *
import metahiv... |
# Copyright (c) 2012 - 2015 EMC Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... |
import sys
# open cust_info_login.txt
with open('cust_info_login.txt', 'r') as file:
customer_login = file.read().strip().split('\n')
cust_login = list(map(lambda c: c.split(' _ '), customer_login))
# save usernames and passwords to a list
users_and_passwords = []
for customer in cust_login:
unpw = [customer[2]... |
#
# OpenVZ containers hauler module
#
import os
import shutil
import p_haul_cgroup
import p_haul_netifapi as netif
import p_haul_fsapi as fsapi
import p_haul_netapi as netapi
import fs_haul_shared
import fs_haul_subtree
name = "ovz"
vzpid_dir = "/var/lib/vzctl/vepid/"
vz_dir = "/vz"
vzpriv_dir = "%s/private" % vz_dir... |
"""
Django settings for webapp project.
Generated by 'django-admin startproject' using Django 1.9.9.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# ... |
import json
import os
from AppKit import NSApplication, NSStatusBar, NSMenu, NSMenuItem, NSVariableStatusItemLength, NSImage
from PyObjCTools import AppHelper
from project_cron.models import Schedule
from threading import Timer
from project_cron.utils import logutil
class App(NSApplication):
def finishLaunching(... |
# Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""
A package providing :class:`iris.cube.Cube` analysis support.
This module defines a suite of :class:`~iris.analysis.Aggreg... |
"""
Parse a bibtex file and only print those entries within a certain number of years
"""
import os
import sys
import argparse
import datetime
from pybtex.database import parse_file, BibliographyData
if __name__ == "__main__":
now = datetime.datetime.now()
earlyyear = now.year - 4
parser = argparse.Argum... |
# -*- coding: utf-8 -*-
# Copyright 2017-2019 The pyXem developers
#
# This file is part of pyXem.
#
# pyXem 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 optio... |
import sys
import os
import sqlite3
import prep_shapefile
import arcpy
from arcpy.sa import *
import datetime
import simpledbf
arcpy.CheckOutExtension("Spatial")
value = sys.argv[1]
zone = sys.argv[2]
final_aoi = sys.argv[3]
cellsize = sys.argv[4]
analysis = sys.argv[5]
start = int(sys.argv[6])
stop = int(sys.argv[7]... |
#
# This file is part of CAVIAR.
#
# CAVIAR 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.
#
# CAVIAR is distributed in the hope that ... |
from setuptools import setup, find_packages
import os
version = '0.0.1'
setup(name='sparc.i18n',
version=version,
description="i18n components for the SPARC platform",
long_description=open("README.md").read() + "\n" +
open("HISTORY.txt").read(),
# Get more strings from
... |
import functools
import json
import time
from collections import OrderedDict
from datetime import date, datetime, timedelta
from django import http
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import PermissionDenied
from django.core.paginator import Paginator
from ... |
"""
Powershell method to inject inline shellcode.
Builds a metasploit .rc resource file to psexec the powershell command easily
Original concept from Matthew Graeber: http://www.exploit-monday.com/2011/10/exploiting-powershells-features-not.html
Note: the architecture independent invoker was developed independently ... |
from __future__ import nested_scopes
#Coroutines are more generic than subroutines. The lifespan of subroutines is dictated by last in, first out (the last subroutine called is the first to return); in contrast, the lifespan of coroutines is dictated entirely by their use and need.
#
#The start of a subroutine is th... |
import flask
from flask import render_template
from flask import request
from flask import url_for
import uuid
import json
import logging
# Date handling
import arrow # Replacement for datetime, based on moment.js
import datetime # But we still need time
from dateutil import tz # For interpreting local times
# OA... |
# -*- coding: utf-8 -*-
""" Sahana Eden Deployments Model
@copyright: 2011-2015 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software w... |
from datetime import date
from django.test import TestCase
from mock import patch
from people.models import Person
@patch("people.models.date")
class TestAgeCalculation(TestCase):
def test_age_full_obvious(self, mock_date):
mock_date.today.return_value = date(1977, 9, 3)
mock_date.side_effect = ... |
from __future__ import unicode_literals, absolute_import, print_function
__author__ = 'danishabdullah'
from redis import StrictRedis
KEY = [
"DEL",
"DUMP",
"EXISTS",
"EXPIRE",
"EXPIREAT",
"MIGRATE",
"MOVE",
"PERSIST",
"PEXPIRE",
"PEXPIREAT",
"PTTL",
"RENAME",
"REN... |
# -*- coding: utf-8 -*-
"""Modoboa limits constants."""
from __future__ import unicode_literals
import collections
from django.utils.translation import ugettext_lazy as _
DEFAULT_USER_LIMITS = collections.OrderedDict((
("domains", {
"content_type": "admin.domain", "label": _("Domains"),
"help":... |
import plusfw
from datetime import datetime
from requests import get, post, codes, exceptions
import json
class Html:
"""
"""
base_uris = {
plusfw.LABEL_PFW: "https://www.plusforward.net",
plusfw.LABEL_QLIVE: "https://www.plusforward.net",
plusfw.LABEL_QIV: "https://www.plusforwa... |
import steam
import urllib2
import datetime
import os
from steam.api import HTTPError, HTTPTimeoutError
from steam.user import ProfileNotFoundError
from .. import db, sentry
from ..models import get_or_create
from ..tf2.models import TF2Item, TF2Class, TF2BodyGroup, TF2ClassModel, TF2EquipRegion, all_classes
from ..tf2... |
import json
import os
import urllib2
def IsChannelOnline(channelName):
url ="https://api.twitch.tv/kraken/streams/" + channelName
try:
contents = urllib2.urlopen(url)
except:
print "Error: Failed to get status of \"" + channelName + "\""
return False
contents = json.load(content... |
"""Test the Verisure config flow."""
from __future__ import annotations
from unittest.mock import PropertyMock, patch
import pytest
from verisure import Error as VerisureError, LoginError as VerisureLoginError
from homeassistant import config_entries
from homeassistant.components.dhcp import MAC_ADDRESS
from homeass... |
#! python3
# 0
# 0 000000 0 000000 0 0 000000000 00000000 00000000 0 000000
# 0 00 0 0 0 00 00 0 0 0 0 0 0
# 0 00 0 0 00000 00 000000 00 0 ... |
import re
import logging
from collections import OrderedDict
from python_kemptech_api.api_xml import (
get_data,
is_successful,
get_error_msg)
from python_kemptech_api.exceptions import (
KempTechApiException,
SubVsCannotCreateSubVs,
RealServerMissingVirtualServiceInfo,
RealServerMissingLoa... |
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
# -*- coding: utf-8 -*-
"""
livereload.watcher
~~~~~~~~~~~~~~~~~~
A file watch management for LiveReload Server.
:copyright: (c) 2013 - 2015 by Hsiaoming Yang
"""
import os
import glob
import time
try:
import pyinotify
except ImportError:
pyinotify = None
class Watcher(object):
"""A fil... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
'''
#####################################
# โโ โฌ โฌ โฌโโโ โโฆโโโโโโฌโ #
# โ โฉโโ โ โโโค โโโ โ โ #
# โโโโดโโโโโโโโ โโฉโโโโ โด #
# โโโโโโโโโโโฌโโฌ โฌโโโโฌโโโโโ #
# โโโโ โโโค โ โโโโโโคโโฌโโโค #
# โโโโโโโ โด โโดโโด โดโดโโโโโ #
###... |
import os
import json
import re
import sys
import requests
import lxml.html
from datetime import datetime, timedelta
from pprint import pprint as PP
from time import sleep
from urlparse import urljoin
from .utils import hn_relatime_to_datetime, get_story_id
from .logger import logger
def parse_date_header(date):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*
import socket
import sys
import subprocess
import re
import time ,threading
import Adafruit_DHT
from Adafruit.Adafruit_BMP180 import BMP085
exitFlag = 0
messdaten="0|0|0|0|0|0"
def cpu_temperatur():
cpu_temp = subprocess.check_output("/opt/vc/bin/vcgencmd measure_temp... |
import bson
import cherrypy
import functools
import json
import logging
import traceback
logger = logging.getLogger(__name__)
def json_exposed(fn):
@cherrypy.expose
@functools.wraps(fn)
def wrapper(*args, **kwargs):
try:
code = 200
value = fn(*args, **kwargs)
excep... |
"""MODELLER, a package for protein structure modeling
See U{http://salilab.org/modeller/} for further details.
@author: Andrej Sali
@copyright: 1989-2010 Andrej Sali
"""
__all__ = ['energy_data', 'io_data', 'environ', 'group_restraints',
'ModellerError', 'FileFormatError', 'StatisticsError',
... |
# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Utility functions for string operations."""
import random
import string
import uuid
BLANK = ''
COMMA = ',' # comma is used as delimiter for multi-choice values
LESS = '<' # need exclude this character ... |
#!/usr/bin/env python3
import os
from gi.repository import Gtk
from src.Constants import MAIN_FOLDER
from src.Constants import UI_FOLDER
from src.Common import createTag
from src.Common import createCategory
from src.Interface.Utils import BasicInterface
from src.Interface.Utils import acceptInterfaceSignals
from ... |
from __future__ import print_function
import math
import os
import urllib
if __name__ == '__main__':
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'astrometry.net.settings'
from astrometry.net.log import *
from astrometry.net.tmpfile import *
from astrometry.net import settings
def plot_sdss_image(wcsfn, ... |
import unittest
import invoiced
import responses
class TestPaymentSource(unittest.TestCase):
def setUp(self):
self.client = invoiced.Client('api_key')
@responses.activate
def test_endpoint_and_create_bank_account(self):
responses.add('POST',
'https://api.invoiced.co... |
import json
from collections import defaultdict
import boto3
from botocore.exceptions import ClientError
from six import iteritems
from six.moves import filter, map
from datadog_checks.base import AgentCheck
from datadog_checks.base.errors import CheckException
class AwsPricingCheck(AgentCheck):
def check(self,... |
import expipe
import os.path as op
import os
import json
overwrite = True
base_dir = op.join(op.abspath(op.dirname(op.expanduser(__file__))), 'templates')
templates = expipe.core.FirebaseBackend("/templates").get()
for template, val in templates.items():
identifier = val.get('identifier')
if identifier is No... |
def basicfizzbuzz(n):
if n % 3 == 0 and n % 5 == 0:
return 'FizzBuzz'
elif n % 3 == 0:
return 'Fizz'
elif n % 5 == 0:
return 'Buzz'
else:
return str(n)
print "\n".join(basicfizzbuzz(n) for n in xrange(1, 100))
print "\n"
print "*****************************************... |
import os
import cPickle
import matplotlib.pyplot as plt
from datasets import DatasetManager
def plot_cost(results, data_name, plot_label):
plt.figure(plot_label)
plt.ylabel('Accuracy (m)', fontsize=30)
plt.xlabel('Epoch', fontsize=30)
plt.yscale('symlog')
plt.tick_params(axis='both', which='major... |
# -*- coding: utf8 -*-
import json
from default import Test
from nose.tools import assert_raises
from pybossa_github_builder.github_repo import GitHubRepo, GitHubURLError
from pybossa_github_builder.github_repo import InvalidPybossaProjectError
from mock import MagicMock, patch
class TestGitHubRepo(Test):
def s... |
# -*- coding: utf-8 -*-
# Scrapy settings for curation_spider project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/e... |
from enigma import eDVBVolumecontrol, eTimer
from Tools.Profile import profile
from Screens.Volume import Volume
from Screens.Mute import Mute
from GlobalActions import globalActionMap
from config import config, ConfigSubsection, ConfigInteger
profile("VolumeControl")
#TODO .. move this to a own .py file
class VolumeC... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
from django.contrib import a... |
import sys
from PyQt4.QtGui import QApplication
from PyQt4.QtCore import QUrl
from PyQt4.QtWebKit import QWebPage
import bs4 as bs
import urllib.request
import time
class Client(QWebPage):
def __init__(self, url):
self.app = QApplication(sys.argv)
QWebPage.__init__(self)
self.loadFinished.... |
from __future__ import absolute_import
from __future__ import unicode_literals
import datetime
import logging
import operator
from functools import reduce
import enum
from docker.errors import APIError
from . import parallel
from .config import ConfigurationError
from .config.config import V1
from .config.sort_servi... |
"""Script for creating releases."""
import os
import sys
import shutil
if len(sys.argv) != 2:
print "Usage: ./" + sys.argv[0] + " <tag/version>"
sys.exit(1)
version = sys.argv[1]
if 'GOPATH' not in os.environ:
print "GOPATH not set."
sys.exit(1)
VARIANTS = [('linux', ['386', 'amd64', 'arm']),
... |
import unittest
from pathlib import Path
import pytest
from pyontutils.utils import get_working_dir
from pyontutils.config import auth
from pyontutils.integration_test_helper import _TestScriptsBase, Folders, Repo
import neurondm
class TestScripts(Folders, _TestScriptsBase):
""" woo! """
only = tuple()
lasts =... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
import sys
import time
import codecs
import numpy as np
import tensorflow as tf
from tensorflow.contrib.tensorboard.plugins import projector
from tensorflow.python.ops import rnn, rnn_cell
from tensorflow.contrib import legacy_seq2seq as seq2seq
import sys
reloa... |
"""Perform validation of final calls against known reference materials.
Automates the process of checking pipeline results against known valid calls
to identify discordant variants. This provides a baseline for ensuring the
validity of pipeline updates and algorithm changes.
"""
import collections
import contextlib
im... |
# MoFileReaderBuilder.py
# Last modified by : terpsichorean, 2014-03-31
# RoR target version : 0.4.0.7
# OS X target version : 10.9.2
# Win32 target version : n/a
# Win64 target version : n/a
# Description : Builds MoFileReader.
# RoR :
# documentation : none on RoR site.
# documentation req... |
# -*- coding: utf-8 -*-
import logging
from django.db import models
from system.official_account.models import OfficialAccount
from system.rule.models import Rule
logger_rule_match = logging.getLogger(__name__)
class RuleMatchManager(models.Manager):
"""
ๅพฎไฟก่งๅๅๅค่กจ Manager
"""
def add(self, rule, plu... |
import datetime
import html
import io
import logging
from lxml import etree
logger = logging.getLogger('bvspca.animals.petpoint')
error_logger = logging.getLogger('bvspca.animals.petpoint.errors')
def extract_animal_ids(animal_summary_etree):
animal_ids = []
for animal in animal_summary_etree.findall('.//ad... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Ryan Scott Brown <ryansb@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.0',... |
import json
import time
import openpyxl
import requests
from indra.config import get_config
from .processor import SofiaJsonProcessor, SofiaExcelProcessor
def process_table(fname):
"""Return processor by processing a given sheet of a spreadsheet file.
Parameters
----------
fname : str
The nam... |
#!/usr/bin/env python
# coding: utf-8
import wx
import wx.richtext
import wx.lib
import wx.lib.wordwrap
import os
import sys
import uuid
import tempfile
import optparse
import StringIO
import time
import locale
import hashlib
import zshelve
import PyRTFParser
import xtea
from wx.lib.embeddedimage import PyEmbeddedI... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from common import *
from os import path
from os import remove
from glob import glob
# Imports automรกticos
from gluon.cache import Cache
from gluon.globals import Request, Response, Session
from gluon.http import HTTP, redirect
from gluon.sql import DAL, Field, SQLDB
fr... |
# coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2016
import unittest
import sys
import itertools
from enum import IntEnum
import datetime
import decimal
import random
from streamsx.topology.schema import StreamSchema
from streamsx.topology.topology import *
from streamsx.topology.tester imp... |
# -*- coding: utf-8 -*-
"""
This file is part of OctoPNP
OctoPNP 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.
Oc... |
# -*- coding: utf-8 -*-
import zipfile
import requests
import json
from threading import Thread
from rest_framework.renderers import JSONRenderer, JSONPRenderer
from rest_framework import permissions, viewsets, views
from rest_framework import status
from django.utils.decorators import method_decorator
from django.vie... |
#
# Collective Knowledge: CK-powered CLBlast crowd-tuning
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
cfg={} # Will be updated by CK (meta description of this module)
work={} # Will be updated ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.