text
stringlengths
2
999k
## # CH-231-A # hw7_p1.cpp # Henri Sota # h.sota@jacobs-university.de ## import math def insertionSort(Bucket): for j in range(1, len(Bucket)): key = Bucket[j] i = j - 1 # Search for the position where to place key value in the sorted # subarray Bucket[0..i] while (i > -1 an...
from kivystudio.widgets.dropdown import DropDownBase class ScreenDrop(DropDownBase): def open(self, widget, screen_display): self.screen_display = screen_display super(ScreenDrop, self).open(widget)
"""The tests for the MQTT sensor platform.""" import json import unittest from datetime import timedelta, datetime from unittest.mock import ANY, patch import homeassistant.core as ha from homeassistant.setup import setup_component, async_setup_component from homeassistant.components import mqtt from homeassistant.co...
from setuptools import setup, find_packages import codecs import os with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setup( name="Wayload", version="0.1.0", author="W4lk3r", author_email="w000alker@gmail.com", description="payload hide and extract module by W4l...
from sympy.external import import_module # fixes issue that arose in addressing issue 6533 def test_no_stdlib_collections(): ''' make sure we get the right collections when it is not part of a larger list ''' import collections matplotlib = import_module('matplotlib', __import__kwargs={...
# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You may not # use this file except in compliance with the License. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
# -*- coding: utf-8 -*- ''' Set up the Salt integration test suite ''' # Import Python libs from __future__ import absolute_import, print_function import platform import os import re import sys import copy import json import time import signal import shutil import pprint import atexit import logging import tempfile i...
# 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, ...
#LER NOME COMPLETO MOSTRAR O 1 E ÚLTIMO NOME #split = dividir o nome separando pelos espaços n = str(input('Qual o seu nome completo? ')).strip() nome = n.split() print('Prazer em te conhecer!') print('Seu primeiro nome é {}.'.format(nome[0])) print('Seu último nome é {}.'.format(nome[len(nome) - 1])) #mostra o 'nome' ...
import datetime import traceback import discord from discord.ext import commands class TomBotException(Exception): pass class InvalidChannelCheck(commands.CommandError): def __init__(self, command): msg = f'A TextChannel type check for {command.qualified_name} has failed' super().__init__(m...
"""AttentionManagment URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.2/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') ...
"""Utility code for the objectrocket package.""" import functools import datetime import six import sys from six import create_bound_method from objectrocket import errors def register_extension_class(ext, base, *args, **kwargs): """Instantiate the given extension class and register as a public attribute of the...
"""FFNN Grunt node This fil demonstrates how to train a FeedForward Neural network on the network without a training ste. Example: $ python examples/ffnn_grunt.py """ import argparse import math import os import pathlib import time import torch import torch.nn.functional as F from munch import Munch from lo...
# -*- coding: utf-8 -*- """ColorFormatParser class which parses color formatted strings.""" __date__ = '2014-06-02' # YYYY-MM-DD import re import itertools import colorise.compat class ColorSyntaxError(SyntaxError): """Thrown when incorrectly formatted color syntax is encountered.""" pass class ColorF...
DATA = '' MODEL_INIT = '$(pwd)/model_init' MODEL_TRUE = '$(pwd)/model_true' PRECOND = '' SPECFEM_DATA = '$(pwd)/specfem2d/DATA' SPECFEM_BIN = '$(pwd)/../../../specfem2d/bin' MODEL = '$(pwd)/model_true'
import time def test_ui(selenium): selenium.browser.get(selenium.url('/')) time.sleep(1) selenium.browser.get(selenium.url('/languages')) time.sleep(3) selenium.browser.get(selenium.url('/sources')) time.sleep(3)
from .endtoend._endtoend.configs import ( XMLLayerConfig, CandidateLayerConfig, MethodLayerConfig, StylingLayerConfig, TechnicalTermLayerConfig, ) __all__ = [ "XMLLayerConfig", "CandidateLayerConfig", "MethodLayerConfig", "StylingLayerConfig", "TechnicalTermLayerConfig", ]
#!/usr/bin/env python """ record_base.py Common stuff for ole files whose streams are a sequence of record structures. This is the case for xls and ppt, so classes are bases for xls_parser.py and ppt_record_parser.py . """ # === LICENSE ================================================================== # record_bas...
#!/usr/bin/env python import logging import increment_lib def lambda_handler(event, context): """Increments a given CountName, possibly derived from api_gateway info. If CountName does not exist, conditional_get_count will return a zero, so this function will increment and return 1.""" logging.warning(...
# --------------------------------------------------------------------- # Vendor: Brocade # OS: FabricOS # --------------------------------------------------------------------- # Copyright (C) 2007-2010 The NOC Project # See LICENSE for details # ---------------------------------------------------------------------...
from collections import deque from functools import wraps from content_editor.contents import contents_for_item from django.core.cache import cache from django.utils.functional import SimpleLazyObject from django.utils.html import mark_safe __all__ = ("Regions", "matches", "cached_render") def cached_render(fn): ...
from .Object import Object class DetectedObjects: def __init__( self, boxes, scores, classes, num, category_index, path, shape ) -> None: self._boxes = boxes self._scores = scores self._classes = classes self._num = num self._category_index = category_index ...
# Copyright 2015 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...
#!/usr/bin/env vpython3 # coding: utf-8 import os import sys import binascii import datetime import PyKCS11 from cryptography import x509 from cryptography.x509.oid import NameOID from cryptography.hazmat.primitives import hashes from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primit...
# This script generates a word cloud of my linux-cheatsheet and a python logo mask import numpy as np from PIL import Image from wordcloud import STOPWORDS from wordcloud import WordCloud # os.chdir(sys.path[0]) text = open('input/wordcount_CheatSheet.md', mode='r', encoding='utf-8').read() stopwords = STOPWORDS st...
# Generated by Django 3.1.13 on 2021-11-16 15:31 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('log', '0001_initial'), ...
#coding=utf-8 from flask import Flask,request import urllib2,re str = 'abcacacccddfds' print re.findall('ee',str)
""" Compute filter edges ==================== In this tutorial we are going to learn how to compute the first order and second order derivatives of an image using `kornia.filters`. """ import cv2 import numpy as np import torch import torchvision from matplotlib import pyplot as plt import kornia ##################...
#!/usr/bin/env python """ _StoreResults_t_ Unit tests for the StoreResults workflow. """ from __future__ import print_function from future.utils import viewitems import threading import unittest from WMCore.DAOFactory import DAOFactory from WMCore.WMBS.Fileset import Fileset from WMCore.WMBS.Subscription import Subs...
import json import os import socket from app import train def main(): os.environ["NCCL_DEBUG"] = "INFO" os.environ["NCCL_SOCKET_IFNAME"] = os.environ["SM_NETWORK_INTERFACE_NAME"] # List of nodes that participate in multi-node training. hosts = json.loads(os.environ["SM_HOSTS"]) # Name and rank ...
# This file only contains a selection of the most common options. For a full list see # the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html import os import pathlib import sys # If extensions (or modules to document with autodoc) are in another directory, add # these directories to sys.p...
''' Derived from preprocessing-py.py to run in Spark for parallelism ''' import os from typing import Dict, List, NamedTuple, Set, Tuple, Union import re import json import datetime as dt from collections import Counter import pandas as pd # from sklearn.model_selection import train_test_split # from sklearn.feature_e...
# encoding: utf-8 """ A lightweight Traits like module. This is designed to provide a lightweight, simple, pure Python version of many of the capabilities of enthought.traits. This includes: * Validation * Type specification with defaults * Static and dynamic notification * Basic predefined types * An API that is si...
# # Generated with WaveKinematicsDiffPointBlueprint from dmt.blueprint import Blueprint from dmt.dimension import Dimension from dmt.attribute import Attribute from dmt.enum_attribute import EnumAttribute from dmt.blueprint_attribute import BlueprintAttribute from .nodereference import NodeReferenceBlueprint class Wa...
#!/usr/bin/env python3 """Generate an updated requirements_all.txt.""" import importlib import os import pkgutil import re import sys import fnmatch COMMENT_REQUIREMENTS = ( 'RPi.GPIO', 'raspihats', 'rpi-rf', 'Adafruit-DHT', 'Adafruit_BBIO', 'fritzconnection', 'pybluez', 'beacontools', ...
import os import sys import time import signal import threading import atexit import Queue _interval = 1.0 _times = {} _files = [] _running = False _queue = Queue.Queue() _lock = threading.Lock() def _restart(path): _queue.put(True) prefix = 'monitor (pid=%d):' % os.getpid() print >> sys.stderr, '%s Cha...
from setuptools import find_packages, setup setup( name="downloads_infrastructure", version="0.0.0", packages=find_packages(), install_requires=["injector", "downloads"], extras_require={"dev": ["pytest"]}, )
import discord import discordbot.config_discordbot as cfg from gamestonk_terminal.economy import wsj_model async def overview_command(ctx): """Market data overview [Wall St. Journal]""" try: # Debug user input if cfg.DEBUG: print("\n!economy.overview") # Retrieve data ...
from django.core.files.uploadedfile import SimpleUploadedFile from django.test import TestCase from django.test.client import Client from django.urls import reverse from bs4 import BeautifulSoup from mock import patch from corehq.apps.app_manager.models import APP_V1, Application from corehq.apps.domain.models import...
# Openshaw, S. and Rao, L. (1995). Algorithms for reengineering 1991 census geography. Environment and Planning A, 27(3):425-446. from ..BaseClass import BaseSpOptHeuristicSolver import abc from collections import deque import math import random import numpy as np import networkx as nx from spopt.region.csgraph_util...
# -*- coding: utf-8 -*- from datetime import date, time import pytest from tests.utils import file_response from city_scrapers.spiders.cook_hospitals import Cook_hospitalsSpider test_response = file_response('files/cook_hospitals.html', url='http://www.cookcountyhhs.org/about-cchhs/governance/board-committee-meeting...
"""Determine a common mode that can support multiple images.""" import warnings from PIL import Image import numpy as np SUPPORTED_MODES: dict[str, set[str]] = { '1': {'1'}, 'L': {'1', 'L'}, 'LA': {'1', 'L', 'LA'}, 'P': set(), 'RGB': {'1', 'L', 'P', 'RGB'}, 'PA': set(), 'RGBA': {'1', 'L'...
""" .. module: lemur.endpoints.models :platform: unix :synopsis: This module contains all of the models need to create an authority within Lemur. :copyright: (c) 2018 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. moduleauthor:: Kevin Glisson <kglisson@netflix.c...
# -*- coding: utf-8 -*- def comp_surface_active(self): """Compute the Slot inner surface for winding (by analytical computation) Parameters ---------- self : SlotM16 A SlotM16 object Returns ------- Swind: float Slot inner surface for winding [m**2] """ return s...
from unittest import TestCase import os from musicscore.musicstream.streamvoice import SimpleFormat from musicscore.musictree.treescoretimewise import TreeScoreTimewise from tests.score_templates.xml_test_score import TestScore path = os.path.abspath(__file__).split('.')[0] class Test(TestCase): def setUp(self)...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. """Module of the Cuda memory performance benchmarks.""" import os import re from superbench.common.utils import logger from superbench.benchmarks import BenchmarkRegistry, Platform, ReturnCode from superbench.benchmarks.micro_benchmarks import ...
from __future__ import print_function from future import standard_library standard_library.install_aliases() from builtins import range import sys import os.path import time import inspect import subprocess import threading import queue import re from .common import * # ---------------------------------------------...
from stock.models import\ StockInfo,\ TradeRecord,\ StockBonusHistory,\ StockAllotmentHistory class Stock: """Stock base class.""" def __init__(self, code): self.code = code def get_all_trade_date(self, order=0): """ Get stock's list dates. order: default...
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.actions import page_action from telemetry.web_perf import timeline_interaction_record class RepeatableScrollAction(page_action.Page...
# coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. OpenAPI spec version: v2 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from ppr...
from __future__ import print_function, absolute_import import argparse from py2jn.tools import python_to_notebook description = """ Convert a literate Python script into a Jupyter Notebook """ def main(): ap = argparse.ArgumentParser(description=description) ap.add_argument("source", help="python filename")...
import boto3 from botocore.exceptions import ClientError if __name__ == "__main__": collectionId='Gamers' print('Attempting to describe collection ' + collectionId) client=boto3.client('rekognition') try: response=client.describe_collection(CollectionId=collectionId) print("Collection...
# Copyright 2017 Battelle Energy Alliance, 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 t...
import socket import ssl import pytest # noqa from yarl import URL # noqa from python_socks import ( ProxyType, ProxyError, ProxyTimeoutError, ProxyConnectionError ) from python_socks._proxy_sync import SyncProxy # noqa from python_socks._resolver_sync import SyncResolver # noqa from python_socks....
class Solution: def stringMatching(self, words: List[str]) -> List[str]: words.sort(key=len) res = [] lps = [self._compute_lps(w) for w in words[:-1]] for i in range(len(words)): for j in range(i + 1, len(words)): if self._kmp(words[i], words[j], lps[i]): ...
#!/usr/bin/env python # Copyright 2015-2016 Yelp Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
print('11111') print (22222)
from distutils.core import setup with open("README.rst", "r") as fh: long_description = fh.read() setup( name='libinfinitton', packages=['.'], version='0.3', license='MIT', description='Cross platform library to use Infinitton device', long_description=long_description, long_descriptio...
import logging import json import os import time import base64 from google.cloud import pubsub_v1 from google.cloud import vision, storage from google.protobuf import json_format import google.cloud.dlp def documentOCR(vision_client, gcs_source_uri, gcs_destination_uri, batch_size=20): """ Args: vis...
# -*- coding: utf-8 -*- import sys import os import models import glob import threading import shutil import gi gi.require_version('Gtk', '3.0') gi.require_version('EvinceDocument', '3.0') gi.require_version('EvinceView', '3.0') from gi.repository import EvinceDocument, EvinceView from gi.repository import GLib, Gio...
import inspect import os from argparse import ArgumentParser, Namespace from typing import Union, List, Tuple, Any from pytorch_lightning.utilities import parsing def from_argparse_args(cls, args: Union[Namespace, ArgumentParser], **kwargs): """ Create an instance from CLI arguments. Eventually use varibl...
from checkov.common.models.enums import CheckResult, CheckCategories from checkov.cloudformation.checks.resource.base_resource_check import BaseResourceCheck class S3AccessLogs(BaseResourceCheck): def __init__(self): name = "Ensure the S3 bucket does not allow READ permissions to everyone" id = "C...
#!/usr/bin/python3 -u # -*- coding: utf-8 -*- # Source: Dave Hylands USB monitor at # https://github.com/dhylands/usb-ser-mon/blob/master/find_port.py """Program which detects USB serial ports. This program will search for a USB serial port using a search criteria. In its simplest form, you can use the -l (--list) o...
""" Copyright (c) 2020 COTOBA DESIGN, Inc. 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, distri...
#!/usr/bin/env python from os.path import join, dirname try: from setuptools import setup except ImportError: from distutils.core import setup def read(name, *args): try: return open(join(dirname(__file__), name)).read(*args) except OSError: return '' setup( name='tulipcore', ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import os import sys import uuid from email.message import Message from flask import current_app, request, jsonify from .authentication import auth from .errors import not_found, forbidden python_ver = sys.version_info python3_ver = (3, 0) if python_ver >= pyth...
from werkzeug.security import safe_str_cmp from user import User users = [ User(1, "bob", 'asdf') ] username_mapping = {u.username: u for u in users} userid_mapping = {u.id: u for u in users} def authenticate(username, password): user = username_mapping.get(username, None) # # if user and user.p...
""" Memory usage functions. """ import sys import collections import numpy as nm import scipy.sparse as sp from sfepy.base.base import basestr, Struct, Output def get_mem_usage(obj, usage=None, name=None, traversal_order=None, level=0): """ Get lower bound of memory usage of an object. Takes into accoun...
"""Python library for Simple Service Discovery Protocol (SSDP).""" import ssdp.asyncio as asyncio import ssdp.entity as entity import ssdp.network as network from ssdp.asyncio import * from ssdp.entity import * __all__ = entity.__all__ + asyncio.__all__
""" これは わたし用のプログラムだぜ☆つ(^~^)! """ import os import shutil import subprocess source = 'C:/Users/むずでょ/source/repos/tororo-go-js' destination = 'C:/Users/むずでょ/Documents/GitHub/tororo-go-js' def go(): print('Trace | Remove.') remove_destination_dir('/meta') remove_destination_dir('/src') remove_destinat...
# -*- coding: utf-8 -*- from django.core.urlresolvers import reverse from django.db import models from django.utils import timezone from django.contrib.auth.models import User from django.db.models.signals import m2m_changed from django.db.models.signals import post_save from groups.models import Group from issues.mo...
# -*- coding: utf-8 -*- # @Author : XiaoGang # @Time : 2020/2/29 20:11 # @File : operate_db.py import pymysql, traceback class Singleton: def __new__(cls, *args, **kwargs): if not hasattr(cls, "_instance"): cls._instance = super().__new__(cls) return cls._instance class MySql(S...
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-04-18 06:19 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('socialapp', '0006_auto_20160415_0721'), ] operation...
import logging import click from .app import CLI2App log = logging.getLogger(__name__) @CLI2App.cli.command('hello1') def hello1(): click.echo('hello1') @CLI2App.cli.command('is-quiet') def is_quiet(): print('printed foo') log.info('logged foo') @CLI2App.cli.command('is-not-quiet') def is_not_quiet...
import pandas as pd import numpy as np import requests import json import os class ScopusModified(object): def __init__(self, apikey=None): self.apikey = apikey def _parse_author(self, entry): #print(entry) author_id = entry['dc:identifier'].split(':')[-1] lastname = entry['p...
# pylint: disable=wildcard-import """Faster-RCNN Object Detection.""" from __future__ import absolute_import from .faster_rcnn import * from .faster_rcnn_deformable import *
# Copyright 2021 Pants project contributors. # Licensed under the Apache License, Version 2.0 (see LICENSE). from helloworld.util.settings_for_tests import configure_settings configure_settings(["helloworld.greet"])
from marshmallow import Schema, fields from ebl.corpus.application.id_schemas import ChapterIdSchema from ebl.corpus.web.chapter_schemas import ApiLineSchema class LineSchema(Schema): atf = fields.String() class ChapterInfoSchema(Schema): id_ = fields.Nested(ChapterIdSchema, data_key="id") siglums = fi...
from muzero.environment.games import Game from typing import Optional from gym import core import collections KnownBounds = collections.namedtuple('KnownBounds', ['min', 'max']) class MuZeroConfig: """ Containing all values relevant for setting up the whole structure of MuZero and the Monte Carlo Tree Searc...
# This file is part of ARES. # # Copyright (C) 2015, Dario Incalza <dario.incalza at gmail.com> # 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.apac...
import ci.util from dso.deliverydb.db import DeliveryDB def default_with_cfg_name( cfg_name: str, ) -> DeliveryDB: cfg_fac = ci.util.ctx().cfg_factory() cfg = cfg_fac.compliancedb(cfg_name) return DeliveryDB( username=cfg.credentials().username(), password=cfg.credentials().password(),...
# coding: utf-8 """ Billing API Billing API allows users to retrieve billing reports and service package details. OpenAPI spec version: 1.4.7 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import io import json import ssl import cer...
log_level = 'INFO' load_from = None resume_from = None dist_params = dict(backend='nccl') workflow = [('train', 1)] checkpoint_config = dict(interval=10) evaluation = dict(interval=1, metric=['NME'], save_best='NME') optimizer = dict( type='Adam', lr=5e-4, ) optimizer_config = dict(grad_clip=None) # learning p...
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
# richard -- video index system # Copyright (C) 2012, 2013, 2014, 2015 richard contributors. See AUTHORS. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the Licens...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'mainwindow.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. from PyQt5 import QtCore, Q...
import fnmatch import json import os import sys master_permissions_path = os.path.join( os.path.dirname(os.path.realpath(__file__)), 'master_permissions.json') # To update the master_permissions.json, open this URL in chrome: # https://awspolicygen.s3.amazonaws.com/policygen.html # Bring up the console from t...
#!/usr/bin/env python3 import os, sys, datetime, time, base64, logging, signal, re, ssl, traceback, threading from urllib.request import urlopen, Request from urllib.error import HTTPError, URLError from socketserver import ThreadingMixIn from http.server import BaseHTTPRequestHandler, HTTPServer from poshc2.server.I...
from matomat.models.menu import MenuKey, MenuEntry class Authorization(object): def __init__(self, db, log): self.db = db self.currentUser = None self.log = log def login(self, username, password): """Try to login the given username and password combination, returns wether l...
import pytest import slovo class Eng(slovo.Word): lang = "en" class Deu(slovo.Word): lang = "de" def test_all(): it = Eng("It") es = Deu("Es") assert str(it) == "(en) It" assert it.__html__() == "<small>(en)</small> It" assert it.get_image() is None it_picture = "https://i.pinim...
# Copyright 2021 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...
import taichi as ti import taichi_glsl as ts ti.init(ti.gpu) @ti.kernel def test_list(): a = [1.0, -1.0] for i in ti.static(a): for j in ti.static(a): for k in ti.static(a): print(ts.vec(i, j, k)) @ti.kernel def test_list2(): a = [[1, 2], [2, 4], [3, 6]] b = [5, 6...
# -*- coding: utf-8 -*- """ game.utils ~~~~~~~~ Utilities used throughout the entire game (c) 2015 by Alejandro Ricoveri See LICENSE for more details. """ import pyglet from . import colors FONT_PRIMARY = '8-bit Operator+' FONT_SECONDARY = '8-bit Operator+ 8' def create_label(text='', *, window, ...
import hashlib import json import logging import math import re import secrets import string import time import urllib.parse from base64 import b64encode from datetime import datetime, timezone from http import HTTPStatus import google_crc32c from gcp_storage_emulator.exceptions import Conflict, NotFound logger = log...
""" Package for SoccerPlanner. """
# -*- coding: utf-8 -*- """ Created on Mon Feb 18 18:08:59 2019 @author: MRS """ import numpy as np import matplotlib.pyplot as plt N = 20 N0, N1 = 10, 10 mu0 = np.array([10, 0]) X0 = np.random.randn(2, N0) + mu0[:, np.newaxis] mu1 = np.array([-10, 10]) X1 = np.random.randn(2, N1) + mu1[:, np....
# Copyright 2017 The WPT Dashboard Project. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json import os import re import unittest VALID_PLATFORM_ID_REGEX = r"^[a-z0-9\-\.]+$" REQUIRED_PLATFORM_FIELDS = { 'currently_run': (True, ...
from boto.dynamodb2.table import Table from boto.dynamodb2.fields import HashKey, RangeKey from boto.dynamodb2.types import STRING from boto.exception import JSONResponseError def main(): try: Table.create( 'makerdb_vendor_items', schema=[ HashKey('vendor_name', dat...
from core.himesis import Himesis, HimesisPreConditionPatternLHS import uuid class HUnitR03a_ConnectedLHS(HimesisPreConditionPatternLHS): def __init__(self): """ Creates the himesis graph representing the AToM3 model HUnitR03a_ConnectedLHS """ # Flag this instance as compiled now self.is_compiled = True s...
# coding=utf-8 # Copyright 2017-2019 The THUMT Authors from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import torch import torch.distributed as dist import tagger.utils as utils import tagger.utils.summary as summary from tagger.optimizers.sche...