text stringlengths 1 927k |
|---|
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-07-23 13:16
from __future__ import unicode_literals
from waffle.models import Flag
from django.db import migrations
EMBER_WAFFLE_PAGES = [
'dashboard',
'home',
]
def format_ember_waffle_flag_name(page):
return 'ember_{}_page'.format(page)
def... |
# -*- encoding: utf-8
from sqlalchemy.test.testing import eq_
import datetime, os, re
from sqlalchemy import *
from sqlalchemy import types, exc, schema
from sqlalchemy.orm import *
from sqlalchemy.sql import table, column
from sqlalchemy.databases import mssql
from sqlalchemy.dialects.mssql import pyodbc
from sqlalche... |
import uvicorn
from fastapi import FastAPI, HTTPException, File, UploadFile
from typing import Optional, List
from csv import reader
### gloabls
port = 8000
app = FastAPI()
indices = []
@app.get("/getdata/{date}")
async def read_item(date: str, index: str = "DAX", show_all_indices: Optional[bool] = False):
result... |
# Спортсмен занимается ежедневными пробежками. В первый день его результат составил a километров.
# Каждый день спортсмен увеличивал результат на 10 % относительно предыдущего. Требуется определить номер дня,
# на который результат спортсмена составит не менее b километров. Программа должна принимать значения
# парамет... |
from django.db import models
from django.conf import settings
# Create your models here.
class Employee(models.Model):
DEPARTMENT_CHOICES = (
('hr', 'Human Resources'),
('finance', 'Finance'),
('engineering', 'Engineering'),
('marketing', 'Marketing'),
('sales', 'Sales'),
... |
"""
A dialogue system meant to be used for language learning.
This is based on Google Neural Machine Tranlation model
https://github.com/tensorflow/nmt
which is based on Thang Luong's thesis on
Neural Machine Translation: https://github.com/lmthang/thesis
And on the paper Building End-To-End Dialogue Systems
Using Ge... |
# Copyright 2013-2022 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 Geant4(CMakePackage):
"""Geant4 is a toolkit for the simulation of the passage of particle... |
import torch
import torch.nn as nn
import torch.nn.functional as F
__all__ = ['Inception3', 'inception_v3']
def inception_v3(**kwargs):
r"""Inception v3 model architecture from
`"Rethinking the Inception Architecture for Computer Vision" <http://arxiv.org/abs/1512.00567>`_.
Args:
pretrained (boo... |
# -*- coding: utf-8 -*-
"""
Utilities for transforming and validating data types
Given that many of the data transformations involve copying the data, they should
ideally happen in a lazy manner to avoid memory issues.
Created on Tue Nov 3 21:14:25 2015
@author: Suhas Somnath, Chris Smith
"""
from __future__ impor... |
import asyncio, logging, sys, json_logging, quart
app = quart.Quart(__name__)
json_logging.init_quart(enable_json=True)
json_logging.init_request_instrument(app)
# init the logger as usual
logger = logging.getLogger("test logger")
logger.setLevel(logging.DEBUG)
logger.addHandler(logging.StreamHandler(sys.stdout))
@a... |
"""add
Revision ID: 5edcaaadde99
Revises: a1d970c1214f
Create Date: 2019-03-18 09:41:06.484761
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5edcaaadde99'
down_revision = 'a1d970c1214f'
branch_labels = None
depends_on = None
def upgrade():
# ### comman... |
from django.db import models
# Create your models here.
class UpLoader(models.Model):
uid = models.CharField(max_length=10)
pass |
import builtins
import socket
import sys
def print(*args, **kwargs):
'''Print method overriding default, prints to stderr.'''
kwargs['flush'] = True
kwargs['file'] = sys.stderr
return builtins.print('[{}] {}'.format(socket.gethostname(), args[0]), *(args[1:]), **kwargs) if any(args) else builtins.... |
# Copyright 2015 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... |
# Copyright 2014 Cloudbase Solutions Srl
#
# 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 l... |
from django.utils.translation import ugettext as _
class StatusCode:
@classmethod
def items(cls):
return cls.options.items()
@classmethod
def label(cls, value):
""" Return the status code label associated with the provided value """
return cls.options.get(value, value)
clas... |
"""The tests for the Modbus cover component."""
from pymodbus.exceptions import ModbusException
import pytest
from homeassistant.components.cover import DOMAIN as COVER_DOMAIN
from homeassistant.components.modbus.const import (
CALL_TYPE_COIL,
CALL_TYPE_REGISTER_HOLDING,
CONF_INPUT_TYPE,
CONF_LAZY_ERR... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pymyair documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# 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
# aut... |
# Generated by Django 3.1.2 on 2020-10-29 08:54
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AU... |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/poi/shared_naboo_ruins_medium_3.iff"
result.attribute_template_id =... |
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from openvino.tools.mo.ops.LSTM import LSTM
from openvino.tools.mo.front.extractor import FrontExtractorOp
from openvino.tools.mo.front.onnx.extractors.utils import onnx_attr
class LSTMFrontExtractor(FrontExtractorO... |
from azul import (
config,
)
from azul.template import (
emit,
)
emit(config.lambda_env_for_outsourcing) |
"""Author: Brandon Trabucco, Copyright 2019"""
import tensorflow as tf
from mineral.algorithms.tuners.tuner import Tuner
class EntropyTuner(Tuner):
def __init__(
self,
policy,
**kwargs
):
Tuner.__init__(self, **kwargs)
self.policy = policy
def update_algorithm(
... |
# -*- coding: utf-8 -*-
from sqlalchemy import Column, String, Integer
from sqlalchemy.ext.declarative import declarative_base
from zvt.api.data_type import Region, Provider
from zvt.contract import Portfolio, PortfolioStockHistory
from zvt.contract.register import register_entity, register_schema
FundMetaBase = decl... |
import numpy as np
from copy import deepcopy
def stratify(data, classes, ratios, one_hot=False):
"""Stratifying procedure.
data is a list of lists: a list of labels, for each sample.
Each sample's labels should be ints, if they are one-hot encoded, use one_hot=True
classes is the list of cl... |
import tensorflow as tf
mnist = tf.keras.datasets.mnist
(x_train, y_train),(x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
model = tf.keras.models.Sequential([
tf.keras.layers.Flatten(),
tf.keras.layers.Dense(512, activation=tf.nn.relu),
tf.keras.layers.Dropout(0.2),
tf.... |
# coding: utf-8
"""
SessionService documentation
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F... |
from .ner import spacy_ner
from .ner_validation import ner_validation
__all__ = ['spacy_ner', 'ner_validation'] |
import argparse
import logging
from coinmetrics.bitsql import runExport, dbObjectsFactory, postgresFactory
from coinmetrics.bitsql.constants import SUPPORTED_ASSETS
from coinmetrics.utils.arguments import postgres_connection_argument
argParser = argparse.ArgumentParser()
argParser.add_argument("asset", type=str, choi... |
# coding: utf-8
"""
OpsGenie REST API
OpsGenie OpenAPI Specification # noqa: E501
OpenAPI spec version: 2.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from opsgenie_swagger.models.base_response import BaseResponse ... |
from gevent import sleep, Greenlet, spawn_raw
class Periodic(object):
def __init__(self, interval, f, *args, **kwargs):
self.interval = interval
self.f = f
self.args = args
self.kwargs = kwargs
self._greenlet = None
def _run(self):
while True:
spawn... |
from WDL import load
def validate_wdl_doc(wdl_path):
load(str(wdl_path)) # load works correctly for validation where parse_document and CLI.check do not.
return |
from __future__ import print_function, absolute_import
import time
from time import gmtime, strftime
from datetime import datetime
from collections import OrderedDict
import torch
import numpy as np
from random import randint
from PIL import Image
import sys
from . import metric
from metric import Accuracy, EditDistanc... |
from neomodel.contrib import SemiStructuredNode
from neomodel import (UniqueIdProperty,
StringProperty,
DateTimeProperty,
FloatProperty,
BooleanProperty
)
from datetime import datetime
import pytz
from .utils.se... |
#!/usr/bin/env python
# Python imports.
import os
import time
# Other imports.
from utils import make_mdp
from simple_rl.planning import ValueIteration
from utils.AbstractValueIterationClass import AbstractValueIteration
from state_abs import indicator_funcs as ind_funcs
from abstraction_experiments import get_sa
d... |
import os
import logging
import asyncio
from aiohttp import web, web_request
from aioapp.app import Application
from aioapp import config
from aioapp.tracer import Span
from aioapp_http import Server, Handler
class Config(config.Config):
host: str
port: int
_vars = {
'host': {
'type': ... |
from time import sleep
import csv
import re
import sys
import requests
from bs4 import BeautifulSoup
def scrape(num_players):
url = "https://osu.ppy.sh/p/pp/"
players = {}
# Handle invalid input
if num_players%50 != 0:
print("num_players must be divisible by 50")
return None
max... |
from django.contrib import admin
from .models import *
# Register your models here.
admin.site.register(Unvetted)
admin.site.register(Banner)
admin.site.register(IotexChart) |
#!/usr/bin/env python
"""
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");... |
# Natural Language Toolkit: API for Language Models
#
# Copyright (C) 2001-2014 NLTK Project
# Author: Steven Bird <stevenbird1@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
# should this be a subclass of ConditionalProbDistI?
class ModelI(object):
"""
A processing interface... |
''' Register rule-based models or pre-trianed models
'''
from rlcard.models.registration import register, load
register(
model_id = 'leduc-holdem-cfr',
entry_point='rlcard.models.pretrained_models:LeducHoldemCFRModel')
register(
model_id = 'leduc-holdem-rule-v1',
entry_point='rlcard.models.leducholdem... |
# Copyright 2017 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... |
from model import sparql, namespaces, AIDA
from rdflib.namespace import split_uri
from collections import defaultdict
import pickle
data = defaultdict(dict)
query = """
SELECT ?cluster (COUNT(?member) AS ?size)
WHERE {
?membership aida:cluster ?cluster ;
aida:clusterMember ?member .
}
GROUP BY ?clust... |
# Generated by Django 3.1.4 on 2021-01-25 22:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('post', '0003_auto_20210125_1713'),
]
operations = [
migrations.AlterField(
model_name='post',
name='photo',
... |
# Copyright 2015 Infoblox 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 applicable law... |
"""
This is the "example" module.
The example module supplies one function, factorial(). For example,
>>> factorial(5)
120
"""
def factorial(n):
"""Return the factorial of n, an exact integer >= 0.
>>> [factorial(n) for n in range(6)]
[1, 1, 2, 6, 24, 120]
>>> factorial(30)
26525285981219105863... |
__author__ = 'iamshreeram'
# Title : main app
# Objective : Stress the REST Service
# Created by: Shreeram
# Created on: 7/20/2018 |
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import requests
from typing import Dict, Tuple
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' GLOBALS/PARAMS '''
SECBI_API_ROOT = '/api/v1'
SECBI_API_ENDPOINT_STATUS = SE... |
#!/usr/bin/env python
import re, dns.resolver
#-----------------------------------------------------
# SPFlattener - Because who needs limits??
# Requires: dnspython
# Usage: edit the "root_domain" variable below and run
#-----------------------------------------------------
# To-do:
# Confirm that SPF doesn't fol... |
# Collaborators (including web sites where you got help: (enter none if you didn't need help)
#tutor
def avg(user_list):
# Insert code here
average = sum(user_list)/len(user_list)
return average
if __name__ == '__main__':
num_list=[]
print("Input a number to be averaged. When finished inputing nu... |
from ckan import model, logic
from ckanext.ytp_request.model import MemberRequest
from ckan.common import c
from ckanext.ytp_request.helper import get_default_locale
from ckanext.ytp_request.mail import mail_process_status
import logging
import datetime
log = logging.getLogger(__name__)
def member_request_reject(co... |
"""
Class to interface with the article multistream bzip2 file.
"""
import bz2
import xml.etree.ElementTree as ET
class ArticleMultistream:
def __init__(self, multistream_file):
self.__rawstream = open(multistream_file, 'rb')
def get_block(self, block_offset):
dc = bz2.BZ2Decompressor()
self.__rawst... |
import sage.rings.finite_rings.finite_field_constructor
from Structures.Field import Field
class FiniteFieldsWrapper(Field):
_galoisField = None
_p = None
_k = None
def __init__(self, p, k, var):
super(FiniteFieldsWrapper, self).__init__()
self._p = p
self._k = k
s... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
# This module is automatically generated by autogen.sh. DO NOT EDIT.
from . import _GCP
class _General(_GCP):
_type = "general"
_icon_dir = "resources/gcp/general"
class GoogleCloudPlatform(_General):
_icon = "google-cloud-platform.png"
class GenericService(_General):
_icon = "generic-service.png... |
# -*- coding: utf-8 -*-
########### SVN repository information ###################
# $Date: $
# $Author: $
# $Revision: $
# $URL: $
# $Id: $
########### SVN repository information ###################
#
'''
*Module G2phase_xyz: read coordinates from an xyz file*
-------------------------------------------------------
A... |
# @l2g 1792 python3
# [1792] Maximum Average Pass Ratio
# Difficulty: Medium
# https://leetcode.com/problems/maximum-average-pass-ratio
#
# There is a school that has classes of students and each class will be having a final exam.
# You are given a 2D integer array classes,where classes[i] = [passi,totali].
# You know ... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: cirq/google/api/v2/calibration.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _mes... |
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
from config.settings.base import BASE_DIR
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.2/howto/static-files/
STATIC_URL = "/static/"
STATIC_DIR = os.path.join(BASE_DIR, "static")
STATIC... |
#!/usr/bin/env python
# -*- coding: gbk -*
# @auther:Hieda no Chiaki <forblackking@gmail.com>
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
class SendMail:
def __init__(self):
pass
def send(self):
username = "forblackking@gmail.com"
... |
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch import autograd
import time as t
import os
from itertools import chain
from torchvision import utils
from .spectral_normalization import SpectralNorm
class WassersteinLoss(torch.nn.Module):
def forward(self, x , target):
loss... |
from train import ex
def main():
batch_size = 8
sequence_length = 327680
model_complexity = 48
ex.run(
config_updates={
"split": "redux",
"audio": "stems/bass.flac",
"instrument": "electric-bass",
"max_harmony": 2,
"skip_pitch_bend_t... |
import numpy as np
import scipy
import theano
from theano import gof, scalar, tensor
from theano.configdefaults import config
from theano.gof.op import COp
from theano.misc.safe_asarray import _asarray
from theano.sparse import basic as sparse
from theano.sparse.basic import (
CSC,
CSR,
csm_data,
csm_g... |
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) 2012, Machinalis S.R.L.
# This file is part of quepy and is distributed under the Modified BSD License.
# You should have received a copy of license in the LICENSE file.
#
# Authors: Rafael Carrascosa <rcarrascosa@machinalis.com>
# Gonzalo Garcia Berrotara... |
# Go through a directory, gather all files with
# specific postfix and attempt converting them into
# .wav files with 16-bit, 16khz sampling rate.
import argparse
import os
import subprocess
from tqdm import tqdm
parser = argparse.ArgumentParser("Gather audio files from directory and turn them into .wav files")
parse... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
import numpy as np
class Oliva(object):
def __init__(self,width=640, skip=12, act_diff=0.015, act_decay=0.1,
act_prod=0.1, sat=0.25, in_diff=0.0, in_decay=0.014, in_mm=0.1,
h_decay=0.1, hormone=0.5):
self.width = width
self.cells = np.zeros((2,2,self.width))
... |
#!/usr/bin/env python3
# imports go here
#
# Free Coding session for 2015-04-18
# Written by Matt Warren
#
class Foo(object):
nice_level = "HI THERE"
def __init__(self, name):
self.name = name
def p(self):
return self.nice_level
def q(self):
return Foo.nice_level
def foo(... |
from app import app as application
def create():
application.run(host='127.0.0.1', port=8888) |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############
# GaudiViewX: UCSF ChimeraX extension to
# explore and analyze GaudiMM solutions
# https://github.com/insilichem/gaudiviewx
# Copyright 2019 Andrés Giner Antón, Jaime Rodriguez-Guerra
# and Jean-Didier Marechal
# Licensed under the Apache Lice... |
# Copyright 2016 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, s... |
#!/usr/bin/env python3
#
# Copyright (c) 2014,Thibault Saunier <thibault.saunier@collabora.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (... |
import sys
import os
if len(sys.argv) < 3:
print >> sys.stderr, "Use %s <video id> <mode quic|http>"
exit(2)
vid = sys.argv[1]
mode = sys.argv[2]
output_filename = os.path.join(os.path.expanduser('~'), vid, "%s_%s_quality_change.txt"%(vid, mode))
input_filename = os.path.join(os.path.expanduser('~'), vid, "%... |
# coding=utf-8
# Filename: test_widgets.py
"""
...
"""
from __future__ import division, absolute_import, print_function
from km3pipe.testing import *
from pipeinspector.widgets import BlobWidget
__author__ = "Tamas Gal"
__copyright__ = "Copyright 2016, Tamas Gal and the KM3NeT collaboration."
__credits__ = []
__lic... |
"""Voice component"""
import importlib
from queue import Empty
from multiprocessing import Process
class Actionner(Process):
"""Define voices component
For now voice use Nuance communications services
"""
def __init__(self, tuxdroid):
Process.__init__(self)
# Set logger
self.... |
# -*- coding: utf-8 -*-
"""
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Libs
import salt.states.quota as quota
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
fr... |
#!/usr/bin/env python
from __future__ import division
from math import *
import rospy
import numpy as np
from rospy_tutorials.msg import Floats
from rospy.numpy_msg import numpy_msg
from sensor_msgs.msg import LaserScan
print "running"
class determine_z_values:
''' Determines the inter-agent distance values... |
##############################################################################
## Copyright (C) 1999-2006 Michigan State University ##
## Based on work Copyright (C) 1993-2003 California Institute of Technology ##
## ##
## R... |
# Author Melody
# Data 2021-06-03 16:27:40
import pandas as pd
import geopy.distance
# Pytest is an automated testing module on Python,Use Pytest to test the legitimacy on Bikeshare Data
# import pytest as pt
# Coords is a data structures to save How Bikeshare Date,Coord just like a List
def getStartEndCoords():
... |
# -*- coding: utf-8 -*-
"""
MiniTwit
~~~~~~~~
A microblogging application written with Flask and sqlite3.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import time
from sqlite3 import dbapi2 as sqlite3
from hashlib import md5
from datetime import datetim... |
import urllib.parse
from selenium.webdriver import Chrome, ChromeOptions
from selenium.webdriver.common.by import By
from webium import BasePage, Find
from webium.driver import close_driver, get_driver
import pytest
import webium.settings
class HeadlessChrome(Chrome):
def __init__(self):
chrome_options ... |
import cyclus_input_gen |
# -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
from functools import partial
import errno
import sys
try:
import eventlet
except ImportError:
raise RuntimeError("You need eventlet installed to use this worker.")
# validate the ev... |
"""
How this works:
- Go through file line by line
- if it's a (re)newcommand: save, move on
- resolve all (re)newcommands
- get a list of all images that are referenced
- get a list of all .tex or .sty files that are referenced -> parse these
- check for special stuff: bibtex/bibtexstyle
Note: i... |
import torch
from torch import nn
class FrameAvgPool(nn.Module):
def __init__(self, cfg):
super(FrameAvgPool, self).__init__()
input_size = cfg.INPUT_SIZE # 4096
hidden_size = cfg.HIDDEN_SIZE # 512
kernel_size = cfg.KERNEL_SIZE # 16
stride = cfg.STRIDE
self.vis_... |
#
# Copyright 2022 The AI Flow 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 w... |
"""
You are given two non-empty linked lists representing
two non-negative integers. The digits are stored in reverse order
and each of their nodes contain a single digit.
Add the two numbers and return it as a linked list.
You may assume the two numbers do not contain any leading zero,
except the number 0 itself.
In... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.contrib.auth.models
import uuid
class Migration(migrations.Migration):
dependencies = [
('auth', '0006_require_contenttypes_0002'),
]
operations = [
migrations.CreateMo... |
from django_tables2 import RequestConfig
from django.shortcuts import render
from django.forms import modelformset_factory
from django.views.decorators.csrf import csrf_protect
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from .tables import CustomerTable, Custo... |
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, UserManager
from django.contrib.auth.hashers import make_password
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
class CustomUserManager(UserManager):
use_in_migrations ... |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
else:
access = Ser... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Butcoin-Electrum - lightweight Butcoin client
# Copyright (C) 2018 Butcoin 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 witho... |
# Copyright 2020 MONAI Consortium
# 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, s... |
#!/usr/bin/env python3
# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not
# use this file except in compliance with the License. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or i... |
import maya.OpenMaya as om
import maya.cmds as mc
import maya.mel as mel
import pymel.core as pm
def createGlobalsNode():
if mc.objExists("customMayaRendererGlobalsNode"):
return
mc.createNode(
"customMayaRendererGlobalsNode",
name = "customMayaRendererGlobalsNode",
shared = Tr... |
from data_loader import load_data, tokenizer
from models import BertForMultipleSequenceClassification
from transformers import AutoConfig
import torch
from tqdm.auto import tqdm
from transformers import get_scheduler
from transformers import AdamW
from sklearn.metrics import accuracy_score, f1_score
label_list = ['확진... |
# -*- coding: utf-8 -*-
"""
ons
===
UK Office for National Statistics (ONS) data file readers.
-------------------------------------------------------------------------------
MIT License
Copyright (c) 2018-21 Chris Thoung
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software a... |
#src/app.py
from flask import Flask
from .config import app_config
from .models import db, bcrypt
from .models import UserModel, ReviewModel, NodeModel,AmenityModel,TourismModel,ShopModel
def create_app(env_name):
"""
Create app
"""
# app initiliazation
app = Flask(__name__)
app.config.from_object(app_... |
from datetime import datetime, timedelta
from typing import Dict, Any, Optional
from jose import jwt, JWTError
from app.config import JWT_TOKEN_EXPIRE_MINUTES, SECRET_KEY, JWT_ALGORITHM
from app.modules.auth.use_cases.interfaces import IJwtService
def _added_exp_to_data(data: Dict[str, Any], minutes: int) -> Dict[s... |
import pytest
def test_help(testdir):
testdir.makepyfile(
"""
def test_01():
a = "pytest"
b = "py"
assert a == b
"""
)
result = testdir.runpytest("--help")
result.stdout.fnmatch_lines(["*--switch*"])
result.stdout.fnmatch_lines(["*Custom ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.