text stringlengths 2 999k |
|---|
# Бинго 75 + Результаты тиража по дате + текущая дата
def test_bingo75_results_draw_date_current_date(app):
app.ResultAndPrizes.open_page_results_and_prizes()
app.ResultAndPrizes.click_game_bingo75()
app.ResultAndPrizes.click_the_results_of_the_draw_date()
app.ResultAndPrizes.click_ok_in_modal_window... |
from typing import Optional
from great_expectations.core.expectation_configuration import ExpectationConfiguration
from great_expectations.expectations.expectation import (
ColumnMapExpectation,
InvalidExpectationConfigurationError,
)
from great_expectations.expectations.util import (
add_values_with_json_... |
from setuptools import setup
install_requires = [
'requests',
'bs4',
]
packages = [
'paizascraper',
]
setup(
name='paizascraper',
version='0.2',
packages=packages,
install_requires=install_requires,
author='ryuma017',
) |
# -*- coding: utf-8 -*-
# for localized messages
from __future__ import print_function
from __future__ import absolute_import
from .__init__ import _
from Plugins.Plugin import PluginDescriptor
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.MenuList import MenuList
from Comp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sqlite3
from gchelpers.db import SqliteCustomFunctions
def dict_factory(cursor, row):
d = {}
for idx, col in enumerate(cursor.description):
d[col[0]] = row[idx]
return d
class UnhandledDbTypeError(Exception):
def __init__(self, message, err... |
"""
Author: David Sergio
KMeans Clustering
"""
import numpy as np
import pandas as pd
# import matplotlib as plt
import matplotlib.pyplot as plt
from numpy import nan
from sklearn.cluster import KMeans
weather_observation_data_file = "..\\transform\\stage6\\all_weather_obs_dates.csv"
weather_observation_data = pd.... |
from __future__ import absolute_import
import pytest
try:
import altair as alt
except:
alt = None
altair_available = pytest.mark.skipif(alt is None, reason="requires altair")
import numpy as np
from panel.models.vega import VegaPlot
from panel.pane import Pane, PaneBase, Vega
blank_schema = {'$schema': ''}... |
import pytest
from api2ch import Api2chAsync, Api2chError
@pytest.mark.asyncio
class TestApiAsync:
async def test_thread(self, api_async: Api2chAsync):
await api_async.thread('api', 1)
with pytest.raises(Api2chError):
await api_async.thread('b', 1)
async def test_threads(self, a... |
import pandas as pd
import matplotlib.pyplot as plt
import pylab
from scipy.signal import argrelextrema
import numpy as np
from scipy import signal
# Get Sensor observations
def getObs(myfile, name):
# read the CSV file, parsing dates and dropping one useless collumn
obs = pd.read_csv(myfile,
... |
"""
Leia um valor do raio de um círculo e Calcule e imprima a área do círculo correspondente.
A área do círculo é pi * raio², considere pi = 3.141592.
"""
pi = 3.141592
r = float(input('Qual o raio do círculo: '))
A = pi * r ** 2
print(f'Área = {A}')
|
import ranger.gui.colorscheme
from ranger.gui.color import *
class Dim(ranger.gui.colorscheme.ColorScheme):
def use(self, context):
fore, back, attr = white, default, normal
if context.reset:
return (fore, back, attr)
if context.error or context.badinfo:
return (black, red, bold)
# TODO sync with dir_co... |
import os
import sys
import re
sys.path.append('build')
import MatterSim
import string
import json
import time
import math
from collections import Counter, defaultdict
import numpy as np
import networkx as nx
from param import args
import torch.nn.functional as F
from param import args
from tqdm import tqdm
def dump_... |
__doc__ = 'Creates an instance of the App class, loads the main menu and \
enters main loop.'
from interface import Interface
from library import Time
class App():
'Application Class '
def __init__(self):
self.app = Interface()
def loop(self):
""" Main Loop """
self.app.load_main_menu()
... |
from tests.compat import unittest, mock
from tests.test_search_exact import TestSearchExactBase
from tests.test_substitutions_only import TestSubstitionsOnlyBase
from tests.test_levenshtein import TestFindNearMatchesLevenshteinBase
from fuzzysearch import find_near_matches, Match
from fuzzysearch.common import FuzzySe... |
#! usr/bin/python3.6
"""
Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445
.. warning::
The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only.
They are there as a guide as to how the visual basic / catscript function... |
class BriefmetricsException(Exception):
pass
class APIException(BriefmetricsException):
def __init__(self, message, code=400, response=None):
self.message = message
self.code = 400
self.response = response
def __repr__(self):
return '%s("%s", code=%d)' % (self.__class__.__... |
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) Travis DePrato.
# Distributed under the terms of the Modified BSD License.
from ipywidgets import DOMWidget
from traitlets import Unicode, Int, Tuple, Any, Bool
from ._frontend import module_name, module_version
class Canvas(DOMWidget):
"""
A simple Canv... |
# coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class PublishedTrackTestCase(Int... |
from ruba_project_1.src.build_dataset import *
from sklearn.externals import joblib
import pickle
import numpy as np
def main(url):
#url = "http://www.facebook.com/"
X_test = feature_extract(url)
print(X_test)
X_test = (np.array(X_test)).reshape(1, -1)
# Load the model from the file
rf_from_... |
import os
from peewee import *
from NavigationDB.MapRoadDot.MapRoadDotDB import MapRoadDot
roadDotsArray = [
MapRoadDot(id=287, idMap=0, idOnMap=0, idPremise=243, x=411, y=1050, audienceX=411, audienceY=1085), #013a
MapRoadDot(id=288, idMap=0, idOnMap=1, idPremise=240, x=535, y=1050, audienceX=535, audienceY=1... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import warnings
from distutils.version import LooseVersion
from pyglet.window import key, mouse
import pyglet
import imgui
from . import compute_fb_scale
from .opengl import FixedPipelineRenderer, ProgrammablePipelineRenderer
class PygletMixin(object):... |
# Copyright (c) Stanford University, The Regents of the University of
# California, and others.
#
# All Rights Reserved.
#
# See Copyright-SimVascular.txt for additional details.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentatio... |
'''
Clase que modela una entidad de recomendación, contiene la informacion de automoviles y perfil
'''
class Recommendation:
def __init__(self, id, arrAutomobiles, profile):
self.__id=id
self.__arrAutomobiles=arrAutomobiles
self.__profile=profile
def get_recommendation(self):
da... |
import os
import site
import sys
sys.path.append('/opt/LambdaCast')
site.addsitedir('/opt/LambdaCast/.venv/lib/python2.7/site-packages')
os.environ['DJANGO_SETTINGS_MODULE'] = 'lambdaproject.settings'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
|
import time
import pandas as pd
import numpy as np
import gc
from os.path import join as opj
import matplotlib.pyplot as plt
import pickle
from tqdm import tqdm
import torchvision
import torch
from torch import nn, optim
from torch.utils.data import DataLoader
from dataset import HuBMAPDatasetTrain
from models import b... |
class Fragment:
def __init__(self):
pass
def populate(self, data):
return None
def name(self):
return "noname" |
# -*- coding: utf-8 -*-
import torch.nn as nn
from torch.nn import functional as F
import pytorch_ssim
class MSE_Loss(nn.Module):
def __init__(self):
super(MSE_Loss, self).__init__()
def forward(self, input, target):
return F.mse_loss(input, target, reduction='mean')
class SSIM_... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 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... |
"""
send_images_cifar.py: sends labeled CIFAR10 images encoded as a string to an inferencing program
Usage: python3 send_images_cifar.py [-h] [-s] [-i IMAGESPERSEC] [-t TOTALIMAGES] | nc <dest IP address> <dest port>
optional arguments:
-h, --help show this help message and exit
-i IMAGESPERSEC, --imag... |
import albumentations as A
from albumentations.pytorch import ToTensorV2
train_common_transform = A.Compose(
[
A.Resize(256, 256),
A.RandomCrop(224, 224),
A.HorizontalFlip(),
A.Rotate(limit=5, p=0.9),
],
additional_targets={"infrared_img": "image"},
)
test_common_transform ... |
# 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 u... |
#-*- encoding:utf-8 -*-
import re
import time
import datetime
import psycopg2
from scrapy.spiders import CrawlSpider
from scrapy.selector import Selector
from scrapy.loader import ItemLoader
from scrapy.http import Request
from LjSpider.items import *
from LjSpider.Db.Mysql import *
class ResidenceIr... |
# Copyright 2021 LINE Corporation
#
# LINE Corporation licenses this file to you 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 a... |
# -*- coding: utf-8 -*-
#
# Copyright 2018 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
import logging
from datetime import datetime
from sqlalchemy import Column, DateTime, String
from sqlalchemy import Table, MetaData, JSON
from sqlalchemy import create_engine, func, select
from sqlalchemy.exc import IntegrityError
from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy.dialects.postgresql impo... |
import os
import re
import pip
import shutil
import zipfile
import argparse
import itertools
import virtualenv
# Here is the things for arguments I guess.
parser = argparse.ArgumentParser(description="AWS Lambda Packager")
parser.add_argument("file", nargs = 1, help='Filename to package')
arguments = parser.parse_a... |
"""SpeevePonics URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-... |
# -*- coding: utf-8 -*-
import numpy as np
from sklearn.utils.validation import check_is_fitted
from .base import BaseExogFeaturizer
from ..base import UpdatableMixin
from ._fourier import C_fourier_terms
__all__ = ['FourierFeaturizer']
sinpi = (lambda x: np.sin(np.pi * x))
cospi = (lambda x: np.cos(np.pi * x))
... |
import os
import pytest
from siu_data.portal_data import SIUPoratlTransparenciaData
from siu_data.query_file import SIUTranspQueryFile
@pytest.mark.vcr()
class TestBasic:
@classmethod
def setup_class(cls):
cls.siudata = SIUPoratlTransparenciaData(
base_url='http://wichi... |
# Generated by Django 2.2.6 on 2019-11-09 19:27
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('item', '0002_item_user'),
]
operations = [
migrations.RemoveField(
model_name='item',
name='item_user',
),
]
|
import apscheduler
from apscheduler.schedulers.blocking import BlockingScheduler
#If you want to cleanup all test resources like vms, volumes, workloads then set
# following cleanup parameter value to True otherwise False
cleanup = True
# pre requisite paramter
pre_req = True
#Test results for reporting
PASS = "PAS... |
#! /usr/bin/env python3
# Micheal McDonagh
# Calculate the square root of a number.
def sqrt(x):
"""
Calculate the square root of argument x.
"""
# Check that x is positive.
if x < 0:
print("Error: negative value supplied")
return -1
else:
print("Here we go..")
#... |
import torch
import numpy as np
import math
from ipdb import set_trace
# Checks if a matrix is a valid rotation matrix.
def isRotationMatrix(R) :
Rt = np.transpose(R)
shouldBeIdentity = np.dot(Rt, R)
I = np.identity(3, dtype = R.dtype)
n = np.linalg.norm(I - shouldBeIdentity)
return n < 1e-6
... |
# Traditional Decorator pattern: noticeably verbose
class WriteLoggingFile1(object):
def __init__(self, file, logger):
self._file = file
self._logger = logger
# We need to implement every file method,
# and in the truly general case would need
# a getter, setter, and deleter for every
... |
#Step 1: Data Preprocessing
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
dataset = pd.read_csv('../datasets/studentscores.csv')
X = dataset.iloc[:, : 1].values
Y = dataset.iloc[:, 1 ].values
from sklearn.model_selection import train_test_split
X_train, X_test, Y_train, Y_test = train_test_sp... |
from pyshark import LiveCapture
class LiveRingCapture(LiveCapture):
"""
Represents a live ringbuffer capture on a network interface.
"""
def __init__(self, ring_file_size=1024, num_ring_files=1, ring_file_name='/tmp/pyshark.pcap', interface=None,
bpf_filter=None, display_filter=None,... |
import logging
from typing import Generator
import scrapy
from burplist.items import ProductLoader
from burplist.locators.beerforce import BeerForceLocator
logger = logging.getLogger(__name__)
class BeerForceSpider(scrapy.Spider):
"""Parse data from raw HTML
Starting URL is from a base URL which contains d... |
#!/usr/bin/env python
import os.path as op
import fsl.data.image as fslimage
import fsleyes.plugins.tools.cropimage as cropimage
from fsleyes.tests import run_with_orthopanel, realYield
datadir = op.join(op.dirname(__file__), '..', 'testdata')
def test_cropimage():
run_with_orthopanel(_test_cropimage)
def _t... |
from requests import Request, Session
from twilio.http import HttpClient
from twilio.http.response import Response
from twilio.http.request import Request as TwilioRequest
class TwilioHttpClient(HttpClient):
"""
General purpose HTTP Client for interacting with the Twilio API
"""
def __init__(self, po... |
# Copyright 2019 Google 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 writing, ... |
import pytest
import threading
import time
from unittest.mock import Mock, call
from quickrpc.action_queue import ActionQueue
from quickrpc.promise import Promise
@pytest.fixture
def aq():
return ActionQueue()
def action():
time.sleep(0.1)
def test_aq_basic(aq):
assert not aq._running.is_set()
aq.pu... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
MPAPostHocAccountingDialog
A QGIS plugin
This plugin checks how your MPAs meet your placement objectives
-------------------
begin ... |
pkgname = "upower"
pkgver = "0.99.17"
pkgrel = 0
build_style = "meson"
configure_args = [
"-Ddefault_library=shared", "-Dos_backend=linux",
"-Dsystemdsystemunitdir=no", "-Dintrospection=enabled", "-Dgtk-doc=false"
]
hostmakedepends = [
"meson", "pkgconf", "gettext-tiny-devel", "glib-devel",
"gobject-int... |
# Generated by Django 3.2.4 on 2021-06-19 16:01
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Teams',
fields=[
('id', models.BigAutoField... |
from dnnv.properties import *
import numpy as np
N1 = Network("N1")
N2 = Network("N2")
class_1 = 9
class_2 = 3
Forall(
x,
Implies(
(0 <= x <= 1),
(np.argmax(N1(x)) != class_1) | (np.argmax(N2(x)) != class_2),
),
)
|
import discord
import re
import markovify
class GuildModel(object):
"""Container struct for associated guilds (servers) with their data"""
model = None
config = None
guild = None
brainfilename = None
counter = 0
timers = {}
def __init__(self, config: dict, guild: str):
self.con... |
"""
ASGI config for byTickets_backend project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJ... |
from __future__ import print_function, unicode_literals
import argparse
import collections
import logging
import os
import sys
import glib
import gobject
from mopidy import config as config_lib, exceptions
from mopidy.audio import Audio
from mopidy.core import Core
from mopidy.utils import deps, process, versioning... |
#!/usr/bin/env python
import rospy
from std_msgs.msg import String
from umnitsa_msgs import console_controller
def callback(data):
rospy.loginfo(rospy.get_caller_id() + 'I heard %s', data.data)
def updateCommand(data):
rospy.loginfo(data)
def listener():
# In ROS, nodes are uniquely named. If two nodes... |
# Made by disKret
import sys
from ru.catssoftware.gameserver.model.quest import State
from ru.catssoftware.gameserver.model.quest import QuestState
from ru.catssoftware.gameserver.model.quest.jython import QuestJython as JQuest
qn = "19_GoToThePastureland"
#NPC
VLADIMIR = 31302
TUNATUN = 31537
#ITEMS
BEAST_MEAT = 75... |
from pathlib import Path
OUTPUT_PATH = Path("ddl")
EXTRACT_PATH_PREFIX = Path("extract")
TRANSFORM_PATH_PREFIX = Path("transform")
DATA_PATH_PREFIX = Path("/data")
|
import enum
import aiohttp_security
from functools import wraps
from aiohttp import web
from aiohttp_security.abc import AbstractAuthorizationPolicy
class Permission(enum.Enum):
"""
App permissions
"""
ONLY_AUTH = 0 # only auth user
ADMIN_UI = 1 # can user admin ui
class FileAuthorizationP... |
# Copyright 2013 by Christian Brueffer. All rights reserved.
#
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Tests for MSAProbs tool."""
import os
import sys
import unittest
from Bio import Al... |
from fairness.metrics.Metric import Metric
class Diff(Metric):
def __init__(self, metric1, metric2):
Metric.__init__(self)
self.metric1 = metric1
self.metric2 = metric2
self.name = "diff:" + self.metric1.get_name() + 'to' + self.metric2.get_name()
def calc(self, actua... |
import os
import numpy as np
import pytest
import pandas as pd
from pandas import (
Categorical,
DatetimeIndex,
Interval,
IntervalIndex,
NaT,
Series,
TimedeltaIndex,
Timestamp,
cut,
date_range,
isna,
qcut,
timedelta_range,
)
import pandas._testing as tm
from pandas.... |
"""Tests for handling jdbc information for the Tamr auxiliary service DF-connect"""
from tamr_toolbox.data_io.df_connect import jdbc_info
from tamr_toolbox.utils import config
from tests._common import get_toolbox_root_dir
CONFIG = config.from_yaml(get_toolbox_root_dir() / "tests/mocking/resources/connect.config.yaml... |
import scanpy as sc
from anndata import read_h5ad
import pandas as pd
import numpy as np
import scipy as sp
import os
import fnmatch
import time
import argparse
from statsmodels.stats.multitest import multipletests
# Inhouse tools
import scdrs.util as util
import scdrs.data_loader as dl
import scdrs.method as md
"""... |
import os
from typing import TYPE_CHECKING
from modules.base import ModuleProcessor
from opta.core.terraform import get_terraform_outputs
from opta.exceptions import UserErrors
if TYPE_CHECKING:
from opta.layer import Layer
from opta.module import Module
class MongodbAtlasProcessor(ModuleProcessor):
def... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-29 16:51
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('school', '0010_auto_20170329_1755'),
]
operations = [
migrations.AddField(
... |
from __future__ import annotations
import abc
import inspect
from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional, Tuple, Type, cast
import numpy as np
from pandas._config import option_context
from pandas._libs import lib
from pandas._typing import (
AggFuncType,
AggFuncTypeBase,
AggFu... |
# Generated by Django 2.2.8 on 2019-12-15 11:47
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
n... |
import datetime
from nwpc_hpc_model.workload.filter_condition import \
FilterCondition, \
get_property_data, \
PropertyFilterCondition, \
create_equal_value_checker, \
create_greater_value_checker, \
create_less_value_checker, \
create_in_value_checker, \
create_value_in_checker
from nw... |
# -*- coding: utf-8 -*-
"""
Low-level functions if you want to build your own higher level abstractions.
.. warning::
This is a "Hazardous Materials" module. You should **ONLY** use it if
you're 100% absolutely sure that you know what you’re doing because this
module is full of land mines, dragons, and di... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys, random, string, requests
LOGGING = True
BASE_URL = "http://localhost:8080"
API_VERSION = "v1.4.0"
DL_TOKEN = { 'Authorization' : 'DirectLogin token=' }
CONTENT_JSON = { 'content-type' : 'application/json' }
def setCounterParty(bank_id, account_id,cou... |
import warnings
import openmc.checkvalue as cv
class Nuclide(str):
"""A nuclide that can be used in a material.
Parameters
----------
name : str
Name of the nuclide, e.g. 'U235'
Attributes
----------
name : str
Name of the nuclide, e.g. 'U235'
"""
def __new__(c... |
# Copyright (C) 2016-2017, Phil Song <songbohr@gmail.com>
import os
import logging
import argparse
import sys
import glob
import inspect
from logging.handlers import RotatingFileHandler
import datetime
import time
import config
import traceback
import markets
from snapshot import Snapshot
from datafeed import Datafe... |
import unittest
from tmc import points
@points('1.1')
class TestFailing(unittest.TestCase):
@points('1.2', '2.2')
def test_new(self):
self.assertEqual("a", "b")
if __name__ == '__main__':
unittest.main()
|
# Copyright 2018 Google, 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 writin... |
import sys
sys.path.insert(1, "../../../")
import h2o
import numpy as np
from sklearn.cluster import KMeans
def prostateKmeans(ip,port):
# Connect to a pre-existing cluster
h2o.init(ip,port) # connect to localhost:54321
#Log.info("Importing prostate.csv data...\n")
prostate_h2o = h2o.import_frame(path=h2o.l... |
from pathlib import Path
from configupdater import ConfigUpdater
from pyscaffold import cli
def test_entry_point(tmpfolder):
args = ["--no-config", "--ds-template", "pyscaffoldext-some_extension"]
# --no-config: avoid extra config from dev's machine interference
cli.main(args)
assert Path("pyscaffold... |
# Copyright 2019 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... |
# Beam example
# Distributed under BSD-3-Clause License. See LICENSE-File for more information
#
"""
Example showing a cantilever beam which is loaded on the tip with a force
showing nonlinear displacements.
The beam is reduced with ECSW and NSKTS
"""
import os
import time
import numpy as np
from h5py import File
f... |
from enum import Enum
from typing import Optional, Dict, Any
from pydantic import BaseModel
class Granularity(str, Enum):
"""
Time Series Granuality
"""
seconds = "seconds"
minutes = "minutes"
hours = "hours"
class TimeSeriesConfig(BaseModel):
"""
Time Series Collection config
... |
import math
import hashlib
import gym
from enum import IntEnum
import numpy as np
from gym import error, spaces, utils
from gym.utils import seeding
from .rendering import *
# Size in pixels of a tile in the full-scale human view
TILE_PIXELS = 32
# Map of color names to RGB values
COLORS = {
'red' : np.array([2... |
from flask import Flask
from flask import request
from flask import jsonify
from flask import make_response
from flask import abort
from . controller import create_user
app = Flask(__name__)
def _assert(condition, status_code, message):
if condition: return
data = {
"message": message,
"stat... |
import sort_utils
def mergeTwoSorted(array1, array2):
len1 = len(array1)
len2 = len(array2)
result = [None for _ in range(len1 + len2)]
i1 = 0
i2 = 0
ir = 0
while i1 < len1 and i2 < len2:
if array1[i1] <= array2[i2]:
result[ir] = array1[i1]
i1 += 1
... |
#!/usr/bin/env python3
import numpy as np
import cv2
import tensorflow as tf
import sys
sys.path.append("/home/oyster/Tensorflow/Monk_Object_Detection/13_tf_obj_2/lib/")
from infer_detector_nano import Infer
from bag_detection.msg import FlipPos, PathPos
def get_rectangles(mask, threshold_area):
"""
Extrac... |
import torchvision.transforms as T
try:
from torchvision.transforms import GaussianBlur
except ImportError:
from .gaussian_blur import GaussianBlur
T.GaussianBlur = GaussianBlur
imagenet_mean_std = [[0.485, 0.456, 0.406],[0.229, 0.224, 0.225]]
class SimSiamTransform():
def __init__(self, image_siz... |
from django.template import Library
from django.template.defaultfilters import floatformat
from django.contrib.humanize.templatetags.humanize import intcomma
from django.utils.encoding import force_unicode
register = Library()
@register.filter(name='addcss')
def addcss(value, arg):
return value.as_widget(attrs={... |
from unittest import mock, TestCase
from sqlalchemy.exc import SQLAlchemyError
import os
from app.models.updaters.access_updater import AccessUpdater
from app.models.db.permission import Permission
from app.models.db.service import Service
from app.models.db.policy import Policy
from unittest.mock import patch, MagicMo... |
import torch
from torch.quantization import (
FakeQuantize,
MovingAverageMinMaxObserver,
default_observer,
default_affine_fixed_qparams_fake_quant,
)
from torch.quantization._learnable_fake_quantize import _LearnableFakeQuantize
from torch.testing._internal.common_quantized import (
_fake_quantize_... |
#!/usr/bin/env python
#Corey Brune - Sep 2016
#This script performs a rewind of a vdb
#requirements
#pip install --upgrade setuptools pip docopt delphixpy
#The below doc follows the POSIX compliant standards and allows us to use
#this doc to also define our arguments for the script.
"""Rewinds a vdb
Usage:
dx_rewi... |
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2020, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
from __future__ i... |
from entente.restore_correspondence import find_correspondence, restore_correspondence
import numpy as np
import pytest
from .restore_correspondence import _maybe_tqdm
def create_truncated_test_mesh():
from .testing import vitra_mesh
# For performance.
return vitra_mesh().picking_vertices(np.arange(1000)... |
#
# 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... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
from chainercv.utils.iterator.apply_prediction_to_iterator import apply_prediction_to_iterator # NOQA
from chainercv.utils.iterator.progress_hook import ProgressHook # NOQA
from chainercv.utils.iterator.unzip import unzip # NOQA
|
import numpy as np
from scipy.misc import comb as nchoosek
from . import base
class Manager(base.Null):
def __init__(self, nmoments=4, use_diff_features=True, oriented=False,
normalize=False, *args, **kwargs):
super(Manager, self).__init__()
self.nmoments = nmoments
self.use_di... |
#!/usr/bin/python3
# 两个数组的交集
def intersect(nums1: list, nums2: list) -> list:
# 双指针法
nums1.sort()
nums2.sort()
i = 0
j = 0
result = []
while i < len(nums1) and j < len(nums2):
if nums1[i] == nums2[j]:
result.append(nums1[i])
i += 1
j += 1
... |
####################################################################################################
# File: setup.py
# Purpose: Setup of the package.
#
# Author: Luke Poeppel
#
# Location: Frankfurt, DE 2020 / NYC, 2020 / Kent, CT 2020
############################################################################... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.