text stringlengths 2 999k |
|---|
from nltk.tokenize import sent_tokenize
text = "What is the time? I think it is 4 o'clock."
sentences = sent_tokenize(text)
print(sentences) |
n, m, *ab = map(int, open(0).read().split())
from_1, to_n = set(), set()
for a, b in zip(*[iter(ab)] * 2):
if a == 1:
from_1.add(b)
if b == n:
to_n.add(a)
print("POSSIBLE" if from_1 & to_n else "IMPOSSIBLE")
|
import matplotlib.pyplot as plt
import numpy
x = [5, 7, 8, 7, 2, 17, 2, 9, 4, 11, 12, 9, 6]
y = [99, 86, 87, 88, 111, 86, 103, 87, 94, 78, 77, 85, 86]
plt.scatter(x, y)
plt.show()
# Random Data Distributions
p = numpy.random.normal(9.2, 8.2, 832176)
q = numpy.random.normal(8.7, 1.2, 982537)
plt.scatter(x, y)
plt... |
from django.urls import path
from .views import HomePageView, AboutPageView
urlpatterns = [
path('about/', AboutPageView.as_view(), name = 'about'),
path('', HomePageView.as_view(), name='home'),
] |
import pytest
import ibis
from ibis.backends.base.sql.ddl import (
CTAS,
CreateTableWithSchema,
DropTable,
InsertSelect,
)
from ibis.backends.impala import ddl
from ibis.backends.impala.compiler import ImpalaCompiler
def test_drop_table_compile():
statement = DropTable('foo', database='bar', must... |
from encoder import sampling_rate, mel_window_length, mel_window_step, mel_n_channels
from scipy.ndimage.morphology import binary_dilation
#from encoder.params_data import *
from pathlib import Path
from typing import Optional, Union
from warnings import warn
import numpy as np
import librosa
import struct
try:
im... |
"""
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... |
# Copyright 2013-2019 The Meson development 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/licenses/LICENSE-2.0
# Unless required by applicable law or agree... |
import json
import unittest
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.contrib.auth import get_user_model
from django.core import exceptions
from django.core.urlresolvers import reverse
from django_dynamic_fixtur... |
def main():
a, b, c = list(map(int, input().split()))
print(solve(a, b, c))
def solve(a, b, c):
if a + b == c:
return "{0}+{1}={2}".format(a, b, c)
elif a - b == c:
return "{0}-{1}={2}".format(a, b, c)
elif a / b == c:
return "{0}/{1}={2}".format(a, b, c)
elif a * b == c:
return "{0}*{1}={2... |
# -*- coding: utf-8 -*-
# Copyright 2018 Ross Jacobs 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 require... |
# -*- coding: utf-8 -*-
#
# ml-challange-2020 documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration val... |
from abc import ABCMeta, abstractmethod
from copy import deepcopy
from itertools import product
from numbers import Real
from typing import Any, Dict, Iterator, List
class Variation(metaclass=ABCMeta):
@abstractmethod
def expand(self) -> List[Any]:
""" Expands the variation to a list of values. "... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Certif... |
# import pathlib
# import runpy
# import pytest
# scripts = pathlib.Path(__file__, '..').resolve().glob('*/*.py')
# @pytest.mark.parametrize('script', scripts, ids=lambda script: script.parts[-2]+"/"+script.parts[-1])
# def test_script_execution(script):
# runpy.run_path(script.as_posix()) |
class Employee(object):
def __init__(self, code, name, **kwargs):
self.code = code
self.name = name
print(kwargs)
if __name__ == '__main__':
# employee = Employee()
# employee.cold = 'E01'
# employee.name = 'Jacky'
# print(employee.cold,employee.name)
data = {'email': '... |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2017 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals, absolute_import
import subprocess
from dockerfile_parse import DockerfileP... |
import os
import config
# Compile the subject
def compile(fileName, userID, language):
if os.path.exists("compiled/" + fileName):
os.system("chmod 777 compiled/" + fileName)
os.system("rm compiled/" + fileName)
if language not in config.lang:
return "NOLANG"
print("Compiling subje... |
import arm_memory_hints_advanced_simd_instructions_and_miscellaneous_instructions
from srs_arm_a1 import SrsArmA1
from rfe_a1 import RfeA1
from bl_immediate_a2 import BlImmediateA2
from stc_a2 import StcA2
from ldc_immediate_a2 import LdcImmediateA2
from ldc_literal_a2 import LdcLiteralA2
from mcrr_a2 import McrrA2
fro... |
import torch.nn as nn
class VfExtractor(nn.Module):
def __init__(self, in_channels=1):
super(VfExtractor, self).__init__()
self.conv1 = nn.Conv2d(in_channels, 120, kernel_size=(3, 3), padding=(1, 1))
self.relu1 = nn.ReLU(inplace=True)
self.conv2 = nn.Conv2d(120, 120, kernel_size=(... |
"""Provides class MetricManager, which stores and manages all metrics for
the model."""
from typing import List
import torch
from src.constructor.config_structure import MetricParams
from src.registry import METRICS
class MetricManager:
phases = ['train', 'valid', 'test']
"""Manages all metrics for the mode... |
# -*- coding: utf-8 -*-
from flask import current_app
from .util import render_email_template, send_or_handle_error, escape_markdown
import rollbar
import pendulum
def send_brief_response_received_email(supplier, brief, brief_response, supplier_user=None, is_update=False):
to_address = brief_response.data['res... |
from ._shape import FontShape
from .width import FontWidth
from .height import FontHeight
__all__ = [
"FontShape",
"FontWidth",
"FontHeight",
]
|
from django.core.exceptions import ValidationError
from django.db import transaction
from django.utils import timezone
def time_check(order_date):
date_now = timezone.now()
delta = timezone.timedelta(minutes=5)
if (date_now - order_date) <= delta:
return True
else:
return False
def... |
import contextlib
import warnings
import numpy as np
import pandas as pd
import pytest
from xarray import (
Dataset,
SerializationWarning,
Variable,
coding,
conventions,
open_dataset,
)
from xarray.backends.common import WritableCFDataStore
from xarray.backends.memory import InMemoryDataStore
... |
from featuretools import list_primitives
from featuretools.primitives import (
Day,
GreaterThan,
Last,
NumCharacters,
get_aggregation_primitives,
get_transform_primitives
)
from featuretools.primitives.utils import _get_descriptions
def test_list_primitives_order():
df = list_primitives()
... |
import pprint
import time
import lxml
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from bs4 import BeautifulSoup
from re import sub
from decimal import Decimal
import requests
import threading
"""
The Spider class crawls flipkart.com and snapdeal.com to gather phone listings (model an... |
from abc import abstractmethod
__author__ = "Noé Cruz | contactozurckz@gmail.com"
__copyright__ = "Copyright 2021, Small APi Project"
__credits__ = ["Noé Cruz", "Zurck'z"]
__license__ = "upax"
__version__ = "0.0.1"
__maintainer__ = "Noé Cruz"
__email__ = "contactozurckz@gmail.com"
__status__ = "Dev"
class Stage():
... |
# Copyright 2019 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 writing, ... |
"""Hubs and authorities analysis of graph structure.
"""
import networkx as nx
__all__ = ["hits", "hits_numpy", "hits_scipy", "authority_matrix", "hub_matrix"]
def hits(G, max_iter=100, tol=1.0e-8, nstart=None, normalized=True):
"""Returns HITS hubs and authorities values for nodes.
The HITS algorithm compu... |
########
# PART 1
def do_round(inp):
current = inp.pop(0)
cups, rest = inp[0:3], inp[3:]
dest = current - 1
max_list = max(inp)
while True:
if dest == 0:
dest = max_list
if dest not in cups:
break
dest -= 1
dest_idx = rest.index(dest)
ret... |
'''
03 - Using a list comprehension
This time, you're going to use the lists2dict() function you defined in the last
exercise to turn a bunch of lists into a list of dictionaries with the help of a
list comprehension.
The lists2dict() function has already been preloaded, together with a couple of
lists, feature_name... |
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField
from wtforms.validators import InputRequired, Email, Length, EqualTo
## Login Form
class LoginForm(FlaskForm):
email = StringField('email', validators=[InputRequired(), Length(min=3, max=15)])
password = PasswordFiel... |
import numpy as np
import scipy.cluster.hierarchy as hr
import scipy.spatial as spa
import clustering
import matplotlib.pyplot as plt
from sklearn.cluster import AgglomerativeClustering
import filter
class textMiningEac:
def __init__(self,k,N,low,high=0):
self.k = k
# Leer datos desde ... |
# This is just for socgen-k test, you make sure Socgen-k server is working well.
# https://socgen-k-api.openbankproject.com/
# API server URL
BASE_URL = "https://socgen2-k-api.openbankproject.com"
API_VERSION = "v2.0.0"
API_VERSION_V210 = "v2.1.0"
# API server will redirect your browser to this URL, should be non-f... |
#!/usr/bin/python3
'''
SPDX-License-Identifier: Apache-2.0
Copyright 2021 Keylime Authors
'''
import sys
import json
input_data = sys.stdin.read()
input_json = json.loads(input_data)
value = input_json['hello']
print(value)
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('firestation', '0045_auto_20170206_1529'),... |
#!/usr/bin/env python
###############################################################################
#
# String Encrypt WebApi interface usage example.
#
# In this example we will encrypt sample file with default options.
#
# Version : v1.0
# Language : Python
# Author : Bartosz Wójcik
# Project ... |
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module provides classes to perform fitting of molecule with arbitrary
atom orders.
This module is supposed to perform exact comparisons without the atom order
correspondence prerequisite, while molecule_structure_comp... |
import json
import pathlib
import airflow
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.operators.python_operator import PythonOperator
from kubernetes.client import models as k8s
from airflow.contrib.operators import kubernetes_pod_operator
import datetime
from airf... |
# 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... |
# Copyright 2017 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... |
# -*- coding: utf-8 -*-
import requests
from requests_oauthlib import OAuth1
from .TwitterSearchException import TwitterSearchException
from .TwitterOrder import TwitterOrder
from .TwitterSearchOrder import TwitterSearchOrder
from .TwitterUserOrder import TwitterUserOrder
from .utils import py3k
try:
from urllib... |
""" Generic SymPy-Independent Strategies """
from toolz import curry, filter
def identity(x):
yield x
@curry
def exhaust(fn, x):
""" Apply a branching rule repeatedly until it has no effect """
seen = set([x])
for nx in fn(x):
if nx not in seen:
seen.add(nx)
for nnx in ... |
#
# Copyright 2016 The BigDL 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 ... |
#!/usr/bin/env python3.7
# -*- encoding=utf8 -*-
from frame.common.param import *
from frame.blog_parser.com_linuxidc import COMLinuxidcParser
class ParserFactory:
def get_parser (self, parser_name: str):
if parser_name in self._parserDict:
return self._parserDict[parser_name]
_parserDict... |
#!/usr/bin/env python
#
# Copyright 2014 Quantopian, 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 ... |
"""
=========================
Filtering regional maxima
=========================
Here, we use morphological reconstruction to create a background image, which
we can subtract from the original image to isolate bright features (regional
maxima).
First we try reconstruction by dilation starting at the edges of the ima... |
from pandac.PandaModules import *
from toontown.toonbase.ToonBaseGlobal import *
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from direct.distributed.ClockDelta import *
from toontown.toonbase import ToontownGlobals
from direct.distributed import DistributedObject
from direct.directnotify import... |
import os
import shutil
import numpy as np
import tensorflow as tf
from scipy.stats import gamma
from matplotlib import pyplot as plt
from neural_inverse_cdf_utils import InvertibleNeuralNetworkLayer, train, result_plot
class GammaCDF(object):
def __init__(self, theta_max=15, base_dir=os.getcwd()):
# d... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
class Solution:
def setZeroes(self, matrix):
m, n, x = len(matrix), len(matrix and matrix[0]), 0
for i in range(m):
for j in range(n):
if i < m - 1 and not matrix[i][j] and matrix[i + 1][j]: matrix[i + 1][j] = None
for i in range(m - 1, -1, -1):
for j ... |
# Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... |
#!/bin/python
# -*- coding: utf-8 -*-
"""Log client details"""
import logging
class LogClient(object):
"""Docstring for LogClient."""
def __init__(self, arg):
"""Initialise."""
super(LogClient, self).__init__()
self.arg = arg
self.log_client()
def log_client(self):
... |
from Qt import QtWidgets, QtCore
from .widgets import ClickableFrame, ExpandBtn
def convert_text_for_html(text):
return (
text
.replace("<", "<")
.replace(">", ">")
.replace("\n", "<br>")
.replace(" ", " ")
)
class TracebackWidget(QtWidgets.QWidget):
... |
# vim: set encoding=utf-8
#
# Copyright (c) 2015 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 requi... |
# Copyright (c) 2020 - 2021 Open Risk (https://www.openriskmanagement.com)
#
# 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
# to ... |
# -*- coding: iso-8859-1 -*-
"""
MoinMoin - Preferences Form
@copyright: 2001-2004 Juergen Hermann <jh@web.de>,
2003-2007 MoinMoin:ThomasWaldmann
@license: GNU GPL, see COPYING for details.
"""
import time
from MoinMoin import user, util, wikiutil, events
from MoinMoin.theme import load_th... |
from __future__ import absolute_import, division, print_function, unicode_literals
from gratipay.testing import BrowserHarness, D,P
from selenium.webdriver.common.keys import Keys
class Tests(BrowserHarness):
def setUp(self):
BrowserHarness.setUp(self)
self.enterprise = self.make_team(available=... |
import functools
import importlib
import logging
import multiprocessing
import os
import time
from typing import Optional
import celery
import requests
from openff.bespokefit.schema.fitting import BespokeOptimizationSchema
from openff.utilities import temporary_cd
from beflow.services import settings
from beflow.serv... |
# 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... |
# YOLOv5 image augmentation functions
import random
import cv2
import math
import numpy as np
from utils.general import segment2box, resample_segments
from utils.metrics import bbox_ioa
def augment_hsv(im, hgain=0.5, sgain=0.5, vgain=0.5):
# HSV color-space augmentation
if hgain or sgain or vgain:
... |
"""
Django settings for deanslist project.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
# Build paths inside the project like this: os.path.join(BA... |
from .document import DocumentArray
from .storage.weaviate import StorageMixins, WeaviateConfig
__all__ = ['DocumentArrayWeaviate', 'WeaviateConfig']
class DocumentArrayWeaviate(StorageMixins, DocumentArray):
"""This is a :class:`DocumentArray` that uses Weaviate as
vector search engine and storage.
"""
... |
#!/usr/bin/env python
# Copyright (c) 2016-2020 Dell Inc. or its subsidiaries.
#
# 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 r... |
"""The test for light device automation."""
from unittest.mock import patch
import pytest
from homeassistant.components import device_automation
import homeassistant.components.automation as automation
from homeassistant.components.websocket_api.const import TYPE_RESULT
from homeassistant.const import CONF_PLATFORM, ... |
#!/usr/bin/env python3
import random
import sys
import time
from datetime import timedelta
random.seed()
to_write = total_len = random.randint(1, 10*1024*1024)
sys.stdout.write("Content-Type: application/octet-stream\n")
sys.stdout.write(f"Content-Length: {total_len}\n")
sys.stdout.write("\n")
sys.stdout.flush()
whi... |
import logging
import multiprocessing
import time
from dataclasses import replace
from secrets import token_bytes
from typing import List
import pytest
from blspy import AugSchemeMPL, G2Element
from clvm.casts import int_to_bytes
from chinilla.consensus.block_header_validation import validate_finished_header_block
fr... |
#!/usr/bin/env python
'''
THIS IS THE EDITOR CLASS. It is modified by the child classes below it which change the specific type of object created. The editor handler class
on the bottom compiles all of the different child classes together in an easy-to-use format which allows the user to switch between
editor 'type... |
# Copyright (c) 2006-2007 Open Source Applications Foundation
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com>
# Copyright (c) 2009 Domen Kozar <domen@dev.si>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.... |
# -*- coding: utf-8 -*-
import argparse
from supar import BiaffineDependencyParser
from supar.cmds.cmd import parse
def main():
parser = argparse.ArgumentParser(description='Create Biaffine Dependency Parser.')
parser.add_argument('--tree', action='store_true', help='whether to ensure well-formedness')
... |
"""Contains various maps for protobuf types, including encoding/decoding
functions, wiretypes and default types
"""
from google.protobuf.internal import wire_format
from scripts.blackboxprotobuf.lib.types import varint, fixed, length_delim
encoders = {
'uint': varint.encode_uvarint,
'int': varint.encode_var... |
from chatterbot import ChatBot
bot = ChatBot(
"IDEOCleveland",
storage_adapter="chatterbot.storage.JsonFileStorageAdapter",
logic_adapters=[
"chatterbot.logic.MathematicalEvaluation",
"chatterbot.logic.TimeLogicAdapter",
"chatterbot.logic.BestMatch"
],
input_adapter="chatter... |
# encoding: utf-8
from functools import partial
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
from config import config
from base_model import resnet50
from seg_opr.seg_oprs import ConvBnRelu
from crfrnn import CrfRnn
HAS_BN = True #crfrnn only support batch... |
from django.db import models
from django.contrib.auth.models import User
VISIBILITY_CHOICES = [
('pub', 'Public'),
('pro', 'Protected'),
('pri', 'Private'),
]
class Idea(models.Model):
title = models.CharField(max_length=100)
description = models.TextField(max_length=1000, blank=False, null=False... |
import os
import csv
from holecardhandicapper.model.const import PREFLOP, FLOP, TURN, RIVER
class Utils:
@classmethod
def build_preflop_winrate_table(self):
fpath = self.get_preflop_winrate_data_path()
table = [[0 for j in range(53)] for i in range(53)]
with open(fpath, "r") as f:
reader = csv.r... |
"""
Base settings to build other settings files upon.
"""
from pathlib import Path
import environ
ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent.parent
# mywallet/
APPS_DIR = ROOT_DIR / "mywallet"
env = environ.Env()
READ_DOT_ENV_FILE = env.bool("DJANGO_READ_DOT_ENV_FILE", default=False)
if READ_DOT_EN... |
#!/usr/bin/env python3
from pycallgraph import PyCallGraph
from pycallgraph.output import GraphvizOutput
from pycallgraph import Config
from pycallgraph import GlobbingFilter
import config_parser
import key_validator
##################
# Parser section
##################
parser_graphviz = GraphvizOutput(output_file... |
# Copyright 2013-present MongoDB, 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 wri... |
"""
Create the module default metadata files by plugging the appropriate component table
descriptions into a TableGroup.
"""
from collections import OrderedDict
from clldutils.jsonlib import dump, load
from cldfspec.util import REPO_DIR
MODULES = {
'Generic': [],
'Wordlist': ['forms'],
'StructureDataset... |
import sys
import subprocess
import json
import os
import platform
archive = sys.argv[1]
# Untar archive
system = platform.system()
workdir = "__workdir_%s" % system
os.makedirs(system)
os.makedirs(workdir)
os.chdir(workdir)
subprocess.check_call("tar xvf %s" % archive, shell=True)
# Find model files and their siz... |
"""
Tests of printing functionality
"""
from __future__ import print_function
import logging
from nose.plugins.skip import SkipTest
import numpy
from six.moves import StringIO
import theano
import theano.tensor as tensor
from theano.printing import min_informative_str, debugprint
def test_pydotprint_cond_highligh... |
from .. import testing
class DoubleMinusTest(testing.FunctionalTestCase):
filename = "double_minus.xlsx"
def test_evaluation_double_unary_A_eq_B(self):
excel_value = self.evaluator.get_cell_value('Sheet1!A1')
value = self.evaluator.evaluate('Sheet1!A1')
self.assertEqual(excel_value, v... |
# pylint: disable = C0111, C0103, C0411, C0301, W0102, C0330, C0303
"""General Purpose Functions"""
import numpy as np
from random import randint
from sklearn.covariance import EllipticEnvelope
from sklearn.ensemble import IsolationForest
def is_not_extreme_outlier(x, _min, _max):
"""Returns true if x >=min and x... |
import torch
import torchvision
from ptpt.log import error
from pathlib import Path
def get_dataset(task: str):
if task in ['ffhq1024','ffhq1024-large']:
transforms = torchvision.transforms.Compose([
torchvision.transforms.ToTensor(),
torchvision.transforms.Normalize([0.5, 0.5, 0.... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
from frappe import _
import frappe,calendar
import itertools
from dateutil.relativedelta import relativedelta
from datetime import date,timedelta,datetime
from frappe.utils import getdate,get_first_day,get_last_day,add_days,add_months,flt
from one_fm.one_fm.timesheet_custom import timesheet_automation,calculate_hourly_... |
'''
MIT License
Copyright (c) 2022 Wentao Yuan
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
to use, copy, modify, merge, publish, d... |
import re
def email(email_str):
"""
Verify if input is a valid email address
"""
if re.match(r'^([A-Za-z0-9_\-\.\u4e00-\u9fa5])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,8})$', email_str):
return email_str
else:
raise ValueError('{} is not a valid email'.format(email_str)) |
"""
This module provides functions for searching paths within a molecule.
The paths generally consist of alternating atoms and bonds.
"""
import cython
import itertools
from Queue import Queue
def find_butadiene(start, end):
"""
Search for a path between start and end atom that consists of
alternating... |
# Copyright 2017 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... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from .. import _utilities
import typing
# Export this package's modules as members:
from .workspace import *
|
from .model_v1 import VAEModelV1 # noqa: F401
from .model_v2 import VAEModelV2 # noqa: F401
from .model_v3 import VAEModelV3 # noqa: F401
from .model_v4 import VAEModelV4 # noqa: F401
|
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... |
import unittest
from google.appengine.api import memcache
from google.appengine.ext import ndb
from google.appengine.ext import testbed
import json
import pytest
import StringIO
import webapp2
from webtest import TestApp
from webtest import Upload
from lxml import etree
import local_config
class TestCustomReports(un... |
# -*- coding: utf-8 -*-
"""testapp URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home... |
# Copyright (c) OpenMMLab. All rights reserved.
import tempfile
import mmcv
import pytest
import torch
from mmcv.runner import obj_from_dict
from mmedit.models import build_model
from mmedit.models.backbones.sr_backbones import BasicVSRNet
from mmedit.models.losses import MSELoss
def test_basicvsr_model():
mod... |
# Copyright (c) 2020 Sarthak Mittal
#
# 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
# to use, copy, modify, merge, publish, dist... |
################################################################################
# Copyright (c) 2021 ContinualAI. #
# Copyrights licensed under the MIT License. #
# See the accompanying LICENSE file for terms. ... |
import sys
sys.path.append('../')
import re
from pyquery import PyQuery as pq#need install
from lxml import etree#need install
from bs4 import BeautifulSoup#need install
import json
from ADC_function import *
from WebCrawler import javbus
'''
API
注册:https://www.airav.wiki/api/auth/signup
设置:https://www.airav.wiki/api/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.