text
stringlengths
1
927k
"""Script to download and cache all data.""" import os from typing import List import openml from automl import openml_utils BENCHMARK_TASKS = {"adult": 7592, "nomao": 9977, "phoneme": 9952} FOLD_COL = "fold" def download_openml_tasks(task_ids: List[int]): """Downloads the given task_ids from OpenML and dumps...
import numpy as np from utils import plot_images import torch from torchvision import datasets from torchvision import transforms from torch.utils.data.sampler import SubsetRandomSampler def get_train_valid_loader( data_dir, batch_size, random_seed, valid_size=0.1, shuffle=True, show_sample=F...
#!/usr/bin/env python # encoding:utf-8 # # Copyright 2015-2017 Yoshihiro Tanaka # 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 requi...
#!/usr/bin/python # -*- coding: utf-8 -*- import requests DEFAULT_IP = '0.0.0.0' DEFAULT_PORT = '5000' def format_request(service, locs, ip = DEFAULT_IP, port = DEFAULT_PORT): req = 'http://' + ip + ':' + port + '/' req += service + '/v1/car/' for loc in ...
# SPDX-License-Identifier: Apache-2.0 # # Copyright 2016 Hynek Schlawack # # 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...
""" Errors not dependent on any specific Scrolls types. Typically, you won't need to instantiate any of these yourself. The base exception for _all_ Scrolls errors is `ScrollError`. Any error that occurs while validating script syntax or interpreting scripts will inherit from `PositionalError`. """ import functools i...
# pylint: disable=missing-docstring from __future__ import print_function __revision__ = 0 try: __revision__ += 1 except Exception: # [broad-except] print('error')
# -*- coding: utf-8 -*- import os.path from setuptools import setup project_name = 'bravado-falcon' version = '0.1.0' setup_dir = os.path.dirname(os.path.abspath(__file__)) with open(os.path.join(setup_dir, 'requirements.txt')) as req_file: requirements = [lib.split('==')[0] for lib in req_file.readlines()] with ...
"""distutils.command.bdist_dumb Implements the Distutils 'bdist_dumb' command (create a "dumb" built distribution -- i.e., just an archive to be unpacked under $prefix or $exec_prefix).""" # created 2000/03/29, Greg Ward __revision__ = "$Id: bdist_dumb.py,v 1.2 2002/04/12 09:44:05 sof34 Exp $" import os from distut...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView urlpatterns = [ url(r'^$', TemplateView.as_view(templ...
#!/usr/bin/env python # $Id: kalign_urllib2.py 2809 2015-03-13 16:10:25Z uludag $ # ====================================================================== # # Copyright 2009-2018 EMBL - European Bioinformatics Institute # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file exce...
from gql import gql from specklepy.api.resource import ResourceBase from specklepy.api.models import Branch from specklepy.logging import metrics NAME = "branch" METHODS = ["create"] class Resource(ResourceBase): """API Access class for branches""" def __init__(self, account, basepath, client) -> None: ...
import torch import torch.nn as nn import torch.nn.functional as F from operations import * from torch.autograd import Variable from genotypes import PRIMITIVES from genotypes import Genotype class MixedOp(nn.Module): def __init__(self, C, stride): super(MixedOp, self).__init__() self._ops = nn.ModuleList(...
from sqlalchemy.sql.expression import and_ from credoscript.mixins.base import paginate class VariationAdaptor(object): """ """ def __init__(self, dynamic=False, paginate=False, per_page=100): self.query = Variation.query self.dynamic = dynamic self.paginate = paginate self....
# coding: utf-8 """ CONS3RT Web API A CONS3RT ReSTful API # noqa: E501 The version of the OpenAPI document: 1.0.0 Contact: apiteam@swagger.io Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import unittest import openapi_client from openapi_client.mode...
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """Tests pertaining to line/branch test coverage for the Firecracker code base. # TODO - Put the coverage in `s3://spec.firecracker` and update it automatically. target should be put in `s3://spec.firecra...
""" This file offers the methods to automatically retrieve the graph c-fat500-5. The graph is automatically retrieved from the NetworkRepository repository. Report --------------------- At the time of rendering these methods (please see datetime below), the graph had the following characteristics: Datetime: 2021-...
import os from monty.serialization import loadfn from fastapi import FastAPI import mp_api.xas.api xas_store = os.environ.get("XAS_STORE", "xas_store.json") xas_store = loadfn(xas_store) xas_router = mp_api.xas.api.get_router(xas_store) app = FastAPI(title="Materials Project API", version="3.0.0-dev") app.include_ro...
from styx_msgs.msg import TrafficLight import cv2 from keras.models import load_model from numpy import newaxis import numpy as np import tensorflow as tf import os class TLClassifier(object): def __init__(self): path = os.getcwd() self.model = load_model(path + '/light_classification/model.h5') self.m...
#Faça um programa que leia um vetor de 10 posições e verifique #se existem valores iguais e os escreva na tela. vetor=[] for c in range(0,10): n=int(input("Informe um numero: ")) if n in vetor: print(f"{n}") vetor.append(n)
# 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 agreed to in...
# coding=utf-8 import tensorflow as tf import numpy as np import os from algorithm import config from base.env.market import Market from checkpoints import CHECKPOINTS_DIR from base.algorithm.model import BaseRLTFModel from helper.args_parser import model_launcher_parser from helper.data_logger import generate_algor...
import subprocess class NotificationError(Exception): pass class BaseNotification: def set_typed_variable(self, value, specified_type): if isinstance(value, specified_type): return value else: raise NotificationError( 'can only set ' f'...
from .user import CreateUser, AuthUser, UpdateUser, DeleteUser, UpdatePassword from .articles import CreateArticle, UpdateArticle, DeleteArticle
from .bitly_api import Connection, BitlyError, Error __version__ = '0.3' __author__ = "Jehiah Czebotar <jehiah@gmail.com>" __all__ = ["Connection", "BitlyError", "Error"] __doc__ = """ This is a python library for the bitly api all methods raise BitlyError on an unexpected response, or a problem with input format """
from django.conf.urls import url, include from oscar.core.application import Application from oscar.core.loading import get_class class DashboardApplication(Application): name = 'dashboard' permissions_map = { 'index': (['is_staff'], ['partner.dashboard_access']), } index_view = get_class('d...
# Copyright 2017 Pilosa Corp. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # 2...
# Copyright 2013-present Barefoot Networks, 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 agre...
from _socket import timeout from urllib.error import URLError from pytube import YouTube from pytube.exceptions import RegexMatchError from old_code.Stream import Stream import time import tools as tools class YoutubeVideo(object): # todo (2): subtitles conn_errors = 0 def __init__(self, url, score=0, ...
# Author: Francesco Grussu, University College London # <f.grussu@ucl.ac.uk> <francegrussu@gmail.com> # # Code released under BSD Two-Clause license # # Copyright (c) 2020 University College London. # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are perm...
#!/usr/bin/python # Copyright 2013 Google Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later vers...
with open("stocks.csv", "r") as f, open("output.csv", "w") as out: out.write("Company Name,PE Ratio, PB Ratio\n") next(f) # This will skip first line in the file which is a header for line in f: tokens = line.split(",") stock = tokens[0] price = float(tokens[1]) eps = float(...
import pystache from functools import partial from flask_login import current_user from redash.authentication.org_resolving import current_org from numbers import Number from redash import models from redash.utils import mustache_render, json_loads from redash.permissions import require_access, view_only from funcy imp...
import os import csv import pandas as pd import geopandas as gpd from datetime import datetime, timedelta ## PROCESSING FUNCTIONS ## def confirmados_diarios_por_estado(datos, entidades): """ Calcula el número total de casos confirmados por fecha y por estado. Input: - datos: datos abiertos de COVID-...
#!/usr/bin/python """ PN CLI trunk-create/trunk-delete/trunk-modify """ # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at y...
"""Init file for RSS downloader."""
""" Console module tests """ import contextlib import io import os import tempfile import unittest from txtai.console import Console from txtai.embeddings import Embeddings APPLICATION = """ path: %s workflow: test: tasks: - task: console """ class TestConsole(unittest.TestCase): """ Console...
from importlib import import_module import os from django.core.exceptions import ImproperlyConfigured from django.utils.module_loading import module_has_submodule from django.utils._os import upath MODELS_MODULE_NAME = 'models' class AppConfig(object): """ Class representing a Django application and its co...
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2016-08-19 05:37 from __future__ import unicode_literals import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('jobs', '0002_remove_job_run_time'), ...
# qubit number=4 # total number=40 import cirq import qiskit from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister from qiskit import BasicAer, execute, transpile from pprint import pprint from qiskit.test.mock import FakeVigo from math import log2 import numpy as np import networkx as nx def bitwise_...
# -*- coding: utf-8 -*- # Generated by Django 1.11.18 on 2019-01-29 16:22 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('questions', '0037_rename_en_to_lang1'), ] operations = [ migrations.RenameField( ...
import deepinterpolation as de import sys from shutil import copyfile import os from deepinterpolation.generic import JsonSaver, ClassLoader import datetime from typing import Any, Dict now = datetime.datetime.now() run_uid = now.strftime("%Y_%m_%d_%H_%M") training_param = {} generator_param = {} network_param = {} g...
import matplotlib.pyplot as plt import arff import numpy as np from sklearn import linear_model # Load dataset dataset = arff.load(open('dataset/dataset01.arff', 'r')) data = np.array(dataset['data']) # Reshape vector X1 = data[:, 0].reshape(-1, 1) X2 = np.multiply(X1, X1) X = np.concatenate((X1, X2), axis=1) Y = dat...
import scipy.stats import unifit class TestFit: data = scipy.stats.cauchy.rvs(size=256) def test_basic(self): unifit.fit(self.data) def test_unnamed(self): unifit.fit( self.data, distributions=unifit.distributions.values() )
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import random import sys import time import re import copy from optparse import OptionParser import pygame from pygame.locals import * version = "0.1" usage = "usage: %prog [ --lvl [0-5] | ]" parser = OptionParser(usage=usage, version="%prog 0.1") parser.add_o...
"""Where the magic happens.""" import random from animalid import alloys, animals, colors, fabrics, opinions, origins, shapes, sizes FIRST_ADJECTIVES = opinions + shapes + sizes SECOND_ADJECTIVES = alloys + colors + fabrics + origins def generate_animal_id(): """What it's all about.""" return "_".join( ...
# -*- coding: utf-8 -*- """ sphinx.make_mode ~~~~~~~~~~~~~~~~ sphinx-build -M command-line handling. This replaces the old, platform-dependent and once-generated content of Makefile / make.bat. This is in its own module so that importing it is fast. It should not import the main Sphinx m...
#!/usr/bin/env python3 import json import time from random import gauss from flask import Flask number_of_devices = 10 number_of_values_per_second = 2 last_request = None app = Flask(__name__) @app.route('/') def index(): return 'Server is running' def get_time_ms(): return int(time.time() * 1000) def...
import matplotlib.pyplot as plt import utils.extractor as extractor import utils.file_handler as file_handler import utils.time_handler as time_handler def plot_intros(): intros = extractor.get_intros_from_data() only_valid_intros = [x for x in intros if not x["end"] == "00:00:00"] x_data = map(get_start...
# Copyright 2015 PerfKitBenchmarker 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 appli...
import pandas from ds_utils.strings import append_tags_to_frame, extract_significant_terms_from_subset def test_append_tags_to_frame(): x_train = pandas.DataFrame([{"article_name": "1", "article_tags": "ds,ml,dl"}, {"article_name": "2", "article_tags": "ds,ml"}]) x_test = pand...
# -*- coding: utf-8 -* # Copyright (c) 2018 PreSeries Tech, SL
from cyberbrain import trace @trace def container(): x = list(range(1000)) return x if __name__ == "__main__": container()
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.14.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re...
# coding: utf-8 import os # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(os.path.join(os.path.dirname(__file_...
from collections import OrderedDict recording_params_dict = OrderedDict([('apply_filter', True), ('freq_min',300.0), ('freq_max',6000.0)]) #Defining GUI Params keys = list(recording_params_dict.keys()) types = [type(recording_params_dict[key]) for key in keys] values = [recording_params_dict[key] for key in keys] reco...
from Magics.macro import * import os def plot_area(epsg, llx, lly, urx, ury): img = os.path.basename(__file__).split('.')[0] title = "Projection {} : [{:.2f}, {:.2f}, {:.2f}, {:.2f}]".format(epsg, llx, lly, urx, ury) #Setting output png = output( output_formats = ['png'], output_name ...
app_name = 'testapp' urlpatterns = [ ]
# Copyright (c) 2021 PaddlePaddle 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 app...
#!/usr/local/bin/python import sys import pymongo import argparse from bson import ObjectId from gevent.pywsgi import WSGIServer from geventwebsocket.handler import WebSocketHandler import bottle from bottle import Bottle, redirect, request, response, static_file, request from bson.json_util import dumps import author...
import filecmp from deliverable_model.builder.model.model_builder import ModelBuilder def test_build(datadir, tmpdir): model_builder = ModelBuilder() model_builder.add_keras_h5_model(datadir / "fixture" / "keras_h5_model") model_builder.save() config = model_builder.serialize(tmpdir) assert c...
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.base.exchange import Exchange import json from ccxt.base.errors import ExchangeError from ccxt.base.errors import AuthenticationE...
from django.contrib import admin from symposion.conference.models import Conference, Section class SectionInline(admin.TabularInline): model = Section prepopulated_fields = {"slug": ("name",)} extra = 1 class ConferenceAdmin(admin.ModelAdmin): list_display = ("title", "start_date", "end_date") ...
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): """Run administrative tasks.""" os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'where_to_go.settings') try: from django.core.management import execute_from_command_line except ...
num=[50,40,23,70,56,100,18,] l=len(num) a=0 mini1=num[a] i=0 x=num while i<l: if x[i]<=mini1: mini1=x[i] i+=1 y=0 mini2=num[y] a=0 c=num m=0 while m<l: if mini2>num[m]>mini1: mini2=num[m] m+=1 print(mini2)
from vecino.similar_repositories import SimilarRepositories from vecino.__main__ import initialize
# Copyright 2017 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 sqlite3 conn = sqlite3.connect('spider.sqlite') cur = conn.cursor() cur.execute(''' UPDATE Pages SET new_rank = 1.0, old_rank = 0.0 ''') conn.commit() cur.close() print('The rank of all pages has been set to 1.0')
# In settings.json first activate computer vision mode: # https://github.com/Microsoft/AirSim/blob/master/docs/image_apis.md#computer-vision-mode from AirSimClient import * import pprint pp = pprint.PrettyPrinter(indent=4) client = CarClient() client.confirmConnection() for x in range(3): # do few times z = x ...
from __future__ import absolute_import from __future__ import unicode_literals from corehq.apps.data_interfaces.models import AutomaticUpdateRule from corehq.apps.sms import tasks as sms_tasks from corehq.form_processor.exceptions import CaseNotFound from corehq.form_processor.interfaces.dbaccessors import CaseAccessor...
import sys import time import signal import subprocess from ._utils import get_ffmpeg_exe, logger from ._parsing import LogCatcher, parse_ffmpeg_header, cvsecs ISWIN = sys.platform.startswith("win") exe = None def _get_exe(): global exe if exe is None: exe = get_ffmpeg_exe() return exe def ...
#!/usr/bin/env python #Created by Spencer Hance and Trevor Gale on January 18th 2015 #Northeastern University Computer Architecture Research Group #Licensed under MIT License import sys import matplotlib.pyplot as plt import numpy as np from pylab import cm import re import random from scipy.misc import comb import a...
"""django_admin_demo URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/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='home'...
import h5py import numpy import matplotlib.pyplot as plt def plotflux(h5file, state=1): """ A function that plots the dataset target_flux_evolution from a direct.h5 file. Parameters ---------- h5file: dictionary The user's HDF5 file loaded with loadh5. state: integer The target...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from ray.rllib.agents.trainer import Trainer, with_common_config from ray.rllib.utils.annotations import override # yapf: disable # __sphinx_doc_begin__ class RandomAgent(Trainer): """P...
#!/usr/bin/env python # -*- coding: utf-8 -*- import simplejson as json from alipay.aop.api.constant.ParamConstants import * class AnswerModel(object): def __init__(self): self._extra = None self._item_id = None self._option_id = None @property def extra(self): return se...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** 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, Mapping, Optional, Sequence, Union, overload from ... import _utilities fro...
import torch import torch.nn as nn class RadarStackedHourglass(nn.Module): def __init__(self, n_class, stacked_num=1): super(RadarStackedHourglass, self).__init__() self.stacked_num = stacked_num self.conv1a = nn.Conv3d( in_channels=2, out_channels=32, k...
# -*- coding: utf-8 -*- ''' Manage information about regular files, directories, and special files on the minion, set/read user, group, mode, and data ''' # TODO: We should add the capability to do u+r type operations here # some time in the future from __future__ import absolute_import, print_function # Import pyth...
from dataclasses import dataclass, field from typing import List, Optional from bindings.gmd.abstract_curve_segment_type import AbstractCurveSegmentType from bindings.gmd.coordinates import Coordinates from bindings.gmd.curve_interpolation_type import CurveInterpolationType from bindings.gmd.point_property import Point...
''' Class: TerminalColors Credit: https://stackoverflow.com/questions/287871/print-in-terminal-with-colors ''' class TerminalColors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[...
from django.test import TestCase # Create your tests here. from .models import Image, Category, Location class TestImage(TestCase): def setUp(self): self.location = Location(locationName='Kiambu') self.location.saveLocation() self.category = Category(categoryName='job') self.cate...
"""Base classes for all estimators.""" # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause import copy import inspect import warnings import numpy as np from scipy import sparse from .externals import six ############################################################################### de...
from sim_core import * import conf import sim # dictionary with list of update functions to call update_functions = {} def install_configuration_update(version, f): prev = update_functions.get(version, []) update_functions[version] = prev + [f] def update_configuration(set): global first_queue try: ...
# import necessary libraries from flask import Flask, render_template, jsonify, redirect from flask_pymongo import PyMongo import scrape_mars # create instance of Flask app app = Flask(__name__) app.config["MONGO_URI"] = "mongodb://localhost:27017/mars_app" mongo = PyMongo(app) # create route that renders index.ht...
#!/usr/bin/python3 import sys import fcntl import logging import time import io import datetime import decimal import statistics from astm_bidirectional_common import my_sql , file_mgmt, print_to_log #For mysql password sys.path.append('/var/gmcs_config') import astm_var ####Settings section start##### logfile_name='/...
from util.conf import JSM_SETTINGS from selenium.webdriver.common.by import By class UrlManager: def __init__(self, portal_id=None, request_key=None): self.host = JSM_SETTINGS.server_url self.login_params = '/servicedesk/customer/user/login' self.portal_params = f'/servicedesk/customer/po...
from adaptor.evaluators.generative import GenerativeEvaluator from adaptor.evaluators.sequence_classification import SeqClassificationEvaluator from adaptor.evaluators.token_classification import TokenClassificationEvaluator from adaptor.lang_module import LangModule from adaptor.objectives.objective_base import Object...
#------------------------------------------------------------------------------------------- # project.py # # Author : Felix Gonda # Date : July 10, 2015 # School : Harvard University # # Project : Master Thesis # An Interactive Deep Learning Toolkit for # Automatic Segmentation of Images # # S...
from __future__ import print_function from __future__ import division from __future__ import absolute_import from scipy.misc import imread, imresize, imsave, fromimage, toimage from scipy.optimize import fmin_l_bfgs_b import numpy as np import time import argparse import warnings from keras.models import Model from k...
#!/usr/bin/env python ############################################################### # < next few lines under version control, D O N O T E D I T > # $Date$ # $Revision$ # $Author$ # $Id$ ############################################################### ############################################################### ...
# coding: utf-8 """ UltraCart Rest API V2 UltraCart REST API Version 2 OpenAPI spec version: 2.0.0 Contact: support@ultracart.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest import ultracart f...
import sys import subprocess def snipe_import_exceptions(exctype, value, traceback): if exctype == ImportError: module = str(value).split(" ")[-1:][0] install_module(module) else: sys.__excepthook__(exctype, value, traceback) sys.excepthook = snipe_import_exceptions def install_module...
#!/usr/bin/env python # coding: utf-8 import numpy as np import astropy.units as u from astropy.time import Time, TimeDelta from pint.residuals import resids import pint.toa as toa from pint import models __all__ = ['make_ideal', 'createfourierdesignmatrix_red', 'add_rednoise', 'add_d...
#!/usr/bin/env python from pandas import * from numpy import * from djeval import * import csv, code import pickle as pickle from sklearn.externals import joblib NUM_GAMES=50000 def shell(): vars = globals() vars.update(locals()) shell = code.InteractiveConsole(vars) shell.interact() msg("Hi! Rea...
# coding=utf-8 # Copyright 2022 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
# Copyright 2018, OpenCensus 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 w...
import os import unittest from apmserver import ElasticTest, ExpvarBaseTest from apmserver import ClientSideElasticTest, SmapIndexBaseTest, SmapCacheBaseTest from apmserver import SplitIndicesTest from beat.beat import INTEGRATION_TESTS import json import time class Test(ElasticTest): @unittest.skipUnless(INTEG...
import os import glob import numpy as np import matplotlib.pyplot as plt from scipy.integrate import solve_ivp from scipy.interpolate import interp1d from .settings import * class ElasticPendulum: """Class that handles the simulation of springy, double pendulums. This class handles a number of initial conditi...
# -*- coding: utf-8 -*- """ @Time : 2020/12/11 11:57 @Author : Corey """ from flask import Flask, request from flask_restful import Api, Resource, marshal, fields, reqparse app = Flask(__name__) # restful接口方法 api = Api(app) class UserApi(Resource): def get(self): return 'get restful api data' de...