text
stringlengths
1
927k
''' Main module that starts both pytest and coverage.py. ''' import coverage import pytest if __name__ == '__main__': # Start code coverage tracking and erase previous results. cov = coverage.Coverage() cov.erase() cov.start() # Start the pytest runner. #pytest.main(['--maxfail=5', '--durati...
# Generated by Django 2.2.10 on 2020-02-18 10:55 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ("cases", "0004_auto_20200211_1459"), ] operations = [ migrations.AddField( model_name="case", ...
from flask import Blueprint, Response, jsonify, request from flask_cors import CORS #from Fase1.analizer import interpreter from Parser.ui import PantallaPrincipal import simplejson as json qry = Blueprint('qry', __name__) CORS(qry) @qry.route('/exec', methods=['POST']) def exec(): """Ejecuta una consulta y dev...
""" Django settings for Anymail tests. Generated by 'django-admin startproject' using Django 1.8. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths in...
#!/usr/bin/env python3 import sys import os import argparse def read_params(args): parser = argparse.ArgumentParser(description='Convert LEfSe output to ' 'Circlader input') parser.add_argument( 'inp_f', metavar='INPUT_FILE', nargs='?', default=None, typ...
import scipy.ndimage as ndimg import numpy as np from imagepy.core.engine import Filter, Simple from geonumpy.pretreat import degap class GapRepair(Simple): title = 'Gap Repair' note = ['all', 'preview'] para = {'wild':0, 'r':0, 'dark':True, 'every':True, 'slice':False} view = [(float, 'wild', (-65536,...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json DATA_DIR = "data" OUTPUT_DIR = "output/seq2seq" def main(): preds = [] with open("%s/pred.txt" % OUTPUT_DIR) as fr: for line in fr: preds.append(line.strip()) outputs = [] with open("%s/MIMICS-test.txt" % DATA_DIR) as fr: ...
""" ###################################################################################################### # Class of scripts to train the Neural Networks # ##################################################################################################...
# This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from sqlalchemy.event import listens_for from sqlalchemy.ext.decl...
from unittest import TestCase, mock import layers import numpy as np import pytest class TestPoolForward(TestCase): def test_max(self): pool = layers.pool.Pool( size=2, stride=2, operation=np.max, ) data = np.zeros((4, 4, 3)) data[:,:,0] = np....
# # Please note that this file has been modified by Unbound Tech # """ Script used by distutils to automatically generate a source code distribution of this python module (a .tar.gz file containing all of the source code). To generate this file run: python setup.py sdist """ from setuptools import setup import os the...
# Copyright 2018 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import datetime import mock from google.appengine.ext import ndb from components import auth from testing_utils import testing from proto import common_pb...
from django.contrib.auth.models import User from django.db import models from tinymce.models import HTMLField # Create your models here. class Profile(models.Model): profile_photo = models.ImageField('profile/', null = True) bio = models.TextField() user = models.ForeignKey(User) last_update = mod...
# Copyright (c) OpenMMLab. All rights reserved. from mmcv.utils import collect_env as collect_basic_env from mmcv.utils import get_git_hash import mmpose def collect_env(): env_info = collect_basic_env() env_info['MMPose'] = (mmpose.__version__ + '+' + get_git_hash(digits=7)) return env_info if __name_...
# MIT License # # Copyright (C) IBM Corporation 2019 # # 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...
from .maturin_sample import hello __all__ = ["hello"]
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import itertools import logging import math import random import statistics import time f...
# ***************************************************************************** # Copyright (c) 2018, NVIDIA CORPORATION. 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...
#!/usr/bin/env python # Copyright 2009-2017 Wander Lairson Costa # Copyright 2009-2021 PyUSB contributors # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above cop...
from .scanner import Scanner from .tokens import Token, Tokens
import tensorflow as tf from tensorflow import keras import numpy as np layers = tf.keras.layers # Clip model weights to a given hypercube class ClipConstraint(tf.keras.constraints.Constraint): # set clip value when initialized def __init__(self, clip_value): self.clip_value = clip_value # clip ...
import datetime import os import random import string import sys import tempfile import time from contextlib import contextmanager import pendulum import pytest from dagster import ( Any, DagsterEventType, Field, ScheduleDefinition, daily_schedule, hourly_schedule, pipeline, repository,...
import numpy as np import torch import random import matplotlib.pyplot as plt import os __all__ = [ "seed_everything", "AverageMeter", "accuracy", "EarlyStopping", "matplotlib_imshow", "print_size_of_model", ] def seed_everything(seed): """ Makes code deterministic using a given seed....
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# -*- coding: utf8 -*- # cp936 """ 交互模式下绘制相关图形,如K线图,美式K线图 """ from hikyuu import * from .common import get_draw_title from bokeh.plotting import Figure, figure, ColumnDataSource from bokeh.models import DatetimeTickFormatter,HoverTool, Title, Label from bokeh.layouts import column from bokeh.io import output_notebook...
import sqlite3 import pandas as pd conn = sqlite3.connect('demo_data.sqlite3') curs = conn.cursor() create_demo_table = """ CREATE TABLE demo ( s varchar(5), x int, y int );""" curs.execute(create_demo_table) conn.commit() curs.execute("""INSERT INTO demo ( s, x, y) VALUES""" + str(('g', 3, 9))) co...
import logging import json import asyncio.events import socketio from .navigation.point import Point from .state.dungeon_map import DungeonMap from .state.entity import Entities, Entity from .bot import Bot from .iclient import IEntityClient from .state.state import State class EntityClient(IEntityClient): """ ...
#!/usr/bin/env python ''' Advent of Code 2021 - Day 9: Smoke Basin (Part 1) https://adventofcode.com/2021/day/9 ''' import numpy as np class HeightMap(): def __init__(self) -> None: self._grid = np.array([]) def add_row(self, row): np_row = np.array(row) if self._grid.size != 0: ...
def prime_controller(y): for i in range(2,(y//2)+1): if y%i==0: return False return True def find_first_non_prime(x): for i in range(len(x)): if 0==prime_controller(x[i]): return x[i] return False
import os import sys import six import pause import argparse import logging.config import re import time import random import json from selenium import webdriver from dateutil import parser as date_parser from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.c...
# # Copyright 2019 Altran. 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 ...
# -*- coding: utf-8 -*- """ Created on Thu Jan 9 09:22:42 2020 @author: hcji """ import numpy as np import tensorflow.keras.backend as K import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from tensorflow.keras.models import Model from tensorflow.keras.layers import Dense, Input, Fl...
#!/usr/bin/env python """ This script shows how to create a transcription order. To run this script, make sure the ~/.rev_settings file is properly filled. """ import pprint from rev.client import RevClient from rev.models.order_request import Input from rev.models.order_request import TranscriptionOptions from rev....
# Copyright 2013-2020 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 PyNeurom(PythonPackage): """Python library neuron morphology analysis""" homepage = "...
import pathlib from setuptools import setup # The directory containing this file HERE = pathlib.Path(__file__).parent # The text of the README file README = (HERE / "README.md").read_text() # This call to setup() does all the work setup( name="pybinanceapi", version="0.1.3", description="Python Wrapper f...
import numpy as np from peptidesim import PeptideSim, utilities import sys import os import sys import gromacs from shutil import copyfile, move import fire def run(dir_name, seqs): ps = PeptideSim(dir_name, seqs) print(ps.sims_dict.keys()) eds_sim = ps.get_simulation('eds-equil') final_dir = os.path...
""" Collection of MXNet general functions, wrapped to fit Ivy syntax and signature. """ # global import ivy _round = round import logging import mxnet as _mx import numpy as _np import math as _math from numbers import Number from operator import mul as _mul from functools import reduce as _reduce import multiprocessi...
# encoding=utf8 # pylint: disable=mixed-indentation, multiple-statements, attribute-defined-outside-init, logging-not-lazy, no-self-use, line-too-long, singleton-comparison, arguments-differ import logging from numpy import full, apply_along_axis, argmin from NiaPy.algorithms.algorithm import Algorithm logging.basicCo...
import argparse import os def parse_common_args(parser): # 模型的选择 parser.add_argument('--model_type', type=str, default='cotnet50_fcn', help='used in model_entry.py') # 数据集的选择 parser.add_argument('--data_type', type=str, default='cifar_10_without_resize', help='used in data_entry.py') # 体现在名字里面 ...
import json from rest_framework import renderers class ArticleJsonRenderer(renderers.BaseRenderer): """ Renders a list of articles or a single instance of an article """ media_type = 'application/json' format = 'json' charset = 'utf-8' def render(self, data, accepted_media_type=None, ...
import torch, torchvision import os, PIL, random, csv import numpy as np import xml.etree.ElementTree as ET from PIL import Image, ImageDraw from matplotlib import pyplot as plt from torch.utils.data import Dataset from torchvision import transforms from pathlib import Path def compile_imgs(root_dir): """ De...
#!/usr/bin/env python # __BEGIN_LICENSE__ # Copyright (C) 2008-2010 United States Government as represented by # the Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # __END_LICENSE__ import os import sys import imp import re import itertools import subprocess from django.cor...
from context_free_algos.cfg import custom_CFG from utils.graph_utils import read_edges import pygraphblas as pgb def cfpq(edges, gram): n = 0 for edge in edges: n = max(n, edge[0], edge[2]) eps_productions, term_productions, norm_productions = gram.split_productions bool_ms = {} for nter...
import jwt from http.cookies import SimpleCookie from datetime import datetime from _main_.settings import SECRET_KEY from database.models import UserProfile def setupCC(client): client.post('/cc/import', { "Confirm": "Yes", "Actions":"carbon_calculator/content/Actions.csv", ...
import numpy as np import torch def batch(x, y, batch_size=1, shuffle=True): assert len(x) == len( y), "Input and target data must contain same number of elements" if isinstance(x, np.ndarray): x = torch.from_numpy(x).float() if isinstance(y, np.ndarray): y = torch.from_numpy(y).flo...
# -*- coding: ISO-8859-1 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # 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...
from api.server import create_app from api.extensions import sql sql.create_all(app=create_app())
#!/usr/bin/env runaiida # -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
#!/Users/luisrita/PycharmProjects/HyperFoods/venv/bin/python # $Id: rst2latex.py 5905 2009-04-16 12:04:49Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ A minimal front end to the Docutils Publisher, producing LaTeX. """ try: import locale...
""" Validators for the fields given. """ import cgi import io from typing import Dict from mock_vws._query_validators.exceptions import UnknownParameters def validate_extra_fields( request_headers: Dict[str, str], request_body: bytes, ) -> None: """ Validate that the no unknown fields are given. ...
import tensorflow as tf from Chatbot_Model.Question_Pairs_Matching import data_prepare from tensorflow.contrib import learn import numpy as np from Chatbot_Model.Question_Pairs_Matching import esim_model import Chatbot_Model.Question_Pairs_Matching.config as config from tqdm import tqdm from sklearn.metrics import f1_s...
import numpy as np import matplotlib.pyplot as plt # deriv computes 1D derivative, dF/dr, using central difference method def deriv(F,r): # get the length of array F (assume same length for r) L = F.size # create empty array to store results result= np.empty(L) # use central diff method for all interi...
from datetime import timedelta import numpy as np from pandas.core.groupby import BinGrouper, CustomGrouper from pandas.tseries.frequencies import to_offset, is_subperiod, is_superperiod from pandas.tseries.index import DatetimeIndex, date_range from pandas.tseries.offsets import DateOffset from pandas.tseries.period...
# 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 from ... import _utilities, _tables from...
# Copyright (c) 2020, Huawei Technologies.All rights reserved. # # Licensed under the BSD 3-Clause License (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://opensource.org/licenses/BSD-3-Clause # # Unless required by applicable law...
# orm/interfaces.py # Copyright (C) 2005-2020 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Contains various base classes used throughout the ORM. Defines some key base...
# Driver control input from keyboard from threading import Thread from typing import Tuple import pygame from src.l2race_utils import my_logger from src.globals import * from tkinter import * logger = my_logger(__name__) from src.car_command import car_command from src.user_input import user_input def show_help(): ...
#%% from kdg.utils import generate_spirals, generate_gaussian_parity from kdg import kdf,kdn from keras import layers import keras # %% network = keras.Sequential() #network.add(layers.Dense(2, activation="relu", input_shape=(2))) network.add(layers.Dense(3, activation='relu', input_shape=(2,))) network.add(layers.Dens...
"""The models subpackage contains definitions for the following model for CIFAR10/CIFAR100 architectures: - `AlexNet`_ - `VGG`_ - `ResNet`_ - `SqueezeNet`_ - `DenseNet`_ You can construct a model with random weights by calling its constructor: .. code:: python import torchvision.models as models resnet...
# -*- coding: utf-8 - # # 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 ...
from .chado import loadFromChado from .gff import loadFromGFF from .redisearch import RediSearchLoader
# -*- coding: utf-8 -*- # -------------------------------------------------------------------------- # Copyright Commvault Systems, 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 # # ...
"""Meta Table Revision ID: 7bd1ee1840ca Revises: 9ca5901af374 Create Date: 2020-01-30 01:13:40.069188 """ from alembic import op import sqlalchemy as sa import app.model_types # revision identifiers, used by Alembic. revision = '7bd1ee1840ca' down_revision = '9ca5901af374' branch_labels = None depends_on = None d...
# coding: utf-8 import re import six from huaweicloudsdkcore.sdk_response import SdkResponse from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization class ListFlavorsResponse(SdkResponse): """ Attributes: openapi_types (dict): The key is attribute name ...
from hive.server.condenser_api.methods import _get_account_reputations_impl from hive.server.common.helpers import return_error_info @return_error_info async def get_account_reputations(context, account_lower_bound: str = '', limit: int = 1000): db = context['db'] return await _get_account_reputations_impl(db,...
from datetime import datetime, timedelta from pytz import timezone import time #=============================================================================================================================# UTC = timezone("UTC") JST = timezone("Asia/Tokyo") PDT = timezone("US/Pacific") def now(tzinfo = UTC) -> datet...
""" This is the unit test suite for the recipes endpoint """ import json from app.helpers import _clean_name from .test_auth import BaseTestCase from .helpers import register_user, login_user, test_category, test_recipe, test_recipe_update,\ invalid_recipe # Linting exceptions # pylint: disable=C0...
# Input parameters for Ti64 # data drive. import os drive = "/mnt/iusers01/jf01/mbcx9cd4/rds_lightform/" # properties of the data files. datafile_directory = drive + 'SXRD_raw_data/desy_2021/diffraction_images/Def_04' datafile_Basename = "Ti64_Rolled_ND_Compress_910C_1-00s-1_Multi-Hit_Temp_Cycl_4Cs-1_810_Cool_4Cs-1...
from django.urls import path from rest_framework.routers import DefaultRouter from main_api.views import ( AboutViews, SkillsViews, EducationsViews, ExperienceViews, RecommendationViews, InterestedViews, ClientsViews, ArticleViews ) router = DefaultRouter() router.register('about', AboutViews, base_name='about') ...
# Copyright 2018-2022 Streamlit Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
#!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from collections import defaultdict, OrderedDict from io import StringIO import io import os import sys import datetime import argparse import nump...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'AnswerTranslation.active' db.add_column('website_answertranslation', 'active', self.gf('dj...
# coding: utf-8 """ Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: v1.18.20 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six f...
# --------------------------------------------------------------------------- # # ResNet, CVPR2016 bestpaper, https://arxiv.org/abs/1512.03385 # pytorch implementation by Haiyang Liu (haiyangliu1997@gmail.com) # --------------------------------------------------------------------------- # import torch import torch.nn...
from surrogate import surrogate __all__ = ('surrogate', 'VERSION') VERSION = '0.1' AUTHOR = 'Kostia Balitsky aka ikostia'
#!/usr/bin/env python # # index_concepts.py # José Devezas <joseluisdevezas@gmail.com> # 2020-06-12 import argparse import csv import glob import operator import os import re import sys import tempfile from collections import defaultdict from itertools import chain from shutil import copy2, copytree import ahocorasic...
import numpy as np import cv2 img=np.zeros((512,512,3),np.uint8) cv2.line(img,(0,0),(511,511),(255,0,0),5) cv2.rectangle(img,(384,0),(510,218),(0,255,0),3) cv2.circle(img,(447,63),63,(0,0,255),9) cv2.ellipse(img,(256,256),(100,50),0,0,180,255,-1) pts = np.array([[10,5],[20,30],[70,20],[50,10]], np.int32) pts = pts.resh...
""" Original code from active state recipe 'Colorize Python source using the built-in tokenizer' ---------------------------------------------------------------------------- MoinMoin - Python Source Parser This code is part of MoinMoin (http://moin.sourceforge.net/) and converts Python source code to H...
from numpy import * import matplotlib.pyplot as plt from io import BytesIO data_am15 = open("AM15G.dat",'r', encoding='utf-8') # solar spectrum data_alpha = open("absorption.dat", 'r',encoding='utf-8') #光吸收系数 Eg = 1.40 #带隙,单位eV L = 3 #输入厚度,单位为μm f = 1 ...
#!/usr/bin/env python3 # SPDX-FileCopyrightText: 2020 Nathaniel Fitzenrider <https://github.com/nfitzen> # # SPDX-License-Identifier: CC0-1.0 import re with open('input.txt') as f: data = f.readlines() conv = {} for s in data: key = re.match(r'(.+) bags contain ', s).group(1) values = re.findall(r'\d+ (...
from unittest import TestCase from os.path import dirname, join import json from pytezos.michelson.micheline import get_script_section from pytezos.michelson.types.base import MichelsonType from pytezos.michelson.program import MichelsonProgram from pytezos.michelson.format import micheline_to_michelson from pytezos.m...
import keras import tensorflow as tf from .models.all_models import model_from_name def model_from_checkpoint_path(model_config, latest_weights): model = model_from_name[model_config['model_class']]( model_config['n_classes'], input_height=model_config['input_height'], input_width=model_config['i...
import os from framework.util.log import Log from framework.util.xml import Xml from framework.util.email import Email from framework.util.config import Config from framework.runner.unittest_runner import UnitTestRunner from framework.runner.pytest_runner import PyTestRunner if __name__ == "__main__": Log.d(Xml.ge...
# # @lc app=leetcode id=456 lang=python3 # # [456] 132 Pattern # # https://leetcode.com/problems/132-pattern/description/ # # algorithms # Medium (28.88%) # Likes: 1408 # Dislikes: 91 # Total Accepted: 56.2K # Total Submissions: 194.4K # Testcase Example: '[1,2,3,4]' # # # Given a sequence of n integers a1, a2,...
#!/usr/bin/env python import os from os.path import dirname from os.path import join import time import subprocess filename = 'lasso_dim100000000_s1000000_nnz5.transx100.libsvm.trans.X' filenameY = 'lasso_dim100000000_s1000000_nnz5.transx100.libsvm.trans.Y' #filename = 'lasso_dim1000000000_s10000000_nnz5.transx100.li...
import elasticsearch import curator import os import json import string, random, tempfile import click from click import testing as clicktest from mock import patch, Mock from . import CuratorTestCase from . import testvars as testvars import logging logger = logging.getLogger(__name__) host, port = os.environ.get('...
import argparse from ast import literal_eval from astropy.io import fits from astropy.visualization import ( AsymmetricPercentileInterval, LinearStretch, LogStretch, ImageNormalize, ) import base64 from bson.json_util import loads import confluent_kafka from copy import deepcopy import dask.distributed ...
from django.db import models # Create your models here. class commands(models.Model): title = models.CharField('命令标题', max_length=300) command = models.CharField('命令', max_length=2000) describe = models.CharField('命令描述', max_length=300) created_time = models.DateTimeField('创建时间', auto_now_add=True) ...
# -*- 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.base.exchange import Exchange import hashlib from ccxt.base.precise import Precise class bl3p(Exchange): def describe(self...
from django.shortcuts import render, redirect from django.contrib import messages from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm from django.contrib.auth.decorators import login_required def register(request): if request.method == "POST": form = UserRegisterForm(request.POST) ...
# Copyright 2012 OpenStack Foundation # 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 requ...
the_count = [1, 2, 3, 4, 5] fruits = ['apples', 'oranges', 'pears', 'apricots'] change = [1, 'pennies', 2, 'dimes', 3, 'quarters'] for number in the_count: print(f'This is count {number}') for i in change: print(f'I got {i}') elements = [] for i in range(0, 6): print(f'Adding {i} to the list') elements.appe...
import os import re import codecs from setuptools import setup, find_packages current_path = os.path.abspath(os.path.dirname(__file__)) def read_file(*parts): with codecs.open(os.path.join(current_path, *parts), 'r', 'utf8') as reader: return reader.read() def get_requirements(*parts): with codecs....
from itertools import product from string import ascii_uppercase class SpreadsheetColumn: def getLabel(self, column): if column < 27: return ascii_uppercase[column-1] for c, w in enumerate(product(ascii_uppercase, repeat=2), 27): if c == column: return ''.jo...
"""Some tests for the wildcard utilities.""" #----------------------------------------------------------------------------- # Library imports #----------------------------------------------------------------------------- # Stdlib import unittest # Our own from yap_ipython.utils import wildcard #---------------------...
# Copyright (c) 2012 NTT DOCOMO, INC. # 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 requ...
from .two_stage import TwoStageDetectorRbbox from ...builder import DETECTORS @DETECTORS.register_module() class RoITransformer(TwoStageDetectorRbbox): def __init__(self, backbone, neck=None, rpn_head=None, roi_head=None, train_...
# -*- coding: utf-8 -*- import os from v2c.message import info def list_files(dirs, print_filelist=False): info('Creating file list in ' + str(len(dirs)) + ' directories...') entries = set() for d in dirs: entries.update(__get_filelist_recursive(d)) entries_sorted = sorted(entries) if pri...
from django.test import TestCase from rest_framework.test import APIClient from dcf_test_app.models import Product from dcf_test_app.models import Brand from django.contrib.auth.models import User from django_client_framework import permissions as p class PostPerms(TestCase): def setUp(self): self.user = ...
import datetime import gzip import io import json import os import shutil import ssl import time import unittest import uuid from io import BytesIO from urllib.parse import parse_qs, quote import boto3 import requests from botocore.client import Config from botocore.exceptions import ClientError from pytz import timez...