text
stringlengths
2
999k
# 2953.py m,i,j=0,0,0;exec("j+=1;t=eval('+'.join(input()))\nif t>m:m=t;i=j\n"*5);print(i,m)
#!/usr/bin/env python '''Compilation of functions for interfacing with miscellanious data products. @author: Zach Hafen @contact: zachary.h.hafen@gmail.com @status: Development ''' import copy import numpy as np import os import pandas as pd ######################################################################## d...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. """ Execute this script in QGIS to add the queried Sentinel 2 imagery as an XYZ tile to the project. """ import ee # import geopandas as gpd # QGIS plug-in for GEE from ee_plugin import Map # import the region outline # region_outline = gpd.re...
from .base import Indexer from infi.app_repo.utils import ensure_directory_exists from infi.gevent_utils.os import path, remove, fopen from infi.gevent_utils.glob import glob from infi.gevent_utils.deferred import create_threadpool_executed_func from infi.app_repo.utils import temporary_directory_context, log_execute_a...
from unittest import mock from django.forms.fields import Field from directory_validators.common import not_contains_url_or_email from find_a_supplier import forms import pytest REQUIRED_MESSAGE = Field.default_error_messages['required'] def test_contact_company_form_required_fields(): form = forms.ContactCom...
# -*- coding: utf-8 -*- from __future__ import division import numpy as np from library import Hill_ratio_at_SP2 from gsw.utilities import match_args_return __all__ = [ 'SP_from_C', 'C_from_SP', 'SP_from_R', 'R_from_SP', 'SP_salinometer', 'SP_from_SK...
# Generated by Django 2.2.13 on 2021-02-25 17:53 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('courses', '0035_program_attempts'), ('exams', '0017_examrun_passing_score'), ] operations = [ migr...
# Copyright 2019 The TensorNetwork 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...
# -*- coding: utf-8 -*- """ Microsoft-Client-Licensing-Platform GUID : b6cc0d55-9ecc-49a8-b929-2b9022426f2a """ from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct from etl.utils import WString, CString, SystemTime, Guid from etl.dtyp import Sid fr...
from setuptools import setup from torch.utils.cpp_extension import BuildExtension, CUDAExtension setup( name='retinanet', version='0.1', description='Fast and accurate single shot object detector', author = 'NVIDIA Corporation', author_email='fchabert@nvidia.com', packages=['retinanet', 'retina...
html_page = ''' <html><head> <title>Teams[%s]</title> <script language="javascript"> pause = 3000 people = new Array(%s) numPairs = %s document.write("<style type='text/css'>") for(i = 1; i <= numPairs; i++) document.write("#hot" + i + " {color:black; background:green}") document.write("</style>"); currLine = 1 f...
from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import matplotlib as mpl import numpy as np import time import os # from criterion import * # from my_operator import * import seaborn as sns import k3d def vis_tensor(beta): volume = k3d.volume(beta) plot = k3d.plot(camera_au...
# -*- coding: utf-8 -*- """ Created on Tue Nov 24 23:36:14 2020 @author: Abhilash """ from distutils.core import setup setup( name = 'BERTSimilarity', packages = ['BERTSimilarity'], version = '0.1', license='MIT', description = 'A BERT embedding library for sentence semantic simi...
# *************************************************************** # Copyright (c) 2021 Jittor. All Rights Reserved. # Maintainers: # Guowei Yang <471184555@qq.com> # Guoye Yang <498731903@qq.com> # Dun Liang <randonlang@gmail.com>. # # This file is subject to the terms and conditions defined in # file '...
import tensorflow as tf from os import path as ospath from model import Model from config import LABELS_PRED, TRAINING_IMG_DIR, TRAINING_DATA_DIR, TRAINING_JSON_PATH, TEST_IMG_DIR, TEST_DATA_DIR, CHECKPOINT_PATH, CHECKPOINT_SAVE_EPOCH, CHECKPOINT_MAX_TO_KEEP, _IMAGE_WIDTH, _IMAGE_HEIGHT, _IMAGE_CHANNELS, _NUM_CLASSES, ...
# ITERACTION BY ITEM numbers = [0,1,2,3,4,5] for number in numbers: # For Loops, number is the index and numbers is the lenght of the loops print(number) # EXAMPLE for number in numbers: if number > 1 and number < 4: print(number)
import time import shared.Client as Client from shared.Log import Log if __name__ == '__main__': client = Client() for i in range(1, 10): client.sendto(''.encode(), 'localhost', 10000) start = time.time() client.receive() end = time.time() Log.i("RTT= {:.10f}ms".format((...
# samples/typing.examples.py ############################################### # This module is not supposed to be executed! # ############################################### # not strongly typed language a = 7 b = "7" a + b == 14 concatenate(a, b) == "77" # dynamic typing a = 7 a * 2 == 14 a = "Hello" a * 2 == "H...
import pyttsx3 engine = pyttsx3.init() # object creation def speaker(d): rate = engine.getProperty('rate') # getting details of current speaking rate print (rate) #printing current voice rate engine.setProperty('rate', 135) # setting up new voice rate voices = engine.getProperty('voice...
import logging import os from docserver.api import schemas logger = logging.getLogger(__name__) HTML_LATEST_REDIRECT = """ <!DOCTYPE HTML> <meta charset="UTF-8"> <meta http-equiv="refresh" content="1; url=latest/"> <script> window.location.href = "latest/" </script> <title>Page Redirection</title> If you are n...
""" Provide the groupby split-apply-combine paradigm. Define the GroupBy class providing the base-class of operations. The SeriesGroupBy and DataFrameGroupBy sub-class (defined in pandas.core.groupby.generic) expose these user-facing objects to provide specific functionailty. """ import collections from contextlib im...
import os import fnmatch from functools import partial from io import BytesIO import tarfile import tempfile import time from .ar import ARWriter from .control import FIELD_INSTALLED_SIZE from .helpers import md5_for_path MAINTAINER_SCRIPT_NAMES = ('preinst', 'postinst', 'prerm', 'postrm') TAR_INFO_KEYS = ('uname', '...
""" minemeld ======== MineMeld core engine """ __version__ = '0.9.60'
#!/bin/python3 import math import os import random import re import sys # # Complete the 'compareTriplets' function below. # # The function is expected to return an INTEGER_ARRAY. # The function accepts following parameters: # 1. INTEGER_ARRAY a # 2. INTEGER_ARRAY b # def compareTriplets(a, b): # Write your code ...
#!python3 # Copyright (C) 2020 Victor O. Costa # 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 3 of the License, or # (at your option) any later version. # This program is dis...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.python import core, workspace import caffe2.python.hypothesis_test_util as hu import caffe2.python.serialized_test.serialized_test_util as serial import hypot...
""" Module for discount exceptions """ class ItemPriceIsBad(Exception): """ Exception when item price is < 0 """ def __init__(self, message): super(ItemPriceIsBad, self).__init__(message) class ItemIsNowFreeException(Exception): """ Exception when Item price is too low (<= 0) """ ...
import pandas as pd from utils.constants import Maps, total_escort_map_distance, total_map_time, calc_map_type, time_to_add from utils.utils import calc_match_date, calc_season # Some readability options for pandas print statements pd.set_option('display.max_columns', 500) pd.set_option('display.max_rows', 200) pd.set...
from django import VERSION from django.contrib import admin from django.contrib.admin import helpers from django.contrib.admin.options import reverse, InlineModelAdmin from django.core.exceptions import PermissionDenied from django.forms.formsets import all_valid from django.http import Http404 from django.utils.decora...
""" A simple stock exchange simulation """ import random ############################# #STOCK EXCHANGE ############################# equities={'Nokia':1000000, 'Google': 2000000, 'Apple': 2400000} tally={'Laura': {'Nokia':0, 'Google':0, 'Apple':0}, 'John':...
import os import struct import elftools import logging from collections import defaultdict from .elf import ELF from ..blob import Blob from .. import register_backend from ...errors import CLEError, CLECompatibilityError from ...memory import Clemory from ...address_translator import AT l = logging.getLogger(name=__...
#!/usr/bin/env python3 # coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in c...
""" Various data structures used in query construction. Factored out from django.db.models.query to avoid making the main module very large and/or so that they can be used by other modules without getting into circular import difficulties. """ import copy import functools import inspect import warnings from collection...
import logging def get_configuration_files(global_plugin_state, current_configuration, output, test_id): files_to_include = current_configuration["files_to_include"] if files_to_include!=None and files_to_include!="": return files_to_include.split() else: return []
import sys from src.data_manager.unaligned_data_loader import UnalignedDataLoader from src.data_manager.svhn import load_svhn from src.data_manager.mnist import load_mnist, load_mnist_new # from datasets.usps import load_usps # from datasets.gtsrb import load_gtsrb # from datasets.synth_traffic import load_...
import re from komand.exceptions import PluginException from ldap3.core.exceptions import LDAPInvalidDnError, LDAPOperationsErrorResult from ldap3 import MODIFY_REPLACE from logging import Logger class ADUtils: @staticmethod def dn_normalize(dn: str) -> str: """ This method normalizes dn keys ...
""" A quick test of the pyloxone_api module From the command line, run: > python -m pyloxone_api username password host port where username, password host and port are your Loxone login credentials """ from pyloxone_api import LoxApp, LoxWs import asyncio import logging import sys _LOGGER = logging.getLogger(__nam...
# -*- coding: utf-8 -*- import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from data import coco as cfg from ..box_utils import match, log_sum_exp class MultiBoxLoss(nn.Module): """SSD Weighted Loss Function Compute Targets: 1) Produce Confidence Tar...
# coding: utf-8 import json import operator from tqdm import tqdm from nltk import word_tokenize from nltk.corpus import stopwords from nltk.stem.porter import * from collections import defaultdict NUMBER_OF_FILES = 266546 def build_dataset(): stemmer = PorterStemmer() stopwords_english = stopwords.words('e...
#! /usr/bin/env python """Super simple utility to save data to a Google spreadsheet""" import gspread from oauth2client.service_account import ServiceAccountCredentials class Saver(object): def __init__(self, cred_file='client_secret.json'): scope = ['https://spreadsheets.google.com/feeds'] creds...
class ReadFromPickleException(Exception): def __init__(self, file='Can not read file'): super().__init__('Cannot parse pickle from file: {}'.format(file))
import logging import datetime from sqlalchemy.exc import IntegrityError, DataError, InvalidRequestError from totalimpactwebapp import db from totalimpactwebapp.json_sqlalchemy import JSONAlchemy logger = logging.getLogger("ti.product_deets") class ProductDeets(db.Model): id = db.Column(db.Integer, primary_key...
#! /usr/bin/env python import os import yaml from astropy import units as u ABSPATH = os.path.dirname(os.path.realpath(__file__)) def parse_pars(par_file=os.path.join(ABSPATH, "parameters.yaml")): ''' Read in SPAMM input parameters from input parameters file. Args: par_file (str): Location of par...
import cv2 face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') img = cv2.imread('images.jpeg') gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) faces = face_cascade.detectMultiScale(gray,1.1,4) for (x,y,w,h) in faces: cv2.rectangle(img,(x,y),(x+w,y+h),(255,0,0),2) cv2.imshow('img',img) cv2....
############################################################################## # # Copyright (c) 2007 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
import asyncio import b4 import sys import logging log_format = logging.Formatter('%(asctime)s.%(msecs)03d %(levelname)s {%(module)s} [%(funcName)s] %(message)s', datefmt='%Y-%m-%d,%H:%M:%S') log = logging.getLogger(__name__) log.setLevel(logging.INFO) handler = logging.StreamHandler(sys...
import importlib from types import ModuleType from typing import Any, Dict import click from comeback import plugins from comeback.utils import verbose_echo def call(module: ModuleType, **plugin_params: Dict[str, Any]) -> None: try: success, err = module.run_plugin(**plugin_params) except T...
# # Copyright (c) 2008-2016 Citrix Systems, Inc. # # 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 l...
import warnings import pandas import numpy import vtreat.vtreat_impl as vtreat_impl import vtreat.util import vtreat.cross_plan def vtreat_parameters(user_params=None): """build a vtreat parameters dictionary, adding in user choices""" params = { "use_hierarchical_estimate": True, "coders":...
# TianTcl - Whisper game - generator import random subject=["ฉัน","คุณ","เขา","มัน","พวกเรา","พวกเขา","คน","ชาวบ้าน"] expand_subject=[None,"ที่สูงๆ","ที่กวาดถนนอยู่","ตรงนั้น","ในห้องนั้น"] verb=["กำลังวิ่ง","เดิน","คุยกัน","นอนอยู่"] epand_verb=[None,"อย่างรวดเร็ว","ช้าๆ","เสียงดังมาก"] object=[None,"ในลู่วิ่ง",...
from django.conf import settings from datetime import timedelta import os # How long after creation the upload will expire DEFAULT_EXPIRATION_DELTA = timedelta(days=1) EXPIRATION_DELTA = getattr(settings, 'DRF_CHUNKED_UPLOAD_EXPIRATION_DELTA', DEFAULT_EXPIRATION_DELTA) # Path where uploading files will be stored unti...
""" Tests common to list and UserList.UserList """ import sys import os from test import test_support, seq_tests class CommonTest(seq_tests.CommonTest): def test_init(self): # Iterable arg is optional self.assertEqual(self.type2test([]), self.type2test()) # Init clears pr...
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ImageSearcher.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from collections import namedtuple from contextlib import closing import numpy as np import socket import time import torch import torch.nn as nn def train(train_iterator, model, criterion, optimizer): ""...
import json import time from typing import Callable, Iterator, Optional import pandas as pd from dagster_pandas import DataFrame from dagster import ( Array, AssetMaterialization, Bool, DagsterInvalidDefinitionError, EventMetadataEntry, Failure, Field, InputDefinition, Int, Non...
# coding:utf-8 # # The MIT License (MIT) # # Copyright (c) 2016-2019 yutiansut/QUANTAXIS # # 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 th...
import slash def test_0(): pass def test_1(): pass def test_2(): pass def test_3(): pass def test_4(): pass def test_5(): slash.logger.warning("this is a sample warning") def test_6(): pass def test_7(): pass def test_8(): pass def test_9(): pass def test_10(): pas...
print('\033[1;36m-\033[m' * 50) a = float(input('\033[1;36mQual a altura da parede? \033[m')) l = float(input('\033[1;36mQual a largura da parede? \033[m')) print(f'\033[1;33mA área da parede é de {a*l:.2f} m².\033[m') print(f'\033[1;33mA quantidade de tinta necessária para pintar esta parede é de {(a*l)/2:.2f} litros....
""" 1) Information is ~ 1/variance, so the new information you have is roughly 1/(0.5^2 + 0.5^2) (compared to 1/0.5^2) for each original measurement. 2) The estimate will be almost entirely dependent on the mu_{1}! There is almost no information from mu_{2}. 3) Because the variances are the same, the amount of...
from dataclasses import dataclass from typing import List, Optional from blspy import G2Element from chaingreen.types.blockchain_format.coin import Coin from chaingreen.types.blockchain_format.pool_target import PoolTarget from chaingreen.types.blockchain_format.sized_bytes import bytes32 from chaingreen.util.ints im...
import cv2 import cpm_utils import numpy as np import math import tensorflow as tf import time import json import random import os tfr_file = 'cpm_sample_dataset.tfrecords' dataset_dir = '/Users/wangrui/Downloads/id_dataset/data' SHOW_INFO = False box_size = 32 input_size = 256 num_of_joints = 6 gaussian_radius = 2 ...
from datetime import datetime import os import json import time from importlib import import_module from django.http import JsonResponse from django.shortcuts import render, redirect from django.http import Http404 from von_connector.config import Configurator from von_connector.schema import SchemaManager from von_...
__copyright__ = """\ (c). Copyright 2008-2020, Vyper Logix Corp., All Rights Reserved. Published under Creative Commons License (http://creativecommons.org/licenses/by-nc/3.0/) restricted to non-commercial educational use only., http://www.VyperLogix.com for details THE AUTHOR VYPER LOGIX CORP DISCLAIMS ALL WARRA...
import logging import os import platform import posixpath import subprocess import sys import mlflow from mlflow.exceptions import MlflowException from mlflow.projects.submitted_run import LocalSubmittedRun from mlflow.projects.backend.abstract_backend import AbstractBackend from mlflow.projects.utils import ( fe...
#!/usr/bin/env python2 # # KubOS Core Flight Services # Copyright (C) 2015 Kubos Corporation # # 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...
# encoding=utf-8 import csv import json class DATAOutput: ''' data ''' def __init__(self): print('开启数据保存器') def save_to_csv(self, parser_result, csvpath): ''' 保存为 json 数据 para: parser_result''' with open(csvpath, 'w', newline='', encoding='utf-8') as csvfile: ...
HTTP = 'http' HTTPS = 'https' PROTOCOL_CHOICES = [ (HTTP, HTTP), (HTTPS, HTTPS), ] PROTOCOL_LIST = [HTTP, HTTPS] BANK = 'BANK' CONFIRMATION_VALIDATOR = 'CONFIRMATION_VALIDATOR' PRIMARY_VALIDATOR = 'PRIMARY_VALIDATOR' ACCOUNT_FILE_HASH_LENGTH = 64 BALANCE_LOCK_LENGTH = 64 BLOCK_IDENTIFIER_LENGTH = 64 HEAD_HA...
def load_doc(filename): file = open(filename,'r') text = file.read() file.close() return text def load_descriptions(doc): mapping = dict() for line in doc.split('\n'): tokens = line.split("\t",1) if len(line)<2: continue image_id, image_desc =...
import logging import asyncio from typing import List logging.basicConfig( level=logging.DEBUG, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s" ) LOGGER = logging.getLogger(__name__) async def run_shell_command(command_to_exec: List) -> (str, str): process = await asyncio.create_subprocess_...
#!/usr/bin/env python3 # coding: utf-8 import numpy as np from .ddfa import _parse_param from .params import u_filter, w_filter, w_exp_filter, std_size, param_mean, param_std def reconstruct_paf_anchor(param, whitening=True): if whitening: param = param * param_std + param_mean p, offset, alpha_shp, ...
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import ast import datetime import logging import os import random import re import time from xml.etree import ElementTree from pkg_resources import DistributionNotFound, get_distribution, parse_version import requests tr...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import six try: # Use regex module for matching uppercase characters if installed, # otherwise fall back to finding all the uppercase chars in a loop. import regex as re upper_re_s = r'\p{Lu}' regex_snippets = { 'acr': r'\p{Lu...
from overrides import overrides from allennlp.common.util import JsonDict from allennlp.data import DatasetReader, Instance from allennlp.data.tokenizers import WordTokenizer from allennlp.models import Model from allennlp.service.predictors.predictor import Predictor @Predictor.register('crf-tagger') class CrfTagge...
# Generated by Django 3.2.10 on 2021-12-30 12:51 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('news', '0001_initial'), ] operations = [ migrations.AlterField( model_name='news', na...
#!/usr/local/bin/python2.7 # -*- coding: utf-8 -*- import sys import os import requests import json import xml.etree.ElementTree as ET import collab_oepage as OEPage import BeautifulSoup from terminaltables.tables import UnixTable from colorclass import Color from shell import Shell from clint.textui import progress #...
import math import torch,time,random import torch.nn as nn import torch.nn.functional as F from torch.distributions.categorical import Categorical from torch.distributions.multivariate_normal import MultivariateNormal from torch.nn.modules.linear import Linear from ..commom.attention import MultiHeadAttention from ..co...
import socket from time import ctime import threading sADDR = ('127.0.0.1', 45002) buff = 1024 cliSock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) cliSock.connect(sADDR) def receive(): while True: rMessage = cliSock.recv(buff) if not rMessage: print("Ending conne...
__version__ = '3.0.156.1'
# Copyright (C) 2020 University of New South Wales & Ingham Institute # Copyright (C) 2020 Stuart Swerdloff and Simon Biggs # 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.ap...
from efficient_rl.environment.factored_mdp.FactoredTaxiClass import FactoredTaxi
# -*- coding: utf-8 -*- import os from hamcrest import * from test.base import BaseTestCase, container_test from amplify.agent.common.util import container from amplify.agent.common.context import context __author__ = "Grant Hulegaard" __copyright__ = "Copyright (C) Nginx, Inc. All rights reserved." __license__ = ""...
from selenium.webdriver import Firefox from time import sleep from urllib.parse import urlparse from json import loads url = 'http://selenium.dunossauro.live/aula_05.html' firefox = Firefox() firefox.get(url) # nome, email, senha, telefone, btn def preenche_form(browser, nome, email, senha, telefone): browser...
a_list = [3, 6, 10, 2] print(a_list[0]**2) # Now, square all items in the list for item in a_list: print(item**2) fruits = ['banana', 'apple', 'whatnot', 'pineapple'] # for current time in fruits: for fruit in fruits: print(fruit)
#!/usr/bin/env python # # Copyright 2011 Facebook # # 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 a...
# coding=utf-8 # Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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...
#!/usr/bin/env python3 # # --- Day 17: Trick Shot / Part Two --- # # Maybe a fancy trick shot isn't the best idea; after all, you only have # one probe, so you had better not miss. # # To get the best idea of what your options are for launching the probe, # you need to find every initial velocity that causes the probe ...
from django.urls import path from .views import OrdersPageView, charge urlpatterns = [ path('', OrdersPageView.as_view(), name='orders'), path('charge/', charge, name='charge'), ]
""" The module provides the abstract :class:`Bound` to represent the boundary of the simulation, e.g. periodic, or gradually more absorbing. Specific boundaries are implemented as subclasses and can be used directly as the `bound` argument to :func:`macromax.solve` or :class:`macromax.Solution`. The precludes the inclu...
#!/usr/bin/env python # coding: utf-8 import pandas as pd from sklearn.model_selection import ParameterGrid from sklearn.base import clone from sklearn.cluster import KMeans from sklearn import metrics import numpy as np import matplotlib.pyplot as plt df = pd.read_excel('4.xlsx') data = df.drop('O7', axis = 1) label...
# Copyright 2014-2021 Canonical Limited. # # 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 pygame pygame.init() X = 600 Y = 400 RED = (255, 0, 0) BLUE = (0, 0, 255) screen = pygame.display.set_mode((X, Y)) pygame.display.set_caption("Pygame Presentation by Coding Pirates") screen.fill(RED) clock = pygame.time.Clock() x = 100 y = 110 dx = 2 dy = 3 radius = 30 while True: clock.tick(70) sc...
import ctypes import pathlib import random import subprocess import tempfile import gi import vlc from PIL import Image, ImageFilter gi.require_version("Gtk", "3.0") from gi.repository import Gtk, Gdk, Gio from base_player import BasePlayer from utils import list_local_video_dir from commons import * class VLCWidg...
# Copyright 2019-2020 Canonical Ltd. # # 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 writi...
from django.db.models import Transform from django.db.models.lookups import PostgresOperatorLookup from .search import SearchVector, SearchVectorExact, SearchVectorField class DataContains(PostgresOperatorLookup): lookup_name = 'contains' postgres_operator = '@>' class ContainedBy(PostgresOperatorLookup): ...
# -*- coding: utf-8 -*- """ test_build_latex ~~~~~~~~~~~~~~~~ Test the build process with LaTeX builder with the test root. :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import print_function import os import re from s...
from __future__ import unicode_literals import itertools from .common import InfoExtractor from ..utils import ( get_element_by_id, int_or_none, remove_end, ) class FoxgayIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?foxgay\.com/videos/(?:\S+-)?(?P<id>\d+)\.shtml' _TEST = { ...
# -*- coding: utf-8 -*- import os from setuptools import setup, find_packages # type: ignore import sys sys.path.append("Browser") with open("README.md", encoding="utf-8") as f: long_description = f.read() packages = find_packages(exclude=["utest", "atest"]) package_data = { "": ["*"], "Browser": [ ...
""" Low-level LAPACK functions ========================== This module contains low-level functions from the LAPACK library. .. versionadded:: 0.12.0 .. warning:: These functions do little to no error checking. It is possible to cause crashes by mis-using them, so prefer using the higher-level routines in `...
import os from time import sleep # sshfs phi@192.168.1.22:/www/oliver_tv/stream mount while True: print('picture') os.system('raspistill -w 640 -h 480 -q 50 -o ./mount/image_stream.jpg -rot 180 -th 0:0:0') #os.system('rsync -avr ./stream/image_stream.jpg phi@192.168.1.22:/www/oliver_tv/stream/')
# Generated by Django 3.2.9 on 2021-12-06 14:21 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), ('gallery', '0001_initial'...