text
stringlengths
1
927k
# -*- coding: utf-8 -*- from ccxt.async.base.exchange import Exchange from ccxt.base.errors import ExchangeError from ccxt.base.errors import NotSupported class bitstamp1 (Exchange): def describe(self): return self.deep_extend(super(bitstamp1, self).describe(), { 'id': 'bitstamp1', ...
from django import forms from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User class ProfileForm(UserCreationForm): email = forms.EmailField(widget=forms.TextInput( attrs = { 'type' : 'email', 'placeholder' : ('Email') } )) ...
from vyper.exceptions import ( TypeMismatchException, ) def test_concat(get_contract_with_gas_estimation): test_concat = """ @public def foo2(input1: bytes[50], input2: bytes[50]) -> bytes[1000]: return concat(input1, input2) @public def foo3(input1: bytes[50], input2: bytes[50], input3: bytes[50]) -> by...
# -*- coding: utf-8 -*- description = 'Axes setup' group = 'lowlevel' tango_base = 'tango://phys.biodiff.frm2:10000/biodiff/' devices = dict( omega_samplestepper = device('nicos.devices.tango.Motor', description = 'Sample stepper omega variant', tangodevice = tango_base + 'fzjs7/omega_samplestepp...
# # Copyright (c) 2013,2014 Juniper Networks, Inc. All rights reserved. # import gevent import os import sys import socket import errno import uuid import logging import coverage import cgitb cgitb.enable(format='text') import testtools from testtools.matchers import Equals, MismatchError, Not, Contains from testtool...
# Listing_8-5.py # Copyright Warren & Carter Sande, 2013 # Released under MIT license http://www.opensource.org/licenses/mit-license.php # Version $version ---------------------------- # Printing the 8 times table using range() for looper in range(1, 11): print looper, "times 8 =", looper * 8
# Generated by Django 2.2.5 on 2019-11-06 15:10 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ("organisations", "0010_auto_20191024_1353"), ] operations = [ migrations.AddField( model_name="o...
import numpy as np import pytest from evaldet import Tracks from evaldet.mot_metrics.clearmot import calculate_clearmot_metrics def test_missing_frame_hyp(): gt = Tracks() gt.add_frame(0, [0], np.array([[0, 0, 1, 1]])) gt.add_frame(1, [0], np.array([[0, 0, 1, 1]])) hyp = Tracks() hyp.add_frame(0...
"""transcript URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.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-ba...
# coding: utf-8 """ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ ...
import json import requests class TVDBHttpException(Exception): pass class TVDB(object): base = 'https://api.thetvdb.com' def __init__(self, apikey=None, username=None, userkey=None): self.username = username self.userkey = userkey self.apikey = apikey self.authenticate(...
# Generated by Django 2.1.7 on 2019-02-26 03:56 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='AccessToken', fields=[ ('id', models.AutoFi...
# coding: utf-8 """ Hydrogen Nucleus API The Hydrogen Nucleus API # noqa: E501 OpenAPI spec version: 1.9.5 Contact: info@hydrogenplatform.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import nucleus_api from nu...
from flask import Blueprint,render_template,request,flash from inventory.backend.scripts import scan from inventory.Crud.operation import add_record from inventory.models import * home = Blueprint("home_view",__name__) @home.route("/",methods = ['GET','POST']) def home_view(): if request.method == "POST": ...
import torch from torch import nn from torch import optim from torch.nn import functional as F from torch.utils.data import TensorDataset, DataLoader from torch import optim import numpy as np from learner import Learner from copy import deepcopy def zero_nontrainable_grads(grads, trainable_lay...
import sys import numpy as np from keras.callbacks import ModelCheckpoint, CSVLogger, LearningRateScheduler from keras.models import Model from keras.layers import Input, Activation, Conv1D, BatchNormalization from keras.optimizers import Adam from learning_to_adapt.model import LHUC, Renorm from learning_to_adapt.ut...
""" Unit tests for euromil.py """ from datetime import date import pytest from pyeuromil import euro_results, euro_draw_dates, euro_stats def test_euromil_results_year_not_exist(): """ results of year test (year does not exists) """ with pytest.raises(ValueError): results = euro_results("abcd") ...
# Copyright (c) 2020, NVIDIA 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 appli...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import os.path as osp import numpy as np # `pip install easydict` if you don't have it from easydict import EasyDict as edict __C = edict() # Consumers can get config by: # from fast_rcnn_config im...
import os import re import cv2 import random import numpy as np import matplotlib.pyplot as plt def read_pgm(filename, byteorder='>'): """Return image data from a raw PGM file as numpy array. Format specification: http://netpbm.sourceforge.net/doc/pgm.html """ with open(filename, 'rb') as f: ...
# -*- coding: utf-8 -*- # Copyright (c) 2019-2021 Ramon van der Winkel. # All rights reserved. # Licensed under BSD-3-Clause-Clear. See LICENSE file for details. from django.test import TestCase from django.utils import timezone from NhbStructuur.models import NhbRegio, NhbVereniging from .leeftijdsklassen import ...
# Copyright Hugh Perkins 2016 """ 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 ...
''' The probabilistic ensemble dynamics model ''' # pylint: disable=C0103, R0902, R0913, W0201, E0401, E1120 import time import itertools import numpy as np import tensorflow as tf from tensorflow import keras from collections import defaultdict import os os.environ['KMP_DUPLICATE_LIB_OK']='True' class PEModel(ke...
# Generated by Django 3.2.3 on 2021-07-13 14:58 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('api', '0051_catalog_content'), ('api', '0051_video_resource_group'), ] operations = [ ]
from __future__ import division from leapp.libraries.actor.library import (MIN_AVAIL_BYTES_FOR_BOOT, check_avail_space_on_boot, inhibit_upgrade) from leapp import reporting from leapp.libraries.common.testutils import create_report_m...
from typing import Any from boa3.builtin.nativecontract.contractmanagement import ContractManagement def Main(arg0: Any): ContractManagement.destroy(arg0)
import datetime from django.shortcuts import render from django.views import View from django.http import HttpResponseRedirect from django.urls import reverse from django.db.models.deletion import ProtectedError from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequi...
#!/usr/bin/env python3 from collections import deque FILE='test.txt' # sol: 40 FILE='input.txt' # sol: 824 def print_board(board): for row in board: print(''.join([str(i) for i in row])) def parse_input(file, repeat): board = [] for i in range(repeat): with open(file, 'r') as f: ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
#################################################################################################### # # ISTANBUL TECHNICAL UNIVERSITY # BLU 537E - Data Analysis & Visualization # Assignment 01 # #################################################################################################### # # ...
from pathlib import Path import streamlit as st from package import utils from pages import local_page, global_page from shared import list_explanation_groups def explanation_group_selectbox(): paths = list_explanation_groups() path = st.sidebar.selectbox( label='Select explanation group:', ...
# 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 discord.ext import commands import discord, sys, os import traceback import datetime from libs import settings async def oncmderror(ctx: discord.ext.commands.Context, error): if type(error) == commands.CommandOnCooldown: if int(error.retry_after) == 0: await ctx.send("Wait a few seconds be...
from django.conf.urls import url,include from django.conf import settings from . import views from django.conf.urls.static import static urlpatterns = [ url(r'^$',views.index,name='index'), url(r'^accounts/profile/', views.my_profile, name='my_profile'), url(r'register/',views.register, name='register'), ...
from minpiler.typeshed import M, message1 M.print('Hello world!') message1.printFlush()
from __future__ import unicode_literals from django_evolution.mutations import AddField from django.db import models MUTATIONS = [ AddField('ReviewRequest', 'file_attachments', models.ManyToManyField, related_model='attachments.FileAttachment'), AddField('ReviewRequest', 'inactive_file_attachmen...
# coding: utf-8 import pprint import six from enum import Enum from . import AbstractTransactionCommentActive class TransactionCommentCreate(AbstractTransactionCommentActive): swagger_types = { 'transaction': 'int', } attribute_map = { 'transaction': 'transaction', } _...
""" The business model core of the application. """ from typing import List, Union from PIL import Image from .annotated_image import AnnotatedImage from .scaled_region2d import ScaledRegion2d from .timer import Timer from src.model import Size2d, Region2d def clearImagesOutsideRange( annotatedImages: List[Ann...
#!/usr/bin/env python3 # # Copyright (c) Bo Peng and the University of Texas MD Anderson Cancer Center # Distributed under the terms of the 3-clause BSD License. import ast import copy import os import subprocess import sys import time from collections import defaultdict from collections.abc import Mapping, Sequence f...
import os def mkdir_without_exception(target): try: # subprocess.call([ # "mkdir", # "-p", # target # ]) os.makedirs(target, exist_ok=True) except FileExistsError: print("the directory %s already exists. continue the next gen phase." % target...
from .errors import * from .private import * from .callback import * from .states import *
import time from django.db import connections from django.db.utils import OperationalError from django.core.management.base import BaseCommand class Command(BaseCommand): """django command to pause execution until db is ready""" def handle(self, *args, **options): """handle the command""" se...
from selenium.webdriver.support import expected_conditions from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from e2e.tests.selenium.locators import LearningCircleCreationPageLocators from e2e.tests.selenium.locators import RegistrationModalLocators import datetime import tim...
""" You may define your own custom forms, based or inspired by the following ones. Examples of customization: recipients = CommaSeparatedUserField(label=("Recipients", "Recipient"), min=2, max=5, user_filter=my_user_filter, channel='my_channel', ) can_overwrite_limits = Fals...
# -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: EnvUtil Description : 环境相关 Author : J_hao date: 2017/9/18 ------------------------------------------------- Change Activity: 2017/9/18: 区分Python版本 ----------------------------...
# Copyright 2019 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
from typing import Type import torch from torch import nn from torch.jit import ScriptModule from catalyst.dl.core import Experiment, Runner class _ForwardOverrideModel(nn.Module): """ Model that calls specified method instead of forward (Workaround, single method tracing is not supported) """ ...
# 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 required by applica...
import json import pandas as pd def handler(event, context): df = pd.DataFrame({"id": [1, 2], "value": ["foo", "boo"]}) print(df) return { "statusCode": 200, "body": json.dumps({ "message": "This is a container lambda." }) }
import tkinter as tk from tkinter.ttk import * import sqlite3 from tkinter import * ''' import speech_recognition as sr # for speech recognition to play songs import pyttsx3 as tts # python module for speech engine = tts.init() volume = engine.getProperty('volume') engine.setProperty('volume',0.75) voices = engine.g...
#!/usr/bin/python #-*- coding: utf-8 -*- # Video 25 FPS, Audio 16000HZ import torch import numpy import time, pdb, argparse, subprocess, os, math, glob import cv2 import python_speech_features from scipy import signal from scipy.io import wavfile from SyncNetModel import * from shutil import rmtree # ==============...
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup # fetch values from package.xml setup_args = generate_distutils_setup( packages=['turtl...
from __future__ import absolute_import, division, print_function import os import sys import tensorflow.compat.v1 as tfv1 from attrdict import AttrDict from xdg import BaseDirectory as xdg from src.flags import FLAGS from .gpu import get_available_gpus from .logging import log_error from .text import Alphabet, UTF8A...
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
import json, os from threading import Thread from tornado.ioloop import IOLoop import tornado.web from hbi.model import Host, Filter from hbi.server import Service class RootHandler(tornado.web.RequestHandler): def get(self): self.write("boop") class EntitiesPoster(tornado.web.RequestHandler): d...
from django.core.management.base import BaseCommand, CommandError from simple_history.models import HistoricalRecords from members.models import User from members.models import User from django.contrib.auth.forms import PasswordResetForm from django.conf import settings from django.core.mail import EmailMessage impor...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: experiment_collection_core/service.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _ref...
############################################################# # win10 64bit # python 3.9.6 # # author: toush1 (20373944 he tianran) ############################################################# import os import re # software path xilinxPath = "G:\\ISE\\ise\\14.7\\ISE_DS\\ISE\\" marsPath = "G:\\mars\\Mars_test.jar" ...
# # Copyright(c) 2019-2021 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # import pytest from api.cas import casadm from api.cas.cache_config import ( CacheMode, CacheLineSize, SeqCutOffPolicy, CleaningPolicy, CacheStatus, ) from core.test_run import TestRun from storage_devices.disk i...
from typing import Any, Mapping, Sequence from urllib.parse import unquote_plus import bleach from importo.fields.base import Field from importo.utils.html import tidy_html class HTMLField(Field): allowed_tags = [ "a", "abbr", "acronym", "b", "bdi", "blockquote", ...
from django.conf import settings def global_settings(request): """ Return custom constant global variables to be used widely for all of our apps. """ # Current user logged in info cur_user_id = 0 cur_user_name = '' cur_user_full_name = '' if request.user.is_authenticated: # Get u...
# flake8: noqa from flask_sqlalchemy import SQLAlchemy from sqlalchemy.dialects import postgresql db = SQLAlchemy() class UserModel(db.Model): __tablename__ = "user" username = db.Column(db.String(36), primary_key=True) password = db.Column(db.String(30)) def __init__(self, username, password): ...
# -*- coding: utf-8 -*- # Copyright (c) 2021 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
from bigcoin import bc_kafka,bc_elasticsearch import json import datetime import signal def generate_elastic_insert_from_messages(messages): for message in messages: json_message = json.loads(message) #value are in satoshi yield { '_index' : 'transaction_idx', '_type': 'transaction', '_id': json_messag...
from mltemplate.ci.core import Stage from mltemplate.ci.jobs import BumpVersionJob, PypiDeployJob, RunTestsJob, StyleCheckJob class BumpVersionStage(Stage): def __init__(self, name="bump-version", **kwargs): super(BumpVersionStage, self).__init__( name=name, jobs=[BumpVersionJob(stage=name, **...
class Event(object): """ Represents a GUI event. """ def __init__(self, tk_event): """ Args: tk_event: The underlying Tkinter event to wrap. """ self._tk_event = tk_event @classmethod def get_identifier(cls): """ Returns: The Tkinter identifier for this event. """ raise Not...
import abc import logging from connexion.operations.secure import SecureOperation from ..decorators.metrics import UWSGIMetricsCollector from ..decorators.parameter import parameter_to_arg from ..decorators.produces import BaseSerializer, Produces from ..decorators.response import ResponseValidator from ..decorators....
#!/usr/bin/env python # Author: Jon Trulson <jtrulson@ics.com> # Copyright (c) 2016-2017 Intel Corporation. # # 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 # ...
from functools import partial import torch import random import numpy as np from ...ops.roiaware_pool3d import roiaware_pool3d_utils from ...utils import common_utils, box_utils from . import augmentor_utils, database_sampler class DataAugmentor(object): def __init__(self, root_path, augmentor_configs, class_name...
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-07-29 07:11 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('services', '0009_auto_20170617_1557'), ] operations = [ migrations.AddField...
# Librerias Django from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin from django.shortcuts import redirect from django.urls import reverse from django.views.generic import DetailView, ListView from django.views.generic.edit import CreateView, UpdateView ...
import argparse import torch import torch.nn as nn multiply_adds = 1 def count_conv2d(m, x, y): # TODO: add support for pad and dilation x = x[0] cin = m.in_channels cout = m.out_channels kh, kw = m.kernel_size batch_size = x.size()[0] out_w = y.size(2) out_h = y.size(3) # ops per output element # kern...
#!/usr/bin/env python ''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License")...
from random import randint alist = list() # [] list('hello') # ['h', 'e', 'l', 'l', 'o'] list((10, 20, 30)) # [10, 20, 30] 元组转列表 astr = str() # '' str(10) # '10' str(['h', 'e', 'l', 'l', 'o']) # 将列表转成字符串 atuple = tuple() # () tuple('hello') # ('h', 'e', 'l', 'l', 'o') num_list = [randint(1, 100) for i in rang...
"""List of API endpoints PRAW knows about.""" # flake8: noqa # fmt: off API_PATH = { "about_edited": "r/{subreddit}/about/edited/", "about_log": "r/{subreddit}/about/log/", "about_modqueue": "r/{subreddit}/about/modqueue/", "about_reports": "r/{subreddit}/abo...
import json import os import shutil import tempfile from unittest import TestCase from ...bencode import bdecode from ..transmission import TransmissionClient as RealTransmissionClient current_path = os.path.dirname(__file__) class TransmissionClient(RealTransmissionClient): def __init__(self, *args, **kwargs...
import ROOT import time import os from array import array from math import sqrt from pXmlWriter import * from ClusterConfig import * class ClusterClassifier: def __init__(self, varBins=True): print 'Opening files...' self.RootTreeDict = {} for (topology, filePat...
#coding=utf-8 from __future__ import print_function import time import argparse from glob import glob import os, cv2 import json def show(image_path, bbox): print(image_path, bbox) im = cv2.imread(image_path) x, y, w, h = bbox # left = int(x - w / 2) # right = int(x + w / 2) # top = int(y - h...
import os from datetime import datetime from .. import auth, types, utils class DaemonApiMixin(object): @utils.minimum_version('1.25') def df(self): """ Get data usage information. Returns: (dict): A dictionary representing different resource categories and th...
from typing import Any, Dict, List, Optional, Tuple, Type, Union import numpy as np import torch as th from torch.nn import functional as F from stable_baselines3.common import logger from stable_baselines3.common.off_policy_algorithm import OffPolicyAlgorithm from stable_baselines3.common.type_aliases import GymEnv,...
from spinnman.messages.scp.abstract_messages.abstract_scp_request\ import AbstractSCPRequest from spinnman.messages.scp.impl.scp_sdram_alloc_response import \ SCPSDRAMAllocResponse from spinnman.messages.sdp.sdp_header import SDPHeader from spinnman.messages.sdp.sdp_flag import SDPFlag from spinnman.messages.sc...
import re from .._compat import PY2, iteritems, integer_types, to_unicode, long from .._globals import IDENTITY from .base import SQLAdapter from . import adapters, with_connection_or_raise class Slicer(object): def rowslice(self, rows, minimum=0, maximum=None): if maximum is None: return rows[...
import pytest import numpy as np from numpy.testing import assert_allclose from astropy.stats.lombscargle.implementations.mle import design_matrix, periodic_fit @pytest.fixture def t(): rand = np.random.RandomState(42) return 10 * rand.rand(10) @pytest.mark.parametrize('freq', [1.0, 2]) @pytest.mark.parame...
from braintree.util.crypto import Crypto from braintree.webhook_notification import WebhookNotification import sys if sys.version_info[0] == 2: from base64 import encodestring as encodebytes else: from base64 import encodebytes from datetime import datetime class WebhookTestingGateway(object): def __init__...
import argparse import logging import datetime import csv from requests.exceptions import HTTPError from urllib3.exceptions import MaxRetryError # local imports from common import config import news_page_objects as news logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) def _news_scraper(n...
# coding: utf-8 """ Powerbot Server No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: 1.0.5 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import...
from dataclasses import dataclass, field from typing import Dict, List, Optional @dataclass class Signatures: class Meta: name = "signatures" w3_org_2000_09_xmldsig_element: List[object] = field( default_factory=list, metadata={ "type": "Wildcard", "namespace":...
import copy import inspect import itertools import logging import os import warnings from contextlib import contextmanager from typing import NamedTuple import torch import torch.distributed as dist RPC_AVAILABLE = False if dist.is_available(): from torch.distributed.distributed_c10d import ReduceOp from torc...
from keras.models import load_model import numpy as np X = np.load("dataset/X_test.npy") Y = np.load("dataset/Y_test.npy") model = load_model("model") score = model.evaluate(X, Y) print(score[0], score[1]) # print(np.argmax(model.predict(X[:200]), axis=1)) # print(np.argmax(model.predict(X), axis=1) == np.argmax(Y...
""" FACTOR dataset loader """ import os import logging import time import numpy as np import deepchem from deepchem.molnet.load_function.kaggle_features import merck_descriptors logger = logging.getLogger(__name__) TRAIN_URL = "https://deepchemdata.s3-us-west-1.amazonaws.com/datasets/FACTORS_training_disguised_combi...
"""Test concurrency properties of the implementation.""" from os.path import dirname from os.path import join import time import asyncio import pytest import aiofiles.threadpool @pytest.mark.asyncio def test_slow_file(monkeypatch, unused_tcp_port): """Monkey patch open and file.read(), and assert the loop still w...
""" SQL composition utility module """ # Copyright (C) 2020-2021 The Psycopg Team import codecs import string from abc import ABC, abstractmethod from typing import Any, Iterator, List, Optional, Sequence, Union from .pq import Escaping from .abc import AdaptContext from .adapt import Transformer, PyFormat from ._en...
class ToolStripItemAlignment(Enum,IComparable,IFormattable,IConvertible): """ Determines the alignment of a System.Windows.Forms.ToolStripItem in a System.Windows.Forms.ToolStrip. enum ToolStripItemAlignment,values: Left (0),Right (1) """ def __eq__(self,*args): """ x.__eq__(y) <==> x==yx.__eq__(y) <==> x==y...
from __future__ import annotations from anytree import NodeMixin from datetime import datetime, timezone from dotenv import load_dotenv from os import environ from os.path import join, dirname from typing import Tuple, List, Any, Dict, Optional import re import requests from rich.box import Box __all__ = [ "get_d...
#!/usr/bin/env python """ """ # Script information for the file. __author__ = "Hendrix Demers (hendrix.demers@mail.mcgill.ca)" __version__ = "" __date__ = "" __copyright__ = "Copyright (c) 2009 Hendrix Demers" __license__ = "" # Standard library modules. import logging import os.path # Third party modules. from PIL ...
from . import config, storage from .listener import TweetListener
from django.db import transaction from rest_framework import generics, mixins class BaseAPIView(generics.GenericAPIView, mixins.CreateModelMixin, mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, mixins....
# -*- coding: utf-8 -*- # # 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 #...
import os import io import numpy as np from PIL import Image import torch from torchvision.transforms import ToTensor class BAIR (object): """Data Handler that loads robot pushing data.""" def __init__(self, data_root, train=True, seq_len=20, image_size=64): self.root_dir = data_root if tra...
#!/usr/bin/env python import os, os.path, sys print """ #include "internal/Embedded.h" #include <string> #include <unordered_map> namespace { std::unordered_map<std::string, EmbeddedContent> embedded = { """ for f in sys.argv[1:]: bytes = open(f, 'rb').read() print '{"/%s", {' % os.path.basename(f) print '"' +...