text stringlengths 17 737k |
|---|
# Make sure to set configuration, needs to be before any galpy imports
from galpy.util import config
config.__config__.set('astropy','astropy-units','True')
import numpy
from astropy import units
def test_orbit_setup_radec_basic():
from galpy.orbit import Orbit
o= Orbit([10.*units.deg,-20.*units.deg,3.*units.k... |
class BinMethod:
quantiles = 'quantiles'
jenks = 'jenks'
headtails = 'headtails'
equal = 'equal'
category = 'category'
def get_scheme_cartocss(column, scheme_info):
"""Get TurboCartoCSS based on input parameters"""
if 'colors' in scheme_info:
color_scheme = '({})'.format(','.join(s... |
#!/usr/bin/env python
# encoding: utf-8
"""A python bulk editor class to apply the same code to many files."""
# Copyright (c) 2012-19 Jérôme Lecomte
#
# 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 th... |
import os.path
from tests.BaseTestClasses import NormalizeFilenameTestCase
class TestSubprocessArguments(NormalizeFilenameTestCase):
def setUp(self):
super(TestSubprocessArguments, self).setUp()
def test_no_basicdateprefix(self):
(rc, output, error) = self.invokeAsSubprocess([], extraParams=... |
# backend.py
# openeventdatabase
from datetime import datetime
import json
import os
import re
import subprocess
import falcon
import psycopg2
import psycopg2.extras
import geojson
from shapely.geometry import shape
def db_connect():
return psycopg2.connect(
dbname=os.getenv("DB_NAME", "oedb"),
h... |
from importlib import import_module
from functools import wraps
__all__ = ['InvalidResponseError', 'get_backend', 'proxy']
class InvalidResponseError(Exception):
pass
def get_backend(name):
module = "%s.%s" % (__package__, str(name).lower())
try:
module = import_module(module)
except KeyEr... |
#!/usr/bin/env python3
"""
backend.py - ffmap-backend runner
https://github.com/ffnord/ffmap-backend
"""
import argparse
import json
import os
import sys
from datetime import datetime
import networkx as nx
from networkx.readwrite import json_graph
from lib import graph, nodes
from lib.alfred import Alfred
from lib.ba... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2012, GEM Foundation.
#
# OpenQuake 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 Lice... |
# Copyright 2014 Red Hat, 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 writing, s... |
# -*- coding: utf-8 -*-
from datetime import datetime
import magento
import xmlrpclib
import socket
from trytond.pool import PoolMeta, Pool
from trytond.transaction import Transaction
from trytond.pyson import Eval
from trytond.model import ModelView, ModelSQL, fields
from .api import OrderConfig
__metaclass__ = Pool... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2011, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenQuak... |
import os
from flask import Flask
from flask import request, render_template, make_response, jsonify
from flask.ext import restful
from flask.ext.pymongo import PyMongo
from bson.json_util import dumps
from bson.objectid import ObjectId
from flask.ext.restful import reqparse
## Patch for Flask-Restful
## http://blog... |
'''create charts showing results of valgbr.py
INVOCATION
python chart06.py [--data] [--test]
where
VALAVM in {roy, anil}
INPUT FILES
WORKING/chart01/data.pickle
WORKING/samples-train.csv
WORKING/valavm/YYYYMM.pickle
WORKING/data.pickle or WORKING/data-test.pickle
INPUT AND OUTPUT FILES (build with --data)
W... |
import numpy as np
import copy
from climlab import constants as const
from climlab.process.process import Process
from climlab.utils.walk import walk_processes
class TimeDependentProcess(Process):
'''A generic parent class for all time-dependent processes.'''
def __init__(self, time_type='explicit', timestep=... |
#!/usr/bin/python -u
#
# pagekite.py, Copyright 2010, the Beanstalks Project ehf.
# and Bjarni Runar Einarsson
#
# 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 Found... |
#!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import copy
import httplib
import re
import socket
import time
from subprocess import Popen as execute
from extra.beep.beep import beep
from lib.core.agent import agent
from... |
# Copyright 2015 Cedric RICARD
#
# This file is part of CloudMailing.
#
# CloudMailing 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 option) any later ve... |
from __future__ import print_function
import sys
import os
from ConfigParser import SafeConfigParser
# The following section determines which configuration file to load.
# It also deduces whether we are in a live environment (is_production,
# which forces DEBUG to False), or in a development environment (al-
# lowin... |
#The DF of a tidal stream
import numpy
import multiprocessing
from scipy import special, interpolate
from galpy.orbit import Orbit
from galpy.util import bovy_coords, fast_cholesky_invert, \
bovy_conversion, multi
_INTERPDURINGSETUP= True
_USEINTERP= True
class streamdf:
"""The DF of a tidal stream"""
def _... |
"""
Oracle 2.0 IRC Bot
help.py plugin module
http://toofifty.me/oracle
"""
import types, inspect
import traceback
import math
import time
from format import WHITE, CYAN, GREY, PURPLE
def _init(bot):
print '\t%s loaded' % __name__
# All commands are called with the arguments
# <module>.<command>(plugins.Loader(... |
#!/usr/bin/python
from pyroute2.netlink.iproute import *
from pyroute2 import IPRoute
from pyroute2 import IPDB
import dns
from qmf.console import Session
import subprocess
import netaddr
import select
import sys
import dns.resolver
import os
import re
import radvd
import routerlink
import datapath
import time
import ... |
"""
Vizio SmartCast TV support.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.vizio/
"""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant import util
from homeassistant.components.media_player impo... |
#!/mesonet/python/bin/python
import mx.DateTime
from pyIEM import iemAccess, iemdb
i = iemdb.iemdb()
climatedb = i["coop"]
ADJUSTMENT = 0
s = mx.DateTime.DateTime(2005,9,19)
e = mx.DateTime.DateTime(2005,10,18)
interval = mx.DateTime.RelativeDateTime(days=+1)
def averageTemp(db, hi="high", lo="low"):
highSum, lowS... |
__all__ = ['record', 'recarray','format_parser']
import numeric as sb
from defchararray import chararray
import numerictypes as nt
import sys
import types
import stat, os
import _internal
_byteorderconv = {'b':'>',
'l':'<',
'n':'=',
'B':'>',
'L':... |
# -*- coding: utf-8 -*-
from lettuce import *
from splinter import Browser
from lettuce.django import django_url
@before.each_scenario
def open_browser(step):
world.browser = Browser()
@after.each_scenario
def close_browser(step):
world.browser.quit()
def visit(url):
world.browser.visit(django_url(url))
@... |
from itertools import combinations
__author__ = "\n".join(['Ben Edwards (bedwards@cs.unm.edu)',
'Huston Hedinger (h@graphalchemist.com)',
'Dan Schult (dschult@colgate.edu)'])
__all__ = ['dispersion']
def dispersion(G, u=None, v=None, normalized=True, alpha=1.0, b=0.0,... |
from __future__ import division
# pylint: disable-msg=W0402
import re
import string
import sys
import tempfile
import warnings
import os
import subprocess
import locale
import traceback
from datetime import datetime
from functools import wraps
from contextlib import contextmanager
from numpy.random import randn, ran... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
import re
import six
import requests
from chandl import util
from chandl.model.posts import Posts
from chandl.model.post import Post
logger = logging.getLogger(__name__)
@six.python_2_unicode_compatible
class Thread:
"""
Repres... |
import asyncio
import base64
import binascii
import collections
import functools
import hashlib
import itertools
import logging
import random
import sys
import time
import types
import uuid
import aioredis
import msgpack
from channels.exceptions import ChannelFull
from channels.layers import BaseChannelLayer
logger ... |
"""Tests for the Compass images functions.
Not all of Compass is implemented, and the arrangement of Compass functions
doesn't exactly match the arrangement in the original documentation.
Regardless, this is a good starting place:
http://compass-style.org/reference/compass/helpers/
Some functions appear to be undocu... |
# -*- coding: utf-8 -*-
r"""
>>> floatformat(7.7)
u'7.7'
>>> floatformat(7.0)
u'7'
>>> floatformat(0.7)
u'0.7'
>>> floatformat(0.07)
u'0.1'
>>> floatformat(0.007)
u'0.0'
>>> floatformat(0.0)
u'0'
>>> floatformat(7.7,3)
u'7.700'
>>> floatformat(6.000000,3)
u'6.000'
>>> floatformat(6.200000, 3)
u'6.200'
>>> floatformat(... |
#!/usr/bin/env python3
# -- coding: utf-8 --
import logging
import requests
import time
import configparser
import os,sys
from bs4 import BeautifulSoup
try:
import http.client as http_client
except ImportError:
# Python 2
import httplib as http_client
cfg = configparser.ConfigParser()
dirname=os.path.dir... |
#######################################################################
#
# Dumper Implementations
#
#######################################################################
from __future__ import with_statement
movableTypes = set([
"QBrush", "QBitArray", "QByteArray", "QCustomTypeInfo", "QChar", "QDate",
"QD... |
class NCounter(object):
"""
INTERNAL USE. EVALUATION PURPOSE ONLY
This is a callback factory whose callbacks register a tick in this class.
If these callbacks are executed times times, then callback is called.
callback will be called after the handler generated by call.
Example us... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
import time
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from djet.assertions import InstanceAssertionsMixin
from djet.files import create_inmemory_file
from mock import MagicMock,... |
"""
Random walker segmentation algorithm
from *Random walks for image segmentation*, Leo Grady, IEEE Trans
Pattern Anal Mach Intell. 2006 Nov;28(11):1768-83.
Installing pyamg and using the 'cg_mg' mode of random_walker improves
significantly the performance.
"""
import warnings
import numpy as np
from scipy import ... |
#! /usr/bin/env python
# coding:utf-8
###############################################################################
#
# The Cling Interpreter
#
# Cling Packaging Tool (CPT)
#
# tools/packaging/cpt.py: Python script to launch Cling Packaging Tool (CPT)
#
# Documentation: tools/packaging/READ... |
"""
Docstrings for generated ufuncs
The syntax is designed to look like the function add_newdoc is being
called from numpy.lib, but in this file add_newdoc puts the docstrings
in a dictionary. This dictionary is used in
numpy/core/code_generators/generate_umath.py to generate the docstrings
for the ufuncs in numpy.co... |
#!/usr/bin/env python
# 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... |
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from django.db.models import Q, F, ExpressionWrapper, IntegerField, Count
from django.db.models import CharField, Value as V
from django.db.models.functions import Concat
from django.db.models.fields import NullBooleanFiel... |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import base64
import sys
TEMPLATE = """\
#cloud-config
packages:
- bzr
runcmd:
# Setup environment
- export HOME=/home/ubuntu
- export BUILD_ID=output
- export CHROOT_ROOT=/home/ubuntu/build-$BUILD_ID/chroot-autobuild
# Setup build chroot
-... |
# Copyright 2017 Capital One Services, 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... |
"""
MachineCom handles communication with GCode based printers trough (USB) serial ports.
For actual printing of objects this module is used from Cura.serialCommunication and ran in a separate process.
"""
__copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License"
import os
import gl... |
#!/usr/bin/python
# Reddit pics downloader
import threading
from requests import get
from json import loads
from os.path import exists
from os import mkdir
from time import sleep
import re
import sys
global open_files, OPEN_FILE_LIMIT
OPEN_FILE_LIMIT = 100
open_files = 0
class UsageError(Exception):
pass
cla... |
from __future__ import print_function
# Standard library imports
from collections import namedtuple
import sys
import time
import uuid
# System library imports
from pygments.lexers import PythonLexer
from IPython.external import qt
from IPython.external.qt import QtCore, QtGui
# Local imports
from IPython.core.input... |
# Copyleft (c) 2016 Cocobug All Rights Reserved.
# coding=utf-8
import os,sys,tree_parser
import re
import traceback
class WebPage(object):
"A webpage object, with some variables and all localisations"
def __init__(self,path):
self.path=path
self.name=os.path.split(path)[-1]
self.vari... |
# Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
__version__ = '0.22.12'
from timeseries import \
Hours, Minutes, Seconds, Milliseconds, Microseconds, Picoseconds, \
SR11025, SR22050, SR44100, SR48000, SR96000, HalfLapped, Stride, \
TimeSlice, VariableRateTimeSeries, VariableRateTimeSeriesFeature, \
SampleRate, AudioSamples, TimeDimension, audio_samp... |
"""
The Bookalope module contains a simple object model to make Bookalope's REST API
more accessible. See http://bookalope.net/
"""
import base64
import json
import re
import datetime
import requests
import babel
def _is_token(token_s):
"""
Given a string, returns True if the string contains a Bookalope token... |
from __future__ import division
from math import ceil
from itertools import combinations
from operator import mul
# Sum of multiples of 3 or 5 under 1000, simplified:
# print (3 * 333 * 334 / 2) + (5 * 199 * 200 / 2) - (15 * 66 * 67 / 2)
def getSumOfMultiple(num, limit):
return int((ceil(limit / num) - 1) ... |
#
# Trick to deal with RST pages and sphinx incompatibility. set to false when building docs
#
from ConfigParser import SafeConfigParser
from cloudmesh.config.cm_config import cm_config, cm_config_server
from cloudmesh.util.keys import get_fingerprint
from cloudmesh.provisioner.provisioner import *
from cloudmesh.user... |
"""Miscellaneous operations for traditional philology and simple
statistics."""
__author__ = ['Kyle P. Johnson <kyle@kyle-p-johnson.com>',
'Steven Bird <stevenbird1@gmail.com>', # original author of NLTK's ConcordanceIndex()
'Edward Loper <edloper@gmail.com>'] # original author of NLTK's ... |
##
## patts-qt - Qt GUI client for PATTS
## Copyright (C) 2015-2016 Delwink, LLC
##
## 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 Foundation, version 3 only.
##
## This program is distribu... |
# coding: utf-8
from collections import OrderedDict
from pdp.tutorial.models import Tutorial, Part, Chapter, Extract
def move(obj, new_pos, position_f, parent_f, children_fn):
'''
Move an object and reorder other objects affected by moving.
This function need the object, the new position you want the o... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Dag Wieers <dag@wieers.com>
# 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... |
"""
Plugin mixin classes
"""
import logging
import json
import requests
from django.conf.urls import url, include
from django.db.utils import OperationalError, ProgrammingError
from plugin.models import PluginConfig, PluginSetting
from plugin.urls import PLUGIN_BASE
logger = logging.getLogger('inventree')
class ... |
import requests
import re
from time import sleep
from bs4 import BeautifulSoup
from os.path import basename
class PTTparser:
def __init__(self):
self.PTTaddress = 'https://www.ptt.cc/bbs/'
def getSoup(self, URL, encoding='utf-8'):
response = requests.get(URL, cookies={'over18': '1'})
... |
"""
nb-NO to nn-NO Metadata Macro will perform the following changes to current content item:
- change the language to nn-NO
"""
import requests
from requests.auth import HTTPBasicAuth
def nob_NO_translate_macro(item, **kwargs):
creds = HTTPBasicAuth("superdesk", "babel")
payload = {
k: item.get(k)
... |
# Copyright (c) Charl P. Botha, TU Delft
# All rights reserved.
# See COPYRIGHT for details.
from module_kits.misc_kit.mixins import SubjectMixin
import vtk
# z-coord of RBB box
RBBOX_HEIGHT = 0.5
#############################################################################
class DeVIDECanvasObject(SubjectMixin):
... |
"""
@author Swarbhanu Chatterjee
@file ion/services/dm/utility/uns_utility_methods.py
@description A module containing common utility methods used by UNS and the notification workers.
"""
from pyon.public import get_sys_name, OT, IonObject, CFG
from pyon.util.ion_time import IonTime
from pyon.util.log import log
from p... |
"""
Generic OCR helper functions and wrapper around various OCRopus
and Tesseract tools.
"""
import os
import re
from datetime import datetime
import subprocess as sp
import uuid
from PIL import Image
from django.utils import simplejson
from django.conf import settings
from HTMLParser import HTMLParser
class Hocr... |
# -*- coding: utf-8 -*-
from flask import Blueprint, render_template, request, redirect, flash, url_for
from flask.ext.login import login_required, current_user
from sqlalchemy import or_
from octopus.case.forms import NewCaseForm
from octopus.case.utils import create_query
from octopus.extensions import nav, db
from ... |
"""
Handle view-logic for the djangoapp
"""
from lti_consumer.models import LtiConfiguration
from opaque_keys.edx.keys import CourseKey
from opaque_keys import InvalidKeyError
from rest_framework import serializers
from rest_framework.response import Response
from rest_framework.views import APIView
from openedx.core.... |
import os
########## DATABASE CONFIGURATION
DB_NAME = os.getenv('DB_NAME')
HOST = os.getenv('DB_HOST')
USER = os.getenv('DB_USER')
PASS = os.getenv('DB_PASS')
PORT = os.getenv('DB_PORT', 5432)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': DB_NAME,
'... |
from __future__ import division
from __future__ import absolute_import
from builtins import str
from builtins import range
from past.utils import old_div
from builtins import object
from .test_helpers import (raises_with_message_like, data_filename,
CalvinistDynamics, make_1d_traj,
... |
# Copyright (c) 2010-2017 Samuel Abels
#
# 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, copy, modify, merge, publish, d... |
#! /usr/bin/env python3
import sqlite3
import subprocess
import os
import bcrypt
import hashlib
from Crypto.Cipher import AES
import codecs
import json
import cherrypy
import time
pwdatabase = 'passwords.db'
# pwdatabase = ':memory:'
authKeys = dict()
login_attempts = []
login_attempt_window = 60 * 5
login_attempts... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2006 Edgewall Software
# Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com>
# Copyright (C) 2004-2005 Christopher Lenz <cmlenz@gmx.de>
# Copyright (C) 2005-2006 Christian Boos <cboos@neuf.fr>
# All rights reserved.
#
# This software is licensed as described in th... |
# -*- coding: utf-8 -*-
import time
import hashlib
import pickle
from threading import RLock
cache = {}
def is_obsolete(entry, duration):
return time.time() - entry['time'] > duration
def compute_key(function, args, kwargs):
key = pickle.dumps((function.func_name, args, kwargs))
return hashlib.sha1(ke... |
from paver.easy import *
import paver.virtual
import os
base = path(os.path.abspath(os.path.dirname(__file__)))
easy_install = base + '/bin/easy_install'
libraries = [
('django', ''),
('http://bitbucket.org/ubernostrum/django-registration/get/tip.zip', '-Z'),
]
options(
virtualenv=Bunch(
script_na... |
from __future__ import print_function
import os
from optparse import make_option
import urlparse
from jinja2 import BaseLoader, Environment, TemplateNotFound
import paramiko
from paver.easy import *
import yaml
@task
@cmdopts([("host=", None, "The host for which to build")], share_with=['generate_image'])
def upgra... |
from datetime import datetime
from django.contrib.auth.models import User
from django.db.models import F
from brabeion import badges
from brabeion.models import BadgeAward
from piston.handler import BaseHandler
from piston.utils import require_extended
from accounts.models import UserProfile
from api.forms import (Vali... |
#SPDX-License-Identifier: MIT
__name__ = "Augur"
__slug__ = "augur"
__url__ = "https://github.com/chaoss/augur"
__short_description__ = "Python 3 package for free/libre and open-source software community metrics & data collection"
__version__ = "0.15.2"
__release__ = "v0.15.2"
__license__ = "MIT"
__copyright__ = "CH... |
#!/usr/bin/env python
# encoding: utf-8
"""
vcf_parser.py
Parse a file with variant info in vcf format.
Creates batches and put them into a queue object.
The batches are dictionary objects with overlapping features where the feature id:s are keys and the values are dictionarys with variants.
Batch = {feature_1_id:{... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Deep learning via the distributed memory and distributed bag of words models from
[1]_, using either hierarchical softmax or negative ... |
# -*- coding: utf-8 -*-
import datetime
from nose.tools import assert_less
from numpy.testing import assert_array_almost_equal
from openfisca_core import periods
from openfisca_france.tests import base
def test_dossier_de_presse_1():
# Célibataire sans enfants1 part : revenu mensuel net = 1593 IR2015 = 1138 IR... |
# -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2013 Rémi Duraffort
# This file is part of RandoAmisSecours.
#
# RandoAmisSecours 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... |
# Django settings for comics project.
import os
import django
PROJECT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../')
DJANGO_DIR = os.path.dirname(os.path.abspath(django.__file__))
SECRET_KEY = 'This key should really be overriden in comics/settings/local.py'
DATABASES = {
'default': {
... |
# The purpose of this script is to create a set of maps from a HAZUS run
# based on user input. The user selects one or more maps to create and
# the script takes maps from a template directory and copies them into
# a new project. For each map, the script generates a PDF and JPEG output.
# Author: Josh Groeneveld
#... |
#-----------------------------------------------------------------------------
# Copyright (C) 2010 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING.txt, distributed as part of this software.
#------------------------------------------------... |
# coding: utf-8
"""Utilities for installing Javascript extensions for the notebook"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import os
import shutil
import sys
import tarfile
import zipfile
from os.path import basenam... |
"""The IPython notebook format
Use this module to read or write notebook files as particular nbformat versions.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from IPython.utils.log import get_logger
from . import v1
from . import v2
from . import v3
from . ... |
import collections
import itertools
import math
import numbers
import operator
import random
import sys
from permuta import Pattern, Rotatable, Shiftable, Flippable
from permuta.misc import left_floor_and_ceiling
if sys.version_info.major == 2:
range = xrange
class Permutation(tuple, Pattern, Rotatable, Shiftab... |
#!/usr/bin/env python3
#
# Copyright (C) 2021 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
# published by the Free Software Foundation.
#
# This program is distributed in the hope t... |
version_info = (0, 0, 4)
__version__ = '.'.join(map(str, version_info))
|
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... |
# Licensed under the MIT License
# https://github.com/craigahobbs/chisel/blob/master/LICENSE
"""
TODO
"""
__version__ = '0.9.88'
from .action import \
Action, \
ActionError, \
action
from .app import \
Application, \
Context
from .doc import \
get_doc_requests
from .model import \
Acti... |
import os
import numpy as np
import pandas as pd
from pathlib import Path
from openpnm.utils import logging
logger = logging.getLogger(__name__)
def gaseous_species_in_water(target, chemical_formula,
temperature="throat.temperature"):
r"""
Calculate Henry's law constant for gaseou... |
import ResolvedStellarPops as rsp
import numpy as np
import itertools
import sys
import os
import logging
logger = logging.getLogger()
class model_grid(object):
def __init__(self,
cmd_input=None,
photsys=None,
filter=None,
object_mass=1e6,
... |
#!/usr/bin/python3
# Email: t3knician@protonmail.com
# Twitter: @HOuadhour
# The QtCore module contains the core non GUI functionality. The QtGui
# contains classes for windowing system integration, event handling, 2D
# graphics, basic imaging, fonts and text. The QtWidgets module contains
# classes that provide a s... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import print_function
import os
import shutil
import pytest
from astroquery.utils.commons import TableList
from astropy.tests.helper import remote_data
from ... import esasky
ESASkyClass = esasky.core.ESASkyClass()
@remote_data
class T... |
#!/usr/bin/python2
def get_argument_parser():
parser = argparse.ArgumentParser(
description="RCAS provides intuitive reports and publication ready graphics"
" from input peak intervals in BED foramt, generated from clip-seq.")
parser.add_argument("BED",
metavar="BED",
... |
"""
`try` - Awesome cli tool to try out python packages.
:copyright: (c) by Timo Furrer
:license: MIT, see LICENSE for details
"""
__VERSION__ = "0.2.3"
|
from carto.exceptions import CartoException, CartoRateLimitException
from .base_dataset import BaseDataset
from ...utils import is_sql_query
class QueryDataset(BaseDataset):
def __init__(self, data, credentials, schema=None):
super(QueryDataset, self).__init__(credentials)
self._query = data
... |
"""
This module provides various regression analysis techniques to model the
relationship between the dependent and independent variables.
"""
import os
import numpy as N
from neuroimaging.core.image.image import Image
class LinearModelIterator(object):
def __init__(self, iterator, outputs=[]):
self.ite... |
"""
===========================
Bayesian calibration routine
based on work of (Patil_et_al, 2010 - #http://www.map.ox.ac.uk/media/PDF/Patil_et_al_2010.pdf) in MCMC in pyMC3
and the works of bayesian calibration of (Kennedy and O'Hagan, 2001)
===========================
J. Fonseca script development 27.10.16
... |
# This file is part of the GOsa project.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import functools
import hashlib
import logging
import cups
import multiprocessing
import os
import temp... |
"""
The :mod:`tslearn.barycenters` module gathers algorithms for time series barycenter computation.
"""
# Code for soft DTW is by Mathieu Blondel under Simplified BSD license
import numpy
from scipy.interpolate import interp1d
from scipy.optimize import minimize
from sklearn.exceptions import ConvergenceWarning
impo... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of asses... |
"""This is Gittip's payday algorithm. I would appreciate feedback on it.
The payday algorithm is designed to be crash-resistant and parallelizable, but
it's not eventually consistent in the strict sense (iinm) because consistency
is always apodeictically knowable.
Exchanges (moving money between Gittip and the outsid... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.