content stringlengths 5 1.05M |
|---|
# ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University at Buffalo
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copy... |
from hamcrest.core.base_matcher import BaseMatcher
class FailingMatcher(BaseMatcher):
def __init__(self, msg: str):
self.__msg = msg
def _matches(self, item='Runnable code'):
return False
def describe_to(self, description):
description.append_text(self.__msg)
def should_have_c... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Date : 2019-10-29 19:18:08
# @Author : Racter Liu (racterub)
# @Mail : racterub@gmail.com
# @Link : https://racterub.io
# @License : MIT
'''
先找出長度最小的字串,以他的長度為基準開一個 for loop ,然後前面先 s1 s2 互相填入 answer ,直到長度最小的字串結束,再將長度較長的字串的剩餘資料寫入 answer
'''
s1 = input("S1: ")... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import pandas as pd
from pandas.core.frame import DataFrame
from base import BaseObject
class ExcelReader(BaseObject):
""" Read an Excel File into a pandas DataFrame
"""
@staticmethod
def read_excel(some_input_path: str,
skiprows: int... |
#!/usr/bin/python
from twisted.python import log
from twisted.internet.defer import Deferred
from twisted.internet import defer, stdio
from twisted.protocols import basic
from twisted.internet.protocol import Protocol
from twisted.web import server, resource
from twisted.web.http_headers import Headers
from twisted.in... |
'''
lab 8
'''
#3.1
def count_words(input_str):
return len(input_str.split())
#3.2
demo_str = 'hi, hello world!'
print(count_words(demo_str))
#3.3
def find_min_num(input_list):
min_item = input_list[0]
for num in input_list:
if type(num) is not str:
if min_it... |
import pandas as pd
import numpy as np
from sklearn import preprocessing
from sklearn.tree import DecisionTreeClassifier # Import Decision Tree Classifier
from sklearn.model_selection import train_test_split # Import train_test_split function
from sklearn.metrics import accuracy_score #Import scikit-learn metrics ... |
from flask_wtf import FlaskForm
from sqlalchemy import func
import wtforms
from wtforms import validators as v
from app.users.models import User
class LoginForm(FlaskForm):
login = wtforms.StringField(
validators=[v.DataRequired()])
password = wtforms.PasswordField(
validators=[v.DataRequired... |
class Command:
def run(self):raise NotImplementedError
def __repr__(self):return self.run()
class ROSEHIP(Command):
def run(self):
from Rosehip.os import OS
return OS().run()
rosehip = ROSEHIP()
|
import PIL.Image as Image
import numpy as np
from utils import calculate_iou, gen_gaussian_noise, cropping
import os
warp = np.array(
[
[-1, 0, -1, 0], # left
[1, 0, 1, 0], # right
[0, -1, 0, -1], # up
[0, 1, 0, 1], # down
[-2, 0, -2, 0], # 2 left
[2, 0, 2, 0], ... |
#!/usr/bin/env python -*- coding: utf-8 -*-
import argparse
import codecs
import utils
from sklearn import svm, metrics
from sklearn.externals import joblib
from numpy import stack, concatenate, zeros, ones
if __name__ == "__main__":
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFo... |
import svgutils.transform as sg
def load_svg(path):
return sg.fromfile(path).getroot()
def label_plot(x, y, label):
return sg.TextElement(x, y, label, size=12, weight="bold")
|
# Original dataset https://www.kaggle.com/antoreepjana/animals-detection-images-dataset
import os
import shutil
from tqdm import tqdm
from glob import glob
import re
import cv2
def split_into_folders():
for folder in ['train', 'test']:
imgs_path, labels_path = load_data_paths(folder)
current_pat... |
digits = input()
print([sum([int(x) for x in digits[:i]]) for i in range(1, len(digits) + 1)])
|
from __future__ import print_function
from .compiler import compile_to_string, compile_file, compile_templates
from .TemplateSet import TemplateSet
|
# -*- coding:utf-8 -*-
"""
Author:
Weichen Shen,weichenswc@163.com
Heyi, heyi_jack@163.com
"""
import tensorflow as tf
from tensorflow.python.keras import backend as K
from tensorflow.python.keras.initializers import Zeros
from tensorflow.python.keras.layers import Layer, Flatten
try:
unicode
except Nam... |
import transaction
from .base import WebTest, BaseTest
from nthuion.models import User, FacebookUser, Email
class UserTest(WebTest):
def prepare(self):
with transaction.manager:
self.session.add(User(name='test'))
def prepare_fb(self):
with transaction.manager:
u = Use... |
# Credit: https://github.com/MinaProtocol/coda-python-client
from enum import Enum
class CurrencyFormat(Enum):
"""An Enum representing different formats of Currency in coda.
Constants:
WHOLE - represents whole coda (1 whole coda == 10^9 nanocodas)
NANO - represents the atomic unit of coda
"""
... |
from __future__ import annotations
import imp
from pickle import FALSE, TRUE
import py_compile
import re
import numpy as np
from numpy.linalg import inv, det, slogdet
class UnivariateGaussian:
"""
Class for univariate Gaussian Distribution Estimator
"""
def __init__(self, biased_var: bool... |
import datetime
import random
import string
import traceback
from enum import Enum
import requests
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.utils.html import format_html... |
import pickle, torch, biovec, esm, os
from CPCProt.tokenizer import Tokenizer
from CPCProt import CPCProtModel, CPCProtEmbedding
import numpy as np
from utils import is_symmetric
from sw_alignment import alignSmithWaterman
def swTrainTest(train, test, sw_alignment):
if sw_alignment == "full":
# Option 1: ... |
# See LICENSE for licensing information.
#
# Copyright (c) 2016-2019 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
import debug
import pgate
from vector import vec... |
#!/usr/bin/env python
# Copyright (C) 2012 Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list ... |
import argparse
import pathlib
import csv
from data.dsp import TacotronSTFT
import mido
import torch
from utils import load_config
KOKO2022_labels = [
'sil',
'pau',
'br',
'a', 'i', 'u', 'e', 'o',
'k', 's', 't', 'n', 'h', 'm', 'y', 'r', 'w',
'g', 'z', 'd', 'b', 'p',
'ky', 'sh', 'ch', 'ty'... |
"""
Defines the multi auth object for multiple key management.
"""
import sys
import time
import json
import logbook
import requests
from requests_oauthlib import OAuth1
import wriggler.const as const
from wriggler.check_rate_limit import check_rate_limit
log = logbook.Logger(__name__)
class MultiAuth(object):
... |
# Copyright 2021 Cortex Labs, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
from cancelas import Cancela
from subprocess import call
from time import sleep
#from hc2 import Sensor
from hcsr04sensor import sensor
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
#Cancela -LEDS
PIN_GREEN = 40
PIN_YELLOW = 38
PIN_RED = 36
GPIO.setup(PIN_GREEN ,GPIO.OUT)
GPIO.setup(PIN_YELLOW, GPIO.OUT)
GPIO.setup... |
from decimal import Decimal
from django.db.models import Q, Count
from django.utils.encoding import smart_unicode
from restlib2.http import codes
from restlib2.params import Parametizer, StrParam, BoolParam, IntParam
from modeltree.tree import MODELTREE_DEFAULT_ALIAS, trees
from avocado.events import usage
from avocado... |
"""Implements the Filter and GlobalConstraint classes, the two types of filters
used by json_extract and JsonPath to find paths through json."""
from gorp.jsonpath.aggregate import *
# includes math_eval imports, aggregation funcs
def _convert_to_filterfunc(x, fuzzy):
"""Used by the Filter class to convert user-... |
# -*- coding: utf-8 -*-
from collections import OrderedDict
from django import forms
from django.utils.translation import ugettext_lazy as _
from envelope.forms import ContactForm
class ContactForm(ContactForm):
template_name = "envelope/contact_email.txt"
html_template_name = "envelope/contact_email.html"... |
"""High-level API tests on workflow."""
import os
import pytest
import ska_sdp_config
# pylint: disable=missing-docstring,redefined-outer-name
PREFIX = "/__test_workflow"
WORKFLOW_IMAGE = "nexus/workflow-test"
# pylint: disable=W0212
@pytest.fixture(scope="session")
def cfg():
host = os.getenv("SDP_TEST_HOST"... |
#!/usr/bin/env python3
# TODO:
# - add help/description
import logging
import os
import re
import sys
from enum import Enum, auto
from queue import Queue
from threading import Thread, Lock
from urllib.request import urlopen, Request
ADBLOCK_HOSTS_FILE = "/etc/dnsmasq.d/adblock.hosts"
INVALID_HOSTNAMES = ["localh... |
import numpy as np
import tensorflow as tf
from tensorflow import keras
class QSP(keras.layers.Layer):
"""Parameterized quantum signal processing layer.
The `QSP` layer implements the quantum signal processing circuit with trainable QSP angles.
The input of the layer is/are theta(s) where x = cos(theta),... |
from termmenu import Menu, EntryNotFoundError
import sys
my_menu = Menu(title="Test!")
my_menu.add_entry("sys.exit(1)", run=lambda: sys.exit(1))
my_menu.add_entry("Print something", run=lambda: print("hello"))
my_menu.add_entry("Do nothing", entry="N")
try:
result = my_menu.run(allowother=False, message="{entry}) {na... |
import html
from pyrogram import Client
from pyrogram.types import CallbackQuery, InlineKeyboardMarkup, InlineKeyboardButton
from aiohttp.client_exceptions import ContentTypeError
from config import TORRENTS, FOOTER_TEXT
from helpers.torrent import torrent_search
@Client.on_callback_query()
async def tor... |
from __future__ import absolute_import
|
# Generated by Django 3.1.3 on 2021-03-07 01:39
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('taxa', '0006_auto_20210306_0830'),
('taxa', '0006_auto_20210301_1905'),
]
operations = [
]
|
from afterpay.exceptions.http.connection_error import ConnectionError
from afterpay.exceptions.http.invalid_response_error import InvalidResponseError
from afterpay.exceptions.http.timeout_error import TimeoutError |
from WebKit.Page import Page
class Main(Page):
def writeContent(self):
self.writeln('<h1>Welcome to Webware!</h1>')
self.writeln('<h2>Test passed.</h2>')
|
from flask import Markup
from flask import current_app as app
from flask import render_template, request
from werkzeug.exceptions import HTTPException, default_exceptions
def error_handler(error):
"""
Logs errors and renders specific, if available, or generic error page
"""
# For 4XX and 5XX level HT... |
#!/usr/bin/env python
"""
@author Jesse Haviland
"""
import roboticstoolbox as rp
import numpy as np
import spatialmath as sm
import time
panda = rp.models.DH.Panda()
panda.q = panda.qr
vell = panda.vellipse(centre='ee')
env = rp.backends.PyPlot()
env.launch(
'Panda Velocity Ellipse Example',
limits=[-0.2, ... |
import warnings
from lightgbm import LGBMClassifier
from sklearn.model_selection import GridSearchCV
from models.tools import load_data
from models.tuning.tools import plot_grid
# deactivate deprecation warnings
warnings.simplefilter("ignore", DeprecationWarning)
n_jobs = 2
# path
path_to_data = "data/"
path_to_su... |
name = input("What is your name?")
old = input("How old are you?")
place = input("Where are you live?")
print('This is, ', name)
print(' It is, ', old, 'years old')
print('(S)he live in ', place) |
"""
This file implements unit tests approximate distributions.
"""
# Bring in modules we need
import HARK.utilities as util
import unittest
import numpy as np
class testsForDCEGM(unittest.TestCase):
def setUp(self):
# setup the parameters to loop over
self.muNormals = np.linspace(-3.0, 2.0, 50)
... |
#!/usr/bin/python3
# -*- coding = utf-8 -*-
import smtplib
from email.mime.text import MIMEText
import time
class mail:
def __init__(
self,
_art,
):
self.art = _art
def send(
self,
config,
):
try:
if (not hasattr(self.art, "content")):
... |
from flask import Flask, redirect, render_template, request, url_for
from stats_app.utils import distribution_data, process_random_sample
app = Flask(__name__)
@app.route("/")
def index():
"""Homepage."""
return render_template("index.html", data=distribution_data)
@app.route("/summary", methods=["POST", ... |
import cv2
import copy
import numpy as np
import os.path
import torch
from torchvision.datasets import CocoDetection
class CocoSegmentationAlb(CocoDetection):
def __init__(self, root, annFile, depthDir, transform):
super().__init__(root=root, annFile=annFile, transform=transform)
categories = sel... |
d = {}
d['int_field']: int = 3
|
"""
Created on Tue May 9 13:48:20 2017
@author: Lucas Boatwright
"""
from sys import argv, stderr
import argparse
from datetime import datetime
import pandas as pd
def parse_arguments():
"""Parse arguments passed to script"""
parser = argparse.ArgumentParser(description=
"This script is designed to chec... |
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 5 12:26:40 2014
:module-author: steffen
:filename: config.py
This module provides a highlevel layer for reading and writing config files.
There must be a file called "config.ini" in the root-folder of the project.
The file has to be of the following structure to be imp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Varnish gmond module for Ganglia
#
# Copyright (C) 2011 by Michael T. Conigliaro <mike [at] conigliaro [dot] org>.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation fil... |
#
# 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 us... |
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
linear = np.arange(1, 20)
square = linear ** 2
log = np.log(linear)
random = np.random.randint(0, 100, 20)
plt.plot(linear)
plt.plot(square)
plt.plot(log)
plt.plot(random)
#all appear on the same plot because did not include a plt.clf()
# X, ... |
"""Install instructions for distributed MapReduce style programs.
"""
import os
from fabric.api import *
from fabric.contrib.files import *
from shared import (_if_not_python_lib, _pip_cmd, _is_anaconda)
@_if_not_python_lib("pydoop")
def install_pydoop(env):
"""pydoop; provides Hadoop access for Python.
http... |
""" Automatic file """
from app.logic.gitrepo.controllers.GitController import GitController
|
"""
# Sample code to perform I/O:
name = input() # Reading input from STDIN
print('Hi, %s.' % name) # Writing output to STDOUT
# Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
"""
# Write your code here
from heapq import heappop, heappush
from sy... |
temperature = float(input("What is the temperature? "))
if temperature < 10:
print("It's too cold!")
elif temperature >= 30:
print("It's too hot!")
else:
print("Let's go tramping!")
|
#!/usr/bin/env python3
import os
import sys
import argparse
import json
import pydot
from lib.util import *
from lib.expression_tree import *
COL_VERTEX_FILLCOLOR = {
"default": "#FAFAFA",
"exception": "#FFEBEE"
}
COL_VERTEX_COLOR = {
"default": "#424242",
"input": "#1565C0",
"output": "#F57F17"
}
EXPR_NODE_VER... |
import os.path as osp
import tempfile
import filelock
import numpy
from gym import Env
from gym.spaces import Box, Discrete
from matplotlib import pyplot
class MnistEnv(Env):
"""
"""
def render(self, mode="human"):
"""
@param mode:
@type mode:
"""
pyplot.imshow(self.state[0])... |
#!/usr/bin/env python3
# coding=utf-8
"""
Air conditionner classes
"""
import logging
import sys
import bitstring
from eakon import HVAC
from eakon.enums import daikin_enum
class Daikin(HVAC):
"""
Daikin ARC478A5
"""
__MARK = 433
__ONE_SPACE = 1288
__ZERO_SPACE = 440
__temp_max = 30
... |
"""
# Mobius Software LTD
# Copyright 2015-2018, Mobius Software LTD
#
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later ve... |
from flask import Flask, request
from src.naogi import JsonRenderer
from PIL import Image
import json
app = Flask(__name__)
testing_dict = {'first': 1, 'second': 'Some text'}
def test_render_should_be_valid_json():
with app.test_request_context():
resp = JsonRenderer.render(testing_dict)
assert resp == json.... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_pychatbot', '0017_tags_unique'),
]
operations = [
migrations.AlterField(
model_name='statement',
name='in_response_to',
field=models.CharField(max... |
#
# PySNMP MIB module Console-Monitoring-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Console-Monitoring-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:21:01 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (d... |
from dataclasses import dataclass, field
__NAMESPACE__ = "http://www.opengis.net/gml"
@dataclass
class AbstractCurveSegmentType:
"""
Curve segment defines a homogeneous segment of a curve.
:ivar num_derivatives_at_start: The attribute
"numDerivativesAtStart" specifies the type of continuity betw... |
import shutil
import glob
import yaml
DROPBOX_TOKEN_FILE = "./dropbox.txt"
WORKING_DIRECTORY = "/home/pi/time-lapse"
IMAGES_DIRECTORY = WORKING_DIRECTORY + "/images"
JOBS_DIRECTORY = WORKING_DIRECTORY + "/jobs"
JOBS_ARCHIVE = JOBS_DIRECTORY + "/archive"
class Setting(object):
def __init__(self, settings_dict):... |
#!/usr/bin/env python3
# Simple Script to replace cron for Docker
import argparse
import sys
import time
from subprocess import run
def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument("interval", type=float, help="Time in seconds between jobs")
args = parser.parse_args()
prin... |
import unittest
from passwords import Password
class PasswordTest(unittest.TestCase):
def tearDown(self):
'''
Specifies may array of password
'''
password.usr_password = []
def setUp(self):
'''
this test runs before all the other tests
'''
se... |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 2 09:24:22 2017
@author: mohamed
"""
from pydatabase.env.environment import Environment
class DBEnvironment(Environment):
@classmethod
def init(cls):
cls.localEnv = DBEnvironment(Environment.ENV_LOCAL)
cls.testingEnv = DBEnvironment(Environment.ENV_TESTIN... |
# pylint: disable=redefined-outer-name,protected-access
# pylint: disable=missing-function-docstring,missing-module-docstring,missing-class-docstring
import panel as pn
from awesome_panel.application.components import PageComponent
from awesome_panel.application.models import Progress, Toast
def test_can_con... |
from module import lib
import numpy as np
def execute(algorithm, test_inputs, inputs, labels):
# Train the perceptron
algorithm.train(inputs, labels)
total_correct = 0
total = len(inputs)
for idx, input_array in enumerate(test_inputs):
# Test the perceptron
output = 1 if algorith... |
#!/usr/bin/python3
# Author: @AgbaD || @agba_dr3
from ..models import Product, Category, Store
# from .. import db
def get_all_products():
products = Product.query.all()
if not products:
return {
'status': 'error',
'msg': "Products not found"
}
all_products = {}
... |
#!/usr/bin/env python3
"""
A program just for testing the new scipy.integrate functionality
without doing anything else.
"""
import src.simulation.halos as hal
import src.simulation.helpers as hlp
|
from tkinter import (
Frame,
IntVar,
Menu,
Toplevel,
Tk,
NW,
Menubutton,
Checkbutton,
StringVar,
)
import tkinter.ttk as ttk
from tkinter.font import Font
from os import startfile
import webbrowser as web
from winregistry import WinRegistry
from mouse import get_position
from threadi... |
#
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
import sys
try:
import unittest2 as unittest
except ImportError:
import unittest
from tests.base import BaseTestCase
from pyasn1.compat import binary
class ... |
import pytest
from run import Dataset, deduplicate_datasets
@pytest.fixture
def dataset_1():
return Dataset(
nb_hits=1,
default_order=1,
id="dataset-1",
title="title",
page="",
acronym="",
post_url="",
description="",
)
@pytest.fixture
def data... |
from simple_zpl2 import ZPLDocument, QR_Barcode
zpl = ZPLDocument()
zpl.add_comment('Create a QR Code')
zpl.add_field_origin(20, 20)
qr_data = 'This is data inside a QR code. This is a barcode often read by cell phones.'
qr = QR_Barcode(qr_data, 2, 2, zpl._QR_ERROR_CORRECTION_STANDARD)
zpl.add_barcode(qr)
zpl.add_... |
class Pessoa():
def __init__(self, nome, cpf, senha, pessoa_id=None):
self.nome=nome
self.cpf=cpf
self.senha=senha
self.pessoa_id=pessoa_id |
"""
Save start/end images and get some stats about saved episodes from running any policy in Gym-Cloth.
"""
import os
import argparse
from PIL import Image
import pickle
import numpy as np
def get_start_end(observation, test_sample, save_folder):
if not os.path.exists(save_folder):
os.makedirs(save_f... |
#!/usr/bin/env python3
# Copyright 2018 Google LLC
#
# 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... |
"""Python wrappers around TensorFlow ops.
This file is MACHINE GENERATED! Do not edit.
Original C++ source file: logging_ops.cc
"""
import collections as _collections
import six as _six
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
from tensorflow.python.eager import context as _context
from ... |
#!/usr/bin/env python
# coding: utf-8
from .igv_widget import IGV
from ._version import __version__, version_info
from .nbextension import _jupyter_nbextension_paths
|
#!/usr/bin/env python
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. ... |
import matplotlib.pyplot as plt
import numpy as np
from influxdb import InfluxDBClient
from datetime import datetime, timedelta
import sys
color1 = '#4751b0'
color2 = '#fd8d3c'
color3 = '#60a4ec'
def DrawDelayTimes(array, label, color):
xs = [1]
for i in range(10, 100, 10):
xs.append(i)
xs.append(99)
xs = np.ar... |
from sqlalchemy.orm import Session
from pollbot.enums import PollType
from pollbot.models import Poll
from pollbot.poll.option import add_multiple_options
from telegram import Poll as NativePoll
def merge_from_native_poll(
poll: Poll, native_poll: NativePoll, session: Session
) -> None:
"""Fills information ... |
import sys
from binary_readers import *
def convert_node(node, buf, level=0):
for subnode in node:
if type(subnode) != list:
print(node)
return
buf[0] += " " * level + subnode[0] + ":"
if type(subnode[1]) == str:
subnode[1] = subnode[1].replace("\r\n", "... |
#!@PYTHON_EXECUTABLE@
#
# This file is a part of HPC PCDSFrame software
#
# Copyright (C) 2019 Parallel Computing and Data Science (PCDS) Laboratory
# School of Computing and Information Sciences
# Florida International University (FIU)
# Author... |
import ast
import redis as redisSource
import numpy as np
class RedisConnector(object):
"""
RedisConnector object creates a connector to a running Redis instance.
Parameters:
name (str): Naming the specific connection
host (str): The host which we are connecting to. This is typically
... |
import unittest
from datetime import datetime
from pyenlone.v import V
from pyenlone.tasks import *
from pyenlone.enloneexception import NotImplementedByBackendException
DRAW = """[{"type":"polyline","latLngs":[{"lat":-32.777775,"lng":-61.604255},{"lat":-33.258328,"lng":-58.023684}],"color":"#a24ac3"}]"""
DRAW2 = ""... |
# Generated by Django 3.1.4 on 2020-12-20 20:37
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('analytics', '0001_initial'),
]
operations = [
migrations.AlterUniqueTogether(
name='users',
unique_together={('account', 'em... |
#!/usr/bin/env python
#
# This library is free software, distributed under the terms of
# the GNU Lesser General Public License Version 3, or any later version.
# See the COPYING file included in this archive
import unittest
from lbrynet.dht.msgtypes import Message, RequestMessage, ResponseMessage, ErrorMessage
from ... |
from tkinter import *
from functools import partial
top = Tk()
top.geometry("300x300")
frame = Frame(top,bg = "yellow",width = 325,height = 300)
frame.grid(row = 0,column = 0,sticky = "NW")
frame.grid_propagate(0)
frame.update()
l_welcome = Label(frame,text = "Welcome to my Convertor",bg = "red")
l_welcome.... |
import os
os.system ('cls')
ones = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve',]
ex = ['twen', 'thir', 'fif']
def numbers(x):
if x < 13 :
return ones[x]
elif x < 20 :
temp = x % 10
if temp == 3 :
return ex[1] +... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.io import wavfile
from scipy import fftpack
from scipy import signal
from scipy.stats import zscore
import os
from sklearn import svm
# import soundfile as sf
#import pyAudioAnalysis
#module to output the sound
from playsound import pl... |
from . import views
from django.urls import path, include
urlpatterns = [
path('', views.index, name='preferences'),
]
|
from collections import OrderedDict
from utility import Utility
from base import OperatorLayerBase
def hasTileSize(name):
if ("sgemm" in name) or ("884gemm" in name) or ("hgemm" in name):
return True
else:
return False
def ctaTile(name):
name = name.split("_")
name = list(filter(lambda x : "x" in x, name))
n... |
default_app_config = "books.apps.Config"
|
"""
A simple rendition of the three-body problem. Also demonstrates the use of
two-phase updates.
The three body problem comes from astrophysics. Basically, applying the
gravitaional to three celestial bodies produces a problem that does not have a
perfect mathematical solution, and must be solved through simulations.... |
import os
import setuptools
# Avoid polluting the .tar.gz with ._* files under Mac OS X
os.putenv('COPYFILE_DISABLE', 'true')
# Prevent distutils from complaining that a standard file wasn't found
README = os.path.join(os.path.dirname(__file__), 'README')
if not os.path.exists(README):
os.symlink(README + '.rst'... |
from django.urls import path
from .views import StudentDataAPIView
urlpatterns = [
path('predictor/', StudentDataAPIView.as_view())
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.