text
stringlengths
17
737k
from flow.petri_net.actions.base import BasicActionBase from flow_workflow.operations.converge.actions import ConvergeAction, order_outputs from twisted.internet.defer import Deferred import fakeredis import mock import unittest class OrderOutputsTest(unittest.TestCase): def test_order_outputs(self): inp...
# -*- coding: utf-8 -*- # # Author: Pearu Peterson, March 2002 # # additions by Travis Oliphant, March 2002 # additions by Eric Jones, June 2002 # additions by Johannes Loehnert, June 2006 # additions by Bart Vandereycken, June 2006 # additions by Andrew D Straw, May 2007 # additions by Tiziano Zito, November 2008...
from __future__ import print_function import os import logging import hashlib import subprocess import inspect import copy import lxml from lxml import etree try: from termcolor import colored except ImportError: logging.error("Please install termcolor:\n sudo pip install termcolor") from XmlValidator impor...
# -*- coding: utf-8 -*- """lonetwin's pimped-up pythonrc A custom pythonrc which provides: * colored prompts * intelligent tab completion (for objects and their attributes/methods in the current namespace as well as file-system paths) * pretty-printing * shortcut to open your $EDITOR with the last exe...
#!/usr/bin/env python from chalicelib.mlb import launch print "Should see: standard, verbose for each game. 'Today' starts at rolloverTime.\n" for (rew, ff, day) in [(True, False, "yesterday"),(False,False,"today"),(False,True,"tomorrow")]: print ("\n" + day + ":") for team in ["WSH","SD"]: for fv in [False,True...
#!/usr/bin/env python from urllib import urlencode, quote_plus import urllib2 import xml.dom.minidom as minidom def _dict_to_xml_string(target): xml_string_list = [ '<%s>%s</%s>' % ( key, (isinstance(target[key], dict) and _dict_to_xml_string(target[key])) or ...
from django.conf.urls import patterns, include, url from django.http import HttpResponseRedirect from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'ShoppingList.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', i...
## $Id$ ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (a...
# # Author: Travis Oliphant, 2002 # from __future__ import division, print_function, absolute_import import warnings import numpy as np from scipy._lib.six import xrange from numpy import (pi, asarray, floor, isscalar, iscomplex, real, imag, sqrt, where, mgrid, sin, place, issubdtype, extract, ...
# -*- coding: utf-8 -*- """ .. module:: test_api :platform: Unix :synopsis: tests for the api submodule. .. moduleauthor:: Mehmet Mert Yıldıran <mert.yildiran@bil.omu.edu.tr> """ import json import time import os import dragonfire import dragonfire.api as API from dragonfire.database import Base from dragon...
# vim: set et ts=4 sw=4 fdm=marker """ MIT License Copyright (c) 2016 Jesse Hogan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to u...
''' Settings in orgmode.sublime-settings are: - orgmode.open_link.resolvers: See DEFAULT_OPEN_LINK_RESOLVERS. - orgmode.open_link.resolver.abstract.commands: See DEFAULT_OPEN_LINK_COMMANDS in resolver.abstract. For more settings see headers of specific resolvers. ''' import sys import re import os.path import sublime ...
# Copyright (C) 2016 OpenMotics BVBA # # 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 distri...
#!/sw64/bin/python2.7 import time import os import subprocess import sys import shutil import numpy sys.path.append('..') import great3sims # Set which branches to test... experiments = [ 'variable_psf', 'control', 'multiepoch', #'real_gal', #'full', ] obs_type = [ 'ground', 'space', ] sh...
# Copyright (c) 2015, The MITRE Corporation. All rights reserved. #BY USING THE VIRSUTOTAL MAEC PACKER MODULE SCRIPT, YOU SIGNIFY YOUR ACCEPTANCE #OF THE TERMS AND CONDITIONS OF USE. IF YOU DO NOT AGREE TO THESE TERMS, DO #NOT USE THE VIRSUTOTAL MAEC PACKER MODULE. #For more information, please refer to the LICENSE....
# rarfile.py # # Copyright (c) 2005-2020 Marko Kreen <markokr@gmail.com> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED...
from torch import Tensor from torch import nn from transformers import XLMRobertaModel, XLMRobertaTokenizer import json from typing import Union, Tuple, List, Dict, Optional import os import numpy as np import logging class XLMRoBERTa(nn.Module): """RoBERTa model to generate token embeddings. Each token is ma...
from __future__ import print_function, division import os, os.path, sys, re, glob import itertools from copy import deepcopy import logging import json from .config import on_rtd if not on_rtd: import numpy as np import pandas as pd import numpy.random as rand from scipy.stats import gaussian_kde ...
#!/usr/bin/python # -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Genera...
# -*- coding: utf-8 -*- import inspect from graceful.validators import min_validator, max_validator class BaseField(object): """ Base field class for subclassing. To create new field type subclass `BaseField` and implement following methods: - ``from_representation()``: converts representation (used...
import locale locale.setlocale(locale.LC_ALL, '') import pkg_resources __version__ = pkg_resources.get_distribution('jarn.viewdoc').version import sys import os import getopt import webbrowser import ConfigParser from os.path import abspath, expanduser, dirname, basename from os.path import split, join, isdir, isfil...
# -*- coding: utf-8 -*- # Copyright (C) 2014 Cornelius Kölbel # contact: corny@cornelinux.de # # 2017-07-20 Cornelius Kölbel <cornelius.koelbel@netknights.it> # Fix unicode usernames # 2017-01-23 Cornelius Kölbel <cornelius.koelbel@netknights.it> # Add certificate verification # 2017-01-07...
from django.conf import settings import random __version__ = '0.1.1' class Seed(object): instance = None seeders = {} fakers = {} @classmethod def __new__(cls, *args, **kwargs): if cls.instance is None: cls.instance = super(Seed, cls).__new__(*args, **kwargs) return...
#!/usr/bin/python """Copyright 2015 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable l...
import sys import os import warnings if sys.version_info < (2, 7): import unittest2 as unittest # pragma: nocover else: import unittest # pragma: nocover from webtest import TestApp import six from six import b as b_ from six.moves import cStringIO as StringIO from pecan import ( Pecan, expose, request,...
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2017 SML Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy...
#!/usr/bin/python #system includes import os, sys, warnings, time, socket, re, urllib2 import SocketServer import threading from copy import copy from math import sqrt, atan2 from pkg_resources import load_entry_point from SimpleHTTPServer import SimpleHTTPRequestHandler from types import IntType, LongType, FloatType ...
# (C) Copyright 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/licenses/LICENSE-2.0 # # Unless required by...
from django.contrib.auth.models import User #to get auth_user table import time ''' UTILITY FUNCTIONS ''' #------------------------------------------------------------------------------- def diff_lists(list1,list2, option=None): """ if option equal 'and', return a list of items which are in both list1 a...
import argparse import logging import os import datetime import time import subprocess import json from cax import __version__ from cax import config, qsub import pax from cax.tasks import checksum, clear, data_mover, process, process_hax, filesystem, tsm_mover, rucio_mover from cax.tasks import corrections def m...
# -*- coding: utf8 -*- # Imports. {{{1 import sys # Try to load the required modules from Python's standard library. try: from io import BytesIO import errno import hashlib from math import floor, ceil, modf import os import stat from time import time import traceback except ImportErr...
from dataStructs import outputsToInputs, parseCSVLine, txHashes inputsDict = outputsToInputs() hashes = txHashes() with open("outputs.csv", "r") as outputsFile, open("bitcoinData/newOutputs.csv", "w") as newOutputs: outputsFile.readline() # skip column names for line in outputsFile: data = parseCSV...
from __future__ import unicode_literals from datetime import datetime from django.contrib.auth import get_user_model from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible fro...
import sys from PyFBA import lp, log_and_message def reaction_bounds(reactions, reactions_with_upsr, media, lower=-1000.0, mid=0.0, upper=1000.0, verbose=False): """ Set the bounds for each reaction. We set the reactions to run between either lower/mid, mid/upper, or lower/upper depending on whether the ...
import sys import json import cv2 import os import numpy import CutFaces as cf import FaceTransform as tf if len(sys.argv)>1: inputID=sys.argv[1] inputImageName=os.path.abspath(__file__+'/../../../../Destination/uploads/'+inputID) inputJSONName=os.path.abspath(__file__+'/../../../../Destination/json/'+inpu...
# Tensor Flow basic - Rishu Shrivastava #import the tf canonical lib import tensorflow as tf #from __future__ import print_function #A computational graph is a series of TensorFlow operations arranged into a graph of nodes. #Let's build a simple computational graph. Each node takes zero or more tensors as inputs and ...
from django.conf import settings from django_spam.utils import Colour # common endpoints bots like (w/o leading slash) SPAM_ROUTES = [ # asp/x 'admin.aspx', 'admin.asp', 'admin/account.html', 'admin/login.asp', 'admin_login.asp', 'admin_login.aspx', 'administartorlogin.aspx', 'adm...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 Comunitea All Rights Reserved # @author Alberto Luengo Cabanillas # Copyright (C) 2016 # Comunitea Servicios Tecnológicos (http://www.comunitea.com) # # This program is fr...
#!/usr/bin/python import time import pygame import Axon from Axon.Ipc import WaitComplete from Kamaelia.UI.GraphicDisplay import PygameDisplay class PygameComponent(Axon.Component.component): """ Borrows ideas from Kamaelia.UI.MH.PyGameApp.PyGameApp & mainly from Ticker """ Inboxes = { "inbox" : "S...
# -*- coding: utf8 -*- # Imports. {{{1 import sys # Try to load the required modules from Python's standard library. try: from io import BytesIO import errno import hashlib import math import os import stat import time import traceback except ImportError as e: msg = "Error: Failed...
""" Test that redundant calls to SetPresence don't cause anything to happen. """ import dbus from servicetest import EventPattern from gabbletest import exec_test ispresence = u'org.freedesktop.Telepathy.Connection.Interface.SimplePresence' def test_presence(q, bus, conn, stream): conn.Connect() q.expect(...
"""Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 106 PATCH_VERSION = "1" __short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}" __version__ = f"{__short_version__}.{PATCH_VERSION}" REQUIRED_PYTHON_VER = (3, 7, 0) # Truthy date string triggers showing related deprecation warning messa...
import arcpy import os import ConfigParser class AttrDict(dict): def __init__(self, *args, **kwargs): super(AttrDict, self).__init__(*args, **kwargs) self.__dict__ = self def update(key, value): config = ConfigParser.SafeConfigParser() config.read(config_path) config.set(ap...
# coding: utf-8 """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 60 PATCH_VERSION = '1' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 4, 2) REQUIRED_PYTHON_VER_WIN = (3, 5, 2) ...
"""Django Feed Aggregator.""" VERSION = (2, 0, 9) __version__ = ".".join(map(str, VERSION)) __author__ = "Ask Solem" __contact__ = "askh@opera.com" __homepage__ = "http://github.com/ask/django-feeds/" __docformat__ = "restructuredtext"
""" The MIT License (MIT) Copyright (c) 2015-present Rapptz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merg...
''' ==================================================================== Copyright (c) 2003-2016 Barry A Scott. All rights reserved. This software is licensed as described in the file LICENSE.txt, which you should have received as part of this distribution. ======================================================...
#!/usr/bin/env python import sys,os import pandas as pd def main(): """ NAME mit_squid_magic.py DESCRIPTION converts 2019 SQUID files into a MagIC format measurement file SYNTAX mit_squid_magic.py [command line options] OPTIONS -h: prints the help message and quit...
#This bot was written by /u/GoldenSights for /u/FourMakesTwoUNLESS on behalf of /r/pkmntcgtrades. Uploaded to Git with permission. import praw import time import datetime import sqlite3 '''USER CONFIGURATION''' USERNAME = "" #This is the bot's Username. In order to send mail, he must have some amount of Karma. PASSW...
#!/usr/bin/python # Copyright 2012, SIL International # All rights reserved. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation; either version 2.1 of License, or # (at y...
from argparse import ArgumentParser from dodo_commands.framework import Dodo from dodo_commands.framework.config import (get_command_path, Paths, projects_dir, ConfigLoader) import glob import os import ruamel.yaml import sys def _args(): # noqa parser = ArgumentParser...
import discord from redbot.core import commands, checks, Config, bot from redbot.core.utils.chat_formatting import box, humanize_list from redbot.core.utils.menus import menu, DEFAULT_CONTROLS from datetime import datetime, timezone # https://red-discordbot.readthedocs.io/en/latest/framework_utils.html # https://git...
# 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 # d...
import itertools import numpy as np from numba.cuda.cudadrv import devicearray from numba import cuda from numba.cuda.testing import unittest, CUDATestCase from numba.cuda.testing import skip_on_cudasim class TestCudaNDArray(CUDATestCase): def test_device_array_interface(self): dary = cuda.device_array(sh...
import avalon.maya class LookLoader(avalon.maya.Loader): """Specific loader for lookdev""" families = ["mindbender.lookdev"] representations = ["ma"] def process(self, name, namespace, context, data): import os import json from maya import cmds from polly.maya import...
import logging from kubernetes.client.rest import ApiException from django.conf import settings from constants.jobs import JobLifeCycle from docker_images.image_info import get_tagged_image from scheduler.spawners.dockerizer_spawner import DockerizerSpawner from scheduler.spawners.utils import get_job_definition lo...
"Usage: unparse.py <path to source file>" import sys import _ast import cStringIO import os def interleave(inter, f, seq): """Call f on each item in seq, calling inter() in between. """ seq = iter(seq) try: f(seq.next()) except StopIteration: pass else: for x in seq: ...
from discord.ext import commands async def setup(bot): await bot.add_cog(Points(bot)) class Points(commands.Cog): def __init__(self, bot): self.bot = bot async def cog_load(self): await self.bot.connect_to_database() await self.bot.db.execute("CREATE SCHEMA IF NOT EXISTS users...
from core.celery.config import ERIGONES_TASK_USER from que.tasks import execute, get_task_logger from vms.models import SnapshotDefine, Snapshot, BackupDefine, Backup, IPAddress logger = get_task_logger(__name__) def is_vm_missing(vm, msg): """ Check failed command output and return True if VM is not on comp...
import discord from discord.ext import commands, tasks import asyncio import datetime import logging import sys import traceback import aiohttp import dateutil.parser from utilities import checks errors_logger = logging.getLogger("errors") def setup(bot): bot.add_cog(Twitch(bot)) class Twitch(commands.Cog): ...
# -*- coding: utf-8 -*- # Copyright 2016 Open Permissions Platform Coalition # 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 appl...
""" The top level of the APL Read-Evaluate-Print loop UNDER DEVELOPMENT This version supports expressions with parentheses and vectors (but the vector calculator is not yet implemented) Expression evaluation includes system commands, system variables and workspace variables It also recognises st...
# # # Copyright (C) 2008 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed ...
import httpretty from nose.tools import assert_equal from lettuce import * import json from requests import get from pubs_ui.utils import (pull_feed, pubdetails, getbrowsecontent, create_display_links, jsonify_geojson, add_legacy_data, SearchPublications, m...
import json, logging, re from biothings.utils.common import dotdict, is_str, is_seq, find_doc from biothings.utils.es import get_es from biothings.utils.userquery import get_userquery from elasticsearch import NotFoundError, RequestError, TransportError from biothings.settings import BiothingSettings #from biothings.ut...
# Copyright 2020 DeepMind Technologies Limited. # # 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 ag...
""" Analyzes the word frequencies in a book downloaded from Project Gutenberg """ import string as s import re def get_word_list(file_name): ''' Reads the specified project Gutenberg book. Header comments, punctuation, and whitespace are stripped away. The function returns a list of the words u...
""" A theano / pylearn2 wrapper for cuda-convnet's response normalization functions. """ __authors__ = "David Warde-Farley" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["David Warde-Farley", "Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "David Warde-Farley" __email__ = ...
#!/usr/bin/python # EVRYTHNG API Python Wrapper v0.92 - Vlad Trifa # Engine 1.17 # Import all basic libs needed import simplejson as json import httplib, urllib import csv import logging # Import some tools to measure execution time import time import corestats # Set to 1 to force HTTPS SECURE=1 # Which API Endp...
########################################################################## # # Copyright (c) 2012, John Haddon. All rights reserved. # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided t...
import poppy_inverse_kinematics.creature as model_creature import numpy as np import poppy_inverse_kinematics.meta_creature as meta_creature import time from hand_follow_config import activate_follow, waiting_time, exp_type, target_delta, move_duration, max_iter if exp_type == "simulation": manual_move = False ...
# # Copyright (c) 2011 rPath, Inc. All Rights Reserved. # import os import socket import tempfile import time from lxml import etree from conary.lib import util from restlib import client as restclient from catalogService import errors from catalogService.rest import baseDriver from catalogService.rest.models impo...
import os import signal import time import urllib from conary.lib import util from catalogService import clouds from catalogService import descriptor from catalogService import environment from catalogService import images from catalogService import instances from catalogService import instanceStore from catalogServ...
# -*- coding: utf-8 -*- """ Created on Wed Sep 28 14:41:37 2016 Suggested anity checks: - For same A coefficients, check if chords are equal - As A increases, the chord for cruise should shrink - For A coefficients, check if cos(beta)=0 - For same A coefficients, check for calculate_psi_goal if psi_bas...
from __future__ import absolute_import import json import os import string from collections import namedtuple import paramiko import logging from django.core.urlresolvers import reverse from django.contrib.auth.models import Group, User from django.contrib.contenttypes.models import ContentType from django.core.excep...
""" SQLAlchemy Database class to handle access to Pstgres through ORM """ try: from sqlalchemy import create_engine, and_, or_, case, func from sqlalchemy.exc import IntegrityError from sqlalchemy.orm import sessionmaker, with_polymorphic from sqlalchemy.sql.expression import desc from sqlalchemy.s...
# CTK: Cherokee Toolkit # # Authors: # Alvaro Lopez Ortega <alvaro@alobbs.com> # # Copyright (C) 2009 Alvaro Lopez Ortega # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License as published by the Free Software Foundation. # # ...
# -*- coding: utf-8 -*- from cacheops.conf import redis_client, handle_connection_failure from cacheops.utils import get_model_name, non_proxy __all__ = ('invalidate_obj', 'invalidate_model', 'invalidate_all') def serialize_scheme(scheme): return ','.join(scheme) def deserialize_scheme(scheme): return tupl...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
#!/usr/bin/env python import os import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as ticker import astropy.io.ascii as ascii_io import fitsio import bass import bokextract datadir = '/global/scratch2/sd/imcgreer/' ndwfs_starfile = datadir+'ndwfs/starcat.fits' bootes_sdss_starfile = datadir+...
''' Significant lifting from https://jmetzen.github.io/2015-11-27/vae.html ''' import time import numpy as np import tensorflow as tf from tensorflow.python.ops import rnn import random import matplotlib.pyplot as plt import re, string from sklearn.feature_extraction.text import CountVectorizer from collections impo...
import html.entities import re import unicodedata import warnings from gzip import GzipFile from io import BytesIO from django.utils.deprecation import RemovedInDjango40Warning from django.utils.functional import SimpleLazyObject, keep_lazy_text, lazy from django.utils.regex_helper import _lazy_re_compile from django....
# This example illustrates the use of entries with validations import datetime import gtk from kiwi.environ import require_gazpacho require_gazpacho() from kiwi.datatypes import ValidationError from kiwi.ui.delegates import Delegate class Person: pass class Form(Delegate): def __init__(self): Del...
""" Location Permissions ==================== Normal Access ------------- Location Types - Users who can edit apps on the domain can edit location types. Locations - There is an "edit_locations" and a "view_locations" permission. Restricted Access and Whitelist -------------------------------- Many large projects ...
"""Package for all Synopsis modules. This package contains the Synopsis modules loaded at runtime. These modules are organised into four subpackages: Core, Parser, Linker and Formatter. There is also the Config module, which contains all the default configuration settings.""" __version__ = "0.5"
from django.core.urlresolvers import reverse from django.utils.translation import ugettext_noop from django.utils.translation import ugettext as _ from corehq.apps.groups.hierarchy import get_user_data_from_hierarchy from corehq.apps.domain.models import Domain from corehq.apps.groups.models import Group from corehq.a...
"""Django Celery Integration.""" # :copyright: (c) 2009 - 2012 by Ask Solem. # :license: BSD, see LICENSE for more details. from __future__ import absolute_import, unicode_literals import os VERSION = (3, 1, 0, 'b2') __version__ = '.'.join(map(str, VERSION[0:3])) + ''.join(VERSION[3:]) __author__ = 'Ask Solem' __co...
from django.test import TestCase from django.contrib.auth.models import User from rest_framework.test import APITestCase from rest_framework import status from rest_framework.authtoken.models import Token from account.models import * import json # Create your tests here. class AccountTestCase(TestCase): def ...
#!/usr/bin/env python3 """ Charcoal's main module. Contains definitions for the Charcoal canvas object, \ the CLI, and various classes used by the Charcoal class. """ from direction import Direction, DirectionToString, Pivot from charcoaltoken import CharcoalToken as CT, CharcoalTokenNames as CTNames from charactert...
from __future__ import print_function, division __author__ = 'rkrsn' from Planners.CD import * from Planners.xtree import xtree from tools.sk import rdivDemo from tools.misc import explore, say from tools.stats import ABCD from tools.tune.dEvol import tuner from tools.oracle import * # Timing from time import time from...
""" Create/update a batch of discount coupons from a CSV file. Parameters: <conference> <csv-file> Creates/updates coupons based on the CSV file contents: code - coupon code max_usage - max. number of uses items_per_usage - max number of items per use value - value of the coupon in percent...
from config import config import jwt import logging from os import urandom from pylibscrypt import scrypt_mcf import sqlite3 logger = logging.getLogger(__name__) class DB(object): def __init__(self, dbfile): self.conn = sqlite3.connect(dbfile) self.cur = self.conn.cursor() self.create() ...
#!/usr/bin/env python # coding=utf-8 if __name__ == "__main__": pass
__author__ = 'tbeltramelli' import cv2 from pylab import * import numpy as np from Utils import * from Filtering import * from RegionProps import * from scipy.cluster.vq import * class Eye: _result = None _right_template = None _left_template = None def __init__(self, right_corner_path, left_corner_p...
""" Tests for L{eliot.journald}. """ from os import getpid, strerror from unittest import skipUnless, TestCase from subprocess import check_output, CalledProcessError, STDOUT from errno import EINVAL from sys import argv from uuid import uuid4 from time import sleep from six import text_type as unicode from .._bytesj...
import subprocess import sys import os import datetime import time import jinja2 from flask import jsonify from app import * lockDir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'lock') pidDir = '/var/run' def installCollectd(): ''' Installs collectd on local node. ''' collectdLock =...
# Copyright 2015 Leon Sixt # # 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, sof...
#!/usr/bin/env python # coding=utf-8 # by BinSys <binsys@163.com> # 支持 mtouch mtouch-64 mtouch.exe mandroid.exe 解包 # Readme # 1. 将插件文件 MKBundleManager.py 放入 IDA Pro 的 plugins 目录 # 2. 用IDA打开待分析文件,等待分析完毕(左下角状态栏的 AU: idel) # 3. IDA 菜单栏 点击 View -> Open subviews -> Bundled Assembly Manager # 4. 在 Bundled Asse...
""" This is the main part of the dslib library - a client object resides here which is responsible for all communication with the DS server.. """ # this is a work-around for an incompatibility of openssl-1.0.0beta # with the login.czebox.cz sites HTTPS interface # more info here: https://bugzilla.redhat.com/sh...
#!/usr/bin/env python # Copyright 2008-2010 Nokia Siemens Networks Oyj # # 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 b...