src stringlengths 721 1.04M |
|---|
import sys
from maya import OpenMaya, OpenMayaUI, cmds
from rjSkinningTools import ui, utils
from . import getSkinnedVertices
# ----------------------------------------------------------------------------
WINDOW_TITLE = "Tweak Vertex Weights"
WINDOW_ICON = "tweakVertexWeights.png"
ORANGE_STYLESHEET = "QLabel{color:... |
#
# Copyright 2017 The E2C 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 l... |
"""
If astroid node
An if statement.
Attributes:
- test (NodeNG)
- Holds the node to evaluate such as Compare.
- body (list[NodeNG])
- A list of nodes that will execute if the test condition passes.
- orelse (list[NodeNG])
- A list of nodes executed when the test condi... |
###############################################################################
# Copyright (c) 2017 Merantix GmbH
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http:... |
import Queue
import json
import signal
import time
from tornado import gen
from tornado.ioloop import IOLoop
from tornado.web import Application, RequestHandler
from tornado.httpserver import HTTPServer
from binder.service import Service
from binder.app import App
from binder.cluster import ClusterManager
from .buil... |
# -*- coding: utf-8 -*-
"""
gdown.modules.rapidgator
~~~~~~~~~~~~~~~~~~~
This module contains handlers for rapidgator.
"""
import re
import json
from time import sleep
from datetime import datetime
from dateutil import parser
from ..module import browser, acc_info_template
from ..exceptions import ModuleError
de... |
#!/usr/bin/env python
#
# Copyright 2007 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 o... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import copy
class BotController(object):
THREADBASE = "TichyThread-{}"
def __init__(self):
self.__childBots = {}
def __del__(self):
for i in self.__childBots:
self.stopBot(i)
del self.__childBots
#######
###... |
import codecs, encodings
"""Caller will hand this library a buffer and ask it to either convert
it or auto-detect the type.
Based on http://code.activestate.com/recipes/52257/
Licensed under the PSF License
"""
# None represents a potentially variable byte. "##" in the XML spec...
autodetect_dict={ # bytepattern ... |
#!/usr/bin/ python
# -*- coding: utf-8 -*-
import sys
import smtplib
from email import Encoders
from email.MIMEText import MIMEText
from email.MIMEBase import MIMEBase
from email.MIMEMultipart import MIMEMultipart
from email.Header import Header
from email.Utils import formatdate
class Gmail(object):
def create_mess... |
""" The CS! (Configuration Service)
"""
__RCSID__ = "$Id$"
from DIRAC.Core.Utilities.ReturnValues import S_OK, S_ERROR
from DIRAC.ConfigurationSystem.private.ServiceInterface import ServiceInterface
from DIRAC.Core.DISET.RequestHandler import RequestHandler
from DIRAC.Core.Utilities import DErrno
gServiceInterface =... |
class ResponseMaker(object):
__slot__ = ['error_verbose']
def __init__(self, error_verbose=True):
self.error_verbose = error_verbose
def get_response(self, result, request_id):
return {
"jsonrpc": "2.0",
"result": result,
"id": request_id
}
... |
# coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page i... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
"""
Appswell Error Handling Lib
functions for handling errors
USAGE
from lib import error_handling
error_details = error_handling.get_error_details()
error_page = error_handling.render_error_page(error_details)
"""
#
# IMPORTS
#
import sys, os, logging, inspect
from os.path import (abspath, di... |
# Copyright 2014 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 ... |
# coding: utf-8
# Copyright (c) 2015-2016, thumbor-community
# Use of this source code is governed by the MIT license that can be
# found in the LICENSE file.
from json import loads, dumps
from os.path import join, splitext
from datetime import datetime
from dateutil.tz import tzutc
from tornado.concurrent import re... |
from webtest import TestApp
from jobhuntr.wsgi import application
from django.test import TestCase
from django.test import Client
from django.utils.six import StringIO
from django.urls import reverse
from django.core.management import call_command
from django.test.utils import setup_test_environment
#setup_test_envir... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# qooxdoo - the new era of web development
#
# http://qooxdoo.org
#
# Copyright:
# 2006-2010 1&1 Internet AG, Germany, http://www.1und1.de
#
# License:
# LGPL: http://www.gnu.org/li... |
# coding: utf8
from math import pi
import numpy as np
from scipy.signal import convolve2d
SOBEL_X = np.array([
[ 1, 0, -1],
[ 2, 0, -2],
[ 1, 0, -1],
])
SOBEL_Y = np.array([
[ 1, 2, 1],
[ 0, 0, 0],
[-1, -2, -1],
])
class GradientImage(object):
def __init__(self, magnitudes, angles)... |
# -*- coding: utf-8 -*-
"""This module provides features to create and evaluate garbled circuits"""
__all__ = ["AbstractCreatorGarbledCircuit", "AbstractEvaluatorGarbledCircuit"]
### CreatorGarbledCircuit
class AbstractCreatorGarbledCircuit(object):
"""
Creator Garbled Circuit Abstract Class
DOCUMENT ME!... |
from sqlalchemy import text
from sqlalchemy.exc import IntegrityError as SqlalchemyIntegrityError
from pymysql.err import IntegrityError as PymysqlIntegrityError
from sqlalchemy.exc import InvalidRequestError
from .basic import db_session
from .models import (
LoginInfo, KeywordsWbdata, KeyWords, SeedIds, UserRela... |
# Copyright 2015 Lenovo Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2015 by the Free Software Foundation, 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) ... |
from tardis.tardis_portal.publish.publishservice import PublishService
PARTY_RIFCS_FILENAME = "MyTARDIS-party-%s.xml"
COLLECTION_RIFCS_FILENAME = "MyTARDIS-%s-dataset-%s.xml"
class PartyPublishService(PublishService):
def get_template(self, type):
return self.provider.get_template(type=type)
... |
import os, subprocess
import json
from webctrlSOAP import webctrlSOAP
from smap import actuate, driver
from smap.authentication import authenticated
class _Actuator(actuate.SmapActuator):
GET_REQUEST = 'getValue'
SET_REQUEST = 'setValue'
def setup(self, opts):
self.devicePath = os.path.expanduser(opts[... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Main module for PyMetaWear
.. moduleauthor:: hbldh <henrik.blidh@nedomkull.com>
Created on 2016-03-30
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
from mbientlab.metawear import Met... |
# Copyright 2016-2017 Akretion (http://www.akretion.com)
# Copyright 2016-2017 Camptocamp (http://www.camptocamp.com/)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, models
class Base(models.AbstractModel):
_inherit = 'base'
@api.model
def _get_new_values(self, re... |
# ----------------------------------------------------------------------------
# This file is part of qarbon (http://qarbon.rtfd.org/)
#
# Copyright (c) 2013 European Synchrotron Radiation Facility, Grenoble, France
#
# Distributed under the terms of the GNU Lesser General Public License,
# either version 3 of the Lice... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Test QiSrc Add Group """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__... |
from __future__ import print_function
# Author: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import warnings
import matplotlib
from numpy.testing import assert_array_almost_equal, assert_allclose
from nose.tools import assert_equal, assert_raises, assert_true
from mne import... |
# -*- coding: utf-8 -*-
#
# Copyright 2014-2020 BigML
#
# 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 ... |
__author__ = 'maartenbreddels'
import functools
import matplotlib.patches as patches
import numpy as np
import matplotlib.artist as artist
import vaex.ui.plugin
from vaex.ui.qt import *
import logging
logger = logging.getLogger("plugin.dispersions")
import matplotlib.transforms as transforms
from matplotlib.path... |
# -*- coding: utf-8 -*-
from selenium.webdriver.support.wait import WebDriverWait
from selenium import webdriver
__author__ = 'lina'
import time
import sys
import xlrd.sheet
import time, os
class Action:
"""
BasePage封装所有页面都公用的方法,例如driver, url
"""
driver = None
# 初始化driver、url、等
def __init__(self, base_url=N... |
#!/usr/bin/env python
import matplotlib
import numpy as np
import wx
import copy
import os
import pmagpy.pmag as pmag
import pmagpy.ipmag as ipmag
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigCanvas
from matplotlib.backends.... |
#!/usr/bin/env python
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import heapq
import logging
import os
import sys
try:
import psutil
except ImportError:
psutil = None
BYTE_UNITS = ['B', 'KiB', '... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010, 2degrees Limited <egoddard@tech.2degreesnetwork.com>.
# All Rights Reserved.
#
# This file is part of djangoaudit <https://launchpad.net/django-audit/>,
# which is subject... |
"""
file: bugfinder.py
author: Christoffer Rosen <cbr4830@rit.edu>
date: November 2013
description: Links changes that introduces bugs by identifying changes
that fix problems.
"""
import re
from orm.commit import *
from caslogging import logging
from analyzer.git_commit_linker import *
import json
class BugFinder:
... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# Dealing with the DataLink layer in the OSI model
# Media Access Control (Ethernet addresses)
#
#
import enum
import sys
from typing import Dict, List
import constants
from interfaces import PhysicalInterface
from utilities import OsCliInter, os_name, the_os
class ... |
"""Test dbcbet"""
from dbcbet.dbcbet import pre, post, inv, throws, dbc, bet, finitize, finitize_method, ContractViolation, ThrowsViolation
from dbcbet.helpers import state, argument_types
#
# These methods are the various preconditions, postconditions, and invariants used by tests
#
# a precondition
def both_number... |
#!/usr/bin/env python3
## -*- coding: utf-8 -*-
from __future__ import print_function
from triton import *
from unicorn import *
from unicorn.arm_const import *
import pprint
import random
import sys
ADDR = 0x100000
STACK = 0x200000
HEAP = 0x300000
SIZE = 5 * 1024 * 1024
CODE ... |
# -*- coding: utf-8 -*-
#
# Schema Registry documentation build configuration file, created by
# sphinx-quickstart on Wed Dec 17 14:17:15 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated fil... |
import numpy as np
import unittest2
from instr.base import SourceMeter
class Keithley2636A(SourceMeter):
def __init__(self, rsrc=None, timeout_sec=600, reset=True):
self._smu = 'a'
idn = 'Keithley Instruments Inc., Model 2636A'
super().__init__(rsrc, idn, timeout_sec, reset)
@proper... |
"""
Load a map stored in csv format, as exported by the program 'Tiled.'
Artwork from http://kenney.nl
"""
import arcade
SPRITE_SCALING = 0.5
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
# How many pixels to keep as a minimum margin between the character
# and the edge of the screen.
VIEWPORT_MARGIN = 40
RIGHT_MARGIN = 1... |
#!/usr/bin/python
# vim:set fileencoding=utf-8
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is dis... |
import random
from combat import Combat
class Character(Combat):
attack_limit = 10
experience = 0
base_hit_points = 10
def attack(self):
roll = random.randint(1, self.attack_limit)
if self.weapon == 'sword':
roll += 1
elif self.weapon == 'axe':
roll += 2
elif self.weapon ==... |
"""This script automates the copying of the default keymap into your own keymap.
"""
import shutil
from pathlib import Path
import qmk.path
from qmk.decorators import automagic_keyboard, automagic_keymap
from milc import cli
@cli.argument('-kb', '--keyboard', help='Specify keyboard name. Example: 1upkeyboards/1up60h... |
#! /usr/bin/env python
# Copyright (C) 2012 Club Capra - capra.etsmtl.ca
#
# This file is part of CapraVision.
#
# CapraVision 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 versio... |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... |
"""
===============
Tight Bbox Test
===============
"""
from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
# nodebox section
if __name__ == '__builtin__':
# were in nodebox
import os
import tempfile
W = 800
inset = 20
size(W, 600)
plt.cla()
plt.clf... |
# ***************************************************************************
# * Copyright (c) 2020 Sudhanshu Dubey <sudhanshu.thethunder@gmail.com> *
# * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or m... |
import hashlib
from django import template
from django.db.models import Count
from ..models import Post, Category, Tag, Link
register = template.Library()
@register.inclusion_tag('_navbar.html')
def show_navbar(active, user):
return {'active': active, 'user': user}
@register.inclusion_tag('_sidebar.html')
def sh... |
from django.shortcuts import render
from django.db.models import F
from members.models import Show
class TimeSlot():
def __init__(self, time, shows):
self.time = time
self.shows = shows
class TimeSlotItem():
def __init__(self, name='', host='', genre='Empty', description='', row_span=1):
... |
from Node import error
SYNTAX_NODE_SERIALIZATION_CODES = {
# 0 is 'Token'. Needs to be defined manually
# 1 is 'Unknown'. Needs to be defined manually
'UnknownDecl': 2,
'TypealiasDecl': 3,
'AssociatedtypeDecl': 4,
'IfConfigDecl': 5,
'PoundErrorDecl': 6,
'PoundWarningDecl': 7,
'Poun... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import urllib2
import json
import time
from datetime import datetime
import sys
SSLLABS_API_ENTRYPOINT = 'https://api.ssllabs.com/api/v2/'
_FMT = '%Y-%m-%d %H:%M:%S'
hasColorama = False
def _c(c):
return c if hasColorama else ''
def _parse_args():
... |
#!/usr/bin/python
import os
from rpmUtils.miscutils import splitFilename
from library import Environment, CommandLineUI
class CompareRPMRH(Environment):
"""docstring for CompareRPMRH"""
def __init__(self):
super(CompareRPMRH, self).__init__()
self.ui = CommandLineUI(echoResponses=False)
... |
from Crypto import Random
from Crypto.Cipher import AES as pyAES
import codecs
class AES(object):
def __init__(self):
self.key = None
self._mode = None
self.iv = None
@staticmethod
def str_to_bytes(data):
t = type(b''.decode('utf-8'))
if isinstance(data, t):
... |
"""Count poker hands
Sample program to count poker hands and thus estimate the probability of a given hand occurring .
The file contains 1 million records randomly distributed and is, therefore, statistically valid.
The data looks like this:
1,1,1,13,2,4,2,3,1,12,0
3,12,3,2,3,11,4,5,2,5,1
1,9,4,6,1,4,3,2,3,9,1
1,4,3... |
#!/usr/bin/env python
"""
Connect to a bugzilla xml-rpc.cgi and download all the things.
This exports products, bugs, comments and bug history to a "bugzilla.json"
output file which can in turn be used to quickly import things to a different
format.
"""
import json
import sys
import xmlrpc.client
# Edit these to you... |
from dimagi.utils.couch.cache.cache_core import GenerationCache
class DomainGenerationCache(GenerationCache):
generation_key = '#gen#domain#'
doc_types = ['Domain']
views = [
"domain/snapshots",
"domain/published_snapshots",
"domain/not_snapshots",
"domain/copied_from_snaps... |
# -*- coding: utf-8 -*-
#######################################################
## Documentation
## Abstracts documentation using an n-dimensioned hash.
##
## Documentation( hash )
## Construct instance given a hash of documentation strings, with
## topic=>documentation mappings. Sub-topics can be specified as
## t... |
"""
Module containing the cell definition for the Sugarscape world.
"""
from cab.ca.cell import CellHex
__author__ = 'Michael Wagner'
__version__ = '1.0'
class WorldCell(CellHex):
def __init__(self, x, y, gc):
super().__init__(x, y, gc)
self.t_gen = None
self.sugar = 0
self.spice... |
#! /usr/bin/env python
"""
BLAST sequences from PROKKA annotations
Takes a PROKKA FAA file and a file with an one or more IDs (each ID must be
on its own line). If a PROKKA annotation description contains an ID in
the IDs file, its sequence is BLASTed against NCBI BLAST and the results are
written to a custom TSV. Th... |
from corehq.apps.accounting.models import BillingAccount, DefaultProductPlan, SoftwarePlanEdition, Subscription
from corehq.apps.accounting.tests import generator
from corehq.apps.commtrack.models import CommtrackActionConfig
from corehq.apps.custom_data_fields import CustomDataFieldsDefinition
from corehq.apps.custom_... |
from app import worker, db, app
from app.models.task import Task
from app.models.user import User
from celery.utils.log import get_task_logger
from datetime import datetime, timedelta
import requests
logger = get_task_logger(__name__)
def get_profile(username):
url = 'https://api.github.com/users/%s' % username
... |
import sys
import numpy as np
import genome.db
class ChromStats(object):
def __init__(self):
self.n = 0
self.n_nan = 0
self.sum = 0
self.min = None
self.max = None
def mean(self):
"""Calculates mean of sites that are not nan
on this chromsome"""
... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'MaintenanceParameters'
db.create_table(u'maintenance_main... |
"""
twtxt.helper
~~~~~~~~~~~~
This module implements various helper for use in twtxt.
:copyright: (c) 2016-2017 by buckket.
:license: MIT, see LICENSE for more details.
"""
import shlex
import subprocess
import sys
import textwrap
import click
import pkg_resources
from twtxt.mentions import for... |
#!/usr/bin/env python3
#CLI Password Manager
#
#The MIT License (MIT)
#
#Copyright (c) 2015 Sami Salkosuo
#
#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 withou... |
from typing import Union
from annotypes import Anno, add_call_types
default_desc = "Default value for parameter. If not specified, parameter is required"
with Anno("Specify that this class will take a parameter name"):
AName = str
with Anno("Description of this parameter"):
ADescription = str
with Anno(defau... |
#!/usr/bin/env python
# Copyright (c) 2014, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from... |
from setuptools import setup
from setuptools.command import build_py as b
import os,sys
import glob
#remove build and dist directory
import shutil
#if os.path.exists('build'):
# shutil.rmtree('build')
#if os.path.exists('dist'):
# shutil.rmtree('dist')
def copy_dir(self, package, src, dst):
self.mkpath(dst)... |
# Copyright (c) 2015-2018 by the parties listed in the AUTHORS file.
# All rights reserved. Use of this source code is governed by
# a BSD-style license that can be found in the LICENSE file.
from ..mpi import MPI
from .mpi import MPITestCase
from ..dist import *
import numpy as np
import sys
import os
from ._hel... |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... |
from sklearn import *
import sklearn
import pandas as pd
import numpy as np
import xgboost as xgb
import lightgbm as lgb
from time import gmtime, strftime
import numpy.random as rng
from multiprocessing.dummy import Pool
import h5py
import concurrent.futures
import tensorflow as tf
import multiprocessing as mp
from s... |
# Copyright 2017 Codas Lab
#
# 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... |
import logging
from datetime import datetime
from PIL import Image, ImageOps
from werkzeug.exceptions import Forbidden, InternalServerError, NotFound
from flask import current_app, g
from flask.ext.mongoengine import Document
from mongoengine import MapField, ImageField, DateTimeField, ObjectIdField, ValidationError
... |
#! /usr/bin/python3
########################################################################
# #
# Cyprium is a multifunction cryptographic, steganographic and #
# cryptanalysis tool developped by members of The Hackademy. #
# Fre... |
import re
from PyQt5.QtCore import Qt
from PyQt5.QtCore import QTimer
from PyQt5.QtGui import QFontMetrics
from PyQt5.QtWidgets import QHBoxLayout
from PyQt5.QtWidgets import QMessageBox
from PyQt5.QtWidgets import QLabel
from PyQt5.QtWidgets import QPushButton
from PyQt5.QtWidgets import QSplitter
from PyQt... |
from flask.ext.wtf import Form
from wtforms import TextField, BooleanField, TextAreaField
from wtforms.validators import Required, Length
from models import User
class PostForm(Form):
post = TextField('post', validators = [Required()])
class LoginForm(Form):
openid = TextField('openid', validators = [Required... |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# CMD code copied from git_cl.py in depot_tools.
import config
import cStringIO
import download
import json
import logging
import ... |
# coding:utf-8
"""
Validation module that that supports alternate spelling suggestions for
domains, MX record lookup and query, as well as custom local-part grammar for
large ESPs.
This module should probably not be used directly, use
flanker.addresslib.address unles you are building ontop of the library.
Public Fun... |
__version__ = '0.0.2'
import os, time, tempfile
from spectre.psfascii import psfascii
from subprocess import Popen, PIPE, STDOUT
from functions.system import rm, source
from config import *
__all__ = ['spectre']
class spectre(object):
__parameters__ = { 'log':'spectre.log', 'path':'', 'filename':'spectre.c... |
'''
(*)~---------------------------------------------------------------------------
This file is part of Pupil-lib.
Pupil-lib 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
(a... |
"""Support for the myStrom buttons."""
import logging
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorDevice
from homeassistant.components.http import HomeAssistantView
from homeassistant.const import HTTP_UNPROCESSABLE_ENTITY
_LOGGER = logging.getLogger(__name__)
async def async_setup_platfo... |
#!/usr/bin/python
"""
NumberGuesser
Guesses your number!
Author: Greg Stewart
Copyright 2014 Greg Stewart
Start: 7/15/14
Tries to guess your number, interacts with you via the Raspberry pi's
16x2 CharLCDPlate
It uses a relatively simple algorithm to guess numbers:
Step 1:
Find a number that is larger tha... |
# 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 agreed ... |
# coding=utf-8
# ==============================================================================
import tensorflow as tf
# ==============================================================================
FLAGS = tf.app.flags.FLAGS
# ==============================================================================
# ---... |
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.models import User
from django.db.models import Sum, Count
from django.http import Http404
from django.shortcuts import get_object_or_404, render_to_response
from django.template import RequestContext
from exceptions impor... |
from testutils.presentation_api.implementations.manifest_factory.loader import \
ManifestReader
from iiifoo_utils import image_id_from_canvas_id
def validate(manifestjson, logger=None):
"""Validate a given manifest json object."""
mr = ManifestReader(manifestjson)
try:
r = mr.read()
js... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... |
"""Truncated SVD for sparse matrices, aka latent semantic analysis (LSA).
"""
# Author: Lars Buitinck
# Olivier Grisel <olivier.grisel@ensta.org>
# Michael Becker <mike@beckerfuffle.com>
# License: 3-clause BSD.
import numpy as np
import scipy.sparse as sp
from scipy.sparse.linalg import svds
from ..... |
#!/usr/bin/python
def main():
# hex1()
hex2()
def hex1():
# ba1 = bytearray.fromhex("0x69")
ba1 = bytearray.fromhex("69")
print "ba1 = %s" % str(ba1)
def hex2():
strings = []
strings.append("asclient.connection.recv 1037 BYTE = 0x21 33 '!'")
strings.append("asclient.connection.recv 10... |
#
# ElementTree
# $Id: ElementTree.py 3440 2008-07-18 14:45:01Z fredrik $
#
# light-weight XML support for Python 2.3 and later.
#
# history (since 1.2.6):
# 2005-11-12 fl added tostringlist/fromstringlist helpers
# 2006-07-05 fl merged in selected changes from the 1.3 sandbox
# 2006-07-05 fl removed support for ... |
""" monkeypatching and mocking functionality. """
from __future__ import absolute_import, division, print_function
import os
import sys
import re
import six
from _pytest.fixtures import fixture
RE_IMPORT_ERROR_NAME = re.compile("^No module named (.*)$")
@fixture
def monkeypatch():
"""The returned ``monkeypatch... |
import re
from typing import List, Optional, Tuple, Union
import attr
import pendulum # type: ignore
from bs4 import BeautifulSoup # type: ignore
from bs4.element import Tag # type: ignore
from furl import furl # type: ignore
from requests import Response
from pyffdl.sites.story import Story
from pyffdl.utilities... |
# Copyright 2016, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... |
"""
Plugin for UrlResolver
Copyright (C) 2017 tknorris
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.
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.