src stringlengths 721 1.04M |
|---|
import logging
from flask import Blueprint, request
from pantomime.types import XLSX
from aleph.search import XrefQuery
from aleph.logic.profiles import pairwise_judgements
from aleph.logic.export import create_export
from aleph.views.serializers import XrefSerializer
from aleph.queues import queue_task, OP_XREF, OP_E... |
# Copyright (C) 2019 Christopher Gearhart
# chris@bblanimation.com
# http://bblanimation.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 Foundation, either version 3 of the License, or
# (at your opt... |
# 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
# d... |
"""
prohotspot
~~~~~~~~~~
Implements the "prospective hotspotting" technique from:
1. Bowers, Johnson, Pease,
"Prospective hot-spotting: The future of crime mapping?",
Brit. J. Criminol. (2004) 44 641--658. doi:10.1093/bjc/azh036
2. Johnson et al.,
"Prospective crime mapping in operational context",
Home... |
#!/usr/bin/env python
#
# This is free and unencumbered software released into the public domain.
#
# Sometimes you want to include one sidenote document into another.
# One way you could do that is copy the .md files from one project into another.
# However, this creates a risk of link-tag collisions. I.e. one project... |
# 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... |
class check_privilege_super():
"""
check_privilege_super:
The following accounts have the SUPER privilege. Do not grant to non Admin users.
"""
# References:
# https://benchmarks.cisecurity.org/downloads/show-single/index.cfm?file=mysql.102
TITLE = 'SUPER Privilege'
CATEGORY = 'Privi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Descriptors for energy profile line classes.
"""
import numpy as np
from catplot.chem_parser import RxnEquation
class DescriptorBase(object):
""" Abstract base class for other descriptor class.
"""
def __init__(self, name):
self.name = name
... |
from functools import partial
from neupy import algorithms, layers
from helpers import simple_classification, compare_networks
from base import BaseTestCase
class OptimizersTestCase(BaseTestCase):
def setUp(self):
super(OptimizersTestCase, self).setUp()
self.network = layers.join(
la... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
Parameters.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
****************************... |
from django.conf import settings
from django.http import HttpResponse
from django_tus import tus_api_version, tus_api_version_supported, tus_api_extensions
class TusResponse(HttpResponse):
_base_tus_headers = {
'Tus-Resumable': tus_api_version,
'Tus-Version': ",".join(tus_api_version_supported),
... |
"""
File : pfamParser.py
Author : Javier Garcia
Creation : 19 December 2007
Contents : fills up tables in database biana with information from PFAM
Called from :
=======================================================================================================
"""
## STEP 1: IMPORT NECESSARY ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-17 13:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('edu', '0007_auto_20170217_1434'),
('ege', '0005_auto_20170129_0117'),
]
ope... |
from django.shortcuts import render
from django.contrib.auth.models import User, Group
from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticated
from django.contrib.auth.decorators import login_required
from quickstart.serializers import UserSerializer, GroupSerializer
from django.htt... |
# This file comprises the tests that are internally validated (as
# opposed to tests which produce output files that are externally
# validated). Primarily they are unittests.
# There is a read/write asymmetry: It is fairly easy to
# internally validate the results of reading a PNG file because we
# can know what pix... |
#!/usr/bin/env python
#
# Copyright 2016 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 requir... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
Laudio - A webbased musicplayer
Copyright (C) 2010 Bernhard Posselt, bernhard.posselt@gmx.at
Laudio 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 ... |
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.CaptchaService import CaptchaService
from module.plugins.internal.Plugin import Fail
class SolveMedia(CaptchaService):
__name__ = "SolveMedia"
__type__ = "captcha"
__version__ = "0.19"
__status__ = "testing"
__description__ = """Sol... |
'''
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 use this ... |
# -*- coding: utf-8 -*-
import scipy.odr
from numpy import *
from PySide2.QtCore import QObject, Signal
class Fit(QObject):
finished = Signal()
def __init__(self, maxit=1000):
QObject.__init__(self)
self.maxit = maxit
self.ready = False
self.x, self.xerr = [], []
se... |
# 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 ... |
# kpbochenek@gmail.com
def non_unique(data):
result = []
diff = 32
for d in data:
if data.count(d) > 1:
result.append(d)
elif type(d) is str and data.count(d) + data.count(chr(ord(d) + diff)) > 1:
result.append(d)
elif type(d) is str and data.count(d) + data.... |
from django.contrib import admin
# Register your models here.
from .models import Article, Person
'''
Class used to show other related fields in Article
'''
class ArticleAdmin(admin.ModelAdmin):
list_display = ('title', 'pub_date', 'mod_date', )
'''
used to split forms into several sets
'''
field... |
from common import TestID, log_surl_call_result
from eu.emi.security.authn.x509.impl import PEMCredential
from exceptions import Exception
from jarray import array
from java.io import FileInputStream
from javax.net.ssl import X509ExtendedKeyManager
from net.grinder.plugin.http import HTTPRequest
from net.grinder.script... |
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2009 Douglas S. Blank <doug.blank@gmail.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 Foundation; either version 2 of the L... |
# coding: utf-8
"""
Cloudbreak API
Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloud... |
"""The data structures for this are based on adjaceny list or a graph data structure so that
iterative computing is possible.
Refer: Valiente, Gabriel. Algorithms on trees and graphs. Springer Science & Business Media, 2013. for
further algorithms.
The tree datastructure also looks like "phylo" class in ape package of... |
#!/usr/bin/env python
import io
import os
import sys
import tempfile
try:
# Python 3.4+
from pathlib import Path
except ImportError:
Path = None
from fitparse.utils import fileish_open, is_iterable
if sys.version_info >= (2, 7):
import unittest
else:
import unittest2 as unittest
def testfile(f... |
#!/usr/bin/env python3
# pysc
# Kashev Dalmia | @kashev | kashev.dalmia@gmail.com
# anagram_dict_builder.py
""" A script which builds an anagram dictionary from a dictionary. """
# Credit: Jeff Knupp
# https://github.com/jeffknupp/presser/blob/master/make_anagrams.py
import collections
import os
import string
def b... |
import matplotlib.pyplot as plt
with open("test_pen", "r") as f:
data = f.read()
data = data.split("\n")[:-1]
data = [data[i].split(" ") for i in range(0, len(data))]
pen = [float(data[i][0]) for i in range(len(data))]
u = [float(data[i][1]) for i in range(len(data))]
d = [float(data[i][2]) for i in range(len(data... |
# ch04_notes.py
# Chapter 4 notes taken from Automate the Boring Stuff with Python (2015).pdf
# Created by Davidzz on 7/20/2016
# List data type
primes = [2, 3, 5, 7, 11, 13, 17]
print(primes[0]) # 2
# For negative index number, start counting from the right
print(primes[-1]) # 17
print(primes[0:5]) # [2, 3, 5, 7, 11]... |
from collections import namedtuple
def _paren(f):
if not isinstance(f, (Atom, Predicate, Universal, Existential)):
return '({})'.format(f)
else:
return str(f)
class Formula:
def __rshift__(self, other):
return Implication(self, other)
def __or__(self, other):
return D... |
"""
Various small and named graphs, together with some compact generators.
"""
__author__ ="""Aric Hagberg (hagberg@lanl.gov)\nPieter Swart (swart@lanl.gov)"""
# Copyright (C) 2004-2008 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights ... |
#!/usr/bin/env python
# Copyright 2012 Cisco Systems, 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... |
# -*- coding: utf-8 -*-
"""
tests.wrappers
~~~~~~~~~~~~~~
Tests for the response and request objects.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import pytest
import pickle
from io import BytesIO
from datetime import datetime
from werkzeug.... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import cms.models.fields
import djangocms_text_ckeditor.fields
class Migration(migrations.Migration):
dependencies = [
('cms', '0013_urlconfrevision'),
('cont... |
import shelve
class InvalidationError(Exception):
pass
class ShelfProxy(Proxy):
__slots__ = ["_key", "_shelf", "_invalidated"]
def __init__(self, obj, shelf, key):
Proxy.__init__(self, obj)
object.__setattr__(self, "_shelf", shelf)
object.__setattr__(self, "_key", key)
... |
from __future__ import unicode_literals
from django.db import models
import datetime
from django_extensions.db import fields
from django.utils import timezone
from taggit.managers import TaggableManager
class Article(models.Model):
CATEGORIES = (
('List','List'),
('Blog','Blog'),
('Countd... |
# -*- coding: utf-8 -*-
# execution.py
from abc import ABCMeta, abstractmethod
import datetime
import queue
from Backtest_Futures.event import FillEvent, OrderEvent
class ExecutionHandler(object):
"""
The ExecutionHandler abstract class handles the interaction
between a set of order objects generated b... |
from unittest.mock import MagicMock, call
import flask
import pytest
from randovania.network_common.error import NotLoggedIn, ServerError, InvalidSession
from randovania.server import database
from randovania.server.server_app import ServerApp
@pytest.fixture(name="server_app")
def server_app_fixture(flask_app, ski... |
import json
import re
import urlparse
import requests
from BeautifulSoup import BeautifulSoup
from nanscrapers.common import random_agent, replaceHTMLCodes
from ..scraper import Scraper
import xbmc
class Sezonluldizi(Scraper):
domains = ['sezonlukdizi.com']
name = "sezonlukdizi"
def __init__(self):
... |
# Copyright 2016 Yuji Azama
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
# -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2016 Chris Lamb <lamby@debian.org>
#
# diffoscope 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,... |
# Annotator needs to find the least generic type for everything.
# To do that, it needs to hold a model of our types.
class Annotator(object):
def __init__(self, unit):
self.unit = unit
self.stack = []
def update(self, func):
for block in func:
for op in block.ops:
... |
import os, sys
from decimal import Decimal
import gzip
from collections import OrderedDict
import logging
def blast_result_iterator(blast_file):
_ = blast_file.readline() # burn header
for line in blast_file:
if not line.startswith("#"):
yield BlastHit(line)
class BlastHit(object):
""... |
# -*- coding: utf8 -*-
## Copyright (c) 2013 Stefan Thesing
##
##This file is part of Podstatty.
##
##Podstatty 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 op... |
# 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... |
import os
import pytz
from datetime import tzinfo, timedelta, datetime
from django.conf import settings
from django.core.validators import MinValueValidator
from django.db import models
from django.db.models import F, Count, ExpressionWrapper, DateField, DateTimeField
from django.db.models.signals import pre_delete, 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 in writing, software
# d... |
import pytest
import yaml
from conda_devenv.devenv import handle_includes, render_jinja
def obtain_yaml_dicts(root_yaml_filename):
contents = open(root_yaml_filename, "r").read()
contents = render_jinja(contents, filename=root_yaml_filename, is_included=False)
root_yaml = yaml.safe_load(contents)
di... |
__author__ = 'olga'
import unittest
from gscripts.rnaseq.sailfish_index import SailfishIndex
import tests
import os
import shutil
import sys
class Test(unittest.TestCase):
out_dir = 'test_output'
def setUp(self):
os.mkdir(self.out_dir)
def tearDown(self):
shutil.rmtree(self.out_dir)
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from ..person import Provider as PersonProvider
class Provider(PersonProvider):
formats = (
'{{first_name}} {{last_name}}',
'{{first_name}} {{last_name}}',
'{{last_name}}, {{first_name}}'
)
first_names = (
'Ā... |
import CirclePlotClass as cpc
class GetMotifs():
def DefineColLists(self):
self.colList = []
r = 0
while r < self.total_length:
self.colList.append(-1)
r += 1
self.sse = self.cpss.GetSSE()
self.secLinks = self.cpss.GetSecLinks()
for s in self.... |
import discord
import feedparser
from discord.ext import commands
from .utils.dataIO import fileIO
from .utils import checks
from __main__ import send_cmd_help
from urllib import parse
import os
import asyncio
import logging
try: # check if feedparser exists
import feedparser
except ImportError:
feedparser ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2016 Eugene Frolov <eugene@frolov.net.ru>
#
# 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
#
# ... |
#!/usr/bin/env python3
"""Setup script for shaarli-client"""
import codecs
import os
import re
from setuptools import find_packages, setup
def get_long_description():
"""Reads the main README.rst to get the program's long description"""
with codecs.open('README.rst', 'r', 'utf-8') as f_readme:
return... |
"""
Get API information encoded in C files.
See ``find_function`` for how functions should be formatted, and
``read_order`` for how the order of the functions should be
specified.
"""
import sys, os, re
try:
import hashlib
md5new = hashlib.md5
except ImportError:
import md5
md5new = md5.new
if sys.vers... |
# -*- 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... |
import numpy as np
# matplotlib don't use Xwindows backend (must be before pyplot import)
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
def analyse_ekf(estimator_status, ekf2_innovations, sensor_preflight, check_levels,
pl... |
from __future__ import unicode_literals
import unittest
from recontool.subset_sums import SubsetSums
class TestSubsetSums(unittest.TestCase):
def test_subset_sums(self):
seq = [1, 2, 3, 4, 5]
subset_sums = SubsetSums.create(seq)
expected_range_sums = [
((0, 5), 15),
... |
from io import StringIO
from tests.util.asserts import assert_that, assert_fails, equals
from tests.util.test import test
from pycell.env import Env
from pycell.eval_ import eval_list
from pycell.lexer import lex
from pycell.parser import parse
import pycell.library
# --- Utils
def evald(inp, stdout=None):
e... |
"""Primitives to manage and construct pipelines for
compression/encryption.
"""
from gevent import sleep
from wal_e import pipebuf
from wal_e.exception import UserCritical
from wal_e.piper import popen_sp, PIPE
PV_BIN = 'pv'
GPG_BIN = 'gpg'
LZOP_BIN = 'lzop'
CAT_BIN = 'cat'
def get_upload_pipeline(in_fd, out_fd, r... |
"""
Test database migrations.
for each version one an empty and a populated db must be stored in directories:
- db/empty
- db/populated
"""
import os
import shutil
import unittest as pyunit
from twisted.trial import unittest
from twisted.internet.defer import inlineCallbacks
from storm.locals import create_databas... |
"""Module to calculate best path between multiple points, using genetic algorithm
Functions:
new_path -- path altering function that creates a new path
distance -- cost function that calculates distance as the cost of a path
select_best -- function that selects the best paths in a population
recombine -- path altering... |
chinese_spicy_list = {
'jalapeno' : ['curry paste', 'chili sauce', 'curry paste'],
'wasabi': ['curry paste', 'chili sauce', 'curry paste'],
'tobasco': ['curry paste', 'chili sauce', 'curry paste'],
'hot sauce': ['curry paste', 'chili sauce', 'curry paste'],
'habanero pepper' : ['curry paste', 'chili... |
from operator import itemgetter
import sys
from flask import Flask
from flask import abort
from flask import render_template
from flask import send_from_directory
from flask import request
from wds.igor.security import secure
from wds.igor import igor
from wds.logging import log_writer
from wds.igor.job import JobBuild... |
from PyQt4.QtGui import *
from electrum_boli.plugins import BasePlugin, hook
from electrum_boli.i18n import _
import datetime
from electrum_boli.util import format_satoshis
from electrum_boli.bitcoin import COIN
try:
import matplotlib.pyplot as plt
import matplotlib.dates as md
from matplotlib.patches i... |
import math
import time
t1 = time.time()
N = 10000000
prime = []
def primeSieve(n):
global prime
n = (n+1)//2
p = [True]*(n)
i = 1
prime.append(2)
while i < n:
if p[i]:
t = 2*i+1
prime.append(t)
p[i] = False
j = 2*i*i+2*i
wh... |
import datetime
from pkg_resources import parse_version
from extrapypi.extensions import db
package_maintainers = db.Table(
'package_maintainers',
db.Column('package_id', db.Integer, db.ForeignKey('package.id', name='_fk_package_maintainers_package')),
db.Column('user_id', db.Integer, db.ForeignKey('user... |
##
##
## Apache License
## Version 2.0, January 2004
## http://www.apache.org/licenses/
##
## TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
##
## 1. Definitions.
##
## "License" shall mean the terms and conditions for use, reproduction,
## and distribution as defined by Sections 1 through 9 of this docum... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 00. 文字列の逆順
# 文字列 "stressed" の文字を逆に(末尾から先頭に向かって)並べた文字列を得よ.
text = "stressed"
answer = "desserts"
# Case 1
##########
case1 = text[::-1] # str[start:end:step] : start から end まで step 毎の文字列を取得
# text[1:7:2] => "tes" (1 から 7 まで 2 文字毎)
... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 8 19:14:33 2017
@author: sbhal
"""
import numpy as np
import pandas as pd
import random
import tensorflow as tf
class qlearningTF:
def __init__(self, m_criteria, initialWeights=None):
if initialWeights == None:
self.weight... |
# coding=utf-8
from __future__ import division
import numpy as np
def SNR_IEC(i1, i2, ibg=0, allow_color_images=False):
'''
Calculate the averaged signal-to-noise ratio SNR50
as defined by IEC NP 60904-13
needs 2 reference EL images and one background image
'''
# ensure images a... |
import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-easy-timezones',
version='0.2.0',
packages=['easy_t... |
# Display a list of *.dat files in a bar chart.
# Based on an example from https://chrisalbon.com/python/matplotlib_grouped_bar_plot.html
import sys
import os
import matplotlib.pyplot as plt
import numpy as np
if len(sys.argv) > 3 and (len(sys.argv)-3) % 2 :
print("usage: python3 {0} <benchmark> <image path> (<da... |
import sys
import os
dir = "/".join(sys.argv[0].split("/")[:-2])
if dir != "":
os.chdir(dir)
sys.path.append(".")
import argparse
from load_data import load_data_bis
from train_MINST import train_model
from logger import custom_logger
def run(**kwargs):
data = load_data_bis()
acc, _ = train_model(data, *... |
#!/usr/bin/env python
import argparse
import os
from phocnet.caffe.model_proto_generator import ModelProtoGenerator
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Save a PHOCNet deploy proto file to disk.')
parser.add_argument('--output_dir', '-od', action='store', type=str, default='... |
#!/usr/bin/env python
import pandas as pd
def df2mat(data, return_labels=False):
"""
Transforms a Pandas DataFrame into a Numpy array with binarized text columns
This function transforms single-level df to an array so it can be plotted
with HyperTools. Additionally, it uses the Pandas.Dataframe.get... |
import movies # my file with the class definition
import fresh_tomatoes # renders site
pi_movie = movies.Movie('Pi',
'https://www.youtube.com/watch?v=jo18VIoR2xU',
'a mathematician makes an incredible discovery',
'http://images.moviepostershop.c... |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
from itertools import chain
import pytest
from ..util.testing import requires
from ..util.parsing import parsing_library
from ..units import default_units, units_library, allclose
from ..chemistry import Substance, Reaction
fr... |
#!/usr/bin/python2
# encoding: utf-8
"""
replicape.py
Machinekit HAL for Replicape Rev B3
Copyright (c) 2016 Sam Wong
Adaptation to Debian Stretch and kernel 4.14.x, extensions as in README.md:
Copyright (c) Karl Jacobs
Permission is hereby granted, free of charge, to any person obtaining a copy of this software a... |
# thesquirrel.org
#
# Copyright (C) 2015 Flying Squirrel Community Space
#
# thesquirrel.org is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any la... |
# trex image from Wyverii on http://opengameart.org/content/unsealed-terrex
import sys
import os
sys.path.append(os.path.abspath('..'))
import pygame
from pygame.locals import *
import pyganim
pygame.init()
# set up the window
windowSurface = pygame.display.set_mode((320, 240), 0, 32)
pygame.display.set_caption('Spr... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (t... |
#
# PVLIB_Python documentation build configuration file, created by
# sphinx-quickstart on Fri Nov 7 15:56:33 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration va... |
"""The tests for sensor recorder platform."""
# pylint: disable=protected-access,invalid-name
from datetime import timedelta
from unittest.mock import patch, sentinel
from homeassistant.components.recorder import history
from homeassistant.components.recorder.const import DATA_INSTANCE
from homeassistant.components.re... |
# -*- coding: utf-8 -*-
import logging
import os
import zipfile
from collections import defaultdict
from django.contrib.gis.gdal import DataSource
from .utils import download
from ..models import Region
logger = logging.getLogger(__name__)
LEVELS = [r[1] for r in Region.REGION_LEVELS]
LOCAL_DICT = {
'Catalu\x... |
# -*- coding: utf-8 -*-
from base64 import b64decode
from hashlib import md5
from ...kodion.json_store import APIKeyStore, LoginTokenStore
from ...kodion import Context as __Context
from ... import key_sets
DEFAULT_SWITCH = 1
__context = __Context(plugin_id='plugin.video.youtube')
__settings = __context.get_settings... |
#!/usr/bin/env python
import yaml
import argparse
import os
__author__ = "Anoop P Alias"
__copyright__ = "Copyright 2014, PiServe Technologies Pvt Ltd , India"
__license__ = "GPL"
__email__ = "anoop.alias@piserve.com"
installation_path = "/opt/nDeploy" # Absolute Installation Path
cluster_config_file = installat... |
"""
Quickly expose your models to a JSON or XML API, authenticated via HTTP or
OAuth.
"""
__version__ = '2.0.1'
from bambu_api.options import *
from bambu_api.sites import APISite
from bambu_api.exceptions import APIException
from bambu_api.decorators import argument, returns, named
from django.conf import settings
f... |
# 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
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2005-2008 Francisco José Rodríguez Bogado, #
# Diego Muñoz Escalante. #
# (pacoqueen@users.sourceforge.ne... |
from api.decorators import api_view, request_data
from api.permissions import IsAdmin, IsSuperAdminOrReadOnly
from api.dc.template.api_views import DcTemplateView
__all__ = ('dc_template_list', 'dc_template')
@api_view(('GET',))
@request_data(permissions=(IsAdmin, IsSuperAdminOrReadOnly))
def dc_template_list(reque... |
__author__ = 'reggie'
###START-CONF
##{
##"object_name": "filterhasa",
##"object_poi": "qpwo-2345",
##"parameters": [
## {
## "name": "tweet",
## "description": "english tweets",
## "required": true,
## "type": "TweetS... |
# Call download scripts
#from download import *
import download.SG_disease
import download.SG_weather
import download.MY_dengue
import download.BN_disease
import download.TH_disease
import download.ID_malaria
import download.wunderground
import download.apps_who_int
import os
import sys
import logging
import logging.c... |
import pytest
from starstoloves.lib.track.lastfm_track import LastfmTrack
from ..result import LastfmResultParser
pytestmark = pytest.mark.django_db
@pytest.fixture()
def result_parser(request):
return LastfmResultParser()
class TestResultParser():
many_results = {
'trackmatches': {
... |
import os
import cryptography.fernet
def wizard():
print('This is osm validator setting initialization wizard.')
print('Please read and enter a few settings.')
print('Press ENTER to continue.')
input()
print()
if os.path.exists('.env'):
print('You already have `.env` file, please mov... |
from moneybot.command import Command
from moneybot.exc import InvalidCommand
from moneybot.ledger import transfer_balance
from random import choice
class FedSpeak(Command):
prefix = "fedspeak"
description = "Speak like the federal reserve!"
options = [
"The members of the Board of Governors and t... |
import pytest
import django_dynamic_fixture as fixture
from django.conf import settings
from readthedocs.builds.querysets import BuildQuerySet
from readthedocs.builds.models import Build, Version
from readthedocs.organizations.models import Organization
from readthedocs.projects.models import Project, Feature
@pyte... |
# Copyright 2019 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 agreed to in writing, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.