content
stringlengths
0
894k
type
stringclasses
2 values
# robot1 # WEMOS D1 Mini Board GPIO Map: D8 pull_down, D4 pull_down # D0=16, D1=5, D2=4, D3=0, D4=2, D5=14, D6=12, D7=13, D8=15 import os, gc, micropython, machine, random, time from sensor_manager import Sensor_HCSR04 usonic = Sensor_HCSR04(trigger=5, echo=4) # D1=5, D2=4 class Motor(): def __init__(self, EN1, EN2...
python
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 ...
python
#!/usr/bin/env python3 """ * Copyright (c) 2020 dithpri (Racoda) <dithpri@gmail.com> * This file is part of RCES: https://github.com/dithpri/RCES and licensed under * the MIT license. See LICENSE.md or * https://github.com/dithpri/RCES/blob/master/LICENSE.md for more details. """ import os import sys import reque...
python
from utime import sleep from textbuffer import TextBuffer from uio import IOBase from uos import dupterm class Monitor(IOBase): def __init__(self, cols=40, rows=4): self.textbuffer = TextBuffer(cols, rows) def read(self, size): return None def write(self, byteslike): with open("wr...
python
from models.builder import CoordSolverBuilder # NOQA from models.common import CKeyClassifier # NOQA from models.common import PairScorer # NOQA from models.encoder import Encoder # NOQA from models.feature import BaselineExtractor # NOQA from models.feature import FeatureExtractor1 # NOQA from models.feature imp...
python
# Generated by Django 3.1.12 on 2021-09-22 21:33 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('projects', '0023_delete_projectuser'), ] operations = [ migrations.AlterField( model_name='project', name='sample',...
python
#!/usr/bin/python3 import rclpy from rclpy.node import Node from std_msgs.msg import String from chess_msgs.srv import GetNextMove, SetEloRating from std_srvs.srv import Empty import stockfish dft_cfg = { "Write Debug Log": "false", "Contempt": 0, "Min Split Depth": 0, "Threads": 1, "Ponder": "fa...
python
# -*- coding: utf-8 -*- # Copyright 2020 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
from wxpy import Bot, FEMALE if __name__ == "__main__": bot = Bot() my_friend = bot.friends().search('胜男酱', sex=FEMALE)[0] message = input() while message != "exit": my_friend.send(message) message = input()
python
""" Data structures to represent relations (i.e., data sets). """ import conclave.utils as utils class Column: """ Column data structure. """ def __init__(self, rel_name: str, name: str, idx: int, type_str: str, trust_set: set): """ Initialize object. :param rel_name: name of...
python
import rsa m = '00f0d1b6305ea6256c768f30b6a94ef6c9fa2ee0b8eea2ea5634f821925de774ac60e7cfe9d238489be12551b460ef7943fb0fc132fdfba35fd11a71e0b13d9fe4fed9af90eb69da8627fab28f9700ceb6747ef1e09d6b360553f5385bb8f6315a3c7f71fa0e491920fd18c8119e8ab97d96a06d618e945483d39d83e3a2cf2567' e = '10001' message = 'wxz2015111zc@srb' imp...
python
import FWCore.ParameterSet.Config as cms import TrackingTools.MaterialEffects.MaterialPropagator_cfi # "forward" propagator for electrons fwdGsfElectronPropagator = TrackingTools.MaterialEffects.MaterialPropagator_cfi.MaterialPropagator.clone( Mass = 0.000511, ComponentName = 'fwdGsfElectronPropagator...
python
import os from cs50 import SQL from flask import Flask, flash, redirect, render_template, request, session from flask_session import Session from tempfile import mkdtemp from werkzeug.exceptions import default_exceptions from werkzeug.security import check_password_hash, generate_password_hash from helpers import apo...
python
import os import sys from collections import OrderedDict try: # Python 2 import ConfigParser as configparser except: # Python 3 import configparser class RDMConfig(object): def __init__(self): """ Config container. """ self.station_code = None self.channel = None ...
python
import jax molecular_profiles = [ "APC inact mut KRAS G12D", "APC mutant BRAF mutant PIK3CA mutant SMAD4 mutant TP53 mutant", "BRAF V600E EGFR amp", "BRAF V600E MAP2K1 L115P", "BRAF V600E NRAS Q61K NRAS A146T MAP2K1 P387S", "BRAF amp BRAF V600X NRAS Q61K", "CDKN2A mut MET del exon14 PDGFRA ...
python
# pylint: disable=attribute-defined-outside-init # Copyright 2012 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ChromeOS Firmware Utilities This modules provides easy access to ChromeOS firmware. To access the co...
python
# # This file is part of GreatFET # from __future__ import absolute_import import usb import time import codecs from .base import GlitchKitModule from ..protocol import vendor_requests # Quirk constant that helps us identify libusb's pipe errors, which bubble # up as generic USBErrors with errno 60 on affected pla...
python
"""配置文件""" # 使用线程数量 THREAD_NUM = 4 # MySQL 配置 MYSQL_CONFIG = { 'host': 'localhost', 'port': 3306, 'user': 'root', 'pwd': 'password', 'db': 'glasses', } # 保存数据的表 MYSQL_TABLE_SAVE_EBD = 'ebd'
python
# The MIT License (MIT) # Copyright (c) 2021 Tom J. Sun # 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, ...
python
import irc3, json from alveos.asgi import channel_layer from django.contrib.sessions.models import Session from channels import Channel @irc3.plugin class Plugin(object): """Alveos IRC3 class""" requires = [ 'irc3.plugins.core', 'irc3.plugins.userlist', 'irc3.plugins.command', ...
python
#Crie um programa que leia duas notas de um aluno calcule sua média, mostrando no final, de acordo #com sua média atingida: #- Média abaixo de 5.0 REPROVADO #- Média entre 5.0 e 6.9 RECUPERAÇÃO #- Média 7.0 ou superior APROVADO n1 = float(input('Digite sua primeira nota!')) n2 = float(input('Digite sua segunda ...
python
#!C:\Users\willi\AppData\Local\Programs\Python\Python38-32\python.exe #!/usr/bin/python import numpy as np # Unused import pandas as pd # For dataframe import matplotlib.pyplot as plt # For ploting graph (unused) import psycopg2 # For database control import tim...
python
from util.lambda_constants import MIN_COST, MIN_MEMORY_SIZE, STATIC_INVOCATION_COST def compute_cost(memory_size, billed_duration): return MIN_COST * (memory_size / MIN_MEMORY_SIZE) * billed_duration + STATIC_INVOCATION_COST class ExecutionLog: """ Class representing the execution log of a AWS Lambda func...
python
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc import event_store_pb2 as event__store__pb2 class EventStoreStub(object): # missing associated documentation comment in .proto file pass def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. ...
python
from django import forms from service_catalog.models import SupportMessage from Squest.utils.squest_model_form import SquestModelForm class SupportMessageForm(SquestModelForm): class Meta: model = SupportMessage fields = ["content"] content = forms.CharField(label="Add a comment", ...
python
import os import atexit from typing import Union from tempfile import TemporaryDirectory from httpwatcher import HttpWatcherServer from tornado.ioloop import IOLoop from pavo.cli import handle_message from ._build import Builder def main() -> None: """Starts a local server that shows you your website in develop...
python
#!/usr/bin/env python3 import matplotlib matplotlib.use('agg') import os import sys import yt import matplotlib.pyplot as plt import numpy as np from functools import reduce from mpl_toolkits.axes_grid1 import ImageGrid # assume that our data is in CGS from yt.units import cm, amu from yt.frontends.boxlib.api impor...
python
#!/usr/bin/python3 # This is not really an example but rather some code to test # the behaviour of the pruss interconnect with regard to # concurrent requests to the same local memory. import sys sys.path.insert( 0, '../src' ) from ti.icss import Icss import ctypes pruss = Icss( "/dev/uio/pruss/module" ) pruss.init...
python
#!/usr/bin/env python import os from django.contrib.auth.management.commands import createsuperuser from django.core.management import CommandError class Command(createsuperuser.Command): help = 'Create a superuser' def handle(self, *args, **options): password = os.getenv('db_pass') username ...
python
class Solution: def XXX(self, l1: ListNode, l2: ListNode) -> ListNode: out = l1 carry = 0 lv = l2.val while True: val = l1.val + lv l1.val = val % 10 lv = val > 9 # carry if l1.next: if l2.nex...
python
# -*- coding: utf-8 -*- """ The ProductInfo elements. """ from typing import Union import numpy # noinspection PyProtectedMember from ..sicd_elements.base import Serializable, DEFAULT_STRICT, _StringDescriptor, \ _DateTimeDescriptor, _ParametersDescriptor, ParametersCollection, \ _SerializableListDescriptor ...
python
# -*- coding: utf-8 -*- from __future__ import division """ Trains a ResNeXt Model on Cifar10 and Cifar 100. Implementation as defined in: Xie, S., Girshick, R., Dollár, P., Tu, Z., & He, K. (2016). Aggregated residual transformations for deep neural networks. arXiv preprint arXiv:1611.05431. """ __author__ = "P...
python
from pathlib import Path from os import path from enum import Enum import numbers from collections.abc import Iterable import io import base64 from pptx import Presentation from pptx.enum.chart import XL_CHART_TYPE, XL_LEGEND_POSITION from pptx.chart.data import CategoryChartData, XyChartData, BubbleChartData from ppt...
python
# Generated by Django 2.0.7 on 2018-08-06 11:36 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('principal', '0004_tienda_uuid'), ] operations = [ migrations.AddField( model_name='ciudad', name='url_pagina', ...
python
import warnings from contextlib import contextmanager from veros import runtime_settings, runtime_state, veros_kernel class Index: __slots__ = () @staticmethod def __getitem__(key): return key def noop(*args, **kwargs): pass @contextmanager def make_writeable(*arrs): orig_writeable =...
python
# coding: utf-8 import logging from typing import Dict, List, Iterable from overrides import overrides from allennlp.common import Params from allennlp.common.checks import ConfigurationError from allennlp.common.file_utils import cached_path from allennlp.data.dataset_readers.dataset_reader import DatasetReader fro...
python
from Core.GlobalExceptions import Exceptions from Services.NetworkRequests import requests from Services.Utils.Utils import Utils from Download.Downloader.Engine.Config import Config from Download.Downloader.Task.PrioritizedTask import PrioritizedTask class SegmentDownloader(PrioritizedTask): def __init__(self, u...
python
import json from optimism.JaxConfig import * from optimism import Mesh def read_json_mesh(meshFileName): with open(meshFileName, 'r', encoding='utf-8') as jsonFile: meshData = json.load(jsonFile) coordinates = np.array(meshData['coordinates']) connectivity = np.array(meshData['connectivi...
python
#Benjamin Ramirez August 9, 2016 #making class to keep track of encoder ticks on wheels import RPi.GPIO as GPIO class Encoder(object): def __init__ (self, a_pin_num, b_pin_num): self.a_pin = a_pin_num self.b_pin = b_pin_num GPIO.setmode(GPIO.BCM) GPIO.setup(s...
python
from flask_wtf import FlaskForm from wtforms import IntegerField, SelectField, SelectMultipleField, SubmitField, \ StringField from wtforms.validators import DataRequired, Optional, NumberRange class Search(FlaskForm): min_age = IntegerField('From-years', validators=[Optional(), NumberRange(0, 1000, 'Too big ...
python
# SPDX-FileCopyrightText: 2022 Stephan Lachnit <stephanlachnit@debian.org> # # SPDX-License-Identifier: EUPL-1.2 """ This module contains tools to manipulate DEP5 documents. """ from .classes import DEP5Document, DEP5FilesParagraph, DEP5HeaderParagraph, DEP5LicenseParagraph, DEP5Metadata from .convert_calir import c...
python
from rest_framework.exceptions import NotFound, PermissionDenied from users.models import User, Role from events.models import Event from events.logic.event import get_events def check_user_event_same_organization(view_method): def _arguments_wrapper( instance, request, requester: User, event_id: int, *a...
python
from taskplus.core.actions import ListTasksRequest def test_list_tasks_request_without_parameters(): request = ListTasksRequest() assert request.is_valid() is True assert request.filters is None def test_list_tasks_request_with_filters(): filters = dict(name='task') request = ListTasksRequest(fi...
python
from flask import Flask, redirect, url_for, render_template, current_app from api import Refran app = Flask(__name__) @app.route('/') def home(): refran = Refran() return render_template('index.html', linea=refran.generate_refran()) if __name__ == '__main__': app.run(debug=True)
python
import subprocess from common.mapr_logger.log import Log class OSCommand(object): @staticmethod def run(statements): response, status = OSCommand.run2(statements) return response @staticmethod def run3(statements, username=None, use_nohup=False, out_file=None, in_background=False, us...
python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ObsPy implementation for parsing the sc3ml format to an Inventory object. This is a modified version of obspy.io.stationxml. :author: Mathijs Koymans (koymans@knmi.nl), 11.2015 - [Jollyfant@GitHub] :copyright: The ObsPy Development Team (devs@obspy.org) :licen...
python
""" Code taken from: https://uvadlc-notebooks.readthedocs.io/en/latest/tutorial_notebooks/tutorial11/NF_image_modeling.html#Normalizing-Flows-as-generative-model https://github.com/didriknielsen/survae_flows/blob/master/survae/transforms/surjections/slice.py """ from typing import Iterable, List from FrEIA.modu...
python
# -*- coding: utf-8 -*- """ Created on Mon Sep 13 12:39:40 2021 @author: Clau Paper: Energy sufficiency (SDEWES LA 2022) User: Public lighting - LOWLANDS """ from core import User, np User_list = [] #Definig users PL = User("Public lighting ", 1) User_list.append(PL) #Appliances PL_lamp_post = PL.Appliance(PL,1...
python
#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import pandas as pd import matplotlib.pyplot as plt df_train = pd.read_csv('train.csv') country = df_train['Country/Region'] country_set = list(set(country)) country_set = sorted(country_set) province = df_train['Province/State'] for i in range(len...
python
#!/usr/bin/env python3 import Bio from Bio.Seq import Seq my_seq = Seq("ATGAGTACACTAGGGTAA") print(my_seq) rc = my_seq.reverse_complement() pep = my_seq.translate() print("revcom is", rc) print("re-revcom is", rc.reverse_complement()) print(pep)
python
import loadgenome as lg import parse as prs import makepdf as mpdf import sys, getopt #print lg.loadgen("sample genomes/23andme_sample.txt") # def main(argv): input_file = '' output_file = '' usage = 'Usage: python main.py -i <input_file> -o <output_file>' try: opts, args = getopt.getopt(argv,...
python
import cv2 import numpy as np import os from glob import glob #imagefiles = sorted(glob('./inputs/*.jpg')) imagefiles = glob('./inputs/*.jpg') images = [] for filename in imagefiles: img = cv2.imread(filename) images.append(img) stitcher = cv2.Stitcher.create() _, res = stitcher.stitch(images) cv2.imshow('Panor...
python
import streamlit as st import time from helpers import * from streamlit.script_runner import RerunException @st.cache(suppress_st_warning=True) # 👈 Changed this def expensive_computation(a, b): # 👇 Added this st.write("Cache miss: expensive_computation(", a, ",", b, ") ran") time.sleep(2) # This makes...
python
{ "targets": [ { "target_name": "equihashverify", "dependencies": [ ], "sources": [ "src/blake/blake2-config.h", "src/blake/blake2-impl.h", "src/blake/blake2-round.h", "src/blake/blake2....
python
#Load libraries. import pandas as pd import numpy as np from sklearn.decomposition import PCA from sklearn.metrics.cluster import adjusted_rand_score import phenograph import matplotlib.pyplot as plt from pylab import * #Write function. #Accept a dictionary of normalized matrices where the keys are downsample lev...
python
# # RegistrationManager.py # # (c) 2020 by Andreas Kraft # License: BSD 3-Clause License. See the LICENSE file for further details. # # Managing resource / AE registrations # from Logging import Logging from typing import Tuple, List from Constants import Constants as C from Configuration import Configuration from res...
python
#!/bin/python3 import sys t = int(input().strip()) for a0 in range(t): n, k = input().strip().split(' ') n, k = [int(n),int(k)] a = [int(a_temp) for a_temp in input().strip().split(' ')] arrived_on_time = 0 for student_arrival in a: if student_arrival <= 0: ...
python
"""Tests for clover.data_ingest.parsing.parsers.table_structures""" # pylint: disable=too-many-lines import copy import pytest import sqlalchemy as sa import sqlalchemy.dialects.postgresql as sa_pg import sqlalchemy.sql.elements as sa_elements import sqlalchemy.sql.functions as sa_func from yalchemy import table_stru...
python
import torch try: import torch_kdtree # if built with setuptools except: import os, sys; sys.path.append(os.path.join(os.path.dirname(__file__), "../../build")) # if built with cmake import torch_kdtree from torch_cluster import radius from scipy.spatial import cKDTree from time import time import numpy as ...
python
from abc import ABCMeta, abstractmethod class AlgebraicClass(metaclass=ABCMeta): """ Esta clase agrega estructura de algebra de frobenius a las clases """ @abstractmethod def __repr__(self): """ Este metodo permite que se pueda mostrar una clase en pantalla """...
python
from __future__ import print_function, absolute_import import argparse import os.path as osp import random import numpy as np import sys import time import shutil import h5py from tqdm import tqdm import torch from torch import nn from torch.backends import cudnn from torch.utils.data import DataLoader import torch.di...
python
# Copyright 2017-present Open Networking Foundation # # 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 ag...
python
import json import requests from .config import BASE_URL, GIST_URL class Do: def __init__(self, gist): self.gist = gist def getMyID(self,gist_name): ''' Getting gistID of a gist in order to make the workflow easy and uninterrupted. ''' r = requests.get( '%s'%BASE_URL+'/users/%s/gists' % self.gist.use...
python
text = """ Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, "and what is the use of a book," thought Alice "without pictures or conversations?" So she...
python
import unittest from omniglot.omni import OmnilingualProcessor from omnilingual import LanguageCode class TestOmni(unittest.TestCase): def setUp(self): self.omni = OmnilingualProcessor(None) self.maxDiff = None if __name__ == "__main__": unittest.main()
python
import pytest import os import time import socket from urllib.parse import urlparse def is_port_open(hostname, port): return socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex((hostname, port)) == 0 @pytest.fixture(scope="session") def ENDPOINT(): return os.environ.get('URI_SERVER', 'http://local...
python
# Generated by Django 3.0.1 on 2019-12-25 21:42 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Circle', fields=[ ('id', models.AutoField(a...
python
# Copyright The PyTorch Lightning team. # # 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 i...
python
import asyncio import logging import signal import socketio import urllib _API_V2_NAMESPACE = '/api/v2/socket_io' _RECONNECT_ATTEMPTS = 1 # We most commonly get disconnected when the session # expires, so we don't want to try many times _LOGGER = logging.getLogger(__name__) class SmartboxAPIV2Namespace(socketio.As...
python
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2021 4Paradigm # # 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 ...
python
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import, division, print_function import re import logging import time import os import sys currentdir = os.path.dirname(os.path.realpath(__file__)) parentdir = os.path.dirname(currentdir) sys.path.append(parentdir) from...
python
# Misc comptrollerAddress = "0xAB1c342C7bf5Ec5F02ADEA1c2270670bCa144CbB" curveAddressProvider = "0x0000000022D53366457F9d5E68Ec105046FC4383" ethZapAddress = "0x5A0bade607eaca65A0FE6d1437E0e3EC2144d540" eurt_namehash = "0xd5aa869323f85cb893514ce48950ba7e84a8d0bf062a7e3058bcc494217da39f" masterChefAddress = "0xbD17B1ce62...
python
# GENERATED BY KOMAND SDK - DO NOT EDIT import komand import json class Input: HASH = "hash" class Output: FOUND = "found" REPORTS = "reports" THREATSCORE = "threatscore" class LookupHashInput(komand.Input): schema = json.loads(""" { "type": "object", "title": "Variables", "pr...
python
""" Created: 2001/08/05 Purpose: Turn components into a sub-package __version__ = "$Revision: 1.1 $" __date__ = "$Date: 2001/12/11 23:47:11 $" """
python
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. from __future__ import absolute_import, division, print_function, unicode_literals BOOTSTRAP_XAR = "bootstrap_xar....
python
# Copyright (c) 2018 FlashX, LLC # # 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, merge, publish, distrib...
python
import json import logging from pathlib import Path from typing import Any, Iterable, List, Set, Union import numpy as np import pandas as pd from hyperstyle.src.python.review.application_config import LanguageVersion from hyperstyle.src.python.review.common.file_system import Extension from hyperstyle.src.python.revi...
python
""" Extract functions for space time raster, 3d raster and vector datasets (C) 2012-2013 by the GRASS Development Team This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details. :authors: Soeren Gebbert """ from .core import get_tgis_message_int...
python
import FWCore.ParameterSet.Config as cms enableSonicTriton = cms.Modifier()
python
# PLY package # Author: David Beazley (dave@dabeaz.com) # https://dabeaz.com/ply/index.html __version__ = '4.0' __all__ = ['lex','yacc']
python
import hvac import os client = hvac.Client(url='https://localhost:8200', verify=False) # use false for testing only (self signed cert on dev machine) client.token = os.environ['VAULT_TOKEN'] secret = client.secrets.kv.v2.read_secret_version(mount_point="apikeys_prod", path='keys') # https://hvac.readthedocs.io/en/stab...
python
from selenium import webdriver import time import arrow from datetime import datetime from bs4 import BeautifulSoup import threading from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys import os ''' Created on 13 Sep 2013 Updated 12 Nov 2017 @author: rob dobson ''' ...
python
import argparse import logging MEDIUM_CHOICES = ["CD", "SACD", "DVD", "DVD-A", "Blu-ray", "Web", "Vinyl", "78RPM Vinyl", "LP", "Vinyl LP", "45RPM Vinyl LP", "EP", "Vinyl EP", "45RPM Vinyl EP", "180g Vinyl LP", "180g 45RPM Vinyl L...
python
""" ===================================== Hawkes simulation with exotic kernels ===================================== Simulation of Hawkes processes with usage of custom kernels """ import matplotlib.pyplot as plt import numpy as np from tick.base import TimeFunction from tick.hawkes import SimuHawkes, HawkesKernelE...
python
#!/usr/bin/env python3 import subprocess import os from libsw import file_filter, settings, build_queue, build_index, logger def register_ip(ip): path = settings.get('install_path') + 'etc/remote-deploy' return file_filter.AppendUnique(path, ip, True).run() def unregister_ip(ip): path = settings.get('i...
python
# Copyright 2020 The FastEstimator 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 appl...
python
import sys from itertools import product import intake def all_params(): all_params = {} cat = intake.open_catalog('catalog.yaml') for item in cat: description = cat[item].describe() params = description["user_parameters"] params = {params[i]["name"]: params[i]["allowed"] for i ...
python
from logging import error, info, basicConfig, getLogger, warning from os import environ as env from gitlabdata.orchestration_utils import ( postgres_engine_factory, snowflake_engine_factory, query_executor, ) from google_sheets_client import GoogleSheetsClient from qualtrics_client import QualtricsClient f...
python
# Interactive Help '''digitando help() no console python Ou help(print) ou print(input.__doc__)''' # Docstrings '''def contador(i, f, p): """==> Faz uma contagem e mostra na tela. :param i: início da contagem :param f: fim da contagem :param p: passo da contagem :return: sem retorn...
python
from .sql import SQL from .sac import SAC from .drsac import DRSAC
python
import jaxopt import numpy as np import pandas as pd import tinygp import jax import jax.numpy as jnp from io import StringIO import matplotlib.pyplot as plt from plotting import * import pickle from jax.config import config config.update("jax_enable_x64", True) bands = 'ugrizY' N_bands = len(bands) class Multiband(...
python
# A function can return only one value. # # If the value is a tuple ... # the effect is the same as returning multiple values. # Quontient & Reminder: # # To compute the quontient and reminders it is better to ... # compute both at the same time. quot = 7//3 rem = 7%3 assert (quot, rem) == (2, 1) quot, rem = divmod...
python
from llvmlite.ir import IdentifiedStructType from rial.ir.metadata.StructDefinition import StructDefinition class RIALIdentifiedStructType(IdentifiedStructType): definition: StructDefinition module_name: str def __init__(self, context, name, packed=False): super().__init__(context, name, packed)...
python
# -*- coding: cp1254 -*- #if external software is used for Analysis (Excel,Weka, R. etc) #This script Convert excel file to raster (susceptibility map) and calculate ROC #The excel file must be include x and y coordinates and Probability values as z #To calculate AUC test and train data required. They were calculated w...
python
objConstructors = {'dyn_vals.get' : {'constructor' : 'DynamicValuec', 'type' : 'DynamicValuei', 'fields' : ['bucket_size', 'bucket_time']}} typeConstructors = {'DynamicValuec' : 'DynamicValuei'} stateObjects = {'flow_emap' : emap, ...
python
""" This is CoLA Bot code that uses slurk interface. CoLA bot handles the dialogue between two players who need to collaborate togther to solve a task. In each game room, we show the players - images, text information, logical rules. They need to discuss together and reach an agreement. So, the two important comm...
python
from pykitml.testing import pktest_graph, pktest_nograph @pktest_graph def test_adult(): import os.path import numpy as np import pykitml as pk from pykitml.datasets import adult # Download the dataset if(not os.path.exists('adult.data.pkl')): adult.get() # Load adult data set input...
python
#!/usr/bin/env python # encoding: utf-8 class OsfStorageError(Exception): pass class PathLockedError(OsfStorageError): pass class SignatureConsumedError(OsfStorageError): pass class VersionNotFoundError(OsfStorageError): pass class SignatureMismatchError(OsfStorageError): pass class VersionSta...
python
""" Suggest types for untyped code. """ import ast from collections import defaultdict from dataclasses import dataclass, field from types import FunctionType from typing import Any, Dict, Iterator, List, Mapping, Optional, Sequence, Tuple, Union from .safe import safe_getattr, safe_isinstance from .error_code impor...
python
from __future__ import division import casadi as ca from planner import Planner __author__ = 'belousov' class Simulator: # ======================================================================== # True noisy trajectory # =======================================================...
python