code stringlengths 1 199k |
|---|
from django.core.management.base import LabelCommand, CommandError
from django.core import serializers
from editorsnotes.main.models import *
from optparse import make_option
import sys
from itertools import chain
import pdb
class Command(LabelCommand):
arg = 'Project_name'
label = 'Project name'
help = 'Du... |
from typing import Set
from django.utils.translation import gettext_lazy as _
from ddd.logic.encodage_des_notes.encodage.domain.model.note_etudiant import IdentiteNoteEtudiant
from osis_common.ddd.interface import BusinessException
class EnseignantNonAttribueUniteEnseignementException(BusinessException):
def __init... |
"""
UI-level acceptance tests for OpenAssessment accessibility.
"""
import os
import unittest
from tests import OpenAssessmentTest, StaffAreaPage, FullWorkflowMixin, MultipleOpenAssessmentMixin
from pages import MultipleAssessmentPage
class OpenAssessmentA11yTest(OpenAssessmentTest):
"""
UI-level acceptance tes... |
import json
import logging
from django.core import urlresolvers
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext, loader
from django.utils.translation import ugettext as _
from tinymce.compressor import gzip_compressor
from tinymce.widgets i... |
from django.shortcuts import render
from django.http import HttpResponse
from readmore.content.thirdparty.wiktionary_api import *
import urllib
import json
def process(request):
word = request.GET.get('word',"No word given")
#print urllib.urlopen(urlbegin+'metallica'+urlend).read()
return HttpResponse(json.... |
import numpy as np
import scipy.io as sio
from merge_lines_v2 import merge_lines
from sioloadmat import loadmat
if __name__ == '__main__':
line_in = loadmat('linefeature.mat')
listpt = loadmat('listpointc.mat')
print 'Line feature shape', line_in.shape, 'list point shape ', listpt.shape
# print 'List po... |
"""
Save for later views
"""
from datetime import datetime
import logging
from django.conf import settings
from django.utils.decorators import method_decorator
from ratelimit.decorators import ratelimit
from rest_framework.response import Response
from rest_framework.views import APIView
from django.db import transacti... |
basebox = "testing32"
baseboxurl = "https://f-droid.org/testing32.box"
memory = 3584
aptproxy = None
arch64 = False |
"""
Specific overrides to the base prod settings to make development easier.
"""
from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import
DEBUG = True
USE_I18N = True
TEMPLATE_DEBUG = DEBUG
TIME_ZONE = 'Asia/Shanghai'
LANGUAGE_CODE = 'zh_CN'
import logging
for pkg_name in ['track.contexts', 'track.m... |
import os
import logging
from flask import Flask, url_for, session, request, render_template, flash, _app_ctx_stack
from flask.ext.login import current_user
from flask.ext.heroku import Heroku
from flask.ext.babel import lazy_gettext
from pybossa import default_settings as settings
from pybossa.extensions import *
from... |
from debsources import statistics
def extract_stats(filter_suites=None, filename="cache/stats.data"):
"""
Extracts information from the collected stats.
If filter_suites is None, all the information are extracted.
Otherwise suites must be an array of suites names (can contain "total").
e.g. extract_... |
from tag_base import TagBase
class TagServicoAdicional(TagBase):
TIPO_AVISO_RECEBIMENTO = 'Aviso Recebimento'
TIPO_MAO_PROPRIA = u'Mão Própria'
TIPO_VALOR_DECLARADO = 'Valor declarado'
TIPO_REGISTRO = 'Registor'
_tipo_servico = {
TIPO_AVISO_RECEBIMENTO: '001',
TIPO_MAO_PROPRIA: '002'... |
import logging
from openerp.tests.common import TransactionCase
from ..oauth2.validator import OdooValidator
_logger = logging.getLogger(__name__)
try:
from oauthlib import oauth2
except ImportError:
_logger.debug('Cannot `import oauthlib`.')
class TestOAuthProviderClient(TransactionCase):
def setUp(self):
... |
'''Produce a custom twist drill plot'''
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
plt.rc('text', usetex=True)
mpl.rcParams['font.weight'] = 'bold'
mpl.rcParams['xtick.major.pad'] = 10
mpl.rcParams['xtick.direction'] = 'inout'
mpl.rcParams['xtick.labelsize'] = 26
mpl.rcParams['ytick.dir... |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class FeedBack(Document):
pass |
import logging
from t_bone import ramps_thermistors
from t_bone import replicape_thermistors
_logger = logging.getLogger(__name__)
def get_thermistor_reading(thermistor, value):
#find the thermistor
thermistor_table = None
if thermistor == "100k":
return ramps_thermistors.convert_ramps_reading(therm... |
"""Class for setting handshake parameters."""
from .constants import CertificateType
from .utils import cryptomath
from .utils import cipherfactory
from .utils.compat import ecdsaAllCurves
CIPHER_NAMES = ["chacha20-poly1305","speck128",
"speck128gcm","speck192gcm","aes256gcm",
"aes128gcm... |
import numpy as np
from lxml import etree
import pandas as pd
import string
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import seaborn
from assaytools import platereader
import sys
import os
import argparse
parser = argparse.ArgumentParser(description="""Visualize your raw data by making a png from your ... |
import collections
import email.parser
import re
import socket
import sys
import traceback
try:
# Python 2 (game)
from urlparse import urlparse
except ImportError:
# Python 3 (test suite)
from urllib.parse import urlparse
import BigWorld
from .asyncore_utils import AsynchatExtended
READ_STATUS = 0
READ_HEADERS = 1
... |
import os
from tendrl.commons.event import Event
from tendrl.commons.message import ExceptionMessage
from tendrl.commons.utils import cmd_utils
from tendrl.commons.utils import etcd_utils
from tendrl.commons.utils import log_utils as logger
def sync():
try:
_keep_alive_for = int(NS.config.data.get("sync_int... |
import unittest
from webkitpy.common.system.systemhost_mock import MockSystemHost
from webkitpy.layout_tests.port import Port, Driver, DriverOutput
from webkitpy.layout_tests.port.webkit_unittest import TestWebKitPort
class DriverOutputTest(unittest.TestCase):
def test_strip_metrics(self):
patterns = [
... |
import distribute_setup
distribute_setup.use_setuptools()
import autowrap.Main
import glob
pxd_files = glob.glob("pxds/*.pxd")
addons = glob.glob("addons/*.pyx")
converters = glob.glob("converters/*.py")
extra_cimports = ["from libc.stdint cimport *",
"from libc.stddef cimport *",
"f... |
import numpy as np
import math
def install(x):
"""
Simple spherical function that can check the validity of an optimization algorithm
http://en.wikipedia.org/wiki/Rosenbrock_function
http://en.wikipedia.org/wiki/Test_functions_for_optimization
f(x1,x2) = 100*(x1^2-x2)^2 + (1-x1)^2
Suggested limits: -... |
from rbnics.backends.basic import import_ as basic_import_
from rbnics.backends.dolfin.function import Function
from rbnics.backends.dolfin.matrix import Matrix
from rbnics.backends.dolfin.vector import Vector
from rbnics.backends.dolfin.wrapping import (build_dof_map_reader_mapping, form_argument_space,
... |
from PyQt5 import QtCore, QtWidgets, QtGui
import logging
import pymysql.cursors
from Resources import Constants
from Resources.UI.ZScanUI import Ui_MainWindow as ZScanUI
class DatabaseSettings(QtCore.QObject):
image_update_needed_signal = QtCore.pyqtSignal()
def __init__(self, shared_objects):
super(Da... |
class Random:
__slots__ = ['_seed', '_value']
def __init__(self, seed):
self._seed = seed
self._value = seed
seed = property(lambda self: self._seed)
def reset(self):
self._value = self._seed
def next_int(self, signed=False):
t = (((self._value * 65535) + 31337) >> 8)... |
'''
Created on 2012-11-30 13:37
@summary:
@author: Martin Predki
'''
from twisted.internet.protocol import DatagramProtocol
class UdpProtocol(DatagramProtocol):
'''
@summary: The Protocol class handles all incoming and outgoing communication
with the udp server.
'''
def __init__(self, udpServer):
... |
from django.shortcuts import render
from django.http import HttpResponse
from django.http import JsonResponse
from django.template import RequestContext, loader
from django.forms.models import model_to_dict
from .models import Dataset
import cgi
from patchwork import createpatch, create_patch_set
from django.db.models ... |
"""Various I/O and serialization utilities."""
import binascii
import contextlib
import io
import struct
def send(conn, data):
"""Send data blob to connection socket."""
conn.sendall(data)
def recv(conn, size):
"""
Receive bytes from connection socket or stream.
If size is struct.calcsize()-compatib... |
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
from django.conf import settings
import django_fsm
import changuito.fields
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
('changuito', '0001_initial'... |
"""Implementation of the Arnold-Winther finite elements."""
from FIAT.finite_element import CiarletElement
from FIAT.dual_set import DualSet
from FIAT.polynomial_set import ONSymTensorPolynomialSet, ONPolynomialSet
from FIAT.functional import (
PointwiseInnerProductEvaluation as InnerProduct,
FrobeniusIntegralM... |
'''Repository of temperature controllers
.. autosummary::
:toctree:
eurotherm
mockup
oxfordcryo
''' |
from odoo import fields, models
class ResPartnerRelation(models.Model):
_inherit = 'res.partner.relation'
strength = fields.Many2one(
string='Strength',
comodel_name='res.partner.relation.strength',
)
note = fields.Char(
'Note',
help='Use this field to add information abo... |
import os
from PyQt4.QtGui import QFileDialog, QUndoCommand, QUndoStack
class UndoFormat(QUndoCommand):
def __init__(self):
self.target = None
self.modif = []
self.originalText = ""
self.next = ""
def setOriginal(self, text):
self.modif.append(text)
self.originalT... |
class Usecase:
def __init__(self, file, **settings):
self.file = file
self.settings = {"library": None}
for key, value in settings.items():
self.settings[key] = value
def execute(self):
for reference in set(self.settings["library"].HasLibraryReferences or []):
... |
from .abstract_mp4_representation import AbstractMP4Representation
class MP4Representation(AbstractMP4Representation):
def __init__(self, encoding_id, muxing_id, media_file, language=None, track_name=None, id_=None, custom_data=None):
super().__init__(id_=id_, custom_data=custom_data, encoding_id=encoding_i... |
__description__ =\
"""
editNames.py
Goes through a file looking for a set of strings, replacing each one with a
specific counterpart. The strings are defined in a delimited text file
with columns naemd "key" and "value".
"""
__author__ = "Michael J. Harms"
__date__ = "091205"
__usage__ = "editTreeNames.py file_to_modi... |
from consts import METRICS_MAXIMIZE, METRICS_MINIMIZE
from npGIAforZ3 import GuidedImprovementAlgorithm, \
GuidedImprovementAlgorithmOptions, RECORDPOINT, setRecordPoint
from src import featuresplitGIA
from src.FeatureSplitConfig import eshop_better_config_names
from src.featuresplitGIA import getBestFeatures, getZ... |
from __future__ import unicode_literals
import itertools
import re
import random
from .common import InfoExtractor
from ..compat import (
compat_HTTPError,
compat_parse_qs,
compat_str,
compat_urllib_parse_urlencode,
compat_urllib_parse_urlparse,
compat_urlparse,
)
from ..utils import (
clean... |
from . import room
import os
import sys
import turtle
import time
print ("You've aquired a broken key, Go to room 43 to reforge it idk man, do do somethin' wit it..")
time.sleep(2)
print ("Also go to room 43 and get my Sun Cream, It's hot in here!")
time.sleep(2)
print ("Welcome to Room 11. Shall we begin. (y/n)")
yes ... |
from __future__ import unicode_literals
import base64
import calendar
import codecs
import contextlib
import ctypes
import datetime
import email.utils
import errno
import functools
import gzip
import itertools
import io
import json
import locale
import math
import operator
import os
import pipes
import platform
import ... |
import argparse
import collections
import json
import shutil
import os
def main():
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument('input_dump', type=argparse.FileType('r'))
arg_parser.add_argument('output_dir')
args = arg_parser.parse_args()
if not os.path.isdir(args.output_dir):
... |
import glob
import os
import shutil
import tempfile
import zipfile
from win32api import GetFileVersionInfo, LOWORD, HIWORD
def BatchRename():
""" Rename all archives in the current directory. """
# Create a temporary directory to store the extracted files.
tempDir = tempfile.mkdtemp(prefix='XYplorer-')
... |
import xmltodict
from collections import OrderedDict
import os
def output(spacer, field, value):
# Just print output
offset = '\n' + spacer + ' ` '
if type(value) is OrderedDict:
print '%s- [%s] <dict>' % (spacer, field)
elif type(value) is list:
print '%s- [%s] <list>' % (spacer, field)
else:
# Showoff, al... |
import configparser
c = configparser.ConfigParser()
c.read("production.ini")
config = {}
config['host'] = c['dboption']['chost']
config['port'] = int(c['dboption']['cport'])
config['user'] = c['dboption']['cuser']
config['pw'] = c['dboption']['cpw']
config['db'] = c['dboption']['cdb']
config['homepath'] = c['option']['... |
from sqlalchemy import Boolean
from sqlalchemy import Column
from sqlalchemy import Enum
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy import Text
from sqlalchemy import UnicodeText
from sqlalchemy.dialects import postgresql as psql
from sqlalchemy.orm im... |
from selenium import webdriver
from fixture.session import SessionHelper
from fixture.group import GroupHelper
from fixture.contact import ContactHelper
import os
class Application:
def __init__(self,browser,base_url):
if browser == "firefox":
self.wd = webdriver.Firefox()
elif browser =... |
''' Call this from __main__ to set the holder arm degrees on the Raspberry Pi.
'''
import argparse
import sys
from client import LaptopClient
DEFAULT_WHEEL_DEGREES = 39
def main(host, port, degrees):
''' Performs the operations of the laptop client, connecting to a
server on host:port.
'''
client = LaptopClient(hos... |
import debug
from screens import screen
from utils import utilities
from stores import valuestore
from keyspecs.toucharea import ManualKeyDesc
from keys.keyspecs import KeyTypes
class SetVarValueKey(ManualKeyDesc):
# This is a key that brings up a sub screen that allows buttons to change the value of the var explicitl... |
import json
from .._abstract.abstract import BaseAGOLClass, BaseSecurityHandler
from ..security import security
import collections
class Services(BaseAGOLClass):
"""
The administration resource is the root node and initial entry point
into a Spatial Data Server adminstrative interface. This resource
... |
from typing import TYPE_CHECKING
from ...file_utils import _LazyModule, is_sentencepiece_available, is_torch_available
_import_structure = {
"configuration_bert_generation": ["BertGenerationConfig"],
}
if is_sentencepiece_available():
_import_structure["tokenization_bert_generation"] = ["BertGenerationTokenizer... |
import os
import time
from collections import namedtuple
from .. import exceptions
try:
from binstar_client.utils import get_server_api
from binstar_client import errors
except ImportError:
get_server_api = None
ENVIRONMENT_TYPE = 'env'
binstar_args = namedtuple('binstar_args', ['site', 'token'])
def is_ins... |
import sys
import json
import time
import datetime
from airflow.contrib.hooks.gcs_hook import GoogleCloudStorageHook
from airflow.hooks.postgres_hook import PostgresHook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
from decimal import Decimal
from tempfile import NamedTemp... |
from __future__ import absolute_import
import fnmatch
import threading
import itertools
import json
import operator
import os
import yaml
from ceilometer import dispatcher
from ceilometer.i18n import _
from oslo_config import cfg
from oslo_log import log
import requests
import six
import stevedore.dispatch
from gnocchi... |
import argparse
import enum
import json
import os
import pathlib
import pprint
import re
import sys
from collections import defaultdict
from typing import Tuple, List, Dict
from math import frexp, log2
from . import sizes
from .utils import sortable_extracted_numbers
debug = False
LOG2_10 = log2(10)
class TimingType(en... |
from direct.showbase import DirectObject
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObject
from direct.task import Task
from direct.distributed import DoInterestManager
from otp.distributed.OtpDoGlobals import *
_ToonTownDistrictStatInterest = None
_ToonTownDistrictStat... |
from __future__ import print_function
from pyspark.ml.linalg import Vectors
from pyspark.ml.feature import (VectorSizeHint, VectorAssembler)
from pyspark.sql import SparkSession
if __name__ == "__main__":
spark = SparkSession\
.builder\
.appName("VectorSizeHintExample")\
.getOrCreate()
#... |
from __future__ import unicode_literals
import unittest
import urllib2
from StringIO import StringIO
import example_responses
import xmltodict
from mopidy_yamaha import talker
class YamahaTalkerTest(unittest.TestCase):
requests = []
default_config = {
'host': '192.168.1.15',
'source': 'HDMI2',
... |
import csv
from os import path
from com.djs.learn.common import LoggingHelper
from com.djs.learn.files.StockCompareRecordsHelper import StockCompareRecordsHelper
input_file_path = "../../../../etc"
output_file_path = "../../../../Temp"
LoggingHelper.set_logging(path.join(output_file_path, "Monitoring.Log"))
file_name =... |
"""Tests for the OAuth2 helper module."""
import mock
from unittest import TestCase
from google.ads.googleads import oauth2
class OAuth2Tests(TestCase):
def setUp(self):
self.client_id = "client_id_123456789"
self.client_secret = "client_secret_987654321"
self.refresh_token = "refresh"
... |
from glob import glob
image_files = glob("images/eq_classes/*png")
help(glob)
get_ipython().magic('matplotlib inline')
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from os.path import basename
eq_images = {}
for image_file in image_files:
file_name = basename(image_file)
eq_class_name = (fil... |
from calvin.actor.actor import Actor, manage, condition, stateguard, calvinsys
class RegistryAttribute(Actor):
"""
Fetch given registry attribute of runtime given as a section.subsection.subsubsection. Will only work for locally known attributes.
Input:
trigger: Any token will trigger a read
Out... |
from __future__ import absolute_import, print_function, division
import unittest
from pony.orm.core import *
from pony.orm.tests.testutils import *
from pony.orm.tests import setup_database, teardown_database
db = Database()
class Student(db.Entity):
name = Required(str)
scholarship = Optional(int)
group = ... |
import logging
import json
from solrupdater import AbstractSolrUpdater
from models import Provider
from utils.dates import facebook_date_to_solr_date
from utils.solr import CORE_NAMES
log = logging.getLogger('facebook')
class FacebookSolrUpdater(AbstractSolrUpdater):
"""
Receive a Facebook post, convert it to a... |
"""
Nuki.io lock platform.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/lock.nuki/
"""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.lock import (LockDevice, PLATFORM_SCHEMA)
from homeassistant.const i... |
from __future__ import print_function
import numpy as np
import unittest
import sys
sys.path.append("..")
from op_test import OpTest
import paddle
import paddle.fluid as fluid
paddle.enable_static()
SEED = 2021
class TestShape(OpTest):
def setUp(self):
self.set_npu()
self.op_type = "shape"
s... |
"""Config flow for Mobile App."""
import uuid
from homeassistant import config_entries
from homeassistant.components import person
from homeassistant.helpers import entity_registry as er
from .const import ATTR_APP_ID, ATTR_DEVICE_ID, ATTR_DEVICE_NAME, CONF_USER_ID, DOMAIN
@config_entries.HANDLERS.register(DOMAIN)
clas... |
from __future__ import absolute_import, unicode_literals
import random
import unittest
from mock import patch
from mock import MagicMock as Mock
from pyrax.cloudloadbalancers import CloudLoadBalancerClient
from pyrax.cloudloadbalancers import CloudLoadBalancer
from pyrax.cloudloadbalancers import Node
from pyrax.cloudl... |
"""Annotator"""
from __future__ import absolute_import
from __future__ import print_function
from .annodoc import AnnoDoc # noqa: F401
from .annospan import AnnoSpan # noqa: F401
from .annotier import AnnoTier # noqa: F401
class Annotator(object):
def annotate(self, doc):
"""Take an AnnoDoc and produce a... |
import contextlib
import json
import os
import pkg_resources
import six
from dcos import package, subcommand
from dcos.errors import DCOSException
import pytest
from mock import patch
from .common import (assert_command, assert_lines, delete_zk_nodes,
exec_command, file_bytes, file_json, get_servic... |
from .parser import parse as _parse
from .result import GitUrlParsed
__author__ = "Iacopo Spalletti"
__email__ = "i.spalletti@nephila.it"
__version__ = "0.10.0"
def parse(url, check_domain=True):
return GitUrlParsed(_parse(url, check_domain))
def validate(url, check_domain=True):
return parse(url, check_domain)... |
import logging
import os
import re
from airflow import configuration as conf
from airflow.configuration import AirflowConfigException
from airflow.utils.file import mkdirs
class FileTaskHandler(logging.Handler):
"""
FileTaskHandler is a python log handler that handles and reads
task instance logs. It create... |
import requests
import cnrclient
from cnrclient.commands.command_base import CommandBase
class VersionCmd(CommandBase):
name = 'version'
help_message = "show versions"
def __init__(self, options):
super(VersionCmd, self).__init__(options)
self.api_version = None
self.client_version =... |
"""
sudo mn --topo single,3 --mac --switch ovsk --controller remote
./pox.py log.level --DEBUG RemoteSwitchRules
sudo mn --custom ~/mininet/custom/topo-3sw-3host.py --topo mytopo --mac --switch ovsk --controller remote
"""
from pox.core import core
import pox
log = core.getLogger()
from pox.lib.packet.ethernet import e... |
"""Support the ISY-994 controllers."""
from collections import namedtuple
import logging
from urllib.parse import urlparse
import PyISY
from PyISY.Nodes import Group
import voluptuous as vol
from homeassistant.const import (
CONF_HOST,
CONF_PASSWORD,
CONF_USERNAME,
EVENT_HOMEASSISTANT_STOP,
)
from homea... |
from insights.parsers import SkipException
from insights.parsers import ovs_appctl_fdb_show_bridge
from insights.parsers.ovs_appctl_fdb_show_bridge import OVSappctlFdbShowBridge
from insights.tests import context_wrap
import doctest
import pytest
FDB_SHOW_BR_INT = """
port VLAN MAC Age
6 29 aa:b... |
import json
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.debug import sensitive_variables # noqa
from horizon import exceptions
from horizon import forms
from horizon import workflows
from openstack_dashboard import api
from openstack_dashboard.dashboards.project.instances \
... |
from typing import Dict
from pandas import DataFrame, concat
from lib.case_line import convert_cases_to_time_series
from lib.cast import numeric_code_as_string
from lib.data_source import DataSource
from lib.utils import table_rename
_ISO_CODE_MAP = {
"02": "C", # CABA
"06": "B", # Buenos Aires
"10": "K",... |
__author__ = 'Administrator'
import string
fr = open("E:\\PyProj\\Others\\rite_HMM_data _test_result_HMM.txt")
sentence = fr.readline()
pos = fr.readline()
event = fr.readline().strip()
pred = fr.readline().strip()
cntEvent = [0 for i in range(16)]
cntPred = [0 for i in range(16)]
cntRight = [0 for i in range(16)]
whil... |
import json
from django import template
register = template.Library()
@register.filter
def get_jsonpath(obj: dict, jsonpath):
"""
Gets a value from a dictionary based on a jsonpath. It will only return
one result, and if a key does not exist it will return an empty string as
template tags should not rai... |
quiz = [
{
'name' : 'q1',
'question' : 'Elasticsearch uses Apache Lucene',
'options' : [
{'answer' : 'True', 'correct' : True},
{'answer' : 'False', 'correct' : False}
]
},
{
'name' : 'q2',
'question' : 'In which programming language ar... |
"""Utility module for optimization."""
import copy
from typing import Any, Collection, Dict, Iterable, List, Sequence
_SEPARATOR_LENGTH = len(' ')
def optimization_exclusion_specified(entry: Dict[str, Any],
optimizer_parameter: str) -> bool:
"""Returns true if the optimizer exclus... |
"""Tests for WinEVTXSessionizerSketchPlugin, LogonSessionizerSketchPludin and
UnlockSessionizerSketchPlugin"""
from __future__ import unicode_literals
import unittest
import copy
import mock
from timesketch.lib.analyzers.evtx_sessionizers import \
LogonSessionizerSketchPlugin
from timesketch.lib.analyzers.evtx_sess... |
from ..broker import Broker
class RoutingAreaMemberBroker(Broker):
controller = "routing_area_members"
def show(self, **kwargs):
"""Shows the details for the specified routing area member.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
... |
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import re
import sys
EXPECTED_HEADER="""# coding=utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
"""
def check_header(filename):
"""Returns True if header check passes."""
try:
w... |
import proto # type: ignore
from google.cloud.aiplatform_v1.types import deployed_model_ref
from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec
from google.cloud.aiplatform_v1.types import env_var
from google.protobuf import struct_pb2 # type: ignore
from google.protobuf import timesta... |
from sicpythontask.PythonTaskInfo import PythonTaskInfo
from sicpythontask.PythonTask import PythonTask
from sicpythontask.InputPort import InputPort
from sicpythontask.OutputPort import OutputPort
from sicpythontask.data.Int64 import Int64
from operator import add
@PythonTaskInfo
class DataInt64Dims(PythonTask):
d... |
import base64
import datetime
import struct
import uuid
from cryptography import fernet
import msgpack
from oslo_config import cfg
from oslo_log import log
from oslo_utils import timeutils
import six
from six.moves import map, urllib
from keystone.auth import plugins as auth_plugins
from keystone.common import utils as... |
"""
test_landsat_ingester.py - unit tests for the landsat_ingester module.
"""
import unittest
import os
import sys
import subprocess
from agdc import dbutil
from agdc.cube_util import DatasetError, Stopwatch
from agdc.landsat_ingester import LandsatIngester
class TestDatasetFiltering(unittest.TestCase):
"""Uni... |
"""
Base utilities to build API operation managers and objects on top of.
"""
import abc
import copy
from oslo_utils import strutils
import urllib.parse
from glanceclient._i18n import _
from glanceclient.v1.apiclient import exceptions
def getid(obj):
"""Return id if argument is a Resource.
Abstracts the common ... |
import os.path
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
from tornado.options import define, options
define("port", default=80, help="run on the given port", type=int)
define("host", default="127.0.0.1:3306", help="blog database host")
define("database", default="blog", h... |
from __future__ import division, unicode_literals, print_function # for compatibility with Python 2 and 3
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import cv2
video_src = './cabrillo-1.asf'
cap = cv2.VideoCapture(video_src)
count=0
t1=np.loadtxt('cabrillo-1-lk-tracked.txt')
ids=np.uni... |
import sys
sys.path.insert(0, '../..')
import test_harness
test_harness.register_generic_assembly_tests(
test_harness.find_files(('.s', '.S')), ['emulator', 'verilator', 'fpga'])
test_harness.execute_tests() |
def get_public_key(project_id, location_id, key_ring_id, key_id, version_id):
"""
Get the public key for an asymmetric key.
Args:
project_id (string): Google Cloud project ID (e.g. 'my-project').
location_id (string): Cloud KMS location (e.g. 'us-east1').
key_ring_id (string): ID of ... |
import json
from stoplight import validate
from deuce.util import set_qs_on_url
from deuce.model import Vault
from deuce import conf
import deuce.util.log as logging
from deuce.transport.validation import *
import deuce
logger = logging.getLogger(__name__)
class CollectionResource(object):
@validate(req=RequestRule... |
__author__ = 'user'
from geom2d.point import Point
l = list(map(lambda i: Point(i, i*i), range(-5, 6)))
l2 = list(filter(lambda p: p.x % 2 == 0, l))
print(l)
print(l2) |
import httplib
import json
from conf import address, sender, receivers, headers, content
c = httplib.HTTPSConnection(address)
path = "/smscenter/v1.0/sendlms"
value = {
'sender' : sender,
'receivers' : receivers,
'subject' : u'LMS 제목',
'content' : content,
}
data = json.dumps(value, ensure_asc... |
import random
from ray.rllib.examples.env.matrix_sequential_social_dilemma import \
IteratedPrisonersDilemma, IteratedChicken, \
IteratedStagHunt, IteratedBoS
ENVS = [
IteratedPrisonersDilemma, IteratedChicken, IteratedStagHunt, IteratedBoS
]
def test_reset():
max_steps = 20
env_all = [init_env(max_... |
import cpauto
import sys
import csv
import pprint
import time
from getpass import getpass
class CheckPointFinder(object):
def __init__(self, session):
self.session = session
# methods for finding all UID's of particulars objects
def findNetworkUIDs(self):
networks = cpauto.Network(self.sessi... |
print ("Hello module world!") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.