content stringlengths 5 1.05M |
|---|
# coding: utf-8
import pandas as pd
import pysam
import argparse
import sys
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_context('talk')
# Group SAG reads into groups:
# 1. Reads that map to both SAG and MAG x
# 2. Reads that map to MAG but not to SAG x
# 3. Reads that map to metag... |
import itertools
from collections import Counter
def create_vocab(corpus, vocab_size=5000, extra_tokens=None):
if isinstance(corpus[0], list):
corpus = itertools.chain.from_iterable(corpus)
freq = Counter(corpus)
if extra_tokens is None:
extra_tokens = []
take = min(vocab_size, len(fre... |
"""
The main portion of this code was taken from OpenAI Gym and it is licensed under the following license:
The MIT License
Copyright (c) 2016 OpenAI (https://openai.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),... |
from tortoise.models import Model
from tortoise import fields
import nanopy
class Account(Model):
wallet = fields.ForeignKeyField('db.Wallet', on_delete=fields.CASCADE, related_name='accounts', index=True)
address = fields.CharField(max_length=65)
account_index = fields.IntField()
work = fields.Boole... |
from datapublic.common_fields import CommonFields
from libs import pipeline
from libs.datasets.sources import cdc_testing_dataset
from tests import test_helpers
def test_cdc_testing_modify_dataset():
region_dc_county = pipeline.Region.from_fips("11001")
region_dc_state = pipeline.Region.from_state("DC")
... |
# -*- coding: utf-8 -*-
import os
try:
from setuptools import setup, find_packages
from setuptools.command import easy_install
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from setuptools.command import easy_install
def r... |
from __future__ import print_function
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.rcParams["font.family"] = "serif"
plt.rcParams["mathtext.fontset"] = "cm"
from orphics import maps,io,cosmology,stats
from pixell import enmap
import numpy as np
import os,sys
from soapack import interfaces... |
# encoding: utf-8
# module System.Net.Security calls itself Security
# from System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
# by generator 1.145
# no doc
# no imports
# no functions
# classes
class AuthenticatedStream(Stream, IDisposable):
""" Provides methods for passing cred... |
# Copyright (C) 2017 SignalFx, Inc. All rights reserved.
name = 'signalfx_serverless_common'
version = '0.1.1.1'
user_agent = 'signalfx_serverless_common/' + version
|
import torch
# =================================== #
# Initializing Tensor #
# =================================== #
device = "cuda" if torch.cuda.is_available() else "cpu"
my_tensor = torch.tensor(
[[1, 2, 3], [4, 5, 6]], dtype=torch.float32, device=device, requires_grad=True
)
print(my_tensor)
... |
from django.apps import AppConfig
class MusicplayersettingConfig(AppConfig):
name = 'musicplayersetting'
|
from rest_framework import serializers
from .models import (
User,
Status,
Friend
)
class UserSerializer(serializers.ModelSerializer):
code = serializers.CharField(max_length=6)
class Meta:
model = User
fields = ('username', 'email', 'password', 'code')
write_only_fields =... |
import tensorflow as tf
import numpy as np
class ModelRNN:
def __init__(self, model,batch_size, seq_length, learning_rate, rnn_size, net_layer, datatype, session):
self.model = model
#you can read more about these models on main.py
if model == 'simple lstm':
hi... |
# Generated by Django 3.2.4 on 2021-06-09 04:06
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('profiles', '0007_client_client_of'),
]
operations = [
migrations.AddField(
model_name='message',
... |
#configuration for pywikibot
import pywikibot
#connect to the wikibase
wikibase = pywikibot.Site("my", "my")
wikibase_repo = wikibase.data_repository()
wikibase_repo.login()
#connect to wikidata
wikidata = pywikibot.Site("wikidata", "wikidata")
wikidata_repo = wikidata.data_repository()
from util.util import Wikibas... |
from hts._t import Model
from hts.model.ar import AutoArimaModel, SarimaxModel
from hts.model.es import HoltWintersModel
from hts.model.p import FBProphetModel
__all__ = ['AutoArimaModel',
'SarimaxModel',
'HoltWintersModel',
'FBProphetModel',
'MODEL_MAPPING']
MODEL_MAPPIN... |
#Modules
import os
import csv
election = "Desktop/Bootcamp/Homework/HW 2/python-challenge/PyPoll/Resources/election_data.csv"
#Set file path
csvpath = os.path.join("Resources","election_data.csv")
#Define Variables
votes_tot = 0
cand_rec_vote = 0
percent_vote = 0
#Set empty dictionary
candidates = {}
#Open CSV
wit... |
from kalyke.client import VoIPClient
client = VoIPClient(
auth_key_filepath="/path/to/YOUR_VOIP_CERTIFICATE.pem", bundle_id="com.example.App.voip", use_sandbox=True
)
alert = {"key": "value"}
# Send single VoIP notification
registration_id = "a8a799ba6c21e0795b07b577b562b8537418570c0fb8f7a64dca5a86a5a3b500"
re... |
def get_type_of_drink(age):
if age in range(14):
return 'toddy'
elif age in range(14, 18):
return 'coke'
elif age in range(18, 21):
return 'beer'
return 'whisky'
years = int(input())
drink = get_type_of_drink(years)
print(f'drink {drink}')
|
import unittest
import threading
from watsor.stream.sync import State, StateLatch, CountDownLatch
class TestSync(unittest.TestCase):
def test_count_down_latch(self):
def count_down(_latch: CountDownLatch):
_latch.count_down()
count = 4
latch = CountDownLatch(count)
se... |
from mock import patch
import pytest
def test_unsupported_system():
from fabtools.system import UnsupportedFamily
with pytest.raises(UnsupportedFamily) as excinfo:
with patch('fabtools.system.distrib_id') as mock_distrib_id:
mock_distrib_id.return_value = 'foo'
raise Unsup... |
from math import sqrt
numero = int(input('Insira um número: '))
print(f'\nResultado'
f'\nDobro: {numero * 2}'
f'\nTriplo: {numero * 3}'
f'\nRaiz: {sqrt(numero)}')
|
import os
from . import base
from . import data
REMOTE_REFS_BASE = 'refs/heads/'
LOCAL_REFS_BASE = 'refs/remote/'
def fetch(remote_path):
# Get refs from server
refs = _get_remote_refs(remote_path, REMOTE_REFS_BASE)
# Fetch missing objects by iterating and fetching on demand
for oid in base.iter_o... |
"""
Open a DICOM folder and update display.
"""
def main(weasel):
weasel.open_dicom_folder()
|
import argparse
import shutil
import os
import sys
import re
import stat
from datetime import datetime
# default values for test
dtargetDirectory = './'
dtitle = './postgen-posts'
# initialize argument parser
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('--dest', '-d', de... |
__author__ = 'ryanrozewski'
import numpy as np
import pandas as pd
from pandas import DataFrame
from Scheduler import Scheduler
from parameters import xR,simNumber,trim_start,trim_end,t_step,x0Vas,start,referenceDate,fee
from MonteCarloSimulators.Vasicek.vasicekMCSim import MC_Vasicek_Sim
from Curves.Corporates.Corpora... |
#!/usr/bin/env python
__author__ = 'Will Kamp'
__copyright__ = 'Copyright 2013, Matrix Mariner Inc.'
__license__ = 'BSD'
__email__ = 'will@mxmariner.com'
__status__ = 'Development' # 'Prototype', 'Development', or 'Production'
'''Scans the header portion of a BSB nautical chart, extracts data and offers
convenien... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
import sys
import string
import hashlib
from getpass import getpass
__all__ = ['untrusted']
ALPHABET = string.digits + string.ascii_letters
def clip_copy(text):
import pyperclip
... |
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from .transaction import transaction
def get_request():
"""Get request object from any location of code."""
return getattr(transaction.ctx, 'request', None)
class VersioningMiddleware(object):
"""Middleware that sa... |
"""user_remove_roles
Revision ID: 4c6ca48245be
Revises: d5b5eb2e8dd0
Create Date: 2021-03-08 11:37:13.600415
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '4c6ca48245be'
down_revision = 'd5b5eb2e8dd0'
branch_labels = None
depends_on = None
def upgrade():
... |
import sys
from torch.nn import Module
from torch import Tensor
from torchvision.transforms import *
from torch.optim.optimizer import Optimizer
from torch.utils.data.dataloader import DataLoader
from torch.optim.lr_scheduler import _LRScheduler
from pathlib import PosixPath
from typing import (List, Any, Union, Dict,... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dfirtrack_config', '0004_dfirtrack_default_config'),
]
operations = [
migrations.RemoveField(
model_name='artifactexporterspreadsheetxlsconfigmodel',
name='artifactl... |
from os import listdir, mkdir
from os.path import isfile, join, exists, isdir
from sys import exit
import shutil
from tinytag import TinyTag
import re
from ..utils.fileutils import ensure_folder_existence, move_file
from ..spotify.spotifyapimanager import SpotifyApiManager
from ..utils.musicfiles import is_valid_music_... |
"""
pygame-menu
https://github.com/ppizarror/pygame-menu
SCROLLAREA
ScrollArea class to manage scrolling in Menu.
"""
__all__ = [
# Main class
'ScrollArea',
# Utils
'get_scrollbars_from_position'
]
import pygame
import pygame_menu
from pygame_menu._base import Base
from pygame_menu._decorator imp... |
import io
import threading
import time
import unittest.mock
import utils
class Foo:
def __init__(self):
self.first_passed = threading.Event()
self.second_passed = threading.Event()
def first(self, printFirst):
printFirst()
self.first_passed.set()
def second(self, printSe... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import numpy as np
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
plt.style.use('ggplot')
import seaborn as sns
blue = '#... |
#
# Constant current "function"
#
import pybamm
class GetConstantCurrent(pybamm.GetCurrent):
"""
Sets a constant input current for a simulation.
Parameters
----------
current : :class:`pybamm.Symbol` or float
The size of the current in Amperes.
**Extends:"": :class:`pybamm.GetCurrent... |
# -*- coding: utf-8 -*-
# TensowFlowのインポート
import tensorflow as tf
# MNISTを読み込むためinput_data.pyを同じディレクトリに置きインポートする
# input_data.pyはチュートリアル内にリンクがあるのでそこから取得する
# https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/examples/tutorials/mnist/input_data.py
import input_data
import time
# 開始時刻
start_time = tim... |
# Generated by Django 3.1.4 on 2021-01-17 15:22
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ListModel',
fields=[
('id', models.AutoFiel... |
class Way:
def __init__(self, idNum):
self.name = None
self.id = idNum
self.nodes = []
self.tags = dict()
self.is_one_way = False
def __repr__(self):
print_val = self.name
if self.is_one_way:
print_val += " (1W)"
print_val += " - " + s... |
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 27 13:04:39 2022
@author: ashrith
"""
import numpy as np
import torch
import torchvision
import matplotlib.pyplot as plt
from time import time
from torchvision import datasets, transforms
from torch import nn, optim
"""
Defining a function
"""
... |
import subprocess, os, fnmatch, time, datetime, argparse
from natsort import natsorted, ns
parser = argparse.ArgumentParser(description='PyTorch Super Res Example Batch Processer')
parser.add_argument('--image', type=str, required=True, help="Path of Image you want to process")
parser.add_argument('--output_filen... |
import pickle
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits import mplot3d
def estimate_coef(x, y):
n = np.size(x)
m_x, m_y = np.mean(x), np.mean(y)
SS_xy = np.sum(y * x) - n * m_y * m_x
SS_xx = np.sum(x * x) - n * m_x * m_x
b_1 = SS_xy / SS_xx
b_0 = m_y - b_1 * m_x
... |
'''
MIT License
Copyright (c) 2017 Kenth Fagerlund
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, publis... |
from django.db import models
from django.urls import reverse
from django.core.exceptions import ValidationError
from django.contrib.contenttypes.fields import GenericRelation
from django.contrib.postgres.fields import JSONField
from model_utils.models import TimeStampedModel, SoftDeletableModel
from attendees.persons... |
class Solution:
"""
@param pid: the process id
@param ppid: the parent process id
@param kill: a PID you want to kill
@return: a list of PIDs of processes that will be killed in the end
"""
def killProcess(self, pid, ppid, kill):
groupByPPID = {}
index = 0
while inde... |
# import essential package
import torch
from torch.utils.data import DataLoader
from Getdataset import IntelDNADataset
from torch.utils.tensorboard import SummaryWriter
from tqdm.auto import tqdm
# utils
from utils.aligning import bp_align
from utils.embedding import *
from utils.label_embedding import *
from utils.mas... |
import cv2
import numpy as np
def sp_noise_img(image, prob):
'''
添加椒盐噪声
prob:噪声比例
'''
output = np.zeros(image.shape, np.uint8)
thres = 1 - prob
for i in range(image.shape[0]):
for j in range(image.shape[1]):
rdn = np.random.random()
if rdn < prob:
... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.autograd as autograd
from torch.autograd import Variable
from torch.optim import lr_scheduler
from torchvision import transforms
import copy
import numpy as np
import r... |
import os
import numpy as np
import sys
sys.path.append("..")
from util import util,options
from data import dataloader,statistics
from util import array_operation as arr
opt = options.Options()
opt.parser.add_argument('--dels',type=str,default='', help='which domains you want to del, eg. [0,1,2,3,4]')
o... |
from bs4 import BeautifulSoup
import requests
site = requests.get('https://www.climatempo.com.br/').content
soup = BeautifulSoup(site, 'html.parser')
print(soup.prettify())
temperature = soup.find("span", id="current-weather-temperature")
print(temperature.string) |
from aiohttp import web
import aiohttp_jinja2
from util import routes, get_user, login_required, to_objectid
from backend import comments, shares, notifications, friends, history
@routes.get('/share/{comment_id}')
@login_required
@aiohttp_jinja2.template('share.html')
async def share_select(request):
user = await... |
""" Temporary wrappers around cli commands until we agree on a better approach to running LSST. """
import os
import subprocess
import tempfile
from huntsman.drp.core import get_logger
# Default search directory for pipeline files
PIPELINE_DIR = os.path.expandvars("${OBS_HUNTSMAN}/pipelines")
def _run_pipetask_cmd(... |
#!/usr/bin/env python
import pytest
"""
Test 463. Island Perimeter
"""
@pytest.fixture(scope="session")
def init_variables_463():
from src.leetcode_463_island_perimeter import Solution
solution = Solution()
def _init_variables_463():
return solution
yield _init_variables_463
class TestC... |
"""
How to upload
python setup.py clean sdist bdist_wheel
twine upload dist/*
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
HERE = path.abspath(path.dirname(__file__))
with open(path.join(HERE, '... |
#!/usr/bin/env python
import argparse
import datetime
import boto3
import pytz
def repos(client):
paginator = client.get_paginator('describe_repositories')
pages = paginator.paginate(
registryId='308535385114',
)
for page in pages:
for repo in page['repositories']:
yield r... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test Insert de données dans la BDD.
"""
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
import pandas as pd
import datetime as dt
from db import Arret, Vehicule, Ligne, Trajet, Et... |
from __future__ import print_function
import os
import cartopy.crs as ccrs
import cdutil
import matplotlib
import numpy as np
import numpy.ma as ma
from cartopy.mpl.ticker import LatitudeFormatter, LongitudeFormatter
from numpy.polynomial.polynomial import polyfit
from e3sm_diags.derivations.default_regions import r... |
"""This module contains backports to support older Python versions."""
#
# (C) Pywikibot team, 2014-2021
#
# Distributed under the terms of the MIT license.
#
import sys
from typing import Any
PYTHON_VERSION = sys.version_info[:3]
# functools.cache
if PYTHON_VERSION >= (3, 9):
from functools import cache # type:... |
import os
import nltk
import matplotlib.pyplot as plt
from collections import Counter
from datetime import date
def words2lists(filename):
lists = []
file = open(filename, "r", encoding="utf-8")
while True:
line = file.readline().rstrip("\n")
if line:
lists.append(line)
... |
from copy import copy
from dataclasses import dataclass, field, asdict
from math import gcd
from typing import Iterator, Iterable
from tabulate import tabulate
@dataclass()
class Euclid(Iterable):
# Only kept for validation
_a: int = field(init=False)
_b: int = field(init=False)
x: int
y: int
... |
#!/usr/bin/env python
from magpy.stream import *
from magpy.absolutes import *
from magpy.transfer import *
from magpy.database import *
import wx
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wx import NavigationToolbar2Wx
from matplotlib.figure imp... |
def check_power_of_2(val):
"""power of 2 no.s have only a bit set
so, if we subtract 1 from given 2's power val and take & with val
results to zero , so we can say it is power of two
"""
if not val:
# for val == 0
return False
if not val & (val - 1):
return True
... |
def closest_sum(ints, num):
|
from typing import List, Any
from util.helpers import solution_timer
from util.input_helper import read_entire_input
data = read_entire_input(2019,2)
test=["1,9,10,3,2,3,11,0,99,30,40,50"]
def parse(data: List[str]) -> List[int]:
return [int(i) for i in data[0].split(',')]
def run(opcodes):
pointer = 0
#... |
import sys
import signal
import logging
import threading
from time import sleep
from .work_queue import WorkQueue
from .worker import Worker
_logger = logging.getLogger(__name__)
class Manager(object):
'''Manage several worker threads and their shared job work queue.
:param worker_count: number of worker ... |
# -*- coding: utf-8 -*-
import copy
from django.conf import settings
from django_slack.log import SlackExceptionHandler
from django.views.debug import ExceptionReporter
from logging import Handler, CRITICAL, ERROR, WARNING, INFO, FATAL, DEBUG, NOTSET, Formatter
ERROR_COLOR = 'danger' # color name is built in to Sl... |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from contextlib import contextmanager
from datetime import datetime
import os
from webtest.app import AppError
from third_party.testing_utils import testing
... |
# coding=utf-8
import platform
import sys
import sentry_sdk
import wx
import wx.lib.inspection
from cellprofiler_core.preferences import get_telemetry_prompt
from cellprofiler_core.preferences import get_telemetry
from cellprofiler_core.preferences import set_telemetry
from cellprofiler_core.preferences import set_te... |
""" Module with various helpers and constant variables."""
import os
import sys
from datetime import datetime
PATH_DIR_SRC = os.path.dirname(os.path.abspath(sys.modules[__name__].__file__))
PATH_DIR_PROJECT = os.path.abspath(os.path.join(PATH_DIR_SRC, '..'))
def get_current_datetime():
""" Read current date a... |
#Modules
import os
import csv
csvpath = os.path.join('Resources', 'election_data.csv')
with open(csvpath) as csvfile:
#CSV reader specifies delimiter and variable that holds contents
csvreader = csv.reader(csvfile, delimiter=',')
#Read the header row first
csv_header = next(csvreader)
#variables ... |
# Python 3.x compatibility
from __future__ import absolute_import
from six import text_type
from future.utils import iteritems
import os
from unittest import TestCase
from etl_sync.readers import unicode_dic, OGRReader
class TestReaders(TestCase):
"""
Test readers, encoding problems in particular.
"""
... |
import numpy as np
# Constants
BIAS = 1
ITERATIONS = 1000
class MulticlassPreceptron:
''''''
'''
Initializer function to takes the possible classes for the
data set.
'''
def __init__(self, possible_classes):
self.learning_rate = 0.1
self.X_train = None
self.y_train ... |
input_file = open("input.txt", "r")
lines = input_file.read().splitlines() #Read whole file, split by newlines
lines = [int(i) for i in lines]
lines.sort()
lines.append(lines[-1]+3)
lines.insert(0,0)
answer = 1
i = 0
while i in range(len(lines)-4):
print(i, lines[i])
if lines[i]+4 == lines[i+4]:
print... |
from pycspr import serialization
from pycspr.domain.types import CLType, CLTypeInfo, PublicKey
from pycspr.domain.types import CLTypeInfo
from pycspr.types.cl import CLTypeInfo
from pycspr.domain.types import CLTypeInfo
from pycspr.domain.types import CLTypeInfo
from pycspr.domain.types import CLTypeInfo
from pycspr.do... |
# Standard imports
import json
from typing import Dict, Union
# Local imports
from oblivion.constants import (
RSAModulus,
RSAExponent,
)
class RSAKey():
"""Class to represent a RSA Key."""
# pylint: disable=too-many-instance-attributes
kind: str = 'generic'
extension: str = 'json'
def ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 26 15:58:59 2018
@author: lin
"""
from until import *
import numpy as np
import time
import matplotlib.pyplot as plt
#from sklearn import linear_model
from sklearn.metrics import accuracy_score,confusion_matrix,classification_report
data1 = np.load(... |
'''
Library information for RAD-Seq analysis.
'''
import re
import sys
import itertools
import os.path
from glob import glob
from collections import defaultdict
class Library(object):
'''Class for library information'''
def __init__(self, name, lib_dir, r1, r2, barcodes_filename):
self.name = name
... |
class Base1(object):
def __init__(self):
self.str1 = "Geek1"
print("Base1")
class Base2(object):
def __init__(self):
self.str2 = "Geek2"
print("Base2")
class Derived(Base1, Base2):
def __init__(self):
Base1.__init__(self)
Base2.__init__(self)
print("... |
# Import necessary packages
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
class MiniGoogLeNet(nn.Module):
"""
A small and light weight model inspired by Inception architecture
"""
def __init__(self, n_class, size, depth):
super().__init__()
self... |
import os
import sys
from typing import List, Set
from PyQt6.QtCore import QPointF, QStandardPaths, Qt, pyqtSignal
from PyQt6.QtGui import QBrush, QColor, QFileSystemModel, QImage, QPainter, QPainterPath, QPen, QUndoCommand, QUndoStack
from PyQt6.QtPrintSupport import QPrinter
from PyQt6.QtSvg import QSvgGenerator
fro... |
import pymel.core as pm
import logging
import os
log = logging.getLogger("mtcoLogger")
class AboutWindow(pm.ui.Window):
def __init__(self):
self.title = "About"
self.rtf = True
self.initUI()
def initUI(self):
pm.setUITemplate("DefaultTemplate", pushTemplate=Tr... |
import logging
import os
import grpc
from zeebe_grpc.gateway_pb2_grpc import GatewayStub
from pyzeebe.credentials.base_credentials import BaseCredentials
from pyzeebe.exceptions import ZeebeBackPressure, ZeebeGatewayUnavailable, ZeebeInternalError
from pyzeebe.grpc_internals.channel_options import get_channel_options... |
# -*- coding: utf-8 -*-
import os
from configparser import SafeConfigParser, NoSectionError
from logging import getLogger
import re
import appdirs
from .log import modulename
from .__init__ import APPNAME
from . import knownpaths
from .validpath import is_pathname_valid, is_path_exists_or_creatable
log = getLogger(... |
import sys
import os
import pandas as pd
from openpyxl.workbook import Workbook
from ShoppingList_to_excel import ShoppingList_to_excel
from PeopleBalance_to_excel import PeopleBalance_to_excel
from PeoplePayment_to_excel import PeoplePayment_to_excel
from FactsandFigures_to_excel import FactsandFigures_to_excel
fro... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from dataclasses import dataclass
from typing import NamedTuple
import pytest
import que
import que.query
@pytest.fixture
def default_select() -> que.Select:
field = que.Field("foo", "bar")
fylter = que.Filter(field)
select = que.Select(table="foo", schema="... |
"""
File: draw_line.py
Name: Pei-Feng (Kevin) Ma
-------------------------
This program creates lines on an instance of GWindow class.
There is a circle indicating the user’s first click. A line appears
at the condition where the circle disappears as the user clicks
on the canvas for the second time.
"""
fro... |
import pyautogui as py
import os
import time
import pyperclip as pc
save = 1
# ---refreshing the photos---
def re_fresh_photo():
i = 1
# edit
py.moveTo(x=97, y=698)
py.click()
time.sleep(1)
# beautify
py.moveTo(x=39, y=621)
py.click()
time.sleep(2)
# save
py.moveTo(x=29... |
#python3
import pandas as pd
import os
import sys
from urllib import request
from bs4 import BeautifulSoup
from pathlib import Path
def getCarReviews(car):
try:
carUrl = 'https://www.cars.com/research/{}/consumer-reviews/?nr=250'.format(car)
rawPageData = request.urlopen(carUrl).read().decode()
... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
..
---------------------------------------------------------------------
___ __ __ __ ___
/ | \ | \ | \ / the automatic
\__ |__/ |__/ |___| \__ annotation and
\ | | ... |
from mpfit import mpfit
|
"""
vtelem - Common name manipulations.
"""
# built-in
import re
from typing import Type
def class_to_snake(class_obj: Type) -> str:
"""Convert a CamelCase named class to a snake_case String."""
return to_snake(class_obj.__name__)
def to_snake(name: str) -> str:
"""Convert a CamelCase String to snake_... |
from .emoji import emojize
from .emojiset import load_emojiset, emojisets
|
#!python3.6
from string import Template
class MyTemplate(Template):
idpattern = '[a-z]+_[a-z]+' # 英字しか使えなくなる。デフォルトの値は [_a-z][_a-z0-9]*
s = Template('$who0 likes $what0')
print(s.substitute(who0='tim', what0='kung pao'))
#s = MyTemplate('$who likes $what')
#print(s.substitute(who='tim', what='kung pao'))#ValueErro... |
import datetime
import json
from parameterized import parameterized
from api.authenticator import BaseSAMLAuthenticationProvider
from api.proquest.credential import ProQuestCredentialManager, ProQuestCredentialType
from api.saml.metadata.model import (
SAMLAttribute,
SAMLAttributeStatement,
SAMLAttributeT... |
from __future__ import (unicode_literals, print_function, absolute_import,
division)
from ema_workbench import (Model, MultiprocessingEvaluator,
ScalarOutcome, IntegerParameter, optimize, Scenario)
from ema_workbench.em_framework.optimization import EpsilonProgress, ... |
class Solver:
"""
A class that solves the New York Times Spelling Bee
...
Methods
-------
solve(required_letters, optional_letters, word_dict)
Gives all answers to the New York Times Spelling Bee using
the required and optional letters
"""
@staticmethod
def solve(re... |
#!/usr/bin/env python3
import unittest
try:
from .abstract import AbstractTest
except ImportError:
from abstract import AbstractTest
class GeeTest(AbstractTest):
def test_all_params(self):
params = {
'gt' : 'f2ae6cadcf7886856696502e1d55e00c',
... |
"""
Entradas:
nombre ---> str ---> nombre
horas normales trabajadas ---> float ---> horasnt
valor hora normal ---> flotar ---> valorhn
horas extra trabajadas ---> float ---> horaset
numero hijos ---> int ---> hijos
Salidas:
valor horas trabajadas ---> float ---> pht
precio hora extra trabajada ---> float ---> phet
suel... |
"""
An example module for defining a new 'profile model' called 'aNewModel'.
Once you have finished writing this file add it to the import line of
this folder's __init__.py script.
This profile model can then be specified by writing
'newModel_example.aNewModel' on the 'WindProfileType' line of the
TurbSim input (conf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.