text
stringlengths
1
927k
from pyspark import SparkContext sc = SparkContext("local") data = sc.textFile("/home/hadoop/Downloads/tweets.csv") data.saveAsTextFile("/home/hadoop/Downloads/mytweets")
# %% Load packages import numpy as np import torch from sklearn.metrics import accuracy_score from bnn_mcmc_examples.examples.mlp.hawks.constants import num_chains from bnn_mcmc_examples.examples.mlp.hawks.dataloaders import test_dataloader from bnn_mcmc_examples.examples.mlp.hawks.prior.constants import sampler_out...
import sys import time import logging import datetime from django.db import transaction from django.utils import timezone from framework.celery_tasks import app as celery_app from website.app import setup_django setup_django() from osf.models import Session from scripts.utils import add_file_logger logger = logging...
# # Copyright (c) 2019 Intel 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 # # Unless required by applicable law or agreed to...
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD (3-clause) from numpy.testing import assert_array_equal, assert_allclose import numpy as np from scipy import stats, sparse from mne.stats import permutation_cluster_1samp_test from mne.stats.permutations import (permutation_t_test, _ci, ...
from collections import namedtuple import itertools import logging import multiprocessing import os import pickle import cluster_vcf_records from minos import gramtools class Error (Exception): pass split_file_attributes = [ 'filename', 'file_number', 'chrom', 'chrom_start', 'chrom_end', 'f...
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
import cocotb import logging from cocotb.triggers import Timer def bin2gray(num): return num >> 1 ^ num; def gray2bin(num): mask = num while(mask != 0): mask = mask >> 1 num = num ^ mask return num BINARY_WIDTH = 8 @cocotb.test() async def test(dut): max_value = 2 ** BINARY_WIDT...
# 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, Version 2.0 (the # "License"); you may not u...
import os from typing import Any, Dict, Optional from unittest import mock import pytest import torch from pytorch_lightning import Trainer from pytorch_lightning.callbacks import ModelCheckpoint from pytorch_lightning.plugins import FullyShardedNativeMixedPrecisionPlugin from pytorch_lightning.strategies import DDPF...
""" Hydrothermal Venture https://adventofcode.com/2021/day/5 """ import re from collections import defaultdict from aoc import parse_numbers class Vent: def __init__(self, x1, y1, x2, y2): assert x1 != x2 or y1 != y2 self.x1 = x1 self.y1 = y1 self.x2 = x2 self.y2 = y2 ...
# -*- coding: utf-8 -*- # Copyright (c) 2018, VHRS and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class Location(Document): pass
# -*- coding: utf-8 -*- from flask import jsonify from . import bp_api @bp_api.errorhandler (404) def not_found (e): return jsonify ({'error': 'not found'}), 404 @bp_api.errorhandler (405) def not_found (e): return jsonify ({'error': 'not allowed'}), 405
import datetime from django.db import DJANGO_VERSION_PICKLE_KEY, models from django.utils.translation import gettext_lazy as _ def standalone_number(): return 1 class Numbers: @staticmethod def get_static_number(): return 2 class PreviousDjangoVersionQuerySet(models.QuerySet): def __getst...
""" This module contains the core `.Task` class & convenience decorators used to generate new tasks. """ from copy import deepcopy import inspect import types from .context import Context from .parser import Argument, translate_underscores from .util import six if six.PY3: from itertools import zip_longest else:...
from .assembler import PysbAssembler
from rest_framework import serializers from profiles_api import models class HelloSerializer(serializers.Serializer): """Serializes a name field for testing our APIView""" name = serializers.CharField(max_length=10) class UserProfileSerializer(serializers.ModelSerializer): """Serializes a user profile ob...
import os from typing import Type import pytest from bio_embeddings.embed import ( EmbedderInterface, SeqVecEmbedder, ProtTransBertBFDEmbedder, ) from bio_embeddings.extract import BasicAnnotationExtractor from bio_embeddings.extract.annotations import Location, Membrane @pytest.mark.skipif(os.environ.g...
import argparse import numpy as np from envs.mujoco.utils.experiment_files import (get_latest_experiment_dir, get_model, get_latest_checkpoint, get_params) from envs.mujoco.utils.load_model import load_params, load_model # def load_params(params_path): # with open...
''' A simple application that binds together a task and a GUI. Both task and GUI must be callables and accept two arguments in order to receive the communication queues. ''' import queue import select import threading from collections.abc import Iterable from quickgui.framework.queues import NewLineQueue from quick...
# Copyright (c) 2021 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 applic...
from django.db import models from django.urls import reverse from django.conf import settings from django.contrib.auth.models import User import datetime class Info_Article(models.Model): title = models.CharField( max_length=30, verbose_name='제목' ) author = models.ForeignKey(User, on_dele...
# Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import numpy as np import ngraph as ng from tests_compatibility.runtime import get_runtime def test_split(): runtime = get_runtime() input_tensor = ng.constant(np.array([0, 1, 2, 3, 4, 5], dtype=np.int32)) axis = ng.consta...
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Golden' ''' 步步高-回测 ''' import time, datetime, sys, os.path import logging from tqsdk import TqApi, TqSim, TqBacktest #, TargetPosTask from datetime import date import matplotlib.pyplot as plt import bases import stgy4long import argparse rq = time.strftime...
import atexit import os from copy import deepcopy from docker.errors import NotFound from temphelpers import TempManager from typing import Dict, Optional, Type from uuid import uuid4 from useintest.common import MOUNTABLE_TEMP_DIRECTORY, docker_client from useintest.executables.builders import CommandsBuilder from u...
from pkg_resources import get_distribution __version__ = get_distribution(__name__).version # Import here to register the client with sunpy from sunpy_soar.attrs import * from sunpy_soar.client import *
# coding: utf-8 # Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department # Distributed under the terms of "New BSD License", see the LICENSE file. from builtins import input import os import importlib from six import with_metaclass import sys from configparser import...
#!/usr/bin/env python3 """ Command Line Arguments for tools """ from argparse import SUPPRESS from lib.cli import FaceSwapArgs from lib.cli import (ContextFullPaths, DirOrFileFullPaths, DirFullPaths, FileFullPaths, FilesFullPaths, SaveFileFullPaths, Radio, Slider) from lib.utils import _image_exte...
"""Simplified "six" package for Beatbox and Python >= 2.7 or >= 3.3""" # It is in a setarate module because some checkers can report that # something is not a valid code in Python 2 or 3 respectively. import sys PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 from io import BytesIO if PY3: from bui...
'''tzinfo timezone information for America/Montreal.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class Montreal(DstTzInfo): '''America/Montreal timezone definition. See datetime.tzinfo for details''' zone = 'America/Montrea...
#! /usr/bin/env python # -*- coding: utf-8 -*- # # GUI module generated by PAGE version 4.21 # in conjunction with Tcl version 8.6 # Apr 22, 2019 04:53:59 PM +0530 platform: Windows NT import sys import tkinter from tkinter import messagebox import mysql.connector import time import dbConnect from dbConnect impo...
# Copyright 2017 Palantir Technologies, Inc. import logging from upyls import hookimpl from upyls.lsp import SymbolKind log = logging.getLogger(__name__) @hookimpl def pyls_document_symbols(config, document): all_scopes = config.plugin_settings('jedi_symbols').get('all_scopes', True) definitions = document.j...
from baseline.pytorch.torchy import *
"""This module contains the general information for IdentMetaSystemFsmTask ManagedObject.""" import sys, os from ...ucsmo import ManagedObject from ...ucscoremeta import UcsVersion, MoPropertyMeta, MoMeta from ...ucsmeta import VersionMeta class IdentMetaSystemFsmTaskConsts(): COMPLETION_CANCELLED = "cancelled" ...
import mimetypes import os from django.conf import settings from django.core.files.base import File from storages.backends.s3boto3 import S3Boto3Storage, SpooledTemporaryFile class PatchedS3Boto3Storage(S3Boto3Storage): """ Note: We need to patch S3Boto3Storage to apply a fix which stops botocore from ...
from .averager import Averager, SE2Averager from .linear import R2Ridge, SE2Ridge from .logistic import R2LogReg, SE2LogReg __all__ = ["Averager", "SE2Averager", "R2Ridge", "SE2Ridge", "R2LogReg", "SE2LogReg"]
from __future__ import print_function, division import matplotlib.pyplot as plt import numpy as np from numpy.testing import assert_allclose import pytest from ..optical_properties import OpticalProperties from ..mean_opacities import MeanOpacities from ...util.functions import virtual_file, B_nu from ...util.consta...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2020, CTERA Networks Ltd. # 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',...
import random global scor_omulet global scor_pisi scor_pisi = scor_omulet = 0 def tabla_de_joc(): """ Se afiseaza tabela de joc de la inceputul jocului :return: Adevarat daca tabela este vizibila """ str1 = "__1____2____3__" str2 = "__4____5____6__" str3 = "__7____8____9__" print(str1+...
from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'), ] urlpatterns += [ path('search/', views.Search, name='search'), ] urlpatterns += [ path('users/', views.UserDetail, name='user-detail'), path('users/create/', views.CreateUser, name='user-create')...
# Copyright 2021 The KServe 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 wr...
"""Alert panes inspired by Bootstrap Alerts. This example was originally created to show how to create custom Bootstrap Alerts. The Alerts have now been contributed to Panel. You can find the reference example [here](https://panel.holoviz.org/reference/panes/Alert.html). """ import panel as pn from awesome_panel impo...
from __future__ import absolute_import import os from django.conf import settings from celery import Celery os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'simpleserver.settings') app = Celery('simpleserver') # Using a string here means the worker will not have to # pickle the object when using Windows. app.config...
import numpy as np class Histogram(): """ Input Histograms, used to retrieve the input of Rational Activations """ def __init__(self, bin_size=0.001, random_select=False): self.bins = np.array([]) self.weights = np.array([], dtype=np.uint32) self.bin_size = bin_size sel...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ make-release ~~~~~~~~~~~~ Helper script that performs a release. Does pretty much everything automatically for us. :copyright: (c) 2013 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import sys import os import re from dat...
import re from dataclasses import dataclass import parse INTEGER_REGEX = r'-?[0-9]+(,[0-9]{3})*' NUMBER_REGEX = rf'({INTEGER_REGEX}(\.[0-9]+)?|infinity|-infinity)' @parse.with_pattern(NUMBER_REGEX) def parse_number(text: str) -> float: number_text = re.compile(NUMBER_REGEX).search(text) return float(number_...
# qubit number=5 # total number=70 import cirq import qiskit from qiskit import IBMQ from qiskit.providers.ibmq import least_busy from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister from qiskit import BasicAer, execute, transpile from pprint import pprint from qiskit.test.mock import FakeVigo from ma...
#!/usr/bin/python import sys from renderqueue.uistyle.Qt import QtWidgets from renderqueue import renderqueue #renderqueue.standalone() app = QtWidgets.QApplication(sys.argv) rqApp = renderqueue.RenderQueueApp() #rqApp.display() rqApp.show() sys.exit(app.exec_())
from typing import List, Optional import numpy as np from pydantic import BaseModel, root_validator, validator from . import constants from .optimise.hypothesis import H_TYPES, PyHypothesisParams __all__ = ["MotionModel", "ObjectModel", "HypothesisModel"] def _check_symmetric( x: np.ndarray, rtol: float = 1e-5...
import numpy as np from scipy.stats import scoreatpercentile as sap #from scipy.stats import norm def _select_sigma(X): """ Returns the smaller of std(X, ddof=1) or normalized IQR(X) over axis 0. References ---------- Silverman (1986) p.47 """ # normalize = norm.ppf(.75) - norm.ppf(.25) ...
#!/usr/lib/ckan/default/bin/python import os import sys from pkg_resources import load_entry_point paster_commands = ['create', 'help','make-config', 'points','post','request', 'serve','setup-app'] config = False for num, arg in enumerate(sys.argv): if arg[:2] == '-i': ...
# Generated by Django 3.0.2 on 2020-03-24 22:36 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0042_auto_20200324_1935'), ] operations = [ migrations.AlterField( model_name='turma', name='matricula_docen...
from client import Client from endpoint import HTTPEndpoint def get_session(url, key, secret): """Get a :class:`tempoiq.client.Client` instance with the given session information. :param String url: Backend's base URL, in the form "https://your-url.backend.tempoiq.com" :param S...
# coding: utf-8 """ Automox Console API API for use with the Automox Console # noqa: E501 OpenAPI spec version: 2021-11-16 Contact: support@automox.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class PatchPolicy(objec...
""" Find dives """ import numpy as np import pandas as pd import scipy as sp import plotly.graph_objects as go import plotly.express as px from plotly.subplots import make_subplots def plotDives(calc_file_path, new_file_path, is_export, min_length = 60, required_depth = None, max_depth = None, interest_variables = []...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
import argparse import numpy as np import os import torch import offline_agent import online_agent from utils.constants import env_list if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--env", default="HalfCheetah-v2") # OpenAI gym environment name parser.add_argument("-...
# Copyright (C) 2017 HuaWei 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
# MIT LICENSE # # Copyright 1997 - 2020 by IXIA Keysight # # 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,...
from unittest2 import TestCase from emv.protocol.response import RAPDU from emv.protocol.structures import TLV from emv.util import unformat_bytes from emv.cap import get_cap_value, get_arqc_req from emv.test.fixtures import APP_DATA # Issuer Proprietary Bitmap used in Barclays cards BARCLAYS_IPB = unformat_bytes("8...
""" Copyright (c) 2017 Cyberhaven 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, publish, distribute, sub...
from launchers.sandbox import Sandbox from tools import constants, paths, utils import json, sys, argparse CONTRACTS = {} # prefix a type name with 'bls12_381_' def bls(tname): return f'bls12_381_{tname}' def mk_contract(name, param, storage, code): CONTRACTS[name] = \ (f"parameter ({param});\n" ...
import six from weakref import ref as weakref from binascii import crc32 from rb.ketama import Ketama from rb._rediscommands import COMMANDS class UnroutableCommand(Exception): """Raised if a command was issued that cannot be routed through the router to a single host. """ class BadHostSetup(Exception)...
# coding: utf-8 """ Pure Storage FlashBlade REST 1.9 Python SDK Pure Storage FlashBlade REST 1.9 Python SDK. Compatible with REST API versions 1.0 - 1.9. Developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/). ...
import PIL.ImageOps import requests from PIL import Image, ImageDraw, ImageFont import urllib.request import os from os import getcwd from os.path import basename, join from wand.color import Color import re import asyncio import lottie from typing import Optional, Tuple from ub import LOGS , CMD_HELP from ub.utils i...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 29 18:56:23 2019 @author: pengming """ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import torch # transpose FLIP_LEFT_RIGHT = 0 FLIP_TOP_BOTTOM = 1 from .bounding_box import BoxList as bbox2 from maskrcnn_benchmark.dat...
# Filename: calPCE.py # Created: July/02/2018 # Last modified: July/07/2018 # Author: Prof. Leifur Leifsson # PhD student: Xiaosong '''PCE construction with quadrature method and collocation (OLS / LARS) method ''' import math import numpy as npy import multiIters import algPCE import collectio...
''' Exercicios sobre Estruturação de Dados em Python ''' # List Comprehension # A listcomp é uma forma pythônica de escrever um for ''' #Exemplo sem FOR linguagens = ["Python", "Java", "JavaScript", "C", "C#", "C++", "Swift", "Go", "Kotlin"] #linguagens = 'Python Java JavaScript C C# C++ Swift Go Kotlin'.split() #...
# Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. # Implement the LRUCache class: # LRUCache(int capacity) Initialize the LRU cache with positive size capacity. # int get(int key) Return the value of the key if the key exists, otherwise return -1. # void put(int key, int val...
import objsize def get_deep_byte_size(obj): return objsize.get_deep_size(obj)
import ast import sys from abc import ABC, abstractmethod from typing import List, Type if sys.version_info >= (3, 8): from typing import Protocol else: from typing_extensions import Protocol from tryceratops.processors import Processor from tryceratops.violations import Violation from .exceptions import Ana...
from face_recognition import face_locations, face_encodings, compare_faces import cv2 from pyttsx3 import init from keyboard import is_pressed from pickle import load, dump from os import listdir, remove from time import time from easygui import enterbox path_of_images = r"C:\Users\seenusanjay\PycharmProjects\pythonPr...
#!/usr/bin/env python3 import warnings from functools import partial from typing import Any, Callable, Dict, List, Optional, Tuple, Union import captum._utils.common as common import torch from captum._utils.av import AV from captum.attr import LayerActivation from captum.influence._core.influence import DataInfluenc...
#!/usr/bin/python # -*-coding:utf-8 -*- u""" :创建时间: 2021/2/24 3:00 :作者: 苍之幻灵 :我的主页: https://cpcgskill.com :QQ: 2921251087 :爱发电: https://afdian.net/@Phantom_of_the_Cang :aboutcg: https://www.aboutcg.org/teacher/54335 :bilibili: https://space.bilibili.com/351598127 """ from .group import group
from django.shortcuts import render # Create your views here. import requests import unicodedata import spotipy from spotipy.oauth2 import SpotifyClientCredentials import requests import urllib import json from pprint import pprint from .models import Journal sp = spotipy.Spotify(auth_manager=SpotifyClientCredentia...
# PyAlgoTrade # # Copyright 2011-2015 Gabriel Martin Becedillas Ruiz # # 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 a...
# -------------------------------------------------------- # Dual Octree Graph Networks # Copyright (c) 2022 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Peng-Shuai Wang # -------------------------------------------------------- import os import time import wget import shutil impor...
from __future__ import print_function from sklearn.metrics.pairwise import cosine_similarity from sklearn.decomposition import TruncatedSVD from sklearn.pipeline import make_pipeline from sklearn.preprocessing import Normalizer from sklearn import metrics from sklearn.decomposition import TruncatedSVD from sklearn.deco...
import sqlite3 import sys from libs.support.ctricks import ctricks operations = ['add'] args = sys.argv[1:] print('doto v.0.1.1') print('author: Paul Smalling <thelambofgoat@gmail.com>') if ('adds' not in operations): sys.exit('Недопустимая операция, на данный момент допустима только операция ' + ctricks.BOLD +...
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modif...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.TravelScene import TravelScene class KoubeiMarketingDataSceneTravelGetModel(object): def __init__(self): self._biz_info = None self._ext_info = None s...
page_names = ["main", "inventory", "accessories", "ender_chest", "armor", "vault", "wardrobe", "storage", "pets", "misc"] # Item descriptive icons MISSING = "<:missing:854823285825208372>" PRICE_SOURCE = "<:price_source:854752333299974174>" RECOMBOBULATOR = "<:recombobulator:854750106376339477>" ART_OF_WAR = "<:art_...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
from scoreformula import scoreformuladict as calculate from scoreconfig import scoreconfiguration as sconfig from pprint import pprint def calctotalscore(score): return (sum(score.values())) def calcdeathscore(playername, game, player): return calculate['deathscore'](player['deaths']) def calcwinscore(player...
# !/usr/bin/env python # coding=UTF-8 """ @Author: WEN Hao @LastEditors: WEN Hao @Description: @Date: 2021-07-27 @LastEditTime: 2021-09-07 """ from typing import Union, NoReturn, List import lru from .base import Constraint from ..transformations import ( Transformation, transformation_consists_of_word_subst...
{ "targets": [{ "target_name": "neon", "sources": [ "src/neon.cc" ], "include_dirs": [ "<!(node -e \"require('nan')\")" ], 'configurations': { 'Release': { 'msvs_settings': { 'VCCLCompilerTool': { # Optimization ...
from flask import Flask, jsonify from flask import render_template, request, redirect, url_for, make_response, session, flash from werkzeug.security import generate_password_hash, check_password_hash from werkzeug.datastructures import FileStorage from master import master_text, master_image from google_cloud_nlp impo...
# -*- coding: utf-8 -*- import argparse import pdb import traceback from itertools import combinations from math import prod from typing import List, Tuple def find_matching_sum(values: List[int], goal: int, k: int) -> Tuple[int, ...]: for trie in combinations(values, k): if sum(trie) == goal: ...
from django.db import models from django.db import * class Cow_Traffic(models.models): Animal Number(models.IntegerField(max_lenght= 5, blank= False, unique=True) Group Name(models.CharField(max_lenght= 6, blank=False, null=False) Date Time(models.DateTimeField(auto_now=True, auto_now_add=True, blank=False) ...
""" Copyright 2013 Steven Diamond 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, software...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import AppConfig class LinkConfig(AppConfig): name = 'link'
class Pesan: def __init__(self): print("Ini class Order") def setOrder(self, noPesan, tglPesan, checkIn, checkOut, bykTamu): Pesan.nomorPesanan = noPesan Pesan.tanggalPesan = tglPesan Pesan.tanggalMasuk = checkIn Pesan.tanggalKeluar = checkOut Pesan.jumlahTamu = ...
import os,sys import numpy as np # This module has functions and defintions to load the optical # properties required by the MicroBooNE detector materialnames = ["LAr", # liquid argon [ may have its own module one day ] "ArGas", # gaseous argon ...
from setuptools import setup setup( name='killrvideo_dsl', version='0.1.0', packages=['killrvideo_dsl'], url='https://killrvideo.github.io/', description='KillrVideo DSL', install_requires=[ 'aenum', 'dse-graph', 'gremlinpython' ], classifiers=[ "Intended...
import matplotlib.pyplot as plt import pandas as pd from sklearn.linear_model import LinearRegression # Splitting the dataset into the Training set and Test set from sklearn.model_selection import train_test_split # Fitting Polynomial Regression to the dataset from sklearn.preprocessing import PolynomialFeatures # I...
from __future__ import annotations from typing import List from abc import ABC, abstractmethod class RealObject(ABC): """ This class represents a real object in the proxy design pattern. """ @abstractmethod def get_list(self) -> List: raise NotImplementedError() class ProxyObject(ABC): """ This class repr...
from django.shortcuts import render from django.http import HttpResponse import requests from bs4 import BeautifulSoup import smtplib import time from .forms import MyForm def home(request): if request.method == 'POST': form = MyForm(request.POST) if form.is_valid(): url = form.cleane...
"a*"
from collections import defaultdict import gzip import requests import threading import time import zlib from apmserver import ServerBaseTest, ClientSideBaseTest, CorsBaseTest try: from StringIO import StringIO except ImportError: from io import StringIO class Test(ServerBaseTest): def test_ok(self): ...
from django.urls import path from apps.users import views urlpatterns = [ path("signin", views.signin), path("login", views.login), path("logout", views.logout), ]