text stringlengths 1 927k |
|---|
import json
import unittest
from secrets import token_bytes
from blspy import AugSchemeMPL, PrivateKey
from tests.util.keyring import using_temp_file_keyring
from venidium.util.keychain import Keychain, bytes_from_mnemonic, bytes_to_mnemonic, generate_mnemonic, mnemonic_to_seed
class TestKeychain(unittest.TestCase)... |
import frappe
def get_context(context):
context.schedules = [
[
["October 17, 2019", "Enterprise + Open Source"],
["08:00 - 09:30", "Registrations & Breakfast"],
["09:45 - 10:00", "Opening Ceremony, Welcome"],
["10:00 - 10:30", "Dr. Kailash Nadh (CTO, Zerodha)"],
["", "<span class='text-muted'>Though... |
class Solution:
def solve(self, n):
stringElements = [str(num) for num in range(1, n + 1)]
stringElements.sort()
return [int(num) for num in stringElements] |
import sys
import time
import os
import config
import setmq
from socket import *
import numpy as np
import time
import binascii
#동양커피머신 상태 가져오기
host = "192.168.103.140"
gseq = 0
gcrc_16 = 0x8005
table_crc = []
def buildTable16(aPoly):
for i in range(0, 256):
data = np.uint16(i << 8)
accum = 0
... |
from datetime import datetime
from os.path import isfile
from typing import Any, Optional, Type, TypedDict, TypeVar, Union
import ruyaml as yaml
from pyhilo.const import LOG
class TokenDict(TypedDict):
access: Optional[str]
refresh: Optional[str]
expires_at: datetime
class AndroidDeviceDict(TypedDict)... |
# -*- coding: utf-8 -*-
"""
.. invisible:
_ _ _____ _ _____ _____
| | | | ___| | | ___/ ___|
| | | | |__ | | | |__ \ `--.
| | | | __|| | | __| `--. \
\ \_/ / |___| |___| |___/\__/ /
\___/\____/\_____|____/\____/
Created on Jun 9, 2014
████████████████████████████████████████... |
class RequestHandler:
def __init__(self):
pass
def preview_request(
self,
region: str,
endpoint_name: str,
method_name: str,
url: str,
query_params: dict,
):
"""
called before a request is processed.
:param string region: the ... |
# Copyright 2020 Google LLC 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 ag... |
# -*- coding: utf-8 -*-
'''
Concurrency controls in zookeeper
=========================================================================
:depends: kazoo
:configuration: See :py:mod:`salt.modules.zookeeper` for setup instructions.
This module allows you to acquire and release a slot. This is primarily useful
for ensure... |
# MIT License
# Copyright (c) 2022 Raghavendra Basvan
# 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, me... |
# -*- coding: utf-8 -*-
from openerp.osv import fields, osv
import datetime
import xmlrpclib
from openerp.tools.translate import _
class stock_picking(osv.osv):
_inherit = "stock.picking"
_columns = {
'remote_picking_id': fields.integer( string='Remote Pick ID', readonly=True),
'picking_no'... |
from LexicalAnalyzer import LexicalAnalyzer
import unittest
class Test(unittest.TestCase):
def setUp(self):
self.testLexer1 = LexicalAnalyzer("[otakuFanSubs] animeName [1280x720][218C38]", ["[", "(", "{"], ["]", ")", "}"], [" "], False)
self.testLexer2 = LexicalAnalyzer("[otakuFanSubs] animeName... |
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RSummarizedexperiment(RPackage):
"""SummarizedExperiment container.
The Summarized... |
from django import forms
class RegionSelectionForm(forms.Form):
region_id = forms.ChoiceField(choices=(), label='Region')
def __init__(self, *args, **kwargs):
region_choices = kwargs.pop('region_choices')
super(RegionSelectionForm, self).__init__(*args, **kwargs)
self.fields['region_i... |
from util import get_named_tu
import ffig.cppmodel
import nose
from nose.tools import assert_equals
def test_new_class_is_added():
tu_a = get_named_tu('class A{};', 'a.cpp')
tu_b = get_named_tu('class B{};', 'b.cpp')
model = ffig.cppmodel.Model(tu_a)
model.extend(tu_b)
classes = model.classes
... |
import inspect
import time
from collections import OrderedDict
from importlib.machinery import SourceFileLoader
from pathlib import Path
from random import randint
from py3status.composite import Composite
from py3status.constants import MARKUP_LANGUAGES, ON_ERROR_VALUES, POSITIONS
from py3status.py3 import Py3, Modu... |
import os
import uuid
import signal
import sys
from time import sleep
from flask import Flask, render_template, request
from flask_mail import Mail
from flask_security import utils, login_required
from flask_admin import Admin
from observer.processing.main import system_init, SystemMng
# create and configure the ap... |
import operator
import warnings
import numpy as np
from pandas._libs import index as libindex
import pandas.compat as compat
from pandas.compat.numpy import function as nv
from pandas.util._decorators import Appender, cache_readonly
from pandas.core.dtypes.common import (
ensure_platform_int, is_categorical_dtyp... |
from dagster import check
from dagster.config.config_type import Array, ConfigAnyInstance
from dagster.core.types.dagster_type import DagsterTypeKind
from .config_schema import InputHydrationConfig
from .dagster_type import DagsterType, PythonObjectDagsterType, resolve_dagster_type
PythonTuple = PythonObjectDagsterTy... |
import torch
import torch.nn as nn
import torch.optim as optim
import argparse
import numpy as np
import torch
import os
import sys
sys.path.append(os.getcwd())
from packnet_sfm.models.SelfSupModel import SelfSupModel
model = SelfSupModel()
PATH = '/home/ai/work/data/experiments/default_config-train_kitti-2022.03.1... |
import os.path as path
from setuptools import setup
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='oboparse',
version='0.0.3',
description='OBO file parser',
long_description=long_description,
... |
import os
import logging
from fastapi import HTTPException, Query
from idunn import settings
from idunn.utils.es_wrapper import get_elasticsearch
from idunn.utils.settings import _load_yaml_file
from idunn.utils.index_names import INDICES
from idunn.places import POI
from idunn.api.utils import (
fetch_bbox_place... |
import pytest
from questions_parser import parser_list
@pytest.mark.parametrize(
"questions, expected_questions",
[(["\n\n", " \na \n\n", " "], ["a"]), ([" a", "a ", "a"], ["a", "a", "a"])],
)
def test_parser_list(questions, expected_questions):
assert parser_list(questions) == expected_questions |
# 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 ... |
# utils/profdata_merge/process.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt for license information
# See http://swift.o... |
from setuptools import find_packages, setup
setup(
name='tmc',
version='1.0.0',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=[
'flask',
],
) |
# Created by Egor Kostan.
# GitHub: https://github.com/ikostan
# LinkedIn: https://www.linkedin.com/in/egor-kostan/
class JohnDoe:
FIRST_NAME = 'John'
LAST_NAME = 'Doe'
ADDRESS = '9805 Cambridge Street'
CITY = 'NY'
STATE = 'Brooklyn'
ZIP_CODE = '11235'
PHONE = '718-437-9185'
USERNAME = 'johndoe'
PASSWOR... |
# 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.
# --------------------------------------------------------------------... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis <michael.aivazis@para-sim.com>
# (c) 1998-2021 all rights reserved
def test():
"""
Send help channel output to a log file
"""
# get the channel
from journal.ext.journal import Help as help
# send all output to a file
... |
from docutils.parsers.rst import Directive
from docutils import nodes
from sphinx.util.nodes import set_source_info
import os
import re
def setup(app):
app.add_directive('fp_output', OutputDirective)
class OutputDirective(Directive):
required_arguments = 1
optional_arguments = 1
def run(self):
... |
# Copyright 2019 The Magenta 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 ... |
from enum import Enum
class Strictness(Enum):
"""The minimum strictness with which to apply checks.
Strictness does not describe whether or not a check
should be applied. Rather, if a check is done, strictness
describes how intense/strict/deep the check should be.
Each level here describes what ... |
"""
WSGI config for website project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` ... |
# -*- coding: utf-8 -*- #
# Copyright 2015 Google LLC. 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 requir... |
#
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is 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
#
# THIS SOFTWARE IS PRO... |
import unittest
import inspect
from pyvalidator.utils.to_string import to_string, obj_str
from . import print_test_ok
class TestIsUuid(unittest.TestCase):
def test_input_str(self):
self.assertEqual(to_string("x"), "x")
print_test_ok()
def test_input_int(self):
self.assertEqual(to_st... |
# 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... |
#! /usr/bin/env python
from asa import (ASA,asa_login)
# Entry point for program
if __name__ == "__main__":
# Initialize Cisco ASA Object
asa = ASA(
address=asa_login['host'],
username=asa_login['username'],
password=asa_login['password']
)
print(asa.getAllPhysicalIfaces())
... |
"""
WeasyPrint
==========
WeasyPrint converts web documents to PDF.
The public API is what is accessible from this "root" packages
without importing sub-modules.
:copyright: Copyright 2011-2019 Simon Sapin and contributors, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import... |
# https://www.acmicpc.net/problem/4949
if __name__ == '__main__':
input = __import__('sys').stdin.readline
bracket = {'(', ')', '[', ']'}
while True:
line = input().rstrip()
if line == '.':
break
stack = list()
for char in line:
if char not in brac... |
#!/usr/bin/env python
#
# Copyright 2007 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 o... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('comments', '0005_auto_20170605_1035'),
]
operations = [
migrations.RemoveField(
model_name='commentimage',
... |
# 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
# distributed under t... |
__author__ = u'schmatz'
import errors
import configuration
import mongo
import node
import repositoryInstaller
import ruby
import shutil
import os
import glob
import subprocess
def print_computer_information(os_name,address_width):
print(os_name + " detected, architecture: " + str(address_width) + " bit")
def constr... |
from collections import namedtuple
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd.function import InplaceFunction, Function
__all__ = ['CPTConv2d']
QParams = namedtuple('QParams', ['range', 'zero_point', 'num_bits']) # 由三个部分组成的表示
_DEFAULT_FLATTEN = (1, -1)
_DEFAULT... |
import gym
import numpy as np
import time
import os
import cv2
import matplotlib.pyplot as plt
from collections import deque
from IPython.display import clear_output
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.nn.utils import clip_grad_norm_
from qnetwor... |
"""
Dashboard para o admin com controlcenter.
Nesse arquivo estao todos os widgets e funcoes para
os graficos e listas.
"""
from controlcenter import Dashboard, widgets
from likebee.core.models import Task
class EmptyDashboard(Dashboard):
"""Funcao em branco."""
pass
class MyWidget0(widgets.Widget):
... |
# Generated by Django 2.2.12 on 2021-08-06 12:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0003_match_players'),
]
operations = [
migrations.AlterModelOptions(
name='arena',
options={'verbose_name': ... |
import json
import yaml
from typer.testing import CliRunner
from frictionless import program, describe, Detector, helpers
runner = CliRunner()
IS_UNIX = not helpers.is_platform("windows")
# General
def test_program_describe():
result = runner.invoke(program, "describe data/table.csv --stats")
assert resul... |
import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['None'] , ['MovingAverage'] , ['Seasonal_Minute'] , ['MLP'] ); |
class addition:
def __init__(self):
self.a=10
self.b=20
def add(self):
self.c=self.a+self.b
print('addition ;',self.c)
a1=addition()
a1.add() |
# _*_ Coding:utf-8 _*_
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_mail import Mail, Message
from config import config
db = SQLAlchemy()
mail = Mail()
def create_app(config_name):
app = Flask(__name__)
app.config.from_object(config[config_name])
config[config_name].init_a... |
import os
from flask import Flask, request
from twilio.jwt.access_token import AccessToken
from twilio.jwt.access_token.grants import VoiceGrant
from twilio.rest import Client
from twilio.twiml.voice_response import VoiceResponse
ACCOUNT_SID = 'AC***'
API_KEY = 'SK***'
API_KEY_SECRET = '***'
PUSH_CREDENTIAL_SID = 'CR*... |
class UnknownPathException(Exception):
pass
class ValidationFailedException(Exception):
pass
class InvalidDataException(Exception):
pass
class ValidationFailedException(Exception):
pass
class UnexpectedRetrievalException(Exception):
pass
class VCSADetailsNotFoundException(Exception):
p... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
import os, sys
import typing
import discord
class TestPlugin:
async def ping_func(message, discord_client: object) -> str:
await discord_client.send_message(message.channel, "WE WUZ KINGS N SHIET")
async def echo_func( message, discord_client: object) -> str:
await discord_client.send_message(... |
import pytest
from pipscoin.util.misc import format_bytes
from pipscoin.util.misc import format_minutes
class TestMisc:
@pytest.mark.asyncio
async def test_format_bytes(self):
assert format_bytes(None) == "Invalid"
assert format_bytes(dict()) == "Invalid"
assert format_bytes("some byte... |
import time
import math
from algosdk.logic import get_application_address
from algosdk.future.transaction import LogicSigAccount, LogicSigTransaction, OnComplete, StateSchema, ApplicationCreateTxn, \
ApplicationOptInTxn, ApplicationNoOpTxn, OnComplete
from .config import PoolStatus, Network, get_validator_index, ge... |
import jogador
'''
Jogadores só podem comprar propriedades caso ela não tenha dono e o jogador tenha o dinheiro da venda.
Ao comprar uma propriedade, o jogador perde o dinheiro e ganha a posse da propriedade
'''
def verificaCompra(propriedade,jogador):
print(propriedade.get_propriedade(),jogador.get_person())
... |
# coding: utf-8
import datetime
import itertools
import logging
import logging.handlers
from sqlalchemy import BigInteger
from sqlalchemy import bindparam
from sqlalchemy import cast
from sqlalchemy import Column
from sqlalchemy import DateTime
from sqlalchemy import event
from sqlalchemy import exc
from sqlalchemy im... |
from itertools import product
import pandas as pd
import pytest
from pandas.testing import assert_series_equal
from evalml.demos import load_breast_cancer, load_wine
@pytest.mark.parametrize("problem_type", ["binary", "multi"])
def test_new_unique_targets_in_score(X_y_binary, logistic_regression_binary_pipeline_cla... |
"""Recruiters manage the flow of participants to the experiment."""
import flask
import json
import logging
import os
import re
import requests
from rq import Queue
from sqlalchemy import func
from dallinger.config import get_config
from dallinger.db import redis_conn
from dallinger.db import session
from dallinger.... |
# coding: utf-8
"""
OpenShift API (with Kubernetes)
OpenAPI spec version: v3.6.0-alpha.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
import openshift.client
from kubernetes.client.rest import Api... |
from cyberbrain import InitialValue, Binding, Mutation, Deletion, Symbol
g = 0
def test_miscellaneous(tracer, test_server):
a = "a"
b = "b"
c = "c"
d = "d"
e = [1, 2, 3]
tracer.start()
x = f"{a} {b:4} {c!r} {d!r:4}" # FORMAT_VALUE,BUILD_STRING
x = a == b == c # ROT_THREE,_COMPARE_... |
from jesse.strategies import Strategy
# test_is_smart_enough_to_open_positions_via_market_orders
class Test05(Strategy):
def update(self):
pass
def should_long(self):
return self.time == 1547201100000 + 60_000
def should_short(self):
return self.time == 1547203560000 + 60_000
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'tim'
from flask import Flask
from flask.json import JSONEncoder
from flask_restful import Api
from flask_restful import Resource
import types
from datetime import datetime
from flask.ext.session import Session
from flask.ext.cache import Cache
from flask impo... |
# -*- coding: utf-8 -*-
from django.conf.urls import include, url
from django.contrib import admin
from django.conf.urls.i18n import i18n_patterns
from .views import home, home_files
urlpatterns = [
url(r'^(?P<filename>(robots.txt)|(humans.txt))$',
home_files, name='home-files'),
]
urlpatterns += i18n_patte... |
# coding=UTF-8
import numpy as np
from DataClass.BassClass.ScannerBase import *
class MScannerClass(ScannerBaseClass):
def __init__(self,
VirtualPhantom,
SelectGradietX=2.0,
SelectGradietY=2.0,
DriveFrequencyX=2500000.0 / 102.0,
... |
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
from sklearn.metrics.pairwise import pairwise_distances
import numpy as np
# pass in column names for each CSV as the column name is not given in the file and read them using pandas.
# You can check the column names from the readme file
#Reading us... |
# 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, overload
from .. import _utilities
from... |
# Apple Invaders Stage 2: Jumping
import pygame as pg
from settings import Settings
from sprites import Player, Block
import random
import os
class World:
def __init__ (self):
# Initialisiert die Spielewelt
pg.init()
pg.mixer.init()
self.screen = pg.display.set_mode((s.WIDTH, ... |
#!/usr/bin/env python
#
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP
#
# 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
#
# U... |
from unittest import TestCase
from Implementations.FastIntegersFromGit import FastIntegersFromGit
from Implementations.helpers.Helper import ListToPolynomial, toNumbers
from Implementations.FasterSubsetSum.RandomizedVariableLayers import RandomizedVariableExponentialLayers
from benchmarks.test_distributions import Dist... |
from __future__ import absolute_import, print_function
# --- System ---
import os
import sys
import time
import warnings
# --- Utility ---
import pandas as pd
import numpy as np
import math
import random
import logging
import pickle
import warnings
warnings.filterwarnings('ignore')
from sklearn.model_selection import... |
from __future__ import print_function, division, absolute_import
import copy
import collections
import numpy as np
from .. import imgaug as ia
from . import normalization as nlib
from . import utils as utils
DEFAULT = "DEFAULT"
_AUGMENTABLE_NAMES = [
"images", "heatmaps", "segmentation_maps", "keypoints",
... |
import logging
import colorama
import torch
from torch import nn
try:
from fedml_core.trainer.model_trainer import ModelTrainer
except ImportError:
from FedML.fedml_core.trainer.model_trainer import ModelTrainer
colorama.init()
class MyModelTrainer(ModelTrainer):
def get_model_params(self):
ret... |
import numpy as np
from astropy.io import fits
def acs_limits( x, y, filename):
'''
;PURPOSE : TO RETURN THE INDEX OF THOSE X AND Y POSITIONS THAT
; ARE WITHIN THE FIELD OF VIEW AND NOT ZERO IN THE SINGLE
; IMAGE FRAM
;INPUTS :
; X : THE X POSITIONS of the sources in ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 NTT
# 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
#
... |
# Copyright 2004-2021 Tom Rothamel <pytom@bishoujo.us>
#
# 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, m... |
import webbrowser
import os
import re
# Styles and scripting for the page
main_page_head = '''
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Fresh Tomatoes!</title>
<!-- Bootstrap 3 -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.m... |
from subprocess import Popen
def run_sync(script):
Popen(['osascript', '-e', script]) |
from .test_function import test_function
from .sphere_scat import sphere_scat |
"""pata URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/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, name='home')
Class-based... |
from q4b import get_grouping
########## TEST CASE 1 ##########
print()
print('-' * 20)
print()
print('Test 1')
expected_results1 = [('Snow White', 'Dopey'), ('Grumpy', 'Queen'), ('Sneezy', 'Sleepy')]
expected_results2 = [('Snow White', 'Grumpy'), ('Dopey', 'Queen'), ('Sneezy', 'Sleepy')]
print('Expected:', expected_re... |
import pytest
from click.testing import CliRunner
from irisvmpy import iris
class TestCLI(object):
@pytest.fixture()
def runner(self):
return CliRunner()
def test_print_help_succeeds(self, runner):
result = runner.invoke(iris.cli, ['--help'])
assert result.exit_code == 0
def... |
#!/usr/bin/env python
#
# ******************************************************************************
# ****** BiCAS - Bidlo's Cellular Automata Simulator *******
# ******************************************************************************
# This program requires the Python environment with N... |
# -*- 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... |
#!/usr/bin/env python
# Info module template
#############################################
# WARNING #
#############################################
#
# This file is auto generated by
# https://github.com/jgroom33/vmware_rest_code_generator
#
# Do not edit this file manually.
#
# Ch... |
import argparse
import io
import logging
import sys
from collections import OrderedDict
from dataclasses import dataclass
from pathlib import Path
from typing import List, Dict, Set, Union, Optional, TextIO
import pandas as pd
from jinja2 import Template, Environment, FileSystemLoader
from kyoto_reader import KyotoRea... |
import numbers
from .session import OSFSession
# Base class for all models and the user facing API object
class OSFCore(object):
def __init__(self, json, session=None):
if session is None:
self.session = OSFSession()
else:
self.session = session
self._update_attri... |
"""Tests for certbot_dns_shellrent.dns_shellrent."""
import unittest
import mock
import json
import requests_mock
from certbot import errors
from certbot.compat import os
from certbot.errors import PluginError
from certbot.plugins import dns_test_common
from certbot.plugins.dns_test_common import DOMAIN
from certbot... |
import json
import numbers
from typing import TYPE_CHECKING, Any, Iterable, List, Optional, Union
from decimal import Decimal
from django.core.exceptions import ValidationError
from django_countries.fields import Country
from prices import Money, TaxedMoney, TaxedMoneyRange
from saleor.checkout import calculations
fro... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-14 15:27
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ask', '0007_answer_author'),
]
operations = [
migrations.CreateModel(
... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 12, transform = "RelativeDifference", sigma = 0.0, exog_count = 100, ar_order = 0); |
from nltk import pos_tag, word_tokenize
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
import csv
import argparse
import os
exact2tokenized = {}
tokenized2pos = {}
pos2content = {}
def main():
print('\n#######################')
print('Preprocess Part 2')
print('################... |
# 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... |
"""maxiPago python integration"""
# :copyright: (c) 2013 by Stored (www.stored.com.br).
# :license: BSD, see LICENSE for more details.
VERSION = (1, 2, 0)
__version__ = '.'.join(map(str, VERSION[0:3])) + ''.join(VERSION[3:])
__author__ = 'Stored'
__contact__ = 'contato@stored.com.br'
__docformat__ = 'restructuredtex... |
import re
def clean_multiline_str(s: str):
return re.sub(
# |||||| <- Clear comments too.
r"^\s*('.*)?",
"",
s.strip(),
flags=re.M
) |
# 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
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayOpenSmsgDataSetResponse(AlipayResponse):
def __init__(self):
super(AlipayOpenSmsgDataSetResponse, self).__init__()
def parse_response_content(self, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.