src
stringlengths
721
1.04M
#!/usr/bin/env python """Display a slew countdown timer (and, eventually, also trigger blink or some other indicator in certain text fields such as net position). Relevant keywords are: SlewDuration: indicates a slew has begun SlewEnd SlewSuperseded Warnings: - It is possible for slewSuperceded to arrive after slewDu...
from unittest import mock from taskplus.core.actions import (GetTaskStatusDetailsAction, GetTaskStatusDetailsRequest) from taskplus.core.domain import TaskStatus from taskplus.core.shared.response import ResponseFailure def test_get_status_details_action(): status = mock.Mock()...
#!/usr/bin/env python # # This file is part of pacman-mirrors. # # pacman-mirrors 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. # # p...
from itertools import combinations # Recebe dicionario de aulas de estrutura: # { CLASS_ID:{ # T:{ # CLASS_T1, # CLASS_T... # }, # TP:{ # CLASS_TP... # }, # ... # }, ... # } # Devolve array de todas as combinacoes de turmas possiveis # Refere-se aos elemen...
import arrow from libweasyl import staff from weasyl import define as d from weasyl import frienduser from weasyl import ignoreuser from weasyl import macro as m from weasyl import media from weasyl import welcome from weasyl.comment import thread from weasyl.error import WeasylError def select(userid, ownerid, lim...
#!/usr/bin/env python 'FontForge: Demo code to paste into the "Execute Script" dialog' __url__ = 'http://github.com/silnrsi/pysilfont' __copyright__ = 'Copyright (c) 2013, SIL International (http://www.sil.org)' __license__ = 'Released under the MIT License (http://opensource.org/licenses/MIT)' __author__ = 'David Ray...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2015 Glencoe Software, Inc. All rights reserved. # # This software is distributed under the terms described by the LICENCE file # you can find at the root of the distribution bundle. # If the file is missing please request a copy by contacting # jason@glen...
import bpy import cProfile from bpy.props import * from io import StringIO from contextlib import redirect_stdout class ProfileAnimationNodes(bpy.types.Operator): bl_idname = "an.profile" bl_label = "Profile" function = StringProperty() output = StringProperty() sort = StringProperty() def ex...
# These are all the modules we'll be using later. Make sure you can import them # before proceeding further. from __future__ import print_function import matplotlib.pyplot as plt import numpy as np import os import sys import tarfile from IPython.display import display, Image from scipy import ndimage from sklearn.lin...
from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.login import LoginManager from flask.ext.moment import Moment from flask.ext.bootstrap import Bootstrap import pyowm app = Flask(__name__, instance_relative_config=True) # config.default app.config.from_object('config.default') # config...
# Copyright 2004-2010 PyTom <pytom@bishoujo.us> # # 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, mer...
import logging from ..core.functions import update_comboboxtext_choices from ..core.toolframe import ToolFrame from ...core.services.accounting import Accounting, PrivilegeLevel logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) class AccountingFrame(ToolFrame): def __init__(self, *args, **kwarg...
#!/usr/local/sci/bin/python2.7 ''' # KW changed make_and_qc_db.py to make_and_full_qc.py # KW changed by adding --month1 and --month2 make_and_full_qc.py invoked by typing:: python2.7 make_and_full_qc.py -i configuration.txt --year1 1850 --year2 1855 --month 1 --month2 12 # KW edited to reflect that code now produc...
#!/usr/bin/python import pywikibot from pywikibot.pagegenerators import ( page_with_property_generator, GeneratorFactory, NamespaceFilterPageGenerator, ) from pywikibot.tools import first_lower from .wikidata import WikidataEntityBot class LabelSettingBot(WikidataEntityBot): def __init__(self, **kw...
""" DoxygenCommon Common code associated with doxygen builders """ import os, sys, os.path as path, yaml import SCons.Script from SCons.Environment import Environment from SCons.Script import File, Dir import glob from fnmatch import fnmatch from functools import reduce # Currently supported output for...
# Copyright 2015 Altova GmbH # # 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...
######################################################################## # File name: test_stanza.py # This file is part of: aioxmpp # # LICENSE # # This program 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 Foun...
import click def merge_many_dicts(*configs): config = {} for c in configs: config = merge_dicts(config, c) return config def merge_dicts(a, b): if isinstance(a, dict) and isinstance(b, dict): for k, v in b.items(): if k not in a: a[k] = v els...
from django.db import models from .raw_models import * from django.core.urlresolvers import reverse import datetime from django.core.exceptions import ValidationError class RadPassManager(models.Manager): def get_queryset(self): return super(RadPassManager, self).get_queryset().filter(attribute='NT-Pas...
"""Support for displaying persistent notifications.""" from collections import OrderedDict import logging from typing import Any, Mapping, MutableMapping, Optional import voluptuous as vol from homeassistant.components import websocket_api from homeassistant.core import HomeAssistant, callback from homeassistant.exce...
import tensorflow as tf import os import sys from copy import copy from model.pipeline import Pipeline from tensorflow.python import debug as tf_debug if __name__ == "__main__": num_keypoints = 30 patch_feature_dim = 8 decoding_levels = 5 kp_transform_loss = 1e4 recon_weight = 0.001 learni...
import subprocess class P2PTestPeers: #for testing with localhost sshname = "testnet" # ssh name for executing remote commands hosts = ["localhost"] # host list ports = [8888] # eosiod listening port of each host devs = ["lo0"] # network device of each host #for testing with testnet2 #ssh...
import re from collections import defaultdict GOAL_CHAR = 'G' EMPTY_CHAR = '_' NORMAL_CHAR = '.' BIG_CHAR = '#' START = (35,0) def print_grid(grid, goal, goal_size): for l, j in enumerate(grid): for k, i in enumerate(j): print_char = NORMAL_CHAR if i[1] > 100: pri...
# 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...
"""Compatibility module, imported by ZSI if you don't have PyXML 0.7. No copyright violations -- we're only using parts of PyXML that we wrote. """ _copyright = '''ZSI: Zolera Soap Infrastructure. Copyright 2001, Zolera Systems, Inc. All Rights Reserved. Copyright 2002-2003, Rich Salz. All Rights Reserved. Permis...
# -*- 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 'CustomUser.photo' db.add_column('app_customuser', 'photo', self.gf('dj...
from djpcms.test import TestCase from djpcms.views import appsite, appview from regression.autocomplete.models import Strategy # RULE 1 import forms from djpcms from djpcms import forms class TestForm(forms.Form): strategy = forms.ModelChoiceField(Strategy.objects.all()) class TestFormMulti(forms.Form)...
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2020, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
#PAM.py import re import glob, os, time from numpy import * from pylab import * def analyzeFile(fileName,delim): cols = {} indexToName = {} lineNum = 0 goodLines = 0 shortLines = 0 FILE = open(fileName,'r') for line in FILE: line = line.strip() if lineNum < 1: lineNu...
"""Parse input PED files for loading into GEMINI sample table. Tries to parse as tab-delimited if files contain tabs, otherwise splits on whitespace. """ default_ped_fields = ["family_id", "name", "paternal_id", "maternal_id", "sex", "phenotype"] missing_member = set(["None", None, "0", "-9"]) ...
# -*- coding: utf-8 -*- # # Copyright 2008-2010 Brett Adams # Copyright 2015-2017 Mario Frasca <mario@anche.no>. # Copyright 2017 Jardín Botánico de Quito # # This file is part of ghini.desktop. # # ghini.desktop is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
""" Based entirely on Django's own ``setup.py`` for now. """ from distutils.core import setup from distutils.command.install_data import install_data from distutils.command.install import INSTALL_SCHEMES import os import sys class osx_install_data(install_data): # On MacOS, the platform-specific lib di...
#!/usr/bin/env python # # UK Parliament Written Answers are now in a new database-driven website. This # site has a nice search, and RSS feeds, but for now we still need a bit of # scraping to fetch the data. Ever so slightly simpler than the past, though! import argparse import datetime import json import os import r...
# -*- encoding: utf-8 -*- ############################################################################## # # # OpenERP, Open Source Management Solution. # # ...
############################################################################################# # # Python script to demonstrate interacting with CASDA's SODA implementation to # retrieve cutout images around a list of sources. # # This script creates a job to produce and download cutouts from the specified image at # t...
""" ========================================== Outlier detection with several methods. ========================================== This example illustrates two ways of performing :ref:`outlier_detection` when the amount of contamination is known: - based on a robust estimator of covariance, which is assuming that the ...
from copy import copy import traceback import uuid try: from cStringIO import StringIO as BytesIO except ImportError: from io import BytesIO from twisted.python import log from .utils import get_spider_list, JsonResource, UtilsCache, native_stringify_dict class WsResource(JsonResource): def __init__(sel...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # FAR documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # 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 # autogen...
# Copyright (C) 2008 One Laptop Per Child # # 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 distribu...
# # Copyright 2012 SAS Institute # # 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 ...
# file eulexistdb/__init__.py # # Copyright 2010,2011 Emory University Libraries # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
import os import json from setuptools import setup, find_packages package_name = 'lux' def read(name): root_dir = os.path.dirname(os.path.abspath(__file__)) with open(os.path.join(root_dir, name), 'r') as f: return f.read() def run(): install_requires = [] dependency_links = [] pkg = ...
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-03-05 03:44 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import uuid class Migration(migrations.Migration): dependencies = [ ('cinemas', '0002_auto_20160303_0631'), ] ...
#!/usr/bin/env python import math import sys import os import random import struct import popen2 import getopt import numpy pi=math.pi e=math.e j=complex(0,1) doreal=0 datatype = os.environ.get('DATATYPE','float') util = '../tools/fft_' + datatype minsnr=90 if datatype == 'double': fmt='d' elif datatype=='int1...
# based on http://cs229.stanford.edu/proj2013/JimenezNguyen_MathFormulas_final_paper.pdf import sys sys.path.append('/usr/local/lib/python2.7/site-packages/') # not necessary for all computers, depending on how OpenCV was installed import cv2 import numpy as np from skimage import morphology from PIL import Image de...
# simpleCircleInstrument.py # # Demonstrates how to use mouse and keyboard events to build a simple # drawing musical instrument. # from gui import * from music import * from math import sqrt ### initialize variables ###################### minPitch = C1 # instrument pitch range maxPitch = C8 # create display d ...
# -*- coding: utf-8 -*- from __future__ import division import math from numpy import minimum as min_ from ....base import * # noqa analysis:ignore from .base import apply_bareme_for_relevant_type_sal class allocations_temporaires_invalidite(Variable): column = FloatCol entity_class = Individus label...
# ============================================================================= # Copyright (C) 2010 Diego Duclos # # This file is part of pyfa. # # pyfa 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 ...
import errno import json import logging import os import re import socket import subprocess import sys from contextlib import contextmanager from datetime import ( datetime, timedelta, ) from time import ( sleep, time, ) from jujupy.utility import ( ensure_deleted, ensure_dir, get_timeout_p...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed unde...
info = { "name": "bem", "date_order": "DMY", "january": [ "jan", "januari" ], "february": [ "feb", "februari" ], "march": [ "mac", "machi" ], "april": [ "epr", "epreo" ], "may": [ "mei" ], "june":...
#!/usr/bin/env python from setuptools import find_packages, setup with open('README.rst') as f: readme = f.read() doc_requires = [ 'sphinx', 'sphinx-prompt', ] test_requires = [ 'coverage', 'pytest', 'pytest-cov', ] dev_requires = doc_requires + test_requires + [ 'bumpversion', 'che...
# 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...
""" Platform-specific code lives here. This is its own module to abstract away what would otherwise be distracting logic-flow interruptions. """ from contextlib import contextmanager import select import sys # TODO: move in here? They're currently platform-agnostic... from .util import has_fileno, isatty WINDOWS =...
from Tkinter import Toplevel, Tk if __name__ == "__main__": _ = lambda x:x class Popup(Toplevel): deferred = None parent = None def __init__(self, parent, addnl=None): Toplevel.__init__(self) self.initial_focus = self self.parent = parent self.addnl = addnl s...
# -*- coding: utf-8 -*- import markdown import ho.pisa as pisa import StringIO import os import re from Cheetah.Template import Template from tempfile import NamedTemporaryFile debug = False def markdown2pdf(text, pdffile, cssfile='xhtml2pdf.css', src_dir='.', fontfile='arial.ttf', skipTo1st=False...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Proxy models for augmenting our source data tables with methods useful for processing. """ from .core import ( OCDDivisionProxy, OCDMembershipProxy, OCDOrganizationProxy, OCDOrganizationIdentifierProxy, OCDOrganizationNameProxy, OCDJurisdictionPr...
#!/bin/python """ Author: Matt Strader Date:August 19,2012 Opens a twilight flat h5 and makes the spectrum of each pixel. Then takes the median of each energy over all pixels A factor is then calculated for each energy in each pixel of its twilight count rate / median count rate The factors are written out in an...
from functools import partial import copy import datetime import numbers import pytz import json import types from django import template from django.core.urlresolvers import reverse from django.template.loader import render_to_string from django.utils.translation import ugettext as _ from django.utils.safestring impo...
import sqlite3 import os class DBManager(object): def __init__(self, filename): self.filename = filename def _init_db(self): self._connect() cu = self.conn.cursor() cu.execute("CREATE TABLE people (name VARCHAR(64), city VARCHAR(32), salary INTEGER);") self.conn.commi...
#!/usr/bin/env python2 # A worker. Waits for incoming connection on port 10666 # When data are received, process them, and sends back to host (using requests), port 10665 import web #Listen for requests from libs.web import ip_port, get_self_ip web.config.debug = False import requests #Answer to requests when data ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ DIRAC and GridPP: perform a query on the CERN@school frames. """ #...for the operating system stuff. import os #...for parsing the arguments. import argparse #...for the logging. import logging as lg # Import the JSON library. import json # The DIRAC import stat...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
# encoding: 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): # Changing field 'ApplicationEntry.english_band_type' db.alter_column('springaid2012_applicatio...
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
from math import sqrt from numpy import mean from Crypto.Cipher import AES import operator hexd={"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,"a":10,"b":11,"c":12,"d":13,"e":14,"f":15} b64d={0:"A",16:"Q",32:"g",48:"w",1:"B",17:"R",33:"h",49:"x",2:"C",18:"S",34:"i",50:"y",3:"D",19:"T",35:"j",51:"z",4:"E...
#!/usr/bin/env python """ Copyright 2015-2020 Knights Lab, Regents of the University of Minnesota. This software is released under the GNU Affero General Public License (AGPL) v3.0 License. """ import click import os from ninja_utils.utils import verify_make_dir from ninja_utils.parsers import FASTA from dojo.datab...
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
#!/usr/bin/env python import sys import pickle from twython import Twython from django.core.management import setup_environ sys.path.append('.') import settings setup_environ(settings) from parliament.models import Member, MemberSocialFeed PICKLE_FILE="mp-twitter.pickle" twitter = Twython() def read_twitter_list...
import MySQLdb import os,sys,smtplib import time from time import sleep from email.mime.text import MIMEText from email.header import Header from scrapy.utils.project import get_project_settings class dbTest(): def __init__(self): self.settings=get_project_settings() self.host=self.settings['MYSQL_HOST'] self...
#!/usr/bin/python2.7 # -*- coding: utf-8 -*- # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # 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 ...
# 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 ...
import clientConfig as cConf from mmp_tracer_api import objID from comsol_api import MMPComsolDummy from mupif import * import logging logger = logging.getLogger() import time as timeTime start = timeTime.time() logger.info('Timer started') # locate nameserver ns = PyroUtil.connectNameServer( nshost=cConf.nshost,...
#!/usr/bin/env python # -*- coding: ascii -*- from __future__ import print_function from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from builtins import object from tkinter import * from PIL import Image, ImageTk from xymath.gui.logo import logo_data impor...
__copyright__ = "Copyright 2017 Birkbeck, University of London" __author__ = "Martin Paul Eve & Andy Byers" __license__ = "AGPL v3" __maintainer__ = "Birkbeck Centre for Technology and Publishing" from uuid import uuid4 from collections import Counter from datetime import timedelta from django.contrib import message...
""" @file comm_wifi_mnode.py """ ## # @addtogroup wifi # @brief This is component # @{ # @addtogroup comm_wifi_mnode # @brief This is comm_wifi module # @{ ## import time import os import string import wifi import ConfigParser from oeqa.oetest import oeRuntimeTest from oeqa.utils.helper import shell_cmd_timeout from ...
# # mechanism # def Pred__possibles(args): for rule in self.rules: for possible in rule.possibles(args): yield possible def Rule__possibles(args): locals = self.match_args(self.args, args) if locals is None: return # E.G. "pred(X, 1)" matches ("Q", "V") producing {'X':Var("Q...
# ---------------------------------------------------------------------------- # Copyright 2016 Nervana Systems 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.o...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging from openerp import SUPERUSER_ID from openerp import tools from openerp.modules.module import get_module_resource from openerp.osv import fields, osv from openerp.tools.translate import _ _logger = loggi...
import unittest from yahooscraper import * class YahooScraperImportTests(unittest.TestCase): def test_import(self): import yahooscraper self.assertIsNotNone(yahooscraper) self.assertIsNotNone(yahooscraper.login) self.assertIsNotNone(yahooscraper.fantasy) self.assertIsNotN...
""" This module encapsulates the behaviour of third species counterpoint. """ import random import foox.ga as ga from .utils import is_parallel, make_generate_function, is_stepwise_motion # Some sane defaults. DEFAULT_POPULATION_SIZE = 4000 DEFAULT_MAX_GENERATION = 200 DEFAULT_MUTATION_RANGE = 3 DEFAULT_MUTATION_RAT...
# This is a template config file for marionette production on Windows. import os import sys config = { # marionette options "marionette_address": "localhost:2828", "test_manifest": "unit-tests.ini", "virtualenv_python_dll": 'c:/mozilla-build/python27/python27.dll', "virtualenv_path": 'venv', "...
# -*- coding: utf-8 -*- import pykka import socket import select import sys import pybonjour import time from mopidy import core, utils from threading import Thread import netifaces import logging import traceback logger = logging.getLogger(__name__) class AppleTvFrontend(pykka.ThreadingActor, core.CoreListene...
# Copyright 2015 NEC Corporation. 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 ...
from PyQt4 import QtGui, QtCore class MainWindow(QtGui.QDialog): def __init__(self): QtGui.QDialog.__init__(self) self.setWindowTitle("PacaBackUp") # Vertical layout self.layout = QtGui.QVBoxLayout(self) # Create widgets self.main_menu_bar = QtGui.QMenuBar() ...
""" Tiny framework used to power Pulsar application, nothing in here is specific to running or staging jobs. Mostly deals with routing web traffic and parsing parameters. """ from webob import Request from webob import Response from webob import exc import inspect from os.path import exists import re from json import...
#!/usr/bin/env python3 __author__ = 'thricehex' __version__ = '7.3.15' # Script for generating password wordlists by mangling keywords, numbers, # or existing wordlists into common password structures. # Author: Garrett Smith(ThriceHex) # Version: 7.3.15 import argparse import os import subprocess descript = 'Gene...
# -*- coding: utf-8 -*- # # gPodder - A media aggregator and podcast client # Copyright (c) 2005-2018 The gPodder Team # # gPodder 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 Licens...
"""hug/test.py. Tests the support for asynchronous method using asyncio coroutines Copyright (C) 2016 Timothy Edmund Crosley 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,...
# -*- coding: utf-8 -*- """ WeatherServer Copyright (C) 2015 Full Stack Embedded 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 versio...
# -*- coding: utf-8 -*- #!/usr/bin/python import MySQLdb import pywikibot import sys import re import mwparserfromhell from pywikibot import pagegenerators ''' Ce script va récupérer toutes les pages qui utilisent le template "Infobox Rugbyman" ''' site = pywikibot.Site("fr", "wikipedia") def parse(title): page = p...
#!/usr/bin/env python # # # Copyright 2007-2016 The Python-Twitter Developers # # 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 requir...
import numpy as np from matplotlib.collections import Collection from matplotlib.artist import allow_rasterization # noinspection PyAbstractClass class CircleCollection(Collection): """Custom circle collection The default matplotlib `CircleCollection` creates circles based on their area in screen units. ...
"""CURRENTLY OUTDATED. WILL UPDATE IN FUTURE""" """ import torch from torch import Tensor from torch.autograd import Variable as Var from torch.utils.data import DataLoader from rl.utils import ProgBar, RealtimePlot from rl.envs import controller class DAgger(): def __init__(self, env, learner, expert): ...
from __future__ import division class easy_profile(object): """ cProfile.Profile easy-to-use wrapper """ def __init__(self, func, file_name, func_name, line, runs=1): """ Profiling of the callable func. file_name, func_name, line shall tell where func is defined. runs is the number of calls which will ...
#! /usr/bin/env python from twisted.application import service, internet from twisted.internet import reactor, defer from starpy import manager, fastagi, utilapplication, menu import os, logging, pprint, time from basicproperty import common, propertied, basic log = logging.getLogger( 'priexhaustion' ) log.setLevel( l...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014-2015 Anthony Minotti <anthony@minotti.cool>. # # # This file is part of Yameo framework. # # Yameo framework is free software: you can redistribute it and/or modify # it under the terms of the G...
# Copyright 2013 Mario Graff Guerrero # 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 wri...
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() # NOQA import collections import numpy as np from chainerrl.misc.r...
import numpy as np import matplotlib import matplotlib.pyplot as plt def plot(params): # Extract parameters t1 = 1. t2, mu, x1, x2, epsf, V = params # Format filename filename = 't1_%.2f_t2_%.2f_mu_%.2f_x1_%.2f_x2_%.2f_epsf_%.2f_V_%.2f.png'%(t1,t2,mu,x1,x2,epsf,V) # Define function to plo...