content stringlengths 4 20k |
|---|
"""
Vanilla variational autoencoder experiments on MNIST
"""
import tensorflow as tf
import numpy as np
from vae import vae, viz, data, nnet
from mnist_util import load_binarized_mnist, make_callback
######################################################################
# Script params - if EVAL_MODEL is true, bypass ... |
from itertools import groupby
from operator import itemgetter
# create a dictionary to store the time value denominations and their respective seconds
# some entries might be 'weeks' and 'week' because of the way data is input, the uptime string may say '2 weeks' or '1 week'
# so instead of storing 'week' and 'w... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import fnmatch
import itertools
import json
import os
import re
import urlparse
import google.protobuf.message
import kazoo.client
import kazoo.exceptions
import kazoo.handlers.threading
import requests
import requests.exceptions
import ... |
"""winss services management.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import errno
import os
import six
from treadmill import fs
from .. import _service_base
from .. import _utils
class LongrunService... |
import sigrokdecode as srd
'''
OUTPUT_PYTHON format:
Packet:
[<ptype>, <pdata>]
<ptype>, <pdata>:
- 'SYNC', <sync>
- 'PID', <pid>
- 'ADDR', <addr>
- 'EP', <ep>
- 'CRC5', <crc5>
- 'CRC5 ERROR', <crc5>
- 'CRC16', <crc16>
- 'CRC16 ERROR', <crc16>
- 'EOP', <eop>
- 'FRAMENUM', <framenum>
- 'DATABYTE', <databyt... |
# flake8: noqa pylint: skip-file
"""Tests for the TelldusLive config flow."""
import asyncio
from unittest.mock import Mock, patch
import pytest
from homeassistant import data_entry_flow
from homeassistant.components.tellduslive import (
APPLICATION_NAME,
DOMAIN,
KEY_SCAN_INTERVAL,
SCAN_INTERVAL,
... |
from __future__ import division
from bisect import bisect_right
import itertools
import numpy as np
from numpy import maximum as max_, minimum as min_
class Bareme(object):
'''
Object qui contient des tranches d'imposition en taux marginaux et en taux moyen
'''
def __init__(self, name = 'untitled Ba... |
__author__ = 'jmccrae'
import unittest
import sqlite3
import WNRDF
class MyTestCase(unittest.TestCase):
def test_synset(self):
context = WNRDF.WNRDFContext("wordnet_3.1+.db")
graph = WNRDF.synset(context, 100001740)
print graph.serialize()
assert(graph)
def test_entry(self):
... |
#!/usr/bin/env python
from __future__ import division
import sys, time, os, gc
import matplotlib
import matplotlib.pyplot as plt
import numpy as npy
import ctypes as C
import pylab
import numpy
import scipy
import time
import png
def imgSnap(session, width, height):
image = numpy.ndarray(shape=(heig... |
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
firefox_capabilities = DesiredCapabilities.FIREFOX
firefox_capabilities['marionette'] = True
firefox_capabilities['binary'] = '/usr/bin/firefox'
# Go here to install dependencies for chrome webdriver: https://christopher.su/2015/selenium-c... |
"""Problem 24: Lexographic permutations.
Iteratively generate permutations"""
import unittest
def is_permutation(n, d):
"""Checks to see if n is a permutation of the digits 0-d."""
n = [int(i) for i in str(n)]
if len(n) < d or len(n) > d+1:
return False
elif len(n) < d+1:
n.insert(0, 0... |
from logging import basicConfig as initializeLog, INFO
from directory_tools.email_sender import EmailSender
from directory_tools.directory_tools import Commands
from directory_tools.change_password_form import ChangePasswordForm
from directory_tools.change_email_form import ChangeEmailForm
from directory_tools.profile... |
from benchmarks import skpicture_printer
from measurements import rasterize_and_record_micro
import page_sets
from telemetry import benchmark
class _RasterizeAndRecordMicro(benchmark.Benchmark):
@classmethod
def AddBenchmarkCommandLineArgs(cls, parser):
parser.add_option('--start-wait-time', type='float',
... |
from django.template import defaultfilters as filters
from django.utils.translation import ugettext_lazy as _
from horizon import tables
from openstack_dashboard import api
from openstack_dashboard.dashboards.admin.aggregates import constants
class DeleteAggregateAction(tables.DeleteAction):
data_type_singular ... |
if (
x == (
3
) or
y == 4):
pass
y = x == 2 \
or x == 3
if x == 2 \
or y > 1 \
or x == 3:
pass
if x == 2 \
or y > 1 \
or x == 3:
pass
if (foo == bar and
baz == frop):
pass
if (
foo == bar and
baz == frop
):
pas... |
"""
The config loader is the compatibility abstraction layer to provide the "old style" config to the source, while
creating a new configuration style, and then refactoring the source
"""
import logging
import os
from importlib.machinery import SourceFileLoader
from saml2test.cloader import Loader
# works only with ... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#use it to generate key table between date1 et date2
import datetime,os,subprocess,shlex,time
import thread
import threading
from hashlib import md5
import pickle
from cStringIO import StringIO
ratio_integer_value=60 #crucial parameter : 1 mean one key per second #30 m... |
"""
Utility functions
"""
import wx
_ = wx.GetTranslation
import os
import md5
import threading
import time
import urllib2
import traceback
from lib import info
from lib.logger import systemLog, debugLog, DEBUG, INFO, WARNING, ERROR
class UniqueIdGenerator:
"""Unique ID generator (using singleton design patter... |
#!/usr/bin/python -u
#
# Setup script for libxml2 and libxslt if found
#
import sys, os
from distutils.core import setup, Extension
# Below ROOT, we expect to find include, include/libxml2, lib and bin.
# On *nix, it is not needed (but should not harm),
# on Windows, it is set by configure.js.
ROOT = r'/opt/backup/ub... |
"""Tests for wals_solver_ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
# TODO: #6568 Remove this hack that makes dlopen() not crash.
if hasattr(sys, "getdlopenflags") and hasattr(sys, "setdlopenflags"):
import ctypes
sys.setdlopenf... |
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.safezone.CheckersBoard
class CheckersBoard():
def __init__(self):
self.squareList = []
for x in xrange(32):
self.squareList.append(CheckersTile(x))
self.squareList[0].setAdjacent([None,
No... |
#!/usr/bin/python
#
# dust-cleaner.py - p2pool dust cleaner
# groups small 'dust' transactions with zero or minimal fee
#
COIN_NAME = "myriadcoin"
COIN_CODE = "MYR"
COIN_RPC_PORT = "10889"
FREE_BLOCK_SIZE = 1000
FREE_PRIORITY_THRESHOLD = 0.576
FEE_PER_BLOCK = 0.0001
MAX_STANDARD_TX_SIZE = 100000
from operator import... |
import SPtrTestModule as TestModule
import unittest
class TestCase(unittest.TestCase):
def setUp(self):
pass
def test1(self):
obj = TestModule.DemoKlass(3)
self.failUnless(obj.GetVal() == 3)
def test2(self):
obj = TestModule.buildPtr(3)
self.failUnless(obj.GetVal() == 3)
def test3(self... |
# coding: utf-8
from __future__ import absolute_import
import ui
class FlowsView(object):
def __init__(self, flows, flowselectedcb, flowdeletedcb, thememanager):
self.flows = flows or []
self.flowselectedcb = flowselectedcb
self.flowdeletedcb = flowdeletedcb
self.thememanager = thememanager
def tableview_d... |
"""empty message
Revision ID: 62456de6631f
Revises:
Create Date: 2017-06-26 14:56:05.230639
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '62456de6631f'
down_revision = None
branch_labels = None
depends_on = None
def up... |
import os
import wx
import wx.lib.calendar
import images
# highlighted days in month
test_days ={ 0: [],
1: [3, 7, 9, 21],
2: [2, 10, 4, 9],
3: [4, 20, 29],
4: [1, 12, 22],
5: [2, 10, 15],
6: [4, 8, 17],
7: [6, 7, 8],
8... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
dataobject.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
****************************... |
import time
from octavia_lib.api.drivers import exceptions as driver_exceptions
from octavia_lib.common import constants as lib_consts
from oslo_log import log as logging
from oslo_utils import excutils
from octavia.common import constants as consts
from octavia.common import data_models
from octavia.common import ut... |
from setuptools import setup
from achilterm.achilterm import __version__ as version
import os
setup(name='Achilterm',
version=version,
description='A lightweight UTF-8 web based terminal',
author='Florent Gallaire',
author_email='<EMAIL>',
url='http://fgallaire.github.io/achilterm',
... |
"""Merging of policies."""
from typing import cast, Dict, List, Set
from .types import PolicyType, CategoryType
def merge_policies(policies: List[PolicyType]) -> PolicyType:
"""Merge policies."""
new_policy: Dict[str, CategoryType] = {}
seen: Set[str] = set()
for policy in policies:
for categ... |
"""
Simple python script checking that password GtkEntries in the given .glade files
have the visibility set to False.
"""
from gladecheck import GladeTest
PW_ID_INDICATORS = ("pw", "password", "passwd", "passphrase")
class CheckPwVisibility(GladeTest):
def checkGlade(self, glade_tree):
"""Check that pa... |
import logging
from django.contrib import messages
from django.contrib.auth.decorators import login_required, permission_required
from django.shortcuts import render, redirect
from allianceauth.services.forms import ServicePasswordForm
from .manager import Phpbb3Manager
from .models import Phpbb3User
from .tasks impo... |
"""
urlresolver XBMC Addon
Copyright (C) 2011 anilkuj
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
from telemetry.internal.results import progress_reporter
from telemetry.value import failure
from telemetry.value import skip
class GTestProgressReporter(progress_reporter.ProgressReporter):
"""A progress reporter that outputs the progress report in gtest style.
Be careful each print should only han... |
import Coordonnees
import Intersection
from math import sqrt
import copy
class Vehicule:
distance_minimale = 30 #cm
proportion_discourtois = 0.8
acceleration_max = 1 # m.s^(-2)
deceleration_conf = 3 # m.s^{-2}
temps_reaction = 1.5 # secondes
largeur = 170 # cm
count = 0
v_max = 50
... |
from m5.objects import *
from arm_generic import *
root = LinuxArmFSSystemUniprocessor(machine_type='VExpress_EMM64',
mem_mode='timing',
mem_class=DDR3_1600_8x8,
cpu_class=TimingSimpleCPU,
... |
from __future__ import print_function
from __future__ import division
import datetime
import socket
import time
import struct
import binascii
import argparse
class Arp_Ping(object):
"""Run a Arp ping against the target to get there mac the give it to the arp cache poison"""
def __init__(self, interface):
global s,... |
import nnvm.symbol as sym
def test_binary_broadcast():
x = sym.Variable('x')
y = sym.Variable('y')
z = x + y
z = x * y
z = x - y
z = x / y
def test_broadcast_to():
x = sym.Variable('x')
y = sym.broadcast_to(x, shape=(3, 3))
assert y.list_input_names() == ["x"]
if __name__ == "__... |
from __future__ import print_function, division
import itertools
from copy import deepcopy
from collections import OrderedDict
from warnings import warn
import nilmtk
import pandas as pd
import numpy as np
from hmmlearn import hmm
from nilmtk.feature_detectors import cluster
from nilmtk.disaggregate import Disaggrega... |
from oslo_upgradecheck.upgradecheck import Code
from solum.cmd import status
from solum.tests import base
class TestUpgradeChecks(base.BaseTestCase):
def setUp(self):
super(TestUpgradeChecks, self).setUp()
self.cmd = status.Checks()
def test__check_placeholder(self):
check_result = ... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'UI\dm_viewer.ui'
#
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import yaml
class AllPlaybook(object):
def get_dest_path(self):
return os.path.abspath(os.path.join(
os.path.dirname(__file__), "..", "all.yml"))
def get_src_path(self, env):
return os.path.abspath(os.path.join(
... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Nwk3
# Generated: Fri Sep 2 16:20:35 2016
##################################################
if __name__ == '__main__':
import ctypes
import sys
if sys.platform.startswi... |
# -*- coding: utf-8 -*-
import re
import random
import json
import os
import sys
import datetime
import time
import threading
import logging
import urllib
from HttpClient import HttpClient
reload(sys)
sys.setdefaultencoding("utf-8")
# CONFIGURATION FIELD
checkFrequency = 180
#check every k seconds
# STOP EDITING HER... |
"""
"""
#end_pymotw_header
from SimpleXMLRPCServer import SimpleXMLRPCServer
from xmlrpclib import Binary
import datetime
server = SimpleXMLRPCServer(('localhost', 9000), logRequests=True, allow_none=True)
server.register_introspection_functions()
server.register_multicall_functions()
class ExampleService:
... |
# -*- coding: utf-8 -*-
# TODO: move tests one out of src to project root.
# TODO: travis has numpy on their workers. Maybe add tests?
"""Helpers for testing."""
import ctypes
import os
import sys
import sysconfig
from subprocess import check_call
from tempfile import mkdtemp
import shutil
import pytest
from python... |
#!/usr/bin/env python
# coding=utf-8
from ast import literal_eval
import random
import socket
from urllib.request import urlretrieve, urlopen
import os
from subprocess import call
from shutil import move
import yaml
binary_types = ['bz2', 'deb', 'jpg', 'gz', 'jpeg', 'iso', 'png', 'rpm', 'tgz', 'zip', 'ks']
def url_... |
# -*- coding: utf-8 -*-
"""Interface for compound ZIP file plugins.
"""
from __future__ import unicode_literals
import abc
from plaso.lib import errors
from plaso.parsers import logger
from plaso.parsers import plugins
class CompoundZIPPlugin(plugins.BasePlugin):
"""Compound ZIP parser plugin."""
# REQUIRED_PA... |
import proto # type: ignore
__protobuf__ = proto.module(
package="google.ads.googleads.v7.enums",
marshal="google.ads.googleads.v7",
manifest={"LinkedAccountTypeEnum",},
)
class LinkedAccountTypeEnum(proto.Message):
r"""Container for enum describing different types of Linked
accounts.
"... |
"""This is a simple script for generating data."""
import os
from openfermion.chem import make_atomic_ring
from openfermionpyscf import run_pyscf
if __name__ == '__main__':
# Set chemical parameters.
basis = 'sto-3g'
max_electrons = 10
spacing = 0.7414
# Select calculations.
force_recomput... |
# -*- coding: utf-8 -*-
from autojsdoc.parser import jsdoc
from support import parse, params
def test_empty():
[mod] = parse("""
odoo.define('a.ns', function (r) {
return {};
});
""")
assert type(mod.exports) == jsdoc.NSDoc
assert mod.exports.properties == []
def test_inline():
[m... |
#!/usr/bin/python3
#
# test of python notification class
#
from gi.repository import Gtk, GObject, Notify
class Notification(GObject.GObject):
__gsignals__ = {
'notify-action': (GObject.SIGNAL_RUN_FIRST, None,
(str,))
}
def __init__(self, summary, body):
GObject.G... |
camera = None
def setCamera(cam):
global camera
camera = cam
arrowModel = None
def setArrowModel(am):
global arrowModel
arrowModel = am
nametagCardModel = None
nametagCardDimensions = None
def setNametagCard(model, dimensions):
global nametagCardModel, nametagCardDimensions
nametagCardModel = ... |
from osv import fields,osv
from tools.translate import _
import time
class wizard_crea_comunicazione(osv.osv_memory):
def default_get(self, cr, uid, fields, context=None):
res = super(wizard_crea_comunicazione, self).default_get(cr, uid, fields, context=context)
res['periodo... |
import discord
import requests
import io
import re
from discord.ext import commands
'''Tools relating to custom emoji manipulation and viewing.'''
class Emoji:
def __init__(self, bot):
self.bot = bot
def find_emoji(self, msg):
msg = re.sub("<a?:(.+):([0-9]+)>", "\\2", msg)
color_mod... |
from openerp.osv import fields, osv
from openerp.tools.translate import _
class crm_partner_binding(osv.osv_memory):
"""
Handle the partner binding or generation in any CRM wizard that requires
such feature, like the lead2opportunity wizard, or the
phonecall2opportunity wizard. Try to find a matching ... |
from __future__ import division
from .base import _SimpleLayoutBase
class Tile(_SimpleLayoutBase):
defaults = [
("border_focus", "#0000ff", "Border colour for the focused window."),
("border_normal", "#000000", "Border colour for un-focused windows."),
("border_width", 1, "Border width.")... |
# -*- coding: utf-8 -*-
'''
Random Forest classifier
'''
from sklearn.cluster import DBSCAN
from sklearn import metrics
from sklearn.preprocessing import StandardScaler
from ...core.routes import register
from .base import BaseMl, BaseMlSk
from sklearn.naive_bayes import GaussianNB
from sklearn.ensemble import AdaBoo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
HAPI Asset Interface - v1.0
Release: May 2017, Beta Milestone
Copyright 2016 Maya Culpa, LLC
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 ... |
from templeplus.pymod import PythonModifier
from toee import *
import tpdp
# Versatile Unarmed Strike: Player's Handbook II, p. 85
VersatileUnarmedStrikeBludgeoningEnum = 2800
VersatileUnarmedStrikePiercingEnum = 2801
VersatileUnarmedStrikeSlashingEnum = 2802
print "Registering Versatile Unarmed Strike"
def GetDam... |
import pytz
from django.utils.timezone import now, localtime
from django.utils.dateparse import parse_datetime
from importlib import import_module
def localized_datetime_string_now():
"""
Return an ISO-formatted datetime string in the local timezone,
which comes from settings.TIME_ZONE.
"""
return... |
'''
This class contains the style attributes for the Novus program,
including color and font.
'''
import wx
class NovusStyle(wx.Object):
'''This class contains the style attributes used for the Novus
program.'''
def __init__(self, parent, *args, **kwargs):
self.h1_font = wx.Font(25, wx.SWISS, wx.N... |
from django.core.mail import send_mail
from django.core.urlresolvers import reverse
from django.conf import settings
from .models import *
def send_note_email(note):
url = getattr(settings, 'SITE_URL', 'http://www.example.com/')
# Lookup user ID of recipient
recipient_obj = Profile.objects.get(pk = no... |
import Tkinter as tkinter
import time
################################################################################
# Almost all the code of the Splash object is from https://code.activestate.com/recipes/576936/
# It was helpful also https://code.activestate.com/recipes/577271-tkinter-splash-screen/
class Splash(o... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import MySQLdb as mdb
import sys
import re
from sklearn.feature_extraction import DictVectorizer
from sklearn import linear_model
from numpy import array_split
vectorizer = DictVectorizer()
def sentenceToDictList(sentence):
dictList = []
for i in range(len(sentence)... |
import os
import os.path
import json
from Crypto.Cipher import AES
import base64
from werkzeug.wrappers import Request, Response
from werkzeug.routing import Map, Rule
from werkzeug.exceptions import HTTPException, NotFound
from werkzeug.wsgi import SharedDataMiddleware
from werkzeug.utils import redirect
from stravali... |
'''
Gesture recognition
===================
This class allows you to easily create new
gestures and compare them::
from kivy.gesture import Gesture, GestureDatabase
# Create a gesture
g = Gesture()
g.add_stroke(point_list=[(1,1), (3,4), (2,1)])
g.normalize()
# Add it to the database
gdb ... |
# Made by Emperorc
import sys
from com.l2scoria.gameserver.model.quest import State
from com.l2scoria.gameserver.model.quest import QuestState
from quests.SagasSuperclass import Quest as JQuest
qn = "80_SagaOfTheWindRider"
qnu = 80
qna = "Saga of the Wind Rider"
class Quest (JQuest) :
def __init__(self,id,name,desc... |
import importlib
from operator import itemgetter
import warnings
def load_model(model_cls_path, model_cls_name, model_load_args):
"""Get an instance of the described model.
Args:
model_cls_path: Path to the module in which the model class
is defined.
model_cls_name: Name of the mo... |
import os
import utils
import gtk
import xml.dom.minidom as dom
import datetime
from xml.parsers.expat import ExpatError
class MapList(object):
COL_ID = 0
COL_TITLE = 1
COL_FNAME = 2
COL_OPEN = 3
"""Holds the list of maps. has a couple of convinience functions. Sings irish folk
this is (regard... |
import sys
sys.path.insert(0, ".")
from coalib.results.Diff import Diff
from coalib.results.PatchResult import PatchResult
import unittest
class PatchResultTest(unittest.TestCase):
def test_raises(self):
self.assertRaises(TypeError,
PatchResult,
origin=... |
import unittest
from dojo_classes.Dojo import Dojo
class TestReallocation(unittest.TestCase):
def setUp(self):
self.dojo = Dojo()
def test_reallocate_office(self):
current_office = self.dojo.create_room("office", "Blue")[0]
person = self.dojo.add_person("Dominic Sanders", "Fellow")
... |
#!/usr/bin/env ptatioython
# -*- coding: utf-8 -*-
'''
Created on May 18, 2016
@author: riccardo
'''
from __future__ import print_function
import os
import sys # @UnusedImport
from collections import OrderedDict
from gfzreport.templates.network.core.utils import relpath
from gfzreport.templates.network.core import... |
import os
import json
import tempfile
import subprocess
from django.core.management.base import BaseCommand
from django.conf import settings
from django.db.models import Q
from scanning.models import DocumentPage, public_url
from sorl.thumbnail import get_thumbnail
class Command(BaseCommand):
args = ''
help ... |
# -*- coding: utf-8 -*-
"""
Read and write HDF5 files.
HDF5 is a data model, library, and file format for storing and managing data. It supports
an unlimited variety of datatypes, and is designed for flexible and efficient I/O and for
high volume and complex data. HDF5 is portable and is extensible, allowing applicati... |
""" This file contains functions to generate and verify tokens for Flask-User.
Tokens contain an encoded user ID and a signature. The signature is managed by the itsdangerous module.
:copyright: (c) 2013 by Ling Thio
:author: Ling Thio (<EMAIL>)
:license: Simplified BSD License, see LICENSE.txt for mor... |
#!/usr/bin/env python
######################################################
# ratRunner.py
# ---------
# <<EMAIL>>
#
# Description:
# Runs user RAT jobs as a Ganga submitted job.
#
# Ships with all RATUser jobs.
# Allows users to install rat snapshots to the temporary
# job directory on the submission back... |
import sys
import FIRELIB
import time
from PyQt4.QtGui import *
from PyQt4.QtCore import *
app = QApplication(sys.argv)
styleFile = QFile("FIRELIB\CSS\styleSheet.txt")
styleFile.open(styleFile.ReadOnly)
style = str(styleFile.readAll())
app.setStyleSheet(style)
members = {}
members["head"] = ['head_z','head_y']
membe... |
#!/usr/bin/env python
"""
An improved version of my Python-based gravity simulator, using Runge-Kutta
4th order solution of the differential equations - coded during Xmas 2012.
Happy holidays, everyone!
I've always been fascinated by space - ever since I read 'The Family of
the Sun', when I was young. And I always wan... |
from django.db.models import Count, Avg
from restless.dj import DjangoResource
from restless.preparers import FieldsPreparer
from sensor_parser.parser import parser_sensor2dict
from api.forms import SensorRecordForm
from api.models import SensorRecord
class ApiResource(DjangoResource):
preparer = FieldsPreparer... |
"""
@author: Stijn De Weirdt (University of Ghent)
"""
import os
import sys
import hod
from hod.rmscheduler.job import Job
from hod.rmscheduler.rm_pbs import Pbs
from hod.rmscheduler.resourcemanagerscheduler import ResourceManagerScheduler
from hod.config.config import (parse_comma_delim_list,
PreServiceConf... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
"""
coco.config
~~~~~~~~~~~~
the configuration related objects.
copy from flask
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import types
import errno
import json
import socket
i... |
from __future__ import unicode_literals
import os
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse, clear_url_caches
from django.test import TestCase
from django.test.utils import override_settings
from django.template import Template, Context
from django.utils impo... |
# flake8: noqa
from pygls.lsp.types.language_features.code_action import *
from pygls.lsp.types.language_features.code_lens import *
from pygls.lsp.types.language_features.color_presentation import *
from pygls.lsp.types.language_features.completion import *
from pygls.lsp.types.language_features.declaration import *
f... |
import re
from .models import EmailCandidate, Invitation, UserProfile
from .signals import (follower_count_changed,
following_count_changed)
from ..follow.models import UserFollow
from ..notification.models import (NotificationPreference, NotificationType,
notifi... |
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import time
import six
from c7n.actions import ActionRegistry, BaseAction
from c7n.exceptions import PolicyValidationError
from c7n.filters import FilterRegistry, MetricsFilter
from c7n.manager import resources
from c7n... |
import json
from uuid import uuid4
from sqlalchemy_jsonapi.errors import (PermissionDeniedError,
RelationshipNotFoundError,
ResourceNotFoundError, ValidationError)
def test_200_on_to_one_set_to_resource(post, user, client):
payload = {... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
try:
import msgpack
except:
import msgpack_pure as msgpack
import logging
logger = logging.getLogger(__name__)
import proteindf_bridge as bridge
from .pdfcommon import load_pdfparam
from .pdfarchive import PdfArchive
class PopUtils(object):
'''Po... |
import cv2
import argparse
import sys
import math
#####################################################################
# press all the go-faster buttons - i.e. speed-up using multithreads
cv2.setUseOptimized(True)
cv2.setNumThreads(4)
# if we have OpenCL H/W acceleration availale, use it - we'll need it
cv2.ocl.s... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
import numpy as np # type: ignore
from onnx import TensorProto
from onnx import mapping
from typing import Sequence, Any, Optional, Text
if sys.byteorder !... |
#! /usr/bin/env python2.7
import util
from util.include import *
import screens
def delete_event (widget, event, data = None):
gobject.source_remove (timer)
return False
writer = None
# Uncomment to record a demo for attract mode
# Use Motion JPEG because, although it's not a good codec, it's not heavil... |
from msrest.serialization import Model
class AvailableProvidersList(Model):
"""List of available countries with details.
All required parameters must be populated in order to send to Azure.
:param countries: Required. List of available countries.
:type countries:
list[~azure.mgmt.network.v2018_... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('streams', '0006_auto_20150511_2334'),
]
operations = [
migrations.RemoveField(
model_name='comment',
... |
#!/usr/bin/python
import time
from qpid.messaging import Message
from datetime import date, datetime
import threading
import requests
import agoclient
import json
class AgoWeatherReporter(agoclient.AgoApp):
def event_handler(self, subject, content):
"""event handler - Processes incomming events and look... |
#!/usr/bin/env python3
"""
This script builds the CLI python wheel, copies it to the desktop folder,
and installs it in the virtual environment.
"""
import inspect
import os
import glob
import subprocess
import shutil
def main():
# Build paths
root_path = os.path.dirname(
os.path.dirname(
... |
"""
Routines and classes for supporting and expressing IP address ranges using a
glob style syntax.
"""
from netaddr.core import AddrFormatError, AddrConversionError
from netaddr.ip import IPRange, IPAddress, IPNetwork, iprange_to_cidrs
from netaddr.compat import _is_str
def valid_glob(ipglob):
"""
:param ip... |
import pandas as pd
import networkx as nx
from na3x.transformation.transformer import transformer
from na3x.utils.converter import Converter
from na3x.utils.aggregator import Aggregator
from logic.constants import DbConstants, ParamConstants
from copy import deepcopy
from logic.gantt import Task, Link
from string impor... |
import praw
import re
import sys, os
from datetime import datetime
# from .CreateAndUploadPlots import createAndUploadPlots
from .CreateTableFromDatabase import getRankingsFromDatabase
from .CreateTableFromDatabase import getTableOfSeriesGamesFromDatabase
from .AddScoresToDatabase import getTitle
from .AddScoresToData... |
"""Tests for pod_names_validation. This test takes app manifest and validate instantiated
pod names are in the format POD_NAME_FORMAT mentioned.
"""
import json
import logging
from kubeflow.testing import ks_util, test_util, util
from kubeflow.tf_operator import test_runner, tf_job_client
from kubeflow.tf_operator im... |
"""
Generate SSL test certificates.
"""
import os
import shlex
import shutil
import subprocess
import textwrap
ROOT_CA = "trusted-root"
SUBJECT = "example.mitmproxy.org"
def do(args):
print("> %s" % args)
args = shlex.split(args)
output = subprocess.check_output(args)
return output
def genrsa(cert:... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.