src stringlengths 721 1.04M |
|---|
## Module statistics.py
##
## Copyright (c) 2014 Antonio Valente <y3sman@gmail.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 License at
##
## http://www.apache.org/licenses/LICENSE-2.0
... |
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... |
import os
from glob import glob
from setuptools import setup, find_packages
# Setup flags and parameters
pkg_name = 'i2c_device' # top-level package name
# Cache readme contents for use as long_description
readme = open('readme.md').read()
# Call setup()
setup(
name=pkg_name,
version='0.1',
description='I2C d... |
from flask import g
from app import app, db
from app.models import Malt, Hop, Yeast, Brew
import flask.ext.restless
from flask.ext.restless import ProcessingException
manager = flask.ext.restless.APIManager(app, flask_sqlalchemy_db=db)
# TODO simplyfy this...
def verify_is_number(dict, value, errors):
if value ... |
""" Test functions for the sparse.linalg.eigen.lobpcg module
"""
from __future__ import division, print_function, absolute_import
import itertools
import platform
import numpy as np
from numpy.testing import (assert_almost_equal, assert_equal,
assert_allclose, assert_array_less)
import pyt... |
import pytest
import os
import copy
from appium import webdriver
from helpers import report_to_sauce, take_screenshot_and_syslog, IOS_BASE_CAPS, EXECUTOR
class TestIOSSelectors():
@pytest.fixture(scope='function')
def driver(self, request, device_logger):
calling_request = request._pyfuncitem.name
... |
#
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly 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 3 of the... |
# 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, ... |
#! /usr/bin/env python
'''
global_mode.py: Global input mode bindings
Copyright (c) 2012 Bill Gribble <grib@billgribble.com>
'''
from ..input_mode import InputMode
from .label_edit import LabelEditMode
from .transient import TransientMessageEditMode
from .enum_control import EnumEditMode
from ..message_element import... |
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
from os.path import exists, join
# Third-party
import astropy.time as atime
import astropy.units as u
import matplotlib.pyplot as plt
import numpy as np
import pytest
from .data import RVData
def test_r... |
#!/usr/bin/python
"""
Script to check if the required modules are installed.
"""
class BColors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
def _test_import(libname):
"""
Try importing the library.
"""
t... |
# -*- coding: utf-8 -*-
from odoo.exceptions import UserError, ValidationError
from odoo import api, exceptions, fields, models, _
MAP_INVOICE_TYPE_PAYMENT_SIGN = {
'out_invoice': 1,
'in_refund': -1,
'in_invoice': -1,
'out_refund': 1,
}
class hv_credit_limit_product(models.Model):
_inherit = 'res.p... |
import os
from fabric.api import *
def create_objects(cfg, service_hosts):
""" Turn a list of service host info into objects that can do
starting, stopping of services, or other things that
we think up.
"""
return [ServiceHost(
s['hostname'],
s['services'],... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# BEL.bio API documentation build configuration file, created by
# sphinx-quickstart on Mon Dec 11 15:42:18 2017.
#
# 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
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('timeline', '0008_auto_20150818_2241'),
]
operations = [
migrations.AlterField(
model_name='options',
... |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
try:
import plotly.graph_objects as go
except ImportError:
pass
def __calculate_plot_data(stvariogram, **kwargs):
xx, yy = stvariogram.meshbins
z = stvariogram.experimental
# x = xx.flatten()
# y = yy.fla... |
import getpass
import re
import ipaddress
def yesNoInput(question):
valid = ['','y','Y','ye','yes','YES','n','N','no','No','NO']
data = ''
while True:
data = raw_input(question)
if not data in valid:
print 'Invalid input!'
continue
else:
break... |
#!/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/
# Basic string exercises
# Fill in the code for the functions below. main() is already se... |
from abc import ABCMeta, abstractmethod
import datetime
import cv2
import math
import os
import errno
class MediaWriter(object):
"""
Abstract class for all media outputs. Forcing each inheritance
to have a write class.
"""
__metaclass__ = ABCMeta
@abstractmethod
def write(self, content, *... |
# encoding: utf-8
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobilit... |
import logging
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import status
from student.models import User
from enrollment import api
from course_modes.models import CourseMode
from openedx.core.lib.exceptions import CourseNotFoundError
from enrollment.error... |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 25 17:18:39 2017
@author: ishort
"""
import math
import Useful
import PartitionFn
import ToolBox
#import numpy
#/* Rayleigh scattering opacity routines taken from Moog (moogjul2014/, MOOGJUL2014.tar)
#Chris Sneden (Universtiy of Texas at Austin) and collabora... |
#! /usr/bin/env python
import sys
import argparse
import screed
import cPickle
def ignore_at(iter):
for item in iter:
if item.startswith('@'):
continue
yield item
def main():
parser = argparse.ArgumentParser()
parser.add_argument('genome')
parser.add_argument('samfile')
... |
# based on https://github.com/pypa/sampleproject/blob/master/setup.py
# see http://packaging.python.org/en/latest/tutorial.html#creating-your-own-project
from setuptools import setup, find_packages
from setuptools.command.install import install as stdinstall
import codecs
import os
import re
import sys
def find_v... |
import cointipbot, traceback, time
class Main():
cb = None
def __init__(self):
'''
Unfortunately, we cannot instantiate CointipBot only once due to the way pifkoin works.
Pifkoin will open an HTTP connection to the RPC client which will eventually close when the bot completes its che... |
# F3AT - Flumotion Asynchronous Autonomous Agent Toolkit
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# 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 Foundation; either version... |
"""Interface to the CKAN data repository, for uploading bundle records and data extracts.
Copyright (c) 2013 Clarinova. This file is licensed under the terms of the
Revised BSD License, included in this distribution as LICENSE.txt
"""
from databundles.dbexceptions import ConfigurationError
import petl.fluent as petlf... |
#!/usr/bin/env python
"""Demonstration of FMU export from a controller synthesized using TuLiP
This is a modified copy from the TuLiP sources of
examples/robot_planning/continuous.py that exports an FMU. The key
changes are
* caching of the abstraction and controller in AbstractPwa.p and FSM.p, and
* calling exportF... |
import threading
from monotonic import monotonic as _time
class next_action:
NEXT_PLUGIN = 1
GOTO_MENU = 2
RUN_DEFAULT_PLUGIN = 3
class event_handler:
EVENT_INVALID = -1
EVENT_BUTTON_LEFT = 0
EVENT_BUTTON_RIGHT = 1
EVENT_BUTTON_RETURN = 2
EVENT_EXIT_PLUGIN = 3
EVENT_NEXT_PLUGIN_... |
from django.db.backends import BaseDatabaseIntrospection
import pyodbc as Database
import decimal,datetime
SQL_AUTOFIELD = -777555
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Map type codes to Django Field types.
data_types_reverse = {
int: 'IntegerField',
boo... |
# -*- coding: utf-8 -*-
"""Inner Module Import"""
from ensdf.genlib import files
from ensdf.genlib import regexp
"""Python Packages"""
import pickle
def get_card(ident=''):
data = []
file_list = files.get_all_files()
prog = lambda i: (i+1)*100/len(file_list)
for ix, f in enumerate(file_list):
card = []
... |
###############################################################################
# volumina: volume slicing and editing library
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# modify it und... |
#
# Copyright (c) 2005 - 2008 Nathan Zorn, OGG, LLC
# See LICENSE.txt for details
#
import sys, os
import httplib, urllib
import random, binascii, sha
from punjab.httpb import HttpbParse
from twisted.words.xish import domish
from twisted.words.protocols.jabber import jid
TLS_XMLNS = 'urn:ietf:params:xml:ns:xmpp-tls'
... |
#!/usr/bin/env python
import argparse
import numpy as np
import sys, os
from os import listdir
import plantcv as pcv
import datetime
### Parse command-line arguments
def options():
parser = argparse.ArgumentParser(description="Get images from an SQLite database and some input information")
parser.add_argument("-d... |
import sys
from inspect import isbuiltin, getcallargs, isfunction, ismethod
from doubles.exceptions import (
VerifyingDoubleArgumentError,
VerifyingBuiltinDoubleArgumentError,
VerifyingDoubleError,
)
ACCEPTS_ARGS = (list, tuple, set)
ACCEPTS_KWARGS = (dict,)
if sys.version_info >= (3, 0):
def _get_f... |
"""Top-level object for a Fruitbak installation.
The `Fruitbak` object defined here is the entry point for all Fruitbak
functionality such as browsing the stored backups, creating new backups
and performing maintenance.
The basic structure of Fruitbak when it comes to browsing the on-disk data
is that of a number of ... |
# 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 ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import xml.dom.minidom as dom
import xml.dom
from decimal import *
import sys
import os
import datetime
#from Numeric import *
# Dokument erzeugen
implement = xml.dom.getDOMImplementation()
###################Globale Variablen###################
task=None
choosen_tag={}... |
import sys
from collections import OrderedDict
from functools import reduce
import numpy
import sklearn.cross_validation
from PyQt4.QtGui import QTableWidget, QTableWidgetItem
import Orange.data
import Orange.classification
from Orange.widgets import widget, gui, settings
from Orange.evaluation.testing import Resul... |
#!/usr/bin/env python
#
# Copyright 2004 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
... |
"""RachioObject module containing a helper class for all API calls."""
import json
from requests import Session
_API_URL = "https://api.rach.io/1/public"
class RachioObject:
"""The Rachio base object."""
def __init__(self, authtoken: str, http_session=None, timeout=25):
"""Rachioobject class initia... |
import numpy as np
import matplotlib.pylab as plt
from MulLayer import MulLayer
class AddLayer:
def __init__ (self):
pass
def forward(self, x, y):
out = x + y
return out
def backward(self, dout):
dx = dout * 1
... |
#!/usr/bin/python
import pyman
from os import getcwd, path
class VM( pyman.Page ):
def __init__( self, pkg ):
super( VM, self ).__init__( "VM" )
self.host = None
self.pkg = pkg
self.dir = path.split( getcwd() )[1]
def choices( self ):
if not self.actions:
... |
from mylib import *
import os,sys
import numpy as np
import matplotlib.pyplot as plt
import math
import random
from time import time
if __name__ == '__main__':
DIR_PATH = sys.path[0] + '\\'
# normal distribution vector file
nvctr_file1 = DIR_PATH + 'normal_500_1.txt'
nvctr_file2 = DIR_PATH + 'normal_500_2.txt'
#... |
# -*- coding: utf-8 -*-
from tests import HangulizeTestCase
from hangulize.langs.lat import Latin
class LatinTestCase(HangulizeTestCase):
lang = Latin()
def test_people_roman(self):
self.assert_examples({
'Flavius Aëtius': '플라비우스 아에티우스',
'FLAVIVS AËTIVS': '플라비우스 아에티우스',
... |
import posixpath
from trac.core import *
from trac.config import *
from trac.config import BoolOption
from trac.web.chrome import ITemplateProvider, \
add_stylesheet
from trac.web.main import IRequestHandler
from trac.wiki import wiki_to_html, wiki_to_oneliner
from trac.mimeview import Mimeview, is_binary
from trac... |
#! /usr/bin/python
print "\n*********************************************************************"
print "Cisco IOU License Generator - Kal 2011, python port of 2006 C version"
import os
import socket
import hashlib
import struct
# get the host id and host name to calculate the hostkey
hostid=os.popen("hostid").read().... |
import dataclasses
import os
from glob import glob
from pathlib import Path
from omegaconf import OmegaConf
from pp.config import CONFIG, TECH, logger
def merge_markdown(
reports_directory: Path = CONFIG["doe_directory"],
mdpath: Path = CONFIG["mask_directory"] / "report.md",
**kwargs,
) -> None:
""... |
#
# 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
# ... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010 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
# l... |
# optirecv.py : motion capture data receiver for use within Grasshopper ghpython objects
# Copyright (c) 2016, Garth Zeglin. All rights reserved. Licensed under the
# terms of the BSD 3-clause license.
# use RhinoCommon API
import Rhino
# Make sure that the Python libraries that are also contained within this course... |
# -*- coding: utf-8 -*-
# Copyright 2012 Fanficdownloader team, 2015 FanFicFare team
#
# 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
#
# Un... |
# Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
"""
Problem Statement
42 is the answer to "The Ultimate Question of Life, The Universe, and Everything". But what The Ultimate Question really is? We may never know!
Given three integers, a, b, and c, insert two operators between them so that the following equation is true: a (operator1) b (operator2) c=42.
You may ... |
import sys, os, random
import zlib, cPickle
############### SAMC Setup ###############
import numpy as np
import scipy as sp
import networkx as nx
from samcnet.samc import SAMCRun
from samcnet.bayesnetcpd import BayesNetSampler, BayesNetCPD
from samcnet import utils
from samcnet.generator import *
if 'WORKHASH' in o... |
import warnings
from django.http import Http404, HttpResponse
from django.shortcuts import render, redirect, get_object_or_404
from django.core.exceptions import ValidationError, PermissionDenied
from django.contrib.contenttypes.models import ContentType
from django.core.paginator import Paginator, EmptyPage, PageNotA... |
#!/usr/bin/env vpython3
#
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Takes a netlog for the WebViews in a given application.
Developer guide:
https://chromium.googlesource.com/chromium/src/+/HEAD/a... |
# Copyright 2020 Netflix, 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... |
# -*- coding: utf-8 -*-
import heapq # used for the so colled "open list" that stores known nodes
import time # for time limitation
from pathfinding.core.util import SQRT2
from pathfinding.core.diagonal_movement import DiagonalMovement
# max. amount of tries we iterate until we abort the search
MAX_RUNS = float('in... |
from app import app
from app import db
from models.orcid import get_orcid_id_from_oauth
from models.person import Person
from models.person import PersonExistsException
from models.person import make_person
from models.person import refresh_orcid_info_and_save
from models.person import connect_orcid
from models.person... |
import common
import unittest
from lib.model.smartplugin import SmartPlugin
from tests.mock.core import MockSmartHome
class TestConfig(unittest.TestCase):
def setUp(self):
self.sh = MockSmartHome()
self.plugins = self.sh.with_plugins_from(common.BASE + "/tests/resources/plugin")
self.item_conf = self.sh.wit... |
from __future__ import unicode_literals
from django.apps.registry import apps as global_apps
from django.db import migrations
from .loader import MigrationLoader
from .recorder import MigrationRecorder
from .state import ProjectState
class MigrationExecutor(object):
"""
End-to-end migration execution - load... |
# -*- coding: utf-8 -*-
# Copyright 2019 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
#
# Un... |
# -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class OsloquantSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scrapy... |
# Test methods with long descriptive names can omit docstrings
# pylint: disable=missing-docstring
import numpy as np
from Orange.data import Table
from Orange.widgets.data.owimpute import OWImpute
from Orange.widgets.tests.base import WidgetTest
class TestOWImpute(WidgetTest):
def setUp(self):
self.widg... |
# -*- coding: utf-8 -*-
import pytest
from cfme import test_requirements
from cfme.configure.tasks import is_host_analysis_finished
from cfme.exceptions import ListAccordionLinkNotFound
from cfme.infrastructure import host
from cfme.web_ui import listaccordion as list_acc, toolbar, InfoBlock
from utils import conf
fro... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
ModelerAlgorithm.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
**********************... |
#!/usr/bin/env python3
# coding=utf-8
"""
Uses PyNaCl to sign a message using ed25519 digital signature algorithm
"""
import sys
import colorama
from colorama import Fore
from nacl.encoding import HexEncoder, RawEncoder
from nacl.signing import SigningKey
if __name__ == '__main__':
colorama.init(autoreset=True)
... |
__author__ = 'Noah Peeters'
import math
const = {
'pi': [math.pi, '\pi'],
'e': [math.e, 'e']
}
float_chars = [str(x) for x in range(10)]
float_chars.append('.')
operators = ['+', '-', '*', '/', '^', '%', '=']
operators_priorities = [0, 0, 1, 1, 2, 1, 0]
operators_latex = ['%s+%s', '%s-%s', '%s*%s', '\\frac{... |
from dataplicity.client.task import Task, onsignal
from omronTcpFins import OmronPLC
class Www2plc(Task):
"""PLC data writer"""
def pre_startup(self):
"""Called prior to running the project"""
# self.conf contains the data- constants from the conf
self.livecfg = self.conf.get('valsetco... |
__author__ = 'Alexander Logger'
from string import Template
import requests
import json
import logging
base_url = 'https://www.dnspod.com/api'
get_records_url_tpl = Template(base_url + '/records/$domain')
modify_record_url_tpl = Template(base_url + '/records/$domain/$record_id')
get_auth_token_url_tpl = Template(base... |
""" test scalar indexing, including at and iat """
from datetime import (
datetime,
timedelta,
)
import numpy as np
import pytest
from pandas import (
DataFrame,
Series,
Timedelta,
Timestamp,
date_range,
)
import pandas._testing as tm
from pandas.tests.indexing.common import Base
class T... |
# Copyright The IETF Trust 2007, All Rights Reserved
import datetime
from django.db import models
from django.contrib.auth.models import User
from ietf.person.name import name_parts, initials
class PersonInfo(models.Model):
time = models.DateTimeField(default=datetime.datetime.now) # When this Person recor... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
Data subsampling
================
.. autosummary::
:toctree: generated/
Sampler
SequentialSampler
VariableLengthSampler
'''
from itertools import count
import numpy as np
from .base import Slicer
from .exceptions import ParameterError, DataError
_... |
# geotecha - A software suite for geotechncial engineering
# Copyright (C) 2018 Rohan T. Walker (rtrwalker@gmail.com)
#
# 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 L... |
# encoding: utf-8
import itertools as it
import numpy as np
import numpy.linalg as la
from scipy.sparse.linalg import svds
__all__ = ['adaptive_stepsize', 'iht_estimator', 'cgm_estimator']
def _vec(A):
newshape = A.shape[:-2]
newshape = newshape + (A.shape[-2] * A.shape[-1],)
return A.reshape(newshape)... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifi... |
# Copyright (c) 2012 NetApp, 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... |
## \file
## \ingroup tutorial_roofit
## \notebook -nodraw
## Organization and simultaneous fits: illustration use of ROOT.RooCustomizer and
## ROOT.RooSimWSTool interface in factory workspace tool in a complex standalone B physics example
##
## \macro_code
##
## \date February 2018
## \authors Clemens Lange, Wouter Ver... |
#import getopt
import argparse
import emails
import sys
import re
import os
import subprocess
import time
import signal
from collections import defaultdict
#import our libs
from emails import EmailTemplate
from utils import Utils
from display import Display
from gather import Gather
from mydns import Dns
from webprofi... |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-11-21 20:41
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('boites', '__first__'),
]
operati... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2016 - now Bytebrand Outsourcing AG (<http://www.bytebrand.net>).
#
# This program is free software: you can redistribute it and/or modify
# it... |
from pubmedHelpers import distinctSet
from operator import itemgetter
from collections import OrderedDict
def calc_hIndex(citations):
N = len(citations)
if N == 0:
return 0
i = 0
while i < N and citations[i]['Citations'] >= (i + 1):
i += 1
return i
# authorName = 'Author Names'
# a... |
#!/usr/bin/env python
import RPi.GPIO as GPIO
import time
import thread
SDI = 11
RCLK = 12
SRCLK = 13
SDIB = 15
RCLKB = 16
SRCLKB = 18
BTN = 22
segCode = [0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71,0x40,0x80]
#code0=0x3f
#code1=0x06
#code2=0x5b
#code3=0x4f
#code4=0x66
#code5=... |
import asyncio
import time
from queue import Queue
import pytest
from concurrently import concurrently, AsyncIOThreadEngine, UnhandledExceptions
from . import EngineTest, paramz_conc_count, paramz_data_count
def process(data):
time.sleep(data)
return time.time()
class TestAsyncIOThreadEngine(EngineTest):... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2015 dhilipsiva <dhilipsiva@gmail.com>
#
# Distributed under terms of the MIT license.
"""
"""
import posixpath
from pipes import quote
from contextlib import contextmanager
from os.path import join, expanduser, basename
import requests... |
"""Order a file storage volume."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
CONTEXT_SETTINGS = {'token_normalize_func': lambda x: x.upper()}
@click.command(context_settings=CONTEXT_SETTINGS)
@click.option... |
# Copyright 2014 TellApart, 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 writi... |
#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015-18 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... |
# Import relevant modules and setup for calling glmnet
import sys
sys.path.append('../test')
sys.path.append('../lib')
import scipy
import importlib
import matplotlib.pyplot as plt
import glmnet
import glmnetPlot
import glmnetPrint
import glmnetCoef
import glmnetPredict
import cvglmnet
import cvglmnetCoef
import c... |
# Copyright 2017 The TensorFlow Agents 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 applicable law or ag... |
'''
Contains the PythonQuestion class, which is an instructor-facing
question type that implements a grade() function.
All instructor-facing Question modules must implement
a grade() function at module level that returns a Result object.
@author: Max Spadafore
'''
from AbstractQuestion import AbstractQ
table_name =... |
#
# 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... |
from datetime import date, datetime
from apscheduler.triggers.cron.fields import *
from apscheduler.util import datetime_ceil, convert_to_datetime, iteritems
class CronTrigger(object):
FIELD_NAMES = ('year', 'month', 'day', 'week', 'day_of_week', 'hour', 'minute', 'second')
FIELDS_MAP = {
'year': Bas... |
# -*- coding: UTF-8 -*-
"""Functions to aid in publishing a service in the publication workflow.
"""
import glob
import json
import os
import random
import string
import urllib2
import xml.dom.minidom as DOM
from xml.sax.saxutils import escape
import arcpy
import checkError
def createMXD(inFolder, template,logs):
... |
# -* encoding: utf-8 *-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import functools
import os
import subprocess
import sys
import hvac
import configargparse
from... |
# 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
# distribu... |
import warnings
import os
import re
import urllib
import requests
import itertools
import json
from tqdm import tqdm
from .photomosaic import options
PUBLIC_URL = "https://www.flickr.com/photos/"
API_URL = 'https://api.flickr.com/services/rest/'
PATH = "http://farm{farm}.staticflickr.com/{server}/"
NAME = "{id}_{secr... |
# Generated by Django 2.0.3 on 2018-08-03 10:28
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("site", "0016_auto_20180719_0520")]
operations = [
migrations.CreateModel(
name="SiteSettingsTranslation",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.