content stringlengths 5 1.05M |
|---|
__author__ = 'Sergei'
from model.contact import Contact
from random import randrange
def test_del_contact(app):
if app.contact.count() == 0:
app.contact.create_c(Contact(first_n= "first",mid_n= "middle",last_n= "last",nick_n= "kuk",company= "adda",address= "575 oiweojdckjgsd,russia",home_ph= "12134519827"... |
# -*- coding: utf-8 -*-
"""General purpose nginx test configuration generator."""
import getpass
from typing import Optional
import pkg_resources
def construct_nginx_config(nginx_root: str, nginx_webroot: str, http_port: int, https_port: int,
other_port: int, default_server: bool, key_path... |
from tkinter import *
from tkinter import font
from tkinter import ttk
from importlib import reload
game_loadonce = False
def play():
global game
global menuApp, game_loadonce
menuApp.save_scores("leaderboard.txt")
menuApp.root.destroy()
if game_loadonce == False:
import game
gam... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import getopt
import os
import sys
import re
from .debug import Debug
from .debug import BColors
from subprocess import Popen, PIPE
from .debug import Debug
class InputParams(object):
def __init__(self, cfg, argv):
self.PROG_OPT_RE = re.compile(r'^([A-Z\d]+)... |
"""Test."""
import unittest
class TestX(unittest.TestCase):
"""Tests."""
def test_f(self):
"""Test."""
self.assertTrue(True)
if __name__ == '__main__':
unittest.main()
|
import discord
from redbot.core import Config, commands, checks
class Automod(commands.Cog):
"""Automoderation commands"""
def __init__(self):
self.config = Config.get_conf(self, identifier=1234567890)
watching = list()
self.config.init_custom("ChannelsWatched", 1)
self.config... |
#! /user/bin/env python3
import argparse
import xlrd
from datetime import datetime
import pandas as pd
import os
import shutil
import configparser
config = configparser.ConfigParser()
config.read("config.ini")
unixFilesPath = os.getcwd() + config["FilePaths"]["unixFilesPath"]
unixConvertedPath = os.getcwd() + config... |
#-*- coding:utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwar... |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are ... |
"""Replace block with 'lock'
Revision ID: 8192b68b7bd0
Revises: 3176777cd2bb
Create Date: 2021-01-20 20:48:40.867104
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = "8192b68b7bd0"
down_revision = "3176777cd2bb"
branch_labels... |
#TODO check whether dummy classifier also does this
def count_true_positive(two_column_data_set):
positive_count = 0
for data in two_column_data_set["class"]:
##Hate Speech is labelled 0 in this project
if data == 0:
positive_count += 1
return positive_count
def compute_preci... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from src.data_schema.feature_names import FeatureNames
from src.data_preparation.input_data_schema import LasVegasGovtDataSchema
def plot_feature_stat(df, feature_xaxis, feature_yaxis, output_file):
##### construct list of mean, standard devia... |
from .sqlalchemy_conftest import * # noqa
@pytest.fixture(scope="session", autouse=True)
def set_up_gcs_mock_tempdir(tmp_path_factory):
from .okta_mock import _Auth
from alchemy.shared import auth_backends
auth_backends.auth, auth_backends.__auth = _Auth(), auth_backends.auth
auth_backends.init_app, ... |
import argparse
from snakemake.shell import shell
from .slurm_job import SlurmJob
from exceRNApipeline.includes.utils import logger
def pre_process(input_fq, adapter, log_file, prefix):
cmd = f"""
hts_Stats -L {log_file} -U {input_fq} | \\
hts_AdapterTrimmer -A -L {log_file} -a {adapter} | \\
hts_QWin... |
import pandas as pd
import csv
original_csv = pd.read_csv('./Fuzzy_dataset.csv')
normal_csv = open('./fuzzy_normal_dataset.csv', 'w', newline='', encoding='utf-8')
normal_csv_file = csv.writer(normal_csv)
abnormal_csv = open('./fuzzy_abnormal_dataset.csv', 'w', newline='', encoding='utf-8')
abnormal_csv_file = csv.w... |
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 18 15:34:32 2018
@author: wangyu
"""
import socket
import sys
sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM) #与服务端相同
try:
sock.connect(('127.0.0.1',1052))
except socket.error as e:
print(e)
sys.exit(-1)
data_send = 'test'
sock.send(data_send.encode... |
from .settings import *
from .user_groups import *
|
import unittest
from unittest.mock import Mock, patch
from nuplan.common.actor_state.scene_object import SceneObject, SceneObjectMetadata
class TestSceneObject(unittest.TestCase):
"""Tests SceneObject class"""
@patch("nuplan.common.actor_state.tracked_objects_types.TrackedObjectType")
@patch("nuplan.com... |
# @Title: 数组中重复的数字 (数组中重复的数字 LCOF)
# @Author: 18015528893
# @Date: 2021-02-28 16:44:53
# @Runtime: 52 ms
# @Memory: 23.4 MB
class Solution:
def findRepeatNumber(self, nums: List[int]) -> int:
for i in range(len(nums)):
while nums[i] != i:
if nums[nums[i]] == nums[i]:
... |
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file acc... |
"""
Helper module allowing src modules to be imported into tests
"""
# pylint: disable=wrong-import-position
# pylint: disable=unused-import
import os
import sys
from blockutils.common import ensure_data_directories_exist
from blockutils.stac import STACQuery
# NOTE: this must be before the modis and gibs imports - ... |
from .context import get_puzzle, get_solution_script
index = 7
INPUT = """
16,1,2,0,4,2,7,1,2,14
"""[1:-1].split("\n")
def test_d7p1():
script = get_solution_script(index)
assert script is not None, "script is none"
d7p1 = script("d7p1")
assert d7p1 is not None, "d7p1 is none"
result = d7p1(INPU... |
from collections import deque
def getIsWall(data):
favoriteNumber = int(data)
def isWall(x, y):
if y < 0 or x < 0:
return True
n = favoriteNumber + x * x + 3 * x + 2 * x * y + y + y * y
wall = 0
while n:
wall ^= n & 1
n >>= 1
return ... |
# coding: utf-8
import cv2, os, sys
from PIL import Image
import numpy as np
import os
from tensorflow import keras
from tensorflow.keras.layers import Input
from .Models import GoogLeNetModel
from .Models import VGG16Model
from .Models import InceptionV3Model
from .Models import MobileNetModel
from .Mod... |
#!/usr/bin/env python
from argparse import ArgumentParser
import sys
parser = ArgumentParser(description="Run the test suite.")
parser.add_argument(
"--failfast",
action="store_true",
default=False,
dest="failfast",
help="Stop the test suite after the first failed test.",
)
parser.add_argument(
... |
import torch
def accuracy(pred, target):
pred = pred.float()
correct = 0
for i in range(target.size()[0]):
if (pred[i] == pred[i].max()).nonzero() == target[i]:
correct += 1
return correct / target.size()[0] |
# Function to sort an unsorted list (due to globbing) using a number
# occuring in the path.
# Author: Lukas Snoek [lukassnoek.github.io]
# Contact: lukassnoek@gmail.com
# License: 3 clause BSD
from __future__ import division, print_function, absolute_import
import os.path as op
def sort_numbered_list(stat_list):
... |
##############################
# support query serve for front web system
# filename:query.py
# author: liwei
# StuID: 1711350
# date: 2019.12.1
##############################
#查询构建
from whoosh import highlight
from whoosh import qparser
from whoosh import index
from flask import Flask
from flask import request... |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
#!/usr/bin/env python3
import curses
from random import randrange, choice # generate and place new tile
from collections import defaultdict
letter_codes = [ord(ch) for ch in 'WASDRQwasdrq']
actions = ['Up', 'Left', 'Down', 'Right', 'Restart', 'Exit']
actions_dict = dict(zip(letter_codes, actions * 2))
def get_user... |
# https://qiita.com/taigamikami/items/6c69fc813940f838e96c
import numpy as np
import tensorflow as tf
import tensorflow_lattice as tfl
import matplotlib.pyplot as plt
import input_data
# ====================================
# 訓練用のデータ
# ====================================
#x_train = np.arange(-5, 5, 0.2)
#noise = np.... |
config = {
"--acoustic-scale":[0.1,float],
"--allow-partial":["false",str],
"--beam":[13,int],
"--beam-delta":[0.5,float],
"--delta":[0.000976562,float],
"--determinize-lattice":["true",str],
"--hash-ratio":[2,int],
"--latti... |
"""
Odoo client using Openerp proxy
"""
# https://pypi.org/project/openerp_proxy/
from openerp_proxy import Client as erpClient
class Client():
"""
Odoo client
"""
def __init__(self, username:str, password:str = '', database:str = '', host:str = '', port:int = 443, protocol:str = 'json-rpcs'):
... |
import ROOT
import numpy as np
# fast index lookup
from melp.libs.misc import index_finder
def save_histo(filename: str, dt_dict: dict):
histo_file = ROOT.TFile.Open(filename, "RECREATE")
for keys in dt_dict.keys():
name_z = str(keys) + "z"
name_phi = str(keys) + "phi"
histo_file.Wri... |
import logging
from collections import namedtuple
import magic
from io import BytesIO
from django.views.generic import DetailView
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
import matplotlib
import matplotlib.pyplot
import aplpy
import astropy
from scheduler.models im... |
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from .models import Favorite, Subscription
User = get_user_model()
class FavoriteAdmin(admin.ModelAdmin):
model = Favorite
list_display = ('user', 'recipe')
class SubscriptionAdm... |
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 7 18:40:45 2019
@author: ryder
"""
#%%
import os
import pandas as pd
from pynabapi import YnabClient
import pygsheets
import datetime
import time
import re
#%%
# should create google_ledger object
with open('keys/google_expenses_sheet_key.txt', 'r') as g_sheet_id_key... |
name = 'omnifig'
long_name = 'omni-fig'
version = '0.6.3'
url = 'https://github.com/felixludos/omni-fig'
description = 'Universal configuration system for common execution environments'
author = 'Felix Leeb'
author_email = 'felixludos.info@gmail.com'
license = 'MIT'
readme = 'README.rst'
packages = ['omnifig'... |
import sys
import dataset
from datetime import datetime
from dateutil.rrule import rrule, MONTHLY
from dateutil.relativedelta import relativedelta
def process(username, metric, stream_limit):
# gets all artists and their respective daily play counts
db = dataset.connect('sqlite:///last-fm.db')
total = db[username].... |
import requests
from datetime import datetime
aq = []
def scrap():
url = "http://vc8006.pythonanywhere.com/api/"
response = requests.request("GET", url)
r = response.json()
for i in range(1,31):
aq.append(r[-i]['AQI'])
# print(r[-i])
# print(response.text)
print(aq)
s... |
import gym
from griddly import GymWrapperFactory
from griddly.RenderTools import RenderToFile
if __name__ == '__main__':
# A nice tool to save png images
file_renderer = RenderToFile()
# This is what to use if you want to use OpenAI gym environments
wrapper = GymWrapperFactory()
# There are two ... |
# Generated by Django 2.2.15 on 2020-08-04 19:14
import aldryn_apphooks_config.fields
import app_data.fields
import cms.models.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import djangocms_blog.models
import djangocms_text_ckeditor.fields
import file... |
import pandas as pd
import numpy as np
import ml_metrics as metrics
from sklearn.ensemble import RandomForestClassifier
from sklearn.calibration import CalibratedClassifierCV
from sklearn.cross_validation import StratifiedKFold
from sklearn.metrics import log_loss
path = '../Data/'
print("read training data")... |
import pytest
from mutalyzer_spdi_parser.convert import to_hgvs_internal_model, to_spdi_model
TESTS_SET = [
(
"NG_012337.3:10:C:T",
{
"seq_id": "NG_012337.3",
"position": 10,
"deleted_sequence": "C",
"inserted_sequence": "T",
},
{
... |
"""
Licensed Materials - Property of IBM
Restricted Materials of IBM
20190891
© Copyright IBM Corp. 2021 All Rights Reserved.
"""
"""
Module to where fusion algorithms are implemented.
"""
import logging
import numpy as np
from ibmfl.aggregator.fusion.iter_avg_fusion_handler import \
IterAvgFusionHandler
logger ... |
from lark import Tree
from copy import deepcopy
from .values import Value, ValueType
from .symbols import Symbol, Symbols
from .debug import DebugOutput
from .converters import get_symbol_name_from_key_item, get_array_index_exp_token_from_key_item
from . import blocks
from . import expressions
class Key():
def __... |
numero=int(input('Coloque o seu numero: '))
x=0
while x <= numero:
if x % 2 == 0:
print (x)
x = x + 1 |
# -*- coding: utf-8 -*-
"""Package to support metabarcoding read trimmming, merging, and quantitation."""
import os
__version__ = "0.1.0-alpha"
_ROOT = os.path.abspath(os.path.dirname(__file__))
ADAPTER_PATH = os.path.join(_ROOT, "data", "TruSeq3-PE.fa")
|
import numpy as np
import pylab as pl
from astropy.io import fits
from astropy.table import Table
from linetools.spectra.io import readspec
from linetools.spectra.xspectrum1d import XSpectrum1D
from linetools.spectra.utils import collate
import numpy as np
from pypeit.core import coadd as arco
from astropy import units... |
import findspark
findspark.init('/opt/spark')
import schedule
import pyspark
from pyspark.sql import SparkSession
from pyspark.sql.functions import col, udf, lit
import random
import smtplib, ssl
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import schedule
import time
from random ... |
class Test(object):
__slots__ = 'name', 'word_set', 'target', 'longest_subsequence',\
'verbose', 'actual'
def __init__(self, json_object):
self.name = json_object['name']
self.word_set = json_object['word_set']
self.target = json_object['target']
self.longest_subsequence = j... |
numbers = [int(el) for el in input().split(", ")]
positive = [str(x) for x in numbers if x >= 0]
negative = [str(x) for x in numbers if x < 0]
even = [str(x) for x in numbers if x % 2 == 0]
odd = [str(x) for x in numbers if not x % 2 == 0]
print("Positive:", ', '.join(positive))
print("Negative:", ', '.join(negative)... |
# ------ your setttings ------
TrainModule = 'OutputOshaberi' # your sensation folder name
device = 'cuda' # debugging device
# ------ end of settings -----
if __name__ == '__main__':
from importlib import import_module
from multiprocessing import Value
module = import_module(TrainModule)
func = module... |
year = int(input())
if year%4==0:
cond=True
if year%100==0 and cond==True:
cond=False
if year%400==0 and cond==False:
print(f"{year} is a Leap Year!!")
else:
print(f"{year} is not a Leap Year") |
from flask import Flask,request
import os
import base64
from lib.logger import Logger
from termcolor import colored
import sys
def main(mongoclient,server_logger,port):
app = Flask('app')
## Get the cookie/victim ID from a request
def get_cookie(request):
d = request.cookies
if d:
return base64.b64decode(... |
'''
PyTorch Dataset Handling. The dataset folder should comprise of two subfolders namely "train" and "test" where both folders has subfolders that named
according to their class names.
'''
import os
import glob
import cv2
import torch
from torch.utils import data
from torch.utils.data import Dataset, dataset
class ... |
import numpy as np
from perturbative_solver import solve_oscillon
from matplotlib import pyplot as plt
from progress.bar import Bar
############################################################################
# Edit these parameters:
############################################################################
# the v... |
from PIL import Image
from csv import reader
inputFilename: str = "./dist/flag.csv"
outputFilename: str = "./writeup/flag.png"
with open(inputFilename, "r") as csv_file:
csv_reader = reader(csv_file)
list_of_rows = list(csv_reader)
size = [len(list_of_rows[0]), len(list_of_rows)]
outputImage: Image = Image.n... |
import unittest
import ttrw
from unittest.mock import patch
test_dictionary = {
"en": {
"adverbs": ["test"],
"adjectives": ["test"],
"nouns": ["test"]
},
"pl": {
"adverbs": ["bardzo"],
"adjectives": ["maly"],
"nouns": ["ksiazka"]
}
}
class TestTTRW(unit... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distribu... |
import graphene
from graphql_auth.bases import MutationMixin, DynamicArgsMixin
from users.mixins import PasswordSetAdminMixin
class PasswordSetAdmin(MutationMixin, DynamicArgsMixin, PasswordSetAdminMixin, graphene.Mutation):
_required_args = ["new_password1", "new_password2"]
class Arguments:
id = gr... |
# -*- coding: utf-8 -*-
import os
import unittest
import sqlite3
import tempfile
import bottle
from bottle.ext import sqlite
''' python3 moves unicode to str '''
try:
unicode
except NameError:
unicode = str
class SQLiteTest(unittest.TestCase):
def setUp(self):
self.app = bottle.Bottle(catchall=... |
# This code is designed to compare the absolute difference between one
# reference burn_cell test and multiple other burn_cell tests.
# burn_cell_testing.py must be run before running this.
# Around line 195, you choose which elements you will compare the xn and ydot of
# To change what you investigate, you must chan... |
#!/usr/bin/python
import socket,os
import platform
""" NETLINK related stuff
Astrit Zhushi 2011, a.zhushi@cs.ucl.ac.uk
"""
NETLINK_CONNECTOR=11
NETLINK_ADD_MEMBERSHIP=1
def get_cn_idx_iwlagn():
uname = platform.uname()[2]
infile = open("/usr/src/linux-headers-%s/include/linux/connector.h"
%(uname), "r")
flag ... |
"""
Employee service.
"""
from department_app import db
from department_app.models.department import Department
from department_app.models.employee import Employee
def add_employee_service(forename, surname, birthdate, department_id, salary):
"""
Adds employee to db.
:param forename: employee first name
... |
### tensorflow==2.3.1
import tensorflow as tf
import tensorflow_datasets as tfds
import numpy as np
def representative_dataset_gen_480x640():
for data in raw_test_data.take(10):
image = data['image'].numpy()
image = tf.image.resize(image, (480, 640))
image = image[np.newaxis,:,:,:]
... |
import bayesiancoresets as bc
import numpy as np
import warnings
warnings.filterwarnings('ignore', category=UserWarning) #tests will generate warnings (due to pathological data design for testing), just ignore them
np.seterr(all='raise')
np.set_printoptions(linewidth=500)
np.random.seed(100)
tol = 1e-9
def test_empty... |
# MIT License
#
# Copyright (c) 2018 Silvia Amabilino
#
# 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... |
# ro_prefixes.py
"""
Central list of prefixes commonly used with ROs
extended to support ro model updates and extensions for earth science (01/2017) by Raul Palma
"""
__authors__ = "Graham Klyne (GK@ACM.ORG), Raul Palma"
__copyright__ = "Copyright 2011-2013, University of Oxford"
__license__ = "MIT (http:/... |
import random
from lxml import etree
from typing import List
from PIL import ImageDraw
from nonebot.log import logger
try:
import ujson as json
except ModuleNotFoundError:
import json
from .base_handle import BaseHandle, BaseData
from ..config import draw_config
from ..util import remove_prohibit... |
"""Queries to answer following questions"""
# How many total Characters are there?
QUERY_1 = '''SELECT COUNT(*)
FROM charactercreator_character;'''
# How many of each specific subclass?
QUERY_2 = '''SELECT (
SELECT COUNT(*)
FROM charactercreator_thief
) AS thief_class,
(
SELECT COUNT(*)
FROM c... |
from astutils import ast
def test_terminal():
value = 'a'
t = ast.Terminal(value)
r = repr(t)
assert r == "Terminal('a', 'terminal')", r
r = str(t)
assert r == 'a', r
r = len(t)
assert r == 1, r
r = t.flatten()
assert r == value, r
def test_hash():
# different AST node in... |
num1 = 111
num2 = 222
num3 = 3333333333
num3 = 333
num4 = 44444
|
# =============================================================================== #
# #
# This file has been generated automatically!! Do not change this manually! #
# ... |
import os
import sys
import zipfile
import asc_parse
import wget
import multiprocessing
import urllib.request as request
from contextlib import closing
import argparse
import shutil
import glob
# A decimal value that will decrease the output file size as it increases
REDUCE_BY = 1.0
# A decimal value t... |
import numpy as np
import pandas as pd
import os
def prm_to_df(prm):
"""Convert prm to a pandas DataFrame"""
values = list(prm.values())
columns = list(prm.keys())
df_prm = pd.DataFrame(columns=columns)
for value, column in zip(values, columns):
df_prm[column] = [value]
return (df_prm)... |
import time
import random
#import pygame
import threading
'''
Start with the person in an empty room with zombies coming at them. The maze, is part of the "nice to have" section, but not pertinent.
'''
class Zombies:
def __init__(self, xcor, ycor):
self.xcor = xcor
self.ycor= ycor
self.image = ''
#the above e... |
# -*- coding: utf-8 -*-
from .schema import dump, load
from .loaded import LoadedValue
from .schema import CallableFunc
__all__ = ['dump', 'load', 'LoadedValue', 'CallableFunc']
|
#!/usr/bin/env python
# Author: CloudNClock @ github
# Date 2020/01/26
# Usage: DDNS updating for namesilo
import urllib3
import xmltodict
import requests
import time
import sys
import datetime
import configparser
import xml.etree.ElementTree as ET
# Update DNS in namesilo
def update(currentIP,recordID,targetDomain... |
import torch
from abc import ABCMeta, abstractmethod
from torchtrainer.utils.mixins import CudaMixin
from .callbacks import Callback, CallbackContainer, History
from .meters import ZeroMeasurementsError
from enum import Enum
from itertools import chain
from torch.autograd import Variable
from .utils.defaults import pa... |
version = '0.66'
short_version = version
full_version = version
|
from flask import url_for
from authentek.database.models import User
def test_get_user(client, db, user, admin_headers):
# test 404
user_url = url_for('api.user_by_id', user_id="100000")
rep = client.get(user_url, headers=admin_headers)
assert rep.status_code == 404
db.session.add(user)
db.se... |
''' setup
'''
import re
import io
from distutils.command.build_ext import build_ext as build_ext_orig
from setuptools import setup, find_packages, Extension
# source: https://stackoverflow.com/a/39671214
__version__ = re.search(
r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
io.open('nei_vcf/__init__.py', encoding... |
#!/usr/bin/env python3
"""opencv module tests"""
import sys
import os
import inspect
import logging
import cv2
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import colors
from matplotlib import ticker
from matplotlib.colors import LinearSegmentedColormap
logger = logging.getLogger("OPENCV")
d... |
# Generated by Django 3.2.7 on 2021-09-03 10:07
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import phonenumber_field.modelfields
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(sett... |
# -*- coding: utf-8 -*-
import pytest
from great_expectations.core import (
ExpectationConfiguration,
ExpectationValidationResult,
)
from great_expectations.render.renderer.renderer import Renderer
def test_render():
# ??? Should this really return the input object?
# Seems like raising NotImplemente... |
from MyCodes.personal import title, inputInt, inputFloat
from urllib.request import urlopen
title('Exercício 113', 50, 34)
a = inputInt('Digite um valor inteiro: ')
b = inputFloat('Digite um valor real: ')
print(f'O valor inteiro é {a} e o valor real é {b:.1f}.')
title('Exercício 114', 50, 34)
try:
pag = urlopen(... |
# Copyright 2017 Gustavo Baratto. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
from .block import *
from .chain import *
__version__ = "0.0.1"
|
import time
from multiprocessing.pool import ThreadPool
from core.events import EventHandler
from core.keystore import KeyStore as kb
from core.packetcap import pktcap
from core.actionModule import actionModule
from core.mymsf import myMsf
class msfActionModule(actionModule):
seentargets = dict()
def __init... |
string = 'emir','zarina','baizak','nazira'
string = string.replace('emir','vanya')
print(string)
|
# 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 u... |
import os
import tempfile
from pathlib import Path
from test.splitgraph.commands.test_commit_diff import _alter_diff_splitting_dataset
from test.splitgraph.conftest import API_RESOURCES, OUTPUT
from unittest import mock
from unittest.mock import call, patch, sentinel
import httpretty
import pytest
from click import Cl... |
name = "CheeseBurger" |
import json
import requests
from requests.auth import HTTPBasicAuth as BasicAuth
from requests.packages import urllib3
from urllib3.exceptions import InsecureRequestWarning
urllib3.disable_warnings(InsecureRequestWarning)
url = "https://sbx-nxos-mgmt.cisco.com:443/ins"
username = "admin"
password = "Admin_1234!"
da... |
# Generated by Django 2.1 on 2019-05-15 22:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main_app', '0006_deviceconfig_last_modify'),
]
operations = [
migrations.AlterField(
model_name='deviceconfig',
name='... |
class Diplomacy:
"""
Respresents every player diplomacy stances with others
"""
def __init__(self, stances=None):
"""
Initialize Diplomacy
Args:
stances (list(int)): stances with other player
Note:
there's 8 stances with other players
"""... |
from portfolyo import dev, testing
from portfolyo.tools import frames
from numpy import nan
import portfolyo as pf
import numpy as np
import pandas as pd
import pytest
@pytest.mark.parametrize("series_or_df", ["series", "df"])
@pytest.mark.parametrize("bound", ["right", "left"])
@pytest.mark.parametrize(
("in_val... |
import sublime
from ui.read import settings as read_settings
from ui.write import write, highlight as write_highlight
from lookup import file_type as lookup_file_type
from ui.read import x as ui_read
from ui.read import spots as read_spots
from ui.read import regions as ui_regions
from core.read import read as core_rea... |
import random, time, torch
import numpy as np
from nlplingo.oregon.event_models.uoregon.define_opt import opt
from nlplingo.oregon.event_models.uoregon.tools.utils import *
from nlplingo.oregon.event_models.uoregon.models.pipeline._01.readers import read_abstract_train_data
from nlplingo.oregon.event_models.uoregon.mod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.