text stringlengths 12 6.59M |
|---|
"""
The TEAPOT MATRIX_Lattice is a subclass of a MAXTRIX_Lattice class. The Matrix lattice is generated
by using the TEAPOT lattice. The matrices are the linear part of the TEAPOT elements
tracking. The number of transport matrices in the lattice is equal to the sum of
all parts of TEAPOT elements. The RF cavities in ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def forwards_func(apps, schema_editor):
Organization = apps.get_model("entity", "Organization")
KnowledgeServer = apps.get_model("entity", "KnowledgeServer")
db_alias = schema_editor.connection.al... |
import numpy as np
from .. import initializers
from .. import regularizers
from .. import constraints
from keras.engine import Layer
from keras.engine import InputSpec
from .. import backend as K
from keras.utils.generic_utils import get_custom_objects
class PELU(Layer):
"""Parametric Exponential Linear Unit.
... |
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describ... |
import json
import os
import sys
import datetime
import traceback
from flask import Blueprint, request, abort, g, url_for
from git import Repo, InvalidGitRepositoryError, GitCommandError
from github import GitHub, ApiError
from multiprocessing import Process
from lxml import etree
from mod_ci.models import Kvm
from ... |
#===============================================================================
# Copyright 2012 Jake Ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/license... |
"""
mod_ci Controllers
===================
In this module, we are trying to maintain all functionality related
running virtual machines, starting and tracking tests.
"""
import hashlib
import json
import os
import shutil
import sys
import requests
import datetime
from flask import Blueprint, request, abort, g, url_f... |
# ===============================================================================
# Copyright 2018 Stephen Cox
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... |
from unittest import TestCase
from mock import Mock, patch
from six import (
text_type,
)
from planterbox.exceptions import UnmatchedStepException
class TestFeatureTestCase(TestCase):
def tearDown(self):
if hasattr(self, 'exc_info'):
del self.exc_info
def test_error_output(self):
... |
"""
Universal database functions.
specific functions related to some components are in component file
"""
import random
import urllib.parse
from datetime import datetime
from random import shuffle
import pymongo
from bson.objectid import ObjectId
from upol_crawler.settings import *
from upol_crawler.utils import urls... |
#!/usr/bin/env python
#
#
import sys
#
# Use scipy to integrate:
#
# dy^2 / dt^2 = -g + r (dh/dt)^2 (object falling with drag)
#
from scipy.linalg import det, solve
from scipy.integrate import odeint
import scipy.stats
import numpy as np
def deriv(h,t,param):
"""return derivatives of the array y"""
g = 9.8... |
"""Views for the URYPlayer submodule of the URY website.
---
Copyright (c) 2013, University Radio York.
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... |
## \file
## \ingroup tutorial_roofit
## \notebook
## Convert between NumPy arrays or Pandas DataFrames and RooDataSets.
##
## This totorial first how to export a RooDataSet to NumPy arrays or a Pandas
## DataFrame, and then it shows you how to create a RooDataSet from a Pandas
## DataFrame.
##
## \macro_code
## \macro_... |
##
# Copyright (c) 2006-2010 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
(C) Copyright [2014] InfoSec Consulting, 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 requir... |
#SQLALCHEMY_ECHO = True
|
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Joel Grand-Guillaume
# Copyright 2011-2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... |
# -*- coding: utf-8 -*-
# MIT license
#
# Copyright (C) 2018 by XESS Corporation / Max Maisel / Hildo Guillardi Júnior
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, i... |
import os.path
import sys
import re
import cx_Oracle
from django.db import connection, models
from django.db.backends.util import truncate_name
from django.core.management.color import no_style
from django.db.backends.oracle.base import get_sequence_name
from django.db.models.fields import NOT_PROVIDED
fro... |
import os
import subprocess
import time
from kokki import *
class ArrayProvider(Provider):
def action_create(self):
if not self.exists():
subprocess.check_call(["/sbin/mdadm",
"--create", self.resource.name,
"-R",
"-c", str(self.resou... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'patataman'
from django.core.management.base import BaseCommand, CommandError
from alumnos.models import Alumno as Alumno_new
from alumnos.models import Libro as Libro_new
from alumnos.models import Curso as Curso_new
from alumnos.models import Grupo as Grupo_... |
"""
Module containing a collection of detector functions used by the
Measurement Control.
"""
import traceback
import numpy as np
from copy import deepcopy
import time
from string import ascii_uppercase
from pycqed.analysis import analysis_toolbox as a_tools
from pycqed.utilities.timer import Timer, TimedMetaClass
from... |
"""
Module containing a collection of detector functions used by the
Measurement Control.
"""
import traceback
import numpy as np
from copy import deepcopy
import time
from string import ascii_uppercase
from pycqed.analysis import analysis_toolbox as a_tools
from pycqed.utilities.timer import Timer, TimedMetaClass
from... |
import numpy as np
import matplotlib.pyplot as plt
import itertools
import copy
import datetime
import os
import lmfit
from copy import deepcopy
import pygsti
import logging
log = logging.getLogger(__name__)
import pycqed.measurement.sweep_functions as swf
import pycqed.measurement.awg_sweep_functions as awg_swf
impor... |
#!/usr/bin/python
#James Tobat, 2014
import matplotlib.pyplot as plt
import csv
import sys
metric_log_file = sys.argv[1]
programs = []
projects = []
pubs = []
dates = []
# reads in the metrics log and will
# gather all appropriate metrics
# for the deployed programs
with open(metric_log_file, 'r') as r... |
# coding=utf-8
from __future__ import absolute_import
import os
import threading
import time
import Queue as queue
from octoprint.settings import settings
from octoprint.events import eventManager, Events
from octoprint.util.comm import MachineCom, get_interval
from beedriver.connection import Conn as BeeConn
from oct... |
import unittest
from lambdazen import zen
class GivenAZenDecorator(unittest.TestCase):
def test_It_creates_functions_from_alternate_lambda_syntax(self):
@zen
def lambdaContainer():
lambdaContainer.func = (x) > x + 1
def emptyFunction():
pass
self.assertTru... |
from pygraphc.preprocess.PreprocessLog import PreprocessLog
from pygraphc.similarity.StringSimilarity import StringSimilarity
from itertools import combinations
import csv
import multiprocessing
class LogTextSimilarity(object):
"""A class for calculating cosine similarity between a log pair. This class is intende... |
from landlab import RasterModelGrid, HexModelGrid
from landlab.components import Space, FlowAccumulator, DepressionFinderAndRouter
import numpy as np
from numpy import testing
from nose.tools import assert_raises
def test_bad_solver_name():
"""
Test that any solver name besides 'basic' and 'adaptive' raises a... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module provides classes that define a chemical reaction.
"""
import logging
import re
from itertools import combinations, chain
import numpy as np
from monty.fractions import gcd_float
from monty.jso... |
#!/usr/bin/env python
""" Minibook: the Facebook(TM) status updater
(C) 2009 Gergely Imreh <imrehg@gmail.com>
"""
VERSION = '0.1.0'
APPNAME = 'minibook'
MIT = """
Copyright (c) 2009 Gergely Imreh <imrehg@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and assoc... |
from pprint import pprint
from random import shuffle
import logging
import numpy as np
import os.path
from modules.irwin.AnalysedGameModel import AnalysedGameModel
from modules.irwin.GameModel import GameModel
from modules.irwin.PlayerModel import PlayerModel
from modules.irwin.PlayerGameActivations import PlayerGam... |
from __future__ import division
def sum_partial_reflections(integrated_data, min_total_partiality=0.5):
'''Sum partial reflections; weighted sum for summation integration; weighted
average for profile fitted reflections. N.B. this will report total
partiality for the summed reflection.'''
if not 'partiality' ... |
"""TreeNode operation to add a new node."""
import nose_parameterized
import unittest
from src.ops import abstract
class _TrivialReadOp(abstract.AbstractOp):
is_read = True
def do(self, root, args):
return self.__class__.is_read
class _TrivialWriteOp(_TrivialReadOp):
is_read = False
class _TrivialDua... |
#!/usr/bin/env python
"""
This module provides classes that define a chemical reaction.
"""
from __future__ import division
__author__="Shyue Ping Ong, Anubhav Jain"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "1.0"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyue@mit.edu"
__status__ = ... |
import re
from pycobot.pycobot import BaseModel
from peewee.peewee import CharField, IntegerField
import time
class karma:
karmare = re.compile(r"^([a-zA-Z0-9\[\]\{\}\\\|\-\_\`^]*)(:?,? ?)?"
"(\+\+|\-\-)")
def __init__(self, core, client):
Karma.create_table(True)
... |
from __future__ import division
def export_mtz(integrated_data, experiment_list, hklout):
'''Export data from integrated_data corresponding to experiment_list to an
MTZ file hklout.'''
# for the moment assume (and assert) that we will convert data from exactly
# one lattice...
# FIXME test to see if the mod... |
# Orca
#
# Copyright 2006-2008 Sun Microsystems Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This ... |
# coding: utf-8
from __future__ import division, unicode_literals, print_function
"""
Input sets for VASP GW calculations
Single vasp GW work: Creates input and jobscripts from the input sets for a specific job
"""
__author__ = "Michiel van Setten"
__copyright__ = " "
__version__ = "0.9"
__maintainer__ = "Michiel v... |
# Orca
#
# Copyright 2005-2009 Sun Microsystems Inc.
# Copyright 2010 Orca Team.
# Copyright 2014-2015 Igalia, S.L.
#
# This 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; either
# version 2.1 ... |
#!/usr/bin/env python
__author__ = 'Thomas R. Lennan, Michael Meisinger'
__license__ = 'Apache 2.0'
# NOTE: CANNOT import DataStore here!!!
COUCHDB_CONFIGS = {
"OBJECTS":{
'views': ['object','association','attachment']
},
"RESOURCES":{
'views': ['resource','directory','association','atta... |
# Orca
#
# Copyright 2005-2009 Sun Microsystems Inc.
# Copyright 2010 Orca Team.
# Copyright 2014-2015 Igalia, S.L.
#
# This 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; either
# version 2.1 ... |
#!/usr/bin/env python
__author__ = 'Thomas R. Lennan, Michael Meisinger'
__license__ = 'Apache 2.0'
from pyon.datastore.datastore import DataStore
COUCHDB_CONFIGS = {
DataStore.DS_PROFILE.OBJECTS:{
'views': ['object','association']
},
DataStore.DS_PROFILE.RESOURCES:{
'views': ['resource'... |
from django.template import RequestContext, loader
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
#from ifind.search.engine.bing import
from ifind.search.query import Query
from keys import BING_API_KEY
from ifind.models.game_mechanics import GameMechanic
from... |
# -*- coding: utf-8 -*-
from ..Node import Node
from .common import CtrlNode
class UniOpNode(Node):
"""Generic node for performing any operation like Out = In.fn()"""
def __init__(self, name, fn):
self.fn = fn
Node.__init__(self, name, terminals={
'In': {'io': 'in'},
'O... |
import distributions, parameter, poly, polycs, polyint, polyreg, polylsq, basis, stats, nataf
from parameter import Parameter
from polyreg import Polyreg
from polylsq import Polylsq
from polyint import Polyint
from polycs import Polycs
from poly import Poly
from stats import Statistics
from basis import Basis
from... |
# -*- coding: utf-8 -*-
"""
This is a template for a pysat.Instrument support file.
Modify this file as needed when adding a new Instrument to pysat.
This is a good area to introduce the instrument, provide background
on the mission, operations, instrumenation, and measurements.
Also a good place to provide contact i... |
import json
import os
import pytest
from django.core.files.uploadedfile import UploadedFile
from django.core.urlresolvers import reverse
from django.test import RequestFactory
from rest_framework import status
from hs_core.hydroshare import add_file_to_resource, ResourceFile, add_resource_files
from hs_file_types.mod... |
# 1.单链表的插入、删除、查找操作;
# 2.链表中存储的数据类型是Int
#
# Author:Lee
class Node(object):
"""链表结构的Node节点"""
def __init__(self, data, next_node=None):
"""Node节点的初始化方法.
参数:
data:存储的数据
next:下一个Node节点的引用地址
"""
self.__data = data
self.__next = next_node
@proper... |
from sys import stderr
from API_operaciones.mysql_connection import mysql2 as mysql
from API_operaciones.mysql_connection import app
import MySQLdb
def print_err(*args, **kwargs):
print(*args, file=stderr, **kwargs)
class bd_descripcion:
""" Esta clase tiene metodos para revisar
que los datos requeridos si e... |
##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... |
#
# Copyright 2018 Analytics Zoo 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 agreed to... |
#
# Copyright 2018 Analytics Zoo 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 agreed to... |
#
# Copyright 2016 The BigDL 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 agreed to in ... |
#!/usr/bin/python
#
# This is a 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 Ansible library is distributed in the hope that i... |
#!/usr/bin/env python
# vim: set encoding=utf-8
"""
Main server program.
"""
from gevent.wsgi import WSGIServer
from gevent.monkey import patch_all
patch_all()
# pylint: disable=wrong-import-position,wrong-import-order
import sys
import logging
import os
import jinja2
from flask import Flask, request, send_from_dir... |
import warnings
from datetime import datetime
from django.db import models
from django.db import IntegrityError
from django.template.defaultfilters import slugify
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext_lazy as _
from django.db.models.fields import Fiel... |
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# Copyright (C) 2014 Sangoma Technologies Corp.
# All Rights Reserved.
# Author(s)
# Simon Gomizelj <sgomizelj@sangoma.com>
import re
import keyword
from .url import url_builder
from .parser import parse
__all__ = ['api']
def make_typename(name):
'''Sanitize a... |
# -*- coding: utf-8 -*-
# Copyright(C) 2012 Roger Philibert
#
# This file is part of weboob.
#
# weboob 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 your op... |
# -*- coding: utf-8 -*-
import os
import os.path
import difflib
import urllib
import re
import Image
import json
import logging
from hashlib import sha1
from datetime import datetime
import tg
import genshi.template
import chardet
from formencode.validators import FancyValidator
from dateutil.parser import parse
from ... |
import matplotlib
matplotlib.use('Agg')
import argparse
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import subprocess
def setup_args():
parser = argparse.ArgumentParser()
parser._action_groups.pop()
requiredArguments = parser.add_argument_group('required arguments')
... |
#!/usr/bin/env python
# MIT License
#
# Copyright (c) 2017 Zhuhao Wang
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use... |
#
# Copyright 2016 The BigDL 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 agreed to in ... |
#!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
# -*- coding: utf-8 -*-
'''
The Salt Key backend API and interface used by the CLI. The Key class can be
used to manage salt keys directly without interfacing with the CLI.
'''
# Import python libs
from __future__ import absolute_import
from __future__ import print_function
import os
import stat
import shutil
import f... |
#
# Copyright (c) 2010 rPath, Inc.
#
# All Rights Reserved
#
import datetime
import logging
import time
from django.db import connection
from mint import mint_error
from mint.django_rest.rbuilder import inventory
from mint.django_rest.rbuilder import models as rbuildermodels
from mint.django_rest.rbuilder.inventory i... |
"""
Support to use flic buttons as a binary sensor.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.flic/
"""
import logging
import threading
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.... |
#!/usr/bin/env python
import sys
from pwmodel import HistPw, PcfgPw, NGramPw
# from IPython.core import ultratb
# sys.excepthook = ultratb.FormattedTB(mode='Verbose',
# color_scheme='Linux', call_pdb=1)
MIN_FREQ = 0.5
if __name__ == "__main__":
Usage = "\nUsage: \n$ {} [-hi... |
import json
import requests
def get_accounts(email, password):
# 1: Login.
session = requests.Session()
if session.get("https://wwws.mint.com/login.event?task=L").status_code != requests.codes.ok:
raise Exception("Failed to load Mint main page '{}'".format(Mint.START_URL))
data = {"userna... |
import spidev
class MCP3208 :
def __init__(self):
try:
# To open spi bus
self.spi = spidev.SpiDev()
# Raspi has only one spi bus (#0) and able to connect 2 devices (#0,#1) by default.
#self.spi.open(0,0) # connect to bus=0,device=0
self.spi.open(0,0) # connect to bus=0,device=0
#self.spi.mode = 0... |
"""
ARCHES - a program developed to inventory and manage immovable cultural heritage.
Copyright (C) 2013 J. Paul Getty Trust and World Monuments Fund
This program 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 Founda... |
#!/usr/bin/python3
import collections
import smtplib
import os
import sys
from email.mime.text import MIMEText
if len(sys.argv) > 1:
build_name = ' ' + ' '.join(sys.argv[1:])
else:
build_name = ''
email_list = 'nickolai@csail.mit.edu,kaashoek@mit.edu,dmz@mit.edu,akonradi@mit.edu,tchajed@mit.edu,atalaymertileri@g... |
"""
St. George Game
actions.py
Sage Berg
Created: 7 Dec 2014
"""
import random
import abc
import places
from display import Display
from raffle import Raffle
import money
class Action(object):
"""
abstract class
"""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def __init__(self):
... |
import pytest
from plenum.common.messages.node_messages import LedgerStatus
from plenum.common.types import f
from plenum.server.node import Node
from plenum.common.constants import CURRENT_PROTOCOL_VERSION
from plenum.common.exceptions import RequestNackedException
from plenum.test.helper import sdk_send_signed_req... |
import json
import os
import sys
import django
from bs4 import BeautifulSoup
from django.db.models import Q
if '__file__' in locals():
sys.path.append(os.path.join(os.path.dirname(__file__), os.path.pardir))
django.setup()
from article.models import Article
from core.models import AffixImage
from django.conf im... |
#
# Copyright 2016 The BigDL 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 agreed to in ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible 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
#... |
"""The motionEye integration."""
from __future__ import annotations
import asyncio
import json
import logging
from types import MappingProxyType
from typing import Any, Callable
from urllib.parse import urlencode, urljoin
from aiohttp.web import Request, Response
from motioneye_client.client import (
MotionEyeCli... |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import requests
import json
from podgen import Media, Podcast, Person, Category
from datetime import datetime
import traceback
import pytz
class Ximalaya():
def __init__(self, album_id):
self.podcast = None
self.album_id ... |
# vim: set expandtab sw=4 ts=4:
"""
Gather build related data.
Copyright (C) 2014-2015 Dieter Adriaenssens <ruleant@users.sourceforge.net>
This file is part of buildtimetrend/python-lib
<https://github.com/buildtimetrend/python-lib/>
This program is free software: you can redistribute it and/or modify
it under the t... |
from __future__ import print_function # for printing to stderr
# for exmaple: print(state.character.get_attack(), file=sys.stderr)
import sys
import random
import abc
import places
from raffle import Raffle
import money
import items
import persons
from outcome import Outcome
class Action(object):
"""
abst... |
# File: easyrtc.py
# Version: 1
# Description: Wrapper that makes using the clock simple
# License: MIT
# Authors: Renze Nicolai <renze@rnplus.nl>
import machine, time
# Functions
def string(print_date=False, print_time=True, timestamp = -1):
if timestamp<0:
[year, month, mday, wday, hour, minute, sec, us... |
"""
Module that performs some nonequispaced ffts using the nfft C library.
This module is made for simulation of diffraction
patterns and is not intended for general use.
"""
import pylab
import nfft_c as _nfft_c
def nfft1d(coordinates, vin):
"""
Performs a 1d nonequispaced fft.
Input:
coordinates :... |
#
# Copyright 2016 The BigDL 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 agreed to in ... |
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2015,2016
import sys
import uuid
import json
import inspect
import pickle
try:
import dill
dill.settings['recurse'] = True
except ImportError:
dill = pickle
import types
import base64
import streamsx.topology.dependency
import streamsx.topology... |
#
# Copyright 2016 The BigDL 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 agreed to in ... |
"""
Support for Radio Thermostat wifi-enabled home thermostats.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.radiotherm/
"""
import datetime
import logging
import voluptuous as vol
from homeassistant.components.climate import ClimateDevice, P... |
from . import msg
from collections import defaultdict
from functools import reduce
from proso.func import function_name
from threading import currentThread, RLock
from time import time
import abc
import hashlib
import importlib
import inspect
import json
import os
import pandas
import pickle
import re
class Function:... |
# vim: set expandtab sw=4 ts=4:
"""
Collection of supporting functions.
Copyright (C) 2014-2015 Dieter Adriaenssens <ruleant@users.sourceforge.net>
This file is part of buildtimetrend/python-lib
<https://github.com/buildtimetrend/python-lib/>
This program is free software: you can redistribute it and/or modify
it un... |
"""
sovrin-node package metadata
"""
__version_info__ = (0, 1)
__version__ = '{}.{}'.format(*(__version_info__ if len(__version_info__)==3 else __version_info__+(0,)))
__author__ = "Sovrin Foundation."
__license__ = "Apache 2.0"
__all__ = ['__version_info__', '__version__', '__author__', '__license__']
__dependencies... |
# Orca
#
# Copyright 2005-2009 Sun Microsystems Inc.
#
# This 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; either
# version 2.1 of the License, or (at your option) any later version.
#
# This... |
# build_index.py
import datetime
from elasticsearch import Elasticsearch
from elasticsearch import helpers
FILE_PATH = "./squid.log.elasticsearch"
ES_HOST = {
"host" : "10.0.0.158",
"port" : 9200
}
INDEX_NAME = 'ats'
TYPE_NAME = 'accesslog'
COMMIT_DATA_PER_TIME =5000
bulk_data = []
# create ES client, creat... |
import math
class Eye:
target = None
current_target_gaze = False
target_gaze_cache = []
def __init__(self, x = None, y = None):
self.x = x
self.y = y
def is_looking_at_target(self):
if not self.x or not self.y: return Eye.current_target_gaze
error = 20.0
i... |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distribut... |
from database.main import session
from models.misc.levelup_stats import LevelUpStats
from models.misc.level_xp_requirement import LevelXpRequirement
from decorators import run_once
from utils.helper import parse_int
@run_once
def load_character_level_stats() -> dict:
"""
Return a dictionary holding informatio... |
import json
from twisted.internet.defer import inlineCallbacks
from twisted.internet.task import Clock
from vumi.utils import http_request, http_request_full
from vumi.transports.tests.test_base import TransportTestCase
from vumi.transports.httprpc import HttpRpcTransport
from vumi.message import TransportUserMessage... |
#!/usr/bin/env python
import os
import numpy as np
import gippy
import unittest
import gippy.algorithms as alg
import gippy.test as gpt
from nose.tools import raises
"""
Included are some tests for doing processing in NumPy instead of Gippy,
for doing speed comparisons. To see the durations of each test use:
$ no... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# This file is part of Ansible
#
# Ansible 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 versi... |
#!/usr/bin/env python3
from argparse import ArgumentParser
import logging
import os
import sys
root_dir = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(root_dir)
from fusion_engine_client.analysis.file_reader import FileReader, TimeAlignmentMode
from fusion_engine_client.messages.co... |
"""
Counter for the days till a HTTPS (TLS) certificate will expire.
For more details about this sensor please refer to the documentation at
https://home-assistant.io/components/sensor.cert_expiry/
"""
import logging
import socket
import ssl
from datetime import datetime, timedelta
import voluptuous as vol
import ho... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.