src stringlengths 721 1.04M |
|---|
"""
Play DVS events in real time
TODO: deal with looping event times for recordings > 65 s
"""
import numpy as np
import matplotlib.pyplot as plt
import dvs
def close(a, b, atol=1e-8, rtol=1e-5):
return np.abs(a - b) < atol + rtol * b
def imshow(image, ax=None):
ax = plt.gca() if ax is None else ax
ax.i... |
import pytest
from pocs.focuser.simulator import Focuser as SimFocuser
from pocs.focuser.birger import Focuser as BirgerFocuser
from pocs.camera.simulator import Camera
from pocs.utils.config import load_config
params = [SimFocuser, BirgerFocuser]
ids = ['simulator', 'birger']
# Ugly hack to access id inside fixtur... |
#
# Copyright (C) 2006, 2013 Red Hat, Inc.
# Copyright (C) 2006 Daniel P. Berrange <berrange@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-26 07:54
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Articl... |
# Vatsal Shah
# ECE-C433 Mini-Project 2
# gmailPy - A terminal gmail client
# Tested on Python 2.7.3
# imapclient is not a part of the standard python library
# install using sudo pip install imapclient
import getpass
from imapclient import IMAPClient
import operator
import email
import optparse
import sys
class gma... |
#!/usr/bin/env python
"""
killMS, a package for calibration in radio interferometry.
Copyright (C) 2013-2017 Cyril Tasse, l'Observatoire de Paris,
SKA South Africa, Rhodes University
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published ... |
import logging
import os
import urlparse
logger = logging.getLogger(__name__)
def updatetree(source, dest, overwrite=False):
parsed_url = urlparse.urlparse(dest)
logger.debug(parsed_url)
if parsed_url.scheme == '':
import shutil
if overwrite and os.path.exists(parsed_url.path):
logger.debug("Delet... |
#!/usr/bin/python
# coding: utf-8
# Perver - tiny Python 3 server for perverts.
# Check README and LICENSE for details.
from sys import platform as os_platform
from hashlib import sha1 as hash_id
from urllib.parse import unquote
from mimetypes import guess_type
from traceback import format_exc
from functools import wra... |
from typing import List
import random
import sys
import curses
from collections import defaultdict
from message_box import MessageBox
from materials import Lava, Dirt, Space, Water, Fire
from utils import Utils
from items import Treasure
from creatures import Miner, Saboteur, DwarfKing
from stats import Stats
class M... |
'''
my.oledhat.interface
This library contains the high-level functions for drawing on the MyOled class (the means of publishing
new images onto the NanoHat OLED device).
Key functions:-
prompt_for_keyboard_text display keyboard; let user enter a phrase; return the phrase
choose_from_list ... |
import tempfile
import urllib.request
import pandas as pd
import os
import tensorflow as tf
# DATA LABELS
LABEL_COLUMN = "label"
CATEGORICAL_COLUMNS = ["workclass", "education", "marital_status", "occupation",
"relationship", "race", "gender", "native_country"]
CONTINUOUS_COLUMNS = ["age", "edu... |
# Copyright (c) 2016 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 require... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import xlrd
import xlwt
import datetime
import openpyxl
def request():
sheet = xlrd.open_workbook(os.path.join('E:/数据分析/20180819', '丽水市活动保障工单结果.xlsx')).sheet_by_index(0)
nRow = sheet.nrows
nCol = sheet.ncols
title = []
rowDatas = {}
... |
def f(m,n):
'''return the number of rectangles that a m x n contains'''
s=0
for a in range(1,m+1):
for b in range(1,n+1):
s+= (m-a+1)*(n-b+1)
return s
print f(1,1),f(2,4), f(3,3)
def g(m,n):
''' the same as f(m,n) except g(m,n) is calculated recursively'''
if m==0:
return 0
elif m == 1 :
return n * ... |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation t... |
from __future__ import print_function
import IMP
import IMP.core
import IMP.test
import IMP.algebra
import IMP.atom
import IMP.container
import IMP.pmi.tools as tools
import IMP.pmi.samplers as samplers
class XTransRestraint(IMP.Restraint):
def __init__(self, m):
IMP.Restraint.__init__(self, m, "XTransR... |
##
# Copyright 2009-2016 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# Flemish Research Foundation ... |
import logging
from celery.schedules import crontab
from django.apps import apps
from django.conf import settings
from django.utils.timezone import now
from factotum.celery import app
logger = logging.getLogger("django")
@app.on_after_finalize.connect
def setup_periodic_tasks(sender, **kwargs):
sender.add_peri... |
'''
Created on Jul 5, 2011
@author: Leo Andres (user)
'''
from datetime import timedelta
import os
import re
import xml.parsers.expat
class TextXMLParser:
element_path = ''
element_dictionary = {}
current_element_data = {}
def __init__(self):
self.element_path = ''
se... |
from rest_framework import generics
from rest_framework.exceptions import PermissionDenied
from .models import PrivateThread, GroupThread
from .serializers import PrivateThreadListCreateSerializer, PrivateThreadRetrieveDestroySerializer
from .serializers import GroupThreadListCreateSerializer, GroupThreadRetrieveUpdat... |
"""Pipeline code to run alignments and prepare BAM files.
This works as part of the lane/flowcell process step of the pipeline.
"""
from collections import namedtuple
import glob
import os
import toolz as tz
from six import iteritems
from bcbio import bam, utils
from bcbio.ngsalign import (bowtie, bwa, tophat, bowti... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.db.models import deletion
from django.core.validators import MinValueValidator, MaxValueValidator
from django.conf import settings
from lucterios.framework.tools import set_locale_lang
from lucterios.C... |
""" decorators.py
"""
import contextlib
import functools
import six
import warnings
try:
from singledispatch import singledispatch
except ImportError: # pragma: no cover
from functools import singledispatch
from .errors import PGPError
__all__ = ['classproperty',
'sdmethod',
'sdprope... |
from flask import Flask
from .results import Results
from .slave import Reboot, Slave, ShutdownBuildslave, GetUptime, GetLastActivity
from .slave import Disable, AWSTerminateInstance
from .slaves import Slaves
app = Flask(__name__)
app.add_url_rule("/results", view_func=Results.as_view("results"), methods=["GET"])
a... |
'''
- login and get token
- process 2FA if 2FA is setup for this account
- Get list of child accounts for a parent user
'''
import requests
import json
get_token_url = "https://api.canopy.cloud:443/api/v1/sessions/"
validate_otp_url = "https://api.canopy.cloud:443/api/v1/sessions/otp/validate.json" #calling the pr... |
import socket
import struct
import random
import hashlib
import errno
from gi.repository import GLib
from gi.repository import GObject
from bencode import bencode, bdecode, bdecode_all
class Bitfield(object):
def __init__(self, size, data=None):
if size < 0:
raise ValueError('Bitfield size ... |
from lxml import etree
from mathml_to_string import MathML2String
s1 = '''<math xmlns="http://ntcir-math.nii.ac.jp/" xmlns:m="http://www.w3.org/1998/Math/MathML">
<m:mrow xml:id="m22.1.10.pmml" xref="m22.1.10">
<m:mo xml:id="m22.1.1.pmml" xref="m22.1.1">-</m:mo>
<m:mrow xml:id="m22.1.10.1.pmml" xre... |
from typing import Type, TypeVar, MutableMapping, Any, Iterable
from datapipelines import DataSource, DataSink, PipelineContext
from cassiopeia.dto.patch import PatchListDto
from .common import SimpleKVDiskService
T = TypeVar("T")
class PatchDiskService(SimpleKVDiskService):
@DataSource.dispatch
def get(s... |
# #
# Copyright 2015-2015 Ghent University
#
# This file is part of vsc-base,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... |
from __future__ import with_statement
import os
import sys
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
sys.path.append(os.getcwd())
from scuevals_api.models import db # noqa
# this is the Alembic Config object, which provides
# access to the valu... |
import pytest
import time
import threading
from memsql.common import sql_step_queue, database, exceptions
memsql_required = pytest.mark.skipif(
"os.environ.get('TRAVIS') == 'true'",
reason="requires MemSQL connection"
)
@pytest.fixture(scope="module")
def queue_setup(request, test_db_args, test_db_database):
... |
#! /usr/bin/env /usr/bin/python3
import os
import sys
def ensure_dir(f):
d = os.path.dirname(f)
if not os.path.exists(d):
os.makedirs(d)
def xmlSplit(infile_name, dest_dir):
try:
# in_file = open('{0}{1}'.format(folder, filename), 'r', encoding='latin_1')
in_file = open(infile_name, 'r', encoding='... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import torch.nn as nn
import torch.nn.functional as F
try:
from apex.normalization import FusedLayerNorm as _FusedLayerNorm... |
# -*- coding: utf-8 -*-
import json
import pandas as pd
import requests
from py2cytoscape.data.edge_view import EdgeView
from py2cytoscape.data.node_view import NodeView
from . import BASE_URL, HEADERS
from py2cytoscape.data.util_network import NetworkUtil
BASE_URL_NETWORK = BASE_URL + 'networks'
class CyNetworkVi... |
import time
import os
import math
# Global variables
gameComplete = "n"
numPlayersValid = "n"
playerNameList = []
numRounds = 10
scoringComplete = 'n'
currentRound = 1
playerScoreList = [0,0,0,0,0,0]
# Print Applications banner information
print('Welcome to the Skull King Calculator')
print('Version ... |
import pytest
from mock import Mock, patch, call
from .fixtures import engine_mock, config_mock, guards_engine_mock
@pytest.mark.usefixtures('engine_mock')
class TestHelperFunctions(object):
@patch('ramses.models.engine')
def test_get_existing_model_not_found(self, mock_eng):
from ramses import mode... |
# THIS FILE SHOULD STAY IN SYNC WITH /redis-monitor/settings.py
# This file houses all default settings for the Redis Monitor
# to override please use a custom localsettings.py file
import os
def str2bool(v):
return str(v).lower() in ('true', '1') if type(v) == str else bool(v)
# Redis host configuration
REDIS_HO... |
# Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms of t... |
__author__ = "Martin Blais <blais@furius.ca>"
from beancount import loader
from beancount.plugins import tag_pending
from beancount.utils import test_utils
class TestExampleTrackPending(test_utils.TestCase):
@test_utils.docfile
def test_tag_pending(self, filename):
"""
2013-01-01 open Expens... |
"""The ClimaCell integration."""
from __future__ import annotations
from datetime import timedelta
import logging
from math import ceil
from typing import Any
from pyclimacell import ClimaCellV3, ClimaCellV4
from pyclimacell.const import CURRENT, DAILY, FORECASTS, HOURLY, NOWCAST
from pyclimacell.exceptions import (
... |
#!/usr/bin/env python
import tempfile
import os
import shutil
import unittest
from io import BytesIO
from werkzeug.datastructures import MultiDict
import talky
class TalkyBaseTestCase(unittest.TestCase):
def setUp(self):
# Set up a dummy database
self.db_fd, talky.app.config['DATABASE_FILE'] = t... |
def label_modes(trip_list, silent=True):
"""Labels trip segments by likely mode of travel.
Labels are "chilling" if traveler is stationary, "walking" if slow,
"driving" if fast, and "bogus" if too fast to be real.
trip_list [list]: a list of dicts in JSON format.
silent [bool]: if True, does n... |
#!/usr/bin/env python3
# encoding: utf-8
from .configmanager import CONFIG_MANAGER
CONKYRC_TOP = """
-- This file gets automatically generated by build_conkyrc.py
conky.config = {
"""
CONKYRC_BOTTOM = """
total_run_times = 0,
alignment = 'top_right',
background = true,
own_window = true,
own_windo... |
# -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... |
import datetime
import click
import re
_multipliers = {
's': 1,
'm': 60,
'h': 3600,
}
_pattern = re.compile(
'(?:(?:(?P<h>\d+):)?(?P<m>\d+):)?(?P<s>\d+(?:\.\d+)?)'
)
def time_str_to_seconds(s):
"""
Convert a string representation of a time to number of seconds.
Args:
s (str): A ... |
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import os
mb_size = 32
X_dim = 784
z_dim = 10
h_dim = 128
mnist = input_data.read_data_sets('../../MNIST_data', one_hot=True)
def plot(samples... |
# 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... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Account',
fields=[
('id', models.AutoField(seri... |
from __future__ import print_function
import nifty
import numpy
import numpy
import vigra
import glob
import os
from functools import partial
nrag = nifty.graph.rag
ngala = nifty.graph.gala
ngraph = nifty.graph
G = nifty.graph.UndirectedGraph
def make_dataset(numberOfImages = 10, noise=1.0,shape=(100,100)):
nu... |
# -*- coding: utf-8 -*-
#
# Moonstone is platform for processing of medical images (DICOM).
# Copyright (C) 2009-2011 by Neppo Tecnologia da Informação LTDA
# and Aevum Softwares LTDA
#
# This file is part of Moonstone.
#
# Moonstone is free software: you can redistribute it and/or modify
# it under the terms of the GN... |
import cProfile
import pstats
import inspect
def profiler_run(command,
how_many_lines_to_print=10,
print_callers_of=None,
print_callees_of=None,
use_walltime=False):
'''
Run a string statement under profiler with nice defaults
command - s... |
#!/usr/bin/env python
# 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/.
# Copyright (c) 2014 Mozilla Corporation
#
# Contributors:
# Anthony Verez averez@mozilla.com
# Je... |
"""
The ```SMpacket`` module
========================
Provide easy utilisation of the stepmania protocol.
:Example:
>>> from smserver.smutils.smpacket import smcommand
>>> from smserver.smutils.smpacket import smpacket
>>> # Create a new packet instance
>>> packet = SMPacket.new(smcom... |
from django.db import models
class Reservation(models.Model):
start_time = models.DateTimeField()
end_time = models.DateTimeField()
customer = models.ForeignKey('Customer')
coach = models.ForeignKey('Coach')
product = models.ForeignKey('Product')
location = models.CharField(max_length=200)
... |
"""
Unittest setup
"""
import pathlib
from unittest import mock, TestCase
import boto3
from botocore import UNSIGNED
from botocore.client import Config
from botocore.stub import Stubber
import responses
import quilt3
from quilt3.util import CONFIG_PATH
class QuiltTestCase(TestCase):
"""
Base class for unitt... |
"""
AsyncFunctionDef astroid node
Subclass of FunctionDef astroid node. An async def function definition and used
for async astroid nodes like AsyncFor and AsyncWith.
Attributes:
- name (str)
- The function's name.
- args (Arguments)
- An arguments node. See Arguments.py for more... |
from zeit.content.article.i18n import MessageFactory as _
import zeit.cms.content.contentsource
import zeit.cms.content.interfaces
import zeit.cms.section.interfaces
import zeit.content.article.source
import zeit.content.cp.source
import zeit.content.image.interfaces
import zope.schema
ARTICLE_NS = 'http://namespaces.... |
#!/bin/env python3
import os
import string
import sys
import re
from pprint import pprint
class CheckException(Exception):
pass
CHECK_SIMPLE = ''
CHECK_NEXT = '-NEXT'
CHECK_SAME = '-SAME'
CHECK_NOT = '-NOT'
CHECK_BETWEEN = '-BETWEEN' # check without order
CHECK_LABEL = 'LABEL'
def _apply_check(c, m, varia... |
"""
In this example we solve a scalar *unfitted* PDE problem. As a
discretisation method we use a level set based geometry description and
a Cut (or Fictitious) Finite element method with a Nitsche formulation
to impose boundary conditions. For stability we add a ghost penalty
stabilization.
Domain:
-------
The domain... |
"""
@author: Antriksh Agarwal
Version 0: 04/29/2018
"""
import cv2
import numpy as np
from utils import *
import time
eyeCascade = cv2.CascadeClassifier('models/eyes.xml')
def detect_eyes(image):
image = cv2.resize(image, (0, 0), fx=4, fy=4)
# start = time.time()
eyes = eyeCascade.detectMulti... |
from django import forms
from django.core.exceptions import ValidationError
from portal.models import Student, Hobby
class SignUpForm(forms.ModelForm):
class Meta:
model = Student
fields = ['name', 'username', 'gender', 'course']
widgets = {
'name': forms.TextInput(attrs={'pla... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Addons modules by CLEARCORP S.A.
# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
#
# This program is free software: you can redistribute... |
from django.conf import settings
from mongoengine.django.auth import User
import requests
import json
class HeliosAuthBackend(object):
"""
Authenticate against the API.
"""
def authenticate(self, username=None, password=None):
payload = {'username': username, 'password': password}
ur... |
# -*- coding: utf-8 -*-
"""Pyplis high level test module.
This module contains some highlevel tests with the purpose to ensure
basic functionality of the most important features for emission-rate
analyses.
Note
----
The module is based on the dataset "testdata_minimal" which can be found
in the GitHub repo in the fol... |
from multiprocessing import Process, Queue
from multiprocessing.queues import Queue as QueueType
import serial
from serial.tools import list_ports
from cmd_list import CMD_LIST
import time
from packets import encode_packet, decode_packet
import logging
#<<<<<<< HEAD
#PORT_VID = 1155
#PORT_PID = 22336
#PORT_SNR = '367... |
from django.utils.translation import ugettext as _
from django.db import models, connection
from django.utils.text import capfirst
from itertools import chain
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
from django.utils.encoding import force_unicode, smart_unicode
fro... |
#
# Copyright 2020 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 th... |
import collections
import datetime
from copy import copy
from numpy import logspace, log10, where
from psutil import virtual_memory, cpu_percent, disk_partitions, disk_usage
from helpers import slack_helper
from helpers import utils
def mem_percents_logspaced(start_percent=None, end_percent=90, bins_count=30):
... |
##################### NPLB #####################
# No Promoter Left Behind (NPLB) is a tool to
# find the different promoter architectures within a set of promoter
# sequences. More information can be found in the README file.
# Copyright (C) 2015 Sneha Mitra and Leelavati Narlikar
# NPLB is free so... |
# 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.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
#!/usr/bin/env python
#=============================================================================
# Copyright 2016 by Shaheed Haque (srhaque@theiet.org)
# Copyright 2016 Stephen Kelly <steveire@gmail.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided th... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt, cint, nowdate, add_days, comma_and
from frappe import msgprint, _
from frappe.model.document import ... |
#!/usr/bin/python
#
# Copyright (C) 2011 by David Tomaschik <david@systemoverlord.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the... |
#
# 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 -*-
import re
from scrapy import Spider, Request
from dateutil import parser
from artbot_scraper.items import EventItem
from pytz import timezone
class ArthouseSpider(Spider):
name = 'Arthouse Gallery'
allowed_domains = ['www.arthousegal... |
"""
@summary: Common configuration functions supporting test execution.
Various startup and termination procedures, helper functions etc.
Not to be used for directly testing the system under test (must not contain Asserts etc.)
"""
import os
import re
from shishito.runtime.platform.shishito_control_test import Shishi... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# :coding=utf-8:
import os
import argparse
import django
from django.core.management import call_command
from waitress import serve
from homepage import __version__ as VERSION
from homepage.wsgi import application
def start(args):
"""
Starts the homepage application server.
"""
serve(application, ... |
from PySide.QtGui import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QLineEdit
from PySide import QtGui, QtCore
import Lifeline
class ClusterDialog(QDialog):
editClusterName = None
def __init__(self, lifeline, defaultName, parent = None):
super(ClusterDialog, self).__init__(parent)
s... |
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
config
~~~~~~
Provides app configuration settings
"""
from __future__ import (
absolute_import, division, print_function, with_statement,
unicode_literals)
from os import path as p
BASEDIR = p.dirname(__file__)
PARENTDIR = p.dirname(BASEDIR)
DB_NAME = ... |
__author__ = 'mnowotka'
import chembl_core_model.models as core
#-----------------------------------------------------------------------------------------------------------------------
class PredictedBindingDomains(core.PredictedBindingDomains):
#api_exclude = []
class Meta:
proxy = True
ap... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# callerframe documentation build configuration file, created by
# sphinx-quickstart on Thu Aug 20 13:21:39 2015.
#
# 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
... |
#!/usr/bin/python
# Copyright (c) 2014-2015 Cedric Bellegarde <cedric.bellegarde@adishatz.org>
# 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 opti... |
import os
import pandas as pd
from dataactbroker.scripts import update_historical_duns
from dataactcore.config import CONFIG_BROKER
from dataactcore.utils.duns import DUNS_COLUMNS, EXCLUDE_FROM_API
from dataactcore.models.domainModels import DUNS, HistoricDUNS
def test_remove_existing_duns(database):
""" Testing... |
__problem_title__ = "Disc game prize fund"
__problem_url___ = "https://projecteuler.net/problem=121"
__problem_description__ = "A bag contains one red disc and one blue disc. In a game of chance a " \
"player takes a disc at random and its colour is noted. After each " \
... |
# Copyright (c) 2013 Niklas Rosenstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, d... |
# Todo:
# multiple prpt files for one action - allows for alternate formats.
import io
import os
import logging
import subprocess
import xmlrpclib
import base64
import netsvc
import pooler
import report
from osv import osv, fields
from tools.translate import _
from datetime import datetime
from .java_oe import ... |
# Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Rackspace provisioner.
"""
from ._libcloud import monkeypatch, LibcloudProvisioner
from ._install import (
provision,
task_open_control_firewall,
)
from ._ssh import run_remotely
from ._effect import sequence
def get_default_username(distribu... |
#!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
# ---------------------------------------------------------------------------#
# Copyright (C) 2016-2017 LB
#
# 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 F... |
from mongoengine import *
__all__ = ['DynamicFields', 'has_dfields']
def has_dfields(cls):
class new_cls(cls):
@property
def _dfields(self):
return DynamicFields._dfields(self.__class__.__name__)
#return new_cls
cls._dfields = DynamicFields._dfields(cls.__name__)
return ... |
class Solution(object):
def orderOfLargestPlusSign(self, N, mines):
"""
:type N: int
:type mines: List[List[int]]
:rtype: int
"""
orders = []
zero_positions = set((tuple(m) for m in mines))
max_order = 0
for _ in range(N):
orders.ap... |
from .AchievementListener import AchievementListener
from models.popups import Popup
class AchievementManager(object):
def __init__(self, popups):
self._achievements = {}
self._listeners = []
self._popups = popups
def __iter__(self):
for achievement in self._achievements.value... |
# -*- coding: utf-8 -*-
from PIL import Image
from outwiker.core.defines import ICON_WIDTH, ICON_HEIGHT
class IconMaker(object):
""" Class for creation icons by images. """
def create(self, fname_in, fname_out):
""" Create icon by file fname_in. Result will have saved as fname_out.
"""
... |
# Foremast - Pipeline Tooling
#
# Copyright 2018 Gogo, 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... |
# -*- coding: utf-8 -*-
from pyrsistent._pmap import pmap, m, PMap
from pyrsistent._pvector import pvector, v, PVector
from pyrsistent._pset import pset, s, PSet
from pyrsistent._pbag import pbag, b, PBag
from pyrsistent._plist import plist, l, PList
from pyrsistent._pdeque import pdeque, dq, PDeque
from pyrsist... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-16 20:40
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
depe... |
#!/usr/bin/env python
"""
@package mi.idk.test.test_git
@file mi.idk/test/test_git.py
@author Bill French
@brief test git
"""
__author__ = 'Bill French'
__license__ = 'Apache 2.0'
from os.path import basename, dirname
from os import makedirs,chdir, system
from os import remove
from os.path import exists
import sys
... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
import argparse
import logging
import pkgutil
import string
from cloudenvy.config import EnvyConfig
import cloudenvy.commands
#TODO(bcwaldon): replace this with entry points!
def _load_commands():
"""Iterate through modules in command and import suspected command cla... |
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
import os
import random
from h2o.estimators.gbm import H2OGradientBoostingEstimator
def milsong_checkpoint():
milsong_train = h2o.upload_file(pyunit_utils.locate("bigdata/laptop/milsongs/milsongs-train.csv.gz"))
milsong_valid = h2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.