text
stringlengths
2
999k
from enum import Enum # How to keep track of what kind of an object a given entity # is... types! Types should act as constants... for now. # Type is a reserved word! class Spec(Enum): # Key types (1-1000) ENTITY = 1 CONTEXT = 2 PERSON = 3 PLACE = 4 THING = 5 CONTEX...
from setuptools import setup, find_packages from codecs import open from os import path __version__ = '1.0.0' here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() # get the dependen...
import django_filters from django.contrib.auth.models import User from extras.filters import TagFilter from extras.filtersets import LocalConfigContextFilterSet from netbox.filtersets import ( BaseFilterSet, ChangeLoggedModelFilterSet, OrganizationalModelFilterSet, PrimaryModelFilterSet, ) from tenancy.filtersets ...
"""Define the IndepVarComp class.""" import numpy as np from openmdao.core.explicitcomponent import ExplicitComponent from openmdao.utils.array_utils import shape_to_len from openmdao.utils.general_utils import make_set, ensure_compatible from openmdao.warnings import warn_deprecation class IndepVarComp(ExplicitCom...
import sys from PyQt5.QtWidgets import * from PyQt5.QtCore import * import threading import time class MyWindow(QMainWindow): def __init__(self): super().__init__() timer = QTimer(self) timer.start(1000) timer.timeout.connect(self.timeout) def timeout(self): name = t...
# Copyright 2020 The DDSP 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 or agreed to in wri...
import re import networkx as nx import numpy as np from aocd.models import Puzzle pattern = re.compile(r'((\d)?\s?(\w*\s\w+)\s(bags?))') def solve_puzzle_one(graph): print(len(nx.ancestors(graph, 'shiny gold'))) def solve_puzzle_two(graph): print(count_bags(graph, 'shiny gold')) def count_bags(graph, no...
import os import requests PRIMEHUB_DOMAIN_NAME = 'primehub-graphql.hub.svc.cluster.local' if 'PRIMEHUB_DOMAIN_NAME' in os.environ: PRIMEHUB_DOMAIN_NAME = os.environ['PRIMEHUB_DOMAIN_NAME'] ME_INFO = None def __post_api_graphql(query, variables): url = 'http://{}/api/graphql'.format(PRIMEHUB_DOMAIN_NAME) ...
# Copyright The PyTorch Lightning team. # # 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 i...
from unittest import TestCase from unittest.mock import MagicMock # Test Cases from subprocess import CalledProcessError # nosec from lib.nmcli_custom import CustomSystemCommand, enable_use_sudo from lib.nmcli_custom import _syscmd from lib.nmcli_custom import disable_use_sudo from nmcli._exception import ( Conn...
from collections import namedtuple from functools import update_wrapper from dagster import check from dagster.config.field_utils import check_user_facing_opt_config_param from dagster.config.validate import process_config from dagster.core.definitions.config import is_callable_valid_config_arg from dagster.core.defin...
from django.conf import settings from rest_framework.routers import DefaultRouter, SimpleRouter from v0_back.users.api.views import UserViewSet if settings.DEBUG: router = DefaultRouter() else: router = SimpleRouter() router.register("users", UserViewSet) app_name = "api" urlpatterns = router.urls
import _plotly_utils.basevalidators class NamelengthValidator(_plotly_utils.basevalidators.IntegerValidator): def __init__( self, plotly_name="namelength", parent_name="densitymapbox.hoverlabel", **kwargs ): super(NamelengthValidator, self).__init__( plotly_name=plotly_name, ...
# 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 ...
from ursina import * from ursina.prefabs.first_person_controller import FirstPersonController from ursina.shaders import lit_with_shadows_shader app = Ursina() random.seed(0) Entity.default_shader = lit_with_shadows_shader ground = Entity(model='plane', collider='box', scale=64, texture='grass', texture_scale=(4,4))...
import numpy as np from torchvision import datasets import torchvision.transforms as transforms import random from torch.utils.data.sampler import SubsetRandomSampler from torch.utils.data import DataLoader, Dataset import torch normalize_birds = transforms.Normalize(mean=[0.485, 0.456, 0.406], ...
############################################################### # NATS-Bench (arxiv.org/pdf/2009.00437.pdf), IEEE TPAMI 2021 # # The code to draw Figure 2 / 3 / 4 / 5 in our paper. # ############################################################### # Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2020.06 # ...
from time import sleep from picamera import PiCamera class CameraService: __instance = None @staticmethod def getInstance(): if CameraService.__instance == None: CameraService() return CameraService.__instance def __init__(self): self.camera = PiCamera() C...
from rest_framework.pagination import PageNumberPagination class StandardResultsSetPagination(PageNumberPagination): """Default Pagination class""" page_size = 10 page_size_query_param = 'page_size' max_page_size = 1000
# small_world_count = SWC # small_world_connected_count = SWCC # small_world_newman_count = SWNC # power_law_count = PLC # power_law_tree_count = PLTC # random_graph_count = RGC # erdos_renyi_random_count = ERRC SWC = 0 SWCC = 0 SWNC = 0 PLC = 0 PLTC = 0 RGC = 0 ERRC = 0
from flask import Flask, render_template, flash, redirect, url_for, request, g, session, abort, send_from_directory from wtforms import Form, validators, StringField, TextAreaField, SelectField, PasswordField from werkzeug.utils import secure_filename from passlib.hash import sha256_crypt from functools import wraps im...
import unittest from unittest import TestCase from src.utils.cross_validation_utils import CrossValidationMetricsResultPrinter from unittest.mock import patch class TestModelMetricsGenerator(TestCase): @patch('builtins.print') def test_should_print_metric_values(self, mock_print): results = {'test_ac...
""" A python class to represent a single comic, be it file or folder of images Copyright 2012-2014 Anthony Beville 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/licens...
# coding=utf-8 """ Created by jayveehe on 2019/2/12. http://code.dianpingoa.com/hejiawei03 """ import tensorflow as tf from tensorflow.python.ops.image_ops_impl import ResizeMethod from PIL import Image import StringIO from w2v_utils import Word2VecManager def read_from_tfrecord(filepath_list, batchsize,w2v_manage...
# Copyright 2020 Dakewe Biotech 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...
"""Sable Executor""" from contextlib import contextmanager from sqlite3 import Connection, connect from typing import Iterable, Iterator from pandas import read_sql_query from sable.data import Table, Tabulation, TestCase @contextmanager def create_sqlite() -> Iterator[Connection]: """Create SQLite connection....
# Copyright 2013-2019 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) from spack import * class PyNumexpr3(PythonPackage): """Numexpr3 is a fast numerical expression evaluator for NumPy....
import os.path import shutil import sys import logging logging.basicConfig(format="%(levelname)s:%(funcName)s:%(message)s", level=logging.INFO) try: import unittest2 as unittest except ImportError: import unittest import rope.base.project from rope.contrib import generate def sample_project(root=None, folde...
from SDWLE.tags.base import MinionEvent, PlayerEvent from SDWLE.tags.condition import MinionIsNotTarget, CardIsNotTarget from SDWLE.tags.selector import FriendlyPlayer class SpellCast(PlayerEvent): def __init__(self, condition=None, player=FriendlyPlayer()): super().__init__("spell_cast", condition, playe...
# -*- coding: utf-8 -*- import numpy as np import codecs as cs from keras.models import Model from keras.layers import Dense,Bidirectional,Embedding,Dropout,Input from keras.layers import TimeDistributed,Conv1D,GlobalMaxPooling1D,GlobalAveragePooling1D,concatenate,LSTM from keras.optimizers import RMSprop, SGD, Adam,...
"""simplesocial 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-...
# # PySNMP MIB module CISCO-MEDIA-GATEWAY-CAPABILITY (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-MEDIA-GATEWAY-CAPABILITY # Produced by pysmi-0.3.4 at Mon Apr 29 17:49:58 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python ...
# coding: utf-8 """ Translator Knowledge Beacon Aggregator API This is the Translator Knowledge Beacon Aggregator web service application programming interface (API) that provides integrated access to a pool of knowledge sources publishing concepts and relations through the Translator Knowledge Beacon API. Th...
""" Faça uma funcao que receba uma matriz de 3x3 elementos. Calcule e retorne a soma dos elementos que estao na diagonal principal """ from random import randint def diagonal(x: list): soma = 0 for i in range(3): for j in range(3): if i == j: soma += x[i][j] return soma...
from core.models import ProviderMachine from rest_framework import serializers from .provider import ProviderSummarySerializer from api.v2.serializers.fields.base import UUIDHyperlinkedIdentityField class ProviderMachineSummarySerializer(serializers.HyperlinkedModelSerializer): provider = ProviderSummarySerialize...
'''initialize''' from .douyineffect import DouyinEffectBeautifier
import keras import keras.backend as K import tensorflow as tf smooth = 1. def dice_coef(y_true, y_pred): y_true_f = K.flatten(y_true) y_pred_f = K.flatten(y_pred) intersection = K.sum(y_true_f * y_pred_f) return (2. * intersection + smooth) / (K.sum(y_true_f) + K.sum(y_pred_f) + smooth) def dice_co...
# -*- coding: utf-8 -*- from random import shuffle from typing import Any from jack.core import * from jack.util.map import numpify from jack.util.preprocessing import transpose_dict_of_lists class ShuffleList: def __init__(self, drawlist, qa): assert len(drawlist) > 0 self.qa = qa self....
from pathlib import Path import jsons class Params: dataset = str('citation_citeseer') data_root = str(str(Path(__file__).absolute().parent)) epoch_size = int(10) lr = float(2e-4) supervised = bool(False) multiheads = bool(False) hidden_c = int(128) out_c = int(64) da_coef = fl...
"""Test help for all functions. """ from click.testing import CliRunner import pytest from arbory import arb @pytest.mark.parametrize('cmd, noop_help', [ # arbory base command. ([], True), # tree subcommand. (['tree'], False), # config subcommand. (['config'], False), ]) def test_help(cmd, n...
class Employee: company = "Google" salary = 100 location = "USA" # def changeSalary(self,sal): # self.__class__.salary = sal @classmethod def changeSalary(cls,sal): cls.salary = sal e = Employee() print(e.salary) e.changeSalary(500) print(e.salary) print(Employee.salary)
import os import sys import time import datetime import locale import getpass import platform import subprocess class Gk: def __init__(self): self.os = os.name self.sys_lang = locale.getdefaultlocale() self.python_ver = sys.version.split()[0] self.user_name = getpass.get...
class DM(): def __init__(self): self.container = None def allocContainer(self, container): self.container = container
""" Copyright 2020 The OneFlow 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 applicable law or agr...
import sys allele_index = 0 for line in sys.stdin: if line.startswith('##'): print(line[:-1]) continue if line.startswith('#'): print('##INFO=<ID=ID,Number=A,Type=String,Description="Variant IDs.">') print(line[:-1]) continue fields = line.split() info_string = fields[7] info_fields = { i.split('=')[0]...
import nibabel as nb import numpy as np import pickle import sys import surfer.io as surf from variables import freesurferdir import os inputDir = sys.argv[1] flag = 'found cluster!!' rowflag = 'rows=,[' def is_number(s): try: float(s) return True except ValueError: return False def c...
""" Jabber (XMPP) notification service. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.xmpp/ """ import logging import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.notify import ( ATTR_...
import os import zlib import uuid import re def get_image(repository, name): """Get the full image name by integrating repository and image name. :param repository: The name of repository :param name: The short image name :returns: str: Full image name, format: repo/name. """ return "{repo}/{...
from binascii import unhexlify, hexlify from http import HTTPStatus from string import Template import click import json import os import sys import requests import shlex import shutil import subprocess import tempfile import time import traceback from typing import Dict from web3 import Web3, HTTPProvider from web3.mi...
import os from datetime import datetime, timedelta import discord from matplotlib import pyplot as plt from gamestonk_terminal.helper_funcs import plot_autoscale from gamestonk_terminal.common.technical_analysis import momentum_model from gamestonk_terminal.config_plot import PLOT_DPI import discordbot.config_discord...
# ---------------------------------------------------------------------- # | # | __init__.py # | # | David Brownell <db@DavidBrownell.com> # | 2018-05-29 21:33:29 # | # ---------------------------------------------------------------------- # | # | Copyright David Brownell 2018. # | Distribute...
from django.contrib.auth.models import AbstractUser from django.db import models class TimestampModel(models.Model): created_at = models.DateTimeField(auto_now_add=True) class Meta: abstract = True class ExtendedTimestampModel(TimestampModel): last_update = models.DateTimeField(auto_now=True) ...
# Polymorphism with a Function and objects: def fun(obj): obj.capital() obj.language() obj.type() obj_ind = India() obj_usa = USA() func(obj_ind) func(obj_usa)
#!/usr/bin/env python from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup d = generate_distutils_setup( packages=['ze_imu'], package_dir={'': 'py'}, install_requires=['rospy', 'yaml'], ) setup(**d)
import requests BASE_URLS = { "GOOGLE_TRANSLATE": "https://translate.google.com/m", "PONS": "https://en.pons.com/translate/", "YANDEX": "https://translate.yandex.net/api/{version}/tr.json/{endpoint}", "LINGUEE": "https://www.linguee.com/", "MYMEMORY": "http://api.mymemory.translated.net/get", "...
from operator import attrgetter import pyangbind.lib.xpathhelper as xpathhelper from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType from pyangbind.lib.base import PybindBase from d...
# -*- coding: utf-8 -*- """k-Nearest Neighbors Detector (kNN) """ # Author: Yue Zhao <zhaoy@cmu.edu> # License: BSD 2 clause from __future__ import division from __future__ import print_function from warnings import warn import numpy as np from sklearn.neighbors import NearestNeighbors from sklearn.neighbors import B...
from django.shortcuts import render from django.http import Http404 from Kateblog.models import Owner def detail(request, owner_id): try: ao = Owner.objects.get(pk=owner_id) except Owner.DoesNotExist: raise Http404("Owner does not exist") return render(request, 'owner.html', {'Owner': ao})...
from setuptools import setup, find_packages import os def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname), 'r').read() except: return "" setup( name='aws-logging-handlers', packages=find_packages(), version='2.0.4', description='Logging aws_loggin...
# # This file is part of pyasn1-alt-modules software. # # Created by Russ Housley # Copyright (c) 2020-2021, Vigil Security, LLC # License: http://vigilsec.com/pyasn1-alt-modules-license.txt # import sys import unittest from pyasn1.codec.der.decoder import decode as der_decoder from pyasn1.codec.der.encoder import enc...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2019 Christelle Zouein <christellezouein@hotmail.com> # # The authors license this file to You 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...
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-10-05 10:12 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("catalog", "0016_auto_20160927_1947"), ] operations = [ migrations.CreateModel...
import pandas as pd import argparse import logging from pathlib import Path import os import re logging.basicConfig(format='%(asctime)s - %(levelname)s - %(name)s - %(message)s', datefmt='%m/%d/%Y %H:%M:%S', level=logging.INFO) logger = logging.getLogger(__name__) def get_ar...
"""empty message Revision ID: 108db2c7e723 Revises: 2e2a97299bb2 Create Date: 2019-11-08 17:43:35.683075 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '108db2c7e723' down_revision = '2e2a97299bb2' branch_labels = None depends_on = None def upgrade(): # ...
from django.test import TestCase import pytest from mock import patch from django.test import Client from django.core.urlresolvers import reverse from webapp.apps.register.models import Subscriber #run this with `py.test --pdb -s -m register` #actually no. `py.test -q webapp/apps/register/tests.py` @pytest.mark.reg...
""" This file (test_admin.py) contains the functional tests for the `admin` blueprint. These tests use GETs and POSTs to different endpoints to check for the proper behavior of the `admin` blueprint. """ import os import json import pytest from flask import request from flask import url_for from modules.box__default.a...
# global import pytest # local import ivy import ivy_tests.test_ivy.helpers as helpers @pytest.mark.parametrize("backend", ["jax", "numpy", "tensorflow", "torch"]) def test_docstrings(backend): ivy.set_default_device("cpu") ivy.set_backend(backend) failures = list() success = True """ F...
import time from datetime import date from unittest import mock, skip from django.test import override_settings from selenium.webdriver.common.keys import Keys from mainapp.models import Person from mainapp.tests.live.chromedriver_test_case import ChromeDriverTestCase from mainapp.tests.live.helper import ( MockM...
import os from .common import * # NOQA from lib.aws import AmazonWebServices from python_terraform import * DATA_SUBDIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'resource') RANCHER_REGION = os.environ.get("AWS_REGION") RANCHER_VPC_ID = os.environ.get("AWS_VPC") RANCHER_S...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Author: Bertrand256 # Created on: 2018-09 import json import re from PyQt5.QtCore import pyqtSlot, QEvent, Qt from PyQt5.QtWidgets import QDialog, QDialogButtonBox from bitcoinrpc.authproxy import EncodeDecimal from ui import ui_cmd_console_dlg from wnd_utils import Wnd...
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str from copy import deepcopy import json import logging import itertools import collections import numpy as np from indra.statements import * from indra.databases import hgnc_client from indra.databases import context_c...
# Copyright 2010-2016, Google 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 copyright # notice, this list of conditions and ...
import unittest import uuid from rocketchat_API.APIExceptions.RocketExceptions import RocketAuthenticationException, RocketMissingParamException from rocketchat_API.rocketchat import RocketChat class TestServer(unittest.TestCase): def setUp(self): self.rocket = RocketChat() self.user = 'user1' ...
if __name__ == '__main__': if __package__ is None: import sys from os import path sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) ) from Agent import * from Stream import * from ListOperators import merge from PrintFunctions import print_streams_recent def example_1...
import os import torch class BaseModel(): def name(self): return 'BaseModel' def initialize(self): # self.opt = opt # self.gpu_ids = opt.gpu_ids # self.isTrain = opt.isTrain # self.Tensor = torch.cuda.FloatTensor if self.gpu_ids else torch.Tensor # self.save_dir...
from timeit import timeit from model.model_group import Group def test_group_list(app2, db): print(timeit(lambda: app2.group.get_group_list(), number=1)) def clean(group): return Group(id=group.id, name=group.name.strip()) print(timeit(lambda: map(clean, db.get_group_list()), number=1000)) asse...
# -*- coding: utf-8 -*- import re from mosclient.common import utils from mosclient.common.client import BaseClient def match_duration(string): if re.match(r'^\d+[HhMm]$', string): return True return False class Client(BaseClient): """ MCS API client (v1) :param access: 指定MOS API acce...
# Copyright 2022 The Flax 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 or agreed to in wri...
import pathlib from ..config import STOYS_EMBEDDED_DEPENDENCIES_PACKAGE _repository_dir = pathlib.Path(__file__).parent.parent.parent.resolve() embedded_dependencies_dir = _repository_dir.joinpath(*STOYS_EMBEDDED_DEPENDENCIES_PACKAGE.split("."))
# -------------- import pandas as pd from sklearn.model_selection import train_test_split #path - Path of file # Code starts here df = pd.read_csv(path) X = df.drop(['customerID','Churn'],1) y = df['Churn'].copy() X_train,X_test,y_train,y_test = train_test_split(X,y,test_size =0.3, random_state=0) # --------------...
# uncompyle6 version 3.2.4 # Python bytecode 2.7 (62211) # Decompiled from: Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] # Embedded file name: macpath import os, warnings from stat import * import genericpath from genericpath import * __all__ = [ 'normcase', 'isabs', 'join', 's...
from .core import Client from .errors import * from .models import * ############ # METADATA # ############ __version__ = 'v2.3.11' __title__ = 'brawlstats' __license__ = 'MIT' __author__ = 'SharpBit' __github__ = 'https://github.com/SharpBit/brawlstats'
# Copyright 2015, 2016 Rackspace 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 requ...
# Author: Habib Sabiu # Date: March 31, 2017 # Purpose: Script to process Spark log files generated when running Spark applications. This script # would loop through all the log files in the current directory and get the timestamp for # all events specified within 'events' list. Basically, the events ...
from . import lr_tuner
n = int(input('Digite um valor:')) count = 1 soma = n maior = n menor = n continua = input('Quer continuar?[s/n]') continua = 's' while continua != 'n': n = int(input('Digite um valor:')) soma += n count += 1 if n > maior: maior = n if n < menor: menor = n continua = input('Quer ...
from dagster import check from dagster.core.events import EngineEventData, EventMetadataEntry from dagster.core.execution.plan.resume_retry import get_retry_steps_from_execution_plan from dagster.core.host_representation import ExternalPipeline from dagster.core.instance import is_memoized_run from dagster.core.storage...
from setuptools import setup, find_packages import codecs install_requires = ['requests'] def readme(): with codecs.open('README.rst', encoding='utf-8') as f: return f.read() setup( name='iamport-rest-client2', version='0.0.2', packages=find_packages(), include_package_data=True, in...
""" Handles Campfire online chat. """ import datetime import re import time import urllib import urlparse from BeautifulSoup import BeautifulSoup import httplib2 try: set # python 2.3 does not have the set data type except NameError: from sets import Set as set from __init__ import __version__ from room impo...
from .mScene import Scene from .model import Model from .structures import Float3 class LightingScene(Scene): def __init__(self, device, size): self.mushroom = Model(device, 'mushroom') self.previousTouchLocation = (0.0, 0.0) super().__init__(device, size) self.mushroom.specularIntensity = 0.2 ...
"""Features, conditions, model contexts and interfaces for hybrid dynamical systems and model estimation tasks. Robert Clewley, September 2007. """ from __future__ import absolute_import, print_function import copy import sys, traceback import numpy as npy # PyDSTool imports from . import Events, ModelSpec, S...
# -*- coding: utf-8 -*- from os.path import join, isfile from os import remove import sys from unittest import TestCase from ddt import ddt, data import mock # for unittest of raw_input from PyQt5 import QtWidgets from ....Classes.MachineSyRM import MachineSyRM from ....Classes.MachineIPMSM import MachineIPMSM from...
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# -*- coding: utf-8 -*- """ wsgi ~~~~ overholt wsgi module This is the beginning of all, it loads up the modules wanted using DispatcherMiddleware The RestApiHandler section is for debugging purposes and enables generating JSequence styled descriptions. It is optional and enabled only if RestApi...
from __future__ import annotations import base64 import time from typing import TYPE_CHECKING from django.contrib.auth import get_user_model from django.core.management import call_command from django.urls import reverse from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common....
"""AstronClientRepository module: contains the AstronClientRepository class""" from direct.directnotify import DirectNotifyGlobal from ClientRepositoryBase import ClientRepositoryBase from MsgTypes import * from direct.distributed.PyDatagram import PyDatagram from panda3d.direct import STUint16, STUint32 class Astron...
# 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 python # encoding: utf-8 ''' @author: liuchang @software: PyCharm @file: else.py @time: 2020-01-28 14:26 ''' for n in range(2, 10): for x in range(2, n): if n % x == 0: print(n, 'equals', x, '*', n / x) break else: # loop fell through without finding a fac...
#!/usr/bin/python3 import os,base64,sqlite3,time,datetime import hashlib as md5 from flask import Flask,g,url_for,send_from_directory, request,Response, jsonify,render_template,redirect from werkzeug import secure_filename ALLOWED_EXTENSIONS = set(['zip']) # Displayed on web frontend, might be included in REST? PRO...
''' Copyright 2022 Airbus SAS 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 dis...