text stringlengths 1 927k |
|---|
# -*- coding: utf-8 -*-
# Scrapy settings for tutorial project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/lates... |
"""
@Filename: AdaptiveBoost.py
@Author: Diogo Ribeiro
@Create Date: 2019-05-03
@Update Date: 2019-05-03
@Description: Implement of Adaptive Boosting
"""
import numpy as np
import preProcess
import pickle
import random
import SVM
import math
class Adaboost:
def __init__(self, norm_type="Nor... |
# http://web.mit.edu/lpsolve/doc/Python.htm
# P = (110)(1.30)x + (30)(2.00)y + (125)(1.56) = 143x + 60y + 195z
# 120x + 210y + 150.75z <= 15000
# 110x + 30y + 125z <= 4000
# x + y + z <= 75
# x >= 0, y >= 0, z >= 0
import lpsolve_wrapper as lw
model = lw.Model(
notations={
'x': lw.notation(
lo... |
"""ganzige 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, name='home')
Class-bas... |
# -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import sys
from code import InteractiveInterpreter
def main():
"""
Print l... |
# -*- coding: utf-8 -*-
import logging
from typing import List
from microchain.block import Block
__all__ = ["Chain"]
class Chain:
_interval = 10 # second
def __init__(self, blocks: List[Block] = None) -> None:
self.blocks = blocks or [Chain.genesis()]
def __len__(self):
return self.l... |
import re
from typing import Tuple
from duty.utils import att_parse, format_response
from duty.objects import MySignalEvent, dp
def delete_template(name: str, templates: list) -> Tuple[list, bool]:
for template in templates:
if template['name'].lower() == name:
templates.remove(template)
... |
import _plotly_utils.basevalidators
class SizerefValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="sizeref", parent_name="scatter3d.marker", **kwargs):
super(SizerefValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... |
# Copyright 2020 gRPC 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 writing... |
import sys
from threading import Thread
from connection import TcpConnection
from proto.tcp_packet_pb2 import TcpPacket
class Chat():
def __init__(self):
self.connection = TcpConnection()
self.packet = TcpPacket()
def createLobby(self, maxPlayers, *args):
payload = self.packet.CreateLobbyPacket()
... |
# Generated by Django 3.1.2 on 2020-11-14 03:49
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('OrderManagement', '0005_... |
mask4bits = ((1 << 4) -1)
import numpy as np
mask8bits = ((1 << 8) -1)
mask16bits = ((1 << 16) -1)
mask64bits = ((1 << 64) -1)
class SNAPPacket(object):
"""
ATA SNAP Firmware Manual, Release 2.0.0
---------------------------------------
Section 2.3.2 "Output Data Formats: Voltage Packets", pg 5
ht... |
#!/usr/bin/env python
"""Check for duplicate sequence identifiers in FASTA files.
This is run as a pre-check before makeblastdb, in order to avoid
a regression bug in BLAST+ 2.2.28 which fails to catch this. See:
http://blastedbio.blogspot.co.uk/2012/10/my-ids-not-good-enough-for-ncbi-blast.html
This script takes one... |
"""
Laser Commands are a middle language of commands for spooling and interpreting.
NOTE: Never use the integer value, only the command name. The integer values are
permitted to change.
COMMAND_PLOT: takes a plot object to generate simple plot commands.
COMMAND_RASTER: takes a raster plot object which generates simpl... |
#!/usr/bin/env python
# --------------------------------------------------------
# FCN
# Copyright (c) 2016 RSE at UW
# Licensed under The MIT License [see LICENSE for details]
# Written by Yu Xiang
# --------------------------------------------------------
"""Test a FCN on an image database."""
import _init_paths
f... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AlipayFundAuthOperationCancelModel(object):
def __init__(self):
self._auth_no = None
self._operation_id = None
self._out_order_no = None
self._out_re... |
import string
import regex
def is_pangram(i):
l = sorted(list(set(regex.sub(r'[^a-z]', "", i.lower()))))
return l == list(string.ascii_lowercase) |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2020-03-13 02:46
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('blogs', '0001_initial'),
]
operations = [
mig... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'confirm.ui'
#
# Created by: PyQt5 UI code generator 5.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectN... |
# SPDX-License-Identifier: BSD-3-Clause
# Copyright Contributors to the OpenColorIO Project.
class CDLTransform:
"""
CDLTransform
"""
def __init__(self):
pass
def equals(self, cdl):
"""
equals(cdl)
:param cdl: a cdl transform
:type cdl: :py:clas... |
import re
import os.path as path
from importlib import import_module
from django.template.context import BaseContext
def dict_from_context(context):
"""
Converts context to native python dict.
"""
if isinstance(context, BaseContext):
new_dict = {}
for i in reversed(list(context)):
... |
"""All low level structures used for parsing Estimote packets."""
from construct import Struct, Byte, Switch, Int8sl, Array, Int8ul
from ..const import ESTIMOTE_TELEMETRY_SUBFRAME_A, ESTIMOTE_TELEMETRY_SUBFRAME_B
# pylint: disable=invalid-name
EstimoteTelemetrySubFrameA = Struct(
"acceleration" / Array(3, Int8sl... |
# -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
from setuptools import setup
setup(
name="ownbot",
version="0.0.4",
license="MIT",
description="Python module to create private telegram bots.",
author="Michael Imfeld",
author_email="michaelimfeld@crooked.ch",
maintainer="Michael... |
#!/usr/bin/env python
"""
Code to load an expert policy and generate roll-out data for behavioral cloning.
Example usage:
python run_expert.py experts/Humanoid-v1.pkl Humanoid-v1 --render \
--num_rollouts 20
Author of this script and included expert policies: Jonathan Ho (hoj@openai.com)
"""
import o... |
# (C) Copyright 2007-2019 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license. The license
# is also available online a... |
from __future__ import with_statement
import errno
import getpass
import itertools
import json
import os
import shutil
import sys
import threading
from abc import ABCMeta, abstractmethod
from collections import namedtuple
from concurrent.futures import ThreadPoolExecutor
from copy import copy
from datetime import date... |
'''quantidade = int(input('quantos produtos o senhor comprou?'))
preco = quantidade * 1.99
print(preco)'''
print("====TABELA DE PREÇOS====")
for c in range(1, 51):
print(c, "- R$", c * 1.99)
quantidade = int(input('quantos produtos o senhor comprou?'))
preco = quantidade * 1.99
print(preco, " é o preço que voce t... |
from collections.abc import Sequence
import mmcv
import numpy as np
import torch
from mmcv.parallel import DataContainer as DC
from ..builder import PIPELINES
def to_tensor(data):
"""Convert objects of various python types to :obj:`torch.Tensor`.
Supported types are: :class:`numpy.ndarray`, :class:`torch.T... |
from otree.api import Currency as c, currency_range, SubmissionMustFail
from . import pages
from ._builtin import Bot
from .models import Constants
class PlayerBot(Bot):
cases = [
{'offer': 1, 'return_1': 1, 'return_2': 1,
'return_2_A': 1, 'return_2_B': 1,
'p1_payoff': 5, 'p2_payoff': 5... |
import collections
from supriya import CalculationRate
from supriya.ugens.Filter import Filter
class BRF(Filter):
"""
A 2nd order Butterworth band-reject filter.
::
>>> source = supriya.ugens.In.ar(bus=0)
>>> b_r_f =supriya.ugens.BRF.ar(source=source)
>>> b_r_f
BRF.ar()
... |
import numpy as np
import torch
import matplotlib.pyplot as plt
from neurodiffeq import diff # the differentiation operation
from neurodiffeq.conditions import IVP # the initial condition
from neurodiffeq.networks import FCNN # fully-connect neural network
from neurodiffeq.solvers import Solver1D
from neurodiffeq.ca... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import random
import argparse
import cv2 as cv
import numpy as np
from tqdm import tqdm
from create_7segment_image import create_7segment_image
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("--width", help='image width', type=... |
import numpy as np
import pytest
from scipy import sparse
from scipy.sparse import random as sparse_random
from sklearn.utils._testing import assert_array_almost_equal
from numpy.testing import assert_allclose, assert_array_equal
from scipy.interpolate import BSpline
from sklearn.linear_model import LinearRegression
f... |
# -*- coding: utf-8 -*-
import io
from owslib import util
from owslib.etree import etree
from owslib.iso import (
MD_Metadata,
)
from owslib.namespaces import Namespaces
def get_md_resource(file_path):
"""Read the file and parse into an XML tree.
Parameters
----------
file_path : str
Pa... |
# -*- coding: utf-8 -*-
# author: @RShirohara
# TODO: #8
from time import sleep
from .detect import DetectArea
from .googleapis import DetectText, GetTTS
from .send import PlayMP3
from .util import VideoStream, QueueConnector
class Tegaki:
"""HandWriting Detection core class.
Attributes:
capture (... |
_backendsNames = ("bouncyCastle", "pgpy")
from pathlib import Path
from os.path import expanduser
from enum import IntFlag
from abc import ABC, abstractmethod
keyringPath = Path(expanduser("~/.gnupg/pubring.kbx"))
class SecurityIssues(IntFlag):
OK = 0
wrongSig = (1 << 0)
expired = (1 << 1)
disabled = (1 << 2)
r... |
import markdown
import pinax.boxes.hooks
import pinax.pages.hooks
def markup_renderer(content):
return markdown.markdown(content)
class PinaxBoxesHookSet(pinax.boxes.hooks.DefaultHookSet):
def parse_content(self, content):
return markup_renderer(content)
class PinaxPagesHookSet(pinax.pages.hooks... |
from os import write as os_write, close as os_close, O_WRONLY as os_O_WRONLY, O_CREAT as os_O_CREAT, open as os_open, remove as os_remove
from twisted.web import resource, http
class UploadResource(resource.Resource):
FILENAME = "/tmp/autotimer_backup.tar"
def __init__(self, session):
self.session = session
re... |
#!/bin/bash
import os
import sys
import random
import cv2
import numpy as np
import xgboost as xgb
from sklearn import preprocessing
from sklearn.decomposition import PCA, NMF
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassif... |
import gym
import numpy
from PIL import Image
from nes_py.wrappers import JoypadSpace
from gym_super_mario_bros.actions import COMPLEX_MOVEMENT
class NopOpsEnv(gym.Wrapper):
def __init__(self, env=None, max_count=30):
super(NopOpsEnv, self).__init__(env)
self.max_count = max_count
def reset(s... |
# Copyright 2014 Facebook, Inc.
# You are hereby granted a non-exclusive, worldwide, royalty-free license to
# use, copy, modify, and distribute this software in source code or binary
# form for use in connection with the web services and APIs provided by
# Facebook.
# As with any software that integrates with the Fa... |
from multiprocessing.sharedctypes import Value
from global_vars import *
from utils import *
def state_inp_to_str(state_inp):
state_str = ''
for ch in state_inp:
state_str += str((['b', 'y', 'g'].index(ch)))
return state_str
def get_state_input():
valid = False
while not valid:
... |
"""mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... |
from pprint import pprint
from .args import get_args
from .openapifile import OpenAPIFile
from .ceresfile import CeresFile
def main():
args = get_args()
input_file = OpenAPIFile()
input_file.load(args.input)
output_producer = CeresFile(input_file, args.output_dir)
output_producer.process() |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="openmc_mesh_tally_to_vtk",
version="develop",
author="The Regular Mesh Plotter Development Team",
author_email="mail@jshimwell.com",
description="A Python package for converting OpenMC mes... |
from decimal import Decimal
from operator import attrgetter
from uuid import uuid4
from django.conf import settings
from django.contrib.postgres.fields import JSONField
from django.core.validators import MinValueValidator
from django.db import models
from django.db.models import F, Max, Sum
from django.urls import rev... |
#!/usr/bin/env python3
import argparse
import asyncio
import re
import sys
from itertools import groupby
from pathlib import Path
from typing import Optional, NamedTuple, AsyncIterable
import aiofiles
import aiohttp
PYPI_URL = "https://pypi.org/pypi/{package_name}/json"
class Package(NamedTuple):
name: str
... |
"""
traits: tools for examining classes, instances, and other python objects
Corey Rayburn Yung <coreyrayburnyung@gmail.com>
Copyright 2021, Corey Rayburn Yung
License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
... |
#!/usr/bin/python3.4
# -*-coding:Utf-8 -*
'''module to manage task settings'''
import xml.etree.ElementTree as xmlMod
import os, uuid, subprocess, shlex, time, datetime, threading
from save import *
from usefullFunctions import *
from Preferences.PresetList.Preset.Preset import *
from TaskList.FileInfo.FileInfo import ... |
import os
import torch
import random
import numpy as np
import torch.optim as optim
from torch.utils.data import DataLoader
from torchvision import transforms, datasets
from module.units.cosface_module import CosFace
def accuracy(logits, y):
_, preds = torch.max(logits, 1)
return (preds == y).float().mean()
... |
# coding=utf-8
import unittest
from ecs_pipeline_deploy import cli
class TestImageParsing(unittest.TestCase):
IMAGES = {
'alpine': (None, 'alpine', 'latest'),
'alpine:3.7': (None, 'alpine', '3.7'),
'docker.aweber.io/_/alpine:3.7':
('docker.aweber.io', '_/alpine', '3.7'),
... |
# -*- coding: UTF-8 -*-
name = 'TracCaptcha'
version = '0.4dev'
description = 'pluggable captcha infrastructure for Trac with reCAPTCHA included'
long_description = '''
TracCaptcha is a Trac plugin to embed a captcha in the ticket page in addition
to Trac's regular permission checks so that spammers are kept out.
**... |
"""
Copyright 2016 Deepgram
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
distri... |
from app.models import Blog , User
from app import db
def setUp(self):
self.user_Gerald = User(username = 'Gerald',password = 'potato', email = 'geerockface4@gmail.com')
self.new_blog = Blog(id=12345,title='Full stack development',content='Is it safe to go the full-stack way or better the Android path'... |
from click import argument
from flask.cli import AppGroup
from sqlalchemy.orm.exc import NoResultFound
manager = AppGroup(help="Queries management commands.")
@manager.command()
@argument("query_id")
@argument("tag")
def add_tag(query_id, tag):
from redash import models
query_id = int(query_id)
try:
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#
import argparse
import os
import sys
from rdkit import Chem
from rdkit.six import StringIO
from meeko import PDBQTMolecule
def cmd_lineparser():
parser = argparse.ArgumentParser(description='Copy atom coordinates from PDBQT (or DLG) file \
... |
from .exceptions import *
from .pricing import *
from .session import *
__all__ = session.__all__ + pricing.__all__ + exceptions.__all__
__version__ = "1.0.2" |
'''
Author: hanyu
Date: 2020-11-06 13:04:12
LastEditTime: 2021-01-09 09:07:08
LastEditors: hanyu
Description: environment
FilePath: /test_ppo/examples/PPO_super_mario_bros/env.py
'''
import logging
import numpy as np
from collections import namedtuple
# todo, to common
def padding(input, seqlen, dtype):
input = ... |
#
# Loop transformation submodule.that implements a combination of various loop transformations.
#
import sys
import orio.module.loop.submodule.submodule, transformation
import orio.module.loop.submodule.tile.tile
import orio.module.loop.submodule.permut.permut
import orio.module.loop.submodule.regtile.regtile
import ... |
"""
WSGI config for SentyectorAPI project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO... |
import copy
import os
import torch
import torch.utils.data
import torchvision
from pycocotools import mask as coco_mask
from pycocotools.coco import COCO
import dataProcessing.transforms as T
import logging
class FilterAndRemapCocoCategories(object):
def __init__(self, categories, remap=True):
self.catego... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, 9T9IT and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class FMDashboard(Document):
def make_outstanding_balances(self):
"""
Make outstanding balances ... |
"""ImagePoster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-b... |
from io import open
from setuptools import setup
from auto_py_to_exe import __version__ as version
setup(
name='auto-py-to-exe',
version=version,
url='https://github.com/brentvollebregt/auto-py-to-exe',
license='MIT',
author='Brent Vollebregt',
author_email='brent@nitratine.net',
descriptio... |
#!/usr/bin/env python
# Copyright 2014-2019 The PySCF Developers. 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
#
# U... |
# MIT License
#
# Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved.
#
# 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 th... |
from .CpyAPI import CpyAPI |
# Crie um programa que tenha uma tupla única com nomes de produtos
# e seus respectivos preços, na sequência. No final, mostre uma
# listagem de preços, organizando os dados em forma tabular.
listagem = ('Lápis', 1.75,
'Borracha', 2,
'Caderno', 15.90,
'Estojo', 10,
'Comp... |
import tensorflow as tf
# tf.enable_eager_execution()
class Dataset(object):
def get_dataset(self, params, mode):
if mode == tf.estimator.ModeKeys.TRAIN:
features_path = params["train_features_file"]
labels_path = params["train_labels_file"]
elif mode == tf.estimator.Mod... |
#!/usr/bin/env python
# Copyright 2015 gRPC 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 o... |
# Copyright (C) 2016 Nippon Telegraph and Telephone 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 applicab... |
# Copyright (c) 2018 The Pooch Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
#
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
"""
The classes that actually handle the downloads.
"""
import sys
import ftplib
import reques... |
"""Trusted Networks auth provider.
It shows list of users if access from trusted network.
Abort login flow if not access from trusted network.
"""
from ipaddress import ip_network, IPv4Address, IPv6Address, IPv4Network, IPv6Network
from typing import Any, Dict, List, Optional, Union, cast
import voluptuous as vol
im... |
import tensorflow as tf
import tensorflow.keras.backend as K
from tensorflow.keras.layers import Layer, Dropout
class SparseDropout(Layer):
def __init__(self, p=0.5):
super().__init__()
self.p = p
def call(self, x, training=None):
if training is None:
training = K.learning... |
# -*- coding: utf-8 -*-
# Use hash instead of parameters for iterables folder names
# Otherwise path will be too long and generate OSError
from nipype import config
import clinica.pipelines.engine as cpe
cfg = dict(execution={"parameterize_dirs": False})
config.update_config(cfg)
class DeepLearningPrepareData(cpe... |
import os
import glob
import argparse
import xml.etree.ElementTree as ET
parser = argparse.ArgumentParser()
# Define parameter
parser.add_argument('--input_dir', type=str)
parser.add_argument('--output_dir', type=str)
parser.add_argument('--class_list', type=str)
args = parser.parse_args()
# Set Class Names
def s... |
# Copyright (c) OpenMMLab. All rights reserved.
import math
import os
import tempfile
import numpy as np
import pytest
import torch
from mmdet3d.core.bbox import LiDARInstance3DBoxes, limit_period
from mmdet3d.datasets import KittiDataset
def _generate_kitti_dataset_config():
data_root = 'tests/data/kitti'
... |
# SPDX-FileCopyrightText: : 2020 @JanFrederickUnnewehr, The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
"""
This rule downloads the load data from `Open Power System Data Time series <https://data.open-power-system-data.org/time_series/>`_. For all countries in the network, the per country load timeseries with... |
import pytest
from scrapli.driver.generic.base_driver import ReadCallback
from scrapli.exceptions import ScrapliValueError
def test_get_prompt(monkeypatch, sync_generic_driver):
# stupid test w/ the patch, but want coverage and in the future maybe the driver actually
# does something to the prompt it gets fr... |
import sys
import networkx as nx
import logging
import json
import requests
from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
from collections import defaultdict
from utils_twc.generic import escape_entities
# Logging formatting
FORMAT = '%(asctime)s %(message)s'
logging.basicConfig(format=FO... |
import argparse
from .iterator import BedEntryIterator
from lhc.io.bed.tools import depth, sort, filter
from lhc.io.txt.tools import compress
def iter_bed(fname):
it = BedEntryIterator(fname)
for entry in it:
yield entry
it.close()
def main():
args = get_parser().parse_args()
args.func(... |
"""Test the bootstrapping."""
# pylint: disable=protected-access
import asyncio
import logging
import os
from unittest.mock import Mock, patch
from homeassistant import bootstrap
import homeassistant.config as config_util
import homeassistant.util.dt as dt_util
from tests.common import (
MockModule,
get_test_... |
from domain.model.base.provider import Provider
class CargoProviderImpl(Provider):
def confirm(self, cargo):
print 'confirm cargo' |
# Copyright (c) 2021 PaddlePaddle 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 appli... |
"""
Ridge regression
"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# Reuben Fletcher-Costin <reuben.fletchercostin@gmail.com>
# Fabian Pedregosa <fabian@fseoane.net>
# Michael Eickenberg <michael.eickenberg@nsup.org>
# License: BSD 3 clause
from abc import ABCMeta, abstractmethod
impor... |
'''
Tests for RandomCodons class of analysis module.
'''
from nose.tools import assert_equal, assert_not_equal, assert_raises
from coral import design, reaction, RNA
def test_randomcodons():
'''
This test is pretty basic right now - not sure how much checking
can be done for a random DNA base generator.... |
# Generated by Django 3.1.3 on 2020-11-14 08:22
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('truck_app', '0009_auto_20201112_1114'),
]
operations = [
migrations.RemoveField(
model_name='truck',
name='likes',
)... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from mptt.models import MPTTModel
from treebeard.mp_tree import MP_Node
from treebeard.al_tree import AL_Node
from treebeard.ns_tree import NS_Node
from treewidget.fields import TreeForeignKey, TreeManyToManyField
from django.u... |
"""Let's Encrypt constants."""
import os
import logging
from acme import challenges
SETUPTOOLS_PLUGINS_ENTRY_POINT = "letsencrypt.plugins"
"""Setuptools entry point group name for plugins."""
CLI_DEFAULTS = dict(
config_files=[
"/etc/letsencrypt/cli.ini",
# http://freedesktop.org/wiki/Software/x... |
import requests
import lxml.html as html
import os
import datetime
#El text-fill es un h2 pero la libreria no identifica el h2 como tal sino como text-fill
HOME_URL = 'https://www.larepublica.co/'
XPATH_LINK_TO_ARTICLE = '//text-fill/a/@href'
XPATH_TITLE = '//div[@class="mb-auto"]/text-fill/span//text()'
XPATH_SUMMAR... |
DEFAULT_SETTINGS = {
'CREATE_HTML_VIEW_RESOURCES': True,
'CREATE_REST_VIEW_RESOURCES': True,
'DEFAULT_MODEL_IMPORTS': [],
'DEFAULT_FORM_IMPORTS': [
'django.forms',
],
'FIELDS': {},
'MODEL_EXTRA_IMPORT_CLASSES': [
'django.db.models',
],
'MODEL_PARENT_CLASSES': ['django... |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 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 the abandontransaction RPC.
The abandontransaction RPC marks a transaction and all its in-wallet... |
# Generated with SMOP 0.41
from libsmop import *
# tsne_p.m
@function
def tsne_p(P=None,labels=None,no_dims=None,*args,**kwargs):
varargin = tsne_p.varargin
nargin = tsne_p.nargin
#TSNE_P Performs symmetric t-SNE on affinity matrix P
# mappedX = tsne_p(P, labels, no_dims)
# The f... |
import pprint as pp
import airflow.utils.dates
from airflow import DAG
from airflow.sensors.external_task_sensor import ExternalTaskSensor
from airflow.operators.dummy_operator import DummyOperator
from datetime import datetime, timedelta
default_args = {
"owner": "airflow",
"start_date": airflow.util... |
import asyncio
import ujson
from band import logger, expose
"""
Listen events and write to output
"""
@expose.listener()
async def broadcast(**params):
logger.info('Broadcast', params=params) |
# Copyright 2020 Regents of the University of Minnesota.
#
# 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 applic... |
"""
sphinx.testing.path
~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import shutil
import sys
if False:
# For type annotation
import builtins # NOQA
from typing import Any, Callable, IO, List # ... |
from abjad import attach
from abjad import inspect
from abjad import iterate
from abjad.tools import abctools
from abjad.tools import scoretools
class ClefSpannerExpression(abctools.AbjadValueObject):
r'''A clef spanner expression.
'''
### CLASS VARIABLES ###
__slots__ = ()
### INITIALIZER ###
... |
"""Utility """
import numpy as np
import cv2
import os
import logging
def check_string_is_empty(string):
"""name
check string empty or not
Args:
Returns:
"""
if string == '':
return True
return False
def check_numpy_array(array):
"""name
check array empty or no... |
#
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.