text stringlengths 475 200k |
|---|
#-*- coding: utf-8 -*-
# tracer.py
# Tracer finds outdated running applications in your system
#
# Copyright (C) 2016 Jakub Kadlcik
#
# 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... |
from __future__ import absolute_import, division
from twisted.trial import unittest
import copy
import sys
from mock import Mock, patch
from twisted.python.components import registerAdapter
from klein import Klein
from klein.app import KleinRequest
from klein.interfaces import IKleinRequest
from klein.test.util im... |
import pytest
from thefuck.rules.prove_recursively import match, get_new_command
from thefuck.types import Command
output = '''Files=0, Tests=0, 0 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)
Result: NOTESTS'''
@pytest.fixture
def isdir(mocker):
return mocker.patch('thefuck.rules.prove_recursively'
... |
from os import path
import os
import sublime
import sublime_plugin
YO_CMD = 'yo'
DEBUG = True
class TamiaCommand(sublime_plugin.WindowCommand):
def run(self, *args, **kwarg):
self.generator = kwarg.get('generator', False)
if not self.generator:
sublime.status_message('Generator not defined.')
return
s... |
from __future__ import print_function
import IMP
import IMP.test
import IMP.core
import IMP.atom
import IMP.em2d as em2d
import IMP.em
import os
from math import *
class Tests(IMP.test.TestCase):
def test_registration(self):
"""Test the registration of 3 subjects from 1gyt.pdb at 0.5 SNR"""
# Get... |
# The MIT License (MIT)
#
# Copyright (c) 2016 Yutkin Dmitry
#
# 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, mod... |
from collections import namedtuple, defaultdict
from functools import total_ordering
from os.path import commonprefix
import re
from corehq.apps.app_manager import id_strings
import urllib
from django.core.urlresolvers import reverse
from lxml import etree
from eulxml.xmlmap import StringField, XmlObject, IntegerField,... |
# coding= utf-8
"""
处理帖子内容
"""
import re
import time
import requests
from bs4 import BeautifulSoup
from http import getHtml
def thread_list(url):
'''
获取帖子列表
:param url:
:return:
'''
try:
soup = BeautifulSoup(getHtml(url),"lxml")
alist = soup.find_all("a",id=True,target="_blank")
result = []
for child i... |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2017 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
# T... |
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from _emerge.EbuildPhase import EbuildPhase
from _emerge.BinpkgFetcher import BinpkgFetcher
from _emerge.BinpkgEnvExtractor import BinpkgEnvExtractor
from _emerge.BinpkgExtractorAsync import BinpkgExtractorAsync
... |
# -*- coding: utf-8 -*-
# phppo2pypo unit tests
# Author: Wil Clouser <[EMAIL]>
# Date: 2009-12-03
from io import BytesIO
from translate.convert import test_convert
from translate.tools import phppo2pypo
class TestPhpPo2PyPo:
def test_single_po(self):
inputfile = b"""
# This user comment refers to: %1... |
"""
This is a setup.py script generated by py2applet
Usage:
python setup-mac.py py2app
"""
# manually remove sample-data mpl subdirectory from Python installation:
# sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mpl-data/sample_data
from distutils import sys... |
"""Adapters for Jupyter msg spec versions."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import re
import json
from datetime import datetime
from jupyter_client import protocol_version_info
def code_to_line(code, cursor_pos):
"""Turn a multiline code b... |
# -*- coding: utf-8 -*-
"""
Project name: OMSTD
Project URL: https://github.com/cr0hn/open_shortener
Copyright (c) 2014, cr0hn<-AT->cr0hn.com
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. Redistr... |
"""
Test for LMS courseware app.
"""
from textwrap import dedent
from unittest import TestCase
import mock
from django.urls import reverse
from opaque_keys.edx.keys import CourseKey
from six import text_type
from courseware.tests.helpers import LoginEnrollmentTestCase
from lms.djangoapps.lms_xblock.field_data import ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from BeautifulSoup import BeautifulSoup
import sqlite3 as lite
import os
CON = None
def connect():
global CON
db_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)), "db")
CON = lite.connect(os.path.join(db_dir, "spiderwave.db"))
def disconnect():
... |
from tweepy import Stream, OAuthHandler, StreamListener, TweepError
from kafka import KafkaProducer #Tested on kafka-python 1.0.2
import json
import sys
"""
Can be tested with kafka-console-consumer.sh.
"""
def load_auth_info(keys_file, app_name):
with open(keys_file) as fp:
d = json.load(fp)
fo... |
#!/usr/bin/python
# -*- coding: utf-8 -*-f
import json
import httplib, urllib, urllib2
import time
from datetime import datetime
import requests
import urllib
#!/usr/bin/python
# -*- coding: utf-8 -*-f
#Import modules for CGI handling
import cgi, cgitb
import Cookie, os, time
#============================ config ... |
from __future__ import division
import numpy as np
from vector_maths import normalize
def BlinnPhong_specular(incident_vector, view_vector, surface_norm, shininess_exponent, intensity=1.0):
""" Return the Blinn-Phong specular intensity for a given light reflection into a viewpoint on a surface with a shininess f... |
# coding: utf-8
"""
Wavefront REST API
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST ... |
# 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 ... |
from flask_wtf import Form
from wtforms import StringField, PasswordField, DateTimeField, IntegerField, RadioField, TextAreaField, BooleanField
from wtforms.validators import (DataRequired, Regexp, ValidationError, Email,
Length, EqualTo, number_range)
from models import User, Apply, em... |
#!/usr/bin/env python
import os
from setuptools import find_packages
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
requires = [
'enum34;python_version < "3.4"'
]
setup(
name='housenumparser',
version='0.2.0',
d... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Qemu(AutotoolsPackage):
"""QEMU is a generic and open source machine emulator and virtual... |
import logging
import os
from abc import abstractmethod
from inflection import camelize
from testwithbaton.api import BatonSetup
class BatonSetupContainer():
"""
Container of a baton setup.
"""
@property
@abstractmethod
def baton_setup(self) -> BatonSetup:
"""
A baton setup
... |
import smtplib
from celery import Celery
from email.mime.text import MIMEText
from SpaceDock.config import _cfg, _cfgi, _cfgb
import redis
import requests
import time
import json
app = Celery("tasks", broker=_cfg("redis-connection"))
donation_cache = redis.Redis(host=_cfg('patreon-host'), port=_cfg('patreon-port'), db... |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 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 markupsafe import Markup
from indico.modules.auth.util import url_for_register
from indico.modules.e... |
"""
Blind Source Separation using the FastICA, FFSep, Jade, JediSep, SOBI, UWedgeSep algorithms with Shogun
Based on the example from scikit-learn
http://scikit-learn.org/
Kevin Hughes 2013
"""
import matplotlib.pyplot as plt
import numpy as np
import shogun as sg
# Generate a sample data
np.random.seed(0)
NUM_SAMP... |
"""
Test lldb data formatter subsystem.
"""
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
class Radar9974002DataFormatterTestCase(TestBase):
# test for rdar://problem/9974002 ()
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# Call sup... |
# Copyright 2021 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, ... |
"""
Support for exposing Concord232 elements as sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.concord232/
"""
import datetime
import logging
import requests
import voluptuous as vol
from homeassistant.components.binary_sensor im... |
# 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, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY W... |
from rezgui.qt import QtCore, QtGui
from rezgui.widgets.ConfiguredSplitter import ConfiguredSplitter
from rezgui.widgets.PackageLineEdit import PackageLineEdit
from rezgui.widgets.PackageVersionsTable import PackageVersionsTable
from rezgui.widgets.PackageTabWidget import PackageTabWidget
from rezgui.mixins.ContextView... |
import os
import sys
import logging
import logging.config
BASEDIR = os.path.realpath(os.path.dirname(os.path.dirname(sys.path[0])))
logdir = os.path.join(BASEDIR, 'logs')
OUTFILE = os.path.join(logdir, 'tests.log')
if not os.path.exists(logdir):
os.mkdir(logdir)
TEST_LOGGING = {
'version': 1,
'incremental... |
# Copyright (c) 2013 Hortonworks, 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 in ... |
# -*- 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... |
######################################################################
# Copyright (C) 2014 Jaakko Luttinen
#
# This file is licensed under Version 3.0 of the GNU General Public
# License. See LICENSE for a text of the license.
######################################################################
####################... |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use ... |
# A 'job server' which actually runs the requests. At the moment this is
# simply a proof of concept. It runs one job at a time and has no
# provisions for supporting multiple job managers or multiple in flight jobs.
# This job-server will try to run jobs which haven't been started before, but
# will not retry jobs... |
#
# neural network optimisation classes
# rupert small, august 2015
#
from Queue import Queue
from numpy import *
from create_MEGA_THETA import *
from RLU_forward_backward import *
import threading
class dr_singles(object):
'''create instance of dr_singles neural network'''
def __init__(self, alpha, beta, base_in... |
import pytest
from pnc_cli import products
from pnc_cli import productversions
from pnc_cli import utils
from pnc_cli.swagger_client.apis.products_api import ProductsApi
from pnc_cli.swagger_client.apis.productversions_api import ProductversionsApi
from test import testutils
import pnc_cli.user_config as uc
@pytest.fi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
readme = open('README.rst').read()
history = open('HISTORY.rst... |
"""A POP3 client class.
Based on the J. Myers POP3 draft, Jan. 96
"""
# Author: David Ascher <[EMAIL]>
# [heavily stealing from nntplib.py]
# Updated: Piers Lauder <[EMAIL]> [Jul '97]
# String method conversion and test jig improvements by ESR, February 2001.
# Added the POP3_SSL class. Methods loose... |
#!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class perl_WWW_Curl(test.test):
"""
Autotest module for testing basic functionality
of perl_WWW_Curl
@author Basavaraju.G <[EMAIL]>
"""
version = 1
nfail = 0
p... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from io import BytesIO
import astropy.units as u
import astropy.coordinates as coord
from astropy.io import fits
from ..query import BaseQuery
from ..utils import commons, prepend_docstr_nosections
from . import conf
from ..exceptions import InvalidQueryE... |
"""The tests for the Google Calendar component."""
import logging
import unittest
from unittest.mock import patch
import homeassistant.components.google as google
from homeassistant.setup import setup_component
from tests.common import get_test_home_assistant
_LOGGER = logging.getLogger(__name__)
class TestGoogle(u... |
#!/usr/bin/env python
"""
progressbar.py
A Python module with a ProgressBar class which can be used to represent a
task's progress in the form of a progress bar and it can be formated in a
basic way.
Here is some basic usage with the default options:
>>> from progressbar import ProgressBar
>>> p = ProgressBa... |
# Copyright (C) 2013-2015 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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.a... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import wx
import widgetUtils
class displayBasicPost(widgetUtils.BaseDialog):
def __init__(self, *args, **kwargs):
super(displayBasicPost, self).__init__(parent=None, *args, **kwargs)
self.panel = wx.Panel(self, -1)
self.sizer = wx.BoxSizer(wx.VERTI... |
# 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 applicable ... |
#coding=UTF-8
'''
Created on 2011-7-6
@author: Administrator
'''
from urlparse import urlparse
import cookielib
import urllib2,urllib
from pyquery.pyquery import PyQuery
import re
import time
import datetime
import urllib2
from lxml import etree
import datetime
import time
from urlparse import urlparse
import re
from ... |
#
#
# Copyright (C) 2006, 2007, 2010, 2011 Google 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 progr... |
""" Mail commands module. """
from gandi.cli.core.base import GandiModule
class Mail(GandiModule):
""" Module to handle CLI commands.
$ gandi mail create
$ gandi mail delete
$ gandi mail info
$ gandi mail list
$ gandi mail purge
$ gandi mail update
"""
@classmethod
def lis... |
# This file is part of the Hotwire Shell user interface.
#
# Copyright (C) 2007 Colin Walters <[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, or
#... |
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.client import Client
from profiles.models import Profile
from protocols.models import Protocol, Step, Action, Component
from organization.models import Organization, Membership
from workflow.models import Workflow
from exper... |
#
# Copyright (c) 2008--2016 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Batch.mashing_scheme_start'
db.delete_column('brew_batch', 'mashing_scheme_start')
d... |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'Invoke-EgressCheck',
# list of one... |
#!/usr/bin/python3
## system-config-printer
## Copyright (C) 2010 Red Hat, Inc.
## Author: Tim Waugh <[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 Licen... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nachi Ueno, NTT MCL, 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.... |
import argparse
import json
import time
import random
import utils
class Spawnpoint(object):
def __init__(self, data):
# not needed but useful for debugging
self.spawnpoint_id = data.get('spawnpoint_id') or data.get('sid')
try:
self.position = (float(data['latitude']), float... |
# coding:utf-8
#
import pygame
from pygame.locals import *
from sys import exit
import random
pygame.init()
tela = pygame.display.set_mode((640,480),0,32)
pygame.display.set_caption("Pong Pong!")
# Prepara as duas barras, a bolinha e o fundo
fundo = pygame.Surface((640,480))
fundo = fundo.convert()
... |
from scipy import interpolate
import numpy as np
def get_sigma(covariance):
"""Returns sigma values from covariances.
:param covariance: array of covariance matrices
:type covariance: 3d array
:return: array of sigma values
:rtype: 1d array
"""
sigma = np.empty(covariance.shape[0:2])
... |
############################################################################
#
# Copyright (C) 2016 The Qt Company Ltd.
# Contact: https://www.qt.io/licensing/
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt licenses may use this file in
# accordance with the co... |
"""
GitMon - The Git Repository Monitor
Copyright (C) 2010 Tomas Varaneckas
http://www.varaneckas.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 3 of the License, or
(at your opt... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Description: TODO
"""
__author__ = "Ariel Gerardo Rios ([EMAIL])"
import os
from uuid import uuid4
from django.db import models
class ImageModel(models.Model):
"""
TODO
"""
@property
def image(self):
"""
TODO
"""
... |
from django.conf import settings
from django.utils.module_loading import import_string
from django.core.management.base import BaseCommand
logging_levels = {3: 'DEBUG', 2: 'INFO', 1: 'WARNING', 0: 'ERROR'}
logging_formats = {
0: '%(module)s: %(message)s',
1: '%(levelname)s %(module)s: %(message)s',
2: '%(... |
#!/usr/bin/env python
'''
@file freq_scale.py
@brief Sandbox for various frequency scale generators
@author gm
@copyright gm 2014
This file is part of Chartreuse
Chartreuse 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 Fo... |
from django.conf import settings
import nltk
from .tagging_common import universal_word_tagger_hub
from nltk.corpus import wordnet
from pattern3.vector import stem, PORTER, LEMMA
#from pattern.en import parse
#import lemmagen.lemmatizer
#from lemmagen.lemmatizer import Lemmatizer
#from tagging_common_parallel import... |
# TODO (jkp 2017-08-29) figure out a way to break this up
# pylint: disable=too-many-lines
"""Model definitions."""
import os
from datetime import datetime
from hashlib import md5
from flask import url_for
from . import db
from .utils import next64
class ApiModel(db.Model):
"""Abstract base model."""
__abs... |
#!/usr/bin/env python
# Scans for library dependencies and plot a graph between those.
#
# Copyright (C) 2015 Peter Wu <[EMAIL]>
# Licensed under the MIT license, see LICENSE for details.
#
# Invoke `scanlibs.py --help` for usage. Examples:
#
# Print all libraries and its dependencies (paths followed by zero or more
# ... |
#!/usr/bin/python
# ROS specific imports
import roslib; roslib.load_manifest('task_manager_turtlesim')
import rospy
from math import *
from task_manager_lib.TaskSmach import *
rospy.init_node('task_client')
wp = [ [1., 9., pi/2, 0, 0, 255],
[9., 9., 0., 0, 255, 255],
[9., 1., -pi/2, 0, 255, 0],
[1., 1., -... |
# -*- coding: utf-8 -*-
"""
Robust Single Linkage: Density based single linkage clustering.
"""
import numpy as np
from sklearn.base import BaseEstimator, ClusterMixin
from sklearn.metrics import pairwise_distances
from scipy.sparse import issparse
from sklearn.externals.joblib import Memory
from sklearn.externals im... |
"""Module providing an API for creating data simulators.
"""
import math, datetime
from pyvol.est.CovUtils import Mean
class SimAPI:
"""Provides an interface for data simulators to follow.
This is a simple application programming interface (API) that data
simulators should follow. Having a cons... |
from unittest import TestCase, mock
from nose.plugins.attrib import attr
from shiftschema.validators import Required
@attr('validator', 'required')
class RequiredTest(TestCase):
""" Required validator test"""
def test_create(self):
""" Can instantiate required validator """
validator = Requi... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# 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... |
##############################################################################
# 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... |
'''
Created on Jan 28, 2013
@author: mmunn
Unit test : EUCA-4128 euca-describe-volumes (verbose) takes a long time to return with results
setUp : Install Credentials,
test : Starts 4 instances and creates 85 volumes. It then calls euca-describe-volumes 10
times a... |
#!../../../../virtualenv/bin/python3
# -*- coding: utf-8 -*-
# NB: The shebang line above assumes you've installed a python virtual environment alongside your working copy of the
# <4most-4gp-scripts> git repository. It also only works if you invoke this python script from the directory where it
# is located. If these... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2011, Nicolas Clairon
# 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 abov... |
"""
Support for RFXtrx binary sensors.
Lighting4 devices (sensors based on PT2262 encoder) are supported and
tested. Other types may need some work.
"""
import logging
import voluptuous as vol
from homeassistant.components import rfxtrx
from homeassistant.util import slugify
from homeassistant.util import dt as dt_u... |
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2020 CS GROUP - France
# License: GNU GPL v2 <http://www.gnu.org/licenses/gpl-2.0.html>
"""
This module contains the classes used in the configuration system.
"""
__all__ = [
'get_text',
'get_attrib',
]
def get_text(elem):
"""
Renvoie le texte contenu dans... |
#===----------------------------------------------------------------------===##
#
# The LLVM Compiler Infrastructure
#
# This file is dual licensed under the MIT and the University of Illinois Open
# Source Licenses. See LICENSE.TXT for details.
#
#===------------------------------------------------... |
from morb.base import Stats
import numpy as np
import theano
def gibbs_step(rbm, vmap, units_list, mean_field_for_stats=[], mean_field_for_gibbs=[]):
# implements a single gibbs step, and makes sure mean field is only used where it should be.
# returns two vmaps, one for stats and one for gibbs.
# also ... |
from datetime import date
def test_ffi(mio):
mio.eval('''
date = FFI clone("date", """
from datetime import date
__all__ = ("today",)
def today():
return date.today().strftime("%B %d, %Y")
""")
''')
today = date.today().strftime("%B %d, %Y")
assert mio.eval("date today()") == today
mio.e... |
#!/usr/bin/env python
# coding: utf-8
# Copyright 2016 Peter Román
# This file is part of 4p which is licensed under GNU GPL v3.
# See the file named LICENSE for details.
from subprocess import Popen, PIPE
from hypothesis import given, assume
from hypothesis.strategies import text
def parse(data):
output, _ = ... |
import logging
import os
import sys
import time
import yaml
from contracts import contract, new_contract
from functools import partial
from lxml import etree
from collections import namedtuple
from pkg_resources import (
resource_exists,
resource_listdir,
resource_string,
resource_isdir,
)
from webob i... |
# app/views/admin.py
from flask import flash, current_app, Flask, render_template, request, redirect, url_for, Blueprint
from .forms import AdminUserForm, AdminRoleForm
from ..models import *
# This is the view that shows the admin dashboard.
admin = Blueprint('admin', __name__, url_prefix='/admin')
@admin.route('... |
import types
from MaKaC.errors import MaKaCError
import MaKaC.conference as conference
import MaKaC.errors as errors
import MaKaC.domain as domain
import MaKaC.roomMapping as roomMapping
import MaKaC.webinterface.materialFactories as materialFactories
import MaKaC.debug as debug
debug.enter(__name__)
class CategoryWe... |
import copy
import rdtest
import renderdoc as rd
class D3D12_Vertex_Attr_Zoo(rdtest.TestCase):
demos_test_name = 'D3D12_Vertex_Attr_Zoo'
def check_capture(self):
action = self.find_action("Draw")
self.check(action is not None)
self.controller.SetFrameEvent(action.eventId, False)
... |
#!/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>'
from collections import OrderedDict
from calibre.ebooks.docx.names import XPa... |
import subprocess
import os
import importlib
from sys import platform as _platform
currentDir = os.path.dirname(os.path.abspath(__file__))
class CommandInspector(object):
def __init__(self):
self.available = self.load_commands()
def callPlugin(self, command, config):
sequence = command.split(... |
import os
CREDITS = """
Developers:
Angelo Nuffer ([EMAIL])
Dyogo Veiga ([EMAIL])
Whanderley ([EMAIL])
Fonts:
Water on the Oil *
Mail Ray Stuff -> Ray Larabie - http://www.larabiefonts.com
Music:
Pocketmaster - http://www.pocketmaster.ch/
* If you know the author, send his name to a develop... |
#!/usr/bin/env python
import sys, random
class NthOrder():
def __init__(self, order, text_length, stream=sys.stdin):
self.order = order
self.stream = stream
self.list_of_combinations = {}
self.generated_text_length = text_length
self.generated_text = ""
self.abominio = ['\n', '\r', '-']
def parse(self... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
# 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 t... |
"""
Tests for ga_invitation middleware.
"""
from contextlib import nested
from datetime import timedelta
import ddt
from mock import patch
from unittest import skip
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase, RequestFactory
from django.util... |
import os
try:
import cPickle as pickle
except:
import pickle
from PIL import Image
from subprocess import Popen
import numpy as np
from numpy.lib.stride_tricks import as_strided
import os
import gzip
from random import shuffle
from collections import OrderedDict
import inspect
import h5py
import sys
from skima... |
from pycp2k.inputsection import InputSection
from ._move_mm_charge1 import _move_mm_charge1
from ._add_mm_charge1 import _add_mm_charge1
class _link1(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Qm_index = None
self.Qm_kind = None
self.Mm_index = None
... |
# -*- coding: utf-8 -*-
"""
waveforms.py - Waveform functions used by StimGenerator
Copyright 2010 Luke Campagnola
Distributed under MIT/X11 license. See license.txt for more infomation.
This file defines several waveform-generating functions meant to be
called from within a StimGenerator widget.
"""
import numpy
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.