src stringlengths 721 1.04M |
|---|
# -*- coding: utf-8 -*-
import threading, sys
from utils.rwlogging import log
from notifier import fetion
from notifier import mail
from category import prices
from category import weather
from utils import const
def weatherMonitor():
try:
#msg = ''
#msg = msg + weather.fetchWeather()
multimsg = [0, 0]
multim... |
from .base import *
DEBUG = False
LIVE_GO_CARDLESS = False
LIVE_MAIL = False
SITE_NAME = os.path.basename(__file__).title()
env_path = os.path.join(BASE_DIR, ".env")
environ.Env.read_env(env_path)
INSTALLED_APPS += ["raven.contrib.django.raven_compat"]
DATABASES = {"default": env.db_url("DATABASE_URL")}
ALLOWED_HO... |
from django import forms
from django.utils.translation import ugettext_lazy as _
from oscar.core.loading import get_model
from oscar.forms import widgets
Voucher = get_model('voucher', 'Voucher')
Benefit = get_model('offer', 'Benefit')
Range = get_model('offer', 'Range')
class VoucherForm(forms.Form):
"""
A... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Sarielsaz Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Base class for RPC testing."""
from collections import deque
from enum import Enum
import logging
im... |
# -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
import unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
return True
except:
return False
class timeweb2(unittest.TestCase):
def setUp(self):
self.wd = WebDriver()
sel... |
# -*- coding: utf-8 -*-
#
# MLDB-1116-tokensplit.py
# Mathieu Marquis Bolduc, 2015-11-24
# This file is part of MLDB. Copyright 2015 mldb.ai inc. All rights reserved.
#
from mldb import mldb
ds1 = mldb.create_dataset({
'type': 'sparse.mutable',
'id': 'example'
})
# create the dataset
ds1.record_row('1', [['x... |
# -*- coding: utf-8 -*-
###
# (C) Copyright (2012-2017) Hewlett Packard Enterprise Development LP
#
# 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 limi... |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from sentry.constants import MEMBER_OWNER, MEMBER_USER
from sentry.models import Team
from sentry.testutils import fixture
from sentry.testutils import ... |
import os
import sys
# OS Specifics
ABS_WORK_DIR = os.path.join(os.getcwd(), "build")
BINARY_PATH = os.path.join(ABS_WORK_DIR, "firefox", "firefox.exe")
INSTALLER_PATH = os.path.join(ABS_WORK_DIR, "installer.zip")
XPCSHELL_NAME = 'xpcshell.exe'
EXE_SUFFIX = '.exe'
DISABLE_SCREEN_SAVER = False
ADJUST_MOUSE_AND_SCREEN =... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
#!/usr/bin/env python
#
# Copyright (c) 2016 Cisco and/or its affiliates.
# 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
# l
# Unless requir... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import utool as ut
import numpy as np
import vtool_ibeis as vt
import pandas as pd
from ibeis.algo.graph.nx_utils import ensure_multi_index
from ibeis.algo.graph.state import POSTV, NEGTV, INCMP
print, rrr, profil... |
#!/usr/bin/env python
import re
import os
import sys
import time
import unittest
import ConfigParser
from setuptools import setup, Command
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
class SQLiteTest(Command):
"""
Run the tests on SQLite
"""
description = ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
import random as rand;
import math;
from sets import Set;
import copy;
import numpy as np;
import itertools;
## mlCons / dlCons structure: [(instance, instance), ... (instance, instance)]
## instance / point structure: Set(attr1, attr2...... |
# 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 ... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import timedelta
from odoo import tools
from odoo.addons.mail.tests.common import mail_new_test_user
from odoo.fields import Date
from odoo.tests import Form, tagged, users
from odoo.tests.common import Tr... |
# 6.00 Problem Set 3
#
# Hangman game
#
# -----------------------------------
# Helper code
# You don't need to understand this helper code,
# but you will have to know how to use the functions
# (so be sure to read the docstrings!)
import random
import string
WORDLIST_FILENAME = "/home/paco/workspace/MIT_6001/hangm... |
# -*- coding: utf-8 -*-
"""
Clase C{IntegerLiteralExpressionNode} del árbol de sintáxis abstracta.
"""
from pytiger2c.ast.valuedexpressionnode import ValuedExpressionNode
from pytiger2c.types.integertype import IntegerType
class IntegerLiteralExpressionNode(ValuedExpressionNode):
"""
Clase C{IntegerLiteralE... |
"""
Listing 11.3: A general bitonic sort
"""
from io import open
import numpy as np
import pyopencl as cl
import utility
SORT_ASCENDING = True
NUM_FLOATS = 2**20
kernel_src = '''
/* Sort elements within a vector */
#define VECTOR_SORT(input, dir) \
comp = input < shuffle(input, m... |
import os
import sqlite3
import sys
from contextlib import closing
from glob import escape, glob
from pathlib import Path
import filelock
import structlog
from raiden.constants import RAIDEN_DB_VERSION
from raiden.storage.sqlite import SQLiteStorage
from raiden.storage.versions import VERSION_RE, filter_db_names, lat... |
""" Simple client/server controller for testing.
Copyright (c) 2014 Kenn Takara
See LICENSE for details
"""
import logging
from fixtest.base.asserts import *
from fixtest.base.controller import TestCaseController
from fixtest.fix.constants import FIX
from fixtest.fix.messages import logon_message, logout_me... |
"""Progress bar utilities."""
from enum import Enum
from io import StringIO
import sys
class TermType(Enum):
"""Enumeration of types of terminals."""
TTY = 1
IPythonTerminal = 2
IPythonGUI = 3
File = 4
Unknown = 0
def _non_ipy_term_type():
"""
The terminal type of a non-IPython term... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007,2008,2009 Chris Ball, based on Collabora's
# "hellomesh" demo.
#
# Copyright (C) 2013,14 Walter Bender
# Copyright (C) 2013,14 Ignacio Rodriguez
# Copyright (C) 2013 Jorge Gomez
# Copyright (C) 2013,14 Sai Vineet
#
# This program is free software; you ca... |
#-------------------------------------------------------------------------------
# Purpose: parsing data from the crawler's "rawmetadata.json.#" json files to a form:
# author mentioned1,mentioned2,... unixTimestamp + text \n
# creating as many txt files as there are json files.
# T... |
import sys
import os.path
import urllib2
import re
from pyquery import PyQuery as pq
import common
def getId(url):
arr = url.split("/")
id = arr[len(arr) - 2]
return id
def getSiteUrl(urlRequest, monitor, rcbUrl):
result = ""
print("REQUEST: {0}".format(urlRequest))
try:
req = urllib2.urlopen(urlRequest, t... |
#!/usr/bin/python
import ROOT
import numpy as np
import glob
import argparse
from dicom_tools.roiFileHandler import roiFileHandler
import os
from dicom_tools.FileReader import FileReader
from dicom_tools.pyqtgraph.Qt import QtCore, QtGui
import dicom_tools.pyqtgraph as pg
from skimage.measure import grid_points_in_poly... |
# -*- coding: utf-8 -*
"""
Use setup tools to install sickchill
"""
import os
from setuptools import find_packages, setup
from requirements.sort import file_to_dict
try:
from babel.messages import frontend as babel
except ImportError:
babel = None
ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__... |
# --------------------------------------------------------
# Tensorflow Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Xinlei Chen
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from __future__ impor... |
# Copyright 2019,2020,2021 Sony Corporation.
# Copyright 2021 Sony Group Corporation.
#
# 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
#
# Un... |
import datetime
from flask_security import RoleMixin, UserMixin
from flask_mongoengine.wtf import model_form
from taarifa_backend import db
fieldmap = {
'BinaryField': db.BinaryField,
'BooleanField': db.BooleanField,
'ComplexDateTimeField': db.ComplexDateTimeField,
'DateTimeField': db.DateTimeField,
... |
"""A simple module housing Bitcoin Script OP Code values."""
class opcode(object):
"""Define Bitcoin Script OP Code values."""
opcodes = {}
# Constants
opcodes['OP_FALSE'] = 0x00
opcodes['OP_1NEGATE'] = 0x4f
opcodes['OP_TRUE'] = 0x51
opcodes['OP_2'] = 0x52
opcodes['OP_3'] = 0x53
... |
import unicodedata
from io import BytesIO
from datetime import datetime
import flask_excel
import weasyprint
from flask import request, send_file, g, make_response, jsonify
from secretary import Renderer
from werkzeug.exceptions import BadRequest, abort
from sqlalchemy.orm.exc import NoResultFound
from pypnusers... |
#!/usr/bin/env python
"""
main.py -- Udacity conference server-side Python App Engine
HTTP controller handlers for memcache & task queue access
$Id$
created by wesc on 2014 may 24
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
import webapp2
from google.appengine.api import app_identity
from google.appe... |
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# Original module for stock.move from:
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny... |
#
#
# Copyright (C) 2006, 2007, 2010, 2011, 2012, 2014 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
... |
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# Based on http://doughellmann.com/2010/05/09/defining-custom-roles-in-sphinx.html
"""Integration of Sphinx with Redmine.
"""
from docutils import nodes, utils
from docutils.parsers.rst.roles import set_classes
def redmine_role(name, ... |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
# Waitrose web scraper
__author__ = 'robdobsn'
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.support.ui as webdriverui
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.common.exceptions import... |
# -*-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
# ... |
# -*- 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... |
"""My library of functions for use in aospy.
Historically, these assumed input variables in the form of numpy arrays or
masked numpy arrays. As of October 2015, I have switched to assuming
xarray.DataArrays, to coincide with the same switch within aospy. However, not
all of the functions in this module have been con... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Script for inserting Kihei SCADA temperature and humidity data.
Usage:
With the current working directory set to the path containing the data files,
python insertSCADAWeatherData.py
"""
__author__ = 'Daniel Zhang (張道博)'
__copyright__ = 'Copyright (c) 2013, Uni... |
#
# Copyright 2009-2012 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 ... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
# -*- coding: utf-8 -*-
"""
This module defines the global constants.
"""
import os
import getpass
import tempfile
COURSERA_URL = 'https://www.coursera.org'
AUTH_URL = 'https://accounts.coursera.org/api/v1/login'
AUTH_URL_V3 = 'https://www.coursera.org/api/login/v3'
CLASS_URL = 'https://class.coursera.org/{class_nam... |
import sage
from sage.signals.gmcp import room as room_signal
from sage import player, aliases
# Create an alias group for whodat
who_aliases = aliases.create_group('whodat', app='whodat')
# store in the app what our last room id was so we know when we change rooms
last_room = None
def write_players():
if len(pl... |
'''
Calculate the distance between two codon usages.
We have two files, the first with just the phages and the second
with their hosts. Then we need to calculate which of the hosts is
closest
'''
import os
import sys
sys.path.append('/home3/redwards/bioinformatics/Modules')
import numpy as np
import scipy
remove_am... |
import os
def valid_miriad_dset0(filelist0):
'''Returns True or False for valid or invalid Miriad datasets,
checks for existnce of the directory, and then for flags, header,
vartable, and visdata. Also returns names of valid datasets'''
if len(filelist0) == 0:
print 'valid_miriad_dset0: No fil... |
"""
Define cross-platform methods.
"""
from pathlib import Path
import logging
import subprocess
import os
import sys
import site
import signal
from .create_keys import create_self_signed_cert
from .version import xenon_grpc_version
def find_xenon_grpc_jar():
"""Find the Xenon-GRPC jar-file, windows version."""... |
# -*- coding: utf-8 -*-
#
# Ancestration documentation build configuration file, created by
# sphinx-quickstart on Sat Sep 28 15:10:26 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.
#
... |
from distutils.core import setup
setup(
name='django-notification',
version=__import__('notification').__version__,
description='Many sites need to notify users when certain events have occurred and to allow configurable options as to how those notifications are to be received. The project aims to provide ... |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def VirtualSerialPortURIBackingInfo(vim, *args, **kwargs):
'''The data object specifies n... |
#!/usr/bin/python
#
# 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 ag... |
"""
Django settings for django_celery_fileprocess_example project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.p... |
# Copyright 2016 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo.tests import common
from odoo.tools.safe_eval import safe_eval
class TestDeduplicateFilter(common.TransactionCase):
def setUp(self):
super(TestDeduplicateFilter, self).setUp()
... |
"""Notifications API"""
import logging
from django.conf import settings
from django.db.models import Q
from django.contrib.auth.models import User
from channels.models import Subscription, ChannelGroupRole, Channel
from channels.api import get_admin_api
from channels.constants import ROLE_MODERATORS
from notificatio... |
#!/usr/bin/env python3
import sys
sys.path.extend(['..', '../../..'])
from mupif import *
import jsonpickle
import time # for sleep
import logging
log = logging.getLogger()
import mupif.Physics.PhysicalQuantities as PQ
#
# Expected response from operator: E-mail with "CSJ01" (workflow + jobID)
# in the subject line, ... |
__author__ = 'amarch'
# -*- coding: utf-8 -*-
import shutil
from core.main import *
def correctGasData(r_g1, v_g1, dv_g1):
'''Функция, куда убраны все операции подгонки с данными по газу.'''
r_g = r_g1
v_g = v_g1
dv_g = dv_g1
#Если необходимо выпрямить апроксимацию на краю - можно добавить неск... |
"""
@package medpy.features
Functionality to extract features from images and present/manipulate them.
Packages:
- histogram: Functions to create and manipulate (fuzzy) histograms.
- intensity: Functions to extracts voxel-wise intensity based features from (medical) images.
- texture: Run-time optimised fe... |
#!/usr/bin/python3
import sys
from libsisyphus import *
checkSystemMode()
pkgList = sys.argv[2:]
if "__main__" == __name__:
if sys.argv[1:]:
if "install" in sys.argv[1:]:
startInstall(pkgList)
elif "uninstall" in sys.argv[1:]:
startUninstall(pkgList)
elif "force-u... |
# coding: utf-8
# Copyright 2014 Globo.com Player authors. All rights reserved.
# Use of this source code is governed by a MIT License
# license that can be found in the LICENSE file.
from collections import namedtuple
import os
import errno
import math
from m3u8.parser import parse, format_date_time
from m3u8.mixins... |
# coding: utf-8
import tkinter as tk
from tkinter import ttk
class FrameObjects(tk.Frame):
"""A very simple class that should be inherited by frames, to help create and
maintain in order the file.
How it works:
- After frames defined, create a dict (or an orderedDict, for convenience),
that will contain e... |
# Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.
# Example:
# Input: "babad"
# Output: "bab"
# Note: "aba" is also a valid answer.
# Example:
# Input: "cbbd"
# Output: "bb"
#Manacher's Algo
class Solution:
def longestPalindrome(self, s):
... |
# -*- coding: utf-8 -*-
'''
Dictionaries containing all translations of the phrases and words used in Pygobstones.
'''
ES = {
'Current working directory:': 'Directorio actual de trabajo: '.decode('utf8'),
'-- New Library': '-- Nueva Biblioteca'.decode('utf8'),
'There are unsaved files, to load a new mod... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014, Clément MATHIEU
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above c... |
from django import forms
from django.forms.extras.widgets import SelectDateWidget
from models import UserProfile, User
class UserProfileForm(forms.ModelForm):
picture = forms.ImageField(help_text="Please select a profile image to upload.", required=False)
current_city = forms.CharField(help_text="Please ente... |
#!/usr/bin/python
import numpy as np
from decisiontree import DecisionTree
from card import deal, format_input
def get_test_data(num_training, num_validation, fun):
samples = {"training": [], "validation": []}
num_samples = {"training": num_training,
"validation": num_validation}
for key... |
from __future__ import absolute_import
# Copyright (c) 2014 Kontron Europe GmbH
#
# This library 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.1 of the License, or (at your option)... |
# Status: being ported by Steven Watanabe
# Base revision: 47077
#
# Copyright (C) Andre Hentz 2003. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, ... |
# Copyright 2016 Red Hat, 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 a... |
#!/usr/bin/env python
#
# Copyright (c) 2015 All rights reserved
# This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
"""Tempest configuration uti... |
"""The Blog Post model."""
from django.db import models
from django.dispatch import receiver
from django.db.models.signals import post_save
from redactor.fields import RedactorField
from taggit.managers import TaggableManager
# Create your models here.
PUBLICATION_STATUS = (
("published", "Published"),
("draf... |
import csv
from collections import defaultdict
file1 = '/Users/pestefo/Sync/projects/information-visualization-course/proyecto/data/data.csv'
file2 = '/Users/pestefo/Sync/projects/information-visualization-course/proyecto/data/302.csv'
columns1 = defaultdict(list)
columns2 = defaultdict(list)
with open(file1, 'rU'... |
# -*- 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... |
# botbook_mcp3002.py - read analog values from mcp3002
# (c) BotBook.com - Karvinen, Karvinen, Valtokari
# Installing spidev:
# sudo apt-get update
# sudo apt-get -y install git python-dev
# git clone https://github.com/doceme/py-spidev.git
# cd py-spidev/
# sudo python setup.py install
import spidev ... |
"""Test map files generation."""
import os
from django.conf import settings
from django.core.management import call_command
from django.test import TestCase
from modoboa.core.utils import parse_map_file
from modoboa.lib.test_utils import MapFilesTestCaseMixin
class MapFilesTestCase(MapFilesTestCaseMixin, TestCase)... |
# Copyright (C) 2014 SEE AUTHORS FILE
#
# 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 distr... |
#
# 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... |
"""
This is an example that amounts to an offline picbreeder.org without any nice features. :)
Left-click on thumbnails to pick images to breed for next generation, right-click to
render a high-resolution version of an image. Genomes and images chosen for breeding
and rendering are saved to disk.
This example also d... |
# Copyright 2014 Diamond Light Source Ltd.
#
# 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... |
#!/usr/bin/env python3
# create a BIP70 payment request signed with a certificate
# FIXME: the code here is outdated, and no longer working
import tlslite
from electrum_mona.transaction import Transaction
from electrum_mona import paymentrequest
from electrum_mona import paymentrequest_pb2 as pb2
from electrum_mona.b... |
"""Extrudes a 2D mesh to generate an ExodusII 3D mesh.
Works with and assumes all polyhedra cells (and polygon faces).
To see usage, run:
------------------------------------------------------------
python meshing_ats.py -h
Example distributed with this source, to run:
--------------------------------------------... |
# 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 ... |
# Third-party modules
from xgboost import XGBRegressor
# Hand-made modules
from .base import BloscpackMixin, MyEstimatorBase, PickleMixin
MACHINE_LEARNING_TECHNIQUE_NAME = "xgb"
PICKLE_EXTENSION = "pkl"
SERIALIZE_FILENAME_PREFIX = "fit_model"
class MyXGBRegressor(MyEstimatorBase, BloscpackMixin, PickleMixin):
de... |
"""
This component provides support for Xiaomi Cameras (HiSilicon Hi3518e V200).
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/camera.yi/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.components.camera import Camera, PL... |
# -*- 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... |
import json
from flask import request
from redash import models
from redash.handlers.base import BaseResource
from redash.permissions import (require_access,
require_object_modify_permission,
require_permission, view_only)
class WidgetListResource(BaseR... |
from django.db import models
# Create your models here.
class Category(models.Model):
name = models.CharField( max_length = 110 )
slug = models.CharField( max_length = 110 )
published = models.IntegerField( default = 0 )
parent = models.ForeignKey( 'self', on_delet... |
# -*- coding: utf-8 -*-
# config.py
# Config for blivet-gui
#
# Copyright (C) 2017 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later versio... |
from typing import List
import typepy
from mbstrdecoder import MultiByteStrDecoder
from ....error import EmptyTableNameError
from ._numpy import NumpyTableWriter
class PandasDataFrameWriter(NumpyTableWriter):
"""
A writer class for Pandas DataFrame format.
:Example:
:ref:`example-pandas... |
# 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 agreed to in writing, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import rdkit
from rdkit.Chem import AllChem
from rdkit import DataStructs
__license__ = "X11"
METADATA = {
"id": "method_rdkit_ecfp2_2048_tanimoto",
"representation": "ecfp2_2048",
"similarity": "tanimoto"
}
def _compute_fingerprint(molecule):
return Al... |
'''
Created on Jun 9, 2011
@author: Piotr
'''
import unittest
import os
from readers.TagReaderX3D import TagReaderX3D
class TagReaderX3DUnitTests(unittest.TestCase):
def setUp(self):
# Setting up the X3D string with ALFIRT namespace tags
x3dString = """<?xml version="1.0" encoding="UTF-8"?>
<!... |
import numpy as np
def shift(starts, ends, regionSize, strands=None, shiftLength=None,
useFraction=False, useStrands=True, treatMissingAsNegative=False):
"""
Shift elements in a track a give nr of BP.
:param starts: numpy array. Starts
:param ends: numpy array. Ends
:param regionSize: I... |
# 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 django.test import RequestFactory
from mock import patch, Mock
from nose.tools import eq_, ok_
from product_details... |
# -*-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
# ... |
from __future__ import absolute_import
from celery.task import Task
from yell import Notification, notify, registry
class CeleryNotificationTask(Task):
""" Dispatch and run the notification. """
def run(self, name=None, backend=None, *args, **kwargs):
"""
The Celery task.
Deli... |
# Copyright 2019 The Cirq Developers
#
# 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 ... |
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
Classes which implement tasks which builder has to be capable of doing.
Logic above these classes has to set the workflow itself.
"""
import re
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.