text
stringlengths
2
999k
# 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 # d...
from pathlib import Path from privacyscanner.filehandlers import NoOpFileHandler from privacyscanner.result import Result from privacyscanner.scanmodules import ScanModule from privacyscanner.scanmodules.chromedevtools.chromescan import ChromeScan, find_chrome_executable from privacyscanner.scanmodules.chromedevtools....
from ipaddress import IPv4Address from pur.core import config class IPMetadata(object): def __init__(self, ip_str: str, port: int): self._ip = ip_str try: self._port = int(port) except ValueError: raise ValueError('Invalid Peer Port {}'.format(port)) self...
from operator import attrgetter import pyangbind.lib.xpathhelper as xpathhelper from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType from pyangbind.lib.base import PybindBase from d...
from django.contrib import admin from .models import CreateOrderModel # Register your models here. admin.site.register(CreateOrderModel)
# Django settings for zulip project. ######################################################################## # Here's how settings for the Zulip project work: # # * settings.py contains non-site-specific and settings configuration # for the Zulip Django app. # * settings.py imports prod_settings.py, and any site-speci...
import datetime try: import json except ImportError: from django.utils import simplejson as json from djutils.dashboard.models import Panel, PanelData, PanelDataSet from djutils.dashboard.provider import PanelProvider from djutils.dashboard.registry import registry from djutils.dashboard.views import dashboar...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('contacts', '0013_auto_20160302_0722'), ] operations = [ migrations.AlterField( model_name='person', ...
# Copyright (c) 2016-present, Facebook, 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 agreed...
import math from collections.abc import Iterator from pathlib import Path def solution_part1(report_file_path: Path) -> int: total = 0 previous = math.inf with report_file_path.open() as report_reader: for number in report_reader: number = float(number) if number > previous...
# -*- coding: utf-8 -*- # # Cavro XP3000 GUI documentation build configuration file, created by # sphinx-quickstart on Fri Jul 11 01:09:52 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated fi...
import matplotlib.pyplot as plt import pandas as pd import yfinance as yf import datetime def trends(ticker, start='2000-01-01', end=None, sensibilidad=None, escala='linear'): ''' Encuentra maximos y mínimos locales dada una sensibilidad (cantidad de velas de la ventana local) Gráfico 1: Precios de cierre...
values=[[3,4,5,1],[33,6,2,2]] v=values[0][0] for list in values: for element in list: if v>element: v=element print(v)
import numpy as np from typing import Dict import xarray from .typing import Tuple, Optional, List try: HOLOVIEWS_IMPORTED = True import holoviews as hv from holoviews.streams import Pipe from holoviews import opts import panel as pn from bokeh.models import Range1d, LinearAxis from bokeh....
"""Docstring""" ############################################################################### # IMPORTS ########################################################### IMPORTS # ############################################################################### # Standard library import datetime import binascii # Installe...
from os.path import dirname,realpath import numpy as np from scipy.integrate import solve_ivp import matplotlib.pyplot as plt import matplotlib.patches as patches import sys pypath = dirname(dirname(dirname(realpath(__file__)))) + '/python/' sys.path.insert(1, pypath) import utils from odes import MG dirpath = dirnam...
from xdev_bot.gidgethub import GHArgs def test_init(): url = 'https://github.com/NCAR/xdev-bot' ghargs = GHArgs(url) assert ghargs.url == url def test_init_set_data(): url = 'https://github.com/NCAR/xdev-bot' data = {'note': 'https://github.com/NCAR/xdev-bot/issues/11111'} ghargs = GHArgs(ur...
import cvnn.dataset as dp from utils import randomize from cvnn.layers import Dense from cvnn.cvnn_model import CvnnModel import tensorflow as tf from utils import transform_to_real import numpy as np from pdb import set_trace if __name__ == "__main__": m = 10000 n = 100 num_classes = 2 dataset = dp.Co...
#!/usr/bin/env python """ Pure-Python Implementation of the AES block-cipher. Benchmark AES in CTR mode using the pyaes module. """ from mpkmemalloc import * import os import gc import threading import psutil import pyperf from six.moves import xrange import pyaes # 23,000 bytes CLEARTEXT = b"This is a test. What c...
# M0_C7 - Employee Database # See https://github.com/Static-Void-Academy/M0_C7/blob/master/README.md ######################################## # Modify and debug the code as needed. # ######################################## import sys usage = '''Usage: [COMMAND] [ID] add [ID] - Add a new employee record edi...
import argparse from itertools import count import pprint from bluesky.callbacks.zmq import Publisher from databroker import Broker from event_model import unpack_event_page, unpack_datum_page arg_parser = argparse.ArgumentParser() arg_parser.add_argument("--db-name", type=str, default="xpd") arg_parser.add_argumen...
# Authors: # Trevor Perrin # Google - handling CertificateRequest.certificate_types # Google (adapted by Sam Rushing and Marcelo Fernandez) - NPN support # Dimitris Moraitis - Anon ciphersuites # Yngve Pettersen (ported by Paul Sokolovsky) - TLS 1.2 # # See the LICENSE file for legal information regarding us...
import os class UserHandler: def __init__(self, user): self.user = user def check_user_dir(self): path = f"home/{self.user}" if not os.path.exists(path): os.mkdir(path) return f"/{path}" else: return f"/{path}"
# stdlib import logging import mock # project from tests.checks.common import AgentCheckTest from utils.dockerutil import DockerUtil # 3rd party from nose.plugins.attrib import attr log = logging.getLogger('tests') CONTAINERS_TO_RUN = [ "nginx:latest", "redis:latest", ] MOCK_CONFIG = { "init_config": ...
#!/usr/bin/python # # Copyright 2018-2020 Polyaxon, 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 ...
#!/afs/bx.psu.edu/project/pythons/py2.7-linux-x86_64-ucs2/bin/python2.7 """ Read a PAIRWISE maf from stdin and print the fraction of columns whose bases match for each alignment. TODO: generalize for more than two speceis. usage: %prog < maf > out """ from __future__ import division import sys import psyco_full ...
import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.operational_faults import FaultModelFoulingAirFilter log = logging.getLogger(__name__) class TestFaultModelFoulingAirFilter(unittest.TestCase): def setUp(self): sel...
from flask import Blueprint main = Blueprint('main', __name__) from . import views, errors, filters from ..models import Permission @main.app_context_processor def inject_permissions(): # add permission to templates return dict(Permission=Permission)
num = float(input()) while True: if 1 <= num <= 100: print(f"The number {num} is between 1 and 100") break num = float(input())
""" Ory APIs Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. # noqa: E501 The version of the OpenAPI document: v0.0.1-alpha.187 Contact: support@ory.sh Generated by: ht...
""" https://projecteuler.net/problem=1 If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. """ def find_multiples(of, below): return set(of * count for count in range(1, int(belo...
from lib.mmonit import MmonitBaseAction class MmonitDismissEvent(MmonitBaseAction): def run(self, event_id): self.login() data = {"id": event_id} self.session.post("{}/reports/events/dismiss".format(self.url), data=data) self.logout() return True
#!/usr/bin/env python3 import atexit import signal import socket import sys import threading import time import rpyc import zeroconf import plumbum # for git_status() from rpyc.utils.server import ThreadedServer import config from common import mkdir, get_routed_ip, get_boxname from remote import box_interface _...
#-*- coding: utf-8 -*- # This file is made to configure every file number at one place # [1] choose the keyword # [2] make the dataset file and category folder to keyword / keyword_classifcation # [3] Choose the PC number # [4] Choose the train load_epoch [option] # [5] choose the inference load_epoch import os key...
# Copyright (C) 16/2/21 RW Bunney # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the...
#!/usr/bin/env python #python import sys import os import time #appion from appionlib import appionScript from appionlib import apStack from appionlib import apFile from appionlib import apDisplay from appionlib import apStackMeanPlot from appionlib.apTilt import apTiltPair from pyami import mem, mrc class TiltPairSt...
""" Django settings for mysite project. Generated by 'django-admin startproject' using Django 3.0. For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.0/ref/settings/ """ import os # Bu...
# Copyright (c) 2021 Graphcore Ltd. All rights reserved. from typing import Optional, Union import popart._internal.ir as _ir from popart.ir.context import get_current_context, op_debug_context from popart.ir.tensor import Tensor from ..utils import check_in_graph from .utils import handle_optimizer_value __all__ = [...
from __future__ import print_function from __future__ import division import abc from collections import namedtuple import six import numpy as np import open3d as o3 from . import transformation as tf from . import gaussian_filtering as gf from . import gauss_transform as gt from . import se3_op as so from . import _ka...
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) import io import re import numpy as np import pytest import six import matplotlib import matplotlib.pyplot as plt from matplotlib import patheffects from matplotlib.testing.determinis...
# -*- coding: utf-8 -*- """ Created on Sat Mar 3 22:08:29 2018 @author: Jonas Lindemann """ import calfem.geometry as cfg import calfem.mesh as cfm import calfem.vis as cfv # ----- Define geometry g = cfg.Geometry() g.point([0.0, 0.0]) # point 0 g.point([5.0, 0.0], marker=20) # point 1 g.point([2.5, 4.0]) # point...
from setuptools import setup from sys import version_info with open('README.rst') as README: long_description = README.read() long_description = long_description[long_description.index('Description'):] with open('VERSION') as VERSION: version = VERSION.read().strip() suds_install_requires = ['suds'] if v...
#!/usr/bin/python # -*- coding: utf-8 -*- ################################################################################ # # RMG - Reaction Mechanism Generator # # Copyright (c) 2002-2010 Prof. William H. Green (whgreen@mit.edu) and the # RMG Team (rmg_dev@mit.edu) # # Permission is hereby granted, free of c...
import os import logging import boto3 import urllib import traceback import json from botocore.exceptions import ClientError from io import BytesIO, StringIO from gzip import GzipFile from json import loads, dumps from elasticsearch import Elasticsearch, RequestsHttpConnection from requests_aws4auth import AWS4Auth fr...
#!/usr/bin/python3 import sys, os, shutil from os import path from urllib.request import pathname2url import subprocess from subprocess import call import sys import re import zipfile import json import config os.chdir(config.root_dir) def check_changed_files(dir_list, tmp_file='temp/filestamp_cache.json'): """ c...
from efficientnet_pytorch import EfficientNet import torch.nn as nn import torch import torch.nn.functional as F from .BiFPN import BiFPNSeg class EfficientDet(nn.Module): def __init__(self, backbone="efficientnet-b0"): super(EfficientDet, self).__init__() model = EfficientNet.from_pretrained(back...
# -*- coding: utf-8 -*- # Copyright (c) 2015 Alexander Fasching # # 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, ...
from ROAR.agent_module.agent import Agent from ROAR.utilities_module.data_structures_models import SensorsData from ROAR.utilities_module.vehicle_models import Vehicle, VehicleControl class RLDepthE2EAgent(Agent): def run_step(self, sensors_data: SensorsData, vehicle: Vehicle) -> VehicleControl: if self....
"""The Iteration/Expression Tree (IET) hierarchy.""" import abc import inspect import numbers from cached_property import cached_property from collections import Iterable, OrderedDict, namedtuple import cgen as c from devito.cgen_utils import ccode from devito.data import FULL from devito.ir.equations import Cluster...
# coding: utf-8 """ Prisma Cloud Compute API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: 21.04.439 Generated by: https://openapi-generator.tech """ try: from inspect import getfulla...
# # Copyright (c) 2008-2015 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.conf import settings def duplicate_txn_id(ipn_obj): """Returns True if a record with this transaction id exists and it is not a payment which has gone from pending to completed. """ query = ipn_obj._default_manager.filter(txn_id = ipn_obj.t...
# Copyright (c) 2021. The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details from wtforms.validators import Optional from wtforms_widgets.base_form import BaseForm from wtforms_widgets....
import sys import math import numpy as np import scipy.io as sio import scipy.sparse as sp from scipy.sparse.linalg import svds as SVD from sklearn import svm from sklearn.metrics import accuracy_score class SFA: ''' spectrual feature alignment ''' def __init__(self, l=500, K=100, base_classifer=svm....
#!/usr/bin/env python3 # Single pipeline to run all the analysis import sys import os import pandas from joblib import Parallel, delayed args=sys.argv ''' Run as: ./pipeline_wilcoxon.py dataset alpha dimension_reduction ml_algo param_dimred param_ml dataset: I - clinical attributes II - Microbiome (from Kaiju...
from typing import TYPE_CHECKING from discordmenu.embed.components import EmbedMain, EmbedAuthor from discordmenu.embed.view import EmbedView from padinfo.common.external_links import puzzledragonx from padinfo.view.components.monster.header import MonsterHeader from padinfo.view.components.monster.image import Monst...
#!/usr/bin/env python # Project skeleton maintained at https://github.com/the-allanc/skeleton # All the hard work done by jaraco at https://github.com/jaraco/skeleton # # Extract the project identity from the README. # import io import setuptools with io.open('README.rst', encoding='utf-8') as readme: readme = r...
# coding: utf-8 # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
"""Describes the tiles in the world space.""" __author__ = 'Phillip Johnson' import items, enemies, actions, world class MapTile: """The base class for a tile within the world space""" def __init__(self, x, y): """Creates a new tile. :param x: the x-coordinate of the tile :param y: t...
""" Django settings for ecommerce project. Generated by 'django-admin startproject' using Django 3.1.2. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ from pathl...
import string import random n, n2, n3 = 2, 3, 1 random.seed() ''' @test(random=missing;$$) @alt(乱数シード|乱数生成系列|シード) 乱数シードを初期化する [システム時刻で|毎回異なるように]乱数を初期化する ''' random.seed(n) ''' @test(random=missing;$$) {乱数シードを|nで}初期化する {乱数シードを|nで}固定化する ''' random.randint(1, 6) ''' @test(random=missing;$$) @alt(整数乱数|ランダムな整数[|値]) @alt(...
"""Create an animation asset.""" import bpy from avalon import api import openpype.hosts.blender.api.plugin from avalon.blender import lib class CreateAction(openpype.hosts.blender.api.plugin.Creator): """Action output for character rigs""" name = "actionMain" label = "Action" family = "action" ...
from . import dynamic_api_gen from .version import __version__ from os import path, environ try: if path.exists(environ.get('API_SPEC_PATH')): dynamic_api_gen.populate_api() except TypeError: print('No Dynamic API path found') try: from .dynamic_api import app except ImportError: from .server ...
import json import logging from math import ceil from sys import exit from time import sleep from datetime import date import coloredlogs import twitter from PIL import Image, ImageDraw from util import ImageUtil, Utility log = logging.getLogger(__name__) coloredlogs.install( level="INFO", fmt="[%(asctime)s] %(m...
"""wrapper for ccache tool, only check_exists""" import subprocess name = 'ccache' platforms = ['osx', 'linux'] optional = True not_found = "used with './fips set ccache on'" #------------------------------------------------------------------------------ def check_exists(fips_dir) : try : subprocess.check...
# -*- coding: utf-8 -*- """This file contains basic interface for plugins within Plaso. This library serves a basis for all plugins in Plaso, whether that are Windows Registry plugins, SQLite plugins or any other parsing plugins. This is provided as a separate file to make it easier to inherit in other projects that ...
import audtool from ulauncher.api.client.Extension import Extension from ulauncher.api.shared.event import KeywordQueryEvent, ItemEnterEvent from KeywordQueryEventListener import KeywordQueryEventListener from ItemEnterEventListener import ItemEnterEventListener from ulauncher.api.shared.item.ExtensionResultItem import...
# 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...
from __future__ import annotations from collections import abc from datetime import datetime from functools import partial from itertools import islice from typing import ( TYPE_CHECKING, Callable, Hashable, List, Optional, Tuple, TypeVar, Union, overload, ) import warnings import ...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** 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 from ... import _utilities, _tables from...
import pickle from os import path from pathlib import Path from typing import List import aiosqlite from chives.consensus.blockchain import Blockchain from chives.consensus.constants import ConsensusConstants from chives.full_node.block_store import BlockStore from chives.full_node.coin_store import CoinStore from ch...
# -*- coding: utf-8 -*- # 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 random, string, json global ratelimit ratelimit = {} Authorizated = json.load(open("Sources/Json/Authorizated.json", "r")) def newUrlID(): return "".join(random.choice(string.ascii_lowercase) for i in range(8)) def ratelimitCheck(dbToken): for auth in Authorizated: ratelimit[auth] = -1 if not dbToken[...
from rqalpha.utils.testing import BaseDataSourceFixture, RQAlphaTestCase, mock_instrument class BaseDataSourceTestCase(BaseDataSourceFixture, RQAlphaTestCase): def test_get_tick_size(self): with self.mock_env_get_last_price(return_value=0.03): self.assertEqual(self.base_data_source.get_tick_si...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import fu...
#!/usr/bin/env python3 import jieba import pandas as pd filePath = '/home/ubuntu/danmu/recentWords.txt' fileSegDone = '/home/ubuntu/danmu/corpusSegRecentWords.txt' fileTrainRead = [] #read the file by line with open(filePath) as fileTrainRaw: for line in fileTrainRaw: fileTrainRead.append(line) #segment ...
import os import logging import sys from nekbot.utils.filesystem import copytree, copy_template from nekbot.utils.system import execute_hook __author__ = 'nekmo' __dir__ = os.path.abspath(os.path.dirname(__file__)) nekbot_src_dir = os.path.dirname(os.path.dirname(__file__)) conf_src_dir = os.path.join(nekbot_src_di...
#!/usr/bin/env python3 import getpass import os # Displays Terminal Trader header. def display_header(): os.system("clear") print("=".center(65, "=")) print("Terminal Trader".center(65, " ")) print("=".center(65, "=")) ### Menus # Displays start menu of the application. def start_menu(): display_header() pri...
# -*- coding: utf-8 -*- """The app module, containing the app factory function.""" from flask import Flask, render_template from salary import commands, public, user from salary.extensions import bcrypt, cache, csrf_protect, db, debug_toolbar, login_manager, migrate def create_app(config_object='salary.settings'): ...
# coding=utf-8 from shutil import copy from time import sleep from pathlib import Path from invoke import run, task @task def tags(docs=False): if docs: run(u"Przygotuj tagi dla pliku pong.py w oparciu o wersje pliku w folderze zadania") targets = {} cwd = Path(".") exercises = Path("./zadani...
from argparse import ArgumentParser import sh import torch.nn from sklearn.metrics import f1_score, accuracy_score, roc_auc_score from disaster_tweets_data_module import * # sh.rm('-r', '-f', 'lightning_logs/disaster_tweets_rnn_glove') class DisasterTweetsClassifierRNN(pl.LightningModule): def __init__(self,...
# coding=utf-8 # Exploit Title: Pakyu Cenloder # Date: March 16 2012 # Author: BMario # Application Link: Microsoft Terminal Services / Remote Desktop Services # http://msdn.microsoft.com/en-us/library/aa383015(v=vs.85).aspx # Version: any Windows version before 13 Mar 2012 # Platforms: Windows # Bug: ...
# microblog/app/ # -*- coding:utf-8 -*- from flask import Flask app = Flask(__name__) app.config.from_object('config') from app import views
# Import packages import cv2 import numpy as np img = cv2.imread(r"C:\Users\harrizazham98\Desktop\OpenCVForPython\resources\Day 1\image\KL_view.jpg") image_copy = img.copy() imgheight=img.shape[0] imgwidth=img.shape[1] # M is the height and N is the width for the patch M = 76 N = 104 x1 = 0 y1 = 0 fo...
# Copyright 2020 The HuggingFace Team. 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 applicabl...
#!/usr/bin/python # build_native.py # Build native codes import sys import os, os.path import shutil from optparse import OptionParser import cocos import cocos_project import json import re from xml.dom import minidom import project_compile BUILD_CFIG_FILE="build-cfg.json" class AndroidBuilder(object): CFG_K...
# Copyright 2017 - Brocade Communications Systems, Inc. # Copyright 2018 - Extreme Networks, 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/lic...
# Copyright 2021 Injective Labs # # 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 writin...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import #::: modules import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import os, sys import ellc import wotan from transitleastsquares import transitleastsquares from transi...
# By @TroJanzHEX import os import shutil from PIL import Image, ImageOps async def black_border(client, message): try: userid = str(message.chat.id) if not os.path.isdir(f"./DOWNLOADS/{userid}"): os.makedirs(f"./DOWNLOADS/{userid}") download_location = "./DOWNLOADS" + "/" + us...
# -*- coding: utf-8 -*- # Copyright 2022 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...
# -*- coding: utf-8 -*- # Import Python Libs from __future__ import absolute_import # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.paths import TMP_STATE_TREE class PillarModuleTest(ModuleCase): ''' Validate the pillar module ''' def test_data(self): ...
#!/usr/bin/python # Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, INC # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright n...
""" here we integrate with the outer world ex: slack apis, aws services apis ...etc """
# Copyright 2018 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, s...
import os import mmcv import argparse parser = argparse.ArgumentParser(description='Hyperparams') # parser.add_argument('--gt', nargs='?', type=str, default=None) parser.add_argument('--pred', nargs='?', type=str, default=None) args = parser.parse_args() output_root = '../outputs/tmp_results/' pred = mmcv.l...
from collections import defaultdict from typing import Dict, List import intcode import robotics class Game(robotics.Painter): """Representation of a simple arcade game. Due to its similarities with the `robotics.Painter` class, we inherit from that instead of the base `intcode.Interpreter`. Attribu...
import sys import os import tempfile import numpy as np import pypelid.utils.sphere as sphere import logging from catstore import catalogue_store logging.basicConfig(level=logging.DEBUG) def check_catalogue_store_batches(n=100, zone_resolution=0): """ Quick demo of catalogue store. This routine loads the data in...
# Agata Kłoss # znalezienie liczby trójkątów w grafie import algorithms.graph as graph import numpy as np # O(n^5) def naive(vertices, edges, only_count=False): def has_edge(i, j, edges): for edge in edges: if (edge[0] == i and edge[1] == j) or (edge[0] == j and edge[1] == i): ...
import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule, xavier_init, kaiming_init from mmcv.runner import BaseModule, auto_fp16 from ..builder import NECKS from .sepc import PConvModule from mmdet.models.utils import ModulatedSEPCConv OP...