text
stringlengths
2
999k
""" Filename: mnist_dataset.py File Description: mnist dataset is acquired from tensorflow datasets and split into training and test dataset. There are getter functions to retrieve training and test dataset. Created by: Abirami Ravi - University of Stuttgart (abirami1429@gmail....
from typing import Any, List import numpy as np import torch.nn import torch from cptr_model.config.config import Config from cptr_model.config.specifics.cptr.architecture_config_file_manager import ArchitectureConfigFileManager from cptr_model.embeddings.position.base_position_embedding import BasePositionEmbedding ...
from __future__ import division, generators, print_function import random #import torch #from torch import nn #from torch.autograd import Variable #from torch.nn import functional as F #from torch.nn.parameter import Parameter #import torch.nn.functional as F import torch import torch.nn as nn import torch.nn.functiona...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from contextlib import closing try: from urllib.request import urlopen except ImportError: from urllib2 import urlopen import os import time CONSTANT_SLEEP = 15 INCREMENT_SLEEP = 17 MULTIPLIER_SLEEP = 2 N = 3 HTTP_CODES = [...
# Copyright 2019-2021 Wingify Software Pvt. 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 agr...
import unittest from day1 eimport calculate_fuel_required class TestAdventDayOne(unittest.TestCase): def test_day_one(self): received = calculate_fuel_required(12) expected = 2 self.assertTrue(received, expected) received = calculate_fuel_required(14) expected = 2 ...
from __future__ import annotations from actions import ( Impossible, Action, ActionWithPosition, ActionWithDirection, ActionWithItem, ) class MoveTo(ActionWithPosition): """Move an entity to a position, interacting with obstacles.""" def plan(self) -> Action: if self.actor.locati...
import pytest from tests.models import EmployeeInfo @pytest.mark.asyncio async def test_model_counting(loaded_database_and_model): db, Employees = loaded_database_and_model all_employees = await Employees.all() employee_count = await Employees.count() print(f"Number of Employees is ", employee_count)...
# -*- coding: utf-8 -*- ### # (C) Copyright [2021] Hewlett Packard Enterprise Development LP # # 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 #...
import time from pynq import Overlay import numpy as np from pynq import Xlnk import struct from scipy.misc import imread import cv2 xlnk = Xlnk() ol = Overlay("cnn.bit") conv = ol.Conv_0 pool = ol.Pool_0 # Conv1 IN_WIDTH1 = 28 IN_HEIGHT1 = 28 IN_CH1 = 1 KERNEL_WIDTH1 = 3 KERNEL_HEIGHT1 = 3 X_STRIDE1 = 1 Y_STRIDE1 =...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Union from .. import utilities, tables class Cluster(pulumi.Cu...
from pathlib import Path from typing import Optional, Sequence, Union from pandas.compat._optional import import_optional_dependency from pandas.core.dtypes.inference import is_list_like from pandas.core.api import DataFrame from pandas.io.common import stringify_path def read_spss( path: Union[str, Path], ...
import dash from dash.dependencies import Input, Output from dash import dcc from dash import html import plotly.express as px import pandas as pd import dash_draggable external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] app = dash.Dash(__name__, external_stylesheets=external_stylesheets) df = p...
from django.apps import AppConfig class ExtraConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'extra'
def test_new_book(): from myapp.bp_book.model_book import Book ''' GIVEN a book model WHEN a new book is created THEN check if fields are defined correctly ''' book = Book() book.type = 'Audiobook' book.title = 'Silent House' book.author = 'Orhan Pamuk' book.isbn = '256987123...
# """ Unit tests for embedder utils. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals # pylint: disable=no-member import tensorflow as tf from texar.modules.embedders import embedder_utils class GetEmbeddingTest...
import os import shutil import subprocess import carla import gym import pygame from PIL import Image from pygame.locals import * from hud import HUD from wrappers import * class CarlaDataCollector: """ To be able to drive in this environment, either start start CARLA beforehand with: Synchrono...
############# # Created 3-17-17 by JJW # For the Fragile Families Challenge # Implements scikit-learn's linear regression classifier # on the FFC data # # AGBTG # ########### # This website helped me: http://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LinearRegression.html import matplotlib matplotl...
# Author: Leland McInnes <leland.mcinnes@gmail.com> # # License: BSD 3 clause from __future__ import print_function import locale from warnings import warn import time from scipy.optimize import curve_fit from sklearn.base import BaseEstimator from sklearn.utils import check_random_state, check_array from sklearn.uti...
# -*- coding: utf-8 -*- """The SleuthKit (TSK) path specification resolver helper implementation.""" from dfvfs.file_io import tsk_file_io from dfvfs.lib import definitions from dfvfs.resolver_helpers import manager from dfvfs.resolver_helpers import resolver_helper from dfvfs.vfs import tsk_file_system class TSKRes...
from django.conf.urls import url from django.http import HttpResponse urlpatterns = [ url(r'^$', lambda req: HttpResponse('OK')), ]
# Copyright (c) 2012, Ryan Kelly. # All rights reserved; available under the terms of the MIT License. """ playitagainsam.eventlog: event reader/writer for playitagainsam ================================================================ """ import os import json from tempfile import NamedTemporaryFile import six...
import unittest import chainer import chainer.cuda import chainer.functions as F import chainer.links as L import chainer.testing import chainermn import numpy as np import pytest class Model(chainer.Chain): def __init__(self, n_vocab, n_hid, communicator, rank_next, rank_prev): n_layer = 1 n_rnn...
from .._tier2 import maximum_of_all_pixels from .._tier0 import create_none from .._tier0 import execute from .._tier0 import plugin_function from .._tier0 import Image @plugin_function(output_creator=create_none) def centroids_of_labels(labels:Image, pointlist_destination :Image = None, include_background :bool = Fal...
import math import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.utils.weight_norm as wn from torch.nn.parameter import Parameter from torch import Tensor from src.models.utils import get_activation from typing import List, Tuple, Dict, Union from collections import deque from scipy.spec...
import turtle from math import pi, sin, cos def hexagone(point, longueur,c): l = longueur x, y = point turtle.up() turtle.goto(point) turtle.color(c[0]) #black turtle.down() turtle.begin_fill() turtle.goto(l * cos(4 / 3 * pi )+x, l * sin(4 / 3 * pi)+y) turtle.goto(l * cos(5 / 3 * pi)+x, l...
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from django.http import Request request: Request = ... class StrIsTainted: def __str__(self): return request.GET["tainted"] ...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Dict, List, Mapping, Optional, Tuple, Union from .. import ...
import numpy as np import matplotlib.pyplot as plt from sklearn.datasets.samples_generator import make_blobs from sklearn.cluster import KMeans from sklearn.cluster import MiniBatchKMeans from sklearn import metrics import pandas as pd plt.rcParams['figure.figsize'] = (45.0, 45.0) order = pd.read_csv("./order_201611...
import logging from collections import Counter from time import time from brownie import chain from joblib import Parallel, delayed import yearn.iearn import yearn.ironbank from yearn.outputs.describers.registry import RegistryWalletDescriber import yearn.special import yearn.v1.registry import yearn.v2.registry from...
import csv import os import pandas as pd from coleman4hcs.evaluation import EvaluationMetric class MonitorCollector(object): """ The monitor class is used to collect data during a experiment """ def __init__(self): """ experiment: Experiment number step: Part number (Build) f...
# -*- coding: iso-8859-15 -*- # *------------------------------------------------------------------ # * cspaxl_DevicePool.py # * # * Cisco AXL Python # * # * Copyright (C) 2021 Carlos Sanz <carlos.sanzpenas@gmail.com> # * # * This program is free software; you can redistribute it and/or # * modify it under the terms ...
# 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. # -----------------------------------------------------...
# pylint: disable=too-many-lines # 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) AutoRe...
#!/usr/bin/env python # Copyright (c) 2015, 2019 IBM Corp. 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...
load("@bazel_skylib//lib:paths.bzl", "paths") def _pkg_zip_impl(ctx): files = " ".join(["%s" % dep.path for dep in ctx.files.deps]) cmd = """ echo -n "{contents}" | xargs -d ' ' -I % touch -t 200001010000 % zip -X {args} {path} {contents} """ cmd = cmd.format( path = ctx.outputs.zip.path, ...
_base_ = './mask_rcnn_x50_32x4d_fpn_gn_ws-all_2x_coco.py' # learning policy lr_config = dict(step=[20, 23]) runner = dict(type='EpochBasedRunner', max_epochs=24)
"""Commands: "!addmod", "!delmod".""" from bot.commands.abstract.command import Command from bot.utilities.permission import Permission from bot.utilities.tools import replace_vars class EditCommandMods(Command): """Command for owners to add or delete mods to list of trusted mods.""" perm = Permission.Admin...
#!/usr/bin/env python3 """ Author : Ken Youens-Clark <kyclark@gmail.com> Date : 2020-03-27 Purpose: Parse water chemistry data """ import argparse import os import re import sys import io from itertools import chain, starmap from collections import defaultdict, Counter from typing import Dict, List, TextIO, NamedTup...
"""This is code based on https://sudomake.ai/inception-score-explained/.""" import torch import torchvision from collections import defaultdict class InceptionScore(torch.nn.Module): """Class that manages and returns the inception score of images.""" def __init__(self, batch_size=32, setup=dict(device=torch....
# Copyright (c) 2016 OpenStack Foundation # # 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 i...
# -*- coding: utf-8 -*- #!/usr/bin/env python import sys import os project_name = sys.argv[1] print("create project: %s" % project_name) filename = "projects/%s/spider.py" % project_name if not os.path.exists(os.path.dirname(filename)): os.makedirs(os.path.dirname(filename)) spider="""# -*- coding: utf-8 -*- #!...
import pytest from ..models import User # ele usa o banco de dados pytestmark = pytest.mark.django_db #criando um usuario def test_create_user(): user = User.objects.create_user( username="usuario_test", email="usuario@test.com", password="passw0rd" ) assert user.username == "usuario_test" ...
# coding: utf-8 """ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ ...
class Material: def __init__(self, rodzaj, dlugosc, szerokosc): self.r=rodzaj self.dl=dlugosc self.szer=szerokosc def wyswietl_nazwe(self): return (self.r, self.dl, self.szer) class Ubrania(Material): def __init__(self, rozmiar, kolor, dla_kogo): self.ro=...
"Module 'errno' on firmware 'v1.10-247-g0fb15fc3f on 2019-03-29'" EACCES = 13 EADDRINUSE = 98 EAGAIN = 11 EALREADY = 114 EBADF = 9 ECONNABORTED = 103 ECONNREFUSED = 111 ECONNRESET = 104 EEXIST = 17 EHOSTUNREACH = 113 EINPROGRESS = 115 EINVAL = 22 EIO = 5 EISDIR = 21 ENOBUFS = 105 ENODEV = 19 ENOENT = 2 ENOMEM = 12 ENOT...
import argparse parser = argparse.ArgumentParser() parser.add_argument('task', metavar='TASK', choices=[ 'PSR', 'RSR', 'PPI', 'RES', 'MSP', 'SMP', 'LBA', 'LEP' ], help="{PSR, RSR, PPI, RES, MSP, SMP, LBA, LEP}") parser.add_argument('--num-workers', metavar='N', type=int, default=4, help='number...
import aiohttp from greendoge.rpc.full_node_rpc_client import FullNodeRpcClient from greendoge.util.byte_types import hexstr_to_bytes from greendoge.util.config import load_config from greendoge.util.default_root import DEFAULT_ROOT_PATH from greendoge.util.ints import uint16 from greendoge.util.misc import format_byt...
class SensorError(Exception): def __init__(self, message='Sensor Error'): super().__init__(message) class GroupError(Exception): def __init__(self, message='Group Error'): super().__init__(message) class TempError(Exception): def __init__(self, message='Error with setting temp'): ...
import os import multiprocessing def copy_file(q, file_name, copy_folder_name, new_folder_name): copy_f = open(copy_folder_name + "/" + file_name, "rb") content = copy_f.read() copy_f.close() new_f = open(new_folder_name + "/" + file_name, "wb") new_f.write(content) new_f.close() q.put(f...
from datetime import datetime from django.contrib.auth import authenticate from django.contrib.auth.models import User, Group from django.views.decorators.csrf import csrf_exempt from rest_framework import permissions from rest_framework import viewsets from rest_framework.authtoken.models import Token from rest_framew...
# Generated by Django 2.0.4 on 2018-05-09 13:50 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('organisation', '0001_initial'), ] operations = [ migrations.CreateModel( name='ProjectTag', ...
from logging import getLogger logger = getLogger("__name__") from sklearn.decomposition import PCA import pandas as pd import numpy as np import matplotlib.pylab as plt import warnings from .plot import annotate_points, _def_label_alignment import seaborn as sns from matplotlib.patches import Ellipse import matplot...
from sklearn_explain.tests.skl_datasets_reg import skl_datasets_test as skltest skltest.test_reg_dataset_and_model("freidman2" , "XGBRegressor_11")
from django.db import models import os import uuid def book_image_file_path(instance, filename): """ Generate a file path and unique name for new book image """ ext = filename.split(".")[-1] filename = f"{uuid.uuid4()}.{ext}" return os.path.join("uploads/book/", filename) class Book(models....
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Feb 17 16:55:24 2021 @author: pmchozas """ import stanfordnlp stanfordnlp.download('es') # This downloads the English models for the neural pipeline nlp = stanfordnlp.Pipeline() # This sets up a default neural pipeline in English doc = nlp("inevitab...
import logging import azure.functions as func import os import requests from .luis import get_luis from .search import get_search def main(req: func.HttpRequest) -> func.HttpResponse: req_body = req.get_json() text = req_body.get('text').lower() luis_response = get_luis(text) if(luis_response == 'kno...
# coding: utf-8 # # Copyright 2022 :Barry-Thomas-Paul: Moss # # 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...
# -*- coding: utf-8 -*- # ------------------------------------------------------------------ # Filename: <filename> # Purpose: <purpose> # Author: <author> # Email: <email> # # Copyright (C) <copyright> # -------------------------------------------------------------------- """ :copyright: <copyright> :licen...
import datetime,sys from MPMUtils.ElementDBSave import ElementDBSave from MPMUtils.ElementFileSaveOrUpdate import ElementFileSaveOrUpdate from MPMUtils.parseHtml import parseHtml from MPMUtils.Logging import logError def UIElementSave(request): """ Used to save the UI Screen :par...
""" @author: ahmed allam <ahmed.allam@yale.edu> """ import os from copy import deepcopy from collections import OrderedDict import numpy from .utilities import ReaderWriter, create_directory, vectorized_logsumexp class LCRFModelRepresentation(object): """Model representation that will hold data structures to be...
# -*- coding: utf-8 -*- # This code is distributed under the two-clause BSD license. # Copyright (c) 2013 Raphaël Barrois import time class Bucket(object): """A bucket. A bucket "leaks" queries at a rate of ``rate`` per second, and has a maximum capacity of ``capacity``. When a new request arrives...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. class AxError(Exception): """Base Ax exception. All exceptions derived from AxError need to define a custom e...
# Copyright 2017-2020 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fil...
import sys import glob import shutil import os import subprocess import time import platform # TODO: This is a work-in-progress script that splits Europarl into years and then runs the extractors, # TODO: instead of trying to run on the whole corpus at once. Made by @bbonf. LOG_FILE = '/tmp/neg.log' PERFECT_EXTRACTO...
from conans import ConanFile, CMake, tools from conans.model.version import Version from conans.errors import ConanInvalidConfiguration import os class QuillConan(ConanFile): name = "quill" description = "C++14 Asynchronous Low Latency Logging Library" homepage = "https://github.com/odygrd/quill/" topi...
''' Author: Griffin Melnick, melnick.griffin@gmail.com File: day21.py Purpose: Advent of Code 2017, day 21 Pulls in command line input of 'a' or 'b' to represent which set of functions to call based on part. ''' from collections import defaultdict import numpy as np import os impor...
from argparse import Namespace from dataclasses import dataclass from typing import List, Tuple, Type, Dict, T import torch.distributed as dist import torch.nn import fltk.nets as nets from fltk.datasets import CIFAR10Dataset, FashionMNISTDataset, CIFAR100Dataset, MNIST from fltk.datasets.dataset import Dataset CLIE...
''' test_k4a_azurekinect.py Tests for the k4a functions for Azure Kinect device. Copyright (C) Microsoft Corporation. All rights reserved. ''' import unittest import ctypes from time import sleep import k4a import test_config def get_1080p_bgr32_nfov_2x2binned(device_handle): return test_config.get_captur...
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os from spack import * class Papyrus(CMakePackage): """Parallel Aggregate Persistent Storage""" homepag...
# -*- coding: utf-8 -*- # Copyright (c) 2019 Uber Technologies, 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 ...
# Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Migrates histogram_suffixes to patterned histograms""" import argparse import logging import os from xml.dom import minidom import extract_histograms im...
""" An opportunity to explore how to make an EV3 Robot move. Authors: Dave Fisher, David Mutchler, Vibha Alangar, their colleagues, and PUT_YOUR_NAME_HERE. """ # TODO: 1. PUT YOUR NAME IN THE ABOVE LINE. # ------------------------------------------------------------------------------ # TODO: 2. # Follow along with...
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2009 Doug Hellmann All rights reserved. # """ """ #end_pymotw_header import sys import textwrap names = sorted(sys.modules.keys()) name_text = ', '.join(names) print textwrap.fill(name_text, width=65)
import time from authlib.oauth2.rfc6749 import ( TokenMixin, AuthorizationCodeMixin, ) from django.db import models class OAuth2AuthorizationCodeMixin (AuthorizationCodeMixin): code = models.CharField(max_length=120, unique=True, null=False) client_id = models.CharField(max_length=48) redirect_ur...
# coding: utf-8 # Generated by Django 2.0.2 on 2018-02-22 15:44 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('whist', '0007_auto_20180222_1048'), ] operations = [ migrations.AlterField( model_name='whistjeu', n...
import setuptools import re with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="seabreeze-server", version="0.2.1", author="Jonathan D B Van Schenck", author_email="vanschej@oregonstate.edu", description="A TCP server to host the `python-seabreeze.cseabreeze...
import discord from discord.ext import commands from dotenv import load_dotenv load_dotenv() import os bot = discord.Client() bot = commands.Bot(command_prefix='&',help_command=None) for filename in os.listdir('cogs'): if filename.endswith('.py'): bot.load_extension(f'cogs.{filename[:-3]}') @bot.event async def on...
import argparse import numpy as np import pandas as pd import tifffile import skimage.io import skimage.measure import skimage.feature import skimage.segmentation import skimage.morphology #TODO make importable by python script parser = argparse.ArgumentParser(description='Extract Features 2D') #TODO create factory ...
#!/usr/bin/env python import numpy as np import matplotlib.image as mpimg import matplotlib.pyplot as plt import pcl from sensor_msgs.msg import PointCloud # Extra points from point cloud according to indices def extra_pc(pc, indices): coord = [] for index in indices: coord.append(list(pc[index])) ...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- __version__ = '1.18.80' # ----------------------------------------------------------------------------- import asyncio import concurrent import socket import time import math import random import certifi import a...
""" nextcord.ui ~~~~~~~~~~~ Bot UI Kit helper for the Discord API :copyright: (c) 2015-present Rapptz :license: MIT, see LICENSE for more details. """ from .view import * from .item import * from .button import * from .select import *
from django.apps import AppConfig class UsersConfig(AppConfig): name = 'mrpulse.users' verbose_name = "Users" def ready(self): """Override this to put in: Users system checks Users signal registration """ pass
# encoding: utf-8 # Copyright 2012 Red Hat, 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 applica...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import shutil import sys import tempfile from observations.r.wght_loss_incentive7 import wght_loss_incentive7 def test_wght_loss_incentive7(): """Test module wght_loss_incentive7.py by downloading wght_...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import ...
#!/usr/bin/python # -*- coding: utf-8 -*- __author__ = "Konstantinos Panayitou" __maintainter__ = "Konstantinos Panayiotou" __email__ = "klpanagi@gmail.com" __version__ = "Alpha" from rapp_robot_api import RappRobot from RappCloud import RappPlatformAPI from RappCloud.Utils import Net import sys from datetime import ...
# -*- coding: utf-8 -*- # Copyright 2016 Yelp 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 law or ag...
# /////////////////////////////////////////////////////////////// # # BY: WANDERSON M.PIMENTA # PROJECT MADE WITH: Qt Designer and PySide6 # V: 1.0.0 # # This project can be used freely for all uses, as long as they maintain the # respective credits only in the Python scripts, any information in the visual # interface ...
#!/usr/bin/env python3 # 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 ...
import os import json from pprint import pprint arr = os.listdir('../lib') combined = "" for file in arr: with open('../lib/' + file) as data_file: data = json.load(data_file) combined += json.dumps(data) pprint(data) writer = open('../chrome/frameworks.js', 'w') writer.write('let dog = ' + comb...
from .ranking import CreditRanking from .interleaving_method import InterleavingMethod import numpy as np from scipy.optimize import linprog class Optimized(InterleavingMethod): ''' Optimized Interleaving Args: lists: lists of document IDs max_length: the maximum length of resultant inter...
import sqlite3 conn = sqlite3.connect('iz.db') cursor = conn.cursor() cursor.execute(""" CREATE TABLE nivel ( nivel_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, nivel_nome VARCHAR(30) NOT NULL, UNIQUE(nivel_nome) ); """) cursor.execute(""" CREATE TABLE usuario ( usuario_id INTEGER NOT NULL...
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.d (the "License"); # you may not use this file except in compliance with the License. # import asyncio from asyncio import sleep from userbot import BOTLOG, BOTLOG_CHATID, CMD_HELP from userbot.events impo...
# -*- coding: utf-8 -*- # Copyright 2017 ProjectQ-Framework (www.projectq.ch) # # 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 # # ...
from files_05_Animals.animal import Animal class Cat(Animal): def __init__(self, name, age, gender): super().__init__(name, age, gender) def make_sound(self): return 'Meow meow!'
import importlib import sys from types import ModuleType from typing import Dict, List, Union from ebonite.config import Core from ebonite.utils.classproperty import classproperty from ebonite.utils.importing import import_module, module_importable, module_imported from ebonite.utils.log import logger class Extensio...
API_KEY = "AIzaSyC_LDEN4uh1WdX6iCsV9rFQmmlnoO6582k"
# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Integration tests for results_processor. These tests write actual files with intermediate results, and run the standalone results processor on them to ch...
from typing import TYPE_CHECKING, Optional import datetime from enum import Enum import json from hoss.api import CoreAPI from hoss.ref import DatasetRef import hoss.error if TYPE_CHECKING: from hoss.namespace import Namespace PERM_NONE = None PERM_READ = "r" PERM_READ_WRITE = "rw" class DeleteStatus(Enum): ...