src stringlengths 721 1.04M |
|---|
##
# This file is part of the Scratch Remote Sensor (SRS) Library project
#
# Copyright (C) 2012 Stefan Wendler <sw@kaltpost.de>
#
# The SRS Library 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; eith... |
# Generated by Django 2.0.13 on 2019-02-25 05:21
from decimal import Decimal
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('crowdfunding', '0012_auto_20190224_0523'),
]
operations = [
migrations.CreateM... |
#!/usr/bin/env python
################################################################################
# GIPS: Geospatial Image Processing System
#
# AUTHOR: Matthew Hanson
# EMAIL: matt.a.hanson@gmail.com
#
# Copyright (C) 2014-2018 Applied Geosolutions
#
# This program is free software; you can redist... |
import numpy as np
from lib.exp.base import ExpCommon
from lib.exp.prepare import Prepare
from lib.exp.matching import Matcher
from lib.exp.evaluator.ground_truth import GroundTruth
from lib.exp.evaluator.pair_evaluator import PairEvaluator
class MatchDo(ExpCommon):
"""
Provide a simple way to rundown
"""... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Testpath documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 1 17:05:52 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
# a... |
import collections
import logging
import os
import re
import textwrap
import time
import weakref
import sublime
from sublime_lib import encodings, ResourcePath
from ..lib.weakmethod import WeakMethodProxy
from ..lib import get_setting
from .region_math import VALUE_SCOPE, get_value_region_at, get_last_key_name_from
... |
# 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 ... |
import os
import py
import pytest
from rpython.rtyper.lltypesystem import lltype, rffi
from rpython.jit.backend.detect_cpu import getcpuclass
from rpython.jit.metainterp.test import support
from rpython.rlib.jit import JitDriver
class JitARMMixin(support.LLJitMixin):
CPUClass = getcpuclass()
# we have to disa... |
# -*- coding: utf-8 -*-
import codecs
import html
import wx
import wx.lib.newevent
from wx.stc import StyledTextCtrl, STC_CP_UTF8
import outwiker.core.system
from outwiker.core.textprinter import TextPrinter
from outwiker.gui.searchreplacecontroller import SearchReplaceController
from outwiker.gui.searchreplacepanel... |
# System information:
# - Linux Mint 18.1 Cinnamon 64-bit
# - Python 2.7 with OpenCV 3.2.0
# Resources:
# - OpenCV-Python tutorial for calibration: http://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_calib3d/py_calibration/py_calibration.html
# - Variable names were changed for clarity
import num... |
from amazon.ion.core import Multimap, record
import six
from tests import parametrize
class _P(record('pairs', 'expected_all_values', 'expected_single_value', 'expected_total_len')):
def __str__(self):
return '{name}'.format(name=self.pairs)
ALL_DATA = _P(
pairs=[('a', 1), ('a', 2), ('a', 3), ('a',... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('tasks', '0005_auto_20151018_1303'),
]
operations = [
migrations.CreateModel(
name='TaskType',
fields... |
# Copyright (C) 2012,2013,2016
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms of ... |
# -*- coding: utf-8 -*-
# Hazırlayan : Rahman Yazgan (rahmanyazgan@gmail.com)
# Lisans : GPL v.3
import json, requests
from PyQt4 import QtCore
from moduller.SiteyeBaglan import SiteyeBaglan
from moduller.DiyanetUlkeler import DiyanetUlkeler
class IlceleriAl:
ayarDosyasi = None
def __init__(self, sehirl... |
# -*- coding: utf-8 -*-
"""
Unit tests for the da.memo module.
---
type:
python_module
validation_level:
v00_minimum
protection:
k00_public
copyright:
"Copyright 2016 High Integrity Artificial Intelligence Systems"
license:
"Licensed under the Apache License, Version 2.0 (the License);
you ... |
from sys import argv
from mytiming import *
from mycheckfiles import *
##--main --------------------------------------------------------------##
variants=[]
variants.append( ["WCSA" ,"../../../self-indexes/collectResults/wcsa" ,"B-LOG.dat" , "S-LOG.dat" , "N.Wa_swcsa.dat" , "N.Wb_swcsa.dat" , "N.P2_sw... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Kevin Carter <kevin.carter@rackspace.com>
#
# Copyright 2014, Rackspace US, 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
#
# ... |
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
def __str__(self):
return self.x
class Solution:
def reverseList(self, head):
"""
:type head: ListNode
:rtype: ListNode
"""
if not head:
return head
pre... |
# -*- coding: utf-8 -*-
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
import addrxlat
import crash
from crash.cache.syscache import utsname
from crash.util import offsetof
from crash.util.symbols import Types
import gdb
types = Types(['uint32_t *', 'uint64_t *'])
class TranslationContext(addrxlat.Con... |
# -*- coding: utf-8 -*-
# Copyright 2007-2016 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... |
import win32api, win32con, win32gui, sys
from flask import Flask, send_from_directory, request
def click():
(x,y) = win32gui.GetCursorPos()
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,y,0,0)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,x,y,0,0)
def rclick():
(x,y) = win32gui.GetC... |
# coding: utf-8
from __future__ import absolute_import
from ruamel.yaml.reader import Reader
from ruamel.yaml.scanner import Scanner, RoundTripScanner
from ruamel.yaml.parser import Parser, RoundTripParser
from ruamel.yaml.composer import Composer
from ruamel.yaml.constructor import BaseConstructor, SafeConstructor, ... |
#!/usr/bin/env python
###############################################################################
# vim: tabstop=4:shiftwidth=4:expandtab:
# Copyright (c) 2017 SIOS Technology Corp. All rights reserved.
##############################################################################
"""
This script will spray events ... |
# Copyright 2013-2014 MongoDB, 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 writin... |
# -*- coding: utf-8 -*-
"""
werkzeug.local
~~~~~~~~~~~~~~
This module implements context-local objects.
:copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from wsgi import ClosingIterator
from _internal import _patch_wrapper
#... |
__author__ = "Harish Narayanan"
__copyright__ = "Copyright (C) 2009 Simula Research Laboratory and %s" % __author__
__license__ = "GNU GPL Version 3 or any later version"
from dolfin import *
#from cbc.twist.coordinate_system import CartesianSystem
# Renaming grad to Grad because it looks nicer in the reference
# co... |
# Copyright 2018 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... |
# -*- coding: utf-8 -*-
from .document_mapper import DocumentMapper
from .finance import (
CityFinanceParser,
EPCIFinanceParser,
DepartmentFinanceParser,
DepartmentFinance2013Parser,
RegionFinanceParser,
RegionFinance2013Parser
)
from .tax import (
CityTaxParser,
CityBefore2008TaxPars... |
#!/usr/bin/env python
#
# Cppcheck - A tool for static C/C++ code analysis
# Copyright (C) 2007-2017 Cppcheck team.
#
# 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... |
import pickle
class ModelCache:
"""
A class to cache the model
"""
def __init__(self):
"""
Create a model dictionary
"""
self.model = dict()
def get(self, name):
"""
Get the model
"""
if name is None:
raise RuntimeError(... |
# 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 t... |
from graphics.input.train_sess_details_input_f import TrainSessDetailsInputF
from graphics.input.data_augmentation_input_f import DataAugmentationInputF
from graphics.input.file_save_details_input_f import FileSaveDetailsInputF
from graphics.output.train_sess.train_sess_output_f import TrainSessOutputF
from graphics.o... |
from AppKit import *
import vanilla
from defconAppKit.windows.baseWindow import BaseWindowController
from mojo.events import addObserver, removeObserver
from robofab.glifLib import writeGlyphToString, readGlyphFromString
from defcon.objects.glyph import addRepresentationFactory
from lib.scripting.codeEditor import Co... |
#
# Copyright (C) 2009-2016 Nexedi SA
#
# 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... |
#
# FRETBursts - A single-molecule FRET burst analysis toolkit.
#
# Copyright (C) 2014 Antonino Ingargiola <tritemio@gmail.com>
#
"""
Module containing automated unit tests for FRETBursts.
Running the tests requires `py.test`.
"""
from __future__ import division
from builtins import range, zip
from collections impor... |
# -*- coding: utf-8 -*-
# This file is part of Viper - https://github.com/botherder/viper
# See the file 'LICENSE' for copying permission.
import os
import sys
import getopt
from viper.common.out import *
from viper.common.abstracts import Module
from viper.core.session import __sessions__
ext = ".bin"
run_radare =... |
from win32api import keybd_event as keyboard_event
from time import sleep
from win32con import KEYEVENTF_KEYUP as RELEASE_KEY
import win32con
SLEEP_CONST = .05
# Giant dictionary to hold key name and VK value
VK_CODE = {'BACKSPACE': win32con.VK_BACK,
'TAB': win32con.VK_TAB,
'\t': win32con.VK_T... |
#!/usr/bin/python
#
# Copyright (C) 2010, 2011 Google 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 p... |
#!/usr/bin/python
import sys
import argparse
from threading import Thread
import problems
from solver import Solver
if __name__ != "__main__":
sys.exit()
parser = argparse.ArgumentParser(description="Kloetze algorithm.")
parser.add_argument("-p", "--problem")
parser.add_argument("-a", "--all", action="store_tru... |
"""Description of YANG & YIN syntax."""
import re
### Regular expressions - constraints on arguments
# keywords and identifiers
identifier = r"[_A-Za-z][._\-A-Za-z0-9]*"
prefix = identifier
keyword = '((' + prefix + '):)?(' + identifier + ')'
# no group version of keyword
keyword_ng = '(?:(' + prefix + '):)?(?:' + ... |
# -*- encoding: utf-8 -*-
"""
@authors: Andrés Felipe Calderón andres.calderon@correlibre.org
Sebastián Ortiz V. neoecos@gmail.com
@license: GNU AFFERO GENERAL PUBLIC LICENSE
SIIM2 Models are the data definition of SIIM2 Information System
Copyright (C) 2013 Infometrika Ltda.
This program is free soft... |
import sys
from django.db import connections
from django.db.utils import ConnectionDoesNotExist, IntegrityError
from django.core.management.base import BaseCommand
from django_comments.models import Comment
from django_comments_xtd.models import XtdComment
__all__ = ['Command']
class Command(BaseCommand):
he... |
#!/usr/bin/env python3
# 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 requir... |
import collections
import pyglet
import pyglet.gl as gl
import pyglet.window.key as pkey
import re, sys, time
from itertools import chain
import victor.mode as vmode
from victor.command_area import CommandArea
from victor.cursor import Cursor
from victor.keystroke import Keystrokes
from victor.movement_grid import Mo... |
class TransperthException(Exception):
"""
Base exception for all exceptions thrown by this library
"""
class InvalidStopNumber(TransperthException):
"""
Thrown when the provided stop number is not a five digit number
"""
class InvalidDirection(TransperthException):
"""
Thrown when th... |
"""
Flask-XUACompatible
-------------------
This is a simple Flask extension that sets X-UA-Compatible HTTP header for
all responses.
"""
from setuptools import setup
setup(
name='flask-xuacompatible',
version='0.1.0',
url='https://github.com/jpvanhal/flask-xuacompatible',
license='BSD',
author=... |
#!/usr/bin/python
#
# This source file is part of appleseed.
# Visit http://appleseedhq.net/ for additional information and resources.
#
# This software is released under the MIT license.
#
# Copyright (c) 2015-2016 Esteban Tovagliari, The appleseedhq Organization
#
# Permission is hereby granted, free of charge, to ... |
"""
This file provides a way to obtain thermodynamic quantities from an
interpolation of available QMC solutions
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from matplotlib import rc
rc('font', **{'family':'serif'})
rc('text', usetex=True)
import glob
import os
import ldaconf
base... |
import simpy
import numpy as np
import pickle
import os
class Result(object):
def __init__(self, test_case, *args):
self.test_case = test_case
if len(args) == 0:
raise Exception('result cant be empty args')
elif len(args) % 2 != 0:
raise Exception('result args must ... |
__doc__ = """
Manipulate audio with an simple and easy high level interface.
See the README file for details, usage info, and a list of gotchas.
"""
from setuptools import setup
setup(
name='pydub',
version='0.9.0',
author='James Robert',
author_email='jiaaro@gmail.com',
description='Manipulate a... |
# This file is part of Verrou, a FPU instrumentation tool.
# Copyright (C) 2014-2021 EDF
# F. Févotte <francois.fevotte@edf.fr>
# B. Lathuilière <bruno.lathuiliere@edf.fr>
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License as
# pub... |
# -*- coding: utf-8 -*-
# * Copyright (C) 2012-2013 Croissance Commune
# * Authors:
# * Arezki Feth <f.a@majerti.fr>;
# * Miotte Julien <j.m@majerti.fr>;
# * Pettier Gabriel;
# * TJEBBES Gaston <g.t@majerti.fr>
#
# This file is part of Autonomie : Progiciel de gestion de CAE.
#
# Autonomie is... |
# -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa 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 Software Foundation, either version 3 of the License, or
# (at... |
# 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 agreed to in writing, s... |
# -*- coding: utf-8 -*-
import urllib2
import urlparse
def download1(url):
"""Simple downloader"""
return urllib2.urlopen(url).read()
def download2(url):
"""Download function that catches errors"""
print 'Downloading:', url
try:
html = urllib2.urlopen(url).read()
except urllib2.URLE... |
# -*- coding: utf-8 -*-
#Copyright (C) 2011 Seán Hayes
#
#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.
#
#This program is ... |
import mxnet as mx
import random
from mxnet.io import DataBatch, DataIter
import numpy as np
def add_data_args(parser):
data = parser.add_argument_group('Data', 'the input images')
data.add_argument('--data-train', type=str, help='the training data')
data.add_argument('--data-val', type=str, help='the vali... |
# coding=utf-8
# Copyright 2021 The Google Research 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/LICENSE-2.0
#
# Unless required by applicab... |
"""
Django settings for api project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
import environ
ROOT_DIR = environ.Path(__file__) - 3 # (api/config/settings/b... |
'''
Created on Jan 5, 2015
@author: Francois Belletti
'''
import numpy as np
from OSM.misc.geoTools import computeDist
#
# Need to change that distance
#
def l2_dist(node_1, node_2):
lat_1 = float(node_1.get('lat'))
lon_1 = float(node_1.get('lon'))
lat_2 = float(node_2.get('lat'))
lon_2 = float(n... |
import numpy as np
import pandas as pd
from sklearn.preprocessing import MinMaxScaler, StandardScaler
class data_scaler(object):
def __init__(self):
self.norm = None
self.norm_1 = None
self.std = None
self.case = None
self.scale = 1
self.bias = 1e-20
# ... |
from RTSim import RTSim
class RTRobot(RTSim):
"""
RTRobot Controller for RTSim real-time robot simulation.
https://github.com/FJFranklin/wifi-py-rpi-car-controller/tree/master/RTSim
"""
def __init__(self, seconds=180, test_name='default'):
# usage: RTRobot (seconds, test_name)
... |
# Copyright (c) 2014 Rackspace, 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 wr... |
"""
"""
import random
import pygm
import consts
class SptSnowFlake(pygm.PyGMSprite):
def __init__(self, size, *args, **kwargs):
super(SptSnowFlake, self).__init__()
self.size = size
#self.surf = self.pygm.Surface(self.size)
self.surf = self.pygm.Surface(self.size,
f... |
# -*- coding: utf-8 -*-
"""
Sessions module for the Tornado framework.
Milan Cermak <milan.cermak@gmail.com>
This module implements sessions for Tornado. It can store
session data in files or MySQL databse, Memcached, Redis
and MongoDB.
USAGE:
======
Every session object can be handled as a dictionary... |
#!python
"""Infers differential preferences for each amino acid at each site.
Written by Jesse Bloom, 2014.
"""
import re
import sys
import os
import time
import tempfile
import math
import copy
import traceback
import multiprocessing
import warnings
import cPickle
import mapmuts
import mapmuts.io
import mapmuts.se... |
#!/usr/bin/python
import csv
import calendar
import datetime
import glob
import os
import sys
dirName = sys.argv[1]
multiplier = float(sys.argv[2]);
fnames = []
dates = []
rows = []
headers = [];
for index,fname in enumerate(glob.glob(dirName + "/*.csv")):
fnames.append(fname)
rows.append([])
dates.append(... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# test_data_root.py
import os
import sys
import unittest
import time
import yaml
root_folder = os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + os.sep + ".." )
data_path = os.path.join(root_folder, 'aikif', 'data', 'core')
yaml_file = os.path.join(data_path, 'roo... |
# -*- coding: utf-8 -*-
import pygame, led, sys, os, random, csv
import smbus
from pygame.locals import *
from led.PixelEventHandler import *
from time import gmtime, strftime
""" A very simple arcade shooter demo :)
"""
random.seed()
BLACK = pygame.Color(0,0,0)
WHITE = pygame.Color(255, 255, 255)
RED = pygame.Color... |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
#pylint: disable=C0103
from __future__ import... |
#!/usr/bin/env python3
import sys
import os
import logger
import logging
import argparse
from os.path import isfile, join, splitext
from importlib import import_module
from PyQt5 import QtCore, QtWidgets, uic
from PyQt5.QtGui import QIcon, QPixmap
from settingsmanager import SettingsManager
from mainwindow import TVMa... |
elif action == 'i/faces':
# TODO: Temporary, remove when done
names = set(['George_W_Bush', 'Colin_Powell', 'Tony_Blair', 'Donald_Rumsfeld', 'Gerhard_Schroeder',
'Ariel_Sharon', 'Hugo_Chavez', 'Junichiro_Koizumi', 'Serena_Williams', 'John_Ashcroft... |
# coding=utf-8
import os
import Utils, Rename
root_dir = "/Volumes/XiaoMi-usb0/下载"
tool = Rename.RenameTool()
def get_suffix(file_name):
index = file_name.rfind('.')
return file_name[index:len(file_name)]
def folder_rename(root_dir):
file_list = os.listdir(root_dir)
for file_name in filter(Utils.... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
import six
import ruamel.yaml as yaml
import os
import json
"""
This module provides classes to perform analyses of
the local environments (e.g., finding near... |
#!/usr/bin/python
# Mario Hernandez
# github.com/mariofix
# Licences under GPL v3
#
# For use with nginx
# uwsgi -s /tmp/ad-login.sock -w adlogin:app --enable-threads --chmod-socket=666
#
import bender
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route("/auth", methods=["GET", "POST"])
def aut... |
import argparse
import datetime as dt
import urllib
from bs4 import BeautifulSoup as bs
pattern = 'https://biz.yahoo.com/research/earncal/{}.html'
def date_to_str(date):
return date.strftime('%Y%m%d')
def date_strings(from_offset, to_offset):
today = dt.date.today()
ret = []
for off in xrange(from_offset, to_o... |
import src.lookml.lookml as lookml
import src.lookml.lkml as lkml
import unittest, copy
from pprint import pprint
import configparser, json
# from looker_sdk import client, models, methods
from looker_sdk import models, methods, init31
config = configparser.ConfigParser()
config.read('tests/settings.ini')
class testS... |
#!/usr/bin/env python
#
# -----------------------------------------------------------------------------
# Copyright (c) 2016 The Regents of the University of California
#
# This file is part of kevlar (http://github.com/dib-lab/kevlar) and is
# licensed under the MIT license: see LICENSE.
# ----------------------------... |
from pySDC import CollocationClasses as collclass
from examples.fenics_grayscott.ProblemClass import fenics_grayscott
from pySDC.datatype_classes.fenics_mesh import fenics_mesh
from examples.fenics_grayscott.TransferClass import mesh_to_mesh_fenics
from examples.fenics_grayscott.HookClass import fenics_output
from py... |
from waxman_topo import Topology
global networkSize
networkSize = None
def set_size(size):
global networkSize
networkSize = size
def links_to_remove(version, graph):
if version == 0:
return []
if len(graph.coreSwitches) < 2:
return []
return [ (graph.coreSwitches[idx], graph.edgeS... |
import pandas as pd
import string
f = pd.read_excel(open("../ModeChoice.xls"), sheetname=None)
coeffs = {}
coeff_ind = None
specs = {}
ind = None
for key, df in f.iteritems():
if "debug" in key or "model" in key or "data" in key:
continue
print key
"""
Really these lines just extract the rel... |
#!/usr/bin/env python
from __future__ import print_function
"""
Test check_if_uptodate
Bug: @parallel sets @check_if_uptodate to None.
Submitted by Jafar Taghiyar (jafar<dot>taghiyar<at>gmail.com)
https://github.com/bunbun/ruffus/issues/53
"""
import os
import os
tempdir = os.path.abspath(os.path.abspat... |
# -*- coding: utf-8 -*-
import mock
import unittest
import odoo.tests.common as common
from ..connector import Binder
from ..queue.job import (Job,
OdooJobStorage,
related_action)
from ..session import ConnectorSession
from ..related_action import unwrap_binding
def... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import #导入3.x的特征函数
from __future__ import print_function
import yaml
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import pandas as pd #导入Pandas
import numpy as np #导入Numpy
import jieba #导入结巴分词
import h5py, pickle, os, datetime
from keras.models import m... |
""" tablelib.py
This file defines functions for getting table information.
"""
import csv
import collections
def load_indexes(froms, tables, indexes):
""" Load indexes into memory.
Args:
froms: tables to query
tables: tables in the database
indexes: indexes in the database
R... |
"""
Pure Python implementation of a Back-Propagation Neural Network using the
hyperbolic tangent as the sigmoid squashing function.
Original Author: Neil Schemenauer <nas@arctrix.com>
Modified Author: James Howard <james.w.howard@gmail.com>
Modified to work for function regression and added option to use matplotlib
t... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
Holds all the information relevant to the client (addresses for instance)
"""
from six import with_metaclass
from django.conf import settings
from django.db import models
from django.template import Context
from django.template.loader import select_te... |
from datetime import datetime, timedelta
from django.test import TestCase
from django.test.client import Client
from django.test.utils import override_settings
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.http import HttpRequest,... |
"""Common topi utilities"""
from __future__ import absolute_import as _abs
import tvm
def get_const_int(expr):
"""Verifies expr is integer and get the constant value.
Parameters
----------
expr : tvm.Expr or int
The input expression.
Returns
-------
out_value : int
The out... |
from subprocess import call
from distutils.core import setup
from distutils.command.build import build
class build_lein_xml(build):
def run(self):
print "Building lein xml"
call('./build-lein-xml', shell=True)
build.run(self)
setup(
name='clojurehelper',
version='0.2',
script... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# todo: add alerts, colors
import requests
import json
import datetime
import argparse
import sys
from prettytable import PrettyTable
# surf to https://developer.forecast.io/ for an api key
# use http://dbsgeo.com/latlon/ to get coordinates for your location
API_KEY=''
L... |
# -*- coding: utf-8 -*-
#
# Elassandra documentation build configuration file, created by
# sphinx-quickstart on Sat May 28 19:29:13 2016.
#
# 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.
#
... |
import decimal
import numpy as np
from numpy import iinfo
import pytest
import pandas as pd
from pandas import (
DataFrame,
Index,
Series,
to_numeric,
)
import pandas._testing as tm
@pytest.fixture(params=[None, "ignore", "raise", "coerce"])
def errors(request):
return request.param
@pytest.fi... |
#!/usr/bin/env python
"""Download all linked files from a webpage.
This is particularly handy for dowloading data from CHILDES.
"""
# Copyright 2012-2014 Constantine Lignos
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... |
"""
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
This file is part of the Smart Developer Hub Project:
http://www.smartdeveloperhub.org
Center for Open Middleware
http://www.centeropenmiddleware.com/
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=... |
#!/usr/bin/env python
# coding: utf-8
from __future__ import print_function
from __future__ import absolute_import
import os
import re
import shutil
import stat
import sys
import tct
from os.path import exists as ospe, join as ospj
from tct import deepget
params = tct.readjson(sys.argv[1])
binabspath = sys.argv[2]
... |
#!/usr/bin/python
import sys
import os
import re
import fnmatch
import string
workload_dir = "/Users/xiyuexiang/GoogleDrive/NOCulator/hring/src/bin/"
workload = "mix_app"
insns_count = 1000000
ipc_alone = [2.16, 2.75, 2.08, 1.91, 2.16, 2.75, 2.08, 1.91, 2.16, 2.75, 2.08, 1.91, 2.16, 2.75, 2.08, 1.91]
ip... |
# -*- coding: utf-8 -*-
# Copyright 2014, 2015 OpenMarket Ltd
#
# 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 django.conf.urls.defaults import *
from django.contrib import admin
from django.contrib import databrowse
from django.contrib import messages
from django.contrib.auth.decorators import login_required, permission_required
from django.views.generic.simple import direct_to_template
from django.contrib.auth.views imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.