content
stringlengths
0
894k
type
stringclasses
2 values
# -*- coding: utf-8 -*- from __future__ import absolute_import __all__ = ("main",) def main(): from lyricli.console import main main() if __name__ == "__main__": main()
python
import nextcord from util.mongo import Document class afk_utils: def __init__(self, bot): self.db = bot.db self.afk_db = Document(self.db, "afk_user_db") async def create_afk(self, user, guild_id, reason): dict = { "_id" : user.id, "guild_id" : guild_id...
python
from .core.serializers import *
python
# firstline # Foo header content # Foo foo foo foo foo foo foo foo foo foo foo foo foo # Foo foo foo foo foo foo foo foo foo foo foo foo foo # Foo foo foo foo foo foo foo foo foo foo foo foo foo # Foo foo foo foo foo foo foo foo foo foo foo foo foo # Foo foo foo foo foo foo foo foo foo foo foo foo foo # Foo foo foo fo...
python
from app.schemas.game_schema import Positions, Action from .action_handler import ActionHandler class MoveActionHandler(ActionHandler): @property def activity_text(self): return f"{self.player} moved" def execute(self): move_where = self.payload.move_where player_position = self.g...
python
import logging import os import re from scanapi.errors import BadConfigurationError from scanapi.evaluators.code_evaluator import CodeEvaluator logger = logging.getLogger(__name__) class StringEvaluator: variable_pattern = re.compile( r"(?P<something_before>\w*)(?P<start>\${)(?P<variable>[\w|-]*)(?P<end...
python
""" A small tool to resize all Frames in a ByteBlower GUI project. """ import sys import lxml.etree as ET import random if len(sys.argv) != 4: print('Expected 2 arguments: <src bbp> <target bpp> <new frame size>') sys.exit(-1) filename = sys.argv[1] target_name = sys.argv[2] try: new_size = int(sys.a...
python
# This Source Code Form is subject to the terms of the MIT # License. If a copy of the same was not distributed with this # file, You can obtain one at # https://github.com/akhilpandey95/altpred/blob/master/LICENSE. import sys import json import certifi import urllib3 import requests import numpy as np import pandas a...
python
#!/usr/bin/env python import os, sys, json, re, shutil from utils.queryBuilder import postQuery def prep_inputs(ml_dir, ctx_file, in_file): # get context with open(ctx_file) as f: j = json.load(f) # get kwargs kwargs = j #mstarch - with containerization, "kwargs" are in context at top level...
python
#Faça um programa que leia nome e peso de várias pessoas, guardando #tudo em uma lista. No final mostre: #A)- Quantas pessoas foram cadatradas #B)- Uma listagem com as pessoas mais pesadas #C)- Uma listagem com as pessoas mais leves temp = [] pessoas = [] mai = men = 0 while True: temp.append(str(input('Nome: ')))...
python
# -*- coding: utf-8 -*_ # # Copyright (c) 2020, Pureport, Inc. # All Rights Reserved """ The credentials module handles loading, parsing and returning a valid object that can be passed into a :class:`pureport.session.Session` instance to authenticate to the Pureport API. This module will search for credentials in wel...
python
import sublime, sublime_plugin import winreg, subprocess import re from os import path CONEMU = "C:\\Program Files\\ConEmu\\ConEmu64.exe" CONEMUC = "C:\\Program Files\\ConEmu\\ConEmu\\ConEmuC64.exe" try: # can we find ConEmu from App Paths? apps = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\W...
python
""" Created on Sat Mar 09 16:33:01 2020 @author: Pieter Cawood """ from mesa import Model from mesa.time import RandomActivation from mesa.space import MultiGrid from mesa.datacollection import DataCollector from mesa_agents import Parking, Wall, Space, Robot from ta_world import MAPNODETYPES class ...
python
''' Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Input: haystack = "hello", needle = "ll" Output: 2 Example 2: Input: haystack = "aaaaa", needle = "bba" Output: -1 Clarification: What should we return when needle is an empty...
python
import requests from bs4 import BeautifulSoup as bs import pandas as pd players_image_urls = [] url = 'https://www.pro-football-reference.com/players/' headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0'} page = requests.get(url,headers=headers, timeout=2, allow_r...
python
import pytest from ethdata import ethdata class TestAccountSetters(object): def test_setter_1_address(self): my_account = ethdata.Account("0x1cB424cB77B19143825004d0bd0a4BEE2c5e91A8") assert my_account.address == "0x1cb424cb77b19143825004d0bd0a4bee2c5e91a8" with pytest.raises(ValueError): ...
python
import struct from binascii import b2a_hex, a2b_hex from pymodbus.exceptions import ModbusIOException from pymodbus.utilities import checkLRC, computeLRC from pymodbus.framer import ModbusFramer, FRAME_HEADER, BYTE_ORDER ASCII_FRAME_HEADER = BYTE_ORDER + FRAME_HEADER # ----------------------------------------------...
python
# # Copyright (c) nexB Inc. and others. # SPDX-License-Identifier: Apache-2.0 # # Visit https://aboutcode.org and https://github.com/nexB/ for support and download. # ScanCode is a trademark of nexB Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
python
b='You Yi Xue Sa Xu Li Li Yuan Dui Huo Sha Leng Pou Hu Guo Bu Rui Wei Sou An Yu Xiang Heng Yang Xiao Yao Fan Bi Ci Heng Tao Liu Fei Zhu Tou Xi Zan Yi Dou Yuan Jiu Zai Bo Ti Ying Tou Yi Nian Shao Ben Gou Ban Mo Gai En She Caan Zhi Yang Jian Yuan Shui Ti Wei Xun Zhi Yi Ren Shi Hu Ne Ye Jian Sui Ying Bao Hu Hu Ye Yang Li...
python
import json from rest_framework.test import APITestCase from django.urls import reverse from rest_framework import status from django.contrib.auth import get_user_model from authors.apps.articles.models import Articles from authors.apps.profiles.models import Profile class TestGetEndpoint(APITestCase): def set...
python
from sympy import Wild, Indexed from contextlib import contextmanager class DestructuringError(ValueError): ''' Represent an error due to the impossibility to destructure a given term. At the present, we neither provide meaningful error messages nor objects related to the context in which this excep...
python
""" **download.py** A commandline utility to retrieve test data from https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/ for use in evaluating LSAnamoly. **usage**: download.py [-h] --params YML_PARAMS --data-dir DATA_DIR [--sc-url SC_URL] [--mc-url MC_URL] Retrieve datasets for LsAnomaly evaluation. By def...
python
#!/usr/bin/env python # encoding: utf-8 from __future__ import unicode_literals from queries import SparqlQuery class event_precis(SparqlQuery): """ """ def __init__(self, *args, **kwargs): super(event_precis, self).__init__(*args, **kwargs) self.query_title = 'Get event precis' ...
python
# -*- coding: utf-8 -*- # Copyright 2021 the HERA Project # Licensed under the MIT License import pytest import glob from pyuvdata import UVData from pyuvdata import UVCal from ..data import DATA_PATH from .. import chunker from hera_qm.utils import apply_yaml_flags import numpy as np import sys def test_chunk_data_...
python
import argparse import codecs import json import math import os.path import numpy as np import tensorflow as tf __all__ = ["create_default_hyperparams", "load_hyperparams", "generate_search_lookup", "search_hyperparams", "create_hyperparams_file"] def create_default_hyperparams(config_type): """create...
python
from fractions import Fraction def isPointinPolygon(pointlist, rangelist):#射线法先判断点是否在大多边形里面 # 判断是否在外包矩形内,如果不在,直接返回false xlist = []#装大多边形的点的横坐标 ylist = []#装大多边形的点的纵坐标 for i in range(len(rangelist)-1): xlist.append(rangelist[i][0]) ylist.append(rangelist[i][1]) maxx = max(xlist) m...
python
#!/usr/bin/env python # -*- coding: utf-8 -*- # ============================================================================= # Ural URL Extraction Unit Tests # ============================================================================= from ural import urls_from_text TEXT = """Facial-recognition technology is advan...
python
"""Train the ASR model. Tested with Python 3.5, 3.6 and 3.7. No Python 2 compatibility is being provided. """ import time import tensorflow as tf from asr.input_functions import input_fn_generator from asr.model import CTCModel from asr.params import FLAGS, get_parameters from asr.util import storage RANDOM_SEED =...
python
from typing import List, Union from datetime import datetime from mongoengine import * from regex import F class Prediction(Document): """ The GFI prediction result for an open issue. This collection will be updated periodically and used by backend and bot for GFI recommendation. Attributes: ...
python
def func(a): return a + 1 ls = [func(a) for a in range(10)]
python
from lxml import etree from re import search class Response: @classmethod def resultDict(cls, strResult): responseGroup = search("\<RetornoXML>(.*)\</Retorno", strResult).group(1) res = {} root = etree.fromstring(responseGroup) for i in root.iter(): text = i.text ...
python
import requests from configparser import ConfigParser import pandas as pd from ipywidgets import widgets, interact from IPython.display import display from .appconfig import AppConfig from abc import ABC, abstractmethod class widget_container: def __init__(self, **wlist): interact(self.on_change, **wlist...
python
# -*- coding:utf-8 -*- from DLtorch.trainer.base import BaseTrainer from DLtorch.trainer.CNNTrainer import CNNTrainer
python
import pytest from rest_framework import status from rest_framework.reverse import reverse from .factories import JsonFactory pytestmark = pytest.mark.django_db @pytest.fixture def sample_json(box): return JsonFactory(box=box, data={"key": "value", "lol": {"name": "hue", "age": 1}}) @pytest.mark.parametrize("...
python
import logging import logging.config from decimal import Decimal from pprint import pformat import time from sqlalchemy import Column, String from sqlalchemy.orm import relationship from trader.exchange.abstract_book import AbstractBook from trader.exchange.order import Order import config from trader.database.manage...
python
# coding=utf-8 # *** WARNING: this file was generated by Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import _utilities from . im...
python
import typing from uuid import uuid4 from pydantic import BaseModel IdentifierType = typing.NewType("IdentifierType", str) def create_identifier() -> IdentifierType: """Create an identifier""" return IdentifierType(str(uuid4())) class EmptyModel(BaseModel): pass OffsetVector = typing.Tuple[float, fl...
python
import os, re import pandas as pd path = os.getcwd() files = os.listdir('C:/Users/Richard/Desktop/Database/嘉南AD_20200317') #print(files) files_xls = [f for f in files if f[-4:] == 'xlsx'] #print(files_xls) df = pd.DataFrame() for f in files_xls: data = pd.read_excel('C:/Users/Richard/Desktop/Database/嘉南AD_20200...
python
def main(): #Lets Create the test dataset to build our tree dataset = {'Name':['Person 1','Person 2','Person 3','Person 4','Person 5','Person 6','Person 7','Person 8','Person 9','Person 10'], 'Salary':['Low','Med','Med','Med','Med','High','Low','High','Med','Low'], 'Sex':['Male','Male'...
python
from django.db import models from django.conf import settings class Post(models.Model): ip = models.CharField(max_length=50) idUser = models.CharField(max_length=250) idClick = models.CharField(max_length=250, primary_key=True) classe = models.CharField(max_length=50) texto = models.TextField(max_l...
python
from typing import Optional from botocore.client import BaseClient from typing import Dict from botocore.paginate import Paginator from botocore.waiter import Waiter from typing import Union from typing import List class Client(BaseClient): def associate_node(self, ServerName: str, NodeName: str, EngineAttributes...
python
import media import fresh_tomatoes # Create movie instance for Toy Story john_wick = media.Movie("John Wick", "An ex-hitman comes out of retirement to track down the gangsters that took everything from him.", "https://upload.wikimedia.org/wikipedia/en/9/98/John_Wick_Teas...
python
import pickle mv_grade = [0]*17771 for i in range(18): with open('temgrade/'+str(i)+'_tem_grade', 'rb') as tf: c = pickle.load(tf) for (mi, grade) in c.items(): mv_grade[int(mi)] = float(grade) print str(i)+ " DONE!" with open('movie_grade.list', 'wb') as mg: pickle.dump(mv_grade, mg)
python
import json # alias # bind # bind # bind def loadCommand(data): return command(data[0], data[1], data[2]) def loadBind(data, key): return bind(loadCommand(data[0]), key, data[1], data[2]) def loadBKey(data, base=None): b = bKey(data[0], base) for i in data[1]: loadBind(i, b) return b ...
python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Collect the occupancy dataset. See the README file for more information. Author: G.J.J. van den Burg License: This file is part of TCPD, see the top-level LICENSE file. Copyright: 2019, The Alan Turing Institute """ import argparse import clevercsv import hashlib i...
python
""" Test CLI References: * https://click.palletsprojects.com/en/7.x/testing/ ToDo: expand cli testing """ from __future__ import annotations from typing import Any from click.testing import CliRunner from pytest_mock import MockFixture from alsek import __version__ def test_version( cli...
python
# -*- coding: utf-8 -*- from __future__ import unicode_literals import tablib import pytz from datetime import datetime from decimal import Decimal, InvalidOperation from django.db.utils import IntegrityError from django.core.management.base import BaseCommand from django.utils import timezone from ...models impor...
python
# -*- coding: utf-8 -*- from .eg import eg_hierarchy
python
"""Dahua package constants""" __version__ = '0.0.2-2' __author__ = "Alexander Ryazanov <alryaz@xavux.com>" from .device import * from .channel import *
python
import pygame from settings import * class Tile(pygame.sprite.Sprite): def __init__(self, pos, groups): super().__init__(groups) self.image = pygame.image.load('assets/rock.png').convert_alpha() self.rect = self.image.get_rect(topleft = pos)
python
#id name color ## Cityscapes, kiti, vkiti CITYSCAPES_LABELS = \ [[ 0 , 'unlabeled' , ( 0, 0, 0)], [ 1 , 'ego vehicle' , ( 0, 0, 0)], [ 2 , 'rectification border' , ( 0, 0, 0)], [ 3 , 'out of roi' , ( 0, 0, 0)], [ 4 , 'static' , ( 0, ...
python
"""FastApi Backend for my Portfolio Website. This doesn't have much purpose currently, but eventually I want to use this backend to interact with various Python-based projects I develop. """
python
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
python
# Generated by Django 2.2.5 on 2019-09-25 16:34 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('backend', '0002_squarefootlayout'), ] operations = [ migrations.AddField( model_name='squarefootlayout', name='fill_...
python
from __future__ import absolute_import, division, print_function from stripe.api_resources.abstract import APIResource class Mandate(APIResource): OBJECT_NAME = "mandate"
python
from django.contrib.auth import logout, authenticate, login from django.core.checks import messages from django.shortcuts import render, redirect from requests import auth from django.contrib.auth.models import User, auth from hotels.models import Reservation from .forms import * # Create your views here. def log(req...
python
# -*- Mode: Python; tab-width: 8; indent-tabs-mode: nil; python-indent-offset:4 -*- # vim:set et sts=4 ts=4 tw=80: # This Source Code Form is subject to the terms of the MIT License. # If a copy of the ML was not distributed with this # file, You can obtain one at https://opensource.org/licenses/MIT # author: JackRed ...
python
# Test MQTT and Async # 10 second button monitor from machine import Pin import pycom import time import uasyncio as asyncio from my_mqtt import MyMqtt pycom.heartbeat(False) class RGB: def __init__(self): self.colour = 0x000000 def set(self, colour): self.colour = colour pycom.rgble...
python
#Sobreira Gustavo #Falta u, placar e repetições from random import randint def criar_tabuleiro(): #Cria a matriz para o jogo for l in range(3): linha = [] for c in range(3): linha.append('🟫') campo.append(linha) def enumerar_colunas(): print(' COLUNA'...
python
# Copyright 2017-2018, Mohammad Haft-Javaherian. (mh973@cornell.edu). # 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...
python
# Adapted from https://github.com/facebookresearch/fvcore/blob/master/fvcore/nn/precise_bn.py # noqa: E501 # Original licence: Copyright (c) 2019 Facebook, Inc under the Apache License 2.0 # noqa: E501 import logging import time import mmcv import torch from mmcv.parallel import MMDistributedDataParallel from mmcv....
python
from flask import Flask, jsonify import RPi.GPIO as GPIO app = Flask(__name__) @app.route('/off/<int:pin>') def getOff(pin): GPIO.setmode(GPIO.BCM) GPIO.setup(pin, GPIO.OUT) state = GPIO.input(pin) GPIO.output(pin,GPIO.HIGH) return jsonify({'status':'LOW', 'pin_no':pin}) @app.route('/on/<int:pin>...
python
#!/usr/bin/env python3 # -*-encoding: utf-8-*- # author: Valentyn Kofanov from kivy.lang import Builder from kivy.uix.screenmanager import Screen from kivy.uix.boxlayout import BoxLayout from kivy.uix.button import Button from kivy.uix.recycleview import RecycleView Builder.load_file("style.kv") CHATS = ["Alex", "M...
python
from data_exploration import explore_over_time, frame_count, generate_summary_plot from file_contents_gen import get_batches_multi_dir, multi_dir_data_gen import matplotlib.pyplot as plt from keras.models import Sequential from keras.layers.core import Activation, Flatten, Dense, Lambda, Dropout # from tf.keras.laye...
python
def print_title(): print('---------------------------') print(' HELLO WORLD') print('---------------------------') print() def main(): print_title() name_input = input('What is your name? ') print('Hello ' + name_input) if __name__ == '__main__': main()
python
#!/usr/bin/python3 """ Module for the function to_json_string(my_obj) that returns the JSON representation of an object (string). """ import json def to_json_string(my_obj): """ Function that returns the JSON representation of an object. Args: my_obj (str): Surce object Returns: JSON...
python
from rest_framework import status from rest_framework.decorators import api_view, permission_classes from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from apps.evaluation.serializers.monthlyMeliaEvaluationSerliazer import MonthlyMeliaEvaluationSerliazer from apps.hote...
python
from json import loads from fastapi.testclient import TestClient from os.path import abspath, dirname, join from main import app class TestTopicsCRUDAsync: def test_bearer_token(self): client = TestClient(app) # Please create new user with the "credentials.json" info with open(join(dirname...
python
from RecSearch.DataWorkers.Abstract import DataWorkers from RecSearch.ExperimentSupport.ExperimentData import ExperimentData import pandas as pd class Metrics(DataWorkers): """ Metric class adds metric data. """ # Configs inline with [[NAME]] @classmethod def set_config(cls): additiona...
python
#!/usr/bin/env python # coding: utf-8 import logging import os import glob import pickle import os.path from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request from apiclient.http import MediaFileUpload DIRECTORY = '/upload'...
python
# -*- coding: utf-8 -*- # Copyright (c) 2012 Wu Tangsheng(lanbaba) <wuts73@gmail.com> # 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 r...
python
import os import midinormalizer from mido import MidiFile, MetaMessage from MusicRoll import * def iter_midis_in_path(folder_path): for root, dirs, files in os.walk(folder_path): for file in files: if file.endswith(".mid") or file.endswith(".MID"): yield (os.path.join(root, file), file) def perform(path): ...
python
from ekstep_data_pipelines.audio_transcription.transcription_sanitizers import ( BaseTranscriptionSanitizer, ) from ekstep_data_pipelines.common.utils import get_logger LOGGER = get_logger("GujratiTranscriptionSanitizer") class GujratiSanitizer(BaseTranscriptionSanitizer): @staticmethod def get_instance(...
python
from nose.plugins.attrib import attr from gilda import ground from indra.sources import hypothesis from indra.sources import trips from indra.statements import * from indra.sources.hypothesis.processor import HypothesisProcessor, \ parse_context_entry, parse_grounding_entry, get_text_refs from indra.sources.hypothe...
python
from __future__ import absolute_import, print_function, unicode_literals from xml.dom.minidom import parseString from jinja2 import Template from .forward_parameter import ForwardParametersAction from .interface import Action from .multi_action import MultiAction _SYNC_DESCRIPTION_TEMPLATE = Template(""" <hudson...
python
# -*- coding: UTF-8 -*- from __future__ import unicode_literals import attr from string import Formatter from ._core import Enum class EmojiSize(Enum): """Used to specify the size of a sent emoji""" LARGE = "369239383222810" MEDIUM = "369239343222814" SMALL = "369239263222822" class MessageReactio...
python
from distutils.core import setup from setuptools import setup setup( name='pyflask', version='1.0', author='liuwill', author_email='liuwill@live.com', url='http://www.liuwill.com', install_requires=[ 'flask>=0.12.1', 'Flask-SocketIO>=2.8.6', 'Flask-Cors>=3.0.2', ...
python
import torch import torch.nn as nn class DEM(nn.Module): def __init__(self, channel): """ Detail Emphasis Module """ super(DEM, self).__init__() self.conv1 = nn.Sequential(nn.ReflectionPad2d(1), nn.Conv2d(channel, channel, kernel_size=3, ...
python
# encoding: utf-8 """ test.py """ import sys def data_from_body(body): if sys.version_info[0] < 3: return ''.join(chr(_) for _ in body) # python3 return bytes(body)
python
def spring_summer(): #봄, 여름 함수 global soils global trees dead_trees = [[[] for _ in range(N)] for _ in range(N)] for i in range(N): for j in range(N): trees[i][j].sort() for idx in range(len((trees[i][j]))): if soils[i][j]>= trees[i][j][idx]: ...
python
# -*- coding: utf-8 -*- from __future__ import division, print_function # coding=utf-8 import sys import os import glob import re import numpy as np import pandas as pd import cv2 import tensorflow as tf # Flask utils from flask import Flask, redirect, url_for, request, render_template from werkzeug.ut...
python
from __future__ import print_function import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import math ## PyTorch implementation of CDCK2, CDCK5, CDCK6, speaker classifier models # CDCK2: base model from the paper 'Representation Learning with Contra...
python
from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer from sqlalchemy.orm import sessionmaker engine = create_engine("sqlite:///tmp.db") Base = declarative_base() class Signature(Base): __tablename__ = "signature" X = Column(Intege...
python
#!/usr/bin/python3 from lib.utility.SystemUtility import * from lib.utility.SessionUtility import * from lib.utility.DocumentUtility import * from lib.utility.CustomJSONEncoder import *
python
import asyncio import aiohttp from asynctest import TestCase from asynctest.mock import CoroutineMock from asgard.backends.chronos.impl import ChronosScheduledJobsBackend from asgard.clients.chronos import ChronosClient from asgard.conf import settings from asgard.http.client import http_client from asgard.models.acc...
python
#!/usr/bin/env python import logging import os import string import sys import yaml from glob import iglob import django from foia_hub.models import Agency, Office, Stats, ReadingRoomUrls django.setup() logger = logging.getLogger(__name__) def check_urls(agency_url, row, field): # Because only some rows have ...
python
import logging from re import search from flask import Blueprint from flask_restful import Api from com_cheese_api.cmm.hom.home import Home from com_cheese_api.usr.user.resource.user import User, Users from com_cheese_api.usr.user.resource.login import Login from com_cheese_api.usr.user.resource.signup import SignUp ...
python
from unicon.plugins.iosxe import IosXEServiceList, IosXESingleRpConnection from .settings import IosXEIec3400Settings from . import service_implementation as svc from .statemachine import IosXEIec3400SingleRpStateMachine class IosXEIec3400ServiceList(IosXEServiceList): def __init__(self): super().__init...
python
from typing import Any, Iterable, Optional, TypeVar from reactivex import Observable, abc from reactivex.disposable import ( CompositeDisposable, Disposable, SerialDisposable, SingleAssignmentDisposable, ) from reactivex.scheduler import CurrentThreadScheduler _T = TypeVar("_T") def catch_with_itera...
python
from __future__ import division import sys, time, csv, h2o import pandas as pd import numpy as np arg = sys.argv print "Running script:", sys.argv[0] arg = sys.argv[1:] print "Arguments passed to script:", arg load_data_fp = arg[0] saving_meanImputed_fp = arg[1] saving_modelImputed_fp = arg[2] saving_means_fp = arg[3]...
python
import hashlib from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QMessageBox from Model.Register import Register from Model.Values import Values from Model.dataUtils import sqlconn class Login_Window(QtWidgets.QMainWindow): def __init__(self, gui, reg): ...
python
#!/bin/envrun import z3 import circ as ci print("z3------") # XOR test case # (A + B)* ~(AB) x = z3.Bool('x') y = z3.Bool('y') expr = z3.And( # 'z' z3.Or(x, y), z3.Not(z3.And(x, y)) ) print(expr) print("internal-------") ix, iy = ci.In(), ci.In() #ox = ci.Out() xor = ci.Circuit.fromRAW( ci.And( ...
python
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import csv import io import logging import os.path as op import re import math import random import string from typing import Dict, List, Opti...
python
from pyrogram import filters from pyrogram.types import Message from megumin import megux, Config from megumin.utils import get_collection from megumin.utils.decorators import input_str LOCK_TYPES = ["audio", "link", "video"] @megux.on_message(filters.command("lock", Config.TRIGGER)) async def lock(c: megux, m: ...
python
import yaml import collections # Ordered loading of dictionary items in yaml files # Taken from: SO link: /questions/5121931/in-python-how-can-you-load-yaml-mappings-as-ordereddicts def yaml_ordered_load(fp): class OrderedLoader(yaml.Loader): pass def construct_mapping(loader, node): loader.f...
python
""" Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. SPDX-License-Identifier: Apache-2.0 OR MIT Unit tests for ly_test_tools._internal.pytest_plugin.terminal_report """ import os import pytest import unittest.mo...
python
import platform from datetime import datetime from typing import Optional import discord from discord.ext import commands class Stats(commands.Cog): def __init__(self, bot): self.bot = bot @commands.Cog.listener() async def on_ready(self): print(f"{self.__class__.__name__} Cog has been l...
python
import urllib.request import sys import chardet from html.parser import HTMLParser from datetime import datetime pikabuUrl = 'http://pikabu.ru/top50_comm.php' startTag = 'profile_commented' endTag = 'b-sidebar-sticky' newsTag = 'a' classTag = 'class' headers = [] links = [] class MyHTMLParser(HTMLParser): def __...
python
""" Recipes available to data with tags ['F2', 'IMAGE', 'CAL', 'FLAT'] Default is "makeProcessedFlat". """ recipe_tags = {'F2', 'IMAGE', 'CAL', 'FLAT'} # TODO: This recipe needs serious fixing to be made meaningful to the user. def makeProcessedFlat(p): """ This recipe calls a selection primitive, since K-band...
python
""" Notifications -------------------------------------------- .. NOTE:: Coming soon 🛠 """
python