text
stringlengths
1
927k
# terrascript/transloadit/r.py # Automatically generated by tools/makecode.py () import warnings warnings.warn( "using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2 ) import terrascript class transloadit_template(terrascript.Resource): pass
# Copyright (C) 2010-2011 Richard Lincoln # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish...
import operator from bpy import data, types, context from . import material, texture, animation from . import object as object_ from .. import constants, utilities, logger, exceptions def _mesh(func): """ :param func: """ def inner(name, *args, **kwargs): """ :param name: :...
from __future__ import absolute_import, division, print_function from libtbx import easy_mp from libtbx import str_utils import libtbx.phil from libtbx.utils import Sorry from libtbx.test_utils import approx_equal_core from libtbx import adopt_init_args, Auto import sys import iotbx.cif.model from iotbx.pdb import mod...
#!/usr/bin/env python3 # Copyright (c) 2016-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test NULLDUMMY softfork. Connect to a single node. Generate 2 blocks (save the coinbases for later). G...
#Faça um programa que leia o ano de nascimento de um jovem e informe, de acordo com a sua idade, # se ele ainda vai se alistar ao serviço militar, se é a hora exata de se alistar ou se já passou do tempo do alistamento. # Seu programa também deverá mostrar o tempo que falta ou que passou do prazo from datetime import d...
# Copyright 2018 The TensorFlow Probability 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 o...
import subprocess def test_run(app_connection, composition): composition.run('run_test', 'true') def test_run_timeout(app_connection, composition): try: composition.run('run_test', 'sleep', '5', timeout=1) assert False except subprocess.TimeoutExpired: pass # Expected
from typing import Type, Union from idna.core import IDNAError from scrapy.core.downloader.handlers.http11 import TunnelError from scrapy.exceptions import IgnoreRequest from scrapy.http.response import Request, Response from scrapy.spidermiddlewares.httperror import HttpError from twisted.internet.defer import Cancel...
import re import numpy as np from suzieq.poller.services.service import Service from suzieq.utils import (convert_rangestring_to_list, convert_macaddr_format_to_colon) class EvpnVniService(Service): """evpnVni service. Different class because output needs to be munged""" def clean_...
from .validator import Validator
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="bar.hoverlabel.font", **kwargs ): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_name=pare...
import base64 import hashlib import json import os import uuid from urllib.parse import urlparse from urllib.request import urlretrieve # Mutates the params, replacing with local temporary file if required import tempdir # Param must exist def required_exists(key, params): if key not in params: raise Valu...
_base_ = [ '../_base_/models/setr_naive_pup.py', '../_base_/datasets/cityscapes_768x768.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py' ] norm_cfg = dict(type='SyncBN', requires_grad=True) model = dict( backbone=dict(img_size=768, align_corners=False, pos_emb...
from django.core.management.base import BaseCommand, CommandError from django.conf import settings from teamsync.dao.github.organizations import get_members_for_org from teamsync.models import User class Command(BaseCommand): help = 'Adds users from GitHub' def handle(self, *args, **options): org_id ...
# https://leetcode.com/problems/find-substring-with-given-hash-value/ # Concept : https://www.youtube.com/watch?v=BfUejqd07yo # Solution : https://www.youtube.com/watch?v=P7dX86HdNqc&t=895s # Solution : https://www.youtube.com/watch?v=bmX2_mal8YQ&t=611s class Solution(object): # Submittted by @Jiganesh ...
""" Module with all the individual handlers, which execute git commands and return the results to the frontend. """ import json import os from notebook.utils import url_path_join as ujoin, url2path from notebook.base.handlers import APIHandler class GitHandler(APIHandler): """ Top-level parent class. """...
#!/usr/bin/env python2 # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import socket import traceback, sys from binascii import hexlify import time, os from socks5 import Socks5Conf...
import click import os import kfp import sys import yaml import importlib import importlib.util import inspect from hypermodel.kubeflow.deploy_prod import deploy_to_prod @click.group() @click.pass_context def deploy(ctx): """Deploy to Kubeflow""" pass @deploy.command() @click.option("-f", "--file", required...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from numpy.testing import assert_allclose from ...tests.helper import assert_quantity_allclose from ..utils import (extract_array, add_array, subpixel_indices, block_reduce, block_replicate, ...
# Convertor models for universal energy management system # The models include the following types of convertors. # 1) Bidirectional convertors # 2) Unidirectional convertors # 3) Introducing measurement value P_AC2DC, P_DC2AC, Q_AC import configuration.configuration_convertors as default_parameters #################...
import tensorflow as tf import numpy as np from tensorflow.keras import layers, regularizers from tensorflow.keras.utils import to_categorical import matplotlib.pyplot as plt import os import argparse from SE2DIN import * from load_data import load_data mnist_rot_dir = 'mnist_rot' mnist_12k_dir = 'mnist12k' model_...
#!/usr/bin/env python import pygame from pygame.locals import * import sys SCR_RECT = Rect(0, 0, 640, 480) class MySprite(pygame.sprite.Sprite): def __init__(self, filename, x, y, vx, vy): pygame.sprite.Sprite.__init__(self) self.image = pygame.image.load(filename).convert_alpha() width = ...
''' (C) Copyright 2019 Hewlett Packard Enterprise Development LP Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, ...
# -*- coding: utf-8 -*- import textwrap import functools class Composer(object): def __init__(self, modules, cuda_ver, cudnn_ver, ubuntu_ver, workspace, versions={}): if len(modules) == 0: raise ValueError('Modules should contain at least one module') pending = self._traverse(modules) ...
import socket import ssl import asyncio import logging import concurrent.futures from http import HTTPStatus import aiodns import aiohttp from rssant_common import _proxy_helper from rssant_common.helper import aiohttp_client_session from rssant_common.dns_service import ( DNSService, DNS_SERVICE, PrivateAddr...
import cv2 import io from PIL import Image, ImageEnhance import pytesseract from wand.image import Image as wi import re import pandas as pd from PyPDF2 import PdfFileWriter, PdfFileReader from pdf2image import convert_from_path claim = '15232353' file = "a.pdf" pages_to_keep = [0] infile = PdfFileReader(file, 'rb') ...
import sys import os import subprocess import pickle import math if len(sys.argv) != 3: print("python3 get_non_crash.py TC_path execute_command") exit() o1 = open("retc.out", "w") o1.write("tc, ret code, stdout\n") for fi in os.listdir(sys.argv[1]): runcmd = sys.argv[2] % (sys.argv[1] + fi) proc = subprocess...
""" Support for IP Webcam settings. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.android_ip_webcam/ """ from homeassistant.components.switch import SwitchDevice from homeassistant.components.android_ip_webcam import ( KEY_MAP, ICON_MAP, DAT...
from conans import ConanFile, CMake, tools from conans.errors import ConanInvalidConfiguration import functools import os required_conan_version = ">=1.43.0" class CCTagConan(ConanFile): name = "cctag" description = "Detection of CCTag markers made up of concentric circles." license = "MPL-2.0" topic...
""" Author: Giang Tran. """ import numpy as np from math import log2 class NodeDT: """ Class Node represents in Decision Tree """ def __init__(self, X, y, feature_name): self.feature_name = feature_name self.X = X self.y = y self.is_leaf = False self.label = N...
# Copyright 2013 Rackspace # # 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...
# Copyright (c) nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/vulnerablecode/ # The VulnerableCode software is licensed under the Apache License version 2.0. # Data generated with VulnerableCode require an acknowledgment. # # You may not use this software except in compliance...
# Generated by Django 2.1.3 on 2020-03-05 10:31 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('core', '0002_tag'), ] operations = [ migrations.CreateModel( n...
#!/usr/bin/python # mostly a proxy object to abstract how some of this works import json from slackclient._server import Server class SlackClient(object): ''' The SlackClient makes API Calls to the `Slack Web API <https://api.slack.com/web>`_ as well as managing connections to the `Real-time Messaging A...
# Copyright (C) 2012-2013 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 applicable la...
from setuptools import setup setup( name='py-telegram-bot', version='0.1', description='Telegram bot coded in Python to retrieve Bitcoin data', license='Apache License v2.0', author='Carlos GC', author_email='mail@ccebrecos.com', url='https://github.com/ccebrecos/py-telegram-bot', keywo...
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'plain_shadow_31593.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: r...
# Copyright 2013-2021 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 argparse import os import filecmp import re from six.moves import builtins import time import pytest import llnl....
# File: V (Python 2.4) from pandac.PandaModules import * from direct.interval.IntervalGlobal import * from direct.particles import ParticleEffect from direct.particles import Particles from direct.particles import ForceGroup from otp.otpbase import OTPRender from PooledEffect import PooledEffect from EffectController ...
import discord from key_loader import GENERAL_ACCESS_TOKEN as TKN client = discord.Client() @client.event async def on_ready(): print('Logged in as') print(client.user.name) print(client.user.id) print('------') @client.event async def on_message(message): global on_watch_users # Prevents re...
# 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 .get_user import GetUser from .get_updated_user import GetUpdatedUser class Users( GetUser, GetUpdatedUser, ): pass
import glob import pygame VEC = pygame.math.Vector2 class Sprite(pygame.sprite.Sprite): def __init__(self, start_x, start_y, height, width, vel=VEC(0, 0)): #pygame.sprite.Sprite.__init__(self) super().__init__() self.pos = VEC(start_x, start_y) self.rect = pygame.Rect(start_x, sta...
"""Defines constants needed for fetch Data from FB.""" # API version FACEBOOK_API_VERSION = "v6.0" # Group information FACEBOOK_GROUP_ID = "1488511748129645" # Fields to fetch from API FACEBOOK_POST_FIELDS = ( "id,created_time,from,link,message,message_tags," "name,object_id,permalink_url,properties," "sh...
"""Make / Download Telegram Sticker Packs without installing Third Party applications Available Commands: .lund [Optional Emoji] .packinfo .loda {for zip sticker pack}""" from telethon import events from io import BytesIO from PIL import Image import asyncio import datetime from collections import defaultdict import ma...
#! /usr/bin/python3 #_*_ coding: utf-8 _*_ ''' @file telegram-statistics.py @author Simon Burkhardt - github.com/mnemocron @date 2018.10.01 Post about this code: https://www.reddit.com/r/LongDistance/comments/9mgcol/oc_chat_statistics_from_telegram_using_python/ Inspiration: https://www.reddit.com/r/LongDistan...
# coding: utf-8 import pprint import re import six class NovaServerBlockDeviceMapping: """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and...
def loadFile(p,wFile): f = open(p) newFile=[] for line in f.readlines(): newLine = line.split(',') newFile.append(newLine[3]) fp = open(wFile, 'w+') for lines in newFile: fp.write(lines) fp.close() f.close() if __name__ == '__main__': loadFile('./loadFile.txt','...
# coding: utf-8 import os import shutil import tarfile import tempfile import time from beaker.middleware import CacheMiddleware from beaker.cache import Cache from webtest import TestApp # Tarballs of the output of: # >>> from beaker.cache import Cache # >>> c = Cache('test', data_dir='db', type='dbm') # >>> c['foo']...
# Copyright (c) 2017 Sony Corporation. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
from __future__ import unicode_literals from builtins import str from builtins import object import logging from django.db.utils import IntegrityError from scrapy.exceptions import DropItem from dynamic_scraper.models import SchedulerRuntime class DjangoWriterPipeline(object): def process_item(self, item, spi...
from gym.spaces import MultiDiscrete import numpy as np from ray.rllib.models.tf.tf_modelv2 import TFModelV2 from ray.rllib.utils.framework import try_import_tf tf = try_import_tf() class SACEnsembleTFModel(TFModelV2): """Extension of standard TFModel for SAC. Data flow: obs -> forward() -> model_o...
#!/usr/bin/env python # Copyright 2017 British Broadcasting 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...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 VMware, Inc. # Copyright (c) 2011 Citrix Systems, Inc. # Copyright 2011 OpenStack 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...
#!/usr/bin/env python import md5 nice = 0 with open("../input/05.txt") as fileobj: for line in fileobj: if 'ab' in line or 'cd' in line or 'pq' in line or 'xy' in line: continue if (line.count('a') + line.count('e') + line.count('i') + line.count('o') + line.count('u')) < 3: continue for x in range(0, l...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import importlib import itertools import os import sys import compas_rhino import compas._os import compas.plugins __all__ = ['install'] def install(version=None, packages=None): """Install COMPAS for ...
#!/usr/bin/env python # *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* # ** Copyright UCAR (c) 1992 - 2015 # ** University Corporation for Atmospheric Research(UCAR) # ** National Center for Atmospheric Research(NCAR) # ** Research Applications Laboratory(RAL) # ** P.O.Box 3000, Boulder...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import json import logging import os import os.path import signal import sys # Only subprocess.PIPE is used in this file so we can ignore the subprocess warning for this file # The actual POpen is in kernel_launcher.py impor...
import tempfile from distutils.command.build import build from distutils.command.clean import clean import sys import numpy as np # TODO: Need a mechanism to ensure numpy is already installed import shutil # Compile using .cpp files if cython is not present try: from Cython.Distutils import build_ext except Import...
import salt.modules.kapacitor as kapacitor import salt.utils.json from tests.support.mixins import LoaderModuleMockMixin from tests.support.mock import Mock, patch from tests.support.unit import TestCase class KapacitorTestCase(TestCase, LoaderModuleMockMixin): env = {"KAPACITOR_UNSAFE_SSL": "false", "KAPACITOR_U...
import os import urllib3 import click from constants import ( CHILD_SERVICE, DEFAULT_CONFIG_FILE, PARENT_SERVICE, SERVICE_NAME, VMACONFIG, ) from flask import Flask # Import the Flask class from .db import DB, MIGRATE, init_db, migrate_database from .extensions import login_manager, oauth, jwt_au...
""" Copyright (c) 2016-2020 Keith Sterling http://www.keithsterling.com 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, m...
import requests from typing import Optional from pydantic import Field from dbt_cloud.command.command import DbtCloudAccountCommand class DbtCloudJobListCommand(DbtCloudAccountCommand): """Returns a list of jobs in the account.""" order_by: Optional[str] = Field( description="Field to order the resul...
# Copyright: 2019, NLnet Labs and the Internet.nl contributors # SPDX-License-Identifier: Apache-2.0 import os from celery import Celery from celery.schedules import crontab os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'internetnl.settings') app = Celery('internetnl') app.config_from_object('django.conf:settings...
from jsonrpc import ServiceProxy access = ServiceProxy("http://127.0.0.1:37594") pwd = raw_input("Enter wallet passphrase: ") access.walletpassphrase(pwd, 60)
from chill import * source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/fdtd-2d/kernel.c') destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/fdtd-2d/tmp_files/2733.c') procedure('kernel_fdtd_2d') loop(0) known(' nx > 1 ') known(' ny > 1 ') ti...
import os import sys basedir = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) # SQLite URI compatible WIN = sys.platform.startswith('win') if WIN: prefix = 'sqlite:///' else: prefix = 'sqlite:////' class BaseConfig(object): SECRET_KEY = os.getenv('SECRET_KEY', 'dev key') DEBUG_TB_INTER...
# -*- coding: utf-8 -*- import sys from os.path import dirname sys.path.append(dirname(dirname(__file__))) from keras import initializers from keras.engine import InputSpec, Layer from keras import backend as K class AttentionWeightedAverage(Layer): """ Computes a weighted average of the different channels ...
from pyspark import SparkConf, SparkContext import collections conf = SparkConf().setMaster("local").setAppName("RatingsHistogram") sc = SparkContext(conf=conf) lines = sc.textFile("file:///E:/Study/SparkCourse/ml-100k/u.data") ratings = lines.map(lambda x: x.split()[2]) result = ratings.countByValue() sortedResul...
class PriorityQueueBase: ''' abstract base class for a priority queue ''' class _Item: __slots_ = '_key', '_value' def __init__(self, k, v): self._key = k self._value = v def __lt__(self, other): return self._key < other._key def is_empty(self)...
def ants_registration(dir_ants, in_nii, ref_nii, out_nii, prefix_out_tform, typ, in_tform=None, restrict=None): '''ants registration''' import os lin_tform_params = ' '.join([ '--metric MI[%s,%s,1,32,Regular,0.25]'%(ref_nii, in_nii), '--convergence [1000x500x250x125]', '--shrink-fa...
""" """ ## source.python imports from messages import Shake ## __all__ declaration __all__ = ("bash", ) ## bash declaration def bash(player, magnitude, duration): shake_message = Shake(magnitude, duration) shake_message.send(player.index)
# Compares the efficacy of two medications through analysis of 2-by-2 # tables # Copyright (c) 2018 Aubrey Barnard. This is free software released # under the MIT License. See `LICENSE` or # https://choosealicense.com/licenses/mit/ for details. __version__ = '0.0.2' import itertools as itools import math import r...
import asyncio import concurrent import logging from concurrent.futures.thread import ThreadPoolExecutor from pathlib import Path from typing import Callable, Dict, List, Optional, Tuple import chives.server.ws_connection as ws # lgtm [py/import-and-import-from] from chives.consensus.constants import ConsensusConstan...
# Copyright 2009-2017 Ram Rachum. # This program is distributed under the MIT license. from combi._python_toolbox import exceptions from combi._python_toolbox import cute_iter_tools from combi._python_toolbox import nifty_collections from combi._python_toolbox import caching from combi._python_toolbox.third_party impo...
# coding=utf-8 import time from django.conf import settings from django.test import TestCase from algoliasearch_django import AlgoliaIndex from algoliasearch_django import algolia_engine from algoliasearch_django.models import AlgoliaIndexError from .models import User, Website, Example class IndexTestCase(TestCase...
""" Bridging Composite and Real: Towards End-to-end Deep Image Matting [IJCV-2021] Base Configurations class. Copyright (c) 2021, Jizhizi Li (jili8515@uni.sydney.edu.au) Licensed under the MIT License (see LICENSE for details) Github repo: https://github.com/JizhiziLi/GFM Paper link (Arxiv): https://arxiv.org/abs/2010...
import logging from flask import Blueprint from flask_restx import Api from application.configuration import web_templates_dir, web_static_dir from application.apps import apps_folder logger = logging.getLogger("VahenWebsite.apps.anagramos") anagramos_bp = Blueprint('anagramos_bp', __name__, ...
import kfserving from typing import Optional from adserver.base.model import CEModel from alibi_detect.utils.saving import load_detector, Data class AlibiDetectModel(CEModel): # pylint:disable=c-extension-no-member def __init__(self, name: str, storage_uri: str, model: Optional[Data] = None): """ ...
"""Retrieve Tweets, embeddings, and persist in the database.""" from os import getenv import basilica import tweepy from .models import DB, Tweet, User # https://greatist.com/happiness/must-follow-twitter-accounts TWITTER_USERS = ['calebhicks', 'elonmusk', 'rrherr', 'SteveMartinToGo', 'alyankovic', 'n...
# Generated by Django 2.0.3 on 2018-03-19 03:43 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUT...
#coding:utf-8 # # id: bugs.core_0210 # title: CS server crash altering SP in 2 connect # decription: # # tracker_id: CORE-0210 # min_versions: ['2.5.0'] # versions: 2.5 # qmid: None import pytest from firebird.qa import db_factory, isql_act, Action # version: 2.5 # re...
# Generated by Django 2.2 on 2020-06-13 12:06 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('webapp', '0001_initial'), ] operations = [ migrations.RenameField( model_name='student', ...
import sys import warnings # import time warnings don't interfere with warning's tests import pytest with warnings.catch_warnings(record=True): from nistats import _py34_deprecation_warning from nistats import _py2_deprecation_warning from nistats import _python_deprecation_warnings def test_py2_deprec...
from typing import Union import math from skbandit.bandits.base import Bandit class WeightedMajority(Bandit): """Optimal bandit in an adversarial setting. As all good algorithms for adversarial bandits, it randomises its decisions. This algorithm supposes access to full information (i.e. the reward for...
from . import * class HelloWorldController(AppDevController): def get_path(self): return "/hello/" def get_methods(self): return ["GET"] @authorize_user def content(self, **kwargs): return {"message": "Hello, world!"}
""" An API wrapper for pronote. This whole package is licensed under the MIT license: Copyright (c) 2020 bain, Xiloe 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, includin...
# import the pygame module, so you can use it import pygame from pygame.locals import * import warnings import random import numpy as np import math from scipy.spatial import Delaunay import delaunaytriangulation as dt import graphmodel as gm import drawer import utils class gNode(gm.Node): def draw(self, surfac...
from django.test import TestCase from django.contrib.auth import get_user_model class ModelTests(TestCase): def test_create_user_with_email_successful(self): """Test creating a new user with an email is successful""" email = 'test@mail.com' password = '123' user = get_user_model()...
#!/usr/bin/env python3 # ==== This project should be running in a python3 enviroment, preferred in Virtualenv. ==== # # Author: Solomon Xie # Email: solomonxiewise@gmail.com # Project: Sina Blog Crawler # Description: scrap my sina blogs and backup # import requests import re import os import time from random import ...
from __future__ import absolute_import from setuptools import setup, find_packages from setuptools.command.install import install class InstallCommand(install): user_options = install.user_options + [ ('no-ml', None, "Don't install without Machine Learning modules."), ] boolean_options = install....
# # Copyright 2013 Apache Software 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 agree...
import models.SingleLayer_net as single_layer import loss_functions.rank_based_loss as rbl # import wandb import torch import utils.data_functions as df import os import json import pandas as pd import csv os.environ['CUDA_VISIBLE_DEVICES'] = '3' # wandb.init(project='example') exp_name = 'example' # wandb.run.name ...
import os from batman.run import run from tests.integration.utils import batman_dir, touch_file # Virtualenv support def test_that_virtualenv_is_created(): with batman_dir({"virtualenv": "__batman__testenv"}) as tmp_batman_dir: os.system('batman {0}'.format(tmp_batman_dir)) output = '__batman__te...
"""satudata URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-base...
import re import time import random import logging import requests from base import BaseBot logger = logging.getLogger(__name__) MEME_URL = 'http://www.memes.com' MEME_REGEX = re.compile(r'^!meme') SCRAPE_REGEX = re.compile(r'<img id="image_\d+" src="([^"]+)"') def random_meme(): try: html = requests.ge...
import numpy as np list1 = np.array([-2, 1, 2, -10, 22, -10]) list2 = np.array([-20, 123, 112, -10, 22, -120]) print( f"values: {list1}", f"min: {np.min(list1)}", f"max: {np.max(list1)}", f"mean: {np.mean(list1)}", f"median: {np.median(list2)}", sep="\n", end="\n\n" ) print( f"values:...
# -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""),...
# ex: set sts=4 ts=4 sw=4 noet: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license terms. # # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## """Test saveds func...