code stringlengths 1 199k |
|---|
import os
import csv
from datetime import datetime, date
import alcide.settings
import django.core.management
django.core.management.setup_environ(alcide.settings)
from django.db import transaction
from alcide.dossiers.models import PatientRecord
from alcide.personnes.models import Worker
from alcide.ressources.models ... |
execfile("eval.py") |
from __future__ import unicode_literals
import webnotes
from webnotes.utils import flt
def execute(filters=None):
if not filters: filters = {}
columns = get_columns()
data = get_tracking_details(filters)
return columns, data
def get_columns():
return ["Freanchise:Link/Franchise:1... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('upload', '0002_uploadedpdf_num_pages'),
]
operations = [
migrations.AlterModelOptions(
name='uploadedpdf',
options={'verbose_name... |
from functools import partial
from operator import itemgetter
from django.conf.urls import url
from django.contrib import admin, messages
from django.core.cache import cache
from django.core.exceptions import PermissionDenied
from django.db.models import Q
from django.http import HttpResponseRedirect
from django.shortc... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('menjobe', '0002_product_name'),
]
operations = [
migrations.CreateModel(
name='RetailPoint',
fields=[
('id', mode... |
import os
from waflib.Errors import ConfigurationError
def options(self):
self.add_option(
'--with-amba',
type='string',
help='Basedir of your AmbaKit installation',
dest='ambadir',
default=os.environ.get("AMBA_HOME")
)
def find(self, path = None):
if path:
incp... |
"""Defines fixtures available to all tests."""
from pytest import fixture, yield_fixture
from webtest import TestApp
from tegenaria.app import create_app
from tegenaria.database import db as _db
from tegenaria.settings import TestConfig
@yield_fixture(scope="function")
def app():
"""Yield a new app."""
_app = c... |
import os
import csv
from pprint import pprint
from collections import OrderedDict
from .data_templates import make_record
def atomize_to_mongo(source_path, mongo):
"""
Accepts the path name of the input data file and the MongoWrapper
instance to be used for writing the atomized records.
"""
if not ... |
from django.contrib.auth.models import User
from django.core.validators import (
MaxValueValidator,
MinValueValidator
)
from django.db import models
from django.utils.translation import ugettext_lazy as _
class WeightEntry(models.Model):
"""
Model for a weight point
"""
date = models.DateField(v... |
import quotation_followup |
__version__ = '0.1.0' |
from .array import ARRAY
from ...sql import elements
from ...sql import expression
from ...sql import functions
from ...sql.schema import ColumnCollectionConstraint
class aggregate_order_by(expression.ColumnElement):
"""Represent a PostgreSQL aggregate order by expression.
E.g.::
from sqlalchemy.dialect... |
"""
XBlock Courseware Components
"""
import warnings
import xblock.core
import xblock.fields
class XBlockMixin(xblock.core.XBlockMixin):
"""
A wrapper around xblock.core.XBlockMixin that provides backwards compatibility for the old location.
Deprecated.
"""
def __init__(self, *args, **kwargs):
... |
"""
Unit tests for email feature flag in new instructor dashboard.
Additionally tests that bulk email is always disabled for
non-Mongo backed courses, regardless of email feature flag, and
that the view is conditionally available when Course Auth is turned on.
"""
from django.conf import settings
from django.core.urlre... |
"""
PYBOSSA api module for domain object Category via an API.
This package adds GET, POST, PUT and DELETE methods for:
* categories
"""
from werkzeug.exceptions import BadRequest
from api_base import APIBase
from pybossa.model.category import Category
class CategoryAPI(APIBase):
"""Class API for domain object C... |
import frappe
import unittest
test_records = frappe.get_test_records('Chart of Accounts')
class TestChartofAccounts(unittest.TestCase):
pass |
from course_material.models import CourseMaterial
from rest_framework import serializers
class CourseMaterialSerializer(serializers.ModelSerializer):
class Meta:
model = CourseMaterial |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inventory', '0002_inventorysettings'),
]
operations = [
migrations.AlterField(
model_name='useditem',
name='timestamp_returned',
... |
import datetime
import io
import uuid
from .sqlfilter import SQLFilter
from lib.exceptions import *
from lib.orm.fields import TimeField, BoolField, ImageField, BinaryField
from lib.orm.binary import Binary
class Sql(object):
""" Generate SQL requests. """
def _replaceSQL(self):
f, v = self._prepareData... |
from . import partner, stock_picking |
from .mapinfo import MapInfo
from .map import Map
from .address import Address
mapinfo = MapInfo()
_map = Map()
address = Address() |
from datetime import datetime, timedelta
import logging
import math
import re
from babel import Locale
from pylons import config
from sqlalchemy import Table, Column, ForeignKey, func, or_
from sqlalchemy import DateTime, Integer, Float, Boolean, Unicode, UnicodeText
from sqlalchemy.orm import reconstructor
import adho... |
from .default import default
import os
import re
class image(default):
def __init__(self, key, stat):
default.__init__(self, key, stat)
self.data = {}
def compile(self, prop):
if not os.path.exists(prop['value']):
print("Image '{}' not found.".format(prop['value']))
r... |
from odoo import models, api
class BaseConfigSettings(models.TransientModel):
_inherit = 'base.config.settings'
def _partner_names_order_selection(self):
options = super(
BaseConfigSettings, self)._partner_names_order_selection()
new_labels = {
'last_first': 'Lastname Sec... |
import calendar
from datetime import datetime, date
from dateutil import relativedelta
from lxml import etree
import json
import time
from openerp import SUPERUSER_ID
from openerp import tools
from openerp.addons.resource.faces import task as Task
from openerp.osv import fields, osv
from openerp.tools.translate import ... |
from nextcloudappstore.settings.base import *
DEBUG = True
SECRET_KEY = 'secret'
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
RECAPTCHA_PUBLIC_KEY = '<RECAPTCHA_PUBLIC_KEY>'
RECAPTCHA_PRIVATE_KEY = '<RECAPTCHA_PRIVATE_KEY>'
EMAIL_HOST = 'localhost'
DEFAULT_FROM_EMAIL = 'Nextcloud App Store <appstore... |
import csv
from pppcemr.models import *
dataReader = csv.reader(open('ndc_database_2016_02_21/package.txt'), delimiter='\t')
for row in dataReader:
package = DrugPackage()
package.product_id = row[0]
package.product_ndc = row[1]
package.package_ndc = row[2]
package.package_name = row[3]
package.... |
from openerp import models, fields
class PassangerType(models.Model):
_name = "fleet.work_order_passanger_type"
_description = "Passanger Type"
name = fields.Char(
string="Name",
required=True,
)
code = fields.Char(
string="Code",
required=True,
)
active = fie... |
"""change return type of functions
Revision ID: d2d2f196738b
Revises:
Create Date: 2017-09-03 16:13:31.799366
"""
from alembic import op
import sqlalchemy as sa
revision = 'd2d2f196738b'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
conn = op.get_bind()
conn.execute('drop function i... |
from pyledger.server import run
from pyledger.server.contract import SimpleContract
class Hello(SimpleContract):
counter = 0
def say_hello(self, name: str):
if name == 'Guillen':
raise Exception('You probably mispelled Guillem')
self.counter += 1
return 'Hello {} # {}'.format... |
__metaclass__ = type
__all__ = [
'InformationTypePortletMixin',
]
from lazr.restful.interfaces import IJSONRequestCache
from lp.app.enums import PRIVATE_INFORMATION_TYPES
from lp.app.interfaces.informationtype import IInformationType
from lp.app.utilities import json_dump_information_types
class InformationType... |
from . import import_statement |
from openerp.osv import orm, fields
class oehealth_annotation(orm.Model):
_inherit = 'oehealth.annotation'
_columns = {
'person_id' : fields.many2one ('oehealth.person', 'Person'),
}
oehealth_annotation() |
import pytest
import pandas as pd
import numpy as np
import os
from re import sub
from urbanaccess.gtfs import utils_format
from urbanaccess import config
@pytest.fixture
def folder_feed_1():
return r'/data/gtfs_feeds/agency_a'
@pytest.fixture
def folder_feed_2():
return r'/data/gtfs_feeds/agency_b'
@pytest.fix... |
from unittest import TestCase
from libzsm.datastructures import contains_list
class ListTest(TestCase):
def test_contains_list(self):
self.assertEqual(
True, contains_list(['manage.py', 'runserver', '-v', '3'], ['-v', '3'])
)
self.assertEqual(
True, contains_list(['ma... |
"""Class to parse camt files."""
import re
from datetime import datetime
from lxml import etree
from openerp.addons.account_bank_statement_import.parserlib import (
BankStatement)
class CamtParser(object):
"""Parser for camt bank statement import files."""
def parse_amount(self, ns, node):
"""Parse ... |
import datetime
from decimal import Decimal
import mock
import uuid
from django.test import TestCase
from attribution.models.enums.function import Functions
from base.models.enums.learning_container_year_types import LearningContainerYearType
from base.models.enums.vacant_declaration_type import VacantDeclarationType
f... |
import datetime
import re
import json
from django.contrib import messages
from django.http import HttpResponseRedirect, HttpResponse
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettex... |
import sys
import libxml2
libxml2.debugMemory(1)
def foo(ctx, x):
return x + 1
def bar(ctx, x):
return "%d" % (x + 2)
doc = libxml2.parseFile("tst.xml")
ctxt = doc.xpathNewContext()
res = ctxt.xpathEval("//*")
if len(res) != 2:
print("xpath query: wrong node set size")
sys.exit(1)
if res[0].name != "doc... |
from . import models |
from .common import *
class SphericalSurfaceSelectionGate:
def allow(self, doc, obj, sub):
if sub.startswith('Face'):
face = getObjectFaceFromName( obj, sub)
return str( face.Surface ).startswith('Sphere ')
elif sub.startswith('Vertex'):
return True
else:
... |
"""
German-language mappings for language-dependent features of
reStructuredText.
"""
__docformat__ = 'reStructuredText'
directives = {
'achtung': 'attention',
'vorsicht': 'caution',
'gefahr': 'danger',
'fehler': 'error',
'hinweis': 'hint',
'wichtig': 'important',
'notiz': 'not... |
"""Settings manager module. This will load/save user settings from a
defined settings backend."""
__id__ = "$Id$"
__version__ = "$Revision$"
__date__ = "$Date$"
__copyright__ = "Copyright (c) 2010 Consorcio Fernando de los Rios."
__license__ = "LGPL"
import imp
import importlib
import os
from gi.reposit... |
"""
Test that updating an alias saves it to the roster.
"""
import dbus
from servicetest import EventPattern, call_async
from gabbletest import acknowledge_iq, exec_test, make_result_iq
import constants as cs
import ns
def test(q, bus, conn, stream):
conn.Connect()
_, event, event2 = q.expect_many(
Even... |
"""
Automated tests for checking transformation algorithms (the models package).
"""
import logging
import unittest
import numpy as np
from gensim.corpora.mmcorpus import MmCorpus
from gensim.models import rpmodel
from gensim import matutils
from gensim.test.utils import datapath, get_tmpfile
class TestRpModel(unittest... |
from pycp2k.inputsection import InputSection
class _xwpbe2(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Section_parameters = None
self.Scale_x = None
self.Scale_x0 = None
self.Omega = None
self._name = "XWPBE"
self._keywords = {'Scale_x0... |
import SocketServer
import threading
import time
class MiTcpHandler(SocketServer.BaseRequestHandler):
#sobrescribo la funcion handle
def handle(self):
while self.data[0] != ".salir":
#intento recibir informacion
try:
self.data.append(self.request.recv(1024))
... |
"""
Superfunctional builder function & handlers.
The new definition of functionals is based on a dictionary with the following structure
dict = {
"name": "", name of the functional - matched against name.lower() in method lookup
"alias": [""], alternative names for the method in lookup ... |
from distutils.core import setup
setup(
name=u'nmadb-contacts'.encode('utf-8'),
version='0.1',
author=u'Vytautas Astrauskas'.encode('utf-8'),
author_email=u'vastrauskas@gmail.com'.encode('utf-8'),
packages=['nmadb_contacts',],
package_dir={'': 'src'},
#package_dat... |
"""Module for on/off switches."""
from .api.command_send import CommandSend
from .exception import PyVLXException
from .node import Node
from .parameter import SwitchParameter, SwitchParameterOff, SwitchParameterOn
class OnOffSwitch(Node):
"""Class for controlling on-off switches."""
def __init__(self, pyvlx, n... |
import time
from fenrirscreenreader.core import debug
outputData = {
'nextFlush': time.time(),
'messageText': '',
'messageOffset': None,
'cursorOffset': None,
} |
from pyblish import api
from pyblish_bumpybox import inventory
class ExtractGroup(api.InstancePlugin):
""" Extract gizmos from group nodes. """
order = inventory.get_order(__file__, "ExtractGroup")
optional = True
families = ["gizmo", "lut"]
label = "Group"
hosts = ["nuke", "nukeassist"]
def... |
program = {
'program_author': 'David McAllister',
'program_date': '2013-09-21',
'program_name': './backup.py',
'program_version': '1.0'
}
config_file = ('/dir_1/dir_2/some_user_name/backup_report.py',) |
from pycraft.service.part.biome import BiomeID, biomes
from pycraft.service.part.block import SaplingType
from ..structure import Tree
from .tree import TreePopulator
static_defs = {
BiomeID.FOREST : TreePopulator(Tree(SaplingType.OAK), 5),
BiomeID.BIRCH_FOREST : TreePopulator(Tree(SaplingType.BIRCH), 5),
B... |
"""
An implementation which send to files data
"""
import bibusinterface
class Bibus2Logs(bibusinterface.BibusInterface):
"""
An implementation which send to files data
"""
def __init__(self, log_file=""):
super().__init__()
def update_data(self, id_, remaining_time=None):
if not rem... |
'''
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 y... |
from server.bones import baseBone
from server import db
from random import random, sample, shuffle
from itertools import chain
class randomSliceBone( baseBone ):
"""
Simulates the orderby=random from SQL.
If you sort by this bone, the query will return a random set of elements from that query.
"""
type = "random... |
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
os.system("pip install -r requirements.txt")
setup(
name="sleepy",
version="1.2.11",
author="Adam Haney",
author_email="adam.haney@akimbo.io",
description=("""A RESTful libr... |
'''
one trade
似乎该考虑加减码
'''
import math
import sys
import os
cwd = os.getcwd()
sys.path.insert(0, os.getcwd())
import data_api
class Trade():
def __init__(self):
self.enter_date = ''
self.enter_price = 0
self.enter_index = -1
self.exit_date = ''
self.exit_price = 0
... |
from pycp2k.inputsection import InputSection
from ._each351 import _each351
class _wannier_spreads5(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Section_parameters = None
self.Add_last = None
self.Common_iteration_levels = None
self.Filename = None
... |
from time import clock
from math import sqrt
from itertools import count
def timer(function):
def wrapper(*args, **kwargs):
start = clock()
print(function(*args, **kwargs))
print("Solution took: %f seconds." % (clock() - start))
return wrapper
@timer
def find_answer():
consecutive = ... |
import sys
import toolbox
import re
file = sys.argv[1]
def clean_ip(ip):
r = re.search('([0-9]{1,3}\.[0-9]{1,3})(\.[0-9]{1,3}\.[0-9]{1,3})', ip)
firstpart = r.group(1)
secondpart = r.group(2)
return firstpart, secondpart
def compare_to_dictonary(line):
'''
make sure line is clean and there are ... |
def main():
change_owed = get_change()
min_coins = get_min_coins(change_owed)
print(min_coins)
def get_change():
print("O hai! ", end="")
while True:
try:
change = float(input("How much change is owed?\n"))
except ValueError:
continue
if change > 0:
... |
from __future__ import unicode_literals
import base64
import re
import time
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
float_or_none,
remove_end,
struct_unpack,
)
def _decrypt_url(png):
encrypted_data = base64.b64decode(png)
text_index = encrypted_da... |
from bitmovin.resources.models import AzureOutput
from ..rest_service import RestService
class Azure(RestService):
BASE_ENDPOINT_URL = 'encoding/outputs/azure'
def __init__(self, http_client):
super().__init__(http_client=http_client, relative_url=self.BASE_ENDPOINT_URL, class_=AzureOutput) |
import sys
import re
element_match_pattern = re.compile(r'([A-Z][a-z]?)')
final_molecule = str()
while True:
line = sys.stdin.readline()
if line == "\n":
final_molecule = sys.stdin.readline().rstrip()
break
results = re.findall(element_match_pattern, final_molecule)
tokens = len(results)
parenth... |
from time import clock
def timer(function):
def wrapper(*args, **kwargs):
start = clock()
print(function(*args, **kwargs))
print("Solution took: %f seconds." % (clock() - start))
return wrapper
@timer
def find_answer():
return sum([i for i in range(1000) if i % 3 == 0 or i % 5 == 0])... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from skflow import * |
u"""Mapping of rt_params to genesis_params.
:copyright: Copyright (c) 2015 Bivio Software, Inc. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from io import open
from pykern import pkarray
from pyker... |
"""
This example shows how to reconnect to a model if you encounter an error
1. Connects to current model.
2. Attempts to get an application that doesn't exist.
3. Disconnect then reconnect.
"""
from juju import jasyncio
from juju.model import Model
from juju.errors import JujuEntityNotFoundError
async def main():
... |
from scheduler.views.rest_dispatch import RESTDispatch
from scheduler.utils.validation import Validation
from scheduler.views.api.exceptions import MissingParamException, \
InvalidParamException
from panopto_client import PanoptoAPIException
from panopto_client.remote_recorder import RemoteRecorderManagement
from s... |
"""
Client side of the scheduler manager RPC API.
"""
from nova import flags
from nova.openstack.common import jsonutils
import nova.openstack.common.rpc.proxy
FLAGS = flags.FLAGS
class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy):
'''Client side of the scheduler rpc API.
API version history:
... |
__source__ = 'https://leetcode.com/problems/bitwise-ors-of-subarrays/'
import unittest
class Solution(object):
pass # your function here
class TestMethods(unittest.TestCase):
def test_Local(self):
self.assertEqual(1, 1)
if __name__ == '__main__':
unittest.main()
Java = '''
Approach 1: Frontier Set
... |
import itertools
from nova.conf import paths
from oslo_config import cfg
LIVE_MIGRATION_DOWNTIME_MIN = 100
LIVE_MIGRATION_DOWNTIME_STEPS_MIN = 3
LIVE_MIGRATION_DOWNTIME_DELAY_MIN = 10
libvirt_group = cfg.OptGroup("libvirt",
title="Libvirt Options",
help="""
Libv... |
needs_sphinx = '1.6'
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Gitcd'
copyright = u'2017, Claudio Walser'
author = u'Claudio Walser'
version = u'1.6'
release = u'1.6.16'
language = None
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
pygments_style =... |
"""Script for converting content to Zip/ISO format.
"""
from os import makedirs
from os import stat
from os import walk
from os.path import isdir
from os.path import join
from shutil import copy2
from shutil import copytree
import sys
import click
from scripts.utils import to_iso
from scripts.utils import to_zip
from .... |
import os
import threading
class LoggerWrapper(threading.Thread):
"""
Read text message from a pipe and redirect them
to a logger (see python's logger module),
the object itself is able to supply a file
descriptor to be used for writing
fdWrite ==> fdRead ==> pipeReader
"""
def __init__(... |
from abc import ABC, abstractmethod
from oscar.agent.commander.base_commander import BaseCommander
from oscar.util.point import Point
from oscar.meta_action import *
class ContextSaveCommander(BaseCommander):
def __init__(self, subordinates: list):
super().__init__(subordinates=subordinates)
self._s... |
__author__ = "OBL"
from sys import maxsize
class Contact:
def __init__(self, firstname=None, lastname=None, address=None, homephone=None, mobilephone=None, workphone=None, phone=None,
mail1=None, mail2=None, mail3=None, id=None, all_phones_from_home_page=None, all_mail_from_home_page=None):
... |
from __builtin__ import True
__authors__ = ['"wei keke" <keke.wei@cs2c.com.cn>']
__version__ = "V0.1"
'''
'''
import unittest
from BaseTestCase import BaseTestCase
from TestAPIs.DataCenterAPIs import DataCenterAPIs,smart_attach_storage_domain, smart_deactive_storage_domain, smart_detach_storage_domain
from TestAPIs.Clu... |
''' 多任务多线程下载:同时启多个线程下载多个文件,并且把每个文件"分段",每段再启一个线程去下载 '''
import time,threading,urllib2,Queue
_lock = threading.Lock()
class Downloader(threading.Thread):
def __init__(self, url, Save_F, buffer, queue):
self.url = url
self.buffer = buffer
self.Save_F = Save_F
self.queue = queue
threa... |
"""Get GitHub data for the innovation networks data pilot.
Uses https://www.githubarchive.org/ and gets the last 2 years of
activity"""
import logging
import os
import requests
import sys
from datetime import datetime, timedelta
from time import sleep
def get_file_path():
"""Get the path to the current file"""
... |
"""Tests for kfp.dsl.serialization_utils module."""
import unittest
from kfp.deprecated.dsl import serialization_utils
_DICT_DATA = {
'int1': 1,
'str1': 'helloworld',
'float1': 1.11,
'none1': None,
'dict1': {
'int2': 2,
'list2': ['inside the list', None, 42]
}
}
_EXPECTED_YAML_LI... |
from ..core.experts import *
from ..core.harness import *
from ..core.transforms import *
from ..contraction.definitions import *
fun_name = 'row_reduction_2d'
op_name = 'linalg.generic'
all_names = [ \
# Note: tried small 1, 2 and 4 sizes, never resulted in better perf. \
"Tile4x16", \
"Tile4x16FusedOutput", \
... |
from oslo.config import cfg
from nova.tests.unit.integrated.v3 import test_servers
CONF = cfg.CONF
CONF.import_opt('shelved_offload_time', 'nova.compute.manager')
class ShelveJsonTest(test_servers.ServersSampleBase):
extension_name = "os-shelve"
def setUp(self):
super(ShelveJsonTest, self).setUp()
... |
from action_tutorials_interfaces.action import Fibonacci
import rclpy
from rclpy.action import ActionClient
from rclpy.node import Node
class FibonacciActionClient(Node):
def __init__(self):
super().__init__('fibonacci_action_client')
self._action_client = ActionClient(self, Fibonacci, 'fibonacci')
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
from caffe2.python import core
from caffe2.python.dataio import Reader
from caffe2.python.dataset import Dataset
from caffe2.python.pipeline import pipe
from caf... |
"""Unittest runner for quantum Linux Bridge plugin
This file should be run from the top dir in the quantum directory
To run all tests::
PLUGIN_DIR=quantum/plugins/linuxbridge ./run_tests.sh
"""
import os
import sys
from nose import config
from nose import core
sys.path.append(os.getcwd())
sys.path.append(os.path.di... |
"""
Resource class and its manager for floating IPs in Compute API v2
"""
from osclient2 import base
from osclient2 import mapper
from osclient2 import utils
ATTRIBUTE_MAPPING = [
('id', 'id', mapper.Noop),
('fixed_ip', 'fixed_ip', mapper.Noop),
('server', 'instance_id', mapper.Resource('nova.server')),
... |
import os
os.environ.setdefault("DJANGO_CONFIGURATION", "Prod")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "manager.settings")
from django.core.asgi import get_asgi_application # noqa: E402
application = get_asgi_application() |
""" This file contains different utility functions that are not connected
in anyway to the networks presented in the tutorials, but rather help in
processing the outputs into a more understandable way.
For example ``tile_raster_images`` helps in generating a easy to grasp
image from a set of samples or weights.
"""
fro... |
"""RFC2462 style IPv6 address generation."""
import netaddr
from jacket.i18n import _
def to_global(prefix, mac, project_id):
try:
mac64 = netaddr.EUI(mac).eui64().words
int_addr = int(''.join(['%02x' % i for i in mac64]), 16)
mac64_addr = netaddr.IPAddress(int_addr)
maskIP = netaddr... |
"""
Molotov-based executor for Taurus.
Copyright 2017 BlazeMeter 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 o... |
"""
DNS - main dnslib module
Contains core DNS packet handling code
"""
from __future__ import print_function
import base64,binascii,calendar,collections,copy,os.path,random,socket,\
string,struct,textwrap,time
from itertools import chain
try:
from itertools import zip_longest
except ImportError:
... |
import enum
"""This module has the global key values that are used across framework
modules.
"""
class Config(enum.Enum):
"""Enum values for test config related lookups.
"""
# Keys used to look up values from test config files.
# These keys define the wording of test configs and their internal
# ref... |
from django import forms
from django.conf import settings
from django.http import HttpResponse, HttpResponseRedirect, Http404
from manager import models as pmod
from . import templater
from django.conf import settings
import decimal, datetime, string, random
from django.core.mail import send_mail, EmailMultiAlternative... |
import webob.exc
from jacket.api.compute.openstack import extensions
from jacket.api.compute.openstack import wsgi
from jacket.compute import cloud
from jacket import context as nova_context
from jacket.compute import exception
from jacket.i18n import _
from jacket.compute import servicegroup
from jacket.compute import... |
"""Liberated Pixel Cup [(LPC)][1] Sprites Dataset.
This file provides logic to download and build a version of the sprites
video sequence dataset as used in the Disentangled Sequential
Autoencoder paper [(Li and Mandt, 2018)][2].
[1]: Liberated Pixel Cup. http://lpc.opengameart.org. Accessed:
2018-07-20.
[2]: Ying... |
from ztag.annotation import *
class VarnishServer(Annotation):
protocol = protocols.HTTP
subprotocol = protocols.HTTP.GET
port = None
def process(self, obj, meta):
vendor = obj["headers"]["server"]
if "varnish" in vendor.lower():
meta.local_metadata.manufacturer = Manufacture... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.