src stringlengths 721 1.04M |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with codecs.open('README.rst', encoding='UTF8') as readme_file:
readme = readme_file.read()
with codecs.open('HISTORY.rst', encoding='UTF8') as history_file... |
"""This holds a routine for restricting the current process memory on Windows."""
import multiprocessing
import ctypes
def set_memory_limit(memory_limit):
"""Creates a new unnamed job object and assigns the current process to it.
The job object will have the given memory limit in bytes: the given process
... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 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... |
import numpy as np
import pandas as pd
from lexos.helpers.error_messages import SEG_NON_POSITIVE_MESSAGE, \
EMPTY_DTM_MESSAGE
from lexos.models.top_words_model import TopwordModel, TopwordTestOptions
from lexos.receivers.top_words_receiver import TopwordAnalysisType
# ---------------------------- Test for z-test ... |
"""
gprime setup
"""
import json
import os
from jupyter_packaging import (
create_cmdclass, install_npm, ensure_targets,
combine_commands, get_version,
)
import setuptools
HERE = os.path.abspath(os.path.dirname(__file__))
# The name of the project
name="gprime"
# Get our version
with open(os.path.join(HERE,... |
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
import sys
import socket
import struct
import tornado.ioloop
import tornado.tcpserver
import tornado.tcpclient
#import tornado.web
from tornado import gen
import functools
class TCPProxyHandler(tornado.tcpserver.TCPServer):
@gen.coroutine
def handle_str... |
# -*- coding: utf-8 -*-
import re
import urllib
from pyload.plugin.Hoster import Hoster
class YourfilesTo(Hoster):
__name = "YourfilesTo"
__type = "hoster"
__version = "0.22"
__pattern = r'http://(?:www\.)?yourfiles\.(to|biz)/\?d=\w+'
__description = """Youfiles.to hoster plugin"""
_... |
#!/usr/bin/env python
########################################################################
# File : tornado-start-all
# Author : Louis MARTIN
########################################################################
# Just run this script to start Tornado and all services
# Use CS to change port
from __future__ i... |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Raphael Ackermann
# Copyright (C) 2010 Benny Malengier
# Copyright (C) 2010 Nick Hall
# Copyright (C) 2012 Doug Blank <doug.blank@gmail.com>
#
# This program is free software; ... |
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
import unittest
import sys
import os
from gff3toembl.EMBLWriter import EMBLWriter
test_modules_dir = os.path.dirname(os.path.realpath(__file__))
data_dir = os.path.join(test_modules_dir, 'data')
class TestEMBLWriter(unittest.TestCase):
def compare_files(self, calculated_filename, expected_filename):
with... |
import logging
try:
from .gsrt_config import GSRTConfig
except ImportError:
from gsrt_config import GSRTConfig
def get_logger():
""" To change log level from calling code, use something like
logging.getLogger("autofocus").setLevel(logging.DEBUG)
"""
logger = logging.getLogger("autofocus")... |
import numpy
import sklearn.metrics
import os
import cv2
import numpy as np
def mean_accuracy(groundtruth, predictions):
groundtruth_cm = sklearn.metrics.confusion_matrix(groundtruth, groundtruth).astype(numpy.float32)
predictions_cm = sklearn.metrics.confusion_matrix(predictions, groundtruth).astype(numpy.fl... |
from __future__ import unicode_literals
from django.core.mail import send_mail
from django.db import models
from django.utils.translation import ugettext as _
from django.contrib.auth.models import (
BaseUserManager, AbstractBaseUser, PermissionsMixin)
class UserManager(BaseUserManager):
def create_user(self... |
# Copyright (c) 2015 Microsoft Corporation
import os
import re
cr = re.compile("Copyright")
aut = re.compile("Automatically generated")
aut2 = re.compile("auto-generated")
cr_notice = """
/*++
Copyright (c) 2015 Microsoft Corporation
--*/
"""
smt2_cr_notice = """
; Copyright (c) 2015 Microsoft Corporation
"""
py... |
import unittest
import json
from flask_api import status
from api import db
from database.models.users import User
from database.managers.user_manager import add_user
from core.messages import error_messages as error
from api.tests.base import BaseTestCase
from api.tests.auth_tests.base_auth import user_registration,... |
#!/usr/bin/env python
'''
setup board.h for chibios
'''
import argparse, sys, fnmatch, os, dma_resolver, shlex, pickle
import shutil
parser = argparse.ArgumentParser("chibios_pins.py")
parser.add_argument(
'-D', '--outdir', type=str, default=None, help='Output directory')
parser.add_argument(
'hwdef', type=st... |
''' Filter 2D or 3D images
This module contains both linear Fourier-accelerated filters as well as ramp
correction and histogram equalization. The filtering code is performed
using Fortran accelerated code from the SPIDER library.
SPIDER: http://www.wadsworth.org/spider_doc/spider/docs/spider.html
.. Created on Ju... |
# Copyright 2015 NEC Corporation. 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 ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2013- Yan Shoshitaishvili aka. zardus
# Ruoyu Wang aka. fish
# Andrew Dutcher aka. rhelmot
# Kevin Borgolte aka. cao
#
# This program is free software; you can redistribute it and/or modify
# it un... |
# import the necessary packages
from __future__ import print_function
from google.protobuf import text_format
from cStringIO import StringIO
from PIL import Image
import scipy.ndimage as nd
import numpy as np
import caffe
import os
class BatCountry:
def __init__(self, base_path, deploy_path, model_path,
patch_model... |
# Copyright (C) 2015 Optiv, Inc. (brad.spengler@optiv.com), KillerInstinct
#
# 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 vers... |
# Author: Hunter Baines <0x68@protonmail.com>
# Copyright: (C) 2017 Hunter Baines
# License: GNU GPL version 3
import sys
from distutils.core import setup
import sudb
FAILURE = '\033[1;31m' + 'Install cannot proceed.' + '\033[00m'
if len(sys.argv) > 1 and sys.argv[1] == 'install':
# Check python version
i... |
# Authors: Nicolas Goix <nicolas.goix@telecom-paristech.fr>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# License: BSD 3 clause
import numpy as np
import warnings
from .base import NeighborsBase
from .base import KNeighborsMixin
from .base import UnsupervisedMixin
from ..base import Outlie... |
import unittest
from mygrations.formats.mysql.db_reader.database import database as database_reader
from mygrations.formats.mysql.file_reader.database import database as file_reader
from mygrations.drivers.mysqldb.mysqldb import mysqldb
from tests.mocks.db.mysql.db_structure import db_structure
from mygrations.formats.... |
from __future__ import unicode_literals
import boto3
import pytest
import sure # noqa
from botocore.exceptions import ClientError, ParamValidationError
from moto import mock_managedblockchain
from . import helpers
@mock_managedblockchain
def test_create_another_member():
conn = boto3.client("managedblockchain"... |
# This file is part of Headphones.
#
# Headphones 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.
#
# Headphones is distributed i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware 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 cop... |
#!/usr/bin/env python
import os
import argparse
import numpy as np
import scipy.misc
import deeppy as dp
from matconvnet import vgg19_net
from style_network import StyleNetwork
def weight_tuple(s):
try:
conv_idx, weight = map(int, s.split(','))
return conv_idx, weight
except:
raise a... |
import numpy as np
from spec.mamba import *
with description('as_args'):
with it('returns nothing for empty input'):
expect(repr_format.as_args()).to(equal(''))
with it('returns comma separated variable args'):
expect(repr_format.as_args(1, True, 'string', {'set'})).to(
equal("1, True, 'string', ... |
"""Perform ensemble calling of structural variants using MetaSV.
https://github.com/chapmanb/metasv
http://dx.doi.org/10.1093/bioinformatics/btv204
"""
import os
import sys
from bcbio import utils
from bcbio.provenance import do
from bcbio.pipeline import datadict as dd
from bcbio.structural import shared
from bcbio.... |
#!/usr/bin/env python
# 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
# "Li... |
from ctypescrypto import pyver
from ctypescrypto.oid import Oid
from ctypescrypto.ec import create
from base64 import b16decode
from subprocess import Popen, PIPE
import unittest
def dump_key(key):
""" Convert key into printable form using openssl utility
Used to compare keys which can be stored in differen... |
# Copyright (c) 2017,2018 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Tests for the `_util` module."""
from datetime import datetime
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pytest
from metpy.plots import a... |
from fabric.api import *
import fabric.contrib.project as project
import os
import shutil
import sys
import SocketServer
from pelican.server import ComplexHTTPRequestHandler
# Local path configuration (can be absolute or relative to fabfile)
env.deploy_path = 'public'
DEPLOY_PATH = env.deploy_path
# Remote server co... |
import webapp2
import jinja2
import os
import logging
jinja_environment = jinja2.Environment(loader = jinja2.FileSystemLoader(os.path.dirname(__file__) + '/templates'))
def doRender(handler, tname = 'index.html', values = {}):
temp = jinja_environment.get_template(tname)
handler.response.out.wr... |
# Copyright (c) 2015, Warren Weckesser. All rights reserved.
# This software is licensed according to the "BSD 2-clause" license.
from __future__ import division as _division, print_function as _print_function
import numpy as _np
from .core import grid_count as _grid_count
import matplotlib.pyplot as _plt
from ._c... |
# #
# Copyright 2013-2015 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),
# the Hercules foundation (ht... |
# -*- coding: utf-8 -*-
# This file is part of emesene.
#
# emesene 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.
#
#... |
#!/usr/bin/env python
import random
import math
import collision_detection as cd
from extra import ceiling_camera, radio
import sys
write_pngs = False
if len(sys.argv)>=2:
if sys.argv[1] == "w":
write_pngs = True
bpp = 4
polygon_width = 1000
polygon_height = 500
pixel_per_mm = 1.
obstacle_color = (0,0,0... |
from __future__ import print_function
import sys
import re
import glob
import argparse
def eprint(*args, **kwargs):
# Print to STDERR instead of STDOUT
print(*args, file=sys.stderr, **kwargs)
def grep(expression, filepath, ignorecase=False, invert=False):
raw_expression = re.escape(expression)
... |
import unittest, doctest, operator
from test import test_support
from collections import namedtuple
import pickle, cPickle, copy
import keyword
import re
from collections import Hashable, Iterable, Iterator
from collections import Sized, Container, Callable
from collections import Set, MutableSet
from collecti... |
#!/usr/bin/env python
#
# Seccomp Library test program
#
# Copyright (c) 2012 Red Hat <pmoore@redhat.com>
# Author: Paul Moore <pmoore@redhat.com>
#
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of version 2.1 of the GNU Lesser General Public License as
# published by t... |
# Copyright 2012 Hewlett-Packard Development Company, L.P.
# Copyright 2012 Varnish Software AS
#
# 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
... |
import numpy as np
from .HDPModel import HDPModel
from bnpy.suffstats import SuffStatBag
from bnpy.util import NumericUtil, NumericHardUtil
import scipy.sparse
import logging
Log = logging.getLogger('bnpy')
class HDPHardMult(HDPModel):
######################################################### Local Params
#####... |
"""
Set up the plot figures, axes, and items to be done for each frame.
This module is imported by the plotting routines and then the
function setplot is called to set the plot parameters.
"""
#--------------------------
def setplot(plotdata):
#--------------------------
"""
Specify what is to b... |
# 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... |
# Sun Aug 23 13:12:56 2009
from numpy import sin, cos, tan, vectorize
def f(x, t, parameter_list):
# Unpacking the parameters
Mh, mf, g, L, q3 = parameter_list
# Unpacking the states (q's and u's)
q1, q2, u1, u2 = x
s1 = sin(q1)
cos(q3) = cos(q3)
c2 = cos(q2)
sin(q3) = sin(q3)
s2 = ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
---------------------------------------------------------------------------------------------------
dlg_exe_data_new
mantém as informações sobre a dialog de edição da tabela de exercícios
This program is free software: you can redistribute it and/or modify
it under th... |
# Copyright (c) 2010-2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functiona... |
#--DiphotonFits.py - Version 1 - 04/02/2016
#--Author: Bradley J Kavanagh
#--Summary: Code for fitting the ATLAS diphoton data
#--and calculating the significance of the 750 GeV excess
#--Note: Requires emcee (http://dan.iel.fm/emcee/current/)
#--Please report any problems to: bradkav@gmail.com
print "----Likelihood... |
import os
from django.conf import settings
from django.core.management import call_command
import pytest
from catalog.models import Category, Course
pytestmark = [pytest.mark.django_db]
fixtures = os.path.join(settings.BASE_DIR, 'catalog', 'tests', 'fixtures')
SIMPLE_TREE = os.path.join(fixtures, 'simple_tree.yaml... |
from setuptools import setup
NAME='ShopifyAPI'
exec(open('shopify/version.py').read())
DESCRIPTION='Shopify API for Python'
LONG_DESCRIPTION="""\
The ShopifyAPI library allows python developers to programmatically
access the admin section of stores using an ActiveResource like
interface similar the ruby Shopify API ge... |
import cim
import cim.objects
from fixtures import *
def test_object_resolver(repo):
"""
Args:
repo (cim.CIM): the deleted-instance repo
Returns:
None
"""
resolver = cim.objects.ObjectResolver(repo)
assert len(resolver.get_keys(cim.Key('NS_'))) == 47490
for key in resolv... |
import numpy as np
import sys
try:
import scipy.stats as st # contains st.entropy
except:
pass
'''
Description:
Author: Mikko Auvinen
mikko.auvinen@helsinki.fi
University of Helsinki &
Finnish Meteorological Institute
'''
# =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
#========... |
# 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 ... |
import os
import dtree as dt
import telebot
from telebot import types
import time
from optparse import OptionParser
import wikiquery as wq
#get token from command line
parser = OptionParser()
parser.add_option("-t", "--token")
(options, args) = parser.parse_args()
TOKEN = options.token
if not TOKEN:
#try from env... |
import itertools
from datetime import timedelta
import pytest
sa = pytest.importorskip('sqlalchemy')
pytest.importorskip('psycopg2')
import numpy as np
import pandas as pd
import pandas.util.testing as tm
from odo import odo, resource, drop, discover
from blaze import symbol, compute, concat
names = ('tbl%d' % i ... |
import base
import datetime
import random
from FixedRandomGame import FixedRandomGame as __base
# use __base, otherwise when searching for games, FixedRandomGame shows up multiple times
class FineControl(__base):
"""
Touch four plates in patterns as fast as you can.
Level 1: tight, clockwise 5 times
... |
"""
test_db
-------
Tests for `alpenhorn.db` module.
"""
import peewee as pw
import pytest
import alpenhorn.db as db
import test_import as ti
# try:
# from unittest.mock import patch, call
# except ImportError:
# from mock import patch, call
class FailingSqliteDatabase(pw.SqliteDatabase):
def execute_... |
"""Support for the Fibaro devices."""
import logging
from collections import defaultdict
from typing import Optional
import voluptuous as vol
from homeassistant.const import (
ATTR_ARMED,
ATTR_BATTERY_LEVEL,
CONF_DEVICE_CLASS,
CONF_EXCLUDE,
CONF_ICON,
CONF_PASSWORD,
CONF_URL,
CONF_USERN... |
# -*- encoding: utf-8 -*-
#core Django Imports
from django import forms
from django.contrib.auth.models import Group
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.forms import ReadOnlyPasswordHashField, AuthenticationForm
from django.forms.extras import widgets
#Third party apps
#Project ap... |
#--------Gof (порождающие паттерны) Builder-----------------------------------------------------------------------------
#
# class Building:
# def make_basement(self,basement):
# pass
# def make_walls(self,walls):
# pass
# def make_roof(self,roof):
# pass
#
# class Sky_scriber(Buildi... |
from discord.ext import commands
from utils import *
import discord
import asyncio
from cogs.updateroster import UpdateRoster
from config import Config
import logging
logger = logging.getLogger('bayohwoolph.cogs.basicpromotions')
BASICPROMOTIONS = Config.config['BASICPROMOTIONS']
ROLE_CADET = BASICPROMOTIONS['ROLE_... |
import os
from select import select
from subprocess import PIPE
import sys
from itertools import chain
from plumbum.commands.processes import run_proc, ProcessExecutionError
from plumbum.commands.base import AppendingStdoutRedirection, StdoutRedirection
from plumbum.lib import read_fd_decode_safely
class Future(obje... |
# -*- coding: utf-8 -*-
"""
Models for Student Identity Verification
This is where we put any models relating to establishing the real-life identity
of a student over a period of time. Right now, the only models are the abstract
`PhotoVerification`, and its one concrete implementation
`SoftwareSecurePhotoVerification`... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta 4
# Copyright 2015 tvalacarta@gmail.com
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#
# Distributed under the terms of GNU General Public License v3 (GPLv3)
# http://www.gnu.org/licenses/gpl-3.0.html
# --... |
import sys
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def findSecondMinimumValue(self, root: TreeNode) -> int:
if not root or (not root.left and not root.right):
return -1
if root.left.va... |
import os
from datetime import datetime
import shutil
class TestCase:
"""
Any subclass must implemenet runtest() and oracle()
"""
def __init__(self, app, prog, re):
self.appid = app
self.tprog = prog
self.res = re
def oracle(self):
print '[error] This is a virtual... |
"""Uploads a custom certificate for the console proxy VMs to use for SSL. Can be used to upload a single certificate signed by a known CA. Can also be used, through multiple calls, to upload a chain of certificates from CA to the custom certificate itself."""
from baseCmd import *
from baseResponse import *
class upl... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: imagenet_resnet_utils.py
import numpy as np
import cv2
import multiprocessing
import tensorflow as tf
from tensorflow.contrib.layers import variance_scaling_initializer
import tensorpack as tp
from tensorpack import imgaug, dataset
from tensorpack.dataflow import... |
#
# Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
#
from analytic_client import AnalyticApiClient
import time, socket, os
from topology_uve import LinkUve
import gevent
from gevent.lock import Semaphore
from opserver.consistent_schdlr import ConsistentScheduler
from topology_config_handler import Topol... |
#Imports and model parameters
from __future__ import absolute_import
from __future__ import division
import tensorflow as tf
import numpy as np
from tensorflow.examples.tutorials.mnist import input_data
#mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)
#Simple network: Given three integers a,b,c, ... |
"""
Base class for any serializable list of things...
Copyright 2006-2008, Red Hat, Inc
Michael DeHaan <mdehaan@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 Li... |
# -*- coding: utf-8 -*-
'''
Created on 2014-01-24
@author: tedlaz
'''
from PyQt4 import QtGui, Qt
class rptDlg(QtGui.QDialog):
def __init__(self,html=u'Δοκιμή',title='Document1',parent=None):
super(rptDlg, self).__init__(parent)
self.setAttribute(Qt.Qt.WA_DeleteOnClose)
... |
# -*- coding: utf-8 -*-
import os
import shutil
import unittest
import tempfile
import codecs
from plistlib import writePlist, readPlist
from ufoLib import UFOReader, UFOWriter, UFOLibError
from ufoLib.glifLib import GlifLibError
from .testSupport import fontInfoVersion3
class TestInfoObject(object): pass
# ------... |
import sys
from itertools import chain
from PyQt5.QtCore import Qt, QRect, QRectF
from PyQt5.QtGui import QPen
from PyQt5.QtWidgets import QGraphicsItem, QGraphicsRectItem
from inselect.lib.utils import debug_print
from inselect.gui.colours import colour_scheme_choice
from inselect.gui.utils import painter_state
fr... |
from urllib.parse import urlparse
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.template import loader
from django.urls import reverse
from django.utils.translation import ugettext as _, ungettext
from accou... |
# Despy: A discrete event simulation framework for Python
# Version 0.1
# Released under the MIT License (MIT)
# Copyright (c) 2015, Stacy Irwin
"""
****************
despy.model.event
****************
.. autosummary::
Event
.. todo
Refactor event so it no longer inherits from Component.
... |
'''
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.
OJ's undirected graph serialization:
Nodes are labeled uniquely.
We use # as a separator for each node, and , as a separator for node label and each neighbor of the node.
As an example, consider the serialized graph {... |
from __future__ import print_function
from timeit import default_timer as timer
import json
import datetime
print('Loading function')
def eratosthenes(n):
sieve = [ True for i in range(n+1) ]
def markOff(pv):
for i in range(pv+pv, n+1, pv):
sieve[i] = False
markOff(2)
for i in ... |
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, api
class AccountMove(models.Model):
_inhe... |
#!/usr/bin/env python
# coding=UTF-8
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from math import floor
from clarifai.rest import ClarifaiApp
from config.configuration import data_path, test_set_id, clarifai_api_key, clarifai_model_name
def floored_percentage(val, digits):
... |
import numpy as np
import cv2
cap = cv2.VideoCapture(0)
startTracking = True
while startTracking:
startTracking = False
# take first frame of the video
_,frame = cap.read()
frame = cv2.flip(frame, 1)
frame = cv2.GaussianBlur(frame, (5, 5), 5)
# setup initial location of window
r... |
#
# Copyright 2015-2019, Institute for Systems Biology
#
# 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 ... |
"""
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 ... |
# 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... |
#!/usr/bin/env python
# encoding: utf-8
from collections import OrderedDict
import sys
import waflib
from waflib.Configure import conf
_board_classes = {}
class BoardMeta(type):
def __init__(cls, name, bases, dct):
super(BoardMeta, cls).__init__(name, bases, dct)
if 'abstract' not in cls.__dict... |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
import logging
import os
from addons.base.apps import BaseAddonAppConfig
from addons.gitlab.api import GitLabClient, ref_to_params
from addons.gitlab.exceptions import NotFoundError, GitLabError
from addons.gitlab.utils import get_refs, check_permissions
from website.util import rubeus
logger = logging.getLogger(__na... |
# -*- encoding: utf-8 -*-
from functools import partial
import itertools
import unittest
from lxml import etree as ET
from lxml.builder import E
from psycopg2 import IntegrityError
from openerp.exceptions import ValidationError
from openerp.tests import common
import openerp.tools
Field = E.field
class ViewCase(c... |
# Copyright (c) 2015 Xilinx Inc.
#
# 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, distrib... |
# 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 ... |
# -*- encoding: utf-8 -*-
from .menu import EscenaMenu
from os import listdir
class MenuDesafios(EscenaMenu):
def configuracion(self):
self.menu_y = 190
self.colorResaltado = self.pilas.colores.Color(0, 0, 0)
self.colorNormal = self.pilas.colores.Color(255, 255, 255)
self.distancia... |
import pdb
#encoding:latin-1
import requests
import urllib2
import userConfig
from collections import OrderedDict
from ..DataStructures.Table import Table
class MetlinMatcher(object):
ws_col_names = [ "formula", "mass", "name", "molid"]
ws_col_types = [ str, float, str, int]
ws_col_formats = [ "%s", "%.... |
from rules.contrib.views import PermissionRequiredMixin, permission_required
from django.urls import reverse
from django.contrib import messages
from django.views.generic import ListView
from django.contrib.auth.models import Group
from django.http import HttpResponseRedirect
from django.views.generic.base import Redi... |
# Copyright 2017 Joachim van der Herten
#
# 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 wr... |
#!/usr/bin/env python3
# Created by ACE 3 team, modified by BC: https://github.com/acemod/ACE3
import fnmatch
import os
import re
import ntpath
import sys
import argparse
def get_private_declare(content):
priv_declared = []
srch = re.compile('private.*')
priv_srch_declared = srch.findall(content)
... |
"""Object-Rlational Mapping classess, based on Sqlalchemy, for representing the
dataset, partitions, configuration, tables and columns.
Copyright (c) 2015 Civic Knowledge. This file is licensed under the terms of the
Revised BSD License, included in this distribution as LICENSE.txt
"""
__docformat__ = 'restructuredte... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.