text
stringlengths
2
999k
# heavygodot/commands/wrap.py """The wrap command.""" from json import dumps from .base import Base import sys from collections import defaultdict import os import zipfile import shutil import re class Wrap(Base): """Create a godot module from the supplied heavy source files""" def run(self): s...
""" Example using this environment with stable_baseline library from stable_baselines.common.vec_env import DummyVecEnv env = DummyVecEnv([lambda: env]) model = PPO2(MlpPolicy, env, verbose=1) model.learn(total_timesteps=25000) model.save("ppo2_cartpole") # Enjoy trained agent model = PPO2.load("ppo2_cartpole") obs...
""" RecycleView =========== .. versionadded:: 1.9.2 The RecycleView provides a flexible model for viewing selected sections of large data sets. It aims to prevent the performance degradation that can occur when generating large numbers of widgets in order to display many data items. .. warning:: This module is h...
# -*- test-case-name: twisted.test.test_compat -*- # # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Compatibility module to provide backwards compatibility for useful Python features. This is mainly for use of internal Twisted code. We encourage you to use the latest version of Python di...
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ta_portal.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportError( "Couldn't import Django. Ar...
import datetime import factory import random import uuid from series_tiempo_ar_scraping.base import Catalog, Dataset, Distribution class DistributionFactory(factory.Factory): class Meta: model = Distribution identifier = factory.Faker('uuid4') parent = None context = factory.Dict({}) # ...
# Copyright 2020 Huawei Technologies Co., Ltd # # 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...
# Configuration file for the Sphinx documentation builder. # # 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 # -- Path setup -------------------------------------------------------------- # If ex...
import sys gender = sys.argv[1] race = sys.argv[3] # if gender == "Male" and race == "Red": # print("1") # else: # print("0") if gender == "Male": print("1") else: print("0")
from .parser import EnsemblParser import biothings.hub.dataload.uploader as uploader from biothings.utils.common import dump2gridfs class EnsemblGeneUploader(uploader.MergerSourceUploader): name = "ensembl_gene" main_source = "ensembl" __metadata__ = {"mapper" : 'ensembl2entrez'} def load_data(self, ...
from django.apps import AppConfig class AdminConfig(AppConfig): name = 'Admin'
from PIL import Image file = 'Pics/MAHIKA SURI.png' im = Image.open(file) imResize = im.resize((int(195),int(215)), Image.ANTIALIAS) imResize.save(file, 'PNG', quality=100)
# -*- coding:utf-8 -*- # __author__="X1gang" # Date:2018/11/25 # import chardet # f= open("a.txt","rb") # data = f.read() # print(chardet.detect(data)) # >> {'encoding': 'utf-8', 'confidence': 0.938125, 'language': ''} # 非固定参数,元祖 # def alarm(msg,*users): # for i in users: # print(msg,i) # alarm("回家吃饭了","...
#!/usr/bin/env python # # Generate pnSeed[] from Pieter's DNS seeder # NSEEDS=600 import re import sys from subprocess import check_output def main(): lines = sys.stdin.readlines() ips = [] pattern = re.compile(r"^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3}):21795") for line in lines: m = patt...
import requests obis_baseurl = "https://api.obis.org/v3/" class NoResultException(Exception): pass def obis_GET(url, args,ctype, **kwargs): out = requests.get(url, params=args, **kwargs) out.raise_for_status() stopifnot(out.headers['content-type'], ctype) return out.json() def obis_write_disk(url, path,...
# Copyright (C) 2010 by the Massachusetts Institute of Technology. # All rights reserved. # Export of this software from the United States of America may # require a specific license from the United States Government. # It is the responsibility of any person or organization contemplating # export to obtain such ...
#!/usr/bin/env python # Copyright 2013 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. import functools import os from compiled_file_system import CompiledFileSystem from copy import deepcopy from environment import GetAp...
#!/usr/bin/env python3 # -*- config: utf-8 -*- from functools import lru_cache import timeit @lru_cache def fib(n): if n == 0 or n == 1: return n else: return fib(n - 2) + fib(n - 1) @lru_cache def factorial(n): if n == 0: return 1 elif n == 1: return 1 else: ...
# Copyright (c) 2017-present, Facebook, 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 or agreed...
import functools from itertools import product from utils.solution_base import SolutionBase class Solution(SolutionBase): def solve(self, part_num: int): self.test_runner(part_num) func = getattr(self, f"part{part_num}") result = func(self.data) return result def test_runner(...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import itertools import unittest import numpy as np import torch from pytorchvideo.layers.convolutions import ( Conv2plus1d, ConvReduce3D, create_conv_2plus1d, ) from torch import nn class TestConvReduce3D(unittest.TestCase): de...
# Copyright 2018-2020 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" fil...
# -*- coding: utf-8 -*- """ Created on Tue Sep 28 15:24:40 2021 @author: ryans """ import tribolium_clustering as tc import pyclesperanto_prototype as cle import numpy as np import matplotlib.pyplot as plt import pandas as pd import umap import hdbscan import napari def nice_screenshots_of_1_timepoint(dataset, predi...
# Copyright (c) Facebook, Inc. and its affiliates. import os import random import numpy as np import pkg_resources from nle import nethack from minihack.envs import register from minihack import LevelGenerator, MiniHackNavigation LEVELS_PATH = os.path.join( pkg_resources.resource_filename("nle", "minihack/dat"), ...
from library.api.db import EntityWithNameModel, db class Ability(EntityWithNameModel): handler = db.Column(db.String(100))
import types import unittest from nsl.collections._ns import as_namedtuple class AsNamedTupleTests(unittest.TestCase): def test_direct(self): class Point: """A point.""" qualname = Point.__qualname__ Point = as_namedtuple(Point, 'x y') p1 = Point(1, 2) p2 = P...
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) Megvii, Inc. and its affiliates. import bisect from functools import wraps from paddle.io import Dataset as PaddleDataset class PaddleConcatDataset(PaddleDataset): r"""Dataset as a concatenation of multiple datasets. This class is useful to assem...
from enum import Enum from typing import Optional, Union import ethicml as em from ethicml.preprocessing.scaling import ScalerType from kit import parsable from kit.torch import TrainingMode from conduit.fair.data.datamodules.tabular.base import EthicMlDataModule __all__ = ["HealthDataModule", "HealthSens"] class ...
#!/usr/bin/env python3 # 2018 Luther Thompson # This code is public domain under CC0. See the file COPYING for details. import unittest import newtuple class TupleTest: def testSetItem(self): self.assertEqual(self.call('setItem', (0, 1, 2), 1, 666), (0, 666, 2)) def testSetItemSlice(self): self.asser...
# -*- coding: utf-8 -*- """ Created on Tue Mar 29 11:49:58 2016 """ from __future__ import division import numpy as np #from sklearn.gaussian_process import GaussianProcess from scipy.optimize import minimize from prada_bayes_opt.acquisition_functions import AcquisitionFunction, unique_rows #from visualiza...
#pass does nothing equivalent to nop in assembler #pass can be used to define an empty object or empty function for i in range(10): pass
#!/usr/bin/python """ Site24x7 Varnish Plugin author: selvakumar.cs Edited to support all types of data from varnish cache """ import importlib import json import os import subprocess import re # if any impacting changes to this plugin kindly increment the plugin version here. PLUGIN_VERSION = "1" # Setting this t...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from future.utils import tobytes from past.builtins import basestring from future.moves.urllib.parse import urlparse, urlsplit import os import logging import xml.sax impor...
# Copyright 2021 Huawei Technologies Co., Ltd # # 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...
#!/usr/bin/python3 '''Advent of Code 2019 Day 5 tests''' import unittest import os import sys import numpy sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from aoc2019 import intcode # pylint: disable=wrong-import-position class TestUM(unittest.TestCase): '''Tests from day nine, ...
import argparse import os import geopandas as gpd import yaml from lib.supplement.roof_edge_area import supplement_area, reprojection from lib.utils import is_exist_path, save_file def main(): parser = argparse.ArgumentParser(description="(str) Supplement roof edge area .") parser.add_argument("target_path"...
import appJar as aj import numpy as np import time import Controller as ctrl class Screen(aj.gui): def __init__(self, title=None, geom=None, handleArgs=True, language=None,startWindow=None, useTtk=False, useSettings=False, showIcon=True, **kwargs): self.initialTime = 0 # Changing value to t...
# Generated by Django 2.0.7 on 2019-06-06 13:56 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('rescape_region', '0006_settings'), ] operations = [ migrations.RenameModel( old_name='Location', new_name='RegionLocation', ...
#!python if __name__ == '__main__': # #if defined('ASDF') print("ASDF defined") # #else print("ASDF not defined") # #endif print("bye")
#!/bin/python3 # -*- coding: utf-8 -*- # References: # https://gist.github.com/moshekaplan/c425f861de7bbf28ef06 # https://www.iditect.com/how-to/53371117.html # https://beenje.github.io/blog/posts/logging-to-a-tkinter-scrolledtext-widget/ # https://stackoverflow.com/questions/13318742/python-logging-to-tkinter-text-wi...
# CONFIGS # Plugin can be called by an arbitrary name instead of /plugin_social (which is a bit ugly) # example: http://..../social/friends or http://..../contacts/search plugin_social_shortcut = response.plugin_social_shortcut or "social" # The plugin_social models are conditional and tables are defined only for spe...
from django.shortcuts import render class GeneralRoutes: @staticmethod def home(request): return render(request, 'home.html') @staticmethod def privacy(request): return render(request, 'privacy.html')
import connexion import six import subprocess import tempfile import sys import shutil import time ## For K8S jobs import pykube from os import environ as os_environ from os import getenv from os.path import basename from pykube.config import KubeConfig from pykube.http import HTTPClient from pykube.objects import (Jo...
import importlib import sys import warnings warnings.warn('pick_gpu has been moved from stanza.research to stanza.cluster; the module in research is deprecated.') sys.modules[__name__] = importlib.import_module('...cluster.pick_gpu', __name__)
import os from django.core.asgi import get_asgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "jobbergate_api.settings") application = get_asgi_application()
# Copyright 2019 Huawei Technologies Co., Ltd # # 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...
# Date 02/10/2021. # __Author__ : Krishnan Navadia # __Package__ : Python 3.x # __GitHub__ : https://github.com/krishnan-tech/ # [pattern1.py] Pattern that print "*" as a matrix for rows x cols # ***** # ***** # ***** # ***** # ***** # This program will ask you for number of rows and columns then print...
# Generated by Django 3.1.3 on 2022-02-18 13:21 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('onlinecourse', '0007_auto_20220218_0930'), ] operations = [ migrations.RemoveField( model_name='submission', name='choices',...
import multiprocessing as mp import queue from copy import deepcopy class QAOAProcess(mp.Process): def __init__(self,job,qctrl,qresult,quantities,nlayers,C,D=None,psi0=None): from qaoa.circuit import QAOACircuit super().__init__() self.qctrl = qctrl self.qresult = qresult s...
import forest_cluster as rfc from forest_cluster.tests.fixtures import simple_cluster def test_forest_clusterer(simple_cluster): X = simple_cluster() cluster = rfc.RandomForestClusterer() cluster.fit(X)
from flask import Flask import random import time app = Flask(__name__) response_codes = [200, 201, 204, 404, 500] @app.route('/', defaults={'path': ''}) @app.route('/<path:path>', methods=['GET', 'POST', 'PUT', 'DELETE']) def catch_all(path): ms = random.randint(25, 190) / 1000 time.sleep(ms) return 'He...
from virgo.parse import parse def test_parse_simple_edge(): s = "a -> b" result = parse(s) assert result is not None assert "a" in result.nodes assert list(result.direct_successors_of("a")) == ["b"] assert list(result.direct_successors_of("b")) == [] def test_parse_simple_edge_with_newline()...
from rides import app if __name__ == '__main__': app.run(host=app.config['IP'], port=int(app.config['PORT'])) application = app
print("Welcome to the band name generator.") cityName = input("Which city did you grow up in?\n") petName = input("What is the name of your pet?\n") print(f"The band name could be: {cityName} {petName}")
from django.test import TestCase from rest_framework.test import APIRequestFactory from emendation_box.models import EmendationBox from emendation_box.models import EmendationBoxType from emendation_box.models import EmendationBoxStructure from technical_reserve.models import TechnicalReserve from .models import Underg...
# Copyright 2013 OpenStack Foundation # 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...
# -*- coding: utf-8 -*- # Copyright 2020 The PsiZ 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 r...
<<<<<<< HEAD:Brynhildr/weapon.py import discord from icons import iconreplace from util import * BIG = ["Draconic Weapons", "Ultima Weapons", "Dark Opus Weapons"] async def weaponparse(categories: list, source: str, embed: discord.Embed, simple: bool) -> None: parsed = BeautifulSou...
from libs import command from addons.pipes.libs import pipe as pipe_class import re class Command(command.DirectOnlyCommand): '''Authorize other people to modify your pipe **Usage** ```@Idea authorize <user> for pipe "<name>"``` Where **`<user>`** is the user you want to add (user mention/ping) **`<name>`** is th...
# # 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"); you may not us...
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved. """ A test for the MapToForLoop transformation. """ import dace import numpy as np from dace.transformation.dataflow import MapExpansion, MapToForLoop @dace.program def map2for(A: dace.float64[20, 20, 20]): for k in range(1, 19): ...
from systems.plugins.index import BaseProvider class Provider(BaseProvider('function', 'value')): def exec(self, data, keys, default = None): if isinstance(keys, str): keys = key.split('.') last_index = len(keys) - 1 for index, key in enumerate(keys): if index == ...
import Assets.Domain import Assets.AssetsScan import Assets.Start start = Assets.Start.start whois_scan = Assets.Domain.start assets_scan = Assets.AssetsScan.start
"""Support for tracking the moon phases.""" from astral import Astral import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import CONF_NAME import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity import homeassistant....
#!/usr/bin/env python3 # Copyright (c) 2017-2020 The XBit Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test multiwallet. Verify that a xbitd node can load multiple wallet files """ from decimal import Decimal...
from common_fixtures import * # NOQA import websocket as ws import pytest def test_host_api_token(client): hosts = client.list_host(kind='docker', removed_null=True).data assert len(hosts) > 0 # valid token and a url to the websocket stats = hosts[0].stats() conn = ws.create_connection(stats.url...
# -*- encoding: utf-8 -*- """ Functions for encoding data of various types including field tables and arrays """ import calendar import datetime import decimal as _decimal import logging import struct import time import typing from pamqp import common LOGGER = logging.getLogger(__name__) DEPRECATED_RABBITMQ_SUPPORT...
from PyQt5 import QtGui from hackedit.app import settings from hackedit.api import index, project from hackedit.api.widgets import PreferencePage from hackedit.app.forms import settings_page_indexing_ui class Indexing(PreferencePage): """ Preference page to configure indexing. """ def __init__(self):...
# -*- coding: utf-8 -*- """ TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Lic...
import sys from flask import Flask, g from flask.ext.sqlalchemy import SQLAlchemy from flask.ext import login sys.path.append('../..') from social.apps.flask_app.routes import social_auth from social.apps.flask_app.template_filters import backends from social.apps.flask_app.default.models import init_social # App a...
import os from lockheed_141310 import app if __name__ == "__main__": app.run(host=app.config['IP'], port=app.config['PORT'])
from random import randint LES_FORMES = [[(-1,1),(-1,0),(0,0),(1,0)],[(0,-1),(0,0),(0,1),(0,2)],[(0,0),(1,0),(1,1),(0,1)],[(-1,0),(0,0),(0,-1),(1,-1)],[(-1,0),(0,0),(0,1),(1,1)],[(-1,0),(0,0),(0,-1),(1,0)],[(-1,0),(0,0),(1,0),(1,1)]] class ModeleTetris: def __init__(self,lig=24,col=14): self.__haut = lig ...
from http.server import BaseHTTPRequestHandler, HTTPServer import socket from threading import Thread import requests import pymongo from scout.server.blueprints.cases import controllers from scout.parse.matchmaker import genomic_features, omim_terms, hpo_terms MME_ACCEPTS = 'application/vnd.ga4gh.matchmaker.v1.0+jso...
"""Custom ResNet model with pre-activation residual blocks. He K, Zhang X, Ren S, Sun J. Identity Mappings in Deep Residual Networks. arXiv.org. 2016. Author: Mike Dusenberry """ import tensorflow as tf def res_block(xin, dbottle, dout, k, stride): """A residual block. This implements the "pre-activation" form...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. """ .. _l-example-backend-api: ONNX Runtime Backend for ONNX ============================= *ONNX Runtime* extends the `onnx backend API <https://github.com/onnx/onnx/blob/master/docs/ImplementingAnOnnxBackend.md>`_ to run...
""" Global functional test imports """ from behave import given, when, then # pylint: disable=no-name-in-module from behave import fixture from behave.fixture import use_fixture import fixtures # pylint: disable=import-error __all__ = [ 'given', 'when', 'then', 'fixture', 'use_fixture', 'fixtu...
# -*- coding: utf-8 -*- from scrapy.linkextractors import LinkExtractor from scrapy.spiders import CrawlSpider, Rule from tasksmanager.models import SpiderTask class DefaultCrawlerSpider(CrawlSpider): name = 'defaultcrawler' def __init__(self, *args, **kwargs): self.domain = kwargs.get('domain') ...
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from ..registration import DiffeoTask def test_DiffeoTask_inputs(): input_map = dict( args=dict( argstr="%s", ), environ=dict( nohash=True, usedefault=True, ), fixed_file=dict( ...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. import typing from cryptography.exceptions import InvalidTag if typing.TYPE_CHECKING: from cryptography.hazmat.backends.openssl.back...
import itertools as it from .dump import get_offset_to_term_id_dict def term_id_to_tokens(nafobj, term_id): term = nafobj.get_term(term_id) if term is None: raise ValueError("No term with that ID: {!r}".format(term_id)) return [ (ID, nafobj.get_token(ID).get_text()) for ID in term....
""" Django settings for falling_tooth_28545 project. Generated by 'django-admin startproject' using Django 2.2.2. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ """ ...
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2019, John McNamara, jmcnamara@cpan.org # import unittest from ...compatibility import StringIO from ..helperfunctions import _xml_to_list from ...table import Table from ...worksheet impor...
def SubsequenceLength(string): seen = {} maximum_length = 0 start = 0 for end in range(len(string)): if string[end] in seen: start = max(start, seen[string[end]] + 1) seen[string[end]] = end maximum_length = max(maximum_length, end-start + 1) return maximum...
import time import striga.core.prioqueue ### #TODO: Move scheduler terminology and implementation (when needed) more to following: # # class Scheduler # - method At(rel=) - OneShotAbsTimeJob # - method At(abs=) - OneShotRelTimeJob # - method Every(period=) - PeriodicJob, period can be string with ('1d') # #This can ...
#!/usr/bin/env python # # Copyright 2015 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 requir...
# added by QDP to run the test using the CI/CD pipeline import pickle import numpy as np from typing import List from fastapi import FastAPI from pydantic import BaseModel, conlist app = FastAPI(title="Predicting Wine Class with batching") # Open classifier in global scope with open("models/wine-95-fixed.pkl", "rb"...
#!/usr/bin/env python3 # coding: utf-8 # pylint: disable=unused-argument, import-outside-toplevel, subprocess-run-check import json import shlex import subprocess from time import sleep from sapporo.model import RunId from . import RESOURCE_REMOTE, SCRIPT_DIR, TEST_HOST, TEST_PORT def post_runs_tags_workflow_name()...
import asyncio import pickle import time import uuid from typing import ( Any, Awaitable, Callable, Dict, Iterable, List, Optional, Sequence, Set, Tuple, TypeVar, Union, cast, ) import cloudpickle from meadowgrid.config import ( DEFAULT_COORDINATOR_HOST, DEF...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import tensorflow as tf from tensorflow.python import pywrap_tensorflow cur_dir = os.path.dirname(os.path.realpath(__file__)) coref_op_library = tf.load_op_library(os.path.join(cur_dir, "coref_kerne...
"""Add comments table Revision ID: 83dce15c3d36 Revises: 75844bac4c9d Create Date: 2019-06-10 15:23:11.647466 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '83dce15c3d36' down_revision = '75844bac4c9d' branch_labels = None depends_on = None def upgrade(): ...
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modif...
import os import copy import json import time import urllib from pathlib import Path import drms import numpy as np import astropy.table import astropy.time import astropy.units as u from astropy.utils.misc import isiterable from sunpy import config, log from sunpy.net.attr import and_ from sunpy.net.base_client imp...
from __future__ import unicode_literals import warnings from future.utils import with_metaclass from django.conf import settings from django.contrib.auth import get_user_model as django_get_user_model from django.core.exceptions import ImproperlyConfigured from django.db.models import Model, Field from mezzanine.ut...
import pytest from tests import helpers @pytest.fixture(scope="function") def tests_filename(testdir): filename = "test_instr_logger_examples.py" testdir.copy_example(filename) return filename @pytest.fixture(scope="function") def additional_module_filename(testdir): filename = "additional_module.p...
import os def get_sphere(name='symmetric362'): if name=='symmetric362': return os.path.join(os.path.dirname(__file__),'evenly_distributed_sphere_362.npz') if name=='symmetric642': return os.path.join(os.path.dirname(__file__),'evenly_distributed_sphere_642.npz')
# Copyright 2016 Google LLC 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 ag...
# Define a procedure, union, # that takes as inputs two lists. # It should modify the first input # list to be the set union of the two # lists. You may assume the first list # is a set, that is, it contains no # repeated elements. # To test, uncomment all lines # below except those beginning with >>>. #a = [1...
# Copyright (c) 2020 Graphcore Ltd. All rights reserved. import matplotlib.pyplot as mpl import matplotlib.gridspec as gridspec import numpy as np import sys import os def run(logsDir, plotsDir="."): """ logsDir : -- where to read all log files from (.txt and .log extensions). This is the data ...
# -*- coding: utf-8 -*- #--------------------------------------------------------------------------- # Copyright 2019 VMware, Inc. All rights reserved. # AUTO GENERATED FILE -- DO NOT MODIFY! # # vAPI stub file for package com.vmware.nsx.migration.plan. #---------------------------------------------------------------...
from rest_framework import serializers from models import Session, Participant class ParticipantSerializer(serializers.ModelSerializer): """Participant serializer.""" class Meta: model = Participant fields = ('id', 'participant', 'session', 'joined_date') read_only_fields = ('joined...