src
stringlengths
721
1.04M
import os import struct from ubifs.defines import * from ubifs.misc import decompress def dents(ubifs, inodes, dent_node, path = '', perms = False): inode = inodes[dent_node.inum] dent_path = os.path.join(path, dent_node.name) if dent_node.type == UBIFS_ITYPE_DIR: try: if not ...
import itertools from collections import defaultdict from typing import Union, List, Dict from pyjolt.exceptions import JoltException def pairwise(iterable): """s -> (s0,s1), (s1,s2), (s2, s3), ...""" a, b = itertools.tee(iterable) next(b, None) return itertools.zip_longest(a, b) def type_generator...
# Copyright 2017 TVB-HPC contributors # # 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...
from gevent.wsgi import WSGIServer as BaseWSGIServer from werkzeug.debug import DebuggedApplication from werkzeug.contrib.fixers import ProxyFix import odoo.http from odoo.service.wsgi_server import application_unproxied as odoo_application from odoo.tools import config import logging import greenlet import gevent ...
# # 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 us...
# 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 # distributed under t...
# -*- coding: utf-8 -*- import tempfile import zipfile from django.contrib.auth.decorators import login_required from django.contrib.admin.views.decorators import staff_member_required from django.shortcuts import render, get_object_or_404 from django.http import Http404 from django.http import HttpResponseRedirect, ...
from django.shortcuts import render from django.http import HttpResponse from django.http import HttpResponseRedirect from django.http import request import json import tenjin from tenjin.helpers import * # Create your views here. from utils import * ############### ## API views ## ############### def api_index(reque...
#!/usr/bin/env python __author__ = 'Michael Meisinger' from nose.plugins.attrib import attr from pyon.public import BadRequest from pyon.util.unit_test import UnitTestCase from ion.util.parse_utils import get_typed_value @attr('UNIT') class TestParseUtils(UnitTestCase): def test_get_typed_value(self): ...
#!/usr/bin/env python3 # -*- coding: utf8 -*- import threading, time from tkinter import * from tkinter.messagebox import * status = '' #Variable servant à la fois à indiquer si l'on peut poursuivre l'exécution du programme (càd si l'on a entré un (ou plusieurs, selon la situation) nom valide et cliqué sur OK) et à r...
import os basedir = os.path.abspath(os.path.dirname(__file__)) class Config: SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string' SQLALCHEMY_COMMIT_ON_TEARDOWN = True SQLALCHEMY_TRACK_MODIFICATIONS = False MAIL_SERVER = 'smtp.googlemail.com' MAIL_PORT = 587 MAIL_USE_TLS = True ...
# Copyright 2016 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 law or a...
# Copyright 2017 Canonical Ltd. # Licensed under the LGPLv3, see LICENCE file for details. import base64 import datetime import json from unittest import TestCase try: from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler except ImportError: from http.server import HTTPServer, BaseHTTPRequestHandler imp...
# -*- coding: utf-8 *-* import warnings from redis.connection import Token from redis.exceptions import ConnectionError, RedisError from .base import RedisBase class ServerCommands(RedisBase): # SERVER INFORMATION def bgrewriteaof(self): "Tell the Redis server to rewrite the AOF file from data in m...
import smtplib import subprocess import sys import time import threading import datetime from email.mime.text import MIMEText # Please Fill in with Correct Information to use SMTP_SERVER = "smtp.gmail.com:587" SMTP_UNAME = "email@email.com" SMTP_PASSWD = "incorrect_password" DEFAULT_NOTIFY_PAUSE = 3600 DEFAULT_CHECK_...
#Quick Stocks v.2 #Author: Hunter Barbella (aka hman523) #Use: to have a command line interface for checking stocks #This code uses the GPL licence while the API uses the MIT licience #This code is provided AS IS and provides no warrenty #Imports the libraries requests for making the GET request and #JSON fo...
# # This file is part of CAVIAR. # # CAVIAR 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. # # CAVIAR is distributed in the hope that ...
# Orca # # Copyright 2009 Sun Microsystems Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This libr...
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
## Copyright (c) 2003 Henk Punt ## 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, merge, publish, #...
# supplementing modifiedMexicanHatTest5.py # outputing the charts, given the results import numpy as np import matplotlib.pyplot as plt from armor import pattern from armor import defaultParameters as dp dbz = pattern.DBZ DS = pattern.DBZstream dataFolder = dp.root + "labLogs/2014-5-2-modifiedMexicanHatTest5/" o...
#!/usr/bin/python """Reset location services to factory settings.""" import os import platform import subprocess from distutils.version import LooseVersion def root_check(): """Check for root access.""" if not os.geteuid() == 0: exit("This must be run with root access.") def os_vers(): """Retr...
# -*- coding: utf-8 -*- from bda.plone.checkout.vocabularies import country_vocabulary from bda.plone.checkout.vocabularies import gender_vocabulary from bda.plone.payment import Payments from bda.plone.shipping import Shippings from bda.plone.shop import message_factory as _ from bda.plone.shop.utils import get_shop_a...
from django.contrib.auth import get_user_model from parler_rest.fields import TranslatedFieldsField from parler_rest.serializers import TranslatableModelSerializer from rest_framework import serializers from rest_framework.fields import SerializerMethodField, DateTimeField from nextcloudappstore.core.models import Php...
#!/usr/bin/env python import sys import time import random import argparse from webapollo import WAAuth, WebApolloInstance def pwgen(length): chars = list("qwrtpsdfghjklzxcvbnm") return "".join(random.choice(chars) for _ in range(length)) if __name__ == "__main__": parser = argparse.ArgumentParser( ...
import tkSimpleDialog import tkMessageBox #import p3d.protein #import p3d.geo from pymol.wizard import Wizard from pymol import cmd, util from pymol.controlling import mode_dict class Bond(object): def __init__(self,bond1,bond2,resid1,resid2): if bond2 > bond1: self.bond1=bond1 self...
# -*- coding: utf-8 -*- # """ """ import json import GlobalDefine from KBEDebug import * class State: """ """ def __init__(self): """ """ pass # ---------------------------------------------------------------- # public # ---------------------------------------------------------------- def getState(self):...
#! /usr/bin/python3.4 #! /usr/bin/python # # test XML parse class # Copyright (c) 2015 Valentin Kim # # 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 yo...
# coding=utf-8 import logging from mailchimp.exceptions import MCInterestCategoryNotFound, MCListNotFound, ObjectNotFound from mailchimp import Request from .base_object import BaseObject from .mc_link import MCLink logger = logging.getLogger(__name__) class MCInterestCategory(BaseObject): item_url = '/lists/{...
import logging class ServiceCountry(object): def __init__(self): self.full_name = None # type: unicode self.short_name = None # type: unicode self.postal_code_example = None # type: unicode self.postal_code_regex = None # type: unicode self.one_postal_code = False ...
from FeedlyClient import FeedlyClient FEEDLY_REDIRECT_URI = 'http://localhost:8000' FEEDLY_CLIENT_ID = 'sandbox' FEEDLY_CLIENT_SECRET = 'JGC5BYXNVW9NXAK48KH9' def get_feedly_client(token=None): if token: return FeedlyClient(token=token, sandbox=True) else: return FeedlyClient( cli...
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # 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 us...
from __future__ import print_function, absolute_import, nested_scopes, generators, division, with_statement, unicode_literals import logging from hytra.core.ilastik_project_options import IlastikProjectOptions from hytra.jst.conflictingsegmentsprobabilitygenerator import ConflictingSegmentsProbabilityGenerator from hy...
from helpers import next_subleq from helpers import subleq from helpers import clear import re def add(instr, assem): a = instr.args[0]; b = instr.args[1]; c = instr.result; t0 = assem.getNextTemp(); #check for literals if re.match("\d+",a): if a not in assem.dataMem: asse...
"""Core items test suite.""" import pathlib import pytest import holocron @pytest.fixture( scope="function", params=[ pytest.param(42, id="int-value"), pytest.param("key", id="str-value"), pytest.param(42.42, id="float-value"), pytest.param(True, id="bool-value"), py...
"""Provides helpful stuff for discoverables.""" # pylint: disable=abstract-method import ipaddress from urllib.parse import urlparse from ..const import ( ATTR_NAME, ATTR_MODEL_NAME, ATTR_HOST, ATTR_PORT, ATTR_SSDP_DESCRIPTION, ATTR_SERIAL, ATTR_MODEL_NUMBER, ATTR_HOSTNAME, ATTR_MAC_ADDRESS, ATTR_PROPERTIE...
# -*- coding: utf-8 -*- from Plugins.Plugin import PluginDescriptor from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.config import config, ConfigSelection, ConfigYesNo, getConfigListEntry, ConfigSubsection, ConfigText from Components.ConfigList import ConfigListScreen from Co...
#!/usr/bin/env python # coding: utf-8 # vim:et:sta:sts=2:sw=2:ts=2:tw=0: from __future__ import division, unicode_literals, print_function, absolute_import import urwidm import time palette = [ ('body', 'light gray', 'black'), ('header', 'white', 'dark blue'), ('footer', 'light green', 'black'), ('foot...
import sys import os import cairo import shlex def comment(cmt): cmt = cmt[:-1] #print "in comment: ", cmt def draw(x): global ctx ''' hard way: very long list of if-elif's if x[0] == "moveto": ctx.move_to( int(x[1]), int(x[2]) ) elif x[0] == "lineto": ctx.line_to( int(x[1]), int(x[2]) ) ctx.stroke(...
from django.conf.urls import * from django.conf.urls import patterns, include, url from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.conf import settings admin.autodiscover() urlpatterns = patterns('', url(r'^home/', 'variables.views.home')...
import json from django.http import JsonResponse from django.contrib.auth.decorators import login_required from django.db.models import Q from django.views.decorators.http import require_POST from base.decorators import ajax_required from document.models import DocumentTemplate, FW_DOCUMENT_VERSION from document.help...
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ Bot to download archiviolastampa.it and upload it to the Internet Archive """ # # (C) Federico Leva, 2020 # # Distributed under the terms of the MIT license. # __version__ = '0.3.0' import collections import concurrent.futures import csv import datetime from internetarch...
import importlib import io import os import dotenv NO_DEFAULT = type( "NO_DEFAULT", (), { "__nonzero__": (lambda self: False), # Python 2 "__bool__": (lambda self: False), # Python 3 "__str__": (lambda self: self.__class__.__name__), "__repr__": (lambda self: str(self)),...
# 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 json import os import tempfile from StringIO import StringIO from corehq.apps.domain.views import BaseDomainView from corehq.apps.reports.util import \ DEFAULT_CSS_FORM_ACTIONS_CLASS_REPORT_FILTER from corehq.apps.style.decorators import ( use_select2, use_daterangepicker, use_jquery_ui, use_...
# -*- coding: utf-8 # Pytoto Manga Downloader # A simple Python scraper for the Batoto Online Manga Reader. # # Bato.to - http://bato.to/ # # This scraper uses Selenium (Chrome), please refer to: # http://selenium.googlecode.com/svn/trunk/docs/api/py/index.html # # This code is 75 columns wide for clarity. # Names of f...
""" Constant dollar transformations =============================================================================== Overview ------------------------------------------------------------------------------- The function ``const2curr`` computes the equivalent generic cashflow in current dollars from a generic cashflow ...
import logging import os import json import sys from object_detector import ObjectDetector from jsonmerge import merge import atexit config = {} logger = None def bootstrap(options): if not os.path.exists('log'): os.makedirs('log') if not os.path.exists('tmp'): os.makedirs('tmp') creat...
from django.conf import settings from django.db import models from django.utils import timezone from translations.models import Translatable, Translation try: from ckeditor.fields import RichTextField except ImportError: RichTextField = models.TextField class News(Translatable): author = models.F...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
#!=============================== #! Demo of central limit theorem #!=============================== from __future__ import print_function import sys from pylab import * from pacal import * from pacal import params import time params.general.warn_on_dependent = False if __name__ == "__main__": colors = "kbgrcmy...
"""Project signals""" import logging import django.dispatch from django.contrib import messages from django.dispatch import receiver from django.utils.translation import ugettext_lazy as _ from readthedocs.oauth.services import registry before_vcs = django.dispatch.Signal(providing_args=["version"]) after_vcs = dj...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2016 Eugene Frolov <eugene@frolov.net.ru> # # 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 # # ...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import atexit import logging import telemetry.internal.platform.power_monitor as power_monitor def _ReenableChargingIfNeeded(battery): if not battery.Ge...
from selenium import webdriver from companies.red_hat import red_hat from app import db from models import Company def print_result(info): """Takes in a dictionary with keys for 'company', 'title', 'url', and 'description' and prints them neatly to the terminal""" for key in ['company', 'title', 'url', ...
"""Webcampak main application entry point.""" from cement.core.foundation import CementApp from cement.utils.misc import init_defaults from cement.core.exc import FrameworkError, CaughtSignal from webcampak.core import exc # Application default. Should update config/webcampak.conf to reflect any # changes, or additi...
# -*- coding: utf-8 -*- from difflib import SequenceMatcher #from cm.utils.spannifier import Spannifier import sys, operator from cm.utils.spannifier import spannify from cm.converters.pandoc_converters import pandoc_convert import logging from cm.utils.spannifier import get_the_soup import re import html5lib from htm...
from importlib import import_module from django.conf import settings from orchestra.core.errors import InvalidSlugValue from orchestra.core.errors import SlugUniquenessError class Workflow(): """ Workflows represent execution graphs of human and machine steps. Attributes: slug (str): ...
from bs4 import BeautifulSoup from unidecode import unidecode import requests def makelist(table, title): result = [] allrows = table.findAll('tr') idx = 0 for row in allrows: rowData = [] allcols = row.findAll('td') if len(allcols) < 1: allcols = row.findAll('th') ...
# # Copyright (C) 2007, Mark Lee # # http://rl-glue-ext.googlecode.com/ # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
''' SASSIE: Copyright (C) 2011 Joseph E. Curtis, Ph.D. 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 your option) any later version. ...
import time import cantal from cantal import fork from contextlib import contextmanager class Branch(fork.Branch): __slots__ = fork.Branch.__slots__ + ('_errors',) def __init__(self, suffix, state, parent, **kwargs): super(Branch, self).__init__(suffix, state, parent, **kwargs) self._errors ...
"""Module with common utilities to this package""" import re from datetime import timedelta import importlib def my_import(class_name): """ Usage example:: Report = my_import('myclass.models.Report') model_instance = Report() model_instance.name = 'Test' model_instance.save()...
""" /* * Copyright 2008 Google Inc. * Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net> * * 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/license...
#encoding: utf-8 import cPickle as pickle from classify import load_cls, label_chars from cv2 import GaussianBlur from feature_extraction import get_zernike_moments, get_hu_moments, \ extract_features, normalize_and_extract_features from functools import partial import glob from multiprocessing.pool import Pool im...
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Copyright 2015 Pascual Martinez-Gomez # # 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 -*- # 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...
""" Given a sif file, enumerates loops (cyclic paths) up to a given depth. Optionally the user can provide a list of start nodes. Otherwise, we will search starting from all nodes. NOTE: This code will stop searching once a start node is reached, so if we have a loop like this: YDR293C -> NPR74 -> YDR293C We will not...
import fasttext import gensim import numpy import flask import spacy import argparse import os import operator import collections app = flask.Flask(__name__) def file_exists(x): if not os.path.isfile(x): import argparse raise argparse.ArgumentTypeError("{0} is not a file".format(x)) return x...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ReplicationTopology' db.create_table(u'physical_replicati...
#!/usr/bin/env python # coding: utf-8 # # Copyright (c) 2015, PAL Team. # All rights reserved. See LICENSE for details. import re from os import path from pal.services.base_service import Service from pal.services.base_service import wrap_response def get_jokes(): file_path = path.realpath(path.join(path.dirnam...
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-12-28 02:07 from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0004_auto_20161227_1717'), ] operations = [ migration...
#!/usr/bin/env python import sys,re,time,argparse from multiprocessing import cpu_count,Pool def main(args): # print >>sys.stdout, "Start analysis: " + time.strftime("%a,%d %b %Y %H:%M:%S") output_gpd = args.output iso_list = get_iso_info(args.isoform) p = Pool(processes=args.cpu) csize = 100 results = p.imap(fun...
import os import errno import csv from typing import List, Dict, TypeVar, Any from argparse import Namespace import numpy as np T = TypeVar("T") def all_files(folder_path: str, exts: List[str]) -> str: """ Gather all files conforming to provided extensions. :param folder_path: Path to folder :type...
#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # *************************************...
#!/usr/bin/env python # Copyright (C) 2015-2016 xtr4nge [_AT_] gmail.com # # 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 your option) any later versi...
import pygame from pygame.locals import * import pymunk from source import game from source.constants import * from source.utilities import * from source.weapon import * class Bomber: def __init__(self): self.width = width = BOMBER_WIDTH self.height = height = BOMBER_HEIGHT vertices = [ ...
import functools from preserialize.serialize import serialize from restlib2.http import codes from avocado.models import DataQuery from serrano.links import reverse_tmpl from serrano.resources import templates from serrano.resources.query.base import query_posthook, QueryBase class QueryForksResource(QueryBase): ...
# -*- coding: utf-8 -*- # 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 Apach...
# 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 law or agreed to in...
##################################################################### # u1.py # # (c) Copyright 2021, Benjamin Parzella. 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 Foundat...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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...
""" gstation-edit CCMidiEvent definition """ # this file is part of gstation-edit # Copyright (C) F LAIGNEL 2009-2017 <fengalin@free.fr> # # gstation-edit 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...
import pygame import time import math import os.path class ClockMode(object): def __init__(self, assets_path): self.clockfont = pygame.font.Font(os.path.join(assets_path, "Helvetica.ttf"), 70) self.datefont = pygame.font.Font(os.path.join(assets_path, "Arimo-Regular.ttf"), 20) self.white =...
# Copyright 2016 Hewlett Packard Enterprise 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 b...
## # Copyright (c) 2005-2014 Apple Inc. All rights reserved. # # 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, mod...
# -*- coding: utf-8 -*- """ * Copyright (C) 2011-2016, it-novum GmbH <community@openattic.org> * * openATTIC 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; version 2. * * This package is distribut...
#!/usr/bin/env python # Copyright (C) 2006-2021 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia 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 (FSF), e...
"""Tests for go.apps.jsbox.outbound.""" from mock import Mock from twisted.internet.defer import inlineCallbacks, succeed from vxsandbox.tests.utils import DummyAppWorker from vxsandbox.resources.tests.utils import ResourceTestCaseBase from vumi.message import TransportUserMessage from vumi.tests.helpers import Vum...
from django.contrib import auth from django.core.exceptions import ImproperlyConfigured class RemoteUserMiddleware(object): """ Middleware for utilizing web-server-provided authentication. If request.user is not authenticated, then this middleware attempts to authenticate the username passed in the ``...
#!/usr/bin/python3 import argparse from read_json import * import tempfile import shutil import pypdftk import os def get_pdf(source, dest): shutil.copy(source, dest) def run(idir, bdir, ofile): authors, venues, papers = read_all_info(idir) fpdf_names = [] tmpdirname = tempfile.mkdtemp...
#!/usr/bin/env python """Convert YAML dialogue files from the Techdemo1 format to the new Techdemo2 format. @author: M. George Hansen <technopolitica@gmail.com> """ import os.path import sys sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), os....
from mlagents.trainers.buffer import BufferKey import pytest import numpy as np from mlagents.trainers.torch.components.reward_providers import ( ExtrinsicRewardProvider, create_reward_provider, ) from mlagents_envs.base_env import BehaviorSpec, ActionSpec from mlagents.trainers.settings import RewardSignalSett...
#!/usr/bin/python2 import os import sys import hooking import traceback import fcntl import ast from xml.dom import minidom try: # 3.0 compat import libvirtconnection libvirtconnection except ImportError: # 3.1 compat from vdsm import libvirtconnection ''' Placed in before_vm_start vmfex hook: Ad...
# Copyright (c) 2018 PaddlePaddle Authors. 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 app...
import os import shutil import glob import logging from autotest.client import test, utils from autotest.client.shared import error class ctcs(test.test): """ This autotest module runs CTCS (Cerberus Test Control System), that is being maintained on a new location, since both CTCS and CTCS2 on sourceforg...
""" This code was generated by Codezu. Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. """ from mozurestsdk.mozuclient import default as default_client from mozurestsdk.mozuurl import MozuUrl; from mozurestsdk.urllocation import UrlLocation from mozure...
""" Unit tests for the stem.version.Version parsing and class. """ import unittest import stem.version from stem.version import Version import stem.util.system import test.mocking as mocking TOR_VERSION_OUTPUT = """Mar 22 23:09:37.088 [notice] Tor v0.2.2.35 \ (git-73ff13ab3cc9570d). This is experimental software. Do...
from __future__ import division, absolute_import, print_function import numpy as np from . import kde_utils class TestCDF(kde_utils.KDETester): @classmethod def setUpClass(cls): kde_utils.setupClass_lognorm(cls) def method_works(self, k, method, name): begin, last = k.cdf([k.lower, k.uppe...
""" dj-stripe PaymentIntent Model Tests. """ from copy import deepcopy from unittest.mock import patch import pytest import stripe from django.test import TestCase from djstripe.enums import PaymentIntentStatus from djstripe.models import Account, Customer, PaymentIntent from tests import ( FAKE_ACCOUNT, FAKE...