text
stringlengths
12
6.59M
# Natural Language Toolkit: Text Trees # # Copyright (C) 2001 University of Pennsylvania # Author: Edward Loper <edloper@gradient.cis.upenn.edu> # URL: <http://nltk.sf.net> # For license information, see LICENSE.TXT # # $Id$ # To do: # - How should we handle traces and/or movement? """ Classes for representing hie...
#!/usr/bin/env python #import serial import time, sys import datetime import libPiLite as lpl #s = serial.Serial() #s.baudrate = 9600 #s.timeout = 0 #s.port = "/dev/serial0" #try: # s.open() #except serial.SerialException, e: # sys.stderr.write("Could not open port %r: %s\n" % (s.port, e)) # sys.exit(1) # #...
"""RVS URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/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-based ...
# Orca # # Copyright 2010-2011 The Orca Team # # 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 library...
"""Operations used to convert between S-57 abbreviations and -names, vs. Esri NIS FeatureClass, FCsubtype numbers""" # Ver. 1.0.2 # Last edited 2014-01-14 / MaHvi # History # Ver. 1.0.0 - First working version # Ver. 1.0.1 # Cleaned up the variable naming from FSC to FCS # Introduced a test module # Ver. 1.0.2 #...
# -*- coding: utf-8 -*- """core -- core behaviors for Owyl. Copyright 2008 David Eyk. All rights reserved. $Author$\n $Rev$\n $Date$ """ __author__ = "$Author$"[9:-2] __revision__ = "$Rev$"[6:-2] __date__ = "$Date$"[7:-2] try: from mx.Stack import Stack, EmptyError except ImportError: from stack import Stac...
import time from sqlalchemy import create_engine, Table, Column, Integer, String, MetaData, ForeignKey, Boolean, Text from sqlalchemy.exceptions import OperationalError from sqlalchemy.orm import mapper, sessionmaker, relation #for user in session.query(User).filter(User.name=='ed'): # print user #print session.quer...
import os,sys,gzip import pandas as pd import numpy as np import multiprocessing as mp from variantAnnotations import * from Vcf_metadata import * class Vcf(object): ''' Loads in a vcf file, aware of gzipped files. Parameters -------------------------------------- filename: str, require...
import inspect, sys, os, types, time, string _permissionlist = ['admin', 'adminchan', 'mod', 'modchan', 'chanowner', 'chanadmin', 'chanpublic', 'public', 'battlehost', 'battlepublic'] _permissiondocs = { 'admin':'Admin Commands', 'adminchan':'Admin Commands (channel)', 'mod':'Moderator Commands'...
import os import os.path import re import subprocess latexEngine = "xelatex" # Output path outputPath = "." if not os.path.exists(outputPath): os.makedirs(outputPath) pdfBookPath = os.path.join(outputPath, "book.pdf") texBookPath = os.path.join(outputPath, "book.tex") chapters = [] def injectShaderBlocks( _folder...
# Details: Proc and data access method text generator for Dealspan referential data # Author: Jon Fast # Last Modified: 9/29/2014 import re import pymssql # common delimiters commaDelim = ', ' commaNewLineDelim = ', \n' slashDelim = '/' # DealSpan proc names (imported from database) tableNames = [] procNames = [] # ...
#!/usr/bin/python #system includes import sys #library includes import cv import numpy as np #an abstract Camera class, for handling multiple types of video input class FrameSource: def __init__(self): return def getPropery(self, p): return None def getAllProperties(self): return {} def getIm...
# -*- coding: utf-8 -*- # MusicPlayer, https://github.com/albertz/music-player # Copyright (c) 2012, Albert Zeyer, www.az2000.de # All rights reserved. # This code is under the 2-clause BSD license, see License.txt in the root directory of this project. from utils import UserAttrib, Event, initBy import Traits # Note...
#! /usr/bin/env python ############################################################################## ## pyvolve: Python platform for simulating evolutionary sequences. ## ## Written by Stephanie J. Spielman (stephanie.spielman@gmail.com) #############################################################################...
#!/usr/local/bin/python import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk import os import shutil import re from partition_handler import partition_repos, disk_query, Delete_partition from partition_handler import partition_query, label_query, bios_or_uefi from partition_handler import autoDiskP...
# Here's a probably-not-very-good port of the Adafruit Arduino library for # this sensor. The Adafruit library is located here: # https://github.com/adafruit/Adafruit_TCS34725 # This port is for the Beaglebone Black and the Adafruit_BBIO and Adafruit_I2C # libraries. By AKA MEDIA SYSTEM from Adafruit_I2C import Adafru...
#! /usr/bin/python # -*- coding: cp932 -*- #this Python script is used to parse MPEG-2 TS stream # #Author: Zhaohui Guo (guo.zhaohui@gmail.com) #Copyright(c)2012 Zhaohui GUO """this script is used to parse MPEG-2 TS stream. """ import sys import struct import Tkinter import tkMessageBox import tkFileDialog import sys...
#!/usr/bin/python """ A messaging program between two Linux systems, optimized for the raspberry pi running raspbian OS. 2014 Nate Fischer, Ivan De Dios """ import subprocess # for function calls import os import sys # for arg parsing import string import re # for searching import time import d...
dados_Veiculos = {} veiculos_alugados = {} DB_Veiculos = "DB_Veiculos.dat" DB_Veiculos_alugados = "DB_Veiculos_alugados.dat" class newCarro(object): def __init__(self, nome_veiculo, cor_veiculo, ano_veiculo, preco_veiculo, placa_veiculo, renavam_veiculo, km_rodados): self.nome_veiculo = no...
''' FileBrowser ====== The :class:`FileBrowser` widget is an advanced file browser. You use it similarly to FileChooser usage. It provides a shortcut bar with links to special and system directories. When touching next to a shortcut in the links bar, it'll expand and show all the directories within that directory. It...
""" Logical Expression Microframework (WIP). """ class PropertyType(type): """ Property type is used to generate Property objets. """ def __getattr__(self, name): return Property(name) def __setattr__(self, name): raise AttributeError('PropertyType is read-only') #FIXME: exception ...
import httplib2 # TODO: require 2.0+ version of simplejson that doesn't provide unicode keys import simplejson import logging from urlparse import urljoin import types # TODO configurable? BASE_URL = 'http://127.0.0.1:8080/' class RemoteObject(object): fields = {} def __init__(self, **kwargs): self.i...
# -*- coding: utf-8 -*- #details how to set global SVN variables can be found in http://blogchuck.com/2009/09/adding-svn-headers-revisited/ ''' # Copyright (C) 2012-2013 Alexander Loew, alexander.loew@zmaw.de # See COPYING file for copying and redistribution conditions. # # This program is free software; you can redi...
from __future__ import with_statement # with statement in Python 2.5 # mex_builder.py: Matlab extension builder # # by Marc Joliet, marcec@gmx.de, 2010.04.22 # (loosely based on mex.py by Joe VanAndel, vanandel@ucar.edu, 2010/1/15) # # This is a little SCons builder tool that finds Matlabs installation directory # an...
import datetime import json import re import os import time from zashel.winhttp import Requests from functools import partial, wraps from math import floor LOCALPATH = os.path.join(os.environ["LOCALAPPDATA"], "zashel", "gapi") # SCOPES class SCOPE: BLOGGER = "https://www.googleapis.com/auth/blogger" ...
#!/usr/local/bin/python # $Id$ # Simple Gnuplot interface. # Written by Michael Haggerty <mhagger@blizzard.harvard.edu> # Derived from earlier version by Konrad Hinsen <hinsen@ibs.ibs.fr> # New restrictions: # Can only plot 2-d numeric arrays or python sequences which are # convertable (via Numeric.asarray) to such...
"""distutils The main package for the Python Module Distribution Utilities. Normally used from a setup script as from distutils.core import setup setup (...) """ # Distutils version # # Updated automatically by the Python release process. # #--start constants-- __version__ = "3.4.0rc2" #--end constants--
# -*- encoding: utf-8 -*- from . import makers
"""Anharmonic modes module for ASE Docs follows Google's python styling guide: http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html Developed by Keld Lundgaard -- keld.lundgaard@gmail.com Supervised by Thomas Bligaard Other contributers: Thomas Nygaard """ from __future__ import division impo...
from SCons.Environment import * from SCons.Script import * import sys from time import * import atexit import os import socket import string import subprocess import autoconf import compiler from utils import * from utils.colors import * class SConsProject: ''' This is a base class helper for SCons build tool. ...
import types import xml.parsers.expat import numpy as np import Bio.SeqIO import seqtools # import refseq # import sequtils # import alignment # import clustering # import LSF # import params # import analysis # =================== # = DATA STRUCTURES = # =================== class ImmuneChain(object): """Dat...
from chap3_the_vector.vec import Vec from chap5_the_matrix.vec import Mat
''' Graph ====== The :class:`Graph` widget is a widget for displaying plots. It supports drawing multiple plot with different colors on the Graph. It also supports a title, ticks, labeled ticks, grids and a log or linear representation on both the x and y axis, independently. To display a plot. First create a graph w...
#!/usr/local/bin/python -tO # $Id$ # A more complicated gnuplot interface. # Written by Michael Haggerty <mhagger@blizzard.harvard.edu> # Derived from earlier version by Konrad Hinsen <hinsen@ibs.ibs.fr> # New features: # + A gnuplot session is an instance of class `gnuplot', so multiple # sessions can be open...
"""SConsProject The SConsProject module proposes a way to easily create the compilation system of your project with the minimum of information. It's an helper around SCons. """ from SCons.Environment import * from SCons.Script import * import sys from time import * import atexit import os import socket import strin...
import base64 import email.utils import os import smtplib import string import time import zlib from Crypto import Random from Crypto.Cipher import Blowfish from Crypto.Hash import SHA from Crypto.Random import random from email.mime.text import MIMEText from flask import Flask, render_template, request, redirect, url_...
import datetime from openedoo.core.libs import (render_template, redirect, request, session, blueprint) from openedoo import db from database import User from flask import jsonify from faker import Faker from .forms import Login fake = Faker() module_employee = blueprint('module_employ...
__all__ = ('Collide2DPoly', 'CollideBezier', 'CollideEllipse') __version__ = '0.1-dev' from .collider import Collide2DPoly, CollideEllipse, CollideBezier if __name__ == '__main__': from kivy.app import App from kivy.uix.widget import Widget from kivy.graphics import Line, Color, Rectangle from kivy...
# This file is part of the kivy-garden project. # Copyright (c) 2014 Zachary Spector, zacharyspector@gmail.com # Available under the terms of the MIT license. """Several textures superimposed on one another, and possibly offset by some amount. In 2D games where characters can wear different clothes or hold different ...
import types import xml.etree.cElementTree as ElementTree import numpy as np import Bio.SeqIO import seqtools # import refseq # import sequtils # import alignment # import clustering # import LSF # import params # import analysis # =================== # = DATA STRUCTURES = # =================== class ImmuneChain...
''' MoreTransitions ====== Usage: Import the transitions and use them with the ScreenManager class. from kivy.garden.moretransitions import PixelTransition,RippleTransition, BlurTransition,RVBTransition screenManager = ScreenManager(transition=PixelTransition()) ...
import numpy as np from netCDF4 import Dataset import sh from collections import OrderedDict def create_variable(data, dimentions, hasunlimdim, datatype, FillValue, attributes): ''' Create dictionary that contain information nessesary for creation of the netCDF variable. INPUT: ...
''' RouletteScrollEffect =================== This is a subclass of :class:`kivy.effects.ScrollEffect` that simulates the motion of a roulette, or a notched wheel (think of Wheel of Fortune). It is primarily designed for emulating the effect of the iOS and android date pickers. Usage ----- Here's an example of using...
# coding=utf-8 from .mapview import *
# -*- coding: UTF-8 -*- import gtk import math from math import * import hashlib import ui # I knew this app was going to borrow heavily from Lybniz, but this # is going to get ridiculous... I'm going to have to figure everything # out before I can pull it apart and get it back together again. # Anyway, this next ...
from src.wayterm import Wayterm import os import cmd import readline class Console(cmd.Cmd): def __init__(self): cmd.Cmd.__init__(self) self.prompt = "wayterm > " ## Command definitions ## def do_hist(self, args): """Print a list of commands that have been entered""" print...
# Standard library imports import concurrent.futures import functools import logging import os import time import numpy as np import pandas as pd import algo import helper import robinhood # Activate logging! logging.basicConfig(level=logging.INFO) MAX_IN_ONE = 1.0 / 12.0 EQUITY_UTILISATION = 0.99 BUY_LIMIT = 1.0 +...
# -*- coding:utf8 -*- ''' dsf module for working with the local filesystem @author: Stuart Herbert <stuart@stuartherbert.com> https://devsetup.systems/dsf-framework/ ''' import os import shutil import time import dsf def file_pair(source_file, target_file, cache_for=3600, cwd=None): retval = FilePair(source_file...
'''Ablation study''' import os import sys import time import numpy from trainModel import * def subsample_data(x,y,frac): """Take first frac of data""" n_data = x.shape[0] n_samples = int(n_data*frac) return x[:n_samples,:], y[:n_samples] def run(frac, model): # Parameters tf.reset_default_graph() opt = {...
import csv import glob from django.core.management.base import BaseCommand, CommandError class Command(BaseCommand): args = '' help = 'Converts HSCIC data files into the format needed for our SQL COPY ' help += 'statement. We use COPY because it is much faster than INSERT.' def add_arguments(self, pa...
# Copyright 2015 Carnegie Mellon University # Author: Yihan Wang <wangff9@gmail.com> # # 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 ...
#!/bin/env python # (c) Copyright 2014-2016 Hewlett Packard Enterprise Development Company LP # # 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/licen...
# -*- coding: utf-8 -*- import time from pgoapi.utilities import f2i from pokemongo_bot import logger from pokemongo_bot.constants import Constants from pokemongo_bot.human_behaviour import sleep from pokemongo_bot.worker_result import WorkerResult from utils import distance, format_time class SeenFortWorker(object...
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2013 Red Hat, 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 r...
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2013 Red Hat, 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 r...
#!/usr/bin/env python # Mosflm.py # Copyright (C) 2006 CCLRC, Graeme Winter # # This code is distributed under the terms and conditions of the # CCP4 Program Suite Licence Agreement as a CCP4 Library. # A copy of the CCP4 licence can be obtained by writing to the # CCP4 Secretary, Daresbury Laboratory, Warrin...
__all__ = ['workflow_oscillator_strength'] from collections import namedtuple from itertools import chain from noodles import (gather, schedule) from nac.common import ( Matrix, Tensor3D, Vector, change_mol_units, getmass, h2ev, retrieve_hdf5_data, search_data_in_hdf5, store_arrays_in_hdf5, triang2mtx) fr...
#!/usr/bin/env python # Mosflm.py # Copyright (C) 2006 CCLRC, Graeme Winter # # This code is distributed under the BSD license, a copy of which is # included in the root directory of this package. # # 23rd June 2006 # # A wrapper for the data processing program Mosflm, with the following # methods to provide fu...
# Copyright 2012 OpenStack Foundation # 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 requ...
#!/usr/bin/env python #-*- coding: utf-8 -*- """ logo_keeper puts feed logos into database """ # @author chengdujin # @contact chengdujin@gmail.com # @created Oct. 29, 2013 import sys reload(sys) sys.setdefaultencoding('UTF-8') sys.path.append('../..') from config.settings import Collection from config.settings imp...
# Copyright 2014, Red Hat, 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 ...
############################################################################## # # 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...
""" This module implements some standard regression models: OLS and WLS models, as well as an AR(p) regression model. Models are specified with a design matrix and are fit using their 'fit' method. Subclasses that have more complicated covariance matrices should write over the 'whiten' method as the fit method prewhi...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals """ This module provides so-called "strategies" to determine the coordination environments of an atom in a structure. Some strategies can favour larger or smal...
#!/usr/bin/python #Copyright (C) 2009 Gabes Jean, naparuba@gmail.com # #This file is part of Shinken. # #Shinken 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 yo...
"""======================================== RNA-Seq Differential expression pipeline ======================================== :Author: Andreas Heger :Release: $Id$ :Date: |today| :Tags: Python The RNA-Seq differential expression pipeline performs differential expression analysis. It requires three inputs: 1 one o...
import os import Queue import RPi.GPIO as GPIO import settings import time import threading import traceback import sys BASE_PATH = os.path.dirname(os.path.realpath(__file__)) UPPER_PATH = os.path.split(os.path.dirname(os.path.realpath(__file__)))[0] DEVICES_PATH = "%s/Hosts/" % (BASE_PATH ) THIRTYBIRDS_PATH = "%s/t...
from collections import OrderedDict from dateutil.rrule import rrule, MONTHLY from django.http.response import Http404 from memoized import memoized from custom.icds_reports.const import AADHAR_SEEDED_BENEFICIARIES from custom.icds_reports.sqldata.agg_awc_monthly import AggAWCMonthlyDataSource from custom.icds_report...
""" encountered an error that required manually loading the module sudo modprobe i2c_bcm2708 """ import os import Queue import settings import time import threading import traceback import sys BASE_PATH = os.path.dirname(os.path.realpath(__file__)) UPPER_PATH = os.path.split(os.path.dirname(os.path.realpath(__file...
from flask_jwt_extended import jwt_required from zou.app.models.comment import Comment from zou.app.services import ( deletion_service, notifications_service, persons_service, tasks_service, user_service ) from zou.app.utils import permissions from .base import BaseModelResource, BaseModelsResour...
import os import mock from datetime import date from dateutil.relativedelta import relativedelta from xml.etree import ElementTree from django.test import TestCase from casexml.apps.case.mock import CaseFactory from corehq.util.test_utils import TestFileMixin from corehq.apps.userreports.sql import IndicatorSqlAdapter ...
import time from zstacklib.utils import http from zstacklib.utils import log from zstacklib.utils import thread from zstacklib.utils import linux logger = log.get_logger(__name__) class ProgressReportCmd(object): def __init__(self): self.progress = None self.processType = None self.resourc...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from os import environ as env from {{cookiecutter.app_name}}.apps.www import www from {{cookiecutter.app_name}}.apps.users import users def as_bool(key, default): return env.get(key, str(default)).lower() \ in ("yes", "true", "t", "1") class Defau...
""" Trigger the conda-forge.github.io Travis job to restart. """ import os import requests import six import conda_smithy.ci_register def rebuild_travis(repo_slug): headers = conda_smithy.ci_register.travis_headers() # If we don't specify the API version, we get a 404. # Also fix the accepted content...
# Copyright 2015 Jarrod N. Bakker # # 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 writ...
# coding=utf-8 import logging import time class HarajsTime(object): """ Converting the string date to time using 'GMT'. """ tm_minute = 0 tm_hour = 0 tm_day = 0 tm_week = 0 tm_month = 0 tm_year = 0 lang = [ "دقيقه", # "minute" "ساعه", # "hour" "يوم", ...
# coding=utf-8 import logging import time class HarajsTime(object): """ Converting the string date to time using 'GMT'. """ tm_minute = 0 tm_hour = 0 tm_day = 0 tm_week = 0 tm_month = 0 tm_year = 0 lang = [ "دقيقه", # "minute" "ساعه", # "hour" "يوم", ...
""" LeenO - modulo di gestione dialoghi """ import threading import LeenoUtils import pyleeno as PL import Dialogs from com.sun.star.awt.MessageBoxButtons import BUTTONS_OK # from com.sun.star.awt.MessageBoxButtons import BUTTONS_OK_CANCEL from com.sun.star.awt.MessageBoxButtons import BUTTONS_YES_NO # from com....
# Copyright 2016 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. import collections import logging import os import traceback from google.appengine.api import taskqueue from google.appengine.ext import ndb from dashboard...
######### # Copyright (c) 2013 GigaSpaces Technologies Ltd. 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...
# Copyright 2016 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. import collections import logging import numbers import os from google.appengine.api import taskqueue from google.appengine.ext import ndb from dashboard.c...
import os import sys import logging import requests import pandas as pd import boto3 import time import math from datetime import datetime from sqlalchemy import * from dataactcore.config import CONFIG_BROKER from dataactcore.interfaces.db import GlobalDB from dataactcore.logging import configure_logging from dataact...
''' Copyright 2011 SRI International 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, softw...
# Copyright 2014 Open Source Robotics Foundation, 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...
import json from klein import Klein from twisted.internet import reactor from twisted.internet.defer import DeferredList, inlineCallbacks, returnValue from paradrop.base import nexus, settings from paradrop.base.pdutils import timeint, str2json from paradrop.core.config import hostconfig from paradrop.core.agent.http ...
#Python Workshop Lesson:24 #http://designalyze.com/int2pythonscripting24_MoreRecursionPt2 #cracking algorithm import rhinoscriptsyntax as rs import Rhino import scriptcontext def crackpolygon(pls, count): temppls = pls pls = [] if count == 0: return 1 else: for pl in te...
""" The Chute Builder interprets the chute specification, which comes from a paradrop.yaml file or from a JSON object via a cloud update. The Chute Builder then produces a valid Chute ojbect with one or more Service objects. There are different versions of the chute specification in code repositories, and so the inten...
from wxplt import * from plot_objects import * from plot_utility import * from interface import * import plot_objects import plot_utility import wxplt import interface from wxplt import lena
#!/router/bin/python # for API usage the path name must be full from .trex_stl_exceptions import * from .trex_stl_streams import * from .trex_stl_jsonrpc_client import JsonRpcClient, BatchMessage from . import trex_stl_stats from .trex_stl_port import Port from .trex_stl_types import * from .trex_stl_async_client im...
#!/usr/bin/env python import argparse import zmq import os import sys import platform import random import time import datetime import pickle import logging import queue import threading import json from parsl.version import VERSION as PARSL_VERSION from parsl.serialize import ParslSerializer serialize_object = ParslS...
"""Unit tests for io.py.""" import os import sys import time import array import unittest from itertools import chain from test import test_support import codecs import io # The module under test class MockRawIO(io.RawIOBase): def __init__(self, read_stack=()): self._read_stack = list(read_stack) ...
import os import sys import llfuse import errno from time import localtime, mktime from llfuse import FUSEError from os import fsencode, fsdecode from Libfs.misc import * from Libfs.cache import Memcache from Libfs.business_logic import BusinessLogic logger = logging.getLogger(__name__) class Operations(llfuse.Operat...
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import unicode_literals from collections import namedtuple import json import os import random from string import ascii_lett...
#!/usr/bin/env python # # 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 os import sys path0 = os.path.dirname(os.path.abspath(__file__)) path1 = os.path.abspath...
# Copyright (c) 2016 Ansible, Inc. # All Rights Reserved. import logging import pygerduty from django.utils.encoding import smart_text from awx.main.notifications.base import TowerBaseEmailBackend logger = logging.getLogger('awx.main.notifications.pagerduty_backend') class PagerDutyBackend(TowerBaseEmailBackend): ...
"""Download flags of countries (with error handling). asyncio version Sample run:: $ python3 flags2_asyncio.py -s ERROR -e -m 200 ERROR site: http://localhost:8003/flags Searching for 676 flags: from AA to ZZ 200 concurrent connections will be used. -------------------- 146 flags downloaded. ...
from AccessControl import ClassSecurityInfo from Products.ATExtensions.Extensions.utils import makeDisplayList from Products.ATExtensions.ateapi import RecordField, RecordsField from Products.Archetypes.Registry import registerField from Products.Archetypes.public import * from Products.CMFCore.utils import getToolByNa...
#!/usr/bin/env python # Copyright 2018, Red Hat # Copyright 2018, Fabien Boucher # # 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...
# coding: utf-8 import re from easy_thumbnails.conf import Settings as thumbnail_settings from unipath import Path ugettext = lambda s: s # Allows PyPy to work with Django. try: import psycopg2 except ImportError: # Fall back to psycopg2cffi. from psycopg2cffi import compat compat.register() BASE_...
"""Dashboard functionality for the diamondash web app""" import re import json from urllib import urlencode import yaml from unidecode import unidecode from pkg_resources import resource_stream from twisted.web.template import Element, renderer, XMLFile from exceptions import ConfigError # graph widget defaults GR...