src
stringlengths
721
1.04M
#!/usr/bin/python # # Written by Vaughn Miller # # Simple script to comb the munki catalogs and list items missing from individual catalogs # # # You should edit REPO_ROOT to reflect local path to the repo # If using email option, you should edit RECIPIENTS to a list of valid email addresses to be notified # # Usage ...
from django.shortcuts import render_to_response, get_object_or_404 from blogpost.models import BlogPost from blogpost.forms import BlogForm from django.http import HttpResponseRedirect def blogList(request): blogs = BlogPost.objects.all() return render_to_response('blogpost/blog_list.html', {'blogs': blogs}) ...
from ctypes import c_void_p import math import numpy as np from OpenGL.GL import * from OpenGL.GLU import * from PyEngine3D.Common import logger, COMMAND from PyEngine3D.Common.Constants import * from PyEngine3D.Utilities import * from PyEngine3D.OpenGLContext import InstanceBuffer, FrameBufferManager, RenderBuffer,...
# pylint: disable-msg=R0904 from tastypie import fields from tastypie.resources import ModelResource from mediathread.api import UserResource, TagResource from mediathread.assetmgr.models import Asset from mediathread.djangosherd.models import SherdNote, DiscussionIndex from mediathread.projects.models import ProjectN...
from collections import namedtuple from gettext import gettext as _ Error = namedtuple('Error', ['code', 'message', 'required_fields']) """ The error named tuple has 4 components: code: The 7 character uniquely identifying code for this error, 3 A-Z identifying the module followed by 4 numeric characters for th...
# -*- coding: utf-8 -*- ######################################################################## # # License: BSD # Created: 2005-05-18 # Author: Francesc Alted - faltet@pytables.org # Author: Ivan Vilata - ivan@selidor.net # # $Id$ # ######################################################################## """Test mo...
# -*-coding:Utf-8 -*- from flask import request from sqlalchemy import exc, and_ from sqlalchemy.orm import sessionmaker from app import app, db from app.models_mod import user, target, usergroup, exttargetaccess, passentry from . import api from subprocess import Popen, PIPE from datetime import datetime, timedelta im...
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-01-09 23:49 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migration...
''' ____ _ _ _ _ _ ____ ___ | _ \ ___ __| | \ | | ___| |_ / \ | _ \_ _| | |_) / _ \ / _` | \| |/ _ \ __| / _ \ | |_) | | | __/ (_) | (_| | |\ | __/ |_ / ___ \| __/| | |_| \___/ \__,_|_| \_|\___|\__| /_/ \_\_| |___| File: PodNet.py Author: Zach Podbieln...
# -*- coding: utf-8 -*- """ (c) 2013 LinkedIn Corp. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");?you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law...
import sys if sys.version_info >= (3, 8): from unittest.mock import AsyncMock else: from asynctest.mock import CoroutineMock as AsyncMock from unittest.mock import Mock, call import pytest from pytest import raises from jj.matchers import ResolvableMatcher from .._test_utils.fixtures import handler_, reque...
''' SASSIE: Copyright (C) 2011 Joseph E. Curtis, Ph.D. 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 (at your option) any later version. ...
# Copyright (C) 2007-2011 Franco M. Luque # URL: <http://www.cs.famaf.unc.edu.ar/~francolq/> # For license information, see LICENSE.txt import codecs import itertools import os from nltk.corpus.reader.util import read_sexpr_block from nltk.corpus.reader import bracket_parse from nltk import tree from nltk import Tree...
# Scraper for Minnesota Supreme Court #CourtID: minn #Court Short Name: MN #Author: Andrei Chelaru #Reviewer: mlr #Date: 2014-07-03 from datetime import date import time from juriscraper.OpinionSite import OpinionSite from juriscraper.lib.date_utils import quarter, is_first_month_in_quarter from lxml import html impo...
import csv import numpy import pandas import os import matplotlib matplotlib.use('PDF') from matplotlib.colors import ListedColormap import matplotlib.pyplot as plt aggregatedData = [] def createOutputFile(folderName): return folderName def outputPlateData(plate, folderName): aggregatedData.extend([[plate.Name]+...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import termsearch try: from setuptools import setup except ImportError: from distutils.core import setup version = termsearch.__version__ if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') print("You probably wa...
# -*- coding: utf-8 -*- # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
# # Copyright (C) 2012 Tobias Bolten # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed i...
#------------------------------------------------------------------------------ # Copyright 2013 Esri # 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/LICENS...
import unittest import string from common.list import splitlist from common.string import sjoin, isletter, strip_accents, remove_nonletters,\ normalize_text, replace_white_spaces, replace_single, replace_dict class TestString(unittest.TestCase): def test_sjoin(self): self.assertEqual('', sjoin([])) self.assertEq...
from __future__ import division from builtins import range from past.utils import old_div import proteus from proteus.mprans.cDissipation import * from proteus.mprans.cDissipation2D import * import numpy as np from proteus import Profiling as prof from proteus import cfemIntegrals from . import cArgumentsDict """ NOTES...
#-*-:coding:utf-8-*- import os import copy import json import string import subprocess #from blindtex import mainBlindtex import sys from sys import argv #HU1 #Method to open a file and return its content as a string. def openFile(fileName): '''This function takes a file a return its content as a string. ...
from collections import namedtuple from PyQt4.QtCore import QTimer, QThread, pyqtSlot as Slot import Orange.data import Orange.feature import Orange.network from Orange.orng.orngDataCaching import data_hints from Orange.OrangeWidgets import OWWidget from Orange.OrangeWidgets import OWGUI from Orange.OrangeWidgets im...
import sys, os, re, yaml, subprocess, shlex, FITS_tools import pandas as pd import numpy as np import pickle import matplotlib import matplotlib.pyplot as plt from matplotlib import image import matplotlib.cm as cm import matplotlib.image as mpimg from scipy.optimize import curve_fit import scipy.integrate as integr...
# -*- coding: utf-8 -*- # Copyright (c) 2017 Thijs Triemstra and contributors # See LICENSE.rst for details. """ Endpoint for coinmarketcap.com :see: https://coinmarketcap.com/api/ """ from datetime import datetime from dateutil.tz.tz import tzutc from . import Endpoint, EndpointResponse class CoinmarketcapRespo...
# -*- encoding: utf-8 -*- from openerp import fields, models, api, _ from openerp.exceptions import Warning import logging _logger = logging.getLogger(__name__) class db_database_backup_preserve_rule(models.Model): _name = 'db.database.backup.preserve_rule' name = fields.Char( 'Name', requir...
#!/usr/bin/python # This file is part of Superwas. # # Superwas 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. # # Superwas is dist...
import json import mock from hamcrest import has_entries, match_equality, is_not from nose.tools import eq_ from requests import Response from performanceplatform.client.admin import AdminAPI class TestAdminAPI(object): @mock.patch('requests.request') def test_get_user(self, mock_request): mock_req...
from datetime import datetime import binascii import json import struct from apns.commands import NOTIFICATION from apns.utils import datetime_to_timestamp class NotificationError(Exception): """To be thrown upon failures on notification processing.""" pass class NotificationInvalidPriorityError(Notificati...
<<<<<<< HEAD from django.db.models import Q, Sum from django.db.models.deletion import ProtectedError from django.db.utils import IntegrityError from django.forms.models import modelform_factory from django.test import TestCase, skipIfDBFeature from .models import ( A, B, C, D, Address, Board, CharLink, Com...
import re import markdown from django.template.loader import render_to_string from django.utils.translation import gettext as _ from wiki.plugins.macros import settings # See: # http://stackoverflow.com/questions/430759/regex-for-managing-escaped-characters-for-items-like-string-literals re_sq_short = r"'([^'\\]*(?:\...
# Copyright 2015 TellApart, 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 writi...
from django.shortcuts import render, get_object_or_404, redirect from django.views import generic from django.contrib import auth, messages from django.http import HttpResponseRedirect from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from...
#!/usr/bin/env python # # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of GNUHAWK. # # GNUHAWK is free software: you can redistribute it and/or modify is under the # terms of the GNU General Public License as published by ...
""" Test the various password reset flows """ import json import re import unittest import ddt from django.conf import settings from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX from django.contrib.auth.models import User from django.contrib.auth.tokens import default_token_generator from django.core.ca...
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from PyQt4.QtCore import SIGNAL, Qt from PyQt4.QtGui import QLabel, QSizePolicy from PyKDE4.kdecore import i18n, ki18n, KAboutData from PyKDE4.kdeui import KVBox, KHBox, KPushButton, KAboutApplicationDialog helpText = """The KAboutApplicationDialog is normally displayed ...
# $Filename$ # $Authors$ # Last Changed: $Date$ $Committer$ $Revision-Id$ # # Copyright (c) 2003-2011, German Aerospace Center (DLR) # #Redistribution and use in source and binary forms, with or without # All rights reserved. #modification, are permitted provided that the following conditions are #met: # # ...
""" This includes the tests for the ShoppingItem model """ import unittest from app.models.shopping import ShoppingItem try: from .common_functions import BaseModelTestClass except (ImportError, SystemError): from common_functions import BaseModelTestClass class ShoppingItemModelTest(BaseModelTestClass): ...
# -*-coding:Utf-8 -* import Vue.Figure as figure import Vue.Donnee as donnee import Lecture.FonctionLectureClassique as classique import numpy as np import sys ######################################################################################## #------------------------------- Input -----------...
#!/usr/bin/env python """Tests different Genetic Algorithm crossover classes. """ # standard library import unittest # biopython from Bio.Seq import MutableSeq from Bio.Alphabet import SingleLetterAlphabet # local stuff from Bio.GA.Organism import Organism from Bio.GA.Crossover.General import SafeFitnessCrossover fro...
from lxml import etree from route53 import xml_parsers, xml_generators from route53.exceptions import Route53Error from route53.transport import RequestsTransport from route53.xml_parsers.common_change_info import parse_change_info class Route53Connection(object): """ Instances of this class are instantiated b...
from kid_readout.interactive import * from kid_readout.equipment import hardware from kid_readout.measurement import acquire from kid_readout.roach import analog from kid_readout.equipment import agilent_33220 import time fg = agilent_33220.FunctionGenerator(addr=('192.168.1.135', 5025)) fg.set_load_ohms(1000) fg.set...
""" How to run scrapers programmatically from a script """ import sys #ubuntu sys.path.insert(0, '/home/kaco/Desktop/alice') #windows sys.path.insert(0, 'C:/Users/Carlos/Google Drive/ZetUp/Buscato/alice') sys.path.insert(0, 'C:/alice') from spiders.abcdin_spider import AbcdinSpider from spiders.casaximena_spider impo...
import os import copy import cPickle import itertools import numpy as np seed = np.random.randint(2**16) # seed = 2958 seed = 58187 #seed = 60017 print "Seed: ", seed import matplotlib.pyplot as plt from matplotlib.patches import Path, PathPatch from hips.inference.particle_mcmc import * from optofit.cneuron.compar...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2013-2017 GEM Foundation # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the Licen...
import unittest from pads.biconnectivity import is_biconnected from pads.biconnectivity import st_orientation from pads.biconnectivity import BiconnectedComponents from pads.partial_order import TopologicalOrder class BiconnectivityTest(unittest.TestCase): G1 = { 0: [1,2,5], 1: [0,5], 2: ...
import datetime import os.path from unittest import mock from django.test import TestCase from ..factories import BandCFactory from ..utils import ( MeetingCancelled, parse_date, clean_text, process_page, get_number_of_pages, _save_page, ) from .. import scrape_logger BASE_DIR = os.path.dirn...
""" Example of how to trace a Fresnel Zone Plate by Lucia Alianelli and Manuel Sanchez del Rio. 1) The source is from get_beam(), is a collimated source of squared cross section (800 microns), monochromatic (1.54 A) 2) fresnel_zone_plane() calculates a fzp, centered at (0,0). It returns a new shadow3 beam cont...
# -*- coding: utf-8 -*- """ Authors: Tim Hessels UNESCO-IHE 2016 Contact: t.hessels@unesco-ihe.org Repository: https://github.com/wateraccounting/wa Module: Collect/MOD9 """ # import general python modules import os import numpy as np import pandas as pd import gdal import urllib import urllib2 from bs4 impor...
import os import numpy as np import pandas as pd from pandas.tools.plotting import scatter_matrix import pylab import statsmodels.formula.api as smf import statsmodels.stats.api as sms from industry_to_days import get_census_mapper """ USAGE: python full_2011.py CREATES: results/2011/clean.csv results/2011/corr.txt...
#!/usr/bin/env python3 import json from subprocess import PIPE, Popen from requests import get repo_master_raw = 'https://raw.githubusercontent.com/g0v/awesome-g0v/master/' readme = 'readme.md' parser = 'parse.ls' awesome_g0v = 'awesome-g0v.json' outfile = 'url_list.json' def get_source(): readme_url = repo_m...
# GUI Application automation and testing library # Copyright (C) 2006-2017 Mark Mc Mahon and Contributors # https://github.com/pywinauto/pywinauto/graphs/contributors # http://pywinauto.readthedocs.io/en/latest/credits.html # All rights reserved. # # Redistribution and use in source and binary forms, with or with...
""" tests.tests_operations ~~~~~~~~~~~~~~~~~~~~~~ """ import pytest from collections import Mapping, Sequence from . import TestMappingType, TestSequenceType from jsonspec.operations import check, remove, add, replace, copy, move from jsonspec.operations import Error, NonexistentTarget def test_types(): ...
# -*- coding: utf-8 -*- # code for console Encoding difference. Dont' mind on it import sys import imp imp.reload(sys) try: sys.setdefaultencoding('UTF8') except Exception as E: pass import testValue from popbill import TaxinvoiceService, PopbillException taxinvoiceService = TaxinvoiceService(testValue.Link...
from ps4a import * import time # # # Computer chooses a word # # def compChooseWord(hand, wordList, n): """ Given a hand and a wordList, find the word that gives the maximum value score, and return it. This word should be calculated by considering all the words in the wordList. If no words ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Packaging setup for safetymomentum.""" from safetymomentum import __version__ as version try: from setuptools import setup except ImportError: from distutils.core import setup def get_long_description(title): """Create the long_description from other file...
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
# =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.com> # 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. Redistributio...
#Display Data from Neato LIDAR #based on code from Nicolas "Xevel" Saugnier #requires vpython and pyserial import thread, time, sys, traceback, math, struct COM_PORT = "COM4" # example: 5 == "COM6" == "/dev/tty5" BAUD_RATE = 115200 FPS = 60 OFFSET = 140 from visual import * point = points(pos=[(0,0,0) for i in range...
# # Author: Satoru SATOH <ssato redhat.com> # License: GPLv3+ # import anyconfig import logging import optparse import os import os.path import sys from sos_analyzer.globals import DATA_SUBDIR import sos_analyzer.archive import sos_analyzer.runner import sos_analyzer.utils LOGGER = logging.getLogger(__name__) DEFA...
# ================================================================= # # Authors: Tom Kralidis <tomkralidis@gmail.com> # # Copyright (c) 2019 Tom Kralidis # # 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 ...
from default import * DEBUG = True TEMPLATE_DEBUG = DEBUG # Using SpatialLite backend DATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.backends.postgis', 'NAME': 'trytalk', 'USER': 'test', 'PASSWORD': 'test', 'HOST': '127.0.0.1', 'PORT': '5432', } } # settings for request application REQUE...
# Copyright (C) 2010-2011 Richard Lincoln # # 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, merge, publish...
# This library 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; either version 3 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be usefu...
from ..utils import _make_pseudo_id from .base import BaseModel, cleanup_list, SourceMixin from .bill import Bill from .popolo import pseudo_organization from .schemas.vote_event import schema class VoteEvent(BaseModel, SourceMixin): _type = 'vote_event' _schema = schema def __init__(self, *, motion_text...
# encoding: utf-8 """Magic functions for InteractiveShell. """ from __future__ import print_function #----------------------------------------------------------------------------- # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and # Copyright (C) 2001 Fernando Perez <fperez@colorado.edu> # Copyright (C) 2008...
from datetime import datetime, timezone from pytz import timezone as ptimezone import re import json import requests class Front: def __init__(self, token): self.headers = { 'Authorization': 'Bearer {}'.format(token), 'Accept': 'application/json' } self.event_types...
from pyomo.environ import * import numpy as np import util import config as cfg import pdb import pandas as pd import copy import dispatch_budget import logging def surplus_capacity(model): return model.surplus_capacity + model.peak_penalty * model.weight_on_peak_penalty def define_penalty_to_preference_high_cos...
# This file is part of the uPiot project, https://github.com/gepd/upiot/ # # MIT License # # Copyright (c) 2017 GEPD # # 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, inc...
# Copyright (C) 2015-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library 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; either # version 2.1 of the License, or (at your option) any later version. # #...
# # reviewboard/admin/urls.py -- URLs for the admin app # # Copyright (c) 2008-2009 Christian Hammond # Copyright (c) 2009 David Trowbridge # # 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...
import collections import unittest from typing import List import utils # O(n) time. O(n) space. Two-end BFS. class Solution: def ladderLength(self, beginWord: str, endWord: str, wordList: List[str]) -> int: if endWord not in wordList: return 0 graph = collections.defaultdict(set) ...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base.exceptions import TwilioException from twilio.http.response import Response class OutgoingCallerIdTestCase(...
# -*- coding: utf-8 -*- """ Created on Sat Sep 24 18:01:13 2016 @author: pwittek """ def write_header_gpx(target_file): f = open(target_file, 'w') f.write('<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n') f.write('<gpx version="1.0" creator="HappyCowler" xmlns="http://www.topografix.com/GPX/1/0">\n') f...
# -*-coding:Utf-8 -* # Copyright (c) 2010 LE GOFF Vincent # 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 # lis...
############################################################################### # Copyright (c) 2013 INRIA # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation; # # This program is distr...
# 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...
def get_clean_HICP(data_dir="../data/", output_dir="../clean_data/", year=2016, quarter=1): ''' This function takes a raw csv file from SPF and creates a new csv file with forecasts only for HICP ''' import pandas as pd ...
#!/usr/bin/python # -*- coding: utf8 import tensorflow as tf import numpy as np from src.util.tf import tensorToSeq, seqToTensor, revlut import math from google.protobuf import text_format from tensorflow.python.platform import gfile import json import os from collections import defaultdict import src.models.tf_utils ...
# coding: utf8 # try something like def index(): form = SQLFORM.factory( Field("descripcion", "string", default="Barrilete multicolor"), Field("cantidad", "integer", default=1), Field("precio", "float", default=1.00), ) if form.accepts(request.vars, session): p...
''' Some tests for filters ''' from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_equal, assert_raises import scipy.ndimage as sndi def test_ticket_701(): # Test generic filter sizes arr = np.arange(4).reshape((2,2)) func = ...
from tests.helpers import BaseTestCase class TestLink(BaseTestCase): def test_can_link(self): """ Default use case where user invokes `et link` with minimal parameters """ self.fail('Not Implemented') def test_requires_a_file_argument(self): """ A user must pas...
# Copyright 2017 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...
import atexit import Queue import re import time import threading from django.conf import settings from django.core.cache import cache from django.http import HttpResponseForbidden, HttpResponseRedirect from django.utils.functional import wraps from djutils.cache import key_from_args class EmptyObject(object): ...
# # GingaQt.py -- Qt display handler for the Ginga reference viewer. # # Eric Jeschke (eric@naoj.org) # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # # stdlib imports import sys, os import traceback im...
import json import logging import os import cv2 import torch from torch.utils.data import Dataset from src import helper logger = logging.getLogger(__name__) class MarioKartDataset(Dataset): """Mario Kart dataset.""" def __init__(self, log_file=os.path.join(helper.get_dataset_folder(), 'mario_kart', "mario...
''' Compare the regridded versions of the SD datasets. ''' from spectral_cube import SpectralCube import matplotlib.pyplot as plt import os from corner import hist2d from radio_beam import Beam import astropy.units as u import numpy as np from paths import fourteenB_HI_data_path, data_path from galaxy_params import ...
#!/usr/bin/env python """ BMI 260: Final Project Load chest CT scan annotations from radiologist xml files. """ from collections import namedtuple import os import re import xml.etree.ElementTree as ET import numpy as np import skimage import skimage.measure import skimage.segmentation import lcat # Nodule datatype...
'''Driver for the TSL2561 digital luminosity (light) sensors. Pick one up at http://www.adafruit.com/products/439 Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! Code ported from Adafruit Arduino library, comm...
# -*- coding: latin1 -*- ################################################################################################ import snap,datetime, sys, time, json, os, os.path, shutil, time, struct, random import subprocess import networkx as nx import matplotlib.pyplot as plt reload(sys) sys.setdefaultencoding('utf-8')...
from toee import * from utilities import * def OnBeginSpellCast( spell ): print "Meteor Swarm OnBeginSpellCast" print "spell.target_list=", spell.target_list print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level game.particles( "sp-evocation-conjure", spell.caster ) def OnSpellEffect( spell )...
#converter_test.py import sys sys.path.insert(0,"..") sys.path.insert(0,"mvln") from mvln import * import unittest, os, shutil testfolder = os.getcwd()+ "/__tmptest__/src/testfolder/" testfolder_dest = os.getcwd()+"/__tmptest__/dst/testfolder/" testfolder2 = os.getcwd()+ "/__tmptest__/src/testfolder2/" testfold...
import pymongo from scrapy.exceptions import DropItem from scrapy.conf import settings from scrapy import log class MongoDBPipeline(object): def __init__(self): connection = pymongo.Connection( settings['MONGODB_SERVER'], settings['MONGODB_PORT']) db = connection[settings['MONGODB_DB...
"""The tests for the Light component.""" # pylint: disable=protected-access import unittest import unittest.mock as mock import os from io import StringIO from homeassistant import core, loader from homeassistant.setup import setup_component, async_setup_component from homeassistant.const import ( ATTR_ENTITY_ID, ...
# Copyright (C) 2008-2010 Adam Olsen # # 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, or (at your option) # any later version. # # This program is distributed in the hope that...
""" Specialize Service for services that can't be containers. Images only club """ import logging from os.path import abspath, dirname, isfile, join from control.cli_builder import builder from control.repository import Repository from control.options import options from control.service.service import ImageService ...
#!/usr/bin/env python import os, math, sys from pprint import pformat from tempfile import mkstemp from execo import Process from execo import logger as ex_log from execo.log import style from execo_g5k import get_site_clusters, OarSubmission, oardel, get_cluster_site, \ oarsub, wait_oar_job_start, get_oar_job_no...
# -*- coding: utf-8 -*- # # © 2013-2017 Salesforce.com, inc. # # # Standard libraries # from __future__ import absolute_import from os import environ # # Third party libraries # from builtins import next, str from argparse import ArgumentParser, _ArgumentGroup # # Internal libraries # from krux.logging import LEVELS...
#-*- coding: utf-8 -*- ''' Description: Text Classification Based on Logistic Regression. Version: python3 ''' import scipy as sp import numpy as np from matplotlib import pyplot from matplotlib import pylab from sklearn.datasets import load_files from sklearn.model_selection import train_test_split from sklear...