src stringlengths 721 1.04M |
|---|
# Copyright 2014 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 re
def result_contains_repaint_rects(text):
return isinstance(text, str) and re.search(r'"paintInvalidations": \[$', text, re.MULTILINE) is not ... |
"""
TestCases for checking dbShelve objects.
"""
import os, string
import random
import unittest
import warnings
from test_all import db, dbshelve, test_support, verbose, \
get_new_environment_path, get_new_database_path
#----------------------------------------------------------------------
# We want th... |
# 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.
#
# This program is distributed in the hope that it will be useful
# but... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
interpreter.py
=====
This module contains the class `NetworkBuilder` and `AgentkBuilder` which interprets
the contents of BriCA language files.
"""
# BriCA Language Interpreter for V1 (Interpreter version 1)
# Originally licenced for WBAI (wbai.jp) under the Apache... |
# coding: utf-8
from __future__ import unicode_literals
import functools
import itertools
import operator
import re
from .common import InfoExtractor
from ..compat import (
compat_HTTPError,
compat_str,
compat_urllib_request,
)
from .openload import PhantomJSwrapper
from ..utils import (
determine_ext... |
"""
Implement Unordered List, or linked list, in python.
The building block is the class Node.
Refer to http://interactivepython.org/runestone/static/pythonds/BasicDS/ImplementinganUnorderedListLinkedLists.html
With added functions append(),index(),insert(),pop()
"""
class Node:
def __init__(self,initdata):
... |
#! /usr/bin/env python
#encoding: utf8
import rospy, unittest, rostest
import rosnode
import time
from pimouse_ros.msg import MotorFreqs
from geometry_msgs.msg import Twist
class MotorTest(unittest.TestCase):
def file_check(self,dev,value,message):
with open("/dev/" + dev,"r") as f:
self.assert... |
"""JSON implementations of authorization searches."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods,too-few-public-methods
# Number of methods are defined in specification
# pylint: disable=protected-access
# Access to protected methods allow... |
import inspect
import os
import sys
from django.apps import apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import DEFAULT_DB_ALIAS, connections
from django.db.migrations.loader import MigrationLoader
from django.utils.timezone import now
from . import __ve... |
# Copyright (c) 2017 Presslabs SRL
#
# 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 writ... |
"""Standalone command-line application that plots ROC, precision-recall
and accumulation curves."""
import sys
from itertools import cycle
from yard.data import BinaryClassifierData
from yard.curve import CurveFactory
from yard.scripts import CommandLineAppForClassifierData
from yard.utils import parse_size
__autho... |
from __future__ import unicode_literals
from collections import namedtuple
import logging
from six import string_types
from .fields import RegexField, ValidationException, NCName, Name
logger = logging.getLogger(__name__)
KeyRef = namedtuple('KeyRef', 'key_name key_value ref_path')
class KeyStore(object):
""... |
"""
Django settings for BasicBrowser project.
Generated by 'django-admin startproject' using Django 1.10.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
impo... |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
"""
Just a quick test to make sure there's no ``cls`` or ``self`` odness.
"""
from __future__ import print_function
import sys
import time
from yamicache import Cache
c = Cache(prefix="myapp", hashing=False, debug=False)
@c.cached()
def my_func(argument, power):
"""running my_func"""
return argument ** power... |
#!/usr/bin/python
import time
import math
from Adafruit_I2C import Adafruit_I2C
# ============================================================================
# Adafruit PCA9685 16-Channel PWM Servo Driver
# ============================================================================
class PWM :
i2c = None
# Re... |
"""
Test file for REQ-REP communication pattern.
"""
import time
from osbrain import run_agent
from osbrain import run_logger
from osbrain.helper import logger_received
from osbrain.helper import sync_agent_logger
from .common import echo_handler
def test_return(nsproxy):
"""
REQ-REP pattern using a handler... |
import struct
from gevent import socket
from gevent.socket import error as socket_error
from gevent.socket import timeout as socket_timeout
import sys
from tendrl.commons.message import Message
from tendrl.commons.logger import Logger
import traceback
class Event(object):
def __init__(self, message, socket_path=... |
#!/usr/bin/env python3
#
# Copyright 2014 Simone Campagna
#
# 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 -*-
#
# e1337cms documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 1 09:47:07 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... |
'''
Tag related operations
@author: Youyk
'''
import apibinding.api_actions as api_actions
import zstackwoodpecker.test_util as test_util
import account_operations
import apibinding.inventory as inventory
def create_system_tag(resourceType, resourceUuid, tag, session_uuid=None):
action = api_action... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011-2012 Smile. All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... |
#!/usr/bin/env python
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import re
import os
import unicodedata
import ConfigParser
from bson import ObjectId
from datetime import datetime
from mining.settings import PROJECT_PATH
def slugfy(text):
slug = unicodedata.normalize("NFKD", text).encode("UTF-8", "ignore")
slug = r... |
# Copyright (c) 2016 Huawei Technologies Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
# 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 u... |
# -*- coding: utf-8 -*-
import asyncio
import discord
from discord.ext import commands
from libraries.library import *
class Vote:
def __init__(self,bot):
self.bot = bot
self.VoteState = None
self.Mess = None
self.Requester = None
self.subject = None
self.Voters =... |
"""Test diff."""
# --- import -------------------------------------------------------------------------------------
import numpy as np
import WrightTools as wt
# --- test ---------------------------------------------------------------------------------------
def test_ascending_1():
x = np.linspace(0, 10, 1... |
#
#
# Copyright (C) 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 program is distri... |
# Copyright 2008-2014 Nokia Solutions and Networks
#
# 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... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'michal@vane.pl'
import os
import logging
import tornado.httpserver
import tornado.ioloop
import tornado.web
import tornado.wsgi
import sockjs.tornado
from django.core.handlers import wsgi
import pusher
import constraint
import logging as _
SETTINGS_PATH="d... |
import warnings
class Article(object):
def __init__(self, title, type_name, content, date_created, source_path, slug,
permalink, snip, output_path, meta_description, yaml):
# The title of this article.
self.title = title
# Name of the template to use for this article.
self.type_name = type_name... |
# -*- coding: utf-8 -*-
#
# PASTAS documentation build configuration file, created by
# sphinx-quickstart on Wed May 11 12:38:06 2016.
# Repository setup is according to:
# http://gisellezeno.com/tutorials/sphinx-for-python-documentation.html
#
# This file is execfile()d with the current directory set to its
# contain... |
# Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms of the G... |
import operator
import os
from collections import OrderedDict
from pandas import DataFrame
from cave.analyzer.parameter_importance.base_parameter_importance import BaseParameterImportance
class Fanova(BaseParameterImportance):
"""
fANOVA (functional analysis of variance) computes the fraction of the varianc... |
from os import mkdir, stat
from stat import ST_MODE
from distutils.core import setup
setup(name = "keepassc",
version = "1.8.2",
author = "Karsten-Kai König, Scott Hansen",
author_email = "grayfox@outerhaven.de",
url = "http://raymontag.github.com/keepassc",
download_url = "https://githu... |
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
# import our data file
from data import locations
# define a dictionary with our directions in. Each direction is a set of coordinates which,
# when added to a position, will move it in that direction. So for instance, if we're currently at (1, 1),
# moving east will result in (1+1, 1) = (2, 1). Moving west will resul... |
"""
Podi, a command-line interface for Kodi.
Copyright (C) 2015 Peter Frost <slimeypete@gmail.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... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# -- stdlib --
import json
import socket
import subprocess
import telnetlib
import time
# -- third party --
# -- own --
# -- code --
ts = int(time.time())
proc = subprocess.Popen(['/bin/bash', '-c', r'''ps -ef |grep memcached|grep -v grep |sed -n 's/.* *-p *\([0-9]\{1,5\}\)... |
import pandas as pd
from sklearn.tree import DecisionTreeClassifier #not Regressor
from sklearn.linear_model import LogisticRegression
from sklearn.neural_network import MLPClassifier
from sklearn.gaussian_process import GaussianProcessClassifier
from sklearn.svm import SVC
from sklearn.gaussian_process.kernels import ... |
# 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 ag... |
"""
cryptography.py
Author: Jeff
Credit: None
Assignment:
Write and submit a program that encrypts and decrypts user data.
See the detailed requirements at https://github.com/HHS-IntroProgramming/Cryptography/blob/master/README.md
"""
action_ = "goahead"
while action_ != "q":
associations = "abcdefghijklmnopqrst... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Tomek Wójcik <tomek@bthlabs.pl>
#
# 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
# t... |
import time
class ZmqTimerManager(object):
def __init__(self):
self.timers = []
self.next_call = 0
def add_timer(self, timer):
self.timers.append(timer)
def check(self):
if time.time() > self.next_call:
for timer in self.timers:
timer.check()
... |
#!/bin/env python
# -*- coding: iso-8859-15 -*-
# (C) 2014 J. Nurminen <slinky@iki.fi>
#
# This is just for my own neural network investigations, I wanted to finally
# learn backpropagation and play around with a simple implementation where I know
# the location of each single thing.
#
# Basic backpropagation with mom... |
import facebook
from django.conf import settings
from django.shortcuts import reverse
from urllib.parse import urlencode, quote, unquote
from django.contrib.auth import login
from django.contrib import messages
app_id = settings.SOCIAL_FACEBOOK_KEY
app_secret = settings.SOCIAL_FACEBOOK_SECRET
def get_graph():
"... |
import sys
'''
The below is only needed for Bayesian Optimization on Luis' Machine.
Ignore and comment out if it causes problems.
'''
path = "/home/luis/Documents/Harvard_School_Work/Spring_2015/cs181/assignments/practicals/prac4/practical4-code/"
if path not in sys.path:
sys.path.append(path)
'''
End Bayesian
'''... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import glob
import logging
import time
import math
from Bio import SeqIO
import subprocess
from pysam import *
__author__ = "Ryan Abo"
__copyright__ = "Copyright 2015, Ryan Abo"
__email__ = "ryanabo@gmail.com"
__license__ = "MIT"
def which(program):
... |
#!/usr/bin/python2
# -*- coding: utf-8 -*-
"""Standalone Grow SDK installer. Downloads Grow SDK and sets up command aliases."""
import argparse
import datetime
import json
import os
import platform
import re
import sys
import tempfile
import urllib
import urllib2
import zipfile
DOWNLOAD_URL_FORMAT = 'https://github.... |
"""
aspen.http.mapping
~~~~~~~~~~~~~~~~~~
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
NO_DEFAULT = object()
class Mapping(dict):
"""Base class for HTTP mappings: Path, Querystring, Headers, Cookie, Body... |
import json
from .theExceptions import (CreationError, DeletionError, UpdateError)
class Index(object) :
"""An index on a collection's fields. Indexes are meant to de created by ensureXXX functions of Collections.
Indexes have a .infos dictionary that stores all the infos about the index"""
def __init__(self... |
import os
from django.contrib import messages
SETTINGS_DIR = os.path.dirname(os.path.abspath(__file__))
PROJECT_DIR = os.path.dirname(SETTINGS_DIR)
BUILDOUT_DIR = os.path.dirname(PROJECT_DIR)
VAR_DIR = os.path.join(BUILDOUT_DIR, "var")
##########################################################################
#
# Se... |
#
# Project: MXCuBE
# https://github.com/mxcube
#
# This file is part of MXCuBE software.
#
# MXCuBE is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... |
"""Run docopt in GOATOOLS."""
from __future__ import print_function
__copyright__ = "Copyright (C) 2016-present, DV Klopfenstein, H Tang, All rights reserved."
__author__ = "DV Klopfenstein"
import sys
import re
from docopt import docopt
from goatools.gosubdag.utils import get_kwargs
#pylint: disable=too-few-publi... |
#!/usr/bin/env python
"""RCC router copy config"""
import os
import hashlib
from datetime import datetime
from telnetlib import Telnet
from device_settings import cisco, huawei, juniper
# remove after tests
#from CONFIGCISCO import TEXT
class Device:
"""It is work like an Expect scripts:
- connect to a networ... |
from urlparse import parse_qs, urlparse
from django.conf import settings
from django.test.client import RequestFactory
from django_jinja.backend import Jinja2
from pyquery import PyQuery as pq
from product_details import product_details
from bedrock.mozorg.tests import TestCase
jinja_env = Jinja2.get_default()
de... |
# Copyright (c) 2009 Six Apart Ltd.
# 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 list of conditions and the... |
from copy import deepcopy
import math
#from HSM_ParametersClass import *
from HSM_SimulateClass import *
def GenerateRandomParametersSets(NumberOfRandomSets, FactorOf, DefaultParamSetRATES):
"""GENERATE SETS OF RANDOM PARAMETERS FROM A FLAT DISTRIBUTION CENTERED AROUND FIDUCIAL VALUES AND WITHIN A FACTOR OF F... |
import director.objectmodel as om
import director.applogic as app
from shallowCopy import shallowCopy
import director.vtkAll as vtk
from director import transformUtils
from director import callbacks
from director import frameupdater
from director.fieldcontainer import FieldContainer
from PythonQt import QtCore, QtGui
i... |
# -*- test-case-name: twisted.trial.test.test_runner -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
A miscellany of code used to run Trial tests.
Maintainer: Jonathan Lange
"""
__all__ = [
'TestSuite',
'DestructiveTestSuite', 'DryRunVisitor', 'ErrorHolder', 'LoggedSuite',
... |
"""
This is the default template for our main set of AWS servers. This does NOT
cover the content machines, which use content.py
Common traits:
* Use memcached, and cache-backed sessions
* Use a MySQL 5.1 database
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables fro... |
#! /usr/bin/env python
# encoding=utf-8
#from __future__ import unicode_literals
import sqlite3
from time import time
from hashlib import md5
from base64 import b64encode
from sys import argv
salt = 'chewingum'
filekey = './filekey'
def install(salt, filekey):
hashs = md5()
with open(filekey) as keyfile: ke... |
# -*- coding: utf-8 -*-
# Given an absolute path for a file (Unix-style), simplify it.
#
# For example,
# path = "/home/", => "/home"
# path = "/a/./b/../../c/", => "/c"
# click to show corner cases.
#
# Corner Cases:
# Did you consider the case where path = "/../"?
# In this case, you should return "/". -> 即在输出的时候是用'... |
"""Inserts the current time (in seconds) into the wiki page."""
revision = "$Rev: 6326 $"
url = "$URL: https://svn.edgewall.org/repos/trac/tags/trac-0.12.2/sample-plugins/Timestamp.py $"
#
# The following shows the code for macro, old-style.
#
# The `execute` function serves no purpose other than to illustrate
# the ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2008 - 2010 Lukas Hetzenecker <LuHe@gmx.at>
NUM_CONNECTED = 100
NUM_HELLO_REQUEST = 110
NUM_HELLO_REPLY = 111
NUM_QUIT = 120
NUM_PARTIAL_MESSAGE = 130
NUM_CONTACTS_REQUEST_HASH_ALL = 200
NUM_CONTACTS_REQUEST_HASH_SINGLE= 201
NUM_CONTACTS_REQUEST_CONTACT = 204
NUM_CONTACTS_REQU... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
import sys
import smtplib
from email.mime.text import MIMEText
from email.utils import formatdate
from ... import config
def create_message(from_addr, to_addr, subject, message, encoding):
body = MIMEText(message, 'plain', encoding)
body['Subject'] = subject
body['From'] = from_addr
body['To'] = to_add... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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... |
from __future__ import absolute_import
from __future__ import print_function
import re
import operator
import six
from six.moves import range
from utilities import load_data,cross_validate
from sklearn.pipeline import Pipeline
from keyword_metrics import keyword_prf
from nltk.stem import PorterStemmer
import gensim
c... |
#
# Copyright (C) 2009 TribleFlame Oy
#
# This file is part of TF.
#
# TF 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.
# ... |
# Copyright (c) 2013 OpenStack Foundation.
# 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... |
"""
Save database.
"""
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import os
import re
from datetime import datetime
import tempfile
from optparse import make_option
from django.conf import settings
from django.core.management.base import CommandError
... |
##
## For help on setting up your machine and configuring this TestScript go to
## http://docs.testdroid.com/appium/
##
import os
import time
import unittest
import subprocess
from time import sleep
from appium import webdriver
from device_finder import DeviceFinder
from selenium.common.exceptions import WebDriverExce... |
"""Test the config manager."""
import asyncio
from datetime import timedelta
import pytest
from homeassistant import config_entries, data_entry_flow, loader
from homeassistant.core import callback
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.setup import async_setup_component
from homea... |
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from absl import app
from selenium.webdriver.common import keys
from grr_response_core.lib import rdfvalue
from grr_response_server import data_store
from grr_response_server.gui import... |
# K2000 KIT Python Module
# to be used in conjonction with the arduinoMicroShiftRegisterTest(s), to produce effect(s) such as K2000 KIT
import time
from collections import deque # used to cycle/rotate the leds deck pattern to be sent over serial to the uC/Ar
# == debug tests ==
'''
larger_list = [0,'A','B','C',1, 1,'F... |
import codecs
import json
import urllib.request
from constants import constants, command_name_list
from telepot.namedtuple import KeyboardButton, ReplyKeyboardMarkup
from model.repositories import channel_repository
from bot import bot
from decorators.command import command
@command(command_name_list["listacanali"])
d... |
import os
# Override these on production env
os.environ.setdefault("APP_ENV", "development")
os.environ.setdefault("SECRET_KEY", "^uhrm48x9y=1f&+$bg=oc(#23mp0*g5k%8+si9tdz7&4_xk&lf")
if os.environ["APP_ENV"] == "development":
try:
# Add secret ENV varibales for development (e.g. API keys) to secrets.py
... |
#!/usr/bin/env python3
"""
A tool for building relocatable packages of UNIX applications.
See README.md for details.
"""
import calendar
import hashlib
import logging
import os
import platform
import sys
import tarfile
import util
from util import sha256_file, rmtree, ensure_dir, touch, file_list, chdir, umask, setenv... |
# Copyright (c) 2010-2014 openpyxl
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distr... |
#!/usr/bin/env python
# coding: utf-8
"""html2text: Turn HTML into equivalent Markdown-structured text."""
from __future__ import division
import re
import cgi
try:
from textwrap import wrap
except ImportError: # pragma: no cover
pass
from html2text.compat import urlparse, HTMLParser
from html2text import co... |
# multi_level_castle.py
# Minecraft Server 1.11.2
# Seed: -7560993781265470572
import castle_maker
import clear_area
import time
def main():
"""
.................................................................
....[back tower].................................................
....................... |
import six
from django.conf import settings
from django_markup.defaults import DEFAULT_MARKUP_FILTER, DEFAULT_MARKUP_CHOICES
class MarkupFormatter(object):
def __init__(self, load_defaults=True):
self.filter_list = {}
if load_defaults:
filter_list = getattr(settings, 'MARKUP_FILTER',... |
#
# Transmission Line Simulator
#
# Author(s): Jiacong Xu
# Created: Jun-28-2017
#
from kivy.uix.widget import Widget
from kivy.properties import *
from kivy.clock import Clock
from kivy.graphics.texture import Texture
from kivy.graphics import *
from PIL import Image, ImageDraw, ImageFilter
class MaterialWidget(Wid... |
#!/usr/bin/env python
# Scrape house.gov and senate.gov for current committee membership,
# and updates the committees-current.yaml file with metadata including
# name, url, address, and phone number.
import re, lxml.html, lxml.etree, io, datetime
from collections import OrderedDict
import utils
from utils import dow... |
#!/usr/bin/python
#
# v0.3 (c) by meigrafd
#
import RPi.GPIO as GPIO
import time, curses
#---------------------------------------------------------------------
# only one of following:
PULL = GPIO.PUD_DOWN #GPIO -> GND
#PULL = GPIO.PUD_UP #GPIO -> 3V3
#-----------------------------------------------------------------... |
'''
localiface.py
Local storage interface for the IOP WOPI server
Author: Giuseppe.LoPresti@cern.ch, CERN/IT-ST
'''
import time
import os
import warnings
from stat import S_ISDIR
# module-wide state
config = None
log = None
homepath = None
def _getfilepath(filepath):
'''map the given filepath into the target na... |
"""MCMC example for transit fitting."""
import matplotlib.pyplot as pl
from everest import Everest, TransitModel
import numpy as np
import emcee
from tqdm import tqdm
from corner import corner
def lnprior(x):
"""Return the log prior given parameter vector `x`."""
per, t0, b = x
if b < -1 or b > 1:
... |
"""
/***************************************************************************
RuGeocoder
A QGIS plugin
Geocode your csv files to shp
-------------------
begin : 2012-02-20
copyright : (C) 2012 by Nikulin Evgeni... |
import pytest
from bingmaps.apiservices import LocationByAddress
from bingmaps.urls import LocationByAddressSchema
from .fixtures import parametrize, BING_MAPS_KEY
http_protocol = 'http'
https_protocol = 'https'
DATA = [{'adminDistrict': 'WA'},
{'key': 'vds'},
{'adminDistrict': 'WA',
'locali... |
# -*- coding: utf-8 -*-
"""
VOD TVsupertuga Add-on
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... |
# encoding=utf-8
import binascii
import json
from twisted.internet.protocol import Protocol
class LightProtocol(Protocol):
def __init__(self):
self.ip = ''
self.port = ''
def connectionMade(self):
# import socket
#self.transport.socket._sock.setsockopt(socket.SOL_SOCKET, socket... |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... |
import time
import threading
import threadactive
class BackWorker(threadactive.Agent):
def tick(self):
threadactive.Agent.tick(self)
print("[%s][%d] front" % (threading.current_thread().getName(), time.clock()) )
self.print_in_front2()
self.print_in_back()
time.sleep(1)
... |
"""
Test functions for models.tools
"""
from statsmodels.compat.python import lrange, range
import numpy as np
from numpy.random import standard_normal
from numpy.testing import (assert_equal, assert_array_equal,
assert_almost_equal, assert_string_equal, TestCase)
from nose.tools import (asse... |
# extraction for Keith Cunningham -- Glitter Gulch DOT
def make_gdf():
df = pd.DataFrame({'name':['Long Lake','Glitter Gulch'],
'lat':[61.8,63.76],'lon':[-148.2,-148.9]})
df['geometry'] = df.apply(lambda x: Point(x.lon, x.lat), axis=1)
shp = gpd.GeoDataFrame( df, crs={'init':'epsg:4326'}, geometry='geometry')
re... |
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException... |
#! /usr/bin/env python
###############################################################################
#
# avarice - The "avarice" program.
# Copyright (C) 2004 Theodore A. Roth
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... |
#! /usr/bin/env python
import io
import xml.etree.ElementTree as ETree
from .kbapi import sru
def main():
"""
Script for testing SRU interface outside Iromlab
(not used by main Iromlab application)
"""
catid = "184556155"
# Lookup catalog identifier
#sruSearchString = '"PPN=' + str(catid)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.