content stringlengths 5 1.05M |
|---|
import os
import pytest
from dagster import (
AssetKey,
DagsterInvalidDefinitionError,
DependencyDefinition,
IOManager,
io_manager,
)
from dagster.core.asset_defs import AssetIn, ForeignAsset, asset, build_assets_job
from dagster.core.snap import DependencyStructureIndex
from dagster.core.snap.dep_... |
def main(argv=None):
if argv is None:
from sys import argv
def usage():
print('usage : <send|s|recv|r> [arguments]')
exit(1)
if len(argv) == 1:
usage()
elif argv[1] in ('send', 's'):
from .send import main as m
elif argv[1] in ('recv', 'r'):
from .recv import main as m
else:
usag... |
from module.interface import *
from os import system
from time import sleep
system('cls')
menu('Somatórios Recursivos')
def somatorio(n: int):
if n == 1:
return 1
else:
return n + somatorio(n - 1)
while True:
try:
n = int(input('Qual número deseja ver o somatório? '))
except (... |
##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
import matplotlib.pyplot as plt
from data import get_class_name
def visualize_num(train_loss, train_accuracy, valid_loss, valid_accuracy):
"""
A function to visualize loss and accuracy during training (for both training and validation).
:param train_loss: a list containing training loss of all epochs
... |
import os
os.system("clear")
celsius = float(input("Please enter a celsius value that you wish to convert to fahrenheit: "))
# Convert celsius to fahrenheit using formula
fahrenheit = (celsius * 1.8) + 32
print("Your new value in fahrenheit is " + str(fahrenheit)) |
import numpy as np
import pandas as pd
df = pd.merge(facebook_employees, facebook_hack_survey, left_on='id', right_on='employee_id', suffixes=('_fe', '_surv')).groupby(by='location').mean()[['popularity']]
df.insert(0, 'location', df.index)
df
|
import os
class Settings:
api_key = os.environ.get("API_KEY")
api_path = "api/v1"
upload_path = "app/uploads"
files_url_path = "files"
id_lenght = 10
|
"""
Unix crypt(3) password hash algorithm.
This is a port to Python of the standard Unix password crypt function.
It's a single self-contained source file that works with any version
of Python from version 1.5 or higher. The code is based on Eric
Young's optimised crypt in C.
Python fcrypt is intended for us... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from dataclasses import dataclass, field
from sys import maxsize
@dataclass
class Node:
"""Node data class."""
value: str
weight: int
length: int = field(init=False)
def __post_init__(self):
self.length = len(self.value)
def compress(filena... |
# Copyright 2019 Jeremy Schulman, nwkautomaniac@gmail.com
#
# 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 applicabl... |
"""
Entries queries
"""
import graphene
from graphql_jwt.decorators import superuser_required
from condos.models import Apartment, Block
from accounts.models import Entry
from accounts.types import EntryType
class EntriesQuery(graphene.AbstractType):
"""Used to read or fetch values"""
entries = graphene.List(... |
#! /usr/bin/env python
import sys
sys.path.append('../src')
import getopt
opts, _ = getopt.getopt(sys.argv[1:], 't:', ['test'])
from pyschedule import Scenario, solvers, plotters
horizon = 10
S = Scenario('Scenario',horizon=horizon)
tasks = S.Tasks('T',num=int(horizon/2),is_group=True,delay_cost=2,state=1)
breaks = S.... |
from abc import ABC, abstractmethod
import vtk
class vtkRendererBase(ABC):
def __init__(self, style):
super().__init__()
self._renderer = vtk.vtkRenderer()
self._renderer.SetBackground(0,0,0)
self._style = style
self._style.SetDefaultRenderer(self._renderer)
self._t... |
#Author: Miguel Molero <miguel.molero@gmail.com>
import numpy as np
from vtk import vtkPolyData, vtkPoints, vtkCellArray, vtkTriangle
from vtk.util.numpy_support import vtk_to_numpy, numpy_to_vtk, get_numpy_array_type, get_vtk_to_numpy_typemap, \
numpy_to_vtkIdTypeArray
from vtk import vtkPoints, VTK_UNSIGNED_CH... |
import argparse
class VStepWigFilter(object):
def __init__(self, score, output_as_bedgraph=False):
self.threshold = score
if output_as_bedgraph:
self._print_track = self._print_bg_track
else:
self._print_track = self._print_wigvs_track
self._spanlen = None
... |
import argparse
import csv
import functools
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from tensorflow.keras.layers import Dense, Activation
from tensorflow.keras import regularizers
from config import hidden_layer_size, n_params
def load_dataset(file_path):
print("Loading {}".fo... |
import numpy as num
import matplotlib.pyplot as plot
import warnings
warnings.simplefilter('ignore', num.RankWarning)
#
def f(x):
return num.sin(2 * num.pi * x) #calculating the sine of function for training data
def implementation ():
for i in range(11):
color=['r-','b-','b-', 'r-', 'r-', 'c-', 'm-'... |
import os
import unittest
import numpy as np
from nuscenes_radar_devkit.nuscenes import NuScenes
from nuscenes_radar_devkit.eval.lidarseg.evaluate import LidarSegEval
from nuscenes_radar_devkit.eval.lidarseg.utils import ConfusionMatrix
class TestLidarSegEval(unittest.TestCase):
def setUp(self):
# TODO... |
from scipy.integrate import solve_ivp
import numpy as np
import matplotlib.pyplot as plt
def run():
theta1_0 = np.deg2rad(20)
theta2_0 = np.deg2rad(0)
sol = solve_ivp(cp_pen, [0, 20], [0, theta1_0, 0, theta2_0], rtol=1e-6)
plt.plot(sol.t, np.rad2deg(sol.y[1,:]),".-")
plt.plot(sol.t, np.rad2deg(so... |
#!/usr/bin/env python3
if __name__ == '__main__':
x = int(input())
y = int(input())
z = int(input())
n = int(input())
def create_list (x,y,z,n):
return [[i,j,k]for i in range (x+1) for j in range (y+1) for k in range (z+1) if i+j+k != n ]
print (create_list(x,y,z,n))
|
import yaml
# add two numbers together
def add(a, b):
return a + b
# subtract two numbers
def sub(a, b):
return a - b
|
# coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
# coding=utf-8
import flask
v1_bp = flask.Blueprint('v1', __name__)
|
import matplotlib.pyplot
from matplotlib import rcParams
from amset.plot.base import ( # noqa
BaseMeshPlotter,
BaseTransportPlotter,
amset_base_style,
revtex_style,
)
__author__ = "Alex Ganose"
__maintainer__ = "Alex Ganose"
__email__ = "aganose@lbl.gov"
def styled_plot(*style_sheets):
"""Retur... |
from optparse import make_option
from django.core.management.base import BaseCommand
from django.db import connection
from aggregator.converters.netcdf4 import NetCDF4Converter
from mongo_client import get_mongo_db
class Command(BaseCommand):
help = 'Import dataset from nc file to postgres'
def add_argumen... |
import unittest
from .SudokuGraph import *
class TestCreation(unittest.TestCase):
def setUp(self) -> None:
self.graph = SudokuGraph()
def test_classtype(self):
self.assertIsInstance(self.graph, nx.Graph)
def test_nodecount(self):
self.assertEqual(len(self.graph.nodes()), self.grap... |
import joblib
from typing import Any, Union
from monolith_filemanager.file.base import File
from ..path import FilePath
class JoblibFile(File):
"""
This is a class for managing the reading and writing of joblib objects.
"""
SUPPORTED_FORMATS = ["joblib"]
def __init__(self, path: Union[str, FileP... |
from __future__ import absolute_import
from django.utils.functional import empty
def extract_lazy_object(lo):
"""
Unwrap a LazyObject and return the inner object. Whatever that may be.
ProTip: This is relying on `django.utils.functional.empty`, which may
or may not be removed in the future. It's 100... |
"""
handler.py
=========
RPC-JSON API Web-handlers
To use define functions with name
- public* public handlers
- login* requires login first
- admin* requires admin login
All handlers must return a JSON dictionary, except for downloadable functions
Handlers can take parameters, which are expected to be only JSON-com... |
# Generated by Django 3.1 on 2020-09-23 23:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user', '0008_auto_20200923_2303'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='image',
... |
import os, datetime, sys, types
from copy import deepcopy
import dateutil.parser
from numpy import cos, pi, cumsum, arange, ndarray, ones, zeros, array, newaxis, linspace, empty, resize, sin, allclose, zeros_like, linalg, dot, arctan2, float64, histogram2d, sum, sqrt, loadtxt, searchsorted, NaN, logical_not, fliplr, f... |
import threading
import socket
import sys
from signal import signal, SIGINT
import time
received_messages = []
ipaddr = '::1'
port = 20002
def display_received_messages(sock):
while True:
resp = sock.recv(256)
resp = resp.decode('utf-8','ignore')
resp = resp.split('|')
... |
#
# Copyright (C) 2018 - 2021 Satoru SATOH <satoru.satoh @ gmail.com>
# SPDX-License-Identifier: MIT
#
r"""A class collect anyconfig.models.processor.Processor and inherited class
objects inherited from it.
"""
import operator
import typing
from . import utils
from .datatypes import (
ProcT, ProcsT, ProcClsT, Proc... |
from rest_framework.serializers import ModelSerializer
from .models import Task, TaskHistory
from task_manager.users.models import User
# from django.contrib.auth.models import User
class UserSerializer(ModelSerializer):
class Meta:
model = User
fields = ["first_name", "last_name", "username"]
... |
########################################################################################################################
#Project: Data mining
#Authors: Oliver De La Cruz
#Date: 22/10/2016
#Description: Online Adam optimization algorithm
##################################################################################... |
import copy
import numpy as np
from collections import OrderedDict
from x2paddle.core.program import PaddleLayer
from x2paddle.core.util import *
class PReLUOpt:
def __init__(self):
pass
def run(self, graph):
print("Optimize: PReLUOpt...")
layers = copy.deepcopy(graph.layers)
... |
import numpy as np
import pydensecrf.densecrf as dcrf
import torch
n_classes = 2
def dense_crf(probs, img=None, n_iters=10,
sxy_gaussian=(1, 1), compat_gaussian=4,
kernel_gaussian=dcrf.DIAG_KERNEL,
normalisation_gaussian=dcrf.NORMALIZE_SYMMETRIC,
sxy_bilateral=(4... |
from matplotlib import pyplot as plt
import numpy as np
from ctapipe.visualization import ArrayDisplay
import astropy.units as u
from ctapipe.coordinates import TiltedGroundFrame, GroundFrame
class ArrayPlotter:
"""
Simple plotter for drawing array level items
"""
def __init__(self, instrument, teles... |
#!/usr/bin/env python3
import acsuite
import lvsfunc as lvf
ac = acsuite.AC()
path = r'BDMV/GRANBLUE_FANTASY_SEASON2_1/BDMV/STREAM/00007.m2ts'
src = lvf.src(path)
if __name__ == "__main__":
ac.eztrim(src, [(0, -24)], path[:-4]+"wav", "GBF2BD_NCOP1_cut.wav")
|
import re
import nltk
def percentage_tokenizer(words: list)-> list:
"""Function to convert all percentages tokens to universal iiipercentiii token.
words: Word tokenized text of pdf (preproccesed)
return: Converted list of tokens
"""
final_words = words[:]
pattern = ... |
import json
import logging
from datetime import datetime
from json import JSONEncoder
from typing import List, Optional
from simple_metrics.metrics import Metric
_log = logging.getLogger(__name__)
class _MetricsEncoder(JSONEncoder):
def default(self, o):
if isinstance(o, Metric):
return o.ge... |
from guillotina.commands import Command
class ServerCommand(Command):
description = "Guillotina server runner"
profiler = line_profiler = None
def get_parser(self):
parser = super(ServerCommand, self).get_parser()
parser.add_argument(
"-r",
"--reload",
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2017 Alibaba Group Holding Ltd.
#
# 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-... |
import discord
from discord.ext import commands
from module import logger as log, keys
from Utility import resources as ex
import aiofiles
# noinspection PyBroadException,PyPep8
class BotMod(commands.Cog):
@staticmethod
async def mod_on_message(message):
# mod mail
try:
message_sen... |
#!/usr/bin/env python3
# Triforce Netfirm Toolbox, put into the public domain.
# Please attribute properly, but only if you want.
import argparse
import enum
import sys
from netboot import TargetEnum
from netdimm import NetDimm, NetDimmVersionEnum
from typing import Any
class EnumAction(argparse.Action):
"""
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
=========================================================================
Program: Visualization Toolkit
Module: TestNamedColorsIntegration.py
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.... |
# -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
# ----------------------------------------------------------------------------------------------------------------------
# this is the main application menu add/remove items as required
# ---------------------------... |
from backpack.app import app |
import sys
import numpy as np
raw = sys.stdin.read()
map = np.array([[c for c in l] for l in raw.split('\n') if len(l) != 0], dtype=int)
def energize(map, i, j):
if i >= 0 and j >= 0 and i < map.shape[0] and j < map.shape[1] and map[i, j] < 10:
map[i, j] += 1
if map[i, j] >= 10:
for d... |
to_find = "WARC-Target-URI:"
shift = len(to_find)
html_dict = dict()
# block 是那一大坨内容的字符串
for block in response:
start = block.find(to_find)
# http 链接起始位置.前面那个start是W的位置
start += shift
# 初始化一个空字符串
url = ""
# 你直接用start也可以,但是cur(current)比较方便理解.表示当前在读哪个位置
cur = start
# 如果还没读到换行,就是url没结束. and... |
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--batch_size', type=int, default=128)
parser.add_argument('--n_epochs', type=int, default=10)
parser.add_argument('--vocab_size', type=int, default=20000)
parser.add_argument('--num_sampled', type=int, default=1000)
parser.add_argument('--word_d... |
from argparse import ArgumentParser
from collections import Collection
import os
from pathlib import Path
from typing import Any
from coupledmodeldriver.client.check_completion import (
check_completion,
is_model_directory,
MODELS,
)
from coupledmodeldriver.configure import ModelJSON
from coupledmodeldrive... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import OrderedDict
class StableWallGraph:
def __init__(self, pict, R, C):
self.vertex = dict()
for r in range(R-1, 0, -1):
for c in range(C):
self.addVertex(pict[r][c])
if (pict[r][c] != pict... |
import json
import os
import numpy as np
import torch
import torch.utils.data as data
from torchsketch.utils.general_utils.loading_utils import *
def preprocess_triplets(triplets):
triplets = np.array(triplets)
processed_triplets = list()
for i in range(triplets.shape[0]):
for j in range(trip... |
from service import Service
class Otis(Service):
def __init__(self, session):
Service.__init__(self, "otis", "v2", session)
def write_option(self, account_id, option_name, option_scope, option_value):
option = {
"name": option_name,
"scope": option_scope,
... |
from add_sp_plus_immediate_t4 import AddSpPlusImmediateT4
from add_immediate_thumb_t4 import AddImmediateThumbT4
from adr_t3 import AdrT3
from mov_immediate_t3 import MovImmediateT3
from sub_sp_minus_immediate_t3 import SubSpMinusImmediateT3
from sub_immediate_thumb_t4 import SubImmediateThumbT4
from adr_t2 import AdrT... |
'''
Module: read_mod_aerosol_and_list_sds.py
==========================================================================================
Disclaimer: The code is for demonstration purposes only. Users are responsible to check for accuracy and revise to fit their objective.
Author: Justin Roberts-Pierel, 2015
Organizati... |
from django.test import TestCase
class ModelTests(TestCase):
def test_something(self):
pass
|
from pyspark.sql import SparkSession
from pyspark.sql.functions import isnan, when, count, col
spark = SparkSession.builder.appName('733').getOrCreate()
sc = spark.sparkContext
df = spark.read.csv('./quarterly reports.csv', header=True)
# Number of total records
df.count()
nullcounts = df.select([count(when(isnan(c... |
import logging
from telegram.ext import Updater, CommandHandler
from mensa_parser import *
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)
def get_token_from_file():
with open('token_testbot') as token_file:
return token_file.re... |
# -*- coding: utf-8 -*-
#
# Copyright 2017 Evolent Health, 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 applicabl... |
from __future__ import absolute_import, division, print_function
import logging
import math
from scitbx.array_family import flex
from cctbx import sgtbx
from dxtbx.model import Crystal
from dials.algorithms.indexing.symmetry import find_matching_symmetry
from dials.algorithms.indexing.compare_orientation_matrices im... |
"""
Because we're not allowed to share raw tweets, we provide a small script that gets those tweets based on a
list of ids. Don't forget to configure the config json file with your developer account.
"""
import tweepy
import os
import json
config = json.load(open("config.json", encoding="utf-8"))
consumer_key = conf... |
from dataclasses import dataclass
from typing import Dict, List
from enum import IntEnum
import json
from localisation import PLURAL_KEYS_VALUE
PLURAL_LANGUAGE_KEY = "LANG"
@dataclass
class Argument:
replace_key: str
language: str
values: Dict[str, str]
@dataclass
class LocalisationRow:
key: str
... |
# This file is executed on every boot (including wake-boot from deepsleep)
import sys
# Set default path
# Needed for importing modules and upip
sys.path[1] = '/flash/lib'
|
# coding: utf-8
"""
This module provides classes to interface with the Materials Project REST
API v3 to enable the creation of data structures and pymatgen objects using
Materials Project data.
"""
import itertools
import json
import platform
import sys
import warnings
from concurrent.futures import FIRST_COMPLETED, T... |
class ScoreKeeperFlag:
def __init__(self, sc_flag):
self.sc_flag = sc_flag
class MetaEvents:
def __init__(self, map_of_events=None):
if map_of_events is None:
map_of_events = {}
self.map_of_events = map_of_events
class AreasVisited:
def __init__(self, current_area='',... |
import os
import cv2
import numpy as np
try:
base_dir = os.environ["BASE_DIR"]
except KeyError:
print("Not exist environment variable %s" % "try sourcing build/environment.sh")
def load_pictures_haar(img):
""" Load pictures for predictions (Haar)"""
image = cv2.imread(img)
img_arr = cv2.resize(imag... |
from django.contrib import admin
from . import models
@admin.register(models.Word)
class WordAdmin(admin.ModelAdmin):
search_fields = [
'word',
'translation',
]
list_display = [
'word',
'translation',
'id',
]
|
import time
from fastapi import status
from core.config import Settings
from tests.helpers import create_test_user
#
# INVALID TESTS
def test_auth_validate_invalid_token(client):
get = client.get("/api/auth/validate", headers={"Authorization": "Bearer asdf"})
assert get.status_code == status.HTTP_401_UNAU... |
#!/usr/bin/env python
# encoding: utf-8
import os
import re
from setuptools import setup, find_packages
def rel_path(path):
return os.path.join(os.path.dirname(__file__), path)
def get_version():
with open(rel_path(os.path.join("paperweight", "__init__.py"))) as f:
for line in f:
if lin... |
import pandas as pd
import datetime as dt
import dateutil.tz
ams = dateutil.tz.gettz('Europe/Amsterdam')
utc = dateutil.tz.UTC
class ImbalancePriceReader(object):
def __init__(self, market_data='../data/tennet_balans_delta/tennet_balans_delta_15m.csv'):
market_df = pd.read_csv(market_data, parse_dates=Tr... |
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
from fqf_iqn_qrdqn.network import NoisyLinear
class MoGNet(nn.Module):
def __init__(self, num_actions, num_gaussians=5,
log_var_min=-20, log_var_max=2,
embedding_dim=7 * 7 * 64, dueling_net=False... |
#
# This script allows the user to control multiple Anki cars
# simultaneously using a single Python script
#
# Author: jstucken
#
SCRIPT_TITLE="Multiple Cars Example"
# import required modules
import loader.bootstrapper
import time
from overdrive import Overdrive
# Setup our cars
nuke = Overdrive(12)... |
import pytest
from flask_unchained import url_for
from flask_unchained.bundles.security import SecurityService, UserManager, current_user
@pytest.mark.usefixtures('user')
class TestLogin:
def test_html_get_login(self, client, templates):
r = client.get('admin.login')
assert r.status_code == 200
... |
from nilearn.datasets import fetch_atlas_harvard_oxford
from nilearn_sandbox.plotting.papaya import papaya_viewer
papaya_viewer(fetch_atlas_harvard_oxford('cort-prob-2mm').maps)
|
import subprocess
import os
from Statistics import getUserInformation
import sys
username = sys.argv[1]
getUserInformation(username) |
from flask_transfer import transfer, UploadError
from werkzeug import FileStorage
import pytest
try:
from io import BytesIO
except ImportError:
from StringIO import StringIO as BytesIO
try:
from unittest import mock
except ImportError:
import mock
@pytest.fixture
def transf():
return transfer.Tr... |
from pbge.plots import Plot, PlotState, Adventure
from pbge.dialogue import Offer, ContextTag
from game import teams, services, ghdialogue
from game.ghdialogue import context
import gears
import pbge
from .dd_main import DZDRoadMapExit
from game.content import backstory, plotutility, ghterrain, gharchitecture
import ra... |
#!/usr/bin/env python3
import unittest, os
AID_SERVER = "112233445500"
AID_CLIENT = "112233446600"
# APPLET = "toys.TeapotApplet"
# CLASSDIR = "Teapot"
# mode = os.environ.get('TEST_MODE', "simulator")
# if mode=="simulator":
# from util.simulator import Simulator, ISOException
# sim = Simulator(AID, APPLET, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import math
#################################
# Linear algebra helpers #
#################################
def LU_solve(b, LU):
"""Finds a solution to the linear system Ax=b
with A factorized into LU."""
rhs = np.asarray(b)
mat ... |
import sys, io, os, builtins
import json
import signal
import traceback
import threading
import multiprocessing
import textwrap
import types
import pathlib
import time
import pickle
import configparser
import time
import collections
import platform
import logging
from multiprocessing import Process, Lock
from queue imp... |
import unittest
from ksmi.kairos_smi import *
class test_kairos_smi(unittest.TestCase):
def setUp(self):
self.hosts = ["mlvcgpu@211.254.217.54:16022"]
def test_ssh_remote_command(self):
# success case
result = ssh_remote_command('mlvcgpu@211.254.217.54:16022', 'echo hello; echo h... |
"""Algorithms."""
from .individuals import Individual
from typing import List, Tuple, Type
import numpy as np # type: ignore
import random
class DE:
"""Differential evolution.
Differential evolution is an optimization heuristic
that doesn't require the optimization problem to be
differentiable. I... |
import os
try:
from . import utils
except ImportError:
import sys
sys.path.append(os.path.dirname(__file__))
import utils
import google.auth
from google.auth.transport.requests import AuthorizedSession
import google.oauth2.service_account
import json
from urllib.parse import quote
import base64
import t... |
'''
;#template` {-path} {-menu} {-s1} {-s2} {-s3}
;#option`-path`Path to controlling file`F`c:\source\python\projects\menu\buttonbar.py`
;#option`-menu`Path to menu file`F`c:\source\python\projects\menu\test.ini`
;#option`-s1`First section`X`info`
;#option`-s2`Second section`X`help`
;#option`-s3`Third section`X`data`
;... |
"""OpenAPI core paths generators module"""
from six import iteritems
from openapi_core.compat import lru_cache
from openapi_core.schema.extensions.generators import ExtensionsGenerator
from openapi_core.schema.operations.generators import OperationsGenerator
from openapi_core.schema.parameters.generators import Parame... |
import taichi as ti
def test_scope():
# In the future the following code should throw an exception at the python front end
# instead of crashing the compiler
return
ti.runtime.print_preprocessed = True
for arch in [ti.x86_64, ti.cuda]:
# ti.reset()
ti.cfg.arch = arch
x = ti.var(ti.f32)
N = ... |
from flask import Flask, render_template, flash, redirect, url_for, request, abort, jsonify
from flask_wtf import FlaskForm
from wtforms import StringField, SelectField, DecimalField
from wtforms.widgets import Input
from wtforms.validators import InputRequired, DataRequired, ValidationError
from werkzeug.utils import... |
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Bamdst(MakefilePackage):
"Bamdst is a a lightweight bam file depth statistical tool."
... |
from setuptools import setup
from setuptools import find_packages
DESCRIPTION = ("CLI application that focus on quickly creating "
"study flash cards")
REQUIREMENTS = ['click==6.6']
setup(
name='pyflashcards',
author='Jonathan Lalande',
author_email='jonathan.lalande.1@ens.etsmtl.ca',
... |
from sklearn.pipeline import Pipeline as SklearnPipeline
from sklearn.utils.metaestimators import available_if
__all__ = ["Pipeline"]
def _final_estimator_has(attr):
"""Check that final_estimator has `attr`.
Used together with `avaliable_if` in `Pipeline`. Copied from sklearn as it is a private method.
"... |
# 4_monteCarlo.py
# A program that approximates Pi using a random float generator and the formula of a circle
# Date: 9/15/2020
# Name: Ben Goldstone
#imports Random Library
from random import *
hits = 0;
shots = int(input("How many trials would you like to run? "))
# loops for total number of shots
for i in range(sho... |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
class Verifier:
"""Verifies that the current machine states match the expectation."""
def VerifyInput(self, verifier_input, variable_expander):
"""... |
#
# PySNMP MIB module PDN-PPP-ML-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/PDN-PPP-ML-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:30:35 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2... |
# Generated by Django 2.2.4 on 2020-05-22 08:22
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('faceapp', '0005_auto_20200522_0809'),
]
operations = [
migrations.AlterField(
model_name='teach... |
"""
This module plots results for the deployed model.
"""
import pandas as pd
from matplotlib.backends.backend_pdf import PdfPages
import seaborn as sns
import matplotlib.pyplot as plt
import RecessionPredictor_paths as path
class TestResultPlots:
"""
The manager class for this module.
""... |
"""
10698. Ahmed Aly
작성자: xCrypt0r
언어: Python 3
사용 메모리: 29,380 KB
소요 시간: 68 ms
해결 날짜: 2020년 9월 23일
"""
from sys import stdin
input = stdin.readline
def main():
for i in range(1, int(input()) + 1):
question, answer = input().split(' = ')
if eval(question) == int(answer):
print(f'Case... |
from django.contrib import admin
# Register your models here.
from florapedia.models import Plant
from embed_video.admin import AdminVideoMixin
class MyModelAdmin(AdminVideoMixin, admin.ModelAdmin):
pass
admin.site.register(Plant, MyModelAdmin)
# admin.site.register(Plant)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.