content
stringlengths
5
1.05M
from numpy.polynomial import Chebyshev polyT = poly.convert(kind=Chebyshev)
import sys import logging import os import time import re import threading import hashlib import xml.dom.minidom import tokens from datetime import datetime SPLUNK_HOME = os.environ.get("SPLUNK_HOME") RESPONSE_HANDLER_INSTANCE = None SPLUNK_PORT = 8089 STANZA = None SESSION_TOKEN = None REGEX_PATTERN = None # dynami...
#!/usr/bin/env python # by TR from obspy.signal.cpxtrace import envelope from sito.noisexcorr import setHIDist import matplotlib.pyplot as plt from sito.stations import IPOCStations from sito.stream import read from operator import itemgetter from scipy.optimize import curve_fit from matplotlib.patches import Polygon...
def always_satisfied(values: tuple) -> bool: return True def never_satisfied(values: tuple) -> bool: return False def all_equal_constraint_evaluator(values: tuple) -> bool: if len(values) == 1: return True first_val = values[0] for val in values: if val != first_val: ...
from typing import Union from kivy.graphics.instructions import RenderContext, InstructionGroup from primal.engine.sprite import ColorSprite class HealthBar: def __init__(self, pos, size, max_health: float = 100): self.max_health = max_health self.health = max_health self.size = size ...
#%% import sys,math,json import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from icecream import ic #%% if len(sys.argv) == 3: filename = sys.argv[1] input_json = sys.argv[2] else: filename = "sample_training_data.txt" input_json = "classic_reg_input.json" org_tr...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, \ unicode_literals import six __all__ = ["WordEmbedding", "classify_format"] import warnings import numpy as np from word_embedding_loader import loader, saver # Mimick namespace class _glove: loader = loader.glove ...
# # Copyright (c) 2015 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...
#!/usr/bin/env python ## Program: VMTK ## Module: $RCSfile: vmtkcenterlinesmoothing.py,v $ ## Language: Python ## Date: $Date: 2006/07/17 09:52:56 $ ## Version: $Revision: 1.1 $ ## Copyright (c) Luca Antiga, David Steinman. All rights reserved. ## See LICENCE file for details. ## This software ...
""" ELF (Unix/BSD executable file format) parser. Author: Victor Stinner, Robert Xiao Creation date: 08 may 2006 Reference: - System V Application Binary Interface - DRAFT - 10 June 2013 http://www.sco.com/developers/gabi/latest/contents.html """ from hachoir.parser import HachoirParser from hachoir.field import (R...
# 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...
x = input().split() maxx =0 a = int(x[0]) b = int(x[1]) c = int(x[2]) d = int(x[3]) newX = [a,b,c,d] newX.sort() print(newX[0] * newX[2])
import sys import socket import threading import queue import base64 import json import time # Import specific application methods import blockchainrpcnetworking import blockchainrpcprocessing import blockchainrpcserver import blockchainrpcbackground # Create global variables readheadersjobqueue = queue.Queue() readh...
""" This module contains any functionality for downloading and extracting data from any remotes. """ import zipfile import tarfile import multiprocessing import requests from pget.down import Downloader from audiomate import logutil logger = logutil.getLogger() PROGRESS_LOGGER_BYTE_DELAY = 1024 * 1024 * 100 def ...
#!/usr/bin/python import sys import os from numpy import * ################################################################################ if len(sys.argv) >= 4: refFlat_filename = sys.argv[1] gpd_filename = sys.argv[2] output_filename = sys.argv[3] else: print("usage: python refFlat.txt gpd_filena...
# # Autogenerated by Thrift Compiler (0.8.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TException from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol, TProtocol try: from thrift.prot...
from django.conf.urls.defaults import * from alva.models import Idea idea_info_dict = { 'queryset': Idea.live.all(), 'date_field': 'think_date', } urlpatterns = patterns('django.views.generic.date_based', (r'^$', 'archive_index', idea_info_dict, 'alva_idea_archive_index'), (r'^(?P<year>\d{4})/$', 'ar...
from biosimulators_utils.simulator_registry import data_model import unittest class DataModelTestCase(unittest.TestCase): def test(self): sim1 = data_model.SimulatorSubmission( id='tellurium', version='2.1.6', specifications_url='https://raw.githubusercontent.com/biosim...
#!/bin/sh import os import sys from glob import glob import shutil THIS_RECIPE = os.getenv('RECIPE_DIR', '') conda_tools_dir = os.path.join(THIS_RECIPE, '..', 'conda_tools') print('conda_tools_dir', conda_tools_dir) sys.path.insert(0, conda_tools_dir) import utils # conda_tools import copy_ambertools def main(): ...
from minerva import mutils from twisted.application import service, strports from twisted.python.filepath import FilePath from webmagic.filecache import FileCache from cardboard.web import site def makeService(config): from twisted.internet import reactor multi = service.MultiService() domain = config[...
import numpy as np # Mirror all frames in a (N, S, H, W) dataset, returning the augmented data # axis = 2 for vertical (flip row order), 3 for horizontal (flip column order) def aug_mirror(dataset, axis): return np.flip(dataset, axis=axis) # Rotate 90 degrees CCW, the integer number of times specified # Rotates...
from django.db.models import Q from django.test import TestCase from django.contrib.auth.models import User, Group from django.db.models.signals import post_save from guardian.models import UserObjectPermission, GroupObjectPermission from governor.shortcuts import (get_users_eligible_for_object, get_groups_eligible...
#!/usr/bin/env python3 from .proc_base import ProcBase class CpuStats: ''' Represents a single CPU entry from the /proc/stat file. ''' # Format string for a table entry table_format_str = '| {0:>6} | {1:>9} | {2:>5} | {3:>11} | {4:>8} |' \ ' {5:>11} | {6:>5} | {percent:7.2...
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # 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 sympy import symbols, lambdify, diff, sqrt, I from sympy import besselj, hankel1, atan2, exp, pi, tanh import scipy.special as scp import numpy as np from scipy.sparse.linalg import gmres # gmres iteration counter # https://stackoverflow.com/questions/33512081/getting-the-number-of-iterations-of-scipys-gmres-ite...
#!/usr/bin/python3 # -*- coding: utf-8 -*- from manga_py import main if __name__ == '__main__': main()
# -*- coding: utf-8 -*- import json import traceback import logging import copy import inspect try: from urllib.parse import urlparse, parse_qs except ImportError: from urlparse import urlparse, parse_qs # type: ignore from requests.status_codes import _codes from tavern.schemas.extensions import get_wrappe...
from logging import getLogger logger = getLogger("__name__")
import shlex import diskspace import argparse import re from . import argpar, utils, pathRender def shell(): arguments = argpar.getarg() parser = argpar.Arguments(description="Making it possible to use Linux df & du command on Windows", add_help=False) parser.add_argument('--help', action='help', default...
import logging from struct import unpack logger = logging.getLogger(__name__) logger.addHandler(logging.NullHandler()) # https://msdn.microsoft.com/en-us/library/dd926359(v=office.12).aspx def _parse_encryptionheader(blob): (flags,) = unpack("<I", blob.read(4)) # if mode == 'strict': compare values with spec...
#!/usr/bin/env python import pytest PUZZLE_INPUT = "273025-767253" def increasing(number, submatching=False): num = number last = 0 repeated_chars = {} for dec in [100_000, 10_000, 1_000, 100, 10, 1]: a = num // dec repeated_chars[a] = 1 if a not in repeated_chars else repeated_chars[...
# Copyright 2020 William Ro. 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 a...
config = {'train': False, # train or run the model 'show_game': True, # when training/evaluating it is much faster to not display the game graphics 'print_score': 10000, # print when a multiple of this score is reached 'max_score': 10000000, # end the episode and update q-table when re...
#Description: # - Extracts the license of a Github repository. #Requirements: # - You will need to enter your Github credentials #Input: # File LibraryData.json which contains all the library repositories #Output: # A pickle file called license.pkl, which will contain a dictionary where the key is a library repositor...
from threedi_modelchecker.checks.base import CheckLevel from threedi_modelchecker.checks.factories import generate_enum_checks from threedi_modelchecker.checks.factories import generate_foreign_key_checks from threedi_modelchecker.checks.factories import generate_geometry_checks from threedi_modelchecker.checks.factori...
from usps_webtools.tracking import PackageTracking from usps_webtools.ziptools import zipByAddress, zipByCityState, cityByZip
# The MIT License (MIT) # Copyright (c) 2018 by the ESA CCI Toolbox development team and contributors # # 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 ...
import pygame, random, sys from GameColor import * from pygame.locals import * WINDOWWIDTH = 800 WINDOWHEIGHT = 600 FPS = 60 REVEALSPEED = 8 BOXSIZE = 40 GAPSIZE = 10 BOARDWIDTH = 4 BOARDHEIGHT = 3 assert (BOARDHEIGHT * BOARDWIDTH) % 2 == 0, '边界必须是偶数' XMARGIN = int((WINDOWWIDTH - (BOARDWIDTH * (BOXSIZE + GAPSIZE))) /...
# Copyright (c) 2021 The Regents of the University of Michigan # All rights reserved. # This software is licensed under the BSD 3-Clause License. """This module defines various convenience functions for generating shapes. The methods here provide routes for generating instances of :class:`~coxeter.shapes.Shape` based ...
def number_format(n): return "{:,}".format(n)
import re CAMEL_CASE_RE = re.compile(r'(((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|$)))') def camel_to_snake(s: str) -> str: """Convert string from camel case to snake case.""" return CAMEL_CASE_RE.sub(r'_\1', s).strip().lower() def snake_to_camel(s: str) -> str: """Convert string from snake case to camel case...
# -*- coding: utf-8 -*- ''' otsu.fun - SSWA Utils @version: 0.1 @author: PurePeace @time: 2020-01-07 @describe: a treasure house!!! ''' import time, datetime # way to return utInfo, decorator def messager(func): def wrapper(*args, **kwargs): data, message, info, status = func(*args,**k...
""" Models for our cerbere app. """ import uuid from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, UserManager from django.db import models from django.utils.translation import gettext_lazy as _ from phonenumber_field.modelfields import PhoneNumberField class User(AbstractBaseUser, Permissio...
import sys sys.path.insert(0, '.') import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F import pytorch_to_caffe class LeNet(nn.Module): def __init__(self): super(LeNet, self).__init__() self.conv1 = nn.Conv2d(1, 6, (5, 5)) self.conv2 = nn...
import numpy as np from bokeh.models import ColumnDataSource from powersimdata.design.compare.transmission import ( calculate_branch_difference, calculate_dcline_difference, ) from powersimdata.utility.distance import haversine from postreise.plot import colors from postreise.plot.canvas import create_map_canv...
"""Implementation of sample attack.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os, sys import numpy as np import models import csv import pandas as pd from PIL import Image import StringIO import tensorflow as tf from timeit import default_ti...
import os.path as osp from .builder import DATASETS from .custom import CustomDataset @DATASETS.register_module() class PascalContextDataset(CustomDataset): """PascalContext dataset. In segmentation map annotation for PascalContext, 0 stands for background, which is included in 60 categories. ``reduce_z...
import re HD_SYLLABLE = re.compile('''(?P<ons>f|v|xy|x|s|z|y|h| n?(?:pl|tx|ts|p|t|r|c|k|q)h?|h?|d|dh| h?(?:ny|n|ml|m|l)|) (?P<rhy>ee|oo|ai|aw|au|ia|ua|i|e|a|o|u|w) (?P<ton>b|s|j|v|m|g|d|)''', flags...
import demistomock as demisto from Malwarebytes import scan_and_remediate, scan_and_report, isolate_endpoint, list_endpoint_info, \ isolate_process, isolate_network, isolate_desktop, deisolate_endpoint,\ scan_detections, scan_status, fetch_incidents, list_all_endpoints, open_sa_incident,\ remediate_sa_incid...
# A quick intro to implement the Distributed Data Parallel (DDP) training in Pytorch. # To simply this example, we directly load the ResNet50 using ```torch.hub.load()```, # and train it from the scratch using the CIFAR10 dataset. # Run this python script in terminal like "python3 DDP_training.py -n 1 -g 8 -nr 0" imp...
def lag(series, periods): return series.shift(periods).fillna(0)
import unittest, json from etk.knowledge_graph import KGSchema from etk.etk import ETK from etk.etk_exceptions import KgValueError from datetime import date, datetime from etk.ontology_api import Ontology from etk.ontology_namespacemanager import DIG class TestKnowledgeGraph(unittest.TestCase): def setUp(self): ...
# flake8: noqa import base64 import collections import datetime import inspect import os import os.path as osp import pickle import re import subprocess import sys import dateutil.tz import numpy as np from garage.core import Serializable class AttrDict(dict): def __init__(self, *args, **kwargs): super(...
# # (c) Copyright 2015,2016 Hewlett Packard Enterprise Development LP # (c) Copyright 2017-2018 SUSE 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/LIC...
# -*- coding: utf-8 -*- from typing import List class Solution: def max_chunks_to_sorted(self, arr: List[int]) -> int: stack = [] for num in arr: if stack and num < stack[-1]: head = stack.pop() while stack and num < stack[-1]: ...
""" Exception classes used in the sample runner. """ class AccountStateError(Exception): "For when an account doesn't have the right preconditions to support a sample." pass
import os.path import re import time import hashlib import pickle import io, gzip import shutil import json import fnmatch import glob import sys from .logger import flogger from .bytesize import bytes_scaled from .codex import phash from .configure import load as load_config elog = flogger(label='XDRIVE') ## init ...
# 42 BSQ — My Map Generator from sys import argv from random import choices BALANCE = 0.035 MAP_BLOCKS = '.ox' try: length, width, density = int(argv[1]), int(argv[2]), (int(argv[3]) * BALANCE) print(f'{length}{MAP_BLOCKS}') for i in range(length): print(''.join(choices(MAP_BLOCKS[:2], [1, density], k=width))...
import logging import sys from .. import settings logger = logging.getLogger(__name__) def hosts(to_write=False): """if to_write is True, then only non-read-only hosts will be returned """ return settings.server_manager.active_hosts(to_write=to_write) def get_info_bulk(urls): """ active_host...
""" Utilities used within the Demographic and Economic Forecasting Model Includes pandas DataFrame reshaping (pivot) and parsing yaml file """ import pandas as pd import yaml def apply_pivot(df): """ Pivot the migration rates DataFrame such that rates for each of the 4 mig rate types are in separate colu...
# coding: utf8 """ Implementation of :py:class:`ConstrainedOptimizer` class, which has 2 main methods: - :py:meth:`~ConstrainedOptimizer.zero_grad` - :py:meth:`~ConstrainedOptimizer.step` """ from typing import Callable, Optional import torch from .problem import CMPState, Formulation class ConstrainedOptimizer:...
import random import math import networkx as nx from qtpy.QtCore import Qt from qtpy.QtCore import QPointF from qtpy.QtGui import QColor from qtpy.QtGui import QFont import nezzle from nezzle.graphics import NodeClassFactory from nezzle.graphics import EdgeClassFactory from nezzle.graphics import LabelClassFactory f...
# -*- coding: utf-8 -*- from unittest import TestCase as UnitTestCase from nose import tools, SkipTest import django from django import template from django.template import TemplateSyntaxError from django.contrib.sites.models import Site from django.contrib.contenttypes.models import ContentType from django.core.pagi...
""" One epoch -> forward & backward pass of all training samples. batch_size -> number of training samples in one forward & backward pass. number of iterations -> number of passes, each pass using [batch_size] number of samples. e.g. 100 samples, batch_size=20 -> 100/20 = 5 iterations for 1 epoch. """ import math i...
from __future__ import unicode_literals, absolute_import import click, os, ConfigParser, getpass @click.command('setup-custom-app') def setup_custom_app(): """Generate config for supervisor, nginx and Procfile""" try: if click.confirm('This will add custom node to existing supervisor config file. Continue?'): s...
import logging from zipfile import ZipFile, ZIP_DEFLATED from apache_beam.io.filesystems import FileSystems from sciencebeam_utils.beam_utils.io import ( dirname, mkdirs_if_not_exists ) def get_logger(): return logging.getLogger(__name__) def load_pages(filename, page_range=None): with FileSystems...
import mellon from sparc.testing.testlayer import SparcZCMLFileLayer import os import shutil import tempfile from zope import component DEFAULT_snippet_lines_increment = 2 DEFAULT_snippet_lines_coverage = 5 DEFAULT_read_size = 512000 DEFAULT_snippet_bytes_increment = 7 DEFAULT_snippet_bytes_coverage = 8 class Mellon...
""" gen_keys.py Recovers a secret using the Fuzzy Key Recovery scheme """ import json import click from fuzzyvault import gen_keys, FuzzyError def work(words, key_count, secret_path) -> None: """ 1. re-create the state object from json file 2. call RecoverySecret on the recovery words (words) 3. prin...
from .base import BaseModel, RelatedResourceMixin from ..utils import enforce_string_type class AddOn(BaseModel, RelatedResourceMixin): _as_is_fields = ['max_days', 'min_days', 'product'] _date_fields = ['start_date', 'finish_date', 'halt_booking_date', 'request_space_date'] def __init__(self, *args, **k...
############################################################################### ## ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: [email protected] ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary for...
from flask import Blueprint bp = Blueprint('shopping', __name__) from src.shopping import routes, forms
#!/usr/bin/env python ''' @author Luke Campbell <My email is around here somewhere> @file ion/processes/data/transforms/test/test_qc_post_processing.py @date Tue May 7 15:34:54 EDT 2013 ''' from ion.services.dm.test.dm_test_case import DMTestCase from interface.objects import ProcessDefinition from pyon.core.exceptio...
import logging import re import sys import pytest from pyscaffold.exceptions import ErrorLoadingExtension, exceptions2exit from pyscaffold.log import logger if sys.version_info[:2] >= (3, 8): # TODO: Import directly (no need for conditional) when `python_requires = >= 3.8` from importlib.metadata import Entr...
# tested from boa.builtins import sha1, sha256, hash160, hash256 def Main(operation, a, b): if operation == 'omin': return min(a, b) elif operation == 'omax': return max(a, b) elif operation == 'oabs': return abs(a) elif operation == 'sha1': return sha1(a) eli...
import setuptools setuptools.setup( name="repo2shellscript", # https://github.com/jupyter/repo2docker/pull/848 was merged! install_requires=[ "dockerfile-parse", "jupyter-repo2docker@git+https://github.com/jupyterhub/repo2docker.git@master", # noqa: E501 "importlib_resources;python...
import threading class OrderTracker: def __init__(self): """ Simple container for data structures that map unique ids to the Order objects associated with that id and the corresponding locks to those data structures to prevent race conditions. There are maps by both client order id as well as order id be...
from PIL import Image, ImageDraw from geometry import Point import math import animation #maps an x in the range(0,1) to a y in the range (0,1). #when x is 0, y is 0; when x is 1, y is 1. #for all intermediate values, y may differ from x. def ease(x, kind="linear"): f = { "linear": lambda x: x, "trig": lam...
""" MIT License Copyright (c) 2021 Hyeonki Hong <[email protected]> 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, modi...
"""Set of models for the user blueprint""" from typing import TYPE_CHECKING, List, Union from flask_login import UserMixin from werkzeug.security import check_password_hash, generate_password_hash from ..database import ( db, Column, Integer, Model, String, Text, relationship, ) if TYPE_...
#!/usr/bin/python """ @author: Michael Rapp ([email protected]) """ import numpy as np DTYPE_INTP = np.intp DTYPE_UINT8 = np.uint8 DTYPE_UINT32 = np.uint32 DTYPE_FLOAT32 = np.float32 DTYPE_FLOAT64 = np.float64
# Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
from abc import ABC, abstractmethod from copy import copy from shutil import rmtree from typing import Any, Union, Optional from pathlib import Path import os import pickle import pandas as pd def _is_empty(data: Optional[pd.DataFrame]) -> bool: return data is None or (isinstance(data, pd.DataFrame) and not len(...
import sys from pathlib import Path from numpy import loadtxt import argparse from copernicus_search import copernicus_search userDataPath = Path(sys.path[0]).resolve() / '..' / 'userdata' staticDataPath = Path(str(loadtxt(userDataPath / 'staticDataPath.txt', dtype='str'))) sys.path.insert(0, str(staticDataPath)) imp...
# Copyright (c) 2019-2020, NVIDIA 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 agree...
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import itertools from dataclasses import dataclass from typing import Tuple from pants.engine.console import Console from pants.engine.fs import ( EMPTY_DIRECTORY_DIGEST, Digest, ...
#!/usr/bin/python # # Copyright (c) 2009-2021, Google LLC # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, thi...
import csv with open('test2.csv') as csvfile: reader = csv.reader(csvfile) for row in reader: print('DB', end=' ') first = True for num in row: if not first: print('', end=', ') first = False if int(num) < 16: prin...
# This is an automatically generated file. # DO NOT EDIT or your changes may be overwritten import base64 from xdrlib import Packer, Unpacker from .account_id import AccountID from .allow_trust_op_asset import AllowTrustOpAsset from .uint32 import Uint32 __all__ = ["AllowTrustOp"] class AllowTrustOp: """ XD...
import pytest from {{cookiecutter.package_name}}.{{cookiecutter.module_name}} import {{cookiecutter.class_name}} def test_case_one(): pass
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() points = vtk.vtkPoints() points.InsertNextPoint(0,-16,0) points.InsertNextPoint(0,0,-14) points.InsertNextPoint(0,0,14) points.InsertNextPoint(14,0,0) points.InsertNextPoin...
# Copyright (c) 2011, Hua Huang and Robert D. Cameron. # Licensed under the Academic Free License 3.0. from Utility import configure def StrategyPool(curRegSize): strategies = \ { "add1":\ { "body":r'''return simd_xor(arg1, arg2)''', "Ops":["simd_add", "simd_sub"], "Fws":[1], "Platforms":[configure.AL...
from common import activities from core.activity import Activities from discord.ext import commands class ActivityList(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command(name="activitylist") @commands.is_owner() async def activityList(self, ctx): formatted_list =...
# Is Unique: # Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structures?
from django.apps import AppConfig class SorularConfig(AppConfig): name = 'sorular'
from django.shortcuts import render from .controller import * def index(request): context = login(request) return render(request, 'pokebattle/base.html', context) def battle(request): context = login(request) return render(request, 'pokebattle/battle.html', context) def my_pokemon(request): co...
"""Test functions for fooof.utils.params.""" import numpy as np from fooof.utils.params import * ################################################################################################### ################################################################################################### def test_compute_kn...
# Product of Array Except Self: https: // leetcode.com/problems/product-of-array-except-self/ # Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i]. # The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit inte...
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin from django.shortcuts import render, get_object_or_404 from django.views.generic import ( ListView, DetailView, CreateView, UpdateView, DeleteView ) from memberships.models import UserMembership from .models import Video ...
myt1 = (12,10,38,22) myt2 = sorted(myt1, reverse = True) print(myt2) myt3 = sorted(myt1, reverse = False) print(myt3) print(type(myt3))
""" Deep Deterministic Policy Gradient agent Author: Sameera Lanka Website: https://sameera-lanka.com """ # Torch import torch import torch.nn as nn from torch.autograd import Variable import torch.optim as optim import torch.nn.functional as F import math # Lib import gym import numpy as np import random from copy ...