src
stringlengths
721
1.04M
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from colle...
import os import sys import unittest from cobbler import utils from newtests.cli.imports.import_base import CobblerImportTest from newtests.cli.imports.import_base import create_import_func class Test_VMWare_Imports(CobblerImportTest): """ Tests imports of various distros """ pass distros = [ {"name":"v...
#!/usr/bin/env python3 import os import inspect cur_dir = os.path.dirname(inspect.getfile(inspect.currentframe())) def git_clone(url, dest_dir): ''' download third party packaged that cannot get from elpa ''' save_path = os.path.join(cur_dir, "src", dest_dir) if os.path.exists(save_path): ...
import tensorflow as tf from tensorflow.contrib import rnn import os os.environ["TF_CPP_MIN_LOG_LEVEL"]="2" class SelfMatchingLayer(): def __init__(self, args, inputs, scope): print("building self-matching layer", scope) batch_size = args.batch_size vocab_size = args.vocab_size hid...
#!/usr/bin/env python # # 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 "Li...
""" This function finds the fractal dimensionality of the cluster """ from DLAcluster import DLAcluster import numpy import matplotlib.pyplot as plt from scipy.optimize import curve_fit radiusArray=numpy.arange(10,80,5) mass=[] for i in radiusArray: massValue,matrix=DLAcluster(i,False) #import radius and Tru...
""" Tests for Discussion API internal interface """ from __future__ import absolute_import import itertools from datetime import datetime, timedelta import ddt import httpretty import mock import six from django.core.exceptions import ValidationError from django.test.client import RequestFactory from opaque_keys.edx....
import threading import json import time import queue import gevent # pylint: disable=import-error from flask import Flask, render_template # pylint: disable=import-error from flask_socketio import SocketIO, emit, join_room, leave_room, send # pylint: disable=import-error from Utils import * from LCM import * HOST_URL...
# -*- coding: utf-8 -*- import pytest from greek_stemmer.lemmatizers.verb import stem class TestVerbStem: # rule-set 1: check irregular verbs verb_stem_ruleset1 = [ ('', 'VB', ''), ('ΕΙΜΑΙ', 'VB', 'ΕΙ'), ('ΕΙΜΑΣΤΕ', 'VBS', 'ΕΙ'), ('ΠΩ', 'VB', 'Π'), ('ΖΕΙΤΕ', 'VBS', '...
#!/usr/bin/python3 import time from random import randint # Game Vars # Health hvar = 100 svar = 100 # Fight # stats not final # player # weapons weaponls = ['bare hands', 'sword', 'axe', 'staff'] wpninpackls = [1, 1 ,1, 0] wpnhealthls = [100, 20, 30, 50] wpndamagels = [5, 7, 10, 20] wpnchancels = [8, 7, 5, 6] #...
# Copyright (c) 2014, Fundacion Dr. Manuel Sadosky # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, this # list of condit...
from Converter import Converter from Components.Element import cached from pprint import pprint # the protocol works as the following: # lines starting with '-' are fatal errors (no recovery possible), # lines starting with '=' are progress notices, # lines starting with '+' are PIDs to record: # "+d:[p:t[,p:t...]]"...
# -*- coding: iso-8859-1 -*- # ----------------------------------------------------------------------------- # ogm.py - ogm/ogg file parser # ----------------------------------------------------------------------------- # $Id$ # # ----------------------------------------------------------------------------- # kaa-Metad...
############## errror code # killed EC_Kill = 100 # transfer timeout EC_Transfer = 101 # expire EC_Expire = 102 # aborted EC_Aborted = 103 # wait timeout EC_WaitTimeout = 104 # reassigned by rebrokeage EC_Reassigned = 105 # reassigned by server-side retry EC_Retried = 106 # retried by pilot EC_PilotRetried = 1...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Thu Feb 9 16:52:39 2017 @author: jpoeppel """ import numpy as np from primo2.networks import BayesianNetwork from primo2.nodes import DiscreteNode from primo2.inference.exact import VariableElimination from primo2.inference.exact import FactorTree from p...
from odf.opendocument import load from odf.table import Table, TableRow, TableCell from odf.namespaces import TABLENS from odf.text import P def import_ods(path): doc = load(path) db = {} tables = doc.spreadsheet.getElementsByType(Table) for table in tables: db_table = [] db[table.ge...
# Copyright 2019 Akretion (Raphaël Valyi <raphael.valyi@akretion.com>) # Copyright 2019 KMEE INFORMATICA LTDA # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from odoo import api, fields from odoo.addons.spec_driven_model.models import spec_models from ..constants.nfe import ( NFE_ENVIRONMENT_DE...
import math from datetime import datetime from tkp.db.model import Frequencyband, Skyregion, Image, Dataset from tkp.utility.coordinates import eq_to_cart from sqlalchemy import func, cast from sqlalchemy.dialects.postgresql import DOUBLE_PRECISION as Double def get_band(session, dataset, freq_eff, freq_bw, freq_bw_...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import logging import urlparse logger = logging.getLogger(__name__) try: import suds.client if suds.__version__ < '0.6': raise ImportError except ImportError: logger.error("The metadata API requires suds-jurko >= 0.6...
# ---------------------------------------------------------------------------- # Anti-Grain Geometry (AGG) - Version 2.5 # A high quality rendering engine for C++ # Copyright (C) 2002-2006 Maxim Shemanarev # Contact: mcseem@antigrain.com # mcseemagg@yahoo.com # http://antigrain.com # # AGG is...
from __future__ import with_statement import pytest from aredis.exceptions import (NoScriptError, ResponseError) from aredis.utils import b multiply_script = """ local value = redis.call('GET', KEYS[1]) value = tonumber(value) return value * ARGV[1]""" msgpack_hello_script = """ local...
#!/usr/bin/env python # This work was created by participants in the DataONE project, and is # jointly copyrighted by participating institutions in DataONE. For # more information on DataONE, see our web site at http://dataone.org. # # Copyright 2009-2019 DataONE # # Licensed under the Apache License, Version 2.0 (t...
import random import time import data import sprite import sys import pygame import constants import collectable import client import wall from struct import * import board class Game: def __init__(self, s): self.objects = [] #start with a list of no objects self.screen = s #get the screen surfac...
import cv2 import numpy as np class Dominator(object): def __init__(self, domino_filename): self.domino_image = cv2.imread(domino_filename) def detect_blobs(self, image=None): if image is None: image = self.domino_image params = cv2.SimpleBlobDetector_Params() pa...
# -*- coding: utf-8 -*- # # alchemlyb documentation build configuration file, created by # sphinx-quickstart on Wed Feb 1 15:01:17 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # #...
from datetime import datetime def stripped_split(ss, c, n=-1): return [p.strip() for p in ss.split(c, n)] class Cookie(object): def __init__(self, path=None, key=None, value=None, domain=None, expires=None, max_age=None, secure=False): self.path = path self.key = key self.value = val...
# 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. # # This program is distributed in the hope that it will be useful, # bu...
#!/usr/bin/env python import os import sys import argparse import time import datetime import plantcv.parallel import tempfile import shutil # Parse command-line arguments ########################################### def options(): """Parse command line options. Args: Returns: argparse object. ...
from couchpotato.core.event import addEvent from couchpotato.core.helpers.encoding import tryUrlencode from couchpotato.core.helpers.variable import cleanHost from couchpotato.core.logger import CPLog from couchpotato.core.notifications.base import Notification from urllib2 import URLError from xml.dom import minidom i...
from err import GenError ARG_BIT_VAL = 1 ARG_CALL = 2 ARG_MEM_BIT = 3 ARG_MEM_VAL = 4 ARG_NONE = 5 ARG_TAG = 6 ARG_VALUE = 7 ARG_STRING = 8 OP_BIT = 0 OP_MEM = 1 OP_MEM_ADDR = 2 OP_BOOL = 3 OP_STRING = 4 OP_INT = 5 OP_NONE = 6 OP_BIT_ADDR = 7 #@TODO Check vm memory class Compiler(GenError): #Erzeugt aus dennen vom Pa...
""" Программа ищет оптимальное решение для задачи про два кувшина Для работы требуется Python 3 """ from enum import Enum class Action(Enum): """ Действия с кувшинами """ empty = 0 fill = 1 transfer = 2 start = 3 def get_pitchers_volume(): """ Возвращает список из целочисленных з...
#!/usr/bin/python import os import glob import shutil def rename(files): new_files = [] for f in files: dirname = os.path.dirname(f) basename = os.path.basename(f) filetype = "" number = "" print("------------") print("Basename: %s") % basename if not basename.find("ogg") == -1: file_type = "og...
from subprocess import check_call, call, PIPE, CalledProcessError from os import path, system, chdir import hitchpython import hitchserve import hitchtest import hitchcli from commandlib import Command, run from pathlib import Path # Get directory above this file PROJECT_DIRECTORY = path.abspath(path.join(path.dirnam...
#!BPY """ Name: 'OGRE for Kenshi (*.MESH)' Blender: 2.80 Group: 'Import/Export' Tooltip: 'Import/Export Kenhi OGRE mesh files' Author: Someone Based on the Torchlight Impost/Export script by 'Dusho' Thanks goes to 'goatman' for his port of Ogre export script from 2.49b to 2.5x, and 'CCCenturion' for trying to refac...
""" Given two arrays of length m and n with digits 0-9 representing two numbers. Create the maximum number of length k <= m + n from digits of the two. The relative order of the digits from the same array must be preserved. Return an array of the k digits. You should try to optimize your time and space complexity. Ex...
# -*- coding: utf-8 -*- ############################################################################## # # Python visionLive API # Copyright 2017 Vision Internet (http://www.visioninternet.com) # ############################################################################## from setuptools import setup, find_pac...
import argparse import itertools import json import logging import os.path import urllib import urllib2 import sys import xml.etree.cElementTree as ET import base.api import base.atom import base.log import base.tag_helper import base.url_fetcher import base.worker def main(): base.log.init() base.atom.init() ...
# 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 use ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Loads and runs all the tests. """ import unittest as ut import shutil import tempfile import sys import os import pyvle def main(): # add here the names of the unittest.TestCase # derived classes to use modules = ( 'pyvle_experiment.TestO...
"""Features in development.""" # Core Library modules import os import urllib.request # Local modules from . import handwritten_data, utils class Bitmap: """n × n grayscale bitmap of the recording.""" normalize = True def __init__(self, n=28): self.n = n # Size of the bitmap (n x n) def...
# coding=utf-8 """ InaSAFE Disaster risk assessment tool developed by AusAid and World Bank - **Impact function Test Cases.** .. note:: 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; eithe...
#Python #created at https://github.com/gjelsas/paperwork-multiexport import os import shutil from os.path import expanduser #topdir = '/home/$USER/papers' #use this if your detection doesn't work! home = expanduser("~") for line in open(home + '/.config/paperwork.conf'): #get the paperworkdir from config...
# Copyright 2018 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...
# # Copyright 2016-2019 Crown Copyright # # 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 i...
'''function [out] = imrotateFill(inp, angle) % function [out] = imrotateFill(inp) % Rotates an 2D image couterclockwise by angle in degrees % Output image has the same dimension as input. % Undefined regions are filled in by repeating the original image % Note: input images must be square % % Copyright (c) UWM, Peter ...
__author__ = 'thor' from sklearn.feature_extraction import DictVectorizer from sklearn.externals import six import numpy as np from pandas import DataFrame from collections import Counter class IterDictVectorizer(DictVectorizer): """Transforms lists of feature-value mappings or rows of a dataframe to vectors...
# -*- coding: utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # Copyright (c) 2012 dput authors # # 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...
import _plotly_utils.basevalidators class ColorbarValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="colorbar", parent_name="barpolar.marker", **kwargs): super(ColorbarValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_nam...
# -*- coding: utf-8 -*- # This file is part of Gertrude. # # Gertrude 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. #...
#!/usr/bin env python """ common functions used in the command line scripts """ import re import datetime import MySQLdb import MySQLdb.cursors import sys import logging def parsetime(strtime): """ Try to be flexible in the time formats supported: 1) unixtimestamp prefixed with @ 2) year-mon...
# coding=utf-8 from sklearn.datasets import load_digits from sklearn.cross_validation import train_test_split from sklearn.metrics.classification import accuracy_score import numpy as np from dbn import SupervisedDBNClassification # Loading dataset digits = load_digits() X, Y = digits.data, digits.target # Data sc...
# Copyright 2016 F5 Networks 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...
import time import lcddriver import RPi.GPIO as GPIO from Adafruit_BME280 import BME280, BME280_OSAMPLE_8 RELAY_PIN = 21 LIMIT = 60 try: GPIO.setmode(GPIO.BCM) GPIO.setup(RELAY_PIN, GPIO.OUT) lcd = lcddriver.lcd() while True: sensor = BME280(mode=BME280_OSAMPLE_8) degrees = sensor.r...
# Copyright 2013-2014 Red Hat, Inc. # # 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 in...
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
#!/usr/bin/env python # # Copyright 2017 the original author or 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 require...
import os.path from glob import glob import bark import argparse from bark import stream import arrow from dateutil import tz import numpy import sys import subprocess def meta_attr(): p = argparse.ArgumentParser( description="Create/Modify a metadata attribute") p.add_argument("name", help="name of b...
# -*- coding: utf-8 -*- # # Copyright 2017-2021 BigML # # 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 ...
from django.db.models import Q from django.core.exceptions import ValidationError import ipaddr import smtplib from email.mime.text import MIMEText from settings.local import people_who_need_to_know_about_failures from settings.local import inventorys_email # http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-func...
# Copyright (c) 2008, Aldo Cortesi. All rights reserved. # # 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,...
# -*- coding: utf-8 -*- # # This file is part of plotextractor. # Copyright (C) 2010, 2011, 2015 CERN. # # plotextractor 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 (a...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import re PHYSICAL_SIDES = ["top", "left", "bottom", "right"] LOGICAL_SIDES = ["block-start", "block-end", "inline-star...
import os import shutil from steps.abstractstep import * def copyfile(filename1, filename2): if not os.path.exists(os.path.dirname(filename2)): os.makedirs(os.path.dirname(filename2)) shutil.copy( filename1, os.path.dirname(filename2) ) if os.path.isfile (filename2): return True return False ...
# -*- coding: iso-8859-1 -*- # Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesse...
""""Command line tool for creating the structural map and file section metadata for a METS document.""" from __future__ import unicode_literals, print_function import os import sys import datetime import click import lxml.etree as ET import mets import xml_helpers.utils as xml_utils from siptools.scripts.create_agen...
# -*- coding: utf-8 -*- import argparse import pylibi2c if __name__ == '__main__': parser = argparse.ArgumentParser() # Required args parser.add_argument('-b', '--bus', help='i2c bus, such as /dev/i2c-1', type=str, required=True) parser.add_argument('-d', '--device', help='i2c device address, such as...
########################################################################## # # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
from __future__ import absolute_import from flask import Flask, request, Response, json from werkzeug.exceptions import BadRequest import r5d4.settings as settings from r5d4.analytics_browser import browse_analytics from r5d4.publisher import publish_transaction from r5d4.utility import json_response from r5d4.logger i...
# Copyright 2016 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Tests for Domain API.""" import http.client import json import random from django.conf import settings from django.urls import reverse from testtools.matchers import Contains...
import datetime from decimal import Decimal from django.contrib.auth.models import User from django.test import TestCase from back_office.models import ClassType, HalaqatClass, Teacher from helpers import generate_random_numbers from students.models import Student class StudentModelTestCase(TestCase): """ T...
# -*- coding: utf-8 -*- import sys, os import unittest sys.path.insert(0, os.path.join('..', 'fivalid')) from validators import ( ValidationError, InvalidTypeError, InvalidValueError, All, Any, ValueAdapter, Not, Failure, Pass, Number, FreeText, Equal, Regex, AllowType, Prefix, Type, Length...
#!/usr/bin/env python #****************************************************************************** # # CS 6421 - Simple Conversion # Execution: python dollarsYen.py portnum # Author: Tim Stamler # Group: Malcolm Goldiner # #****************************************************************************** impor...
import pytest import quantgov.ml import subprocess from pathlib import Path PSEUDO_CORPUS_PATH = Path(__file__).resolve().parent.joinpath('pseudo_corpus') PSEUDO_ESTIMATOR_PATH = ( Path(__file__).resolve().parent .joinpath('pseudo_estimator') ) def check_output(cmd): return ( subprocess.check_o...
from __future__ import absolute_import import fiona from geopandas import read_postgis, read_file from geopandas.tests.util import download_nybb, connect, create_db, \ PANDAS_NEW_SQL_API, unittest, validate_boro_df class TestIO(unittest.TestCase): def setUp(self): nybb_filename, nybb_zip_path = dow...
# -*- coding: utf-8 -*- from __future__ import unicode_literals try: from urlparse import urlparse, parse_qs except ImportError: from urllib.parse import urlparse, parse_qs EMBED_SERVICE_PROVIDERS = [ # Video 'Youtube', 'Vimeo', # Audio ] def process_provider_url(url, exclude_providers=[]):...
# Copyright (C) 2017 Tiancheng Zhao, Carnegie Mellon University class KgCVAEConfig(object): description= None use_hcf = True # use dialog act in training (if turn off kgCVAE -> CVAE) update_limit = 3000 # the number of mini-batch before evaluating the model # how to encode utterance. # bow: ...
#!/usr/bin/env python # Copyright (c) 2017 Okinawa Open Laboratory and others. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE...
# -*- coding: utf-8 -*- """ Copyright (C) 2011 Dariusz Suchojad <dsuch at zato.io> Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """ from __future__ import absolute_import, division, print_function, unicode_literals # stdlib import logging from traceback import format_exc # Django from django.ht...
# -*- coding: UTF-8 -*- # Build customizations # Change this file instead of sconstruct or manifest files, whenever possible. # Since some strings in `addon_info` are translatable, # we need to include them in the .po files. # Gettext recognizes only strings given as parameters to the `_` function. # To avoid initia...
from main import * def test_output_1(): print() res = output("Testfile", 43, True, 3,2,1, False, False) res1 = output("Testfile", 43, True, 3,2,1, False, False) res2 = output("Testfile", 43, True, 3,2,1, False, False) res3 = output("Testfile", 43, True, 3,2,1, False, False) res4 = ...
# # Copyright (c) 2014 # Yoshitaro Makise # # 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. # # This program is distrib...
title = 'Links' class Link: def __init__(self, section, url, name): self.section = section; self.url = url; self.name = name links = [ Link('News', 'https://hackaday.com', 'Hackaday : viz, articles on crazy engineering projects'), Link('News', 'https://news.ycombinator.com', 'Hacker News : a mostly-softwa...
# vi: ts=4 expandtab # # Copyright (C) 2012 Canonical Ltd. # Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P. # Copyright (C) 2012 Yahoo! Inc. # # Author: Scott Moser <scott.moser@canonical.com> # Author: Juerg Haefliger <juerg.haefliger@hp.com> # Author: Joshua Harlow <harlowja@yaho...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Detector.training_log' db.add_column(u'detectors_detector', 'training_log', ...
# EFILTER Forensic Query Language # # Copyright 2015 Google Inc. 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 # # Un...
from django.http import HttpResponse, Http404, HttpResponseRedirect from django.template import RequestContext from django.shortcuts import render_to_response, get_object_or_404 from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse fro...
from easyprocess import Proc from paver.easy import * import paver.doctools import paver.virtual import paver.misctasks from paved import * from paved.dist import * from paved.util import * from paved.docs import * from paved.pycheck import * from paved.pkg import * options( sphinx=Bunch( docroot='docs', ...
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from podium_api.asyncreq import make_request_custom_success, get_json_header_token from podium_api.types.paged_response import get_paged_response_from_json from podium_api.types.lap import get_lap_from_json def make_lap_get(token, endpoint, expand...
# coding=utf-8 #! /usr/bin/python import config import json import train_input import test_input def main(): train_business_dict = {} train_input.get_business(config.train_business, train_business_dict) test_business_dict = {} test_input.get_test_business(config.test_business, test_b...
#!/usr/bin/env python # import libs from types import StringType, ListType import warnings # import classes import analytics.utils.queryengine as q import analytics.utils.misc as misc from analytics.algorithms.algorithmsmap import AlgorithmsMap from analytics.core.map.clustermap import ClusterMap from analytics.core.m...
# This file defines command line commands for manage.py import datetime from app.init_app import app, db, manager from app.models import User, Role @manager.command def init_db(): """ Initialize the database.""" # Create all tables db.create_all() # Add all Users add_users() def add_users(): ...
#!/usr/bin/python # -*- coding: utf-8 -*- from Tkinter import * import tkMessageBox import tkFileDialog import xlrd import os class MainPanel(Frame): def __init__(self,master=None): Frame.__init__(self,master) self.pack(expand = 1, fill='both',padx = 5, pady = 5) self.createWidgets() ...
# -*- coding: utf-8 -*- """ unicode.py is part of Coquery. Copyright (c) 2016, 2017 Gero Kunter (gero.kunter@coquery.org) Coquery is released under the terms of the GNU General Public License (v3). For details, see the file LICENSE that you should have received along with Coquery. If not, see <http://www.gnu.org/lic...
"""All tests for views.""" import os import json from django.core.files import File from django.core.urlresolvers import reverse from django.http import HttpRequest from django.template.loader import render_to_string from django.test import TestCase, RequestFactory from django.contrib.messages import get_messages fro...
#!/usr/bin/env python # coding=utf8 import json import hashlib import hmac import time import requests from . import version from .utils import build_url from .exceptions import APIError, EmailFilterRuleException VERSION = version.__version__ class Sift(object): def __init__(self, api_key, api_secret, env='pro...
import os import pprint from numpy import linspace from numpy.ma import MaskedArray from netCDF4 import Dataset from dilegeometry import DileGeometry class Dile(DileGeometry): def __init__(self, z=0, y=0, x=0, variable=None, attributes=None): self.variable = variable self.attributes = attributes...
# -*- coding: utf-8 -*- UTF_8_ENCODING = "utf-8" ISO_8895_1_ENCODING = "iso-8895-1" WINDOWS_1252_ENCODING = "windows-1252" MAC_ROMAN_ENCODING = "macroman" ASCII_ENCODING = "us-ascii" encodings = (UTF_8_ENCODING, ISO_8895_1_ENCODING, WINDOWS_1252_ENCODING, MAC_ROMAN_ENCODING, ASCII_ENCODING) def getEncoding(filename...
#!/usr/bin/python # -*- Coding:utf-8 -*- # # Copyright (C) 2012 Red Hat, Inc. All rights reserved. # # 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, ...
# Copyright 2011 the Melange 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 law or agreed to in wr...