src
stringlengths
721
1.04M
#compose_maps.py #make ALL the maps import math from generate_borders import generate_borders from generate_graticule import generate_graticule, generate_backdrop from generate_indicatrices import generate_indicatrices from generate_orthodromes import generate_orthodromes from generate_shape import plot_shapes from g...
"""Projects app signals.""" import logging from django.db.models.signals import post_save, pre_delete from django.dispatch import receiver, Signal from . import notifications from .models import Participation logger = logging.getLogger('web.projects.signals') pending = Signal(providing_args=('instance',)) valid =...
#!/usr/bin/env python import os def clrscr(): """ Clear screen and move cursor to 1,1 (upper left) pos. """ print '\033[2J\033[1;1H' def clreol(): """ Erases from the current cursor position to the end of the current line. """ print '\033[K' def delline(): """ Erases the entire current line. """ ...
import numpy as np import matplotlib as mpl import nose import matplotlib.pyplot as plt import nose.tools as nt import numpy.testing as npt from .. import rcmod, palettes, utils class RCParamTester(object): def flatten_list(self, orig_list): iter_list = map(np.atleast_1d, orig_list) flat_list =...
from django.shortcuts import render, HttpResponse from django.views.generic import View from pybloom.pybloom import BloomFilter import uuid from django import forms import json from nltk.corpus import stopwords import nltk nltk.data.path.append('/home/sujit/nltk_data') # Create your views here. ### Settings for simi...
""" loading text, converting it to tensors of one-hot vectors, splitting to train/eval/test sets splitting sets to batches """ import numpy as np class MinibatchLoader: def __init__(self): self.char_to_ix = {} self.ix_to_char = {} self.x = np.array([]) self.y = np.array([]) ...
"""\ YAML parser module. @author: Aaron Mavrinac @organization: University of Windsor @contact: mavrin1@uwindsor.ca @license: GPL-3 """ import os import yaml from math import pi import pkg_resources from itertools import chain from .robot import Robot from .solid import Solid from .laser import RangeModel from .cov...
""" Django settings for POLLUTION project. Generated by 'django-admin startproject' using Django 1.9.1. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os ...
from survive.player.playermodel import Player from survive.activities.crafting.craftingcontroller import CraftingController from survive.inventory.inventorycontroller import InventoryController from survive.activities.hunting.huntingcontroller import HuntingController from survive.generic.controller import Controller f...
# iocdump.py # # Copyright 2016 FireEye # Licensed under the Apache 2.0 license. Developed for Mandiant by William # Gibb. # # Mandiant licenses this file to you 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 Lic...
# # This file is part of HEPData. # Copyright (C) 2015 CERN. # # HEPData 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. # # HEPData is...
import numpy as np import copy from .misc import * from .point import Point from .line import Line from .surface import Surface from .volume import Volume """ class to handle gmsh geo-file(s) """ class extdb(dict): ''' Extrude database, this is for conveniently accessing dict-keys by calling as attribute ...
# Capstone project for Jose Portilla's Complete Python Bootcamp course at udemy.com # Project Idea: Inverted index - An Inverted Index is a data structure used to create full text search. # Given a set of text files, implement a program to create an inverted index. Also create a # user interface to do a search using t...
#!/usr/bin/env python """convexhull.py Calculate the convex hull of a set of n 2D-points in O(n log n) time. Taken from Berg et al., Computational Geometry, Springer-Verlag, 1997. Prints output as EPS file. When run from the command line it generates a random set of points inside a square of given length and finds...
# 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 ...
# -*- coding: utf-8 -*- # Copyright 2007-2020 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
import cgi import six from wtforms import Form from wtforms import validators from pyramid.i18n import get_localizer from pyramid.renderers import render from pyramid.threadlocal import get_current_request from apex.lib.db import merge_session_with_post from apex.lib.i18n import Translator class ExtendedForm(Form):...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """UI for Invenio-Search.""" from __future__ import absolute_import, print_function ...
""" Module that defines all predicates in this world. """ import inspect from pddlpy.scope import Scope class BasePredicate(object): """ Represents a predicate that already has grounded atoms. """ def __init__(self, *args, **kwargs): argnames, _, _, _ = inspect.getargspec(self.__call__) ...
# 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...
import os import json import sip sip.setapi('QString', 2) sip.setapi('QVariant', 2) sip.setapi('QDate', 2) sip.setapi('QDateTime', 2) sip.setapi('QTextStream', 2) sip.setapi('QTime', 2) sip.setapi('QUrl', 2) from PyQt4 import QtGui, QtCore signal = QtCore.pyqtSignal slot = QtCore.pyqtSlot property = QtCore.pyqtPropert...
"""Support for statistics for sensor values.""" import logging import statistics from collections import deque import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_NAME, CONF_ENTITY_ID, ...
# -*- coding: UTF-8 -*- __author__ = "Liu Fei" __github__ = "http://github.com/lfblogs" __all__ = [ "Pool" ] """ Define database connection pool """ import asyncio import logging try: import aiomysql except ImportError: from aio2py.required import aiomysql try: import aiopg except ImportError: ...
<<<<<<< HEAD <<<<<<< HEAD # # A higher level module for using sockets (or Windows named pipes) # # multiprocessing/connection.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # __all__ = [ 'Client', 'Listener', 'Pipe', 'wait' ] import io import os import sys import socket imp...
# vim: set encoding=utf-8 : """ Tests Gabble's implementation of XEP-0092. """ from twisted.words.xish import xpath from servicetest import assertLength from gabbletest import exec_test, elem_iq, elem import ns def test(q, bus, conn, stream): request = elem_iq(stream, 'get')( elem(ns.VERSION, 'query') )...
""" """ import inspect import os import hashlib import random import socket import string import time from Cookie import CookieError from galaxy import eggs eggs.require( "Cheetah" ) from Cheetah.Template import Template eggs.require( "Mako" ) import mako.runtime import mako.lookup # pytz is used by Babel. eggs.requir...
# Generated by Django 2.0.3 on 2018-06-30 17:27 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='ImgurConfig', fields=[ ...
import numpy as np from numpy import sin,cos,exp,sqrt,pi,tan import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import pdb,sys,pickle,os import astropy.io.fits as pyfits import traces.grating as grat import utilities.plotting as plotting from traces.axro.SMARTX import CXCreflIr from scipy import in...
# Copyright 2018 D-Wave 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.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
"""User utils tests""" import pytest from profiles.utils import ensure_active_user, is_duplicate_username_error, usernameify @pytest.mark.parametrize( "full_name,email,expected_username", [ [" John Doe ", None, "john-doe"], ["Tabby Tabberson", None, "tabby-tabberson"], ["Àccèntèd Ñame...
from flask import Blueprint, request, jsonify from sqlalchemy.exc import IntegrityError from ..models.List import List from ..extensions import db list_api = Blueprint('list', __name__, url_prefix='/api/list') @list_api.route('/', methods=['GET']) def get_lists(): lists = List.query return jsonify({'lists':...
#!/usr/bin/env python3 import os from glob import glob from distutils.core import setup from distutils import dep_util def get_data_files(): data_files = [ (os.path.join('share', 'applications'), ['data/devede_ng.desktop']), (os.path.join('share', 'pixmaps'), ['data/devedeng.svg']), (os.pa...
import unittest from datetime import datetime, timedelta import app from app import models, server from app.models import db, User, Reservation, Resource, Tag from flask import url_for class TestModels(unittest.TestCase): def setUp(self): self.app = app.get_app("TEST") self.app.config.update(SERVE...
#!/usr/bin/env python #coding:utf-8 import pika import json HOST = 'localhost' USERNAME = 'hisir' PASSWORD = 'hisir123' class Xiaomi(): def __init__(self): credentials = pika.PlainCredentials(USERNAME, PASSWORD) self.connection = pika.BlockingConnection(pika.ConnectionParameters(host=HOST, crede...
# -*- coding: utf-8 -*- # # Test links: # https://www.oboom.com/B7CYZIEB/10Mio.dat import re from module.common.json_layer import json_loads from module.plugins.internal.Hoster import Hoster from module.plugins.captcha.ReCaptcha import ReCaptcha class OboomCom(Hoster): __name__ = "OboomCom" __type__ =...
# -*- coding: utf-8 -*- import codecs from os import path from setuptools import setup with open('README.rst', 'rt') as f: long_description = f.read() setup( name='saltobserver', version='0.9.4', description='A simple webapp for presenting data as offered by SaltStack\'s Redis Returner', long_des...
# 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, ...
#!/usr/bin/env python2 """ Given a protein FASTA file, compute immunogenicity for all posible 9-mer peptides. Usage: fred2_background.py [--alleles=<alleles_list> --top_N=N] --input=FILE_IN --output=FILE_OUT fred2_background.py -h | --help Arguments: --input=FILE_IN Input fasta file, can be retri...
#!/usr/bin/env python import sys import time import traceback from signal import alarm, signal, SIGALRM import pygame now = "20140516121953" total_pics = 4 # number of pics to be taken w = 800 h = 450 transform_x = 600 # how wide to scale the jpg when replaying transfrom_y = 450 # how high to scale the jpg when ...
# vim:fileencoding=utf-8:ts=2:sw=2:expandtab import re import os import os.path import glob import mimetypes import subprocess from ..Base import S3 from . import Job, S3BackedFile class S3BackedDocument(S3BackedFile): def __init__(self, *, OutputKey, **kw): super().__init__(**kw) self.OutputKey = OutputK...
import datetime from django.test import TestCase from django.test.client import Client from ..models import Hit from .utils import build_hit_url, random_url class TestOfHitView(TestCase): def test_logs_hit(self): url = random_url() c = Client() response = c.get(build_hit_url(url)) ...
# -*- coding: utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # Disabling the below pylint warnings in order to use long names convention in the tests # and because some entities are used seamlessly instead of being directly called. # pylint: disable=invalid-name # pylint: disable=unused-import """ ...
"""Reverse Cuthill-McKee based placement. """ from collections import defaultdict, deque from six import itervalues from rig.place_and_route.place.sequential import place as sequential_place from rig.links import Links from rig.netlist import Net def _get_vertices_neighbours(nets): """Generate a listing of eac...
#----------------------------------------------------------------------------- # Name: get_matches.py # # Author: Alexander Popov # #----------------------------------------------------------------------------- import os import sys import json import TeamFeatures #Debug flag to only process ~100 rows debug = False...
from contextlib import closing from contextlib import suppress from io import StringIO from string import Template import uuid import html from sklearn import config_context class _VisualBlock: """HTML Representation of Estimator Parameters ---------- kind : {'serial', 'parallel', 'single'} ...
from __future__ import print_function from ctypes import * import ctypes from ._alp_defns import * import numpy as np import time def _api_call(function): """ decorator to implement error handling for ALP API calls. """ def api_handler(dmd_instance, *args, **kwargs): r = function(dmd_instance,...
# encoding: utf-8 from nose.tools import assert_equal, ok_ from ckan.lib.munge import (munge_filename_legacy, munge_filename, munge_name, munge_title_to_name, munge_tag) class TestMungeFilenameLegacy(object): # (original, expected) munge_list = [ ('unchanged', 'unchanged...
# # Honeybee: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari # # This file is part of Honeybee. # # Copyright (c) 2013-2020, Mostapha Sadeghipour Roudsari <mostapha@ladybug.tools> # Honeybee is free software; you can redistribute it and/or modify # it under the terms of the GNU G...
from __future__ import absolute_import # Copyright (c) 2010-2016 openpyxl import os.path from openpyxl.comments import Comment from openpyxl.xml.constants import ( PACKAGE_WORKSHEET_RELS, COMMENTS_NS, PACKAGE_XL, ) from openpyxl.xml.functions import fromstring from .properties import CommentSheet ...
# icbuild - a tool to ease building collections of source packages # Copyright (C) 2015 Ignacio Casal Quinteiro # # msvc.py: msvc module type definitions. # # 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 Softwar...
from google.appengine.ext.webapp import template import webapp2 import json from models.user import User from models.link import Link from models.group import Group import time class deleteMemberFromGroup(webapp2.RequestHandler): def get(self): user = None if self.request.cookies.get('our_token'): #the cookie ...
import sublime, sublime_plugin import re def multiple_replace(dict, text): pattern = re.compile("^(%s)\=" % "|".join(map(re.escape, dict.keys()))) lines = text.split("\x01") newLines = [] for line in lines: new_line = pattern.sub(lambda match: dict[match.string[match.start():match.end()-1]] + "=", line) new...
#encoding: utf-8 #Para que no de porculo los acentos y Ñ # Django settings for oBid project. ## EXPLICACION ## IMPORTAMOS LA LIBRERIA 'os' del sistema y establecemos como PATH del proyecto la carpeta en la que se encuentra import os PROJECT_PATH=os.path.dirname(os.path.realpath(__file__)) DEBUG = True TEMPLATE_DEBUG ...
############################################################################### # Copyright (c) 2017 Salvatore Ventura <salvoventura@gmail.com> # # File: documentation_test.py # # Author: Salvatore Ventura <salvoventura@gmail.com> # Date: 07 Sep 2017 # Purpose: Test examples in documentation # # Revi...
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms from torch.utils.data import DataLoader import torch.optim.lr_scheduler as lr_scheduler from torch.autograd.function import Function import torchvision import os import matplotlib...
import numpy as np import os from data_settings import DATADIR from data_standardize import load_npz_of_arr_genes_cells """ Script to load raw data and attach cluster labels - if no cluster labels provide, perform clustering (TODO: implement) - else append saved clusters """ def load_cluster_labels(clusterpath, o...
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2014 Dean Jackson <deanishe@deanishe.net> # # MIT Licence. See http://opensource.org/licenses/MIT # # Created on 2014-07-06 # """ """ from __future__ import print_function, absolute_import from flask import Flask import config app = Flask(__name__) app.conf...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.a...
import argparse, json import simpleamt if __name__ == '__main__': parser = argparse.ArgumentParser(add_help=False) parser.add_argument('--prod', action='store_false', dest='sandbox', default=True, help="Whether to run on the production AMT site.") parser.add_argument('...
import sys import re from substring import * from itertools import combinations from collections import defaultdict if len(sys.argv) < 2: #check for whether input specified or not print "No jumbled word specified.Please enter a jumbled word." sys.exit(0) input_string = sys.argv[1] uni_input = unicode(input_...
# *-* coding: utf-8 *-* # 抓取证券日报上的每日交易公告集锦 # http://www.ccstock.cn/meiribidu/jiaoyitishi/ # 代码版本 python 2.7 IDE:PyCharm import requests import random import sys import time from bs4 import BeautifulSoup from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.header import Header i...
# coding=utf-8 # Copyright 2021 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
import functools import warnings from django.conf import settings # Avoid shadowing the login() and logout() views below. from django.contrib.auth import ( REDIRECT_FIELD_NAME, get_user_model, login as auth_login, logout as auth_logout, update_session_auth_hash, ) from django.contrib.auth.decorators i...
# Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A "Test Server Spawner" that handles killing/stopping per-test test servers. It's used to accept requests from the device to spawn and kill instances of ...
from flask import Flask, request, render_template import time import datetime import arrow app = Flask(__name__) app.debug = True # Make this False if you are no longer debugging @app.route("/") def hello(): return "Hello World!" @app.route("/lab_temp") def lab_temp(): import sys import Adafruit_DHT humidity,...
# vim:set ts=4 sw=4 et nowrap syntax=python ff=unix: # # Copyright 2011-2018 Mark Crewson <mark@crewson.net> # # 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/lice...
#!/usr/local/bin/python # TimeTracking Program for Projects from datetime import datetime import time from decimal import * import sys import os import select from termcolor import colored os.system('cls' if os.name == 'nt' else 'clear') # Set path for datafile PATH='./tTrackData.txt' getcontext().prec = 2 def o...
import sys import importlib if not hasattr(sys, 'argv'): sys.argv = [''] #import tensorflow as tf import numpy as np import random #import time from xml.dom import minidom import os import shutil import site import pprint import h5py import imageio from skimage.transform import resize import site as s s.getusersite...
#!/usr/bin/python # -*- coding: cp1252 -*- # from math import radians, cos, sin,tan, atan2, sqrt, pow, pi, atan2 #====================================================================== class PointClass: def __init__(self,x=0,y=0): self.x=x self.y=y def __str__(self): return (...
from __future__ import print_function import argparse import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms from torch.autograd import Variable import torch.nn.parallel import torch.distributed as dist import torch.utils.data.distribu...
# Copyright 2016 The TensorFlow 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 required by applica...
#!/usr/bin/env python # This script prepares files before uploading them for distribution # This has to be run after all imports are finished import json, pickle, os, stat, shutil from mapbox_country_pack import world_pack as mapboxgl_world_pack root_dir = "distribution" bucket = open("bucket_name", "r").read().stri...
# -*- coding:utf-8 -*- # Copyright © 2011 Clément Schaff, Mahdi Ben Jelloul """ openFisca, Logiciel libre de simulation du système socio-fiscal français Copyright © 2011 Clément Schaff, Mahdi Ben Jelloul This file is part of openFisca. openFisca is free software: you can redistribute it and/or modify it unde...
import numpy as np import matplotlib.pyplot as plt from mpi4py import MPI from cplpy import CPL from draw_grid import draw_grid class CFD(): def __init__(self, npxyz, xyzL, xyz_orig, ncxyz): #initialise MPI and CPL self.comm = MPI.COMM_WORLD self.CPL = CPL() self.CFD_COMM = sel...
# Copyright (C) 2019 ycmd contributors # # This file is part of ycmd. # # ycmd 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. # # ycmd...
#!/usr/bin/env python ''' Use netmiko to connect to 'show arp' on pynet-rtr1, pynet-rtr2, and juniper-srx. ''' from netmiko import ConnectHandler from getpass import getpass def login(rtr_name): '''make connection''' try: device_connection = ConnectHandler(**rtr_name) print '### YOU ARE NOW LOG...
#!/usr/bin/env python3 import os import sys import copy import re from collections import OrderedDict from lofarpipe.support.parset import Parset from lofarpipe.support.control import control from lofarpipe.support.loggingdecorators import duration from lofarpipe.support.data_map import DataMap, DataProduct, validate_...
# -*- coding: utf-8 -*- """ tablib.compat ~~~~~~~~~~~~~ Tablib compatiblity module. """ import sys is_py3 = (sys.version_info[0] > 2) try: from collections import OrderedDict except ImportError: from tablib.packages.ordereddict import OrderedDict if is_py3: from io import BytesIO import tablib...
#!/bin/python #/************************************************************************** #* File: ipCounter.py #* #* This is a basic program to count the total number of IPs #* in a given range. Input is a txt formatted file similar #* to the sample provided #* #* This updated version uses Python to make it more a...
import argparse import collections import datetime import functools import itertools import random import struct import time import xml from asteroid import bleee from gi.repository import GLib def ensure_connected(fn): @functools.wraps(fn) def wrapper(self, *args, **kwargs): # Note that this does no...
import os import time import module.loading as ld import module.command as cmd import module.character_loader as cl import module.os_manager as om import data_manager as dm from module.story_env import chat_line as chatl from module.story_env import story_telling as st from module.story_env import new_line as nl from m...
#!/usr/bin/python # autoEqualizer - Script to load equalizer presets ondemand based on what genre of track is playing # Copyright (C) 2007 Ritesh Raj Sarraf <rrs@researchut.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publ...
#!/usr/bin/env python3 # Generate Italic calligraphy SVG images and OpenDocument documents according # to the specified parameters. # # Written in 2014 by Jordan Vaughan # # To the extent possible under law, the author(s) have dedicated all copyright # and related and neighboring rights to this software to the public ...
# -*- coding: utf-8 -*- from flask import render_template, request, jsonify, flash, g from flask.ext.login import current_user from . import index_blueprint from .. import db from .. import babel from ..models import User from datetime import datetime @index_blueprint.before_app_request def before_request(): if...
# coding: utf-8 """ ORCID Member No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: Latest Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import r...
from multiprocessing import Process import time import gym import universe from universe.spaces.vnc_event import keycode from envs import create_env def start_game(model, env_name): """regular Python process, not using torch""" p = Process(target=play_game, args=(model,env_name)) p.start() # Don't wa...
from django.conf import settings from django.template.loader import get_template from django.template import RequestContext, Context from django.shortcuts import render_to_response, render from django.core.mail import send_mail, BadHeaderError from django.http import HttpResponse, HttpResponseRedirect import urllib im...
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
#!/usr/bin/env python3 ''' @file rpctest.py @author Gabriele Tozzi <gabriele@tozzi.eu> @package DoPhp @brief Simple RPC JSON client in python for tetsing methods ''' import sys import argparse import re import hashlib import http.client, urllib.parse import gzip, zlib import json import logging class ParamAction(arg...
import sys ''' The below is only needed for Bayesian Optimization on Luis' Machine. Ignore and comment out if it causes problems. ''' path = "/home/luis/Documents/Harvard_School_Work/Spring_2015/cs181/assignments/practicals/prac4/practical4-code/" if path not in sys.path: sys.path.append(path) ''' End Bayesian '''...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("maasserver", "0114_node_dynamic_to_creation_type")] operations = [ migrations.AlterField( model_name="bootresourcefile", ...
#!/usr/bin/env python3 import csv import copy from bs4 import BeautifulSoup import httplib2 from urllib.parse import urlencode import sys def extract_record(row): #<tr> #<td align="left"> # <font color="#333333"> # <a id="ctl00_ContentPlaceHolder1_gvFSO_ctl51_hypJavascript"></a> # <a href...
import os import shutil DEBUG = False img_suffix = ['.jpeg','.jpg','.png','.tiff'] def gen_img_unique_file_name(count,total): assert(count<=total) name = '' for i in range(len(str(total)) - len(str(count))): name+='0' offset = str(count) name+=offset return name def copy_img_file(s...
#!/usr/bin/env python #coding=utf-8 from twisted.python import log from store import store from settings import * import logging import json def process(req=None,admin=None): msg_id = req.get("msg_id") cache_class = req.get("cache_class") if not cache_class: reply = json.dumps({'msg_id':msg_id,'da...
from twisted.protocols import basic from twisted.python import log import handlers class CommandHandler(object): CMD = "!" def __init__(self, parent, api_url): self.parent = parent self.fx_login = handlers.LoginHandler(api_url) def handle(self, line): """Dispatches to functions ...
""" This module contains functions for linear regression classifier. """ import logging from array import array from py_entitymatching.matcher.mlmatcher import MLMatcher from py_entitymatching.matcher.matcherutils import get_ts from sklearn.linear_model import LinearRegression from sklearn.base import BaseEstimator ...
#!/usr/bin/python ##################################################################################### ##################################################################################### # # title : ffmpeg-appender-test.py # authors : Bertrand Martel # copyrights : Copyright (c) 2015 Bertrand Martel # li...
# -*- coding: utf-8 -*- """ Created on Sun Apr 24 15:46:52 2016 @author: lifu """ import numpy as np from dimsum.utils import ArrayPool eps = 1e-9 class TestArrayPool: """Test class for ArrayPool. """ def test_attribute_access(self): """Test attribute-style access to arrays. """ ...
# -*- coding: UTF-8 -*- ''' Created on Mar 12, 2015-1:16:18 PM @author: Ling Wang<LingWangNeuralEng@gmail.com> ''' import cv2, os from Constants_and_Parameters import * def loadAsGray(imgFile, cropY=[0,880]): img = cv2.imread(imgFile) img = img[cropY[0]:cropY[1],:,:] gray = cv2.cvtColor(img, cv2.COLOR_...
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'valerio cosentino' from exporters import resources import os class HtmlGenerator(): """ This class handles the generation of an HTML page embedding charts """ BOOTSTRAP_COLUMNS = 12 CHARTS_PER_LINE = 2 def __init__(self, logger): ...