src stringlengths 721 1.04M |
|---|
#!/usr/bin/env python
# Usage: simple-mailer [--[no-]tls] username[:password]@server[:port] from to subject
import optparse
parser = optparse.OptionParser(usage='%prog [options] username[:password]@server[:port] from to subject', description='Sends an email message, reading the password (unless specified on the comma... |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 The HyperSpyUI developers
#
# This file is part of HyperSpyUI.
#
# HyperSpyUI 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
#... |
#! /usr/bin/env python3
import logging
logger = logging.getLogger(__name__)
import os
from setuptools import setup, find_packages
import sys
# We define the main script name here (file in bin), since we have to change it for MacOS X
SCRIPTNAME='advene'
def check_changelog(maindir, version):
"""Check that the ch... |
"""
Chess board
No computer player yet
Sucks in other ways too
TO DO: look over http://home.hccnet.nl/h.g.muller/max-src2.html
"""
## b = InitialChessBoard()
## print str(b)
#. rnbqkbnr
#. pppppppp
#.
#.
#.
#.
#. PPPPPPPP
#. RNBQKBNR
## pw = HumanPlayer(white)
## pb = HumanPlayer(bl... |
# -*- coding:utf-8 -*-
from django.contrib.admin import helpers
from django.core.checks import messages
from django.http import HttpResponse, HttpResponseRedirect
from django.utils.html import strip_tags
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django.c... |
from __future__ import absolute_import
import logging
from logstash.formatter import LogstashFormatterVersion1
class SuppressDeprecated(logging.Filter):
def filter(self, record):
WARNINGS_TO_SUPPRESS = [
'RemovedInDjango110Warning',
'RemovedInDjango20Warning',
]
# ... |
"""Main data-model classes for the Humanitarian Exchange Language (HXL).
This module defines the basic classes for working with HXL data. Other
modules have classes derived from these (e.g. in
[hxl.filters](filters.html) or [hxl.io](io.html)). The core class is
[Dataset](#hxl.model.Dataset), which defines the operatio... |
import random
import re
import json
import pytz
import dateutil.parser
from datetime import datetime, timedelta
from pprint import pformat
from hashlib import md5
from django.http import HttpResponse
from django.core.exceptions import ObjectDoesNotExist
from django.shortcuts import render, redirect
from django.conf im... |
# Amara, universalsubtitles.org
#
# Copyright (C) 2014 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your op... |
"""SCons.Tool.Packaging.tarbz2
The tarbz2 SRC packager.
"""
#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# 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, includ... |
data = (
None, # 0x00
None, # 0x01
None, # 0x02
None, # 0x03
None, # 0x04
None, # 0x05
None, # 0x06
None, # 0x07
None, # 0x08
None, # 0x09
None, # 0x0a
None, # 0x0b
None, # 0x0c
None, # 0x0d
None, # 0x0e
None, # 0x0f
None, # 0x10
None, # 0x11
None, # 0x12
None, ... |
"""A Python module for interacting with Slack's Web API."""
import asyncio
import copy
import hashlib
import hmac
import io
import json
import logging
import mimetypes
import urllib
import uuid
import warnings
from http.client import HTTPResponse
from ssl import SSLContext
from typing import BinaryIO, Dict, List
from ... |
#!/usr/bin/env python2
from shm_tools.shmlog.parser import LogParser
import argparse
import sys
from datetime import datetime
from time import sleep, mktime, time
import os
import struct
import sys
'''
Utility for benchmarking log file access
Jeff Heidel 2013
'''
GROUP = 0xFFFF
END_STBL = 0xFFFFFFFFFFFFFFFF
ap = arg... |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created: ter 29. set 21:52:13 2015
# by: The Resource Compiler for PyQt (Qt v4.8.4)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x01\x57\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\... |
# -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2015 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by th... |
#!/usr/bin/env python
"""
Compares the pixel values of two images and gives a measure of the difference.
Copyright (C) 2013 Oskar Maier
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 versio... |
"""Functions for reading from the database."""
import constants
import database_utils
import models
def get_urls():
"""Get all of the urls in articles in the database."""
with database_utils.DatabaseConnection() as (connection, cursor):
cursor.execute("SELECT link FROM article;")
urls = set(i... |
# coding=utf-8
# Author: Mr_Orange <mr_orange@hotmail.it>
# URL: https://sickrage.github.io
#
# This file is part of SickRage.
#
# SickRage 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 ... |
'''
2DPCA for feature extraction of MNIST digits dataset
Author : Akhil P M
'''
from settings import *
from sklearn.ensemble import RandomForestClassifier
import utils
def compute_covariance_matrix(A):
""" compute the 2D covariance matrix in image space"""
no_of_images = len(A)
cov = np.zeros((A.shape[2], A.sh... |
from fureon.utils.logger import main_logger
class ExceptionWithLogger(Exception):
def __init__(self, message, logger, level='warning'):
super(ExceptionWithLogger, self).__init__(message)
exception_name = self.__class__.__name__
logger_message = u'{0}: {1}'.format(exception_name, message)
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from base import QueryOperation
from params import SingleParam, StaticParam
from utils import OperationExample
#class GetFeedbackV4(QueryOperation):
# """
# This API is no longer available (on en or de wikipedia). As of
# 3/9/2013, this API do... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2008 Stephan Peijnik (sp@gnu.org)
#
# This file is part of NWU.
#
# NWU 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... |
# yaranullin/network/tests/test_network.py
#
# Copyright (c) 2012 Marco Scopesi <marco.scopesi@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.... |
import re
from unittest import TestCase
from eizzek.lib.registry import PluginRegistry, SessionPluginRegistry
class PluginRegistryTest(TestCase):
def setUp(self):
self.registry = PluginRegistry()
def ping(**kwargs):
return ''
self.ping = ping
self.regex = ... |
# -*- coding: utf-8 -*-
"""
Constructs board object which stores the get_location of all the pieces.
Default Array
| [[0th row 0th item, 0th row 1st item, 0th row 2nd item],
| [1st row 0th item, 1st row 1st item, 1st row 2nd item],
| [2nd row 0th item, 2nd row 1st item, 2nd row 2nd item]]
| Default board
| 8... |
from Tkinter import *
class ColorMap:
"""
A simple converter from a ColorRamp (a gradient of nColors) to
a ColorMap (a graph of data + visual way pts)
"""
def __init__(self,parent,ramp,width=None,height=None,data=None):
"""
just produces the canvas/image for
the ColorRamp
... |
# F. Giorgi R. Francisco
# Uncertainties in regional climate change prediction: a regional analysis
# of ensemble simulations with the HADCM2 coupled AOGCM
outlines = dict()
outlines[1] = ((110, -45), (155, -45), (155, -11), (110, -11))
outlines[2] = ((-82, -20), (-34, -20), (-34, 12), (-82, 12))
outlines[3] = ((-76, ... |
#!/usr/bin/python
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code mu... |
# vim: set fileencoding=utf-8 :
import unittest
import pyvips
from .helpers import PyvipsTester, JPEG_FILE
class TestGValue(PyvipsTester):
def test_bool(self):
gv = pyvips.GValue()
gv.set_type(pyvips.GValue.gbool_type)
gv.set(True)
value = gv.get()
self.assertEqual(value, ... |
import threading
class Async_Handler(object):
def __init__(self, data, method, callback, callback_data):
self.data = data
self.method = method
self.callback = callback
self.callback_data = callback_data
def execute(self):
self.execute_without_callback()
self.c... |
# -*- coding: utf-8 -*-
#
# gensim documentation build configuration file, created by
# sphinx-quickstart on Wed Mar 17 13:42:21 2010.
#
# 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.
#
# All ... |
# Copyright 2012 Canonical Ltd.
# This file is taken from the python-shelltoolbox package.
#
# IMPORTANT: Do not modify this file to add or change functionality. If you
# really feel the need to do so, first convert our code to the shelltoolbox
# library, and modify it instead (or modify the helpers or utils module h... |
from datetime import datetime, timedelta
from io import StringIO
from lxml import etree
import requests
from order.source_handler import check_source
from utils import (
log,
success,
warn
)
from api_utils import (
build_url,
MAX_PAGE_SIZE,
ANSWER_BATCH_SIZE
)
from custom_filters import load_... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from math import cos
from math import pi
from math import sin
from math import sqrt
from compas.utilities import pairwise
from compas.geometry import matrix_from_frame
from compas.geometry import transform_po... |
#!/usr/bin/env python
"""Instantiates the Python Eve REST API Server.
Instantiates the Python Eve REST API Server for both local
and cloud (IBM Bluemix) execution. Provides a default catch-all
routing to provide API consumers with intentional responses
for all routes. Provides a redis cloud caching instance for
sess... |
"""
Tests for go_http.account
"""
import collections
import copy
import json
from unittest import TestCase
from requests import HTTPError, Session
from requests.adapters import HTTPAdapter
from requests_testadapter import TestSession, Resp, TestAdapter
from go_http.account import AccountApiClient
from go_http.except... |
import os
import codecs
import jinja2
import docutils
import docutils.examples
import markupsafe
import shumgrepper
def modify_rst(rst):
""" Downgrade some of our rst directives if docutils is too old. """
try:
# The rst features we need were introduced in this version
minimum = [0, 9]
... |
#!/usr/bin/env python
#coding: iso-8859-15
#
# Copyright (C) 2005 Gaëtan Lehmann <gaetan.lehmann@jouy.inra.fr>
#
# this file is part of uptodate
#
# 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... |
import sys
import json
import operator
def read_raw_json(file_handle):
f = open(file_handle, 'r')
try:
raw_json = f.read()
finally:
f.close()
return raw_json
def parse_raw_json(raw_json):
return json.loads(raw_json)
def add_contestant_info_to_players_dictionary(
contest... |
import os
import logging
import decimal
import base64
import json
from datetime import datetime
from lib import config, util, util_worldcoin
ASSET_MAX_RETRY = 3
D = decimal.Decimal
def parse_issuance(db, message, cur_block_index, cur_block):
if message['status'] != 'valid':
return
def modify_extende... |
# -*- coding: utf-8 -*-
# EditXT
# Copyright 2007-2013 Daniel Miller <millerdev@gmail.com>
#
# This file is part of EditXT, a programmer's text editor for Mac OS X,
# which can be found at http://editxt.org/.
#
# EditXT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publ... |
from .models import Answers, RadioResults, SelectResults, ImportanceOrderResults, CheckboxResults
from chartit import DataPool, Chart
class Results( ):
def render_results( self, questions, survey ):
"""
Sorts out logic behind how we present our answers.
@param questions QuerySet Questions we're working with... |
from __future__ import division, print_function, absolute_import
from numpy.testing import assert_, assert_array_almost_equal, assert_equal, \
assert_almost_equal, assert_array_equal, \
assert_raises, run_module_suite, TestCase
import numpy as np
import scipy... |
# coding: utf-8
import json
import random
import string
from google.appengine.ext import ndb
class GlobalBotVariables(ndb.Model):
scenario_uri = ndb.StringProperty()
class GroupMembers(ndb.Model):
members = ndb.StringProperty(repeated=True)
class PlayerStatus(ndb.Model):
scene = ndb.StringProperty()
... |
# -*- coding: utf-8 -*-
#
# market_share_analysis documentation build configuration file, created by
# sphinx-quickstart.
#
# 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.
#
# All configuration... |
import unittest
from django.contrib.auth.models import Group
from django.test import TestCase
from hs_core import hydroshare
from hs_core.testing import MockIRODSTestCaseMixin
class TestPublishResource(MockIRODSTestCaseMixin, TestCase):
def setUp(self):
super(TestPublishResource, self).setUp()
... |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, 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 3 of the Lic... |
import gc
from asyncio import Queue
from datetime import datetime, timezone, timedelta
import pytest
from async_generator import aclosing
from asphalt.core import Event, Signal, stream_events, wait_event
try:
from asyncio import all_tasks, current_task
except ImportError:
from asyncio import Task
all_tas... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 IBM Corp.
# 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/licen... |
from setuptools import setup
with open("README.md") as file:
long_description = file.read()
setup(
name='vulkan',
version='1.1.99.1',
description='Ultimate Python binding for Vulkan API',
author='realitix',
author_email='realitix@gmail.com',
packages=['vulkan'],
long_descripiton=long... |
import os
import numpy as np
import time
import tensorflow as tf
from eight_mile.utils import listify, get_version
from eight_mile.tf.layers import SET_TRAIN_FLAG, get_shape_as_list
from eight_mile.tf.optz import EagerOptimizer
from baseline.utils import get_model_file, get_metric_cmp
from baseline.model import create_... |
import os
import unittest
from Orange.widgets.tests import test_setting_provider, \
test_settings_handler, test_context_handler, \
test_class_values_context_handler, test_domain_context_handler
from Orange.widgets.data.tests import test_owselectcolumns
try:
from Orange.widgets.tests import test_widget
... |
# coding: utf-8
"""
Connection
ConnectionStandalon
(class) ConnectionStandalonFactory
(class) ConnectionStandalonProtocol
ConnectionReplset
(class) ConnectionReplsetFactory
(class) ConnectionReplsetProtocol
(property) primary
(property) secondaries
connect (uri... |
"""
The ``zen.drawing.ubigraph`` module provides support for rendering Zen graphs in the `Ubigraph visualization environment <http://ubietylab.net/ubigraph/>`_. The renderer will update the visualization in real time as changes are made to the underlying graph. Furthermore, edges and nodes can be visually highlighted... |
__author__ = 'anderson'
import xml.etree.ElementTree as ET
import sys
import re
import generic_response
import pymongo
from pymongo import MongoClient
from dateutil.parser import parse
import logging
def send_to_consumer(url, xml_string):
print "sending to: " + url + '\n' + xml_string
#r = requests.post(url, ... |
#!/usr/bin/python2
from builder import Builder
from toolchain import CToolchain
from build_exceptions import BuildError
from multiprocessing import cpu_count
from Queue import Queue
from thread_pool import ThreadPool
from termcolor import colored
SINGLE_OBJECT_TIMEOUT = 25
class ParallelBuilder(Builder):
def __... |
import pytest
import python_jsonschema_objects as pjs
import collections
@pytest.fixture
def schema():
return {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Test",
"definitions": {
"MyEnum1": {"type": "string", "enum": ["E_A", "E_B"]},
"MyEnum2": ... |
#!/usr/bin/env python
# coding=utf-8
"""
Copyright 2013 Load Impact
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 la... |
#!/usr/bin/env python3
import unittest
import record,number
class TestRecordBuilder(unittest.TestCase):
def setUp(self):
self.text1=[
"1. АДМИНИСТРАЦИЯ ГУБЕРНАТОРА САНКТ- 2 114 774,1",
"ПЕТЕРБУРГА (801)",
"1.1. Расходы на содержание главы Правительства 0102 0010008 2 026,0",
"Санкт-Петербурга",
"1.... |
# Copyright 2019-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos 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 versio... |
#!/usr/bin/env python3
import RPi.GPIO as GPIO
import time
VibratePin = 11
Gpin = 13
Rpin = 12
tmp = 0
def setup():
GPIO.setmode(GPIO.BOARD) # Numbers GPIOs by physical location
GPIO.setup(Gpin, GPIO.OUT) # Set Green Led Pin mode to output
GPIO.setup(Rpin, GPIO.OUT) # Set Red Led Pin mode to out... |
# encoding: utf8
import re
from django import template
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
from wp_frontman.lib.utils import previous_next
register = template.Library()
widont_re = re.compile(r'''(?<!>)\s+(?!<)''', re.U|re.M|re.S)
@register.simple... |
from pyres import ResQ
from pyres.worker import Worker
from remotecv.utils import logger
class UniqueQueue(ResQ):
def _escape_for_key(self, value):
return value.replace(" ", "").replace("\n", "")
def _create_unique_key(self, queue, key):
return "resque:unique:queue:%s:%s" % (queue, self._esc... |
import re
import os
objects = ['Photon', 'Electron', 'Muon', 'Jet', 'Vertex']
susyObjects = {'Photon': 'Photon', 'Electron': 'Electron', 'Muon': 'Muon', 'Jet': 'PFJet', 'Vertex': 'Vertex'}
objectVars = file('ObjectVars.h')
classPat = re.compile('^[ ]*class[ ]+([a-zA-Z0-9]+)Vars[ ]*{')
cTorPat = re.compile('^[ ]*[a-z... |
import sys
import gc
import logging
import os.path
from typing import List, Tuple
from common import parse_utils
from common.drivers import ModuleDiscoveryDriver
from common.model import Module, PipedEvent
from common.utils import int_to_hex4str
from modules import StandardModulesOnlyDriver
from .errors import Config... |
import os
from flask import Flask, render_template, request, jsonify, send_from_directory
import win32api
import win32con
import time
import sys
#Giant dictonary to hold key name and VK value
VK_CODE = {'backspace':0x08,
'tab':0x09,
'clear':0x0C,
'enter':0x0D,
'shift':0x... |
###############################################################################
# Minecraft ID to Friendly Name #
# Copyright (C) 2016 TransportLayer #
# #
... |
from django.contrib.auth import (login as django_login, authenticate,
logout as django_logout)
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import SetPasswordForm
from django.http import JsonResponse, HttpResponseRedirect
from django.shortcuts... |
import numpy as np
from scipy import special
from sum_conv import sum_conv
def wzm_layer(ME1,MM1, MEdd, MMdd,Lambda,odl, Ceps,pin, taun, bn1mat,settings):
## wzmocnienie pola w srodku warstwy
# (Cst{1}.ME,Cst{1}.MM, Cst{dd}.ME, Cst{dd}.MM,...
# lambda, dip_pos ,Cepsilon{dd},theta,stPinTaun )
nNbtheta=pi... |
# Copyright 2019 The Meson development team
# 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 ... |
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 8 16:55:05 2017
@author: rickdberg
Calculate the rmse of modeled bottom water Mg concentration vs actual measurements
"""
import numpy as np
from sqlalchemy import create_engine
import pandas as pd
import matplotlib.pyplot as plot
import seawater
engine = create_engin... |
# -*- coding: utf-8 -*-
"""
Volunteer Management
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
s3db.hrm_vars()
# =============================================================================
def index... |
"""This insertion generator generates insertions with uniformly distributed lengths"""
import numpy as np
import mitty.lib
import mitty.lib.util as mutil
from mitty.plugins.variants import scale_probability_and_validate
import logging
logger = logging.getLogger(__name__)
__example_param_text = """
{
"p": 0.0001, ... |
# -*- coding: utf-8-*-
"""
Author: Marco Dinacci <dev@dinointeractive.com>
Copyright © 2008-2009
"""
from pandac.PandaModules import *
loadPrcFile("../res/Config.prc")
#loadPrcFileData("", "want-directtools 1")
#loadPrcFileData("", "want-tk 1")
import direct.directbase.DirectStart
from direct.gui.OnscreenText import... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def lang(apps, schema_editor):
Language = apps.get_model("Timeline_data", "Language")
en = Language()
en.id = 1
en.code = 'en'
en.indexing = 1
en.name = "English"
en.save()
da = Lan... |
STATE_MENU = 1
STATE_BUILD = 2
STATE_UFO = 3
STATE_FLIGHT = 4
STATE_RESULTS = 5
STATE_END = 100
# parts available for use per level number.
LEVEL_PARTS = {
1: ('tax returns', 'shopping list', 'todo list',
'ludum dare comments', 'bank accounts',
'website passwords', 'IP address scamlist',
),... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
"""
This file defines the classes used to represent a 'coordinate', which includes
axes, ticks, tick labels, and grid lines.
"""
import numpy as np
from matplotlib.ticker import Formatter
from matplotlib.transforms import Affine2D, ScaledTranslation
from matplotlib.patches import PathPatch
from .formatter_locator im... |
'''
Test the data.py module
'''
import numpy as np
import matplotlib.pyplot as plt
import util
import data as Data
# --- Halotools ---
from halotools.empirical_models import PrebuiltHodModelFactory
from ChangTools.plotting import prettyplot
from ChangTools.plotting import prettycolors
def PlotCovariance(obvs, ... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Copyright 2014 faisal oead <fafagold@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 2 of the License, or
#... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
This script was created to test different algorithms for peak finding in
different situations.
by Bruno Quint
"""
import numpy as np
import matplotlib.pyplot as plt
from astropy.modeling import fitting, models
from scipy import signal
__author__ = 'Bruno Quint'
... |
from extendable_cards.view.graphics import Rectangle, Point, Text
from tkinter import Button
class GameOutline(object):
def __init__(self, window, dx, dy, w, h):
self.top_y = dy
self.bottom_y = dy+h
self.right_x = dx+w
self.left_x = dx
self.discard_end_x = dx + (w/6.0)
... |
# coding: utf-8
import numpy as np
import pandas as pd
import os
import json
import sys
import re
from collections import Counter
####
import datetime
mylist = []
today = datetime.date.today()
mylist.append(today)
date = str(mylist[0]) # print the date object, not the container ;-)
####
topic_dist_dfname = sys.argv[... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2004-2009 Edgewall Software
# Copyright (C) 2004 Oliver Rutherfurd
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wi... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'CustomEmail.system'
db.add_column('admin_custom_emails', 'system',
sel... |
import os
import encodings.idna
import pytest
import yaml
import geopy
import shapely
import errorgeopy.geocoders
@pytest.fixture
def addresses():
return (
'66 Great North Road, Grey Lynn, Auckland, 1021, New Zealand',
'Grey Lynn, Auckland, 1021, New Zealand',
'High Street, Lower Hutt, N... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt
from frappe.model.naming import make_autoname
from frappe import _
from frappe.model.mapper import get... |
# -------------------------------------------------------------------------
# Copyright (c) 2010-2012 Lorne McIntosh
#
# This file is part of OptAnim.
#
# OptAnim 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... |
#
# gPrime - A web-based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007-2012 Brian G. Matherly
# Copyright (C) 2009 Nick Hall
# Copyright (C) 2009 Benny Malengier
# Copyright (C) 2010 Jakim Friant
# Copyright (C) 2011 Tim G L Lyons
# Copyright (C) 2012 Ma... |
"""
TestCommon.py: a testing framework for commands and scripts
with commonly useful error handling
The TestCommon module provides a simple, high-level interface for writing
tests of executable commands and scripts, especially commands and scripts
that interact with the file system. All methods throw... |
"""
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipul... |
#!/usr/bin/env python3
import sys
import socket
import json
import db
class NodeBase:
"""base class of node"""
def call(self, addr, msg, wait=True):
"""do request to other node and return result"""
request = bytes(json.dumps(msg), 'utf-8')
print('request', request)
self.socke... |
#!/usr/bin/env python2
# 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 ... |
# -*- coding: utf-8 -*-
import re
from typing import Iterable, Text
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import BaseHandler
import execjs
# noinspection PyProtectedMember
from bs4 import BeautifulSoup, SoupStrainer
from .base import FeedFetcher, Item
class IAppsF... |
#!/usr/bin/env python
# coding: utf8
import argparse
import logging
import time
from kalliope.core import Utils
from kalliope.core.ConfigurationManager import SettingLoader
from kalliope.core.ConfigurationManager.BrainLoader import BrainLoader
from kalliope.core.SignalLauncher import SignalLauncher
from flask import ... |
# coding: utf-8
#
# Copyright 2018 The Oppia 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 requi... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... |
#!/usr/bin/env python3
# Copyright (c) 2009-2019 The Bitcoin Core developers
# Copyright (c) 2014-2019 The DigiByte Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Class for digibyted node under test"""
import c... |
# © 2018 Savoir-faire Linux
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from datetime import datetime, timedelta
from odoo import fields
from .common import TestCalendarEventCommon
from odoo.exceptions import ValidationError
class TestCalendarEvent(TestCalendarEventCommon):
def setUp(self):... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
v_net_allpairs.py
---------------------
Date : December 2015
Copyright : (C) 2015 by Médéric Ribreux
Email : medspx at medspx dot fr
********************... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.