src
stringlengths
721
1.04M
from django import forms from dockit import schema from dockitcms.fields import BaseFieldEntry, ListFieldMixin from dockitcms.widgetblock.models import Widget class WidgetField(BaseFieldEntry): field_class = schema.SchemaField def get_field_kwargs(self): kwargs = dict(super(WidgetField, self)....
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from gratipay.testing import Harness, T class TestTeamClosing(Harness): def test_teams_can_be_closed_via_python(self): team = self.make_team() team.close() assert team.is_closed ...
# Copyright (c) 2014 Sony Network Entertainment Intl. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys import recipe_util # pylint: disable=F0401 # This class doesn't need an __init__ method, so we disable the warning # pylint: di...
import numpy import random import sum_tree class Experience(object): def __init__(self, memory_size, batch_size, alpha): self.tree = sum_tree.SumTree(memory_size) self.memory_size = memory_size self.batch_size = batch_size self.alpha = alpha def add(self, data, priority): ...
from troubleshooting.framework.modules.configuration import ConfigManagerInstance from troubleshooting.framework.remote.client import client from troubleshooting.framework.libraries.bash import ExecuteCommond try: #import project config.variable from config.variable import * except: print "WARN: failed to i...
# This file is part of Lithium-Projman. # # Lithium-Projman 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) any later version. # # Lithi...
# Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type from collections import MutableMapping from ansible import constants as C from ansible.plugins.acti...
#!/usr/bin/env python """ A simple script for making random passwords, WITHOUT 1,l,O,0. Because those characters are hard to tell the difference between in some fonts. """ import sys from random import Random class random_password(object): def __init__(self): self._characters = { 'righthand...
# -*- 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 General Public License a...
########################################################################## # This file is part of WTFramework. # # WTFramework 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 ...
##################################################################################### # # Copyright (c) Crossbar.io Technologies GmbH # # Unless a separate license agreement exists between you and Crossbar.io GmbH (e.g. # you have purchased a commercial license), the license terms below apply. # # Should you enter ...
from PyQt5.QtCore import QObject, pyqtSignal # , QRect, QPoint # from PyQt5.QtWidgets import qApp from piony import logger from piony.config import ymlparser as yml from piony.config.argparser import ArgParser from piony.config.budparser import BudParser, BudError from piony.config.keyparser import KeymapParser cla...
import requests from matroid import error from matroid.src.helpers import api_call # https://staging.dev.matroid.com/docs/api/index.html#api-Video_Summary-PostSummarize @api_call(error.InvalidQueryError) def create_video_summary(self, url=None, videoId=None, file=None): """Create an video summary with provided url ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys, os, urllib2, urllib, cookielib import time, logging, logging.handlers from datetime import datetime from pprint import pprint import csv, shutil, re from ftplib import FTP_TLS, error_perm from db import DB from utils import * from urllib import quote import trac...
import glob import logging import os import yaml from mistral.actions import base LOG = logging.getLogger(__name__) DEFAULT_METADATA = { 'name': 'Unnamed', 'description': 'No description', 'stage': 'No stage', 'require_plan': True, 'groups': [], } VALIDATIONS_DIR = '/usr/share/tripleo-validation...
from BeautifulSoup import BeautifulSoup as Soupify import urllib, re import settings import oauth2, urlparse, json from do import settings class DropboxAPI(object): def __init__(self, user): self.user = user dinfo = self.user.social_auth.get(provider='dropbox') access_token = urlparse.parse_qs( dinfo.extra_da...
# This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # # This program is distributed in the hope that it will be useful, but ...
''' This file is part of GEAR_mc. GEAR_mc is a fork of Jeremie Passerin's GEAR project. GEAR 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 the License, or (at...
from unittest import TestCase from gcsa.attachment import Attachment from gcsa.serializers.attachment_serializer import AttachmentSerializer DOC_URL = 'https://docs.google.com/document/d/1uDvwcxOsXkzl2Bod0YIfrIQ5MqfBhnc1jusYdH1xCZo/edit?usp=sharing' class TestAttachment(TestCase): def test_create(self): ...
import datetime import warnings from xml.dom import minidom from django.contrib.syndication import views from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from django.utils import tzinfo from django.utils.feedgenerator import rfc2822_date, rfc3339_date from models import Entry ...
# ****************************************************************************** # Copyright 2014-2018 Intel Corporation # # 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.apa...
# Python 3.6.1 import re from timeit import timeit class Registers(dict): """Simple dict-based class that sets a default value on missing keys.""" def __missing__(self, key): self[key] = 0 return self[key] class Instruction: """Class for holding register instructions.""" instr_re = ...
# # Evy - a concurrent networking library for Python # # Unless otherwise noted, the files in Evy are under the following MIT license: # # Copyright (c) 2012, Alvaro Saurin # Copyright (c) 2008-2010, Eventlet Contributors (see AUTHORS) # Copyright (c) 2007-2010, Linden Research, Inc. # Copyright (c) 2005-2006, Bob Ippo...
#!/usr/bin/python #this is a conglomerate of fasta-fixing scripts, now called FISH (FASTA ID SWAPPING HELPER) because lol i can acronym. ## #last edit abigailc@Actaeon Sept 7 2016 #things this doesn't do: play super nice with accession numbers instead of GI numbers. probably easy to convert, (see that one script that ...
import os from inginious.frontend.plugins.utils import create_static_resource_page from .api.stacked_bar_plot_api import StackedBarPlotAPI from .pages.analytics import AnalyticsPage from .api.analytics import AnalyticsAPI from .api.calendar_plot_api import CalendarPlotAPI from .api.time_series_plot_api import TimeSeri...
#!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. 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 # # U...
import urlparse import json import httplib2 from keystoneclient.v2_0 import ec2 from tests import utils class EC2Tests(utils.TestCase): def setUp(self): super(EC2Tests, self).setUp() self.TEST_REQUEST_HEADERS = { 'X-Auth-Token': 'aToken', 'User-Agent': 'python-keystonecli...
""" PSET-6 Problem 2: Decryption (decryptStory) Now that you have all the pieces to the puzzle, please use them to decode the file story.txt. In the skeleton file, you will see a method getStoryString() that will return the encrypted version of the story. Fill in the following function; it should create the wordList,...
#!/usr/bin/env python """ Shell Doctest module. :Copyright: (c) 2009, the Shell Doctest Team All rights reserved. :license: BSD, see LICENSE for more details. """ import commands import doctest import inspect import re import subprocess import sys master = None _EXC_WRAPPER = 'system_command("%s")' def system_comma...
""" A stream friendly, simple compression library, built around iterators. See L{compress} and L{decompress} for the easiest way to get started. After the TIFF implementation of LZW, as described at U{http://www.fileformat.info/format/tiff/corion-lzw.htm} In an even-nuttier-shell, lzw compresses input bytes with int...
import unittest import numpy as np from context import * def test_correlate(): """ Test correlate. """ img = CImg(np.array([[0, 0, 0, 0], [0, 1, 1, 0], [0, 1, 1, 0], [0, 0, 0, 0]])) kernel = CImg(np.array([[1, 1], ...
#!/usr/bin/env python import random import socket import struct import sys import time from Adafruit_MCP230xx import Adafruit_MCP230XX CABINET_VERSION='1.0b' START_MSG='## Cabinet version %s ##' % (CABINET_VERSION) MCAST_GRP = ('224.19.79.1', 9999) DRAWERS = 9 USE_PULLUPS = 1 RETRIGGER_DELAY = 10 #seconds WAIT_...
# coding: utf-8 # Copyright 2014-2015 Álvaro Justen <https://github.com/turicas/rows/> # # 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 License, or # (at yo...
import logging import re import os from efront import iohelpers as io DEV_DIR = r"c:\dev4.1" ROOTS = [ r"c:\svn", r"c:\git", ] def get_current_target(): regex = re.compile("<JUNCTION> +dev4\.1 \[(.*)\]") matches = [] def get_match(line): m = regex.search(str(line)) ...
# Author: Samuel Genheden samuel.genheden@gmail.com """ Program to insert an atomistic solute in box of ELBA molecules Examples -------- insert_in_elba.py data.toluene -o elba_toluene -b data.128dopc_4232wat -f forcefield.elba -z {0..30} insert_in_elba.py data.kalp23_heavyh -b data.128dopc_4232wat_mod_whole -f fo...
# 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 u...
import numpy as np import flopy # Assign name and create modflow model object modelname = 'tutorial1' mf = flopy.modflow.Modflow(modelname, exe_name='mf2005') # Model domain and grid definition Lx = 1000. Ly = 1000. ztop = 0. zbot = -50. nlay = 1 nrow = 10 ncol = 10 delr = Lx/ncol delc = Ly/nrow delv = (ztop - zbot)...
import copy import json from django.apps import apps from django.db import models from django.forms.models import ModelChoiceIterator from django.http import HttpResponse from django.utils.encoding import force_text import logging logger = logging.getLogger(__name__) class ViewException(Exception): pass class...
# -*- coding: utf-8 -*- """ This module implements writing CEF format events. """ from math import ceil, trunc import six from magnetsdk2.time import seconds_from_UTC_epoch def escape_header_entry(x): """ Escapes backslashes and pipes from a header entry. :param x: the string value to escape :retur...
# -*- coding: latin-1 -*- """ This module was created by Silas Gyger, silasgyger@gmail.com. It stands under CC BY 4.0 License. http://creativecommons.org/licenses/by/4.0/ """ import thinkdsp import numpy as np from matplotlib import pyplot class Wave(thinkdsp.Wave): def __getitem__(self, key): return self.ys[key]...
# -*- coding: utf-8 -*- from __future__ import print_function import os import sys import imp import subprocess ## Python 2.6 subprocess.check_output compatibility. Thanks Greg Hewgill! if 'check_output' not in dir(subprocess): def check_output(cmd_args, *args, **kwargs): proc = subprocess.Popen( ...
# -*- coding: utf-8 -*- from decimal import Decimal as D from django.test import TestCase from oscar.apps.basket.models import Basket from oscar.apps.catalogue.models import Option from oscar.apps.partner import availability, prices, strategy from oscar.test import factories from oscar.test.factories import ( Bas...
# Copyright 2015 Hewlett-Packard Development Company, L.P. # # 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...
# coding=utf-8 # Copyright (c) 2015 EMC Corporation. # 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 # #...
import os from pathlib import Path PROJECT_ROOT = Path(os.path.abspath(os.path.join( os.path.dirname(__file__), '../'))) SECRETS_PATH = PROJECT_ROOT/'secrets.json' #: SRTM tiles that cover New Zealand; for a visual, see http://geojson.io/#id=gist:anonymous/81b4cb465f1c78941f665c9038494f0f&map=5/-41.360/172.463 SRT...
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-06-05 20:08 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('coins', '0001_initial'), ] operations = [ migrations.RemoveField( ...
#!/usr/bin/env python from traits.api import HasTraits, Instance, Array, Bool, Dict, \ on_trait_change, Delegate, List, Color, Any, Instance, Int, File, \ Button, Enum, Str, DelegatesTo, Property, CFloat,Range from traitsui.api import View, Item, HGroup, VGroup, \ Group, Handler, HSplit, VSplit, RangeEd...
import os import html import json import subprocess import aiohttp.web from skywall.core.config import config from skywall.core.constants import API_ROUTE, BUILD_ROUTE from skywall.core.modules import import_enabled_modules def get_frontend(request): devel = config.get('devel') host = config.get('webpack.host...
# -*- coding: utf-8 -*- from amnesia.modules.content import Content from amnesia.modules.content_type import ContentType from amnesia.modules.event import Event from amnesia.modules.account import Account #from amnesia.modules.country import Country from amnesia.order import EntityOrder from amnesia.order import Path ...
# -*- coding: utf-8 -*- # # Copyright © 2014-2017 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions # of the GNU General Public License v.2, or (at your option) any later # version. This program is distributed...
import sdf import matplotlib.pyplot as plt import numpy as np import matplotlib as mpl plt.style.use('seaborn-white') # plt.rcParams['font.family'] = 'sans-serif' # plt.rcParams['font.sans-serif'] = 'Tahoma' # # plt.rcParams['font.monospace'] = 'Ubuntu Mono' plt.rcParams['font.size'] = 16 # plt.rcParams['axes.labelsiz...
""" ========================== Voting Chainladder Example ========================== This example demonstrates how you can can use the Voting Chainladder method. """ import numpy as np import pandas as pd import chainladder as cl # Load the data raa = cl.load_sample('raa') cl_ult = cl.Chainladder().fit(raa).ultimate_...
""" Django settings for banknotes project. Generated by 'django-admin startproject' using Django 1.9.7. 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 ...
__author__ = "Marie E. Rognes" __copyright__ = "Copyright (C) 2012 Simula Research Laboratory and %s" % __author__ __license__ = "GNU GPL Version 3 or any later version" # Last changed: 2012-05-01 __all__ = ["TaylorHoodSolver"] from dolfin import * from cbc.common.utils import * from cbc.common import * class Tayl...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """A module that implements the TextSampler class. """ import numpy import theano from theanolm.network import RecurrentState class TextSampler(object): """Neural network language model sampler A Theano function that generates text using a neural network languag...
#! /usr/bin/env python # -*- coding: utf-8 -*- # S.D.G """ Test the resources module of the package """ # Imports import unittest from unittest.mock import mock_open, patch import nnet.resources as resources import os import pandas import numpy as np from collections import OrderedDict import random __author__ = 'Be...
# -*- coding: utf-8 -*- from django.db import models, migrations import spirit.core.utils.models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Category', fields=[ ('id', models.AutoField(primary_key=...
# -*- coding: utf-8 -*- # # Copyright 2014 Carsten Klein <trancesilken@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 # #...
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
import pytest import os import zen.api OFFLINE = not zen.api._is_online() OFFLINE_REASON = 'Not online, skipping integration tests' @pytest.mark.skipif(OFFLINE, reason=OFFLINE_REASON) def test_zen_api_create_id(): assert zen.api.create_id(stage=zen.api.DEV) is not None @pytest.fixture() def pdf_file(resource...
from __future__ import unicode_literals from mopidy.mpd.exceptions import MpdNoExistError from mopidy.mpd.protocol import handle_request @handle_request(r'disableoutput\ "(?P<outputid>\d+)"$') def disableoutput(context, outputid): """ *musicpd.org, audio output section:* ``disableoutput`` T...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Nebula, 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 # # ...
import random import requests from framepy import modules import cherrypy HTTP_SERVER_ERRORS_BORDER = 500 PROTOCOL = 'http://' class Module(modules.Module): def before_setup(self, properties, arguments, beans): beans['http_template'] = HttpTemplate() def after_setup(self, properties, arguments, cont...
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Usage: cli.py [options] cli.py (-h | --help) cli.py --version Options: --local-url <url> URL of local docker-registry (default: $DOCKER_HOST) --local-port <int> Port of local docker-registry [default: 5000] --remote-url <url> URL of re...
# Copyright 2019-present Kensho Technologies, LLC. from collections import namedtuple from .compiler import ( emit_cypher, emit_gremlin, emit_match, emit_sql, ir_lowering_cypher, ir_lowering_gremlin, ir_lowering_match, ir_lowering_sql, ) from .schema import schema_info # A backend is ...
""" REST API Documentation for the NRS TFRS Credit Trading Application The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation. OpenAPI spec version: v1 ...
#!/usr/bin/env python import telnetlib import time import socket import sys class DefineNetworkDevice(object): def __init__(self, ip, uname, pword): ''' Object initialization ''' self.ip = ip self.uname = uname self.pword = pword self.TELNET_PORT = 23 self.TELNET_TIMEOUT = 6 def TelnetConnect(self...
from pandac.PandaModules import CollisionSphere, CollisionTube, CollisionNode from pandac.PandaModules import NodePath, BitMask32 from pandac.PandaModules import Point3, Point4, WaitInterval, Vec3, Vec4 from direct.interval.IntervalGlobal import LerpScaleInterval, LerpColorScaleInterval, LerpPosInterval, LerpFunc from ...
#!/usr/bin/python import argparse try: import mosquitto except ImportError: import paho.mqtt.client as mosquitto import time, random import sys from mqttrpc import MQTTRPCResponseManager, dispatcher import logging logging.getLogger().setLevel(logging.DEBUG) @dispatcher.add_method def foobar(**kwargs): ...
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# -*- test-case-name: xmantissa.test.test_webcmd -*- import os import sys from twisted.python import reflect from twisted.python.usage import UsageError from axiom import item, attributes from axiom.dependency import installOn, onlyInstallPowerups from axiom.scripts import axiomatic from xmantissa.web import SiteCo...
# Copyright (c) 2008-2009 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. """This is the Mac implementation of the layout_package.platform_utils package. This file should only be imported by that package.""" import os ...
""" tests.generator --------------- Test generator of application :author: Prev(prevdev@gmail.com) """ import pytest import os import shutil from jikji import Jikji def test_generate1() : """ Testing for generating of testapp1 """ jikji = Jikji('tests/testapp1', options=['sclear']) OUTPUT_ROOT = jikji.set...
########################################################################## # # Copyright (c) 2014, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Red...
#!/usr/bin/env python # Copyright 2017 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. """Tool for finding the cause of binary size bloat. See //tools/binary_size/README.md for example usage. Note: this tool will perform...
# Copyright (c) 2016-present, Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
""" Stock buy sell multiple times with transaction charge fn(i, have) if i is last: if bought: have to sell else: pass else: if bought: choices: sell or pass else: choices: pass or buy """ arr = [1, 3, 2, 8, 4, 10] arr = [1, 3, 2, 8, 4, 10, 2, 4, 6, 2, 4, 6, 1, 9, 5,...
#!/usr/bin/env python # # Command line tool to convert simple ESP-IDF Makefile & component.mk files to # CMakeLists.txt files # import argparse import subprocess import re import os.path import glob debug = False def get_make_variables(path, makefile="Makefile", expected_failure=False, variables={}): """ Giv...
import os.path import shutil import sys import genlisttypes from wxpybuild.wxpyext import build_extension, WXWIN wxpy_extra_sources = '''\ src/PythonUtils.cpp '''.split() wxpy_modules = [ ('_wxcore', ['src/wx.sip'] + wxpy_extra_sources), # TODO: use wxUSE_XXX flags # ('_wxhtml', ['src/html.sip']...
# -*- encoding: utf-8 -*- # Email reminder # Author: Alex S. Garzão <alexgarzao@gmail.com> # main.py import argparse import MySQLdb import MySQLdb.cursors import ConfigParser import logging from reminder_config import ReminderConfig from mandrill_config import MandrillConfig from send_reminders import SendReminders f...
def create_label(dmrs_xml, carg_clean=False): """ Create an identifying label attribute for each node and link, consisting of its arguments and properties. :param dmrs_xml: Input DMRS XML :return: Modified DMRS XML """ for entity in dmrs_xml: if entity.tag == 'node': ...
import uuid from django.contrib import messages from django.contrib.auth import logout from django.contrib.auth.decorators import login_required from django.contrib.sites.models import Site, RequestSite from django.shortcuts import redirect from django.template.response import TemplateResponse from django.views.gener...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2012 Slawomir Lisznianski <sl@minta.com> # # GNU General Public Licence (GPL) # # 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; eithe...
# coding=utf-8 # Copyright 2021 Arm Limited and affiliates. # Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved. # Copyright 2018 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may...
"""Models providing Programs support for the LMS and Studio.""" from collections import namedtuple from urlparse import urljoin from django.utils.translation import ugettext_lazy as _ from django.db import models from config_models.models import ConfigurationModel AuthoringAppConfig = namedtuple('AuthoringAppConfig...
import logging import _PyDbgEng from . import internalstate import ndk class registers_INT32(object): pc = property(fget=lambda self: self['eip']) sp = property(fget=lambda self: self['esp']) def __init__(self, task): self.task = task self.interface = task.host.interface.Registers def...
from django.contrib.auth.decorators import login_required from django.http import JsonResponse from django.shortcuts import redirect, render from django.views import View from experiments_manager.consumers import send_message from experiments_manager.helper import MessageStatus from git_manager.helpers.git_helper impo...
""" Steward extension providing framework for web interface """ import re import pyramid.renderers from pyramid.request import Request from pyramid.settings import asbool def to_json(value): """ A json filter for jinja2 """ return pyramid.renderers.render('json', value) def do_index(request): """ Rende...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015 CERN. # # 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 (at your option) any...
from __future__ import with_statement from unittest import TestCase import mock import statsd class TestTimerBase(TestCase): def tearDown(self): self._time_patch.stop() def get_time(self, mock_client, key): return float(self.get_arg(mock_client, key).split('|')[0]) def get_arg(self, moc...
from chunks import split_into_chunks, parse_header_and_data from pixels import PIXELS from scanlines import split_scanlines from filters import Filters def reconstructer(scanlines, bpp): reconstructed = [list(scanline.get('bytes')) for scanline in scanlines] def reconstruct_byte(filter_type, current_byte, y, ...
import datetime from abc import ABC from dataclasses import asdict, is_dataclass from enum import Enum from typing import Any, List, Optional class PlugIn(ABC): def can_handle(self, obj: Any) -> bool: ... def encode(self, obj: Any) -> Any: ... class DataClassPlugIn(PlugIn): def can_hand...
# -*- coding: utf-8 -*- # # django-relatives documentation build configuration file, created by # sphinx-quickstart on Thu May 16 15:28:58 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file...
#!/usr/bin/python ''' Atomix project, _scrape_b_i.py, (TODO: summary) Copyright (c) 2015 Stanford University Released under the Apache License v2.0. See the LICENSE file for details. Author(s): Manu Bansal ''' import csv import os import sys import re from _util import * class BlockScraper: def which(self, block...
import argparse import rsa """ python3 cli.py -f key generate -l 8 python3 cli.py -f message encode -k key_public -d encoded python3 cli.py -f encoded decode -k key_private -d decoded """ def generate(args): public, private = rsa.get_key_pair(int(args.length)) with open(args.file + '_public', 'w+...
# -*- coding: utf-8 -*- # # Copyright (c) 2012 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 a...
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Invoke-UserHunter', 'Author': ['@harmj0y'], 'Description': ('Finds which machines users of a specified group are logged into. ' 'P...
import os import time import json import gevent import pprint import signal import inspect import requests import humanize import functools import contextlib from gevent.pool import Pool from datetime import datetime, timedelta from holster.emitter import Priority, Emitter from disco.bot import Bot from disco.types.me...
from django.conf.urls import patterns, url, include from django.core.urlresolvers import reverse, NoReverseMatch from django.db import models from .views import ListView, CreateView, DetailView, UpdateView, DeleteView class GetAbsoluteUrlMixin: """ Mixin to add the methods get_absolute_url() and get_absolute...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (C) 2015 Jolla Ltd. # Contact: Jussi Pakkanen <jussi.pakkanen@jolla.com> # All rights reserved. # # You may use this file under the terms of BSD license as follows: # # Redistribution and use in source and binary forms, with or without # modification, ar...