text stringlengths 2 999k |
|---|
# Generated by Django 3.0.8 on 2020-09-28 19:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('auctions', '0017_watchlist'),
]
operations = [
migrations.AddField(
model_name='watchlist',
name='title',
... |
_base_ = './ttfnet_r34_2x.py'
# dataset settings
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile', to_float32=True),
dict(type='LoadAnnotations', with_bbox=True),
dict(
type='PhotoMetricDistortion',
... |
import numpy as np
min_time = 3
d = 0.06
duration = 1.6
max_time = 5
def get_another_fragments(voice_fragments, operator_similarity, wav_splits):
new_fragments = []
new_similarity = []
for voice_fragment in voice_fragments:
cur_diff = voice_fragment[1] - voice_fragment[0]
if cur_diff >= m... |
# coding: utf-8
# ================================================
# Project: mumu
# File: feature/_woe.py
# Author: Mingmin Yu
# Email: yu_ming623@163.com
# Date: 2021/6/24 18:24
# Description:
# ================================================
import os
import string
import logging
import math
import xlsxwriter
impor... |
from pkg_resources import parse_version
from configparser import ConfigParser
import setuptools
assert parse_version(setuptools.__version__)>=parse_version('36.2')
# note: all settings are in settings.ini; edit there, not here
config = ConfigParser(delimiters=['='])
config.read('settings.ini')
cfg = config['DEFAULT']
... |
from django.views import generic
from django.db.models import get_model
from django.shortcuts import get_object_or_404
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from django import http
from oscar.core.loading import get_class
from oscar.apps.customer.alerts import util... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
# Copyright 2019 The PlaNet 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... |
import json
class GraphRenderer(object):
def get_graph(self):
raise NotImplementedError()
def get_javascript(self):
raise NotImplementedError
class ComponentDiGraphHTMLRenderer(GraphRenderer):
def __init__(self, component_graph, width=1000, height=1000, enable_pan_and_zoom=True):
... |
# Simple two DC motor robot class. Exposes a simple LOGO turtle-like API for
# moving a robot forward, backward, and turning. See RobotTest.py for an
# example of using this class.
# Author: Tony DiCola
# License: MIT License https://opensource.org/licenses/MIT
import time
import atexit
from Adafruit_MotorHAT import... |
# Copyright 2019 Annomator Written by Arend Smits
# 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/LIC... |
"""Tests for algorithms for partial fraction decomposition of rational
functions. """
from sympy.polys.partfrac import (
apart_undetermined_coeffs,
apart,
apart_list, assemble_partfrac_list
)
from sympy import (S, Poly, E, pi, I, Matrix, Eq, RootSum, Lambda,
Symbol, Dummy, factor, toget... |
# Generated by Django 3.0.6 on 2020-06-29 18:30
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... |
# Copyright (c) 2015 SONATA-NFV, 2017 5GTANGO
# 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 ... |
#!/usr/bin/python
from position_server.position_server import PositionServer
from threading import Thread
from tkinter import *
import math
import signal
import sys
# Global vars that change the way canvas looks
canvas_border = 50
canvas_width = canvas_height = 500
mouse_scroll_force_update = True
time_interval = 3... |
# Copyright (c) 2018 eBay, Inc., All Rights Reserverd.
# Copyright 2010 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:/... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
#!/usr/bin/python
# Copyright (c) 2017, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... |
import json
import sys
import re
import upf1_to_json
import upf2_to_json
def get_upf_version(file_name):
with open(file_name) as inp:
line = inp.readline()
if "<PP_INFO>" in line:
return 1
elif "UPF version" in line:
return 2
return 0
def parse_upf_from_file(file_name):
ver... |
"""
Antoine Grouazel
Nov 2019
"""
import netCDF4
import numpy as np
import logging
from src.config import RASTER_NASA_COASTLINE
nc = netCDF4.Dataset(RASTER_NASA_COASTLINE)
DISTANCE_COASTs = nc.variables['distance_to_coast'][:]
LON_COASTs = nc.variables['lon'][:]
LAT_COASTs = nc.variables['lat'][:]
nc.close()
def latl... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from src.utils.custom_typing import GanLossOutput, Tuple
class ClassifLoss(nn.Module):
"""Classifier loss"""
@staticmethod
def accuracy(y_pred, target):
return torch.sum(y_pred == target).float().mean()
def __init__(self):
... |
# Copyright 2010-2011 OpenStack Foundation
# Copyright 2011 Piston Cloud Computing, 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... |
from scfmsp.controlflowanalysis.instructions.AbstractInstructionTwoRegisters import AbstractInstructionTwoRegisters
class InstructionDadd(AbstractInstructionTwoRegisters):
name = 'dadd'
def get_execution_time(self):
return self.clock
def execute_judgment(self, ac):
super(InstructionDadd,... |
"""
题目:有四个数字:1、2、3、4,能组成多少个互不相同且无重复数字的三位数?各是多少?分别每行打印一个输出全部
"""
def get_number_performance(number):
target_number = []
for hundred_number in number:
for tens_digit in number:
for the_unit in number:
if (hundred_number != tens_digit) and (tens_digit != the_unit) and (the_uni... |
import enum
class StatusCode(enum.Enum):
OK = 200
BAD_REQUEST = 400
NOT_FOUND = 404
NOT_ALLOWED = 405
UNAUTHORIZED = 401
ERROR = 500
|
import tensorflow as tf
import os
def _get_training_data(FLAGS):
''' Buildind the input pipeline for training and inference using TFRecords files.
@return data only for the training
@return data for the inference
'''
filenames=[FLAGS.tf_records_train_path+'/'+f for f in os.listdir(FLAGS.tf_... |
import django.dispatch
SignalSetGPIO= django.dispatch.Signal(providing_args=["pk","Value"])
SignalToggleAVAR= django.dispatch.Signal(providing_args=["Tag","Device","newValue","force"])
SignalCreateMainDeviceVars= django.dispatch.Signal(providing_args=["Data"])
SignalDeleteMainDeviceVars= django.dispatch.Signal(providi... |
from iminuit import Minuit
from probfit import UnbinnedLH, gaussian, SimultaneousFit, rename
from matplotlib import pyplot as plt
from numpy.random import randn, seed
seed(0)
width = 2.
data1 = randn(1000)*width + 1
data2 = randn(1000)*width + 2
#two gaussian with shared width
pdf1 = rename(gaussian, ('x', 'mu_1', 's... |
from asynctest import mock as async_mock, TestCase as AsyncTestCase
from ......messaging.request_context import RequestContext
from ......messaging.responder import MockResponder
from ......transport.inbound.receipt import MessageReceipt
from ...messages.credential_issue import CredentialIssue
from .. import credent... |
from __future__ import absolute_import
from datetime import timedelta
import pytest
import logging
import re
import mock
from tornado import gen
from tornado.ioloop import PeriodicCallback, IOLoop
from tornado.httpclient import HTTPError
from tornado.httpserver import HTTPServer
import bokeh.server.server as server... |
#!/usr/bin/env python3
# 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.
from enum import Enum
from typing import Any, List, Optional
import numpy as np
from gym import Space, spaces
from habi... |
import os
import glob
import shutil
import subprocess
import time
from collections import deque
import numpy as np
import torch
import torch.utils.data as data
import cv2
from model.utils.blob import prep_im_for_blob, im_list_to_blob
from model.utils.config import cfg
from model.nms.nms_wrapper import nms
from model.r... |
from __future__ import print_function
import os
import socket
import shutil
import sys
import getpass
if sys.version_info >= (2, 7):
import unittest
else:
import unittest2 as unittest
from .. import lib
from ..configuration import IrodsConfig
from ..controller import IrodsController
from . import metaclass_un... |
"""Base class for sparse matrices"""
from __future__ import division, print_function, absolute_import
import sys
import numpy as np
from scipy._lib.six import xrange
from .sputils import (isdense, isscalarlike, isintlike,
get_sum_dtype, validateaxis)
__all__ = ['spmatrix', 'isspmatr... |
# Copyright (c) 2010, 2015 Nicira, 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 ... |
from flee import flee
from datamanager import handle_refugee_data
from datamanager import DataTable
import numpy as np
import outputanalysis.analysis as a
import sys
"""
Generation 1 code. Incorporates only distance, travel always takes one day.
"""
#Burundi Simulation
def date_to_sim_days(date):
return DataTable... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# pylint: disable=C0114
import io
import re
from glob import glob
from os.path import basename, dirname, join, splitext
from setuptools import find_packages, setup
def read(*names, **kwargs):
with io.open(
join(dirname(__file__), *names),
encoding... |
"""AwesomeVersion."""
from types import TracebackType
from typing import Any, List, Optional, Type, Union
from .exceptions import AwesomeVersionCompare, AwesomeVersionStrategyException
from .handlers import CompareHandlers
from .strategy import VERSION_STRATEGIES, AwesomeVersionStrategy
from .utils.logger import LOGGE... |
# 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... |
from django.conf.urls import url
from . import views
app_name = 'display_glitches_DB'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^do-db-search/$', views.do_DB_search, name='do_DB_search'),
]
|
from PyQt5.QtCore import QThread
class IA(QThread):
def __init__(self, personalidad):
super().__init__()
self.personalidad = personalidad
self.start()
def run(self):
self.personalidad(self)
pass |
import numpy as np
import torch
from mmdet.core import bbox2roi
from mmdet.models.losses import SmoothL1Loss
from ..builder import HEADS
from .standard_roi_head import StandardRoIHead
@HEADS.register_module()
class DynamicRoIHead(StandardRoIHead):
"""RoI head for `Dynamic R-CNN <https://arxiv.org/abs/2004.06002>... |
import pyperclip #for copying and pasting to our clipboard
class User:
'''
Create class that generates new instances of users.
'''
user_list = []
def __init__(self, username, password):
'''
Method that defines the properties of a user.
'''
... |
import html
from telethon import utils
from telethon.tl import types
from FIREX.utils import admin_cmd, edit_or_reply, sudo_cmd
def get_who_string(who):
who_string = html.escape(utils.get_display_name(who))
if isinstance(who, (types.User, types.Channel)) and who.username:
who_string += f" <i>(@{who.... |
#!/usr/bin/env python3
# Copyright 2010-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 ... |
# test_fluxqubit.py
# meant to be run with 'pytest'
#
# This file is part of scqubits.
#
# Copyright (c) 2019, Jens Koch and Peter Groszkowski
# 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.
##########... |
# Copyright 2020 - 2021 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 wri... |
# Copyright 2016 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... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelEncoder
import re
from sklearn.feature_extraction import DictVectorizer
from sklearn.model_selection import train_test_split
import xgboost as xgb
from sklearn.cluster import MiniBatchKMeans
import nltk
fro... |
# Copyright 2022 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... |
class StatsMixin:
def get_stats(self):
unique_governments = self.df["Government"].unique()
return len(unique_governments), unique_governments
# num_msg: str
# list_msg: str
def print_stats(self, num_msg="", list_msg=""):
num_govs, list_of_govs = self.get_stats()
if num_m... |
import komand
from .schema import AppendLineInput, AppendLineOutput, Input, Output, Component
# Custom imports below
class AppendLine(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name='append_line',
description=Component.DESCRIPTION,
... |
PATH='puzzle_input/ejercicio14.txt'
PATH2='puzzle_input/ejercicio14M.txt'
#esta funcion convierte un númeo decimal a binario anteponiendo los ceros necesarios
#para que su tamaño sea de 36
def convertirABinario(numero):
auxiliar=list()
while numero != 0:
auxiliar.append(str(numero%2))
numero=num... |
import yaml
import json
from st2tests.base import BaseActionTestCase
class ZabbixBaseActionTestCase(BaseActionTestCase):
__test__ = False
def setUp(self):
super(ZabbixBaseActionTestCase, self).setUp()
self._full_config = self.load_yaml('full.yaml')
self._blank_config = self.load_yam... |
from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env("DJANGO_SECRET_KEY")
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED... |
"""Storage for tokens."""
from __future__ import annotations
from datetime import datetime, timezone
from typing import List, Optional, cast
from sqlalchemy import delete
from sqlalchemy.engine import CursorResult
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.future import select
from structlog.std... |
import paho.mqtt.client as mqtt
import urllib.request as request
import logging
import logging.config
import json
import os
import shutil
import datetime
import urllib
from queue import Queue
from threading import Thread
from subprocess import call
IMAGE_URL = "http://192.168.37.21/oneshotimage.jpg"
MQTT_HOST = "local... |
import json
from google.appengine.ext import db
from google.appengine.api import memcache
def tache_key(name = 'default'):
return db.Key.from_path('taches', name)
#@param: key represente l'id de la tache voulue ou "tous" si jamais on veut toutes les taches
#@param: update indique si il faut mettre a jour le cac... |
from easydict import EasyDict as edict
# init
__C_UCF50 = edict()
cfg_data = __C_UCF50
__C_UCF50.STD_SIZE = (768,1024)
__C_UCF50.TRAIN_SIZE = (576,768)
__C_UCF50.DATA_PATH = '/home/marcellino/CrowdCounting/datasets/ProcessedData/UCF_CC_50'
__C_UCF50.MEAN_STD = ([0.403584420681,0.403584420681,0.403584... |
import csv
import os
import numpy as np
class evaluation:
def __init__(self, dest_folder="graphs"):
self.dest_folder = dest_folder
self.metrics_keys = []
self.metrics_values = []
def set_keys(self, keys):
self.metrics_keys = keys
def add_value(self, values):
... |
from dc2g.planners.FrontierPlanner import FrontierPlanner
import numpy as np
from skimage.transform import resize
import tensorflow as tf
import json
import os
import matplotlib.pyplot as plt
class DC2GPlanner(FrontierPlanner):
def __init__(self, model_name, traversable_colors, goal_color, room_or_object_goal, c... |
import functools
from flask import (Blueprint, flash, g, redirect, render_template, request, session, url_for)
bp = Blueprint('auth', __name__, url_prefix='/auth')
@bp.route('/register', methods=('GET', 'POST'))
def register():
return render_template('auth/register.html') |
"""
Copyright (c) 2011, 2012, Regents of the University of California
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this l... |
# -*- coding: utf-8 -*-
"""
Test case for the vault execution module
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import salt.modules.vault as vault
# Import Salt libs
from salt.exceptions import CommandExecutionError
from tests.support.mixins import LoaderModuleM... |
# read and write json files
from pyspark.sql import SparkSession
import json
spark = SparkSession.Builder().appName("json").master("local[2]").getOrCreate()
sc = spark.sparkContext
#data = json.load(open("/home/user/workarea/projects/learn-pyspark/data/colors.json","r"))
#rdd = sc.parallelize(data)
data = spark.r... |
# MIT License
#
# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2020
#
# 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
# r... |
import rdflib
from Integrator import dolog
# format_extension_mapping = {
# 'rdf': 'xml',
# 'owl': 'xml',
# 'ttl': 'ttl'
# }
#
#
# def valid_syntax(file_abs_dir):
# g = rdflib.Graph()
# try:
# g.parse(file_abs_dir, format=format_extension_mapping[file_abs_dir[-3:].lower()])
# return... |
""" Each encoder should have following attributes and methods and be inherited from `_base.EncoderMixin`
Attributes:
_out_channels (list of int): specify number of channels for each encoder feature tensor
_depth (int): specify number of stages in decoder (in other words number of downsampling operations)
... |
from setuptools import setup, find_packages
setup(name='py4etrics',
version='0.1.7',
author='Tetsu HARUYAMA',
author_email='haruyama@econ.kobe-u.ac.jp',
packages=find_packages(),
package_dir={'py4etrics': './py4etrics'},
url='https://github.com/Py4Etrics/py4etrics',
license='M... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from infi.clickhouse_orm.database import DatabaseException, ServerError
from .base_test_with_data import *
class ReadonlyTestCase(TestCaseWithData):
def _test_readonly_db(self, username):
self._insert_and_check(self._sample_data(), len(data... |
from flask import render_template, Blueprint, current_app, request, flash, redirect, url_for
from flask_login import current_user, logout_user, login_required, fresh_login_required
from blog.models import User, Category, Post
from blog.extensions import db
from blog.forms.user import EditProfileForm, ChangePasswordForm... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2019-07-10 16:14:50
# @Author : Lewis Tian (taseikyo@gmail.com)
# @Link : github.com/taseikyo
# @Version : Python3.7
# https://projecteuler.net/problem=9
TRIPLET = 1000
def main():
for a in range(1, TRIPLET + 1):
for b in range(a + 1, TRIPLE... |
a, b = [int(x) for x in input().split()]
print(f'{a / b:.2f}') |
# 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.package import *
class Swan(MakefilePackage):
"""SWAN is a third-generation wave model, developed at Delf... |
import subprocess
import time
from pathlib import Path
from itertools import chain
from werkzeug.utils import secure_filename
import models
from app import api
def allowed_file(filename):
return '.' in filename and filename.rsplit('.', 1)[1].lower() in models.ALLOWED_EXTENSIONS
def get_pictures(filepath):
... |
#!/usr/bin/env python
import json
from carrierpigeon import utils
if __name__ == "__main__":
filename = input("Desired filename ('.json' assumed): ").strip()
version = int(input("Version number [1]: ").strip())
if not version:
version = 1
print()
fields = []
required = []
whil... |
# -*- coding: utf-8 -*-
# Copyright (C) 2013, the codeeditor development team
#
# Codeeditor is distributed under the terms of the 2-Clause BSD License.
# The full license can be found in 'license.txt'.
""" Subpackage parsers
This subpackage contains all the syntax parsers for the
different languages.
"""
""" CREA... |
# This file is part of datacube-ows, part of the Open Data Cube project.
# See https://opendatacube.org for more information.
#
# Copyright (c) 2017-2021 OWS Contributors
# SPDX-License-Identifier: Apache-2.0
from copy import deepcopy
from typing import Any, MutableMapping
def deepinherit(parent: MutableMapping[str, ... |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2021, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... |
import numpy as np
import pandas as pd
from tqdm import tqdm
from src.configs.experiment_config import ExperimentConfig
from src.configs.variables_const import VariablesConsts
from src.data.processing.textual_processing import PreProcessing
from src.evaluation.evaluation_method import EvaluationMethod
class Predict:... |
""" Copied from Hugging face T5 model code in Pytorch. """
import copy
import logging
import math
import os
import torch
import torch.nn.functional as F
from torch import nn
from torch.nn import CrossEntropyLoss
from transformers import PretrainedConfig
from transformers.configuration_t5 import T5Config
from trans... |
"""
Django settings for profiles_project project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
impor... |
from typing import List, Any
import json
from utils.requests_retry_session import requests_retry_session
from utils.parsers import parse_datetime
class PaystackAPI(object):
def __init__(self, api_key: str):
self._session = requests_retry_session()
self._headers = {"Authorization": f"Bearer {api_ke... |
"""
ASGI config for templates_advanced project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.... |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class EngineshooterItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
pass
class SearchResultItem(scra... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from models.tresnet.layers.avg_pool import FastAvgPool2d
class Flatten(nn.Module):
def forward(self, x):
return x.view(x.size(0), -1)
class DepthToSpace(nn.Module):
def __init__(self, block_size):
super().__i... |
# 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... |
#!/usr/bin/env python
##################################################
## DEPENDENCIES
import sys
import os
import os.path
try:
import builtins as builtin
except ImportError:
import __builtin__ as builtin
from os.path import getmtime, exists
import time
import types
from Cheetah.Version import MinCompatib... |
import argparse
import json
import logging
from tqdb import __version__ as tqdb_version
from tqdb import main
from tqdb import storage
from tqdb.utils import images
from tqdb.utils.text import texts
# Disable any DEBUG logging from PIL:
logging.getLogger('PIL').setLevel(logging.WARNING)
logging.basicConfig(
level... |
import logging
import logging.handlers
import queue
import threading
import time
import urllib.request
from collections import deque
from pathlib import Path
from typing import List
import av
import numpy as np
import pydub
import streamlit as st
from streamlit_webrtc import AudioProcessorBase, WebRtcMode, webrtc_str... |
"""
Django settings for profiles_project project.
Generated by 'django-admin startproject' using Django 3.1.3.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
fro... |
# Copyright 2012,2014 Hewlett-Packard Development Company, L.P.
# 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
#
# ... |
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.2.1, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# ------------------------------------------... |
from sets import Set
from math import log
import re
import operator
trainTopics = [] #lisdyt of list of topics, "None" if no topic
trainTitle = []
trainBody = []
testTopics = [] #lisdyt of list of topics, "None" if no topic
testTitle = []
testBody = []
termFrequency = list(dict())
with open("reuters/reut2-000.sgm") ... |
#
# 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... |
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
from common import update
try:
data = {}
data[ 'update_type' ] = 'sample_dataset_transfer_status'
data[ 'sample_dataset_ids' ] = sys.argv[3].split(',')
data[ 'new_status' ] = sys.argv[4]
except IndexError:
print('usa... |
# Generated by Django 3.2 on 2022-02-06 21:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("auth_app", "0007_auto_20220203_0937"),
]
operations = [
migrations.AlterField(
model_name="businessowner",
name="busin... |
# -*- coding: utf-8 -*-
# Copyright (C) 2005-2019 Mag. Christian Tanzer. All rights reserved
# Glasauergasse 32, A--1130 Wien, Austria. tanzer@swing.co.at
# ****************************************************************************
#
# This module is licensed under the terms of the BSD 3-Clause License
# <http://www.... |
import numpy as np
from collections import Counter
from context import arkouda as ak
from base_test import ArkoudaTest
import pytest
import random
import string
ak.verbose = False
N = 100
UNIQUE = N//2
# test_strings = np.array(['These are', 'some', 'interesting',
# '~!@#$%^&*()_+', 'sarrays'... |
# -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/ValueSet
Release: R4
Version: 4.0.1
Build ID: 9346c8cc45
Last updated: 2019-11-01T09:29:23.356+11:00
"""
import io
import json
import os
import unittest
import pytest
from .. import valueset
from ..fhirdate import FHIRDate
from .fixtures im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.