text stringlengths 2 999k |
|---|
from __future__ import absolute_import
import cPickle as pickle
import os
import subprocess
import sys
from .utils import get_command_prefix, get_func_name, get_func
from . import logs
def call_in_fork(func, args=None, kwargs=None):
args = args or ()
kwargs = kwargs or ()
pid = os.fork()
if pi... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch.utils.data as data
import numpy as np
import torch
import json
import cv2
import os
from centernet_utils.image import flip, color_aug
from centernet_utils.image import get_affine_transform, affine_... |
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import render, redirect, get_object_or_404
from django.urls.base import reverse_lazy
from django.views import View
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from autos.models import Auto, Make
# Create your ... |
OPENID_SREG = {
"required": "nickname, email",
"optional": "postcode, country",
"policy_url": ""
}
OPENID_AX = [
{"type_uri": "http://axschema.org/contact/email", "count": 1, "required": True, "alias": "email"},
{"type_uri": "fullname", "count":1 , "required": False, "alias": "fullna... |
import unittest
import pytest
from andrew_is_hungry_for_py.eat import feedme
@pytest.mark.parametrize("input_date,expected", [
("2019-10-31", "Birthday Cake"),
("2019-10-01", "Cake"),
("2019-11-01", "Leftover Birthday Cake"),
("2020-10-31", "Birthday Cake"),
("2020-11-14", "Stale Birthday Cake"),... |
#
# PySNMP MIB module TPT-COMPACT-FLASH-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TPT-COMPACT-FLASH-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:26:16 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (def... |
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def convertBST(self, root: TreeNode) -> TreeNode:
def change(root, val):
if root:
... |
# -*- coding: utf-8 -*-
import asyncio
import os
import signal
import asyncpg
from .App import App, AppData
from .AppConfig import AppConfig, KEY_EXPOSE, KEY_FORWARDS
from .Config import Config
from .Containers import Containers
from .DeploymentLock import DeploymentLock
from .Exceptions import StoryscriptError, TooM... |
input = """
3 6 2 3 4 5 6 7 0 0
1 8 1 0 2
1 9 2 0 6 7
1 10 2 0 6 7
1 11 1 0 5
1 12 1 0 4
1 13 1 0 3
1 8 1 0 13
1 13 1 0 12
1 12 1 0 11
1 11 1 0 10
1 10 1 0 9
1 9 1 0 8
1 1 5 0 9 10 11 12 13
0
2 ex1
10 e
5 ex4
11 d
6 ex5
8 a
7 ex6
12 c
3 ex2
13 b
4 ex3
9 f
0
B+
0
B-
1
0
1
"""
output = """
{ex5}
{ex6}
{}
"""
|
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-07-25 18:20
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0007_merge_20180725_1316'),
]
operations = [
migrations.RemoveField(
... |
import pandas as pd
import numpy as np
from preprocess import Preprocess
import logging
import torch
from torch.utils.data import DataLoader
from torch.utils.data.sampler import SubsetRandomSampler
from hasoc_dataset import HASOCDataset
logging.basicConfig(level=logging.INFO)
"""
For loading HASOC data loading and pre... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 7, transform = "RelativeDifference", sigma = 0.0, exog_count = 0, ar_order = 12); |
from gym import spaces
import multiprocessing.dummy as mp
import multiprocessing
import numpy as np
import os
import torch
import torch
import torch.nn as nn
from torch.nn import Parameter, ModuleList
import torch.nn.functional as F
from evkit.rl.utils import init, init_normc_
from evkit.utils.misc import is_cuda
fr... |
# -*- coding: utf-8 -*-
"""
Dependencies: flask, tornado
"""
import logging
from wbia.control import controller_inject
from wbia.web import appfuncs as appf
import utool as ut
(print, rrr, profile) = ut.inject2(__name__)
logger = logging.getLogger('wbia')
register_route = controller_inject.get_wbia_flask_route(__name... |
from account.models import UserProfile
from django.contrib.auth import get_user_model
from rest_framework import serializers
User = get_user_model()
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ['id', 'username', 'email', 'last_login']
class UserRegisterSe... |
import copy
from tokenize import Token
import re
from django.core import validators
from rest_framework.exceptions import ValidationError
from rest_framework.generics import ListAPIView, CreateAPIView
from rest_framework.response import Response
from members.models import Member, mobile_regex
from members.serializers ... |
from qppwg.models.qppwg import * # NOQA
|
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2016-present MagicStack Inc. and the EdgeDB 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_cli
----------------------------------
Tests for `fip` module.
"""
import pytest
from click.testing import CliRunner
from fip import cli
@pytest.fixture
def response():
"""Sample pytest fixture.
See more at: http://doc.pytest.org/en/latest/fixture.html... |
from surveyapi import api
from flask_script import Manager
from flask_migrate import MigrateCommand,Migrate
from surveyapi.app import create_app
from surveyapi.models import db,Survey,Question,Choice,User
# pip install flask-script
# pip install flask-migrate
app = create_app()
# 创建migrate实例
migrate = Migrate(app,db)
... |
#!/usr/bin/python
# Copyright (c) 2010 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 os
import re
import types
import pyauto_functional # Must be imported before pyauto
import pyauto
class BrowserTest(pyauto.P... |
__all__ = [
'Code',
]
import string, random, re
class Code:
CONTANST = string.ascii_letters + string.digits
# 去除掉不易分辨的字符的随机串
def get_code(self, n):
t_str = ''
length = self.len_constant
for _ in range(n):
t_str += self.easy_constant[random.randint(0, length-1)]
... |
import os
import mock
from OpenSSL import SSL
from mitmproxy import cmdline
from mitmproxy import options
from mitmproxy.proxy import ProxyConfig
from mitmproxy.models.connections import ServerConnection
from mitmproxy.proxy.server import DummyServer, ProxyServer, ConnectionHandler
from mitmproxy.proxy import config
f... |
PERCENT_SAFE = "._-~"
MD5_CHUNK_SIZE = 1000 * 1000 * 5 # 5MB
|
#!/usr/bin/env python
#
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
import numpy as np
import scipy as scp
from scipy.sparse import csr_matrix
from scipy.sparse.linalg import svds
from collections import Counter
from nltk.corpus import stopwords
class Word2Vec(object):
def __init__(self, sentences):
"""
sentences -- preprocessed sentences of reviews
vo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 29 13:11:39 2019
@author: melzanaty
"""
# initiate empty list to hold user input and sum value of zero
user_list = []
list_sum = 0
# seek user input for ten numbers
for i in range(10):
userInput = int(input("Enter any 2-digit number: "))
# che... |
# Generated by Django 3.1.4 on 2021-04-21 13:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('finappservice', '0018_internaltransacthistory_date_created'),
]
operations = [
migrations.CreateModel(
name='Currency',
... |
# Copyright 2015 Red Hat, 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 required by... |
import sys
if sys.version_info.major == 2:
from .six_py2 import (
queue,
configparser,
parse,
)
else:
from .six_py3 import ( # noqa: #401
queue,
configparser,
parse,
)
|
from __future__ import unicode_literals
import frappe, json
from frappe import _
from frappe.model.document import Document
from frappe.utils import get_url
def get_context(context):
context.show_search = True
@frappe.whitelist(allow_guest=True)
def create_student_applicant(first_name, middle_name, last_name, pro... |
from datetime import datetime
from requests_html import HTMLSession
from bs4 import BeautifulSoup
from fake_useragent import UserAgent
UA = UserAgent()
BASE_URL = "https://www.infobase.md/ro/"
class Explorer:
def __init__(self, entity):
self.entity = entity
self.headers = {"User-Agent": UA.chrome,... |
#!/usr/bin/env python
import os
import sys
from djlinkmobile import __version__
from setuptools import setup
# Publish to Pypi
if sys.argv[-1] == "publish":
os.system("python setup.py sdist upload")
sys.exit()
setup(
name='django-linkmobile',
version=__version__,
description='Django application ... |
# coding: utf-8
from dataclasses import dataclass
from datetime import datetime
from typing import List
from transitions import Machine
from .enum import Mark, Direction, Freq, Operate
from .utils.ta import RSQ
@dataclass
class Tick:
symbol: str
name: str = ""
price: float = 0
vol: float = 0
@datacl... |
"""
WSGI config for project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting... |
#!/usr/bin/env python
import sys, time
import numpy as np
from io import StringIO
import pickle as pickle
from pandas import DataFrame
from pandas import concat
from pandas import read_pickle
from pandas import cut
from pandas import concat
from pandas import set_option
from sklearn.externals import joblib... |
# Copyright 2015 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
#
# https://aws.amazon.com/apache2.0/
#
# or in the "license" file accomp... |
# Copyright 2018 Alibaba Cloud 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 required by appli... |
import dataclasses
@dataclasses.dataclass
class AppState:
INT_0: int = 0
INT_1: int = 0
INT_2: int = 0
INT_3: int = 0
FLOAT_0: float = 0.0
FLOAT_1: float = 0.0
FLOAT_2: float = 0.0
FLOAT_3: float = 0.0
BOOL_0: bool = False
BOOL_1: bool = False
BOOL_2: bool = False
BOOL_... |
#!/usr/bin/env python3
import os
import sys
import gzip
self_name = os.path.basename(__file__)
usage_mesg = 'Usage: %s <fasta> <chromosome|scaffold>' % self_name
if len(sys.argv) != 3:
sys.stderr.write('%s\n' % usage_mesg)
sys.exit(1)
filename_fa = sys.argv[1]
seq_type = sys.argv[2]
if not os.access(filenam... |
# 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! ***
from enum import Enum
__all__ = [
'ExternalAccess',
'FilteredSync',
'KerberosArmoring',
'KerberosRc4Encryption',
'Ldaps',
'Not... |
# 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
"""
import pprint
import re # noqa: F401
import six
class InlineRespon... |
#!/usr/bin/python3
import argparse
import json
import requests
import sys
parser = argparse.ArgumentParser()
parser.add_argument("-db", required=True, type=str, help="Database name")
parser.add_argument("-id", required=True, type=str, help="Id to delete")
args = parser.parse_args()
database = args.db
ids_to_delete... |
import itertools
import os
import os.path as osp
import chainer
import numpy as np
import skimage.io
try:
from sklearn.model_selection import train_test_split
except ImportError:
from sklearn.cross_validation import train_test_split
from .base import class_names_apc2016
import instance_occlsegm_lib.data
impor... |
import numpy as np
# irisデータセットの読み込み
# num_train: 学習データ数(残りはテストデータ)
# random: ランダムに抽出するか
def load_iris(num_train=100, random=True):
from sklearn.datasets import load_iris
iris = load_iris()
data = iris.data.astype(np.float32)
label = iris.target.astype(np.int64)
if random:
perm = np.r... |
"""Script to copy avatars in a common folder to be used.
The assumption is that all avatars are in "bot-avatars" and "repo-avatars".
"""
import os
from pathlib import Path
from shutil import copy2
REPO_ROOT = Path(__file__).parent
def copy_avatars(avatar_folder: str):
"""Copy all avatars to the ``avatars`` fol... |
import io
import json
import logging
from vortex.restful.RestfulResource import HTTP_REQUEST
from vortex.restful.RestfulResource import PluginRestfulResource
from twisted.trial import unittest
from twisted.web.test.requesthelper import DummyRequest
from vortex.Tuple import Tuple
from vortex.Tuple import TupleField
fro... |
import unittest
from sopel_openweathermap import utils
class TestInputLocationParsingMethods(unittest.TestCase):
"""
https://docs.python.org/3.8/library/unittest.html#basic-example
"""
def test_geocoordinate_latitude_out_of_bounds(self):
# Test Latitude out of bounds and Longitude in bounds
... |
# © Copyright 2021 HP Development Company, L.P.
import json
import pprint
from re import subn
from utils import SubCrawlColors
from .default_storage import DefaultStorage
class ExampleStorage(DefaultStorage):
cfg = None
logger = None
def __init__(self, config, logger):
self.cfg = config
... |
# This Python file uses the following encoding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import str
from future.utils import python_2_unicode_compatible
import logging
from creagraphenebase.py... |
from __future__ import print_function
from abc import ABCMeta, abstractmethod
from collections import MutableMapping
from threading import RLock
from datetime import datetime, timedelta
from logging import getLogger
import warnings
import sys
from pkg_resources import iter_entry_points
from tzlocal import get_localzo... |
"""
pkasolver.py
toolset for predicting the pka values of small molecules
Handles the primary functions
"""
def canvas(with_attribution=True):
"""
Placeholder function to show example docstring (NumPy format)
Replace this function and doc string for your own project
Parameters
----------
wi... |
from cmaketools import setup
import sys
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
python_version = str(sys.version_info.major) + "." + str(sys.version_info.minor)
print("PYTHON VER... |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
#coding:utf-8
DEBUG = True
DATABASE_TYPE = 'mysql'
DATABASE_NAME = 'watchtips'
DATABASE_USERNAME = 'proj'
DATABASE_PASSWORD = 'XXX'
log_enable = True
log_file = 'log/wtlog.log'
log_tofile = True
log_toprint = True
ssl_enable = True
ssl_certificate_path = 'crtkey/server.crt'
ssl_private_key_path = 'crtkey/server.key... |
import os
import pymates.fonts
from pymates.dom import DocumentNode, ParagNode, StyleNode, SpanNode, MathNode, inline
from pymates.lom import Alignment
def document():
return DocumentNode(document)
def pagesize(size):
return style(pageSize=size)
@inline("counters")
def counter(node, counterFmt, refFmt, *name... |
"""Discrete CNN Q Function."""
import torch
from torch import nn
from garage import InOutSpec
from garage.torch.modules import DiscreteCNNModule
# pytorch v1.6 issue, see https://github.com/pytorch/pytorch/issues/42305
# pylint: disable=abstract-method
class DiscreteCNNQFunction(nn.Module):
"""Discrete CNN Q Fun... |
"""
This python script adds a new gdb command, "dump-guest-memory". It
should be loaded with "source dump-guest-memory.py" at the (gdb)
prompt.
Copyright (C) 2013, Red Hat, Inc.
Authors:
Laszlo Ersek <lersek@redhat.com>
Janosch Frank <frankja@linux.vnet.ibm.com>
This work is licensed under the terms of the GNU... |
# Copyright (c) 2013 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.
{
'variables': {
# This turns on e.g. the filename-based detection of which
# platforms to include source files on (e.g. files ending in
# ... |
# Generated from c:\Users\gina1\Documents\Tec\Compiladores\ANTLRBasics\ginaTarea.g4 by ANTLR 4.9.3
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
from typing import TextIO
else:
from typing.io import TextIO
def serializedATN():
with StringIO() a... |
# Quicksort algorithm by taking last element as pivot
def partitionIndex(arr, l, r):
i = l - 1
pivot = arr[r]
for j in range(l, r):
if arr[j] <= pivot:
i += 1
arr[j], arr[i] = arr[i], arr[j]
arr[i+1], arr[r] = arr[r], arr[i+1]
return (i+1)
def quicks... |
from yunionclient.common import base
class Loadbalanceracl(base.ResourceBase):
pass
class LoadbalanceraclManager(base.StandaloneManager):
resource_class = Loadbalanceracl
keyword = 'loadbalanceracl'
keyword_plural = 'loadbalanceracls'
_columns = ["Id", "Name", "Project", "Is_Public", "Acl_Entries... |
#!/usr/bin/env python
# vim: set fileencoding=utf-8 filetype=python :
"""
Simple wrapper for pg_dump and pg_restore.
http://www.postgresql.org/docs/9.4/static/app-pgrestore.html
"""
from __future__ import unicode_literals
from datetime import datetime
import logging
log = logging.getLogger(__name__)
import os.path
f... |
# Copyright 2020 ByteDance 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 writin... |
import unittest
import logging
from darts import TimeSeries
from darts.utils.timeseries_generation import constant_timeseries
from darts.dataprocessing import Pipeline
from darts.dataprocessing.transformers import (
BaseDataTransformer,
FittableDataTransformer,
InvertibleDataTransformer,
)
from darts.datap... |
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.contrib.syndication import views as syndication_views
from django.core.mail import send_mail
from django.urls import reverse_lazy
from django.http import Http404
from django.shortcuts import get_object_or_404, redir... |
# -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
sys.path.append("../../")
from alpharotate.libs.models.detectors.retinanet import build_whole_network
from tools.test_dota_base import TestDOTA
from configs import... |
from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
from . import mail
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, **kwargs):
app = current_app._get_current_object()
msg = Mess... |
from __future__ import absolute_import, unicode_literals
import os
from django.core.exceptions import ImproperlyConfigured
def get_env(name, default=None):
"""Get the environment variable or return exception"""
if name in os.environ:
return os.environ[name]
if default is not None:
retur... |
#!/usr/bin/python
#
# Copyright 2014 Microsoft 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 applicable... |
## SplashScreen File
## This file contains information about your project
from datetime import date
CurrentYear = date.today().year
SoftwareName = "GetInfo"
Version = "1.0"
CopyrightName = "Heitor"
print("Name:", SoftwareName)
print("Version:", Version)
print("Created By:", CopyrightName)
if CurrentYear == 2021:
... |
import random
from pygame import Color
from pygame.image import load
from pygame.math import Vector2
from pygame.mixer import Sound
def load_sprite(name, with_alpha=True):
path = f"assets/sprites/{name}.png"
loaded_sprite = load(path)
if with_alpha:
return loaded_sprite.convert_alpha()
else:... |
"""Tests for config parsing."""
import hashlib
import typing as t
import itertools
import pathlib
import sys
import pytest
from pypiserver.backend import SimpleFileBackend, BackendProxy
from pypiserver.config import DEFAULTS, Config, RunConfig, UpdateConfig
FILE_DIR = pathlib.Path(__file__).parent.resolve()
# User... |
# Add import from parent directory possible
import sys
import pandas as pd
import numpy
import matplotlib.pyplot as plt
from lib.DataOperations import *
from lib.ReportSignals import *
from lib.Stock import *
from lib.indicator import indicator
# Creates MoneyFlowIndex object
def CreateMoneyFlowIndex(high, low, clos... |
#
# @lc app=leetcode.cn id=543 lang=python3
#
# [543] 二叉树的直径
#
# @lc code=start
# Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def diameterOfBinaryTree(self, root: TreeNode) -> int:
... |
import pytest
from base.client_base import TestcaseBase
from common import common_func as cf
from common import common_type as ct
from utils.util_log import test_log as log
from common.common_type import CaseLabel, CheckTasks
prefix = "delete"
half_nb = ct.default_nb // 2
tmp_nb = 100
tmp_expr = f'{ct.default_int64_f... |
"""
Module to read and write xpedite binary data file
This module provides classes XpediteDataReader and XpediteDataFactory to
read from and write to binary data file respectively.
1. XpediteDataReader - Used to extract records from data file.
2. XpediteDataFactory - Used for writing serialized profile objects
... |
import argparse
import configparser
import glob
import io
import os.path
import re
from typing import Dict
from typing import List
from typing import Match
from typing import Optional
from typing import Sequence
from typing import Set
from typing import Tuple
from identify import identify
KEYS_ORDER: Tuple[Tuple[str... |
# coding: utf-8
"""
API Specification
# Introduction Welcome to gridscales API documentation. A REST API is a programming interface that allows you to access and send data directly to our systems using HTTPS requests, without the need to use a web GUI. All the functionality you are already familiar with in y... |
from argparse import ArgumentParser
# noinspection PyProtectedMember
class CommandParser(ArgumentParser):
def __init__(
self,
name=None,
aliases=None,
py_function=None,
subcommands=None,
short_description=None,
**kwargs
):
... |
# 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
__a... |
# Generated by Django 2.2.6 on 2019-11-25 17:09
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_auto_20191104_2109'),
]
operations = [
migrations.CreateModel(
name='StorySprint',... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云(BlueKing) available.
Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
You may obt... |
import copy
n = int(input())
enter = []
exit = []
uniqenter = set()
for i in range (n):
a , b = map(int,input().split())
if b - a >= 5:
enter.append(a)
exit.append(b)
uniqenter.add(a)
maxsum = 0
arrivetimebest1 = 0
arrivetiemostbest2 = 5
for arrivetime in uniqenter:
watched = set()
... |
import nesmdb.vgm
import nesmdb.score
def seprsco_to_vgm(seprsco):
exprsco = nesmdb.score.seprsco_to_exprsco(seprsco)
rawsco = nesmdb.score.exprsco_to_rawsco(exprsco)
ndf = nesmdb.score.rawsco_to_ndf(rawsco)
ndr = nesmdb.vgm.ndf_to_ndr(ndf)
vgm = nesmdb.vgm.ndr_to_vgm(ndr)
return vgm
def seprsco_to_wav(se... |
from __future__ import division
import numpy as np
import cv2
import os
from sklearn.metrics import auc
import matplotlib.pyplot as plt
def readDataset(dataset_path, ID, Color):
# Get the ID dataset path
frames_path = dataset_path + ID + '/input'
gt_path = dataset_path + ID + '/groundtruth'
# List all... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
from pyfiberamp.helper_funcs import *
from scipy.interpolate import UnivariateSpline
import matplotlib.pyplot as plt
class Spectroscopy:
@classmethod
def from_files(cls, absorption_cross_section_file, emission_cross_section_file, upper_state_lifetime):
absorption_spectrum = load_spectrum(absorption_c... |
"""
datetime.tzinfo timezone definitions generated from the
Olson timezone database:
ftp://elsie.nci.nih.gov/pub/tz*.tar.gz
See the datetime section of the Python Library Reference for information
on how to use these modules.
"""
import sys
import datetime
import os.path
from pytz.exceptions import AmbiguousTim... |
# Replace words in assets
import unreal
import sys
HELP_TEXT = '''
This is an Unreal Python API script which renames assets which contain a specific word,
replacing that word with the word we specify (or with nothing if nothing is specified)
Example Usage:
"C:/Modding/Unreal Scripts/replace-words-in-... |
#!/usr/bin/python
################################################################################
# 211b0e3a-5cc5-11e4-af55-00155d01fe08
#
# Justin Dierking
# justindierking@hardbitsolutions.com
# phnomcobra@gmail.com
#
# 10/24/2014 Original Construction
################################################################... |
# Copyright 2001 Brad Chapman.
# Revisions copyright 2009-2010 by Peter Cock.
# Revisions copyright 2010 by Phillip Garland.
# All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""D... |
# 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)
class AddressLookup... |
__author__ = """JongYoon Lim"""
__email__ = 'jongyoon@apache.org'
__version__ = '0.0.1'
from .face_aligner import FaceAligner, AlignedResult
from .landmarks_type import LandmarksType
from .face_plot import FacePlot
|
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... |
__all__ = []
from . import apps
from .apps import *
__all__.extend(apps.__all__)
__all__.append('apps')
# from . import valence
# from .valence import *
# __all__.extend(valence.__all__)
# __all__.append('valence')
from . import parse
from .parse import *
__all__.extend(parse.__all__)
__all__.append('parse')
from .... |
"""
Spheral Field module.
Provides the Field classes.
"""
from PYB11Generator import *
from SpheralCommon import *
from spheralDimensions import *
dims = spheralDimensions()
from FieldBase import *
from Field import *
from ArithmeticField import *
from MinMaxField import *
#-----------------------------------------... |
from __future__ import unicode_literals
import re
import sys
import types
from django.conf import settings
from django.http import HttpResponse, HttpResponseNotFound
from django.template import Context, Engine, TemplateDoesNotExist
from django.template.defaultfilters import force_escape, pprint
from django.urls impor... |
# import smtplib
import os.path
import cv2 as cv
# import imghdr
# from email.mime.text import MIMEText
# from email.mime.image import MIMEImage
# from email.mime.multipart import MIMEMultipart
# EMAIL_ADDRESS = "opencvmini@gmail.com"
# EMAIL_PASSWORD = "mukemaSS"
# ImgFileName = 'Intruder.jpg'
# path = '... |
# Copyright 2020 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 by applicable law or agreed to... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.