content stringlengths 5 1.05M |
|---|
#coding=utf-8
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
from utils.readConfig import ReadConfig
from utils.auth_ipipe import Get_ipipe_auth
from utils.db import Database
from utils import bosclient
import os
import time
import datetime
import logging
from tornado.httpclient... |
import pytest
import numpy as np
from numpy.testing import assert_equal
from glue.core import Data, DataCollection
from glue.core.link_helpers import LinkSame
ARRAY = np.arange(3024).reshape((6, 7, 8, 9)).astype(float)
class TestFixedResolutionBuffer():
def setup_method(self, method):
self.data_coll... |
# -*- coding: utf-8 -*
from east.asts import ast
from east.asts import utils
from east import consts
class NaiveAnnotatedSuffixTree(ast.AnnotatedSuffixTree):
__algorithm__ = consts.ASTAlgorithm.AST_NAIVE
def _construct(self, strings_collection):
"""
Naive generalized suffix tree constructio... |
from docxtpl import DocxTemplate
from constants import monthes
class Saver:
# TODO
"""
Смотри, мне кажется, что когда пользователь указывает нам фотографию,
мы будем копировать её, куда-то в скрытую папке и в б/д хранить путь в секретке
---
GUI -> Saver -> DB
path ... |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLES2 import _types as _cs
# End users want this...
from OpenGL.raw.GLES2._types import *
from OpenGL.raw.GLES2 import _errors
from OpenGL.constant import Constant as _C
... |
#!/usr/bin/env python
import sys
import os
# ----------------------------------------------------------------------------|
if __name__ == '__main__':
print """Generating Configuration Script for remote Yuma Testing...\n"""
ipAddr = raw_input( "Enter Netconf Agent Ip address: ")
port = raw_input( "... |
import os.path
from typing import Dict, List
import dpath.util
def get_files(plots_data: Dict) -> List:
values = dpath.util.values(plots_data, ["*", "*"])
return sorted({key for submap in values for key in submap.keys()})
def group_by_filename(plots_data: Dict) -> List[Dict]:
files = get_files(plots_da... |
#!/usr/bin/env python
#/*******************************************************************************
# Copyright (c) 2012 IBM Corp.
# 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
# ht... |
# Copyright (c) 2008, Humanized, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditio... |
# Copyright 2014, Doug Wiegley (dougwig), A10 Networks
#
# 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 b... |
from django.contrib.auth.models import User
from django.test import TestCase
from django.urls import resolve, reverse
from ..models import Board, Post, Topic
from ..views import PostListView
class TopicPostsTests(TestCase):
def setUp(self):
self.board = Board.objects.create(name='Django', description='Dj... |
# Django imports
from django.urls import path
# About app imports
from about.views.about_view import about
app_name = 'about'
urlpatterns = [
path(
route='',
view=about,
name='about'
),
]
|
perguntas = {
'Pergunta1':{
'pergunta':'Quanto é 2 + 2?',
'respostas': {'a':2,'b':22,'c':4},
'resposta_certa':'c'
},
'Pergunta2':{
'pergunta':'Quanto é 2 - 2?',
'respostas': {'a':2,'b':0,'c':4},
'resposta_certa':'b'
}
}
acertos = 0
for pk,pv in perguntas.i... |
# coding=utf-8
from __future__ import absolute_import, division, print_function, \
unicode_literals
from typing import Optional, Text, Tuple, Union
from django.core.cache import BaseCache, DEFAULT_CACHE_ALIAS
from django.core.cache.backends.base import DEFAULT_TIMEOUT
from triggers.locking import resolve_cache
f... |
"""
(c) 2021 Usman Ahmad https://github.com/selphaware
test_main.py
Testing mainly file compressions and some string compressions
"""
import unittest
from tests.tfuncs import string_test, compress_test # type: ignore
from os import remove
class TestHuffPress(unittest.TestCase):
def test_d_txt(self... |
from forsa import settings
from wajiha.models import OpportunityCategory
def google_keys(request):
return {'GOOGLE_ANALYTICS_KEY': settings.GOOGLE_ANALYTICS_KEY, 'GTM_KEY': settings.GTM_KEY}
def category_list(request):
return {'category_search_list': OpportunityCategory.objects.all()} |
# -*- coding: utf-8 -*
from itertools import chain
from os import getcwd, path
import argparse
from pupy.decorations import tictoc
CD = getcwd()
def fmt_line(line, col, phillup=False):
"""
:param line:
:param col:
:return:
# >>> format_line([])
"""
if len(line) == 1:
code = line[... |
# -*- coding: utf-8 -*- #
# Copyright 2021 Google LLC. 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 requir... |
from slither.core.visualization import render_map
from slither.service import Service
s = Service()
activities = s.list_activities()
a = [a for a in activities if a.has_path][0]
print(a.start_time)
map = render_map(a.get_path())
with open("map.html", "w") as f:
f.write(map)
|
from django.db import models
# Create your models here.
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.contrib.auth.base_user import BaseUserManager
class CustomUserManager(BaseUserManager):
def create_user(self, email, password, **extra_fields):
if not ema... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File : kernel.py
# Author : Jiayuan Mao
# Email : maojiayuan@gmail.com
# Date : 02/04/2018
#
# This file is part of Jacinle.
# Distributed under terms of the MIT license.
"""Useful utilities for kernel-based attention mechanism."""
import torch
from .linalg impo... |
# ==========================================================
# INFORMATIONS :
# -----------------------------
# UTILITÉ :
# Corps du programme de génération
# procédurale de carte en 2D
# ==========================================================
import time
import sys
from modules.short_class_import impor... |
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import AxesGrid
def shiftedMap(cmap, start=0, midpoint=0.5, stop=1.0, name='shiftedcmap'):
cdict = {
'red': [],
'green': [],
'blue': [],
'alpha': []
}
# regular index to comput... |
def foo():
print("Hello justuse-user!") |
import asyncio
from pytest import mark
from graphql.execution import execute
from graphql.language import parse
from graphql.type import (
GraphQLSchema,
GraphQLObjectType,
GraphQLField,
GraphQLList,
GraphQLInterfaceType,
GraphQLBoolean,
GraphQLInt,
GraphQLString,
)
class Barrier:
... |
# Author: Xinshuo Weng
# email: xinshuo.weng@gmail.com
import numpy as np
from PIL import Image
import init_paths
from prob_stat import hist_equalization
from xinshuo_visualization import visualize_distribution, visualize_image
def test_hist_equalization():
print('testing for gaussian distribution')
random_data = n... |
"""
Oracle implementation of Files.InFileset
"""
from WMCore.WMBS.MySQL.Files.InFileset import InFileset as InFilesetMySQL
class InFileset(InFilesetMySQL):
pass
|
"""
Retrieve declination for given word using wiktionary API.
"""
import re
import click
import requests
import tabulate
import bs4
API = 'http://de.wiktionary.org/w/api.php'
@click.command()
@click.argument('word')
@click.option('--table-fmt', type=click.Choice(tabulate.tabulate_formats),
help='Vis... |
import time , os
os.system("clear")
txt = "Hello World ! \nThis is a test.\nHope,it will work.\nSee You Soon!"
for i in range(0,len(txt)):
print(txt[i],end="", flush=True)
time.sleep(0.1)
print ("")
my_string = 'Hello world ! This is a test.'
time.sleep(0.3)
for i in range(0,5):
print (my_string,end="\r")
for j... |
# Copyright 2016 Georg Seifert. 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 o... |
"""
20161208 Scott Havens
Convert the IPW images for the topo input into a netCDF file
"""
from datetime import datetime
import netCDF4 as nc
from smrf import ipw
file_name = 'topo.nc'
f = {
'dem': 'dem.ipw',
'mask': 'mask.ipw',
'veg_height': 'veg_height.ipw',
'veg_k': 'veg_k.ipw',
'veg_... |
import setuptools
#long_description = open('README.md').read()
setuptools.setup(
name='canary_training',
version='0.1',
author='broydj',
author_email='broydj@amazon.com',
description='',
#long_description=long_description,
#long_description_content_type='text/markdown',
url='',
#... |
# File automatically generated by mapry. DO NOT EDIT OR APPEND!
"""defines some object graph."""
import typing
class SomeGraph:
"""defines some object graph."""
def __init__(
self,
map_of_strings: typing.MutableMapping[str, str]) -> None:
"""
initializes an instanc... |
import numpy as np
from scipy.interpolate import spline
import matplotlib.pyplot as plt
plt.style.use('paper2')
r1_Pd2plus = [1.6, 1.7030303, 1.80606061, 1.90909091, 2.01212121, 2.11515152, 2.21818182, 2.32121212, 2.42424242,
2.52727273, 2.63030303, 2.73333333, 2.83636364, 2.93939394, 3.04242424, 3.14545... |
""" -------------------- MAIN BENCHMARKING SCRIPT -----------------------
Run this script by executing the following from a command prompt:
python3 benchmark.py
Or, use just "python benchmark.py" if that is how you normally access Python 3.
One some operating systems (Linux, Mac OSX), you may be able to ... |
def example(Simulator):
from csdl import Model
import csdl
import numpy as np
class ExampleSimple(Model):
def define(self):
x = self.declare_variable('x')
y = self.declare_variable('y')
a = x + y
b = x + y
c = 2 * a
... |
#!/usr/bin/env python
import tkinter as tk
import serial
#import serial.tools.list_ports
import os
from random import Random
from time import sleep
import threading
master_ser = serial.Serial("COM30",115200,timeout=1)
window = tk.Tk()
window.title('My Window')
window.geometry('500x300')
cmd = [0x00,0x00]
... |
import tkinter
import tkinter.tix
from scripts import Warnings, Constants
from scripts.frontend.custom_widgets import CustomLabels
from scripts.frontend.custom_widgets.WidgetInterface import WidgetInterface
class Frame(tkinter.Frame, WidgetInterface):
_selected = "Number of Selected Items: "
def __init__(se... |
import string
import random
import sys
args = sys.argv
N = int(args[1])
M = int(args[2])
saida = args[3]
pontos = []
letras = string.hexdigits
for i in range(N):
ponto = []
ponto.append("".join(random.choice(letras) for i in range(random.randint(1, 31))))
tem_repetido = True
while tem_repetido:
... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Validators for user profiles."""
from __future__ import absolute_import, print_fu... |
# x_6_4
#
# セリーグの対戦カードの組み合わせを「巨人 x 阪神」のように表示してください(ただし同一チーム同志は対戦しないこと)
central_league = ['巨人', 'ヤクルト', '横浜', '中日', '阪神', '広島']
|
#MIT License
#Copyright (c) 2021 Jonatan Asensio Palao
#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... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 3 16:27:19 2018
@author: binggu
"""
import numpy as np
#! program to illustrate the colored Gaussian Noise generator CGAUSS
#! The routine must be initialized with CGAUS0 and calls a flat distribution
#! random number generator available with mo... |
# import the module
# get the current clock ticks from the time() function
seconds = basic_examples.time()
print(seconds)
currentTime = time.localtime(seconds)
# print the currentTime variable to know about it
print(currentTime,'\n')
# use current time to show current time in formatted string
print('Current System ... |
from attr import attrs
from google.protobuf.message import DecodeError
from .constants import API_URL
from .pb import upload_pb2
from ..models import Call, ParsedResponse
@attrs(slots=True)
class MusicManagerCall(Call):
base_url = API_URL
request_type = response_type = upload_pb2.UploadResponse
def __attrs_post_... |
from django import forms
from django.contrib.auth.forms import AuthenticationForm
class RememberMeAuthenticationForm(AuthenticationForm):
remember = forms.BooleanField(required=False, widget=forms.CheckboxInput())
|
/home/runner/.cache/pip/pool/9e/67/da/1425736d5888390dbe323817b7e6cdf148faef8842822c2be48a25fbf5 |
from django.contrib import admin
from admin_view.admin import CustomAdmin, ModelViewAdmin
from admin_view.views.base import AdminTemplateView
from tests.models import ExampleModel
class ExampleView(AdminTemplateView):
pass
class CustomExampleAdmin(CustomAdmin):
app_label = 'tests'
module_name = 'custom... |
# Copyright 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 accompany... |
import numpy
from torch import nn
import torch
|
from cktgen.cktgen import *
if __name__ == "__main__":
args,tech = parse_args()
ndev = ADT( tech, "n",npp=6,nr=1)
ndev.addM1Terminal( "s", 1)
ndev.addM1Terminal( "g", 3)
ndev.addM1Terminal( "d", 5)
pdev = ADT( tech, "p",npp=6,nr=1)
pdev.addM1Terminal( "s", 1)
pdev.addM1Terminal( "g", 3)
pdev.addM1... |
"""
Currently, the code is tested by running:
https://github.com/Minyus/pipelinex_pytorch/blob/master/main.py
# TODO: Add test code.
"""
|
import firebase_admin
from firebase_admin import credentials, firestore
cred = credentials.Certificate("./bnode-2cd0d-firebase-adminsdk-eyxsn-c90ed335bb.json")
firebase_admin.initialize_app(cred)
db = firestore.client()
docs = db.collection('users').get()
for doc in docs:
print(doc.to_dict())
data = {
u'name... |
from flask import Flask, redirect, render_template, request, flash, url_for, session
import numpy as np
import pickle
from settings.settings import DEV
app = Flask(__name__)
app.config.from_object(DEV)
# load model
with open('model.pkl', 'rb') as file:
model = pickle.load(file)
@app.route("/", methods=["GET","PO... |
# Copyright (c) 2021 kamyu. All rights reserved.
#
# Google Code Jam 2021 Round 2 - Problem A. Minimum Sort
# https://codingcompetitions.withgoogle.com/codejam/round/0000000000435915/00000000007dc51c
#
# Time: O(ClogN) = C/N + C/(N-1) + ... + C/2 = 4.187 * 10^8 (given N = 100, C = 10^8)
# Space: O(1)
#
# Usage: python... |
from setuptools import setup, find_packages
VERSION = "1.0.1"
def read_file(filepath):
with open(filepath) as f:
return f.read()
setup(
name="django-seo2",
version=VERSION,
description="A framework for managing SEO metadata in Django.",
long_description=read_file('README.rst'),
url=... |
#openfi
#escape char in the olxlo produced file will need substitute at later date
#for runtime on the second loop of instantiation self.populate
dxpone = {
"name":"dxpone",
"refapione":"dxponeapione --- Hi and welcome to the text case scenario that will be used to insert \
towards a discord or something simil... |
import sys
from awsglue.transforms import *
from awsglue.utils import getResolvedOptions
from pyspark.context import SparkContext
from awsglue.context import GlueContext
from awsglue.job import Job
from awsglue.dynamicframe import DynamicFrame
#Retrieve parameters for the Glue job.
args = getResolvedOptions(sys.argv, ... |
#%% Generate graphs with the operating points
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
ground_truth_file = 'mscoco_ground_truth.json'
predictions_file = 'mscoco_predictions.json'
# initialize COCO ground truth api
cocoGt = COCO(ground_truth_file)
# initialize COCO detections api
c... |
from django.core.management.base import BaseCommand, CommandError
from crowdataapp.models import Document
import re
import csv
class Command(BaseCommand):
help = 'Report weird numbers on entries.'
def handle(self, *args, **options):
documents = Document.objects.filter(verified=True)
with open('docs_with_... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
tcga_path = './data/tcga/'
sample_sheet = pd.read_table(tcga_path + 'metadata/full_transcriptome_sample_sheet.txt')
#Function for removing decimals off ENSG gene names
cut_decimal = np.vectorize(lambda x : x.split('.')[0])
... |
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
setup_args = generate_distutils_setup(
packages=['ekf_localization'],
package_dir={'':'msgs_lib'}
)
setup(**setup_args)
|
from src import app
app.run(debug=True, host="0.0.0.0", port=5000)
|
from engine.views.wavefront_parsers import ObjectParser
with open("objects/cockpit.obj", 'r') as f:
object_file_data = f.readlines()
class TestIntegratingObjectParser(object):
def setup(self):
self.parser = ObjectParser()
self.target = self.parser.parse(object_file_data)
def test_objec... |
def complexfunc(am,grades=10):
print courses[0]
print grades["compilers"]
if courses[0]<grades["compilers"]:
print "everything is ok"
test = complexfunc(200020)
|
from flask import request
from werkzeug import exceptions
from backend.app import app, db
from backend.models import Card
@app.route("/model", methods=["GET", "POST"])
def example():
if request.method == "POST":
if request.is_json:
data = request.get_json()
new_model = Card(data)
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
description = """ Extract physiological log files from encoded "_PHYSIO" DICOM file generated by CMRR MB sequences
and convert them to BIDS compliance format """
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except(IOError, ImportE... |
from django.core.management.base import BaseCommand, CommandError
from arxiv import models, tasks
class Command(BaseCommand):
"""Send a test email to verify mail server configuration"""
def add_arguments(self, parser):
parser.add_argument('recipient')
def handle(self, *args, **kwargs):
#... |
"""Long Short Term Memory Network Classifier python module
website references:
https://www.kaggle.com/ternaryrealm/lstm-time-series-explorations-with-keras"""
import time
import itertools
import os
from os import listdir
from os.path import isfile, join
from numpy import genfromtxt
import numpy as np
from keras.mode... |
import os
DIR_NEW_TEMPLATE = 'new_templates'
NEW_PROJECT_DIR_NAME_PREFIX = 'designer_'
NEW_TEMPLATE_IMAGE_PATH = os.path.join(DIR_NEW_TEMPLATE, 'images')
DIR_PROFILES = 'profiles'
DESIGNER_CONFIG_FILE_NAME = 'config.ini'
|
# coding=utf-8
# Copyright 2019 The TensorFlow GAN 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 applicabl... |
import random
import os
def read_data(filepath="./archivos/data.txt"):
words = []
with open(filepath, "r", encoding="utf-8") as f:
for line in f:
words.append(line.strip().upper())
return words
def run():
data = read_data(filepath="./archivos/data.txt")
chosen_word = random.c... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, sys, glob, shutil, subprocess as sp
from skbuild import setup
from skbuild.setuptools_wrap import create_skbuild_argparser
import argparse
import warnings
import platform
cmake_args = []
parser = argparse.ArgumentParser(add_help=False)
parser.add_argument("-h",... |
#!/usr/bin/env python3
# Hiber [File/Link] CLI Client
# Jus de Patate - 2020
import sys
import os
import re
try:
import requests
except ImportError:
print("Couldn't import requests")
exit(1)
version = "1.0"
hiberfile = "https://hiberfile.com"
hiberlink = "https://hiber.link"
def shortLink(originalLink)... |
# -*- coding: utf-8 -*-
"""
openedx_export_plugins Django application initialization.
"""
from django.apps import AppConfig
from openedx.core.djangoapps.plugins.constants import PluginURLs, ProjectType
class OpenedxExportPluginsConfig(AppConfig):
"""
Configuration for the openedx_export_plugins Django applic... |
#!/usr/local/autopkg/python
import json
import plistlib
import unittest
from io import BytesIO
from tempfile import TemporaryDirectory
from unittest import mock
from unittest.mock import patch
from autopkglib import Preferences
TEST_JSON_PREFS = b"""{"CACHE_DIR": "/path/to/cache"}"""
TEST_PLIST_PREFS = b"""<?xml ver... |
#!/usr/bin/env python3
"""
Created on 26 May 2021
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
import requests
from scs_core.aws.manager.configuration_check_requester import ConfigurationCheckRequester
# --------------------------------------------------------------------------------------------... |
# 求邻接信息熵
# 传入邻接列表,返回信息熵
from util import entropy, P, eMax, getSeq, cleanStopWord
def wordRank(seq, text):
"""
词的灵活程度又它的左临集合和右临集合判定
"""
LeftSet, RightSet = [], []
cur = text.find(seq)
wl = len(seq)
while cur != -1:
if cur != 0:
LeftSet.append(text[cur - 1:cur])
R... |
# Steven Atkinson
# satkinso@nd.edu
# April 5, 2018
"""
Elliptic problem
dimensionality reduction is data-driven and Bayesian, inputs to forward
surrogate are uncertain.
Uses two KGPLVMs
"""
from __future__ import absolute_import
from . import data, train, train_doe, analysis, util |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 16 18:26:18 2020
@author: Wilson
"""
import json, requests, time, random
from pytube import YouTube
from datetime import datetime
from sys import exit
import re, io
count = 0
countDL = 0
countSkip = 0
starttime = datetime.now()
#random timer wait
def wait(start, end):
... |
import logging, fileinput, fnmatch, subprocess
import requests
from bs4 import BeautifulSoup
import sys
import os
from datetime import datetime
import re
from subprocess import Popen, STDOUT, PIPE
from ansible_playbook_runner import Runner
api_version = '2600'
rel_dict = {
'Appliance Configuration Timecon... |
from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileAllowed
from wtforms import StringField, PasswordField, BooleanField, SubmitField, TextAreaField
from wtforms.validators import ValidationError, DataRequired, Email, EqualTo, Length
from app.models import User
class LoginForm(FlaskForm):
use... |
# -*- coding: utf-8 -*-
#/usr/bin/python3
'''
June 2017 by kyubyong park.
kbpark.linguist@gmail.com.
https://www.github.com/kyubyong/transformer
maxlen = 70, batch_size = 128
源端、目标端、proj 词表共享 ???qe-brain中没有共享
优化策略:已经更改为和qe-brain中相同
'''
class QE_Hyperparams:
'''Hyperparameters'''
# data
source_train = '../p... |
""" conf test cases """
import unittest
from xcmd.conf import Conf, ConfVar
class ConfTestCase(unittest.TestCase):
""" test conf code """
def setUp(self):
""" nothing for now """
pass
def test_conf(self):
""" basic tests """
conf = Conf(
ConfVar(
... |
import pandas as pd
import numpy as np
import re
import time
import sys
degree = {
"06": ["Академический бакалавр", "Специалист"],
"07": ["Магистр"]
}
uni_module = {
"0": "универсальный модуль",
"1": "модуль философия мышление",
"2": "модуль цифровая культура",
"3": "модуль креативные технолог... |
'''
Created on Jan 30, 2016
@author: Ziv
'''
import sys
import tkinter as tk
import tkinter.constants
import tkinter.filedialog
from tkinter.scrolledtext import ScrolledText
from srtFix.processFile import processFile
from getArgs import fixParams
from srtFix.processFile import calculateOffset
class TkFileDialogExampl... |
import sys
N, M = sys.stdin.readline().split()
AandB = sys.stdin.read().split()
print(' '.join(sorted(AandB, key=int)))
|
import argparse
import base64
import os
import random
import shutil
from binascii import hexlify
from Crypto.Cipher import AES
from Crypto.Util import Counter
banner = """
_ _
| | |
_ _ _ _ ____ ____| | | ____
( \\ / ) | | |/ ___) _ ) | |/ _ |
) X... |
from mkcommit import CommitMessage, editor, to_stdout
def commit():
return CommitMessage("whatever", editor())
if __name__ == "__main__":
to_stdout(commit())
|
"""Channel consumers."""
import json
from channels import Group
from channels.auth import channel_session_user, channel_session_user_from_http
from rest_framework.renderers import JSONRenderer
from .actions import send_real_person_status, send_scenes_status, send_units_status, STATUS_GROUP
@channel_session_user_fro... |
from pystats import *
mean = 3.95 # mean of the samples
stddev = 0.1 # standard deviation of the samples
lower_bound = 3.9
upper_bound = 4.1
print('Fraction under lower bound [ P(X <= {:1.4f}) ] = {:1.4f}'.format(lower_bound, pnorm(lower_bound, mean, stddev)))
print('Fraction over upper bound [ P(X > {:1.4f}) ] = {... |
# import pandas as pd
# import numpy as np
# import matplotlib.pyplot as plt
# df = pd.read_csv('C:\\Yitian\\FS_CE_NETS_Py\\1.csv')
# #df=df.to_excel('C:\Yitian\FS_Cascading_Events_NETS\Frequency Response.xlsx', 'Line_02-03_Outage', index=False)
# x=df.ix[2:2000,'Results']
# #Titles = np.array(df.loc[-1, :])
#... |
# 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, overload
from ... import _utilities
fro... |
# python mysql
from configparser import RawConfigParser, Error
import os
def readConfig():
"""
Return
------
`(variable) config: ConfigParser`
"""
# Deal with path issue
folder = os.path.dirname(os.path.abspath(__file__))
config_file = os.path.join(folder, 'localConfig.env')
co... |
#!/usr/bin/env python2.7
"""
update_dreqs_0012.py
This script is run to update the version on two of the CNRM-CM6-1-HR to the
same as the first submission. The files for these two submissions are then
copied to the same directory and the directory value for that file is updated
to the new path.
"""
import argparse
fro... |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
from chia.instrumentation.observers.observer import Observer
from chia.instrumentation.observers.observer_factory import ObserverFactory
__all__ = ["Observer", "ObserverFactory"]
|
import tensorflow as tf
from tensorflow.keras.metrics import BinaryAccuracy, AUC, FalsePositives, FalseNegatives
from tensorflow.keras.losses import BinaryCrossentropy
from tensorflow.keras.callbacks import ReduceLROnPlateau, EarlyStopping
from tensorflow.keras.layers import Conv2D, MaxPooling2D, AveragePooling2D, Flat... |
import torch
class SpikingActivation(torch.autograd.Function):
"""
Function for converting an arbitrary activation function to a spiking equivalent.
Notes
-----
We would not recommend calling this directly, use
`pytorch_spiking.SpikingActivation` instead.
"""
@staticmethod
def for... |
import random
class NormalArm():
def __init__(self, mu, sigma):
self.mu = mu
self.sigma = sigma
def draw(self):
return random.gauss(self.mu, self.sigma)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.