content stringlengths 0 894k | type stringclasses 2
values |
|---|---|
import tkinter
import tkinter.filedialog
from PIL import Image,ImageTk
from torchvision import transforms as transforms
from test import main,model
# 创建UI
win = tkinter.Tk()
win.title("picture process")
win.geometry("1280x1080")
# 声明全局变量
original = Image.new('RGB', (300, 400))
save_img = Image.new('RGB... | python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2015 RAPP
# 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 app... | python |
# Train FSDKaggle2018 model
#
import sys
sys.path.append('../..')
from lib_train import *
conf.logdir = 'logs_mobilenetv2_small'
conf.best_weight_file = 'best_mobilenetv2_small_weight.h5'
# 1. Load Meta data
DATAROOT = Path.home() / '.kaggle/competitions/freesound-audio-tagging'
#Data frame for training dataset
df_tr... | python |
"""
GFS2FileSystemBlockSize - command ``stat -fc %s <mount_point_path>``
====================================================================
The parser parse the output of ``stat -fc %s <mount_point_path>``
"""
from insights import parser, CommandParser
from insights.specs import Specs
from insights.parsers import S... | python |
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | python |
"""Methods specific to handling chess datasets.
"""
import torch
import torchvision
import typing
import logging
from enum import Enum
import numpy as np
import chess
from recap import URI, CfgNode as CN
from .transforms import build_transforms
from .datasets import Datasets
logger = logging.getLogger(__name__)
de... | python |
option = 'Yy'
print ('\033[1;32m{:=^40}\033[m'.format(' ANNUAL STUDENT RESULT '))
while option == 'Yy':
nome = str(input('\033[1mType your name: '))
n1 = float(input('\033[1;33m{}\033[m \033[1;32mType a first note:\033[m '.format(nome.lower().capitalize())))
n2 = float(input('\033[1;33m{}\033[m \033[1;32mE... | python |
from shared.numeric import is_permutation
from shared.generators import infinite_range
def is_max_permutation(number: int, multiple: int) -> bool:
for i in range(2, multiple + 1):
if not is_permutation(number, number * i):
return False
return True
def permutation_multiples(multiple: int)... | python |
import pandas as pd
from estimators.FuzzyFlow import FuzzyFlow
fuzzy = FuzzyFlow()
dat = pd.read_csv('../sampling_617685_metric_10min_datetime.csv',parse_dates=True,index_col=0)[:3000]
dat = pd.Series(dat['cpu_rate'].round(3))
fuzzy.fit_transform(dat) | python |
input_str = input("Enter a list of elements: ")
list1 = [int(x) for x in input_str.split() if int(x) % 2 == 0]
print(list1) | python |
"""
URLconf for ``access_log`` app.
"""
# Prefix URL names with the app name. Avoid URL namespaces unless it is likely
# this app will be installed multiple times in a single project.
from django.conf.urls import include, patterns, url
urlpatterns = patterns(
'access_log.views',
url(r'^downloads/(?P<content... | python |
import torch.nn as nn
import torch.nn.functional as F
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = nn.Sequential(
nn.Conv2d(in_channels=3, out_channels=64, kernel_size=7, stride=3, padding=0),
nn.BatchNorm2d(64),
n... | python |
__all__ = [
"AuthenticationViewDjangoMixin",
"AuthenticationViewMixin",
"AuthenticationViewRestMixin",
"Authenticator",
]
from .authenticator import Authenticator
from .views import AuthenticationViewDjangoMixin, AuthenticationViewMixin, AuthenticationViewRestMixin
| python |
# Copyright (c) 2006-2012 Filip Wasilewski <http://en.ig.ma/>
# Copyright (c) 2012-2016 The PyWavelets Developers
# <https://github.com/PyWavelets/pywt>
# See COPYING for license details.
"""
The thresholding helper module implements the most popular signal thresholding
functions.
"""
from __f... | python |
# -*- coding: utf-8 -*-
from flask_mongoengine import Document
from mongoengine import CASCADE
from mongoengine.fields import LazyReferenceField, BooleanField, StringField
from mpcontribs.api.contributions.document import Contributions
class Cards(Document):
contribution = LazyReferenceField(
Contribution... | python |
from collections import defaultdict
from django.conf import settings
from django.db import transaction, IntegrityError, models
from django.db.models import Q, Sum
from django.utils import timezone
from article.models import ArticleType
from money.models import Money, Decimal, Denomination, CurrencyData, Currency, Mon... | python |
import threading
from functools import wraps
def delay(delay=0.):
"""
Decorator delaying the execution of a function for a while.
"""
def wrap(f):
@wraps(f)
def delayed(*args, **kwargs):
timer = threading.Timer(delay, f, args=args, kwargs=kwargs)
timer.start()
... | python |
train_imgs_path="path_to_train_images"
test_imgs_path="path_to_val/test images"
dnt_names=[]
import os
with open("dont_include_to_train.txt","r") as dnt:
for name in dnt:
dnt_names.append(name.strip("\n").strip(".json"))
dnt.close()
print(dnt_names)
with open("baseline_train.txt","w") as btr:
for fi... | python |
import datetime
import time
import pandas as pd
from apscheduler.schedulers.background import BackgroundScheduler
from django_apscheduler.jobstores import DjangoJobStore, register_events, register_job
from django_apscheduler.models import DjangoJob, DjangoJobExecution
# from django_pandas.io import read_frame
from BiS... | python |
#!/usr/bin/env python
"""monitorTasks"""
# usage: ./monitorTasks.py -v ve2 -u admin -j 54334 -k 'Starting directory differ' -t 120
# import pyhesity wrapper module
from pyhesity import *
from time import sleep
from datetime import datetime
import os
import smtplib
import email.message
import email.utils
# command li... | python |
from graphite_feeder.handler.appliance.socket import energy_guard, presence
| python |
# https://atcoder.jp/contests/abc077/tasks/arc084_a
N = int(input())
a_arr = list(map(int, input().split()))
a_arr.sort()
b_arr = list(map(int, input().split()))
c_arr = list(map(int, input().split()))
c_arr.sort()
def find_least_idx(num: int, lst: list) -> int:
n = len(lst)
left = 0
right = n - 1
whi... | python |
from refiner.generic.refiner import Refiner
from topology.communication import Communication
from topology.node import Node, Direction
from topology.microToscaTypes import NodeType, RelationshipProperty
from topology.protocols import IP
import ipaddress
import copy
class DynamicDiscoveryRecognizer(Refiner):
def _... | python |
import __init__
from rider.utils.commands import main
main()
| python |
#!/usr/bin/env python3
# Paulo Cezar, Maratona 2016, huaauhahhuahau
s = ''.join(c for c in input() if c in "aeiou")
print("S" if s == s[::-1] else "N")
| python |
#import PIL and numpy
from PIL import Image
import numpy as np
#open images by providing path of images
img1 = Image.open("")
img2 = Imgae.open("")
#create arrays of above images
img1_array = np.array(img1)
img2_array = np.array(img2)
# collage of 2 images
#arrange arrays of two images in a single row
imgg = np.hsta... | python |
import argparse
import cv2
from glob import glob
from itertools import product
import numpy as np
import os
from tqdm import tqdm
from scipy.special import erf
import torch
import torch.nn as nn
from model.model import CompModel
import arithmetic_coding as ac
MAX_N = 65536
TINY = 1e-10
def load_img(path):
img =... | python |
# This code is generated by [Atcoder_base64](https://github.com/kyomukyomupurin/AtCoder_base64)
from base64 import b85decode
import subprocess
from pathlib import Path
from zlib import decompress
binary = "c%0=~Z){uD6~DIg$7xf?EiD9ERs&&bS7PF}DJfls?ZoXfIB96o(v?4#7u$)w`A=p)mxLi^skEwB(nV7@`hiJB>;pr5fN4VefV!Xz#-wcuQ>P)pq... | python |
from django.db import models
from django.contrib.auth.models import User
class Duck(models.Model):
color = models.CharField(max_length=30, default='yellow')
model = models.CharField(max_length=30)
price = models.FloatField(default=0)
owner = models.ForeignKey(User, null=True)
| python |
from polyphony import testbench
def if29(p0, p1, p2):
x = 0
if p0 == 0:
pass
elif p0 == 1:
if p1 == 0:
if p2 == 0:
x = 10
elif p1 == 1:
pass
elif p1 == 2:
pass
else:
return -1
#x = -1
re... | python |
import json
from django.core.management.base import BaseCommand
from ...models import Item
# BaseCommandを継承して作成
class Command(BaseCommand):
# python manage.py help import_itemで表示されるメッセージ
help = 'Create Item from json file'
def remove_null(self, value, default):
if value is None:
ret... | python |
#!/usr/bin/python
# encoding: utf-8
from helper import *
import cv2
import numpy as np
import os
import pickle
# https://klassenresearch.orbs.com/Plotting+with+Python
#import matplotlib.rc
# Make use of TeX
#rc('text',usetex=True)
# Change all fonts to 'Computer Modern'
#rc('font',**{'family':'serif'... | python |
"""
Developed by ThaumicMekanism [Stephan K.] - all credit goes to him!
"""
import contextlib
import sys
from typing import Callable, List
from tqdm.contrib import DummyTqdmFile
import examtool.api.download
from examtool.api.gradescope_upload import APIClient
from examtool.api.extract_questions import (
extract_g... | python |
from flask_wtf import FlaskForm
from wtforms.validators import InputRequired
from dmutils.forms.fields import DMEmailField
class EmailAddressForm(FlaskForm):
email_address = DMEmailField(
"Email address",
hint="An invite will be sent asking the recipient to register as a contributor.",
va... | python |
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(14, GPIO.OUT)
GPIO.setup(15, GPIO.IN)
try:
while True:
GPIO.output(14, GPIO.input(15))
finally:
GPIO.output(14, 0)
GPIO.cleanup() | python |
# -*- coding: utf-8 -*-
"""
Sony .spimtx LUT Format Input / Output Utilities
================================================
Defines *Sony* *.spimtx* *LUT* Format related input / output utilities objects.
- :func:`colour.io.read_LUT_SonySPImtx`
- :func:`colour.io.write_LUT_SonySPImtx`
"""
from __future__ import... | python |
import jwt
from os import environ
from datetime import datetime, timedelta
from flask_restful import (Resource, request)
from models.user import UserModel, UserSchema
from webargs.flaskparser import use_args
from webargs import fields
from flask import flash, redirect, url_for
user_args ={'username': fields.Str(requir... | python |
"""bsp methods"""
import base64
import json
import pprint
import pyodata
import sap.cli.core
import sap.cli.helpers
from sap import get_logger
from sap.errors import ResourceAlreadyExistsError
class CommandGroup(sap.cli.core.CommandGroup):
"""Management for BSP Applications"""
def __init__(self):
s... | python |
import pandas as pd
from datetime import datetime
from log import Log
class Asset:
def __init__(self):
self.data = None
self.name = None
self.symbol = None
self.exchange = None
self.header_lines = None
def read_header(self, filename):
self.header_lines = 0
... | python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:mod:`ranges`
==================
.. module:: ranges
:platform: Unix, Windows
:synopsis:
.. moduleauthor:: hbldh <henrik.blidh@nedomkull.com>
Created on 2015-06-04, 15:12
"""
from __future__ import division
from __future__ import print_function
from __future__... | python |
from setuptools import setup
setup(
name="sup",
author="Richard Liaw"
)
| python |
#!/usr/bin/env python
"""
Monitor system calls with dockit.
"""
import os
import sys
import atexit
import logging
import traceback
import lib_uris
import lib_util
import lib_common
from lib_properties import pc
os.environ["PYTHONUNBUFFERED"] = "1"
if True:
# TODO: Make this cleaner.
# FIXME: This does not ... | python |
from .video_resnet_triplet_attention import encoder as encoder_attention
from .video_resnet_triplet_bilinear import encoder as encoder_bilinear
from .video_resnet_triplet_gap import encoder as encoder_gap
from .video_resnet_triplet_mxp import encoder as encoder_mxp
from .video_resnet_triplet_frame_wise import encoder a... | python |
# -*- coding: utf-8 -*-
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module for creating clang-tidy builds."""
from __future__ import print_function
from chromite.cbuildbot import manifest_versi... | python |
from django.shortcuts import render
from rest_framework import status, generics, viewsets, views
from rest_framework.decorators import api_view
from rest_framework.response import Response
from django_filters.rest_framework import DjangoFilterBackend
from .models import People, Companies
from . import serializers
cla... | python |
from django.db import models
# Create your models here.
class Locker(models.Model):
is_using = models.BooleanField(default=False)
| python |
# coding=utf-8
# Copyright 2014 Janusz Skonieczny
"""
Gra w kółko i krzyżyk
"""
import pygame
import pygame.locals
import logging
# Konfiguracja modułu logowania, element dla zaawansowanych
logging_format = '%(asctime)s %(levelname)-7s | %(module)s.%(funcName)s - %(message)s'
logging.basicConfig(level=logging.DEBUG,... | python |
from django.db import models
# Create your models here.
# Con este archivo creo lo necesario para importar luego otro archivo que finalizara creando una BD en postgres
# Los metodos STR son los que van a mostrarse en la pagina en django
class Domicilio(models.Model):
calle = models.CharField(max_length=255)
n... | python |
from PyObjCTools.TestSupport import *
from Foundation import *
try:
unicode
except NameError:
unicode = str
class TestNSLinguisticTagger (TestCase):
@min_os_level('10.7')
def testConstants(self):
self.assertIsInstance(NSLinguisticTagSchemeTokenType, unicode)
self.assertIsInstance(NSLin... | python |
# Written by Jeremy Lee, 2020-10-30
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('umap', '0007_auto_20190416_1757'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
... | python |
from pyomo.core import *
class Model:
model = AbstractModel()
model.T = Set() # Index Set for time steps of optimization horizon
model.S = Set() # Index Set for time steps of optimization horizon
################################## PARAMETERS #################################
#... | python |
"""
This module contains event handlers related to the restart options
after a Codenames game ends.
"""
from flask_socketio import emit, leave_room
from flask_login import current_user
from app import socketio, db
from app.models.user_data import UserData
from app.games.codenames.models import CodenamesTeams
from ap... | python |
from pyg_base import is_num, is_ts, df_concat
import pandas as pd
import numpy as np
import numba
@numba.njit
def _p(x, y, vol = 0):
if vol == 0:
return 1. if x<y else -1. if x>y else 0.0
else:
one_sided_tail = 0.5 * np.exp(-abs(y-x)/vol)
return 1-one_sided_tail if x<y else one_sided_ta... | python |
from .data import *
from .selector import *
from .utils import *
from .dataset import * | python |
# Search for lines that start 'X' followed by any non whitespace
# characters and ':' then output the first group of non whitespace
# characters that follows
import re
hand = open('mbox-short.txt')
for line in hand:
line = line.rstrip()
x = re.findall('^X\S*: (\S+)', line)
if not x: continue
print(x)
| python |
from datetime import datetime
import numpy as np
from multiprocessing import Pool, cpu_count
import os
import sys
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.tensorboard import SummaryWriter
from .utils.preprocess_conllu import *
from .utils.helpers import *
from .utils.tools i... | python |
import sys, re
from mk_yaml_ontology import ont_node, dump_yaml
def replace_token(pattern, replacement, s):
replacement = f' {replacement} '
s = re.sub(f' ?{pattern} ', replacement, s)
s = re.sub(f' {pattern} ?', replacement, s)
return s
def mk_ont_node(line_string):
fields = line_string.split("\t... | python |
import os
import pytest
from aztk.models.plugins import PluginConfiguration
from aztk.models.plugins.internal import PluginManager
from aztk.error import InvalidPluginReferenceError
dir_path = os.path.dirname(os.path.realpath(__file__))
fake_plugin_dir = os.path.join(dir_path, "fake_plugins")
def RequiredArgPlugin(r... | python |
from abt.cli import main
| python |
import asyncio
import logging
from rsp1570serial.discovery import discover_source_aliases
if __name__ == "__main__":
logging.basicConfig(
level=logging.INFO, format="%(asctime)s %(levelname)s:%(message)s"
)
# asyncio.run(discover_source_aliases("socket://192.168.50.211:50002"))
asyncio.run(disc... | python |
from copy import deepcopy
class ensemble:
def __init__(self, obj):
self.vals = {None: (None,obj)}
def get(self):
if self.vals is None: return self.val
if len(self.vals)==1:
for nm in self.vals.values():
return nm[1]
return self
... | python |
'''
Created on May 2, 2016
@author: damianpa
'''
| python |
import yaml
import os
import git
import logging
from .i_repository_parser import IRepositoryParser
class RosdistroRepositoryParser(IRepositoryParser):
"""
Pulls the rosdistro-package and gets all urls from the rosdistro files.
"""
def __init__(self, settings: dict):
"""
Creates a new ... | python |
import sklearn as sk
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import fetch_olivetti_faces
faces = fetch_olivetti_faces()
print "DESCR"
print faces.DESCR
print "images.shape"
print faces.images.shape
print "data.shape"
print faces.data.shape
print "target.shape"
print faces.target.shape
| python |
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-p","--principal",action="store", type=float,
help="Principal", default=10000, required=True)
parser.add_argument("-r", "--rate", action="store", type=float,
help="rate of interest", default=10, req... | python |
from ASTModels import Node
memory_size = 30000
def execute(ast: [Node]) -> ([int],int):
memory = [0]*memory_size
mp = 0
for node in ast:
memory, mp = _evaluate(node,memory,mp)
print()
return memory, mp
def _evaluate(node: Node, memory: [int], mp: int) -> ([int],int):
if node.nod... | python |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import os
import sys
import tensorflow as tf
import numpy as np
from tensorflow.python.client import timeline
with tf.device("/cpu:0"):
a = tf.Variable([1],)
with tf.device("/cpu:1"):
b = tf.Variable([2],)
... | python |
class Vehicle:
def __init__(self, vin):
self.vin=vin
def GetVin(self):
return self.vin
class Car(Vehicle):
def Accelerate(self):
print("Car accelerating...")
class Truck(Vehicle):
def Accelerate(self):
print("Truck accelerating...")
def main():
cars=[Car("A12345689... | python |
# -*- coding: utf-8 -*-
import webapp2
from webapp2_extras import routes
import json
from api import routes as apiRoutes
from fetch import routes as fetchRoutes
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.write('QCurren... | python |
# -*- coding:utf-8 -*-
import unittest
from simple_ml.classify_data import DataCollector, get_iris
import numpy as np
class TestDataCollector(unittest.TestCase):
def test_get_iris(self):
dc = DataCollector()
x = dc.fetch_handled_data("iris")
self.assertIsInstance(x, np.ndarray)
s... | python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#################
# Module-Import #
#################
#eegpy-modules
try:
import eegpy
from eegpy.events import EventTable
from eegpy.misc import FATALERROR
from eegpy.ui.widgets.windowwidgets import EegpyBaseWin
from eegpy.ui.icon import image_from_ee... | python |
#!/usr/bin/env python3
"""
Prepares the test environment prior to starting hyperglass.
"""
import os
import glob
import shutil
from logzero import logger
working_directory = os.path.dirname(os.path.abspath(__file__))
parent_directory = os.path.dirname(working_directory)
def ci_copy_config():
"""Copies test confi... | python |
# Version: @VERSIONEER-VERSION@
"""The Versioneer - like a rocketeer, but for versions.
@README@
"""
# pylint:disable=invalid-name,import-outside-toplevel,missing-function-docstring
# pylint:disable=missing-class-docstring,too-many-branches,too-many-statements
# pylint:disable=raise-missing-from,too-many-lines,too-m... | python |
from dj_rest_auth.serializers import PasswordResetSerializer
from django.conf import settings
class PasswordResetSerializerFrontendHost(PasswordResetSerializer):
"""
Serializer for requesting a password reset e-mail.
"""
def save(self):
if "allauth" in settings.INSTALLED_APPS:
fro... | python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#2018-05-29 08-49
# Standard Modules
import logging
# Extra Modules
dependencies_missing = False
try:
import teradata
except ImportError:
dependencies_missing = True
from metasploit import module, login_scanner
# Metasploit Metadata
metadata = {
'name': 'Te... | python |
import itertools
import discord
from discord.ext import commands
from bot.constants import Colours
with open('bot/resources/evergreen/python_facts.txt') as file:
FACTS = itertools.cycle(list(file))
COLORS = itertools.cycle([Colours.python_blue, Colours.python_yellow])
class PythonFacts(commands.Cog):
"""S... | python |
from django.core.management.base import BaseCommand, CommandError
from ghu_main.email import EmailAPI
class Command(BaseCommand):
"""This command refers to the API in email.py for sending emails in-app"""
def __init__(self):
super(Command, self).__init__()
def add_arguments(self, parser):
... | python |
#!/usr/bin/python
#
# Copyright (c) 2016 Juniper Networks, Inc. All rights reserved.
#
import os
import sys
import argparse
import ConfigParser
import requests
from netaddr.ip import IPNetwork
from vnc_api.vnc_api import *
class ProvisionVgwInterface(object):
def __init__(self, args_str=None):
self._ar... | python |
#!/usr/bin/env python
def plain_merge(array_a: list, array_b: list) -> list:
pointer_a, pointer_b = 0, 0
length_a, length_b = len(array_a), len(array_b)
result = []
while pointer_a < length_a and pointer_b < length_b:
if array_a[pointer_a] <= array_b[pointer_b]:
result.append(arr... | python |
class RuleWriterMount(type):
def __init__(cls, name, bases, attrs):
if not hasattr(cls, 'rule_writers'):
cls.rule_writers = {}
else:
cls.register_rule_writer(cls)
def register_rule_writer(cls, rule_writer):
instance = rule_writer()
cls.rule_writers[insta... | python |
#!/usr/bin/env python
import os
import re
import shutil
import subprocess
import sys
toplevel = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
re_setup = re.compile(r'setup\(')
re_version = re.compile(r'(?<=\bversion=[\'"])([0-9a-zA-Z._+-]+)')
def update_version(gitversion, foundversion):
"""Choo... | python |
"""
Merge the tools
Consider the following:
A string, s, of length n.
An integer, k, where k is a factor of n.
We can split s into n/k subsegments where each subsegment, t(i), consists of a contiguous block of k characters in s.
Then, use each t(i) to create string u(i) such that:
The characters in u(i) are a subseque... | python |
import string
def is_pangram(sentence: str) -> bool:
"""
Determine if a given string contains all the characters from a to z.
sentence -- Any string.
returns -- true/false for if string contains all letters from a to z.
"""
letters = set(string.ascii_lowercase)
return letters.issubset(se... | python |
import numpy as np
from scipy.linalg import solve
from js.geometry.quaternion import Quaternion
for path in [ "../data/gazebo_winter/", "../data/mountain_plain/", "../data/gazebo_summer/" ]:
#for path in [ "../data/stairs/", "../data/apartment/", "../data/wood_summer/" ]:
with open(path+"pose_scanner_leica.csv") as... | python |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Rackspace Hosting
#
# 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... | python |
nome = str(input('Digite seu nome: ')).strip().upper()
print(f'Seu nome tem SILVA: ','SILVA' in nome) | python |
from .clip import *
from .esresnet import *
from .audioclip import AudioCLIP
from .audioclip_finetune import AudioCLIPFinetune | python |
loan_amount = eval(input('Loan Amount: '))
r = eval(input('Annual Interest Rate: '))
n = eval(input('Loan Duration in Months: '))
payment = (r*loan_amount)/(1-((1+r)**-n))
print('$', payment)
| python |
from .settings import *
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'myapp',
]
# Uncomment if you want to use a mysql/mariadb database. Don't forget to c... | python |
# coding:utf-8
""" 以tushare为源的市场数据表
"""
import loguru
import random
import time
import datetime
import tushare as ts
import pandas as pd
import matplotlib.pyplot as plt
from .sqldata import SqlDayManager, SqlBaseManager
import sys,os
sys.path.append(os.path.abspath("../timedata"))
import settings
from loguru impor... | python |
from localstack.dashboard import infra
from localstack.config import USE_SSL
def test_infra_graph_generation():
try:
graph = infra.get_graph()
except Exception as e:
if USE_SSL:
print('TODO: the Web UI in combination with USE_SSL=true is currently broken.')
return
a... | python |
from typing import Optional
from ..helpers.const import *
class ConfigData:
name: str
host: str
port: int
username: Optional[str]
password: Optional[str]
password_clear_text: Optional[str]
unit: int
update_entities_interval: int
update_api_interval: int
monitored_devices: list... | python |
# Generated by Django 3.2.8 on 2021-11-30 17:55
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... | python |
from user.models import CourseRegistration
# TODO:
# send mail with formatted relevant student test results to course adviser
# generate a list of courses registered buy a student for the current semester and session
def get_registered_courses(student, session, semester):
reg = CourseRegistration.objects.filter(... | python |
from output.models.ms_data.regex.re_l32_xsd.re_l32 import (
Regex,
Doc,
)
__all__ = [
"Regex",
"Doc",
]
| python |
from app import app
'''
set debug=False bellow when deploying to prod
'''
app.run(host='0.0.0.0', debug=True) | python |
#!/usr/bin/python3
# -*- mode: python -*-
"""
s3_gateway:
bottle/boto3 interface to view an s3 bucket in a web browser.
2021-02-15 slg - updated to use anonymous s3 requests,
per https://stackoverflow.com/questions/34865927/can-i-use-boto3-anonymously
2021-02-20 slg - add support for database querie... | python |
from torch import Tensor, _VF # noqa: F401
from torch.nn.utils.rnn import PackedSequence
import torch
import warnings
from typing import List, Optional, Tuple
class QuantizedLinear(torch.jit.ScriptModule):
__constants__ = ['scale', 'zero_point']
def __init__(self, other):
super(QuantizedLinear, se... | python |
import argparse
import os
import json
import xml.etree.cElementTree as ET
import logging
import numpy as np
import sys
sys.path.insert(0,'common')
from transforms3dbatch import *
from utils.quaternion import *
def parse_motions(path):
xml_tree = ET.parse(path)
xml_root = xml_tree.getroot()
xml_motions = x... | python |
from django.apps import apps as django_apps
default_app_config = 'scrapyd_dash.apps.ScrapydDashConfig' | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.