content stringlengths 5 1.05M |
|---|
from typing import Dict, Optional
from sqlalchemy import column, literal_column, select
from panoramic.cli.husky.core.sql_alchemy_util import (
quote_identifier,
safe_identifier,
sort_columns,
)
from panoramic.cli.husky.service.blending.blending_taxon_manager import (
BlendingTaxonManager,
)
from pano... |
import theano
import theano.tensor as T
import treeano
from treeano.sandbox.nodes import bttf_mean
fX = theano.config.floatX
@treeano.register_node("bachelor_normalization")
class BachelorNormalizationNode(treeano.NodeImpl):
hyperparameter_names = ("bttf_alpha",
"alpha",
... |
print("My name is John")
|
# -*- coding: utf-8 -*-
# Copyright 2013 Simonas Kazlauskas
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation
from os import path, makedirs
from hashlib import sha1
from gi.repository... |
# Edit by Tianyu Ma
# coding: utf-8
"""
=====
Third step: merge csv files
=====
"""
|
import json
import string
import csv
fname = './data/obama_speech.txt'
fhand = open(fname, 'r')
text = fhand.read()
lines = text.split('\n')
line_count = len(lines)
word_count = 0
for line in lines:
words = line.split()
for word in words:
if word == " ":
continue
word_count += 1
pr... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-23 21:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Words... |
# for循环是一种遍历列表的有效方式, 但在for循环中不应修改列表, 否则将导致Python难以跟踪其中的元素.
# 要在遍历列表的同时对其进行修改, 可使用while循环.
# 在列表之间移动元素
unconfirmed_users = ['alice', 'brian', 'candace'] # 待验证用户列表
confirmed_users = [] # 已验证用户列表
# 遍历列表对用户进行验证
while unconfirmed_users: # 当列表不为空时返回True, 当列表为空时, 返回False
current_user = unconfirmed_users.pop() # 取... |
from datetime import datetime
from lib import d,t
def main():
r = t.t()
r = (r+(' '+(d.d())))
print(f'{r} :)')
return(0x01)
if(__name__==('__main__')): main()
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Script to help in managing Usenet hierarchies. It generates control
# articles and handles PGP keys (generation and management).
#
# signcontrol.py -- v. 1.4.0 -- 2014/10/26
#
# Written and maintained by Julien ÉLIE.
#
# This script is distributed under the MIT License. P... |
with open('p11_grid.txt', 'r') as file:
lines = file.readlines()
n = []
for line in lines:
a = line.split(' ')
b = []
for i in a:
b.append(int(i))
n.append(b)
N = 0
for i in range(20):
for j in range(20):
horizontal, vertical, diag1, diag2 = 0, 0,... |
# -*- coding: utf-8 -*-
#
# COMMON
#
page_action_basket = "Корзина"
page_action_enter = "Войти"
page_action_add = "Добавить"
page_action_cancel = "Отмена"
page_action_yes = "Да"
page_action_save = "Сохранить"
page_action_action = "Действие"
page_action_modify = "изменить"
page_action_remove = "удалить"
page_message_e... |
#!/usr/bin/env python3
# -*-coding: utf-8 -*-
"""
.. invisible:
_ _ _____ _ _____ _____
| | | | ___| | | ___/ ___|
| | | | |__ | | | |__ \ `--.
| | | | __|| | | __| `--. \
\ \_/ / |___| |___| |___/\__/ /
\___/\____/\_____|____/\____/
Created on October 14, 2014
█████████████... |
from typing import List
# ------------------------------- solution begin -------------------------------
class Solution:
def canWinNim(self, n: int) -> bool:
return n % 4 == 0
# ------------------------------- solution end - --------------------------------
if __name__ == '__main__':
input = 4
print("In... |
bat = int(input('bateria = '))
def batery (bat):
if bat == 0:
print('morri')
elif bat > 0 and bat < 21:
print('conecte o carreador')
elif bat > 20 and bat < 80:
print('carregando...')
elif bat > 79 and bat < 100:
print('estou de boa')
elif bat == 100:
print('p... |
#coding:utf8
'''
Created on 2016年4月20日
@author: wb-zhaohaibo
'''
import MySQLdb
print MySQLdb
conn = MySQLdb.Connect(
host="127.0.0.1",
port=3306,
user="root",
passwd="admin",
db="testsql... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Script for updating pymoprhy2 dictionaries (Russian and Ukrainian).
Please note that it is resource-heavy: it requires > 3GB free RAM and about
1GB on HDD for temporary files.
Usage:
update.py (ru|uk) (download|compile|package|cleanup) ...
update.py (ru|uk) al... |
import Selenium_module as zm
print("Zillow Downloader")
url = input("URL: ")
image_links, title = zm.get_links(url)
zm.get_images(image_links, title)
zm.cleanup_exit()
|
from flask_wtf import FlaskForm
from datetime import datetime
from wtforms import BooleanField, DateTimeField, HiddenField, SelectField, StringField, SubmitField, ValidationError
from wtforms.ext.sqlalchemy.fields import QuerySelectField
from wtforms.validators import Required, Optional
from .. models import Element, E... |
import numpy as np
import os
import cv2
import sys
import time
import dlib
import glob
import argparse
import voronoi as v
def checkDeepFake(regions):
return True
def initialize_predictor():
# Predictor
ap = argparse.ArgumentParser()
if len(sys.argv) > 1:
predictor_path ... |
r""" FSS-1000 few-shot semantic segmentation dataset """
import os
import glob
from torch.utils.data import Dataset
import torch.nn.functional as F
import torch
import PIL.Image as Image
import numpy as np
class DatasetFSS(Dataset):
def __init__(self, datapath, fold, transform, split, shot, use_original_imgsize)... |
# The Python print statement is often used to output variables.
# To combine both text and a variable, Python uses the '+' character:
x = "awesome"
print("Python is " + x)
# You can also use the '+' character to add a variable to another variable:
x = "Python is "
y = "awesome"
z = x + y
print(z)
# For numbers, the '... |
from keras.applications.resnet50 import ResNet50 as RN50
from keras.preprocessing import image
from keras.models import Model
from keras.layers import Flatten
from keras.layers import Dense, GlobalAveragePooling2D
from keras import backend as K
from keras.utils import plot_model
from keras.preprocessing.image import Im... |
import ctypes
# Implements the Array ADT using array capabilities of the ctypes module.
class Array :
# Creates an array with size elements.
def __init__( self, size ):
assert size > 0, "Array size must be > 0"
self._size = size
# Create the array structure using the ctypes module.
... |
#!/usr/bin/env python3
# Copyright (c) 2021 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
#
# U... |
# Unit test set_out_sample_residuals ForecasterAutoreg
# ==============================================================================
import numpy as np
import pandas as pd
from skforecast.ForecasterAutoreg import ForecasterAutoreg
from sklearn.linear_model import LinearRegression
def test_predict_interval_output_w... |
import os
import gzip
import cPickle
from config import config
for fold in range(5):
filename = os.path.join(config.data_dir, 'atis.fold' + str(fold) + '.pkl.gz')
with gzip.open(filename, 'rb') as f:
train_set, valid_set, test_set, dicts = cPickle.load(f)
labels2idx_, tables2idx_, words2idx_ =... |
import unittest
from bsim.connection import *
class TestConnectionMethods(unittest.TestCase):
def test_data(self):
c = Connection(debug=False)
c.delay_start = [0, 0, 3, 0, 1, 0, 0, 0, 0, 2, 0, 0]
c.delay_num = [1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0]
c.rev_delay_start = [0, 0, 0, 1, ... |
class History(object):
def __init__(self, name, userID):
self.name = name
self.userID = userID
self.history = []
def logMessage(self, lastMessage):
if len(self.history) > 10:
self.history.pop()
self.history.append(lastMessage)
def getLastMessages(self, n... |
import logging
__title__ = 'django_nine.tests.base'
__author__ = 'Artur Barseghyan'
__copyright__ = '2015-2019 Artur Barseghyan'
__license__ = 'GPL-2.0-only OR LGPL-2.1-or-later'
__all__ = (
'LOG_INFO',
'log_info',
)
logger = logging.getLogger(__name__)
LOG_INFO = True
def log_info(func):
"""Logs some... |
import os
import datetime
import MySQLdb
con = MySQLdb.connect(host='DBSERVER', user='DBUSER', passwd='DBPASSWD', db='DB')
cur = con.cursor()
cur.execute("SHOW TABLES")
data = "SET FOREIGN_KEY_CHECKS = 0; \n"
tables = []
for table in cur.fetchall():
tables.append(table[0])
for table in tables:
if table != "f... |
from .data_parallel import CustomDetDataParallel
from .sync_batchnorm import convert_model
|
import os
from setuptools import setup
setup(name='NNApp01',
version='0.1.0',
description='NN Programming Assignment ',
author='Dzmitry Buhryk',
author_email='dzmitry.buhryk@gmail.com',
license='MIT',
install_requires=['flask', 'werkzeug'],
tests_require=['requests', 'flask',... |
from multiprocessing import Process
import envServer
from distutils.dir_util import copy_tree
from random import shuffle
import sys
sys.path.append("../pyutil")
sys.path.append("..")
import signal
import parseNNArgs
import traceback
import threading
import pickle
import shutil
import glob
import os
import random
im... |
#!/usr/bin/env python3
#-*- encoding: UTF-8 -*-
def main():
try:
nota1 = float(input("1ª nota: "))
nota2 = float(input("2ª nota: "))
except:
print("Apenas valores numéricos devem ser informados!")
if(nota1 < 0 or nota1 > 10 or nota2 < 0 or nota2 > 10):
print("Notas inválidas... |
from . import util
ut = util.Util()
reload(util)
class ViewerMarlin():
def open_file(self, path):
with open(path) as f:
l = f.readlines()
# print(type(l))
# print(len(l))
# print(l)
return l
def get_value_move(self, str_):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of tofbot, a friendly IRC bot.
# You may redistribute it under the Simplified BSD License.
# If we meet some day, and you think this stuff is worth it,
# you can buy us a beer in return.
#
# Copyright (c) 2011,2015 Etienne Millon <etienne.millon@gmail.... |
# Copyright 2016 Peter Dymkar Brandt 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 numpy import absolute, isnan, where
from scipy.spatial.distance import correlation
def compute_correlation_distance(x, y):
correlation_distance = correlation(x, y)
if isnan(correlation_distance):
return 2
else:
return where(absolute(correlation_distance) < 1e-8, 0, correlation_di... |
# This sample tests the case where a subclass of Dict uses
# a dictionary literal as an argument to the constructor call.
from collections import Counter, defaultdict
from typing import Callable, Generic, Mapping, Optional, TypeVar
c1 = Counter({0, 1})
reveal_type(c1, expected_text="Counter[int]")
for i in range(256... |
# Sequência dos termos numéricos de uma função arbitrária.
# Printa a sequência dos termos da função X^2 até um termo escolhido.
n = int(input())
for i in range(0,n):
print(i*i)
i = i+1
# Printa a sequência dos termos da função X^3 até um termo escolhido
y = int(input())
for i in range (0,y... |
from bisect import bisect
from contextlib import closing, contextmanager
from itertools import accumulate, chain, islice, zip_longest
from multiprocessing import Lock, RawValue, Process
from os import cpu_count
from re import sub
from sys import argv, stdout
output_file = open("bench_output-fasta_bg.txt", mode="wb", b... |
# ______ _ _ _ _ _ _ _
# | ___ \ | | | | (_) (_) | | (_)
# | |_/ / __ ___ | |__ __ _| |__ _| |_ ___| |_ _ ___
# | __/ '__/ _ \| '_ \ / _` | '_ \| | | / __| __| |/ __|
# | | | | | (_) | |_) | (_| | |_) | | | \__ \ |_| | (__
# \_| |_| \___/|_.__/ \__,_|... |
# -*- coding: utf-8 -*-
"""
drift - Logging setup code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Set up logging based on config dict.
"""
from __future__ import absolute_import
import os
import logging
from logging.handlers import SysLogHandler
import logging.config
import json
import datetime
import s... |
# -*- coding: utf-8 -*-
'''
Created on 2017/09/14
@author: yuyang
'''
import os
import urllib
import uuid
from docx.shared import Pt
from docx.shared import RGBColor
from docx.shared import Inches
JPEG_EXTENSION = '.jpg'
PNG_EXTENSION = '.png'
GIF_EXTENSION = '.gif'
SPLIT_STRING = '///'
def add_author(document, a... |
"""
Views for the app
"""
from __future__ import absolute_import
from __future__ import division
import os
import uuid
from auth import constants
from auth.forms import \
CategoryForm, \
CountryForm, \
CurrencyForm, \
GatewayForm, \
LoginVoucherForm, \
MyUserForm, \
NetworkForm, \
Ne... |
# Copyright (c) Naas Development Team.
# Distributed under the terms of the Modified BSD License.
import os
c = get_config()
c.NotebookApp.ResourceUseDisplay.track_cpu_percent = True
c.NotebookApp.ResourceUseDisplay.mem_warning_threshold = 0.1
c.NotebookApp.ResourceUseDisplay.cpu_warning_threshold = 0.1
# We rely o... |
#FUNÇÕES (FUNCTION)
#EXEMPLO SEM O USO DE FUNÇÃO :(
rappers_choice = ["L7NNON", "KB", "Trip Lee", "Travis Scott", ["Lecrae", "Projota", "Tupac"], "Don Omar"]
rappers_country = {"BR":["Hungria", "Kamau", "Projota", "Mano Brown", "Luo", "L7NNON"],
"US":["Tupac", "Drake", "Eminem", "KB", "Kanye West", "Lecrae", "Tra... |
from __future__ import print_function
import numpy as np
import time, os, sys
import matplotlib.pyplot as plt
from scipy import ndimage as ndi
from skimage import color, feature, filters, io, measure, morphology, segmentation, img_as_ubyte, transform
import warnings
import math
import pandas as pd
import argparse
impor... |
#!/usr/bin/env python3
"""This script adds Type B uncertainties to those given in the .apu file.
"""
from sys import exit
from glob import glob
from numpy import matrix
from math import radians, sin, cos, sqrt, atan2, degrees
def dd2dms(dd):
minutes, seconds = divmod(abs(dd) * 3600, 60)
degrees, minutes = d... |
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2018 ZhicongYan
#
# 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 us... |
from ctypes import *
import threading
import json
import os
tls_var = threading.local()
import csv
csv.field_size_limit(500000)
from G2Exception import TranslateG2ModuleException, G2ModuleNotInitialized, G2ModuleGenericException
def resize_return_buffer(buf_, size_):
""" callback function that resizs return buff... |
import torch.nn as nn
import torch.nn.functional as F
class CNN(nn.Module):
# https://github.com/rensutheart/PyTorch-Deep-Learning-Tutorials/blob/master/part3_MNIST.py
def __init__(self, n_classes):
super(CNN, self).__init__()
# define all the components that will be used in the NN (these can ... |
# Copyright 2014 - Red Hat 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 writin... |
from .R2 import R2
|
import os
def handle_headers(frame, request, response):
# Send a 103 response.
resource_url = request.GET.first(b"resource-url").decode()
link_header_value = "<{}>; rel=preload; as=script".format(resource_url)
early_hints = [
(b":status", b"103"),
(b"link", link_header_value),
]
... |
# Copyright 2018 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
from rest_framework import serializers
from .models import Product
class ProductSerializer(serializers.ModelSerializer):
# Get the image url by serializing `ImageField`
image = serializers.ImageField(max_length=None, allow_empty_file=False, allow_null=True, required=False)
class Meta:
# Model to... |
import os
import platform
import time
import sys
import importlib
import glob
import subprocess
import selectors
import multiprocess
import paramiko
from comm.platform import linux_win, run_cmd_list, run_cmd
from compute import Config_ini
from compute.log import Log
def get_local_path():
"""
:return:Get... |
# coding: utf-8
from django.core.management.base import BaseCommand, CommandError
from ...models import Account, Tweet
class Command(BaseCommand):
"""Generates the HTML version of all the Tweets.
Does this by re-saving every Tweet, one-by-one.
For one account:
./manage.py generate_tweet_html --accou... |
import pytest
@pytest.fixture
def supply_AA_BB_CC():
aa=25
bb =35
cc=45
return [aa,bb,cc] |
#!/usr/pkg/bin/python2.7
from __future__ import print_function
# grep: serach for string patterns in files
import sys
import os
import argparse
import re
def _fg(file, pattern, ops):
with open(file, 'r') as f:
text = f.readlines()
z = len(text)
for i in range(z):
line = text[i]
result = patt... |
from collections import defaultdict
import dill
import numpy as np
import time
import torch.multiprocessing as mp
mp.set_sharing_strategy('file_system')
from starter_code.infrastructure.log import renderfn
from starter_code.sampler.hierarchy_utils import flatten_rewards, build_interval_tree, set_transformation_ids, ge... |
# Copyright (c) 2018 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 appli... |
#-*- coding:utf-8 -*-
# 2.2 变量
message = "Hello Python world!"
print(message)
message = "现在的时间是:2021年6月11日21:07:18"
print(message)
# 2.3 字符串
name = "ada love lace"
print(name.title())
print(name.upper())
print(name.lower())
first_name = "ada"
last_name = "love lace"
full_name = first_name + last_name
print(full_name... |
from .model_108_basicDdSt import BasicDdSt
|
import numpy as np
from py_wake.site._site import UniformWeibullSite
from py_wake.wind_turbines import OneTypeWindTurbines
wt_x = [134205, 134509, 134813, 135118, 135423]
wt_y = [538122, 538095, 538067, 538037, 538012]
power_curve = np.array([[3.0, 0.0],
[4.0, 15.0],
[... |
import unittest
class Solution:
def hIndex(self, citations):
"""
:type citations: List[int]
:rtype: int
"""
if not citations:
return 0
citations.sort(reverse=True)
h = 0
for i in citations:
if i > h:
h += 1
... |
# -*- coding: utf-8 -*-
"""Console script for rps."""
import click
from .log import get_log
import asyncio
from .server import Site
from .api import start
def validate_url(ctx, param, value):
try:
return value
except ValueError:
raise click.BadParameter('url need to be format: tcp://ipv4:por... |
from .controllers.product import ProductController
from .models import commerce
from .models import inventory
from django import forms
from django.db.models import Q
class ApplyCreditNoteForm(forms.Form):
required_css_class = 'label-required'
def __init__(self, user, *a, **k):
''' User: The user wh... |
from typing import Tuple
from hypothesis import given
from gon.base import (Compound,
Geometry)
from gon.hints import Scalar
from tests.utils import (equivalence,
robust_invert)
from . import strategies
@given(strategies.geometries_with_coordinates_pairs)
def test_basi... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from math import fabs
import compas
import numpy as np
import scipy as sp
import scipy.linalg
import scipy.sparse
import scipy.sparse.linalg
def compute_displacement_x(mesh, gate_points, x_size, z_size, coeff... |
"""
A class to hold polytopes in H-representation.
Francesc Font-Clos
Oct 2018
"""
import numpy as np
class Polytope(object):
"""A polytope in H-representation."""
def __init__(self, A=None, b=None):
"""
Create a polytope in H-representation.
The polytope is defined as the set of
... |
import udfalcon
def test_outputs_return_results():
assert isinstance(udfalcon.fly({'output': 'return', 'mode': 'test'}), dict)
|
import re
def main():
eventRegex = r'\s*\n*-{50,}\s*\n*'
placeRegex = r'(?i)(?:place|yer|location|mekan)\s*:\s+(.*?)\s*?[\n\r]'
dateRegex = r'(?i)(?:date|tarih|deadline)\s*:\s+(.*?)\s*?[\n\r]'
timeRegex = r'(?i)(?:time|zaman)\s*:\s+(.*?)\s*?[\n\r]'
testData = getTestData()
for i in range... |
import graphene
from .models import Media
from .service import MediaService
service = MediaService()
class MediaType(graphene.ObjectType):
'''
Media Type,
represents a GraphQL version of a media entity
'''
id = graphene.ID(required=True)
mime = graphene.String(required=True)
data ... |
'''
This is Main class of RFCN Model
Contain the model's framework and call the backbone
'''
from KerasRFCN.Model.ResNet import ResNet
from KerasRFCN.Model.ResNet_dilated import ResNet_dilated
from KerasRFCN.Model.BaseModel import BaseModel
import KerasRFCN.Utils
import KerasRFCN.Losses
import keras.layers as KL
impo... |
# -*- coding: utf-8 -*-
"""Utilities for interacting with data and the schema."""
import json
import logging
from collections import defaultdict
from functools import lru_cache
from pathlib import Path
from typing import Dict, Mapping, Set, Union
from .constants import (
BIOREGISTRY_PATH,
COLLECTIONS_PATH,
... |
from dataclasses import dataclass
from time import time
from typing import Union, Tuple
import psycopg2
from loguru import logger
from pony.orm import Database, Required, PrimaryKey, db_session
@dataclass()
class GetQuery:
mol_smi: str
search_type: str
fp_type: Union[bool, str] = False
sort_by_simila... |
from substrateinterface import SubstrateInterface
import os
from utils import get_project_root_dir
# execution environment (for testing) --------------
main_script = os.path.join(get_project_root_dir(), "StakingManager.py")
# to get your python env, execute "which python" in CLI with env activated
# E.g. for anaconda ... |
from aurora.amun.client.session import AmunSession
def main():
# Calling with no token in constructor will load one from an environment variable if provided
# or a file in HOME/.
session = AmunSession()
print("Getting Valuations")
valuations = session.get_valuations()
numToShow = 5
print... |
import torch
import torch.nn as nn
from torch.nn.utils.rnn import pack_padded_sequence
from torch import Tensor
from models.convolutional_rnn import Conv2dLSTM
class RNNEncoder(nn.Module):
def __init__(self, num_layers: int = 2, hidden_size: int = 512, action__chn: int = 64, speed_chn: int = 64):
super(R... |
# from .helpers.utils_ import *
# from .helpers.math_ import MathClass
# from .helpers.mm import MatrixMadness
from .main import *
|
from __future__ import print_function
from __future__ import absolute_import
import astroid
from pylint.interfaces import IAstroidChecker
from pylint.checkers import BaseChecker
from pylint.checkers.utils import check_messages
MSGS = {
'E1113': ('Import inside a function from shining is not allowed',
... |
from selenium import webdriver
class Application:
def __init__(self):
self.wd = webdriver.Chrome(executable_path="C:\\chromedriver_win32\\chromedriver.exe")
self.wd.implicitly_wait(60)
def open_home_page(self):
wd = self.wd
wd.get("http://localhost/addressbook/addressbook/grou... |
"""protected and listed fields on Location
Revision ID: f8c342997aab
Revises: 5df6df91a533
Create Date: 2021-02-02 11:10:09.250494
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f8c342997aab'
down_revision = '5df6df91a533'
branch_labels = None
depends_on = No... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
from click_captcha import ClickCaptcha
import fire
import sys
import codecs
sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
sys.stdout.write("Your content....")
def main(app_name, count=300, enable_dummy_word=False, font_path="extend/msyh.ttf", word_list_file_path... |
from __future__ import absolute_import, print_function, unicode_literals
import sys
import binascii
import base64
from zope.interface import implementer
from pyramid.interfaces import IAuthenticationPolicy
from pyramid.authentication import CallbackAuthenticationPolicy, \
AuthTktAuthenticationPolicy
from py... |
import indicators.indicator_settings as indicator_settings
settings = indicator_settings.global_settings['VAR_LB']
table_name = "VAR_LB"
for i in list(settings.keys()):
table_name += "_" + str(settings[i])
settings.update(
{
'db_path' : indicator_settings.indicators_root_path + "/var_lb/var_lb_db.sqlit... |
from tkinter import *
from tkinter import ttk
from PIL import Image, ImageTk
from tkinter import messagebox
import mysql.connector
from mymain import AAS
def main():
win = Tk()
app = Login_Window(win)
win.mainloop()
class Login_Window:
def __init__(self, root):
self.root = root
self.... |
import pytest
from tests.compiler import compile_base
from thinglang.compiler.errors import SelfInStaticMethod
SELF_USE_IN_STATIC_METHOD = '''
thing Program
has number n1
static does something
{}
'''
def test_direct_self_use_in_static_function():
with pytest.raises(SelfInStaticMet... |
# -*- coding: utf-8 -*-
import struct
SIZE = "I"
SIZEB = "B"
def stringToByteList(txt):
byteList = list()
for to in range(0, len(txt), 8):
byteList.append(int(txt[to:to + 8], 2))
return byteList
def byteListToString(byteList):
txt = ""
for element in byteList:
txt = txt + bin(ele... |
#!/usr/bin/env python
# Import stuff for compatibility between python 2 and 3
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import str
from future import standard_library
import os
import numpy as n... |
from selenium import webdriver
from training_ground_page import TrainingGroundPage
from trial_page import TrialPage
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
options = webdriver.ChromeOptions()
options.add_experimental_option('excludeSwitches', ['enable-logging'])
# Test Setup
... |
import re
import subprocess
def read_model_list():
with open('latest_model_list.txt') as f:
return f.readlines()
records = read_model_list()
for record in records:
temp = re.search('test[0-9]+', record)
temp = temp.group(0)
temp = re.search('[0-9]+', temp)
test_map = temp.group(0)
... |
# -*- coding: utf-8 -*-
#
# This file is part of EUDAT B2Share.
# Copyright (C) 2016 CERN.
#
# B2Share 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... |
"""Apps module for the orp_api app."""
# Third Party
from django.apps import AppConfig
class OrpApiConfig(AppConfig):
"""Configuration for application."""
default_auto_field = 'django.db.models.BigAutoField'
name = 'orp_apps.orp_api'
|
# coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-255
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class BiosPolicy(object):
"""
NOTE: This class is a... |
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Type, Union
from vkbottle import ABCView, BaseReturnManager
from vkbottle.dispatch.handlers import FromFuncHandler
from vkbottle.framework.bot import BotLabeler
from vkbottle.modules import logger
from vkbottle_types.events import MessageEvent as _... |
from sympl import (
PlotFunctionMonitor, AdamsBashforth, NetCDFMonitor
)
from climt import SimplePhysics, get_default_state
import numpy as np
from datetime import timedelta
from climt import EmanuelConvection, RRTMGShortwave, RRTMGLongwave, SlabSurface
import matplotlib.pyplot as plt
def plot_function(fig, stat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.