content
stringlengths
0
894k
type
stringclasses
2 values
#!/usr/bin/python3 __author__ = "blueShard (ByteDream)" __license__ = "MPL-2.0" __version__ = "1.1" # Startscript um zu check, ob python3, pip3 + alle benötigten externen python3 libraries installiert sind (wenn nicht wird das benötigte nachinstalliert), das danach die main.py startet: """ #!/bin/bash which python3 ...
python
import requests import reconcile.utils.threaded as threaded import reconcile.queries as queries from reconcile.dashdotdb_base import DashdotdbBase, LOG QONTRACT_INTEGRATION = 'dashdotdb-dvo' class DashdotdbDVO(DashdotdbBase): def __init__(self, dry_run, thread_pool_size): super().__init__(dry_run, threa...
python
#coding=utf-8 # # Copyright (C) 2015 24Hours TECH Co., Ltd. All rights reserved. # Created on Mar 21, 2014, by Junn # # from django.utils.translation import ugettext_lazy as _ from django.db import models from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin import settings from managers import ...
python
from harmony_state import harmony_state # this module opens MIDI input can receive MIDI signals from... some port. Which port? Let's see. #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jun 7 10:34:59 2020 @author: johntimothysummers """ import mido from harmony_state import harmony_state fro...
python
import re import os from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request, HtmlResponse from scrapy.utils.response import get_base_url from scrapy.utils.url import urljoin_rfc from urllib import urlencode import hashlib import csv from product_spiders.item...
python
# Generated by Django 3.0.7 on 2020-09-03 13:14 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('Job', '0005_auto_20200903_0602'), ] operations = [ migrations.AddField( model_name='certificates', name='image', ...
python
""" This is meant for loading the definitions from an external file. """ import os.path from .backend import EmptyBackend from .driver import Driver from .errors import CompilerError from .lexer import Lexer from . import symbols from . import types # Since a file isn't going to change in the middle of our run, there...
python
from requests import Session from uuid import uuid4 from base64 import b64encode from hashlib import sha1 from datetime import datetime from adobe_analytics.config import BASE_URL from adobe_analytics.exceptions import ApiError class OmnitureSession: def __init__(self, username=None, secret=None, comp...
python
maximoImpar = int(input("Até que número gostaria de lista os impares?: ")) for x in range(maximoImpar): if x % 2 != 0: print(x)
python
#!/usr/bin/env python """ BA 08 NGA model """ from .utils import * class BA08_nga: """ Class of NGA model of Boore and Atkinson 2008 """ def __init__(self): """ Model initialization """ # 0. Given parameters (period independent parameters) self.a1 = 0.03 # in ...
python
import permstruct import permstruct.dag from permstruct.lib import Permutations def loc_max(w): ''' Helper function for stack-sort and bubble-sort. Returns the index of the maximal element in w. It is assumed that w is non-empty. ''' m = w[0] i = 0 c = 0 for j in w[1:]: c = c+...
python
from Othello.Cell import Cell from .Decorator import Decorator class Decorator_MaximizeOwnDisc(Decorator): def _scoring(self, case): score = {Cell.BLACK: case.blackDisc, Cell.WHITE: case.whiteDisc}[self._discType] return (self._rate * score) + self._agent._scoring(case) def ...
python
#!/usr/bin/env python # Copyright 2013 Netflix, Inc. """Utility classes """ from contextlib import contextmanager import logging import signal import sys class TimeoutError(Exception): """Timeout Error""" pass @contextmanager def timeout(seconds, error_message="Timeout"): """Timeout context manager u...
python
from typing import Any, List from PySide6.QtGui import QColor from PySide6.QtWidgets import QComboBox from .ui import ColorPicker class Optionable: def __init__(self, **options): self.options = options def add_options(self, **options): self.options.update(options) def set_option(self, ...
python
import os from django.conf import settings DEBUG = False TEMPLATE_DEBUG = True DATABASES = settings.DATABASES # Update database configuration with $DATABASE_URL. import dj_database_url # import os # import psycopg2 # import urllib.parse as up # up.uses_netloc.append("postgres") # url = up.urlparse(os.environ["DAT...
python
import os broker_url = os.environ['REDIS_URL'] result_backend = os.environ['REDIS_URL'] broker_transport_options = { 'max_connections': 20 } task_serializer = 'json' result_serializer = 'json' accept_content = ['json'] task_routes = { # '{{cookiecutter.code_name}}.apps.app-name.tasks.*': {'queue': '{{cookiec...
python
#!/usr/bin/env python import numpy as np from scipy.io.matlab import loadmat from sklearn.metrics import pairwise_distances import os _ROOT = os.path.abspath(os.path.dirname(__file__)) lps_neighbor_shifts = { 'a': np.array([ 0, -1, 0]), 'ai': np.array([ 0, -1, -1]), 'as': np.array([ 0, -1, 1]), 'i': np.array([ 0...
python
from post_processing_class import PostProcess from post_processing_class import update_metrics_in_report_json from post_processing_class import read_limits from post_processing_class import check_limits_and_add_to_report_json
python
# -*- coding: utf-8 -*- import random import time import pytest from fixture.application import Application from fixture.orm import ORMFixture from model.contact import Contact from model.group import Group @pytest.mark.skip(reason="XAMPP 8 ver") def test_add_contact_to_group(app: Application, orm: ORMFixture): ...
python
import unittest from collatz import collatz_sequence as collatz class CollatzTestCase(unittest.TestCase): def test_base_case(self): base_case = collatz(1) self.assertListEqual(base_case, [1]) def test_3(self): sequence = collatz(3) self.assertListEqual(sequence, [3, 10, 5, 16,...
python
from django.urls import re_path from . import views app_name = "curator" urlpatterns = [ re_path(r"^upload$", views.UploadSpreadSheet.as_view(), name="upload_file"), ]
python
""" Anisha Kadri 2017 ak4114@ic.ac.uk A Module containing methods to create networks from different models. 1) For pure preferential attachement:- pref_att(N, m) 2) For random attachment:- rand_att(N,m) 3) For a mixture of the two, attachment via random walk:- walk_att(N,m,L) References ---------- [1]...
python
import queue import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement from operator import itemgetter, mul from copy import de...
python
from typing import Dict from .logger import Logger from google.cloud.logging_v2.client import Client from google.cloud.logging_v2.resource import Resource class StackDriverLogger(Logger): def __init__(self, project_id, service_name, region): self.client = Client(project=project_id) self.project_i...
python
import unittest from utils.transliteration import transliterate class TestTransliterate(unittest.TestCase): def test_english_string(self): original = 'The quick brown fox jumps over the lazy dog' result = transliterate(original) self.assertEqual(original, result) def test_english_st...
python
__author__ = 'Gaston C. Hillar' import pyupm_th02 as upmTh02 import pyupm_i2clcd as upmLcd import pyupm_servo as upmServo import time import paho.mqtt.client as mqtt import json class TemperatureServo: def __init__(self, pin): self.servo = upmServo.ES08A(pin) self.servo.setAngle(0) def prin...
python
import time import serial import numpy as np from pytweening import easeInOutQuint, easeOutSine from scipy.misc import derivative from scipy.interpolate import interp1d from raspberryturk.embedded.motion.arm_movement_engine import ArmMovementEngine from .pypose.ax12 import * from .pypose.driver import Driver SERVO_1 =...
python
""" 程式設計練習題 1-6 1-14 Turtle:畫三角形. 撰寫一程式,在螢幕的畫三角形。 """ from turtle import Turtle TURTLE = Turtle() TURTLE.showturtle() TURTLE.right(60) TURTLE.forward(100) TURTLE.right(120) TURTLE.forward(100) TURTLE.right(120) TURTLE.forward(100)
python
# Generated by Django 3.1.1 on 2020-09-18 16:19 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0005_personel'), ] operations = [ migrations.AddField( model_name='crew', name='total_assigments', ...
python
# Generated by Django 3.0.5 on 2020-11-06 16:43 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('qing', '0003_mistakes'), ] operations = [ migrations.AddField( model_name='data', name='data_url', field...
python
# flake8: noqa from .some_function import some_function from .SomeClass import SomeClass from .SomeClass import SOME_CONSTANT from .wrap_min import wrap_min from .wrap_min import MinWrapper
python
# Copyright (c) 2015 OpenStack Foundation. 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 ...
python
# # This file is part of pysnmp software. # # Copyright (c) 2005-2016, Ilya Etingof <ilya@glas.net> # License: http://pysnmp.sf.net/license.html # # PySNMP MIB module SNMP-USM-AES-MIB (http://pysnmp.sf.net) # ASN.1 source file:///usr/share/snmp/mibs/SNMP-USM-AES-MIB.txt # Produced by pysmi-0.0.5 at Sat Sep 19 23:11:55 ...
python
# Generated by Django 2.0.4 on 2018-04-17 05:05 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('blog', '0001_initial'), ...
python
# Generated by Django 3.0.7 on 2020-07-23 07:24 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('disdata', '0021_auto_20200723_0649'), ] operations = [ migrations.AlterField( model_name='disease', name='victim_id'...
python
from math import factorial from collections import Counter import operator from itertools import permutations import math print(round(2.9)) print(abs(-2.9)) # absolute vaue print(math.ceil(2.2)) # the ceiling of a number print(math.floor(9.8)) print(sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1])) print(math.fsum([....
python
from util.orientation import Orientation from util.vec import Vec3 class GameObject: """GameObjects are considered to be all objects that can move on the field. Attributes: location (Vec3): location vector defined by x,y,z coordinates velocity (Vec3): velocity vector with x,y,z components ...
python
#!/usr/bin/env python # -*- coding: utf-8 -*- # The MIT License (MIT) # Copyright (c) 2017 Juan Cabral # 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 withou...
python
def greet(i): console.log(str(i) + " Hello World!") for i in range(8): greet(i)
python
import unittest from pyconductor import * class NewUserTest(unittest.TestCase): def setUp(self): self.preloaded_dict = load_test_values() def test_user_can_run_material_testcase(self): calculate_conductance(self.preloaded_dict["air"]) def test_user_can_add_material_to_materialdict(self...
python
import re from pyingest.config import config class UATURIConverter(): ''' Takes a string containing a comma-separated list of string as input, and converts any that match UAT entities to their UAT:URI_# instead (not including URL). Returns a string consisting of comma-separated keywords/uris. ...
python
from __future__ import annotations from typing import Optional from pydantic.fields import Field from pydantic.types import StrictBool from ..api import BodyParams, EndpointData from ..types_.endpoint import BaseEndpoint from ..types_.inputs import WorkflowCustomField from ..types_.scalar import WorkflowId class W...
python
from app import * keyboard = types.InlineKeyboardMarkup(row_width=1) a = types.InlineKeyboardButton(text=emoji.emojize(":memo: Activate Subscriber", use_aliases=True), callback_data="activate") b = types.InlineKeyboardButton(text=emoji.emojize(":scroll: Send Advertisement", use_aliases=True), callback_data="ad") c = ...
python
import cv2 import numpy as np from imread_from_url import imread_from_url from acvnet import ACVNet resolutions = [(240,320),(320,480),(384,640),(480,640),(544,960),(720,1280)] # Load images left_img = imread_from_url("https://vision.middlebury.edu/stereo/data/scenes2003/newdata/cones/im2.png") right_img = imread_fr...
python
""" Test Models A set of trivial models for PyTests """ import pandas as pd import numpy as np import re class SingleWordModel: def __init__(self, name, colname, myword): self.name = name self.colname = colname self.word = myword def predict(self, x: pd.DataFrame) -> np.ndarr...
python
# -*- coding: utf-8 -*- """ Created on Mon Sep 6 13:24:49 2021 @author: Asus """ import pandas as pd import numpy as np import string import unicodedata import re from functools import reduce def strip_accents(s): return ''.join(c for c in unicodedata.normalize('NFD', s) if unicodedata.category(...
python
''' test_fix.py: Test fix_fusion ''' import os import pysam from utils import check_file from circ.CIRCexplorer import fix_fusion class TestFix(object): def setup(self): ''' Run fix_fusion ''' print('#%s: Start testing fix_fusion' % __name__) ref = 'data/ref.txt' ...
python
import numpy as np import rich from rich import print, pretty pretty.install() ############# from price_model import SimulateGBM from basis_fun import laguerre_polynomials ############## def priceOption(S0, K, r, paths, sd, T, steps, Stock_Matrix,k, reduce_variance = True): steps = int(steps) Stn = Stock_Matri...
python
""" Copyright 2019 Samsung SDS 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 ...
python
#!/usr/bin/env python """The setup script.""" from setuptools import setup, find_packages with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() requirements = ['scikit-learn', 'pandas', 'scipy', 'numpy', 'category_encoder...
python
import copy import weakref import re from django.core import validators from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import force_unicode from django.core.exceptions import FieldError, ValidationError from django.utils.translation import get_language from itertools import izip ...
python
# -*- coding: utf-8 -*- from lantz import Feat, Action, Driver, Q_ from lantz.drivers.ni.daqmx import AnalogOutputTask, VoltageOutputChannel import numpy as np import pandas as pd import os import time default_folder = os.path.dirname(__file__) default_filename = os.path.join(default_folder, 'power_calibration.csv') ...
python
#!/usr/local/bin/python3 from SM1 import * # The SM1 library is imported here COMPORT = '/dev/tty.usbserial-AL05TVH5' # Serial port (on Windows, it is COM1,2,...) ser = setup_serialcom(COMPORT) # Connection w serial port established print('Reading axes position...\n') output1 = query_position(ser, 1) ...
python
# The code that helped me to achive this is from Just Van Rossum: https://gist.github.com/justvanrossum/b65f4305ffcf2690bc65 def drawShape(shapePhase, shapeRadius): def variation(pt, radius, phase): x, y = pt dx = radius * cos(phase) dy = radius * sin(phase) return x + dx, y + ...
python
## Hit-and-Run Sampling, adapted from Johannes Asplund-Samuelsson (https://github.com/Asplund-Samuelsson) # Import libraries import sys, os import numpy as np import time import math from scipy import stats ####################################################################################################### ## Nam...
python
import numpy as np import matplotlib.pyplot as plt from sklearn.mixture import GaussianMixture as GMM from sklearn.cluster import DBSCAN from time import time def color_match(im, Q = 5, verbose = False): GMM_FEATURE_MATRIX = im.reshape(-1,3) model = GMM(n_components=Q,covariance_type='diag') CLOSE...
python
from inventory.env import Staging from inventory.project import BackEnd, FrontEnd class DevelopHost(Staging, BackEnd, FrontEnd): ansible_host = 'develop_hostname' version = 'develop' extra = {'debug': 1} class StagingHost(Staging, BackEnd, FrontEnd): ansible_host = 'master_hostname' version = 'm...
python
""" Tests of neo.io.neomatlabio """ import unittest from neo.io import MicromedIO from neo.test.iotest.common_io_test import BaseTestIO class TestMicromedIO(BaseTestIO, unittest.TestCase, ): ioclass = MicromedIO entities_to_download = [ 'micromed' ] entities_to_test = [ 'micromed/Fil...
python
# ElectrumSV - lightweight Bitcoin SV client # Copyright (C) 2019-2020 The ElectrumSV Developers # # 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 lim...
python
import json from ipaddress import IPv4Address from pytest_toolbox.comparison import AnyInt, RegexStr from .conftest import Factory async def test_login(cli, url, factory: Factory): user = await factory.create_user() r = await cli.post( url('auth:login'), data=json.dumps({'email': user.email,...
python
from datasets.base.image.manipulator import ImageDatasetManipulator import numpy as np import copy from datasets.base.common.operator.manipulator import fit_objects_bounding_box_in_image_size, \ update_objects_bounding_box_validity, prepare_bounding_box_annotation_standard_conversion from data.types.bounding_box_fo...
python
import numpy as np import pydub import librosa import scipy import scipy.fftpack as fft silence_threshold = 60 # in -dB relative to max sound which is 0dB lambdaa = 1 # amplitude of delta signal in PEFBEs n_mels = 60 # feature dimension for each frame segment_length = 41 # 1 segment is 41 frames segment_hop_...
python
"""empty message Revision ID: 40557a55e174 Revises: 0f9ddf8fec06 Create Date: 2021-09-13 03:11:26.003799 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '40557a55e174' down_revision = '0f9ddf8fec06' branch_labels = None depends_on = None def upgrade(): # ...
python
import numpy as np import matplotlib.pyplot as plt import pdb import hsmix import scipy as sp #==================================================================== def test_ideal_gas_press(): TOL = .03 xHS = 1.0 # atmospheric conditions mHS = 28.97 kT = 1.0/40 # 300 K V0 = 39270.0 V_a = V...
python
from simplerpcgen.rpcgen import rpcgen
python
import os import sys from .graph import SubtaskGraph from sge.mazemap import Mazemap import numpy as np from .utils import get_id_from_ind_multihot from sge.utils import WHITE, BLACK, DARK, LIGHT, GREEN, DARK_RED class MazeEnv(object): # single batch def __init__(self, args, game_name, graph_param, game_len, gam...
python
from django.contrib.auth.backends import BaseBackend from naloge.models import Uporabnik from accounts.francek import * from django.conf import settings class FrancekBackend(BaseBackend): # FrancekBackend deluje kot sekundarni nacin prijave v aplikacijo. V # nastavitvah mora biti na zadnjem mestu - kot v nasl...
python
from app.programs.loader import load list = load('app/programs/original')
python
n = input("Enter the name:: ") reverseString = [] i = len(n) while i > 0: reverseString += n[ i - 1 ] i = i - 1 reverseString = ''.join(reverseString) print("ReversedString::", reverseString)
python
pa = int(input('Digite o primeiro termo da PA: ')) r = int(input('Digite a razao da PA: ')) c = 0 mais = 10 tot = 0 print('Os termos são', end=" ") while mais != 0: tot += mais while c <= tot: c += 1 print('{}'.format(pa), end=' -> ') pa = pa + r print('PAUSA') mais = int(input('...
python
from io import StringIO from cline import CannotMakeArguments, CommandLineArguments from mock import patch from pytest import raises from smokestack.exceptions import SmokestackError from smokestack.register import register from smokestack.tasks.operate import OperateTask, OperateTaskArguments from smokestack.types i...
python
import os import json import argparse import glob as gb import utils as ut import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt def main(args): """ Execute: ------------------------------------------------------------------- python process.py --path data/v6...
python
# python 3 headers, required if submitting to Ansible from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.utils.display import Display display = Display() class FilterModule(object): """ ansible filter """ def filters(self): return { ...
python
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
python
# Copyright 2016 The TensorFlow 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 applica...
python
import bartender import atexit from flask import Flask, request, Response from drinks import drink_list, drink_options #import atexit from menu import MenuItem, Menu, Back, MenuContext, MenuDelegate atexit.register(bartender.Bartender.atExit) pete = bartender.Bartender() pete.buildMenu(drink_list, drink_options) app ...
python
import datetime # Gets time from milliseconds # Returns string formatted as HH:MM:SS:mmm, MM:SS:mmm or S:mmm, depending on the time. def get_time_from_milliseconds(milli): milliseconds = milli % 1000 seconds= (milli//1000)%60 minutes= (milli//(1000*60))%60 hours= (milli//(1000*60*60))%24 if hours...
python
import numpy as np from sklearn.metrics import r2_score from metaflow_helper.models import LightGBMRegressor from metaflow_helper.constants import RunMode def test_lightgbm_model_regressor_handler_train(): n_examples = 10 n_repeat = 10 offset = 10 X = np.repeat(np.arange(n_examples), n_repeat)[:, None...
python
import tensorflow as tf from tensorflow.keras.models import Model from tensorflow.keras.layers import Input, Conv2D, BatchNormalization, Activation from tensorflow.keras.layers import UpSampling2D, add, concatenate, MaxPool2D, Dropout import tensorflow.keras.backend as K import numpy as np def basic_Block(inputs, out...
python
c = get_config() #Export all the notebooks in the current directory to the sphinx_howto format. c.NbConvertApp.notebooks = ['*.ipynb'] c.NbConvertApp.export_format = 'markdown' c.NbConvertApp.output_files_dir = '../assets/posts/{notebook_name}_files'
python
#!/usr/bin/env python # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2012,2013,2015,2016,2017,2018 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. #...
python
import urllib.parse from sp_api.api import ProductFees from sp_api.base import Marketplaces def test_get_fees_for_sku(): print(ProductFees().get_product_fees_estimate_for_sku("Foo's Club", 39.32, is_fba=False))
python
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
python
import os import datetime from omegaconf import OmegaConf from . import io from . import features from . import models from . import metrics from . import kfolds from . import permutation conf = None def setup(config="config.yaml"): global conf conf = OmegaConf.load(config) if not os.path.exists('out...
python
"Livestreamer main class" from __future__ import (absolute_import, division, print_function, unicode_literals) import os import re import sys # Python 2/3 compatibility try: from urllib.parse import urlsplit except ImportError: from urlparse import urlsplit try: from configparser i...
python
""" Tests ``from __future__ import absolute_import`` (only important for Python 2.X) """ import jedi from .. import helpers @helpers.cwd_at("test/test_evaluate/absolute_import") def test_can_complete_when_shadowing(): script = jedi.Script(path="unittest.py") assert script.completions()
python
#!/usr/bin/env python3 # 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. import itertools import math import os import random import unittest from typing import Li...
python
"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database _sym_db = _symbol_database.Default() from .....exabel.api.anal...
python
"""Metadata read/write support for bup.""" # Copyright (C) 2010 Rob Browning # # This code is covered under the terms of the GNU Library General # Public License as described in the bup LICENSE file. import errno, os, sys, stat, pwd, grp, struct, re from cStringIO import StringIO from bup import vint, xstat from bup.d...
python
import functools import hashlib import os from typing import BinaryIO, Final, List, Optional, final, Iterable @final class Team: team_id: Final[str] name: Final[str] def __init__(self, team_id: str, name: str): self.team_id = team_id self.name = name @final class Replay: PLAYER_TAG_...
python
from .extension import setup __version__ = "0.1.0" __all__ = ["setup"]
python
#!/usr/bin/env python3 import csv import logging import subprocess import os import sys from github import Github from s3_helper import S3Helper from get_robot_token import get_best_robot_token from pr_info import PRInfo, get_event from build_download_helper import download_all_deb_packages from upload_result_helper...
python
""" Top-level namespace for meta-analyses. """ from . import cbma from . import ibma from . import esma __all__ = ['cbma', 'ibma', 'esma']
python
## 테스트 셋 기본 def make_test_set(): test_df = pd.read_csv("sample_submission.csv", usecols=["order_id"]) # order_id에 맞는 user_id를 찾아서 merge orders_df = pd.read_csv("orders.csv", usecols=["order_id","user_id", "order_dow", "order_hour_of_day"]) test_df = pd.merge(test_df, orders_df, how="inner", on="o...
python
import orodja import re import unicodedata import os from pathlib import Path leta = ["/pyeongchang-2018", "/sochi-2014", "/vancouver-2010", "/turin-2006", "/salt-lake-city-2002", "/nagano-1998", "/lillehammer-1994", "/albertville-1992", "/calgary-1988", "/sarajevo-1984", "/lake-placid-1980", "/innsbruck-197...
python
# # MythBox for XBMC # # Copyright (C) 2011 analogue@yahoo.com # http://mythbox.googlecode.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at...
python
import io import json import os import click from demisto_sdk.commands.common.constants import (PACK_METADATA_SUPPORT, PACKS_DIR, PACKS_PACK_META_FILE_NAME, FileType)...
python
# -*- coding:utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import numpy as np from deeploader.dataset.dataset_base import ArrayDataset import util from dataset.data_util import get_img def rotate(angle, x, y): """ 基于原点的弧度旋转...
python
from abc import abstractmethod from dataclasses import dataclass import textwrap from typing import Any, Callable, Dict, Iterable, Iterator, List, Sequence, Tuple, Union import clingo from clingo import MessageCode, Symbol, SymbolicAtom from clingo import ast from clingo.ast import parse_string from eclingo.prefixes ...
python
"""Testing module for priorityq.""" import pytest @pytest.fixture def test_q(): """Test fixtures of priority qs.""" from src.priorityq import PriorityQ q0 = PriorityQ() q1 = PriorityQ() q1.insert('sgds', 10) q1.insert('another', 9) q1.insert('another', 8) q1.insert('another', 7) q...
python