content stringlengths 5 1.05M |
|---|
import json
from pathlib import Path
from prompt_toolkit import PromptSession
from prompt_toolkit.shortcuts import print_formatted_text
from prompt_toolkit.history import FileHistory
from xdg import XDG_CONFIG_HOME
from everhour import Everhour
from .completer import everhour_completer
from .history import get_hi... |
#!/usr/bin/env python
import glob
# look for files named count_<something>.txt, which are the output files from
# the previous step
# load each of them, read the number out of it, and add it to our total counts
total_counts = 0
for counts_file in glob.glob("counts_*.txt"):
with open(counts_file, mode="r") as file... |
from math import trunc
num = float(input("Digite um número: "))
arred = trunc(num)
print("O número {} arredondado é:{} ".format(num, arred))
|
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
def lncosh(x):
return -x + F.softplus(2.*x) - math.log(2.)
def tanh_prime(x):
return 1.-torch.tanh(x)**2
def tanh_prime2(x):
t = torch.tanh(x)
return 2.*t*(t*t-1.)
def sigmoid_prime(x):
s = torch.... |
'''
Created on 14/11/2014
@author: javgar119
'''
from QuantLib import *
# dates
calendar = TARGET()
todaysDate = Date(14, 11, 2014)
Settings.instance().evaluationDate = todaysDate
settlementDate = Date(14, 11, 2014)
maturity = Date(17, 2, 2015)
dayCounter = Actual365Fixed()
# option parameters
option... |
import discord
import asyncio
from discord.ext import tasks, commands
from config import *
import logging
from mcstatus import MinecraftServer
import base64
from io import BytesIO
import concurrent.futures
class mcstatus_cog(commands.Cog):
def __init__(self, bot: commands.Bot, get_status):
self.bot = bot
... |
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... |
#!/usr/bin/env python
""" This module is the top of the current measurement documentation
all other modules contained in the script folder are utilized here.
The main method starts the threads that communicate with
each MCU on the embedded board and save the received data.
The scmcu thread controls the... |
import argparse
import os
from fuckery.cli import main
import tests.common as t_common
def test_main():
fn = 'hello_world.bf'
fp = t_common.get_file(fn)
ns = argparse.Namespace()
ns.verbose = False
ns.input = fp
ns.loop_detection = False
ns.memory_size = 100
main(options=ns)
|
#! /usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import paddle
from paddle.optimizer import Optimizer
import warnings
__all__ = ['Adadelta', 'Adagrad', 'Adam', 'Adamax', 'Ftrl', 'Nadam', 'RMSprop', 'SGD', 'Momentum', 'Lamb', 'LARS']
class Adadelta(Optimizer... |
# -*- coding: utf-8 -*-
"""Git helper for the scaffolder project.
This file provides a class to assist with git operations.
"""
import os
import re
from typing import Tuple
from l2tscaffolder.helpers import cli
from l2tscaffolder.lib import errors
class GitHelper(cli.CLIHelper):
"""Helper class for git operations... |
from django.shortcuts import redirect
from django.urls import reverse
from guardian.decorators import permission_required
from rnapuzzles.models import Challenge
def publish_results(request, pk):
challenge = Challenge.objects.get(pk=pk)
challenge.result_published = True
challenge.save()
return redi... |
# -*- coding: utf-8 -*-
"""
Segmenting text to Enhanced Thai Character Cluster (ETCC)
Python implementation by Wannaphong Phatthiyaphaibun
This implementation relies on a dictionary of ETCC created from etcc.txt
in pythainlp/corpus.
Notebook:
https://colab.research.google.com/drive/1UTQgxxMRxOr9Jp1B1jcq1frBNvorhtBQ
... |
from .data_service import TopicDataEntityHelper, TopicDataService, TopicStructureService, TopicTrigger
from .raw_data_service import RawTopicDataEntityHelper, RawTopicDataService
from .regular_data_service import RegularTopicDataEntityHelper, RegularTopicDataService
from .topic_storage import build_topic_data_storage
|
"""Helpers for Google Translate API"""
__author__ = "Amanjeev Sethi"
import logging
from apiclient.discovery import build
from .base_service import BaseService
class Google(BaseService):
def __init__(self, api_key):
self._api_key = api_key
self._service = build('translate', 'v2', developerKey=s... |
# PACKAGE: DO NOT EDIT THIS LINE
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import scipy
import sklearn
from ipywidgets import interact
from load_data import load_mnist
MNIST = load_mnist()
images = MNIST['data'].astype(np.double)
labels = MNIST['target'].astype(np.int)
# GRADED FUNCT... |
class pyidmlException(Exception):
"""Base-class for all exceptions raised by this module"""
class NotParaException(pyidmlException):
"""Expected a paragraph tag, received something else"""
|
def make_lookup():
"""
Returns dictionary relating ID numbers to h/v/b values
"""
d1, d2 = {}, {}
with open(r"res/ACNH_color_palette", "r") as f1:
d1['column_headers'] = f1.readline().split(",")
while s1 := f1.readline():
vals = s1.split(",")
if vals[3] not in d1:
d1[vals[3... |
# Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums =
# [0,1,2,4,5,6,7] might become:
#
# [4,5,6,7,0,1,2] if it was rotated 4 times.
# [0,1,2,4,5,6,7] if it was rotated 7 times.
# Notice that rotating an array
# [a[0], a[1], a[2], ..., a[n-1]] 1 time re... |
import cv2
import numpy as np
from math import sqrt
def convertLine(line):
return np.array([line[0], -line[1], -line[0]*line[2] + line[1]*line[3]])
def main():
ransac_trial = 50
ransac_n_sample = 2
ransac_thresh = 3.0
data_num = 1000
data_inlier_ratio = 0.5
data_inlier_noise = 1.0
tr... |
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 9 13:55:16 2015
@author: adelpret
"""
from control_manager_conf import *
TAU_MAX = 1e6; # security check of ControlManager
CURRENT_MAX = 1e6; # security check of ControlManager
CTRL_MAX = 1e6; # max desired current... |
# Copyright 2013-2020 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 CbtfLanl(CMakePackage):
"""CBTF LANL project contains a memory tool and data center type s... |
# Used for performance tests to replace `has_government` lines with scripted triggers
ideology_bundles = {
"has_socialist_government": ["has_government = totalist", "has_government = syndicalist", "has_government = radical_socialist"],
"has_elected_government": ["has_government = social_democrat", "has_governme... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch.utils.data as data
import numpy as np
import torch
import json
import cv2
import os
from utils.image import flip, color_aug
from utils.image import get_affine_transform, affine_transform
from utils... |
# -*- coding: utf-8 -*-
"""OpenCTI ReportImporter connector main module."""
from reportimporter import ReportImporter
if __name__ == "__main__":
connector = ReportImporter()
connector.start()
|
#!/usr/bin/python3
"""
Copyright 2018-2019 Firmin.Sun ([email protected])
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 applic... |
import bitwise as bw
class TestHalfAdder:
def test_HalfAdder(self):
input_1 = bw.wire.Wire()
input_2 = bw.wire.Wire()
carry_out = bw.wire.Wire()
sum_ = bw.wire.Wire()
a = bw.arithmetic.HalfAdder(input_1, input_2, carry_out, sum_)
input_1.value = 0
input_2.... |
import os
import numpy as np
import saber
np.seterr(all="ignore")
# workdir = ''
# drain_shape = os.path.join(workdir, 'gis_inputs', '')
# gauge_shape = ''
# obs_data_dir = ''
# hist_sim_nc = ''
# COLOMBIA
# workdir = '/Users/rchales/data/saber/colombia-magdalena'
# drain_shape = os.path.join(workdir, 'gis_inputs... |
#Created by Josh Tseng, 2 June 2020
#This file illustrates that you can use other data types in dictionaries too
#Imagine this dictionary contains user details for a bank
#The format for data is as follows:
#User ID: [Name, Phone number, Amount of money in bank in dollars]
user_database = {
"001": ["John Tan", "92234... |
from abc import ABCMeta, abstractmethod
class Observer(object):
__metaclass__ = ABCMeta
@abstractmethod
def on_next(self, value):
return NotImplemented
@abstractmethod
def on_error(self, error):
return NotImplemented
@abstractmethod
def on_completed(self):
return... |
import numpy as np
def generate_basic_anchors(sizes, base_size=16):
"""
:param sizes: [(h1, w1), (h2, w2)...]
:param base_size
:return:
"""
anchor_num=10
assert(anchor_num==len(sizes))
base_anchor=np.array([0, 0, base_size-1, base_size-1], np.int32)
anchors=np.zeros((len(sizes), 4),... |
import sys
from collections import defaultdict, deque
sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin
INF = float('inf')
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
S = ns()
d = deque(S)
Q = ni()
cur = 0
for _ in range(Q):
q = list(map(str,... |
async def async_func():
return 42
|
import os
import pytest
from liberapay.testing import Harness
@pytest.mark.skipif(
os.environ.get('LIBERAPAY_PROFILING') != 'yes',
reason="these tests are only for profiling",
)
class TestPerformance(Harness):
def test_performance_of_homepage(self):
for i in range(1000):
self.client... |
"""
defines:
- split_line_elements(bdf_model, eids, neids=2,
eid_start=1, nid_start=1)
"""
import numpy as np
from pyNastran.bdf.bdf import read_bdf
def split_line_elements(bdf_model, eids, neids=2,
eid_start=1, nid_start=1):
"""
Splits a set of element ids
... |
import json
import logging
from django.test import TestCase, Client
from django.urls import reverse
from ..models import User
logger = logging.getLogger(__name__)
class TestsTheme(TestCase):
fixtures = ['f1']
def setUp(self):
# Every test needs a client.
self.client = Client()
self.... |
"""
unrelated.py: examples with ``super()`` in a sibling class.
``U`` is unrelated (does not subclass ``Root``)
Calling ``ping`` on an instance of ``U`` fails::
# tag::UNRELATED_DEMO_1[]
>>> u = U()
>>> u.ping()
Traceback (most recent call last):
...
AttributeError: 'super' object has no attrib... |
from celery import Celery
from event_manager.get_app import get_app
from kombu import Exchange, Queue
broker_url = 'amqp://rabbitmq:5672'
app = get_app('producer', broker_url, tuple())
|
#!/usr/bin/python
# Copyright (c) 2017, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... |
"""Validator interface."""
import abc
from typing import Any # noqa # pylint: disable=unused-import
import six
@six.add_metaclass(abc.ABCMeta) # pylint: disable=R0903,W0232
class Validator(object):
# disabled checks for pylint
# R0903 - :too-few-public-methods
# W0232 - :no-init
"""Validator Inter... |
# RestDF Default settings
PORT: int = 8000
HOST: str = 'localhost'
DEBUG: bool = False
|
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
import paddlers as pdrs
from paddlers import transforms as T
# 下载和解压视盘分割数据集
optic_dataset = 'https://bj.bcebos.com/paddlex/datasets/optic_disc_seg.tar.gz'
pdrs.utils.download_and_decompress(optic_dataset, path='./')
# 定义训练和验证时的transforms
# API说明:https://github.com/P... |
import sqlite3
from model.output_config_model import OutputConfigModel
class OutputConfigDao:
def __init__(self):
self.conn = sqlite3.connect('mybatis_generator.db')
def close(self):
self.conn.cursor().close()
self.conn.close()
def add_config(self, output_config):
cur =... |
import os
from flask import Flask
from etc.conf.env import ENV_CONFIG
__basedir__ = os.path.abspath(os.path.dirname(__file__))
app = Flask(__name__)
config = None
env = os.environ.get('ENV', 'local')
logged_in_user = {}
# Loading configuration
if env in ENV_CONFIG:
app.config.from_object(ENV_CONFIG[env])
co... |
x = y = 1
x = y = z = 1
|
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 9 20:58:07 2018
@author: JinJheng
"""
a=int(input())
if a%400==0:
print(a,"is a leap year.")
elif a%100==0 or a%4!=0:
print(a,"is not a leap year.")
elif a%4==0:
print(a,"is a leap year.")
else:
print() |
#!/usr/bin/env python
#
# Copyright 2018 Twitch Interactive, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not
# use this file except in compliance with the License. A copy of the License is
# located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or i... |
#!/usr/bin/env python
import roslib
roslib.load_manifest('atlas_teleop')
import rospy
from sensor_msgs.msg import Joy
from geometry_msgs.msg import Pose
from std_msgs.msg import Float64, Int8
import math
class DrcVehicleTeleop:
def __init__(self):
rospy.init_node('drc_vehicle_teleop')
self.joy_s... |
import copy
import io
import json
import logging
import math
import os
import random
import threading
import tempfile
import time
from pathlib import Path
import boto3
import cv2
import ffmpeg
from PIL import Image
from tqdm import tqdm
from ..api import API
from ..common import (
annotation_status_str_to_int, pr... |
"""Remove EquipmentDataField default_val."""
# pylint: disable=invalid-name
from django.db import migrations
class Migration(migrations.Migration):
"""Remove EquipmentDataField default_val."""
dependencies = [
('IoT_DataMgmt',
'0087_delete_EquipmentInstanceDataFieldDailyAgg')
]
... |
# Josh Aaron Miller 2021
# API calls for Enemies
import venntdb
import uuid
from constants import *
from api_campaigns import *
# VenntHandler methods
def create_enemy(self, args, username):
name = args[KEY_NAME]
campaign_id = None
if KEY_CAMPAIGN_ID in args:
# automatically add t... |
from numpy import average
from multiCameraServer import filterHubTargets,configX,configY
import plotly.graph_objects as go
lines = []
#input CSV is an WpiLib Data export
with open('C:/Users/racve/OneDrive/Documents/FIRST/FRC_20220322_011433.csv') as f:
lines = f.readlines()
count = 0
baseTime = 0
loopTime = 0.05... |
from eth2spec.test.context import spec_state_test, expect_assertion_error, always_bls, with_all_phases
from eth2spec.test.helpers.block import build_empty_block_for_next_slot
from eth2spec.test.helpers.block_header import sign_block_header
from eth2spec.test.helpers.keys import privkeys
from eth2spec.test.helpers.propo... |
"""Shim to enable editable installs."""
from setuptools import setup
setup()
|
import os
import unittest
from programy.extensions.weather.weather import WeatherExtension
from test.aiml_tests.client import TestClient
class WeatherExtensionTests(unittest.TestCase):
def setUp(self):
self.test_client = TestClient()
latlong = os.path.dirname(__file__) + "/google_latlong.js... |
wandb_project ='mmsegmentation'
wandb_experiment_name = 'ResNet50, PointRend finetuning, 2 classes'
######################################################################
# optimizer
optimizer = dict(type='Adam', lr=0.0001, weight_decay=0.00005)
optimizer_config = dict()
# learning policy
lr_config = dict(policy='exp'... |
import random
from .enums.difficulty import Difficulty
from .enums.goal import Goal
from .enums.logic import Logic
from .enums.enemizer import Enemizer
from .enums.start_location import StartLocation
class RandomizerData:
def __init__(self, seed: int = random.randint(0, 999999999),
difficulty: D... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import traceback
from flask import request,jsonify, abort
from flask import current_app as app
from ..models.supply import Supply, PostCompany
from base_handler import BaseHandler, HandlerException
from data_packer import RequiredField, OptionalField, SelectorField, converte... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
import textworld
from textworld.challenges import cooking
def test_making_cooking_games():
options = textworld.GameOptions()
options.seeds = 1234
nb_ingredients = 2
settings = {
"recipe": nb_ingred... |
from http import HTTPStatus
from lite_content.lite_exporter_frontend.core import RegisterAnOrganisation
def validate_register_organisation_triage(_, json):
errors = {}
if not json.get("type"):
errors["type"] = [RegisterAnOrganisation.CommercialOrIndividual.ERROR]
if not json.get("location"):
... |
# -*- coding:utf-8 -*-
from __future__ import print_function, division
import sys
sys._running_pytest = True
from distutils.version import LooseVersion as V
import pytest
|
# 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
__a... |
import requests
URL = "https://ims_api.supppee.workers.dev/api/coord"
r = requests.post(url = URL)
data = r.json()
print(data)
|
import tensorflow as tf
import tensorflow.contrib.slim as slim
def dualcamnet_v2(inputs,
keep_prob=0.5,
is_training=True,
num_classes=None,
num_frames=12,
num_channels=12,
spatial_squeeze=False, scope='DualCamN... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 7 10:10:55 2018
@author: David
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow as tf
#%% Print program header
def print_header():
print("=============================================... |
# Copyright (c) 2021 PaddlePaddle 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 appli... |
"""Script to build, sign and notarize the macOS RDMnet binary package."""
import datetime
import os
import re
import subprocess
import sys
import time
# This script requires an unlocked keychain on the keychain search path with the ETC macOS identities pre-installed.
# It is mostly run in the environment of Azure Pipe... |
from . import api
from .version import (
version,
version_info,
__version__
)
__all__ = (
"api",
"__version__",
"version",
"version_info",
)
|
import csv
import os
import pickle
from math import sqrt
from typing import Dict
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsRegressor
from arm_prosthesis.services.myoelectronics.preprocessing.feture_extactor imp... |
from graphql import GraphQLArgument as Argument
from graphql import GraphQLBoolean as Boolean
from graphql import GraphQLField as Field
from graphql import GraphQLNonNull as NonNull
from graphql import GraphQLResolveInfo as ResolveInfo
from graphql import GraphQLString as String
from scrapqd.gql import constants as co... |
"""
Estimate optical flow on standard test datasets.
Use this script to generate the predictions to be submitted to the benchmark website.
Note that this script will only generate the flow files in the format specified by the respective benchmark. However,
additional steps may be necessary before submitting. For exam... |
from application import db
from sqlalchemy import text
# Tulos-liitostaulun luominen
class Tulos(db.Model):
__tablename__='liitostaulu'
id = db.Column(db.Integer, primary_key=True)
sijoitus = db.Column(db.Integer, nullable=False)
pisteet = db.Column(db.Integer, nullable=False)
kilpailu_id = db... |
"""
Created on May 21, 2020
@author: Parker Fagrelius
start server with the following command:
bokeh serve --show OS_Report
view at: http://localhost:5006/OS_Report
"""
import os, sys
import time
import pandas as pd
import subprocess
from bokeh.io import curdoc
from bokeh.plotting import save
from bokeh.models im... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This software is under a BSD license. See LICENSE.txt for details.
from datatank_py.DTDataFile import DTDataFile
from datatank_py.DTPath2D import DTPath2D
from datatank_py.DTPoint2D import DTPoint2D
from datatank_py.DTPointCollection2D import DTPointCollection2D
from d... |
import tensorflow as tf
def shape_list(x):
ps = x.get_shape().as_list()
ts = tf.shape(x)
return [ts[i] if ps[i] is None else ps[i] for i in range(len(ps))]
def _rnn_dropout(x, kp):
if kp < 1.0:
x = tf.nn.dropout(x, kp)
return x
def rnn_cell(x, h, units, scope='rnn_cell',
w_init=tf.ra... |
"helper funs"
#imports
import os
import cv2
import matplotlib.pyplot as plt
import numpy as np
from moviepy.editor import VideoFileClip
from IPython.display import HTML
from operator import itemgetter
# def create_fullpath_lst(dirpath):
#
# fullpath_lst = []
# print(os.listdir(dirpath))
# # for file_name ... |
"""
From https://www.kaggle.com/pierremegret/gensim-word2vec-tutorial#Gensim-Word2Vec%C2%A0Tutorial
Author Pierre Megret
"""
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
sns.set_style("darkgrid")
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
d... |
"""
Clark Cape Cod
==============
"""
from sklearn.base import BaseEstimator
class ClarkCapeCod(BaseEstimator):
pass
|
from functools import reduce
from unittest import TestCase
from itertools import product
from nose.tools import (
assert_is_not,
eq_,
ok_,
raises,
)
from pyscalambda.formula_nodes import Formula
from pyscalambda import not_, Q, SC, SD, SF, SI, _, _1, _2, _3
def not_formula_and_eq(a, b, msg=None):
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=================================================
Classification Accuracy as a Substantive
Quantity of Interest: Measuring Polarization
in Westminster Systems
Andrew Peterson & Arthur Spirling 2017
=================================================
Generate classifier acc... |
name = "test-packaging-rss"
print("loaded")
|
from cdiserrors import *
{% if cookiecutter.package_type == 'Service' %}
from authutils.errors import JWTError
{% endif %}
class CustomException(APIError):
def __init__(self, message):
self.message = str(message)
self.code = 500
|
# -*- coding: utf-8 -*- #
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
#-----------------------------------------------------------------------------
# Copyright (c) 2014, HFTools Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#--------------------------------------------------... |
import optimus_manager.envs as envs
import optimus_manager.var as var
import optimus_manager.checks as checks
import optimus_manager.pci as pci
from optimus_manager.acpi_data import ACPI_STRINGS
from optimus_manager.bash import exec_bash, BashError
class KernelSetupError(Exception):
pass
def setup_kernel_state(... |
"""
A daemon that cleans up tasks from the service queues when a service is disabled/deleted.
When a service is turned off by the orchestrator or deleted by the user, the service task queue needs to be
emptied. The status of all the services will be periodically checked and any service that is found to be
disabled or ... |
from ctypes import byref, CDLL, c_int, c_size_t, POINTER
from ctypes.util import find_library
from errno import ENOENT, ESRCH, EALREADY
from socket import socket
libSystem = CDLL(find_library('System'))
class LaunchdSocketActivateError(Exception):
# from launch_activate_socket(3)
errors = {
ENOENT: "... |
#Matthew Trahms
#EE 526
#5/19/21
#This function generates the low enable latches to store the write data address
#this file is called multiple times in the case of multiple regfiles
#syntax for the post latch address bits is defined in make_decoder.py
#clock signal expected is wr_addr_en_(RF#)
#takes:
#the python fi... |
# -*- coding: utf-8 -*-
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
"""
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_td_bgcolor
"""
app = dash.Dash()
titleStyle = {'margin-bottom':'0.5in',
'font-si... |
"""Operators for creating Spiral curve shapes."""
import bpy
from bpy.types import Operator
from bpy.props import FloatProperty, IntProperty, StringProperty
from bpy_extras.object_utils import AddObjectHelper
from ..utils.functions import create_polar_coordinates, make_spline
from ..utils.ui import get_icon
SPIRAL_T... |
from teree.teree import Teree
|
import time
import copy
import math
import random
from dataclasses import dataclass
import pyxel
@dataclass
class Point:
x: float
y: float
def __eq__(self, other):
if not isinstance(other, Point):
return False
return self.x == other.x and self.y == other.y
def __repr__(s... |
from collections import Counter
import random
class MarkovChain:
def __init__(self):
self.probabilities = {}
self.start_probabilities = {}
self.symbols = set()
self.n = None
def fit(self, sequences, n):
self.n = n
# Collect n-grams and their next value
... |
import os, sys, time
import numpy as np
import scipy.io as spio
import torch
from iflow.dataset.generic_dataset import Dataset
directory = os.path.abspath(os.path.join(os.path.dirname(__file__), '../..','data')) + '/LASA_dataset/'
class LASA():
def __init__(self, filename, device=torch.device('cpu')):
... |
naam = input("wat is uw naam? >>>")
adres = input("wat is uw adres? >>>")
postcode = input("wat is uw postcode? >>>")
woonplaats = input("wat is uw woonplaats? >>>")
print("----------------------------------------------------")
print("| Naam : " + naam)
print("| Adres : " + adres)
print("| Postcode : " +... |
# Value Exists
has_repo = session.query(models.Repo.repo_id).filter_by(ext_repo_id=ext_repo_id).scalar() is not None
|
import os
from collections import defaultdict
from . import clientutils, cmds
import logging
logging.basicConfig()
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
class SearchEngine(object):
"""
Search class used for locating files on perforce.
This classes also records search history for f... |
#
# Copyright 2019 Peifeng Yu <[email protected]>
#
# This file is part of Salus
# (see https://github.com/SymbioticLab/Salus).
#
# 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:... |
from typing import Optional, Union, Tuple, List
from warnings import warn
import os
import time
import numpy as np
import pandas as pd
from scipy.interpolate import interp1d
import mechanicalsoup
import requests
import json
from chemicalc.utils import decode_base64_dict, find_nearest_idx
from chemicalc.file_mgmt import... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.