text
stringlengths
2
999k
""" Methods for decoding subsets of voxels (e.g., ROIs) or experiments (e.g., from meta-analytic clustering on a database) into text. """ from .base import Decoder from ...due import due, Doi @due.dcite(Doi('10.1371/journal.pcbi.1005649'), description='Citation for GCLDA decoding.') class GCLDADiscreteDeco...
import pytest @pytest.mark.freeze_time('2020-01-01') def test_get_budget_account_subaccount_groups(api_client, user, create_budget_subaccount, create_budget_account, create_budget, create_budget_subaccount_group): budget = create_budget() account = create_budget_account(budget=budget) grou...
import itertools import sys import time import signal from .fancycli import fancywait from .fancycli.platform import isatty def skipcallback(handler): raise StopIteration def delay_impl_factory(helper, statusline, show_toggle): togglelabel = lambda: '<r>切换自动补充理智(%s)' % ('ON' if helper.use_refill else 'OFF'...
from __future__ import unicode_literals template = { "Resources": { "EC2EIP": { "Type": "AWS::EC2::EIP" } }, "Outputs": { "EIP": { "Description": "EIP for joining", "Value": { "Fn::Join": [ ":", ...
#!/usr/bin/env python # # Author: Vincent Perricone <vhp lavabit.com> # Date: 3/10/2011 # Title: Dupe Finder - Duplicate File Finder # License: Released under "Simplified BSD License" see LICENSE file # import sys import os import hashlib hashdict = {} def output(): for key in hashdict: if hashdi...
import os.path, glob, sys import ROOT arch = sys.argv[1] sample = sys.argv[2] build = sys.argv[3] suffix = sys.argv[4] g = ROOT.TFile("test_"+arch+"_"+sample+"_"+build+"_"+suffix+".root","recreate") # declare hists: reco only h_MXNH = ROOT.TH1F("h_MXNH_"+suffix, "nHits/Track", 35, 0, 35) h_MXPT = ROOT.TH1F("h_M...
import pandas as pd import os import numpy as np import xml.etree.ElementTree as ET from collections import defaultdict def iou(pred_box, true_box): p_xmin, p_ymin, p_xmax, p_ymax = pred_box[0], pred_box[1], pred_box[2], pred_box[3] t_xmin, t_ymin, t_xmax, t_ymax = true_box[0], true_box[1], true_box[2], true...
from typing import NamedTuple, List Tree = NamedTuple('Tree', [('name', str), ('runes', List[str])]) """A :func:`namedtuple <collections.namedtuple>` which represents a specific tree in a :class:`RunePage`. Attributes ---------- name : str The name of the rune tree, e.g. ``'Precision'``. runes : List[str] A ...
import os import os.path import hashlib import errno from torch.utils.model_zoo import tqdm def gen_bar_updater(): pbar = tqdm(total=None) def bar_update(count, block_size, total_size): if pbar.total is None and total_size: pbar.total = total_size progress_bytes = count * block_si...
from .common import JobStreamTest import textwrap class TestMap(JobStreamTest): """Tests map() functionality that is compatible with the builtin map() function. MY_MODULE controls where map() comes from; None indicates that the builtin should be used, and is used to test compatibility.""" MY_MODULE...
def test_default_response_home_view(dummy_request): from ..views.default import home_view response = home_view(dummy_request) assert len(response) == 0 assert type(response) == dict # Auth View Functionality def test_default_response_auth_view(dummy_request): from ..views.default import auth_view...
# dotbot_forever.py # by Kerstin Voigt, Sept 2014; inspired by Nils Nilsson, Introduction to # Artificial Intelligence: A New Synthesis # dobot will wander around until it finds the wall, then circle the wall in # counter clockwise direction forever; BEHAVIOR IS PROGRAMMED!! # Implements sensors and features from ...
from django.urls import path from . import views app_name = 'chibi' urlpatterns = [ path('<slug>', views.redirect_view, name='short_url'), path('api/shorten/', views.AddRedirectView.as_view(), name='api_shorten'), ]
#!/usr/bin/env python import rospy from json import loads from pytg.receiver import Receiver # get messages from pytg.sender import Sender # send messages, and other querys. from pytg.utils import coroutine #from rosapi.srv import Topics from rosbridge_library.protocol import Protocol from rosbridge_library.capab...
import json import os import time import unittest import lusid from datetime import datetime from main import get_input_transactions, check_or_create_commission_transactions from tests.integration.setup.setup_instruments import setup_instruments from tests.integration.setup.setup_portfolio import setup_portfolio from...
import requests class CoinbasePro : def __init__(self, uri) : self.uri = uri def get(self, endpoint, params = {}) : response = requests.get(self.uri + '/coinbasepro' + endpoint, params) return response.json() if response.status_code > 199 and response.status_code < 300 else False ...
# emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil; coding: utf-8 -*- # ex: set sts=4 ts=4 sw=4 noet: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license ...
import os import unittest from pathlib import Path from openmc_data_to_json import ( cross_section_h5_file_to_json_files, cross_section_h5_files_to_json_files, cross_section_h5_file_to_json_file, cross_section_h5_to_json, reactions_in_h5, trim_zeros_from_front_and_back_of_list, ) class TestAp...
# coding: utf-8 import torch from joeynmt.constants import PAD_TOKEN from joeynmt.helpers import load_data, arrays_to_sentences, bpe_postprocess, \ load_config, get_latest_checkpoint, make_data_iter, \ load_model_from_checkpoint, store_attention_plots from joeynmt.metrics import bleu, chrf, token_accuracy, se...
__author__ = 'brianoneill' def test_deco_sklearn_cluster_KMeans_class(): """ Code from "Demonstration of k-means assumptions", http://scikit-learn.org/stable/auto_examples/cluster/plot_kmeans_assumptions.html#example-cluster-plot-kmeans-assumptions-py This test demonstrates * decorating an "ex...
import numpy as np import onnx_darknet.darknet.darknet_ctypes as dn from onnx_darknet.handlers.backend_handler import BackendHandler from onnx_darknet.handlers.handler import onnx_op from onnx_darknet.handlers.handler import darknet_func @onnx_op("Relu") class Relu(BackendHandler): @classmethod def _common...
from django.test import TestCase from django.contrib.auth import get_user_model from core import models def sample_user(email='test@londonappdev.com', password='testpass'): """Create a sample user""" return get_user_model().objects.create_user(email, password) class ModelTests(TestCase): def test_crea...
# Copyright 2015-2018 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from django.conf import settings from lck.django.common.models import MACAddressField from ralph.discovery.models import DeviceType from ralph.s...
#!/usr/bin/python # -*- coding: utf-8 -*- import flask from flask import Flask, render_template from flask_googlemaps import GoogleMaps from flask_googlemaps import Map from flask_googlemaps import icons import os import re import sys import struct import json import requests import argparse import getpass import thre...
# pylint: disable=c-extension-no-member # 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, Vers...
"""Defines the linter class.""" from typing import ( Any, Dict, List, Optional, overload, ) from typing_extensions import Literal from sqlfluff.core.errors import ( CheckTuple, ) from sqlfluff.core.timing import TimingSummary # Classes needed only for type checking from s...
""" ``django-structlog`` is a structured logging integration for ``Django`` project using ``structlog``. """ default_app_config = "django_structlog.apps.DjangoStructLogConfig" name = "django_structlog" VERSION = (1, 6, 2) __version__ = ".".join(str(v) for v in VERSION)
input_file = '/opt/ml/processing/input/churn.txt'; train_file = '/opt/ml/processing/output/data/train.csv' validation_file = '/opt/ml/processing/output/data/validation.csv' test_file = '/opt/ml/processing/output/data/test.csv' import pandas as pd import numpy as np churn = pd.read_csv(input_file) churn = churn.drop('P...
from liquepy.num import flac, general, o3, models, mrd_curves
from asposewords import Settings from com.aspose.words import Document from com.aspose.words import NodeType class JoiningTables: def __init__(self): dataDir = Settings.dataDir + 'programming_documents/' # Load the document. doc = Document(dataDir + "tableDoc.doc") ...
import win32com.client, pythoncom, os, openpyxl def create_excelsheet(filepath): pythoncom.CoInitialize() excel = win32com.client.DispatchEx('Excel.Application') workbook = excel.Workbooks.Open(r+filepath) excel.Visible = False excel.DisplayAlerts = False copiedsheet = workbook.Worksheets("main") worksheet = w...
import unittest from tests.harness import instrumentGooey from gooey import GooeyParser from gooey.tests import * class TestListbox(unittest.TestCase): def makeParser(self, **kwargs): parser = GooeyParser(description='description') parser.add_argument( '--widget', widget...
"""Define Parameter which holds the value.""" from contextlib import suppress import numpy as np import tensorflow as tf # TF backwards compatibility from tensorflow.python import ops, array_ops import zfit from zfit import ztf from tensorflow.python.ops.resource_variable_ops import ResourceVariable as TFBaseVariab...
from flask_wtf import FlaskForm from wtforms import RadioField, IntegerField from wtforms.validators import DataRequired, NumberRange from wtforms.widgets.core import Input class NumberInput(Input): input_type = "number" class MyIntegerField(IntegerField): widget = NumberInput() class AddCartForm(FlaskFor...
from SwarmAnalyticsUtility.SocketIOClient.SocketIOClient import *
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 from recipe.serializers import TagSerializer TAGS_URL = reverse('recipe:tag-list') class PublicTag...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/spanner_v1/proto/spanner.proto import sys _b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) from google.protobuf import descriptor as _descriptor from google.protobuf import message...
# Refaça o DESAFIO 51, lendo o primeiro termo e a razão de uma PA, mostrando os 10 primeiros termos da progressão # usando a estrutura while. a = int(input('Digite o primeiro termo da P.A: ')) r = int(input('Digite o a razão da P.A: ')) contador = 1 while contador < 11: pa = a + (contador-1)*r print('O {}º t...
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.async_support.base.exchange import Exchange import math import json from ccxt.base.errors import ExchangeError from ccxt.base.err...
import os import sys filename = __file__[:-5] + '-input' with open(filename) as f: input_values = list(map(lambda s: s.split(), f.read().splitlines())) total_forward = 0 total_depth = 0 total_aim = 0 for direction, distance in input_values: if direction == 'forward': total_forward += int(distance) ...
from __future__ import annotations import re import typing from abc import ABC, abstractmethod from enum import Enum from typing import Any, Callable, Dict, Hashable, List, Optional, TypeVar, Union import discord from .app_command_interaction import SlashInteraction from .types import ( ApplicationCommandPayload,...
import unittest from summa.keywords import keywords from utils import get_text_from_test_data class TestSummarizer(unittest.TestCase): def test_keywords(self): text = get_text_from_test_data("mihalcea_tarau.txt") kwds = keywords(text) self.assertTrue(len(kwds.splitlines())) kwd...
# Copyright 2020 Ben Kehoe # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license" file accompanying this file. This file is # distr...
#!/usr/bin/python """ Modified by Taichi Miya on 2020-08-29. Copyright (c) 2020 Yamaoka-Kitaguchi Lab. All rights reserved. Created by Thomas Mangin on 2017-07-06. Copyright (c) 2009-2017 Exa Networks. All rights reserved. License: 3-clause BSD See: http://blog.sflow.com/2017/07/bgp-flowspec-on-white-box-switch.html...
from django.conf.urls import patterns, include, handler500, url from django.conf import settings from django.views.generic import TemplateView from tags.views import view_tag, TagList urlpatterns = patterns( '', url(r'^/$', TemplateView.as_view(template_name='tags/index.html'), name='tags'), url(r'^...
import datetime import logging import requests from zipfile import ZipFile from .scraper import FlowScraper FLOW_URL = 'https://flow.polar.com' FLOW_LOGIN_URL = "{}/login".format(FLOW_URL) FLOW_GPX_URL = "{}/api/export/training/gpx/".format(FLOW_URL) FLOW_CURVE_URL = "{}/training/analysis/{{}}/curve/data".format(FLO...
import discord, os from discord.ext import commands from colorama import Fore, init from dotenv import load_dotenv load_dotenv() init(convert=True) TOKEN = os.getenv("TOKEN") intents = discord.Intents.default() intents.members = True bot = commands.Bot(command_prefix="!",help_command=None,intents=intents) hoistingTa...
import os import mne import sys import glob import pickle import matplotlib matplotlib.use('agg') # now it works via ssh connection import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from IPython import embed from scipy.stats import ttest_rel sys.path.append('/home/dvmoors1/...
import typing import time import struct from datetime import datetime, timezone from csaf_f16.fgbase import FlightGearBase, Dubins2DConverter class FGIntruder(FlightGearBase): """ Multiplayer airplane/object It can either `idle` and only stays alive, or actively update its position The multiplayer p...
"""SCons.Tool.gcc Tool-specific initialization for gcc. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of...
#!/usr/bin/env python3 from setuptools import setup # skill_id=package_name:SkillClass PLUGIN_ENTRY_POINT = 'fallback-wolfram-alpha.mycroftai=skill_wolfie:WolframAlphaSkill' # in this case the skill_id is defined to purposefully replace the mycroft version of the skill, # or rather to be replaced by it in case it is p...
# -*- coding: utf-8 -*- # Copyright 2019, Paweł Kierzkowski, mailto:<pk.pawelo@gmail.com> # # Python test originally created or extracted from other peoples work. The # parts from me are licensed as below. It is at least Free Software where # it's copied from other people. In these cases, that will norm...
""" mbed CMSIS-DAP debugger Copyright (c) 2015 ARM Limited 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 models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('members', '0001_initial'), ] operations = [ migrations.AlterField( model_name='m...
from openml.exceptions import OpenMLServerException from requests.exceptions import ChunkedEncodingError def test_automl(budget=5, dataset_format="dataframe", hpo_method=None): from flaml.data import load_openml_dataset try: X_train, X_test, y_train, y_test = load_openml_dataset( dataset_...
# We need an object with prices and special offers # which will be working as our DB. db_values = { 'A': { 'price': 50, 'special_offer': [{ 'qty': 3, 'offer': 130, 'type': 'price' }, { 'qty': 5, 'offer': 200, 't...
#!/usr/bin/env python3 import rospy from gazebo_msgs.srv import SpawnModel, SpawnModelRequest, SpawnModelResponse from copy import deepcopy from tf.transformations import quaternion_from_euler sdf_cube = """<?xml version="1.0" ?> <sdf version="1.4"> <model name="MODELNAME"> <static>0</static> <link name="li...
from polybot.version import __version__ # noqa: F401
# -*- coding: utf-8 -*- # # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights # Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or i...
import os import sys import logging from flask import Flask from flask.ext.login import LoginManager from flask_sqlalchemy import SQLAlchemy from sqlalchemy_utils import PasswordType from flask_sqlalchemy import orm app = Flask(__name__, template_folder='../templates', static_folder='../static') app.logger.addHandle...
import logging import pymongo import os CONNECT_TIMEOUT = 2000 log = logging.getLogger('app') env = os.environ host = env.get('MONGO_HOST') port = int(env.get('MONGO_PORT', 27017)) login = env.get('MONGO_LOGIN') password = env.get('MONGO_PASSWORD') _client = None def get_client(): global _client if not ...
from toolshed.importer import create_project from toolshed.updater import update_projects_score def test_oauth_rankings(): flask_dance = create_project(pypi_url="https://pypi.python.org/pypi/Flask-Dance", github_url="https://github.com/singingwolfboy/flask-dance") flask_oauth = create_project(pypi_url="https:...
import os from multiprocessing import cpu_count from tempfile import NamedTemporaryFile from vermin import Arguments, Config from .testutils import VerminTest def parse_args(args): return Arguments(args).parse() class VerminArgumentsTests(VerminTest): def __init__(self, methodName): super(VerminArgumentsTes...
import pyodbc import datetime import openpyxl class SqlToXl(): """Use to connect to database, run sql, write results to Excel file""" def __init__(self, connection_string): self.connection_string = connection_string def save_sql(self, sql, filename, sheetname="Sheet1"): cnxn ...
import json import os import re import shutil import tempfile import time import yaml from bzt import TaurusConfigError, TaurusException, NormalShutdown, AutomatedShutdown from bzt.bza import Master, Test, MultiTest from bzt.engine import ScenarioExecutor, Service, EXEC from bzt.modules import FunctionalAggregator fr...
class UserNotFound(BaseException): """Thrown if a user passed is not in database""" pass
# Copyright 2019 Ross Wightman # Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
import pytest from graphql_relay import to_global_id from db.helper.forms import convert_date from db.models import Student, ProfileType, ProfileState, Hobby, OnlineProject # pylint: disable=C0209 def student_query(slug): return ''' query { student(slug: "%s") { matchStatus { initia...
''' Any file within the no_import_common_class folder is for methods that can be imported safely (without circular dependencies) into the classes in the common class folder. These methods are specific to category pages ''' import constants.file_paths as file_paths RESUME = 'resume' NOT_RESUME = ('exer...
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.md file in the project root # for full license information. # ============================================================================== import numpy as np from cntk import * from cntk.layers import * from cntk.layers.ty...
"""notes 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-based v...
""" #Trains a ResNet on the CIFAR10 dataset. """ from __future__ import print_function import keras from keras.layers import Dense, Conv2D, BatchNormalization, Activation from keras.layers import AveragePooling2D, Input, Flatten from keras.optimizers import Adam from keras.callbacks import ModelCheckpoint, LearningRa...
""" Usage Instructions: """ import csv import numpy as np # import pickle import random import tensorflow as tf import pandas as pd from maml import MAML from scene_sampling import SLICProcessor, TaskSampling from tensorflow.python.platform import flags from utils import tasksbatch_generator, sample_generator, met...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys if __name__ == '__main__': from breathe.apidoc import main sys.exit(main())
""" Basic statistics module. This module provides functions for calculating statistics of data, including averages, variance, and standard deviation. Calculating averages -------------------- ================== ================================================== Function Description ================== ==...
############################################################################### # Copyright (c) 2018-2021 Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory # # Written by J. Chavez, S. Czyz, G. Kosinovsky, V. Mozin, S. Sangiorgio. # RASE-support@llnl.gov. # # LLNL-CODE-...
import pytest from pytest import raises from viper import compiler from viper.exceptions import TypeMismatchException fail_list = [ """ @public def baa() -> decimal: return 2.0 ** 2 """, """ @public def foo(a:num): b:num(sec) c:num(sec**2) c = b ** a """ ] @pytest.mark.parametrize('b...
import pytest from atst.filters import dollars, renderAuditEvent, usPhone from atst.models import AuditEvent @pytest.mark.parametrize( "input,expected", [ ("0", "$0.00"), ("123.00", "$123.00"), ("1234567", "$1,234,567.00"), ("-1234", "$-1,234.00"), ("one", "$0.00"), ...
n1 = int(input('Um valor: ')) n2 = int(input('Outro valor: ')) s = n1 + n2 m = n1 * n2 d = n1 / n2 di = n1 // n2 e = n1 ** n2 print('A soma é {},\no produto é {}.\ne a divisão é {}'.format(s, m, d), end=' >>>') print('\nA divisão inteira é {}, e a potência é {}'.format(di, e))
#!/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 wallet backup features. Test case is: 4 nodes. 1 2 and 3 send transactions between each other...
import os import datetime import copy import flask import pymongo from flask_cors import CORS from jsonschema import validate from bson.objectid import ObjectId from src import exceptions from src.json_response import jsonify from src.permission import require_permission, get_sub from src.util import find_data_links ...
######################################################## # Rodrigo Leite - drigols # # Last update: 02/03/2021 # ######################################################## from scipy.sparse import csr_matrix from numpy import count_nonzero from numpy import array...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import copy import o...
# coding: utf-8 import pprint import re import six class NeutronListFloatingIpsRequest: """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name an...
#!/usr/bin/env python3 """ This module contains a variety of classic real-valued optimization problems that frequently occur in research benchmarks. It also contains helpers for translating, rotating, and visualizing them. """ import warnings from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3...
from html import unescape from os.path import dirname, join, realpath import jinja2 from starlette.applications import Starlette from starlette.middleware.sessions import SessionMiddleware from starlette.responses import RedirectResponse from starlette.testclient import TestClient from starlette_core.messages import ...
import copy import os from pymatgen.core.structure import Molecule from pymatgen.analysis.graphs import MoleculeGraph from pymatgen.analysis.local_env import OpenBabelNN from fireworks import LaunchPad, Workflow from atomate.qchem.database import QChemCalcDb from atomate.qchem.fireworks.core import SinglePointFW, O...
# coding: utf-8 """ Mimir DataHub API No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 0.0.9 Generated by: https://github.com/swagger-api/swagger-codegen.git Licensed under the Apache License, Version 2.0 (the "Licens...
import settings import handlers.base_handler import csv class CartogramHandler(handlers.base_handler.BaseCartogramHandler): def get_name(self): return "Bolivia" def get_gen_file(self): return "{}/bol_processedmap.json".format(settings.CARTOGRAM_DATA_DIR) def validate_values(self, val...
from PIL import Image, ImageDraw, ImageFont import re #ipath= u"./data/NCDC/上海/虹桥/9705626661750dat.txt" text2print = "한국어 中國語" img = Image.new('RGB', (1000, 1000), color = (73, 109, 137)) defaultFnt = ImageFont.truetype('font-files/나눔명조Bold', 50) chineseFnt = ImageFont.truetype('font-files/KoPubDotumBold.ttf', 50) d...
# -*- coding: utf-8 -*- """ Tests for runner_returns """ from __future__ import absolute_import, print_function, unicode_literals import errno import os import socket import tempfile import pytest import salt.payload import salt.utils.args import salt.utils.files import salt.utils.jid import salt.utils.yaml from test...
# coding: utf-8 """ Copyright 2015 SmartBear Software 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...
#MenuTitle: Delete All Anchors # -*- coding: utf-8 -*- __doc__=""" Deletes all anchors in active layers of selected glyphs. """ thisFont = Glyphs.font selectedLayers = thisFont.selectedLayers print "Deleting anchors in:" for thisLayer in selectedLayers: thisGlyph = thisLayer.parent print "-- %s" % thisGlyph.name...
"""A geoscript groovy kernel for Jupyter""" __version__ = '0.0.1'
import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as patches import xml.etree.ElementTree as etree import torch from torch import nn from torch import optim from torch.utils import data from torchvision import models from scipy import misc from skimage import io, transform def image_padding...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys from setuptools import setup from setuptools.command.install import install VERSION = "1.0.12" def readme(): """print long description""" with open('README.md') as f: return f.read() setup(name='certspotter', version=VERSION, ...
from datetime import datetime from decimal import Decimal import pytest from isoduration.parser import parse_duration from isoduration.types import DateDuration, Duration, TimeDuration def test_representations(): duration = Duration(DateDuration(weeks=3), TimeDuration(hours=2, seconds=59)) date_repr = ( ...
#!/usr/bin/python # coding=utf-8 # 打印出所有的"水仙花数",所谓"水仙花数"是指一个三位数,其各位数字立方和等于该数本身。 # 例如:153是一个"水仙花数",因为153=1的三次方+5的三次方+3的三次方。 def getNumber(start, end): lists = [] if (start > end or end > 999): print "data error" return lists for i in range(start, end + 1, 1): hundred = int(i / 1...
#!/usr/bin/env python3 from integer import ZZ from zmod import ZMod from poly import PolyRing from ring import RingProperties def hom_tests(ring): assert ring.ZERO == ring(0) assert ring.ONE == ring(1) for a, b in [(3, 50), (0, 4), (-4, -5)]: assert ring(a) + ring(b) == ring(a + b) asser...