src stringlengths 721 1.04M |
|---|
# Copyright Tom SF Haines
#
# 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, soft... |
import unittest
import mock
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
@testing.parameterize(*testing.product({
'shape': [(3, 2), ()],
... |
# Create your views here.
from django.shortcuts import render_to_response,get_object_or_404
from django.template import Context, loader,RequestContext
from django.http import HttpResponse,HttpResponseRedirect
from polls.models import Poll,Choice
from django.core.urlresolvers import reverse
from django.http import Http4... |
import uuid
from sqlalchemy import Column, Integer, String, ForeignKey, Table, Text
from sqlalchemy.orm import relationship, backref
import database as db
from core.types import GUID
class Level():
id_ = Column(Integer, primary_key=True)
name = Column(String)
def __unicode__(self):
return "%s" % s... |
# Copyright 2021 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... |
from t_core.messages import Packet
from t_core.iterator import Iterator
import time
from multiprocessing import Process
from core.himesis_utils import expand_graph, shrink_graph, delete_graph, disjoint_model_union, print_graph, graph_to_dot, get_preds_and_succs
from copy import deepcopy
import numpy.random as npr... |
import sys, json, gc, os
try:
import psutil
except ImportError as e:
pass # google crap engine (get it if you need it!)
from dez.memcache import get_memcache
from dez.http.application import HTTPApplication
from .routes import static, cb
from cantools import config
sys.path.insert(0, ".") # for dynamically load... |
from django.core import serializers
import os
from datetime import datetime
from django.core.management.base import BaseCommand
from xbrowse_server.base.models import Project, ProjectCollaborator, Project, \
Family, FamilyImageSlide, Cohort, Individual, \
FamilySearchFlag, ProjectPhenotype, IndividualPhenotype,... |
# -*- coding: utf-8 -*-
import base64
import re
import time
from datetime import timedelta
from pyload.core.network.request_factory import get_url
from ..anticaptchas.ReCaptcha import ReCaptcha
from ..base.simple_downloader import SimpleDownloader
class ShareonlineBiz(SimpleDownloader):
__name__ = "Shareonline... |
"""
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 use this ... |
__author__ = 'tinyms'
#coding=UTF8
import os
import sys
import re
import codecs
import hashlib
import json
#import urllib.request
#import urllib.parse
import time
import datetime
import decimal
import uuid
from imp import find_module, load_module, acquire_lock, release_lock
from tornado.template import Template
# impor... |
from flask_wtf import Form
from wtforms import SubmitField, StringField, TextAreaField, IntegerField
from wtforms.validators import DataRequired, Length
from flask_wtf.file import FileAllowed, FileField
class ItemForm(Form):
"""It defines the fields to render in WTForms for each item
"""
name = StringFiel... |
#! /usr/bin/env python
from __future__ import print_function
from openturns import *
from os import getenv
TESTPREAMBLE()
try:
Log.Show(Log.INFO)
# 1st sample
f = open('sample.csv', 'w')
f.write(
"X1;X2;X3;X4\n-1.2;2.3;3.4;-4.5\n5.6;-6.7;7.8;8.9\n-0.1;3.2;5.1;7.5\n")
f.close()
aSampl... |
#!/usr/bin/python
# -*- coding: utf-8 -*- # coding: utf-8
#
# IBM Storwize V7000 autodiscovery script for Zabbix
#
# 2013 Matvey Marinin
#
# Sends volume/mdisk/pool LLD JSON data to LLD trapper items "svc.discovery.<volume-mdisk|volume|mdisk|pool>"
# Use with "_Special_Storwize_Perf" Zabbix template
#
# See also http:/... |
from django.http import HttpResponse
from vodkamartiniqa.views.helpers import get_answers
from vodkamartiniqa.views.helpers import get_questions
import json
#from django.core.serializers.json import DjangoJSONEncoder
# TODO get answers via ajax with start and end
def get_answers_ajax(request, question_id, start=0, end... |
"""
pynet-rtr1 (Cisco IOS) 184.105.247.70
pynet-rtr2 (Cisco IOS) 184.105.247.71
pynet-sw1 (Arista EOS) 184.105.247.72
pynet-sw2 (Arista EOS) 184.105.247.73
pynet-sw3 (Arista EOS) 184.105.247.74
pynet-sw4 (Arista EOS) 184.105.247.75
juniper-srx 184.105.247.76
"""
from getpass import getpass
password = ... |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
#import os
from PySide2 import QtCore
## Python3 compatibility
#if os.getenv("PINGUINO_PYTHON") is "3":
##Python3
#from configparser import RawConfigParser
#else:
##Python2
#from ConfigParser import RawConfigParser
from ..methods.dialogs import Dialogs
... |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2019, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.conf import s... |
"""Retrieves, stores, and otherwise manages program options."""
##
# Copyright 2013 Chad Spratt
# 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/... |
"""
Module for serialization/deserialization and handling of KNX addresses.
The module can handle:
* individual addresses of devices.
* (logical) group addresses.
* xknx internal group addresses.
The module supports all different writings of group addresses:
* 3rn level: "1/2/3"
* 2nd level: "1/2"
* Free format: "1... |
# -*- coding: utf-8 -*-
import numpy as np
import abel
import matplotlib.pyplot as plt
IM = np.loadtxt("data/VMI_art1.txt.bz2")
legendre_orders = [0, 2, 4] # Legendre polynomial orders
proj_angles = range(0, 180, 10) # projection angles in 10 degree steps
radial_step = 1 # pixel grid
smoothing = 1 # smoothing 1/e... |
#!/usr/bin/env python
# Copyright (C) 2012 pamalt Developer.
# This file is part of pamalt - https://github.com/bostonlink/pamalt
# See the file 'LICENSE' for copying permission.
# PaloAlto Log query Maltego transforms module
# Author: David Bressler (@bostonlink)
import urllib, urllib2
import time, sys
import xml.et... |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import math
from .Cesar import Cesar
class AnalisisFrecuencia(object):
"""docstring for AnalisisFrecuencia"""
def __init__(self, mensaje):
super(AnalisisFrecuencia, self).__init__()
self.frecuenciaIngles = {
'A': 0.08167, 'B': 0.01492, 'C': 0.02782, 'D': 0.0425... |
# given a pem file ... openssl req -new -x509 -keyout yourpemfile.pem -out yourpemfile.pem -days 365 -nodes
import sys
import ssl
import time
import signal
import threading
import BaseHTTPServer, SimpleHTTPServer
def http_worker():
httpd = BaseHTTPServer.HTTPServer(('localhost', 8080), SimpleHTTPServer.SimpleHTTP... |
# -*- 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... |
"""
Topological sort.
From Tim Peters, see:
http://mail.python.org/pipermail/python-list/1999-July/006660.html
topsort takes a list of pairs, where each pair (x, y) is taken to
mean that x <= y wrt some abstract partial ordering. The return
value is a list, representing a total ordering that respects all
the inpu... |
from __future__ import print_function
import os
import sys
file_to_module_name = dict()
def init_module_names():
modules = [item for item in sys.modules.items()]
file_to_module_name.update(dict(
(getattr(mod, '__file__').replace('.pyc', '.py'), name)
for name, mod in modules
if hasatt... |
import struct
import zlib
from cStringIO import StringIO
def read_woff_header(f):
"""
Read the WOFF header from a file-like object, consuming the file up to the
end of the header.
Reference here: http://www.w3.org/TR/WOFF/#WOFFHeader
"""
fmt = '>IIIHHIHHIIIII'
buf = f.read(struct.calcsize... |
# WARNING: Do not edit by hand, this file was generated by Crank:
#
# https://github.com/gocardless/crank
#
from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors
class CurrencyExchangeRatesService(base_service.BaseService):
"""Service class that provides acc... |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Blob helper functions."""
import numpy as np
import cv2
def im_lis... |
import pexpect, sys
from os import environ , path
from time import sleep
from copy import deepcopy
import unittest
class Comp:
def __init__(self, name, cmd):
self.init_name = name
self.name = self.init_name
self.cmd = cmd
self.staus = 0
self.output = ''
self.extra_p... |
import time
import colorsys
import sys
from PySide import QtGui, QtOpenGL, QtCore
from PySide.QtCore import QTimer, SIGNAL
from PySide.QtGui import QLabel
import copy
import numpy as np
from OpenGL.GL import *
from OpenGL.GLU import *
import centerpoints.data_set
class Color:
def __init__(self, color=None):
... |
# Copyright 2014 - Savoir-Faire Linux 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 ... |
#!/usr/bin/env python3
# Copyright (c) 2009-2019 The Bitcoin Core developers
# Copyright (c) 2014-2019 The DigiByte Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test various fingerprinting protections.
If a s... |
# -*- coding: utf-8 -*-
import urlparse,urllib2,urllib,re
import os
import sys
from core import config
from core import logger
from core.item import Item
DEBUG = True
CHANNELNAME = "channelselector"
def getmainlist():
logger.info("channelselector.getmainlist")
itemlist = []
# Obtiene el id... |
#!/usr/bin/env python
"""
Test XML backend
"""
import os
import sys
import time
import unittest
import pymoca.parser as mo_parser
from pymoca.backends.xml import analysis, generator, sim_scipy
from pymoca.backends.xml import parser as xml_parser
# get matplotlib from analysis, since logic for plotting
# without displa... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module's main purpose is to act as a script to create new versions
of ufunc.c when ERFA is updated (or this generator is enhanced).
`Jinja2 <http://jinja.pocoo.org/>`_ must be installed for this
module/script to function.
Note that this does *no... |
from __future__ import division
import sys
from table import *
from where2 import *
from dtree import *
def csv2py(f):
sym2num = {} # hold all the characters with assinged numbers that never seen
def str2num(t, p=0):
for r,row in enumerate(t._rows):
for c, cell in enumerate(row.cells):
if isinsta... |
#!/usr/bin/python3
class Tape:
'''
A generic implementation of a record tape for a Turing Machine.
It's bounded on the left side and unbounded on the right side.
It stores only Python integers.
'''
def __init__(self):
self.reset()
def inc_val(self):
self.cells[self.pointer... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#将/dd 文件夹下的所有东西复制到/tmp
import json
import os,shutil,platform,sys
from collections import defaultdict
print (U"我是中文,但是我是一个好中文,不是你们现象的那样。")
print (r'^time/plus/\d{1,2}/$');
maven_repo_root = "D:\\mrp"
maven_onedrive_repo = "D:\\tmp1"
# shutil.copytree(maven_repo_root, maven_... |
# -*- coding: utf-8 -*-
from __future__ import with_statement
from cms.admin.forms import PageForm
from cms.api import create_page
from cms.models import Page, Title
from cms.models.placeholdermodel import Placeholder
from cms.models.pluginmodel import CMSPlugin
from cms.plugins.text.models import Text
from cms.sitemap... |
#!/usr/bin/env python
#
# fit2tcx - convert a FIT file to a TCX file
#
# Copyright (c) 2012, Gustav Tiger <gustav@tiger.name> [https://github.com/Tigge/FIT-to-TCX/]
# Copyright (c) 2014-2016, Ian Grant <ian@iangrant.me> [https://github.com/imgrant/fit2tcx]
#
# Permission is hereby granted, free of charge, to any person... |
import unittest
import unittest.mock
import io
import re
from g1.bases import datetimes
from g1.operations.cores import alerts
class ConfigTest(unittest.TestCase):
def test_destination_slack(self):
with self.assertRaisesRegex(AssertionError, r'expect true'):
alerts.Config.SlackDestination()... |
"""Race condition tests for ndb."""
import logging
logging.basicConfig(
level=logging.INFO,
format='%(threadName)s:%(levelname)s:%(name)s:%(message)s')
import threading
import time
from google.appengine.api import memcache
from google.appengine.ext import testbed
from ndb import context
from ndb import eventlo... |
#!/usr/bin/env python
# coding: utf8
from nose.tools import assert_equal, assert_not_equals
from nose import SkipTest
#lines above are inserted automatically by pythoscope. Line below overrides them
from Goulib.tests import *
from Goulib.itertools2 import *
class TestTake:
def test_take(self):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated Thu Dec 1 09:58:36 2011 by generateDS.py version 2.7a.
#
import sys
import getopt
import re as re_
etree_ = None
Verbose_import_ = False
( XMLParser_import_none, XMLParser_import_lxml,
XMLParser_import_elementtree
) = range(3)
XMLParser_import_li... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import os, curses, curses.ascii, subprocess
import glob
from time import sleep
class Wrapper(object):
deploy_dir = os.path.join("..", "virtualisation", "autodeploy")
def __init__(self, deploy_json):
self.dir = os.path.dirname(deploy_json)
self.... |
#!/eecs/research/asr/mingbin/python-workspace/hopeless/bin/python
import numpy, os, codecs, itertools, logging
from gigaword2feature import *
from scipy.sparse import csr_matrix
from sklearn import preprocessing
logger = logging.getLogger( __name__ )
def LoadED( rspecifier, language = 'eng' ):
entity2cls = { ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# freeseer - vga/presentation capture software
#
# Copyright (C) 2011, 2013 Free and Open Source Software Learning Centre
# http://fosslc.org
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Licens... |
import os
from setuptools import setup
# Load version
__version__ = None
# exec(open('isoclassify/version.py').read())
# Load requirements
requirements = None
with open('requirements.txt') as file:
requirements = file.read().splitlines()
# mwdust requires manual install to download maps
# TODO: add warning if `m... |
import random
def random_color(base, variation):
'''
Returns a random, bounded color value.
Args:
base: Some base color component (between 0 and 255)
variation: The degree of variation (around the color)
Returns:
A random color.
'''
color = base + (2 * random.random()... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... |
"""mcl/sparse.py
Code for performing the Markov Cluster Algorithm using scipy.sparse.spmatrix as
the underlying matrix. (AKA "sparse" matrices)"""
import numpy
import scipy.sparse as sparse
from datetime import datetime
_DEFAULT_ROW_THRESH=1E-14
_DEFAULT_CHECK_ITERATIONS=50
def _delta(A,B):
"""Computes the diffe... |
import collections
### HyperOptimization Parameters ###
Scalar = collections.namedtuple("Scalar", ("scale", "default", "min", "max"))
Either = collections.namedtuple("Either", ("alternatives",))
def linear(default, min = None, max = None):
return Scalar("linear", default, min, max)
def logarithmic(default, min ... |
import unittest
from werkzeug.routing import Map, Rule
from app.http import router
sample = {
'/a': '1',
'/b': {
'a': '21',
'b': '22'
}
}
class TestHelpers(unittest.TestCase):
def test_dict_to_url_map(self):
list_sample = router._rdict_to_rlist(sample)
flatten = r... |
#!/usr/bin/env python
import numpy as np
import boldsim.sim as sim
import timeit
import argparse
parser = argparse.ArgumentParser(description='Run BOLDsim benchmarks.',
epilog='By default no benchmarks will be run, so make sure to specify one!')
parser.add_argument('-a', '--all', acti... |
# -*- coding: utf-8 -*-
import os
import time
import pickle
import logging
import datetime
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.http import HttpResponseForbidden
from django.http import HttpResponse, HttpRe... |
# -*- encoding: utf-8 -*-
"""Test for Roles CLI
:Requirement: Role
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: UsersRoles
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from math import ceil
from random import choice
from fauxfactory import gen_string
from robottelo.cli.bas... |
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'scrapers'))
sys.path.append("..")
from datetime import datetime
from pymongo import MongoClient
from database import *
import error
import re
import sync
import exam_team as examTeamApi
def importExamTeam ( school_id, branch_id, test_team_id... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (c) 2010, Combustion Ingenieros Ltda.
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistribution... |
""" This module contains testcase_361_ebs_deferred_detach test """
import time
import multiprocessing
import logging
from testcase import Testcase
from dva.work.common import RESULT_FAILED
class testcase_361_ebs_deferred_detach(Testcase):
"""
Perform EBS test:
- Create the volume
- Attach the volume
... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.auth.views import login, logout
from tastypie.api import Api
from brainblog.views import *
from brainblog.api import UserResource
from brainindex.api import TextThoughtAjaxResource
admin.autodiscover()
# rest ap... |
# -*- coding: utf-8 -*-
#
# WebhookDB documentation build configuration file, created by
# sphinx-quickstart on Wed Feb 25 10:08:26 2015.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... |
import json
import requests
import pyxform.survey_from
from guardian.shortcuts import assign_perm
from django.http import HttpResponseBadRequest, HttpResponse, HttpResponseRedirect
from django.conf import settings
from django.utils.encoding import smart_unicode
from django.contrib.auth.decorators import login_required... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import firecares.firestation.models
import django.contrib.gis.db.models.fields
class Migration(migrations.Migration):
dependencies = [
('firestation', '0066_staffing_other_apparatus_type'),
]
... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-02-24 11:48
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
... |
def find_eulerian_tour(graph):
# find the node with biggest degree
biggest_degree, biggest_node = 0, None
for i, node in enumerate(graph):
for e in node:
count = 0
outer_graph = graph[:]
for inner_node in outer_graph:
if e in inner_node:
... |
# -*- coding: utf-8 -*-
# Description:
# This file takes in a .csv file of people and retrieves their images from IMDB if they exist
# Example usage:
# python imdb_get_images.py ../data/people_box_office_top_50_movies_1995-2014_imdb.csv
# python imdb_get_images.py ../data/people_box_office_top_10_movies_2011-20... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 2014, 2015 CERN.
#
# Invenio 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 optio... |
"""
Production settings.
Based on https://github.com/rdegges/django-skel/blob/master/project_name/settings/prod.py
"""
from os import environ
from common import *
# Below are things we might need to deal with later
########## EMAIL CONFIGURATION
########## DATABASE CONFIGURATION
########## CACHE CONFIGURATION
########... |
"""
Module to interact with the ChromeCast via protobuf-over-socket.
Big thanks goes out to Fred Clift <fred@clift.org> who build the first
version of this code: https://github.com/minektur/chromecast-python-poc.
Without him this would not have been possible.
"""
import logging
import socket
import ssl
import json
imp... |
#-------------------------------------------------------------------------------
import collections
import sys
import re
import min
#-------------------------------------------------------------------------------
class Registry(object):
Entry = collections.namedtuple('Entry', 'obj, type')
_registry = collecti... |
"""
Tests brewblox_service.couchdb_client
"""
import pytest
from aiohttp import web
from aiohttp.client_exceptions import ClientResponseError
from brewblox_service import couchdb_client, http_client
TESTED = couchdb_client.__name__
SRV_URL = couchdb_client.COUCH_URL[len('http://'):]
DB_URL = '/sparkbase'
DOC_URL = '... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
'''
Created on Nov 29, 2015
@author: Sameer Adhikari
'''
# Classes the initiate the chain that leads to the receivers doing their work.
# These classes are only aware that they have to invoke the abstract command.
# These classes have no visibility into how the commands connects to receivers.
class ToolbarButton(obj... |
#!/usr/bin/env python3
# Filename: my_tmw.py
# Author: #cf
# Version 0.2.0 (2015-08-27)
##################################################################
### CONFIG FILE for: Topic Modeling Workflow (tmw) ###
##################################################################
# Used in the following pape... |
#
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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... |
# Copyright 2014 - Savoir-Faire Linux 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 ... |
# python-pgp A Python OpenPGP implementation
# Copyright (C) 2014 Richard Mitchell
#
# Portions of this code are based on code from GnuPG.
# GnuPG is Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003,
# 2004, 2006 Free Software Foundation, Inc.
# GnuPG is licensed under the GNU Public License version 3 or ... |
# -*- coding: UTF-8 -*-
__revision__ = '$Id$'
# Copyright (c) 2006-2011
#
# 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 versi... |
"""
"""
# Gui, 27-06-2012
# Just an idea. Create a class of filtered data. A fake Masked Array object
# which gives the output on demand, filtered.
try:
import multiprocessing as mp
except:
print "I couldn't import multiprocessing"
import numpy as N
import numpy
import numpy as np
from numpy import ma
fro... |
##############################################################################
#
# Copyright (c) 2015, 2degrees Limited.
# All Rights Reserved.
#
# This file is part of twapi-users
# <https://github.com/2degrees/twapi-users>, which is subject to the
# provisions of the BSD at
# <http://dev.2degreesnetwork.com/p/2degree... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""This file contains code for use with "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2010 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
import random
import thinkstats
import myplot
import matplotlib.pyplot as p... |
# -*- coding: utf-8 -*-
#
# ISMRMRD documentation build configuration file, created by
# sphinx-quickstart on Thu Nov 13 10:11:39 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... |
# Copyright (C) 2010-2012 Red Hat, Inc.
# This work is licensed under the GNU GPLv2 or later.
# To test domain block device statistics
import time
import libvirt
from libvirt import libvirtError
from libvirttestapi.src import sharedmod
from libvirttestapi.utils.utils import get_xml_value
required_params = ('guestnam... |
#!/usr/bin/env python
# Copyright 2012-2013 Xiangfu
# Copyright 2012-2013 Andrew Smith
# Copyright 2013 Luke Dashjr
#
# 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 Lice... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Base class for loading dataset for the frame-wise model.
In this class, all data will be loaded at each step.
You can use the multi-GPU version.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
imp... |
# Use a custom sort comparator to sort the integers
# Converted the sorted integer array into a string
def cmp_to_key(mycmp):
'Convert a cmp= function into a key= function'
class K:
def __init__(self, obj, *args):
self.obj = obj
def __lt__(self, other):
return mycmp(self.... |
from pathlib import Path
import pandas as pd
import ibis
import ibis.expr.operations as ops
from ibis.backends.tests.base import BackendTest, RoundHalfToEven
class TestConf(BackendTest, RoundHalfToEven):
check_names = False
additional_skipped_operations = frozenset({ops.StringSQLLike})
supported_to_time... |
import eveapi
from apies.models import CallGroup, Call, Api
from characters.models import RefType
api = eveapi.EVEAPIConnection()
data = api.API.CallList()
def call_groups():
for group in data.callGroups:
try:
CallGroup.objects.create(
groupid=group.groupID,
na... |
# -*- coding: utf-8 -*-
#
# 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
#... |
#!/usr/bin/env python
"""
This example illustrates the Gibbs phenomenon.
It also calculates the Wilbraham-Gibbs constant by two approaches:
1) calculating the fourier series of the step function and determining the
first maximum.
2) evaluating the integral for si(pi).
See:
* http://en.wikipedia.org/wiki/Gibbs_phen... |
import os
NAME_AUTHORITY = os.environ.get("NAME_AUTHORITY", "eightfitzroy.arupiot.com")
DEVICE_NAME = os.environ.get("DEVICE_NAME", "TST-1")
HOST = os.environ.get("BRICKD_HOST", "localhost")
PORT = int(os.environ.get("BRICKD_PORT", "4223"))
SHORT_IDENT = os.environ.get("SHORT_IDENT", "test")
MODULES = []
MENU_MODUL... |
import datetime
import itertools
import unittest
from copy import copy
import django
from django.db import (
DatabaseError, IntegrityError, OperationalError, connection,
)
from django.db.models import Model
from django.db.models.deletion import CASCADE, PROTECT
from django.db.models.fields import (
AutoField, ... |
#!/usr/bin/env python3
#=============================================================================
#Copyright (C) 2016, Anonymous Maarten
#
#This file is part of ADuC832 demoproject.
#
#This program is free software; you can redistribute it and/or
#modify it under the terms of the GNU General Public License
#as publ... |
#
# Copyright 2009-2011 Red Hat, Inc.
#
# 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 distributed ... |
import scipy
import sys
import os
import numpy as np
import pylab
import MakeModel
from astropy.io import fits as pyfits
from FitTellurics import FitFunction, FitContinuum3, CCImprove
import FitsUtils
import Units
homedir = os.environ['HOME']
LineListFile = homedir + "/School/Research/McDonaldData/LineList.dat"
if... |
# -*- coding: utf-8 -*-
# vim: shiftwidth=4 tabstop=4 expandtab softtabstop=4 ai
# Copyright 2009-2014 Odin Hørthe Omdal
# This file is part of Medlemssys.
# Medlemssys is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Sof... |
#!/usr/bin/env python
from os import chdir, remove
from sys import stderr, stdout
from optparse import OptionParser
from subprocess import Popen, PIPE
from xml.etree.ElementTree import parse, SubElement
from os.path import dirname, basename, splitext, join
from urlparse import urlparse, urljoin
from tempfile import mk... |
from tpot import TPOTRegressor
import pandas as pd
import numpy as np
import warnings
warnings.filterwarnings("ignore")
# from matplotlib import pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.externals import joblib
from sklearn.metrics import r2_score
from time imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.