code
stringlengths
1
199k
import picamera # libreria para camara from time import sleep # para hacer pausa #para acceder a la camara camera = picamera.PiCamera() camera.capture('image.jpg') #toma una foto camera.start_preview() camera.vflip = True camera.hflip = True camera.brightness = 60 camera.start_recording('FlISol.h264') sleep(10) camera...
from setuptools import setup install_requires = [ 'django>1.9', 'django-formtools', ] setup( name='quiz app', version='0.1', author='Marshall Roach', author_email='marshall.roach@gmail.com', description='A simple setup for a django app that demonstrates my knowledge. ', install_requires=...
"""abydos.tests.distance.test_distance_kuhns_viii. This module contains unit tests for abydos.distance.KuhnsVIII """ import unittest from abydos.distance import KuhnsVIII class KuhnsVIIITestCases(unittest.TestCase): """Test KuhnsVIII functions. abydos.distance.KuhnsVIII """ cmp = KuhnsVIII() cmp_no_...
def title(): return "WSF Plugin Example" def description(): return "The Wordpress Sploit Framework plugin is example" def author(): return "0pc0deFR" def payload(payload, method, type_exploit): return payload def parameters(parameters, method, type_exploit): return parameters def exploit(url, method, type_exploit)...
from django.conf.urls.defaults import * from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Example: (r'^blog/', include('blog.urls')), # Uncomment the admin/doc line below to enable admin documentation: # (r'^admin/doc/', include('django.contrib.admindocs.urls')), # U...
"""214. Totient Chains https://projecteuler.net/problem=214 Let φ be Euler's totient function, i.e. for a natural number n, φ(n) is the number of k, 1 ≤ k ≤ n, for which gcd(k,n) = 1. By iterating φ, each positive integer generates a decreasing chain of numbers ending in 1. E.g. if we start with 5 the sequence 5,4,2,1 ...
""" To run this script, type python buyLotsOfFruit.py Once you have correctly implemented the buyLotsOfFruit function, the script should produce the output: Cost of [('apples', 2.0), ('pears', 3.0), ('limes', 4.0)] is 12.25 """ fruitPrices = {'apples':2.00, 'oranges': 1.50, 'pears': 1.75, 'limes':0.75, ...
"""Sample objects for use in tests $Id: test_SampleResourceManager.py 112140 2010-05-07 15:29:36Z tseaver $ """ class ResourceManager(object): """Sample resource manager. This class provides a trivial resource-manager implementation and doc strings to illustrate the protocol and to provide a tool for ...
extra_compile_args = ['-std=c99', '-O3'] #, '-O0'] compiler = 'cc' mpicompiler = 'cc' mpilinker= 'cc' libraries = ['acml'] extra_link_args += ['-dynamic'] include_dirs += ['/usr/lib64/python2.6/site-packages/numpy/core/include'] scalapack = True hdf5 = True define_macros += [('GPAW_NO_UNDERSCORE_CBLACS', '1')] define_m...
from nbodykit.plugins import DataSource from nbodykit.utils.pluginargparse import BoxSizeParser import numpy import logging from nbodykit.utils import selectionlanguage logger = logging.getLogger('PlainText') def list_str(value): return value.split() class PlainTextDataSource(DataSource): """ Class to read ...
import pandas import string PATH_TO_CSV = 'ReducedCSV.csv' PATH_TO_CORRECTED_CSV = 'CorrectedCSV.csv' def correctImperfectionsData(inputFilePath, outputFilePath): outputFile = open(outputFilePath, 'w') outputFile.write('username,date,body,score,subreddit\n') with open(inputFilePath) as inputFile: fo...
import pygame class BaseScreen(object): background_path = "" def __init__(self, context): self.context = context if self.background_path: self.background = pygame.image.load(self.background_path) else: self.background = pygame.Surface(context.screen.get_size()) ...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('spine_core', '0014_auto_20160712_0045'), ] operations = [ migrations.RenameField( model_name='repo', old_name='project', new_...
from django.apps import apps from django.contrib.auth import get_user_model from django.contrib.sites.models import Site from django.test.testcases import TestCase from django.urls import re_path from wiki.conf import settings from wiki.managers import ArticleManager from wiki.models import Article, ArticleRevision, UR...
""" intuition/rrd.py - rrdtool integration support for OWL Intuition. Copyright 2013 Michael Farrell <micolous+git@gmail.com> This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, unified_strdate ) class JoveIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?jove\.com/video/(?P<id>[0-9]+)' _CHAPTERS_URL = 'http://www.jove.com/video-chapters?videoid={video_id:}' _TESTS ...
from __future__ import print_function import sys from numpy import sqrt,fabs,sin,cos,arccos,arctan2,pi,zeros from math import erf xs = 0.0 ys = 0.0 zs = 0.0 xr = 6000.0 yr = 1000.0 zr = 4000.0 station_prefix = "DB.Z1.FX" # e.g., "DB.Z5.FX" -> DB.Z5.FXX.semd,DB.Z5.FXY.semd,DB.Z5.FXZ.semd station_ending = ".semd" rho...
from timeit import default_timer as timer import numpy as np import MORAS as vc import cv2 algs = [vc._SIFT, vc._SURF, vc._ORB, vc._HARRIS, vc._MSER] algsName = ["SIFT", "SURF","ORB", "HARRIS", "MSER"] paths = ['images/graff/img1.png', 'images/boat/img1.png', 'images/ubc/img1.png', 'images/experiments/uni.jpg', 'images...
from __future__ import unicode_literals import time BLOG_AUTHOR = "Arun S" # (translatable) BLOG_TITLE = "arunsr.in" # (translatable) SITE_URL = "https://www.arunsr.in/" BLOG_EMAIL = "me@arunsr.in" BLOG_DESCRIPTION = "The truth shall make you fret." # (translatable) DEFAULT_LANG = "en" TRANSLATIONS = { DEFAULT_L...
from .support import (get_log, chunks, debug_silence, jmprint, joinmarket_alert, core_alert, get_password, set_logging_level, set_logging_color, lookup_appdata_folder, bintohex, bintolehex, hextobin, lehextobin, utxostr_to_utxo, ...
class SvnLump: def __init__(self): self.headers = {} self.header_order = [] self.properties = {} self.content = None def set_header(self, key, value): if key not in self.headers: self.header_order.append(key) self.headers[key] = value def get_heade...
import sys import os STAT_RANGE = "RANGE" STAT_MAXIMUM = "MAXIMUM" STAT_MINIMAL = "MINIMUM" STAT_AVERAGED = "AVERAGED" STAT_NONE = "NONE" HLOSS_CM = "C-M" HLOSS_DW = "D-W" HLOSS_HW = "H-W" OPTIONS = 'OPTIONS' UNITS_CMD = "CMD" UNITS_CMH = "CMH" UNITS_MLD = "MLD" UNITS_LPM = "LPM" UNITS_LPS = "LPS" UNITS_AFD = "AFD" UNI...
import sys sys.path.append('/home/pi/Desktop/ADL/YeastRobot/PythonLibrary') from RobotControl import * deck="""\ SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P SW24P ...
""" Obtained from http://python3porting.com/noconv.html enable unicode support in python 2 and 3. """ import sys if sys.version < '3': import codecs def u(x): return codecs.unicode_escape_decode(x)[0] else: def u(x): return x
def main(): print "Hi." if __name__ == "__main__": main()
from __future__ import absolute_import, division, print_function from dojson.contrib.marc21.utils import create_record from inspire_dojson.experiments import experiments from inspire_schemas.api import load_schema, validate def test_dates_from_046__q_s_and_046__r(): schema = load_schema('experiments') date_prop...
""" Bitmask Command Line interface: mail """ import argparse import sys from leap.bitmask.cli import command class Mail(command.Command): service = 'mail' usage = '''{name} mail <subcommand> Bitmask Encrypted Email Service SUBCOMMANDS: enable Start service disable Stop service ...
""" :mod:`websockets.legacy.server` defines the WebSocket server APIs. """ import asyncio import collections.abc import email.utils import functools import http import logging import socket import sys import warnings from types import TracebackType from typing import ( Any, Awaitable, Callable, Generato...
from horton import * # pylint: disable=wildcard-import,unused-wildcard-import def check_spin(fn_fchk, sz0, ssq0, eps): path_fchk = context.get_fn('test/%s' % fn_fchk) mol = IOData.from_file(path_fchk) olp = mol.obasis.compute_overlap(mol.lf) if hasattr(mol, 'exp_beta'): sz, ssq = get_spin(mol.e...
import pygame import numpy as np import scipy.spatial.distance from numpy.random import random,randint import time screen_size = (1920,1080) pygame.init() screen = pygame.display.set_mode(screen_size) screen.fill((0,0,0)) grid = np.zeros(screen_size) n = 10 hotspots = [np.random.random(2) * screen_size for i in range(n...
import configparser import os class ConfigBibtex(): """ Load bitex files from configuration files :param name: name of the configuration :param location: path of the config directory """ def __init__(self, name='bibtex.conf', location='~/.zimbibliographer'): filename = str(name) ...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Customer', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=Fal...
import github.GithubObject import github.PaginatedList import github.Repository import github.IssueEvent import github.Label import github.NamedUser import github.Milestone import github.IssueComment import github.IssuePullRequest class Issue(github.GithubObject.GithubObject): @property def assignee(self): ...
import re from core import logger from core import scrapertools def test_video_exists(page_url): logger.info("streamondemand.servers.stormo test_video_exists(page_url='%s')" % page_url) data = scrapertools.downloadpage(page_url) if "video_error.mp4" in data: return False, "[Stormo] El archivo no existe o ha...
from django.conf.urls import patterns, include, url from django.conf import settings from django.conf.urls.static import static from django.contrib import admin admin.autodiscover() urlpatterns = patterns( '', url(r'^setlang/$', 'django.views.i18n.set_language', name="setlang"), url(r'^admin/', include(admi...
""" TODO.TXT Timeline View Reporter Based on bidseye.py by Gina Trapani USAGE: timeline.py [todo.txt] USAGE NOTES: Expects a text file as parameter, formatted as follows: - One todo per line, ie, "My big project {start: 2006-12-27} {due: 2006-12-30}" - with starting and due dates as extensions: {start: ...
"""Global Position System (GPS) Coarse Acquisition (C/A) search The Standard Positioning Service (SPS) spec can be found at https://www.navcen.uscg.gov/pubs/gps/sigspec/gpssps1.pdf """ import ca_code from satellite import Satellite import numpy as np class CASearch : def __init__( self, fs, doppler=10000 ) : ...
from genesys.generator import NameGenerator, random_generator second_names = ["Aardvark", "Abyssinian", "Addax", "Affenpinscher", "Akbash", "Akita", "Albatross", "Alligator", "Alpaca", "Anemone Fish", "Angelfish", "Angora", "Anole", "Ant", "Anteater", "Antelope", "Aoudad", "Ape", "Argali...
''' Module db_sql_create.py Creates insert, update, delete sql from dictionaries ''' def dic2sql(table, adic): ''' Returns sql (insert, update, delete) table : The table name adic : dictionary with key names same with table field names Returns : if id = 0, insert sql if id != 0, update s...
import pyphen dic = pyphen.Pyphen(lang='en') print(dic.inserted('Rohit')) print(dic.inserted('xxxx')) dic = pyphen.Pyphen(lang='es') print(dic.inserted('Gema')) print(dic.inserted('David'))
from __future__ import print_function from datetime import datetime, timedelta,timezone import operator import sqlite3 import mdb.circstats import mdb.dtutil import mdb.seed import mdb.util def dbg_list_times(sname, key, sdb, weathdb): #print("Plays of "+sname) cur = sdb.cursor() wcur = weathdb.cursor() ...
from pylab import colorbar import math import pylab import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Rectangle import sys pylab.rc('font', family='serif', size=14) time_per_site = {} visits_per_site = {} L = 10 start_site = "1_1" final_site = "10_10" Gamma_0 = 1. E_bar = 1. beta = 1.0 c...
'''Holds all the tables for our database and whatnot.''' from sqlalchemy import Table, Column, Integer, String, Float from sqlalchemy import MetaData, ForeignKey metadata = MetaData() #~ Column('id', Integer, primary_key=True), #~ Column('name', String), #~ Column('id', Integer, primary_key=True), #~ Column('dri...
from oct2py import octave import timeit octave.addpath('/home/alexander/Documents/MATLAB/matpower6.0') octave.addpath('/home/alexander/Documents/MATLAB/matpower6.0/@opf_model') octave.addpath('/home/alexander/Documents/MATLAB/opf_solvers/minopf5.1_linux') octave.addpath('/home/alexander/Documents/MATLAB/opf_solvers/tsp...
''' Main executable for the "hg_tweetfeeder" Twitter bot. ''' from tweetfeeder import TweetFeederBot from tweetfeeder.flags import BotFunctions def main(): """ Main body for starting up and terminating Tweetfeeder bot """ # pylint: disable=no-member try: bot = TweetFeederBot(BotFunctions.All, "confi...
""" Routines for handling the new-style `.mat` files, which are secretly `.hdf` files """ from __future__ import absolute_import from __future__ import with_statement from __future__ import division from __future__ import nested_scopes from __future__ import generators from __future__ import unicode_literals from __fut...
import re import os keywords = [ '启动自动攻击', 'xxddos', 'phpddos', 'fsockopen("udp:', 'fsockopen("tcp:', '$_get["moshi"]=="udp"' ] whitefilter = [ (['install/svinfo.php'], ['fsockopen("tcp:']), ] def judgeBackdoor(fileCtent): fileCtent = fileCtent.lower() #纯关键词查找-暂不确定后门 for key in keywords: if key in fileCten...
""" ts_seedsplit.py: Seed split/join tests for the test.py test suite """ from mmgen.globalvars import g from mmgen.opts import opt from mmgen.wallet import get_wallet_cls from .ts_base import * ref_wf = 'test/ref/98831F3A.bip39' ref_sid = '98831F3A' wpasswd = 'abc' sh1_passwd = 'xyz' dfl_wcls = get_wallet_cls('mmgen')...
from collections import Counter import dataclasses import datetime import functools import itertools import logging import random from typing import ( Any, Callable, Dict, Iterable, Iterator, List, Optional, Sequence, Tuple, Type, TypeVar, Union, ) from cassandra import C...
import numpy as np import pandas as pd from scipy import signal as spsig from scipy.optimize import curve_fit from scipy.interpolate import interp1d from uncertainties import ufloat, unumpy import peakutils import os from glob import glob from utils import FTDateTime from fittingroutines import gaussian_func from filte...
from mpi4py import MPI import numpy as np from random import randint, seed from time import sleep import sys comm = MPI.COMM_WORLD rank = comm.Get_rank() nranks = comm.Get_size() i_am_root = True if (rank == 0) else False np.set_printoptions(threshold=7) def random_rank_in_range (nentries=3, nmax=nranks): if '...
from sys import exc_info from traceback import format_tb from mako.template import Template from mako.lookup import TemplateLookup import setting class ExceptionMiddleware(object): def __init__(self, app): self.app = app def __call__(self, environ, start_response): application = None try...
import sys import os import math import pytest import grpc import tempfile sys.path.insert(1, os.path.join(sys.path[0], "../../")) import rips import dataroot def test_Launch(rips_instance, initialize_test): assert rips_instance is not None def test_EmptyProject(rips_instance, initialize_test): cases = rips_ins...
from __future__ import unicode_literals name = 'RestAuthCommon' url = 'https://common.restauth.net' import os import re import shutil import sys import unittest from subprocess import PIPE from subprocess import Popen from distutils.command.clean import clean as _clean from setuptools import Command from setuptools imp...
from copy import deepcopy class Query(object): def __init__(self, query=None): if not query: self._query = {'query': {'bool': {'should': [], 'must': [], 'must_not': []}}} else: self._query = query def set_parameter(self, name, value): self._query[name] = value ...
import base64 import hashlib import imghdr import logging import os import shutil import sqlite3 import traceback from basedir import * try: import pyotherside except: pass __appname__ = "harbour-sailfishclub" dbPath = os.path.join(XDG_DATA_HOME, __appname__, __appname__, "QML", "OfflineSt...
""" Wheel-Themes ============= This provides infrastructure for theming support in your Wheel applications. It takes care of: - Loading themes - Rendering their templates - Serving their static media - Letting themes reference their templates and static media """ from __future__ import with_statement import itertools i...
""" NamesOfGod Version para Python 2 """ __author__ = "Jose Miguel Garrido" __copyright__ = "(C) 2016 Jose Miguel Garrido" """ 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 L...
""" ========= Tool Tree ========= A ToolTree widget presenting the user with a set of actions organized in a tree structure. """ import enum from typing import Any, Dict, Tuple, List, Optional from AnyQt.QtWidgets import ( QTreeView, QWidget, QVBoxLayout, QSizePolicy, QStyle, QAction, ) from AnyQt.QtGui import QSta...
""" This example shows how to make a scatter plot from an application-oriented perspective. The results are comparable to the basic_script example, but the framework is readily extensible for further use. Relevant tutorial section: http://docs.enthought.com/chaco/user_manual/chaco_tutorial.html#scatter-plots """ from t...
import sys sys.path.append('/home/pi/Desktop/ADL/YeastRobot/PythonLibrary') from RobotControl import * deck="""\ DW96W DW96W DW96W BLANK BLANK BLANK BLANK DW96W DW96W DW96W BLANK BLANK BLANK BLANK DW96W DW96W DW96W BLANK BLANK BLANK BLANK BLANK BLANK BLANK BLANK BLANK BLANK BLANK """ OffsetDict={0: 'UL', 1: 'UR...
''' featherweight – A lightweight terminal news feed reader Copyright © 2013, 2014, 2015 Mattias Andrée (maandree@member.fsf.org) 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 t...
md4_test= [ ('', 0x31d6cfe0d16ae931b73c59d7e0c089c0), ("a", 0xbde52cb31de33e46245e05fbdbd6fb24), ("abc", 0xa448017aaf21d8525fc10ae87aa6729d), ("message digest", 0xd9130a8164549fe818874806e1c7014b), ("abcdefghijklmnopqrstuvwxyz", 0xd79e1c308aa5bbcdeea8ed63df412da9), ("ABCDEFGH...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('erudit', '0069_auto_20170418_1227'), ] operations = [ migrations.RemoveField( model_name='article', name='publication_allowed_by_...
""" Copyright Nathan Hughes 2015 This file is part of code developed for the Music Perception and Robotics Laboratory at Worcester Polytechnic Institute. This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Fre...
from copy import deepcopy import json class Command(object): def run(self, game, *a): pass def repr(self, game): pass def undo(self, game): pass class UndoCommand(Command): sig = "undo" doc = "Undoes the last command you gave." def run(self, game): transparent = True while transp...
from __future__ import unicode_literals from django.db import migrations import markdownx.models class Migration(migrations.Migration): dependencies = [ ('devblog', '0002_post_contentspecial'), ] operations = [ migrations.RemoveField( model_name='post', name='contentS...
import cv2 import os import numpy as np from random import randint """ This script was used to narrow down the classification script. Basically we ran this over the directories that were already classified to get a more zoomed in image. Source referenced: K-means http://docs.opencv.org/3.0-beta/doc...
from __future__ import unicode_literals import os import sys sys.path.append(os.curdir) from pelicanconf import * SITEURL = 'http://karthur.org' RELATIVE_URLS = False FEED_ALL_ATOM = 'feeds/all.atom.xml' CATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml' DELETE_OUTPUT_DIRECTORY = True GOOGLE_ANALYTICS = 'UA-64322630-1'
__author__ = 'nexhero' import urllib2 import json API_V1 = "http://www.wikia.com/api/v1/" class wikia: def __init__(self): def_ = "something" def wikis(self, query): url = API_V1 + "Wikis/ByString?expand=1&string="+ query +"&limit=25&batch=1&includeDomain=true&lang=en" res = urllib2.urlo...
import os import getpass import json from jinja2 import Environment, PackageLoader from .utils import get_sites, get_config, update_config env = Environment(loader=PackageLoader('bench', 'templates'), trim_blocks=True) def generate_supervisor_config(bench='.'): template = env.get_template('supervisor.conf') bench_dir...
import os import logging import re class FastaFileIndexer(object): def __init__(self, filename, logLevel='ERROR'): """FastaIndexer constructor""" self.logLevel = logLevel logging.basicConfig(level=logLevel) self.filename = filename self.lSeq = [] self.dSeq = {} ...
"""djmessenger URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('statisticscore', '0030_auto_20161223_1754'), ] operations = [ migrations.CreateModel( name='Announcement', fields=[ ('id', models.AutoField(auto_created=...
""" HDF5 data manager for WEST. Original HDF5 implementation: Joe Kaus Current implementation: Matt Zwier WEST exclusively uses the cross-platform, self-describing file format HDF5 for data storage. This ensures that data is stored efficiently and portably in a manner that is relatively straightforward for other analys...
import sys import io MAX_PARAMS = int(sys.argv[1]) tl_ctors = ''' template<class T, template<typename> class Alloc, %targs%> inline void* type_ctor(%fargs%) { Alloc<T> a; void* p = a.allocate(1); new(p) T(%args%); return p; } ''' tl_dtor = ''' /////////////////////////////////////////////////////////////////////////...
import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, GdkPixbuf from xdg import BaseDirectory import os import json import sys __appname__ = 'pappymenu' __version__ = (0, 1) __source__ = 'http://github.com/Kingdread/pappymenu' command_string = None def cache_path(): """Return the path of the cac...
__version__ = '0.1.13'
""" Este controller realiza ações sobre as categorias, isso inclui cadastrar, alterar, deletar, visualizar e visualizar tudo """ from restAPI import app, db from flask_restful import reqparse, Resource, Api from restAPI.models.models_categorias import CategoriaDatabase, categorias_schema from flask import jsonify api =...
'''! \file inventory.py \package rpgToolDefinitions.inventory \brief definition of data structures for character inventories. \date (C) 2020-2021 \author Marcus Schwamberger \email marcus@lederzeug.de \version 1.0 ''' __version__ = "1.0" __updated__ = "28.12.2020" geartypes = {"en": ["clothes", "tool", "container", "fo...
import re, sys, os, itertools, sets, getopt # Load standard modules I often use import numpy, gzip ''' Takes a directory (-f, <default .>) and cycles through results from -doCounts pos files to compute the average, median, and standard deviation of coverage for each scaffold. Set up to work wiht a specific inter...
import sys, os import math, random import pygame from pygame.locals import * from Engine import * from GameObjects import * from Menu import * USE_ANTIALIAS = True class Game: def __init__(self, screen): self.screen = screen self.sprites = Group() self.clearables = Group() self.aster...
import sys, logging, logging.handlers, re import types def _encoded(s): if isinstance(s, str): return s else: return s.encode('utf-8') IDENTIFIER = re.compile('^[a-z_][a-z0-9_]*$', re.I) def valid_ident(s): m = IDENTIFIER.match(s) if not m: raise ValueError('Not a valid Python id...
""" urllib3 - Thread-safe connection pooling and re-using. """ from __future__ import absolute_import import warnings from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url from . import exceptions from .filepost import encode_multipart_formdata from .poolmanager import PoolManager, Pr...
import os import re from django.conf import settings from django.utils import timezone from django.utils.deprecation import MiddlewareMixin from django.contrib.auth.middleware import RemoteUserMiddleware from mozilla_cloud_services_logger.django.middleware import ( RequestSummaryLogger as OriginalRequestSummaryLogg...
from __future__ import absolute_import, unicode_literals import sys import os import stat import platform import errno import subprocess from mach.decorators import ( CommandArgument, CommandProvider, Command, ) from mozbuild.base import MachCommandBase, MozbuildObject @CommandProvider class SearchProvider(...
__author__ = "Sergio Garcia Prado" __license__ = "MPL-2.0" __version__ = "1.0.0" __maintainer__ = "Sergio Garcia Prado" __email__ = "sergio@garciparedes.me" import json def dict_to_json(dict_data): return json.dumps(dict_data, indent=2, sort_keys=True)
import datetime from socorro.external.postgresql.products import ProductVersions from socorro.lib import datetimeutil from socorro.unittest.external.postgresql.unittestbase import PostgreSQLTestCase class IntegrationTestProductVersionsBase(PostgreSQLTestCase): @classmethod def setUpClass(cls): super(Int...
import magic import sys from pprint import pprint from csirtg_smrt.constants import PYVERSION f = sys.argv[1] def _is_ascii(f, mime): if mime.startswith(('text/plain', 'ASCII text')): return True def _is_xml(f, mime): if not mime.startswith(("application/xml", "'XML document text")): return ...
import os from marionette_driver.errors import JavascriptException from marionette import MarionetteTestCase class TestLog(MarionetteTestCase): def setUp(self): MarionetteTestCase.setUp(self) self.marionette.enforce_gecko_prefs({"marionette.test.bool": True, "marionette.test.string": "testing", "mar...
import datetime import HTMLParser import json import urllib import bleach import jinja2 import pytz from babel import localedata from babel.dates import format_date, format_datetime, format_time from babel.numbers import format_decimal from django.conf import settings from django.contrib.messages.storage.base import LE...
import os import sys import configurations sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "normandy.settings") configurations.setup() from django.contrib.auth.models import User # noqa User.objects.create_superuser("user1", "user1@example...
PIPELINE_CSS = { 'csrf-failure': { 'source_filenames': ( 'css/sandstone/sandstone-resp.less', 'css/csrf-failure.less', ), 'output_filename': 'css/csrf-failure-bundle.css', }, 'about': { 'source_filenames': ( 'css/sandstone/video-resp.less',...
import os import logging import json import socket import uuid from urllib import urlencode from urlparse import urlparse, urlunparse import anykeystore import velruse from pyramid import security from pyramid import httpexceptions from pyramid.events import subscriber from pyramid.response import Response from pyramid...
import datetime import pytz from pyramid.view import view_config from substanced.util import Batch from dace.objectofcollaboration.principal.util import get_current from dace.processinstance.core import ( DEFAULTMAPPING_ACTIONS_VIEWS) from pontus.view import BasicView from novaideo.content.novaideo_application impo...
import models import report import wizard
from __future__ import unicode_literals import frappe def execute(filters=None): columns, data = [], [] employee = branch= '' cond = "1=1" if filters: employee, branch = filters.get('employee') or '', filters.get('branch') or '' data = frappe.db.sql(""" select * from ( SELECT e.na...
import xlwt from datetime import datetime from openerp.addons.report_xls.report_xls import report_xls from openerp.addons.report_xls.utils import rowcol_to_cell from openerp.addons.account_financial_report_webkit.report.partners_ledger \ import PartnersLedgerWebkit from openerp.tools.translate import _ _column_size...
import datetime from django.db.models import Q from django.conf import settings from etgen.html import E from lino.api import dd, rt, _ from lino.utils.quantities import ZERO_DURATION from lino.utils import SumCollector from lino_xl.lib.contacts.models import * from lino_xl.lib.contacts.roles import ContactsUser from l...
from django.contrib.syndication.views import Feed from django.core.urlresolvers import reverse from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.utils.html import escape from .models import Comic from .views import single from dashboard.models import SiteOptions from das...