text stringlengths 2 999k |
|---|
#
"""
Texar defined exceptions.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
__all__ = [
"TexarError"
]
class TexarError(Exception):
"""
Texar error.
"""
pass
|
__author__ = 'patras'
from domain_exploreEnv import *
from timer import DURATION
from state import state, rv
DURATION.TIME = {
'survey': 5,
'monitor': 5,
'screen': 5,
'sample': 5,
'process': 5,
'fly': 3,
'deposit': 1,
'transferData': 1,
'take': 2,
'put': 2,
'move': 10,
'... |
# -*- coding: utf-8 -*-
# Copyright 2020 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... |
import os
from collections import OrderedDict
from typing import Tuple, List, Callable
from fs_s3fs import S3FS
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset
from skimage.exposure import match_histograms
from datetime import datetime
from eolearn.core import EOPatch
def a... |
from collections import defaultdict
from itertools import product
MULTITASK_PENALTY = 1
AUTHOR_PENALTY = 2
RELATION_COST = .05
DEFAULT_FLEXIBILITY = .1
OVERREQ_PENALTY = 0.5
def workload_diff(target, proposed):
"""
Helper for pitches_cost
:param target: <role, load>
:param proposed: <role, load>
:... |
# coding=utf-8
"""Maximum trade profit problem dynamic programming solution Python implementation."""
def mx_profit(prices):
n = len(prices)
profit = [0] * n
mxp = prices[n - 1]
for i in range(n - 2, -1, -1):
mxp = max(mxp, prices[i])
profit[i] = max(profit[i + 1], mxp - prices[i])
... |
import os
from datetime import datetime
import pytest
from .helpers import tasks
from .helpers import assertions
from .helpers.env import E2EEnv
DIR = os.path.dirname(__file__)
TAP_MARIADB_ID = 'mariadb_to_rs'
TAP_MARIADB_BUFFERED_STREAM_ID = 'mariadb_to_rs_buffered_stream'
TAP_POSTGRES_ID = 'postgres_to_rs'
TAP_S3_... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
Download SQL file of MySQL database by phpMyAdmin
'''
import re
import os
import sys
import base64
import urllib
import urllib2
import traceback
from cookielib import CookieJar, DefaultCookiePolicy
from pprint import pprint
__author__ = 'furyu (furyutei@gmail.com... |
"""
CAR CONFIG
This file is read by your car application's manage.py script to change the car
performance.
EXMAPLE
-----------
import dk
cfg = dk.load_config(config_path='~/d2/config.py')
print(cfg.CAMERA_RESOLUTION)
"""
import os
#pi information
PI_USERNAME = "pi"
PI_PASSWD = "raspberry"
PI_HOSTNAME = "raspbe... |
from typing import Any, Callable, Dict, Optional, Type, Union
from fugue.execution.execution_engine import ExecutionEngine, SQLEngine
from fugue.execution.native_execution_engine import NativeExecutionEngine
from triad.utils.convert import to_instance
from triad import assert_or_throw
class _ExecutionEngineFactory(o... |
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
import numpy as np
import os
import sys
from pprint import pprint
from datetime import datetime
from datetime import timedelta
import pickle
import copy
from mpl_toolkits.basemap import Basemap
import matplotlib.colors
timezone = 1
endpointsPARIS = []... |
#there are many ways we can do random numbers
#1. import random
#used to produce pseudo-random numbers.
# They are called pseudo-random because they are not truly random and can be reproduced.
import random
a = random.random() #random float between 0 and 1
b = random.uniform(1,10) #random float between 1 and 10
c = ... |
# Generated by Django 3.2.9 on 2021-11-16 11:37
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_m... |
# #!/usr/bin/env python
# """Tests for `aa_pbs_exporter` package."""
# from click.testing import CliRunner
# from aa_pbs_exporter.cli import aa_pbs_exporter_cli as cli
# def test_content(response):
# """Sample pytest test function with the pytest fixture as an argument."""
# # from bs4 import BeautifulSoup... |
# -*- coding: utf-8 -*-
import json
import os
import sys
import time
from echopy import Echo
from project import RESOURCES_DIR, BLOCK_RELEASE_INTERVAL
if "BASE_URL" not in os.environ:
BASE_URL = json.load(open(os.path.join(RESOURCES_DIR, "urls.json")))["BASE_URL"]
else:
BASE_URL = os.environ["BASE_URL"]
cat... |
#!/usr/bin/python
import sys
MIN_UDP_SPORT = 2048
if __name__ == "__main__":
N_SUBTABLES = int(sys.argv[1])
N_RULES = int(sys.argv[2])
assert N_RULES >= N_SUBTABLES
rules_per_subtable = N_RULES / N_SUBTABLES
if rules_per_subtable > 100:
udp_port_range = 100
ip_dst_range = rules_p... |
# -*- coding: utf-8 -*-
"""
Romanization of Thai words based on machine-learnt engine ("thai2rom")
"""
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from pythainlp.corpus import download, get_corpus_path
device = torch.device("cuda:0" if torch.cuda.is_available()... |
# -*- coding: utf-8 -*-
import os
import re
import requests
import shutil
import time
import xml.etree.ElementTree as ET
import urllib.parse
from collections import namedtuple
from dateutil.parser import parse as parsedate
from docutils import nodes, utils
from sphinx.util.nodes import split_explicit_title
from sphin... |
"""This lobe enables the integration of huggingface pretrained wav2vec2/hubert/wavlm models.
Reference: https://arxiv.org/abs/2006.11477
Reference: https://arxiv.org/abs/1904.05862
Reference: https://arxiv.org/abs/2110.13900
Transformer from HuggingFace needs to be installed:
https://huggingface.co/transformers/instal... |
newchat_xpath= "//*[@id='side']/header/div[2]/div/span/div[2]"
search_xpath= "//*[@id='app']/div/div/div[2]/div[1]/span/div/span/div/div[1]/div/label/div/div[2]"
#user_xpath= "//span[@title='{}']"
message_xpath= "//*[@id='main']/footer/div[1]/div[2]/div/div[2]"
sendbutton_xpath= "//*[@id='main']/footer/div[1]/div[3]" |
"""
VRChat API Documentation
The version of the OpenAPI document: 1.6.8
Contact: me@ruby.js.org
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from vrchatapi.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
... |
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementations
Classes for obtaining upstream sources for the
BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2012 Intel Corporation
#
# This program is free software; you c... |
# -*- coding: utf-8 -*-
from os.path import dirname, abspath
import sys
sys.path.insert(0, dirname(dirname(abspath(__file__))))
import utils.config_loader as config
import utils.config_loader as config
import utils.tools as tools
import torch
import shutil
versions = ['sl', 'alpha']
para_org = True
for vv in versio... |
# 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-2.0
#
# Unless required by applicable law or a... |
"""
Our modification of the OpenAI Gym Continuous Mountain Car by Olivier Sigaud:
https://github.com/openai/gym/blob/master/gym/envs/classic_control/continuous_mountain_car.py
which was (ultimately) based on Sutton's implementation:
http://incompleteideas.net/sutton/MountainCar/MountainCar1.cp
"""
from pilco.errors i... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
from django.conf.urls import include, url
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
import profiles.urls
import accounts.urls
from . import views
urlpatterns = [
url(r'^$', views.HomePage.as_view(), name='home'),
url(r'^about/$', views.AboutPag... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2014-2021, Lars Asplund lars.anders.asplund@gmail.com
from pathlib import Path
from vunit.verilog impo... |
# encoding: utf-8
# module System.Drawing.Configuration calls itself Configuration
# from System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
# by generator 1.145
# no doc
# no imports
# no functions
# classes
class SystemDrawingSection(ConfigurationSection):
""" SystemDra... |
num1 = input("Enter the first number:\n ")
num2 = input("Enter the second number:\n ")
num3 = input("Enter the third number:\n ")
num4 = input("Enter the fourth number:\n ")
if (num1>num2) and (num2>num3):
print("The greatest number is:", num1)
elif (num2>num1) and (num1>num3):
... |
"""
IRN API v1
Allows users to extract, create, update and configure IRN data. # noqa: E501
The version of the OpenAPI document: 1
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from fds.sdk.IRNContacts.model_utils import ( # noqa: F401
ApiTy... |
from __future__ import unicode_literals
import copy
from funcy import merge
from schema import Optional
from contextlib import contextmanager
from dvc.external_repo import external_repo
from dvc.utils.compat import str
from .local import DependencyLOCAL
class DependencyREPO(DependencyLOCAL):
PARAM_REPO = "rep... |
# encoding=utf8
# This is temporary fix to import module from parent folder
# It will be removed when package is published on PyPI
import sys
sys.path.append('../')
import numpy as np
from niapy.task import StoppingTask
from niapy.problems import Problem
from niapy.algorithms.basic import ParticleSwarmAlgorithm
cla... |
from contextlib import contextmanager
from logging import getLogger
from django.conf import settings
from elasticsearch.helpers import bulk as es_bulk
from elasticsearch_dsl import analysis, Index
from elasticsearch_dsl.connections import connections
logger = getLogger(__name__)
# Normalises values to improve sort... |
from abc import ABC, abstractmethod
import numpy as np
import random
from typing import Callable, Dict, Optional, Tuple, Sequence
from .reward_spaces import Subtask
from ..lux.game import Game
class SubtaskSampler(ABC):
def __init__(self, subtask_constructors: Sequence[Callable[..., Subtask]]):
self.subt... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
#!/usr/bin/env python
"""Test of "New Hunt" wizard."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from absl import app
from selenium.webdriver.common import keys
from grr_response_core.lib import rdfvalue
from grr_response_core.lib.rdfvalues import p... |
# 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... |
#!/usr/bin/env python3
"""Visualise statistic by machine economic."""
from __future__ import annotations
import pandas as pd
from matplotlib import pyplot as plt
from typing import Dict
from .mechanic_report import MechReports
from .administration.logger_cfg import Logs
from .support_modules.custom_exceptions impor... |
import numpy as np
from multiagent.core import World, Agent, Landmark
from multiagent.scenario import BaseScenario
class Scenario(BaseScenario):
def make_world(self, dim_c=3):
world = World()
# set any world properties first
world.dim_c = dim_c
num_landmarks = 3
# add agents... |
# -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2022 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... |
#!/usr/bin/env python
"""Manager of worker subprocesses.
This module invokes the worker subprocesses that perform the cloud
security monitoring tasks. Each worker subprocess wraps around a cloud,
store, event, or alert plugin and executes the plugin in a separate
subprocess.
"""
import logging.config
import multip... |
import os
import shutil
import pytest
from pyuplift.utils import retrieve_from_gz
data_home = os.path.join(os.sep.join(__file__.split(os.sep)[:-1]), 'data')
def test_retrieve_from_gz():
output_path = os.path.join(data_home, 'test.test')
archive_path = output_path + '.gz'
retrieve_from_gz(archive_path, o... |
# Recorder that records agent states as dataframes and also stores a carla recording, in synchronous mode
#!/usr/bin/env python
# Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://... |
from system.core.model import Model
from flask import jsonify
class Lead(Model):
def __init__(self):
super(Lead, self).__init__()
def get_leads(self, name, early, late, page, sort, order):
query = 'SELECT * FROM leads'
data = {}
prev = False
if name != '':
query += ' WHERE CONCAT(first_name, " ", last... |
from django.conf import settings
from django.contrib.auth import get_user, views as auth_views
from django.contrib.auth.decorators import login_required
from django.core.files import File
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render, get_object_or_404
from django.urls i... |
import re
def test_repr(tracer, rpc_stub):
class A:
pass
tracer.start()
match = re.match("foo", "foobar")
a = A()
tracer.stop()
from utils import return_GetFrame
frame_proto = return_GetFrame(rpc_stub, "test_repr")
binding_match_event = frame_proto.events[0]
assert (
... |
# -*- coding: utf-8 -*-
#
# ======================================================================================================================
# Copyright (©) 2015-2019 LCS
# Laboratoire Catalyse et Spectrochimie, Caen, France.
# CeCILL-B FREE SOFTWARE LICENSE AGREEMENT
# See full LICENSE agreement in the root dir... |
# coding: utf-8
"""
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: beta
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
class ProcessLineag... |
import collections
import itertools
import math
import unittest
import aoc_utils.geometry
from aoc_utils import char_map, data
class TestCoordinatesUtils(unittest.TestCase):
def test_solve_tie(self):
self.assertEqual(None, solve_tie([]))
self.assertEqual((12, 34), solve_tie([(12, 34)]))
s... |
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_uploads import UploadSet, configure_uploads, IMAGES
from flask_mail import Mail
from flask_bootstrap import Bootstrap
from config import config_options
db = SQLAlchemy()
login_manager = LoginManager()
login_... |
from osf.models.metaschema import RegistrationSchemaBlock, RegistrationSchema, FileMetadataSchema # noqa
from osf.models.base import Guid, BlackListGuid # noqa
from osf.models.user import OSFUser, Email # noqa
from osf.models.contributor import Contributor, RecentlyAddedContributor, PreprintContributor, DraftRegistr... |
# RT - Twitter
from typing import TYPE_CHECKING, Union, Dict, Tuple, List
from discord.ext import commands
import discord
from tweepy.asynchronous import AsyncStream
from tweepy import API, OAuthHandler
from tweepy.errors import NotFound
from tweepy.models import Status
from jishaku.functools import executor_functi... |
import copy
import pprint
import unittest
import requests
from wikibaseintegrator import wbi_core, wbi_fastrun, wbi_functions, wbi_datatype
from wikibaseintegrator.wbi_core import MWApiError
__author__ = 'Sebastian Burgstaller-Muehlbacher'
__license__ = 'AGPLv3'
class TestMediawikiApiCall(unittest.TestCase):
d... |
import sys
import os
import re
import collections
import itertools
import bcolz
import pickle
import numpy as np
import pandas as pd
import gc
import random
import smart_open
import h5py
import csv
import tensorflow as tf
import gensim
import datetime as dt
from tqdm import tqdm_notebook as tqdm
# import multiproce... |
import sys, re, os, selenium, time, argparse
from time import sleep
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.common.by import By
from urllib.request import urlopen, urlretrieve
class YoutubeDownloader(object):
def __... |
import pytest
from os.path import join
import mackinac
@pytest.mark.fixtures('download_data')
class TestReconstruct:
def test_reconstruct_features(self, universal_folder, bacteria_folder, b_theta_features,
b_theta_summary, b_theta_id):
template = mackinac.create_template... |
#!/usr/bin/env python
# Author: Alex Tereschenko <alext.mkrs@gmail.com>
# Copyright (c) 2016 Alex Tereschenko.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, includin... |
class ThemeSpaceListGeneric:
list = None
list_text = None
list_text_hi = None
list_title = None
|
from mirage.libs import io
class Loader:
'''
This class permits to dynamically load the modules.
'''
def __init__(self):
'''
This constructor generates the modules list.
'''
import mirage.modules as modules
self.modulesList = {}
for moduleName,module in modules.__modules__.items():
current = module#... |
#!/usr/bin/env python
import boto3
import json
import sys
client = boto3.client('ecs')
data = json.load(sys.stdin)
family_prefix = data['family_prefix']
task_def = client.list_task_definitions(familyPrefix=family_prefix,
status="ACTIVE", sort="DESC", maxResults=1)
task_arn =... |
import itertools
import os
import numpy as np
import pandas as pd
from utils.Recording import Recording
import utils.settings as settings
def load_opportunity_dataset(opportunity_dataset_path: str) -> "list[Recording]":
"""
Returns a list of Recordings from the opportunity dataset
"""
print("Will re... |
# 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
from ... import _utilities, _tables
from... |
from estudent.school import School
def run_example():
school = School.create_school_with_students("Hogwart")
print(school)
print(f"W szkole może być maksymalnie {school.MAX_STUDENTS_NUMBER} uczniów")
if __name__ == '__main__':
run_example()
|
from urllib.request import urlopen
import torch
from torch import nn
import numpy as np
from skimage.morphology import label
import os
from HD_BET.paths import folder_with_parameter_files
def get_params_fname(fold):
return os.path.join(folder_with_parameter_files, "%d.model" % fold)
def maybe_download_parameter... |
""" Azure Automation assets module to be used with Azure Automation during offline development """
#!/usr/bin/env python2
# ----------------------------------------------------------------------------------
#
# MIT License
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this softwar... |
# Generated by Django 3.1.7 on 2021-03-23 19:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('transactions', '0007_auto_20210323_1910'),
]
operations = [
migrations.AlterField(
model_name='customer',
name='cust... |
#!/usr/bin/env python3
import sys
import csv
"""
Field Name Full name Format Example
1 SEQ Sequence number Int (6) 86415
2 KM_REF Kilometre reference Char (6) ST5265
3 DEF_NAM Definitive name Char (60) Felton
4 ... |
#!/usr/bin/env python3
# python setup.py sdist --format=zip,gztar
from setuptools import setup
import os
import sys
import platform
import imp
import argparse
version = imp.load_source('version', 'lib/version.py')
def readhere(path):
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(... |
# -*- coding: utf-8 -*-
"""
Created on Sat Dec 16 22:30:11 2020
@author: Easin
"""
from __future__ import absolute_import, division, print_function
import tensorflow as tf
from tensorflow.keras import Model, layers
import numpy as np
import matplotlib.pyplot as plt
# MNIST dataset parameters.
num_class... |
# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fi... |
"""
(C) Copyright 2021 IBM Corp.
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... |
# -*- coding: utf-8 -*-
"""
Created on Sep 20, 2012
@author: moloch
Copyright 2012 Root the Box
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/licen... |
from datetime import timedelta
from django.contrib.auth import get_user_model
from django.utils import timezone
from churches.models import Church
from schedules.forms import EventForm, AttendantAdminForm, AttendantForm
from schedules.models import Event, Attendant
from schedules.tests._setup import EventSetupTestCas... |
""" Module containing a class for encapsulating the settings of the tree search
"""
import os
import yaml
from aizynthfinder.utils.logging import logger
from aizynthfinder.utils.paths import data_path
from aizynthfinder.mcts.policy import Policy
from aizynthfinder.mcts.stock import Stock, MongoDbInchiKeyQuery
class... |
__all__ = ('GUI_STATE_CANCELLED', 'GUI_STATE_CANCELLING', 'GUI_STATE_READY', 'GUI_STATE_SWITCHING_CTX',
'GUI_STATE_SWITCHING_PAGE', 'PaginationBase')
from ...backend.futures import Task, CancelledError
from ...discord.core import KOKORO
from ...discord.exceptions import DiscordException, ERROR_CODES
GUI_STATE_REA... |
import pytest
from problems.problem_0242 import Solution
@pytest.mark.parametrize('test_input, expected', (
(('anagram', 'nagaram'), True),
(('rat', 'car'), False),
))
def test_is_anagram(test_input, expected):
assert Solution.isAnagram(*test_input) == expected
|
"""
Copyright 2020 The OneFlow 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 applicable law or agr... |
# -*- coding: utf-8 -*-
# Copyright 2020 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... |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
"""WOInfo Plugin for WordOps"""
from cement.core.controller import CementBaseController, expose
from cement.core import handler, hook
from wo.core.variables import WOVariables
from pynginxconfig import NginxConfig
from wo.core.aptget import WOAptGet
from wo.core.shellexec import WOShellExec
from wo.core.logging import... |
# ledtheatre is Licensed under the MIT License
# Copyright 2017 Andrew Alcock
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# ... |
from .single_level import *
from .multi_roi_extractor import *
|
from decouple import config
ADDRESS = config("ADDRESS")
PORT = config("PORT")
TS_USER = config("TS_USER")
PASSWORD = config("PASSWORD")
TOKEN = config("TOKEN")
PERSISTENCE_FILE = config("PERSISTENCE_FILE")
|
from datetime import datetime
from datetime import date
class MainParent(object):
pass
class SubParent1(MainParent):
def foo(self):
pass
pass
class SubParent2(MainParent):
pass
class Child(SubParent1, SubParent2):
def spam(self):
pass
pass
class NoParentsAllowed(datetime, ob... |
"""Test code for relu activation"""
import os
import numpy as np
import tvm
import topi
from topi.util import get_const_tuple
def verify_relu(m, n):
A = tvm.placeholder((m, n), name='A')
B = topi.nn.relu(A)
a_np = np.random.uniform(size=get_const_tuple(A.shape)).astype(A.dtype)
b_np = a_np * (a_np > 0... |
import threading
import sys
is_py2 = sys.version[0] == '2'
if is_py2:
import Queue as queue
else:
import queue as queue
def isScalar(x):
return not isinstance(x, (list, tuple))
def isList(x):
return isinstance(x, (list))
def asString(x):
return str(x)
def makeDict():
return {'a': 1.0, 'c': 3.0, 'b': ... |
import inspect
import itertools
import logging
import time
from typing import (
Any,
Callable,
List,
Iterator,
Iterable,
Generic,
Union,
Optional,
TYPE_CHECKING,
)
import ray
from ray.data.context import DatasetContext
from ray.data.dataset import Dataset, T, U
from ray.data.impl.pi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.MaitainShopProduct import MaitainShopProduct
class AlipayEcoMycarMaintainServiceproductUpdateModel(object):
def __init__(self):
self._operation_type = N... |
from __future__ import annotations
from pathlib import _PosixFlavour, _WindowsFlavour
from typing import Optional, Callable, Awaitable, Dict, List, TYPE_CHECKING
from errno import EINVAL
import os
import sys
from aiopath.wrap import func_to_async_func as wrap_async
try:
from pathlib import _getfinalpathname
_a... |
import argparse
import json
import os
import pickle
import numpy as np
from pocovidnet.evaluate_genesis import GenesisEvaluator
from pocovidnet.evaluate_video import VideoEvaluator
from tensorflow.keras import backend as K
from pocovidnet.videoto3d import Videoto3D
def main():
parser = argparse.ArgumentParser(des... |
from rest_framework import serializers
from .models import Skill, Task, Days
class SkillSerializer(serializers.ModelSerializer):
class Meta:
model = Skill
fields = ('name', 'user')
class TaskSerializer(serializers.ModelSerializer):
class Meta:
model = Task
fields = ('name', ... |
#!/usr/bin/env python3
# Copyright (c) 2016-2017 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 using named arguments for RPCs."""
from test_framework.test_framework import AltcoinTestFramework... |
from typing import Tuple
import pytest
import kornia as kornia
import kornia.testing as utils # test utils
import torch
from torch.testing import assert_allclose
from torch.autograd import gradcheck
class TestBoundingBoxInferring:
def test_bounding_boxes_dim_inferring(self, device, dtype):
boxes = tor... |
class Solution:
def rob(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if(len(nums)==1): return nums[0] # 1的时候不work 两个dp,一个从第一位开始,一个从倒数第二位结束
last, now = 0, 0
last1, now1 = 0, 0
for i, n in enumerate(nums):
if i<len(nums... |
# Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from aws import Action as BaseAction
from aws import BaseARN
service_name = 'Amazon Managed Service for Prometheus'
prefix = 'aps'
class Action(BaseAction):
def __init__(self, action=None):
... |
import numpy as np
import struct
LAYER_DENSE = 1
LAYER_CONVOLUTION2D = 2
LAYER_FLATTEN = 3
LAYER_ELU = 4
LAYER_ACTIVATION = 5
LAYER_MAXPOOLING2D = 6
LAYER_LSTM = 7
LAYER_EMBEDDING = 8
ACTIVATION_LINEAR = 1
ACTIVATION_RELU = 2
ACTIVATION_SOFTPLUS = 3
ACTIVATION_SIGMOID = 4
ACTIVATION_TANH = 5
ACTIVATION_HARD_SIGMOID =... |
import sqlalchemy
from functools import partial
async def create_engine(*args, **kwargs):
engine = sqlalchemy.create_engine(*args, **kwargs)
if engine.driver == "psycopg2":
import asyncpg
p = await asyncpg.create_pool(str(engine.url))
elif engine.driver == "pyodbc":
imp... |
from cfn_datadog import Timeboard, Graph, TemplateVariable, Definition, Request
from troposphere import Parameter, Template, Join, ImportValue, Sub
t = Template()
datadog_lambda_stackname = t.add_parameter(Parameter(
"DatadogLambdaStackname",
Type="String",
Description="Stack name of cfn-datadog"
))
time... |
import logging
from PyQt5.QtWidgets import *
import envi.qt.memory as e_mem_qt
import envi.qt.memcanvas as e_mem_canvas
import vqt.hotkeys as vq_hotkey
import vivisect.base as viv_base
import vivisect.renderers as viv_rend
import vivisect.qt.views as viv_q_views
import vivisect.qt.ctxmenu as viv_q_ctxmenu
from vqt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.