src stringlengths 721 1.04M |
|---|
#1
#v 0.001
#I don't have a TOC here yet as everything constantly changes
import COMMON #file vars and functions for import/export processing
import VIEWER #mainly for the toggles
from VIEWER import __GL,__GLU #GL functions
from VIEWER import __pyg
'''
from COMMON import Scripts
#Shapes (private)
#Widgets (privat... |
# Purpose:
# Use the GUI, WASD or the arrow keys to control the robots movement.
# Reason for updated version:
# Reason for an updated version is that using the setWidgetProperties, I would be able to eliminate a lot of repeated
# code and be able to set everything easily through one function therefore saving ti... |
import collections
import random
"""
There’s an airplane with 100 seats, and there are 100 ticketed passengers each
with an assigned seat. They line up to board in some random order. However, the
first person to board is the worst person alive, and just sits in a random
seat, without even looking at his boarding pass... |
# -*- coding: utf-8 -*-
from typing import Any
import mock
import json
from requests.models import Response
from zerver.lib.outgoing_webhook import GenericOutgoingWebhookService, \
SlackOutgoingWebhookService
from zerver.lib.test_classes import ZulipTestCase
from zerver.models import Service
class TestGenericOut... |
"""
Notes regarding the implementation of smallest_palindrome and
largest_palindrome:
Both functions must take two keyword arguments:
max_factor -- int
min_factor -- int, default 0
Their return value must be a tuple (value, factors) where value is the
palindrome itself, and factors is an iterable containing b... |
#------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------------------------------... |
# pylint: disable-msg=W0622
#
# Copyright 2008 German Aerospace Center (DLR)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
# encoding: utf-8
"""
Class for reading/writing data from micromed (.trc).
Inspired by the Matlab code for EEGLAB from Rami K. Niazy.
Supported : Read
Author: sgarcia
"""
from .baseio import BaseIO
from ..core import *
from .tools import create_many_to_one_relationship
import numpy as np
import quantities as pq
... |
import subprocess
from numpy import *
from scipy import *
import wave
import scipy.io.wavfile
import scipy.signal
import random
import pylab
import pdb
'''By Ruofeng Chen, April 2013'''
voices = ["Albert", "Bad News", "Bahh", "Bells", "Boing", "Bubbles", "Cellos", "Deranged", "Good News", "Hysterical", "Pipe Organ", ... |
import gtk
from widgets.settings_page import SettingsPage
class Column:
TITLE = 0
COMMAND = 1
class CommandsOptions(SettingsPage):
"""Commands options extension class"""
def __init__(self, parent, application):
SettingsPage.__init__(self, parent, application, 'commands', _('Commands'))
... |
import numpy
import asc
class TimeSeries(numpy.ndarray):
r"""
Class for representing time series. It has fields for representing both
time series data and time axis, as well as methods for basic manipulation
on time series. Inherits from numpy.ndarray and can be created from
virtually anything th... |
#!/usr/bin/env python
# copy pasta from https://github.com/matthiasplappert/keras-rl/blob/master/examples/dqn_cartpole.py
# with some extra arg parsing
import numpy as np
import gym
from keras.models import Sequential
from keras.layers import Dense, Activation, Flatten
from keras.optimizers import Adam
from rl.agen... |
# -*- coding: utf-8 -*-
"""test basic cmds"""
import socket
from .shell_test_case import PYTHON3, ShellTestCase
from kazoo.testing.harness import get_global_cluster
from nose import SkipTest
# pylint: disable=R0904
class BasicCmdsTestCase(ShellTestCase):
""" basic test cases """
def test_create_ls(self):... |
# manage.py
import os
import unittest
import coverage
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
COV = coverage.coverage(
branch=True,
include='project/*',
omit=[
'project/tests/*',
'project/server/config.py',
'project/server/*/__init__.py'... |
"""A _predicate_ is any callable object that optionally accepts a context as its first positional parameter.
One might look like:
```python
def always(context=None):
return True
```
That's it, really. The provided built-in ones are class-based, but the process is the same even if the method has a
strange name like ... |
#!/usr/bin/env python
from __future__ import print_function
import psycopg2 as pg
from multiprocessing import Process
from random import randint
from time import sleep
import loremipsum
# How often statistics is printed (in seconds)
UPDATE_PERIOD = 0.1
def get_row_count(cur):
cur.execute('select count(*) from... |
###############################################################################
# #
# 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 ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Loic Lambiel ©
# License MIT
import sys
import argparse
import logging
import logging.handlers
import time
import socket
try:
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
except ImportError:
print ("It look like l... |
#!/usr/bin/env python3
try:
# Python 3
import tkinter as tk
from tkinter import ttk
from tkinter import filedialog
except ImportError:
# Python 2
import Tkinter as tk
import ttk
import tkFileDialog as filedialog
import os
class Dialog(tk.Toplevel):
def __init__(self, parent, tit... |
import json
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.http import HttpResponse, HttpResponseBadRequest
from django.shortcuts import redirect, render
from louderdev.decorators import ajax_required
from louderdev.messenger.models import Message
@... |
# Project Euler - Problem 46
# --------------------------
# What is the smallest odd composite that cannot be written as the sum of a prime and twice a square?
from myMath import isPrime
from time import time
# Find primes up to a certain number and output a list of them
def primes(top):
seive = range(2, top+1)
for... |
import os
import yaml
from ccmlib import common, repository
from ccmlib.cluster import Cluster
from ccmlib.dse_cluster import DseCluster
from ccmlib.node import Node
class ClusterFactory():
@staticmethod
def load(path, name):
cluster_path = os.path.join(path, name)
filename = os.path.join(c... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 - 2012, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
... |
import idaapi
import idc
import sark
def message(*messages):
for msg in messages:
for line in msg.splitlines():
idaapi.msg("[Autostruct] {}\n".format(line))
class AutoStruct(idaapi.plugin_t):
flags = idaapi.PLUGIN_PROC
comment = "AutoStruct struct creator"
help = "Automagically ... |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
# Copyright (C) 2011 Tim G L Lyons
#
# 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; eith... |
"""Settings are derived by compiling any files ending in .py in the settings
directory, in alphabetical order.
This results in the following concept:
- default settings are in 10-public.py (this should contain most settings)
- custom settings are in 05-private.py (an example of this file is here for
you)
- any o... |
"""
This is a very thin wrapper for faker. You can access all of faker's usual
methods via FakerLibrary calls in Robot Framework.
"""
# pylint: disable=no-value-for-parameter,unused-argument,useless-object-inheritance
import ast
import faker.factory
import faker.generator
import wrapt
def _str_to_data(string):
... |
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import numpy as np
import cv2
import glob
from skimage.feature import hog
from skimage import color, exposure
import random
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.svm im... |
"""Support for Tado sensors for each zone."""
import logging
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_BATTERY,
DEVICE_CLASS_CONNECTIVITY,
DEVICE_CLASS_POWER,
DEVICE_CLASS_WINDOW,
BinarySensorEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.c... |
import os,shutil
from glob import iglob
import matplotlib.pyplot as plt
from chxanalys.chx_libs import (np, roi, time, datetime, os, getpass, db,
get_images,LogNorm, RUN_GUI)
from chxanalys.chx_generic_functions import (create_time_slice,get_detector, get_fields, get_sid_filenam... |
# coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.gi... |
# -*- Python -*-
# -*- coding: utf-8 -*-
'''rtsprofile
Copyright (C) 2009-2015
Geoffrey Biggs
RT-Synthesis Research Group
Intelligent Systems Research Institute,
National Institute of Advanced Industrial Science and Technology (AIST),
Japan
All rights reserved.
Licensed under the GNU Lesser Ge... |
# -*- coding: utf-8 -*-
import os
import codecs
class Personal:
point_id = ''
user_name = ''
user_pronoun = ''
sex = ''
phone = ''
email = ''
address = ''
class Cloth:
cloth_name = ''
color_code = ''
small_type = ''
price = ''
image_url = ''
big_type = ''
cloth... |
#!/usr/bin/python2.7
import httplib as ht
import json
import client_path
import squeakspace.client.client as cl
import squeakspace.common.util as ut
import client_types as tp
import test_params
conn = ht.HTTPConnection(test_params.server_address, test_params.server_port)
client = cl.Client(conn, test_params.node_n... |
import pytest
import numpy
from numpy.testing import assert_allclose
from thinc.types import Ragged, Pairs
@pytest.fixture
def ragged():
data = numpy.zeros((20, 4), dtype="f")
lengths = numpy.array([4, 2, 8, 1, 4], dtype="i")
data[0] = 0
data[1] = 1
data[2] = 2
data[3] = 3
data[4] = 4
... |
""" gfs2sms logging and statistics module.
Part of the package of gfs2sms tools.
Contains:
initialiseLogging() function.
Custom logging handlers, filters and formatters.
Depends:
"""
from __future__ import unicode_literals
import json
import logging
import config as gfs2smsConfig
def initialiseLogging ... |
"""
MySQL database backend for Django.
Requires mysqlclient: https://pypi.org/project/mysqlclient/
"""
from django.core.exceptions import ImproperlyConfigured
from django.db import IntegrityError
from django.db.backends import utils as backend_utils
from django.db.backends.base.base import BaseDatabaseWrapper
from dja... |
'''
Copyright (C) 2013 Rasmus Eneman <rasmus@eneman.eu>
This program 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 later version.
This program is... |
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful
# but... |
class Solution:
def numDecodings(self, s: str) -> int:
MOD = 1000000007
dp = [0] * (1 + len(s))
dp[0] = 1
for i in range(1, len(dp)):
if s[i - 1] == '*':
dp[i] = dp[i - 1]*9 % MOD
elif s[i - 1] != '0':
dp[i] = dp[i - 1]
... |
"""
Copyright 2006-2009, Red Hat, Inc and Others
Michael DeHaan <michael.dehaan AT gmail>
This software may be freely redistributed under the terms of the GNU
general public license.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundatio... |
"""amend biobank orders
Revision ID: 0e92151ebd4a
Revises: 075b9eee88b7
Create Date: 2018-08-15 11:43:57.043915
"""
import model.utils
import sqlalchemy as sa
from alembic import op
from rdr_service.participant_enums import BiobankOrderStatus
# revision identifiers, used by Alembic.
revision = "0e92151ebd4a"
down_r... |
# Copyright 2011 Red Hat, 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; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the ... |
# Copyright (c) 2018 PaddlePaddle 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 app... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... |
from cfme.utils.log import logger
def _remove_page(roles, group, pages):
if group in roles:
for page in pages:
if page in roles[group]:
roles[group].remove(page)
else:
logger.info("Page %s attempted to be removed from role %s, "
... |
# -*- coding: utf-8 -*-
from .base import DoubanAPIBase, DoubanAPIBase_v1, DEFAULT_START, DEFAULT_COUNT
class User(DoubanAPIBase):
def __repr__(self):
return '<DoubanAPI User>'
def get(self, id):
return self._get('/v2/user/%s' % id)
@property
def me(self):
return self.get('... |
# -*- coding: utf-8 -*-
from direct.showbase.DirectObject import DirectObject
from direct.fsm.FSM import FSM
from direct.gui.OnscreenText import OnscreenText
from direct.gui.DirectGui import DirectFrame, DGG
from direct.stdpy.file import *
from direct.actor.Actor import Actor
from panda3d.core import Point3, TextNode,... |
# This file contains a lexer HTK model files in ASCII format.
#
# @author W.J. Maaskant
from ply import *
# Exception class.
class HtkScanningError(Exception):
pass
# List of token names.
tags = (
'BEGINHMM',
'ENDHMM',
'MEAN',
'MIXTURE',
'NUMMIXES',
'NUMSTATES',
'STATE',
'TRANSP',
'VARIANCE',
'OTHER_TAG... |
import OpenPNM
import scipy as sp
print('-----> Using OpenPNM version: '+OpenPNM.__version__)
pn = OpenPNM.Network.Cubic(shape=[10,10,40],spacing=0.0001)
pn.add_boundaries()
Ps = pn.pores('boundary',mode='not')
Ts = pn.find_neighbor_throats(pores=Ps,mode='intersection',flatten=True)
geom = OpenPNM.Geometry.Toray090(ne... |
"""
migrate task to deploy
Revision ID: 106230ad9e69
Revises: 16c1b29dc47c
Create Date: 2016-02-17 00:43:21.608658
"""
# revision identifiers, used by Alembic.
revision = "106230ad9e69"
down_revision = "16c1b29dc47c"
from alembic import op
import sqlalchemy as sa
MIGRATE_TASK_TO_DEPLOY = """
INSERT INTO deploy (ta... |
from __future__ import unicode_literals
import datetime
import django
from django.utils.timezone import now
from django.test import TestCase
from job.messages.unpublish_jobs import UnpublishJobs
from job.models import Job
from job.test import utils as job_test_utils
from product.models import ProductFile
from produc... |
from collections import Counter
import numpy as np
def getKmers(string,kV):
return [ string[i:i+kV] for i in range(0,len(string)-kV+1)]
def getCounters(seqs,kmer,goodIdx):
working = seqs[goodIdx]
# transform the dna into their kmers. Use a counter structure,
# which is much faster. it stored the uniq... |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2014 CERN.
##
## Invenio 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) a... |
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.showbase.PythonUtil import lineInfo, Functor
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObject
from otp.level import Level
from otp.level import LevelConstants
from otp.level impo... |
# -*- coding: utf8 -*-
# Run ipython -i dummy.py if you don't want to run it on Raspberry Pi
from pymodbus.server.async import StartTcpServer
from pymodbus.datastore import ModbusSequentialDataBlock
from pymodbus.datastore import ModbusSlaveContext, ModbusServerContext
from identity import identity
import logging
log... |
import os
import uuid
from django.utils import timezone
from django.db import models
def image_path_post(self, filename):
today = timezone.now()
path = "{0}/{1}/{2}/".format(today.year, today.month, today.day)
ext = filename.split('.')[-1]
my_filename = "{0}.{1}".format(str(uuid.uuid1()).replace('-', ... |
#Consider a city where the streets are perfectly laid out to form an infinite square grid.
#In this city finding the shortest path between two given points (an origin and a destination) is much easier than in other more complex cities.
#As a new Uber developer, you are tasked to create an algorithm that does this calc... |
# -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# 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.
#
# ... |
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from sqlalchemy.ext.declarative import declared_attr
from indico... |
import re
import os
import django
from django.conf import settings
from rosetta.conf import settings as rosetta_settings
from django.core.cache import cache
from django.utils.importlib import import_module
import itertools
def find_pos(lang, project_apps=True, django_apps=False, third_party_apps=False):
"""
sc... |
# -*- coding: UTF-8 -*-
# Copyright 2013-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""
The :xfile:`models` module for the :mod:`lino_welfare.modlib.integ` app.
"""
from __future__ import unicode_literals
from builtins import str
import logging
logger = logging.getLogger(__name__)
import date... |
"""Tests for the correct reading of the queue config."""
from copy import deepcopy
from amqpeek.cli import build_queue_data
class TestFormatQueues:
"""Tests parsing of queue config."""
def test_dedup_queue_config(self, config_data: dict) -> None:
"""Tests handling of duplicate config entries in diff... |
from pathlib import Path
from multiprocessing import Pool, freeze_support
import os
import datetime
import clang.cindex
import subprocess
from paths import path_to_components, path_to_gameobjects, path_to_cmake, path_to_src
args = ["-xc++",
"-D__CODE_GENERATOR__",
"-std=c++17",
"-IC:/Projects/D... |
from tempfile import NamedTemporaryFile
from unittest import TestCase
from peloton_bloomfilters import BloomFilter, ThreadSafeBloomFilter, SharedMemoryBloomFilter
class Case(object):
def test(self):
self.assert_p_error(0.2, 1340)
self.assert_p_error(0.15, 870)
self.assert_p_error(0.1, 6... |
# -*- coding: utf-8 -*-
# Krzysztof Joachimiak 2017
# sciquence: Time series & sequences in Python
#
# Symbolic Aggregate Approximation
# Author: Krzysztof Joachimiak
#
# License: MIT
import numpy as np
import scipy.stats
from sklearn.preprocessing import scale, StandardScaler
from paa import paa
from operator import... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Nicira Networks, 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.apach... |
#!/usr/bin/env python
import sys
import os
import traceback
import time
import gc
import hashlib
#gc.disable()
sys.path.insert(0, '../../PyPDF2/')
import PyPDF2
import find_pdfrw
import pdfrw
from PyPDF2 import PdfFileReader, PdfFileWriter
import find_pdfrw
from pdfrw import PdfReader, PdfWriter, PdfParseError
... |
import inform
import movement
command_list = {
'look':"1",
'score':"1",
'move':"1",
'sit':"1",
'stand':"1",
'sleep':"1",
'wake':"1",
}
alias_list = {
'l':'look',
'sc':'score',
'n':'move n',
's':'move s',
'e':'move e',
'w':'move w',
'sl':'sleep',
'wa':'wake',
}
function_list = { 'look': inform.c_look,... |
from collections import Iterable
import os
from os import path
import shutil
import logging
from __init__ import __version__
log = logging.getLogger(__name__)
def flatten(seq):
"""
Poached from http://stackoverflow.com/questions/2158395/flatten-an-irregular-list-of-lists-in-python
Don't flatten strings ... |
# Copyright 2002-2011 Nick Mathewson. See LICENSE for licensing information.
"""mixminion.testSupport
Shared support code for unit tests, benchmark tests, and integration tests.
"""
import base64
import cStringIO
import os
import stat
import sys
import mixminion.Crypto
import mixminion.Common
from mixminion.... |
# base_resource_estimator.py
#
# Copyright (C) 2016
# ASTRON (Netherlands Institute for Radio Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it
# and/or modify it under the terms of the GNU G... |
import sys
import json
import random
import os
import sqlite3
items = []
for line in sys.stdin:
sent = json.loads(line)
items.append((sent['id'], sent['sentence']))
random.seed(1)
random.shuffle(items)
random.shuffle(items)
random.shuffle(items)
random.shuffle(items)
conn = sqlite3.connect('working/annotatio... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
#!/Users/michelkrohn-dale/Desktop/ecommerce-2/bin/python
#
# The Python Imaging Library
# $Id$
#
from __future__ import print_function
try:
from tkinter import *
except ImportError:
from Tkinter import *
from PIL import Image, ImageTk
import sys
# -----------------------------------------------------------... |
from py2neo import Graph
graph = Graph("http://neo4j:1234@localhost:7474/db/data/")
# Insert data
insert_query = '''
UNWIND {pairs} as pair
MERGE (p1:Person {name:pair[0]})
MERGE (p2:Person {name:pair[1]})
MERGE (p1)-[:KNOWS]-(p2);
'''
data = [["Jim", "Mike"], ["Jim", "Billy"], ["Anna", "Jim"],
["Anna", "Mik... |
#encoding=utf-8
from __future__ import absolute_import
from celery import shared_task
# from celery.task import task
from btcproject import celery_app
from btc.lib.okcoin import *
from btc.lib.btceapi import *
from btc.lib.bitfinex import *
from btc.lib.huobi import *
from btc.lib.btcchina import *
fr... |
# Copyright 2017 Eayun, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... |
#!/usr/bin/python
"""
snnm
~~~~
This module contains the source code for `snnm`
Snnm is an utility tool created to fetch synonyms for a given expression from
the web and print them to the console.
"""
import bs4
import click
import requests
BASE_URL = 'http://www.thesaurus.com/browse/'
def _fetch_html(expression):... |
# Copyright Tom SF Haines, Reinier de Blois
#
# 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 t... |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2007 Donald N. Allingham
# Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2008 Jerome Rapinat
# Copyright (C) 2008 Benny Malengier
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the ... |
# Copyright (c) 2014, 2015, 2016, 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information.
#
# null - The irNull singleton and IRNullType
#
# vim:set ts=8 shiftwidth=8 softtabstop=8 noexpandtab :
import sys
__all__ = ('IR_NULL_STR', 'IR_NULL_BYTES', 'IR_NULL_UNICODE', 'IR_NULL_STRINGS', 'IRNul... |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
from django import forms
class ApplicationMultiplexerTitleForm(forms.Form):
content = forms.CharField(
label="Menu title",
max_length=100
)
class ApplicationMultiplexerForm(forms.Form):
application_label = forms.CharField(
label="Application label"
)
endpoint_name = forms... |
from time import time
import datetime
import numpy as np
import matplotlib.pyplot as plt
from malpi.cnn import *
from malpi.data_utils import get_CIFAR10_data
from malpi.solver import Solver
from optparse import OptionParser
from malpi.fast_layers import *
def plot_solver(solver):
plt.subplot(2, 1, 1)
plt.plot... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mlagents_envs/communicator_objects/agent_info.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from googl... |
# Copyright (c) 2020 Santosh Philip
# =======================================================================
# Distributed under the MIT License.
# (See accompanying file LICENSE or copy at
# http://opensource.org/licenses/MIT)
# =======================================================================
# -*- coding: ... |
#!/usr/bin/env python
class BaseFormat(object):
"""
Base format class.
Supported formats are: ogg, avi, mkv, webm, flv, mov, mp4, mpeg
"""
format_name = None
ffmpeg_format_name = None
def parse_options(self, opt):
if 'format' not in opt or opt.get('format') != self.format_name:
... |
#!/usr/bin/python
#This file is part of DNApy. DNApy is a DNA editor written purely in python.
#The program is intended to be an intuitive, fully featured,
#extendable, editor for molecular and synthetic biology.
#Enjoy!
#
#Copyright (C) 2014 Martin Engqvist |
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... |
"""
Update product images from Magento -> OpenERP
"""
import xmlrpclib
import optparse
from config import *
from magento import *
from ooop import OOOP
def main():
url = 'http' + (secure and 's' or '') + '://' + server
o = OOOP(user=username,pwd=password,dbname=dbname,uri=url,port=port)
url = 'http' + ... |
# coding=utf-8
def auth():
"""
@apiDefine AuthHeader
@apiHeaderExample Auth-Header-Example
{
"Authorization": "token 5b42e18555c11dbf2c31403ea6b706a6"
}
@apiHeader {string} Authorization 验证身份,格式为"token <token>",注意"token"后面需要一个空格, 请联系我们取得测试token.
... |
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import json
import types
from django.contrib.contenttypes.models import ContentType
from django.shortcuts import get_object_or_404
from django.http import Http404
from mptt.exceptions import InvalidMove
from ... |
# OpenLocalMap OpenSource web mapping for local government
# Copyright (C) <2014> <Ben Calnan>
#
# 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, ... |
from ..controller import ControllerBlock,RobotControllerIO
from klampt.model import trajectory
class TrajectoryPositionController(ControllerBlock):
"""A (robot) controller that takes in a trajectory and outputs the position
along the trajectory. If type is a 2-tuple, this will also output the
derivative ... |
#!/usr/bin/env python3
##ON APP MACHINE
import sys
from os import listdir, mkdir
from os.path import isdir, dirname, abspath
import os
import subprocess
import weakref
from scipy import fftpack
import numpy as np
## some global variables, this needs to be fixed at some point
default_raw_data_loc = None#"/exp_app... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
###
# Copyright (2016-2020) Hewlett Packard Enterprise Development LP
#
# 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/licen... |
from date_conventions import *
class OvernightIndexSwap:
''' We define the product by its:
- startDate
- endDate
- floatingLegNominal: the nominal used to compute the flows of the floating leg:
if positive the flows are received, negative paid
- fixedLegDates: the union of the start and end d... |
# -*- coding: utf-8 -*-
from __future__ import division
import copy
import functools
import logging
import math
import re
import unicodedata
from framework import sentry
import six
from django.apps import apps
from django.core.paginator import Paginator
from elasticsearch import (ConnectionError, Elasticsearch, No... |
import email
from django.core.exceptions import PermissionDenied
from django.template import Context
from django.db import transaction
from django_mailbox.models import Message
import html2text
from vertex.celery import app
import vertex.rules
from service.models import Ticket, TicketSubscriber, Update, EmailTemplate
... |
#!/usr/bin/env python
"""
================================================
ABElectronics IO Pi Tests | __init__
Requires python smbus to be installed
For Python 2 install with: sudo apt-get install python-smbus
For Python 3 install with: sudo apt-get install python3-smbus
run with: python3 IOPi_init.py
=============... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.