content
stringlengths
5
1.05M
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import math import torch from pytext.config import ConfigBase from pytext.config.component import Component, ComponentType from pytext.optimizer import Optimizer from torch.optim.lr_scheduler import ( CosineAnnealingLR as...
import os from functools import namedtuple import dgl import dgl.function as fn import numpy as np import torch from dgl.data import PPIDataset from ogb.nodeproppred import DglNodePropPredDataset, Evaluator from sklearn.metrics import accuracy_score, f1_score import scipy.sparse as sp import json from networkx.readwr...
import pytest from pybetter.cli import process_file from pybetter.improvements import FixMutableDefaultArgs NO_CHANGES_MADE = None # In these samples we do not use indents for formatting, # since this transformer uses module's inferred indentation # settings, and those will be like _8_ spaces or such. NON_MUTABLE_DE...
# The goal is to take several SQL queries, completely similar except # the values, and generalise by doing the inverse operation of binding # variables to a possibly prepared query. # # The results are sets of variables which represent the application data. # If we can deduce the most important variables: Indexed colum...
#!/usr/bin/env python # -*- coding:utf-8 -*- import os import time import json from base64 import b64encode import requests from Crypto.PublicKey import RSA from Crypto.Cipher import PKCS1_v1_5 as Cipher_pkcs1_v1_5 RSA_PUBLIC_KEY = """-----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDC7kw8r6tq43pwApYv...
#! /usr/bin/env python3 from datetime import datetime from sys import argv, exit from time import sleep from json import load from notify import notify ## Import Site-Specific Checkers from websites.newegg import check as newegg from websites.bestbuy import check as bestbuy CHECK = { 'newegg': newegg, ...
from tornado import web from controllers._base import BaseController class HomeController(BaseController): @web.authenticated async def get(self): self.renderTemplate('home.html') @web.authenticated async def post(self): self.renderJSON({'user': self.current_user.toDict()})
# Copyright 2019 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, ...
from bitmovin_api_sdk.encoding.infrastructure.kubernetes.agent_deployment.agent_deployment_api import AgentDeploymentApi
# # Copyright 2015-2017 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...
import requests from datetime import datetime, timedelta from pytz import timezone from source.classes import Channel, Program from source.utils import get_epg_datetime PROGRAMS_URL = "https://nwapi.nhk.jp/nhkworld/epg/v7b/world/s{start}-e{end}.json" def get_all_channels(): # Hardcode since we are only dealing with...
# NASA EO-Metadata-Tools Python interface for the Common Metadata Repository (CMR) # # https://cmr.earthdata.nasa.gov/search/site/docs/search/api.html # # Copyright (c) 2020 United States Government as represented by the Administrator # of the National Aeronautics and Space Administration. All Rights Reserved. # # ...
''' Instructions: 1. Run python dino_jump.py - This launches the training tool. 2. Click on the pygame window thats opened to make sure windows sends the keypresses to that process. 3. Relax the Myo arm, and with your other hand press 0 - This labels the incoming data as class 0 4. Make a fist with your hand and press ...
# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from UM.Logger import Logger from UM.i18n import i18nCatalog from UM.Qt.Duration import DurationFormat from cura.CuraApplication import CuraApplication from cura.PrinterOutputDevice import PrinterOutputDevice, ConnectionSt...
import random from paragen.samplers import AbstractSampler, register_sampler from paragen.utils.runtime import Environment @register_sampler class ShuffleSampler(AbstractSampler): """ ShuffleSampler shuffle the order before fetching samples. """ def __init__(self, **kwargs): super().__init__...
import numpy as np from icecream import ic from pathlib import Path import cv2 data = np.load('data/dance-twirl.npy')[0].astype(np.uint8) label = np.load('labels/dance-twirl.npy')[0].argmax(axis=-1) label = label.astype(np.uint8)*255 ic(label.shape) ic(np.unique(label, return_counts=True)) ic(data.shap...
# -*- coding: utf-8 -*- from time import sleep from .baseapi import BaseAPI class Action(BaseAPI): def __init__(self, *args, **kwargs): self.id = None self.token = None self.status = None self.type = None self.started_at = None self.completed_at = None self...
# -*- coding: utf-8 -*- """Unit tests for contradictory_claims/data."""
# pylint: disable=missing-module-docstring from .wordle_agent import Agent
# -*- coding: utf-8 -*- """Functions to generate a list of steps to transition from the current state to the desired state.""" from __future__ import (unicode_literals, print_function) from creds import constants from creds.ssh import write_authorized_keys from creds.users import (generate_add_user_command, generate_m...
# -*- encoding: utf-8 -*- """ Copyright (c) 2019 - present AppSeed.us """ from app.home import blueprint from flask import render_template, redirect, url_for, request from flask_login import login_required, current_user from app import login_manager from jinja2 import TemplateNotFound import razorpay from bs4 import B...
#keep credit if u gonna edit or kang it #without creadit copy paster mc #creadits to sawan(@veryhelpful) learned from kraken import random, re from uniborg.util import admin_cmd import asyncio from telethon import events @borg.on(admin_cmd(pattern="mst ?(.*)")) async def _(event): if not event.te...
# ========================================================================== # Copyright (C) 2022 Intel Corporation # # SPDX-License-Identifier: MIT # ========================================================================== import argparse import os import subprocess import sys; import json; def run_cmd(cmd, args=[...
#!/usr/bin/python3 import tabula import sys import json import getTable from tableMap import getTableMap, getTableCols import pdf2pos def processBedsTable(filename): # Get Index & TableMap index = getTable.getIdFromFilename(filename) tableName = "beds" tableMap = getTableMap(index,tableName) colIn...
def main(): print("Is 2 less than 5?: ", (2 < 5)) print("Is 2 greater than 5?:", (2 > 5)) print("Is 2 equal than 5?: ", (2 == 5)) print("Is 3 greater than or equal to 3?: ", (3 >= 3)) print("Is 5 less than or equal to 1?: ", (5 >= 1)) print("Is True equal to True?: ", (True == True)) print...
from abc import ABC, abstractmethod from math import pi class Person: def __init__(self, name): self.name = name def introduce(self): print(f'Hello! I am {self.name}') class Shape(ABC): @abstractmethod def calculate_perimeter(self): pass @abstractmethod...
""" This PyQGIS script iterates through all layers with a name matching "_described" and: (1) Zooms to and displays all non-path features (2) Prompts user to confirm deletion (3) Deletes non-path features upon confirmation Selecting "No" will end the layer iteration loop. WARNING: This modifies local shap...
# Generated by Django 2.1 on 2018-12-21 07:07 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('articles', '0005_auto_20181219_1816'), ] operations = [ migrations.CreateModel( name='CommentEdit...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Aug 29 14:54:12 2018 @author: maximov """ import torch, os, sys, cv2 import torch.nn as nn from torch.nn import init import functools import torch.optim as optim from torch.utils.data import Dataset, DataLoader from torch.nn import functional as func ...
class Console: def __init__(self, input_path): self.instructions = [] self._read_program(input_path) self.accumulator = 0 self.loop = False # switches to True when revisiting an instruction def _read_program(self, input_path): lines = [line.strip() for line in open(i...
class Solution: def ambiguousCoordinates(self, s: str) -> List[str]: def make(frag): N = len(frag) for d in range(1, N + 1): left, right = frag[:d], frag[d:] if ((not left.startswith('0') or left == '0') and (not right.endswith('0'))): ...
#!/usr/bin/env python3 # coding=utf-8 import os import subprocess import requests import yaml import json import sys from pathlib import Path from loguru import logger from yuque import YuQue from lake2md import lake_to_md from dotenv import dotenv_values user_config = dotenv_values(".env") class Config: def _...
import base64 from rdflib import URIRef def http_formatter(namespace, value): """ Formats a namespace and ending value into a full RDF URI format with NO '<' and '>' encapsulation args: namespace: RdfNamespace or tuple in the format of (prefix, uri,) value: end value to attach to the namesp...
# # This file is part of PKPDApp (https://github.com/pkpdapp-team/pkpdapp) which # is released under the BSD 3-clause license. See accompanying LICENSE.md for # copyright notice and full license details. # """ Django settings for pkpdapp project. Generated by 'django-admin startproject' using Django 3.0.5. For more ...
# -*- coding: utf8 -*- # Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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...
import time class log: """ This module is used to track the progress of events and write it into a log file. """ def __init__(self,filepath,init_message): self.message = '' self.filepath = filepath self.progress = {'task':[init_message],'time':[time.process_time()]} ...
# coding:utf-8 __author__ = 'timmyliang' __email__ = '[email protected]' __date__ = '2020-03-24 13:44:48' """ """ import sys import inspect # NOTE https://stackoverflow.com/questions/4214936/ # intercept a function and retrieve the modifed values def get_modified_values(target): def wrapper(*args, **kwargs):...
class Solution: def canConstruct(self, ransomNote, magazine): """ :type ransomNote: str :type magazine: str :rtype: bool """ ransomNote = list(ransomNote) magazine = list(magazine) r_len = len(ransomNote) m_len = len(magazine) if r_len...
# -*- coding: utf-8 -*- """Test C-loop and BLAS ufuncs """ import hypothesis as hy import numpy as np import numpy_linalg.gufuncs._gufuncs_cloop as gfc import numpy_linalg.gufuncs._gufuncs_blas as gfb import numpy_linalg.testing.unittest_numpy as utn import numpy_linalg.testing.hypothesis_numpy as hn from numpy_linalg....
from read_inputs import read_file fileName = "d7_inputs.txt" # fileName = "d7_test.txt" # fileName = "real_inputs7.txt" counter = 0 max_num = 0 min_num = 0 import numpy as np def diff(test_point, data): #determine total diff from incoming data_list and test_point # diff(2, [[0, 1, 1, 2, 2, 2, 4, 7, 14, 16]]...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re import csv import copy import xlrd import operator from functools import reduce from django.db.models import Q from django.utils.timezone import datetime from idcops.lib.utils import shared_queryset from idcops.lib.tasks import device_post_sav...
import socket from django.conf import settings # noinspection PyUnusedLocal def from_settings(request): if not hasattr(from_settings, 'env_name'): from_settings.env_name = settings.ENVIRONMENT_NAME if hasattr( settings, 'ENVIRONMENT_NAME') else None from_settings.env_colou...
CN_DS_VICTORIAMETRICS = 1 CN_DS_POSTGRESQL = 0
import sys import urllib2 import urllib class Py3status: urls = [ 'youUrl.com'] status = '' def websitesStatus(self): self.status = '' color = self.py3.COLOR_LOW error = 0 for url in self.urls: req = urllib2.Request('http://'+url) resCode ...
from dataclasses import dataclass from typing import Iterable from rxbp.init.initsubscription import init_subscription from rxbp.mixins.flowablemixin import FlowableMixin from rxbp.observables.fromiteratorobservable import FromIteratorObservable from rxbp.subscriber import Subscriber from rxbp.subscription import Subs...
import os from livestyled.schemas.ticket_integration import TicketIntegrationSchema FIXTURES_DIR = os.path.join(os.path.dirname(__file__), 'fixtures') TEST_API_DOMAIN = 'test.livestyled.com' def test_deserialize_ticket_integration(): with open(os.path.join(FIXTURES_DIR, 'example_ticket_integration.json'), 'r')...
import processing import detection import classification import numpy as np import cv2 if __name__ == "__main__": #Run for image files img_filenames = ['1.png', '2.png', '3.png', '4.png', '5.png'] CNNmodel = None for img_file in img_filenames: #TODO Step 1 Processing numpy_save = ...
# -*- coding: utf-8 -*- from qiniu import QiniuMacAuth, http, urlsafe_base64_encode import json def createTemplate(access_key, secret_key, body): """ 创建模板 https://developer.qiniu.com/qvs/api/6721/create-template :param access_key: 公钥 :param secret_key: 私钥 :param body: 请求体 { ...
# Copyright (c) 2019-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # def f_gold ( mat , N ) : for i in range ( N ) : for j in range ( N ) : if ( mat [ i ] [ j ] != mat [ j ]...
import re def response(hey_bob): hey_bob = re.sub(r"[^a-zA-Z0-9\?]", "", hey_bob) print(len(hey_bob)) hey_bob_list = list(hey_bob) flag_lowercase = False flag_uppercase = False flag_question = False if len(hey_bob) == 0: return "Fine. Be that way!" if hey_bob[-1] == "?": flag_question...
""" Skill Labeller Preprocessor API endpoint """ import json import falcon import random import logging try: from skilloracle import SkillOracle except: from ..skilloracle import SkillOracle class SkillOracleEndpoint(object): def __init__(self, fetcher=None): self.host = "skilloracle" self...
import os class UrlList: DEFAULT_URL_LIST = 'config/url_list.txt' def __init__(self, url_list_path=DEFAULT_URL_LIST): if not os.path.exists(url_list_path): raise FileNotFoundError() self.url_list_path = url_list_path def read(self): urls = [] with open(self.url_list_path) as f: urls...
from django import template from django.utils.html import format_html from django.utils.safestring import mark_safe from timetable.models import RoomLink register = template.Library() @register.filter def for_event(weeks, event): result = [] oldBookingTxt = True bookingTxt = None run = 1 for wee...
""" This script is for unit testing of embedded pinterest_pin extractor Use pytest to run this script Command to run: /stampify$ python -m pytest """ import pytest from data_models.embedded_pinterest_pin import EPinterestPin from extraction.content_extractors import embedded_pinterest_pin_extractor fr...
# 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. import datetime import hashlib import logging import time from bisect import bisect_right from collections import OrderedDict, defaultdict fro...
# Copyright 2017 reinforce.io. 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 applicable law or...
import glob, os from variables import * # Reads .wav files in training_data directory, processes them, and outputs a .tdata file # with the aggregated training data that can be used by the model for training later on def prepare_training_data(): print("==PREPARE TRAINING DATA==") from training_data import Trai...
from stage import * class Active(Stage): def __init__(self, activeFn, inputNames, outputDim, defaultValue=0.0, outputdEdX=True, name=None): Stage.__init__(self, name=name, ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import frappe __version__ = '0.0.1' @frappe.whitelist(allow_guest=True) def authenticate(user, password): print "Esta ingresando", password, frappe.db.sql("""select company_name from `tabCompany` where company_name = 'Nodux'""", as_dict=1) print "...
from django.db import models # Create your models here. class song(models.Model): song = models.CharField(max_length=122)
# -*- coding: utf-8 -*- """Test constants for BEL Commons.""" import os __all__ = [ 'dir_path', ] dir_path = os.path.dirname(os.path.realpath(__file__))
import os def dot2svg(filename, engine='dot'): data = { 'engine': engine, 'file': filename.replace(".dot", "") } command = "{engine} -Tsvg {file}.dot > {file}.svg".format(**data) print(command) os.system(command) def browser(filename): data = { 'engine': 'python -m web...
import logging import werkzeug.urls import urlparse import urllib2 import simplejson import openerp from openerp.addons.auth_signup.res_users import SignupError from openerp.osv import osv, fields from openerp import SUPERUSER_ID _logger = logging.getLogger(__name__) class res_users(osv.Model): _inherit = 'res....
# -*- coding: utf-8 -*- ############################################################################# # # Copyright © Dragon Dollar Limited # contact: [email protected] # # This software is a collection of webservices designed to provide a secure # and scalable framework to build e-commerce websites. # # This s...
from register import find_max_correlation, extract_patches, Registrator from numpy import testing import numpy as np from skimage.color import rgb2gray class TestRegister(): def setup(self): self.image = np.zeros((8, 8)) self.image[3:5, 3:5] = 1 self.template = np.zeros((3, 3)) sel...
# coding: utf-8 # ## Intro # This notebook aggregates the environmental data by event whereas before we were looking at the data by date. # ### Calculate number of locations that flooded # In[1]: get_ipython().magic(u'matplotlib inline') import os import sys module_path = os.path.abspath(os.path.join('..')) if mo...
# Copyright 2022 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
import crypto_tools def caesar_little_doc(): return "encrypt/decrypt using caesar algo" def caesar_full_doc(): return """ Just caesar algorithm. Uses dictionary from alphabers.json and move characters left and right """ def caesar_processing(data, lang, key): caesar_dict = crypto_tools...
import math r = float(input()) area = math.pi*r*r perimeter = 2*math.pi*r print('Area = ' + str(area) + '\nPerimeter = ' + str(perimeter))
DISPLAY_DIR = '.pypastry' DISPLAY_PATH = DISPLAY_DIR + '/display.txt' RESULTS_PATH = 'results' REPO_PATH = '.'
#------------------------------------# # Author: Yueh-Lin Tsou # # Update: 7/17/2019 # # E-mail: [email protected] # #------------------------------------# """------------------ - Image Contours ------------------""" # Import OpenCV Library, numpy and command line interface imp...
# Copyright (c) 2020 fortiss GmbH # # Authors: Julian Bernhard, Klemens Esterle, Patrick Hart and # Tobias Kessler # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. from bark.core.world.agent import Agent from bark.core.world import World from bark.c...
MAP_HEIGHT_MIN = 20 MAP_HEIGHT_MAX = 50 MAP_WIDTH_MIN = 20 MAP_WIDTH_MAX = 50 MAP_KARBONITE_MIN = 0 MAP_KARBONITE_MAX = 50 ASTEROID_ROUND_MIN = 10 ASTEROID_ROUND_MAX = 20 ASTEROID_KARB_MIN = 20 ASTEROID_KARB_MAX = 100 ORBIT_FLIGHT_MIN = 50 ORBIT_FLIGHT_MAX = 200 ROUND_LIMIT = 1000 def validate_map_dims(h, w): ret...
import os import paddle import paddle.nn as nn import numpy as np from U2Net.u2net import U2NET from U2Net.processor import Processor from paddlehub.module.module import moduleinfo @moduleinfo( name="U2Net", # 模型名称 type="CV", # 模型类型 author="jm12138", # 作者名称 author_email="[email protected]", # ...
import torch import torch.nn as nn from torch.autograd import Variable import numpy as np from EEGNAS.imported_models.Chrononet.base import ModelBase from EEGNAS.imported_models.Chrononet.lasso_feature_selection import LassoFeatureSelection import logging logger = logging.getLogger(__name__) class PytorchModelBase(...
import pandas as pd import pickle from sklearn.linear_model import LogisticRegression class Trainer: def __init__(self): pass def Dataset(self): self.dataset = pd.read_csv(r'dataset.csv') print(self.dataset.head()) def trainModel(self): self.Dataset() sel...
import inject import os from mycloud.common import to_generator from mycloud.photos.photos_client import PhotosClient class FsPhotosClient: photos_client: PhotosClient = inject.attr(PhotosClient) async def add(self, local_path, name): filename = os.path.basename(local_path) with open(local_...
# Fltk-widgets # # (c) 2022 Kevin Routley # # build a cross-ref between the test programs and the includes used # basically a means to determine which widgets are exercised in which test # # There are two different possible outputs. (Un-)comment as desired. # 1. Outputs markdown which is the table of widgets/images/tes...
# -*- coding: utf-8 -*- """Base Site class.""" from typing import ClassVar from typing import Dict from typing import List from mrsimulator.utils.parseable import Parseable from pydantic import validator from .tensors import AntisymmetricTensor from .tensors import SymmetricTensor __author__ = "Deepansh Srivastava" ...
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # from __future__ import absolute_import, division import os import sys import logging import tensorflow as tf import tensorflow...
""" Simple multithreaded algorithm to show how the 4 phases of a genetic algorithm works (Evaluation, Selection, Crossover and Mutation) https://en.wikipedia.org/wiki/Genetic_algorithm Author: D4rkia """ from __future__ import annotations import random # Maximum size of the population. bigger could be fa...
import c4d from .Const import Const class UD(): """ Class for handle our UserData. Since we cant access to curve data from Ressource file in python. The only solution is to build our object menu ourself via userData. It's a bit tricky since we have to rebuild everything from sratch everytime. But ...
#!/usr/bin/env python """ Explore encoding settings on a platform. """ from __future__ import print_function import sys import platform import locale from behave.textutil import select_best_encoding def explore_platform_encoding(): python_version = platform.python_version() print("python %s (platform: %s, %s,...
import numpy as np from ._CFunctions import _CInternalField,_CInternalFieldDeg def Field(p0,p1,p2,MaxDeg=None): ''' Return the internal magnetic field vector(s). Check the model config using JupiterMag.Internal.Config() to see whether Cartesian or polar coordinates are used for input/output and to set the model. ...
""" Send SMS through ASPSMS Adapted from repoze.sendmail: https://github.com/repoze/repoze.sendmail Usage: qp = SmsQueueProcessor(sms_directory) qp.send_messages() """ import errno import json import logging import os import pycurl import stat import time from io import BytesIO log = l...
from setuptools import setup setup(name='python-ecb-daily', version='0.3', description='Python ECB Daily Rates Wrapper', url='https://github.com/fatihsucu/python-ecb-daily', author='Fatih Sucu', author_email='[email protected]', license='MIT', packages=['ecb'], instal...
from .tf_sensaturban_dataset import SensatUrbanDataset
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name="neo_force_scheme", version="0.0.1", author="Leonardo Christino", author_email="[email protected]", description="NeoForceSceme, an extention of the origin...
from typing import List from . import movie_list, title_list from .common import SamuraiListBaseType class SamuraiContentsList(SamuraiListBaseType): titles: List[title_list.SamuraiListTitle] movies: List[movie_list.SamuraiListMovie] def _read_list(self, xml): assert xml.tag == 'contents' ...
# =============================================================================== # Copyright 2011 Jake Ross # # 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/licens...
# 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 sqlite3 as lite con = lite.connect('JobDetails.db') cur = con.cursor() cs = {} amounts = {} # for table in ['Reviews']: # cur.execute("SELECT Country FROM " + table) # countries = [each[0] for each in cur.fetchall()] countries = [] for table in ['Jobs', 'ReviewJobs']: cur.execute("SELECT CountryO...
#!/usr/bin/env python3 # suspenders.py - keep your pants on import os.path import functools from .util import elements PANTS_TARGETS = [ 'android_binary', 'android_dependency', 'android_library', 'android_resources', 'annotation_processor', 'benchmark', 'confluence', 'contrib_plugin', 'cpp_binary',...
def fibonacci(n): result = [] x, y = 0, 1 while x < n: result.append(x) x, y = y, y + x return result
import tensorflow as tf from keras.preprocessing.image import ImageDataGenerator from keras.preprocessing.image import array_to_img, img_to_array, load_img from keras.preprocessing.image import DirectoryIterator,DataFrameIterator import numpy as np class TimeDistributedImageDataGenerator(ImageDataGenerator): def _...
import itertools from . import kernel_defs _kern_base = [kernel_defs.LinKernel, kernel_defs.SEKernel, kernel_defs.PerKernel] _kern_op = [kernel_defs.SumKernel, kernel_defs.ProdKernel] _ext_pairs = list(itertools.product(_kern_base, _kern_op)) def replace(old_kernel, new_kernel): parent = old_kernel.parent ...
import graphene from levels.types import Power from levels.models import PowerModel from badges.models import BadgeModel from levels.types import Level, Host from levels.models import LevelModel, HostModel from common.fields import CustomMongoengineConnectionField from pprint import pprint from inspect import getmemb...
""" # Definition for a Node. class Node: def __init__(self, val: int = 0, left: 'Node' = None, right: 'Node' = None, next: 'Node' = None): self.val = val self.left = left self.right = right self.next = next """ class Solution: def connect(self, root): def recursive_conn...
import discord import asyncio import os import json import requests from discord.ext import commands from discord.ext.commands import has_permissions import random green = discord.Color.green() class helpp(commands.Cog): def __init__(self,client): self.client=client @commands.command() async def help(self,ctx):...
import setuptools with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setuptools.setup( name="PyRestart", version="1.0.0", author="MXPSQL", author_email="[email protected]", description="Restart module", long_description=long_description, ...