src stringlengths 721 1.04M |
|---|
#!/usr/bin/python
from setuptools import setup, find_packages
import os
EXTRAS_REQUIRES = dict(
test=[
'fudge>=1.0.3',
'nose>=1.1.2',
],
dev=[
'ipython>=0.12.1',
],
)
# Pypi package documentation
root = os.path.dirname(__file__)
path = os.path.join(root, 'README.rst... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-07 21:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='UrlSho... |
# 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
# list of conditions and ... |
"""The tests for the Alexa component."""
# pylint: disable=protected-access
import asyncio
import json
import pytest
from homeassistant.core import callback
from homeassistant.setup import async_setup_component
from homeassistant.components import alexa
from homeassistant.components.alexa import intent
SESSION_ID = ... |
from odoorpc import ODOO
class TodoAPI():
def __init__(self, srv, port, db, user, pwd):
self.api = ODOO(srv, port=port)
self.api.login(db, user, pwd)
self.uid = self.api.env.uid
self.model = 'todo.task'
self.Model = self.api.env[self.model]
def execute(self, method, a... |
"""
``django-guardian`` template tags. To use in a template just put the following
*load* tag inside a template::
{% load guardian_tags %}
"""
from __future__ import unicode_literals
from django import template
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser, G... |
import os
import sys
import re
import pylab
def parse_trajectory_line(line):
trajectory = []
for x,y in re.findall("\(([0-9.]+), ([0-9.]+)\)",line):
trajectory.append((float(x),float(y)))
return trajectory
def generate_trajectories(file):
#get rid fo two first lines
file.readline()
file.readline()
#parse eac... |
SYSTEM_GROUPS = [
{
"description" : "This is my first system group.",
"updated_at" : "2012-04-26T19:59:46Z",
"pulp_id" : "ACME_Corporation-Test System Group 1-0cdaf879",
"created_at" : "2012-04-26T19:59:23Z",
"name" : "Test System Group 1",
"id" : 1,
"organiz... |
# Copyright 2018 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
#!/usr/bin/env python
# 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.
"""The 'grit xmb' tool.
"""
import getopt
import os
from xml.sax import saxutils
from grit import grd_reader
from grit import la... |
#!/usr/bin/env python
#-- Setup file for py2exe
from distutils.core import setup
import py2exe
import sys, os
import Cryptodome
import requests
#find POGOProtos
sys.path.append("pgoapi\protos")
mydata = list()
path = Cryptodome.__path__[0]
root_end = path.find('Cryptodome')
for folder,folder_name,files in os.walk(p... |
#
# 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... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from django.core.urlresolvers import reverse
from django.core import serializers
fr... |
# The MIT License (MIT)
# Copyright (c) 2016, 2017 by the ESA CCI Toolbox development team and contributors
#
# 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 w... |
"""Settings that need to be set in order to run the tests."""
import os
DEBUG = True
SITE_ID = 1
APP_ROOT = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..'))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
ROOT_URLCONF = 'downloa... |
from wKRApp.views import db
from wKRApp.models import Users
# create the database and the db tables
db.create_all()
# insert in Users
db.session.add(Users("123456",
"Brian",
"Nobody",
"bnobody@nowhere.com",
"0812345678",
... |
import unittest
import numpy
import chainer
from chainer import cuda
from chainer.functions.connection import embed_id
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
@testing.parameterize(
{'x_data': [0, 1, 0], 'ignore_label'... |
'''
@author: frank
'''
import subprocess
from zstacklib.utils import log
logcmd = True
logger = log.get_logger(__name__)
class ShellError(Exception):
'''shell error'''
class ShellCmd(object):
'''
classdocs
'''
def __init__(self, cmd, workdir=None, pipe=True):
... |
import glob
import itertools
import json
import logging
import os
import re
import subprocess
import sys
import time
from deimos.cmd import Run
from deimos.err import *
from deimos.logger import log
from deimos._struct import _Struct
def run(options, image, command=[], env={}, cpus=None, mems=None, ports=[]):
en... |
#!/usr/bin/env python3
#
#
import bottom, random, time, asyncio
from .svr_info import ServerInfo
import logging
logger = logging.getLogger('connectrum')
class IrcListener(bottom.Client):
def __init__(self, irc_nickname=None, irc_password=None, ssl=True):
self.my_nick = irc_nickname or 'XC%d' % random.ran... |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
#! /usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
from DataTools import writeDataToFile
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--time-step',dest='time_step',required=False)
parser.add_argument('--output-file',dest='fn_out',required=False)
args = parser.parse_ar... |
#FLASK
from flask import abort, render_template, Response, flash, redirect, session, url_for, g, request, send_from_directory
#FLASK EXTENSIONS
from flask.ext.login import login_user, logout_user, current_user, login_required
from flask.ext.sqlalchemy import get_debug_queries
from flask.ext.mail import Mail
#LOCAL
from... |
# -*- coding: utf-8 -*-
from django.conf.urls.defaults import patterns, url
from django.utils.translation import ugettext_lazy as _
from wiki.conf import settings
from wiki.core.plugins import registry
from wiki.core.plugins.base import BasePlugin
from wiki.plugins.links import views
from wiki.plugins.links.mdx.urlize... |
#!/usr/bin/env python
from __future__ import division, print_function
import os
import sys
import re
import argparse
import requests
import cssselect
import lxml.html
import unicodedata
if sys.version_info.major == 3:
text_type = str
else:
text_type = unicode
# Some settings
download_directory = 'downloads'
... |
# -*- coding: utf-8 -*-
"""Setup/installation tests for this package."""
from osm.buildout.testing import IntegrationTestCase
from plone import api
class TestInstall(IntegrationTestCase):
"""Test installation of osm.buildout into Plone."""
def setUp(self):
"""Custom shared utility setup for tests.""... |
# Copyright 2016 Pinterest, 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 writi... |
#
# 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
# ... |
import logging
logger = logging.getLogger(__name__)
requires_model="Appliance"
try:
basestring
except NameError:
basestring = (str, bytes)
def get(isamAppliance, check_mode=False, force=False):
"""
Retrieve the tracing levels
"""
return isamAppliance.invoke_get("Retrieve the tracing levels",... |
import numpy as np
MEDIAN = 'median'
AVERAGE = 'average'
def annotate_token(current_token_id, window_tokens, \
token_concepts, relatedness, rel_concepts):
'''
Annotate the tokens in a given token window.
:param current_token_id: token to be annotated
:param window_tok... |
#!/usr/bin/python
# coding:utf-8
import re
import sys
import os
import stat
import shutil
from setuptools import setup, find_packages
DATADIR = "/data/job"
LOGDIR = "/data/logs/job"
CONFDIR = "/data/conf/job"
def initConfEnv():
"""Initialize configure and modidy basepackage.ini"""
# data
conf = 'conf/bas... |
"""
This module contains all json serializers in the project.
"""
from json import loads as json_loads
class JSONSerializer(object):
"""
This class contains methods for serializing model objects into JSON objects.
"""
@staticmethod
def serialize_hierarchy_overview(hierarchy):
"""
Serializes a hierarchy to J... |
# pylint: disable-all
# flake8: noqa
import sys
sys.path.append("..")
from todopagoconnector import TodoPagoConnector
from CredentialsData import CredentialsData
import unittest
from unittest import TestCase
if sys.version_info[0] >= 3:
from unittest.mock import patch, Mock
else:
from mock import patch, Mock, M... |
from __future__ import unicode_literals
from django.conf import settings
from django.utils.encoding import force_text
from rest_framework.compat import importlib
from rest_framework.serializers import ListSerializer, ManyRelatedField
from inflection import underscore, dasherize
def get_serializer(serializer):
if... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import apps
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse_lazy
from django.db.models import Q
from django.shortcuts import redirect
from django.v... |
from src.core.page import ResourceLoader, Page
from src.core.r import Resource
from src.pages.explore import Explore
from src.pages.me.me import Me
class BottomNavigation(Page):
meNavIconInactive = ResourceLoader(Resource.meNavIconInactive)
meNavIconActive = ResourceLoader(Resource.meNavIconActive)
expl... |
#!/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.
"""Code generator for PlatformObject<> constructor list.
This script takes as arguments a list of platform names as a text file and
a ... |
from datetime import timedelta
import json
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponseBadRequest, HttpResponse
from django.urls import reverse
from django.views.generic import View
from provider import constants
from provider.oauth2.backends import BasicClientBackend, Re... |
#!/usr/bin/python
# Filename: ffprobe.py
"""
Python wrapper for ffprobe command line tool. ffprobe must exist in the path or in a common installation path
"""
version = '0.4'
import subprocess
import re
import os
import sys
from os import listdir
from os.path import isfile, join
import json
import mimetypes
class FF... |
# 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 ... |
# This program is in the public domain.
from distutils.core import setup
import py2app
## \file
# \brief Setup file for constructing OS X applications. Run using:
#
# % python setup-app.py py2app
#Should be combined with setup.py which understands py2exe so that
#it is easier to keep names and versions consis... |
# -*- coding: utf-8 -*-
# Zeobuilder is an extensible GUI-toolkit for molecular model construction.
# Copyright (C) 2007 - 2012 Toon Verstraelen <Toon.Verstraelen@UGent.be>, Center
# for Molecular Modeling (CMM), Ghent University, Ghent, Belgium; all rights
# reserved unless otherwise stated.
#
# This file is part of Z... |
import os
import time
import sys
import handler_ss
import handler_hs
import write_ss
import write_hs
import write_prox
import prox
while True:
os.system("clear")
print "Menu"
print "Please choose an option:"
print "1. Log iClass Standard Security & Prox"
print "2. Log iClass High Security & Prox"... |
# -*- coding: utf-8 -*-
from unittest import TestCase
from parameterized import parameterized
import pandas as pd
import numpy as np
from numpy.testing.utils import assert_array_equal
from pandas import (MultiIndex,
Index)
from pandas.util.testing import assert_frame_equal, assert_series_equal
from... |
"""
Provides authorization functions for Mojang's login and session servers
"""
import hashlib
import json
# This is for python2 compatibility
try:
import urllib.request as request
from urllib.error import URLError
except ImportError:
import urllib2 as request
from urllib2 import URLError
import loggin... |
from flask import Blueprint, render_template, request, g, Response, redirect, session, abort, send_file, make_response, url_for
from flask.ext.login import current_user
from sqlalchemy import desc
from KerbalStuff.objects import User, Mod, ModVersion, DownloadEvent, FollowEvent, ReferralEvent, Featured, Media, GameVers... |
"""
Builds a manifold learning autoencoders.
Author(s): Wei Chen (wchen459@umd.edu)
"""
import numpy as np
from keras.models import Sequential
from keras.optimizers import Adagrad, SGD, Adadelta, Adam
from keras.regularizers import l2
from keras.layers import Input, Dense
from keras.models import Model
#from early_st... |
# -----------------------------------------------------------
# demonstrates how to create and use a double-linked list
# using the collections module
#o
# (C) 2017 Frank Hofmann, Berlin, Germany
# Released under GNU Public License (GPL)
# email frank.hofmann@efho.de
# -------------------------------------------------... |
import bpy
from os.path import dirname, basename, join
import unittest
import json
from io import StringIO
import logging
from contextlib import contextmanager
import sverchok
from sverchok.utils.logging import debug, info
from sverchok.utils.context_managers import sv_preferences
from sverchok.utils.sv_IO_panel_tool... |
# Copyright 2018 The TensorFlow Probability 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 applicable law o... |
# encoding: utf8
import math
from math import pi
from textwrap import dedent
import pytest
from quantiphy import Quantity, add_constant
def test_workout():
Quantity.reset_prefs()
qs = Quantity.extract(
r"""
Fclk = 50MHz -- clock frequency
This is an arbitrary line of te... |
import sys
import tenhou
tilelist = []
for x in range(0, 9):
# tilelist.append(Image(source="%sm.gif" % (x+1)))
tilelist.append("images/%sm.gif" % (x+1))
for x in range(0, 9):
# tilelist.append(Image(source="%sp.gif" % (x+1)))
tilelist.append("images/%sp.gif" % (x+1))
for x in range(0, 9)... |
#!/usr/bin/env python
# This file is part of Responder, a network take-over set of tools
# created and maintained by Laurent Gaffie.
# email: laurent.gaffie@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... |
#!/usr/bin/python3
"""Perform a previously configured AOSP toolchain build.
This script kicks off a series of builds of the toolchain gcc compiler
for Android. It relies on previously established symbolic links set
up by hand or by "setup-aosp-toolchain-build.py".
"""
import getopt
import importlib
import multiproce... |
import requests
import json
import time
from collections import OrderedDict
from test_framework.test_framework import OpenBazaarTestFramework, TestFailure
class EthRefundDirectTest(OpenBazaarTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 3
def run_test(self):
... |
import sys;
file = open("equations.inc","w")
file2 = open("writeinitialguess.inc","w")
file3 = open("writesolution.inc","w")
file4 = open("guesstangential.inc","w")
n=int(sys.argv[1]);
file.write("#------------------------------------------------------------------------\n")
file.write("#Optimisation Variables\n\n")
... |
# Binary search a tuple/array of integers according to a list of numbers given
# on the command line.
import argparse
import re
import math
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
"csv_list",
default=(0,1,2,3,4,5,6,7,8,9,10),
help="A comma seperated list of... |
#!/usr/bin/python
from pycounters.utils.munin import Plugin
config = [
{
"id" : "requests_per_sec",
"global" : {
# graph global options: http://munin-monitoring.org/wiki/protocol-config
"title" : "Request Frequency",
"category" : "PyCounters example"
},
... |
# Copyright 2016 Suzy M. Stiegelmeyer
#
# 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 agre... |
from django.test import Client, TestCase
from django.core.urlresolvers import reverse
from breach.models import Target, Victim, Round, SampleSet
import json
from binascii import hexlify
from mock import patch
class ViewsTestCase(TestCase):
def setUp(self):
self.client = Client()
self.target1 = Ta... |
# -*- coding: utf-8 -*-
import scrapy
from scrapy.spiders import CrawlSpider, Rule
from bson.objectid import ObjectId
from crow.items import RestaurantDetailItem
from scrapy.selector import HtmlXPathSelector
from pymongo import MongoClient
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
class TripSp... |
#!/usr/bin/python
import serial
import time
import random
import sys
s = None
num_leds = 93
play_time = 0
def flush_input():
s.flushInput()
def wait_for_ack():
while s.inWaiting() <= 0:
pass ... |
# Copyright (C) 2012-2013 W. Trevor King <wking@tremily.us>
#
# This file is part of rss2email.
#
# rss2email 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... |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
'''lesson_1_6 homework «Разбор алгоритмических задач с собеседований»
решение задач с HackerRank
'''
#TODO 2:
# CSS colors are defined using a hexadecimal (HEX) notation for the combination of Red, Green, and Blue color values (RGB).
# Specifications of HEX Color Code
#
# ■ It must start with a '#' symbol.
# ■ It can ... |
# -*- coding: utf-8 -*-
import json
from json.decoder import WHITESPACE
import logging
from traceback import print_exc
try:
# from PyQt5.Qt import (QMainWindow, QApplication, QFileDialog, QToolBar, QWidget, QVBoxLayout, QTextEdit, QTimer,
# QLabel, QColor, QByteArray, QBuffer, QPixmap, QBoxLayout, QPainter, QP... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 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.apach... |
import functools
import logging
import time
from datetime import datetime
import pytz
from app.util.config_util import config
def str2datetime(value, default=None, time_format="%Y-%m-%d %H:%M:%S"):
try:
return datetime.strptime(value, time_format)
except Exception as exception:
logging.excep... |
# This file is part of Booktype.
# Copyright (c) 2012 Aleksandar Erkalovic <aleksandar.erkalovic@sourcefabric.org>
#
# Booktype 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 Li... |
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import (ascii, bytes, chr, dict, filter, hex, input,
int, map, next, oct, open, pow, range, round,
str, super, zip)
import io
import re
import pandas a... |
from numpy import *
from pylab import *
size = 64
plt.figure(figsize=(8, 8))
x, y, z = genfromtxt(
"../../../../data/out/rust-examples/scalar_field/empty_field.dat").T
x = x.reshape(size + 1, size + 1)
y = y.reshape(size + 1, size + 1)
z = z.reshape(size + 1, size + 1)
pcolor(x, y, z)
show()
r1, number1 = genfro... |
#!/usr/bin/env python
"""
parallel_tree.py - Version 1.0 2013-09-22
Run two tasks in parallel using the pi_trees library.
Created for the Pi Robot Project: http://www.pirobot.org
Copyright (c) 2014 Patrick Goebel. All rights reserved.
This program is free software; you can redistribute ... |
"""
Problem 3.
calculate the time series
yt = 5 + .05 * t + Et (Where E is epsilon)
for years 1960, 1961, ..., 2001 assuming Et independently and
identically distributed with mean 0 and sigma 0.2.
"""
from random import uniform
from matplotlib.pyplot import plot, show
from numpy import array, polyfit, poly1d
def ... |
"""
Allow the user to visualise the current state of the program from the console.
"""
# OAT - Obfuscation and Analysis Tool
# Copyright (C) 2011 Andy Gurden
#
# This file is part of OAT.
#
# OAT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Lice... |
# -*- coding:utf-8 -*-
import logging
import pathlib
from typing import Union
import lxml.html
import requests
class WebPage:
def __init__(
self,
url: str,
session: requests.sessions.Session = None,
params: dict = None,
logger: logg... |
from Components.Console import Console
from os import mkdir, path, remove
from glob import glob
from Components.config import config, ConfigSubsection, ConfigInteger, ConfigText, getConfigListEntry, ConfigSelection, ConfigIP, ConfigYesNo, ConfigSequence, ConfigNumber, NoSave, ConfigEnableDisable, configfile
import os
... |
############################################################################
##
## Copyright (c) 2000-2015 BalaBit IT Ltd, Budapest, Hungary
## Copyright (c) 2015-2018 BalaSys IT Ltd, Budapest, Hungary
##
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General... |
from django import forms
from django.conf import settings
class ConfigGeneralForm(forms.Form):
"""
Django form for updating the CRIPTs Configuration.
"""
required_css_class = 'required'
debug = forms.BooleanField(
help_text='*Requires a web server restart.',
initial=False,
... |
import pytest
import matplotlib.pyplot as plt
from aneris.control.factory import InterfaceFactory
from dtocean_core.core import (AutoFileInput,
AutoFileOutput,
AutoPlot,
Core)
from dtocean_core.data import CoreMetaData
from d... |
import os
from GAN import GAN
'''
from CGAN import CGAN
from infoGAN import infoGAN
from ACGAN import ACGAN
from EBGAN import EBGAN
from WGAN import WGAN
from DRAGAN import DRAGAN
from LSGAN import LSGAN
from BEGAN import BEGAN
'''
from utils import show_all_variables
import tensorflow as tf
import argparse
"""pars... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Test Git Transaction """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__... |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
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... |
#!/usr/bin/python
# (c) 2018 Jim Hawkins. MIT licensed, see https://opensource.org/licenses/MIT
# Part of Blender Driver, see https://github.com/sjjhsjjh/blender-driver
"""Python module for Blender Driver demonstration application.
This application adds to the pulsar application. The code illustrates:
- Basic use o... |
# -*- coding:utf-8 -*-
__author__ = 'eric'
import hashlib
from datetime import datetime
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from werkzeug.security import generate_password_hash, check_password_hash
from flask.ext.login import UserMixin
from flask import current_app, request... |
from PyQt4.QtCore import SIGNAL, Qt
from PyQt4.QtGui import QLabel
from PyKDE4.kdecore import i18n
from PyKDE4.kdeui import KVBox, KHBox, KColorButton, KColorCells, KColorCombo, KColorPatch
helpText = """These are examples of three ways of changing colors interactively,
and one widget that displays a chosen color.
W... |
#!/usr/bin/env python
import math
spherical = (( 60, 6), ( 20, 30), ( 45, 48), ( 75, 18), (100, 348),
(300, 6), (260, 348), (285, 18), (315, 48), (340, 30),
(180, 328), (140, 333), (165, 300), (195, 300), (220, 333),
(120, 318), ( 95, 338), (109, 238), (131, 258), (145... |
import logging
import csv
import subprocess
import re
from django.conf import settings
from daiquiri.core.generators import generate_csv, generate_votable, generate_fits
from daiquiri.core.utils import get_doi_url
logger = logging.getLogger(__name__)
class BaseDownloadAdapter(object):
def __init__(self, datab... |
#!/usr/bin/python
#
# Copyright (c) 2014-2015 Sylvain Peyrefitte
#
# This file is part of rdpy.
#
# rdpy 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) a... |
# This file is part of GridCal.
#
# GridCal 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.
#
# GridCal is distributed in the hope that... |
# coding=utf-8
"""
The end developer will do most of their work with the PayPalInterface class
found in this module. Configuration, querying, and manipulation can all be done
with it.
"""
import types
import logging
from pprint import pformat
import warnings
import requests
from paypal.settings import PayPalConfig
f... |
# -*- coding: utf-8 -*-
import dateutil.parser
import csv
from os.path import dirname, join
import re
import string
import codecs
import requests
from django.core.management.base import BaseCommand
from candidates.utils import strip_accents
from candidates.views.version_data import get_change_metadata
from electio... |
#!/usr/bin/env python
'''
Forward Flux sampling: Flux generator a-la-Tom
Flavio
'''
####################################
# edit here
####################################
# number of successes, can be changed via command line
desired_success_count = 100
# executable set-up
#precommand = 'mosrun -J 12'
executable = '... |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
from abc import ABCMeta, abstractmethod
class Observer(object):
"""
This class represents the observer role in the "observer pattern".
Classes which inherit this method will be notified by the notify() method.
"""
__meta__ = ABCMeta
@abstractmethod
def notify(self, data):
"""
... |
"""
SVCB and HTTPS RR Types class.
"""
import socket
import struct
from .name import name_from_wire_message
# SVCB (Service Binding RR) Parameter Types
SVCB_PARAM = {
0: "mandatory",
1: "alpn",
2: "no-default-alpn",
3: "port",
4: "ipv4hint",
5: "echconfig",
6: "ipv6hint",
}
class Rdat... |
# Copyright 2014 Netflix, 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... |
# -*- coding: utf-8 -*-
#
# Zooniverse Aggregation Engine documentation build configuration file, created by
# sphinx-quickstart on Mon Mar 14 11:15:07 2016.
#
# 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
# aut... |
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2011,2012,2013,2014,2015,2016 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#... |
"""Test class for Compute Profile UI
:Requirement: Computeprofile
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: UI
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from robottelo.datafactory import (
generate_strings_list,
invalid_value... |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
def upload_location(instance, filename):
return 'avatars/{}/{}'.format(instance.id, filename)
# Create your models here.
class Profile(models.Model):
user = models.OneToOneField(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.