text stringlengths 2 999k |
|---|
#!/usr/bin/python3 -tt
#
# Copyright (c) 2013, Adam Simpkins
#
def prog_emitter(target, source, env):
'''
An emitter function for Program().
This automatically processes static library dependencies.
If a Program depends on libfoo.a, it automatically adds all other libraries
that libfoo.a depends o... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... |
"""
This module contain solvers for all kinds of equations:
- algebraic or transcendental, use solve()
- recurrence, use rsolve()
- differential, use dsolve()
- nonlinear (numerically), use nsolve()
(you will need a good starting point)
"""
from __future__ import print_function, division
f... |
import asyncio
import datetime
import functools
import json
import re
import textwrap
import urllib
from collections import namedtuple
from io import BytesIO
import aiohttp
import discord
from bs4 import BeautifulSoup
from html2text import html2text as h2t
from redbot.core import commands
from redbot.core.bot import R... |
import sys
from scipy.spatial.transform import Rotation as R
import argparse
import os
import pandas as pd
import numpy as np
sys.path.insert(1, '../utils/')
from obj_loader import obj_loader
from data_helper import *
def write_line(fout, line):
fout.write(line + '\n')
def normalize_one_obj(in_obj_dir, out_obj_dir... |
from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField, PasswordField, BooleanField, SubmitField
from wtforms.validators import DataRequired, Length, ValidationError, Email, EqualTo
from app.models import User
class LoginForm(FlaskForm):
username = StringField('Username', validators=[DataRe... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import psycopg2 as p
import time
import random
from . import Loader
from . import logger
import os
class PostgresLoader(Loader):
'''
A Loader class for load testing postgresql databases
'''
def __init__(self, host, port, user, password, db):
... |
import argparse
import json
import tensorflow as tf
import time
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from taattack._datasets import AgNews, Imdb, Mnli, Qnli, Snli, YelpPolarity
from taattack.attackers import ValCat2022
from taattack.config import BASE_DIR, DEVICES
from taattack.vi... |
from django.urls import reverse
from rest_framework import status
from rest_framework.permissions import IsAuthenticated
from environments.identities.traits.views import TraitViewSet
from environments.permissions.constants import (
MANAGE_IDENTITIES,
VIEW_ENVIRONMENT,
)
from environments.permissions.models imp... |
import re
import logging
from library.utility import jsonDumps
from library.logger import set_logging
from library.config import Config
def lambda_handler(event, context):
set_logging(level=logging.DEBUG)
config = Config()
#logging.debug("Client token: " + event['authorizationToken'])
logging.debu... |
"""
WSGI config for CUTMQuizWebService project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('D... |
import _plotly_utils.basevalidators
class SizesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="sizesrc", parent_name="table.cells.font", **kwargs):
super(SizesrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... |
"""
.. _ex-spm-faces:
==========================================
From raw data to dSPM on SPM Faces dataset
==========================================
Runs a full pipeline using MNE-Python:
- artifact removal
- averaging Epochs
- forward model computation
- source reconstruction using dSPM on the con... |
import pandas as pd
pd.set_option('expand_frame_repr', False)
pd.set_option('display.max_rows', 20000)
class QTPosition:
def __init__(self):
"""
持仓信息的初始化定义
"""
self.df = pd.DataFrame(data=None,
columns=['code', # 股票代码
'name', # 股票名字
'market_value', ... |
from former import util
from util import mask_
import torch
from torch import nn
import torch.nn.functional as F
import random, math
class SelfAttentionWide(nn.Module):
def __init__(self, emb, heads=8, mask=False):
"""
:param emb:
:param heads:
:param mask:
"""
s... |
class Table(object):
def __init__(self, group, name, json_dict):
self.group = group
self.name = name
self.json_dict = json_dict
def __str__(self):
return "Table(group={}, name={})".format(self.group, self.name)
|
import json, time
from basket import product
from basket import promotion
class SimpleLogger:
enabled = False
info = 'INFO'
error = 'ERROR'
def log(self, message, level=info):
"""Simple logger.
:param str message: Log message
:param str level: Log level name
"""
... |
import logging
from datetime import datetime
from pathlib import Path
from secrets import token_bytes
from typing import List, Optional, Tuple
from blspy import AugSchemeMPL, G1Element, PrivateKey
from chiapos import DiskPlotter
from melon.plotting.plot_tools import add_plot_directory, stream_plot_info_ph, stream_plo... |
#!/usr/bin/env python3
import feedparser
import datetime
import dateutil.parser
import signal
import time
import threading
import os
import sys
from db import FeedDB
from config import Config
class FeedUpdater(object):
def __init__(self, config, db):
self.__config = config
self.__db = db
... |
# coding: utf-8
from __future__ import absolute_import
import pytest
from six import iteritems
from thrall.amap.consts import EXTENSION_BASE, EXTENSION_ALL
from thrall.amap._models import _district_model
class TestDistrictRequestParams(object):
def test_init_ok(self):
model = _district_model.DistrictRe... |
import unittest
class TestMySQLPubSub(unittest.TestCase):
def setUp(self):
from minpubsub import create
self.pubsub = create('mysql', 'localhost', 'root', 'mysql', 'test')
def test_pubsub(self):
subscriber = self.pubsub.subscribe('channel')
self.pubsub.publish('channel... |
"""
WSGI config for django_project_dzhapua project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefaul... |
import random
import uuid
from typing import Optional, List
from django.contrib.auth.models import User
from django.db import models
from cards.models import Card, Printing
from cubes.models import Cube
class Draft(models.Model):
uuid = models.UUIDField(unique=True, default=uuid.uuid4)
name = models.CharFie... |
import os
import h5py
import netgen.csg as csg
import dolfin
import numpy
from dolfin_utils.meshconvert import meshconvert
basename = 'test'
cube = csg.OrthoBrick(csg.Pnt(-20, -5, -1), csg.Pnt(20, 5, 1))
hole = csg.Cylinder(csg.Pnt(0,0,-2), csg.Pnt(0,0,2), 1)
geo = csg.CSGeometry()
geo.Add(cube-hole)
mesh = geo.Gen... |
import os
import pandas as pd
import click
import joblib
from sklearn.ensemble import RandomForestRegressor
@click.command("train")
@click.option("--input-dir")
@click.option("--output-dir")
def train(input_dir: str, output_dir):
data = pd.read_csv(os.path.join(input_dir, "data.csv"))
target = pd.read_csv(os... |
from kubernetes import client
from .. import authz
from . import custom_api, v1_core
def get_notebook(notebook, namespace):
authz.ensure_authorized(
"get", "kubeflow.org", "v1beta1", "notebooks", namespace
)
return custom_api.get_namespaced_custom_object(
"kubeflow.org", "v1beta1", namesp... |
import copy
import os
# we already use worker threads, limit each process to 1 thread!
from functools import partial
from numbers import Number
from typing import Optional, Sequence
from trw.basic_typing import Stride, KernelSize
from trw.layers import LayerConfig, BlockConv, BlockConvNormActivation, default_layer_con... |
# https://www.codechef.com/problems/UTMOPR
for T in range(int(input())):
n,k=map(int,input().split())
s=sum(list(map(int,input().split())))
if(s%2==0):
print("odd") if(k==1) else print("even")
else: print("even") |
import pandas as pd
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.utils.validation import check_is_fitted
from feature_engine.dataframe_checks import (
_is_dataframe,
_check_input_matches_training_df,
)
class BaseImputer(BaseEstimator, TransformerMixin):
"""shared set-up checks an... |
#!/usr/bin/env python3
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.actions import LogInfo
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node
def g... |
import sys
import warnings
import itertools
import platform
import pytest
from decimal import Decimal
import numpy as np
from numpy.core import umath
from numpy.random import rand, randint, randn
from numpy.testing import (
assert_, assert_equal, assert_raises, assert_raises_regex,
assert_array_equal, assert_a... |
print("How Many Row You Want To Print")
one= int(input())
print("Type 1 Or 0")
two = int(input())
new =bool(two)
if new == True:
for i in range(1,one+1):
for j in range(1,i+1):
print("*",end=" ")
print()
elif new ==False:
for i in range(one,0,-1):
for j in range(1,i+1):
... |
from .classes import *
from shapely import ops
def _checkTpologyForTwoDegreeNodes(node):
ib_link, ob_link = node.incoming_link_list[0], node.outgoing_link_list[0]
# if not (ib_link.valid and ob_link.valid): return False
if ib_link.from_node is ob_link.to_node: return False
ib_link.ob_comb_link... |
import html
class QuizBrain:
def __init__(self, q_list):
self.question_number = 0
self.score = 0
self.question_list = q_list
self.current_question = None
def still_has_questions(self):
return self.question_number < len(self.question_list)
def next_question(self):
... |
from django.urls import path
from . import views
app_name = 'authapp'
urlpatterns = [
path('login/', views.login, name='login'),
path('logout/', views.logout, name='logout'),
path('register/', views.register, name='register'),
path('edit/', views.edit, name='edit'),
] |
import constants
from models.worker_spec import (
args_list_from_spec_params
)
def update_all_deployments(api, apps_api_instance, spec, status, namespace):
worker_deployment = update_worker_deployment(
apps_api_instance, spec, status, namespace
)
flower_deployment = update_flower_deployment(
... |
# encoding: utf-8
import os
import random
import torch
import torch.nn as nn
import torch.distributed as dist
from yolox.exp import Exp as MyExp
from yolox.data import get_yolox_datadir
class Exp(MyExp):
def __init__(self):
super(Exp, self).__init__()
self.num_classes = 1
self.depth = 0.67... |
# learning to use APIs
# Using Open Notify API to get info on astronauts in the space station
# Import requests module
import requests
# create variable for URL that will be used
url = 'http://api.open-notify.org/astros.json'
# Use a GET request to retrieve data from URL
people = requests.get (url)
# Us... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2016 Ben Kurtovic <ben.kurtovic@gmail.com>
#
# 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 ... |
# This material was prepared as an account of work sponsored by an agency of the
# United States Government. Neither the United States Government nor the United
# States Department of Energy, nor Battelle, nor any of their employees, nor any
# jurisdiction or organization that has cooperated in the development of thes... |
from django.test import TestCase
from cases.models import Case
from accounts.models import Account
from common.models import User, Comment, Attachments
class AccountCreateTest(object):
def setUp(self):
self.user = User.objects.create(
first_name="uday", username='uday', email='u@mp.com', role=... |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..svm import SVMTest
def test_SVMTest_inputs():
input_map = dict(
args=dict(argstr='%s', ),
classout=dict(argstr='-classout', ),
environ=dict(
nohash=True,
usedefault=True,
),
in_file=dict(
... |
# Copyright 2017 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" file acc... |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# Copyright (c) 2008-2021 pyglet contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follo... |
# coding=utf-8
# Copyright 2021 Iz Beltagy, Matthew E. Peters, Arman Cohan and The HuggingFace Inc. team. 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://w... |
"""
Delete all files in a list
"""
from glob import glob
from os import remove
# Create a list of file
file_list = glob('D:\\path\\to\\folder\\*char.ext')
print(file_list)
# remove items in list
for i in file_list:
remove(i)
|
#
# This file is part of pyasn1-modules software.
#
# Created by Russ Housley
# Copyright (c) 2019, Vigil Security, LLC
# License: http://snmplabs.com/pyasn1/license.html
#
import sys
import unittest
from pyasn1.codec.der.decoder import decode as der_decoder
from pyasn1.codec.der.encoder import encode as der_encoder
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 11 00:45:08 2018
seq1H_genlog: seqeunce learning model 2stack conv enc
- q(x), l(x)
- non-autoregressive (not feeding predicted labels)
- instance Norm.
- G: GLU version
- H: Highway-net version
기존 버그 완전 수정!
@author: mimbres
"""
import torch
impo... |
import numpy as np
import matplotlib.pyplot as plt
from dicepool import dpool
class Attributes(object):
"""
Class holding the attributes of a character
"""
def __init__(self, Int=1, Wit=1, Com=1, Str=1, Dex=1, Sta=1, Man=1, Pre=1, Res=1):
self.attr = {}
self.attr['int'] = Int
se... |
import subprocess
def stop_prometheus_node_exporter(silent):
if not isfile('/etc/systemd/system/node_exporter.service'):
return False # We have no node daemon installed.
if subprocess.call('sudo systemctl stop node_exporter', **get_subprocess_kwargs(silent)) != 0:
return False
return subpr... |
from cython.cimports import cqueue
from cython import cast
@cython.cclass
class Queue:
"""A queue class for C integer values.
>>> q = Queue()
>>> q.append(5)
>>> q.peek()
5
>>> q.pop()
5
"""
_c_queue = cython.declare(cython.pointer(cqueue.Queue))
def __cinit__(self):
se... |
def adress():
return None |
#encoding: utf-8
from ngram import ngram
def getwords(doc):
menus = [
"备孕","怀孕","产后",
"发烧","胎教","母胎",
"疾病","营养","护理",
"疾病","孕妇","孕妈",
"生育",
]
tg = ngram(menus,min_sim=0.0)
words = tg.getSimilarStrings(doc.encode("utf8")).keys()
return dict([(w,1) for w in wor... |
import pytest
import docker
import requests
MAC_PRODUCT_KEY = 'confluence'
DOCKER_VERSION_ARG = 'CONFLUENCE_VERSION'
DOCKERFILES = ['Dockerfile', 'Dockerfile-alpine']
IMAGE_NAME = 'confluence-dev'
# This fixture cleans up running containers whose base image matches IMAGE_NAME after each test
@pytest.fixture
def doc... |
from pyspark.sql import SparkSession
# COMMAND ----------
# Optional:
sc._jvm.com.microsoft.kusto.spark.utils.KustoDataSourceUtils.setLoggingLevel("all")
# COMMAND ----------
pyKusto = SparkSession.builder.appName("kustoPySpark").getOrCreate()
kustoOptions = {"kustoCluster":"<cluster-name>", "kustoDatabase" : "<data... |
# Copyright (c) 2020
# Author: xiaoweixiang
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
__all__ = [
"__title__"... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
port1={21:"FTP",22:'SSH',23:"telnet",80:'http'}
port1={value:key for key,value in port1.items()}
print(port1)
# In[2]:
list=[(1,2),(3,4),(5,6),(4,5)]
for i in range(len(list)):
list[i]=sum(list[i])
print(list)
# In[5]:
lis=[(1,2,3),[1,2],['a','hit','less']]... |
import unittest
from shexer.shaper import Shaper
from test.const import BASE_FILES
from test.t_utils import file_vs_str_tunned_comparison
from shexer.consts import TURTLE
import os.path as pth
_BASE_DIR = BASE_FILES + "qualifiers" + pth.sep
class TestShapeQualifiersMode(unittest.TestCase):
def test_wi... |
import logging
import pytest
import ibm_spectrum_scale_csi.base_class as baseclass
import ibm_spectrum_scale_csi.common_utils.input_data_functions as inputfunc
LOGGER = logging.getLogger()
pytestmark = [pytest.mark.volumeprovisioning, pytest.mark.localcluster, pytest.mark.cg]
@pytest.fixture(autouse=True)
def values(... |
from typing import Any, Dict, Optional
from pydantic.fields import Undefined
from flask_sugar import params
def Path(
default: Any,
*,
alias: Optional[str] = None,
title: Optional[str] = None,
description: Optional[str] = None,
gt: Optional[float] = None,
ge: Optional[float] = None,
... |
#!/usr/bin/python
from pwn import *
# conn = process("./cake")
conn = remote("2018shell2.picoctf.com", 54086)
def wait_prompt():
conn.recvuntil("In total, you have sold $")
def make_cake(price, name):
conn.send("M\n")
conn.recvuntil("Made cake ")
cake_index = int(conn.recvline()[:-2])
conn.send(... |
"""
Find Duplicates: You have an array with all the numbers from 1 to N, where N is at most 32,000. The
array may have duplicate entries and you do not know what N is. With only 4 kilobytes of memory
available, how would you print all duplicate elements in the array
In List[int]
4KB is ~ 4_000 bytes or ~ 32_000 bit... |
import shutil
from os import path
from delta_migrations import app
from click.testing import CliRunner
def test_creating_migration_dir_without_location():
"""test creation of history table without a path"""
runner = CliRunner()
result = runner.invoke(app.create_migration_dir)
assert not result.excepti... |
import json
import time
from urllib.parse import urljoin
import dateutil.parser
import requests
import logging
import os
from kinetick.enums import SecurityType, PositionType
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=os.getenv('LOGLEVEL') or logging.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated Tue Oct 10 00:42:24 2017 by generateDS.py version 2.28b.
# Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
#
# Command line options:
# ('--no-process-includes', '')
# ('-o', 'esociallib/v2_04/evtIrrf.py')
#
# Command line arguments:
#... |
#! /usr/bin/env python
from expand_data import debug_functions, print_debug
import inspect
############################################################################################
def get_options(): ... |
class AstrObject():
def __init__(self):
print 'test'
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os.path import exists
import os
import sys
import setuptools # NOQA
from setuptools import find_packages
def parse_version(fpath):
"""
Statically parse the version number from a python file
"""
import ast
if not exists(fpath):
raise Value... |
import pixie
image = pixie.Image(200, 200)
image.fill(pixie.Color(1, 1, 1, 1))
paint = pixie.Paint(pixie.PK_GRADIENT_RADIAL)
paint.gradient_handle_positions.append(pixie.Vector2(100, 100))
paint.gradient_handle_positions.append(pixie.Vector2(200, 100))
paint.gradient_handle_positions.append(pixie.Vector2(100, 200))
... |
#!/usr/bin/env python
import argparse
import os
import shlex
import shutil
import subprocess
def silent(*cmd):
with open(os.devnull, 'w') as devnull:
subprocess.check_call(cmd, stdout=devnull)
DISTS_DIR = 'downloaded_dists'
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
... |
# coding: utf-8
"""
Copyright 2016 SmartBear Software
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 l... |
# The MIT License (MIT)
#
# Copyright (c) 2013 Curtis Schlak
#
# 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, mod... |
"""
Tests for the archive subsystem. Tests for each driver are here.
"""
import pytest
from anchore_engine.subsys import logger
from anchore_engine.subsys.object_store import exc
from anchore_engine.subsys.object_store.drivers.filesystem import (
FilesystemObjectStorageDriver,
)
from anchore_engine.subsys.object_s... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.conf import settings
DEFAULTS = {"SERVICE_CLASS": None, "WEBHOOK_SECRET": None, "PROCESSOR_CLASS": None}
class AppSettings(object):
def __init__(self, prefix, defaults):
self.prefix = prefix
self.defaults = defaults
... |
# Copyright 2018-2020 Xanadu Quantum Technologies 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... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of pyunicorn.
# Copyright (C) 2008--2022 Jonathan F. Donges and pyunicorn authors
# URL: <http://www.pik-potsdam.de/members/donges/software>
# License: BSD (3-clause)
#
# Please acknowledge and cite the use of this software and its authors
# when results a... |
# Generated by Django 2.0.7 on 2019-11-01 03:21
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('students', '0003_auto_20191101_0848'),
]
operations = [
migrations.RenameField(
model_name='studentqualification',
old_name=... |
#Análisis de Algoritmos 3CV2
# Alan Romero Lucero
# Josué David Hernández Ramírez
# Práctica 4 Divide y vencerás
"""
MÓDULOS DE VARIABLES GLOBALES
_parameters: Lista que almacena los parámetros de los puntos a trazar
para Partition. Cada elemento es una tupla que almacena la longitud
... |
from django.urls import path
from . import views
app_name = 'levels'
urlpatterns = [
path('', views.CategoryIndexView.as_view(), name='index'),
path('search/', views.SearchView.as_view(), name='search'),
path('<path>/', views.CategoryDetailView.as_view(), name='category'),
path('files/<pk>.shtml', vi... |
#!/usr/bin/env python
#
# Copyright 2010 Per Olofsson
#
# 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 django.contrib import admin
from .models import Project,Profile,ReviewRating
# Register your models here.
admin.site.register(Project)
admin.site.register(Profile)
admin.site.register(ReviewRating)
|
from app import create_app
APP = create_app() |
"""Image Processing: image manipulation and image info routines
"""
# Copyright 2017-2018 Matthew A. Clapp
#
# 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/licens... |
import re
import functools
from furl import furl
from inspect import isfunction, ismethod
from .response import Response
from .constants import TYPES
from .request import Request
from .matcher import MatcherEngine
from .helpers import trigger_methods
from .exceptions import PookExpiredMock
from .matchers import init a... |
#####################################
## 11 bit Operation at ADC ##
#####################################
# import Libraries
import csv
import cmath
import numpy as np
import matplotlib.pyplot as plt
# Temperature & Resistance from PT-100 Datasheet
temp=[]
res=[]
count=0
for row in csv.reader(open('pt100-data... |
# Copyright 2013-2022 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.package import *
class Diy(CMakePackage):
"""Data-parallel out-of-core library"""
homepage = "https:... |
# base16-qutebrowser (https://github.com/theova/base16-qutebrowser)
# Base16 qutebrowser template by theova and Daniel Mulford
# Embers scheme by Jannik Siebert (https://github.com/janniks)
base00 = "#16130F"
base01 = "#2C2620"
base02 = "#433B32"
base03 = "#5A5047"
base04 = "#8A8075"
base05 = "#A39A90"
base06 = "#BEB6... |
# Russian Roulette Exit Portal
DIZZY_NPC = 9000155 # some roulette-looking npc
sm.setSpeakerID(DIZZY_NPC)
if sm.sendAskYesNo("Are you sure you want to leave? You won't be able to return!"):
sm.warpNoReturn(sm.getPreviousFieldID()) |
from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from django.core.management.base import BaseCommand
from zerver.models import get_user_profile_by_email, UserProfile
import os
from six.moves.configparser import SafeConfigParser
class Command(BaseCommand):
help =... |
# -*- coding: utf-8 -*-
"""
transitions.extensions.nesting
------------------------------
Adds the capability to work with nested states also known as hierarchical state machines.
"""
from copy import copy, deepcopy
from functools import partial
import logging
import warnings
from six import string_types
... |
# engine/result.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Define result set constructs including :class:`.ResultProxy`
and :class:`.RowPro... |
#!/usr/bin/env python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the follo... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
# Export this package's modules as members:
from .registry import *
from .crypto_key import *
from .crypto_key_iam_binding import *
fro... |
import numpy as np
import pandas as pd
import pickle
import time
import random
import os
from sklearn import linear_model, model_selection, ensemble
from sklearn.svm import SVC
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.base import clone
from sklearn import metrics
from sklearn.model_selectio... |
from zope.interface import Interface, Attribute
class IRenderer(Interface):
"""
Each Widget has its own renderers.
Each Renderer is a multi adapter for a widget and a frame_buffer type.
"""
def render(self):
pass
class IDevice(Interface):
"""
Base interface for a hardware device... |
import json
from websocket import create_connection
import websocket
url = "ws://127.0.0.1:8080/"
with open('trx.json') as json_file:
data = json.load(json_file)
try:
ws = create_connection(url)
ws.ping()
while True:
ws.send_binary(json.dumps(data))
ws.close()
except Exception as ex:
print(... |
from redbot.core import commands
import asyncio
# import json
import pause
from datetime import datetime
from dateutil import tz
import sys
from datetime import datetime
import time as pytime
from time import sleep
if sys.version_info[0] >= 3:
from datetime import timezone
class Reminders(commands.Cog):
"""s... |
"""
CUDA driver bridge implementation
NOTE:
The new driver implementation uses a *_PendingDeallocs* that help prevents a
crashing the system (particularly OSX) when the CUDA context is corrupted at
resource deallocation. The old approach ties resource management directly
into the object destructor; thus, at corruptio... |
execfile('1_import_pkgs.py')
execfile('2_epochs.py')
execfile('3_get_model_D4.py')
execfile('4_get_data.py')
execfile('5_divide_data.py')
execfile('6_fit_model.py')
execfile('7_learning_curve.py')
execfile('8_accuracy_4_2.py')
execfile('9_confusion_matrix_4_2.py')
#execfile('10_images_misclassified.py')
#execfile('11_m... |
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'', include('noticampus.urls')),
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.