text
stringlengths
1
927k
import mock import pytest import random from speech_packer import Packer, SpeechAnalyzer ITEMS = ['t-shirt', 'jeans', 'raincoat', 'sneakers', 'hiking boots'] @mock.patch("speech_packer.SpeechAnalyzer") def test__add_item(mock_analyzer): item = random.choice(ITEMS) mock_analyzer.process_single_phrase.return_v...
# coding=utf-8 # Copyright 2021 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...
# coding=utf8 # Copyright 2018 JDCLOUD.COM # # 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 ...
#!flask/bin/python from app.views import update_all_sheets update_all_sheets();
import numpy as np import pandas as pd import yfinance as yf def downloading_stocks_data(dct, start_date: str = "2021-01-01", end_date: str = "2021-07-01") -> pd.DataFrame: """ Download the stocks daily information from tickers listed as keys of a dictionary, gets only "Close" price from each day within s...
"""Tests for greeneye_monitor sensors.""" from unittest.mock import AsyncMock from homeassistant.components.greeneye_monitor.sensor import ( DATA_PULSES, DATA_WATT_SECONDS, ) from homeassistant.const import STATE_UNKNOWN from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_registry im...
import scipy.stats import numpy as np from scipy.stats import multivariate_normal as MVG class UniformDist: def __init__(self, xmax=1., xmin=None): self.xmax = xmax self.xmin = - xmax if xmin is None else xmin self.prob = 1 / (self.xmax - self.xmin) def __call__(self, *args, **kwargs):...
# Copyright (c) 2011 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. { 'targets': [ { 'target_name': 'compositor', 'type': '<(library)', 'msvs_guid': '21CEE0E3-6F4E-4F01-B8C9-F7751CC21AA9', 'd...
# -*- coding: utf-8 -*- """ @author: moloch Copyright 2014 -------------------------------------------- Check for ticksy .gif and .bmp files http://jklmnn.de/imagejs/ """ import os from string import printable from tornado.options import options from random import randint MAX_AVATAR_SIZE = 1024 * 1024 MIN_AVA...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import pandas as pd def add_corona_dates(df, index_name, strategy=["during_corona", "no_corona"]): """ Inputs ------ strategy : List division of datetimes based on stages of corona; acceptable strategies are one of the following (order i...
# Exercício Python 4: #Faça um programa que leia algo pelo teclado e mostre na tela o seu tipo primitivo e todas as informações #possíveis sobre ele..''' e=input('Digite algo:') print('Entrada é um número: ',e.isnumeric()) print('Entrada é decimal:',e.isdecimal()) print('Entrada é alfabetica:',e.isalpha()) print('Es...
import os class Config(object): DEBUG = True DEVELOPMENT = True PG_USER = os.environ.get("PG_USER", "") PG_PASS = os.environ.get("PG_PASS", "") PG_HOST = os.environ.get("PG_HOST", "") PG_PORT = os.environ.get("PG_PORT", "") PG_DB = os.environ.get("PG_DB", "") SENDGRID_KEY = os.environ....
from __future__ import print_function import time import math import random import numpy as np import pickle as pkl import networkx as nx from gensim.models import Word2Vec from fastdtw import fastdtw from collections import Counter from collections import defaultdict import os class Z(object): def __init__(self,...
__copyright__ = "Copyright (c) 2021 Jina AI Limited. All rights reserved." __license__ = "Apache-2.0" from typing import Tuple, Dict, Union, Iterable import numpy as np from jina.executors.decorators import single from jina.executors.crafters import BaseCrafter from .helper import _load_image, _move_channel_axis, _...
# Modified from https://github.com/facebookresearch/detectron2/tree/master/projects/PointRend # noqa import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.utils import _pair def normalize(grid): """Normalize input grid from [-1, 1] to [0, 1] Args: grid (Tensor): T...
#!/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 """ """ from matplotlib import pyplot as plt import numpy as np # set up plot fonts from matplotlib import rcParams rcParams['font.family'] = 'sans-serif' rcParams['font.sans-serif'] = ['Helvetica', 'Arial'] rcParams['font.size'] = 11 # common settin...
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 CORTIER Benoît # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # ...
# encoding: utf-8 """ The Base Application class for ipyparallel apps """ import os import logging import re import sys from traitlets.config.application import catch_config_error, LevelFormatter from IPython.core import release from IPython.core.crashhandler import CrashHandler from IPython.core.application import ...
# coding: utf-8 # Std import re # Other import dals import dals.local_host.local_host_io_wrapper as dal def printer(msg): print msg def write_result_file(result_list, fname): sets = dal.get_utf8_template() sets['howOpen'] = 'w' sets['name'] = fname dal.list2file(sets, result_list) def read...
#!/usr/bin/python3 import requests import re import datetime import html import json from epg_sources.tele import tele from epg_sources.teleboy import teleboy from icon_sources.tele import tele as teleicon from icon_sources.teleboy import teleboy as teleboyicon class channel_item: id: str lang: str displa...
# encoding: utf-8 from sys import path from os.path import dirname as dir path.append(dir(path[0])) from connectors import users from telegram.ext import CommandHandler def main(dispatcher): about_handler = CommandHandler('about', __about) dispatcher.add_handler(about_handler) def __about(bot, update): ...
"""ANTS Apply Transforms interface Change directory to provide relative paths for doctests >>> import os >>> filepath = os.path.dirname( os.path.realpath( __file__ ) ) >>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data')) >>> os.chdir(datadir) """ import os from .base import ANTS...
#!/usr/bin/env python2 # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from .mininode import * from .blockstore import BlockStore, TxStore from .util import p2p_port ''' This is a tool for comparing two or more helpicods ...
import numpy as np from astropy.visualization.lupton_rgb import LinearMapping, AsinhMapping import matplotlib.pyplot as plt from matplotlib.patches import Rectangle, Polygon from matplotlib.ticker import MaxNLocator from .bbox import Box from .component import Component def channels_to_rgb(channels): """Get the l...
# Copyright (c) 2011-2020 Eric Froemling # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish,...
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import shutil import hmac import hashlib from django.db import models from django.db.models.signals import post_save from django.conf import settings from django.utils.translation import ugettext_lazy as _ from .settings import DAV_ROOT, PROVIDER_...
import asyncio import ssl try: import aiohttp except ImportError: # pragma: no cover aiohttp = None import six try: import websockets except ImportError: # pragma: no cover websockets = None from . import client from . import exceptions from . import packet from . import payload class AsyncClient(...
""" Regular expression match """ import re pattern = re.compile("(.*) regex '(.*)'") def fn(groups, lsv_fn): """Regular expression search function""" field, pattern = groups route_regex = re.compile(pattern) return lambda data: route_regex.search(str(lsv_fn(data, field))) != None
from abc import ABC, abstractmethod from concurrent.futures import Executor import csv from functools import partial from itertools import chain from math import ceil, exp, log10 import os from pathlib import Path import timeit from typing import Dict, Iterable, List, Optional, Sequence, Tuple, Type from rdkit import ...
'''This program contains the functions averageFinder and midpointFinder. AverageData calculates the averages of the "columns" of a list of numbers (a list of lists of numbers) for real and fake samples (separately) and midpointFinder finds the midpoint between the real and fake averages. Data is either given from the t...
"""Simplified Python gRPC interceptors.""" from grpc_interceptor.exception_to_status import ExceptionToStatusInterceptor from grpc_interceptor.server import MethodName, parse_method_name, ServerInterceptor __all__ = [ "ExceptionToStatusInterceptor", "MethodName", "parse_method_name", "ServerIntercept...
#!/usr/bin/python3 from html.parser import HTMLParser import urllib.request import webbrowser import datetime LANG = 'en' TMPFILE = '/tmp/watdo.html' class Parser(HTMLParser): def __init__(self): super(Parser, self).__init__() self.handle_next_h2 = False self.handle_until_h2 = False ...
from __future__ import division import random import unittest class ModuloTest(unittest.TestCase): def test_negmod(self): for _ in xrange(10000): a = random.randint(-10000, 10000) b = random.randint(-10000, 10000) if b == 0: b = random.randint(1, 10000) q = a // b r = a % b self.assertEqual(a...
__all__ = [ 'Dropbox', 'DropboxTeam', 'create_session', ] # This should always be 0.0.0 in master. Only update this after tagging # before release. __version__ = '0.0.0' import contextlib import json import logging import random import time import requests import six from . import files, stone_serialize...
import unittest from src.fizzbuzz import FizzBuzz class MyTestCase(unittest.TestCase): def test_something(self): self.assertEqual(FizzBuzz().fixxBuzz(), "1 2") if __name__ == '__main__': unittest.main()
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/2/15 17:36 # @Author : Kang # @Site : # @File : data_process.py # @Software: PyCharm import pandas as pd from gensim.models import Word2Vec from sklearn.decomposition import IncrementalPCA # inital reduction from sklearn.manifold import TSNE ...
"""Implementations for various useful completers. These are all loaded by default by IPython. """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development Team. # # Distributed under the terms of the BSD License. # # The full license is in the ...
#!/usr/bin/env python2 # Copyright (c) 2016-2017 The Duality Blockchain Solutions developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test proper accounting with an equivalent malleability clone # from test_framework.t...
# coding: utf-8 """ Healthbot APIs API interface for Healthbot application # noqa: E501 OpenAPI spec version: 1.0.0 Contact: healthbot-hackers@juniper.net Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import swagge...
import os from PIL import Image import urllib.request as ur import urllib.request from io import BytesIO import requests import csv import h5py import numpy as np import argparse def retrieve_patch( rec ): response = requests.get( rec[1], timeout=10 ) file = BytesIO( response.content ) img = Image.open( fi...
load(":functions.bzl", "create_option_file", "explicit_target") def _maven_pom_impl(ctx): # Contains both *.jar and *.aar files. jars = depset() # classfied jars. Sources are in clsjars["sources"] clsjars = {} # classifier -> depset(jars) clsjars["sources"] = depset() if ctx.attr.library: ...
from django import template from django_gravatar.templatetags.gravatar import gravatar_url # Get template.Library instance register = template.Library() # enables the use of the gravatar_url as an assignment tag register.assignment_tag(gravatar_url) @register.simple_tag(takes_context=True) def display_name(context)...
"""Constants for the FRITZ!Box Tools integration.""" from typing import Literal from fritzconnection.core.exceptions import ( FritzActionError, FritzActionFailedError, FritzInternalError, FritzLookUpError, FritzServiceError, ) from homeassistant.backports.enum import StrEnum from homeassistant.co...
"""Support for Timers.""" from datetime import timedelta import logging import voluptuous as vol from homeassistant.const import CONF_ICON, CONF_NAME, SERVICE_RELOAD import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity_component import EntityComponent from homeassistant.helpers.event...
"""Build ProxyStore package""" import setuptools with open('requirements.txt') as f: install_requires = f.readlines() with open('README.md') as f: long_desc = f.read() setuptools.setup( name="ProxyStore", version="0.3.0", author="Greg Pauloski", author_email="jgpauloski@uchicago.edu", des...
model = dict( type='LiteFlowNet', encoder=dict( type='NetC', in_channels=3, pyramid_levels=[ 'level1', 'level2', 'level3', 'level4', 'level5', 'level6' ], out_channels=(32, 32, 64, 96, 128, 192), strides=(1, 2, 2, 2, 2, 2), num_convs=(1, 3, 2, ...
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
""" This package contains the high-level Python interface to the particle system. Also see the :mod:`panda3d.physics` module, which contains the C++ implementation of the particle system. For more information about the particle system, see the :ref:`particle-effects` page in the manual. """
import os import torch from .data_cls import BertDataBunch from .data_ner import BertNERDataBunch from .learner_cls import BertLearner from .learner_ner import BertNERLearner import time from transformers import AutoTokenizer import warnings warnings.filterwarnings("ignore", message="numpy.dtype size changed") warni...
"""python 中的copy分为浅复制和深复制""" import copy # # a = [1, 2, 3] # b = a # 这时候a和b指向的是硬盘中的同一片区域,用id显示的话即使id(a)==id(b) # b[1] = 22 # 改变a中值b中值会同时被改变 # print(a) # [1, 22, 3] # print(id(a) == id(b)) # True # # # deep copy # c = copy.deepcopy(a) # print(id(a) == id(c)) # False # c[1] = 2 # print(a) # [1, 22, 3] 改变c中值,a中值不会...
#!/usr/bin/python # This script is used to generate luabinding glue codes. # Android ndk version must be ndk-r9b. import sys import os, os.path import shutil import ConfigParser import subprocess import re from contextlib import contextmanager def _check_ndk_root_env(): ''' Checking the environment NDK_ROOT, w...
#!/usr/bin/env python # -*- coding: utf-8 -*- from conans import ConanFile, CMake, tools, RunEnvironment import os import platform class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "cmake" if platform.system() == "Windows": prefix='' else: ...
""" Django settings for ActivityManager project. Generated by 'django-admin startproject' using Django 2.2. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ """ import...
# -*- coding: utf-8 -*- # CCP in Tomographic Imaging (CCPi) Core Imaging Library (CIL). # Copyright 2017 UKRI-STFC # Copyright 2017 University of Manchester # 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 ...
from fairypptx.color import Color, make_hue_circle from fairypptx.shape import Shape, Shapes class PaletteMaker: """Make a Color Pallete. """ default_color = Color((25, 239, 198)) def __init__(self, fontsize=18, line=3, colors=None): sel...
# Copyright 1999-2018 Alibaba Group Holding 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 by applicable law or a...
import numpy as np import cv2 MIN_MATCHES = 20 def main(): # Compute model first model = cv2.imread('../data/model.jpg', 0) # ORB keypoint detector orb = cv2.ORB_create() # create brute force matcher object bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True) # Comp...
__version__ = '1.0a3'
def joinprob3d(ff, T1 = 2*pi): """ Given the 2d histogram (ff) of two datasets, this function gives back the join probability as 3d plot with the corresponding axis. Author: Michele Monti Args: ff: (list) is the output of histogram2d, ff[0] is the distribution from histogram2d to 3d plot, ff[1] is the x...
from typing import Callable, Dict, List, Union class Augmentor: """Augmentation abstraction to use with data dictionaries.""" def __init__( self, dict_key: str, augment_fn: Callable, input_key: str = None, output_key: str = None, **kwargs, ): """ ...
import FindTag import requests import re def Introduction(): print("欢迎使用本程序 copyright: 刘锦帆 20级 工科班 天津大学") print("本程序满足二次元爱好者收集二次元图片的需求,顺便增加了将图片制成头像的功能") print("首先,通过简单的 Python 爬虫 从[k站](著名二次元图片网站) [https://konachan.net/post] 抓取并下载二次元图片") print("然后,利用 open-CV [https://github.com/nagadomi/lbpcascade_a...
class Hello(object): pass
import os.path import typing import subprocess import base64 from django.conf import settings from django.core.files.storage import default_storage from django.http import HttpResponse from django.urls.base import resolve from django.views.decorators.csrf import csrf_exempt from drf_yasg.openapi import Parameter from d...
from django.apps import AppConfig class WebapiConfig(AppConfig): name = 'webapi'
# Generated by Django 2.2 on 2020-07-20 08:32 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('user', '0003_auto_20200720_1241'), ] operations = [ migrations.AlterField( model_name='customuser', name='national_cod...
""" Module to generate random D&D characters. """ import os import math import random import aigis import fantasyName DEFAULT_PLAYER_NAME = "Dungeon Master" DEFAULT_SAVE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "tmp")) CHAR_ATTR_NAMES = {"strength", "dexterity", "intelligence", "wisdom", "const...
#!/usr/bin/python from bs4 import BeautifulSoup from urllib2 import urlopen from trancesection import app import xml.etree.ElementTree as et from multiprocessing.dummy import Pool as ThreadPool from copy_reg import pickle from types import MethodType from trancesection import db from trancesection.models import Podca...
"""The main entry point into this package when run as a script.""" # For more details, see also # https://docs.python.org/3/library/runpy.html # https://docs.python.org/3/reference/import.html#special-considerations-for-main import os import sys from .something import Something def main(): """Execute the Somet...
#!/usr/bin/env python from __future__ import print_function import json import sys test_list = [] localWorker = False tarball = '../package/target/openmessaging-benchmark-0.0.1-SNAPSHOT-bin.tar.gz' build = False # Run 10kb 100 rate 16 partitions 2min # "workload": { # "consumerBacklogSizeGB": 0, # "consumer...
"""Prediction of Users based on tweet embeddings""" import numpy as np from sklearn.linear_model import LogisticRegression from .models import User from .twitter import vectorize_tweet def predict_user(user0_name, user1_name, hypo_tweet_text): """ Determine and return which user is more likely to say a hypoth...
# -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import os impo...
def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, imp __file__ = pkg_resources.resource_filename(__name__, '_machsignals.cpython-36dm-darwin.so') __loader__ = None; del __bootstrap__, __loader__ imp.load_dynamic(__name__,__file__) __bootstrap__()
import requests, csv from bs4 import BeautifulSoup import pandas as pd import matplotlib as plt def get_html_text(url): ''' 获取html文本 ''' r = requests.get(url, timeout=30) # print('验证码:'r.status_code) return r.text def process_cvs_w_file(filepath, file_list): ''' 把数据写成csv文件 ...
# Configuration for Joe's machines """Copyright (c) 2005-2018, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution...
T=int(input()) while(T>0): T=T-1 i=0 j=0 k=0 l=[] N=int(input()) while(N>0): N=N-1 i=i+1 j=j+1 k=k+1 print(1,i,j,k,flush=True) r=int(input()) l.append(r) print(2,*l,flush=True) s=int(input()) if(s==-1): break
from typing import List, Optional, Union from lnbits.helpers import urlsafe_short_hash from . import db from .models import TPoS async def create_tpos(*, wallet_id: str, name: str, currency: str) -> TPoS: tpos_id = urlsafe_short_hash() await db.execute( """ INSERT INTO tpos.tposs (id, wallet...
# # Paramiko Expect # # Written by Fotis Gimian # http://github.com/fgimian # # This library works with a Paramiko SSH channel to provide native SSH # expect-like handling for servers. The library may be used to interact # with commands like 'configure' or Cisco IOS devices or with interactive # Unix scripts or comman...
#!/usr/bin/env python3 # # Generation of the cbmc-batch.yaml files for the CBMC proofs. # # Copyright (C) 2019 Amazon.com, Inc. or its affiliates. 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")...
from pathlib import Path HOME = Path(__file__).parent.parent DOC = HOME / 'doc' MAN = HOME / 'man/man1'
""" This file offers the methods to automatically retrieve the graph Propionimicrobium sp. BV2F7. The graph is automatically retrieved from the STRING repository. References --------------------- Please cite the following if you use the data: ```bib @article{szklarczyk2019string, title={STRING v11: protein--pr...
import numpy as np import pandas as pd import matplotlib.pyplot as plt import functions as rdd ''' To Do: - Put testing functions in another folder - test different input types, combos of bad items, etc ''' # Set seed np.random.seed(42) # Simulate data N = 10000 # x = np.random.uniform(-.5, .5, N) x = np....
import PySide2.QtCore # Prints PySide2 version # e.g. 5.11.1a1 print(PySide2.__version__) # Gets a tuple with each version component # e.g. (5, 11, 1, 'a', 1) print(PySide2.__version_info__) # Prints the Qt version used to compile PySide2 # e.g. "5.11.2" print(PySide2.QtCore.__version__) # Gets a tuple with each ve...
{"code":0,"message":"0","ttl":1,"data":[{"cid":260839008,"page":1,"from":"vupload","part":"PocketLCD_with_srt","duration":467,"vid":"","weblink":"","dimension":{"width":1920,"height":1080,"rotate":0}}]}
from flow.controllers import FollowerStopper, IDMController, ContinuousRouter, OVMController from flow.core.params import SumoParams, EnvParams, InitialConfig, NetParams from flow.core.params import VehicleParams from flow.envs.ring.accel import AccelEnv, ADDITIONAL_ENV_PARAMS from flow.networks.ring import RingNetwork...
""" Copyright 2013 Steven Diamond 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...
# ============================================================================= # pypar.py - Parallel Python using MPI # Copyright (C) 2001, 2002, 2003 Ole M. Nielsen # (Center for Mathematics and its Applications ANU and APAC) # # This program is free software; you can redistribute it and/or modify # ...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. from testrun import *
#!/usr/bin/env python3 # Copyright (c) 2014-2017 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 wallet import RPCs. Test rescan behavior of importaddress, importpubkey, importprivkey, and impor...
""" Concrete implementations of the Transformation classes for the LagrangePolynomial. Transformations from Lagrange basis to Newton and Canonical basis are provided. """ from minterpy.core.ABC import TransformationABC from minterpy.polynomials import CanonicalPolynomial, NewtonPolynomial from minterpy.polynomials.lag...
# -*- coding: utf-8 -*- import datetime import os import sqlite3 import urllib.parse from bottle import route, request, abort, run, response, redirect, static_file, template, TEMPLATE_PATH import config import model import sys TEMPLATE_PATH.append("./template") @route("/") def welcome_service(): print("config....
import os import sys from csv import reader class FileParser: def __init__(self, file_path): # Load file filename, extension = os.path.splitext(file_path) # Check for correct file format if extension != '.txt': print('Invalid file type, must be .txt with one query per l...
# coding: utf-8 def g(): pass def f(): d1 = {42: 100} d2 = {'abc': 'fob'} d3 = {1e1000: d1} s = set([frozenset([2,3,4])]) class C(object): abc = 42 def f(self): pass cinst = C() class C2(object): abc = 42 def __init__(self): self.oar = 100...
from memcached_clients import RestclientPymemcacheClient import re ONE_MINUTE = 60 ONE_HOUR = 60 * 60 class RestClientsCache(RestclientPymemcacheClient): """ A custom cache implementation for Course Dashboards """ def get_cache_expiration_time(self, service, url, status=200): if "sws" == service: ...
# -*- coding: utf-8 -*- """ """ import rpy2 import pandas as pd class DataFrame(): def __init__(self,r_df): """ import rpy2_utils as ru dfh = ru.robjects.DataFrame(r_df) """ #TODO: Verify data type self.r = r_df def __contains__(self, name): ...
#!/usr/bin/env python3 """ 搭积木 小球相同,格子不同 """ def combination(n, m): r = 1 for i in range(1, m + 1): t = (r * (n - i + 1) // i) % (10 ** 9 + 7) t *= r return r if __name__ == '__main__': n, m = map(int, input().split(' ')) print(combination(m * m + n - 1, n) % (10 ** 9 + 7))
from PyObjCTools.TestSupport import * from Quartz.QuartzCore import * class TestCIFilterShape (TestCase): def testMethods(self): self.assertArgIsBOOL(CIFilterShape.transformBy_interior_, 1) if __name__ == "__main__": main()
"""empty message Revision ID: 577055ed7da4 Revises: 732b6fffe866 Create Date: 2021-08-19 02:09:56.472249 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '577055ed7da4' down_revision = '732b6fffe866' branch_labels = None depends_on = None def upgrade(): # ...
# open.py is used to ... when the open method is invoked in 32-bit mode. import gc import os import sys import time from arm_ds.debugger_v1 import Debugger from arm_ds.debugger_v1 import DebugException import config import memory import mmu # obtain current execution state debugger = Debugger() execution_state = de...
from adminsortable2.admin import SortableInlineAdminMixin from django.contrib import admin from django.db import models from django.utils.encoding import force_text from django.utils.translation import gettext_lazy as _ from django.utils.html import format_html from indicators.models import ( Indicator, IndicatorTy...
# -*- coding: utf-8 -*- import redis import ddtrace from ddtrace import Pin, compat from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY from ddtrace.contrib.redis import get_traced_redis from ddtrace.contrib.redis.patch import patch, unpatch from tests.opentracer.utils import init_tracer from ..config import REDI...