text stringlengths 2 999k |
|---|
#Check if cython code has been compiled
import os
import subprocess
use_extrapolation=False #experimental correlation code
if use_extrapolation:
print("Importing AfterImage Cython Library")
if not os.path.isfile("AfterImage.c"): #has not yet been compiled, so try to do so...
cmd = "python setup.py bui... |
from django.apps import AppConfig
class ProfilebyjimmyConfig(AppConfig):
name = 'profilebyjimmy'
|
# 裁剪视频
import os
from cv2 import cv2
import math
def read_video():
"""
获取到输入的视频路径,并建立保存的路径。
:return:
"""
#video_path = input(r'请输入视频的路径[eg:D:\Video\66.mp4]:')
video_path='./测试.flv'
all_info = video_path.split('/')
file_name = all_info[-1].split('.')[0]
save_path = '/'.join(all_inf... |
from sys import argv
MORSE_CODE_DICT = {'A': '.-', 'B': '-...', 'C': '-.-.', 'D': '-..', 'E': '.',
'F': '..-.', 'G': '--.', 'H': '....', 'I': '..', 'J': '.---',
'K': '-.-', 'L': '.-..', 'M': '--', 'N': '-.', 'O': '---',
'P': '.--.', 'Q': '--.-', 'R': '.-.', 'S'... |
from .to_jsonic import ToJsonicConverter, ToJsonicConverterError, from_json # noqa
|
"""
Split a PDF file into multiple files
"""
import argparse
import os
import sys
from typing import List, NamedTuple
from csv import DictReader
from pathlib import Path
from PyPDF3 import PdfFileWriter, PdfFileReader
Chapter = NamedTuple('Chapter',
[
('name', str),
... |
from panda3d.core import *
from direct.distributed import DistributedObject
from direct.directnotify import DirectNotifyGlobal
from otp.otpbase import OTPGlobals
class FriendManager(DistributedObject.DistributedObject):
notify = DirectNotifyGlobal.directNotify.newCategory('FriendManager')
neverDisable = 1
... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2020 Fetch.AI 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 ... |
import nltk #Import Natural Language tool Kit library
from nltk.stem import WordNetLemmatizer #Converts words to their root words Ex: Believing to Belief
lemmatizer = WordNetLemmatizer()
import json
import pickle
import numpy as np
from keras import *
from keras.models import Sequential # plain stack of layers where e... |
class Defuzzy:
@staticmethod
def centroid(fuzzy):
a = sum([x * fuzzy.function(x) for x in fuzzy.domain])
b = sum([fuzzy.function(x) for x in fuzzy.domain])
return a/b
#Todo
@staticmethod
def bisectriz(fuzzy):
area = 0
image = [fuzzy.function(x) for x in fu... |
"""This module implements functions related to the usage of AWS Sagemaker"""
import json
import logging
import time
import sagemaker
from sagemaker import ModelPackage
logger = logging.getLogger(__name__)
class ModelPackageArnProvider:
"""This class provides ARNs to SSD and YOLOv3 models for different regions... |
# -*- coding: utf-8 -*-
import time
import logging
from tic_toc import Timer
log_fmt = '[%(asctime)s:%(msecs)04d] - %(name)s - %(levelname)s - %(message)s'
datefmt = '%Y-%m-%d %H:%M:%S'
logging.basicConfig(format=log_fmt, datefmt=datefmt, level=logging.INFO)
log = logging.getLogger('asyncio')
with Timer('NAME', to... |
# qubit number=5
# total number=41
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += H(0) # number=3
pr... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
"""
Client Example: Count Objects
--------------------------------------------------------------------
Count all available Something objects connecting to simple-example app
"""
from typing import Optional, List
from base64 import b64decode
from hopeit.app.api import event_api
from hopeit.app.context import EventConte... |
from typing import Tuple
import pygame
from pygame_gui import UIManager
import pygame_gui
from pygame_gui.elements.ui_window import UIWindow
from pygame_gui.elements.ui_text_box import UITextBox
from talktown.person.person import Person
from talktown.place import Building
class CharacterInfoWindow(UIWindow):
"""
... |
'''
XlPy/matched/Proteome_Discoverer/base
_____________________________________
Inheritable objects with methods to calculate Proteome Discoverer
peptide ID formulas PPMs, and standardize the peptide sequences
(use of mixed case).
:copyright: (c) 2015 The Regents of the University of Californi... |
'''
/django_api/Cas/models.py
-------------------------
Model of Cas
'''
from django.db import models
from django.utils import timezone
# Cas model
class Cas(models.Model):
# Account
username = models.CharField(max_length=100, default='None')
# PWD
password = models.TextField()
# Role
role = ... |
from flask_sqlalchemy import SQLAlchemy
import inspect
import traceback
db_functions = []
def db_function(name):
"""
Use as decorator, append f to db_functions.
"""
def d(f):
def w(*args, **kwargs):
try:
return f(*args, **kwargs)
except:
... |
from .did_doc_alice import (
DID_DOC_ALICE_WITH_NO_SECRETS,
DID_DOC_ALICE_SPEC_TEST_VECTORS,
)
from .did_doc_bob import DID_DOC_BOB_SPEC_TEST_VECTORS, DID_DOC_BOB_WITH_NO_SECRETS
from .did_doc_charlie import DID_DOC_CHARLIE
from .did_doc_mediator1 import DID_DOC_MEDIATOR1
from .did_doc_mediator2 import DID_DOC_... |
# -*- coding: utf-8 -*-
""" Sahana Eden Setup Model:
* Installation of a Deployment
* Configuration of a Deployment
* Managing a Deployment (Start/Stop/Clean instances)
* Monitoring of a Deployment
* Upgrading a Deployment (tbc)
@copyright: 2015-2020 (c) Sahana Software Fou... |
#!/usr/bin/env python
from os.path import dirname, abspath
import sys
from django.conf import settings
if not settings.configured:
settings_dict = dict(
INSTALLED_APPS=["filepages", ],
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
},
... |
# Copyright (c) 2018, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.setup.doctype.company.company import install_country_fixtures
def execute():
frappe.reload_doc('regional', 'report', 'fichier_des_ecritures_compta... |
import random
import numpy as np
# A modification of Detective. Instead of using Tit for Tat when the opponent betrays you it uses the much more agressive Forgiving Tit for Tat which will only forgive you when you are nice for two consecutive turns
#
# Better DETECTIVE: First: I analyze you. I start:
# Cooperate, Def... |
# Copyright 2013-present Barefoot Networks, 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 agre... |
# -*- coding: utf-8 -*-
import six
from ecl.tests.functional import base
class TestExtension(base.BaseFunctionalTest):
def test_list(self):
sots = self.conn.block_store.extensions()
self.assertGreaterEqual(len(sots), 0)
|
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 11 21:31:58 2020
@author: hexx
"""
# -*- coding: utf-8 -*-
"""
Created on Sat May 9 18:19:50 2020
@author: hexx
"""
import pandas as pd
import numpy as np
import os
from scipy.optimize import minimize, Bounds
from myFunctions import def_add_datashi... |
#
# Copyright(c) 2019-2021 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
from ctypes import c_void_p, CFUNCTYPE, Structure, c_int
from .shared import SharedOcfObject
class CleanerOps(Structure):
INIT = CFUNCTYPE(c_int, c_void_p)
KICK = CFUNCTYPE(None, c_void_p)
STOP = CFUNCTYPE(None, c_void... |
INPUT_FEEDBACK = 0
INPUT_BROADCAST_MESSAGE = 1
INPUT_DIRECT_MESSAGE = 2
INPUT_USER_CRITERIA = 3
|
import socket
import random
import time
HOST = '127.0.0.1'
PORT = 9999
sender_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sender_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sender_socket.bind((HOST, PORT))
sender_socket.listen()
m = 3
size = (m ** 2) - 1
def send(sender, addr):
... |
'Accumulate the ELBO from a list of utterances given from "stdin"'
import argparse
import pickle
import sys
import numpy as np
import beer
def setup(parser):
parser.add_argument('-a', '--alis', help='alignment graphs in a "npz" '
'archive')
parser.add_argument(... |
from circuit import *
from dec_base import *
import z3
import time
class pwrdipObj(dipObj):
def __init__(self):
super().__init__()
self.flips = []
self.pwrsig = -1
return
class CirDecryptSca(CirDecrypt):
def __init__(self, enc_cir, corrkey):
super().__init__(None, enc_... |
import sys
import logging
import argparse
from materials_commons.api import get_all_projects
from ..utils.LoggingHelper import LoggingHelper
from ..internal_etl.BuildProjectExperimentWithETL import BuildProjectExperiment
def main(project, user_id, apikey, excel_file_path, data_dir_path):
main_log = logging.getL... |
# Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
"""
DriverFactory class
NOTE: Change this class as you add support for:
1. SauceLabs/BrowserStack
2. More browsers like Opera
"""
import dotenv,os,sys,requests,json
from datetime import datetime
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabil... |
from __future__ import absolute_import
import mock
import pytest
from detect_secrets.plugins.core import initialize
from detect_secrets.plugins.high_entropy_strings import Base64HighEntropyString
from detect_secrets.plugins.high_entropy_strings import HexHighEntropyString
class TestFromPluginClassname(object):
... |
import re, sys
from rpython.jit.metainterp.resoperation import opname
from rpython.jit.tool.oparser import OpParser
from rpython.tool.logparser import parse_log_file, extract_category
from copy import copy
def parse_code_data(arg):
name = None
lineno = 0
filename = None
bytecode_no = 0
bytecode_na... |
import matplotlib.pyplot as plt
if __name__ == '__main__':
data_x = [-2, -1, 0, 1, 2.5, 3.5, 4, 5, 6, 7]
data_y = [202.5, 122.5, 62.5, 22.5, 0, 10.0, 22.5, 62.5, 122.5, 202.5]
data_der = [-45, -35, -25, -15, 0, 10, 15, 25, 35, 45]
for x, y, d in zip(data_x, data_y, data_der):
plt.plot(x, y, marker='x', color='... |
"""
Train an m2vae model.
"""
import os
import sys
from collections import defaultdict
import contextlib
from itertools import combinations
import torch
import numpy as np
from tqdm import tqdm
import pretty_midi
import data
import mvae
import models
import util
import io_util
import wrappers
import logging
loggi... |
#!/usr/bin/env python
"""
This file is part of the package FUNtoFEM for coupled aeroelastic simulation
and design optimization.
Copyright (C) 2015 Georgia Tech Research Corporation.
Additional copyright (C) 2015 Kevin Jacobson, Jan Kiviaho and Graeme Kennedy.
All rights reserved.
FUNtoFEM is licensed under the Apache... |
import pygame,sys
import libtcodpy as libtcod
#game fi#les
import constants
#
#( ____ \\__ __/( ____ )|\ /|( ____ \\__ __/
#| ( \/ ) ( | ( )|| ) ( || ( \/ ) (
#| (_____ | | | (____)|| | | || | | |
#(_____ ) | | | __)| | | || | | |
# ) | | | | (\ ... |
# coding=utf8
#
# (c) Simon Marlow 2002
#
import io
import shutil
import os
import re
import traceback
import time
import datetime
import copy
import glob
import sys
from math import ceil, trunc
from pathlib import PurePath
import collections
import subprocess
from testglobals import config, ghc_env, default_testopts... |
from Analisis_Ascendente.Instrucciones.instruccion import Instruccion
import Analisis_Ascendente.Tabla_simbolos.TablaSimbolos as TS
import C3D.GeneradorTemporales as GeneradorTemporales
import Analisis_Ascendente.reportes.Reportes as Reportes
class CasePL(Instruccion):
''' #1 Case search
#2 Case '''... |
# Using Tensorflow 2.x
# Make sure to use the latest version of Tensorflow
# Using Tensorflow 2.x
import tensorflow as tf
from tensorflow.keras.preprocessing.image import ImageDataGenerator
model = tf.keras.Sequential([
tf.keras.layers.Conv2D(64, (2, 2), input_shape=(64, 64, 3)),
tf.keras.layers.Conv2D(64, (... |
# -*- coding: utf-8 -*-
""""Windows Registry plugin for SAM Users Account information."""
from dfdatetime import filetime as dfdatetime_filetime
from plaso.containers import events
from plaso.containers import time_events
from plaso.lib import definitions
from plaso.lib import errors
from plaso.parsers import winreg_... |
import json
import os
import procrunner
def test_export_mosflm(dials_regression, tmpdir):
dials_regression_escaped = json.dumps(dials_regression).strip('"')
with open(
os.path.join(dials_regression, "experiment_test_data/experiment_1.json")
) as fi:
with (tmpdir / "experiments.json").open... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 Red Hat, Inc.
#
# 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, mo... |
# -*- coding: utf-8 -*-
"""
Utilities for the CLI functions.
"""
import re
import click
import json
from .instance import import_module
from ..interfaces.base import InputMultiPath, traits
from ..interfaces.base.support import get_trait_desc
# different context options
CONTEXT_SETTINGS = dict(help_option_names=['-... |
#
# PySNMP MIB module HP-ICF-DHCPv6-RELAY (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HP-ICF-DHCPv6-RELAY
# Produced by pysmi-0.3.4 at Mon Apr 29 19:21:12 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default... |
from PyQt5 import QtTest
from Functions import WatchStoriesAction
from random import randint
from PyQt5.QtCore import QThread
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
def watchStoriesFromAccount(browser, targetAccount, TargetAmount):
pageMove... |
################################################################################
# BSD LICENSE
#
# Copyright(c) 2019-2020 Intel Corporation. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condit... |
# -*- coding: utf-8 -*-
'''
Copyright (C) 2012-2018 Diego Torres Milano
Created on Jan 5, 2015
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
Un... |
# Copyright (c) 2010 Doug Hellmann. All rights reserved.
#
"""Find email addresses that match the person's name
"""
# end_pymotw_header
import re
address = re.compile(
"""
# The regular name
(?P<first_name>\w+)
\s+
(([\w.]+)\s+)? # optional middle name or initial
(?P<last_name>\w+)
... |
# coding=utf-8
# Copyright 2020 The TensorFlow Datasets 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 appl... |
import asyncio
import logging
import os
from cryptoxlib.CryptoXLib import CryptoXLib
from cryptoxlib.Pair import Pair
from cryptoxlib.clients.bitvavo import enums
from cryptoxlib.clients.bitvavo.exceptions import BitvavoException
LOG = logging.getLogger("cryptoxlib")
LOG.setLevel(logging.DEBUG)
LOG.addHandler(logging... |
# -*- coding: utf-8 -*-
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2018 The Electrum developers
#
# 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,
# includi... |
import datetime as dt
from paraview import servermanager
from paraview.simple import *
from paraview.benchmark import *
#import logbase, logparser
logbase.maximize_logs()
records = []
n0 = dt.datetime.now()
def get_render_view(size):
'''Similar to GetRenderView except if a new view is created, it's
created wi... |
from csv_address_expander import CsvAddressExpander
def test_expand_row():
row = {"address": "61 Wellfield Rd. R. Cardiff", "country": "Wales"}
other_fields = ["country"]
expanded_rows = CsvAddressExpander.expand_row(row, other_fields)
expanded_rows = sorted(expanded_rows, key=lambda row: row["normali... |
import sys
try:
from .tabcmd import main
except ImportError:
print("Tabcmd needs to be run as a module, it cannot be run as a script")
print("Try running python -m tabcmd")
sys.exit(1)
if __name__ == "__main__":
main()
|
"""
Base Django settings
====================
For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
import os
import pathlib
from django.urls import... |
"""Tools for setting up interactive sessions. """
from sympy.interactive.printing import init_printing
preexec_source = """\
from __future__ import division
from sympy import *
x, y, z, t = symbols('x y z t')
k, m, n = symbols('k m n', integer=True)
f, g, h = symbols('f g h', cls=Function)
"""
verbose_message = """\... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, division, print_function, absolute_import
import logging
import sys
from contextlib import contextmanager
import base64
import datetime
from cryptography.fernet import Fernet
from ..compat import *
from ..exception import InterfaceError
logger = loggi... |
import time
from . import serial_connection
class StepperMotorDriver(object):
"""
Controls stepper motors.
"""
DEVICE_IDENTIFIER = "SMD"
def __init__(self, device_path: str = ""):
if device_path == "":
device_path = (
serial_connection.search_for_serial_devic... |
from __future__ import print_function
import json
import sys
import irods_six
try:
import jsonschema
except ImportError:
pass
try:
import requests
except ImportError:
pass
class ValidationError(Exception):
pass
class ValidationWarning(Warning):
pass
def load_and_validate(config_file, schema... |
from typing import Dict
import blspy
from venidium.full_node.bundle_tools import simple_solution_generator
from venidium.types.blockchain_format.coin import Coin
from venidium.types.blockchain_format.program import Program
from venidium.types.coin_spend import CoinSpend
from venidium.types.condition_opcodes import Co... |
"""STTP package root."""
from . import errors
from . import ext
from . import subst
from . import pkg_meta
from . import core
from .parser import Parser
__version__ = pkg_meta.version
__all__ = [
'Parser',
'errors',
'ext',
'subst',
'pkg_meta',
'core',
]
|
import numpy as np
import torch
import torch.utils.data as data
import data.util as util
class LQ_Dataset(data.Dataset):
'''Read LQ images only in the test phase.'''
def __init__(self, opt):
super(LQ_Dataset, self).__init__()
self.opt = opt
self.paths_LQ = None
self.LQ_env = N... |
#!/usr/bin/env python
"""
Parse the NCES Data File Format Data files. Either return a list/dict of items
from the Date Files or cache back as reduced set of the data into much smaller
data files.
Can be run from the command line to pre-filter the NCES raw data into a reduced dataset
to speed up run time. This can a... |
from typing import Optional
from hypothesis import given
from tests.base_test_case import BaseTestCase
from electionguard.constants import (
get_small_prime,
get_large_prime,
get_generator,
get_cofactor,
)
from electionguard.group import (
ElementModP,
ElementModQ,
a_minus_b_q,
mult_i... |
from output.models.nist_data.list_pkg.time.schema_instance.nistschema_sv_iv_list_time_length_2_xsd.nistschema_sv_iv_list_time_length_2 import NistschemaSvIvListTimeLength2
__all__ = [
"NistschemaSvIvListTimeLength2",
]
|
import numpy as np
from pybrain.tools.shortcuts import buildNetwork
import pygame
class CoopGame(object):
""" Class that runs and renders the game """
window = None
DIM = (600, 600)
FPS = 24
DT = 1.0/FPS
players = []
bullets = []
def __init__(self, render=False, max_moves=200):
... |
# Copyright (c) 2009 Google Inc. 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': 'subdir_file',
'type': 'none',
'msvs_cygwin_shell': 0,
'actions': [
{
'action_name'... |
from itertools import permutations
from operator import (
add,
ge,
gt,
le,
lt,
methodcaller,
mul,
ne,
)
from unittest import TestCase
import numpy
from numpy import (
arange,
array,
eye,
float64,
full,
isnan,
zeros,
)
from pandas import (
DataFrame,
d... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# pook documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 4 18:59:54 2016.
#
# 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
# autog... |
# Copyright 2020 The SQLFlow 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 applicable law o... |
# Copyright 2014 Diamond Light Source 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 t... |
import numpy as np
import os
import path_config
from datasets.data import Sequence, BaseDataset, SequenceList
def GOT10KDatasetTest():
""" GOT-10k official test set"""
return GOT10KDatasetClass("test").get_sequence_list()
def GOT10KDatasetVal():
""" GOT-10k official val set"""
return GOT10KDatasetCl... |
#
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# 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, pu... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
from typing import Callable, List, Optional
import torch
from fairseq import utils
from fairseq.data.indexed_dataset import g... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-25 16:19
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from main import main
main(revisions=["issue583-v1", "issue583-v2"])
|
# coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
"""
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.1.15.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Bu... |
"""
.. module:: dataset
:synopsis: dataset for sequence labeling
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
import sys
import pickle
import random
import functools
import itertools
from tqdm import tqdm
class SeqDataset(object):
"""
Dataset for Sequence Labeling
Par... |
# Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
try:
from ez_setup import use_setuptools
use_setuptools()
except:
pass
from setuptools import setup
try:
import six
py3 = six.PY3
except:
py3 = sys.version_info[0] >= 3
# metadata
import re
_version_re = re.compile(r'__version__\s*=\s... |
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# 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, publ... |
# Gumowski-Mira Strange Attractor
# http://en.wikipedia.org/wiki/Attractor
# FB - 201012072
import random
from PIL import Image
imgx = 800
imgy = 600
maxIt = 50000 # number of pixels to draw
# drawing area (xa < xb and ya < yb)
xa = -20.0
xb = 20.0
ya = -20.0
yb = 20.0
def f(x):
return a * x + 2.0 * (1.0 - a) * x... |
KWARGS_MANAGER_SECRET = 'FXV/#X=>fMT,pc-wm3BYaxqoZ7VOA+'
class KwargsManager:
def purify(self, **kwargs):
_dict = {}
for key, value in kwargs.items():
if value is not KWARGS_MANAGER_SECRET:
_dict[key] = value
return _dict
def build(self, _dict, data, data_... |
from __future__ import print_function, unicode_literals
import importlib
import os
import sys
from django.apps import apps
from django.db.models.fields import NOT_PROVIDED
from django.utils import datetime_safe, six, timezone
from django.utils.six.moves import input
from .loader import MigrationLoader
class Migrat... |
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from scipy.stats import stats
from src.tools.poi import select_poi
from src.data.ascad import TraceCategory
def statistical_moment(traces: np.array, moment=1):
"""
Retrieves a statistical moment in a given order for a given set of trace... |
# Copyright 2013-2021 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 Arrayfire(CMakePackage, CudaPackage):
"""ArrayFire is a high performance software library ... |
# Copyright 2021, 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... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import unittest
import k3modutil
import k3ut
dd = k3ut.dd
class TestModutil(unittest.TestCase):
def setUp(self):
sys.path.append(os.path.dirname(__file__))
module_tree = [
'root0',
'root0.mod0',
... |
#!/usr/bin python3
# -*- coding: utf-8 -*-
# 斐波那契数列计算
def fbi(n):
if n == 1 or n == 2:
return 1
return fbi(n-1) + fbi(n-2)
n = eval(input())
print(fbi(n)) |
class DirectMeta(type):
def __init__(cls, arg1, arg2):
print a<caret>rg1
|
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
from setuptools import setup
setup(
name = 'ftpknocker',
packages = ['ftpknocker'],
version = '1.1.1',
license = 'MIT',
description = 'ftpknocker is a multi-threaded scanner for finding anonymous FTP servers',
author = 'Kevin Kennell',
author_email = 'kevin@kennell.de',
install_requires=[
'cli... |
""" smoke.py: smoke tests for JS9, calling much of the public API """
import time
import sys
import json
import pyjs9
from astropy.io import fits
from smokesubs import *
def fitsioTest(j, file):
"""
test FITS IO routines
"""
tfits = "foo.fits"
hdul = fits.open(file)
hdul.info()
displayMessa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.