text
stringlengths
12
6.59M
"""Collate an assignment and answer Jupyter notebooks into a single notebook. This script is designed to support active reading. It takes as input a set of ipython notebook as well as some target cells which define a set of reading exercises. The script processes the collection of notebooks and builds a notebook whi...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Publish the documentation on GitHub Pages. Prerequisites ------------- 1. Create empty gh-pages branch: git branch gh-pages git checkout gh-pages git symbolic-ref HEAD refs/heads/gh-pages rm .git/index git clean -fdx 2. Setup sphinx. python...
from __future__ import absolute_import, division, print_function import pytest bcolz = pytest.importorskip('bcolz') from datashape import discover, dshape import numpy as np import pandas.util.testing as tm from odo import into from blaze import by from blaze.expr import symbol from blaze.compute.core import compu...
# Copyright (c) 2010-2012 OpenStack Foundation # # 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 agree...
# -*- coding: utf-8 -*- """ documentation """ from __future__ import division, unicode_literals, print_function import logging from .tracking_infrastructure import CellTracker, CellCrossingCheckingGlobalDuoOptimizerQueue from ..generic.signal import find_extrema_and_prominence, hamming_smooth from ..generic.etc import...
import os from optparse import make_option from subprocess import call from django.core.management import call_command from django.core.management.base import BaseCommand, CommandError from openbudget.settings import local as settings from modeltranslation.models import autodiscover as register_models_translations cl...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 """ Tests for the Python-Java code layer. """ import os import unittest from openquake import java class JvmMaxMemTestCase(unittest.TestCase): """Tests related to the JVM's maximum memory setting""" def setup(self): try: ...
#!/usr/bin/python # # Copyright (C) 2015 SUSE LLC # # 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. # # This li...
from copy import copy import sqlalchemy as sa from sqlalchemy.ext.hybrid import hybrid_property, Comparator from sqlalchemy_utils.functions import primary_keys def translation_getter_factory(name): def attribute_getter(self): value = getattr(self.current_translation, name) if value: re...
""" Reads the subset of the dBase III file format used by ESRI shapefiles. The dBase III format was never specified publicly but it has been reverse-engineered. The best documentation on the subject can be found at http://www.clicketyclick.dk/databases/xbase/format/dbf.html. """ from collections import namedtuple from...
from argparse import ArgumentParser from pathlib import Path from typing import TypeVar, Type, Optional, Union, IO, Dict from dacite import from_dict from omegaconf import OmegaConf, DictConfig T = TypeVar('T') class ParamsMixIn: @classmethod def load(cls: Type[T], file: Optional[str] = None) -> T: ...
""" Built-in, globally-available admin actions. """ from django import template from django.core.exceptions import PermissionDenied from django.contrib.admin import helpers from django.contrib.admin.util import get_deleted_objects, model_ngettext from django.db import router from django.shortcuts import render_to_resp...
__author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016, {}".format(__author__) __license__ = "MIT License" __version__ = "1.0.0" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
# -*- coding: utf-8 -*- # pylint: disable=bad-continuation """ Certificate HTML webview. """ import logging import urllib from datetime import datetime from uuid import uuid4 import MySQLdb as mdb import pytz from django.conf import settings from django.contrib.auth.models import User from django.http import Http404, ...
from typing import Dict, List, Union, Optional, Sequence, Any from enum import Enum from pydantic import BaseModel, Field, ValidationError, validator from pydantic import StrictStr, StrictInt, StrictFloat, StrictBool from pydantic import FilePath, DirectoryPath from collections import defaultdict from thinc.api import ...
# -*- coding: utf-8 -*- ############################################################################## # # Author: Joël Grand-Guillaume # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as pu...
import click from qstrader import settings from qstrader.compat import queue from qstrader.price_handler.yahoo_daily_csv_bar import YahooDailyCsvBarPriceHandler from qstrader.strategy.moving_average_cross_strategy import MovingAverageCrossStrategy from qstrader.strategy import Strategies, DisplayStrategy from qstrader...
# -*- coding: utf-8 -*- import itertools from sqlparse import sql from sqlparse import tokens as T try: next except NameError: # Python < 2.6 next = lambda i: i.next() def _group_left_right(tlist, ttype, value, cls, check_right=lambda t: True, check_left=lambda ...
# -*- coding: utf-8 -*- # vim: ai ts=4 sts=4 et sw=4 # spamc - Python spamassassin spamc client library # Copyright (C) 2015 Andrew Colin Kissa <andrew@topdog.za.net> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by...
# -*- coding: utf-8 -*- from openerp.osv import fields, orm from openerp.tools.translate import _ class logistic_requisition_cost_estimate(orm.TransientModel): _name = 'logistic.requisition.cost.estimate' _description = 'Create cost estimate of logistic requisition lines' def _get_requisition_id(self, c...
# -*- coding: utf-8 -*- """ spdypy.stream ~~~~~~~~~~~~~ Abstractions for SPDY streams. """ import collections from .frame import (SYNStreamFrame, SYNReplyFrame, RSTStreamFrame, SettingsFrame, DataFrame, HeadersFrame, WindowUpdateFrame, FLAG_FIN) class Stream(object): """ ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import re import logging import serial import gobject import pykka from mopidy import exceptions from mopidy.utils import encoding logger = logging.getLogger(__name__) class SerialMonoboxController(pykka.ThreadingActor): def...
import asyncio import discord import re import os import random import string import json import time import html import codecs from random import shuffle from discord.ext import commands from Cogs import Settings from Cogs import DisplayName from Cogs import Nullify class CardsAgainstHumanity: # Init ...
"""This is a file to test the encoders parameter on ensembles""" import math import time import numpy as np import matplotlib.pyplot as plt from .. import nef_theano as nef build_time_start = time.time() net = nef.Network('Encoder Test') net.make_input('in1', math.sin) net.make_input('in2', math.cos) net.make('A',...
import binascii import random import traceback from logzero import logger from twisted.internet.protocol import Protocol from twisted.internet import error as twisted_error from twisted.internet import reactor, task from neo.Core.Blockchain import Blockchain as BC from neocore.IO.BinaryReader import BinaryReader from n...
# Drived from the rpi_ws281x library. A buffer class used to create layers for then passing # a flattened set of values to rxi_ws281x for dsiplay on the neoPixels # this is so that multiple simultanious animiation elements can be complied together easily # Author: Karl Grindley (karlg100@gmail.com) from neopixel impo...
""" An example client. Run simpleserv.py first before running this. """ from __future__ import unicode_literals import json from threading import Event from twisted.internet import reactor, protocol, threads, defer from nethud.dpqueue import DeferredPriorityQueue class NethackClient(protocol.Protocol): """Once...
# -*- coding: utf-8 -*- from openerp import models, fields, api, _ from openerp.exceptions import UserError class ResPartner(models.Model): _inherit = "res.partner" firstname = fields.Char('First Name') lastname = fields.Char('Last Name') subscriber = fields.Boolean(string="Subscriber...
# -*- coding: utf-8 -*- ############################################################################### # # ODOO (ex OpenERP) # Open Source Management Solution # Copyright (C) 2001-2015 Micronaet S.r.l. (<http://www.micronaet.it>) # Developer: Nicola Riolini @thebrush (<https://it.linkedin.com/in/thebrush>) # This prog...
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2021, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
# -*- coding: utf-8 -*- """Phrasal adjectives. --- layout: post source: Garner's Modern American Usage source_url: http://bit.ly/1T4alrY title: Phrasal adjectives date: 2014-06-10 12:31:19 categories: writing --- Phrasal adjectives. """ from proselint.tools import existence_check, preferred_forms_...
#!/usr/bin/python """ AirRace competition in Vienna. See robotchallenge.org usage: ./airrace.py <image or video file> [<PaVE frame number>] """ # for introduction of cv2 for Python have a look at # http://docs.opencv.org/trunk/doc/py_tutorials/py_tutorials.html import sys import cv2 import math import numpy ...
#!/usr/bin/env python # Copyright (c) 2009, Anton Korenyushkin # 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...
''' Created on Jan 31, 2012 @author: guillaume.aubert@gmail.com ''' import socket import sys import datetime import os import argparse import log_utils import imaplib import gmvault_utils import gmvault from cmdline_utils import CmdLineParser from credential_utils import CredentialHelper GLOBAL_HELP_EPILOGUE="""Ex...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from datetime import datetime from chai import Chai from arrow import locales from arrow.api import now from arrow import arrow class ModuleTests(Chai): def test_get_locale(self): mock_locales = mock(locales, '_locales') mock_loca...
# GUI Application automation and testing library # Copyright (C) 2006 Mark Mc Mahon # # 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 opti...
################################################################################ #This software was developed by the University of Tennessee as part of the #Distributed Data Analysis of Neutron Scattering Experiments (DANSE) #project funded by the US National Science Foundation. # #See the license text in lic...
import pygtk pygtk.require('2.0') import gtk class window: def delete_event(self,widget,event,data=None): "Quit window" gtk.main_quit() return False def __init__(self): "Initiate the window,button,etc .." self.window=gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.set_resizable(True) self.window.set_tit...
# Copyright (c) 2010-2011, GEM Foundation. # # OpenQuake is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # only, as published by the Free Software Foundation. # # OpenQuake is distributed in the hope that it will be useful, # but WITHOUT AN...
''' Track finding and fitting functions are listed here.''' import logging import progressbar import tables as tb import numpy as np from math import sqrt from numba import njit from multiprocessing import Pool, cpu_count from numpy.lib import recfunctions from matplotlib.backends.backend_pdf import PdfPages from te...
#!/usr/bin/env python """ Copyright (c) 2014, <47bytes@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: * Redistributions of source code must retain the above copyright notice, this l...
from annotypes import Anno from malcolm.core import Part, PartRegistrar, ChoiceMeta, Port, Alarm from malcolm.modules import ca, builtin from malcolm.modules.pmac.infos import cs_axis_names with Anno("PV prefix for CSPort and CSAxis records"): APrefix = str class RawMotorCSPart(Part): """Defines a string `A...
import os import numpy as np def dsk_out(fout,kvecs,mdsk,edsk): """ output fluctuating structure factor dS(k) in energy.pl format Args: fout (str): output filename kvecs (list): a list of 3D vectors mdsk (list): mean <dS(k)>, one value per kvector edsk (list): error, one value per kvector Return...
import os import re class InstallimageConfig: CFG_DIR = '/srv/tftp/installimage/' @classmethod def all(cls): '''Return all currently defined installimage configs.''' entries = [] for entry_file in os.listdir(InstallimageConfig.CFG_DIR): if re.match('([0-9A-Z]{2}_){3}[0-...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2013 Matt Martz # 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/lic...
#!/usr/bin/env python ######################################################################################### # # Test function sct_detect_vertebral_levels # # --------------------------------------------------------------------------------------- # Copyright (c) 2015 Polytechnique Montreal <www.neuro.polymtl.ca> # A...
# # -*- coding: utf-8 -*- # # Copyright (c) 2007 Jared Crapo # # 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, mod...
import urllib2 import logging import datetime from lxml import etree from django.db import IntegrityError from iati.models import * from geodata.models import Country, Region from iati.models import RegionVocabulary from iati_synchroniser.models import Codelist import pprint logger = logging.getLogger(__name__) cl...
#!/usr/bin/env python import os,sys import numpy as np try: import fitsio except: from astropy.io import fits from astropy.stats import sigma_clip from ninetyprime import ampOrder,colbias import matplotlib.pyplot as plt from matplotlib import ticker def _data2arr(data,minVal=0,maxVal=65335): return np.ma.masked_...
## # Project: URL ANALYZER # Class: Defense Against the Dark Arts # Week: 6 # Contributors: # Ty Skelton # John Miller # Chris Kennard # Justin Bruntmyer # ## import json import codecs import argparse from pprint import pprint def processArgs(): parser = argparse.Arg...
#!/usr/bin/env python2 """ Animate a given set of CSV data ontop of a GIS file, and display it in a semi-elegant form. Future improvements: - GUI tweaking (1) - Transformations - Intergrate with the scale - Code cleanups (2) - Removing all of the TODO's... (2) - Speed ups + profilin...
import numpy import sys import random import subprocess import re import decimal import math import os import shutil import time import types import uuid import argparse from argparse import RawTextHelpFormatter ############################## # ARGPARSE TYPES AND FUNCTIONS ############################## def parseGC(...
"""Simple phase This example illustrates the simple usage of the :py:class:`qpimage.QPImage` class for reading and managing quantitative phase data. The attribute ``QPImage.pha`` yields the background-corrected phase data and the attribute ``QPImage.bg_pha`` yields the background phase image. """ import matplotlib.p...
import json from sqlalchemy import inspect from pprint import pprint class JSONAPIFromSqlAlchemyRenderer: '''Pyramid renderer: to JSON-API from SqlAlchemy. Pass in as the renderer to a view and return the results of a sqlalchemy query from the view. The renderer will produce a correct JSON-API response. ...
""" Tests for the http gateway. Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net). """ import json from wsgiref.util import setup_testing_defaults import io import unittest import Pyro4.utils.httpgateway import Pyro4.errors import Pyro4.core from Pyro4.naming import NameServer from Pyro4...
from functools import wraps def decorate_with(*decorators): """decorate_with is a decorator that takes other decorators as input, including their arguments (if any), and applies the them to the function being decorated""" def wrapper(func): @wraps(func) def func_wrapper(*args, **k...
import logging from rex import Vulnerability from rex.exploit import Exploit, CannotExploit from ..technique import Technique l = logging.getLogger("rex.exploit.techniques.call_shellcode") class CallShellcode(Technique): name = "call_shellcode" applicable_to = ['unix'] def apply(self, **kwargs): ...
# # Copyright (c) 2017 Intel Corporation # # 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...
from mythril.analysis.modules.delegatecall import execute, _concrete_call, _symbolic_call from mythril.analysis.ops import Call, Variable, VarType from mythril.analysis.symbolic import SymExecWrapper from mythril.disassembler.disassembly import Disassembly from mythril.laser.ethereum.cfg import Node from mythril.laser....
import requests import json import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.patches as mpatches import cartopy.io.shapereader as shpreader import cartopy.crs as ccrs import statsmodels.api as sm import pandas as pd from pyjstat import pyjstat from collections import Ordered...
#!/usr/bin/python # -*- coding: utf8 -*- import os import psycopg2 import time import config import argparse import urllib import urllib2 import requests import datetime import json import pprint import sys ''' Система тут такая. Предварительно, обработанные данные загружаются в NextGIS Web. Он умеет их рендрить ре...
from datetime import datetime from dateutil.parser import parse from dateutil.tz import tzutc import json import os import unittest from openapscontrib.predict.predict import Schedule from openapscontrib.predict.predict import calculate_carb_effect from openapscontrib.predict.predict import calculate_cob from openapsc...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from mcrouter.test.MCProcess import Mcrouter from mcrouter.test.McrouterTestCase import McrouterTestCase from mcrouter....
from django.http.response import HttpResponse, HttpResponseRedirect from django.shortcuts import render from PhotoSharingApplication.APIS.helpers.upload_images import ImageForm from PhotoSharingApplication.models import Categories, UserProfile, Pictures, PictureLikes from django.template import RequestContext, lo...
# coding= utf-8 # Copyright (c) 2014 Rackspace, 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 o...
#!/usr/bin/env python # ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # Copyright (c) 2017, Intel Corporation. # All rights reserved. # # 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 # ...
# coding: utf-8 # # Natural Language Toolkit: Sentiment Analyzer # # Copyright (C) 2001-2015 NLTK Project # Author: Pierpaolo Pantone <24alsecondo@gmail.com> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ Utility methods for Sentiment Analysis. """ from copy import deepcopy import codecs imp...
# Natural Language Toolkit: Wordnet Interface: Wordnet Module # # Copyright (C) 2001-2008 University of Pennsylvania # Author: Oliver Steele <steele@osteele.com> # David Ormiston Smith <daosmith@csse.unimelb.edu.au>> # Steven Bird <sb@csse.unimelb.edu.au> # URL: <http://nltk.sf.net> # For license inform...
# Sam Greydanus and Luke Chang 2015 # Some code taken from nilearn searchlight implementation: https://github.com/nilearn/nilearn/blob/master/nilearn/decoding/searchlight.py import os import time import sys import warnings from distutils.version import LooseVersion import random import cPickle import numpy as np im...
from .fully_connected_layer import FullyConnectedLayer from .output_layer import OutputLayer
# Copyright (c) 2019-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. from __future__ import a...
# coding: utf-8 from madrona.features.forms import FeatureForm, SpatialFeatureForm from django import forms from django.forms import ModelMultipleChoiceField, CheckboxSelectMultiple from django.forms.widgets import * from django.forms.widgets import Input from django.utils.safestring import mark_safe from django.contri...
# Copyright (c) 2019-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. from __future__ import a...
from django.http import HttpResponse, Http404 from django.shortcuts import get_object_or_404 from django.template.defaultfilters import slugify from django.views.decorators.cache import cache_page from madrona.features.models import Feature from madrona.features import get_feature_by_uid from general.utils import meter...
import random from mpf.core.case_insensitive_dict import CaseInsensitiveDict from mpf.core.utility_functions import Util channel_min_val = 0 channel_max_val = 255 rgb_min = (0, 0, 0) rgb_max = (255, 255, 255) # Standard web color names and values named_rgb_colors = CaseInsensitiveDict( off=(0, 0, 0), alicebl...
"""Contains the base class for the Snux driver overlay. This class overlays an existing WPC-compatible platform interface to work with Mark Sunnucks's System 11 interface board. """ import logging from mpf.core.platform import DriverPlatform from mpf.devices.driver import ConfiguredHwDriver from mpf.platforms.inte...
""" Mail reader functions Adapted from * http://www.ianlewis.org/en/parsing-email-attachments-python * http://stackoverflow.com/questions/1225586/checking-email-with-python """ import poplib from email.Header import decode_header from email.Parser import Parser as EmailParser from email.utils import parseaddr from ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2003-2010 Chris Liechti <cliechti@gmx.net> # All Rights Reserved. # Simplified BSD License (see LICENSE.txt for full text) """\ Helper module to parse IAR listing files. """ import re, sys, os verbosity = 0 symbols = {} class Module: ...
import os from django.db import models from django.db.models import Subquery from django.template.defaultfilters import slugify from museum.settings import STATIC_URL class SeriesManager(models.Manager): def search(self, p): qs = self.exclude(visible=False) return qs class Series(models.Model):...
#!/usr/bin/env python import os import sys import getopt import discid import musicbrainzngs as ws use_json = False compact_json = True extra_includes = [] device = None def usage(): print("Usage: {0:s} [-hjJ] [-i list] [device]".format(os.path.basename(sys.argv[0]))) print("Flags:") print(" -h Show this h...
# -*- coding: utf-8 -*- # Copyright (C) 2015-2020 by Brendt Wohlberg <brendt@ieee.org> # All rights reserved. BSD 3-clause License. # This file is part of the SPORCO package. Details of the copyright # and user license can be found in the 'LICENSE.txt' file distributed # with the package. """Linear algebra functions."...
PACKAGE = 'herbpy' import roslib; roslib.load_manifest(PACKAGE) import prpy, openravepy # Add dependencies to our OpenRAVE plugin and data search paths. import prpy.dependency_manager prpy.dependency_manager.export(PACKAGE) def initialize(robot_xml=None, env_path=None, attach_viewer=False, sim=True, **kw_args): #...
import copy import re from buildbot.plugins import steps, util from buildbot.process import buildstep from buildbot.status.results import SUCCESS from twisted.internet import defer import yaml import environments as envs SERVO_REPO = "https://github.com/servo/servo" class ServoFactory(util.BuildFactory): """\...
import time import socket import datetime from geopy.distance import vincenty class FlightRadar(): #https://github.com/wiseman/node-sbs1 #http://woodair.net/SBS/Article/Barebones42_Socket_Data.htm def __init__(self): self._airplanes = {} self._loc = (52.5151,13.4394) def dump(self): ...
#!/usr/bin/env python # #CustomScript extension # # Copyright 2014 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
import os import json import commands import traceback from kvmagent import kvmagent from zstacklib.utils import jsonobject from zstacklib.utils import linux from zstacklib.utils import log from zstacklib.utils import shell from zstacklib.utils import http from zstacklib.utils.bash import in_bash logger = log.get_log...
#!/usr/bin/env python '''unit testing code for pysam. Execute in the :file:`tests` directory as it requires the Makefile and data files located there. ''' import warnings import unittest import os import re import glob import sys import subprocess import shutil import pysam import pysam.samtools import pysam.bcftools...
import datetime import pymongo from pymongo.connection import Connection import re authorized_types = [type(None), bool, int, float, unicode, list, dict, datetime.datetime, pymongo.binary.Binary, pymongo.objectid.ObjectId, pymongo.dbref.DBRef, pymongo.code.Code, type(re.compile("")), ] class RequireField...
# -*- coding:utf-8 -*- import string import numpy as np def str2list(rawstr): rawlist = rawstr.strip(string.whitespace).split(' ') # Remove space elements in list. cleanlist = [x for x in rawlist if x != ' ' and x != ''] return cleanlist def line2list(line, field=' ', dtype=float): "Convert te...
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2017-08-08 18:36 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): SQL = """ --- Migrating v1 tickets. insert into api_v3_ticket ( id, status, request_typ...
import webapp2 import webapp2_extras.routes from .centralclient import CentralClient from .download import Download from .handlers.collectionshandler import CollectionsHandler from .handlers.confighandler import Config, Version from .handlers.containerhandler import ContainerHan...
""" Jhonatan da Silva Last Updated version : Sat Feb 11 14:36:15 2017 Number of code lines: 21 """ import serial import io import time ser = serial.Serial('/dev/ttyUSB0') class Jtk(): def __init__(self): pass def ativarUltrassonico(self): ser.write(b'U') def ativarLCD(self): ...
# -*- coding: utf-8 -*- """ werkzeug.routing ~~~~~~~~~~~~~~~~ An extensible URL mapper. Map creation:: >>> m = Map([ ... # Static URLs ... Rule('/', endpoint='static/index'), ... Rule('/about', endpoint='static/about'), ... Rule('/help', endpoin...
#!/usr/local/bin/python2 # -*- coding: utf-8 -*- import re import mechanize from bs4 import BeautifulSoup import calendar import json import os from datetime import datetime, timedelta import sys begin = 2015 end = 2015 now = datetime.now() URL = 'http://fhy.wra.gov.tw/ReservoirPage_2011/StorageCapacity.aspx' br = m...
"""Plots examples (storm objects) with surrounding context. Specifically, for each storm object, this script plots surrounding radar data and tornado reports for near-past and near-future times. """ import copy import os.path import argparse import numpy import matplotlib matplotlib.use('agg') import matplotlib.pyplo...
import re import uuid, collections from datetime import datetime import dateutil.parser from itertools import imap from operator import itemgetter import random import string from couchdbkit import ResourceNotFound from couchdbkit.ext.django.schema import * from django.core.cache import cache from django_couchdb_uti...
""" App Launch Hook - Rez This hook is executed to launch applications, potentially in a Rez context. https://github.com/nerdvegas/rez Rez packages can be requested via app_launchers.yml, as part of the "extras" section and in a key called "rez_packages". Also be sure to override the default "hook_app_launch" with t...
# Copyright (C) 2009 - TODAY Renato Lima - Akretion # Copyright (C) 2019 - TODAY Raphaël Valyi - Akretion # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from odoo import api, fields, models from odoo.addons.l10n_br_fiscal.constants.fiscal import ( TAX_FRAMEWORK, # FISCAL_IN_OUT, ) from .acc...
import cython from Cython import __version__ from glob import glob import re, os, sys try: import gzip gzip_open = gzip.open gzip_ext = '.gz' except ImportError: gzip_open = open gzip_ext = '' import shutil import subprocess try: import hashlib except ImportError: import md5 as hashlib tr...
from __future__ import division from StringIO import StringIO import cPickle import numpy as np import scipy as sp import pandas as pd from scipy.stats import gamma from sklearn.decomposition import PCA import matplotlib.pyplot as plt import seaborn as sns class HRFModel(object): """Abstract class definition fo...