src stringlengths 721 1.04M |
|---|
# This takes 4min 30s to run in Python 2.7
# But only 1min 30s to run in Python 3.5!
#
# Note: gym changed from version 0.7.3 to 0.8.0
# MountainCar episode length is capped at 200 in later versions.
# This means your agent can't learn as much in the earlier episodes
# since they are no longer as long.
import gym
impo... |
import Queue
import threading
MAX_WAIT_QUEUE_TIMEOUT = 2
class ArticleInserter(threading.Thread):
'''Thread which inserts articles into the database
'''
def __init__(self, queue, build_view):
threading.Thread.__init__(self)
'''constructor
@param queue the queue to which the ar... |
# Copyright 2015-2016 Yelp 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 writin... |
'''
Project: https://github.com/smh69/strum
Chord names and their compositions
Copyright (C) 2010-2015, Spencer Michael Hanson
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 o... |
import re
from django import forms
from django.core import validators
from django.utils.encoding import force_unicode
from django.utils.translation import ugettext_lazy as _
from utils.forms.recapcha import ReCaptchaField
from utils.validators import UniSubURLValidator
assert ReCaptchaField # Shut up, Pyflakes.
cl... |
from collections import OrderedDict
from pathlib import Path
import pytest
from aiohttp_apiset.swagger.loader import (
AllOf,
DictLoader,
ExtendedSchemaFile,
FileLoader,
Loader,
SchemaFile,
yaml,
)
def test_load():
p = Path(__file__).parent / 'data/schema01.yaml'
f = SchemaFile(p... |
#!/home/adam/Documents/revkit-1.3/python
#!/usr/bin/python
# RevKit: A Toolkit for Reversible Circuit Design (www.revkit.org)
# Copyright (C) 2009-2011 The RevKit Developers <revkit@informatik.uni-bremen.de>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gener... |
# -*- mode: python; coding: utf-8 -*-
# Copyright 2014 Peter Williams <peter@newton.cx> and collaborators.
# Licensed under the MIT License.
"""A framework making it easy to write functions that can perform computations
in parallel.
Use this framework if you are writing a function that you would like to
perform some ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import itertools
import json
import logging
import os
import sys
import random
from random import shuffle
import numpy as np
import scipy as scp
import scipy.misc
sys.path.insert(1, '../incl')
from scipy.mis... |
from .readout_pulse import *
from .. import readout_classifier
from . import excitation_pulse
from .. import single_shot_readout
import numpy as np
import traceback
def get_confusion_matrix(device, qubit_ids, pause_length=0, recalibrate=True, force_recalibration=False):
qubit_readout_pulse, readout_device = get_... |
#!/usr/bin/env python3
"""
changes-lxc-wrapper
===================
:copyright: (c) 2014 Dropbox, Inc.
"""
from setuptools import setup, find_packages
tests_require = [
'coverage',
'mock>=1.0.1,<1.1.0',
'pytest>=2.6.1,<2.7.0',
]
install_requires = [
'raven>=5.0.0,<5.1.0',
]
setup(
name='changes-... |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# Copyright (C) 2015 <Christopher Wells> <cwellsny@nycap.rr.com>
# Copyright (C) 2015 <Rui914>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files... |
"""Provide match grabber for AlphaTL."""
import logging
from datetime import datetime, timedelta, timezone
from urllib.request import urlopen, urlretrieve
import scctool.settings
import scctool.settings.translation
from scctool.matchgrabber.custom import MatchGrabber as MatchGrabberParent
# create logger
module_logge... |
# -*- coding: utf-8 -*-
#
#This file is part of a program called NumShip
#Copyright (C) 2011,2012 Alex Sandro Oliveira
#NumShip 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... |
#!/usr/bin/env python
import sys, os, time, atexit
import traceback
import locale
from signal import SIGTERM,SIGKILL
from zstacklib.utils import linux
from zstacklib.utils import log
logger = log.get_logger(__name__)
class Daemon(object):
"""
A generic daemon class.
Usage: subclass the Daemon class... |
import keras
import numpy as np
from keras import optimizers
from keras.datasets import cifar10
from keras.models import Sequential
from keras.layers import Conv2D, Dense, Flatten, MaxPooling2D
from keras.callbacks import LearningRateScheduler, TensorBoard
from keras.preprocessing.image import ImageDataGenerator
batch... |
"""
This package gathers all tools used by the Abinit test suite for manipulating YAML formatted data.
"""
from __future__ import print_function, division, unicode_literals
import warnings
from .errors import NoYAMLSupportError, UntaggedDocumentError, TagMismatchError
try:
import yaml
import numpy # numpy is... |
from flask import current_app, json, request
def __pad(strdata):
""" Pads `strdata` with a Request's callback argument, if specified, or does
nothing.
"""
if request.args.get('callback'):
return "%s(%s);" % (request.args.get('callback'), strdata)
else:
return strdata
... |
##############################################################################
# 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... |
# -*- coding: utf-8 -*-
"""
LibraryContent: The XBlock used to include blocks from a library in a course.
"""
import json
import logging
import random
from copy import copy
from gettext import ngettext
import six
import bleach
from lazy import lazy
from lxml import etree
from opaque_keys.edx.locator import LibraryLo... |
__author__ = 'ray'
import os
from subprocess import Popen,PIPE
import wave
import numpy as np
def run_comm(comm):
process = Popen(comm, stdout=PIPE)
(std_out,std_err) = process.communicate()
exit_code = process.wait()
if std_out: print std_out
if std_err!=None: print std_err
def run_comm_save_out... |
# Copyright (c) 2015 Mirantis, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
import unittest
import Tkinter
import Graphics
import Geometry
# python2.2 testGraphics.py -v
def testOperationsLeafGF(tester, operations):
for op in operations:
apply(op[1], op[2])
tuples = map(None, op[0].xy, op[3])
for tup in tuples:
tester.failIf(tup[0] <= tup[1] - tester.e)
... |
#!/usr/bin/env python
'''
Make a set of images with a single colormap, norm, and colorbar.
It also illustrates colorbar tick labelling with a multiplier.
'''
from matplotlib.pyplot import figure, show, sci
from matplotlib import cm, colors
from matplotlib.font_manager import FontProperties
from numpy import amin, ama... |
#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Herald HTTP transport servlet
:author: Thomas Calmant
:copyright: Copyright 2014, isandlaTech
:license: Apache License 2.0
:version: 0.0.1
:status: Alpha
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
yo... |
#!/usr/bin/python -tt
#
# Copyright (c) 2011 Intel, Inc.
#
# 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; version 2 of the License
#
# This program is distributed in the hope that it will be us... |
""" Some Python2/Python3 compatibility support helpers """
import sys
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
if PY3:
basestring = str
cmp = lambda x, y: (x > y) - (x < y)
memoryview = memoryview
open = open
unichr = chr
unicode = lambda x: x
raw_input = input
i... |
# This file is part of DroidTrail.
#
# bl4ckh0l3 <bl4ckh0l3z at gmail.com>
#
# DroidTrail is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later... |
# -*-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
# ... |
"""
HMD calibration client example.
This script shows how to talk to Pupil Capture or Pupil Service
and run a gaze mapper calibration.
"""
import zmq, msgpack, time
ctx = zmq.Context()
# create a zmq REQ socket to talk to Pupil Service/Capture
req = ctx.socket(zmq.REQ)
req.connect("tcp://127.0.0.1:50020")
# conven... |
'''
Created on Nov 1, 2014
@author: ehenneken
'''
from __future__ import absolute_import
# general module imports
import sys
import os
import operator
from itertools import groupby
from flask import current_app
from .utils import get_data
from .utils import get_meta_data
__all__ = ['get_suggestions']
def get_sugge... |
# coding: utf-8
from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import AbstractUser, AbstractBaseUser
from courses.models import Course
class User(AbstractUser):
avatar = models.ImageField(u'фото профиля',upload_to='avatars', blank=False, default=u'avatars/def... |
from urlparse import urlparse
from momoko.clients import AsyncClient
class Row:
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
class Database():
def __init__(self, client):
self.client = client
def select_all(self, operation, parameters=(), record=Row, callback=None):
... |
# coding: utf-8
from __future__ import unicode_literals
import re
import json
import itertools
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
int_or_none,
orderedSet,
str_to_int,
unescapeHTML,
)
class D... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import unittest
from log import Log
from DV72 import ControlDevice
from OS74 import CurrentPlatform, FileSystemObject
from MP74 import OpenWeatherMap
from TX74 import WebContent
def load_platform_based(from_path, web=None):
base = FileSystemObject().dir_up(2)
print(... |
# -*- coding: utf-8 -*-
"""
pygtkhelpers.ui.objectlist.column
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2005-2008 by pygtkhelpers Authors
:license: LGPL 2 or later (see README/COPYING/LICENSE)
"""
import gtk
class PropertyMapper(object):
def __init__(self, prop, attr=None, format_func=Non... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.contrib.auth import authenticate
from django.core import mail
from django.test.utils import override_settings
from django.conf import settings
from django import forms
from django.contrib.auth.backends import ModelBackend
from .mo... |
# Django settings for example project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'exampl... |
from kivy.logger import Logger
import os
class MeshData(object):
def __init__(self, **kwargs):
self.name = kwargs.get("name")
self.vertex_format = [
('v_pos', 3, 'float'),
('v_normal', 3, 'float'),
('v_tc0', 2, 'float')]
self.vertices = []
self.i... |
#/*##########################################################################
# Copyright (C) 2004-2012 European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
#
# This file is free software; you can redistribute it and/or modi... |
# -*- coding: iso-8859-1 -*-
"""
MoinMoin - pagelinks Formatter
@copyright: 2005 Nir Soffer <nirs@freeshell.org>
@license: GNU GPL, see COPYING for details.
"""
from MoinMoin.formatter import FormatterBase
class Formatter(FormatterBase):
""" Collect pagelinks and format nothing :-) """
def pagel... |
import json
from flask import Blueprint, render_template, request
import requests
import config
from tracker.API import TrackerAPI
hook = Blueprint('hooks', __name__, 'templates')
@hook.route('/github/hook')
def home():
return render_template('new.html')
@hook.route('/github/hook/new', methods=['POST'])
def new(... |
# -*- 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... |
"""
Show a wallabag entry
"""
import io
import formatter
import json
import os
from sys import exit
import sys
from bs4 import BeautifulSoup
import api
import conf
import entry
def show(entry_id, colors=True, raw=False, html=False):
"""
Main function for showing an entry.
"""
conf.l... |
#!/usr/bin/env python
"""
Find classes and functions in ../src which have no test case.
usage: find-untested.py [-l]
Arguments:
-l Long list
(Run in 'tests' directory)
"""
import os
import sys
import re
import glob
def findclasses():
classes = []
dirs = {}
for dir, subdirs, files in os.walk('../src'):... |
##############################################################################
# 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... |
from flask import Flask, render_template, request
import json
from celery import Celery, result
from flask import jsonify, url_for
import time
from messageHandler import messageHandler
import os
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
# not sure if this is best practice for importing from other direct... |
from app import server, db, trajectoryAPI
from pylab import *
import flask
from flask import jsonify, request, url_for, redirect, render_template, abort
from flask.ext import restful
import requests
import math, time
import urllib2
import json
import os
from os import path
starting_lat = 0
starting_lng = 0
vehicle_mi... |
import sys
import traceback
from typing import Any, Callable, Dict, NoReturn
import construi.console as console
from compose.errors import OperationFailedError
from compose.service import BuildError
from docker.errors import APIError
from .config import ConfigException, NoSuchTargetException
from .target import Build... |
import sys
import unittest
from datetime import datetime
from parameterized import parameterized, param
from tests import BaseTestCase
is_python_supported = sys.version_info >= (3, 6)
try:
from dateparser.calendars.hijri import HijriCalendar
except ImportError:
if is_python_supported:
raise
@unitt... |
from binascii import b2a_hex
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import ec, rsa, padding
from .util import DEFAULT_PIN, DEFAULT_MANAGEMENT_KEY, NON_DEFAULT_MANAGEMENT_KEY
f... |
def get_fileinf(file):
documentName = file.name
isFiles =2 #默认普通文件
fileType=05 #文件类型,默认OTHER
postfix = documentName.split(".")[-1]
for i,v in enumerate(types):
if postfix.lower() in v:
fileType = i+1
break
#调用云查看链接
file_url =file.absolute_url(request)
ur... |
import maya.cmds as cmds
import numpy as np
spectrum = np.load(
r"D:\Documents\Personal\Graphics\Colour\spectrum.npy")[:, 35:325, :]
materials = [u'mia_material_x01', u'mia_material_x02', u'mia_material_x03',
u'mia_material_x04', u'mia_material_x05', u'mia_material_x06',
u'mia_mate... |
# See https://zulip.readthedocs.io/en/latest/subsystems/notifications.html
import re
from collections import defaultdict
from datetime import timedelta
from email.headerregistry import Address
from typing import Any, Dict, Iterable, List, Optional, Tuple
import html2text
import lxml.html
import pytz
from bs4 import B... |
from datetime import datetime
import json
from urllib2 import urlopen, HTTPError
from django.db.models import Max
from sources.models import FacebookPost
def time(s):
return datetime.strptime(s, '%Y-%m-%dT%H:%M:%S+0000')
def post_text(item):
return item.get('message', u'') + item.get('description', u'')
de... |
import subprocess
import boto3
import sys
import configparser
from codecs import open
from os.path import expanduser
import os
import glob
import inquirer
import argparse
import libtmux
import time
class Connector:
def __init__(self, connection_name, profile):
self.hosts_folder = expanduser("~")
print(self.... |
# Copyright 2017 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... |
import six
import re
import types
import sys
# python 3 doesnt have long
if sys.version_info > (3,):
long = int
def quote_string(string):
return repr(str(string))
def mysql_list(l):
return ','.join(map(str, l))
def _escape(x):
if isinstance(x, six.string_types):
return quote_string(x)
... |
# -*- test-case-name: txdav.who.test -*-
##
# Copyright (c) 2014 Apple 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... |
# -*- coding: utf-8 -*-
# Code by Yinzo: https://github.com/Yinzo
# Origin repository: https://github.com/Yinzo/SmartQQBot
from Group import *
from Pm import *
from Sess import *
import threading
logging.basicConfig(
filename='smartqq.log',
level=logging.DEBUG,
format='%(asctime)s %(filename)s... |
# -*- coding: utf-8 -*-
import hashlib
from decimal import Decimal, InvalidOperation
from dateutil.parser import parse
class InvalidTransaction(Exception):
pass
class RawTransaction(object):
date = None
description = None
amount = None
checksum = None
"""docstring for Transaction"""
def... |
"""
* Copyright (c) 2008 Zivios, LLC.
*
* This file is part of Zivios.
*
* Zivios 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 versio... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-02-10 21:37
from __future__ import unicode_literals
from django.db import migrations
import django.db.models.deletion
import sentry.db.models.fields.foreignkey
class Migration(migrations.Migration):
# This flag is used to mark that a migration shouldn... |
"""
Tests for trajectory analysis utilities.
"""
import VMD
from mock import sentinel
from pyvmd.analyzer import Analyzer
from pyvmd.molecules import Molecule
from .utils import data, PyvmdTestCase
class TestAnalyzer(PyvmdTestCase):
"""
Test `Analyzer` class.
"""
def setUp(self):
self.mol = ... |
# Creates a rough gold layer with a rough dielectric coating containing an
# anisotropic scattering medium
import sys
sys.path.append('.')
from utils.materials import gold
from utils.cie import get_rgb
import layerlab as ll
eta_top = 1.5
# This step integrates the spectral IOR against the CIE XYZ curves to obtain
... |
class RepositoryManager:
"""
Manages official Genesis plugin repository. ``cfg`` is :class:`genesis.config.Config`
- ``available`` - list(:class:`PluginInfo`), plugins available in the repository
- ``installed`` - list(:class:`PluginInfo`), plugins that are locally installed
- ``upgradable`` - li... |
import sys
from naoqi import ALProxy
import time
def main(robotIP):
PORT = 9559
try:
motionProxy = ALProxy("ALMotion", robotIP, PORT)
except Exception,e:
print "Could not create proxy to ALMotion"
print "Error was: ",e
sys.exit(1)
try:
postureProxy = ALProxy("A... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import pygtk
pygtk.require("2.0") #Essa linha define a versão do pygtk a ser importado
import gtk, gobject, cairo, gio, pango, atk, pangocairo
#Criando a Classe do Programa
class InverterApp(object):
def __init__(self):
#Agora como eu havia dito vamos utilizar ... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from marionette_driver.by import By
from marionette_driver.keys import Keys
from marionette_driver.marionette import Act... |
# coding: utf-8
# Copyright (c) 2015, thumbor-community
# Use of this source code is governed by the MIT license that can be
# found in the LICENSE file.
import calendar
from json import loads, dumps
from os.path import join, splitext
from datetime import datetime, timedelta
from dateutil.tz import tzutc
from torna... |
#!/usr/local/env python3
"""
Simple linear regression with gradient descent. No optimization attempts have
been made, this is purely for example and educational purposes.
Data is randomly generated and saved to a file in the current directory for
reproduceability. To regenerate the data, simply delete the
'linear_regr... |
#!flask/bin/python
########################################################################
# Table Definitions
########################################################################
Accounts = {
'customer_id': "INTEGER NOT NULL", # integer
# 'customer_name': "TEXT NOT NULL", # string
'acc... |
"""
12 Jan 2016
This script uses MAF alignment files to convert genomic coordinates of one
species to another species.
As borders from one chromosome in one species might be distribute along several
chromosome in an other species, this script needs to be used over whole genomes.
"""
import sys, re, os
from os ... |
import subprocess
import sys
from pyramid.scaffolds import PyramidTemplate
class LocmakoTemplate(PyramidTemplate):
_template_dir = 'pyramid_locmako'
summary = 'pyramid project with Mako and Localization'
def post(self, command, output_dir, vars):
print "=== POST", command, output_dir, vars
... |
# -*- coding: utf-8 -*-
import os
import logging
from datetime import datetime
from collections import namedtuple
from werkzeug.exceptions import NotFound, BadRequest
from flask import Flask, render_template
from converter import init_converter
from model import init_db, get_article, get_spiders
from api import ini... |
import datetime
import unittest
import pytest
import ibis
import ibis.expr.api as api
import ibis.expr.operations as ops
from ibis.backends.base.sql.compiler import Compiler, QueryContext
from ibis.tests.expr.mocks import MockConnection
pytest.importorskip('sqlalchemy')
class TestASTBuilder(unittest.TestCase):
... |
# encoding: utf-8
from HTMLParser import HTMLParser
import time
import urllib2
import requests
import json
import yaml
from lxml import etree
class MLStripper(HTMLParser):
def __init__(self):
self.reset()
self.fed = []
def handle_data(self, d):
self.fed.append(d)
def get_data(self... |
"""Provides device conditions for lights."""
from typing import Dict, List
import voluptuous as vol
from homeassistant.components.device_automation import toggle_entity
from homeassistant.const import CONF_DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers.condition import ConditionChecker... |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, msgprint
from frappe.utils import flt
from frappe.utils import formatdate
import time
from erpnext.accounts.utils... |
#!/usr/bin/env python
# FIXME: pass default key through uzbl?
# FIXME: save checkbox?
import gtk
import os
import re
import sys
import yaml
from argparse import ArgumentParser
from gnupg import GPG
from xdg.BaseDirectory import xdg_data_home
default_recipients = ['0xCB8FE39384C1D3F4']
gpg = GPG()
uzbl_site_data_dir ... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
QFieldSyncDialog
A QGIS plugin
Sync your projects to QField on android
-------------------
begin : 2015-05-20
git sha ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2014 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of CKAN Store Publisher Extension.
# CKAN Store Publisher Extension is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License as published by
# t... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013, Nachi Ueno, NTT I3, 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... |
import logging
from functools import reduce
import nanoget.utils as ut
import pandas as pd
import sys
import pysam
import re
from Bio import SeqIO
import concurrent.futures as cfutures
from itertools import repeat
def process_summary(summaryfile, **kwargs):
"""Extracting information from an albacore summary file.... |
class ViewFields(object):
"""
Used to dynamically create a field dictionary used with the
RunstatView class
"""
def __init__(self):
self._fields = dict()
def _prockvargs(self, field, name, **kvargs):
if not len(kvargs):
return
field[name].update(kvargs)
... |
# -*- encoding: utf-8 -*-
"""
This file is part of the wpm software.
Copyright 2017, 2018 Christian Stigen Larsen
Distributed under the GNU Affero General Public License (AGPL) v3 or later. See
the file LICENSE.txt for the full license text. This software makes use of open
source software.
The quotes database is *no... |
import csv
import re
from beer_search_v2.models import Product, ContainerType, ProductType
from beer_search_v2.utils import get_alcohol_category_instance
from django.core.exceptions import ObjectDoesNotExist
from django.core.management.base import BaseCommand
from datetime import date
class Command(BaseCommand):
... |
from copy import copy
from string import whitespace
from reportlab.pdfbase.pdfmetrics import stringWidth, getFont, getAscentDescent
from .style import TextAlign, default as default_style, VerticalAlign
__all__ = ('Box', 'Block', 'Inline', 'ListItem')
def flatten(sub):
for line in sub:
if isinstance(line,... |
"""iguana URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/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-base... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11b1 on 2017-09-23 23:21
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import users.models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0008_alter_use... |
from zhtools.transliteration import Transliteration
import unittest
class TestTransliteration(unittest.TestCase):
def test_split_syllables(self):
self.assertEqual(Transliteration("wo3bu4zhi1dao4").text,
["wo3", "bu4", "zhi1", "dao4"])
self.assertEqual(Transliteration("zhe... |
#!/usr/bin/env python3
"""Python binding of Lora wrapper of LetMeCreate library."""
import ctypes
LORA_CLICK_AUTO_FREQ_BAND_250KHZ = 0
LORA_CLICK_AUTO_FREQ_BAND_125KHZ = 1
LORA_CLICK_AUTO_FREQ_BAND_62_5KHZ = 2
LORA_CLICK_AUTO_FREQ_BAND_31_3KHZ = 3
LORA_CLICK_AUTO_FREQ_BAND_15_6KHZ = 4
LORA_CLICK_AUTO_FREQ_BAND_7_8KHZ... |
# -*- coding: utf-8 -*-
import pytest
from cfme import test_requirements
from cfme.cloud.provider import CloudProvider
from cfme.common.provider import BaseProvider
from cfme.infrastructure.provider.rhevm import RHEVMProvider
from cfme.infrastructure.provider.scvmm import SCVMMProvider
from cfme.utils.appliance.implem... |
# based on python script from
# http://diyhpl.us/reprap/trunk/users/wizard23/python/lookupTables/KTY84-130.py
#
# adapted by Stemer114 for usage with 4.7k pull-up resistor
# table format for repetier firmware
# https://github.com/Stemer114/Reprap_KTY-84-130
#
# generates a Lookuptable for the following termistor
# KT... |
#
# p.haul connection module contain logic needed to establish connection
# between p.haul and p.haul-service.
#
import logging
import socket
import util
class connection(object):
"""p.haul connection
Class encapsulate connections reqired for p.haul work, including rpc socket
(socket for RPC calls), memory socke... |
"""
Authenticator
original from the JupyterHub repository
https://github.com/jupyter/nbgrader/blob/master/nbgrader/auth/hubauth.py
"""
import json
import requests
from requests.exceptions import ReadTimeout
from tornado.web import HTTPError
from tornado.web import RequestHandler
from . import util
# Backfills fo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'marcel'
import threading
import os
import select
import time
import atexit
class CheckLight(threading.Thread):
def __init__(self, light_on_method, light_off_method, pin=24, waiting_time=0.5):
threading.Thread.__init__(self)
self.pin_number = pin
... |
"""a directed graph example."""
from sqlalchemy import MetaData, Table, Column, Integer, ForeignKey
from sqlalchemy.orm import mapper, relation, create_session
import logging
logging.basicConfig()
logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO)
meta = MetaData('sqlite://')
nodes = Table('nodes', meta,... |
from direct.directnotify import DirectNotifyGlobal
from direct.showbase import DirectObject
from pandac.PandaModules import *
import random
from toontown.hood import ZoneUtil
from toontown.toonbase import ToontownGlobals
class HoodMgr(DirectObject.DirectObject):
notify = DirectNotifyGlobal.directNotify.newCatego... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.