text stringlengths 475 200k |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Adrien Chardon
# @Date: 2014-08-20 19:01:30
# @Last Modified by: Adrien Chardon
# @Last Modified time: 2014-11-05 10:39:26
# This file is part of iTeam.org.
# Copyright (C) 2014 Adrien Chardon (Nodraak).
#
# iTeam.org is free software: you can redistribute i... |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
import os
from datasets.imdb import imdb
import datasets.ds_utils as ds... |
"""
Detritus.
(c) Charles Shiflett 2011
"""
import os.path
import apps.forms.form_models.bform as bforms
import xlsnarf
import xlrd
from apps.forms.form_models.bfbdb import *
from apps.forms.inventory.models import *
from django.conf import settings
import pdb
debug=True
def listXLSFiles(directory):
dirlist =... |
#!/usr/bin/python
import argparse
import sys
from itertools import *
import math
import operator
from e21 import divisor_sum
def euler23(through):
abundance = set()
for i in xrange(2, through):
if divisor_sum(i) > i:
abundance.add(i)
abundant_sorted = sorted(abundance)
total = 0
for i in xrange(1,... |
#coding: utf-8
# Copyright 2005-2010 Wesabe, 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... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Test for the converters.
"""
import os
import tempfile
import nose
from .. import as_volume_img, save
import nibabel as nib
data_file = os.path.join(nib.__path__[0], 'tests',
... |
import numpy as np
import pytest
import pandas as pd
from pandas import CategoricalIndex, Index, MultiIndex
import pandas.util.testing as tm
def assert_matching(actual, expected, check_dtype=False):
# avoid specifying internal representation
# as much as possible
assert len(actual) == len(expected)
f... |
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from flask import redirect, render_template, session
from werkzeu... |
import matplotlib
matplotlib.use('Agg')
matplotlib.rcParams.update({'font.size': 18})
matplotlib.rcParams.update({'axes.linewidth': 2})
matplotlib.rcParams['xtick.major.size'] = 8
matplotlib.rcParams['xtick.major.width'] = 2
matplotlib.rcParams['ytick.major.size'] = 8
matplotlib.rcParams['ytick.major.width'] = 2
matplo... |
"""
Read or write the DIMACS CNF file format.
"""
def save(filename, problem):
save_file(open(filename, 'w'), problem)
def save_file(f, problem):
nvariables = reduce(max,
(abs(literal) for clause in problem for literal in clause),
0)
nclauses = len(problem)
... |
#!/usr/bin/env python
# WARNING: this is a hack. Only common (simple) cases are considered.
import sys
import collections
def read_old(filename):
'''Read the old input file in and convert it to a dictionary.'''
inp = {}
comments = []
idim = 0
ndim = 3
with open(filename) as f:
for l... |
import sys
import time
py3k = sys.version_info >= (3, 0)
py33 = sys.version_info >= (3, 3)
py26 = sys.version_info >= (2, 6)
py25 = sys.version_info >= (2, 5)
jython = sys.platform.startswith('java')
win32 = sys.platform.startswith('win')
pypy = hasattr(sys, 'pypy_version_info')
if py3k:
from io import StringIO
... |
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
import numpy as np
import pyhrf
from pyhrf import xmlio
try:
from collections import OrderedDict
except ImportError:
from pyhrf.backport import OrderedDict
from pyhrf.ndarray import xndarray, tree_to_cuboid, stack_cuboids
from pyhrf.ui.analyser_ui import FMRI... |
#!/usr/bin/env python
# coding=utf-8
import des
import md4
import hashlib
import utils
def challenge_hash(peer_challenge, authenticator_challenge, username):
"""ChallengeHash"""
sha_hash = hashlib.sha1()
sha_hash.update(peer_challenge)
sha_hash.update(authenticator_challenge)
sha_hash.update(use... |
# -*- coding: utf-8 -*-
"""The plist file object."""
from __future__ import unicode_literals
import plistlib
class PlistFile(object):
"""Class that defines a plist file.
Attributes:
root_key (dict): the plist root key.
"""
def __init__(self):
"""Initializes the plist file object."""
super(Plis... |
#!/usr/bin/env python
#
# Adds missing svn:needs-lock property directly on repository files.
# Direct access to the repository is required.
#
# Specify -d to perform a "dry run". This just indicates what needs to be done.
# Specify -i REGEXP to only include file names matching the regular expression.
# (Defaults to ... |
'''
'''
# 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");... |
# coding: utf-8
# Standard library
import time
# Third-party
import numpy as np
from numpy.fft import fft, fftfreq
# Project
from .core import check_for_primes, SuperFreqResult
from ._naff import naff_frequency
from .simpsgauss import simpson
from .log import logger
__all__ = ['SuperFreq', 'find_frequencies',
... |
# app.py
"""
Application module.
This file is part of the program
LeMMA - a GUI Frontend for creating MMA files.
Note that this is NOT really an MMA editor, but rather a simple front-end to MMA
Please read help.txt and CHANGES for more information.
This program is free software: you can redistribute it and/or modify... |
from __future__ import division
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ---------------... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool limiting together/eviction with the wallet."""
from test_framework.test_framework import ... |
#!/usr/bin/env python
#
# $Id: win32-loadaniicon.py 4 2007-06-02 00:47:59Z ramon $
#
# Windows Animated Cursor Stack Overflow Exploit
# Copyright 2007 Ramon de Carvalho Valle <[EMAIL]>,
# RISE Security <[EMAIL]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms o... |
import re
try:
str = unicode
except NameError:
pass
class AttrDict(object):
"A case-insensitive attribute accessible dict-like object"
def __init__(self, name, *args, **kwargs):
self.name = name
for key, value in dict(*args, **kwargs).items():
if not isinstance(key, (str,... |
'''
Check for positional offsets between the VLA and SD datasets.
'''
from image_registration import register_images
from spectral_cube import Projection, SpectralCube
from uvcombine.uvcombine import match_flux_units
from astropy import log
import astropy.units as u
import numpy as np
from .progressbar import _map... |
from .object import Void
from .env import LexEnv
from io import StringIO
from .value import StringValue, ListValue, Value, ValueType
from .callstack import CallStack, StackType
from .glue import Glue
from .cmd import Cmd, CmdType
import random
class State:
# Constructor
def __init__(self, story):
# Pu... |
# Copyright 2012 IBM Corp.
#
# 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... |
"""
image - Plot an image.
"""
from pygmt.clib import Session
from pygmt.helpers import build_arg_string, fmt_docstring, kwargs_to_strings, use_alias
@fmt_docstring
@use_alias(
R="region",
J="projection",
D="position",
F="box",
M="monochrome",
V="verbose",
X="xshift",
Y="yshift",
c... |
import os
import json
import random
import logging
from os.path import abspath, join, dirname
logger = logging.getLogger(__name__)
ROOT = abspath(join(dirname(globals()['__file__']), '../../..'))
ABS_CHOICES = {'yes': True, 'y': True, 'no': False, 'n': False}
DEFAULT_LOG_LEVEL = 'warn'
SECTIONS = (
{'options':... |
# Copyright 2013 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 ag... |
# 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.
from turbogears.database import session
from bkr.inttest import data_s... |
#
# QAPI parser test harness
#
# Copyright (c) 2013 Red Hat Inc.
#
# Authors:
# Markus Armbruster <[EMAIL]>
#
# This work is licensed under the terms of the GNU GPL, version 2 or later.
# See the COPYING file in the top-level directory.
#
from qapi import *
from pprint import pprint
import os
import sys
class QAPIS... |
import math
from numbers import Number
import numpy
from chainer import cuda
from chainer import function
from chainer import utils
from chainer.utils import type_check
from chainer import variable
# ------------------------------------------------------------------------------
# Arithmetic
# ----------------------... |
'''
147. Insertion Sort List
Medium
Sort a linked list using insertion sort.
A graphical example of insertion sort. The partial sorted list (black) initially contains only the first element in the list.
With each iteration one element (red) is removed from the input data and inserted in-place into the sorted list
... |
import hashlib
import json
import os
import uuid
from django import forms
from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ValidationError
from django.core.paginator import Emp... |
from vsd_common import *
@vsdcli.command(name='gateway-create')
@click.argument('name', metavar='<name>', required=True)
@click.option('--system-id', metavar='<system ID>', required=True)
@click.option('--personality', metavar='<personality>',
type=click.Choice(['VSG',
'... |
# Copyright 2013 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 ag... |
from flask import render_template, flash, redirect
from app import app
from .forms import LoginForm
from noteData import note
from firebase import firebase
firebase = firebase.FirebaseApplication('https://thoughtspace.firebaseio.com/', None)
@app.route('/')
@app.route('/index')
def index():
user = {'nickname': ... |
# Copyright 2016 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... |
"""
SkCode quote tag definitions code.
"""
from datetime import datetime
from html import escape as escape_html
from html import unescape as unescape_html_entities
from ..etree import TreeNode
from ..tools import sanitize_url
from ..utility.relative_urls import get_relative_url_base
class QuoteTreeNode(TreeNode):
... |
"""Support for Eufy lights."""
import logging
import lakeside
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_COLOR_TEMP,
LightEntity,
)
import homeassistant.util.color as color_util
from homeassistant... |
# Copyright (c) 2014 OpenStack Foundation
#
# 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 ... |
from django.core.exceptions import ObjectDoesNotExist
from rest_framework import permissions
from kolibri.auth.permissions.base import BasePermissions
from kolibri.auth.permissions.base import lookup_field_with_fks
class AnyoneCanWriteAnonymousLogs(BasePermissions):
"""
Permissions class that allows anonymou... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import print_function
import itertools as it, operator as op, functools as ft
from os.path import join, exists, isfile, expanduser, dirname
from contextlib import contextmanager, closing
from collections import deque, OrderedDict
from heapq import heappush... |
'''
Created on Jul 31, 2014
@author: tangliuxiang
'''
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from bootimgpack.pull.push import push
from bootimgpack.pull.mtkpush imp... |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsDistanceArea.
.. note:: 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.
"""
_... |
from __future__ import absolute_import, division, print_function, unicode_literals
import atexit
import codecs
import copy
import fnmatch
import logging
import os
import shutil
import signal
import sys
import threading
import traceback
from contextlib import contextmanager
from datetime import datetime, timedelta
imp... |
import pytest
from mendeley.exception import MendeleyException
from test import cassette, sleep
from test.resources.documents import *
def test_should_page_through_search_results():
session = get_user_session()
delete_all_documents()
with cassette('fixtures/resources/documents/list_advanced_search/page_t... |
# Copyright 2013 Donald Stufft and individual contributors
#
# 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... |
# 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
# distributed under the... |
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
from __future__ import division
from __future__ import print_function
from six.moves import xrange
import numpy as np
# data I/O
data = open('../data/saved_txt/chr1_train.txt', 'r').read() # should be simple plain te... |
from __future__ import absolute_import
import sys
import keyword
import logging
# The generateDS package and our generateds module
# collide on case-insensitive file systems.
import generateDS.generateDS
from ome.modeltools.exceptions import ModelProcessingError
from xml import sax
from ome.modeltools.model import OM... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Mailbox',
fields=[
('id', models.AutoField(verb... |
# Copyright (C) 2008-2013, Luis Pedro Coelho <[EMAIL]>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
#
# License: MIT (see COPYING file)
from __future__ import division
from . import _bbox
import numpy as np
def bbox(img, border=None, as_slice=False):
"""
min1,max1,min2,max2 = bbox(img, border={0}, as_s... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
base_path = os.path.dirname(os.path.abspath(__file__))
# Insert local directories into path
sys.path.append(base_path)
sys.path.append(os.path.join(base_path, 'cps'))
sys.path.append(os.path.join(base_path, 'vendor'))
from cps import web
try:
fro... |
"""Utilities for writing code that runs on Python 2 and 3"""
import operator
import sys
import types
__author__ = "Benjamin Peterson <[EMAIL]>"
__version__ = "1.1.0"
# True if we are running on Python 3.
PY3 = sys.version_info[0] == 3
if PY3:
string_types = str,
integer_types = int,
class_types = type,... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import requests
import pytest
@pytest.fixture(scope='module')
def webfront(agent):
return agent.context().lookup('webfront')
@pytest.fixture
def api_url(webfront):
return webfront.local_bas... |
"""
Copied from the python xreload (available for change)
Alternative to reload().
This works by executing the module in a scratch namespace, and then
patching classes, methods and functions in place. This avoids the
need to patch instances. New objects are copied into the target
namespace.
Some of the many limita... |
##########################################################################
#
# Copyright (c) 2008-2011, Image Engine Design 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:
#
# * Redis... |
from __future__ import absolute_import
from collections import defaultdict
from django import forms
from django.conf import settings
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.forms.models import modelform_factory
from django.http import HttpResponseRedirect
from djang... |
#!/usr/bin/python
#This is the main Fina API broker
import os
import cherrypy
import finaLib as fl
currentDir = os.path.dirname(os.path.abspath(__file__))
class fina(object):
exposed = True
@cherrypy.tools.accept(media='text/plain')
def GET(self, tid=None, cat=None, graph=None, graphType=None, sortby=None, s... |
""" Module of generic event packets and their contents.
All relevant classes are held in a single file according
to their type.
Classes here follow the API described in:
- /usr/include/libcaer/events/packetContainer.h
"""
import ctypes
from packet_definitions import caerEventPacketHeader
from packet_definitions imp... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import tensorflow as tf
from polyaxon_schemas.optimizers import AdamConfig
from polyaxon_lib.libs.utils import get_tracked
from polyaxon_lib.models.rl.base import BasePGModel
class VPGModel(BasePGModel):
"""Implements a va... |
from django.db import models
import bcrypt
from django.core.files.storage import FileSystemStorage
from django.conf import settings
# Create your models here.
file_system = FileSystemStorage(location=settings.FILE_SYSTEM)
profile_pic_file_system = FileSystemStorage(location=settings.PROFILE_PICTURE_FILE_SYSTEM)
clas... |
# Copyright 2015 moco_beta
#
# 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, softwa... |
#
# 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 us... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
r_what_color.py
---------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
****************************... |
# -*- coding: utf-8 -*-
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Test the key_value_store module."""
from __future__ import print_function
import os
from chromite.lib import cros_test_lib
f... |
#!/usr/bin/env python
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
import re
from lxml.etree import XPath as X
from calibre.utils.filenames im... |
# 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 agreed to in... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Provides logging services for the MSG Data Science Project.
Setting self.shouldRecord=True provides a way of collecting all logging output
for the instantiated logger into self.recording.
Usage:
from msg_logger import MSGLogger
self.logger = MSGLogger(__name__)
The... |
# Copyright 2018 Capital One Services, 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... |
##
# Copyright (C) 2013-2014 Jessica Tallon & Matt Molyneaux
#
# This file is part of Inboxen.
#
# Inboxen 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,... |
# Copyright 2016, 2017 Peter Zybrick and others.
#
# 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... |
from __future__ import absolute_import, division, print_function
import unittest
from datetime import datetime
from pytz import timezone
from pytz.reference import Eastern
from pyoos.collectors.collector import Collector
class CollectorTest(unittest.TestCase):
def test_times_return_utc(self):
c = Colle... |
import os
import sys
import shutil
import unittest
sys.path.append(os.path.join(os.path.dirname(__file__), "../"))
from PIL import Image
import numpy as np
from model.environment import Environment
from model.agent import Agent
from model.dqn_agent import DQNAgent, Q
class FormatAgent(Agent):
def __init__(self, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
""" Integration tests against zimbraAccount SOAP webservice
It has to be tested against a zimbra server (see README.md)
"""
import unittest
from six import text_type, binary_type
from zimsoap import utils
from zimsoap.client imp... |
################################################################################
# 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... |
from os import path
from saml2 import BINDING_HTTP_REDIRECT
from saml2.entity_category.at_egov_pvp2 import EGOVTOKEN, CHARGEATTR
from _util.TestHelper import create_cookie_header, get_url_dict, get_post_action_body
from _util.TestIdP import TestIdP
from _util.TestSp import TestSp
__author__ = 'haho0032'
import che... |
'''
common XBMC Module
Copyright (C) 2011 t0mm0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Th... |
"""audio_read reads in a whole audio file with resampling."""
# Equivalent to:
#import librosa
#def audio_read(filename, sr=11025, channels=1):
# """Read a soundfile, return (d, sr)."""
# d, sr = librosa.load(filename, sr=sr, mono=(channels == 1))
# return d, sr
# The code below is adapted from:
# https://gi... |
#
# Copyright 2015 Peter Sprygada <[EMAIL]>
#
# This file is part of Ansible
#
# Ansible 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... |
# -*- coding: utf-8 -*-
from preview import Preview
class PreviewControl(object):
"""
This class is a controler for preview.
"""
preview = None
def __init__(self, painter_class = None):
self.painter_class = painter_class
@staticmethod
def start(**args):
'''
Au... |
"""
nose-long-descriptions - Improves nose test description output
By default, a nose test description is either the first line of its docstring,
or its id. Enabling this plugin means that it uses both, both are present.
"""
# pylint: disable=invalid-name,no-self-use
from nose.plugins import Plugin
class EnhancedDe... |
#!/usr/bin/python
#
# pyku
# ====
# Python-based random haiku generator
#
# Chris Collins, <[EMAIL]>
#
# v0.5 - 2013-11-15
#
# Copyright (C) 2013 Chris Collins
#
# 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 Softw... |
#!/usr/bin/env python3
############################################################################
# Script para Validação de push de forma a evitar quebras do projeto de #
# testes do calabash. #
#################################################################... |
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# 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
... |
# coding: utf-8
"""
Qc API
Qc API # noqa: E501
The version of the OpenAPI document: 3.0.0
Contact: [EMAIL]
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import datetime
import telestream_cloud_qc
from telestream_cloud_qc.models.telete... |
# Copyright 2016 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... |
# -*- coding: utf-8 -*-
# Copyright (C) 2010 Holoscópio Tecnologia
# Author: Luciana Fujii Pontello <[EMAIL]>
#
# 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, o... |
# from datetime import datetime
from inis.modules.deposit.forms import UploadForm
from inis.modules.deposit.tasks import create_error_message, \
file_names_not_in_TRNs, get_TRNs, get_duplicated_trns, \
launch_bibsched_tasks, notify_rejection, \
notify_submission, validate
from inis.utils import get_kb_key... |
#
# 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 us... |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, [EMAIL], All rights reserved.
# LLNL-CODE-647188
#
# F... |
from basicDNSSEC import BasicDNSSEC
import os
import subprocess
class basicNSEC3(BasicDNSSEC):
__test__ = True
_confdir = 'basicNSEC3'
@classmethod
def secureZone(cls, confdir, zonename, key=None):
zone = '.' if zonename == 'ROOT' else zonename
if not key:
pdnsutilCmd = [os... |
import coursemanager.models as coursemanager
from django.contrib.auth.models import User
from datetime import datetime
'''
UserProfiles.
'''
jeanyangUser=coursemanager.UserProfile.objects.create(
username="jeanyang"
, email="[EMAIL]"
, name="Jean Yang"
, role='a'
)
benUser=coursemanager.UserProfile.objects.... |
from io import BytesIO
import numpy as np
import six
from ..io.manage_plugins import call_plugin
from ..color import rgb2grey
from .util import file_or_url_context
from ..exposure import is_low_contrast
from .._shared.utils import all_warnings, warn
__all__ = ['imread', 'imsave', 'imshow', 'show',
'imrea... |
# ScoreQuality_minuit.py is a program that reads protein sequence and its correct confermation
# reads structure information, calculates the scores of the scoring matrix using different scoring
# parameters ratios
# The program uses pyminuit to optimize the calculated score in a way that it will match the correct
# co... |
from libqtile.widget import base
import cairocffi
class IconTextBox(base._TextBox):
defaults = [
('update_interval', 5, 'The update interval'),
]
def __init__(self, **config):
base._TextBox.__init__(self, text='Not Connected', **config)
self.add_defaults(IconTextBox.defaults)
... |
#!/usr/bin/env python3
# Copyright (c) 2017-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test message sending before handshake completion.
A node should never send anything other than VERSION... |
from DIRAC import gLogger
from DIRAC.Resources.Storage.GFAL2_XROOTStorage import GFAL2_XROOTStorage
from DIRAC.Resources.Storage.GFAL2_SRM2Storage import GFAL2_SRM2Storage
sLog = gLogger.getSubLogger(__name__)
class CTAStorage(GFAL2_XROOTStorage):
""" Plugin to interact with CERN CTA.
It basically is XROOT ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.