content
stringlengths
5
1.05M
from django.apps import AppConfig class ConnectionRequestsConfig(AppConfig): name = 'v1.connection_requests'
from setuptools import find_packages, setup with open("./README.rst") as f: long_description = f.read() requirements = [] setup( name="rcv", version="0.1.2", description="Tabulate ballots from ranked-choice elections", author="Max Hully", author_email="max@mggg.org", long_description=long...
#!/usr/bin/env python3 import glob import os import pathlib import shutil import subprocess import time import typing import venv import click import git import requests from fair.common import FAIR_FOLDER FAIR_REGISTRY_REPO = "https://github.com/FAIRDataPipeline/data-registry.git" def django_environ(environ: typi...
#!/usr/bin/python # -- coding: utf-8 -- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Vers...
from .opacities.linebyline import LineByLine from .opacities.ck import CKTable from .model.transmission import TransmissionRADTRANS from .model.directimage import DirectImageRADTRANS from .model.emission import EmissionRADTRANS
# -*-coding:utf-8-*- __author__ = "Allen Woo" PLUGIN_NAME = "warehouse_plugin" CONFIG = { }
import numpy as np # from pathos.multiprocessing import cpu_count # from pathos.pools import ParallelPool as Pool from multiprocessing import Pool,cpu_count import libs.contact_inhibition_lib as lib #library for simulation routines import libs.data as data from structure.global_constants import * import structure.initi...
#!/usr/bin/env python # -*- coding: utf-8 -*- import codecs import os import re import sys try: from setuptools import setup except ImportError: from distutils.core import setup # Get the version version_regex = r'__version__ = ["\']([^"\']*)["\']' with open('h2/__init__.py', 'r') as f: text = f.read() ...
from django.core.management.base import BaseCommand, CommandError from django.conf import settings from django.core.mail import EmailMessage from django.db.models import Q from django.core.exceptions import ObjectDoesNotExist from pettycash.models import PettycashBalanceCache, PettycashTransaction from members.models...
__all__ = ['logger', 'testoptions', 'testutil'] # fix import paths first so that the right (dev) version of pygr is imported import pathfix # import rest of test utils. import testoptions import testutil # make SkipTest available from unittest_extensions import SkipTest, PygrTestProgram
DEFAULT_INTERVAL = 3600 # 1 hour
import numpy as np import csv import logging logger = logging.getLogger(__name__) ### generate submission.csv def output_submission(path,playlist,rec_uris,Warn=True): pid = playlist['pid'] num_recs = len(rec_uris) if Warn and (num_recs != 500): logger.warning("Playlist {0} got {1}/500 rec...
from multiprocessing.sharedctypes import Value import numpy as np import pandas as pd from sklearn.metrics import accuracy_score from tqdm import tqdm from fastinference.models import Ensemble, Tree import torch import torch.nn as nn def create_mini_batches(inputs, targets, batch_size, shuffle=False): """ Create...
from pathlib import Path import sys from django.conf import settings BASE_DIR = Path(__file__).resolve().parent.parent def pytest_configure(): # Add example app to sys path. parent_dir = Path(__file__).parent sys.path.append(parent_dir.as_posix()) settings.configure( INSTALLED_APPS=[ ...
from queue import Queue heros = Queue() heros.put('Iron Man') heros.put('Captain America') heros.put('Spider Man') heros.put('Doctor Strange') print(heros) print(heros.get()) print(heros.get()) print(heros) # Once all the items are removed from Queue and then you call get method # on it won't give queue exhausted o...
import voluptuous as vol from esphome.components import binary_sensor, sensor from esphome.components.apds9960 import APDS9960, CONF_APDS9960_ID import esphome.config_validation as cv from esphome.const import CONF_DIRECTION, CONF_NAME from esphome.cpp_generator import get_variable DEPENDENCIES = ['apds9960'] APDS996...
"""Version nummber for network_importer.""" __version_info__ = (2, 0, "0-beta2") __version__ = ".".join([str(v) for v in __version_info__])
"""System plugin for Home Assistant CLI (hass-cli).""" import logging import click from homeassistant_cli.cli import pass_context import homeassistant_cli.remote as api _LOGGING = logging.getLogger(__name__) @click.group('system') @pass_context def cli(ctx): """System details and operations for Home Assistant."...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Feb 22 01:38:22 2021 @author: buzun """ import keyboard import uuid import time from PIL import Image from mss import mss import os import glob """ game address http://www.trex-game.skipser.com/ """ # game map limits = {"top":375, "left": 740, "width...
# -*- coding: utf-8 -*- """ Created on Fri Sep 21 20:08:00 2018 @author: sampr """ import pandas as pd def predict(value) : data = pd.read_table("fruit_data_set.txt") k = int(input("\nEnter the value of n_neighbours : ")) X = data['mass'] Y = data['fruit_name'] c...
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'main.ui' ## ## Created by: Qt User Interface Compiler version 5.15.2 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! #####################...
import setuptools setuptools.setup( name="explorecourses", version="2.0.0", url="https://github.com/danielwe/explore-courses-api", author="Jeremy Ephron, Daniel Wennberg", author_email="jeremye@stanford.edu, daniel.wennberg@gmail.com", description="A Python API for Stanford Explore Courses", ...
__version__ = (2, 2, 1)
"""pokerscores URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home...
from thesis_util.thesis_util import eval_experiment from thesis_util.thesis_util import create_eval_recon_imgs,create_eval_random_sample_imgs # load results for spatial VAE with latent space 3x3x9 # Pathes and names pathes_2_experiments = [r'C:\Users\ga45tis\GIT\mastherthesiseval\experiments\SpatialVAE_02_14AM on Novem...
import torch import pytorch_lightning as pl from pathlib import Path from typing import List, Optional, Dict, Tuple from torch.utils.data import DataLoader from src.utils import FileHandler from src.dl.utils import to_device from ..datasets.dataset_builder import DatasetBuilder class CustomDataModule(pl.LightningDat...
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) import collections import Queue import threading import uuid from . import common_utils Message = collections.namedtuple("Message", ['id', ...
# Generated by Django 3.0.2 on 2020-01-28 18:25 import ckeditor.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('pages', '0002_posts'), ] operations = [ migrations.AlterField( model_name='posts', name='body', ...
import sys import time from datetime import datetime from picamera import PiCamera camera = PiCamera() #camera.start_preview() code = 1 logins = {'12345': '12345', '123': '123', '1': '1'}; with open("../logs/logs.txt", "a") as f: match = False if len(sys.argv) != 3: f.write("Incorrect format, got arguments: " + s...
from alpyro_msgs import RosMessage, duration, float64, string from alpyro_msgs.geometry_msgs.pointstamped import PointStamped from alpyro_msgs.geometry_msgs.vector3 import Vector3 class PointHeadGoal(RosMessage): __msg_typ__ = "control_msgs/PointHeadGoal" __msg_def__ = "Z2VvbWV0cnlfbXNncy9Qb2ludFN0YW1wZWQgdGFyZ2V...
#!/usr/bin/env python import sys import os import glob import argparse import numpy import matplotlib.pyplot as plt def load_data(path): # Estimate number of processors num_procs = len(glob.glob(os.path.join(path, "jacobi_*.txt"))) # Load all data data = [] num_points = 0 for i in range(num...
#!/usr/bin/env python # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # script to run an abc test on a windows mobile emulator # - requires the wmrunner.exe program t...
import numpy as np from ..util.errors import NumericalPrecisionError from ..util.opt import partial_nn_opt from .coreset import Coreset class BatchPSVICoreset(Coreset): def __init__(self, data, ll_projector, opt_itrs, n_subsample_opt=None, step_sched=lambda m: lambda i : 1./(1.+i), mup=None, Zmean=None, SigpInv=None...
#!/usr/bin/env python # -*- coding:utf-8 -*- import sys from src import Menu from src import Content from src import Transfer from src import Constants from PyQt5.QtGui import QIcon from PyQt5 import QtWidgets, uic from PyQt5.QtWidgets import QFileDialog import ctypes try: temp1 = ctypes.windll.Load...
import numpy as np import pytest from continuum.scenarios import Rotations from tests.test_classorder import InMemoryDatasetTest from continuum.datasets import MNIST, CIFAR100 @pytest.fixture def numpy_data(): nb_classes = 6 nb_data = 100 x_train = [] y_train = [] for i in range(nb_classes): ...
#!/usr/bin/env python #coding:utf-8 # Created: 21.02.2010 # Copyright (C) 2010, Manfred Moitzi # License: MIT License __author__ = "mozman <mozman@gmx.at>" import unittest from dxfwrite.base import dxfstr from dxfwrite.entities import Insert, Attrib class TestInsert(unittest.TestCase): def test_insert_simple(se...
#### PATTERN | FR ################################################################################## # Copyright (c) 2012 University of Antwerp, Belgium # Author: Tom De Smedt <tom@organisms.be> # License: BSD (see LICENSE.txt for details). # http://www.clips.ua.ac.be/pages/pattern ####################################...
# Copyright © 2019 Province of British Columbia # # 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 agr...
import os import sys import bpy import json import argparse import mathutils import numpy as np materials_path = os.path.dirname(os.path.realpath(__file__)) + '/materials.blend' ################################################# # https://stackoverflow.com/questions/28075599/opening-blend-files-using-blenders-python-ap...
from ..Block import Block class LoadSegBlock(Block): def __init__(self, blkdev, blk_num=0): Block.__init__(self, blkdev, blk_num, chk_loc=2, is_type=Block.LSEG) def create(self, host_id=0, next=Block.no_blk, size=128): Block.create(self) self.size = size self.host_id = host_id self.next = ne...
import pytest import StocksMA.StocksMA as stm @pytest.mark.parametrize( "company", [ "CIH", "maroc telecom", "involys", "total", "telecom", "label", "central", "sothema", "MNG", "salaf", "CIH", "Auto Nejma", ]...
from django.contrib import admin from django.utils import timezone # Register your models here. from smarttm_web.models import Participation_Type, Position, User, Club, Participation, Member, EC_Member, Meeting, Evaluation, Attendance class PositionAdmin(admin.ModelAdmin): list_display = ('name', 'seniority') cla...
import numpy as np import pytest from sklego.common import flatten from sklego.linear_model import LowessRegression from tests.conftest import nonmeta_checks, regressor_checks, general_checks @pytest.mark.parametrize( "test_fn", flatten([nonmeta_checks, general_checks, regressor_checks]) ) def test_estimator_che...
# Copyright The OpenTelemetry 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 applicable law or agreed to in ...
import datetime from django.conf import settings from google.appengine.api import app_identity SETTINGS_PREFIX = "DJANGAE_BACKUP_" def get_backup_setting(name, required=True, default=None): settings_name = "{}{}".format(SETTINGS_PREFIX, name) if required and not hasattr(settings, settings_name): ra...
from libfuturize.fixes.fix_future_standard_library import FixFutureStandardLibrary
from django.db import models class DropBoxListener(models.Model): listen = models.IntegerField()
from django.conf.urls import url from .import views from django.conf import settings from django.conf.urls.static import static urlpatterns=[ url('^$', views.index, name='index'), url(r'^search/', views.search_photos, name='searchPhotos'), url(r'^location/', views.search_location, name='locationPhoto') ] ...
def separar(lst): if lst == []: return [], [] a, b = lst[0] la, lb = separar(lst[1:]) return [a]+la, [b]+lb def remove_e_conta(lst, element): if lst == []: return [], 0 lst1, count = remove_e_conta(lst[1:], element) if lst[0] == element: return lst1, count + 1 ...
""" Pylibui test suite. """ from pylibui.controls import ProgressBar from tests.utils import WindowTestCase class ProgressBarTest(WindowTestCase): def setUp(self): super().setUp() self.progressbar = ProgressBar() def test_value_initial_value(self): """Tests the progressbar's `value...
# -*- coding: utf-8 -*- """ neutrino_api This file was automatically generated for NeutrinoAPI by APIMATIC v2.0 ( https://apimatic.io ). """ class URLInfoResponse(object): """Implementation of the 'URL Info Response' model. TODO: type model description here. Attributes: ...
from monero_glue.xmr import crypto from monero_glue.xmr.sub.keccak_hasher import HashWrapper from monero_serialize import xmrserialize class PreMlsagHasher(object): """ Iterative construction of the pre_mlsag_hash """ def __init__(self, state=None): from monero_glue.xmr.sub.keccak_hasher impo...
# # Author: Daniel Dittenhafer # # Created: Nov 3, 2016 # # Description: Image Transformations for faces # # An example of each transformation can be found here: https://github.com/dwdii/emotional-faces/tree/master/data/transformed # __author__ = 'Daniel Dittenhafer' import os import numpy as np from sc...
from django.utils.translation import ugettext_lazy as _ from fluent_contents.extensions import plugin_pool, ContentPlugin from .models import ContactPersonItem @plugin_pool.register class ContactPersonPlugin(ContentPlugin): model = ContactPersonItem raw_id_fields = ('contact', ) render_template = 'icekit/...
import unittest import numpy as np import torch from kcd.kcd import KCD from graphio.graphio import GraphIO from graphutils.graphutils import GraphUtils from glob import glob import os.path import re class TestMutliArange(unittest.TestCase): def test_numpy(self): print("Testing Multi-arange Function in ...
""" Calm Runbook Sample for set variable task """ import os from calm.dsl.runbooks import runbook, ref from calm.dsl.runbooks import RunbookTask as Task from calm.dsl.runbooks import CalmEndpoint as Endpoint @runbook def DslSetVariableRunbook(): "Runbook example with Set Variable Tasks" Task.SetVariable.esc...
# coding: utf-8 # main.py the api core # Created by S4n1x-d4rk3r from bs4 import BeautifulSoup from flask import Flask, jsonify, request import requests, sqlite3 from hashlib import md5 from datetime import datetime import time conn = sqlite3.connect('./flashit.db') c = conn.cursor() c.execute('create table if not ex...
import io import pathlib import re from typing import Any, Callable, Dict, List, Optional, Tuple, cast import torch from torchdata.datapipes.iter import IterDataPipe, LineReader, IterKeyZipper, Mapper, TarArchiveReader, Filter, Shuffler from torchvision.prototype.datasets.utils import ( Dataset, DatasetConfig,...
#!/usr/bin/env python3 class LogStats(): def __init__(self): self.reset() def reset(self): self.data_accum = [] self.data_averages = [] def log_data(self, data): self.data_accum.append(data) def log_average(self): total = 0 for ...
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
import pyqrcode import validators def createQR(url = 'https://www.github.com/Elry', qrName = 'author'): url = pyqrcode.create(url) url.svg(qrName+'.svg', scale = 8) url.eps(qrName+'.eps', scale = 2) print(url.terminal(quiet_zone = 1)) def getUrl(): print('Enter link to transform into QR code') url = str(i...
import os, sys, docker, json, shutil class CLI(object): def __init__(self, settings, debug, force): self.settings = settings self.debug = debug self.force = force self.options = { "debug": self.debug, "force": self.force, } self.client = docker.DockerClient(b...
# -*- coding: utf-8 -*- """ This module is for running predictions. Examples: Example command line executable:: $ python predict.py """ import logging from pathlib import Path import click import pandas as pd from cloudpickle import load from orbyter_demo.util.config import parse_config from orbyter_dem...
from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.messages.views import SuccessMessageMixin from django.db.models import Q from django.shortcuts import get_object_or_404, redirect from django.utils.translation import ugettext_lazy as ...
from flask import Blueprint, render_template, request, flash, jsonify, session from flask_login import login_required, current_user from .models import Movie from . import db, app_title import json from sqlalchemy.sql import func, or_, desc from time import time_ns # Create a Flask blueprint, attach this m...
# Generated by Django 3.0.10 on 2020-11-09 15:08 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('cms', '0068_bibliography_surname'), ] operations = [ migrations.RenameField( model_name='bibliographyentry', old_name='auth...
from src.Transition import * class Graph(object): """Clase d'un graphe/automate Traite un fichier.txt et retourne l'alphabet, l'état initial, états finaux, alphabet, les états et transitions Attributes: transitions (list): Liste des transitions de type 'Transition' finalStates (list)...
from subprocess import Popen, PIPE import sys, time import getpass username = getpass.getuser() #from Axel Schmidt def file_len(f): for i, l in enumerate(f): pass return i + 1 for i in range(0, 1): command= """#!/bin/bash #SBATCH --job-name=clas12-nflow{0} #SBATCH --nodes=1 #SBATCH --ntasks=1 ...
import logging import os import uuid from cryptoxlib.CryptoXLib import CryptoXLib from cryptoxlib.Pair import Pair from cryptoxlib.clients.hitbtc.HitbtcWebsocket import TickerSubscription, OrderbookSubscription, TradesSubscription, \ AccountSubscription, ClientWebsocketHandle, CreateOrderMessage, CancelOrderMessag...
import base64 import json import urllib.request from _md5 import md5 api = "https://api.coolapk.com/v6/main/init" built_in_str = "ldTM3cTZiFTMhFzMlFWN2cjMjVDNzQWYxYTOwU2MwIDZHljcadFN2wUe5omYyATdZJTO2J2RGdXY5VDdZhlSypFWRZXW6l1MadVWx8EVRpnT6dGMaRUQ14keVdnWH5UbZ1WS61EVBlXTHl1dZdVSvcDZzI2YmVWMjF2NwAjZkN2YmVTY4UTO1YWO4Y2Nw...
# -*- coding: utf-8 -*- import tushare as ts from sqlalchemy import create_engine from utilAll.Constants import * from utilAll.FormatDate import * import pandas as pd class ReferenceInfo: engine_sql = create_engine(SQL_ENG_NAME) def setProfitData(self,year = None,topNo=50, isSave = False,tableName = REFERENC...
import torch.nn as nn import torch.nn.functional as F from collections import OrderedDict from torchmeta.modules.module import MetaModule from torchmeta.modules.linear import MetaLinear class MetaMultiheadAttention(nn.MultiheadAttention, MetaModule): __doc__ = nn.MultiheadAttention.__doc__ def __init__(self,...
import math def lcm(a, b): return int(a * b / math.gcd(a, b)) ans = 1 for d in range(10, 20): ans = lcm(ans, d + 1) print(ans) # Copyright Junipyr. All rights reserved. # https://github.com/Junipyr
""" Abstract Functor A functor is an operator defined on a type that consists of mappings from objects, and mappings for a morphism. i.e. contains a Transform type and Morphism type """ from typing import TypeVar, Generic __all__ = ["AbstractFunctor"] from ..type import AbstractType from ._operator import Abstrac...
__version__ = "2.0+master"
"""Gremlin DSL for the Security Graph Altimeter Universe.""" from datetime import datetime import uuid from gremlin_python.process.graph_traversal import ( GraphTraversal, GraphTraversalSource, __ as AnonymousTraversal, ) from gremlin_python.process.traversal import ( T, Cardinality, Bytecode,...
from core import art from core.files import FileHandler import random import shutil import json import sys import os class InfoHandler: def __init__(self, data_filepath, metadata_filepath): self.data_filepath = data_filepath self.metadata_filepath = metadata_filepath # copy each...
"""Nonstationary (linear trend) flood frequency analysis stan """ import os import numpy as np from . import StatisticalModel from ..path import data_path from ..util import compile_model class LN2LinearTrend(StatisticalModel): """Lognormal Model with linear trend and constant CV """ def __init__(self,...
import csv def remove(string_input): return "".join(string_input.split()) def best_value(cvs_file): #returns the best value in a dataset with open('data/second_testing_set.csv', 'r') as file: reader = file.readlines() last_row = remove(reader[-1]) c = 0 final = "" for i in la...
#!/usr/bin/python import sys,pymongo from pymongo import Connection from pymongo.errors import ConnectionFailure from bson.code import Code class MongoDB: '''Manage database layer for Mongodb''' def __init__(self,db_name): # print "MongoDB constructor" self.db_name = db_name self....
#! Python # To grab the clipboard. import pyperclip # Used to send emails every certain amount of time of the log. import smtplib # Threading Library. import threading log = "" lastLogged = "" count = 0 # Sends us the email of the log on the given interval. def send_email(email, password, message): # Initialize ...
# Software License Agreement (BSD License) # # Copyright (c) 2014, Andrew Wilson # Copyright (c) 2012, Dorian Scholz # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of sou...
#!/usr/bin/python #coding:utf8 import random from sb import s, b ################################################################################ small_prime_table = ( 0x0002, 0x0003, 0x0005, 0x0007, 0x000B, 0x000D, 0x0011, 0x0013, 0x0017, 0x001D, 0x001F, 0x0025, 0x0029, 0x002B, 0x002F, 0x0035, 0x003B, 0x003D, 0x...
from gpiozero import FishDish from signal import pause fish = FishDish() fish.button.when_pressed = fish.on fish.button.when_released = fish.off pause()
#!/usr/bin/env python # -*- coding: utf-8 -*- from datetime import date, timedelta import extract, fmt def _prepstr(s): """ >>> _prepstr(s='') '' >>> _prepstr(s='$') '$' >>> _prepstr(s=' ') '' >>> _prepstr(s='hello world') 'hello world' >>> _prepstr(s='hello world'...
# Generated by Django 2.0.1 on 2018-03-06 23:18 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('classy', '0027_auto_20180306_1517'), ] operations = [ migrations.AddField( model_name='classifi...
import yaml def get_data_from_yaml(file_path): with open(file_path) as f: dict = yaml.load(f, Loader=yaml.FullLoader) return dict
r = float(input("Quanto de dinheiro você tem na carteira? R$")) d = r/3.27 print("Com R${:.2f} você pode comprar US${:.2f}".format(r, d))
""" 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 ...
from collections.abc import MutableMapping from typing import List, Hashable from mmdict.errors import AliasExistsError class MultiDict(MutableMapping): def __init__(self, initial={}, aliases={}): # Actual storage of values, by cannonical key self.value_store = {} # Mapping of alias -> can...
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
## Brian Blaylock ## October 18, 2021 """ Some simple tests for the ABI data """ from goes2go.data import goes_nearesttime, goes_latest, goes_timerange def test_nearesttime(): ds = goes_nearesttime('2020-01-01', save_dir='$TMPDIR') def test_latest(): ds = goes_latest(save_dir='$TMPDIR')
#!/usr/bin/env python3 # coding=utf-8 """ Mreleaser __init__.py Module """ from __future__ import annotations __all__ = ( "AnyPath", "ExcType", "TemporaryFileType", "CmdError", "Env", "Git", "Path", "Releaser", "TempDir", "aiocmd", "cli_invoke", "cmd", "suppress", ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # vim: tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab # # setup.py # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain...
import datetime import hashlib import jwt import smtplib, ssl from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart class HashFile(object): def __init__(self, filename, blocksize = 65536): file_hash = hashlib.sha256() with open(filename, 'rb') as f: fb = f...
import sys import os import argparse import numpy as np import pandas as pd from prettytable import PrettyTable from multiprocessing import cpu_count num_cores = cpu_count() # model_types = ['w2v', 'swe', 'swe_with_randomwalk', 'swe_with_2nd_randomwalk', 'swe_with_bias_randomwalk', 'swe_with_deepwalk', 'swe_with_node...
import re import shutil import subprocess import sys from pathlib import Path import requests class RazPlus(object): def __init__(self, username, password): self.username = username self.passowrd = password def login(self): s = requests.Session() try: r = s.post('...
# -*- coding: utf-8 -*- import gst import gtk class SongBin(gst.Bin): def __init__(self, song_path): gst.Bin.__init__(self) self.source = gst.element_factory_make("filesrc", "file-source") self.decoder = gst.element_factory_make("mad", "mp3-decoder") self.conv = gst.element_fact...
from .models import campaign from rest_framework import serializers class campaignSerializer(serializers.ModelSerializer): class Meta: model = campaign fields = ['id','title','description','identifier','additionalData']
t, ans = list(range(1, 101)), 0 for i in t: ans += i * i print(ans - (sum(t) * sum(t)))