content
stringlengths
5
1.05M
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
import csv from gurd import similar name='' date='' left=[] height=[] with open('report/report_duration_tour.csv',encoding="utf_8") as f: csv_reader = csv.reader(f, delimiter=',') line_count = 0 for row in csv_reader: if line_count > 0 and line_count%2 == 0: name=r...
# Programmer: Chris Tralie # Purpose: To extract similarity alignments for use in the GUI import numpy as np import os import scipy.misc import matplotlib.pyplot as plt import json import base64 from taiko_pytorch.graphditty.SimilarityFusion import getS from taiko_pytorch.graphditty.DiffusionMaps import getDiffusionMap...
# Copyright (c) 2019 PaddlePaddle 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 appl...
""" As described in http://celery.readthedocs.org/en/latest/django/first-steps-with-django.html """ import os from celery import Celery os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings") app = Celery("{{ cookiecutter.project_name }}") # Using a string here means the worker will not have to # pickle t...
from muridesu.parse_stmts import parse_stmts from importlib.util import source_hash, MAGIC_NUMBER import marshal def _w_long(x): return (int(x) & 0xFFFFFFFF).to_bytes(4, 'little') def _code_to_hash_pyc(code, source_hash, checked=True): "Produce the data for a hash-based pyc." data = bytearray(MAGIC_NUMB...
#parses response from gateway class UserParse(object): @staticmethod def sessions_replace(response, session_id): importantdata = {} activeCounter = {} #priority = 0 allCounter = {} #priority = 1 sessionidCounter = {} #priority = 2 #sessions_replace is one of those undocumented events that have weird format...
#!/usr/bin/env python3 import benchwork import protos from os import urandom SAMPLE_RATE = 48000 SAMPLES_PER_MS = int(SAMPLE_RATE / 1000) client = "org.mycompany.myclient.134567" def make_sound(ms: int = 0) -> bytes: return bytearray(urandom(ms * SAMPLES_PER_MS)) @benchwork.benchmark(with_classes=protos.all_pr...
from collections import namedtuple stgram_tuple = namedtuple('stgram_tuple', ['date', 'text_lines', 'in_text_votes', 'reg_by_name_dict', # {rep_tuple: registered_bool} 'reg_by_party_dict', ...
# %% import os import pandas as pd import numpy as np import datetime from scripts import versionfinal,versionurgencia,versionespecifico,identificacionmotor,motorseguncilindrada,corregirmarca, progreso, motor, quitardecimal, valores, modelogeneral, especifico, origensegunvin, version, modelogenerico, especifico2, corre...
import os def install_dependencies(): stream = os.popen('git clone https://github.com/chrsmrrs/tudataset.git && \ pip --no-cache-dir install torch-scatter==latest+cu101 -f https://pytorch-geometric.com/whl/torch-1.7.0.html && \ pip --no-cache-dir install torch-sparse==latest+cu101 -f https...
import logging import os import os.path import urllib.request, urllib.parse, urllib.error from edge.writer.solrtemplateresponsewriter import SolrTemplateResponseWriter from edge.response.solrjsontemplateresponse import SolrJsonTemplateResponse class Writer(SolrTemplateResponseWriter): def __init__(self, configFil...
from .iimpute import IImpute from .version import __version__ name = "i-impute"
import glob import numpy as np import scipy.misc import os import time import constants import threading from utils import bb_util from utils import drawing from utils import py_util DIR_PATH = os.path.dirname(os.path.realpath(__file__)) WEIGHT_PATH = os.path.join(DIR_PATH, 'yolo_weights/') class ObjectDetector(ob...
from .args import ConsoleArgumentParser from .exception import ConsoleQuit, ConsoleExit from .server import ConsoleHandler, ConsoleServer from . import defaults from . import commands __all__ = ['ConsoleArgumentParser', 'ConsoleQuit', 'ConsoleExit', 'ConsoleHandler', 'ConsoleServer', 'defaults', 'commands'] __versio...
# Developer: Emre Cimen # Date: 06-17-2019 # Include CF.py file for Random Subspace Ensemble Classifier based on Conic Functions # Datasets' last column should be class information. import pandas as pd from sklearn.model_selection import StratifiedKFold import time import numpy as np from CF import EnsambleCF from...
import segmentation_models_pytorch as smp import torch import torch.nn.functional as F import torch.nn as nn class BCEDiceLoss(smp.utils.losses.DiceLoss): def __init__(self, eps=1e-7, activation="sigmoid"): super().__init__(eps, activation) if activation is None or activation == "none": ...
#!/usr/bin/env python import pynuodb import unittest from nuodb_base import NuoBase class NuoDBBasicTest(unittest.TestCase): def test_toByteString(self): self.assertEqual(pynuodb.crypt.toSignedByteString(1), '01'.decode('hex')) self.assertEqual(pynuodb.crypt.toSignedByteString(127), '7F'.dec...
from vizdoomaze.envs.vizdoomenv import VizdoomEnv class vizdoomazeTwo3(VizdoomEnv): def __init__(self): super(vizdoomazeTwo3, self).__init__(36)
# -*- coding: utf-8 -*- """ Abstract base class implementation """ __author__ = 'Samir Adrik' __email__ = 'samir.adrik@gmail.com' from uuid import uuid4 from abc import ABC, abstractmethod class Entity(ABC): """ abstract base entity class """ @abstractmethod def __init__(self): """ ...
from RachelCore.RachelCore import *
import sqlite3 import traceback import pandas as pd from django.db import IntegrityError from functions import pandda_functions from xchem_db.models import * def find_pandda_logs(search_path): print('RUNNING') # If statement checking if log files have been found log_files = pandda_functions.find_log_fil...
def correct_sentence(text: str) -> str: """ returns a corrected sentence which starts with a capital letter and ends with a dot. """ # your code here if text.endswith('.'): return text.capitalize() else: return text.capitalize() + "." if __name__ == '__main__': ...
# -*- coding: utf-8 -*- # Generated by Django 1.9.11 on 2017-04-26 20:59 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...
import unittest from decimal import Decimal from test.conftest import mocked_order_result from unittest.mock import patch import binance.client import pytest from bot.commands import BuyCommand from bot.data_types import ( ExchangeOrder, MarketBuyStrategy, MarketIndexStrategy, OrderTimeInForce, Or...
# -*- coding: utf-8 -*- """ # @file name : bn_in_123_dim.py # @author : Jianhua Ma # @date : 20210403 # @brief : three kinds of bn functions for different dimension data. """ import torch import numpy as np import torch.nn as nn import sys import os from tools.common_tools import set_seed hello_pytorch...
#!/usr/bin/env python3 ## Package stats.py ## ## Copyright (c) 2011 Steven D'Aprano. ## ## 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 lim...
while True: a,b=input().strip().split() if(a[0]=="*"):break cnt=ans=0 for c,x in enumerate(a): if(a[c]==b[c]):cnt=0 else: if cnt==0:ans+=1 cnt+=1 print(ans)
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright © 2014-2016 NetApp, Inc. All Rights Reserved. # # CONFIDENTIALITY NOTICE: THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION OF # NETAPP, INC. USE, DISCLOSURE OR REPRODUCTION IS PROHIBITED WITHOUT THE PRIOR # EXPRESS WRITTEN PERMISSION OF NETAPP, INC. from __fu...
class HmNotifyType(basestring): """ Notify type """ @staticmethod def get_api_name(): return "hm-notify-type"
from django.contrib.auth import get_user_model from django.http import Http404, HttpResponseRedirect, HttpResponseForbidden from django.shortcuts import render from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required from django.contrib.auth.views import login as django_log...
# Queries to _insert database tables database_tables = [ ################################################################ # Versioning """ CREATE TABLE IF NOT EXISTS versions ( name TEXT PRIMARY KEY, version TEXT ); """, #####################################################...
#!/usr/bin/env python """ Script for copying NIAK fMRI preprocessing report output into new folder structure for 2018 Simexp fMRI QC dashboard """ import time import json import shutil import inspect import argparse import pathlib as pal from distutils import dir_util copy_debug = False def populate_report(repo...
#!/usr/bin/env python3 # Test topic subscription. All SUBSCRIBE requests are denied. Check this # produces the correct response, and check the client isn't disconnected (ref: # issue #1016). from mosq_test_helper import * def write_config(filename, port): with open(filename, 'w') as f: f.write("port %d\n...
file_name = "ALIAS_TABLE_rate{}.txt" def gen_alias(weights): ''' @brief: generate alias from a list of weights (where every weight should be no less than 0) ''' n_weights = len(weights) avg = sum(weights)/(n_weights+1e-6) aliases = [(1, 0)]*n_weights smalls = ((i, w/(avg+1e-6)) ...
import torch from torch import nn class BaselineFaceExpression(torch.nn.Module): def __init__(self, in_features, out_features, hid_features, n_layers=2): super().__init__() assert hid_features > 1 backbone_layers = [] for i in range(n_layers - 1): curr...
import os from typing import Any, ClassVar, Dict, Optional import mlflow from mlflow.entities import Experiment from pydantic import root_validator, validator from coalescenceml.directory import Directory from coalescenceml.environment import Environment from coalescenceml.experiment_tracker import ( BaseExperim...
from .build import * from .parse.ast import * from .parse.matcher import *
from pytocl.main import main from driver import Driver from rnn_model import RNNModelSteering if __name__ == '__main__': main(Driver( RNNModelSteering("TrainedNNs/steer_norm_aalborg_provided_batch-50.pt"), logdata=False))
###################################################################### # Author: Dr. Scott Heggen TODO: Change this to your name # Username: heggens TODO: Change this to your username # # Assignment: A01 # # Purpose: A program that returns your Chinese Zodiac animal given a # birth year between 1988 an...
#!/usr/bin/env python import PIL from PIL import ImageFont from PIL import Image from PIL import ImageDraw #设置字体,如果没有,也可以不设置 #font = ImageFont.truetype("/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf",13) #打开底版图片 imageFile = "./HTML/example1.jpg" im1=Image.open(imageFile) # 在图片上添加文字 1 draw = Image...
from .models import UserData, Sounds from .src.DataManager import DataManager from .BasicManager import BasicManager, STORE_PATH class SoundManager(BasicManager): manager = DataManager(1, STORE_PATH) def get(self, user_id): result = None user = UserData.user_object(user_id) if user is...
n1 = float(input('Informe a 1° nota: ')) n2 = float(input('Informe a 2° nota: ')) media = (n1+n2) / 2 m = print('A média das notas = {}'. format(media))
# -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MarketingStatus Release: R5 Version: 4.5.0 Build ID: 0d95498 Last updated: 2021-04-03T00:34:11.075+00:00 """ from pydantic import Field from . import fhirtypes from . import backbonetype class MarketingStatus(backbonetype.BackboneType): ...
# Copyright (C) 2018 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Services for create and manipulate objects via admin UI.""" from lib import url from lib.page import dashboard from lib.page.modal.create_new_person import CreateNewPersonModal from lib.utils import selen...
# Python program for Dtra's single # source shortest path algorithm. The program is # for adjacency matrix representation of the graph from pwn import * # Library for INT_MAX import sys class Graph(): def __init__(self, vertices): self.V = vertices self.graph = [[0 for column in range(vertices)] fo...
import logging import os from aiogram import Bot, Dispatcher, types from aiogram.contrib.fsm_storage.memory import MemoryStorage from data import config # these paths will be used in the handlers files cwd = os.getcwd() input_path = os.path.join(cwd, "user_files", "input") output_path = os.path.join(cwd, "user_files...
# -*- coding: utf-8 -*- """ src ~~~~~~~~~~~~~~~~~~~ This module contains the application source code. The application is based upon Model-View-Controller architectural pattern. """
import numpy as np import pandas as pd import time from Bio import Entrez def addBibs(df): """Takes output from mergeWrite and adds cols for corresponding pubmed features. Parses Entrez esummary pubmed results for desired bibliographic features. Iterates for each pmid in input's generifs col. Casts re...
import numpy as np import random from q1_softmax import softmax from q2_sigmoid import sigmoid, sigmoid_grad from q2_gradcheck import gradcheck_naive def affine_forward(x, w, b): """ Computes the forward pass for an affine (fully-connected) layer. The input x has shape (N, d_1, ..., d_k) and contains a m...
print("sema")
from output.models.nist_data.list_pkg.negative_integer.schema_instance.nistschema_sv_iv_list_negative_integer_enumeration_2_xsd.nistschema_sv_iv_list_negative_integer_enumeration_2 import ( NistschemaSvIvListNegativeIntegerEnumeration2, NistschemaSvIvListNegativeIntegerEnumeration2Type, ) __all__ = [ "Nist...
import requests from lxml import html # 导入lxml.html模块 def crawl_second(url): #print(url) r = requests.get(url).content r_tree = html.fromstring(r) for i in r_tree.xpath('//a'): link = i.xpath('@href')[0] name = i.text; if(name is None): continue ...
# Copyright (c) 2014 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
from typing import Sequence from datetime import datetime class Message(object): def __init__(self, text: str, html: str, replies: Sequence[str], date: datetime, is_from_bot: bool): self._text = text self._html = html self._replies = replies self._date = date self._is_from_...
# Copyright (C) 2021 Intel Corporation # # SPDX-License-Identifier: MIT from collections import OrderedDict import json import os.path as osp from datumaro.components.annotation import AnnotationType from datumaro.util import find DATASET_META_FILE = 'dataset_meta.json' def is_meta_file(path): return osp.splite...
#!/usr/bin/env python3.6 # Work with Python 3.6 import json import time from requests import get, post with open("pool.json") as data_file: pools = json.load(data_file) with open("check_time.json") as data_file: last_check = json.load(data_file) with open("links.json") as data_file: data = json.load(data...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved from detectron2.layers import ShapeSpec from detectron2.utils.registry import Registry from .backbone import Backbone BACKBONE_REGISTRY = Registry("BACKBONE") """ Registry for backbones, which extract feature maps from images. """ def build_back...
# 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 applicable ...
from distutils.core import setup setup( name = 'pyrelations', packages = ['pyrelations'], version = '0.1.1', description = 'Small Python library for turning lists into relational record entries', author = 'Shawn Niederriter', author_email = 'shawnhitsback@gmail.com', url = 'https://github.com/Sniedes722...
import os import graphviz from exploration import modelling from exploration.data_exploration import X_train, y_train, X_test, y_test from exploration.modelling import cv from exploration.utils import BASE_DIR from sklearn import tree def format_result(result): res = ('\n{result[name]}' '\nbest_params...
## Convert a String to a Number! ## 8 kyu ## https://www.codewars.com/kata/544675c6f971f7399a000e79 def string_to_number(s): return int(s)
import scrapy from bs4 import BeautifulSoup from cultureBigdata.items import CultureNewsItem, CultureBasicItem, CultureEventItem import re import json import time from datetime import datetime def timestamp_to_str(timestamp): time_local = time.localtime(timestamp) dt = time.strftime("%Y-%m-%d %H:%M:%...
from random import randrange pole = '--------------------' import util import ai def vyhodnot(pole): if ("xxx" in pole): return "x" elif ("ooo" in pole): return "o" elif ("-" not in pole): return "!" else: return "-" def tah_hrace(pole): symbol = 'x' while T...
from setuptools import setup setup( name='pyCoinMiner', packages=['test'], test_suite='test', )
from django.contrib import admin from .models import User, Location, LocationUser # Register your models here. class UserAdmin(admin.ModelAdmin): fields = ('resources', ) class LocationAdmin(admin.ModelAdmin): fields = ('left_top', 'resources') class LocationUserAdmin(admin.ModelAdmin): fields = ('user',...
from SimPEG import Survey, Problem, Utils, np, sp, Solver as SimpegSolver from scipy.constants import mu_0 from SurveyFDEM import SurveyFDEM from FieldsFDEM import FieldsFDEM, FieldsFDEM_e, FieldsFDEM_b, FieldsFDEM_h, FieldsFDEM_j from simpegEM.Base import BaseEMProblem from simpegEM.Utils.EMUtils import omega class ...
# Generated by Django 3.0.6 on 2020-05-21 10:24 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ope...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jul 10 12:56:56 2019 @author: kylasemmendinger """ # import python libraries import pandas as pd import os # back out a directory to load python functions from "Scripts" folder org_dir_name = os.path.dirname(os.path.realpath('SensIndices_RCPlots.py')) ...
net_device = { 'ip_addr':'10.5.6.6', 'vendor':'cisco', 'platform':'ios', 'username':'malford', 'password':'chicken', } bgp_fields = { 'bgp_as':'65002', 'peer_as':'20551', 'peer_ip':'10.232.232.2' } net_device.update(bgp_fields) print("These are the dictionary keys: ") for x in net_device: print(x) print('\n') p...
import numpy as np from copy import deepcopy from sklearn.linear_model import LinearRegression class Transform: def __init__(self, parent=None): self.__parent = parent def __repr__(self): return f'Transform object of {self.__parent}' def level(self): """수평맞추기 """ ...
import os from py.path import local import pypy from pypy.tool.udir import udir from pypy.translator.c.test.test_genc import compile from pypy.rpython import extregistry import errno import sys import py def getllimpl(fn): return extregistry.lookup(fn).lltypeimpl def test_access(): filename = str(udir.join(...
#!/usr/bin/env python ''' Copyright (c) 2020 Modul 9/HiFiBerry 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, me...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np import sys from rrsg_cgreco._helper_fun import nlinvns from rrsg_cgreco import linop import skimage.filters from scipy.ndimage.morphology import binary_dilation as dilate # Estimates sensitivities and complex image. # (see Martin Uecker: Image reconstru...
# coding=utf-8 # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -----------------------------------------------------...
import csv from datetime import datetime import numpy as np import ray from ray.tune.logger import pretty_print from ray.rllib.agents.dqn.apex import ApexTrainer from ray.rllib.agents.dqn.apex import APEX_DEFAULT_CONFIG from ray.rllib.models import ModelCatalog from custom_mcar import MountainCar from masking_model im...
import sys sys.path.append("../../") from appJar import gui def launch(win): app.showSubWindow(win) def stopper(btn=None): return app.yesNoBox("Stop", "Stop?") app=gui() app.startSubWindow("Modal", modal=True, blocking=False, transient=False, grouped=True) app.setStopFunction(stopper) app.addLabel("l1",...
""" 实现 strStr() 函数。 给定一个 haystack 字符串和一个 needle 字符串,在 haystack 字符串中找出 needle 字符串出现的第一个位置 (从0开始)。如果不存在,则返回 -1。 示例 1: 输入: haystack = "heallo", needle = "ll" 输出: 2 示例 2: 输入: haystack = "aaaaa", needle = "bba" 输出: -1 说明: 当 needle 是空字符串时,我们应当返回什么值呢?这是一个在面试中很好的问题。 对于本题而言,当 needle 是空字符串时我们应当返回 0 。这与C语言的 strstr() 以及 Jav...
from django.db import models from rest_framework import serializers from rest_framework.reverse import reverse class InterfaceFile(models.Model): # Type choices TYPE_INPUT = 'input' TYPE_OUTPUT = 'output' TYPE_CHOICES = [ (TYPE_INPUT, 'Input'), (TYPE_OUTPUT, 'Output') ] name =...
from .pygraphs_base import Graph, Vertex, Edge from .tools import load_db, save_db __version__ = '0.0.2' def start(): print(''' pygraphs import successfully, version: {version} Author: Guo Fei, Email: guofei9987@foxmail.com repo: https://github.com/guofei9987/pygraphs, documents: https://...
__all__ = ["near_miss_v1", "near_miss_v2", "near_miss_v3", "condensed_knn", "edited_knn", "knn_und", "tomek_link"]
from flask import jsonify from limbook_api import AuthError, ImageUploadError from limbook_api.errors.validation_error import ValidationError def register_error_handlers(app): """ -------------------------------------- Error handlers for all expected errors -------------------------------------- ...
"""Entry point for the 'python -m electionsbot' command.""" import electionsbot if __name__ == "__main__": electionsbot.main()
import sys from contextlib import contextmanager from traceback import print_tb import yaml @contextmanager def capture_all_exception(_run): """Capture all Errors and Exceptions, print traceback and flush stdout stderr.""" try: yield None except Exception: exc_type, exc_value, trace = sys...
#!/usr/bin/env python3 # dcfac0e3-1ade-11e8-9de3-00505601122b # 7d179d73-3e93-11e9-b0fd-00505601122b import argparse import sys import matplotlib.pyplot as plt import numpy as np import sklearn.datasets import sklearn.metrics import sklearn.model_selection if __name__ == "__main__": parser = argparse.ArgumentPars...
import json from .Handler import Handler class PutPokemonHandler(Handler): def __init__(self): pass def put_handler(self, pokemon_info): poke_number, poke_name, poke_types = pokemon_info["number"], pokemon_info["name"], pokemon_info["types"] # mapping to list mapping_id = self.g...
b='Yun Wen Xiong Gai Gai Bao Cong Yi Xiong Peng Ju Tao Ge Pu E Pao Fu Gong Da Jiu Gong Bi Hua Bei Nao Shi Fang Jiu Yi Za Jiang Kang Jiang Kuang Hu Xia Qu Fan Gui Qie Zang Kuang Fei Hu Yu Gui Kui Hui Dan Gui Lian Lian Suan Du Jiu Jue Xi Pi Qu Yi Ke Yan Bian Ni Qu Shi Xun Qian Nian Sa Zu Sheng Wu Hui Ban Shi Xi Wan Hua X...
#!/usr/bin/env python from __future__ import print_function import glob, re, os, sys, time import boto3 import urllib import argparse parameters = argparse.ArgumentParser(description="Create a new EBS Volume and attach it to the current instance") parameters.add_argument("-s","--size", type=int, required=True) parame...
# -*- coding: utf-8 -*- from matplotlib.patches import Circle, Patch from matplotlib.pyplot import axis, legend, subplots from numpy import exp, pi, sqrt from ....definitions import config_dict COND_COLOR = config_dict["PLOT"]["COLOR_DICT"]["PHASE_COLORS"][0].copy() INS_COLOR = config_dict["PLOT"]["COLOR_DICT"]["PHA...
from albumcollections import db MAX_SPOTIFY_PLAYLIST_ID_LENGTH = 50 MAX_SPOTIFY_SNAPSHOT_ID_LENGTH = 100 MAX_SPOTIFY_USER_ID_LENGTH = 50 class AcUser(db.Model): id = db.Column(db.Integer, primary_key=True) spotify_user_id = db.Column(db.String(MAX_SPOTIFY_USER_ID_LENGTH), unique=True, nullable=False) pla...
from tensorflow import keras import tensorflow as tf import numpy as np import matplotlib.pyplot as plt fashion_mnist = keras.datasets.fashion_mnist (train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data() class_names = ['T-shirt/top', 'Trouser', 'Pullover', 'Dress', 'Coat','Sandal', 'Sh...
import re def filter_language(el, res: dict = None): if not res: res = {} if isinstance(el, dict): for k, v in el.items(): match = re.fullmatch(r'\w\w_\w\w', k) if match: res[k] = filter_language(v, res=res) else: return filte...
# coding: utf-8 """ Uptrends API v4 This document describes Uptrends API version 4. This Swagger environment also lets you execute API methods directly. Please note that this is not a sandbox environment: these API methods operate directly on your actual Uptrends account. For more information, please visit ...
from django import forms from .models import Competition, Training, Competitor, Trainingpresence, Driver, Event, Result, Location from datetimewidget.widgets import DateTimeWidget class CompetitionForm(forms.ModelForm): class Meta: model = Competition fields = ['name', 'starttime', 'endtime', 'desc...
'''OpenGL extension NV.viewport_array2 This module customises the behaviour of the OpenGL.raw.GLES2.NV.viewport_array2 to provide a more Python-friendly API Overview (from the spec) This extension provides new support allowing a single primitive to be broadcast to multiple viewports and/or multiple layers. A s...
#!/usr/bin/env python # # Copyright (c) 2018 TrueChain Foundation # # 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...
## this is where i test all of my shit code ## before I put it in my other shit code # from selenium import webdriver # # PROXY = '142.54.163.90:19006' # IP:PORT # # chrome_options = webdriver.Options() # chrome_options.add_argument('--proxy-server=http://%s' % PROXY) # # chrome = webdriver.Chrome(chrome_options=chrom...
"""Intranet de la Rez - Main Pages Routes""" import datetime import json import flask from flask_babel import _ from discord_webhook import DiscordWebhook from app import context from app.main import bp, forms from app.models import Ban from app.tools import captcha, utils, typing @bp.route("/") @bp.route("/index"...
from lxml import html from pytracking.tracking import get_configuration, get_open_tracking_url, get_click_tracking_url DEFAULT_ATTRIBUTES = {"border": "0", "width": "0", "height": "0", "alt": ""} def adapt_html(html_text, extra_metadata, click_tracking=True, open_tracking=True, configuration=None, **kwargs): "...
from __future__ import division, unicode_literals, print_function """ Utility classes for retrieving elemental properties. Provides a uniform interface to several different elemental property resources including ``pymatgen`` and ``Magpie``. """ import os import json import six import abc import numpy as np import pan...