src stringlengths 721 1.04M |
|---|
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2016 Simone Donadello
#
# 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) an... |
from __future__ import division
import cython_random as random
from utility import MathUtils as mu
class BetTier(object):
"""A bet tier object that identifiers the size of a bet"""
def __init__(self, name, test_func):
self.name = name
self.test_func = test_func
def test(self, data):
... |
#!/usr/bin/python
"""This script is obsolete!"""
import pywikibot
from pywikibot import pagegenerators
from .query_store import QueryStore
from .wikidata import WikidataEntityBot
class QualifiersFixingBot(WikidataEntityBot):
blacklist = frozenset(['P143', 'P248', 'P459', 'P518', 'P577', 'P805',
... |
# Copyright (c) 2012-2013, Antonio Alonso Dominguez <alonso.domin@gmail.com>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty, AWSHelperFn, Tags
from .validators import (
boolean, integer, positive_integer, double, defer
)
CHANGE_IN_CAPACITY = 'CHANGE_IN_CAPACITY... |
from django.conf.urls import url # noqa
from biohub.core.routes import register_api
from rest_framework.routers import DefaultRouter
from biohub.forum.views import PostViewSet, ArticleViewSet,\
ExperienceViewSet, ActivityViewSet, UserExperienceViewSet
from biohub.biobrick.views import BiobrickViewSet, UserBrickVi... |
#!/usr/bin/env python
import json
import sys
import demandmodel.demandModel as demandModel
import networkmodel.networkModel as networkModel
import qoemodel.qoeModel as qoeModel
import routemodel.routeModel as routeModel
import servermodel.serverModel as serverModel
import sessionmodel.sessionModel as sessionModel
imp... |
"""
Test functions for models.tools
"""
from statsmodels.compat.python import lrange, range
import numpy as np
from numpy.random import standard_normal
from numpy.testing import (assert_equal, assert_array_equal,
assert_almost_equal, assert_string_equal, TestCase)
from nose.tools import (asse... |
#!/usr/bin/env python3
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from element_generator import GenerateFieldContent
from element_generator import GenerateElements
import unittest
class ElementGe... |
#
# Copyright (C) 2009-2019 Nexedi SA
#
# 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 distributed... |
import json
from typing import Any, Type
from dataclasses import dataclass
from overture_song.validation import Validatable
from overture_song.utils import Builder, default_value
from typing import List
from dataclasses import is_dataclass, asdict
from overture_song.utils import check_type, check_state
class Entity... |
#!/usr/bin/env python3
# _*_ coding: utf-8 _*_
import sys, random
from os import path
import yaml
from flask import (
Flask,
request,
render_template
)
from pexpect.pxssh import (
pxssh,
ExceptionPxssh
)
import log as lg
VERSION = '1.3.1'
CONF_PATH = path.join(
path.dirname(__file__),
'config.yml'
)
... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 NEC Corporation. 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.or... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 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
... |
#!/usr/bin/env python3
import sys
print("QPID support NOT enabled! Will NOT connect to any broker, and messages will be lost!")
"""
Exceptions.
"""
class ProtonException(Exception):
pass
class SessionError(Exception):
pass
class Timeout(Exception):
pass
"""
Messages.
"""
class Message(object):
def ... |
from zeit.cms.browser.widget import ConvertingRestructuredTextWidget
from zeit.cms.i18n import MessageFactory as _
import json
import zeit.cms.browser.widget
import zeit.cms.interfaces
import zeit.content.article.edit.header
import zeit.content.article.edit.interfaces
import zeit.content.modules.rawtext
import zeit.edi... |
# Copyright 2009 Lee Harr
#
# This file is part of Acromania.
#
# Acromania 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.
#
# Acroman... |
import climate
import lmj.plot
import logging
import numpy as np
import sklearn.decomposition
import theanets
climate.add_arg('--dimensions', type=int, default=10, metavar='D')
climate.add_arg('--samples', type=int, default=1000, metavar='N')
climate.add_arg('--clusters', type=int, default=20, metavar='K')
climate.add... |
from elemental_core.util import process_uuids_value
from ._resource_type import ResourceType
from ._resource_reference import ResourceReference
from ._property_changed_hook import PropertyChangedHook
class FilterType(ResourceType):
"""
Represents a collection of AttributeIds that should be filtered together.... |
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... |
# Nix
# Copyright (c) 2017 Mark Biciunas.
#
# 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 distrib... |
from django.db import connections
from django.db.models.expressions import RawSQL
from django.db.models.fields import Field
from django.db.models.query import QuerySet
from django.contrib.gis.db.models import aggregates
from django.contrib.gis.db.models.fields import (
get_srid_info, LineStringField, GeometryField... |
#!/usr/bin/env python
# Copyright 2014 David Irvine
#
# This file is part of MQTT2RRD
#
# MQTT2RRD 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 lat... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from itertools import ifilter
UNIDADES = (
'',
'UN ',
'DOS ',
'TRES ',
'CUATRO ',
'CINCO ',
'SEIS ',
'SIETE ',
'OCHO ',
'NUEVE ',
'DIEZ ',
'ONCE ',
'DOCE ',
'TRECE ',
'CATORCE ',
'QUINCE ',
'DIECISEIS ',
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from copy import deepcopy
import numpy as np
import pandas as pd
from xarray import Dataset, DataArray, auto_combine, concat, Variable
from xarray.core.pycompat import iteritems, OrderedDict
from . import Tes... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
# -*- coding: utf-8 -*-
import unittest
from pyparsing import ParseException
from tests.utils.grammar import get_record_grammar
"""
CWR Publisher Territory of Control (SPT) grammar tests.
The following cases are tested:
"""
__author__ = 'Bernardo Martínez Garrido'
__license__ = 'MIT'
__status__ = 'Development'
c... |
#
# SettingsTab
#
tab = self.notebook.settingsTab
tab.settings['Eckart flag'] = False
tab.settings['Neutral Born charges'] = False
tab.settings['Sigma value'] = 5
tab.settings['Mass definition'] = 'program'
#
# 0th Scenario tabs
#
tab = self.notebook.scenarios[0]
tab.settings['Matrix'] = 'ptfe'
tab.settings['Mass or vo... |
import sys
import warnings
import numpy as np
import pandas as pd
def parse_title(title, split_str=" "):
"""
Parse the title of GSE13100 into usable metadata. Should work with pandas apply()
Args:
title:
split_str:
Returns:
"""
split = title.split(split_str)
meta = []
... |
import os, sys, time
from glob import glob
import cv2
from pylab import *
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.backends.backend_pdf import PdfPages
matplotlib.rcParams['figure.facecolor'] = 'w'
from scipy.signal import argrelextrema
import scipy.stats as stats
import scipy.io as sio
from scipy imp... |
import logging
import re
import dkim
from django.core.mail.backends.smtp import EmailBackend
from django.db import connection
from django.utils import translation
from django.template.loader import get_template
from django_tools.middlewares import ThreadLocal
from bluebottle.clients.context import ClientContext
from... |
"""@namespace IMP.EMageFit.imp_general.representation
Utility functions to handle representation.
"""
import IMP
import IMP.atom
import IMP.core
import IMP.algebra
import string
import logging
log = logging.getLogger("representation")
#
"""
Functions to deal with the representation of assemblies and managing... |
# Copyright (C) 2010-2011 Richard Lincoln
#
# 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... |
"""frequencia URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... |
# First run a test from the command prompt, generating an HTML file.
# The output of the test is stored in a DIV.
# Also the script is automatically included in the HTML file.
# Loading the HTML file will run the script.
# This will compare the output of the script running in the browswer to the output in the DIV.
... |
import numpy as np
import os
import unittest
from alfpy import word_distance
from alfpy.utils import distmatrix
from . import utils
class TestDistMatrix(unittest.TestCase):
def setUp(self):
id_list = ['seq1', 'seq2', 'seq3']
data = np.array([[0, 0.3531587, 0.35509333],
... |
from django.test import TestCase
from .models import Kindergarten, KindergartenType, City
CityData = {
'name': 'City name'
}
KindergartenTypeData = {
'name': 'Kindergarten type name'
}
KindergartenData = {
'name': 'Test Kindergarten Name',
'address': 'Test Kindergarten Address'
}
class ModelTests... |
#!/usr/bin/env python
#
#
# FreeType 2 glyph name builder
#
# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By co... |
"""
nodsl.py
Attempt to express the language of choice without
overloading operators.
I understand why the article did it, and I'm impressed
that it works so well, but it's hard to follow what's
happening. Too much magic for me.
I think partly it's because the article conflates variables
and choices. A variable's ... |
# mysql/oursql.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mysql+oursql
:name: OurSQL
:dbapi: oursql
:connectstring... |
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import fetch_olivetti_faces
from sklearn.utils.validation import check_random_state
from linear_regression import *
from knn import *
def main():
# Load the faces datasets
data = fetch_olivetti_faces()
targets = data.target
da... |
# SQLiteToPDFWithNamedTuples.py
# Author: Vasudev Ram - http://www.dancingbison.com
# SQLiteToPDFWithNamedTuples.py is a program to demonstrate how to read
# SQLite database data and convert it to PDF. It uses the Python
# data structure called namedtuple from the collections module of
# the Python standard library.
... |
# build_assistant/codegen/declarations/ClassBlockSection.py
#
# (C) Copyright 2014-present Cristian Dinu <goc9000@gmail.com>
#
# This file is part of Uniarchive II.
#
# Licensed under the GPL-3
from build_assistant.codegen.abstract.GeneralizedBlockSection import GeneralizedBlockSection
from build_assistant.codegen.de... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 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
#
# ... |
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import mock
import hid_constants
import hid_descriptors
import hid_gadget
import usb_constants
report_desc = hid_de... |
from pulsar.api import Http404
from pulsar.utils.log import LocalMixin, local_method
from .utils import handle_wsgi_error
class WsgiHandler:
'''An handler for applications conforming to python WSGI_.
.. attribute:: middleware
List of :ref:`asynchronous WSGI middleware <wsgi-middleware>` callables
... |
import numpy as np
import os
import warnings
import collections
import astropy.io.fits as fits
from threeML.plugins.spectrum.binned_spectrum import BinnedSpectrumWithDispersion, Quality
from threeML.plugins.spectrum.binned_spectrum_set import BinnedSpectrumSet
from threeML.plugins.OGIP.pha import PHAII
from threeML.p... |
# -*- coding: iso-8859-1 -*-
#Copyright (C) Fiz Vazquez vud1@sindominio.net
# Modified by dgranda
#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 opt... |
"""
Adapted from LA Times datadesk credit to Ben Welsh.
http://datadesk.latimes.com/posts/2012/06/test-your-django-app-with-travisci/
"""
import os
import sys
import django
from django.conf import settings
class QuickDjangoTest(object):
"""
A quick way to run the Django test suite without a f... |
class AttrDisplay(object):
"""Provides an inheritable display overload method that shows instances
with their class names and a name=value pair for each attribute stored
on the instance itself (but not attrs inherited from its classes). Can
be any into any class, and will work on any instance."... |
import os
import errno
import unittest
import shutil
import numpy
import tempfile
import socket
#imports from fixture:
from logger import logger
from lofarpipe.support.lofarexceptions import PipelineException
from lofarpipe.support.utilities import create_directory #@UnresolvedImport
from lofa... |
"""This module implements config."""
import os
import sys
import logging
from collections import Mapping
import yaml
from swak.exception import ConfigError
from swak.util import parse_and_validate_cmds, validate_tag
ENVVAR = 'SWAK_HOME'
CFG_FNAME = 'config.yml'
MAIN_LOG_CFG = '''
logger:
version: 1
formatt... |
# Copyright 2008 (C) Nicira, Inc.
#
# This file is part of NOX.
#
# NOX 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.
#
# NOX is d... |
# pylint: disable=missing-docstring
import os
from asgiref.sync import async_to_sync
from guardian.shortcuts import assign_perm
from resolwe.flow.managers import manager
from resolwe.flow.managers.utils import disable_auto_calls
from resolwe.flow.models import (
Collection,
Data,
DataDependency,
Desc... |
from typing import Any
import pandas as pd
import pandas.util.testing as tm
import pytest
from multipledispatch.conflict import ambiguities
import ibis
import ibis.common.exceptions as com
import ibis.expr.datatypes as dt
import ibis.expr.operations as ops
from ibis.pandas.client import PandasClient
from ibis.pandas.... |
# -*- coding: utf-8 -*-
# PEP8:NO, LINT:OK, PY3:OK
#############################################################################
## This file may be used under the terms of the GNU General Public
## License version 2.0 or 3.0 as published by the Free Software Foundation
## and appearing in the file LICENSE.GPL includ... |
import json
from flask import Blueprint, request, url_for
from apikit import jsonify, get_limit, get_offset
from werkzeug.exceptions import BadRequest
from nomenklatura.model import Dataset, Entity
from nomenklatura.model.matching import find_matches
section = Blueprint('reconcile', __name__)
def reconcile_index(... |
import random
import numpy as np
def rsrcBin(L):
r = []
for k in range(L):
r.append(random.randint(0,1))
return r
def rsrc(L):
r = rsrcBin(L)
x = [1-2*x for x in r]
return x
def fftOnce(x):
W = len(x)
hw = np.hamming(W)
ss = np.fft.fft(x*hw)
return np.conj(ss)*ss
def spectrum(x):
... |
# Copyright 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 agreed to in... |
# -*- coding: utf-8 -*-
"""Groupings needed on an energy system for it to work with solph.
If you want to use solph on an energy system, you need to create it with these
groupings specified like this:
.. code-block: python
from oemof.network import EnergySystem
import solph
energy_system = EnergySy... |
from collections import OrderedDict
from django.db.models import Q
from django.forms import CheckboxSelectMultiple
from django.utils.translation import pgettext_lazy
from django_filters import MultipleChoiceFilter, OrderingFilter, RangeFilter
from ..core.filters import SortedFilterSet
from .models import Attribute, P... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
try:
from __builtin__ import bytes, str, open, super, range, zip, round, int, pow, object, input
except ImportError: pass
try:
from __builtin__ import raw_input as input
except: pass
from c... |
# Copyright 2015 Google 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 or a... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2010 TUBITAK/UEKAE
#
# 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.
#
# ... |
import os
import re
import sys
from setuptools import Extension
from setuptools import setup
if sys.platform == 'win32':
versions = [
var for var in os.environ
if var.startswith('VS') and var.endswith('COMNTOOLS')
]
vs = sorted(versions, key=lambda s: int(re.search(r'\d+', s).group()))[-1]... |
"""Problem 49
01 August 2003
The arithmetic sequence, 1487, 4817, 8147, in which each of the terms
increases by 3330, is unusual in two ways: (i) each of the three terms
are prime, and, (ii) each of the 4-digit numbers are permutations of
one another.
There are no arithmetic sequences made up of three 1-, 2-, or 3-di... |
# -*- 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 'Slideshow'
db.create_table('cmsplugin_slideshow', (
('cmsplugin_ptr', self.gf('d... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# This file is part of solus-sc
#
# Copyright © 2017-2018 Ikey Doherty <ikey@solus-project.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Founda... |
import sys
sys.path.append('/opt/rh/python27/root/usr/lib64/python2.7/site-packages/pysam')
sys.path.append('/home/ptedder/local/lib/python2.7/site-packages')
sys.path.append('/home/ptedder/local/lib64/python2.7/site-packages')
print sys.path
import random,pysam,re,subprocess,HTSeq,pdb,argparse
from collections import ... |
#! /usr/bin/env python
'''
Testsuite for the UniformPDF class
'''
from __future__ import absolute_import, division, print_function
import numpy as np
from puq import *
import scipy.stats as stats
def _hisplot(y, nbins):
n, bins = np.histogram(y, nbins, normed=True)
mids = bins[:-1] + np.diff(bins) / 2.0
... |
#!/usr/bin/env python
# Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 ... |
import numpy as np
import pylab as pl
import matplotlib.pyplot as plt
import cvxopt as co
from svdd import SVDD
from kernel import Kernel
if __name__ == '__main__':
# kernel parameter and type
kparam = 0.1
ktype = 'rbf'
# generate raw training data
Dtrain = co.normal(2,100)
# build kernel
kernel = Kernel.get_... |
# Curved Ball - a game for the Pi Glow board
# By Mike Cook - March 2015
import time, random, sys
from smbus import SMBus
import wiringpi2 as io
# command register addresses for the SN3218 IC used in PiGlow
CMD_ENABLE_OUTPUT = 0x00
CMD_ENABLE_LEDS = 0x13
CMD_SET_PWM_VALUES = 0x01
CMD_UPDATE = 0x16
SN3218 = 0x54 # i2c ... |
from tkinter.filedialog import *
import lan_ip
import tkinter as tk
from tkinter import ttk
from fileTransfer import *
from receiver import *
import _thread
from custom_function import *
from tkinter import messagebox
class RecvPage(tk.Frame):
def __init__(self, parent, root):
super().... |
#!/usr/bin/env python3
from build import ninja_common
build = ninja_common.Build("visualizer")
# Only build if all dependencies are present.
# TODO Create a better means of dependency checking.
import os
sources = ['gl_utils.cpp',
'graphics_engine.cpp',
'material.cpp',
'obj_build... |
import math
import logging
import StringIO
import sys
import cairo
import numpy as np
from osgeo.osr import SpatialReference
from PIL import Image
import httplib2
from foldbeam.rendering.renderer.base import RendererBase, set_geo_transform
from foldbeam.rendering.renderer.decorator import reproject_from_native_spatia... |
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
from __future__ import print_function
import __builtin__, sys, contextlib, StringIO
from md import fluid
__all__ = (
'display', 'read', 'current_input_port', 'current_output_port',
'output_to_string', 'input_from_string',
'output_to_file', 'input_from_file'
)
## Default to None. This let's the cells play... |
# -*-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... |
#-*- coding:utf-8 -*-
"""
This file is part of OpenSesame.
OpenSesame 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.
OpenSesame is distri... |
import pytest
from itertools import tee, izip
from testutils import get_co, get_bytecode
from equip import BytecodeObject
from equip.bytecode.utils import show_bytecode
import equip.utils.log as logutils
from equip.utils.log import logger
logutils.enableLogger(to_file='./equip.log')
from equip.analysis import Control... |
from flask import session, redirect, request, render_template
from app import app
from app.models import *
def getUserFromDb(username,password):
userQuery = Users.query.filter_by(username=username)
if userQuery.count()==0:
return "No such user"
else:
usr = userQuery.first()
if us... |
#!/usr/bin/python
from setuptools import setup, find_packages
import pandarss
install_requires = [
'Twisted>=15.0.0',
'bottle>=0.12.7'
]
package_data={
'pandarss': [
'views/css/*',
'views/js/*',
'views/*'
]
}
setup(name='pandarss',
version='0.1',
author='pandaman',... |
# flake8: noqa
import logging
from django.conf import settings
from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from ava_core.integration.integration_abstract.utils import retrieve_credential_from_database
log = logging.getLogger(__name__)
clas... |
# coding=utf-8
# UrbanFootprint v1.5
# Copyright (C) 2017 Calthorpe Analytics
#
# This file is part of UrbanFootprint version 1.5
#
# UrbanFootprint is distributed under the terms of the GNU General
# Public License version 3, as published by the Free Software Foundation. This
# code is distributed WITHOUT ANY WARRANT... |
# Copyright (C) 2010-2013 Claudio Guarnieri.
# Copyright (C) 2014-2016 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import os
import getpass
import logging
import subprocess
from lib.cuckoo.common.abstracts import Auxilia... |
#!/usr/bin/env python
desc="""Report histogram for given insert size data
"""
epilog="""Author:
l.p.pryszcz+git@gmail.com
Barcelona, 18/10/2012
"""
import argparse, os, sys
from datetime import datetime
def plot( isizes,outfn ):
"""
"""
import matplotlib.pyplot as plt
# the histogram of the data
... |
import subprocess
import os
from spotdl.encode import EncoderBase
from spotdl.encode.exceptions import EncoderNotFoundError
from spotdl.encode.exceptions import FFmpegNotFoundError
import logging
logger = logging.getLogger(__name__)
# Key: from format
# Subkey: to format
RULES = {
"m4a": {
"mp3": "-code... |
# -*- coding: utf-8 -*-
"""
Handle PARI documentation
"""
from __future__ import unicode_literals
import re
import subprocess
leading_ws = re.compile("^( +)", re.MULTILINE)
trailing_ws = re.compile("( +)$", re.MULTILINE)
double_space = re.compile(" +")
end_space = re.compile(r"(@\[end[a-z]*\])([A-Za-z])")
end_pare... |
"""
UCSC Interface via SQLalchemy
=============================
"""
import os
import re
from sqlalchemy import sql
from sqlalchemy import orm
import sqlalchemy as sa
import logging; log = logging.getLogger(__name__)
import config
import model
Session = orm.sessionmaker()
session = Session()
initialized = False
meta... |
"""
A parallel version of XOR using neat.parallel.
Since XOR is a simple experiment, a parallel version probably won't run any
faster than the single-process version, due to the overhead of
inter-process communication.
If your evaluation function is what's taking up most of your processing time
(and you should check ... |
# Copyright 2015 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
#For decoded t.wnry file from sample: ed01ebfbc9eb5bbea545af4d01bf5f1071661840480439c6e5babe8e080e41aa
from Crypto.Cipher import PKCS1_v1_5
from Crypto.PublicKey import RSA
from Crypto.Cipher import AES
from Crypto import Random
from Crypto.Hash import SHA
import sys
import struct
import binascii
import hashlib
def d... |
import sys
sys.path.append("../src/")
import os,json
from datetime import datetime
from model import db, VCluster, Container, PortMapping, Image, BillingHistory
timeFormat = "%Y-%m-%d %H:%M:%S"
dockletPath = "/opt/docklet/global"
usersdir = dockletPath + "/users/"
try:
VCluster.query.all()
except Exception as err... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
import asyncio
import logging
import discord
from .gatherbot import GatherBot
from .organiser import Organiser
from . import commands
logger = logging.getLogger(__name__)
class DiscordGather:
def __init__(self, token):
self.token = token
self.bot = None
self.client = discord.Client()
... |
#!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' \
'2010, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
from functools import partial
from calibre.gui2.dialogs.confirm_delete_location_ui import Ui_Dialog
from PyQt5.Q... |
#!/usr/bin/env python3
# Copyright (c) 2016 The crimson Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import crimsonTestFramework
from test_framework.util import (
start_nod... |
# -*- coding: utf-8 -*-
# <Bunch - BDD test tool for Lettuce scenarios>
# Copyright (c) 2012 Grid Dynamics Consulting Services, Inc, All Rights Reserved
# http://www.griddynamics.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... |
"""This defines the Messenger class, which is responsible for most of the
event handling that happens on the Python side."""
__all__ = ['Messenger']
from .PythonUtil import *
from direct.directnotify import DirectNotifyGlobal
import types
from direct.stdpy.threading import Lock
class Messenger:
notify = Direc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.