text
stringlengths
12
6.59M
import re import copy import warnings import contextlib import operator import numpy as np from astropy import _erfa as erfa from astropy.utils.compat.misc import override__dir__ from astropy import units as u from astropy.constants import c as speed_of_light from astropy.utils.data_info import MixinInfo from astropy...
# ##### BEGIN GPL LICENSE BLOCK ##### # # JewelCraft jewelry design toolkit for Blender. # Copyright (C) 2015-2019 Mikhail Rachinskiy # # 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, eith...
#!/usr/bin/env python3 import pygame from pygame.locals import * import random import traceback import hexmech import life import bits pygame.init() def main(): hexmech.setMetrics( width = 10, height = 10, t = 3) screen = Screen(1280, 720, fullscreen = False) world = World(screen, 180, 70) ...
# # DAPLink Interface Firmware # Copyright (c) 2009-2016, ARM Limited, All Rights Reserved # SPDX-License-Identifier: Apache-2.0 # # 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...
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division import argparse import os import sys import subprocess import tarfile import contextlib import json from pwd import getpwuid # import SAMADhi stuff CMSSW_BASE = os.environ['CMSSW_BASE'] SCRAM_ARCH = os.environ['SCRAM_ARCH'] sys.path.appen...
#!/usr/bin/env python ''' Filters a tab-delmited file based upon configurable critera ''' import sys,os,gzip from support import gzip_opener def usage(): print __doc__ print """\ Usage: %s -header file.txt {criteria} Where criteria is a set of operations in the form of: col# operation value Eg: 1 eq foo Co...
from drivnal.constants import * from drivnal.client import Client from drivnal.event import Event import drivnal.utils as utils from drivnal import server import time import uuid @server.app.route('/event', methods=['GET']) @server.app.route('/event/<int:last_event>', methods=['GET']) def event_get(last_event=None): ...
from crispy_forms.bootstrap import FormActions from crispy_forms.layout import Layout, Div, HTML, Submit, Field from django import forms from django.core.exceptions import ValidationError from django.db.models import Case, When from extrequests.models import ( DataVariant, InfoSource, WorkshopInquiryReques...
import html import re import aiohttp import async_timeout import dateutil.parser import discord from bs4 import BeautifulSoup as BS from discord.ext import commands class Mal: """ Finds info about some anime on MAL """ def __init__(self, bot): self.bot = bot self.LINK_ANIME_SEARCH = ...
# fMBT, free Model Based Testing tool # Copyright (c) 2014, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU Lesser General Public License, # version 2.1, as published by the Free Software Foundation. # # This program is distribut...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import os import numpy as np from ....tests.helper import pytest, assert_quantity_allclose from .. import iers from .... import units as u from ....
""" Misc: Library for Misc ---------------------- +------------------------+---------+ | This is the Misc common library. | +------------------------+---------+ """ import os import re import json import shlex import base64 import random import socket from time import sleep, gmtime, strftime from subprocess import Po...
from rest_framework.viewsets import ModelViewSet from rest_framework.filters import SearchFilter, OrderingFilter from django_filters.rest_framework import DjangoFilterBackend from datetime import datetime, timedelta from api.models import * from api.permission import HasGroupPermission from api.v330.launch.filters imp...
#!/usr/bin/env python import argparse import csv import glob import os import shutil import subprocess import requests from datetime import datetime import re from pm.log import loggers from pm.utils.filesystem import chdir from pm.utils import config as cf from pm.utils import parsers, misc # test flowcells: 14122...
import unittest class SimpleTest(unittest.TestCase): def test_addition(self): a = 2 b = 5 self.assertTrue( (a + b) == 7 ) def broken_test(self): a = 2 b = 2 self.assertTrue( (a + b) == 7 ) if __name__ == '__main__': unittest.main()
from fabric.api import * from fabric.contrib.files import sed import string # Custom Code Enigma modules import DrupalUtils import DrupalConfig import Drupal httpauth_pass = None ssl_enabled = False ssl_ip = None ssl_cert = None drupal_common_config = None # Feature branches only, preparing database # Assumes singl...
import sublime import subprocess, re, os, threading, tempfile from subprocess import Popen, PIPE try: STARTUP_INFO = subprocess.STARTUPINFO() STARTUP_INFO.dwFlags |= subprocess.STARTF_USESHOWWINDOW STARTUP_INFO.wShowWindow = subprocess.SW_HIDE except (AttributeError): STARTUP_INFO = None _sem = threading.Semaphor...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from functools import partial from collections import defaultdict import numpy as np from matplotlib import rcParams from matplotlib.artist import Artist from matplotlib.axes import Axes, subplot_class_factory from matplotlib.transforms import Affine2D,...
""" Oracle 2.0 IRC Bot stats.py plugin module http://toofifty.me/oracle """ import os, inspect, traceback from format import CYAN, WHITE, GREY, PURPLE, RED, GREEN, _random def _init(bot): print '\t%s loaded' % __name__ def seen(l, b, i): """ !d Return the last time the user was seen by Oracle !...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Andy Sayler # Copyright 2015 ### Imports ### import functools import uuid import datetime import flask import flask.ext.httpauth import flask.ext.cors from pcollections import drivers from pcollections import backends from pytutamen_server import datatypes from pyt...
#!/usr/bin/env python import random, os, sys, time, math, pygame from vector2 import Vector2 from pygame.locals import * SPACESWARM_VERSION = (0, 2, 1) BLACK = (0, 0, 0) WHITE = (255, 255, 255) RED = (255, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) WINDOWWIDTH, WINDOWHEIGHT = 800, 600 TEXTCOLOR = WHITE BACKGROUND...
#!/usr/bin/env python ######################################################################################### # # Module converting image files # # --------------------------------------------------------------------------------------- # Copyright (c) 2013 Polytechnique Montreal <www.neuro.polymtl.ca> # Author: Benja...
#!/usr/bin/python """ @brief QuickBot class for Beaglebone Black @author Rowland O'Flaherty @date 08/27/2013 """ import os import sys import time import math import re import socket import threading import numpy as np import Adafruit_BBIO.GPIO as GPIO import Adafruit_BBIO.PWM as PWM import Adafruit_BBIO.ADC as ADC ...
# Sublime modelines - https://github.com/SublimeText/Modelines # sublime: translate_tabs_to_spaces false; rulers [100,120] import sublime import subprocess import re import os import threading import tempfile import datetime import uuid import traceback as tbck import json from subprocess import Popen, PIPE import cop...
#!/usr/bin/env python3 import os import sys import string from importlib import reload import getKerningPairsFromOTF reload(getKerningPairsFromOTF) __doc__ = '''\ This script extracts a viable kern feature file from a compiled OTF. It requires the script 'getKerningPairsFromOTF.py'; which is distributed ...
from __future__ import division import math import numpy as np #This code calculates diversity and Evenness #This code is in the beginning stages #Simpson's index = D = sum(ni[ni-1])/(N[N-1]) ######Steps###### #Select each species as n, for each n multiply n * n-1 #sum all n(n-1) then divide by N(N-1) #D = Simpson's I...
from discord.ext import commands from .utils import config, checks from .utils.formats import human_timedelta from collections import Counter, defaultdict from inspect import cleandoc import re import json import discord import enum import datetime import asyncio import argparse, shlex import logging log = logging.ge...
#!/usr/bin/python # -*- coding: utf-8 -*- import unittest from spambl import (UnknownCodeError, NXDOMAIN, HpHosts, IpDNSBL, DomainDNSBL, GeneralDNSBL, GoogleSafeBrowsing, UnathorizedAPIKeyError, HostCollection, CodeClassificationMap, SumClassificationMap, H...
# # Copyright 2019 Asylo 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 applicable law or agreed to in writi...
''' Created on Mar 27, 2016 certain sites do not like being scraped, to get arround this python needs to pretend to be a browser. need to download the program chrome driver http://chromedriver.storage.googleapis.com/index.html I use 2.9 win32 just place chromedriver.exe into the same directory as this app @author: Noe...
# # Copyright (c) 2014, DeviantArt Inc. # ''' This module implements a simple HTTP client with keepalive but not pipelining. ''' import re import socket import sys import os import apiary import optparse import time from httplib import HTTPResponse, IncompleteRead import threading class HTTPWorkerBee(apiary.Worker...
from typing import List, Union, Dict, Any, Optional, Iterable, Callable, Tuple from typing import Iterator, Type, Pattern, Generator, TYPE_CHECKING from types import ModuleType import os import importlib import importlib.util import re from pathlib import Path import thinc from thinc.api import NumpyOps, get_current_op...
#!/usr/bin/env python # encoding: utf-8 """ Pipelines for fitting PHAT CMDs. """ import os from glob import glob import numpy as np from astropy.coordinates import Distance import astropy.units as u from astropy.table import Table from m31hst import phat_v2_phot_path from m31hst.phatast import PhatAstTable from pado...
from discord.ext import commands from .utils import checks, db, time, cache from collections import Counter, defaultdict from inspect import cleandoc import re import json import discord import enum import datetime import asyncio import argparse, shlex import logging log = logging.getLogger(__name__) ## Misc utiliti...
#!/usr/bin/env python3 '''A rudimentary script to change the status, status2, or proxy setting of AUs in TDB files from one or more old values to a new value.''' __copyright__ = '''\ Copyright (c) 2000-2020, Board of Trustees of Leland Stanford Jr. University All rights reserved.''' __license__ = '''\ Redistribution...
from django.conf import settings from django.core import mail from django.core.handlers.wsgi import WSGIHandler from django.core.management import call_command from django.core.servers.basehttp import AdminMediaHandler from django.core.urlresolvers import NoReverseMatch, reverse from django.db import connection from dj...
#!/usr/bin/python # vim: ts=4 sw=4 et """ Class for handling argparse parsers. """ import argparse import logging import os import subprocess import sys import textwrap import yaml # pylint: disable=too-many-instance-attributes class ArgParser(object): """Placeholder.""" def __init__(self): self.logger...
############################################################################### # # apogee.tools.download: download APOGEE data files # ############################################################################### import os import sys import shutil import tempfile import subprocess import numpy from apogee.tools im...
import datetime import discord import re from discord.ext import commands from subprocess import call from typing import Union from utils import utils, crud, models from utils.checks import is_staff, check_staff_id, check_bot_or_staff class Mod(commands.Cog): """ Staff commands. """ def __init__(sel...
#/usr/bin/env python import argparse import json import os import sys import subprocess class LauncherError(Exception): pass class Launcher(object): def __init__(self, options): self.options = options self.config = {} self.project = None self.process_options(options) d...
__author__ = 'Dmitry Golubkov' __email__ = 'dmitry.v.golubkov@cern.ch' import json import requests import urllib class Client(object): BASE_URL = 'https://aipanda015.cern.ch' def __init__(self, auth_user, auth_key, verify_ssl_cert=False, base_url=None): self.verify_ssl_cert = verify_ssl_cert ...
import os, sys import unittest # hack to make installing the modules unneccessary # when running the tests sys.path.insert(1, os.path.dirname(os.getcwd())) from buildit.system.system import System as System import monkey_patches class TestSystem(unittest.TestCase): def setUp(self): self.system = Sy...
from django.db import models class MediaCollection(models.Model): PUBLIC_ACCESS_CHOICES = (('0', 'none'), ('1', 'metadata'), ('2', 'full')) reference = models.CharField(unique=True, max_length=250) physical_format = models.ForeignKey('PhysicalFormat', related_name="collections") old_...
# Copyright 2020 Google Research. 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...
""" Configuration-related classes for versionner """ import codecs import configparser import os.path import pathlib import re import sys from versionner import defaults # pylint: disable=too-many-instance-attributes,too-few-public-methods class FileConfig: """ Single project file configuration """ ...
from discord.ext import commands from .utils import checks, db, time, cache from .utils.paginator import Pages from collections import Counter, defaultdict from inspect import cleandoc import re import json import discord import enum import datetime import asyncio import argparse, shlex import logging log = logging.g...
#!/usr/bin/python import sys, re, string, os import shutil import popen2 import StringIO import ConfigParser import numpy import spice_read from plotutils import load, plotter #################### SETUP VARS TEMPLATE_FILE = "testcircuits/index_template.html" REL_DIR = "../" # relation between this script and the B...
#!/usr/bin/env python # -*- coding: utf-8 # # Author: Qiming Sun <osirpt.sun@gmail.com> # import os, sys import gc import time import math import itertools from functools import reduce import numpy import pyscf.lib.parameters as param import pyscf.lib.logger as log from pyscf.gto import cmd_args from pyscf.gto import ...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright 2015 Agile Business Group <http://www.agilebg.com> # Copyright (C) 2015 Alessio Gerace <alesiso.gerace@agilebg.com> # # This program is free software: you can redistribute it and/or modify # ...
from flask import render_template, request from sprb import sprb from classes.signed_request import SignedRequest import json from sforce_custom.partner import SforcePartnerClient @sprb.route('/') def index(): return render_template('index.html') @sprb.route('/canvas', methods=['POST',]) def canvas(): print 'recei...
# coding=utf-8 from __future__ import unicode_literals import json import pytz import time from datetime import datetime, date, timedelta from django.core.files.base import ContentFile from django.core.urlresolvers import reverse from django.conf import settings from django.utils import timezone from mock import pat...
# -*- coding: utf-8 -*- import re import requests def rshift(val, n): return val>>n if val >= 0 else (val+0x100000000)>>n class gTTS: """ gTTS (Google Text to Speech): an interface to Google's Text to Speech API """ GOOGLE_TTS_URL = 'https://translate.google.com/translate_tts' MAX_CHARS = 100 # Max cha...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from json import loads, dumps from itertools import islice from elasticsearch import Elasticsearch, helpers #pip3 install elasticsearch from datetime import date, datetime import logging tmplt = """ { "template": "lbc-*", "settings": { "number_of_replicas": 0, ...
# # Copyright (C) 2011 - 2017 Satoru SATOH <ssato @ redhat.com> # License: MIT # # Some XML modules may be missing and Base.{load,dumps}_impl are not overriden: # pylint: disable=import-error """XML files parser backend, should be available always. - Format to support: XML, e.g. http://www.w3.org/TR/xml11/ - Requireme...
#Colonies - Space colony management sim #Created by Bhavish J (Github: xnph) #Learning python and github. Two birds with one stone. import random class Planet: """Class representing planets and handles generation and properties of planets and such""" planetcount = 0 #each planet will have an id pla...
from __future__ import print_function import os import tempfile from textwrap import dedent import unittest import mock import ssm.agents from ssm.ssm2 import Ssm2Exception class getDNsTest(unittest.TestCase): def setUp(self): # Create a temporay file for use in the tests self.tf, self.tf_path ...
import yaml import sys import os """ Looks for differences in Common Data Elements and Survey Questions in two registry definition yaml files. """ def get_dict_of_items(yaml_data, list_to_compare, identifier): return {item[identifier]: [attr + ": " + str(item[attr]) for attr in item] for item in yaml_dat...
#!/usr/bin/env python # -*- coding: utf-8 -*- """The user interface for our app""" import os,sys,tempfile,re,functools,time,types,glob,codecs from pprint import pprint from copy import copy from multiprocessing import Process, Queue from Queue import Empty from hashlib import md5 from StringIO import StringIO from rs...
# Copyright 2016 Raytheon BBN Technologies # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 import unittest import time import os import nump...
# use your venv here # # wrap a playbook inside a flask restful api app.. import subprocess import re from flask import Flask, request from flask_restful import Resource, Api, reqparse # flask restful returns json format, no need to use jsonify method # just return dictionaries ansi_escape = re.compile(r'\x1b[^m]*m...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ colorize standard input by rows or (space separated) columns Example usage: output alternate rows in different colors $ ls -l | colorize.py -a output each column from stdin in a different color $ tail -f logfile | colorize.py output the first 3 columns in differ...
import re from .base import RegexFilth class SSNFilth(RegexFilth): type = 'ssn' # please note that this not only captures valid SSNs but also invalid ones. # This choice is delibrate in that we want to be biased toward replacing # any filth with a cleaner alternative. # https://en.wikipedia.org/...
# -*- coding: utf-8 -*- """The user interface for our app""" import os,sys,tempfile,re,functools,time from pprint import pprint from multiprocessing import Process, Queue from Queue import Empty from hashlib import md5 from cStringIO import StringIO from rst2pdf.createpdf import RstToPdf from rst2pdf.log import log ...
# Copyright 2009-2014 MongoDB, 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 writin...
""" Created on 16 May 2017 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) Note: time should always be stored as UTC, then localized on retrieval. """ import sys from scs_core.data.rtc_datetime import RTCDatetime from scs_host.bus.i2c import I2C # ------------------------------------------------------...
from django.conf import settings from django.db import connection from odb_shared import reraise, get_logger def sql_update_with_key(table_name, primary_key, data_list): if not len(data_list): return keys = list(data_list[0].keys()) _values_list = [] for row in data_list: _values_list...
# -*- coding: utf-8 -*- """The user interface for our app""" import os,sys,tempfile,re,functools,time,types,glob from pprint import pprint from copy import copy from multiprocessing import Process, Queue from Queue import Empty from hashlib import md5 from cStringIO import StringIO from rst2pdf.createpdf import RstTo...
""" For code shared between test_utils.py and check.py. Not sure this is the best place - but check needs to not depend on test_utils so run_client_tests can execute without webob dependency. """ import json from os.path import join def write_config(has_temp_directory, data, name="config.json"): try: temp...
# Copyright 2014, Oliver Nagy <olitheolix@gmail.com> # # This file is part of Azrael (https://github.com/olitheolix/azrael) # # Azrael 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...
from abc import abstractmethod from inspect import isabstract import pytest def test_import_compat(compat): """Test the module is importable. See conftest.py for the actual import.""" assert compat def test_import_abc(abc): """Test the module is importable. See conftest.py for the actual import.""" ...
from __future__ import division from textwrap import dedent import colorsys import numpy as np from scipy import stats import pandas as pd import matplotlib as mpl from matplotlib.collections import PatchCollection import matplotlib.patches as Patches import matplotlib.pyplot as plt import warnings from .external.six ...
import sys, os if sys.platform != "darwin": print "GUI: your platform is probably not supported yet" from guiCocoaCommon import * from utils import * import Traits try: app except NameError: # only declare if not yet declared app = None def setupAppleMenu(): # http://www.cocoabuilder.com/archive/cocoa/192181-i...
import dedupe import unittest import numpy import random import itertools import warnings import dedupe.mekano as mk import collections class CoreTest(unittest.TestCase): def setUp(self) : random.seed(123) self.ids_str = iter([('1', '2'), ('2', '3'), ('4', '5'), ('6', '7'), ('8','9')]) self.records = i...
# -*- coding: utf-8 -*- """ Tests for the function sta.spike_triggered_average :copyright: Copyright 2015 by the Elephant team, see AUTHORS.txt. :license: Modified BSD, see LICENSE.txt for details. """ import unittest import math import numpy as np from numpy.testing import assert_array_equal from numpy.testing.utils...
#!/usr/bin/env python2 import click from zerodb import api DEFAULT_SECRET_KEY = "\xcf\xb94\x88\xe5\xea\xbf\xcb\x13\x1c!\xef\x96h>\xd8\xf8\x9e\xad/y\xb0r\xce" @click.command() @click.option("--api-host", default="localhost", help="Host for API") @click.option("--api-port", default=17234, help="Port for API", type=cl...
import json from abc import ABC, abstractmethod import boto3 from flask import current_app from notifications_utils.template import non_gsm_characters from app.config import BroadcastProvider from app.utils import DATETIME_FORMAT, format_sequential_number # The variable names in this file have specific meaning in a ...
# Copyright 2017 TensorHub, 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 writing, ...
# # Copyright (c) 2014, DeviantArt Inc. # ''' This module implements a simple HTTP client with keepalive but not pipelining. ''' import re import socket import sys import os import apiary import optparse import time from httplib import HTTPResponse, IncompleteRead import threading class HTTPWorkerBee(apiary.Worker...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2007 Ferran Pegueroles <ferran@pegueroles.com> # Copyright (c) 2009 Albert Cervera i Areny <albert@nan-tic.com> # Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>) ...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
from collections import defaultdict from django.http import HttpRequest, JsonResponse from django.db import transaction from django.core.handlers.base import BaseHandler from binder.exceptions import ( BinderException, BinderRequestError, BinderMethodNotAllowed, ) from binder.json import jsonloads, jsondumps class...
# -*- coding: utf-8 -*- """ notes: * trello_id -- we don't trust trello's ID system """ from __future__ import unicode_literals import logging import re from trello_reporter.charting.harvesting import Harvestor from dateutil import parser as dateparser from dateutil.tz import tzutc from django.db import models f...
#!/usr/bin/env python """ A library for parsing Standard MIDI Files (SMFs). Currently it just outputs the data it finds. """ from sebastian.core import OSequence, Point, OFFSET_64, MIDI_PITCH, DURATION_64 class Base(object): """ Base is a generic base class for parsing binary files. It cannot be instan...
# Copyright (c) 2011, SD Elements. See LICENSE.txt for details. import json import logging from re import compile import django.conf from django.contrib.auth import logout from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse, resolve from django.http import HttpResponse...
# -*- coding: utf-8 -*- """ test_http11.py ~~~~~~~~~~~~~~ Unit tests for hyper's HTTP/1.1 implementation. """ from collections import namedtuple from io import BytesIO, StringIO import pytest import hyper from hyper.http11.connection import HTTP11Connection from hyper.http11.response import HTTP11Response from hyper...
import libpry, time, pprint from libqtile import layout import libqtile.theme import utils theme = libqtile.theme.Theme({}, specials={'stack': {'border_width': 10}}) class MaxConfig: groups = ["a", "b", "c", "d"] layouts = [ layout.Max() ] keys = [] screens = [] class uMax(utils.QtileTes...
""" Deep learning and Reinforcement learning library for Researchers and Engineers """ # from __future__ import absolute_import try: install_instr = "Please make sure you install a recent enough version of TensorFlow." import tensorflow except ImportError: raise ImportError("__init__.py : Could not import...
import pytest from pandas.util.testing import assert_frame_equal import pandas as pd from copy import deepcopy from feedinlib import WindPowerPlant, Photovoltaic from feedinlib.models import WindpowerlibTurbine, Pvlib, \ WindpowerlibTurbineCluster from windpowerlib import WindTurbine as WindpowerlibWindTurbine c...
"""Tests for pytentd Also provides some imports from the testing libraries used. """ __all__ = ['TentdTestCase', 'MockResponse', 'MockFunction', 'patch' 'skip'] from os import close, remove from tempfile import mkstemp from unittest import TestCase, skip from flask import json, jsonify, Response, _request_ctx_stack...
import pytest from pandas.util.testing import assert_frame_equal import pandas as pd from copy import deepcopy from feedinlib import WindPowerPlant, Photovoltaic from feedinlib.models import (WindpowerlibTurbine, Pvlib, GeometricSolar, WindpowerlibTurbineCluster) from feedinlib.models.geo...
# Copyright 2016-2017 Versada <https://versada.eu/> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Sentry", "summary": "Report Odoo errors to Sentry", "version": "14.0.1.1.1", "category": "Extra Tools", "website": "https://github.com/OCA/server-tools", "author": "Moha...
# -*- coding: utf-8 -*- import time import uuid import requests import re import hashlib from urlparse import urlparse, urljoin from bs4 import BeautifulSoup import seolinter html_parser = "lxml" # html_parser = "html.parser" TIMEOUT = 16 def crawl(urls, db, internal=False, delay=0, user_agent=None): proces...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Telegram bot to play UNO in group chats # Copyright (c) 2016 Jannes Höke <uno@jhoeke.de> # # 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 Foundatio...
#!/usr/bin/env python # # $Id$ # import unittest import os import sys import subprocess import time import signal import socket import types from test import test_support import psutil PYTHON = os.path.realpath(sys.executable) DEVNULL = open(os.devnull, 'r+') def wait_for_pid(pid, timeout=1): """Wait for pid ...
#!/usr/bin/env python # # $Id$ # import unittest import os import sys import subprocess import time import signal import types import errno import platform import traceback import socket import psutil PYTHON = os.path.realpath(sys.executable) DEVNULL = open(os.devnull, 'r+') POSIX = os.name == 'posix' LINUX = sys....
import random, sys, os, copy, math import caption, eye, head, mouth, noise import svgwrite from svgwrite.text import TSpan import path_utilities as pu import filter_utils as f """ SIZE OF DRAWING """ WIDTH = 1000 HEIGHT = 800 widthmm = "%fmm" % WIDTH heightmm = "%fmm" % HEIGHT """ SIZE OF HEAD OUTLINE """ X_MIN = W...
from setuptools import setup, find_packages name = 'tessera' _locals = {} exec(compile(open(file).read(), file, 'exec')) version = _locals['__version__'] setup( name=name, version=version, description='Powerful multipurpose dashboard server', license='Apache', author='Urban Airship', url='htt...
from pkg_resources import get_distribution from serfclient.client import SerfClient __version__ = get_distribution('serfclient').version
#!/usr/bin/env python3 import database import http # Send header http.send_json_header() # Ensure the correct post keys were sent if http.check_keys(("member_id", "session_id", "society_id", "token")): member_id = http.post["member_id"].value session_id = http.post["session_id"].value society_id = http.p...
#!/usr/bin/python -O import binascii with open('../misc/test.mp3', 'rb') as f: freqTable = [ 44100, 48000, 32000, 0 ] brTable = [ 0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 0 ] while True: header = f.read(2) if header: print "candidate: %s" % bi...