content string |
|---|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
import wagtail.wagtaildocs.blocks
import wagtail.wagtailimages.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailcore.blocks
import wagtail.wagtailembeds.blocks
class... |
import socket
import errno
from gevent.pywsgi import WSGIHandler, WSGIServer
from gunicorn.workers.ggevent import GeventWorker
import gunicorn.glogging
import inbox.log
from inbox.util.debug import Tracer
from inbox.config import config
log = inbox.log.get_logger()
# Set to 0 in config to disable altogether.
MAX_BLOCK... |
#!/usr/bin/python
import yaml
import glob
import json
import os
ANSIBLE_ROLES_PATH = "/etc/ansible/playbooks/*.yml"
CONFLIST_PATH= "/etc/ansible/roles/{}/vars/conf_list.yml"
def main():
playbook_roles = {}
playbook_list = glob.glob(ANSIBLE_ROLES_PATH)
for playbook in playbook_list:
with open(pl... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import json
import os
import shutil
import tempfile
import time
from mcrouter.test.McrouterTestCase import McrouterTestCase
class TestAsyncFiles(McrouterTestCase):
... |
# coding=utf-8
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import os
from io import StringIO
from unittest import TestCase
from po_localization.parser import Parser, ParseError, parse_po_file, parse_po_filename
from po_localization.po_file impor... |
# coding: utf-8
import django.contrib.gis.db.models.fields
import jsonfield.fields
import taggit.managers
from django.conf import settings
from django.db import migrations, models
import onadata.apps.logger.models.attachment
import onadata.apps.logger.models.xform
class Migration(migrations.Migration):
dependen... |
from flask import request
from sqlalchemy.dialects.postgresql import array_agg
from zeus.config import db
from zeus.constants import Result
from zeus.db.func import array_agg_row
from zeus.models import Job, TestCase, Revision
from zeus.utils.builds import fetch_build_for_revision
from .base_revision import BaseRevis... |
from sympy.core import S, symbols, Eq, pi, Catalan, EulerGamma, Function
from sympy.core.compatibility import StringIO
from sympy import Piecewise
from sympy import Equality
from sympy.matrices import Matrix, MatrixSymbol
from sympy.utilities.codegen import OctaveCodeGen, codegen, make_routine
from sympy.utilities.pyte... |
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import pandas as pd
from mousestyles import path_diversity
def test_smooth_noise():
movement = {'t': pd.Series([0., 0.02, 0.04, 0.06], index=[0, 1, 2, 3]),
'x': pd.Series([0., 0., 0.1, 0.... |
{
"name": "Mass Editing Improved",
"version": "1.0",
"author": "NDP Systemes",
"category": "Tools",
"website": "http://www.serpentcs.com",
"license": "GPL-3 or any later version",
"description": """
This module provides the functionality to add, update or remove the values
of more th... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import gc
import logging
import mock
from multiprocessing import Process, Queue
import os
import sys
from shellbot import Context, Engine, Shell, Vibes
from shellbot.commands import Empty
class MyChannel(object):
is_direct = False
class MyBot(objec... |
"""Unittests for writers.chromeos_adml_writer."""
import os
import sys
import unittest
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.dirname(__file__), '../../../..'))
from writers import chromeos_adml_writer
from writers import adml_writer_unittest
from writers.admx_writer import AdmxElementType
... |
#!/usr/bin/env python
"""
Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
from lib.core.enums import DBMS
from lib.core.settings import MAXDB_SYSTEM_DBS
from lib.core.unescaper import unescaper
from plugins.dbms.maxdb.enumeration import Enumeration
... |
import yaml
import falcon
from oslo_log import log as logging
import six
LOG = logging.getLogger(__name__)
def get_version_from_request(req):
"""Attempt to extract the API version string."""
for part in req.path.split('/'):
if '.' in part and part.startswith('v'):
return part
return ... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
import os
from pants.base.build_environment import (get_buildroot, get_pants_cachedir, get_pants_configdir,
p... |
import tensorflow as tf
from utils import *
class Discriminator:
def __init__(self,input,name='disc'):
with tf.variable_scope(name):
conv1=conv_layer(input,[3,3,3,64],1)
lrelu1=leaky_relu(conv1)
ochannels=[64,128,128,256,256,512,512]
stride=[2,1]
... |
from __future__ import print_function
from __future__ import unicode_literals
from inspect import getdoc
from operator import attrgetter
import logging
import re
import signal
import sys
from docker.errors import APIError
import dockerpty
from .. import __version__
from .. import legacy
from ..const import DEFAULT_TI... |
"""Test the schedule module.
"""
import numpy as np
from datetime import datetime, timedelta
from trollsched.schedule import fermia, fermib, conflicting_passes
from trollsched.schedule import parse_datetime, build_filename
from pyresample.boundary import AreaBoundary
from trollsched.satpass import get_next_passes
fro... |
'''
Read the content of sample-csv.csv then produce sample-email.csv wherein
"User Name"s and "Display Name"s are only needed. The delimiter has to be
changed to 'tab' (\t). After running the script The content of sample-email.csv
should be this:
+--------------------------------------+
User Name Display Name
<EMAIL>... |
# -*- coding: utf-8 -*-
import os, json
import telebot
import redis
from telebot import types
from flask import Flask, jsonify, abort, redirect, url_for
from flask import session, escape, request
from googletrans import Translator
app = Flask(__name__)
app.config['JSON_AS_ASCII'] = False
translator = Translator()
#... |
'''
This program is used to calculate the dataset split statistics
'''
import numpy as np
import json
import os
import math
from os import listdir
from os.path import isfile, join
import utilities.paths as paths
DRIVE = paths.get_drive()
MODELS = ['MVCD003_02']
LAYERS = ['fc6', 'fc7']
VIDEOS = ['V006', 'V007', 'V008'... |
import httplib2, sys,json
from decimal import Decimal
from datetime import datetime, date, timedelta
import mysql.connector
import os
import time
from ftplib import FTP
import tarfile
import zipfile
import gzip
from gffFastaTools import FastaParser
####19.12
def getSequencesFromFTP(outdir, release, specieslist=[]):
... |
import os.path
import logging
import string
import tempfile
from job import Job
import crackling.config as config
class OclLiteJob(Job):
hashTypes = {"MD5":0}
path = config.OCLLITE_PATH
validParams = ["minlen", "maxlen", "charset", "threads"]
MSG_STATUS = "\n"
def validateParams(self, params):
for k,v in par... |
import os
import sys
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
try:
from django.apps import apps
get_model = apps.get_model
except ImportError:
from django.db.models.loading import cache
get_model = cache.get_model
from powerdns_manager.utils im... |
"""
Boost experimentations.
G{packagetree mHTM}
"""
# Native imports
from itertools import izip
import os
import cPickle
# Third-Party imports
import numpy as np
# Program imports
from mHTM.plot import plot_surface_video, plot_surface
def compute_boost(duty_cycle, min_duty_cycle, max_boost=10):
... |
#! /usr/bin/env python
import os, sys, string, math
sys.path.append(os.path.abspath(os.getenv('HOME')+"/src/python/git_manager/"))
from git_report_structure import *
from gm_resources import *
from utility import *
def is_valid_repo_dir( repo_name ):
rep_dir = get_repository_path( repo_name ... |
# Time: O(n^3)
# Space: O(n)
#
# Additive number is a positive integer whose digits can form additive sequence.
#
# A valid additive sequence should contain at least three numbers.
# Except for the first two numbers, each subsequent number in the sequence
# must be the sum of the preceding two.
#
# For example:
# "112... |
"""Handlers for objects in gdemo."""
import json
import uuid
import webob
from gdemo import DATA_STORE
from gdemo.util import get_route_value
def get_object(environ, start_response):
container_id = get_route_value(environ, 'container_id')
object_id = get_route_value(environ, 'object_id')
try:
... |
# -*- coding: utf8 -*-
#
# Created by 'myth' on 3/15/16
import unittest
from copy import deepcopy
import numpy as np
import settings
from modules.flatland import (DOWN, EMPTY, FOOD, LEFT, PLAYER, POISON, RIGHT,
UP, Agent, FlatLand)
from modules.nnet import ActivationFunction, Layer, Neur... |
from JumpScale import j
from fabric.api import *
import JumpScale.baselib.remote.cuisine
import JumpScale.lib.docker
import JumpScale.baselib.redis
# codedirFromHost="" #to not map the code dir
codedirFromHost="# /opt/code:/opt/code"
redis=j.clients.redis.getRedisClient("localhost",9999)
secret=redis.get("ms1:secr... |
"""
Copyright (C) 2013-2018 Calliope contributors listed in AUTHORS.
Licensed under the Apache 2.0 License (see LICENSE file).
cli.py
~~~~~~
Command-line interface.
"""
import contextlib
import datetime
import itertools
import logging
import os
import pstats
import shutil
import sys
import traceback
import click
... |
from unittest.mock import patch
from hc.payments.models import Subscription
from hc.test import BaseTestCase
class UpdatePaymentMethodTestCase(BaseTestCase):
@patch("hc.payments.models.braintree")
def test_it_retrieves_paypal(self, mock):
mock.paypal_account.PayPalAccount = dict
mock.credit_c... |
import sys
import soco
import json
import time
import ConfigParser
from httplib2 import Http
from urllib import urlencode
from soco import SoCo
if len(sys.argv) < 2:
print """
USAGE: %s <config file>"
""" % sys.argv[0]
else:
# Read the config file
config = ConfigParser.ConfigParser()
config.rea... |
# coding: utf-8
"""
This module contains hotkey trigger function that sends notifications to Growl.
"""
from __future__ import absolute_import
# Standard imports
import sys
from traceback import format_exc
# Internal imports
from aoikhotkey.const import HOTKEY_INFO_K_HOTKEY_ORIG_SPEC
from aoikhotkey.const import HOTK... |
"""
Django settings for mrestweb project.
Generated by 'django-admin startproject' using Django 1.9.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
... |
###
# General definition
##
from __future__ import print_function
import os
try:
import configparser
except ImportError:
import ConfigParser
configparser = ConfigParser
DEBUG = False
DEBUG_ACT = False
HOME_DIR = os.path.expanduser("~")
USER_CONFIG_PATH = os.path.join(HOME_DIR, '.config')
USER_CONFIG_PATH =... |
"""Card Names class
__author__ = "http://www.gemalto.com"
Copyright 2001-2012 gemalto
Author: Jean-Daniel Aussel, mailto:<EMAIL>
This file is part of pyscard.
pyscard 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... |
'''
Task Coach - Your friendly task manager
Copyright (C) 2004-2013 Task Coach developers <<EMAIL>>
Task Coach 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) ... |
import datetime
from Quality.Average.averageQuality import DAILY
from Quality.Average.averageQualityManager import AverageQualityManager
from qoimetric import QoIMetric
from virtualisation.clock.abstractclock import AbstractClock
from virtualisation.misc.log import Log as L
class ReputationSystem(object):
"""doc... |
#!/software/tools/python-2.6.7/bin/python
import jobstats
import sys
import numpy as np
def main():
"""
Main routine: Cross reference a list of nodes to find common jobs
"""
if len(sys.argv) < 2:
sys.exit('Usage: ' + sys.argv[0] \
+ ' [Accounting files]')
else:
jo... |
__author__ = "Cedric Bonhomme"
__version__ = "$Revision: 0.1 $"
__date__ = "$Date: 2016/03/01$"
__revision__ = "$Date: 2016/03/01 $"
__copyright__ = "Copyright (c) Luxembourg Institute of Science and Technology"
__license__ = ""
from flask import request, url_for, session, flash
import requests
from flask_login import... |
"""
Compute all mixed Nash equilibria of a 2-player (non-degenerate) normal
form game by support enumeration.
References
----------
B. von Stengel, "Equilibrium Computation for Two-Player Games in
Strategic and Extensive Form," Chapter 3, N. Nisan, T. Roughgarden, E.
Tardos, and V. Vazirani eds., Algorithmic Game Theo... |
import numpy as np
from c3nav.mapdata.render.engines import register_engine
from c3nav.mapdata.render.engines.base3d import Base3DEngine
@register_engine
class OldOpenSCADEngine(Base3DEngine):
filetype = 'old.scad'
def _create_polyhedron(self, vertices):
facets = np.vstack(vertices)
vertices... |
from peewee import *
import peewee as pw
import datetime
DATABASE = "TLSScanning"
myDB = pw.MySQLDatabase("TLSScanning", host="127.0.0.1", port=3306, user="root", passwd="fedora")
# define a base model calss that specifies which database to use. Then, any subclasses
# will automatically use the correct DB.
... |
"""
# UI/UX Authoring Tool
# @license http://www.apache.org/licenses/LICENSE-2.0
# Author @ Jamil Hussain
"""
from django.contrib import admin
from django import forms
from django.contrib import admin
from django.contrib.auth.models import Group
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from d... |
import commands
import sqlite3
import os
from archipelcore.archipelPlugin import TNArchipelPlugin
from archipelcore.utils import build_error_iq
from archipelcore import xmpp
ARCHIPEL_NS_OOM_KILLER = "archipel:vm:oom"
class TNOOMKiller (TNArchipelPlugin):
def __init__(self, configuration, entity, entry_point_g... |
def myblock(tw, sound):
''' Plays a sound file '''
from TurtleArt.tautils import get_path
import os
import tempfile
dirs = [os.path.join(
os.environ['HOME'],
'Activities/TamTamMini.activity/common/Resources/Sounds/'),
os.path.join(
os.environ['HOME'],
'Activ... |
from google.cloud.trace_v2.services.trace_service.client import TraceServiceClient
from google.cloud.trace_v2.services.trace_service.async_client import TraceServiceAsyncClient
from google.cloud.trace_v2.types.trace import AttributeValue
from google.cloud.trace_v2.types.trace import Module
from google.cloud.trace_v2.t... |
import os
from unittest import mock
from .. import *
from bfg9000 import file_types, options as opts
from bfg9000.file_types import (Executable, ObjectFile, ObjectFileList,
SourceFile)
from bfg9000.languages import Languages
from bfg9000.path import Path, Root
from bfg9000.tools.jvm im... |
# coding: utf-8
from ngta import TestCase, main, parametrize, TestRunner, TestSuite, TestContext, test, TestResult
from ngta.events import EventType, TestEventHandler, EventObservable
from unittest import mock
import inspect
import logging
logger = logging.getLogger(__name__)
def setup_module():
pass
def tear... |
import skein
import os
from cipher import Cipher
import consts
import log
class ArchiveEncryptorException(Exception):
def __init__(self, message):
super().__init__(message)
class EncryptedArchiveCorruptException(ArchiveEncryptorException):
def __init__(self, reason):
super().__init__('The encr... |
from ..core.numbers import Number
from ..core.operations import Pow, Add, Mul, free_of, base, exponent, Eq
from ..core.function import Function
from ..core.symbol import free_symbols
class d(Function):
name = 'd/d'
nargs = 2
def __init__(self, u, x):
self.name += str(x)
super(d, self).__i... |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class SubscribeRulesTestCase(In... |
#!/usr/bin/python
# rai.py by Ambrosa http://www.ambrosa.net
# this module is used for download EPG data from Rai website
# derived from E2_LOADEPG
# 29-Dec-2011
__author__ = "ambrosa http://www.ambrosa.net"
__copyright__ = "Copyright (C) 2008-2011 Alessandro Ambrosini"
__license__ = "CreativeCommons by-nc-sa http://... |
import logging
import os
import threading
import trio.abc
from watchdog.observers import Observer
logger = logging.getLogger(__name__)
class MemoryChannelEventHandler:
'''
A watchdog wrapper that will report file changes back to the syncrypt
controller app.
'''
def __init__(self, channel: trio.... |
import ast
class FreeVarFinder(ast.NodeVisitor):
"""
Finds free variables in a Python expression, which may contain lambda
functions.
"""
def __init__(self, masked=[]):
super(FreeVarFinder, self).__init__()
self.masked = set(masked)
self.vars = set()
se... |
"""router gateway IP QoS
Revision ID: 195176fb410d
Revises: cada2437bf41
Create Date: 2016-04-28 12:38:09.872706
"""
from alembic import op
import sqlalchemy as sa
from neutron_lib.db import constants as db_const
# revision identifiers, used by Alembic.
revision = '195176fb410d'
down_revision = 'cada2437bf41'
def... |
import operator
import os
import abc
import pyparsing as pp
import six
from six.moves import reduce
from netlib import strutils
from netlib import human
from . import generators, exceptions
class Settings(object):
def __init__(
self,
is_client=False,
staticdir=None,
unconstraine... |
'''
xdice is a lightweight python 3.3+ library for managing rolls of dice.
License: GNU
@author: Olivier Massot <<EMAIL>>, 2017
'''
import random
import re
__VERSION__ = "1.2.2"
def compile(pattern_string): # @ReservedAssignment
"""
> Similar to xdice.Pattern(pattern_string).compile()... |
""" Module with the modbv class """
from _intbv import intbv
class modbv(intbv):
__slots__ = []
def _handleBounds(self):
lo, hi, val = self._min, self._max, self._val
if lo is not None:
if val < lo or val >= hi:
self._val = (val - lo) % (hi - lo) + lo
# index... |
import random
import cPickle as pickle
import re
from sqlite3 import dbapi2 as sqlite
import time
dbName = "logs.db"
def trivia(event):
'''Responds with a random trivial fact'''
trivia = pickle.load(open("misc/trivia.pickle"))
random.seed(time.time())
fact = random.choice(trivia)
print "Replying i... |
from tornado.gen import coroutine
from tornado.web import RequestHandler
from utils.httpclient import AsyncHTTPClient
from utils.convert import to_str
from config import proxy_host, proxy_port
class ApiHandler(RequestHandler):
@coroutine
def post(self, action):
world_ip = to_str(self.get_secure_cookie... |
#!/usr/bin/python
from sys import argv, exit
import json
from objects.ressources.ressource import Ressource
from objects.ressources.leave import Leave
from objects.ressources.wood import Wood
# default configuration part
worldWidth = 4
worldHeight = 6
# usage text
usage = """Usage: %s [-h|--help]""" % argv[0]
# hel... |
from elan import *
#Set_Location_And_Weather_By_Zip
Configurator.Start()
Configurator.Wait()
sleep(3)
Configurator.locationandweather.Click()
try:
Configurator.locationtype.Click()
except:
sleep(2)
Configurator.locationandweather.Click()
Configurator.locationtype.Click()
sleep(2)
try:
C... |
from skidl import SKIDL, TEMPLATE, Part, Pin, SchLib
SKIDL_lib_version = '0.0.1'
Worldsemi = SchLib(tool=SKIDL).add_parts(*[
Part(name='WS2812B',dest=TEMPLATE,tool=SKIDL,keywords='RGB LED NeoPixel',description='RGB LED with integrated controller',ref_prefix='LED',num_units=1,do_erc=True,pins=[
Pin... |
#! /usr/bin/env python
# Last Change: Wed Sep 24 06:00 PM 2008 J
import numpy as np
from scipy.fftpack import fft, ifft
from scikits.talkbox.tools import nextpow2
from scikits.talkbox.linpred._lpc import levinson as c_levinson
__all__ = ['levinson', 'lpc']
def lpc(signal, order, axis=-1):
"""Compute the Linea... |
import abc
import six
import threading
import time
from keystoneclient.v2_0 import client as ks_client
from oslo_config import cfg
from oslo_utils import timeutils
from tacker.agent.linux import utils as linux_utils
from tacker import context as t_context
from tacker.i18n import _LW
from tacker.openstack.common impor... |
# -*- coding: utf-8 -*-
import handlers
from django.conf.urls import url, patterns
from anaf.core.api.auth import auth_engine
from anaf.core.api.doc import documentation_view
from anaf.core.api.resource import CsrfExemptResource
ad = {'authentication': auth_engine}
# messaging resources
mlistResource = CsrfExemptRes... |
from typing import List, Dict, Tuple
from crispy_forms.layout import Fieldset, Row
from django import forms
from django.utils.translation import ugettext as _
from agir.lib.form_components import *
from agir.people.person_forms.fields import is_actual_model_field, get_form_field
class FieldSet:
def __init__(
... |
"""
This is the implementation of the exciting I/O functions
The functions are called with read write using the format "exi"
The module depends on lxml http://lxml.de
"""
from lxml import etree as ET
import numpy as np
from ase.atoms import Atoms
from ase.parallel import paropen
from ase.units import Bohr
def re... |
import logging
import socket
import os
import sys
import globals,manager_utils,network_utils,dispatcher_utils
try:
from jeedom.jeedom import *
except ImportError:
print "Error: importing module jeedom.jeedom"
sys.exit(1)
def start_server():
set_log_level()
logging.info('Start openzwaved')
logging.info('Log level... |
'''
Tha main component for pulsar datastore clients is the :class:`.Store`
class which encapsulates the essential API for communicating and executing
commands on remote servers.
A :class:`.Store` can also implement several methods for managing
the higher level :ref:`object data mapper <odm>`.
'''
from abc import ABCMet... |
# -*- coding: utf-8 -*-
import sys
# from urllib import urlencode
# from urlparse import parse_qsl
# import xbmcgui
import xbmcplugin
import urlresolver
import xbmcaddon
import xbmc
import sys
import os
from resources import kodi
ADDON_ID = kodi.addon_id
apppath = xbmc.translatePath(os.path.join('special://home/add... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import sys
import os
import time
import datetime
import threading
import codecs
import subprocess
import yaml
import watchdog.observers
import watchdog.events
import linkdown.htmlhelper
import linkdown.convert
def convertcmd(options):
"""
Ar... |
from oslo.config import cfg
import st2common.config as common_config
from st2common.constants.system import VERSION_STRING
common_config.register_opts()
CONF = cfg.CONF
def _register_common_opts():
common_config.register_opts()
def _register_rules_engine_opts():
logging_opts = [
cfg.StrOpt('loggin... |
from __future__ import unicode_literals
from django import forms
from django.core.validators import EMPTY_VALUES
from django.utils.translation import ugettext_lazy as _
from pictures.models import Watermark
class EditForm(forms.Form):
is_rotate_enabled = forms.BooleanField(required=False, initial=False, label=... |
"""Determine the layer plane angle of all the elements in a grid.
Author: Perry Roth-Johnson
Last modified: March 26, 2014
Usage:
1. Look through the mesh_stn11.abq file and find all the element set names.
(Find all the lines that start with "*ELSET".)
2. Enter each of the element set names in one of the f... |
#!/usr/bin/python3
from argparse import ArgumentParser
from bootstrap import *
from os.path import join
def read_file(fn):
for l in iter(open(fn).readline, ''):
yield l.rstrip('\r\n')
def read_terminals(fn):
state = 0
for l in read_file(fn):
if not l:
continue
if state... |
import unittest
# source: https://sr.wikipedia.org/wiki/Cikli%C4%8Dno_sortiranje#Algoritam
# Sort an array in place and return the sorted array
def cycleSort(array):
writes = 0
# Loop through the array to find cycles to rotate.
for cycleStart in range(0, len(array) - 1):
item = array[cycleStart]
... |
"""Module containing the class for scenario thens then its translations."""
from croissant.language.keyword.base import BaseKeyword
class ScenarioThenKeyword(BaseKeyword):
"""Class containing the then keyword of a scenario.
In English, this keyword is by default:
then
"""
path = "scenario.... |
import sys
import os.path
import getopt
import numpy as np
import matplotlib.pyplot as plt
def convertFileToNumpy(idir,ifile,odir):
print("Working on "+ifile)
ifname = idir+"/"+ifile
ofname = odir+"/"+ifile+".npy"
data=open(ifname).read()
lines = data.split('\n')
# Parse out the number o... |
import json
import os
import signal
import time
from datetime import datetime as dt
from subprocess import Popen
from psutil import Process, TimeoutExpired, NoSuchProcess, AccessDenied, ZombieProcess
from job_runner.io import assert_file_executable
from job_runner.reporting.message import Exited, Running, Start
cla... |
from setuptools import setup,find_packages
__component_name__ = "ServerWebUI"
__author__ = "Loris Corazza"
__author_email__ = "<EMAIL>"
__version__ = "0.1"
__url__ = "http://nam.ece.upatras.gr/p2ner/"
__license__ = """Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except i... |
import cv2
import numpy as np
import uuid
import os
import sys
import time
class Trainer(object):
faceCascade = cv2.CascadeClassifier('d:\data\haarcascade\haarcascade_frontalface_default.xml')
eyesCascade = cv2.CascadeClassifier('d:\data\haarcascade\haarcascade_eye_tree_eyeglasses.xml')
# eyesCascade = cv... |
import logging as log
import warnings
import simplejson as json
from qubell.api.private import exceptions
from qubell.api.private.organization import OrganizationList, Organization
from qubell.api.provider.router import ROUTER as router
from qubell import deprecated
#todo: understood, that some people may use this o... |
# -*- coding: utf-8 -*-
import shutil, os, zipfile, traceback, random
from datetime import datetime
from ordering.util.excel_helper import *
from common import serveFile, Date2Text
from ordering.model import *
from tg import request, config, flash, redirect
import time, zlib
from ordering.util.bin2hex import *
epcobj=... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from sys import argv, exit
import os, re
if "upl" in argv[1:]:
os.system("python setup.py register -r pypi")
os.system("python setup.py sdist upload -r pypi")
exit()
m = open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "soif", "_version.py")).re... |
__author__ = 'Veronica'
from src.model.frameGenerator import GeradorPacote
from src.model.generatedFrames import PacotesGerados
from src.model.frameSend import EnviarPacote
from src.model.frameListener import RecebedorPacote
from src.controller.controller import Controller
class ExperimentoElisa(object):
def __i... |
# -*- coding: utf-8 -*-
import sys
import unittest
from mock import MagicMock, patch
from drift.management import get_commands, do_execute_cmd
from drift.management.commands import bakeami
def mock_get_service_info():
ret = MagicMock()
ret["name"] = "Mock"
ret["version"] = "0.1.0-mock"
return ret
d... |
#!/bin/python
# usage:
# cat clAmdBlas.h | $0
import sys, re;
from common import remove_comments, getTokens, getParameters, postProcessParameters
try:
if len(sys.argv) > 1:
f = open(sys.argv[1], "r")
else:
f = sys.stdin
except:
sys.exit("ERROR. Can't open input file")
fns = []
while ... |
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
from infiltrator.textractor.textractor import Extractor
import datetime
import codecs
import json
# from bs4 import BeautifulSoup
class InfiltratorPip... |
# -*- coding: utf-8 -*-
import os, re, sys, json, urllib, hashlib, traceback
import xbmcup.app, xbmcup.db, xbmcup.system, xbmcup.net, xbmcup.parser, xbmcup.gui
import xbmc, cover, xbmcplugin, xbmcgui
from http import HttpData
from auth import Auth
from wmodal import MovieInfo
from common import Render
from defines im... |
#!/usr/bin/env python3
from .common import *
from pprint import pprint
def get_conn():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((nc.host(), nc.port()))
s.settimeout(.3)
return s
def _test(req, resp, sleep=0):
s = get_conn()
# Send a single byte at a time
for i in re... |
import json
from klein import Klein
from paradrop.base import pdutils
from . import cors
class ChangeApi(object):
routes = Klein()
def __init__(self, update_manager):
self.update_manager = update_manager
@routes.route('/', methods=['GET'])
def get_changes(self, request):
"""
... |
"""This code example creates new image creatives for a given advertiser. To
determine which companies are advertisers, run get_companies_by_filter.py.
To determine which creatives already exist, run get_all_creatives.py."""
__author__ = '<EMAIL> (Jeff Sham)'
# Locate the client library. If module was installed via "s... |
from PyQt5 import QtWidgets, QtCore
from .users_ui import Ui_Form
from ...core.mixins.toolwindow import ToolWindow
from ....core.instrument.privileges import PrivilegeLevel, PRIV_USERMAN
from ....core.services.accounting import Accounting, User
class UserManager(QtWidgets.QWidget, Ui_Form, ToolWindow):
required_... |
'''
Using ANSI Colors to print to terminal
Adapted from code taken from Blenders bcolor.py
Samir Ahmed 2012
'''
class color:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
CYAN = "\033[36m"
MAGENTA = "\033[35m"
RED = "\033[31m... |
# encoding: 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 'Banner.with_logo'
db.add_column('misc_banner', 'with_logo', self.gf('django.db.models.fiel... |
# -*- coding: utf-8 -*-
# code for console Encoding difference. Dont' mind on it
import sys
import imp
imp.reload(sys)
try:
sys.setdefaultencoding('UTF8')
except Exception as E:
pass
import testValue
from popbill import TaxinvoiceService, PopbillException
taxinvoiceService = TaxinvoiceService(testValue.Link... |
# -*- 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 'ImageCollection.slug'
db.add_column(u'images_imagecollection', 'slug',
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.