text stringlengths 2 999k |
|---|
milhas = float(input('digite sua velocidade em milhas por hora: '))
km = 1.61 * milhas
print(f'A velocidade de {milhas} milhas por horas é equivalente a {km} quilometros por hora')
|
print('------注册界面----------')
bank = {}
def register():
username =input('输入用户名:')
password = input('输入密码:')
password1 =input('确认密码:')
if username not in bank:
if password == password1:
bank[username]=[password,0]
else:
print('用户已存在!请直接登录!')
|
# coding=utf-8
# Copyright 2020 The Google Research 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 applicab... |
# Copyright 2021 The FastEstimator Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
# Generated by Django 3.1.7 on 2021-05-13 22:04
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('stock', '0035_auto_20210513_1715'),
]
operations = [
migrations.RemoveField(
model_name='mydiary',
name='was_correct',
... |
# -*- coding: utf8 -*-
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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... |
from application.app import app, db
import datetime
class Group(db.Model):
id = db.Column(db.Integer, primary_key=True)
group_name = db.Column(db.String(50), unique=True, nullable=False)
is_deleted = db.Column(db.Boolean, default=False)
created_date = db.Column(
db.DateTime, default=datetime.da... |
import os
path = "/Users/chuntinz/Downloads/XNLI-1.0"
def read_test_tsv(path, opt1, opt2):
with open(path, "r", encoding="utf-8") as fin, open(opt1, 'w', encoding='utf-8') as fout1, open(opt2, 'w', encoding='utf-8') as fout2:
for line in fin:
fields = line.strip().split('\t')
lan... |
"""
====================================================================
Multiclass MEG ERP Decoding
====================================================================
Decoding applied to MEG data in sensor space decomposed using Xdawn.
After spatial filtering, covariances matrices are estimated and
classified by th... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Aaron Dettmann
import setuptools
import os
from ceasiompy.__version__ import __version__
NAME = 'ceasiompy'
EXCLUDE_DIRS = ['doc', 'test']
VERSION = __version__
AUTHOR = 'CFS Engineering'
EMAIL = 'aidan.jungo@cfse.ch'
DESCRIPTION = 'A conceptual aircraft design envir... |
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from {{ cookiecutter.project_slug }}.models import Base
def database_connect(database_url: str):
return create_engine(database_url)
def create_session(engine):
return sessionmaker(bind=engine)()
def create_tables(engine):
B... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import time
import pygame
class DSJoyStick:
"""
用來接收所有的搖桿事件
"""
def __init__(self):
pygame.init()
joyStickCount = pygame.joystick.get_count()
if joyStickCount == 0:
return nil
self.myJoyStick = pygame.joystick.Joystick(0)
self.myJoyStick.init()
print self.myJ... |
from bson import DBRef, SON
from base import (BaseDict, BaseList, TopLevelDocumentMetaclass, get_document)
from fields import (ReferenceField, ListField, DictField, MapField)
from connection import get_db
from queryset import QuerySet
from document import Document
class DeReference(object):
def __call__(self, i... |
import ast
import datetime
import re
import secrets
import time
from datetime import timedelta
from typing import (
AbstractSet,
Any,
Callable,
Dict,
List,
Optional,
Pattern,
Sequence,
Set,
Tuple,
TypeVar,
Union,
)
import django.contrib.auth
from bitfield import BitField... |
from cornice import Service
from daybed.backends.exceptions import CredentialsAlreadyExist
from daybed.tokens import get_hawk_credentials, hmac_digest
from daybed.views.errors import forbidden_view
tokens = Service(name='tokens', path='/tokens', description='Tokens')
token = Service(name='token', path='/token', descr... |
from rest_framework import viewsets
from .models import Payload
from .serializers import PayloadSerializer
class PayloadApiView(viewsets.ModelViewSet):
queryset = Payload.objects.all()
serializer_class = PayloadSerializer
|
def initialize_tracking(initial):
return (initial[-1], {x: i for i, x in enumerate(initial[0:-1])})
def update_tracking(prev_number, i, last_occ):
if prev_number not in last_occ:
next_number = 0
else:
next_number = i - 1 - last_occ[prev_number]
last_occ[prev_number] = i - 1
return ... |
# Copyright 2012 Nebula, 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 agree... |
from app import app
from app.api import api
from app.api.wrappers import Manager
from flask import jsonify, request
from app.api import tools
manage = Manager() # App Manager
@api.route('/organization/', methods=['GET'])
def get_org_data():
org_domain = request.args.get('org_domain', None)
response = manag... |
#!/usr/bin/env python3
#
# This file is part of LiteX-Boards.
#
# Copyright (c) 2019 Sean Cross <sean@xobs.io>
# Copyright (c) 2018 David Shah <dave@ds0.me>
# Copyright (c) 2020 Florent Kermarrec <florent@enjoy-digital.fr>
# SPDX-License-Identifier: BSD-2-Clause
import os
import sys
import argparse
from migen import... |
import pytest
def test_double_relax(mock_vasp, clean_dir, si_structure):
from jobflow import run_locally
from atomate2.vasp.flows.core import DoubleRelaxMaker
from atomate2.vasp.schemas.task import TaskDocument
# mapping from job name to directory containing test files
ref_paths = {
"rel... |
# -*- coding: utf-8 -*-
import inspect
from abc import abstractmethod, ABC
from collections import defaultdict
from typing import TypeVar, Generic, ClassVar, TYPE_CHECKING, Tuple, Optional, Callable, Any
from ordered_set import OrderedSet
if TYPE_CHECKING:
from ddb.cache import Cache # pylint:disable=cyclic-impo... |
import re
from docxtpl import DocxTemplate, R, InlineImage, RichText, Listing
from docx.shared import Mm, Inches, Pt
from docassemble.base.functions import server
import docassemble.base.filter
from types import NoneType
from docassemble.base.logger import logmessage
def image_for_docx(number, question, tpl, width=Non... |
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Tag, Recipe
from recipe.serializers import TagSerializer
TAG_URL = reverse('recipe:tag-list')
class P... |
import cherrypy
import os
from s3_sessions.sessions import S3Session
class Server(object):
@cherrypy.expose()
def index(self):
count = cherrypy.session.get('count', 0) + 1
cherrypy.session['count'] = count
return "You have seen this page {} times".format(count)
if __name__ == '__mai... |
import requests
response = requests.delete('http://localhost:28139/page')
|
import sys
from pathlib import Path
import subprocess
from typeguard import typechecked
from balsa import get_logger
from pyshipupdate import mkdirs
import pyship
from pyship import AppInfo, pyship_print, get_icon
from pyship import __application_name__ as pyship_application_name
from pyship.launcher import applicati... |
# 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 applica... |
from network_attack_simulator.envs.environment import NetworkAttackSimulator
from network_attack_simulator.experiments.experiment_util import get_scenario
from network_attack_simulator.experiments.experiment_util import get_agent
from network_attack_simulator.experiments.experiment_util import is_valid_agent
from netwo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys, os
import subprocess as sp
from tempfile import TemporaryDirectory
# Add /scripts to path. Used for Furo theme and to generate images
this_path=os.path.split(os.path.abspath(__file__))[0]
script_path=this_path+'/scripts'
sys.path.append(script_path)
html_stat... |
import sys
sys.path.insert(1, "../../")
import h2o
def upload_import_small(ip, port):
# Connect to a pre-existing cluster
h2o.init(ip, port)
various_datasets = ["smalldata/iris/iris.csv", "smalldata/iris/iris_wheader.csv", "smalldata/prostate/prostate.csv",
"smalldata/prostate/pros... |
from collections import OrderedDict
from mock import patch, MagicMock
import numpy as np
from pytest import raises
from scipy.sparse import csr_matrix
from menpo.image import Image
from menpo.shape import (
TriMesh,
TexturedTriMesh,
ColouredTriMesh,
PointCloud,
LabelledPointUndirectedGraph,
)
from ... |
# 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... |
import core.implant
import core.job
import string
class UserHunterJob(core.job.Job):
def create(self):
self.fork32Bit = True
def report(self, handler, data, sanitize = False):
data = data.decode('latin-1')
task = handler.get_header(self.options.get("UUIDHEADER"), False)
if tas... |
##
#
# @author Florian BELLANGER, Fyne DC, Annecy, FRANCE
# @brief a set of generic functions for data management
import numpy as np
from random import randrange
def average_above_zero(table):
"""
make average from a table of non-null positiv value
Arg:
table : a list of numeric values
return... |
def cake(candles,debris):
res = 0
for i,v in enumerate(debris):
if i%2:
res+=ord(v)-97
else:
res+=ord(v)
if res>0.7*candles and candles:
return "Fire!"
else:
return 'That was close!' |
import geopandas as gpd
import os
from json import loads
from numpy import zeros, asarray, array, reshape, nan, sqrt, std
from copy import deepcopy
from fiona import open as fopen
from rasterio.mask import mask
from pyproj import CRS
from rasterio import open as rasopen
from shapely.geometry import shape, mapping, Poly... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (c) Camille Scott, 2020
# File : database.py
# License: MIT
# Author : Camille Scott <camille.scott.w@gmail.com>
# Date : 22.02.2021
import aiofiles
import aiosql
import aiosqlite
import asyncio
from datetime import datetime
import functools
import os
import sqlite... |
# -*- coding: utf-8 -*-
import random
import codecs
import hashlib
import ast
class WrongOption(Exception):
pass
class BadHash(Exception):
pass
test = '''Alas, my love, you do me wrong,
To cast me off discourteously.
For I have loved you well and long,
Delighting in your company.'''
####################... |
# coding=utf-8
# Copyright 2022 The TensorFlow Datasets 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 appl... |
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import ImageGrid
fig = plt.figure(1)
grid1 = ImageGrid(fig, 121, (2, 2), axes_pad=0.1,
aspect=True, share_all=True)
for i in [0, 1]:
grid1[i].set_aspect(2)
grid2 = ImageGrid(fig, 122, (2, 2), axes_pad=0.1,
aspect=T... |
import matplotlib
import pandas as pd
matplotlib.use('Agg') # Force matplotlib to not use any Xwindows backend.
import numpy as np
from astropy.io import fits
from custom_image_utils import scaled_plot
from matplotlib import pyplot as plt
import scipy.spatial.distance
import skimage.transform
# recreate the methods o... |
import os, re, time
import random
import requests, json
import argparse
requests.packages.urllib3.disable_warnings()
def getToken(folder,errPrint=True):
if os.path.isdir(folder):
for file in sorted(os.listdir(folder),reverse=True):
reLog = re.match(r'.+?_LeagueClientUx\.log', file)
if reLog:
try:
wit... |
#! /usr/bin/env python
"""
Module with various fits handling functions.
"""
__author__ = 'Carlos Alberto Gomez Gonzalez'
__all__ = ['open_fits',
'info_fits',
'write_fits',
'verify_fits',
'byteswap_array']
import os
import numpy as np
from astropy.io import fits as ap_fit... |
import errno
import socket
from itertools import chain, imap
from redis.exceptions import ConnectionError, ResponseError, InvalidResponse
class PythonParser(object):
def __init__(self):
self._fp = None
def on_connect(self, connection):
"Called when the socket connects"
self._fp = conne... |
# Copyright 2022 Mark Bolhuis <mark@bolhuis.dev>
# 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... |
from ..core import EntityManager
class PayAccount(EntityManager):
object_name = 'pay-account'
|
def is_leap_year(y:int)->bool:
return (y % 4 == 0 and y % 100 !=0) or y % 400 == 0
def get_last_date(y:int, m:int)->int:
if m == 1 or m == 3 or m == 5 or m == 7 or m == 8 or m == 10 or m == 12:
return 31
elif m == 2:
return 29 if is_leap_year(y) else 28
return 30
def is_date_overflo... |
# !/usr/bin/env python3
# -*- cosing: utf-8 -*-
import json
with open("foo.txt", "r") as f:
contents = f.read()
my_list = json.loads(contents)
|
# 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 warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2020 Rapptz
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 u... |
"""System-wide constants."""
from __future__ import annotations
import os
# Mode Names
PRODUCTION_MODE_NAME = "prod"
DEVELOPMENT_MODE_NAME = "dev"
# Latest Git Commit
LATEST_KEYWORD = "latest"
# Root of repo
ROOT_DIR = os.path.normpath(
os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..")
)
RO... |
"""
tasks.filemap
~~~~~~~~~~~~~
tests/filename_map.yml validity checks
"""
import pathlib
import re
import yaml
from invoke import task # pylint: disable=3rd-party-module-not-gated
from tasks import utils
CODE_DIR = pathlib.Path(__file__).resolve().parent.parent
FILENAME_MAP_PATH = CODE_DIR / "tests" / ... |
# 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 warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... |
from django.conf.urls import include, url
from django.contrib.auth import views as auth_views
from . import views
# Uncomment the next two lines to enable the admin (imports admin module in each app):
from django.contrib import admin
admin.autodiscover()
urlpatterns = [
# xapi endpoints
url(r'^XAPI/', includ... |
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
# useful for handling different item types with a single interface
from itemadapter import ItemAdapter
import pymongo
import re
class LianjiaPipelin... |
# Copyright 2016-2018, Pulumi 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 t... |
"""Definitions for using tools like saved_model_cli."""
load("//tensorflow:tensorflow.bzl", "clean_dep", "if_xla_available")
load("//tensorflow:tensorflow.bzl", "tfcompile_target_cpu")
load("//tensorflow/compiler/aot:tfcompile.bzl", "target_llvm_triple")
def _maybe_force_compile(args, force_compile):
if force_com... |
import os
from.MYDataset import MYDataset
from .SRNDataset import SRNDataset
def get_split_dataset(dataset_type, datadir, want_split="all", training=True, **kwargs):
"""
Retrieved desired dataset class
:param dataset_type dataset type name (srn|dvr|dvr_gen, etc)
:param datadir root directory name for... |
# -*- coding: utf-8 -*-
# @Time : 2018/7/29 下午1:37
# @Author : yidxue
|
# -*- coding: utf-8 -*-
"""
Copyright [2009-2020] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by... |
from django.db import models
# Create your models here.
# class SaveBook(models.Model):
# pass |
import unittest
import numpy as np
import os
import sys
sys.path.insert(0, os.pardir)
sys.path.insert(0, os.path.join(os.pardir, 'openmoc'))
import openmoc
class TestRectangularPrism(unittest.TestCase):
def test_constructor(self):
rectprism = openmoc.RectangularPrism(1, 2, .5, 1.5, 3, 2.5)
self.... |
from __future__ import absolute_import, division, print_function
from .server import Server, to_tree, from_tree, api
from .spider import spider, from_yaml
from .client import Client
from .serialization import (
SerializationFormat,
all_formats,
json as json_format,
pickle as pickle_format,
msgpack ... |
class Layer:
def __init__(self):
self.input = None
self.output = None
def forward_propagation(self, input):
raise NotImplementedError
def backward_propagation(self, output_error, learning_rate):
raise NotImplementedError |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class BlogAppConfig(AppConfig):
name = 'djangocms_blog'
verbose_name = _('django CMS Blog')
|
# Copyright 2020 kubeflow.org
#
# 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... |
from django.test import TestCase
from django.urls import reverse
from rest_framework.test import APIClient
from rest_framework import status
from ..serializers import UserApiSerializer
from apis.models import UserApiModel
from datetime import date
def create_user(data):
return UserApiModel.objects.create(**data... |
__author__ = 'marcusj'
import requests
import base64
import json
url = "http://localhost:49731"
version = "/v1/version"
reports = "/v1/reports"
headers = {'Content-Type': 'application/json;charset=UTF-8', 'Accept': 'application/json'}
service_version_field = 'ServiceVersion'
engine_version_field = 'EngineVersion'
d... |
from bugyocloudclient.core import BugyoCloudClient
from bugyocloudclient.endpoints.checkauthenticationmethod import \
CheckAuthenticationMethod
from bugyocloudclient.models.authinfo import AuthInfo
from bugyocloudclient.models.clientparam import ClientParam
from requests import Response
class TestCheckAuthenticat... |
#!/usr/bin/env python3
import os
from os.path import join
import subprocess
import multiprocessing
from constants import *
LOG_ROOT = "/data/graph/log"
NUM_XEON_PHIS = 4
FILE_GROUP = "adm"
NINEP_NVME = {}
# common config
SG_PORT = 5000
SG_ALGORITHM = "pagerank"
SG_NMIC = 4
SG_RUN_ON_MIC = 0
SG_DEBUG = False
SG_PRI... |
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (c) 2019 HERE Europe B.V.
#
# SPDX-License-Identifier: MIT
# License-Filename: LICENSE
#
###############################################################################
# from qgis.core import QgsSetti... |
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect
from django.http import JsonResponse
from django.forms.models import model_to_dict
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import Sus... |
from rest_framework import serializers
from ebooks.models import Ebook, Review
class ReviewSerializer(serializers.ModelSerializer):
review_author = serializers.StringRelatedField(read_only=True)
class Meta:
model = Review
exclude = ("ebook",)
# fields = "__all__"
class EbookSeriali... |
# -*- coding: utf-8 -*-
# Copyright 2018 GIG Technology NV
#
# 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... |
from _pydevd_bundle.pydevd_constants import * #@UnusedWildImport
from pydevd_file_utils import get_abs_path_real_path_and_base_from_frame
from _pydev_imps._pydev_saved_modules import thread
threadingCurrentThread = threading.currentThread
DEBUG = False
#===============================================================... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
# import modules
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.linear_model import LinearRegression
sns.set()
# load the data
data = pd.read_csv('data/Simple_linear_regression.csv')
x = data['SAT']
y = data['GPA']
#convert to 2d array
x_matrix = x.values.res... |
"""Module for Coding DNA DelIns Translation."""
from variation.translators.translator import Translator
from variation.schemas.classification_response_schema import ClassificationType
from variation.schemas.token_response_schema import CodingDNADelInsToken, Token
class CodingDNADelIns(Translator):
"""The Coding D... |
# -*- coding: utf-8 -*-
"""Top-level package for Buildout Recipe Mako Template."""
from buildout.recipe.mako_template.recipe import Recipe
__author__ = """Maksym Shalenyi"""
__email__ = 'maksym.shalenyi@gmail.com'
__version__ = '0.1.0'
__all__ = [Recipe]
|
#!/usr/bin/env python
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This script runs an automated Cronet native performance benchmark.
This script:
1. Starts HTTP and QUIC servers on the host machine... |
from tests.utils import W3CTestCase
class TestFlexbox_AlignContentStretch(W3CTestCase):
vars().update(W3CTestCase.find_tests(__file__, 'flexbox_align-content-stretch'))
|
# sqlalchemy/exc.py
# Copyright (C) 2005-2019 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Exceptions used with SQLAlchemy.
The base exception class is :exc:`.SQLAlchemy... |
from __future__ import (division, absolute_import, print_function,
unicode_literals)
from beets.plugins import BeetsPlugin
from beets import ui
class TestPlugin(BeetsPlugin):
def __init__(self):
super(TestPlugin, self).__init__()
self.is_test_plugin = True
def command... |
# https://www.codechef.com/problems/COOMILK
for T in range(int(input())):
n,l,k=int(input()),list(map(str,input().split())),1
for z in range(n-1):
if(l[z]=="cookie" and l[z+1]!="milk"): k=0
if(l[n-1]=="cookie"): k=0
print("NO") if(k==0) else print("YES") |
import os
import six
import json
import socket
import datetime
import Utils
import Model
from MultiCast import SendTrigger
def getPhotoDirName( raceFileName ):
return os.path.join( os.path.dirname(raceFileName or '') or '.', os.path.splitext(raceFileName or '')[0] + '_Photos' )
def PhotoSendRequests( messages, cmd='... |
from django_rich_logging.logging import DjangoRequestHandler
from rich.console import Console
def test_init_with_console():
console = Console()
handler = DjangoRequestHandler(console=console)
assert id(console) == id(handler.console)
def test_init_with_no_console():
handler = DjangoRequestHandler()... |
"""Contain the unit tests related to the models in app ``trainings``."""
import datetime
from django.test import TestCase
from teamspirit.core.models import Address, Location
from teamspirit.profiles.models import Personal
from teamspirit.trainings.models import Training
class TrainingModelTestsCase(TestCase):
... |
import os
import numpy as np
from rbci.logger import Logger as Log
def load_result_file(file):
arr = np.load(file)
D = dict([(k, arr[k]) for k in arr.keys()])
return D
def load_config(cfgfile):
""" Parses a configuration file """
cfgf = open(cfgfile, 'r')
cfg = {}
for l in cfgf:
... |
import json
import logging
from datetime import datetime
from functools import wraps
from pathlib import Path
import pymongo
from pymongo.errors import ServerSelectionTimeoutError
class Dataset:
"""Base parent class for all datasets
--------
Methods:
--------
get_dataset():
Get t... |
# -*- coding: utf-8 -*-
"""
Basic Shell Tests
~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import pytest
from pygments.token import Token
from pygments.lexers import BashLexer, BashSessionLexer, MSDOSSessionLexer, Pow... |
# Copyright 2020 Google Research. 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... |
import _plotly_utils.basevalidators
class SizesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name='sizesrc',
parent_name='scatterpolargl.marker',
**kwargs
):
super(SizesrcValidator, self).__init__(
plotly_name=plotly_nam... |
from .inference import InferenceBackend
from .decoder import ConfigDecoder
from .profiler import Profiler |
"""
This module performs subspace system identification.
It enforces that matrices are used instead of arrays to avoid dimension conflicts.
"""
import sysid
import cupy as np
__all__ = ['subspace_det_algo1', 'prbs', 'nrms']
def block_hankel(data, f):
"""
Create a block hankel matrix.
Args:
data ... |
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import datetime
import json
from components import auth
from components import auth_testing
from testing_utils import testing
from legacy import api_common... |
import asyncio
import logging
from typing import List, Optional, Set, Tuple
import aiosqlite
from blspy import G1Element
from fibo.types.blockchain_format.sized_bytes import bytes32
from fibo.util.db_wrapper import DBWrapper
from fibo.util.ints import uint32
from fibo.wallet.derivation_record import DerivationRecord
... |
from django.apps import AppConfig
class NitmisAdminConfig(AppConfig):
name = 'nitmis_admin'
|
from base_config import get_baseconfig_by_epoch
from gsm.gsm_prune_pipeline import gsm_prune_pipeline
def gsm_rc56():
network_type = 'rc56'
dataset_name = 'cifar10'
batch_size = 64
base_log_dir = 'gsm_exps/{}_base_train'.format(network_type)
gsm_log_dir = 'gsm_exps/{}_gsm'.format(network_type)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.