src
stringlengths
721
1.04M
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- import gtk import webkit import gobject import xml.dom.minidom from xml.dom.minidom import Node import time import os import sys import crypt, random, string import libcrypt from sqlite3 import dbapi2 as sqlite gobject.threads_init() def dialog_info(info): """ ...
import sys, string, os, datetime, time, glob, subprocess, re, fnmatch #Windows version (slashes = / ) def parallelCommands(cmds, numThreads): if not cmds: return # empty list def done(p): return p.poll() is not None def success(p): return p.returncode == 0; def fail(): sys.exit(...
import argparse import os import platform import urllib import tempfile import names driver_urls = { 'chrome_os_x': { 'url': 'http://chromedriver.storage.googleapis.com/2.21/chromedriver_mac32.zip', 'file_name': 'chromedriver_mac32.zip' }, 'chrome_ubuntu': { 'url': ...
import numpy.fft as nfft import numpy as np import timeseries as ts from scipy.stats import norm # import pyfftw import sys #sys.path.append("/Users/yuhantang/CS207/TimeSeries/procs") from .interface import * def createfromlist(l): d = new_darray(len(l)) for i in range(0,len(l)): darray_set(d,i,l[i]) ...
import random class Card(object): SUITS = ('C', 'S', 'H', 'D') VALUES = {'A':1, '2':2, '3':3, '4':4, '5':5, '6':6, '7':7, '8':8, '9':9, 'T':10, 'J':10, 'Q':10, 'K':10} def __init__(self, suit, rank): if (suit in self.SUITS) and (rank in self.VALUES.keys()): self.suit = suit ...
# # The Multiverse Platform is made available under the MIT License. # # Copyright (c) 2012 The Multiverse 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 restrict...
from __future__ import print_function from __future__ import absolute_import from __future__ import division import math from copy import deepcopy from compas.geometry import scale_vector from compas.geometry import normalize_vector from compas.geometry import subtract_vectors from compas.geometry import cross_vecto...
# -*- coding: utf-8 """Logic to add suggestions to exceptions.""" import keyword import difflib import didyoumean_re as re import itertools import inspect import errno import os import sys from collections import namedtuple #: Standard modules we'll consider while searching for symbols, for instance: # - NameError a...
from tridesclous import get_dataset from tridesclous.peakdetector import get_peak_detector_class import time import itertools import scipy.signal import numpy as np import sklearn.metrics.pairwise from matplotlib import pyplot from tridesclous.tests.test_signalpreprocessor import offline_signal_preprocessor from t...
from django.db.models.query_utils import Q from django.forms.models import ModelChoiceIterator from django_select2.fields import ChoiceMixin, AutoModelSelect2MultipleField, AutoModelSelect2Field from django_select2_extension.widgets import AutoPhotoHeavySelect2MultipleWidget, AutoPhotoHeavySelect2Widget class Filtera...
# Hijacking third party libs # now things are going to get serious. # imagine you need to put some code inside a third party lib. Let's say # it is some logging feature so you can understand some wacky behavior. # you don't know where this will lead you, and you are exploring # alternatives to learn more about the c...
from utils import PropertyUnavailable class People(object): """ A collection of people, represented by the Person class. """ def __init__(self, json=None): self._json = json or {} self.data = [Person(identity) for identity in self._json] def __str__(self): return self.__u...
import argparse import csv import logging import re import os import sys BLANK_SUB = '_' LABEL_SEPARATOR = ':' ID_SEPARATOR = '_' def read_data(directory): logger = logging.getLogger(sys.argv[0]) for subdir in next(os.walk(directory))[1]: label = subdir subpath = os.path.join(directory, subdi...
# 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 ...
from django.db import models from django.contrib import admin # Create your models here. # -*- coding: utf-8 -*- def decode(info): return info.decode('utf-8') class Book(models.Model): class Meta: verbose_name = 'book' verbose_name_plural = verbose_name ISBN = models.CharField('ISBN',max_l...
# # Script to run all of the figure of merit code for a single run back to back. # import viirs_fom as vf import sys def all_fom(database_name, workers=12) : # I over U FOM vf.calc_all_ioveru_fom('{}_schema_info.csv'.format(database_name), 'gt', 'burnmask13', workers=work...
#!/usr/bin/env python3 # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright 2017-2018 - Edoardo Morassutto <edoardo.morassutto@gmail.com> import datetime impor...
from __future__ import print_function from keras.models import Sequential from keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D from keras.layers.core import Activation, Flatten, Dense, Dropout from keras.regularizers import l2 from keras.optimizers import Adam from keras import backend as ...
#!/usr/bin/env python # Copyright (c) 2011, The University of York # All rights reserved. # Author(s): # James Arnold <jarnie@gmail.com> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of sourc...
import csv, os, shutil, time import datetime as dt import xbmc, xbmcgui import rpi.constants, rpi.hash, rpi.web from rpi.constants import videoPath as videoPath from rpi.constants import videoPathTmp as videoPathTmp from rpi.constants import videocsvfile as videocsvfile from rpi.constants import videocsvfile as video...
# -*- coding: utf-8 -*- import wx from wx.lib.buttons import ThemedGenBitmapTextToggleButton class ToggleButton(ThemedGenBitmapTextToggleButton): def __init__(self, parent, id=-1, bitmap=None, label='', pos=wx.DefaultPosition, ...
import sys import numpy as np MATRIXONEFILENAME = sys.argv[1] MATRIXTWOFILENAME = sys.argv[2] DETECTORLENGTHFILENAME = sys.argv[3] OUTPUTFILENAME = sys.argv[4] SEQUENCELENGTH = int(sys.argv[5]) MAXPOOLSIZE = int(sys.argv[6]) def getIntList(): # Gets a list of ints from the detector file intFile = open(D...
# Copyright 2014 Cloudera 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, so...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015-2018: Alignak team, see AUTHORS.txt file for contributors # # This file is part of Alignak. # # Alignak 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 So...
# -*- coding: utf-8 -*- """Evaluators module of the nc2map package. This module (currently) contains two evaluators of MapBase instances plus the base class. Classes are: - EvaluatorBase: (Subclass of MapsManager). Base class for all evaluators (this class itself does nothing but provide the general framework...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015, 2016 CERN. # # Invenio 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...
# -*- coding: utf-8 -*- """ Created on Tue Sep 12 18:47:50 2017 @author: adelpret """ from scipy import signal import numpy as np from scipy import ndimage import matplotlib.pyplot as plt from identification_utils import solve1stOrderLeastSquare def identify_motor_acc(dt, dq, ddq, current, tau, Kt_p, Kv_p, ZERO_VELO...
from django.db import models from django.utils import timezone from django.utils.translation import ugettext as _ class AnsweredQuestionsHistoric(models.Model): discipline = models.ForeignKey('Discipline', related_name=_('Discipline'), verbose_name=_(u"Discipline")) lesson = models.ForeignKey('Lesson', relate...
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# 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): # Adding field 'Response.created' db.add_column('authorizenet_response', 'created', self.gf('django.db.mo...
# # Copyright (c) 2015 NORDUnet A/S # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of ...
# Copyright 2016 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
#!/usr/bin/env python # nicechart.py # # Copyright 2011 # # Christoph Sterz # Florian Weber # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or #...
import urllib.parse import dsportal import cgitb import cgi import rssgen import os cgitb.enable() def application(env, startResponse): os.chdir('/webserver/rss') method = env['REQUEST_METHOD'] try: contentLength = int(env['CONTENT_LENGTH']) postEnv = env.copy() postEnv['QUERY STRING'] = '' HTTPPost = cgi...
import argparse import collections import sys try: import vcf except ImportError: exit("This script requires the PyVCF python package. Please install using pip or conda") def filter_call(sample, filters): if sample['DP'] < filters.DEPTH: return "Depth" elif sample['Q'] < filters.QUAL: ...
# Copyright (c) 2005-2007 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this ...
# $Filename$ # $Authors$ # Last Changed: $Date$ $Committer$ $Revision-Id$ # # Copyright (c) 2003-2011, German Aerospace Center (DLR) # All rights reserved. # #Redistribution and use in source and binary forms, with or without # #modification, are permitted provided that the following conditions are #met: # ...
# 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 ...
# Copyright (c) 2014 The Bitcoin Core developers # Copyright (c) 2014-2015 The Moneta developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Helpful routines for regression testing # # Add python-bitcoinrpc to module s...
import ql2_pb2 as p import types import sys from errors import * from net import Connection class RqlQuery(object): # Instantiate this AST node with the given pos and opt args def __init__(self, *args, **optargs): self.args = [expr(e) for e in args] self.optargs = {} for k in optargs....
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
#!/usr/bin/env python3 # ============================================================================== # Copyright 2019 - Philip Paquette # # NOTICE: 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 th...
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: url(r'^$', 'glassface.views.splash', name='home'), url(r'^twitteradd/([a-zA-Z0-9]+)$', 'glassface.views.twitt...
from django.core.management.base import BaseCommand from django.db import transaction from django.core.files import File from optparse import make_option import csv import datetime import os.path import mimetypes from advisornotes.models import AdvisorNote from coredata.models import Person, Unit from coredata.queries...
''' Created on 16 Jan 2014 @author: Jamie ''' import sqlite3 as lite import pandas import pandas.io.sql as pd_lite ''' Create the stations database ''' with lite.connect("./db/uk_stations.db") as con: cur = con.cursor() cur.execute("DROP TABLE IF EXISTS Stations") stations = pandas.read_csv('./tables...
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Michael Liao' ''' Database operation module. ''' import time, uuid, functools, threading, logging # Dict object: class Dict(dict): ''' Simple dict but support access as x.y style. >>> d1 = Dict() >>> d1['x'] = 100 >>> d1.x 100 ...
######################################################################## # File name: xso.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 Foundation, ...
import ravendb import unittest import test_base class test_when_configuring_ravenpy_session(test_base.TestCase): def tearDown(self): pass def test_configuring_wait_for_non_stale_results(self): self.session = ravendb.store(self.get_uri(), self.get_db(), waitForNonStaleResults = False...
""" crafty experiment within gentoo chroot. """ from benchbuild.utils.wrapping import wrap_in_uchroot as wrap from benchbuild.projects.gentoo.gentoo import GentooGroup from benchbuild.utils.downloader import Wget from benchbuild.utils.run import run, uchroot from benchbuild.utils.cmd import cat # pylint: disable=E040...
# -*- coding: utf-8 -*- # # # TheVirtualBrain-Scientific Package. This package holds all simulators, and # analysers necessary to run brain-simulations. You can use it stand alone or # in conjunction with TheVirtualBrain-Framework Package. See content of the # documentation-folder for more details. See also http://ww...
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2015-2019 Rapptz 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 u...
def load_parameters(): """ Loads the defined hyperparameters :return parameters: Dictionary of loaded parameters """ # Input data params TASK_NAME = 'my_task' # Task name DATASET_NAME = TASK_NAME # Dataset name SRC_LAN = 'fr' ...
import random data = [] NUM_COLOURS = 5 GRID_SIZE = 20 def init(): for y in range(GRID_SIZE): r = [] for x in range(GRID_SIZE): r.append(random.randint(0, NUM_COLOURS - 1)) data.append(r) def get_block_colour(x, y): if x in range(get_width()) and y in range(get_height())...
# file: share/when-wizard/templates/cond-event-batterylow.py # -*- coding: utf-8 -*- # # Condition plugin for the low battery event # Copyright (c) 2015-2018 Francesco Garosi # Released under the BSD License (see LICENSE file) import locale from plugin import EventConditionPlugin, PLUGIN_CONST, plugin_name # setup i1...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Compare all photos within a tree with those stored in a date tree (yyyy/mm/dd/*) and remove already existing pictures""" import KmdImages import KmdCmd import PIL.Image as Image import os, sys import logging class KmdImagesMergeDateTree(KmdCmd.KmdCommand): def ext...
from __future__ import unicode_literals import sys from datetime import date, datetime from decimal import Decimal, ROUND_UP, ROUND_DOWN from unittest import TestCase from wtforms import validators, widgets, meta from wtforms.fields import * from wtforms.fields import Label, Field, SelectFieldBase, html5 from wtform...
from flask import Flask, g from dnsforever.config import secret_key from dnsforever.models import Session from dnsforever.web.tools.session import get_user blueprints = ['apis', 'index', 'account', 'domain', 'domain_a', 'domain_ddns', 'domain_aaaa', 'domain_cname', 'domain_mx', ...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2017 Romain Boman # # 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 ...
# -*- coding: utf-8 -*- ''' The `sync` function in `vdirsyncer.sync` can be called on two instances of `Storage` to synchronize them. Apart from the defined errors, this is the only public API of this module. The algorithm is based on the blogpost "How OfflineIMAP works" by Edward Z. Yang: http://blog.ezyang.com/2012/...
# !/usr/bin/python #-*- coding: utf-8 -*- """ This file is part of B{Domogik} project (U{http://www.domogik.org}$ License ======= B{Domogik} is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of t...
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-07-11 11:01 from __future__ import unicode_literals import django.contrib.auth.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('type_page', '0001_initial'), ] operations = [...
# Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 import opt_einsum from pyro.util import ignore_jit_warnings _PATH_CACHE = {} def contract_expression(equation, *shapes, **kwargs): """ Wrapper around :func:`opt_einsum.contract_expression` that optionally uses Pyro'...
''' This package is for user managing in wechat mp 1. What can we do? - set tags and everything around them - get all your users (of course not at a time) or get detailed information of one - set blacklist and everything around it 3. I alse listed API list for you: - TAGS create_tag ...
""" classify patients based on lab tests """ import get_sample.mimic2 from mutil import Graph import mutil.mycsv import time import datetime import random import numpy as np import theano import theano.tensor as T import alg.classification def main( max_id = 2000, target_codes = ['428.0'], show_flag = True): m...
from django.db import connections #, transaction from collections import OrderedDict, namedtuple from django.conf import settings from django.db import DatabaseError from traceback import print_exc from ansi.constants import field_type_name def dictfetchall(cursor): """Returns all rows from a cursor as a dict (r...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2011-2015 Glencoe Software, Inc. All Rights Reserved. # Use is subject to license terms supplied in LICENSE.txt # """ chgrp plugin Plugin read by omero.cli.Cli during initialization. The method(s) defined here will be added to the Cli class for...
#!/usr/bin/env python3 # Johannes Steinmetzer, April 2019 # See [1] https://pubs.acs.org/doi/pdf/10.1021/j100247a015 # Banerjee, 1985 # [2] # import matplotlib.pyplot as plt import numpy as np import sympy as sym def make_funcs(): x, y, = sym.symbols("x y") f_ = (1 - y)*x**2*sym.exp(-x**2) + (1/...
import os.path # Copyright: (2013-2014) Michael Till Beck <Debianguru@gmx.de> # License: GPL-2.0+ #We collect xpath snippets at this place: <a href="https://github.com/Debianguru/MailWebsiteChanges/wiki/snippets">Snippet collection</a> - please feel free to add your own definitions! sites = [ {'shortname'...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # This file is part of agora-tools. # Copyright (C) 2014-2016 Agora Voting SL <agora@agoravoting.com> # agora-tools 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...
# -*- coding: utf-8 -*- """/lezioni command""" import logging import re from typing import Tuple from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update from telegram.ext import CallbackContext from module.data import Lesson from module.shared import check_log, send_message logging.basicConfig(format='...
#!/usr/bin/env python #-*- coding: utf-8 -*- pywversion="2.1.7" never_update=False # # jackjack's pywallet.py # https://github.com/jackjack-jj/pywallet # forked from Joric's pywallet.py # beta_version = ('a' in pywversion.split('-')[0]) or ('b' in pywversion.split('-')[0]) missing_dep = [] from bsddb.db import *...
# -*-coding: utf-8-*- import logging from pyramid.view import view_config, view_defaults from pyramid.response import Response from pyramid.httpexceptions import HTTPFound from . import BaseView from ..models import DBSession from ..models.resource import Resource from ..models.supplier import Supplier from ..lib.bl...
# $Id: __init__.py 7977 2016-11-29 12:00:39Z milde $ # Author: David Goodger # Maintainer: docutils-develop@lists.sourceforge.net # Copyright: This module has been placed in the public domain. """ Simple HyperText Markup Language document tree Writer. The output conforms to the XHTML version 1.0 Transitional DTD (*al...
# -*- coding: utf-8 -*- # Copyright 2015, 2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
import io import os from setuptools import setup, find_packages VERSION = '1.6' long_description_text = """Forex Python is a Free Foreign exchange rates and currency conversion. Features: List all currency rates. BitCoin price for all curuncies. Converting amount to BitCoins. Get historical rates for any day since 199...
import broke import sys import argparse def parse_arguments(): parser = argparse.ArgumentParser(description="Prints information about a broke-file") parser.add_argument("--verbose", action="store_true", help="Print each message") parser.add_argument("--utf8", action="store_true", help="Prints payload of ea...
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
class Automovil: def __init__(self, Vel, Kilometraje_Marcado, Cupo_Max): self.Vel = Vel self.Kilometraje_Marcado = Kilometraje_Marcado self.Cupo_Max = Cupo_Max def Costo(self, Cupo_Max): Costo = self.Cupo_Max*100 return Costo def Precio(self, Cupo_Max): ...
#################################################################################################### # # Musica - A Music Theory Package for Python # Copyright (C) 2017 Fabrice Salvaire # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pub...
#!/usr/bin/python # # dor-bug robot # # ####################################################### from math import sin,cos,radians,degrees,pi,asin,atan,sqrt import numpy as np from tools import * from time import sleep alpha_max = pi/2 beta_max = pi phi_max = pi/5 small_angles = [-0.01, 0.0, 0.01 ] big_angles = ...
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# -*- coding: utf-8 -*- import time import datetime import random import cookielib import urllib import urllib2 from urlparse import urlparse from config import * from common import * from BeautifulSoup import BeautifulSoup class BaseCrawl(object): #房源类型 1 出售 2 出租 3 求购 4 求租 flag = None isStoped = False ...
#!/usr/bin/env python2.7 import argparse import os,sys from getpass import getpass from pprint import pprint as pp from collections import Counter from itertools import chain from jnpr.junos import Device from jnpr.junos.factory import loadyaml from jnpr.junos.exception import RpcError def parseargs(): p = argpar...
"""Updates a network""" from baseCmd import * from baseResponse import * class updateNetworkCmd (baseCmd): typeInfo = {} def __init__(self): self.isAsync = "true" """the ID of the network""" """Required""" self.id = None self.typeInfo['id'] = 'uuid' """Force up...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'impact_functions_doc_base.ui' # # Created: Fri Sep 14 14:43:14 2012 # by: PyQt4 UI code generator 4.9.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromU...
#! /usr/bin/env python from zplot import * # populate zplot table from data file t = table('verticalbars.data') # create the postscript file we'll use as our canvas canvas = svg('verticalbars.svg') # on the x-axis, we want categories, not numbers. Thus, we # determine the number of categories by checking the max #...
""" Test script. Run compressed sensing on a 2D image in Fourier domain and see what we get. """ import numpy as np import matplotlib.pyplot as plt from scipy import misc import BasicFunctions as bf import Sketching as sketch # Parameters. IMAGE_PATH = "../../data/" IMAGE_NAME = "lenna.png" SIZE = (50, 50) ALPHA = 2...
""" Functions for preparing various inputs passed to the DataFrame or Series constructors before passing them to a BlockManager. """ from collections import OrderedDict, abc import numpy as np import numpy.ma as ma from pandas._libs import lib from pandas._libs.tslibs import IncompatibleFrequency, OutOfBoundsDatetime...
#!/usr/bin/env python from sys import stdin, stderr from optparse import OptionParser import numpy as np from scipy import stats, linalg """ Partial Correlation in Python (clone of Matlab's partialcorr) This uses the linear regression approach to compute the partial correlation (might be slow for a huge number of v...
#!/usr/bin/env python import json import os from lib.github import GitHub import requests BROWSER_LAPTOP_REPO = 'brave/browser-laptop' TARGET_ARCH= os.environ['TARGET_ARCH'] if os.environ.has_key('TARGET_ARCH') else 'x64' RELEASE_NAME = 'Dev Channel Beta' def main(): github = GitHub(auth_token()) releases = gith...
# Thu May 29 02:59:41 EEST 2014, nickkouk # proper division for python 2.7 from __future__ import division # Usual importing stuff for PySide from PySide.QtGui import * from PySide.QtCore import * # Module imports import sys import os from serial.tools.list_ports import comports # Qt-Designer compiled python code ...
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2008 - 2014 by Wilbert Berendsen # # 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 ...
import binascii import logging import struct import time import sys, traceback from cStringIO import StringIO from collections import namedtuple from datetime import datetime from functools import partial __all__ = [ 'KafkaError', 'ConnectionFailure', 'OffsetOutOfRange', 'InvalidMessageCode', 'Wron...
#!/usr/bin/python3 # # Copyright (C) 2017 Łukasz Kopacz # # This file is part of Pocztowy konwerter. # # Pocztowy konwerter 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 #...
# # 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...
# -*- coding:utf-8 -*- import csv import urllib.parse as urlparser from owlmixin import OwlMixin from owlmixin.owlcollections import TList from jumeaux.addons.log2reqs import Log2ReqsExecutor from jumeaux.models import Request, Log2ReqsAddOnPayload class Config(OwlMixin): encoding: str = "utf8" keep_blank:...
# Simple Arp Handler v2 # Jack Zhao # s.zhao.j@gmail.com from operator import attrgetter from ryu.base import app_manager from ryu.controller import ofp_event from ryu.controller.handler import CONFIG_DISPATCHER from ryu.controller.handler import MAIN_DISPATCHER from ryu.controller.handler import set_ev_cls from ry...
# (C) Copyright 2015 Hewlett Packard Enterprise Development Company LP """ Systemd based service """ import glob import logging import os import pwd import subprocess import service log = logging.getLogger(__name__) class LinuxInit(service.Service): """Parent class for all Linux based init systems. """ ...
""" Django settings for newproject project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...)...