text stringlengths 2 999k |
|---|
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2020 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Community module tests."""
import pytest
from flask import url_for
from invenio_accoun... |
#!/usr/bin/env python
"""
ViperMonkey: VBA Grammar - Statements
ViperMonkey is a specialized engine to parse, analyze and interpret Microsoft
VBA macros (Visual Basic for Applications), mainly for malware analysis.
Author: Philippe Lagadec - http://www.decalage.info
License: BSD, see source code or documentation
Pro... |
# Copyright 2020 Huy Le Nguyen (@usimarit)
#
# 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 t... |
import time
from lemur.plugins.lemur_aws.sts import sts_client
@sts_client('route53')
def wait_for_r53_change(change_id, client=None):
_, change_id = change_id
while True:
response = client.get_change(Id=change_id)
if response["ChangeInfo"]["Status"] == "INSYNC":
return
ti... |
from flask import Flask, render_template, redirect, url_for, jsonify, request
from flask_sqlalchemy import SQLAlchemy
from full_classes import getFullClasses, getAllReviews
from condensed_classes import getMajors, getTreqs
from prof_info import getAllProfs
from flask_cors import CORS
import models
import forms
import s... |
from django.contrib import admin
from django.conf import settings
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('api/v1/user/', include('user.urls')),
path('api/v1/todolist/', include('todolist.urls')),
]
if settings.DEBUG:
import debug_toolbar
urlpatt... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
surfaces --- Models for surfaces
================================
.. autosummary::
:toctree: generated/
Surface Models
--------------
SurfaceRadiation
DAp
DApColor
HG
NEATM
Phase functions
---------------
phaseHG
... |
# coding=utf-8
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ... |
import logging
from ..exceptions import (
LoaderException,
)
logger = logging.getLogger(__name__)
class LoaderFormatterException(LoaderException):
pass
|
import rl
from core import do_one, exhaust, switch
from traverse import top_down
def subs(d, **kwargs):
""" Full simultaneous exact substitution
Example
=======
>>> from sympy.strategies.tools import subs
>>> from sympy import Basic
>>> mapping = {1: 4, 4: 1, Basic(5): Basic(6, 7)}
>>> ex... |
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
###############################################################################
# PURPOSE:
# Lambda function to check the status of a Rekognition job and save that job's
# data to the MIE dataplane when ... |
import logging
import functools
log = logging.getLogger('decorators')
log.setLevel(logging.INFO)
decorated = set()
def deflog(f):
log.debug('decorating function: %s', f.__name__)
decorated.add(f.__name__)
@functools.wraps(f)
def wrapped(*args, **kwargs):
log.debug('calling function: %s', f... |
import numpy as np
from numba import from_dtype, cuda
from numba.cuda.testing import skip_on_cudasim, SerialMixin
import unittest
class TestAlignment(SerialMixin, unittest.TestCase):
def test_record_alignment(self):
rec_dtype = np.dtype([('a', 'int32'), ('b', 'float64')], align=True)
rec = from_dty... |
#pylint: disable=W0401
from .bike import *
|
import torch
from torch import nn, optim
from torch.nn import functional as F
import torch.nn.init as init
def _weights_init(m):
classname = m.__class__.__name__
#print(classname)
if isinstance(m, nn.Linear) or isinstance(m, nn.Conv2d):
init.kaiming_normal_(m.weight)
class LambdaLayer(nn.Module):... |
# Copyright 2015 The TensorFlow 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 applica... |
# Copyright 2018 Huawei Technologies Co.,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
#
# Unl... |
from zeit.cms.i18n import MessageFactory as _
import zeit.cms.browser.view
import zeit.cms.checkout.interfaces
import zeit.cms.content.interfaces
import zeit.cms.interfaces
import zope.app.appsetup.product
import zope.cachedescriptors.property
import zope.location.interfaces
import zope.traversing.api
MARKER = object... |
import wx
from wx.lib.masked import NumCtrl
class ZaberControlPanel(wx.Panel):
def __init__(self, zaber, *args):
wx.Panel.__init__(self, *args)
self._zaber = zaber
self._home_button = wx.Button(
self, label="Home Zaber", size=(100, 24))
self._home_button.Bind(... |
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 10 21:52:21 2021
@author: qq735
"""
from multiprocessing import Process
from socket import *
# import wiringpi
import RPi.GPIO as GPIO
import time
import string
import threading
import timeout_decorator
import serial
import pynmea2
serialPort = serial.Serial("/dev/tty... |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 7 12:23:48 2020
@author: Leonard Wee
"""
import os
#import pandas as pd
import pydicom as dicom
import json
import re
def generator(homeFolder,outputdir):
jsonfile_list = []
#Spinal-Cord dictionary
spinalcorddict = {
"labelID": 1,
"SegmentDes... |
# -*- coding: utf-8 -*-
""" gtorch_utils/segmentation/loss_functions/dice """
def dice_coef_loss(inputs, target):
"""
Source: https://www.kaggle.com/bonhart/brain-tumor-multi-class-segmentation-baseline
"""
num = target.size(0)
inputs = inputs.reshape(num, -1)
target = target.reshape(num, -1)
... |
from django.test import TestCase
from whateverapp.models import *
import factory
class CityFactory(factory.DjangoModelFactory):
class Meta:
model = City
name = "New York City"
class HotelFactory(factory.DjangoModelFactory):
class Meta:
model = Hotel
name = "Omni",
room_charge =... |
# Lint as: python2, python3
# Copyright 2020 The TensorFlow 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... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Christian Heider Nielsen"
__doc__ = r"""
Created on 22/03/2020
"""
"""Credit: mostly based on Ilya's excellent implementation here:
https://github.com/ikostrikov/pytorch-flows"""
import numpy
import torch
from torch import nn
from tor... |
from benchmarkstt.helpers import make_printable
from benchmarkstt.deferred import DeferredCallback
import pytest
def cb(txt):
def _():
_.cb_count += 1
return '[%s]' % (txt,)
_.cb_count = 0
return _
class ToDefer:
def __init__(self, value):
self.value = value
self.cb_c... |
class ClientError(Exception):
"""Common base class for all client errors."""
pass
class NotFoundError(ClientError):
"""URL was not found."""
pass
class InvalidRequestError(ClientError):
"""The API request was invalid."""
pass
class TimeoutError(ClientError):
"""The API server did no... |
# Copyright 2016 The TensorFlow 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.DeliverAddress import DeliverAddress
class AlipayUserUserinfoShareResponse(AlipayResponse):
def __init__(self):
super(AlipayUserUserinfoShareResponse, se... |
import imp
import os
import sys
import numpy as np
from pyrl import utils
from pyrl.figtools import Figure, mpl
#=========================================================================================
# Files
#=========================================================================================
here ... |
import boto3
import parsedatetime
import datetime
import logging
class EBSBackup:
def __init__(self, config):
self.config = config
self._cal = parsedatetime.Calendar()
self.log = logging.getLogger(self.__class__.__name__)
def backup(self):
"""Backup volumes specified in config... |
from toontown.building import DistributedBBElevatorAI
from toontown.building import FADoorCodes
from toontown.building.DistributedBoardingPartyAI import DistributedBoardingPartyAI
from toontown.coghq import DistributedCogKartAI
from toontown.hood import CogHQAI
from toontown.suit import DistributedBossbotBossAI
from to... |
#!/usr/bin/env python3
'''
Remove blockchain-backup.local from /etc/hosts.
Copyright 2018-2020 DeNova
Last modified: 2020-11-02
'''
import os.path
import sys
def main():
'''
On Linux systems, remove
blockchain-backup.local from /etc/hosts.
>>> from denova.os.user import whoam... |
import numpy as np
import scipy as scipy
import matplotlib.pyplot as plt
|
#!/usr/bin/env python
# encoding: utf-8
'''
@author: ZYZ
@contact: 609924504zyz@gmail.com
@file: Main.py
@time: 5/9/2020 19:10
@desc:半自动淘宝商品评论抓取工具
'''
import taobao
import filePreRegular
import dataAnalysis as DA
import configparser
import time
import random
cp = configparser.RawConfigParser()
cp.read('Infor.conf')
#... |
from FinancialFileFetcher import FinancialFileFetcher
def test_geturls():
l_identifier = ['AAPL', 'MSFT']
test_key = 'a42ff36922e94fbba2a2ad35a595905f'
start_date = '2020-01-02'
end_date = '2021-09-01'
l_file_form = ['10-Q','10-K']
ret_df = FinancialFileFetcher.get_urls(l_identifier = l_identif... |
# -*- coding: utf-8 -*-
import os
from oslo_config import cfg
CONF = cfg.CONF
CONF.register_opts([
cfg.StrOpt('env'),
cfg.StrOpt('secret_key'),
cfg.StrOpt('log_dir'),
cfg.StrOpt('tmp_dir'),
cfg.StrOpt('pidfile'),
cfg.StrOpt('backup_dir'),
cfg.IntOpt('zone_update_interval'),
cfg.StrOp... |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
"""This example demonstrates the usage of Optuna with Ray Tune.
It also checks that it is usable with a separate scheduler.
"""
import time
import ray
from ray import tune
from ray.tune.suggest import ConcurrencyLimiter
from ray.tune.schedulers import AsyncHyperBandScheduler
from ray.tune.suggest.optuna import Optuna... |
from typing import Dict, Set, Tuple
import numpy as np
import mutation_prediction_native as native
from mutation_prediction import data
from mutation_prediction.data import Dataset
def load_alignments(dataset: Dataset) -> Dict[str, Tuple[str, Set[str]]]:
return native.load_alignments(dataset.get_msa_path(), dat... |
from torch import nn
from torch.autograd import Variable
import torch
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
import numpy as np
# from models.vgg_tro_channel1 import vgg16_bn
from models.vgg_tro_channel3 import vgg16_bn, vgg19_bn
# torch.cuda.set_device(1)
DROP_OUT = False
LSTM = Fa... |
"""
client.py
Establish a connection to the database
"""
import logging
from pymongo import MongoClient
from pymongo.errors import ConnectionFailure, ServerSelectionTimeoutError
try:
# Python 3.x
from urllib.parse import quote_plus
except ImportError:
# Python 2.x
from urllib import quote_plus
LOG... |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Deuscoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Linux network utilities
import sys
import socket
import fcntl
import struct
import array
import os
imp... |
import numpy as np
class Muscle(object):
"""This class implements the muscle model.
The muscle model is based on the hill-type muscle model.
"""
# Default Muscle Parameters
c = np.log(0.05) # pylint: disable=no-member
N = 1.5
K = 5.0
tau_act = 0.01 # Time constant for the activation... |
import _plotly_utils.basevalidators
class ValueValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="value",
parent_name="scattergeo.marker.colorbar.tickformatstop",
**kwargs,
):
super(ValueValidator, self).__init__(
plotl... |
# coding: utf-8
# flake8: noqa
"""
News feeds APIs
Various news feeds.<BR />[Endpoint] https://api.apitore.com/api/34 # noqa: E501
OpenAPI spec version: 0.0.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
# import apis into sdk p... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('myapp', '0012_auto_20150729_0021'),
]
operations = [
migrations.AddField(
model_name='streetlighting1',
... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 0, transform = "BoxCox", sigma = 0.0, exog_count = 20, ar_order = 0); |
"""Facilities to analyze entire programs, including imported modules.
Parse and analyze the source files of a program in the correct order
(based on file dependencies), and collect the results.
This module only directs a build, which is performed in multiple passes per
file. The individual passes are implemented in ... |
from pyplan_core.classes.wizards.BaseWizard import BaseWizard
import pandas as pd
import jsonpickle
class Wizard(BaseWizard):
def __init__(self):
self.code = "DataframeGroupby"
def generateDefinition(self, model, params):
nodeId = params["nodeId"]
if model.existNode(nodeId):
... |
import os
pluginName = os.path.abspath(__file__).split(os.path.sep)[-2]
pluginNameFriendly = (pluginName[0].upper()+pluginName[1:]).replace('_',' ')
from corpusslayer.hooks import getAnalysisOptionsEmptyContainer
from corpusslayer.bootstrap_constants import COLOR
from django.utils.translation import ugettext_lazy as _
... |
#Formato que criei o teste 5, existe outro modo conforme aprenstação abaixo
#n1 = int(input('Digite um número: '))
#n2 = n1 + 1
#n3 = n1 - 1
#print('Você sabia que o sucessor do {} é {} e o antecessor é {}'.format(n1,n2,n3))
n = int(input('Digite um número: '))
print('Analisando o valor {}, seu antecessor é {} e o su... |
import collections.abc
import pytest
import src.graph
def _bidirectional_edge(
v1: src.graph.Vertex,
v2: src.graph.Vertex,
weight: src.graph.GraphDistance) -> list[src.graph.Edge]:
return [src.graph.Edge(v1, v2, weight), src.graph.Edge(v2, v1, weight)]
class _NotEdge(object):
"""This... |
#!/bin/env python3
# -*- coding: utf-8 -*-
## Evan Widloski - 2016-12-03
## redrum - Reddit wallpaper ranker and changer
## Uses logistic function to choose wallpaper based
## on number of views, resolution and aspect ratio
from __future__ import print_function
import sys
# if sys.version_info[0] < 3:
# sys.ex... |
# Copyright 2018 The Bazel Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 2 00:20:41 2021
@author: jacob
"""
import cv2
import mediapipe as mp
from vedo import *
from time import sleep
from google.protobuf.json_format import MessageToDict
import numpy as np
from utils import *
MEMORY_DEBUG = False
THUMB_TIP_INDEX = 4
INDEX_TIP_INDEX = 8
MI... |
from Generative_Models.Generative_Model import GenerativeModel
import torch
from utils import *
class ConditionalModel(GenerativeModel):
# if no task2generate are given we generate all labellize for all task
# if task2generate and annotate == false we generate only for the actual task
# if task2generate... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
# encoding: utf-8
# Copyright 2012 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 applica... |
# -*- coding: utf-8 -*-
#
# Copyright 2019-2021 - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in c... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""TcEx Framework InstallJson Object."""
import json
import os
from collections import OrderedDict
class InstallJson(object):
"""Object for install.json file."""
def __init__(self, filename=None, path=None):
"""Initialize class properties."""
self... |
import logging
import os
import json
import azure.functions as func
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Received auth request.')
validLogin = False
try:
req_body = req.get_json()
except ValueError:
logging.info("Could not get json body"... |
import logging
import os
import sys
os.makedirs('./log', exist_ok=True)
_error_log_file = os.path.expanduser('./log/error.log')
_critical_log_file = os.path.expanduser('./log/critical.log')
formatter = logging.Formatter('[%(asctime)s %(name)s] %(levelname)s: %(message)s')
default_handler = logging.StreamHandler(sys.s... |
from django.urls import path
from django.conf.urls import url
from . import views
urlpatterns = [
path('', views.index, name='index'),
url('result', views.result, name='result')
] |
#
# Copyright (C) 2011 by Brian Weck
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
#
import sys, os.path, time, re
import urllib, urllib2, cookielib
import simplejson, HTMLParser
from urlparse import urlparse
from HTTPHeaderLogger import HTTPHeaderLoggerHandler
from . import lo... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
import mock
from click.testing import CliRunner
from unittest import TestCase
from shub import exceptions as shub_exceptions
from shub_image.push import cli
from .utils import FakeProjectDirectory
from .utils import add_sh_fake_config
@mock.patch('shub_image.utils.get_docker_client')
class TestPushCli(TestCase):
... |
#!/usr/bin/env python
from datetime import datetime, timedelta
import json
from dateutil.parser import parse
from flask import render_template
import pytz
from app_utils import *
from render_utils import make_context
def senate_big_board():
"""
Senate big board
"""
from models import Race
races... |
from __future__ import division
import torch
import numpy as np
def parse_conv_block(m, weights, offset, initflag):
"""
Initialization of conv layers with batchnorm
Args:
m (Sequential): sequence of layers
weights (numpy.ndarray): pretrained weights data
offset (int): current posi... |
"""
Functions to test the spatial tools.
"""
from __future__ import annotations
import warnings
from typing import Callable
import numpy as np
import pytest
import rasterio as rio
import geoutils as gu
from geoutils import datasets
from geoutils.georaster import RasterType
# def test_dem_subtraction():
# """Tes... |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import operator
impo... |
import pygame
#Imports pygame libraries to help with the structures of the game and setup.
import random
#Imported to generate random numbers for the enemies and prize appearance.
pygame.init()
#Initializes the pygame modules that will be used.
screen_width = 1600
screen_height = 800
screen = pygame.display... |
import smart_imports
smart_imports.all()
class LogicStorageTestsCommon(utils_testcase.TestCase):
def setUp(self):
super(LogicStorageTestsCommon, self).setUp()
self.p1, self.p2, self.p3 = logic.create_test_map()
self.storage = logic_storage.LogicStorage()
def test_initialize(self)... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import astropy.units as u
def func(x, a, b, c, d, e):
return a + b * x + c * x ** 2 + d * x ** 3 + e * x ** 4
model = "fiducial"
colors = ["#add0ed", "#2b5d87", "#4288c2", "#17334a"]
Tobs = 4 * u.yr
power_dat_F50 = pd.read_hdf(
"../data/... |
import os
from werkzeug.contrib.fixers import ProxyFix
from app import create_app
app = create_app('production')
app.wsgi_app = ProxyFix(app.wsgi_app)
if __name__ == '__main__':
app.run()
|
# -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2020 PyBuilder Team
#
# 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/l... |
gestures = ["wink", "double blink", "close your eyes", "jump"]
def handshake(s):
s = list(sanitize(s))
s.reverse()
seq = []
lim = len(s) if len(s) <= len(gestures) else len(gestures)
for i1 in range(lim):
if s[i1] == "1":
seq.append(gestures[i1])
if len(s) == 5:
seq... |
# push: O(1)
# pop: O(1)
# top: O(1)
# getMin: O(1)
class MinStack:
def __init__(self):
"""
initialize your data structure here.
"""
self.stack = []
self.min = float('inf')
def push(self, x: int) -> None:
if x<self.min:
self.min = x
self.st... |
from urllib.request import urlopen
from urllib.request import urlretrieve
from urllib.parse import urlencode
import os
from os import environ
import json
import giphy_client
def download_random_gif():
gif_filename = "hug.gif"
giphy_random_url = 'https://api.giphy.com/v1/gifs/random'
giphy_api_key = enviro... |
# -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... |
import discord
from discord.ext import commands
class List(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command(name = 'listCommands', aliases = ['List', 'list'])
async def listCommands(self, ctx):
await ctx.send("List of Command:\n1. Ban: Can be used to ban a... |
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
from logging import error
import subprocess
import os
import pwd
import grp
def install():
#### CHOCO ###########
# Choco-solver is an open-source Java library for Constraint Programming.
# More info at https://github.com/chocoteam/choco-solver
######################
####################
# J... |
"""
Copyright (c) 2018-2022 Intel Corporation
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 wri... |
"""
WSGI config for youtube project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTI... |
import astropy.units as u
import gwcs.coordinate_frames as cf
import numpy as np
import pytest
from astropy.coordinates import SkyCoord
from astropy.time import Time
from ndcube.extra_coords import LookupTableCoord
@pytest.fixture
def lut_1d_distance():
lookup_table = u.Quantity(np.arange(10) * u.km)
return ... |
#!/usr/bin/env python
"""Initialize for tests."""
import os
from grr import config
from grr.config import contexts
from grr.lib import config_lib
from grr.lib import flags
from grr.lib import log
from grr.lib import registry
from grr.lib import stats
# Make sure we do not reinitialize multiple times.
INIT_RAN = Fals... |
"""product_migration_for_vs
Revision ID: 31ec16d4f1e9
Revises: a37f90e6802d
Create Date: 2021-04-30 10:01:10.794355
"""
import sqlalchemy as sa
from alembic import op
from flask import current_app
from auth_api.models import db
from auth_api.services.products import Product
from auth_api.services.rest_service import... |
'''
Network architecture for TDAN:
TDAN: Temporally Deformable Alignment Network for Video Super-Resolution
'''
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import models.archs.arch_util as arch_util
try:
from models.archs.dcn.deform_conv import ModulatedDeformConvPack as D... |
# Copyright 2022 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
# Copyright (C) 2018-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
"""
Django settings for CVAT project.
Generated by 'django-admin startproject' using Django 2.0.1.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values... |
#!/usr/bin/env python
# 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
#
# Authors:
# - Mario Lassnig, mario.lassnig@cern.ch, 2016-2017
# - Daniel Dr... |
import numpy as np
import os
from numpy import loadtxt
from sklearn.metrics import confusion_matrix, classification_report
import pandas as pd
import glob
from matplotlib import pyplot as plt
from scipy.cluster.hierarchy import dendrogram
from sklearn.cluster import AgglomerativeClustering
def buildData(preds, path):
... |
import numpy as np
from pymoo.performance_indicator.igd import IGD
from pymoo.util.misc import to_numpy
from pymoo.util.normalization import normalize
from pymoo.util.termination.sliding_window_termination import SlidingWindowTermination
class DesignSpaceToleranceTermination(SlidingWindowTermination):
def __ini... |
import logging
import re
import time
import warnings
from collections import namedtuple
from typing import Any
import numpy as np
from packaging import version
from qcodes import VisaInstrument
from qcodes import validators as vals
from qcodes.instrument.channel import ChannelList, InstrumentChannel
from qcodes.instr... |
import falcon
try:
import ujson as json
except Exception, e:
import json
class LeroleroResource:
def on_get(self, req, resp):
"""Retorna um dicionário qualquer"""
minha_frase = {
'frase': "Acima de tudo, é fundamental ressaltar que a necessidade de renovação processual obstacul... |
import logging
import os
import math
from tqdm import tqdm
import numpy as np
import torch
from torch.utils.data import Dataset
logger = logging.getLogger(__name__)
def isfloat(value):
try:
float(value)
return True
except ValueError:
return False
def seq_collate(data):
(obs_se... |
"""
Contains any tests around the base stateful game object.
"""
from unittest import TestCase
from engine.game_object import GameObject
class GameObjectTestCase(TestCase):
"""
A simple test case for testing anything related to
game objects that have important state.
"""
def setUp(self):
... |
from panda3d.core import NodePath, Shader, LVecBase2i, Texture, GeomEnums
from Code.Globals import Globals
from Code.RenderPass import RenderPass
from Code.RenderTarget import RenderTarget
class OcclusionBlurPass(RenderPass):
""" This pass performs a edge preserving blur by comparing the scene normals
duri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.