content
stringlengths
5
1.05M
import requests import time import datetime import json import csv # def get(t): # res_text=requests.get('http://nufm.dfcfw.com/EM_Finance2014NumericApplication/JS.aspx?type=CT&cmd=0000011,3990012&sty=CTBFTA&st=z&sr=&p=&ps=&cb=&token=70f12f2f4f091e459a279469fe49eca5').text # data=eval(res_text) # dh=data[0...
import socket from socket import * from win32clipboard import * from win32con import * print "ClipCross Alpha" host = "" #Accept connection from any machine. port = 6000 #We will communicate over port 6000 of this machine. Ports 0-1024 are restricted, ports 1025-65535 are n...
# 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, Dict, List, Mapping, Optional, Tuple, Union from .. import ...
import logging from pkg_resources import DistributionNotFound, get_distribution from feast.infra.offline_stores.bigquery_source import BigQuerySource from feast.infra.offline_stores.contrib.spark_offline_store.spark_source import ( SparkSource, ) from feast.infra.offline_stores.file_source import FileSource from ...
# -*- coding: utf-8 -*- """ Created on Sun Apr 8 10:41:43 2018 @author: Haosong """ import sys sys.path.append("C:\\CSCI1001_Project\\PrepareData.py") # Replace the thing in the braces above with the current path PrepareData.py is in import PrepareData PrepareData.prepareData()
from django.shortcuts import render, get_object_or_404, redirect from rest_framework.views import APIView from rest_framework.response import Response import json from .functions import classify_passenger, load_model class get_classification(APIView): def post(self, request): model = load_model('./api/titanic_...
# -*-coding:utf-8-*- from mobpush.model.BasePush import BasePush class IosNotify(BasePush): serialVersionUID = 6316980682876425791 BADGE_TYPE_SET = 1 BADGE_TYPE_ADD = 2 SLIENT = 1 def __init__(self, title=None, subtitle=None, attachment=None, attachmentType=None, mutableContent=N...
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer from itsdangerous import URLSafeSerializer as URLSafeSerializer def generate_auth_token(secret_key, username, password): serializer = Serializer(secret_key, expires_in=15000) token = serializer.dumps({'username': username, "password": pass...
import mlflow from threading import Thread import os import time from sapsan.core.models import ExperimentBackend class MLflowBackend(ExperimentBackend): def __init__(self, name: str = 'experiment', host: str = 'localhost', port: int = 9000): super().__init_...
#!/usr/bin/env python3 # Copyright 2019 HTCondor Team, Computer Sciences Department, # University of Wisconsin-Madison, WI. # # 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....
from core.buckets import BucketExtend from core.sampler import Sampler class LowDiscrepancySampler(Sampler): def __init__(self, bucket_extend: BucketExtend, samples_count: int, shutterOpen: float, shutterClose: float): super().__init__(bucket_extend, samples_count, shutterOpen, shutterClose) ...
#!/usr/bin/env python # coding: utf-8 # In[2]: from pathlib import Path import numpy as np import pandas as pd train = pd.read_csv("corpus/imdb/labeledTrainData.tsv", header=0, delimiter="\t", quoting=3) test = pd.read_csv("corpus/imdb/testData.tsv", header=0, delimiter="\t",...
# Available debug categories. DEBUG_CATEGORIES = { 'architects': False, 'callbacks': False, 'controllers': False, 'drivers': False, 'emitters': False, 'imap': False, 'managers': False, 'workers': False, 'all': False, } # Default categories for the 'all' keyword. DEBUG_ALL_CATE...
class Solution: def sortColors(self, nums): return nums.sort() if __name__ == '__main__': nums = [0, 1, 2, 2, 1, 1, 2, 2, 0, 0, 0, 0, 2, 1] print("Before Sort: ") print(nums) # [0, 1, 2, 2, 1, 1, 2, 2, 0, 0, 0, 0, 2, 1] Solution().sortColors(nums) print("After Sort: ") print(n...
#!/usr/bin/env python3 """ Check Lisp examples in a Markdown file. To run (assuming this repo is a submodule in a dir called .cl-make): $ pip3 install -r .cl-make/requirements.txt $ .cl-make/readme.py README.md The return code is zero iff all Lisp examples in the file run without errors in an SBCL REPL and ...
#!/usr/bin/python import serial import time import sys if len(sys.argv) != 2: print "Usage: %s <serial port>" % sys.argv[0] sys.exit() def getResponse(): time.sleep(0.25) s = ser.readline() print "RECV: " print s if "NMI:" in s: print "NMI signal received" #sys.exit() ...
import cfscrape from flask import request from flask_restplus import Resource, Namespace, fields, abort from Servers.AnimeFLV.scraper import getList, scrapeEpisodeList, scrapeEpisode, scrapeGenre, scrapeGenreList, scrapeFeed, scrapeLastAnimeAdded cfscraper = cfscrape.create_scraper(delay=10) animeflv_api = Namespace(...
from threading import Lock from twisted.internet import protocol, reactor class ClientProtocol(protocol.Protocol): def dataReceived(self, data): self.server_protocol.transport.write(data) def connectionLost(self, reason): self.server_protocol.transport.loseConnection() class ClientFactory(...
from pathlib import Path from collections import defaultdict import sys TEST_MODE = bool(len(sys.argv) > 1 and sys.argv[1] == "test") CARD = ['E', 'S', 'W', 'N'] DIRECTIONS = [(1,0),(0,1),(-1,0),(0,-1)] ROTATIONS = [(1,0,0,1),(0,-1,1,0),(-1,0,0,-1),(0,1,-1,0)] def phase1(data): pos = [0,0] facing = 0 for...
import pytest from rotkehlchen.tests.utils.ethereum import ETHEREUM_TEST_PARAMETERS @pytest.mark.parametrize(*ETHEREUM_TEST_PARAMETERS) def test_get_block_by_number(ethereum_manager): block = ethereum_manager.get_block_by_number(10304885) assert block['timestamp'] == 1592686213 assert block['number'] == ...
# Copyright 2021 Alibaba Group Holding Limited. All Rights Reserved. import os import random import numpy as np import torch def set_random_seed(seed): random.seed(seed) np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed(seed) torch.cuda.manual_seed_all(seed) os.environ['PYT...
# Copyright 2006-2012 Mark Diekhans import re from pycbio.hgdata.autoSql import intArraySplit, intArrayJoin, strArraySplit, strArrayJoin from pycbio.tsv.tabFile import TabFileReader from pycbio.hgdata import dnaOps from pycbio.hgdata.cigar import ExonerateCigar from collections import defaultdict from deprecation impor...
from pydantic import BaseSettings class Settings(BaseSettings): MONGO_URI: str = "mongodb://localhost:27017/" APP_DB: str = "ultraapp" JWT_SECRET: str = "S3CR3T" # jwt secret JWT_LIFETIME: int = 3600 * 24 settings = Settings()
import time from typing import List class Solution: def evalRPN(self, tokens: List[str]) -> int: stack = [] for token in tokens: if not stack: stack.append(token) if token in {'+', '-', '*', '/'}: y = stack.pop() x = stack.pop...
""" Create an OpenVINO model package to upload to Azure Blob Storage and use IoT Hub module update twin to update the Azure Percept AzureEyeModule. """ import argparse import os import json import zipfile import datetime from azure.storage.blob import ( BlockBlobService, BlobPermissions, ) from azure.iot.hub im...
EPSILON = 0 UNICODE_LATIN_START = 32 UNICODE_LATIN_END = 127 SEEK_RULE = 1 SEEK_RULE_NAME = 2 SEEK_ST_COLON = 3 SEEK_ND_COLON = 4 SEEK_EQUALS = 5 SEEK_ST_PROD = 6 SEEK_ST_TERM = 7 SEEK_ST_NTERM = 8 SEEK_ST_ESC = 9 SEEK_PROD = 10 SEEK_TERM = 11 SEEK_NTERM = 12 SEEK_ESC = 13 SEEK_SPECIAL_TERM = 14 SEEK_SPECIAL_NTERM = ...
''' Script to do analysis ''' import argparse import logging import time import torch import transformers import itertools from collections import defaultdict from models import MTModel # Use with care: logging error only while printing analysis for reading sanity transformers.utils.logging.set_verbosity_error() de...
from __future__ import annotations import numpy as np from PySide2.QtCore import QPoint, QRect from PySide2.QtWidgets import QMdiSubWindow class DataViewerSubWindow(QMdiSubWindow): def __init__(self, viewer: DataViewer): super().__init__() self.viewer = viewer self.layout_anchors = None...
class AMQPError(Exception): message = 'An unspecified AMQP error has occurred: %s' def __repr__(self): return "<%s: %s>" % (self.__class__.__name__, self.message % self.args) # Backward compatibility AMQPException = AMQPError class AMQPConnectionError(AMQPError): message = 'Connection can not ...
import sys import time from collections import deque from datetime import timedelta from rich import get_console from rich.progress import BarColumn, Progress, ProgressColumn, SpinnerColumn, TextColumn class TimeRemainingColumn(ProgressColumn): """Renders estimated time remaining.""" # Only refresh twice a ...
import arcpy arcpy.env.overwriteOutput = True # Note: Script assumes data from Pro SDK community samples are installed under C:\Data, as follows: inFC = r"E:\GISTech\2021\ProProjects\PythonUsage\PythonUsage.gdb\FCL_Lijn" outFC = r"E:\GISTech\2021\ProProjects\PythonUsage\PythonUsage.gdb\ViaScript" # Buffer the input f...
# -*- coding: utf-8 -*- from bitshares import BitShares from bitshares.instance import set_shared_bitshares_instance from bitshares.amount import Amount from bitshares.price import Price from bitshares.asset import Asset import unittest class Testcases(unittest.TestCase): def __init__(self, *args, **kwargs): ...
from ._version import VERSION from ._chat_client import ChatClient from ._chat_thread_client import ChatThreadClient from ._generated.models import ( SendChatMessageResult, ChatThreadInfo, ChatMessageType ) from ._shared.user_credential import CommunicationTokenCredential from ._shared.user_token_refresh_op...
from django.test import TestCase from wagtailmenus.conf import constants from wagtailmenus.models import MainMenu from wagtailmenus.tests import base, utils Page = utils.get_page_model() class MainMenuTestCase(TestCase): """A base TestCase class for testing MainMenu model class methods""" fixtures = ['test...
""" Receba a altura do degrau de uma escada e a altura que o usuário deseja alcançar subindo a escada. Calcule e mostre quantos degraus o usuário deverá subir para atingir o seu objetivo. """ a = float(input('Qual é a altura do degrau da escada (cm)? ')) ab = float(input('Qual é a altura que você deseja alcançar subin...
import numpy as np from netCDF4 import Dataset from .utils import popEntries,setDimensions from .OBSstruct import OBSstruct import pandas as pd def remove_duplicates(S, coordinate = 'fractional'): ''' This function identifies duplicated observations and makes sure all observation on output are unique. ...
import matplotlib.pyplot as plt import csv import random import numpy as np import math import matplotlib.patches as patches data = {} with open('datasets/data_boston.csv', 'r') as csvfile: csvfile.readline() file = csv.reader(csvfile, delimiter=',') for row in file: if data.has_key(row[5]): data[row[5]].appe...
#!/usr/bin/python #coding:utf-8 import os import re import string import linecache import shutil #Get file name from given directory directoryPath = os.getcwd() #directoryPath2 = os.getcwd() + '\\New' file_extension = ".md" if __name__ == '__main__': for fileName in os.listdir(directoryPath): if(fileName...
from .point_cloud import PointCloud, PointCloudMeta, PointCloudSpatial # noqa
def empty_graph(n): res = [] for i in range(n): res.append([0]*n) return res def convert(graph): matrix = [] for i in range(len(graph)): matrix.append([0]*len(graph)) for j in graph[i]: matrix[i][j] = 1 return matrix def prims_algo(graph): graph1 = conver...
# # customization fragment to run L1 GT emulator starting from a RAW file # # V.M. Ghete 2010-06-09 import FWCore.ParameterSet.Config as cms def customise(process): # # (re-)run the L1 GT emulator starting from a RAW file # from L1Trigger.Configuration.L1Trigger_custom import customiseL1GtEmulat...
""" Overview: Useful functions for build representation format of object. """ from typing import List, Tuple __all__ = [ 'get_repr_info', ] def get_repr_info(cls: type, args: List[Tuple]) -> str: """ Overview: Get representation information for object. Can be used in ``__repr__`` meth...
# -*- Mode: Python; tab-width: 4 -*- # Copyright (c) 2005-2010 Slide, 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: # # * Redistributions of source code must retain the above copyrig...
from bnop_source.b_code.bnop_facades import BnopFacades from bnop_source.b_code.core.object_model.bnop_repositories import BnopRepositories from bnop_source.b_code.core.object_model.objects.bnop_objects import BnopObjects from boro_common_source.ckids.boro_object_ckids import BoroObjectCkIds from nf_common_source.code....
""" Unit tests for flat_file.py See: https://code.visualstudio.com/docs/python/testing """ import unittest from cred_manage.flat_file import FlatFileCredContainer import os FLAT_FILE_THAT_EXISTS='/tmp/file_that_exist.txt' FLAT_FILE_THAT_DOES_NOT_EXIST='/tmp/file_that_not_exists.txt' def setUpModule(): """ ...
from marshmallow import fields, validate from app import ma from nfmanagementapi.models import FilterRule class FilterRuleSchema(ma.SQLAlchemyAutoSchema): class Meta: model = FilterRule ordered = True uuid = fields.UUID(required=True, description="Unique Identifier", dump_only=True) n...
import sys import Adafruit_DHT import Adafruit_BMP.BMP085 as BMP085 import requests def getReadings(): humidity, dht_temp = Adafruit_DHT.read_retry(22, 4) if humidity is not None and dht_temp is not None: bmp_sensor = BMP085.BMP085() pressure = bmp_sensor.read_pressure() bmp_temp = bmp_...
# Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def mergeTwoLists(self, l1: ListNode, l2: ListNode) -> ListNode: if not l1: return l2 if not l2: return l1 ...
import bug_killer_client.network.project as project_client from bug_killer_api_interface.schemas.request.project import CreateProjectPayload, UpdateProjectPayload from bug_killer_api_interface.schemas.response import UserProjectsResponse, ProjectResponse async def get_user_projects(auth: str) -> UserProjectsResponse:...
import imageio import pandas as pd import matplotlib.pyplot as plt import trackviz.static tracks = pd.read_csv('sample_data/ant_tracking_res.csv').rename(columns={'frame': 't'}) fig, ax = trackviz.static.trajectory_3d(tracks, color='t', line_kws=dict(linewidths=0.5)) fig.savefig('output/static_3d_color_frame.png') # ...
from typing import Any from typing import Optional import aiohttp from ...box import box from ...command import argument from ...command import option from ...event import Message from ...utils import json box.assert_config_required('NAVER_CLIENT_ID', str) box.assert_config_required('NAVER_CLIENT_SECRET', str) LANG...
"""Python wrappers around TensorFlow ops. This file is MACHINE GENERATED! Do not edit. Original C++ source file: image_ops.cc """ import collections as _collections from tensorflow.python.eager import execute as _execute from tensorflow.python.eager import context as _context from tensorflow.python.eager import core...
""" Copyright 2018 Ederson Bilhante Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to ...
import math import torch import torch.nn as nn import torch.nn.functional as F import torchvision.models as models from einops import rearrange from torch import Tensor device = "cuda" if torch.cuda.is_available() else "cpu" DEVICE = device class PositionalEncoding(nn.Module): def __init__(self, d_model: int, dro...
# teste = list() # teste.append('Henrique') # teste.append(15) # # galera = list() # galera.append(teste[:]) # # teste[0] = 'Maria' # teste[1] = 22 # # galera.append(teste[:]) # print(galera) galera = [['João', 19], ['Alana', 16], ['Maria', 33], ['Pedro', 25]] for p in galera: print(f'Nome: {p[0]} \nIdade: {p[1]}...
from django.db import IntegrityError from django.db.models import Q from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from cajas.boxes.services.box_daily_square_manager import BoxDailySquareManager from cajas.users.models.employee import Employee ...
#!/usr/bin/env python3 # Copyright (C) 2018 Adrian Herrera # # 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...
# -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt5 (Qt v5.12.8) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\xb4\xdf\ \xff\ \xd8\xff\xe0\x00\x10\x4a\x46\x49\x46\x00\x01\x01\x00\x00\x01\x00\ \x01\x00\x00\x...
class RunnerTemplate: def exec(self, data): pass
import asyncio import logging import re from io import BytesIO import discord from redbot.core import checks, commands from redbot.core.bot import Red from redbot.core.utils.chat_formatting import box, inline from tsutils.emoji import char_to_emoji, fix_emojis_for_server, replace_emoji_names_with_code logger = loggin...
# Lint as: python3 # Copyright 2019 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 ...
# LIBRARIES from django.db import models from django.db.utils import IntegrityError from django.contrib.contenttypes.models import ContentType # DJANGAE from djangae.db import transaction from djangae.fields import ( ComputedCharField, GenericRelationField, ListField, RelatedSetField, RelatedListFi...
class DocumentOCRViewTestMixin(object): def _request_document_content_view(self): return self.get( viewname='ocr:document_ocr_content', kwargs={ 'document_id': self.test_document.pk } ) def _request_document_content_delete_view(self): return self...
import attr import aiohttp import asyncio from typing import Any, Optional # Not frozen, since that doesn't work in PyPy @attr.s(slots=True, auto_exc=True, auto_attribs=True) class FacebookError(Exception): """Base class for all custom exceptions raised by ``fbchat``. All exceptions in the module inherit thi...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
"""Lambda pocket-to-kindle create_epub.""" from datetime import datetime from os import environ as env from os import stat from shlex import join from subprocess import (run, CalledProcessError, TimeoutExpired) from tempfile import NamedTemporaryFile from uuid import uuid4 import utils import utils.aws as aws import u...
# default_settings.py # # Author(s): # Exequiel Ceasar Navarrete <esnavarrete1@up.edu.ph> # # Licensed under MIT # Version 1.0.0 import os #======================================================== # [Flask-specific configuration] ::start #======================================================== DEBUG = False CACH...
from __future__ import annotations import typing if typing.TYPE_CHECKING: from src.typehints import AnyCallableT __all__: tuple[str, ...] = ("is_classvar",) def is_classvar(fn: AnyCallableT) -> bool: return hasattr(fn, "__classvar__")
#!/usr/bin/python from urllib2 import urlopen import json, re from json import loads def print_json(j): j = json.dumps(j, sort_keys=True, indent=2) # j = re.sub(j, r'\n', '\\n') print j def my_urlopen(url): print "\nurlopen:", url return urlopen(url) print "\nget all projects" req = urlopen('ht...
"""Tests for the Update integration init.""" from __future__ import annotations import asyncio from collections.abc import Awaitable, Callable from typing import Any from unittest.mock import Mock, patch from aiohttp import ClientWebSocketResponse import pytest from homeassistant.components.update import ( DOMAI...
class Events: def __getattr__(self, name): if hasattr(self.__class__, '__events__'): assert name in self.__class__.__events__, \ "Event '%s' is not declared" % name self.__dict__[name] = ev = _EventSlot(name) return ev def __repr__(self): retu...
""" Code modified from PyTorch DCGAN examples: https://github.com/pytorch/examples/tree/master/dcgan """ import argparse import os import random import torch import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.utils.data def get_parsers(): parser = argparse.ArgumentParser() parser.add_...
import math import torch import torch.nn as nn import torch.nn.functional as F class FunctionRepresentation(nn.Module): """Function to represent a single datapoint. For example this could be a function that takes pixel coordinates as input and returns RGB values, i.e. f(x, y) = (r, g, b). Args: ...
import random import os import matplotlib.image as mpimg import matplotlib.pyplot as plt plt.ion() PROJECT_FOLDER = os.path.dirname(__file__) DATASET_FOLDER = PROJECT_FOLDER + '/data/columbia-prcg-datasets' PHOTO_FOLDER = DATASET_FOLDER + '/google_images/' CG_FOLDER = DATASET_FOLDER + '/prcg_images/' NUM_IMA...
import os import tempfile from ..spectrify import load_data, spectrify_audios import numpy as np def test_spectrify(): out_bins = 80 samplerate = 44100 frame_len = 0.1 input_fnames = [os.path.dirname(__file__)+"/test.mp3"] spec_datas = [load_data(filename,samplerate) for filename in input_fnames] ...
from ..grammar import Grammar from typing import Deque from ..tokenizer import Token class FinalToken: def __init__(self): self.name = '$' self.lexeme = '$' class Parser: def __init__(self, grammar: Grammar, action, go_to): self.grammar = grammar self.action = action ...
def processChange(job): service = job.service args = job.model.args if args.pop('changeCategory') != 'dataschema': return if 'url' in args: service.model.data.url = args['url'] if 'eventtypes' in args: service.model.data.eventtypes = args['eventtypes'] service.saveAll...
"""Fire animation, by Uck!""" import dcfurs import random # Colors, from top to bottom of the fire. colors = [0, 0x1f0f0f, 0x3f0000, 0xff0000, 0xff7f00, 0xffff00, 0x1f007f, 0x0000ff, 0xffffff] # Bitmask values copied from emote.boop(). boop_mask = [ 0x0e48e, 0x12b52, 0x12b52, 0x0eb4e, 0...
from agents.common import PLAYER1, PLAYER2, initialize_game_state, apply_player_action, \ evaluate_rows, is_player_blocking_opponent, is_player_winning def test_evaluate_rows_True_Player1_is_player_blocking_opponent(): game = initialize_game_state() num_rows = game.shape[0] num_cols = game.shape[1] ...
# project/server/tests/base.py from flask_testing import TestCase from price_picker import db, create_app from price_picker.common.create_sample_data import create_sample_data app = create_app() class BaseTestCase(TestCase): def create_app(self): app.config.from_object("config.TestingConfig") ...
from resotolib.baseresources import BaseResource import resotolib.logger import socket import multiprocessing import resotolib.proc from concurrent import futures from resotolib.baseplugin import BaseCollectorPlugin from argparse import Namespace from resotolib.args import ArgumentParser from resotolib.config import Co...
from enum import Enum __NAMESPACE__ = "http://www.opengis.net/gml" class KnotTypesType(Enum): """ This enumeration type specifies values for the knots’ type (see ISO 19107:2003, 6.4.25). """ UNIFORM = "uniform" QUASI_UNIFORM = "quasiUniform" PIECEWISE_BEZIER = "piecewiseBezier"
#!/usr/bin/env python3 """Bumps the detect-secrets version, in both `detect_secrets/__init__.py` and `README.md`. Then commits. """ import argparse import pathlib import subprocess import sys PROJECT_ROOT = pathlib.Path(__file__).absolute().parent.parent INIT_FILE_PATH = PROJECT_ROOT.joinpath('detect_secrets/__init_...
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.init as init from models.archs.dcn.deform_conv import ModulatedDeformConvPack as DCN_sep class PCD_Align(nn.Module): ''' Alignment module using Pyramid, Cascading and Deformable convolution with 3 pyramid levels. ''' def...
import os os.chdir("../..") print(os.getcwd()) import sys sys.path.append('') from envs.aslaug_v1_cont import AslaugEnv env = None def setup(): global env, obs env = AslaugEnv(gui=True) os.chdir("baselines/mpc-acado") obs = env.reset() def get_obs(): global obs return obs.tolist() def step(inp)...
import re import sqlite3 import util import db def main(): con = db.connect_db() tbl = "art_of_worldly_wisdom" db.purge_table(con, tbl) db.init_table(con, tbl) cur = con.cursor() sql = f"INSERT INTO {tbl} (_id, _body) VALUES (?, ?)" body_lines = [] is_last_line_page_break = False ...
# 5_pennyBoard.py # A program that assigns each square on a checkerboard to a set number of pennies getting exponentially bigger # Date: 9/22/2020 # Name: Ben Goldstone square = 1 numberOfPennies = 0.01 #Constants ONEPENNYTOGRAMS = 2.5 ONEPOUNDTOGRAMS = 453.6 ONEPOUNDOFCOPPERTODOLLARS = 3.15 #counters totalAmountOfMon...
"""attendanceManagement URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='ho...
"""Tests for the to_cnf transformation.""" import unittest from tt.errors import InvalidArgumentTypeError from tt.expressions import BooleanExpression from tt.transformations import to_cnf class TestExpressionToCnf(unittest.TestCase): def assert_to_cnf_transformation(self, original, expected): """Helpe...
initialized = True class TestFrozenUtf8_1: """\u00b6""" class TestFrozenUtf8_2: """\u03c0""" class TestFrozenUtf8_4: """\U0001f600""" def main(): print("Hello world!") if __name__ == '__main__': main()
from __future__ import print_function, division, absolute_import from datetime import timedelta import errno import logging import socket import struct import sys from tornado import gen from tornado.iostream import IOStream, StreamClosedError from tornado.tcpclient import TCPClient from tornado.tcpserver import TCPS...
from output.models.nist_data.atomic.integer.schema_instance.nistschema_sv_iv_atomic_integer_max_inclusive_3_xsd.nistschema_sv_iv_atomic_integer_max_inclusive_3 import NistschemaSvIvAtomicIntegerMaxInclusive3 __all__ = [ "NistschemaSvIvAtomicIntegerMaxInclusive3", ]
import pygame import copy from vector import Vec2, Vec4 from pixel import Pixel from colors import * from mymath import clamp, get_line_pixels class Canvas: def __init__(self, x, y, width, height, zoom=1.00): self.pos = Vec2(x, y) self.size = Vec2(width, height) self.zoom = zoom se...
from __future__ import annotations from threading import Thread from typing import Callable, Optional from .interfaces import ITimeoutSendService from ..clock import IClock from ..service import IService, IServiceManager from ..send import ISendService from ..util.Atomic import Atomic from ..util.InterruptableSleep imp...
""" IOEcho device, receive GPIO, send them thought TCP to target """ __all__ = ['IOEcho'] __version__ = '0.1' from .deviceBase import DeviceBase from time import sleep from lib.common import PrintColor import requests import json from socket import * try: import RPi.GPIO as GPIO is_running_on_pi = True except Run...
import os import sys import numpy as np import csv import matplotlib.pyplot as plt from src import readFiles as rf from os import listdir import re def getDirectoriesAtPath(path): return [name for name in os.listdir(path) if os.path.isdir(os.path.join(path, name))] # Function to read the execution time an applic...
class NoSuchOmekaClassicItemException(Exception): pass
''' 1) Add an item to your cart 2) Proceed to checkout 3) Quit $ 1 Enter item description: Red Bull Enter item quantity: 48 Price per unit: $2.00 $ 2 48 - Red Bull @ $2.00 ea Subtotal: $96.00 Tax (4.712%): $4.52 Total: $100.52 age = raw_input("How old is you? ") height ...
from django.template.defaulttags import register @register.filter def index(sequence, position): return sequence[position]
# Noysim -- Noise simulation tools for Aimsun. # Copyright (c) 2010-2011 by Bert De Coensel, Ghent University & Griffith University. # # Run the viewer as a windows program import noysim.viewer app = noysim.viewer.wx.PySimpleApp() app.frame = noysim.viewer.ViewerFrame() app.frame.Show() app.MainLoop()