src stringlengths 721 1.04M |
|---|
# This file is part of fedmsg.
# Copyright (C) 2015 Sayan Chowdhury.
#
# fedmsg 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... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# l... |
#!/usr/bin/python
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
import sys
import re
"""Baby Names exercise
Define the extract_names() function below and c... |
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt
"""Settings tests for django_coverage_plugin."""
from django.test.utils import override_settings
from .plugin_test import DjangoPluginTestCase, test_s... |
# -*- coding: utf-8 -*-
# Module: default
# Author: Yangqian
# Created on: 25.12.2015
# License: GPL v.3 https://www.gnu.org/copyleft/gpl.html
# Largely following the example at
# https://github.com/romanvm/plugin.video.example/blob/master/main.py
import xbmc,xbmcgui,urllib2,re,xbmcplugin
from BeautifulSoup import Be... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import pyowm
from datetime import datetime
from EmeraldAI.Logic.Singleton import Singleton
from EmeraldAI.Config.Config import Config
class Weather(object):
__metaclass__ = Singleton
__owm = None
__language = None
__defaultCountry = None
def __init__(sel... |
#!/usr/bin/env python
""" game.py Humberto Henrique Campos Pinheiro
Game logic.
"""
from config import WHITE, BLACK, EMPTY
from copy import deepcopy
class Board:
""" Rules of the game """
def __init__ ( self ):
self.board = [ [0,0,0,0,0,0,0,0], \
[0,0,0,0... |
from django.shortcuts import render, redirect
from django.db import transaction
from django.contrib.auth.decorators import login_required
from .forms import ProfileNameForm, ProfileDetailForm
from django.contrib import messages
# Create your views here.
def index(request):
# Add variables in the custom_variables... |
"""The blocking connection adapter module implements blocking semantics on top
of Pika's core AMQP driver. While most of the asynchronous expectations are
removed when using the blocking connection adapter, it attempts to remain true
to the asynchronous RPC nature of the AMQP protocol, supporting server sent
RPC comman... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
from django.conf import settings
from django.contrib.auth.models import Group, SiteProfileNotAvailable
from django.core.exceptions import ImproperlyConfigured
from django.db import models, transaction
from transifex.txcommon.log import logger
if not settings.AUTH_PROFILE_MODULE:
raise SiteProfileNotAvailable
try:
... |
__source__ = 'https://leetcode.com/problems/numbers-with-same-consecutive-differences/'
# Time: O(2^N)
# Space: O(2^N)
#
# Description: Leetcode # 967. Numbers With Same Consecutive Differences
#
# Return all non-negative integers of length N such that
# the absolute difference between every two consecutive digits is ... |
#!/usr/bin/python2
__version__ = "1.0.0"
import plexapi
from plexmyxbmc.config import get_config
from plexmyxbmc.log import get_logger
plexapi.X_PLEX_PROVIDES = 'player,controller,sync-target'
plexapi.X_PLEX_PRODUCT = "PlexMyXBMC"
plexapi.X_PLEX_VERSION = __version__
plexapi.X_PLEX_IDENTIFIER = get_config().get('uuid'... |
from __future__ import division
__author__ = 'Bijan'
'''
This is a function to plot CCLM outputs.
'''
from netCDF4 import Dataset as NetCDFFile
import numpy as np
import matplotlib.pyplot as plt
#from matplotlib.backends.backend_pdf import PdfPages
import os
import cartopy.crs as ccrs
import cartopy.feature
def rand_s... |
import sys
import datetime
class ProgressIndicator(object):
ENABLED = True
RECORDS = list()
def __init__(self, prompt, frequency):
self._display(prompt)
self._record(prompt + 'start')
self.prompt = prompt
self.frequency = frequency
self.count = 0
def click(sel... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4
# repoze.who.plugins.saml2: A SAML2 plugin for repoze.who
# Copyright (C) 2015 Andrew Colin Kissa <andrew@topdog.za.net>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file... |
import os
import time
import dialog
from modules.sitegrouphosttools import SiteGroupHostTools
from modules.groups.group import Group
from modules.groups.groupform import GroupForm
from modules.groups.groupmenu import GroupMenu
from modules.sitegrouphosttools import get_group_members
class GroupListMenu(SiteGroupHostTo... |
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Walter Bender
# Port To GTK3:
# Ignacio Rodriguez <ignaciorodriguez@sugarlabs.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 ... |
# -*- coding: utf-8 -*-
"""
cartogram_geopandas v0.0.0c:
Easy construction of continuous cartogram on a Polygon/MultiPolygon
GeoDataFrame (modify the geometry in place or create a new GeoDataFrame).
Code adapted to fit the geopandas.GeoDataFrame datastructure from
Carson Farmer's code (https://github... |
"""
This module is an API for downloading, getting information and loading datasets/models.
Give information about available models/datasets:
>>> import gensim.downloader as api
>>>
>>> api.info() # return dict with info about available models/datasets
>>> api.info("text8") # return dict with info about "text8" dat... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
"""A high-speed, production ready, thread pooled, generic HTTP server.
Simplest example on how to use this module directly
(without using CherryPy's application machinery)::
from cherrypy import wsgiserver
def my_crazy_app(environ, start_response):
status = '200 OK'
response_headers = [('Cont... |
# -*- encoding: utf-8 -*-
from django import forms
from django.forms import ModelForm, DateInput
from django.contrib.admin import widgets
from django.utils.translation import ugettext as _
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from django.forms.models import inlineformset_factory
from... |
# coding=utf-8
# pylint: disable-msg=E1101,W0612
import pytest
from datetime import datetime, date
import numpy as np
import pandas as pd
from pandas.core.dtypes.common import is_integer_dtype, is_list_like
from pandas import (Index, Series, DataFrame, bdate_range,
date_range, period_range, time... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Frequent used classifiers List = [
"Development Status :: 1 - Planning",
"Development Status :: 2 - Pre-Alpha",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Development Status :: 5 - Production/Stable",
"Development Stat... |
import json
import logging
from typing import (
Any,
List,
Mapping,
TYPE_CHECKING,
Tuple,
)
import uuid
from aiohttp import web
import aiohttp_cors
import sqlalchemy as sa
import trafaret as t
import yaml
from ai.backend.common import validators as tx
from ai.backend.common.logging import BraceSty... |
import praw
import random
import itertools
from prawcore import NotFound
from Config import getToken
from nsfw import isEnabled
def initReddit():
global r
r = praw.Reddit(user_agent='Discord Bot', client_id='byorb8K1SwaO1g', client_secret=getToken('Reddit'))
def random_hot_post(subreddit, limit, message):
... |
"""
Optional IPython extension for working with Parameters.
This extension offers extended but completely optional functionality
for IPython users. From within IPython, it may be loaded using:
%load_ext param.ipython
This will register the %params line magic to allow easy inspection of
all the parameters defined on... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2015,掌阅科技
All rights reserved.
摘 要: test_key.py
创 建 者: WangLichao
创建日期: 2015-08-18
"""
import sys
import os
sys.path.append(os.path.dirname(os.path.split(os.path.realpath(__file__))[0]))
import unittest
from zyredis.key import Key
class TestKeyModel... |
import datetime
from django.conf import settings
from django.utils import timezone
from django.core.files import File
from funfactory.urlresolvers import reverse
from nose.tools import eq_, ok_
from airmozilla.main.models import (
Event,
Channel,
Template,
Picture,
EventHitStats,
Approval,
)
... |
# ----------------------------------------------------------------------------
# Copyright (c) 2017-, LabControl development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# -------------------------------------------------... |
#!/usr/bin/python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
#
# stats
#
# Query StatsOracle info from analytics
#
import sys
import os
import argparse
import json
import datetime
from opserver_util import OpServerUtils
from sandesh_common.vns.ttypes import Module
from sandesh_common.vns.co... |
import gzip
from sofia.step import Step
from lhc.binf.sequence.reverse_complement import reverse_complement
try:
import pysam
def get_fasta_set(filename):
return pysam.FastaFile(filename)
except ImportError:
from lhc.io.fasta import FastaInOrderAccessSet
def get_fasta_set(filename):
f... |
#!/usr/bin/env python
# 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
# "Li... |
#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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 us... |
from boxbranding import getBoxType
from time import localtime, mktime
from datetime import datetime
import xml.etree.cElementTree
from os import path
from enigma import eDVBSatelliteEquipmentControl as secClass, \
eDVBSatelliteLNBParameters as lnbParam, \
eDVBSatelliteDiseqcParameters as diseqcParam, \
eDVBSatellit... |
from __future__ import print_function
import attr
from zope.interface import implementer
from twisted.internet.interfaces import IReactorUDP
from twisted.internet.protocol import DatagramProtocol
from twisted.internet import defer
from txmix import IMixTransport
@implementer(IMixTransport)
@attr.s()
class UDPTrans... |
# Copyright 2015 Red Hat, 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 law o... |
# Copyright 2016 Measurement Lab
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
#!/usr/bin/env python
# VizStack - A Framework to manage visualization resources
# Copyright (C) 2009-2010 Hewlett-Packard
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# ... |
#!/usr/bin/env python
#################################
# @author: Mahmoud Shaheen #
# MedicalBox IOT Project #
# Arduino #
#################################
#functions for serial communication with Arduino
#called from controlHardware module
import serial
import data
import time
ser = se... |
import glob
import logging
import os
from easyprocess import EasyProcess
from entrypoint2 import entrypoint
commands = """
python3 -m pyunpack.cli --help
"""
commands = commands.strip().splitlines()
def empty_dir(dir):
files = glob.glob(os.path.join(dir, "*"))
for f in files:
os.remove(f)
@entry... |
#
# rpclib - Copyright (C) Rpclib contributors.
#
# 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 lib... |
__author__ = 'averaart'
"""This module offers a means to store multiple versions of the same fastq file, by only storing the differences between
them and recreating the processed file based on the original file and the differences."""
# Batteries included
import os
import sys
from subprocess import Popen, PIPE
import ... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# This file is part of Fail2Ban.
#
# Fail2Ban 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;... |
#
# Copyright (C) 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 wr... |
# -*- coding: utf-8 -*-
import logging
from geomsmesh import geompy
from toreFissure import toreFissure
from ellipsoideDefaut import ellipsoideDefaut
from rotTrans import rotTrans
from genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
# ---------------------------------------------------------------------... |
# Lint as: python3
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
__all__ = ['Composer', 'ComposerError']
from .error import MarkedYAMLError
from .events import *
from .nodes import *
class ComposerError(MarkedYAMLError):
pass
class Composer:
def __init__(self):
self.anchors = {}
def check_node(self):
# Drop the STREAM-START event.
... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# coarsewignerfunction.py: A class for Coarse-grained Wigner functions
#
# © 2016 Olivia Di Matteo (odimatte@uwaterloo.ca)
#
# This file is part of the project Balthasar.
# Licensed under BSD-3-Clause
#
from itertools import product
import numpy as np
from pynitefields imp... |
# -*- coding: UTF-8 -*-
"""
$Id$
$URL$
Copyright (c) 2010 foption
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, modif... |
"""
==============================================
Denoise images using Non-Local Means (NLMEANS)
==============================================
Using the non-local means filter [Coupe08]_ and [Coupe11]_ and you can denoise
3D or 4D images and boost the SNR of your datasets. You can also decide between
modeling the n... |
"""
This script produces a shapefile from the gmsh mesh(.msh) file.
"""
import shapefile
import sys
class Errors:
INVALID_MESH_FORMAT = "ERROR: The mesh file given is not in a suitable format. Please provide a mesh file generated using gmsh"
NO_ELEMENTS_IN_MESH_FILE = "ERROR: The mesh file contains no elements"
... |
"""
.. module:: layer
:platform: Windows, Linux
:synopsis: Class that contians feature service layer information.
.. moduleauthor:: Esri
"""
from .._abstract import abstract
from ..security import security
import types
from ..common import filters
from ..common.geometry import SpatialReference
from ..common.g... |
# (C) Copyright 2017 Inova Development 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 appl... |
import unittest
from ..src.prime_factors import PrimeFactors
class PrimeFactorsTest(unittest.TestCase):
def test_generate_one__should_be_empty(self):
primes = PrimeFactors.generate(1)
assert len(primes) == 0
def test_generate_two__should_be_two(self):
number = 2
self.check_p... |
import matplotlib.pyplot as plt
import numpy as np
#@pearson is the Pearson coefficient
def plotPearsonGraph(xArray,yArray,pearson,xLabel="X",yLabel="f(X)",maxx=10,minx=0,maxy=10,miny=0,title="Plotting of unknown function f"):
mini = min(minx,miny)
n = len(xArray)
if not (n == len(yArray)):
print "... |
import numpy as np
from flare.kernels.kernels import force_helper, force_energy_helper, grad_helper
from numba import njit
from flare.env import AtomicEnvironment
from typing import Callable
import flare.kernels.cutoffs as cf
from math import exp
class TwoBodyKernel:
def __init__(
self,
hyperparam... |
#!/usr/bin/env python
#
# Electrum - lightweight ParkByte client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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 withou... |
from flask import Blueprint, request, jsonify, current_app
from flask.ext.security import login_required
from flask.ext.login import current_user
from flask_wtf import Form
from flask.views import MethodView
from wtforms import TextField
from wtforms_json import MultiDict
from core.plugins.lib.views.forms import JSONMi... |
import code
import collections
import csv
import Classifier
import gzip
import numpy
import os
import pandas
import langid
import segmenter
from sklearn import metrics
from sklearn.metrics import classification_report
from Classifier import BayesClassifier
numpy.random.seed(666)
def capital_encode(username):
prev... |
#!/usr/bin/python
import unittest
import os
import random
import numpy as np
from pymatgen.core.structure import Structure
from pymatgen.core.lattice import Lattice
from pymatgen.core.surface import Slab, SlabGenerator, generate_all_slabs, \
get_symmetrically_distinct_miller_indices
from pymatgen.symmetry.group... |
# http://pyrocko.org - GPLv3
#
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
# file: setup.py
from distutils.core import setup, Extension
import sys
__VERSION__ = "1.12_1"
laius = """This small C package is comprised of an independent set of
routines dedicated to manipulating AVL tree... |
'''
Created on 13/12/2017
@author: chernomirdinmacuvele
'''
from PyQt5.Qt import QDialog, QModelIndex, QStandardItemModel, QStandardItem,\
QGroupBox
import mixedModel
import QT_tblViewUtility
import rscForm
import frmPesquisa_Sort
class GenericPesquisas(QDialog):
def configCombox(self):
'''
... |
# -*- coding: utf-8 -*-
#
# This file is part of Tamia released under the MIT license.
# See the LICENSE for more information.
from __future__ import (print_function, division, absolute_import, unicode_literals)
from datetime import datetime
import os.path
from StringIO import StringIO
import pygit2
from .errors imp... |
# © 2016 Serpent Consulting Services Pvt. Ltd. (support@serpentcs.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, models
class IrModelFields(models.Model):
_inherit = 'ir.model.fields'
@api.model
def search(self, args, offset=0, limit=0, order=None, count=False... |
__author__ = 'stanley'
import webapp2
from handlers.dashboard.dashboard import DashboardHandler
from handlers.home.home import HomeHandler
from handlers.about import AboutHandler
from handlers.home.upload import UploadHandler
from handlers.home.upload_url import UploadURLHandler
from handlers.home.education import Edu... |
"""
The :mod:`sklearn.model_selection._split` module includes classes and
functions to split the data based on a preset strategy.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>,
# Olivier Girsel <olivier.grisel@ensta.org>
# Ragha... |
from .util import logger
from . import config
from . import exceptions
import functools
import json
import time
import six
from abc import ABCMeta, abstractproperty
from requests.structures import CaseInsensitiveDict
class BaseAuth:
__metaclass__ = ABCMeta
scheme = abstractproperty()
def __init__(self... |
from charm.schemes.dabe_aw11 import Dabe
from charm.adapters.dabenc_adapt_hybrid import HybridABEncMA
from charm.toolbox.pairinggroup import PairingGroup, GT
import unittest
debug = False
class DabeTest(unittest.TestCase):
def testDabe(self):
groupObj = PairingGroup('SS512')
dabe = Dabe(groupObj)... |
from __future__ import absolute_import
from proteus import *
try:
from .risingBubble import *
from .vof_p import *
except:
from risingBubble import *
from vof_p import *
if timeDiscretization=='vbdf':
timeIntegration = VBDF
timeOrder=2
stepController = Min_dt_cfl_controller
elif timeDi... |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License... |
#!/usr/bin/env python
##############################################################################
## pyvolve: Python platform for simulating evolutionary sequences.
##
## Written by Stephanie J. Spielman (stephanie.spielman@gmail.com)
##############################################################################... |
#!/usr/bin/env python
###
# (C) Copyright (2012-2015) Hewlett Packard Enterprise Development LP
#
# 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 limita... |
#!/usr/bin/python
# *****************************************************************************
#
# Copyright (c) 2016, EPAM SYSTEMS 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
#
#... |
#!/usr/bin/env python
import psycopg2
from arbalest.configuration import env
from arbalest.redshift import S3CopyPipeline
from arbalest.redshift.schema import JsonObject, Property
"""
**Example: Bulk copy JSON objects from S3 bucket to Redshift table**
Arbalest orchestrates data loading using pipelines. Each `Pipelin... |
# -*- coding: utf-8 -*-
u"""
Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
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/lic... |
# Copyright 2019 Virgil Dupras
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
from datetime import date
from ._ccore import oven_cook_txns
class Oven:
... |
'''
setup virtual router suite environment, including start zstack node, deploy
initial database, setup vlan devices.
@author: Frank
'''
import os
import zstacklib.utils.linux as linux
import zstacklib.utils.http as http
import zstacktestagent.plugins.host as host_plugin
import zstacktestagent.testagent a... |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... |
HAMMING_MAX = 9999
def read_sequences_from_fasta_string(fasta_string):
"""reads the sequences contained in a FASTA string"""
lines = fasta_string.split('\n')
sequences = []
seqbuffer = ""
seqname = None
for line in lines:
line = line.strip()
if line.startswith('>'):
... |
"""This test checks that AxSearch is functional.
It also checks that it is usable with a separate scheduler.
"""
import numpy as np
import time
import ray
from ray import tune
from ray.tune.schedulers import AsyncHyperBandScheduler
from ray.tune.suggest.ax import AxSearch
def hartmann6(x):
alpha = np.array([1.0... |
"""
See solution026-1.py for problem explanation.
References:
http://mathworld.wolfram.com/DecimalExpansion.html
http://mathworld.wolfram.com/MultiplicativeOrder.html
Rules (from references):
1) The number of digits in the repeating portion of the decimal expansion of a rational number can also be found d... |
# coding=utf-8
# This file is part of SickRage.
#
# URL: https://SickRage.GitHub.io
# Git: https://github.com/SickRage/SickRage.git
#
# SickRage 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... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import re
import warnings
from operator import itemgetter
from tabulate import tabulate
import numpy as np
from monty.io import zopen
from monty.json import MSONable
from pymatgen import Structure, Lattice... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Quiz'
db.create_table(u'quiz_quiz', (
(u'id', self.gf('django.db.models.fields.A... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Public Library of Science
#
# 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 limitat... |
#!/usr/bin/env python3
import os
import random
import string
class VerbSystem:
def __init__(self):
self.Verbs = {}
def AddVerb(self, **kwargs):
VerbEntry = {}
for k in kwargs:
VerbEntry[k] = kwargs[k]
self.Verbs[kwargs["verb"]] = VerbEntry
def Execute(self, ... |
# Copyright (c) 2010-2011 OpenStack, 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 ... |
#!/usr/bin/env python
#
# Copyright 2012 the V8 project authors. 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
# noti... |
import json
from django.conf.urls import url
from django.db.models import Q
from django.http import HttpResponse, Http404
from tastypie import fields
from tastypie.authentication import ApiKeyAuthentication
from tastypie.authorization import ReadOnlyAuthorization
from tastypie.resources import ModelResource
from tasty... |
import boto
import boto.s3
from boto.s3.key import Key
import hashlib
import os
from os.path import expanduser
import sys
import shutil
from global_vars import *
from reporting import ErrorObject
from config import WorkerSetup
homedir = expanduser("~")
"""
Gets specified Video and Encode object, and delivers file t... |
import glob
import os.path
from pandas import DataFrame
import pandas
def get_all_paths(data_set=None, root_dir="/"):
# TODO
# if data_set ... collections.Sequence
# iterate over list
if data_set is None:
data_set = {"hcp", "henson2010faces", "ds105", "ds107"}
list_ = list()
head, tail... |
# Copyright (C) 2012-2017 Germar Reitze
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This pro... |
# Copyright (c) 2013 Don March <don@ohspite.net>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is dis... |
# This file is part of Merlin.
# Merlin is the Copyright (C)2008,2009,2010 of Robin K. Hansen, Elliot Rosemarine, Andreas Jacobsen.
# Individual portions may be copyright by individual contributors, and
# are included in this collective work with permission of the copyright
# owners.
# This program is free software; ... |
__author__ = 'Chuck Martin'
from django.views.generic.edit import CreateView
from django.views.generic import ListView
from rest_framework import generics
from rest_framework import permissions
from serializers import MessageSerializer
from models import Message
from forms import MessageForm
class CreateMessage(Cr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.