text stringlengths 2 999k |
|---|
built_modules = list(name for name in
"Core;Gui;Widgets;PrintSupport;Sql;Network;Test;Concurrent;WinExtras;Xml;XmlPatterns;Help;Multimedia;MultimediaWidgets;OpenGL;OpenGLFunctions;Positioning;Location;Qml;Quick;QuickWidgets;RemoteObjects;Scxml;Script;ScriptTools;Sensors;TextToSpeech;Charts;Svg;DataVisualization;UiT... |
ROOT_URLCONF = 'password_reset.tests.urls'
SECRET_KEY = 'yo secret yo'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'password_reset.sqlite',
},
}
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'password_reset',
'password_... |
import sys
import os
import argparse
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input_directory', type=str, default=r'../data/samples/metadata.csv',
help='directory to save checkpoints')
parser.add_argument('-o', '--output_directory', type=str... |
import unittest, random, sys, time, re
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_rf
targetList = ['red', 'mail', 'black flag', 5, 1981, 'central park', 'good', 'liquor store rooftoop', 'facebook']
lol = [
['red','orange','yellow','green','blue','indigo... |
import datetime
import logging
from typing import Union, List, Optional, Tuple
import pandas as pd
from sqlalchemy import literal
from sqlalchemy.orm import sessionmaker
from schafkopf.database.data_model import Teilnehmer, Runde, Punkteconfig, Einzelspiel, Resultat, Verdopplung, User
from schafkopf.database.session ... |
# Copyright 2017-present Open Networking Foundation
#
# 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 agr... |
"""
Tools for waiting for a cluster.
"""
import click
from dcos_e2e_cli.common.options import (
existing_cluster_id_option,
superuser_password_option,
superuser_username_option,
verbosity_option,
)
from dcos_e2e_cli.common.utils import check_cluster_id_exists, command_path
from dcos_e2e_cli.common.wai... |
from . import commands
from re import match
from logging import debug
from .commandtools import execute
def command_mode(document):
pass
commands.commandmode = command_mode
def publics(obj):
"""Return all objects in __dict__ not starting with '_' as a dict"""
return dict((name, obj) for name, obj in var... |
BASE_API = "https://api.linkedin.com/v1/"
"""
Profile resources
Documentation: http://developer.linkedin.com/documents/profile-api
"""
PROFILE = BASE_API + "people"
"""
Groups resources
Documentation: http://developer.linkedin.com/documents/groups
"""
GROUP_MEMBERSHIPS = BASE_API + "people/~/group-memberships:(grou... |
# Copyright 2022 The FastEstimator 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 appl... |
from ophyd import (EpicsSignal, EpicsSignalRO)
from .. import (RecordBase, _register_record_type,
FieldComponent as Cpt)
@_register_record_type('timestamp')
class TimestampRecord(RecordBase):
alarm_status = Cpt(EpicsSignalRO, '.STAT')
current_raw_value = Cpt(EpicsSignal, '.RVAL')
previous... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# 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-... |
from directory_api_client.client import api_client
import pytest
import requests
import requests_mock
from contact import constants, forms, views
routing_steps = [step for step, _ in views.RoutingFormView.form_list]
@pytest.fixture
def domestic_data(captcha_stub):
return {
'given_name': 'Test',
... |
import pandas as pd
normal = pd.read_csv("WADI_normal.csv")
normal["Normal/Attack"] = "Normal"
normal.to_csv("WADI_normal_2.csv") |
try:
import cv2
import numpy as np
except:
print("Couldn't load cv2")
import math
import subprocess
jpeg = None
def cvThread(cX):
subprocess.call(['v4l2-ctl', '-c', 'exposure_auto=1'])
subprocess.call(['v4l2-ctl', '-c', 'exposure_absolute=5'])
subprocess.call(['v4l2-ctl', '-c', 'brightness=10'... |
# Copyright 2013 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.
class Request(object):
'''Request data.
'''
def __init__(self, path, host, headers):
self.path = path.lstrip('/')
self.host = host.rstrip('/')
... |
#*******************************************************************************
# Copyright 2014-2019 Intel Corporation
# All Rights Reserved.
#
# This software is licensed under the Apache License, Version 2.0 (the
# "License"), the following terms apply:
#
# You may not use this file except in compliance with the Li... |
# -*- coding: utf-8 -*-
"""
"""
from natrixclient.common import const
from natrixclient.command.nreport import execute as report_execute
from natrixclient.bin import ln
def parse_report_basic(*args):
request_parameters = {"type": "basic",
"logger": ln}
response_parameters = dict(... |
from rest_framework import serializers
from .models import Profile,project,Rating
class ProfileSerializer(serializers.ModelSerializer):
class Meta:
model=Profile
fields=('bio','email','profile_pic','user')
class ProjectSerializer(serializers.ModelSerializer):
class Meta:
model=project
... |
import os
import argparse
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
from keras import callbacks, layers, models, optimizers
from keras import backend as K
from keras.utils import to_categorical
from keras.datasets import mnist
from keras.preprocessing.image import ImageDataGenerator
fro... |
import models.container
import models.document
import models.user
import models.url
from functools import lru_cache, wraps
def recurse_docs(documents_json, container_id, workspace_id):
containers = [models.container.Container(
c['name'], c['id'], container_id, workspace_id
) for c in documents_json.ge... |
#!/usr/bin/env python3
# Copyright (c) 2019-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test p2p blocksonly mode & block-relay-only connections."""
import time
from test_framework.messages ... |
# Copyright (c) 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
from . import model
from . import gate_type as gtype
def cx(control, target) :
g = model.Gate(gtype.X())
g.set_ctrllist([control])
g.set_qreg(target)
return g
def ci(control, target) :
g = model.Gate(gtype.ID())
g.set_ctrllist([control])
g.set_qreg(target)
return g
# def swap(qreg0, q... |
import click
from typing import Optional
from ..utils.session import read_session
def _validate_session_and_build_name(session: Optional[str], build_name: Optional[str]):
if session and build_name:
raise click.UsageError(
'Only one of --build or --session should be specified')
if session ... |
default_app_config = 'django_twined.apps.DjangoTwinedAppConfig'
|
# Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
from collections import defaultdict
import time
import random
import dynet as dy
import numpy as np
# Functions to read in the corpus
w2i = defaultdict(lambda: len(w2i))
t2i = defaultdict(lambda: len(t2i))
UNK = w2i["<unk>"]
def read_dataset(filename):
with open(filename, "r") as f:
for lin... |
import logging
from telegram.ext import Updater
from .config import config, get_debug_level
from .database import init_db
from .handlers import add_handlers
from .jobs import register_jobs
def main():
format = config['LOGGING']['Format']
datefmt = config['LOGGING']['DateFormat']
level = get_debug_level(... |
import enum
class Priority(enum.Int):
Low = 1
High = 2
Critical = 3
class PriorityExtended(Priority, export=False):
SubLow = 0
def can_priority_displace(priority_new, priority_existing, allow_clobbering=False):
if priority_new is None:
return False
if allow_clobbering:
return ... |
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PacbioDamasker(MakefilePackage):
"""Damasker: The Dazzler Repeat Masking Suite. This is a ... |
import os
from flask import Flask, request, redirect, url_for, jsonify
from werkzeug import secure_filename
import sys
# assumes run from flaskapp directory
sys.path.append("../vision")
import locate
import db
UPLOAD_FOLDER = 'app/static'
ALLOWED_EXTENSIONS = set(['jpg', 'jpeg', 'png', 'gif'])
app = Flask(__name__)
... |
"""Unit tests for the beta manifold."""
import warnings
from scipy.stats import beta
import geomstats.backend as gs
import geomstats.tests
from geomstats.information_geometry.beta import BetaDistributions, BetaMetric
class TestBetaDistributions(geomstats.tests.TestCase):
"""Class defining the beta distribution... |
from django.db import models
from django.conf import settings
class EducationalInstitution(models.Model):
name = models.CharField(max_length=255)
def __str__(self):
return self.name
@classmethod
def get_institutions_with_enrolled_students(cls):
"""
For recruiters to use, so t... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import re
try:
basestring
except NameError:
basestring = str
__all__ = [
'i_to_rgb',
'i_to_red',
'i_to_green',
'i_to_blue',
'i_to_white',
'i_to_black',
'rgb_to_hex',
'... |
"""Test the event converter from Meetup JSON to event object."""
from meetup2xibo.updater.event_converter import EventConverter, Event, PartialEvent
from meetup2xibo.updater.event_location import EventLocation
from meetup2xibo.updater.location_chooser import LocationChooser
from meetup2xibo.updater.time_converter impo... |
# Copyright 2019 DeepMind Technologies Ltd. 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 appl... |
# -*- coding: utf-8 -*-
"""
pip_services3_data.ILoader
~~~~~~~~~~~~~~~~~~~~~~~~~
Interface for data loaders.
:copyright: Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
from abc import ABC
from typing import List, O... |
A = int( input() )
B = int( input() )
C = int( input() )
mul = str( A * B * C )
for i in range(10):
print( mul.count( str(i) ) ) |
import os
# from abc import abstractmethod
defaultValues = {
"SERVER_PROTOCOL": "http://",
"SERVER_HOST": "localhost",
"SERVER_PORT": "8080",
"DATE_ANNOTATOR_PROTOCOL": "http://",
"DATE_ANNOTATOR_HOST": "localhost",
"DATE_ANNOTATOR_PORT": "9000",
"PERSON_NAME_ANNOTATOR_PROTOCOL": "http://",... |
"""Support for MQTT lights."""
import logging
import voluptuous as vol
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_EFFECT,
ATTR_HS_COLOR,
ATTR_RGB_COLOR,
ATTR_WHITE_VALUE,
ATTR_XY_COLOR,
COLOR_MODE_RGB,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
... |
import sys
import os
import math
import argparse
import json
with open('./caffePath.cfg') as f:
caffe_path = f.readlines()
sys.path.append('%s/python' % caffe_path)
print 'specified caffe path: %s' % caffe_path
import caffe
from caffe import layers as L # pseudo module using __getattr__ magic to generate protobuf ... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... |
from setuptools import setup
setup(
name = 'CodeChallenge---TextClassification',
version = '0.1.0',
packages = ['textClassifierCLI'],
entry_points = {
'console_scripts': [
'textClassifierCLI = textClassifierCLI.__main__:main'
]
}) |
from transmute_core.exceptions import NoSerializerFound
class SerializerSet(object):
"""
composes multiple serializers, delegating commands to one
that can handle the desired content type.
SerializerSet implements a dict-like interface. Retrieving
serializers is done by get the content type item:... |
from datetime import datetime
import requests
import json
from decimal import *
import boto3
from urllib.parse import quote
API_KEY = ""
# API constants, you shouldn't have to change these.
API_HOST = 'https://api.yelp.com'
SEARCH_PATH = '/v3/businesses/search'
BUSINESS_PATH = '/v3/businesses/' # Business ID will co... |
class Frame:
def __init__(self, rtsp_address, fps, img_id, img, time, gray_scale_flag):
self.__rtsp_address = rtsp_address
self.__fps = fps
# Frame
self.__img_id = img_id
self.__img = img
self.__time = time
self.__img_shape = img.shape
self.__gray_scale_flag = gray_scale_flag
def get_img_id(self)... |
from django.contrib import admin
from django.urls import path
from django.conf.urls.static import static
from django.conf import settings
from . import views
urlpatterns = [
path('', views.index, name="index"),
path('create/', views.create, name="create"),
path('teacher-admin/', views.teacher_admin, name="... |
import smart_imports
smart_imports.all()
class PlaceTaxSizeBorderTests(helpers.BaseTestPrototypes):
def setUp(self):
super().setUp()
self.place = self.place1
self.place_2 = self.place2
self.place.attrs.tax_size_border = 1
self.place_2.attrs.tax_size_border = 4
... |
class FtpOutputListQueryParams(object):
def __init__(self, offset=None, limit=None, name=None):
# type: (int, int, string_types) -> None
super(FtpOutputListQueryParams, self).__init__()
self.offset = offset
self.limit = limit
self.name = name
@property
def openapi_t... |
#!/usr/bin/env python3
"""
Defines the SeEpub class, the master class for representing and operating on
Standard Ebooks epub3 files.
"""
import base64
import datetime
import os
from pathlib import Path
from typing import Dict, List, Optional, Tuple, Union
from sys import getsizeof
import git
from lxml import etree
fr... |
# Generated by Django 2.2.9 on 2020-01-16 14:22
from django.db import migrations, models
import django.utils.timezone
import django_use_email_as_username.models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = ... |
"""
This code is released under the terms of the GNU General Public License (GPL) version 3.
Author: Adam D. Light
Contact: adamdlight [at] gmail.com
Latest update: 05 February, 2012
"""
import sys
import traceback
import struct
import numpy
import tables
class Cine(object):
"""
Cine is a data container class that all... |
#!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function
#
# Standard imports
#
import glob, os
from distutils.extension import Extension
#
# setuptools' sdist command ignores MANIFEST.in
#
#from distutils.command.sdist import... |
import os
import tempfile
import pytest
import json
from ...utilities.macro import substitute_in_file, parse_macro_string
@pytest.mark.parametrize("text, macros, expected", [
(
'This is a ${what} to ensure that macros work. ${A} ${B} ${C}',
{'what': 'test', 'A': 'X', 'B': 'Y', 'C': 'Z'},
... |
from torch.utils.data.sampler import WeightedRandomSampler
import sklearn.metrics
from collections import Counter
from copy import deepcopy
import numpy as np
import torch
import torch.nn.functional as F
from torch.utils import data
from torchvision import transforms
from tqdm import tqdm
from dataset import PixelSet... |
import argparse
import sys
from collections import Counter
from collections import defaultdict
import itertools
import time
import numpy as np
import math
import pickle
from scipy import stats
import setRank_ESR
def string2dict(s):
d = {ele.split(":")[0]: float(ele.split(":")[1]) for ele in s.split(",")}
return d... |
from functools import wraps
import itertools
import random
from nose.tools import nottest
from ..utils import Lazy_Coord, Node, not_set, Grid, bytify, jsonify
@nottest
def unary_test(function):
@wraps(function)
def wrapper(self):
coords = [(Lazy_Coord(obj, "x"), Lazy_Coord(obj, "y")) for obj in self.ob... |
#!/usr/bin/env python2
# vim: set ts=4 sw=4 tw=79 fileencoding=utf-8:
from __future__ import absolute_import
from builtins import chr
from wcf.MyHTMLParser import HTMLParser, interesting_cdata
try:
from htmlentitydefs import name2codepoint
except ImportError:
from html.entities import name2codepoint
import ... |
from . import Base
Parties = []
class PoliticalParty(Base):
"""A class used to store and retrieve political parties"""
def __init__(self):
super().__init__(Parties)
def create_party(self, _name, _hqAddress, _logoUrl):
"""Save new party to parties dictionary"""
new_party = dict()
... |
"""Read the Docs tasks."""
import os
from invoke import task, Collection
import common.tasks
import common.dockerfiles.tasks
ROOT_PATH = os.path.dirname(__file__)
namespace = Collection()
namespace.add_collection(
Collection(
common.tasks.prepare,
common.tasks.release,
),
name='deploy... |
from scipy.stats import chisquare as chi2
def calculate_chisquare(text: bytes) -> float:
return chi2(text).statistics
|
# ## Copyright (c) 2012, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy
np = numpy
from ..core.parameterization import Param
from GPy.core.model import Model
from ..util.block_matrices import get_blocks, get_block_shapes, unblock, get_blocks_3d, get_block_shape... |
from datetime import datetime
from django import forms
from django.utils.safestring import mark_safe
from django.utils.encoding import force_text
from django.utils.formats import get_format
from django.utils.translation import get_language
from django.conf import settings
from django.template.loader import render_to_s... |
# encoding: utf-8
"""
@author: BrikerMan
@contact: eliyar917@gmail.com
@blog: https://eliyar.biz
@version: 1.0
@license: Apache Licence
@file: cnn_lstm_model.py
@time: 2019-01-24 15:27
"""
import logging
from keras.layers import Dense, Conv1D, TimeDistributed, Activation
from keras.layers.recurrent import LSTM
from ... |
class PytestTestRunner(object):
"""Runs pytest to discover and run tests."""
def __init__(self, verbosity=1, failfast=False, keepdb=False, **kwargs):
self.verbosity = verbosity
self.failfast = failfast
self.keepdb = keepdb
def run_tests(self, test_labels):
"""Run pytest and... |
import asyncio
import logging
from abc import abstractmethod, ABCMeta
from asyncio import Task, Future
from datetime import timedelta
from enum import Enum
from functools import reduce
from inspect import signature
from typing import Callable, List, Awaitable, Any
from protoactor.actor import messages, log
from protoa... |
# Copyright (c) ByteDance, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""
Copy-paste from backgrounds_challenge library:
https://github.com/MadryLab/backgrounds_challenge
"""
import os
import... |
from collections import defaultdict
def solution(n, results):
answer = 0
graph = defaultdict(list)
for result in results: # graph dictionary는 "선수 번호" : [해당 선수가 이긴 result들] 로 구성되어 있다.
graph[result[0]].append(result)
for key in range(1, n + 1): # 삼단논법을 통해 확장시킬 수 있는 result들을 확장시킨다.
in... |
import unittest
import collections
import pickle
import random
import mock
import six
from torchnlp.text_encoders import subword_text_tokenizer
from torchnlp.text_encoders.subword_text_tokenizer import encode
from torchnlp.text_encoders.subword_text_tokenizer import decode
from torchnlp.text_encoders.subword_text_tok... |
'''
Created on 22.08.2011
@author: kca
'''
from ..ssl import HTTPSMixin
from ..wsgi import WSGIServer
from SocketServer import ThreadingMixIn, ForkingMixIn
from wsgiref.simple_server import WSGIRequestHandler
from futile import NOT_SET
class SecureWSGIServer(HTTPSMixin, WSGIServer):
def __init__(self, server_addres... |
#!/usr/bin/env python
import rospy
import cv2
from duckietown_msgs import (Pixel, Vector2D, Segment, SegmentList)
from ground_projection import (EstimateHomography, GetGroundCoord, GetImageCoord)
from sensors_msgs import (Image, CameraInfo, image_encodings)
from cv_bridge import CvBridge
import numpy as np
from ground... |
#!/usr/bin/env python
"""A Skeleton HTML page template, that provides basic structure and utility methods.
"""
##################################################
## DEPENDENCIES
import sys
import os
import os.path
try:
import builtins as builtin
except ImportError:
import __builtin__ as builtin
from os.path... |
#**************************************************************
#**************************************************************
#**************************************************************
#
# - This Python file contains the functions required for
# demonstrating the functionality of Bayesian maximum variance
# in... |
"""Utilities for parsing typeshed files."""
import os
from pytype import module_utils
from pytype import pytype_source_utils
from pytype import utils
from pytype.pyi import parser
from pytype.pytd.parse import builtins
def _get_module_names_in_path(lister, path):
names = set()
try:
contents = list(lister(pa... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from django import forms
from django.contrib.auth.models import AnonymousUser
from faker import Faker
from machina.apps.forum_conversation.forms import PostForm
from machina.apps.forum_conversation.forms import TopicForm
from machina.conf ... |
# Generated by Django 3.0.7 on 2020-10-02 21:52
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0004_auto_20201002_2239'),
('profiles', '0016_auto_20201002_2346'),
]
operations = [
migrat... |
import logging.config
from flask import Flask
from pymongo import MongoClient
from module.util.cryptUtil import AESCipher
# APP INITIALIZATION
SECRET_KEY = 'supersecretkey'
config = {
'APP_NAME': 'authentication-module',
'APP_HOST': '0.0.0.0',
'APP_PORT': 50000,
'APP_VERSION': '0.19',
'APP_STAGE... |
"""Constants for Checks App"""
PHONE_REGEX = r'(\d{1}-)?\d{3}-\d{3}-\d{4}( ext \d{1,})?$'
PHONE_MESSAGE = ('Enter a valid phone number (example: 1-234-567-8910',
'or 123-456-7890, or 1-234-567-8910 ext 3348).',)
ORG_REGEX = r'^[A-Za-z0-9]{2,4}$'
ORG_MESSAGE = 'Please enter a 2-4 digit alphanumeric cod... |
# -*- coding: utf-8 -*-
""" EVOKE Page class - allowing several "kinds" of pages, including default kinds:
- page : a generic page, which can have child pages (of any kind)
- file : a reference to a flat file, available for download its parent page
- image : a reference to a an image flat file... |
# Escreva um programa que leia um valor em metros e o exiba convertido em centímetros e milímetros
medida = float(input('Digite o valor em metros: '))
cent = int(medida * 100)
mili = int(medida * 1000)
print('{} metros, equivalem a {} centímetros e {} milímetros'.format(medida, cent, mili))
|
import sys
import os
import errno
cur_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.abspath("%s/../management" % cur_dir))
sys.path.append(os.path.abspath("%s/../examples" % cur_dir))
# sys.path.insert(0, os.path.abspath('%s/../containers/python/' % cur_dir))
import clipper_manager
from tuto... |
from flask import current_app,jsonify,request
from app import create_app,db
from models import Articles,articles_schema
# Create an application instance
app = create_app()
# Define a route to fetch the avaialable articles
@app.route("/articles", methods=["GET"], strict_slashes=False)
def articles():
articles = Art... |
"""
Test the ColumnTransformer.
"""
import re
import pickle
import warnings
import numpy as np
from scipy import sparse
import pytest
from numpy.testing import assert_allclose
from sklearn.utils._testing import assert_raise_message
from sklearn.utils._testing import assert_array_equal
from sklearn.utils._testing impo... |
# Copyright (c) 2016, the GPyOpt Authors
# Licensed under the BSD 3-clause license (see LICENSE.txt)
from .base import AcquisitionBase
from .EI import AcquisitionEI
from GPyOpt.acquisitions.EI_mcmc import AcquisitionEI_MCMC
from .MPI import AcquisitionMPI
from .MPI_mcmc import AcquisitionMPI_MCMC
from .LCB import Acqu... |
import numpy as np
parameters = {
'size_range': (300, 1000),
'bins_range': (7, 100),
'mu_range': (0, 4),
'sigma_range': (0.01, 0.5),
'k_range': (1, 10),
'lambda_range': (0.5, 1.5),
'theta_range': (0.5, 2),
'low_range': (0.2, 1),
'high_range': (1, 2),
}
def generate_data():
# se... |
#
# Copyright 2017 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
# Copyright 2019 TerraPower, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
import os
import pytest
from condor.record import record_iterator_class
from condor.record import BibtexRecordParser
from condor.record import FroacRecordIterator
from condor.record import FroacRecordParser
from condor.record import IsiRecordIterator
from condor.record import IsiRecordParser
from condor.record import ... |
from shared_config import *
word_size = 32
num_words = 2048
output_extended_config = True
output_datasheet_info = True
netlist_only = True
nominal_corner_only = True |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... |
"""vector.py contains definitions for Vector and VectorArray classes"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
class BaseVector(np.ndarray):
"""Class to contain basic operations used b... |
import torch
import cv2
import numpy as np
from .models.with_mobilenet import PoseEstimationWithMobileNet
from .modules.keypoints import extract_keypoints, group_keypoints
from .modules.load_state import load_state
from .modules.pose import Pose
from . import demo
def get_rect(net, images, height_size=512):
strid... |
##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... |
#!/usr/bin/env python3
# Copyright (c) 2015-2017 The QQcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Functionality to build scripts, as well as SignatureHash().
This file is modified from python-QQcoinlib... |
# --------------------------------------
# doregression.py
#
# sample regression problem
# Parameters:
#
#
# Returns:
#
# Example:
#
#
# Also defines:
#
# Greg Hartwell
# 2017-11-1
#----------------------------------------------------------------------------
import matplotlib.pyplot as plt
import numpy as... |
def main():
name = input("What is your name? ")
speech = "\nHello, " + name + ", nice to meet you!"
print(speech)
main()
|
from .._toolchain.yosys import *
from . import rtlil
__all__ = ["YosysError", "convert", "convert_fragment"]
def _convert_rtlil_text(rtlil_text, black_boxes, *, src_loc_at=0):
if black_boxes is not None:
if not isinstance(black_boxes, dict):
raise TypeError("CXXRTL black boxes must be a dict... |
import chainer
from src.function.reshape import flatten
from src.function.activation import relu
from src.link.convolution_2d import Convolution2D
from src.link.linear import Linear
from src.link.last_linear import LastLinear
class OuterPolytope(chainer.Chain):
"""Convolutional network with ReLU.
We followed ... |
# Faça uma lista que receba números enquanto o usuário desejar, mas apenas os não repetidos e mostre
# algumas informações sobre
lista =[];
opcao = ' ';
while True:
lista2 = lista[:];
lista.append(int(input('Digite um número: ')));
if lista[-1] in lista2:
print('O item ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.