src
stringlengths
721
1.04M
from django.shortcuts import redirect, render, get_object_or_404 from django.core.urlresolvers import reverse from django.utils import timezone from django.contrib import messages from django.contrib.auth.decorators import login_required from blog import models from blog import forms # Create your views here. @login...
#!/usr/bin/python3 ### # Master controller for the TreeMaze. It communicates with the arduino through serial port. # Receives data through GPIO inputs and serial. ### import threading from MazeHeader_PyCMDv2 import * PythonControlSet = ['T2','T3a','T3b','T3c','T3d','T3e','T3f','T3g','T3h','T3i','T3j', ...
import os.path import string import random import re import wx import wx.stc from contextlib import contextmanager from find_replace_dialog import FindReplaceDetails, FindReplaceDialog from go_to_line_dialog import GoToLineDialog from menu_defs import edit_menu from syntax import syntax_from_filename, syntax_plain fro...
#!/usr/bin/env python3 ############################################################################### # # # Copyright 2019. Triad National Security, LLC. All rights reserved. # # This program was produced under U.S. Government contrac...
# coding=utf-8 import unittest """331. Verify Preorder Serialization of a Binary Tree https://leetcode.com/problems/verify-preorder-serialization-of-a-binary-tree/description/ One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we record the node's value. If it is a nu...
# -*- coding: utf-8 -*- """ Created on Fri May 2 13:49:11 2014 @author: mireland A script for testing... Change this to try out your own analysis. """ import astropy.io.fits as pyfits import numpy as np import matplotlib.pyplot as plt from azimuthalAverage import * # This includes an AO Instrument called "aoinst" ...
# Author: Anthony Baxter """Class representing audio/* type MIME documents. """ import sndhdr from cStringIO import StringIO import MIMEBase import Errors import Encoders _sndhdr_MIMEmap = {'au' : 'basic', 'wav' :'x-wav', 'aiff':'x-aiff', 'aifc':'x-aiff',...
# coding=utf-8 # Copyright 2013 Hewlett-Packard Development Company, L.P. # 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/li...
""" Django settings for test_mezzanine_advanced_admin project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path....
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 Dell 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/lice...
"""Utilities for all Let's Encrypt.""" import collections import errno import os import stat from letsencrypt import errors Key = collections.namedtuple("Key", "file pem") # Note: form is the type of data, "pem" or "der" CSR = collections.namedtuple("CSR", "file data form") def make_or_verify_dir(directory, mode=0...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# -*- coding: utf-8 -*- # 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...
#!/usr/bin/env/ python ################################################################################ # Copyright 2016 Brecht Baeten # This file is part of python-git-package. # # python-git-package is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lic...
#!/usr/bin/env python import os import webapp2 import tba_config from controllers.admin.admin_api_controller import AdminApiAuthAdd, AdminApiAuthDelete, AdminApiAuthEdit, AdminApiAuthManage from controllers.admin.admin_apistatus_controller import AdminApiStatus from controllers.admin.admin_authkeys_controller import ...
#!/usr/bin/env python # ------------------------------------------------------------------- # File Name : predict_from_stream.py # Creation Date : 03-12-2016 # Last Modified : Sun Jan 8 13:33:08 2017 # Author: Thibaut Perol <tperol@g.harvard.edu> # ------------------------------------------------------------------- ""...
#! /usr/bin/env python3 import argparse import misc.automl_utils as automl_utils import misc.parallel as parallel import as_asl.as_asl_command_line_utils as clu import as_asl.as_asl_filenames as filenames import as_asl.as_asl_utils as as_asl_utils from as_asl.as_asl_ensemble import ASaslPipeline import logging impo...
# Generated by Django 2.2.16 on 2020-09-29 21:48 from django.db import migrations, models import django.db.models.deletion import opaque_keys.edx.django.models class Migration(migrations.Migration): dependencies = [ ('lti_consumer', '0001_initial'), ] operations = [ migrations.CreateMod...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import json from odoo import tests from odoo.tools import mute_logger @tests.tagged('post_install', '-at_install') class TestControllers(tests.HttpCase): @mute_logger('odoo.addons.http_routing.models.ir_http', 'o...
"""PGPy conftest""" import pytest import glob try: import gpg except ImportError: gpg = None import os import sys from distutils.version import LooseVersion from cryptography.hazmat.backends import openssl openssl_ver = LooseVersion(openssl.backend.openssl_version_text().split(' ')[1]) gpg_ver = LooseVersio...
#!/usr/bin/python ''' (C) Copyright 2020-2021 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent ''' from data_mover_test_base import DataMoverTestBase from os.path import join class DmvrCopyProcs(DataMoverTestBase): # pylint: disable=too-many-ancestors """Test class for POSIX DataMover mult...
from reportlab.pdfgen import canvas from cStringIO import StringIO from django.http import HttpResponse,Http404,HttpResponseRedirect # from django.shortcuts import render,get_object_or_404 # from django.core.urlresolvers import reverse from django.template import loader, RequestContext #from django.contrib.auth.models ...
#!/usr/bin/env python # 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 the hope that ...
import couchdb from couchdb.design import ViewDefinition class TweetCouch(object): def __init__(self, dbname, url=None): try: self.server = couchdb.Server(url=url) self.db = self.server.create(dbname) self._create_views() except couchdb.http.PreconditionFailed: self.db = self.server[dbname] def _cr...
# from https://github.com/zephod/lego-pi/blob/master/lib/xbox_read.py from os import popen from sys import stdin import re import time s = re.compile('[ :]') class Event: def __init__(self,key,value,old_value): self.key = key self.value = value self.old_value = old_value def is_press...
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger def get_sorted_model(request, model): sort = request.GET.get('sort', None) obj = model if sort == "price_lth": obj = model.order_by('cost_per_unit') elif sort == "price_htl": obj = model.order_by('-cost_per_unit')...
# little grammar for test import os from itertools import chain from pyrser import grammar from pyrser import meta from pyrser import fmt from pyrser.parsing.node import * from pyrser.hooks.echo import * from pyrser.hooks.vars import * from pyrser.hooks.set import * from pyrser.hooks.predicate import * from pyrser.hoo...
import unittest import json import flask import friendsNet.resources as resources import friendsNet.database as database DB_PATH = 'db/friendsNet_test.db' ENGINE = database.Engine(DB_PATH) COLLECTION_JSON = "application/vnd.collection+json" HAL_JSON = "application/hal+json" RATE_PROFILE = "/profiles/rate-profile" #...
#coding=UTF-8 from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext from pyspark.sql.types import * from datetime import date, datetime, timedelta import sys, re, os st = datetime.now() conf = SparkConf().setAppName('PROC_O_AFA_PXY_CRPINFO').setMaster(sys.argv[2]) sc = SparkContext(conf = conf) sc....
# -*- coding: utf-8 -*- """ @file peopleCollection.py @author Nicole Ronald @date 2014-03-17 @version Defines a collection of people who request trips from the demand-responsive transportation system. SUMOoD (SUMO on Demand); see http://imod-au.info/sumood Copyright (C) 2014 iMoD SUMO, Simulation of Urban MOb...
import os, sys, numpy as np, tensorflow as tf from pathlib import Path from termcolor import colored as c, cprint sys.path.append(str(Path(__file__).resolve().parents[1])) import convnet_2_deep __package__ = 'convnet_2_deep' from . import network from tensorflow.examples.tutorials.mnist import input_data mnist = in...
#!/usr/bin/python3 # Copyright (C) 2016 Renan Guilherme Lebre Ramos # This file is a part of smtracker. # # smtracker 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 y...
from datetime import datetime, timedelta TIME_FORMAT = '%H:%M:%S' def calculate_task_execution_timeout(task_time): current_datetime = datetime.now() current_time = get_time_from_datetime(current_datetime) return calculate_delta_time(task_time, current_time) def calculate_task_next_execution_datetime(ta...
"""MUMPy Interpreter The functions in this module represent various functions that may need to be carried out from the command line (including starting the REPL and compiling and executing a routine file). Licensed under a BSD license. See LICENSE for more information. Author: Christopher Rink""" try: # Used by ...
# -*- coding: utf-8 -*- # from __future__ import unicode_literals import os import sys SITE_ROOT = os.path.realpath(os.path.dirname(__file__)) sys.path.append(SITE_ROOT) import local_settings as ls AUTHOR = ls.AUTHOR SITENAME = ls.SITENAME SITEURL = ls.SITEURL PATH = ls.PATH TIMEZONE = ls.TIMEZONE LOCALE = ls.LOCAL...
def extractWanderingmusetranslationWordpressCom(item): ''' Parser for 'wanderingmusetranslation.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None chp_prefixes = [ ('SH Chapter ', 'Swain Hakush...
from django.shortcuts import render #import googlemaps import csv import time import json import requests from django.http import HttpResponse from django import forms from . import models class EnterIDForm(forms.Form): meeting_id = forms.CharField() def validate_trip_id(self): if Meeting.objects.filter(trip_id= ...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ForumUser' db.create_table(u'forumuser_forumuser', ( ...
# -*- coding: utf-8 -*- # # Copyright 2008 - 2019 Brian R. D'Urso # # This file is part of Python Instrument Control System, also known as Pythics. # # Pythics 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, e...
from datetime import datetime import time from twython import TwythonStreamer from fluent import sender from fluent import event import os # for local fluent sender.setup('twitter') class MyStreamer(TwythonStreamer): def save_tweet(self, tweet, tag): event_contents = { 'tweet_id': tweet['i...
# Python imports. from collections import defaultdict import random # Other imports. from simple_rl.pomdp.POMDPClass import POMDP from simple_rl.tasks.maze_1d.Maze1DStateClass import Maze1DState class Maze1DPOMDP(POMDP): ''' Class for a 1D Maze POMDP ''' ACTIONS = ['west', 'east'] OBSERVATIONS = ['nothin...
#!/usr/bin/env python """ Demos of MIMO time encoding and decoding algorithms that use IAF neurons with delays. """ # Copyright (c) 2009-2015, Lev Givon # All rights reserved. # Distributed under the terms of the BSD license: # http://www.opensource.org/licenses/bsd-license import numpy as np # Set matplotlib backe...
from __future__ import unicode_literals import os.path import optparse import shlex import sys from .compat import ( compat_expanduser, compat_getenv, ) from .utils import ( get_term_width, write_string, ) from .version import __version__ def parseOpts(overrideArguments=None): def _readOptions(f...
""" This module contains integer constants from a C header file named something like gl.h. """ GL_DEPTH_BUFFER_BIT = 0x00000100 GL_STENCIL_BUFFER_BIT = 0x00000400 GL_COLOR_BUFFER_BIT = 0x00004000 GL_POINTS = 0x0000 GL_LINES = 0x0001 GL_LINE_LOOP = 0x0002 GL_LINE_STRIP = 0x0003 GL_TRIANGLES = 0x0004 GL_TRIANGLE_STRIP =...
#!/usr/bin/python # This code is simply a wrapper for running gdal commands, without MATLAB # causing issues with dependencies, etc. import sys import os print(sys.argv[0]) action = sys.argv[1] targetfile = sys.argv[2] if action == "merge": print('Mergeing...') # gdalbuildvrt merged.vrt r14bn2.wgs84.tif r1...
# Copyright (c) 2014 VMware, 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 # # Unless required...
# -*- coding: utf-8 -*- # # Gma documentation build configuration file, created by # sphinx-quickstart on Thu Mar 27 09:06:53 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleable ...
from PIL import Image import os, hashlib class IconManager: def __init__(self, icon_index = 0, image_dir = "images"): self.icon_index = icon_index self.image_index = -1 if not icon_index else int(icon_index / 441) self.image_array = [] self.icon_hashes = [] self.image_dir = image_dir # Load images i...
#!/usr/bin/env python from common.dbconnect import db_connect from common.entities import KippoHoneypot from canari.maltego.entities import IPv4Address from canari.maltego.message import Field from canari.framework import configure __author__ = 'catalyst256' __copyright__ = 'Copyright 2014, Honeymalt Project' __credi...
# coding: utf-8 import json from collections import defaultdict from hashlib import md5 from django.core.management.base import BaseCommand from django.db import transaction from ...models import Asset, AssetVersion ROUGH_BATCH_MEM_LIMIT_MB = 100 MAX_BATCH_SIZE = 100 def find_original_and_duplicate_versions(versio...
from flask import Flask, jsonify import threading import zmq import time import logging from Queue import Queue # Clear the Log file if it exists with open("server.log", "w"): pass logging.basicConfig(filename='server.log',level=logging.DEBUG,\ format='%(levelname)s:%(asctime)s %(message)s', datefmt='%m/%...
import datetime as dt import logging import re import urllib import urlparse import uuid from copy import deepcopy from os.path import splitext from flask import Request as FlaskRequest from framework import analytics from guardian.shortcuts import get_perms # OSF imports import itsdangerous import pytz from dirtyfie...
#!/usr/bin/env python # Copyright (c) 2015 Cloudera, 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 # # Unless requir...
# coding:utf-8 """ Tests for student activation and login """ import json import unicodedata import unittest import ddt import six from django.conf import settings from django.contrib.auth.models import User from django.core import mail from django.core.cache import cache from django.http import HttpResponse, HttpResp...
import setuptools with open("space_tracer.md") as f: long_description = f.read() about = {} with open("plugin/PySrc/space_tracer/about.py") as f: exec(f.read(), about) # noinspection PyUnresolvedReferences setuptools.setup( name=about['__title__'], version=about['__version__'], author=about['__aut...
import re import string import urllib.request, urllib.error, urllib.parse from datetime import datetime from lxml import etree def function_name(text, rex=re.compile(r'"name"\s*:\s*"([^"]+)"')): match = rex.search(text) if match: return match.group(1) return None parser = etree.HTMLParser() tree...
""" Container-/OPF-based input OEBBook reader. """ from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>' import sys, os, uuid, copy, re, cStringIO from itertools import izip from urlparse import urldefrag, urlparse from urllib import unquote ...
import pickle import seaborn as sns import string from pudzu.sandbox.markov import * from pudzu.sandbox.bamboo import * from pudzu.charts import * from math import log CORPUS = "wikienglish" TITLE = "Letter and next-letter frequencies in English" SUBTITLE = "measured across 1 million sentences from Wikiped...
"""Unit tests for the Docker feature.""" from ddt import ddt from fauxfactory import gen_string from robottelo import entities from robottelo.cli.docker import Docker from robottelo.cli.factory import ( CLIFactoryError, make_org, make_product, make_repository, ) from robottelo.cli.repository import Repo...
#!/usr/bin/env python #-*- coding: utf-8 -*- from spade.Agent import BDIAgent from spade.Behaviour import OneShotBehaviour, EventBehaviour, ACLTemplate, MessageTemplate from spade.ACLMessage import ACLMessage from spade.AID import aid from spade.SWIKB import SWIKB as KB Overflow = 0.00 ''' TODO: Reimplement agents...
# Number-to-binary game # Copyright (C) 2013 Jonathan Humphreys # 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. # Thi...
# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. NATIVE_LIBRARIES_TEMPLATE = """\ // This file is autogenerated by // build/android/gyp/write_native_libraries_java.py // Please do not change its content...
#!/usr/bin/env python # coding=utf-8 """The gitsome installer.""" from __future__ import print_function, unicode_literals import os import sys try: from setuptools import setup, find_packages from setuptools.command.sdist import sdist from setuptools.command.install import install from setuptools.comman...
# Copyright 2016 Autodesk Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re import string from multiprocessing.pool import ThreadPool from urlparse import urlparse, parse_qs import unicodedata import pafy from mopidy import backend from mopidy.models import SearchResult, Track, Album import pykka import requests from ...
Openness = ['Adventurousness','Artistic interests','Emotionality','Imagination','Intellect','Authority-challenging'] Conscientiousness = ['Achievement striving','Cautiousness','Dutifulness','Orderliness','Self-discipline','Self-efficacy'] Extraversion = ['Activity level','Assertiveness','Cheerfulness','Excitement-seeki...
""" Utility routines """ from collections.abc import Mapping from copy import deepcopy import json import itertools import re import sys import traceback import warnings import jsonschema import pandas as pd import numpy as np from .schemapi import SchemaBase, Undefined try: from pandas.api.types import infer_dt...
from flask import abort, request, Response, Blueprint import datetime import logging import re from pebbles.models import InstanceToken from pebbles.server import restful authorize_instances = Blueprint('authorize_instances', __name__) class AuthorizeInstancesView(restful.Resource): def get(self): toke...
# Copyright (C) 2020 OpenMotics BV # # 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 the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribu...
# The MIT License (MIT) # # Copyright (c) 2016 Scott Shawcroft for Adafruit Industries # # 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 ...
import utils import re from multiprocessing import Process, Queue import callbacks def libraryDirs(): out,err=utils.call('.','ld','--verbose') return re.findall('SEARCH_DIR\("=([^"]+)"\);',out) def listAllPackages(): res=set() try: all,err=utils.call('.','pkg-config','--list-all') lin...
''' Created on Feb 24, 2016 @author: Daniel Rivas ''' from django.db import models from django.utils.translation import ugettext_lazy as l_ from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django_markdown.models import MarkdownField from ...
''' Generic Sweep script (currently setup for no more than 3 dims) 20/10/2015 - B ''' #import numpy as np from time import time, sleep from parsers import copy_file from ramp_mod import ramp from DataStorer import DataStoreSP # , DataStore2Vec, DataStore11Vec # Drivers from dummydriver import instrument as dummy from...
import click import sys, os from bench.config.common_site_config import get_config from bench.app import pull_all_apps, is_version_upgrade from bench.utils import (update_bench, validate_upgrade, pre_upgrade, post_upgrade, before_update, update_requirements, backup_all_sites, patch_sites, build...
# coding=utf-8 # # 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 # di...
'''BaseBatch module BaseBatch is used by SpriteBatch and BlockBatch. ''' from abc import ABC, abstractmethod from os import path import math from vulk import PATH_VULK_SHADER from vulk import vulkanconstant as vc from vulk import vulkanobject as vo from vulk import vulkanutil as vu from vulk.graphic import mesh as me...
# Standard library imports import json import uuid import time from bson import ObjectId from operator import truth from bson.binary import Binary from contextlib import contextmanager from datetime import datetime, timedelta from itertools import islice, repeat, starmap, takewhile # Third party imports import gevent ...
# Create your views here. from django.http import HttpResponse,HttpResponseRedirect from django.shortcuts import render, get_object_or_404 from accounts.models import Employee, PhoneNo, Skill, HasSkill from django.core.urlresolvers import reverse from django.contrib.auth.hashers import make_password, check_password fro...
#!python """Script for plotting distributions of epitopes per site for two sets of sites. Uses matplotlib. Designed to analyze output of epitopefinder_getepitopes.py. Written by Jesse Bloom.""" import os import sys import random import epitopefinder.io import epitopefinder.plot def main(): """Main body of sc...
import numpy as np class Node(object): """ Base class for nodes in the network. Arguments: `inbound_nodes`: A list of nodes with edges into this node. """ def __init__(self, inbound_nodes=[]): """ Node's constructor (runs when the object is instantiated). Sets pro...
from datetime import datetime, timedelta from flask import url_for, json from chaosmonkey.api.hal import Document import test.attacks.attack1 as attack1_module import test.planners.planner1 as planner1_module valid_request_body = { "name": "Test Planner", "attack": { "ref": "test.attacks.attack1:Attack...
import numpy as np import numpy.random import matplotlib.pyplot as plt import cPickle as pickle import MySQLdb from wsd.database import MySQLDatabase import matplotlib.cm as cm from matplotlib.colors import LogNorm, Normalize, BoundaryNorm, PowerNorm from conf import * from matplotlib import style style.use('acm-3c...
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
# -*- coding: utf-8 -*- """ Created on Tue Aug 25 13:08:19 2015 @author: jgimenez """ from PyQt4 import QtGui, QtCore from run_ui import Ui_runUI from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile import os from reset import * from time import localtime, strftime, struct_time from logTab import ...
from nanpy import (ArduinoApi, SerialManager, Tone) from time import sleep #Connect to Arduino. Automatically finds serial port. connection = SerialManager() speaker = 14 #AO on Arduino tone = Tone(speakerpin, connection) #Setting "tone" to mean using the "speaker" pin on the "connection". See tone library in Na...
#!/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://...
from __future__ import absolute_import from sentry.testutils import APITestCase from django.core.urlresolvers import reverse class UserListTest(APITestCase): def test_lookup_self(self): user = self.create_user(email='a@example.com') self.login_as(user=user) url = reverse( '...
import itertools import os import numpy as np from numpy.testing import (assert_equal, assert_allclose, assert_, assert_almost_equal, assert_array_almost_equal) from pytest import raises as assert_raises import pytest from scipy._lib._testutils import check_free_memory from numpy import arr...
from __future__ import unicode_literals import os from django.conf import settings from django.contrib.staticfiles.finders import find from assetfiles.filters import BaseFilter, CommandMixin, ExtensionMixin import assetfiles.settings from assetfiles.exceptions import SassFilterError class SassFilter(ExtensionMixin...
import os, sys import logging import traceback from django.conf import settings from datetime import datetime import time # make things easier so people don't have to install pygments try: from pygments import highlight from pygments.lexers import HtmlLexer from pygments.formatters import HtmlFo...
from slumbercache import exceptions _SERIALIZERS = { "json": True, "yaml": True, } try: import json except ImportError: _SERIALIZERS["json"] = False try: import yaml except ImportError: _SERIALIZERS["yaml"] = False class BaseSerializer(object): content_types = None key = None ...
import os, sys from common_converter import * _template = """ import yaml, traceback import RTC import OpenRTM_aist _data = $CONSTRUCTOR _port = OpenRTM_aist.OutPort("$NAME", _data) def convert(data, d_list): it = iter(d_list) $CODE print 'converted:', data return data def _sendData(d_list): convert(_dat...
# -*- coding: utf-8 -*- ############################################################################## # Copyright (C) 2012 SICLIC http://siclic.fr # # 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 the Fr...
###################################################################### ## ## Copyright (C) 2007, Blekinge Institute of Technology ## ## Filename: goto_next_line.py ## Author: Simon Kagstrom <ska@bth.se> ## Description: Peephole template ## ## $Id: memory-getstatic.py 14142 2007-03-10 18:54:28Z ska $ ## #...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import codecs from setuptools import setup def read(fname): file_path = os.path.join(os.path.dirname(__file__), fname) return codecs.open(file_path, encoding='utf-8').read() setup( name='vtky', packages=['vtky'], version='0.1.0', autho...
# -*- coding: utf-8 -*- import newrelic.agent from django.core.exceptions import PermissionDenied from django.http import HttpResponseRedirect from django.shortcuts import render from constance import config from kuma.attachments.forms import AttachmentRevisionForm from kuma.attachments.models import Attachment from...
# plugin/noseplugin.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Enhance nose with extra options and behaviors for running SQLAlchemy tests. M...
#!/usr/bin/env python __author__ = 'Stephen P. Henrie' import unittest, os, gevent, platform, simplejson from mock import Mock, patch from pyon.util.int_test import IonIntegrationTestCase from pyon.util.containers import get_ion_ts from nose.plugins.attrib import attr from pyon.util.context import LocalContextMixi...
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.catalog.CatalogBasketItem from panda3d.core import Datagram import CatalogItem from toontown.estate import GardenGlobals from toontown.toonbase import ToontownGlobals from direct.actor import Actor from toontown.toonbase import TTLocalizer from ...
#!/usr/bin/env python3 #-*- coding:utf-8 -*- ############################################################### # CLAM: Computational Linguistics Application Mediator # -- CLAM Wrapper script for Text Statistics -- # by Maarten van Gompel (proycon) # http://ilk.uvt.nl/~mvgompel # Induction for Linguisti...