content
stringlengths
5
1.05M
# Copyright (c) Sebastian Scholz # See LICENSE for details. """ Classes for representing and dealing with oauth2 clients """ from abc import abstractmethod, ABCMeta try: from urlparse import urlparse except ImportError: # noinspection PyUnresolvedReferences from urllib.parse import urlparse from txoauth2...
from flair.data import Corpus from flair.data import Sentence from flair.embeddings import TokenEmbeddings, WordEmbeddings, \ StackedEmbeddings, CharacterEmbeddings, FlairEmbeddings, \ PooledFlairEmbeddings, ELMoEmbeddings, BertEmbeddings , RoBERTaEmbeddings from typing import List from create_flair_corp...
from .query import SortFilterQuery
# -*- coding: utf-8 -*- ''' Created on Dec 21, 2013 @author: Chris ''' from gooey import Gooey from gooey import GooeyParser import message welcome_message = \ r''' __ __ _ \ \ / / | | \ \ /\ / /__| | ___ ___ _ __ ___ ___ \ \/ \/ / _ \ |/ __/ _ \| '_ ` _ \ / _ \ \ /\ / __/ |...
#!/usr/bin/env python3 """Modularise a JSON schema Modularise a JSON schema and allows it to accept a data structure that can be composed of include files. Two positional arguments are expected: 1. The file name of the JSON schema file. 2. The file name of a configuration file in JSON format. The configuration fi...
from drone.config.settings import logger def write_log(msg=None): def wrap(f): def wrapped_f(*args, **kwargs): if msg: logger.debug(msg) logger.debug('%s %s %s' % (str(f), str(args), str(kwargs))) result = f(*args, **kwargs) logger.debug(resu...
# uncompyle6 version 2.13.2 # Python bytecode 3.5 (3351) # Decompiled from: Python 3.5.3 (default, Jan 19 2017, 14:11:04) # [GCC 6.3.0 20170118] # Embedded file name: db\tables\profiles.py __author__ = 'sanyi' from sqlalchemy import * from sqlalchemy.orm import mapper from sqlalchemy.dialects.postgresql import UUID as...
from healthvaultlib.itemtypes.heartrate import HeartRate from healthvaultlib.itemtypes.allergy import Allergy from healthvaultlib.itemtypes.questionanswer import QuestionAnswer from healthvaultlib.itemtypes.bloodpressure import BloodPressure from healthvaultlib.itemtypes.comment import Comment from healthvaultlib.itemt...
from .augmentations import get_augmentation from .preprocesses import get_preprocess
import DistributedTreasureAI from toontown.toonbase import ToontownGlobals class DistributedSZTreasureAI(DistributedTreasureAI.DistributedTreasureAI): def __init__(self, air, treasurePlanner, x, y, z): DistributedTreasureAI.DistributedTreasureAI.__init__(self, air, treasurePlanner, x, y, z) self.h...
""" Get all preassembled statements, prune away unneeded information, pickle them. """ import sys import pickle from delphi.utils.indra import get_statements_from_json_file if __name__ == "__main__": all_sts = get_statements_from_json_file(sys.argv[1]) with open(sys.argv[2], "wb") as f: pickle.dump(a...
ELASTICSEARCH = { "default": {} } """ Elasticsearch server settings, see _`elasticsearch-py` docs for all available options .. _elasticsearch-py: https://elasticsearch-py.readthedocs.io/en/master/index.html Example settings:: # With security and via HTTPS using RFC-1738 URL ELASTICSEARCH = { "def...
# python3 # -*- coding: utf-8 -*- # @Time : 2022/1/16 22:21 # @Author : yzyyz # @Email : youzyyz1384@qq.com # @File : word_analyze.py # @Software: PyCharm from nonebot import on_command, logger, on_message from nonebot.adapters.onebot.v11 import Bot, GroupMessageEvent, MessageSegment from nonebot.adapters.one...
# -*- coding: utf-8 -*- # pylint: disable=wildcard-import from __future__ import absolute_import from .dataset import * from .datasets import * from .dataloader import * from . import transforms from .stratified_sampler import StratifiedSampler from . import utils
#-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #-- """adding max cards Revision ID: b740362087 Revises: 537fa16b46e7 Create Date: 2013-09-19 17:37:3...
#!/usr/bin/env python3 # Append GPL3 license notice into the top of ian existing file. # Note: If you just trying to append to an empty file, just use # echo "data" | cat >> empty_file.txt # Usage: # cap <file> # import sys gpl_license = '''/* -Insert project name and what it does- Copyright (C) 2018 faraco <s...
def main_report(): print("Hey I am a function inside mainscript.py")
# Copyright 2021 VMware, Inc. # SPDX-License-Identifier: Apache-2.0 import unittest from vdk.internal.builtin_plugins.job_properties.datajobs_service_properties import ( DataJobsServiceProperties, ) from vdk.internal.builtin_plugins.job_properties.inmemproperties import ( InMemPropertiesServiceClient, ) clas...
# -*- coding: utf-8 -*- import unittest from hrt.base import AbstractScript from hrt import script from .templates import (code_begin_python, code_search_python, code_python, code_post_python, code_search_ruby, code_begin_ruby, code_ruby, code_post_ruby, code_begin_bash, code_search_bash, code_...
from . import io from . import local_config from . import ndarray from . import misc from . import plots
import psycopg2 ## connect to the db host = "localhost" db = "stock_selector_db" user = "postgres" pw = "123" conn = psycopg2.connect( host = host, database = db, user = user, password = pw) cur = conn.cursor() ## insert data while True: index = input("what index do you want to register?\n") ...
#! /usr/bin/env python3 """ Chain of joltage adapters """ from pathlib import Path import collections from rich import print import rich.traceback rich.traceback.install() TEST = False # TEST = True if TEST: p = Path(__file__).with_name('day10part1-sample.txt') expected_result_for_1 = 22 expected_result...
""" The :py:mod:`training` module provides a generic continual learning training class (:py:class:`BaseStrategy`) and implementations of the most common CL strategies. These are provided either as standalone strategies in :py:mod:`training.strategies` or as plugins (:py:mod:`training.plugins`) that can be easily combin...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (c) 2020 Érik Martin-Dorel # # Contributed under the terms of the MIT license, # cf. <https://spdx.org/licenses/MIT.html> from bash_formatter import BashLike from datetime import datetime import base64 import copy import json import requests import os impor...
# @lc app=leetcode id=326 lang=python3 # # [326] Power of Three # # https://leetcode.com/problems/power-of-three/description/ # # algorithms # Easy (42.60%) # Likes: 340 # Dislikes: 45 # Total Accepted: 372.3K # Total Submissions: 873.9K # Testcase Example: '27' # # Given an integer n, return true if it is a pow...
from ..machine import Machine class GenericVideo(object): PAUSED = "paused" PLAYING = "playing" STOPPED = "stopped" def __init__(self, skip_optional_validation=True): self.skip_optional_validation = skip_optional_validation def set_machine(self, transitions, initial_state): self....
# FROMS from models import Player from graph import get_graph_from_edges, draw_graph, get_full_cycles_from_graph,\ full_cycle_to_edges, get_one_full_cycle, convert_full_cycle_to_graph,\ get_one_full_cycle_from_graph, get_hamiltonian_path_from_graph,\ is_there_definitely_no_hamiltonian_cycle, hamilton impor...
#!/usr/bin/python import DeviceAtlasCloud.Client import json import argparse da = DeviceAtlasCloud.Client.Client() parser = argparse.ArgumentParser(description='Device Atlas Cloud Probe') parser.add_argument('-ua', action='store', type=str, help='User Agent string', dest='useragent') args = parser.parse_args() heade...
# Copyright 2021 Photon # # 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, softw...
#!/usr/bin/env python "Neon using Gaussians" import unittest, sciunittest from PyQuante.Ints import getbasis,getints from PyQuante.hartree_fock import rhf from PyQuante.Molecule import Molecule # GAMESS-UK HF Energy # Energy -128.4744065199 energy = -128.474406 # Changed 2003-04-07 to reflect diis name = "Ne" def ...
# # growler/indexer/middleware.py # from os import (path, listdir) HTML_TMPL_STR = """ <!DOCTYPE html> <html> <head>{head}</head> <body>{body}</body> </html> """ HEAD_TMPL_STR = """ <meta charset=utf8> <title>{title}</title> """ BODY_TMPL_STR = """ <h1>Index of {path}</h1> <ul>{file_list}</ul> """ PATH_NOT_FOU...
#!/usr/bin/env python3 import unittest import torch from Lgpytorch.kernels import SpectralMixtureKernel class TestSpectralMixtureKernel(unittest.TestCase): def create_kernel(self, num_dims, **kwargs): return SpectralMixtureKernel(num_mixtures=5, ard_num_dims=num_dims, **kwargs) def create_data_no_...
#entrada while True: frase = str(input()) if frase[0] == '*': break #processamento letra = frase[0].upper() frase = frase.split() palavras = len(frase) flag = 'Y' for i in range(1, palavras): if frase[i][0].upper() != letra: flag = 'N' break ...
import gzip import mmap import pickle import re import signal from requests import codes as status_code_values from athena import SharedFragmentTree, tokenise_and_join_with_spaces def extract_common_fragments_per_lui_worker( queue, lui, filepath, entry_points, exclusions ): signal.signal(signal.SIGINT, sign...
class ClassificationModel(object): def __init__(self, modeltype): pass def predict_part_no(self, image): return "3020a", 0.8 def predict_color_id(self, image): return 3, 0.9
from werkzeug.security import generate_password_hash, check_password_hash from accessors.user_accessor import UserAccessor from redis_processor.message_processor import MessageProcessor, Message import logging from helpers.image_server import ImageServer import os class UserException(Exception): pass class User...
from src.TeXtable import tex_table if __name__ == '__main__': # right print(tex_table(style = 1,csv_text='./test/test.csv')) print(tex_table(style = 2,csv_text='./test/test.csv')) print(tex_table(style = 3,csv_text='./test/test.csv')) print(tex_table(style = 4,csv_text='./test/test.csv'))
#! python3 # __author__ = "YangJiaHao" # date: 2018/2/23 class Solution: def groupAnagrams(self, strs): """ :type strs: List[str] :rtype: List[List[str]] """ result = {} for s in strs: # key = tuple(sorted(s)) # result[key] = result.get(key, []...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Example on how to use the 'Pendulum' OpenAI Gym environments in PRL using the `stable_baselines` library. """ from stable_baselines.common.policies import MlpPolicy from stable_baselines.common.vec_env import DummyVecEnv from stable_baselines import PPO2 from pyrobolea...
''' Retrieval Network Testing in Discrete World, Written by Xiao For robot localization in a dynamic environment. ''' # Import params and similarity from lib module import torch import argparse, os, copy, pickle, time import numpy as np import matplotlib.pyplot as plt from PIL import Image from progress.bar import Bar ...
# https://github.com/abhishekchhibber/Gmail-Api-through-Python/blob/master/gmail_read.py ''' Reading GMAIL using Python - Abhishek Chhibber ''' ''' This script does the following: - Go to Gmal inbox - Find and read all the unread messages - Extract details (Date, Sender, Subject, Snippet, Body) and export the...
# python 2 # encoding: utf-8 import os import sys import subprocess from datetime import datetime from workflow import Workflow, MATCH_SUBSTRING from workflow.background import run_in_background import mullvad_actions import helpers GITHUB_SLUG = 'atticusmatticus/alfred-mullvad' ############################# #####...
# -*- coding: utf-8 -*- """ Simple server Takes i-beacon read data with POST method Return summary data with GET MIT License Copyright (c) 2017 Roman Mindlin 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...
from collections import defaultdict class Solution: def diagonalSort(self, mat: List[List[int]]) -> List[List[int]]: d = defaultdict(list) m, n = len(mat), len(mat[0]) res = [[0]*n for _ in range(m)] for i in range(m): for j in range(n): d[i-j].append(mat...
# pylint: disable=invalid-name,protected-access import pytest from allennlp.common.testing import ModelTestCase from allennlp.common.checks import ConfigurationError from allennlp.common.params import Params from allennlp.models import Model class BiattentiveClassificationNetworkMaxoutTest(ModelTestCase): def s...
import pytz from datetime import datetime from mwd.settings import STAGE, TIME_ZONE def stage(request): return {'stage': STAGE} def year(request): return {'year': datetime.now(pytz.timezone(TIME_ZONE)).year} def recaptcha_site_key(request): return { 'reCAPTCHA_v2_site_key': '6LcM4LQZAAAAAOXJ-CS...
import sys import os import pymongo import json import datetime # important values block_max = 4369999 quadrillion = 1000000000000000000 # connecting to mongo to get collection client = pymongo.MongoClient(serverSelectionTimeoutMS=1000) collection = client["blockchainExtended2"]["blocks"] def retriev...
import os from os import listdir from os.path import isfile, join import gc import sys from sys import getsizeof from math import floor import pickle import timeit import getopt from functools import reduce from itertools import repeat from multiprocessing import Pool from numba import njit import numpy as np import t...
import mimetypes import os import shutil import tempfile import time from datetime import datetime, timedelta import pandas as pd import shapely.wkt from django.db import connection from django.db.models import Q from django.http import FileResponse from django.shortcuts import render from django.utils.decorators impo...
import math class CommandTurnLeft: def __init__(self, whill, measure, angle_deg): self.whill = whill self.measure = measure self.angle_deg = angle_deg def run(self): if math.fabs(self.measure.angle_deg) < math.fabs(self.angle_deg): self.whill.send_joystick(int(0), i...
""" Wrapper for the pyproj library """ from pyproj import Proj import pdb class MyProj(object): def __init__(self, projstr, utmzone=51, isnorth=False, init=None): """ Wrapper for Proj class Assists with creation of commonly used projections (UTM and Mercator) Provides conveni...
from .settings import * import dj_database_url DEBUG = True INSTALLED_APPS = INSTALLED_APPS + ( 'debug_toolbar', ) SITE_URL = "http://192.168.1.101:8000" FROM_EMAIL = "paul@pluscom.co.ke" LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'filters': { 'require_debug_false': { ...
all = '' counter = 0 wr = open('../sequences/all.txt', 'w') with open('../sequences/His68Leufs.txt', 'r') as f: for line in f: line = line.strip(' ') wr.write(line.strip('\n')) # for i in range(0, line.strip('\n')) # all += line.strip('\n')
import logging import json import threading import os import paho.mqtt.client as mqtt import base64 from time import sleep, time from random import random from telegram.ext import Updater, CommandHandler, MessageHandler, Filters # Enable logging logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(...
# -*- coding: utf-8 -*- # Time : 2021/12/22 22:04 # Author : QIN2DIM # Github : https://github.com/QIN2DIM # Description: from services.cluster import __entropy__, __pending__ from services.middleware.workers_io import EntropyHeap from services.settings import logger from services.utils import CoroutineSp...
import app_config import copy from fabric.api import * from fabric.state import env from jinja2 import Template import logging import carebot """ General configuration """ env.user = app_config.SERVER_USER env.hosts = app_config.SERVERS env.slug = app_config.PROJECT_SLUG logging.basicConfig() logger = logging.getL...
import json import unittest from parameterized import parameterized from repro.models.liu2019 import BertSumExt, BertSumExtAbs, TransformerAbs from repro.testing import get_testing_device_parameters from . import FIXTURES_ROOT class TestLiu2019Models(unittest.TestCase): def setUp(self) -> None: # The e...
import os import tempfile from pathlib import Path import fsspec import pytest from callee.strings import StartsWith from sgkit.io.vcf.utils import build_url, temporary_directory def directory_with_file_scheme() -> str: return f"file://{tempfile.gettempdir()}" def directory_with_missing_parent() -> str: #...
""" Test version of a classic optimised Dijkstra algorithm for single source shortest path """ import networkx as nx #from skfmm import heap #import heapq import heapdict #from fibheap import * import fibonacci_heap_mod class DijkstraSSSP: def __init__(self,G): self.graph = G self.d = {} s...
from . import financialmodelingprep as fmp_api
#! /usr/bin/env python3 # Copyright(c) 2017 Intel Corporation. # License: MIT See LICENSE file in root directory. from mvnc import mvncapi as mvnc from sys import argv import numpy import cv2 from os import listdir from os.path import isfile, join from random import choice from timeit import timeit from threading imp...
# This source is based on: # 'examples/vhdl/array_axis_vcs/run.py' from VUnit (Mozilla Public License, v. 2.0) from pathlib import Path from vunit import VUnit VU = VUnit.from_argv() VU.add_random() VU.add_verification_components() ROOT = Path(__file__).parent VU.add_library("lib").add_source_files([ ROOT / "*....
#!/usr/bin/env python # Si570Utils class gives python access to the Si570 Digital # Sythesizer via a USB connection. # Copyright (C) 2014 Martin Ewing # Massive modifications by Bob Bouterse WD8RDE, I only need it to calculate register values. # # This program is free software: you can redistribute it and/or modify # ...
# -*- coding: utf-8 -*- """A library for driving the Pimoroni Micro Dot pHAT Raspberry Pi add-on. This library creates a virtual buffer of unlimited size onto which you can write text and icons for scrolling around the Micro Dot pHAT display. Methods are included for rotating and scrolling, plus writing text either ...
import math import time_functions import numpy as np import sys # Function calculates projection of an arbitrary vector # on an arbitrary plane given by its normal vector representation. def calculate_projection_of_vector_on_plane(vector, surface_normal_of_plane): k = np.dot(vector, surface_normal_of_plane) / np....
import numpy as np import matplotlib.pyplot as plt import useful as use import pdb from decimal import Decimal np.set_printoptions(threshold=np.inf) fig1, ax3 = plt.subplots() fig2, ax4 = plt.subplots() fig3, ax5 = plt.subplots() ############################################## #Theoretical Solution dt = .001 l = [1]...
# Xiaomi Chuangmi Camera
from selenium.webdriver.common.by import By from .BasePage import BasePage # Работает на главной странице yandex.ru # В класс передается драйвер # click_on_yandex_service принимает в аргумент имя сервиса (например, "Картинки"), возвращает элемент сервиса на странице # *также можно передать значение для аргумента ret...
# This file is generated, do not modify import datetime VERSION = (1, 1, 39) VERSION_STR = '1.1.39' PRODUCT = 'gatling/version.py' REQ_MD5 = '66d2b20c6fa5c95ac17a05d908889c66' PY_MD5 = '718bdc24d15cec0096bd0ab6ed8e405b' TIMESTAMP = datetime.datetime(2020, 2, 21, 2, 17, 35, 784725) USER_NAME = 'Philip Bergen' USER_...
#! /usr/bin/python # # postgre_python_update.py # # Sep/06/2016 # # ------------------------------------------------------------------- import cgi import string import sys import psycopg2 # import json # # # ------------------------------------------------------------------- sys.path.append ('/var/www/data_base/com...
from __future__ import unicode_literals from django.db import models, connection from .private_media import * from django.contrib.auth.models import User from django.core.validators import MaxValueValidator, MinValueValidator from tinymce import HTMLField import uuid # ENUM choices DISCOUNT_CHOICE = ( ('Percentage...
# Copyright (c) Chris Choy (chrischoy@ai.stanford.edu). # # 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, ...
# -*- coding: utf-8 -*- import numpy as np import pytest try: from mgmetis.parmetis import part_geom from mpi4py import MPI comm = MPI.COMM_WORLD has_mpi = True except (ImportError, ModuleNotFoundError): has_mpi = False @pytest.mark.skipif(not has_mpi or comm.size != 2, reason="invalid parallel ...
# Form implementation generated from reading ui file 'wiznewtext.ui' # # Created: Mon Dec 23 20:49:57 2002 # by: The PyQt User Interface Compiler (pyuic) # # WARNING! All changes made in this file will be lost! import sys from qt import * class wizNewText(QWizard): def __init__(self,parent = None,name = No...
# Generated by Django 3.0.3 on 2020-09-02 14:13 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('rcsystem', '0047_delete_post'), ] operations = [ migrations.RenameModel( old_name='BookCategory', new_name='DBBookCategory',...
from queue import Empty, Queue import threading from flask import ( Flask, request, Response, send_file, render_template ) import torch torch.backends.cudnn.benchmark = True from torchvision import transforms, utils from util import * import os import glob import copy import time from io import BytesIO from distu...
""" LYNGUA LANGUAGE LEARNING EXPERIENCE Copyright (c) 2021 by SilentByte <https://silentbyte.com/> """ # Deprecated and planning to delete import json import base64 import logging import requests from typing import List from dataclasses import dataclass from lyngua_api import settings log = logging.getLogge...
from __future__ import absolute_import import numpy import scipy.ndimage.filters from six.moves import range def kirsch(image): convolution_mask = [5, -3, -3, -3, -3, -3, 5, 5] derivatives = numpy.zeros(image.shape) kernel = numpy.zeros((3, 3), image.dtype) kindex = numpy.array([[0, 1, 2], [7, -1, 3...
# -*- coding: utf-8 -*- # This file as well as the whole tspreprocess package are licenced under the MIT licence (see the LICENCE.txt) # Maximilian Christ (maximilianchrist.com), 2017 from __future__ import absolute_import, division import numpy as np from tsfresh import extract_features from tsfresh.utilities.datafra...
#!/usr/bin/env python # Pre-processing script that reads Geant4 output from a particular source # and saves it to a uniform-format FITS file encoding the energy deposited # in WFI pixels for each primary particle. This is for the MIT-generated # Geant4 output, which should be sorted into directories for different # ru...
import os from elasticsearchutils import searchByStatus, buildElasticSearchUrl ES_ENDPOINT = os.environ.get('ES_ENDPOINT', 'http://aa41f5f30e2f011e8bde30674acac93e-1024276836.us-west-2.elb.amazonaws.com:9200') ES_INDEX = 'documents' es_url_status_search=buildElasticSearchUrl(ES_ENDPOINT, ES_INDEX) es_url_stat...
from __future__ import annotations import random import numpy as np import pytest from torchvision import datasets # type: ignore[import] from edutorch.typing import NPArray, NPIntArray @pytest.fixture(autouse=True) def _set_random_seed() -> None: random.seed(0) np.random.seed(0) @pytest.fixture(scope="...
# -*- coding: utf-8 -*- """ Authors: Tim Hessels Module: Collect/MYD11 Description: This module downloads MYD11 LST data from http://e4ftl01.cr.usgs.gov/. Use the MYD11.LST function to download and create daily LST images in Gtiff format. The data is available between 2000-02-18 till present. Examples: from pyWAPOR.C...
""" Unit tests for ``wheezy.http.cacheprofile``. """ import unittest from datetime import datetime, timedelta from unittest.mock import Mock, patch from wheezy.core.datetime import parse_http_datetime from wheezy.http.cacheprofile import ( # isort:skip CACHEABILITY, CacheProfile, RequestVary, SUPPOR...
from abjad import * from presentation import * ### PRE ### def show_demo(): talea = rhythmmakertools.Talea( counts=[1, 2, 3], denominator=16, ) tie_specifier = rhythmmakertools.TieSpecifier( tie_across_divisions=True, ) burnish_specifier = rhythmmakertools.Burnish...
from poynt import API class BusinessApplication(): """ A Class providing methods to fetch business application information """ @classmethod def get_business_application(cls, business_id): """ Gets a business application Arguments: business_id (str): the business I...
# -*- coding: utf-8 -*- """ /*************************************************************************** MOPA An independet project Método de Obtenção da Posição de Atirador ------------------- begin : 2019-03-06 git sha ...
# -*- coding: UTF-8 -*- """ An unofficial implementation of CSP-DarkNet with pytorch @Cai Yichao 2020_09_30 """ import torch import torch.nn as nn import torch.nn.functional as F # from torchsummary import summary from .CSPdarknet53conv_bn import Mish, BN_Conv_Mish from .build import BACKBONE_REGISTRY from...
# -*- coding: utf-8 -*- """ @author: Ardalan MEHRANI <ardalan77400@gmail.com> @brief: """ import numpy as np from sklearn import datasets, metrics, model_selection from pylightgbm.models import GBMClassifier # Parameters seed = 1337 path_to_exec = "~/Documents/apps/LightGBM/lightgbm" np.random.seed(seed) # for repro...
import pandas as pd import re def get_sisa_kamar(x): try: gotdata = x.split('\n \n\t')[1].split('\n \n\t\t\t\t')[0] except IndexError: gotdata = x return gotdata def get_area(x): try: gotdata = x.split('\n \n\t')[1]\ .split('\n \n\t\t\t\t')[1].split('\n\t\t\t')[1]....
import ipaddr import re from django.core.exceptions import ValidationError from cyder.cydns.validation import validate_domain_name from cyder.base.eav.utils import strip_and_get_base, validate_list ### Naming conventions in this module: ### ### - A function that does not start with '_' is a validator that can be...
"""Support for Velbus switches.""" import logging from velbus.util import VelbusException from homeassistant.components.switch import SwitchEntity from . import VelbusEntity from .const import DOMAIN _LOGGER = logging.getLogger(__name__) async def async_setup_entry(hass, entry, async_add_entities): """Set up ...
from .keygen import KeyInfo, free_keys_left, generate_key, get_key_information, set_key_used, validate_key
import os import argparse import gzip import json import tqdm DEFAULT_ARGS = {"input_path": "data/datasets/pointnav/citi/v2/train/train.json.gz"} def parse_args(): parser = argparse.ArgumentParser() parser.add_argument("--input-path", "-i") parser.add_argument("--output-path", "-o") parser.add_argu...
""" Introduction of Neighbor Sampling for GNN Training ================================================== In :doc:`previous tutorials <../blitz/1_introduction>` you have learned how to train GNNs by computing the representations of all nodes on a graph. However, sometimes your graph is too large to fit the computation...
import numpy as np import scipy as sp import scipy.linalg as la from scipy.linalg import svd from scipy.linalg import eig from numpy import matmul as mm from scipy.linalg import expm as expm from numpy import transpose as tp def rank_to_normal(data, c, n): # Standard quantile function data = (data - c) / (n -...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: Larry Xiao # @Date: 2014-07-30 09:22:13 # @Last Modified by: Larry Xiao # @Last Modified time: 2014-07-30 09:30:18 import sys import numpy class ReportEntry: DateTime = '' TimetoLoad = '' TimetoPartition = '' Data = '' Strategy = '' ...
import pytest import numpy as np from numba import types from numba.typed import List from hmmkay.utils import ( _check_array_sums_to_1, make_proba_matrices, make_observation_sequences, check_sequences, ) def test_make_observation_sequences(): # basic tests for shape, types and values # test...
import pandas as pd import numpy as np from fast_ml.utilities import rare_encoding class FeatureEngineering_Categorical: def __init__(self, model=None, method='label', drop_last=True, n_frequent=None): ''' Parameters: ----------- model = default is None. Most of the encoding met...
import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk from .uiutils import ChildFinder import sys @Gtk.Template(filename=sys.path[0] + "/dungeon/ui/keypadwidget.glade") class KeypadWidget(Gtk.Box, ChildFinder): __gtype_name__ = "KeypadWidget" def __init__(self, length=5, default=None): ...