src stringlengths 721 1.04M |
|---|
from setuptools import setup, find_packages
install_requirements = ['pytz', 'tzlocal']
version = '2.2.0'
try:
import importlib
except ImportError:
install_requirements.append('importlib')
setup(
name='tasklib',
version=version,
description='Python Task Warrior library',
long_description=open... |
#!/usr/bin/env python
import sys
sys.path.append('gen-py')
from cse124 import Twitter
from cse124.ttypes import *
from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
try:
transport = TSocket.TSocket('localhost', 9090)
... |
import sys
import os
# ------------------------------------------------------------------------------
# User Authentication - Liftpass is a single user application (for now)
# ------------------------------------------------------------------------------
UserKey = b'd759214482924d10ac159b794e9424e7'
UserSecret = b'4bf... |
# sql/visitors.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Visitor/traversal interface and library functions.
SQLAlchemy schema and expressio... |
from PyQt5.QtCore import QAbstractListModel, pyqtSignal, Qt, QModelIndex, QMimeData
from PyQt5.QtGui import QFont
from urh import constants
from urh.signalprocessing.FieldType import FieldType
from urh.signalprocessing.MessageType import MessageType
from urh.signalprocessing.ProtocoLabel import ProtocolLabel
from urh.... |
'''
IDE: Eclipse (PyDev)
Python version: 2.7
Operating system: Windows 8.1
@author: Emil Carlsson
@copyright: 2015 Emil Carlsson
@license: This program is distributed under the terms of the GNU General Public License
'''
import Tkinter as tk, pygame
from Tkconstants import NW, BOTH
from View import GlobalFunc
from Co... |
import os, sys, shutil, copy
from .. import io as su2io
from .. import mesh as su2mesh
from decompose import decompose as su2decomp
def adaptation ( config , kind='' ):
# local copy
konfig = copy.deepcopy(config)
# check kind
if kind: konfig['KIND_ADAPT'] = kind
kind = konfig.get('KIN... |
try:
basestring
except NameError:
basestring = str
import copy
import logging
import zlib
from time import gmtime, strftime
from spock import utils
from spock.mcp import datautils, mcdata
from spock.mcp.mcdata import MC_VARINT
from spock.mcp.mcpacket_extensions import hashed_extensions
logger = logging.getL... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# ... |
# Copyright 2014 Mirantis Inc.
#
# 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 a... |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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 without restriction,
# including without... |
#!/usr/bin/env python
'''
Michael Hirsch 2014
Reads a .tex file (say, your PhD dissertation) and plots the counts vs time
TeXcount, then optionally can post that png to an HTML server.
'''
from texcounts import moddet
from texcounts.plots import plotTexStats
from texcounts.ssh import uploadSFTP
def main(texfn,uplo... |
from sympycore import *
def test_eye():
assert eye(3).tolist()==[[1,0,0],[0,1,0],[0,0,1]]
assert eye(3,2).tolist()==[[1,0],[0,1],[0,0]]
assert eye(2,3).tolist()==[[1,0,0],[0,1,0]]
assert eye(3,k=1).tolist()==[[0,1,0],[0,0,1],[0,0,0]]
assert eye(3,k=2).tolist()==[[0,0,1],[0,0,0],[0,0,0]]
asser... |
import time
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
from pySDC.implementations.datatype_classes.mesh import mesh, imex_mesh
from pySDC.implementations.problem_classes.AllenCahn_2D_FD import allencahn_fullyimplicit, allencahn_semiimplicit
# http://www.personal.psu.edu/qu... |
#
# THIS IS AN IMPLEMENTATION OF SUPPORT VECTOR MACHINES
#
# COPYRIGHT BELONGS TO THE AUTHOR OF THIS CODE
#
# AUTHOR : LAKSHMAN KUMAR
# AFFILIATION : UNIVERSITY OF MARYLAND, MARYLAND ROBOTICS CENTER
# EMAIL : LKUMAR93@UMD.EDU
# LINKEDIN : WWW.LINKEDIN.COM/IN/LAKSHMANKUMAR1993
#
# THE WORK (AS DEFINED BELOW) IS PROVIDED... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
from math import pow
import electrum.bitcoin as bitcoin
from electrum import paymentrequest as pr
from future import standard_library
from future.moves.urllib ... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import morfeusz2
import sys, os
import getopt
reload(sys)
sys.setdefaultencoding('utf8')
def usage():
print("Use: morfeusz.py przykład")
def m_number(f):
abbr = {
"sg" : ["sing.", "singular"],
"pl" : ["pl.", "plural" ],
}
htm... |
"""
homeassistant.components.http
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides an API and a HTTP interface for debug purposes.
For more details about the RESTful API, please refer to the documentation at
https://home-assistant.io/developers/api/
"""
import json
import threading
import logging
import time
import ... |
#!/usr/bin/env python
# Author: Pau Miquel i Mir <pau.miquel.mir@cern.ch> <pmm1g15@soton.ac.uk>>
# Date: July, 2016
#
# DISCLAIMER: This script is a prototype and a work in progress. Indeed, it is possible that
# it may not work for certain tutorials, and that it, or the tutorial, might need to be
# tweaked slightly to... |
# coding=utf-8
from __future__ import unicode_literals
import json
import datetime
import os
import re
import time
import traceback
from concurrent.futures import ThreadPoolExecutor
from mako.exceptions import RichTraceback
from mako.lookup import TemplateLookup
from mako.runtime import UNDEFINED
from mako.template i... |
import re
from urlparse import urlparse, parse_qs
from datetime import timedelta
from django.core.urlresolvers import reverse
from django.core.validators import MinValueValidator, MaxValueValidator
from django.db import models
from django.utils.safestring import mark_safe
from durationfield.db.models.fields.duration im... |
# -*- coding: utf-8 -*-
# options.py
# Global options file
# Copyright 2006 Giuseppe Venturini
# This file is part of the ahkab simulator.
#
# Ahkab 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, version 2 o... |
# -*- coding: utf-8 -*-
import locale
import re
import time
import urllib.parse
from pyload.core.utils import parse
from ..helpers import parse_html_form, set_cookie, search_pattern
from .account import BaseAccount
class XFSAccount(BaseAccount):
__name__ = "XFSAccount"
__type__ = "account"
__version__ ... |
"""
Priority Queue with Binary Heaps:
---------------------------------
Introduction:
------------
A priority queue acts like a queue in that you can dequeue and item by
removing it from the front. However, in a priority queue the logical order
of items inside the queu... |
from instal.firstprinciples.TestEngine import InstalTestCase, InstalCompareJSONTestCase
from instal.instalexceptions import InstalTestNotImplemented
import subprocess
import os
from instal.instalsolve import instal_solve_keyword
from instal.instalutility import temporary_text_file
import tempfile
class SolveCLIInvoca... |
from process_base import *
from targets import *
import subprocess
import os
class ProcessDeviceIo(ProcessBase):
def __init__(self, Controller, crashdump_folder, breakpoint_handler, pid, ph, unique_identifier, verbose, logger):
# Specific options
self.path_to_exe = b"C:\\Windows\\System32\\notepad.exe"
self.c... |
#!/usr/bin/env python
import yaml
import sys
import json
import os
import subprocess
__author__ = "Anoop P Alias"
__copyright__ = "Copyright 2014, PiServe Technologies Pvt Ltd , India"
__license__ = "GPL"
__email__ = "anoop.alias@piserve.com"
installation_path = "/opt/nDeploy" # Absolute Installation Path
backen... |
#!/usr/bin/env python
import logging
import os
import shutil
import subprocess
import sys
import tempfile
import warnings
from argparse import ArgumentParser
import django
from django.apps import apps
from django.conf import settings
from django.db import connection
from django.test import TestCase, TransactionTestCas... |
# from :http://docs.python.org/3.3/faq/programming.html#what-is-the-difference-between-arguments-and-parameters
# By returning a tuple of the results:
def func2(a, b):
a = 'new-value' # a and b are local names
b = b + 1 # assigned to new objects
return a, b # return new value... |
"""Basic quilt-like functionality
"""
__copyright__ = """
Copyright (C) 2005, Catalin Marinas <catalin.marinas@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This program is d... |
"""
A script that :
- computes a Masker from FDG PET (baseline uniform)
- cross-validates a linear SVM classifier
- computes a ROC curve and AUC
"""
import os, glob
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import nibabel as nib
from sklearn import svm
from sklearn import cross_validation
... |
"""
WSGI config for lacuna 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`` s... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016-2018 Kevin Deldycke <kevin@deldycke.com>
# and contributors.
# All Rights Reserved.
#
# 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 F... |
from pytesseract import image_to_string
from PIL import Image
import cv2
import numpy
import sys
if __name__ == '__main__':
f = open("test1.txt")
f = f.read()
for element in f:
str1 = element
position = ((712, 571), (725, 587))
dh = position[1][1] - position[0][1]
upper = position[0][... |
"""
Print statistics about the tweets collected by search_url_tweets.py
"""
import codecs
from collections import Counter, defaultdict
import json
import numpy as np
from . import __data__
def print_all(fname=__data__ + '/tweets.json'):
url2mentions = defaultdict(lambda: Counter())
url2score = defaultdict(l... |
# Copyright 2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Tests for DistroSeriesParent model class."""
__metaclass__ = type
from testtools.matchers import MatchesStructure
from zope.component import getUtility
from zope.interface.ver... |
#!/usr/bin/env python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
import os
import grove_128_64_oled as oled
import pynmea2 as nmea
import serial
import sys
from stat import *
from time import sleep
SENSOR = 'sound'
if sys.argv[1] != '':
SENSOR = sys.argv[1].strip().lower()
if SENSOR == 'sound':
fr... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... |
#! /usr/bin/env python
from __future__ import division #3/2=1.5 and 3//2=1
#adam-does# makes REMS masks
#adam-use # use on clusters where we have wayyyy to many exposures in the lensing band to make masks by hand (i.e. RXJ2129)
import sys
#from import_tools import *
import imagetools_light as imagetools
import astropy
... |
# Copyright 2015 The TensorFlow Authors. 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 required by applica... |
#! /usr/bin/python -Es
# Copyright (C) 2012-2013 Red Hat
# AUTHOR: Dan Walsh <dwalsh@redhat.com>
# AUTHOR: Miroslav Grepl <mgrepl@redhat.com>
# see file 'COPYING' for use and warranty information
#
# semanage is a tool for managing SELinux configuration files
#
# This program is free software; you can redistribute i... |
# Copyright 2019 Google LLC. 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 required by applicable law or a... |
from datetime import datetime, timedelta
from rdr_service.participant_enums import EnrollmentStatus, PhysicalMeasurementsStatus, QuestionnaireStatus, \
SampleStatus
from tests.helpers.unittest_base import BaseTestCase
class CheckEnrollmentStatusTest(BaseTestCase):
"""Tests checking enrollment status of parti... |
# -*- coding: utf-8 -*-
# HDTV - A ROOT-based spectrum analysis software
# Copyright (C) 2006-2009 The HDTV development team (see file AUTHORS)
#
# This file is part of HDTV.
#
# HDTV is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# ... |
from django.contrib.auth.forms import UserCreationForm,AuthenticationForm
from django import forms
from django.contrib.auth.models import User
class SimpleUserCreation(UserCreationForm):
email = forms.EmailField(required=True, widget=forms.widgets.TextInput(attrs={'class':'form-control','placeholder': 'Email Address'... |
# TODO: turn this into a set of functions
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import fsolve
def plot_diagrama_de_rafagas(ax, Vb, Vc, Vd, n_25fts, n_50fts, n_60fts, dv, units, vel_label):
ax.plot(np.arange(0, Vb[units], dv), [1 + n_60fts(vel) for vel in np.arange(0, Vb[u... |
# Copyright 2017-2021 TensorHub, Inc.
#
# 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 writ... |
#!/usr/bin/env python
from distutils.core import setup
templates = ['*.html','*.htm','*.xml','*.zpt','*.zpts']
images = ['*.gif','*.png','*.jpg','*.jpeg','*.js','*.htc']
styles = ['*.css']
setup(name="plasTeX",
description="LaTeX document processing framework",
version="0.9.3",
author="Kevin D. Smi... |
""" Example to demonstrate how the graph definition gets
bloated because of lazy loading
Author: Chip Huyen
Prepared for the class CS 20SI: "TensorFlow for Deep Learning Research"
cs20si.stanford.edu
"""
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
########################################... |
"""This module handles module definitions
which basically is a list of module definition."""
import ast
# Contains all project definitions for a program run
# Only used in framework_adaptor.py, but modified here
project_definitions = dict()
class ModuleDefinition():
"""Handling of a definition."""
module_... |
import argparse
import sys
import pikaptcha
from pikaptcha.ptcexceptions import *
from pikaptcha.tos import *
from pikaptcha.gmailv import *
from pikaptcha.url import *
from pgoapi.exceptions import AuthException, ServerSideRequestThrottlingException, NotLoggedInException
import pprint
import threading
import getopt
... |
from agility.maestro import Maestro
from agility.pololu.enumeration import uscSerialMode, ChannelMode, HomeMode
from agility.pololu.usc import Usc
from threading import Event
from shared.debug import Dummy
import numpy as np
import math
from matplotlib.path import Path
import matplotlib.pyplot as plt
from mpl_toolkits.... |
# Copyright 2016 Google Inc. 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 required by applicable law or agree... |
# coding: utf-8
"""
Wavefront REST API
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST ... |
# -*- coding: utf-8 -*-
#
import uuid
from django.db import models
from django.utils.translation import ugettext_lazy as _
from orgs.mixins.models import OrgModelMixin
class AbstractSessionCommand(OrgModelMixin):
RISK_LEVEL_ORDINARY = 0
RISK_LEVEL_DANGEROUS = 5
RISK_LEVEL_CHOICES = (
(RISK_LEVEL_... |
from datetime import datetime, timedelta
import logging
import itertools
from celery.canvas import chain
from celery.task import task
from django.db import transaction
from django.db.models import Q
from corehq.apps.products.models import SQLProduct
from corehq.apps.locations.models import Location, SQLLocation
from di... |
#coding=UTF-8
from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext
from pyspark.sql.types import *
from datetime import date, datetime, timedelta
import sys, re, os
st = datetime.now()
conf = SparkConf().setAppName('PROC_M_R_RET_CUST_ASSETS').setMaster(sys.argv[2])
sc = SparkContext(conf = conf)
s... |
# -*- coding: utf-8 -*-
# pylint: disable=I0011,C0103,W0404
""" Configuration.
For details, see https://pyrocore.readthedocs.io/en/latest/setup.html
Copyright (c) 2009, 2010, 2011 The PyroScope Project <pyroscope.project@gmail.com>
"""
# This program is free software; you can redistribute it and/or modify
# i... |
# ===============================================================================
# Copyright 2012 Jake Ross
#
# 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... |
from django.contrib.auth.models import User, Group, Permission
from django.contrib.auth.admin import UserAdmin, GroupAdmin
from libya_elections.admin_site import admin_site
class LibyaUserAdmin(UserAdmin):
list_display = ('username', 'email', 'first_name', 'last_name', 'is_active', 'is_staff',
... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Wordcount exercise
Google's Python class
The main() below is already defined and comp... |
import signal
class timeout:
"""
This class may be used as a decorator or as a context.
when used as a decorator the decorated function raises a TimeoutError
exception if the function has not returned after the maximum execution time.
when used as a context the code wrapped inside the co... |
import pytest
from lucid.modelzoo.aligned_activations import NUMBER_OF_AVAILABLE_SAMPLES
from lucid.modelzoo.vision_models import AlexNet, InceptionV1
from lucid.recipes.activation_atlas import activation_atlas, aligned_activation_atlas
from lucid.misc.io import save
# Run test with just 1/10th of available samples
s... |
# Natural Language Toolkit: Chunk parsing API
#
# Copyright (C) 2001-2016 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Named entity chunker
"""
from __future__ import print_function
import os, re, pickle
from xml.etree im... |
from datetime import time
import sys
import random
import numpy as np
import Orange
from Orange.data import Table, ContinuousVariable, DiscreteVariable
from Orange.statistics.basic_stats import DomainBasicStats
from Orange.widgets.settings import Setting
from Orange.widgets.utils.datacaching import getCached, setCache... |
# Copyright 2016, Tresys Technology, LLC
#
# This file is part of SETools.
#
# SETools is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 2.1 of
# the License, or (at your option) any later ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import dbApi
import time
import collections
import gc
import pyximport
pyximport.install()
import deduplicator.cyHamDb as hamDb
import traceback
import server.decorators
@server.decorators.Singleton
class TreeProxy(hamDb.BkHammingTree):
pass
'''
The idea here is that we ha... |
#!/usr/bin/env python
# -*- coding: utf-8 -*
from __future__ import print_function
import os
import sys
try:
from standardoptions import set_up_logging, add_standard_arguments
except:
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'buildscripts'))
from standardoptions im... |
"""
mpstest8.py
A test of manipulating matrix product states with numpy.
2014-08-25
"""
import numpy as np
import matplotlib.pyplot as plt
from cmath import *
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
def main():
#test3()
getMPS(randomState(2,5),3).shape
def test3():
""" Test MPS ... |
import os
import re
import sys
def check_input(new_ver):
""" Ensure that user input matches the format X.X.X """
pat = r'\d+.\d+.\d+'
if not re.match(pat, new_ver):
print("The new version must be in the format X.X.X (ex. '0.6.0')")
return True
def version_update(new_ver, file_array):
... |
#!/usr/bin/env python
###############################################################################
##
## Copyright (C) 2014 Greg Fausak
##
## 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... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2019-05-10 11:49
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('formazione', '0034_auto_201904... |
import threading
import socket
import sys
LISTEN_TO_UDP_PORT = 5000
SEND_TO_UDP_IP = "127.0.0.1"
SEND_TO_UDP_PORT = 5000
TCP_SERVER_IP = "127.0.0.1"
TCP_SERVER_PORTS = [5000,5001,5002,]
class TCP_UDP_forwarder(threading.Thread):
def __init__(self, tcp_server_ip, tcp_server_port):
threading.Thre... |
# Invaders
# Copyright (C) 2013 Maximilian Hunt
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is ... |
from ngrams import is_english_word, read_word_freq
def test_is_english_word():
assert is_english_word('a')
assert is_english_word('word')
assert is_english_word('first-class')
assert is_english_word("don't")
assert is_english_word('u.s.a.')
assert is_english_word('B')
assert is_english_wo... |
"""Search. Get tweets."""
from abc import ABCMeta, abstractmethod
from .config import import_name
def search_manager_from_config(config, **default_init):
"""Get a `SearchManager` instance dynamically based on config.
`config` is a dictionary containing ``class`` and ``init`` keys as defined
in :mod:`bi... |
import numpy as np
from numpy.core._rational_tests import rational
from numpy.testing import (
assert_equal, assert_array_equal, assert_raises, assert_,
assert_raises_regex, assert_warns,
)
from numpy.lib.stride_tricks import (
as_strided, broadcast_arrays, _broadcast_shape, broadcast_to,
broadcast_... |
# Copyright 2012 the Melange authors.
#
# 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/LICENSE2.0
#
# Unless required by applicable law or agreed to in writi... |
# -*- coding: utf-8 -*-
#
# django-codenerix
#
# Copyright 2017 Centrologic Computational Logistic Center S.L.
#
# Project URL : http://www.codenerix.com
#
# 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 ... |
#! /usr/bin/env python2
# A set of tools, functions, aliases and more used in RecBlast.
import os
import tarfile
import zipfile
from time import strftime, sleep
import re
import subprocess
from Bio import Entrez
import shutil
Entrez.email = "recblast@gmail.com"
Entrez.tool = "RecBlast"
TEMP_FILES_PATH = os.getcwd()
... |
import copy
class Error(Exception):
"""Base exception class for the dexml module."""
pass
class ParseError(Error):
"""Exception raised when XML could not be parsed into objects."""
pass
class RenderError(Error):
"""Exception raised when object could not be rendered into XML."""
pass
class Xm... |
"""
Tools for generating forms based on Peewee models
(cribbed from wtforms.ext.django)
"""
from collections import namedtuple
from wtforms import Form
from wtforms import fields as f
from wtforms import validators
from wtfpeewee.fields import ModelSelectField
from wtfpeewee.fields import SelectChoicesField
from wtfpe... |
from flexmock import flexmock
from mcloud.service import Service
import os
from mcloud.container import PrebuiltImageBuilder, DockerfileImageBuilder
from mcloud.test_utils import mock_docker
import pytest
from twisted.internet import defer
@pytest.inlineCallbacks
def test_image_builder_prebuilt():
with mock_doc... |
# -*- coding: utf-8 -*-
# from __future__ import unicode_literals
# Django settings for grnglow project.
import os
import qiniu.conf
qiniu.conf.ACCESS_KEY = ""
qiniu.conf.SECRET_KEY = ""
# 存在七牛上的图片的文件名前缀
QINIU_FILE_PREFIX = 'grnglow'
# 七牛图片存储的 URL
QINIU_IMG_URL = ''
DEBUG = True
TEMPLATE_DEBUG = DEBUG
HOME_PAGE_UR... |
"""
Django settings for gettingstarted project, on Heroku. For more info, see:
https://github.com/heroku/heroku-django-template
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/se... |
from pandas.io.excel._base import ExcelWriter
from pandas.io.excel._util import _validate_freeze_panes
class _OpenpyxlWriter(ExcelWriter):
engine = 'openpyxl'
supported_extensions = ('.xlsx', '.xlsm')
def __init__(self, path, engine=None, mode='w', **engine_kwargs):
# Use the openpyxl module as t... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from morphine import features
from morphine.feature_extractor import FeatureExtractor
from morphine.basetagger import PartialTagger
from pymorphy2.tagset import OpencorporaTag
class POSFeatureExtractor(FeatureExtractor):
IGNORE = {
'Arch', 'i... |
# pypot dynamixel library
import pypot.dynamixel as pd
# threading for motor control
import threading
import time
import numpy as np
# get ports
# USB2AX will be the first result
ports = pd.get_available_ports()
# connect to port
motors = pd.DxlIO(ports[0], 1000000)
# get list of motors
print 'Scanning for motors...'... |
# This Python file uses the following encoding: utf-8
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
setup(
name='python-rake',
#... |
import unittest
import scipy.misc as misc
import preprocessing
import utilities
class PreprocessingTest(unittest.TestCase):
def setUp(self):
unittest.TestCase.setUp(self)
self.training_directory = 'unit_test_resources/data/train'
self.test_directory = 'unit_test_resources/data/test'
... |
"""
WSGI config for tf2rpg 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`` s... |
from __future__ import division, absolute_import, print_function
import numpy
import subprocess
import shlex
import ctypes
from ctypes import (
byref,
WINFUNCTYPE,
c_ubyte,
sizeof,
POINTER,
Structure,
)
from ctypes.wintypes import (
POINT,
RECT,
DWORD,
LPARAM,
... |
from os.path import join
from consul_kv.utils import loop_dictionary, inflate_key_value_pair, dict_merge
def map_dictionary(dictionary):
"""
Map a dictionary to key value pairs where each key is an
accumulation of all levels of nesting for the value
:param dict dictionary: to flatten into a k/v mappi... |
__author__ = 'Stuart Gordon Reid'
__email__ = 'stuartgordonreid@gmail.com'
__website__ = 'http://www.stuartreid.co.za'
"""
File description
"""
class Solution(object):
solution = []
def __init__(self, solution, problem):
"""
Abstract initialization method for a solution to some optimization ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2002 - 2014 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the variables filter dialog.
"""
from __future__ import unicode_literals
from PyQt5.QtWidgets import QDialog, QDialogButtonBox
from Debugger.Config import ConfigVarTypeDispStrings
import Prefer... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
# This file is distributed under the terms of the GNU General Public license.
# Copyright (C) 1999 Aloril (See the file COPYING for details).
from common import const
class Memory:
def __init__(self, a_map):
self.events = []
self.map = a_map
def destroy(self):
self.events = None
... |
# -*- coding: utf-8 -*-
"""
tests.test_fixtures
~~~~~~~~~~~~~~~~~~~
Test the fixture support.
:copyright: 2010, Pascal Hartig <phartig@rdrei.net>
:license: BSD
"""
from nose.tools import eq_
from flask import g
from rdrei.tests.utils import get_fixture_path
from rdrei.application import app
from rdrei.utils.redis_fi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.