text stringlengths 17 737k |
|---|
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# pylint: disable=g-bad-file-header
# Copyright 2016 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/LICENS... |
#!/usr/bin/python
import threading
import time
from Monsoon import HVPM
import struct
import time
import math
from Monsoon.calibrationData import calibrationData
from Monsoon import Operations as ops
from copy import deepcopy
import numpy as np
class channels:
timeStamp = 0
MainCurrent = 1
USBCurrent = 2
... |
"""File-backed data interface
"""
import copy
import csv
import glob
import os
import re
from functools import lru_cache, wraps
import pyarrow as pa
from smif.data_layer.data_array import DataArray
from smif.data_layer.data_interface import DataInterface
from smif.data_layer.load import dump, load
from smif.data_layer... |
#!/usr/bin/env python
"""
Converts an svl file into a JAMS annotation
"""
__author__ = "Oriol Nieto"
__copyright__ = "Copyright 2014, Music and Audio Research Lab (MARL)"
__license__ = "GPL"
__version__ = "1.0"
__email__ = "oriol@nyu.edu"
import argparse
import glob
import logging
import os
impor... |
#Metar Map V1
#Author: FHT
#2017-06-11
""" Code to Customize METARmap """
# Airport List --> PUT IN SAME ORDER AS LEDs ARE WIRED ON MAP
#airports = ["KBOS", "KBED", "KLWM", "KPSM", "KPYM"]
airports = ["KBOS", "KSAW","KHYR","KPIA","KDEN"]
# Brightnesss Time Settings
morn = 7 # Local time in morning (hour only) for... |
import argparse
from random import *
import math
from geo2d.geometry import *
import itertools
from tkinter import *
import time
from intervalset import AngularIntervalSet
import sys,traceback
from collections import namedtuple
def random_color():
return "#%02x%02x%02x" % (randrange(0,255),randrange(0,255),randran... |
from flask import abort, request, make_response
from flask.ext.admin import expose, BaseView
from .rbac import RBACMixin
from .xlsx import XLSXBuilder
from pmg import db
class Report(object):
def __init__(self, id, name, description, sql):
self.id = id
self.name = name
self.description = ... |
#!/usr/bin/env python3
# encoding: utf-8
"""poll_bot - A simple reaction-based Discord poll bot"""
__version__ = '0.1.0'
__author__ = 'Benjamin Mintz <bmintz@protonmail.com>'
__all__ = []
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='poll')
@bot.event
async def on_ready():
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Script that calculates ANI measures for a directory of genomes.
This script calculates Average Nucleotide Identity (ANI) according to one of
a number of alternative methods described in, e.g.
Richter M, Rossello-Mora R (2009) Shifting the genomic gold standard for the... |
from collections import OrderedDict
from collections.abc import Callable, Iterable
import warnings
from .blob import unpack
import numpy as np
from datajoint import DataJointError
from . import key as PRIMARY_KEY
def prepare_attributes(relation, item):
"""
Used by fetch.__getitem__ to deal with slices
:... |
# ===============================================================================
# Copyright 2013 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/licenses... |
#!/usr/bin/env python
import os
import sys
import re
import gc
import locale
import shutil
import time
import unittest
import doctest
import operator
import subprocess
import tempfile
import traceback
import warnings
try:
import platform
IS_PYPY = platform.python_implementation() == 'PyPy'
IS_CPYTHON = pl... |
# -*- coding: utf-8 -*-
##############################################################################
#
# connector-ecommerce for OpenERP
# Copyright (C) 2013-TODAY Akretion <http://www.akretion.com>.
# @author Sébastien BEAU <sebastien.beau@akretion.com>
#
# This program is free software: you can redistribu... |
# -*- encoding: utf -*-
import collections
from abjad import new
from abjad.tools import indicatortools
from abjad.tools import pitchtools
from abjad.tools import rhythmmakertools
from abjad.tools import systemtools
from abjad.tools import templatetools
import consort
music_specifier = consort.MusicSpecifier(
rhy... |
#!/usr/bin/python
import os
import sys
import re
import gc
import codecs
import shutil
import unittest
import doctest
import operator
import tempfile
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
try:
import cPickle as pickle
except ImportError:
import pickle
WITH_CY... |
#!/usr/bin/env python
"""Run Tulip unittests.
Usage:
python3 runtests.py [flags] [pattern] ...
Patterns are matched against the fully qualified name of the test,
including package, module, class and method,
e.g. 'tests.test_events.PolicyTests.testPolicy'.
For full help, try --help.
runtests.py --coverage is equiv... |
import re
def readStatus():
status = ''
f = open('/proc/asound/card0/pcm0p/sub0/status', 'r')
for line in f:
matchObj = re.match(r'state.*', line)
if matchObj:
status = matchObj.group()
break
matchObj = re.match(r'closed', line)
if matchObj:
... |
from __future__ import unicode_literals
import os, copy
from itertools import groupby
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation
from matplotlib import cm
from matplotlib.collections import LineCollection
from matplotlib.font_manager import FontProperties
from matplotlib.... |
# Copyright 2014: Mirantis 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 b... |
"""rwrtrack
Usage:
rwrtrack.py [-q|-v] get [<pages>]
rwrtrack.py [-q|-v] analyse <name> [<othername>] [-d <dates>]
rwrtrack.py [-q|-v] average <metric> [-d <dates>] [-x <pre>] [-y <pst>]
rwrtrack.py [-q|-v] rank <metric> [<n>] [-d <dates>] [-x <pre>] [-y <pst>]
rwrtrack.py [-q|-v] sum [-d <dates>]
... |
# -*- 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 print_function
import os
import stat
import shutil
import fnmatch
import hashlib
# Import salt li... |
#!/usr/bin/env python
import json
import redis
def dumps(host='localhost', port=6379, db=0, pretty=False):
r = redis.Redis(host=host, port=port, db=db)
kwargs = {}
if not pretty:
kwargs['separators'] = (',', ':')
else:
kwargs['indent'] = 2
kwargs['sort_keys'] = True
encoder... |
"""
Setuptools is released using 'jaraco.packaging.release'. To make a release,
install jaraco.packaging and run 'python -m jaraco.packaging.release'
"""
import re
import os
import subprocess
import pkg_resources
pkg_resources.require('jaraco.packaging>=2.0')
def before_upload():
_linkify('CHANGES.txt', 'CHANGE... |
# -*- coding: utf-8 -*-
"""
account.py
"""
from trytond.pool import Pool, PoolMeta
from trytond.model import fields, ModelView
from trytond.pyson import Eval
__metaclass__ = PoolMeta
__all__ = ['AccountJournal', 'AccountMove', 'AccountMoveLine']
class AccountJournal:
'Account Journal'
__name__ = 'accou... |
#!/usr/bin/python
#
# Copyright (c) 2008 rPath, Inc.
#
# All Rights Reserved
#
import sys
if '..' not in sys.path: sys.path.append('..')
import testsuite
testsuite.setup()
import mint_rephelp
import mock
import webprojecttest
from pcreator import factorydata
import factory_test.testSetup
factory_test.testSetup.setup(... |
from itertools import product
from ..parametric import f_twoway_rm, f_threshold_twoway_rm, \
defaults_twoway_rm
from nose.tools import assert_raises, assert_true
from numpy.testing import assert_array_almost_equal
import numpy as np
# hardcoded external test results, manually transferred
test_external = {
# S... |
from .assertion import *
from .attention import *
from .batch import *
from .cnn import *
from .classification import *
from .control import *
from .dynamic_length import *
from .embedding import *
from .initializers import *
from .invertible import *
from .layer import *
from .mask import *
from .math import *
from .m... |
# -*- coding: utf-8 -*-
##
## $Id$
## Ranking of records using different parameters and methods on the fly.
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN.
##
## CDS Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General... |
#!/usr/bin/env python3
import os, re, sys, subprocess
from io import open
# When passed `--release`, this script sets up Coq to support three
# `-compat` flag arguments. If executed manually, this would consist
# of doing the following steps:
#
# - Delete the file `theories/Compat/CoqUU.v`, where U.U is four
# vers... |
#!/usr/bin/env python2
'''
This script takes two arguments:
- an input filename (the output of epacts with a single phenotype)
- an output filename (please end it with `.json`)
It creates a json file which can be used to render a QQ plot.
'''
from __future__ import print_function, division, absolute_import
import o... |
#!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
class xrange(object):
"""
Advanced (re)implementation of xrange (supports slice/copy/etc.)
Reference: http://code.activestate.com/recipes/521885-a-pythonic-impleme... |
#!/usr/bin/python
import re
from numpy import array
import argparse
import sys
import csv
import pysam
import warnings
## This program is Copyright (C) 2012, Peter Hickey (hickey@wehi.edu.au)
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public Licens... |
#!/usr/bin/env python
import re
from numpy import array
import argparse
import sys
import csv
import pysam
import warnings
from operator import itemgetter, attrgetter
import itertools
from math import floor
import os
#### LICENSE ####
## Copyright (C) 2012 - 2014 Peter Hickey (peter.hickey@gmail.com)
## This file is ... |
from utils import *
from bop import *
totalErrorCount = None
def checkEquals(expected, actual):
if expected != actual:
totalErrorCount += 1
print "Failure: expected", expected, "but was", actual
# Tests definitions
def testCityBlueprint():
print "testCityBlueprint..."
game = Game(scriptPath)
blueprint = ga... |
from cws import MAKE_CONTEXT, POP_CONTEXT, PUSH, POP, LOAD_FAST, STORE_FAST,\
CMP, FULLADD, FULLSUB, UADD, USUB, FULLMUL, MULBYDIGIT, UMUL
import subprocess
import random
def random_ndigits(p):
return random.randint(10 ** (p-1), 10 ** p)
def random_varname():
return ''.join(random.s... |
# IPython log file
import numpy as np
import os
import sys
sys.path.append('/Users/jni/projects/unfold-embryo')
sys.path.append('/Users/jni/projects/skan')
sys.path.append('/Users/jni/projects/storm-cluster')
from skimage import filters, morphology, io
from gala import imio
import unfold
os.chdir('/Users/jni/Dropbox... |
# -*- coding: utf-8 -*-
"""
TODO: Merge autoregister tests from django-modeltranslation-wrapper.
NOTE: Perhaps ModeltranslationTestBase in tearDownClass should reload some modules,
so that tests for other apps are in the same environment.
"""
from __future__ import with_statement # Python 2.5 compatibility
imp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware 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 cop... |
#!/usr/bin/env python
# Copyright 2015, 2016 Jeff Trawick, http://emptyhammock.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
#
# Unl... |
# coding: utf-8
from vimtips import vimtips, addvimtip
from admin import listadmin, addadmin, deladmin
from ping import ping, pong
from start import start, about
from conversation import lsconversation
from pi import pingpi, takephoto
|
import os
from qtpy import QtWidgets
from astropy.visualization import (LinearStretch, SqrtStretch,
LogStretch, AsinhStretch)
from glue.external.echo.qt import autoconnect_callbacks_to_qt
from glue.utils.qt import load_ui, update_combobox
from glue.core.qt.data_combo_helper import ... |
# Copyright 2015 Bloomberg Finance L.P.
#
# 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 i... |
#!/usr/bin/python
"""Test of line navigation output of Firefox on a page with a simple
form. Note that this is based on the following Firefox 3 build:
Gecko/2007122122 Minefield/3.0b3pre. In addition, it is using the
current patch to bug 505102 to handle a significant change made in
the current Firefox. The asserti... |
#!/usr/bin/env python
from __future__ import unicode_literals
import time
import datetime
import requests
from lxml import etree
from dateutil.parser import *
from nameparser import HumanName
from scrapi.linter import lint
from scrapi.linter.document import RawDocument, NormalizedDocument
NAME = "clinicaltrials"... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: R. Patrick Xian
"""
# =========================
# Sections:
# 1. Utility functions
# 2. File I/O and parsing
# 3. Data transformation
# =========================
from __future__ import print_function, division
import numpy as np
import pand... |
from random import shuffle
"""
Scrabble Game
Classes:
Tile - keeps track of the tile letter and value
Rack - keeps track of the tiles in a player's letter rack
Bag - keeps track of the remaining tiles in the bag
Word - checks the validity of a word and its placement
Board - keeps track of the tiles' location on the bo... |
#
# Copyright (c) 2009, Georgia Tech Research Corporation
# 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, thi... |
#!/usr/bin/env python
##
## See COPYING file distributed along with the ncanda-data-integration package
## for the copyright and license terms
##
from __future__ import print_function
from builtins import str
import os
import re
import tempfile
import shutil
from sibispy import sibislogger as slog
from sibispy impo... |
from torch import nn
from transformers import AutoModel, AutoTokenizer, AutoConfig
import json
from typing import List, Dict, Optional, Union, Tuple
import os
class Transformer(nn.Module):
"""Huggingface AutoModel to generate token embeddings.
Loads the correct class, e.g. BERT / RoBERTa etc.
:param mode... |
# Django
# Third-Party
# Third-Party
from django_fsm_log.admin import StateLogInline
from fsm_admin.mixins import FSMTransitionMixin
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import Group as AuthGroup
# Local
from .filters import ... |
"""User-friendly public interface to polynomial functions. """
import mpmath
from mpmath.libmp.libhyper import NoConvergence
from ..core import (S, Basic, Expr, I, Integer, Add, Mul, Dummy,
Tuple, Symbol, preorder_traversal, sympify, Derivative)
from ..core.mul import _keep_coeff
from ..core.relat... |
# Copyright 2013-2014 Sebastian Kreft
#
# 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 ... |
import inspect
import itertools
import numpy as np
import os
from glob import glob
from dipy.utils.six import string_types
from dipy.workflows.base import get_args_default
def common_start(sa, sb):
"""Return the longest common substring from the beginning of sa and sb."""
def _iter():
for a, b in zip... |
"""Configuration for a datapath."""
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2019 The Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this ... |
# Copyright (c) The University of Edinburgh 2014-2015
#
# 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... |
# coding: utf-8
from __future__ import division, unicode_literals, print_function
"""
This module provides classes to run and analyze boltztrap on pymatgen band
structure objects. Boltztrap is a software interpolating band structures and
computing materials properties from this band structure using Boltzmann
semi-cla... |
from itertools import starmap, repeat
try:
from itertools import imap
except ImportError:
imap = map
import numpy as np
import weakref
from ..Qt import QtGui, QtCore, USE_PYSIDE, USE_PYQT5
from ..Point import Point
from .. import functions as fn
from .GraphicsItem import GraphicsItem
from .GraphicsObject import... |
#!/usr/bin/env python
# encoding: utf-8
#
# @Author: José Sánchez-Gallego
# @Date: Oct 30, 2017
# @Filename: spectrum.py
# @License: BSD 3-Clause
# @Copyright: José Sánchez-Gallego
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import numpy as np
import ... |
# vim:ts=4:sts=4:sw=4:expandtab
import os
import re
import shutil
import string
import sys
import traceback
from datetime import datetime, timedelta
from satori.client.common import want_import
want_import(globals(), '*')
def seconds(time):
return float(time.microseconds + (time.seconds + time.days * 24 * 3600) ... |
" spar loading "
from gpkit import Model, parse_variables
from gpkitmodels.GP.beam.beam import Beam
from gpkitmodels.GP.aircraft.tail.tail_boom import TailBoomState
from numpy import pi
#pylint: disable=no-member, unused-argument, exec-used, invalid-name
#pylint: disable=undefined-variable, attribute-defined-outside-i... |
"""Entry point for rpi2caster-driver"""
from .main import main as main_function
main_function()
|
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 1, 2017
@author: dg622@cornell.edu
"""
import numpy as np
import os
import EXOSIMS.MissionSim as MissionSim
import sympy
from sympy.solvers import solve
import scipy.integrate as integrate
import scipy.interpolate as interpolate
import scipy.optimize as optimize
import a... |
import numpy as np
import copy
import matplotlib.pyplot as plt
from scipy import interpolate
from matplotlib.path import Path
from matplotlib.patches import PathPatch, Circle
BIOSEMI_32_LOCS = {
'AF3': (-0.409, 0.87, 0.280), 'AF4': (0.409, 0.87, 0.280),
'C3': (-0.719, 0.0, 0.689), 'C4': (0.719, 0.0, 0.689),
'CP1... |
from libmyriad import ResultCode
import datetime
import json
import logging
import multiprocessing
import os
import psutil
import re
import requests
import shutil
import subprocess
import time
import zipfile
class Myriad:
def __init__(self):
self.config = []
self.maestroAPIGateway = None
self.myriadJobsFolder... |
#!/usr/bin/env python
# Displays all Launchpad bugs for OpenStack/Nova which block
# the creation of the release candidate.
#
# Copyright 2016 Markus Zoeller
import argparse
import os
import datetime
import common
parser = argparse.ArgumentParser()
parser.add_argument('-p',
'--project-name',
... |
# -*- coding: utf-8 -*-
from __future__ import (
print_function,
division,
unicode_literals,
absolute_import
)
# Local imports.
from natsort.natsort import (
natsort_key,
natsort_keygen,
natsorted,
versorted,
humansorted,
realsorted,
index_natsorted,
index_versorted,
... |
# -*- coding: utf-8 -*-
from __future__ import print_function, division, unicode_literals
import sys
import os
import re
from .natsort import natsort_key, natsorted, int_nosign_re, int_sign_re
from .natsort import float_sign_exp_re, float_nosign_exp_re
from .natsort import float_sign_noexp_re, float_nosign_noexp_re
fro... |
#! /usr/bin/env python
from __future__ import print_function
from argparse import ArgumentParser
import logging
import os
import re
import sys
import yaml
LOGGER = logging.getLogger('upgrade_dbt_schema')
LOGFILE = 'upgrade_dbt_schema_tests_v1_to_v2.txt'
COLUMN_NAME_PAT = re.compile(r'\A[a-zA-Z0-9_]+\Z')
# compatibil... |
import json
import oauth2
import optparse
import urllib
import urllib2
"""
url_params = {}
url_params['term'] = 'movie'
url_params['location'] = '19123'
url_params['limit'] = 3
url_params['radius_filter'] = 15000
url_params['category_filter'] = 'movietheaters'
url_params['sort'] = 0"""
def requester(host, path, url_pa... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... |
from __future__ import print_function
import numpy as np
import regreg.api as rr
from selection.api import randomization, glm_group_lasso, pairs_bootstrap_glm, multiple_views, discrete_family, projected_langevin, glm_group_lasso_parametric
from selection.tests.instance import logistic_instance
from selection.tests.de... |
from __future__ import division
from ..util import read_param_file
from sys import exit
import numpy as np
from scipy.stats import norm
import common_args
# Perform Morris Analysis on file of model results
# Returns a dictionary with keys 'mu', 'mu_star', 'sigma', and 'mu_star_conf'
# Where each entry is a li... |
##########################################################################
#
# Copyright 2010 VMware, Inc.
# All Rights Reserved.
#
# 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 res... |
__author__ = 'olga'
from qtools import Submitter
import os
from glob import glob
import sys
from gscripts import which
from gscripts.general import read_sample_info_file
class MisoPipeline(object):
def __init__(self, cl):
"""
Given a CommandLine object 'cl', save the arguments as
attribut... |
# -*- coding: utf-8 -*-
# set user selected language (default spanish)
if request.vars.lang: session.lang=request.vars.lang
T.force(session.lang or "es")
# Return service unavailable
# for maintenance
SUSPEND_SERVICE = False
ALLOW_VOTE = True
######################################
### PARAMETERS
##################... |
from gen_mixins import SubjectMixin
import geometry
from moduleBase import moduleBase
from moduleMixins import introspectModuleMixin
import moduleUtils
import Measure2DFrame
reload(Measure2DFrame)
import vtk
import vtktudoss
import wx
class M2DMeasurementInfo:
pass
class M2DWidget:
"""Class for encapsulating... |
import keras
from keras.datasets import mnist
from keras.layers import BatchNormalization
from keras.layers import Activation, Dense, Flatten
from keras.layers import Conv2D, SeparableConv2D, MaxPooling2D
from keras.models import Sequential
from keras.optimizers import SGD
batch_size = 128
epochs = 20
lear... |
# -*- coding: utf-8 -*-
# Tests for the contrib/localflavor/ AU form fields.
tests = r"""
## AUPostCodeField ##########################################################
A field that accepts a four digit Australian post code.
>>> from django.contrib.localflavor.au.forms import AUPostCodeField
>>> f = AUPostCodeField()... |
import datetime
import os
import random
import requests
import subprocess
import time
import traceback
import twitter
RATE = 60 * 30
MENTION_RATE = 65
FLICKR_API_KEY = None
TWITTER_CONSUMER_KEY = None
TWITTER_CONSUMER_SECRET = None
TWITTER_ACCESS_TOKEN_KEY = None
TWITTER_ACCESS_TOKEN_SECRET = None
MODE_NAMES = [
... |
#!/usr/bin/env python
"""
Shell Doctest module.
:Copyright: (c) 2009, the Shell Doctest Team All rights reserved.
:license: BSD, see LICENSE for more details.
"""
import commands
import doctest
import inspect
import re
import subprocess
import sys
import os
master = None
_EXC_WRAPPER = 'system_command("%s")'
def sy... |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2019 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.
from __future__ import unicode_literals
import json
import posixpath
import... |
import urllib
import cgi
import json
import base64
from functools import partial
import pytest
import requests
from tests.helpers import build_authorize_url, build_access_token_url, TEST_SERVER_HOST
# custom asserts
def assert_required_argument(url, argument, method='GET', headers=None):
error_description = 'Pa... |
#
# Created as part of the StratusLab project (http://stratuslab.eu),
# co-funded by the European Commission under the Grant Agreement
# INFSO-RI-261552."
#
# Copyright (c) 2011, GRNET S.A.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... |
# -*- coding: utf-8 -*-
"""muLAnFig: a tool to create a figure from muLAn outputs"""
# Copyright (c) 2014-2018 Clément Ranc & Arnaud Cassan
# Distributed under the terms of the MIT license
#
# This module is part of software:
# muLAn: gravitational MICROlensing Analysis code
# https://github.com/muLAn-proj... |
#!/usr/bin/env python2.7
#
# Copyright (c) 2016 The Hyve B.V.
# This code is licensed under the GNU Affero General Public License (AGPL),
# version 3, or (at your option) any later version.
#
#
# This file is part of cBioPortal.
#
# cBioPortal is free software: you can redistribute it and/or modify
# it under the ter... |
import datetime as dt
from decimal import Decimal
from django.core.management import call_command
from django.test import TestCase
from django.utils.six import StringIO
from mock import patch, PropertyMock, MagicMock
from silver.models import (Proforma, DocumentEntry, Invoice, Subscription,
... |
import random
import uuid
from datetime import date, datetime, timedelta
from decimal import Decimal
from io import BytesIO
from django.core.management import call_command
from django.test import TestCase, override_settings
from dateutil.relativedelta import relativedelta
from mock import patch
from casexml.apps.cas... |
from contextlib import contextmanager
from six.moves import cStringIO as StringIO
from datetime import datetime
try:
from unittest import skipUnless
except ImportError:
from unittest2 import skipUnless
import django
from django.test import TestCase
from django.core import management
from simple_history import m... |
# vim: tabstop=4 shiftwidth=4 expandtab
# Copyright (c) 2008, Aldo Cortesi. All rights reserved.
#
# 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 limit... |
from django.test import TestCase
from mock import patch
from corehq.apps.domain.models import Domain
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.locations.models import SQLLocation, LocationType
from corehq.apps.locations.tests.util import setup_locations_and_types, delete_all_locations
fro... |
"""The MomentumIterativeMethod attack."""
import numpy as np
import tensorflow as tf
from cleverhans.tf2.utils import optimize_linear, compute_gradient
from cleverhans.tf2.utils import clip_eta
def momentum_iterative_method(
model_fn,
x,
eps=0.3,
eps_iter=0.06,
nb_iter=10,
... |
from __future__ import division
from export_mtz import sum_partial_reflections
from export_mtz import scale_partial_reflections
def export_xds_ascii(integrated_data, experiment_list, hklout, summation=False,
include_partials=False, keep_partials=False):
'''Export data from integrated_data corre... |
#!/usr/bin/python
# vim: set ai sw=4 sta fo=croql ts=8 expandtab syntax=python
# die, PEP8's 80-column punched card requirement!
import time
import sys
import gzip
import os
import csv
import re
import fnmatch
import MySQLdb
from all impor... |
#!/usr/bin/env python
import os
import psycopg2 as pg
from simpledatamigrate import repositories as r, collector as c, migrator as m
def create_postgres_migrator():
connection = pg.connect(
host=os.getenv('COMPONENT_DB_HOST_ADDR'),
port=os.getenv('COMPONENT_DB_TCP_PORT'),
database=os.geten... |
import appliance
import pandas
def concatenate_traces(traces, metadata=None, how="strict"):
'''
Given a list of appliance traces, returns a single concatenated
trace. With how="strict" option, must be sampled at the same rate and
consecutive, without overlapping datapoints.
'''
if not metadata:... |
#!/usr/bin/python -u
# -*- coding: utf-8 -*-
from dbus.mainloop.glib import DBusGMainLoop
import dbus
import gobject
import argparse
import sys
import os
import json
# Victron packages
sys.path.insert(1, os.path.join(os.path.dirname(__file__), 'ext', 'velib_python'))
from vedbus import VeDbusService
from ve_utils imp... |
# Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author)
# Mathieu Blondel (partial_fit support)
#
# License: BSD Style.
"""Implementation of Stochastic Gradient Descent (SGD) with dense data."""
import numpy as np
import scipy.sparse as sp
from ..externals.joblib import Parallel, delayed
... |
# -*- coding: utf-8 -*-
"""Test the generic output formatter interface."""
from __future__ import unicode_literals
from decimal import Decimal
from textwrap import dedent
import pytest
from cli_helpers.tabular_output import format_output, TabularOutputFormatter
from cli_helpers.compat import binary_type, text_type
f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.