text
stringlengths
1
927k
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Weather stations along the Appalachian Trail, using trail towns provided by Ref. [1]. [1]: http://www.aprs.org/hamtrails/AT-towns.txt """ stations = { "GA": { "Gainesville, GA": "KGVL", # Gainesville, GA "Waleska, GA": "KCNI", # Cant...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: spec.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _mess...
# -*- coding: utf-8 -*- """ A module to find the optimizing vibrational coordinates to reduce intermode coupling """ import os import time import logging import numpy as np from copy import deepcopy from scipy import optimize from numba import jit import rmgpy.constants as constants from ape.job.job import Job from...
from tg_bot import LOAD, NO_LOAD, LOGGER def __list_all_modules(): from os.path import dirname, basename, isfile import glob # This generates a list of modules in this folder for the * in __main__ to work. mod_paths = glob.glob(dirname(__file__) + "/*.py") all_modules = [basename(f)[:-3] for f in ...
exam_st_date = input("Enter your exam date ").split(',') output = f"The examination will start from : {exam_st_date[0]}/{exam_st_date[1]}/{exam_st_date[2]}" print(output)
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Plots for the apero drs paper Created on 2021-08-01 @author: cook """ import matplotlib matplotlib.use('Qt5Agg') from astropy.io import fits from astropy.visualization import imshow_norm, ZScaleInterval, LinearStretch import glob import matplotlib.pyplot as plt import...
def main(): with open("AoC-D5.txt") as f: lines = f.readlines() lines = [thing.strip("\n") for thing in lines] lines = [thing.split(" -> ") for thing in lines] lines = [point.split(',') for direction in lines for point in direction] lines = [lines[n:n + 2] for n in range(0, len(lines), 2)] ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Sign releases on github, make/upload ppa to launchpad.net NOTE on ppa: To build a ppa you may need to install some more packages. On ubuntu: sudo apt-get install devscripts libssl-dev python3-dev \ debhelper python3-setuptools dh-python NOTE on apk sig...
from django.conf import settings from django.shortcuts import redirect from django_otp import user_has_device class TwoFactorMiddleware(object): def __init__(self, get_response): self.get_response = get_response def __call__(self, request): response = None if hasattr(self, 'process_req...
#! /usr/bin/env python #@+leo-ver=4 #@+node:@file freenetfs.py #@@first """ A FUSE-based filesystem for freenet Written May 2006 by aum Released under the GNU Lesser General Public License Requires: - python2.3 or later - FUSE kernel module installed and loaded (apt-get install fuse-source, crack tarba...
import contextlib import pickle import unittest import warnings import numpy import pytest try: import scipy.sparse scipy_available = True except ImportError: scipy_available = False import cupy from cupy.core import _accelerator from cupy import testing from cupyx.scipy import sparse def _make(xp, sp, ...
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2018-12-02 12:15 from __future__ import unicode_literals import bims.enums.taxonomic_rank import bims.enums.taxonomic_status import django.contrib.postgres.fields from django.db import migrations, models import django.db.models.deletion class Migration(migrati...
# -*- 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 #...
# apps.py - django app definition for keyring # # This file is part of debexpo # https://salsa.debian.org/mentors.debian.net-team/debexpo # # Copyright © 2019 Baptiste Beauplat <lyknode@cilg.org> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associat...
#!/usr/bin/env python3 """ Hdmi Matrix simulation """ import time from datetime import datetime from llama import mqtt import hdmi DEADTIME = 1.0 # Update lock timer LAST_UPDATE_A_FINISHED = 0 LAST_UPDATE_B_FINISHED = 0 # Actions GET_CHANNEL_INPUTS_REQUEST = "@hdmi/GET_CHANNEL_INPUTS_REQUEST" GET_CHANNEL_INPUTS...
# -*- coding: utf-8 -*- # code for console Encoding difference. Dont' mind on it import sys import imp imp.reload(sys) try: sys.setdefaultencoding('UTF8') except Exception as E: pass import testValue from popbill import Cashbill, CashbillService, PopbillException cashbillService = CashbillService(testValue....
"""Tests for the elpy.jedibackend module.""" import sys import unittest import jedi import mock from elpy import jedibackend from elpy import rpc from elpy.tests import compat from elpy.tests.support import BackendTestCase from elpy.tests.support import RPCGetCompletionsTests from elpy.tests.support import RPCGetCom...
# import pytest # from starlette.testclient import TestClient # # from app import db_models # from app.db.mysql import objects # from app.db_models import UserToken, UserSubmitBangumi # from app.api.auth.api_v1.depends import get_current_user # def test_submit_subject_id_require_auth(client: TestClient): # r = cli...
""" $description French live TV channel and video on-demand service owned by Gulli. $url replay.gulli.fr $type live, vod $region France """ import logging import re from streamlink.plugin import Plugin, pluginmatcher from streamlink.plugin.api import validate from streamlink.stream.hls import HLSStream from streamlin...
from Prometheus.views.index_view import index from Prometheus.views.search_view import search from Prometheus.views.corporation_view import transcript
#!/usr/bin/env python # -*- coding: utf-8 -*- """The setup script.""" from setuptools import setup, find_packages with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() requirements = [ 'Click>=6.0', # TODO: Get ve...
#! /usr/bin/env python # Copyright (c) 2019 Uber Technologies, 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 a...
# -*- coding: utf-8 -*- import base64 import json import urlparse from django.conf import settings from django.core.urlresolvers import reverse from django.test import override_settings import mock from rest_framework.test import APIClient from rest_framework_jwt.serializers import VerifyJSONWebTokenSerializer from ...
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'faceweb.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise Import...
#!/usr/bin/env python """ Copyright (c) 2013, Luke Fitzgerald All rights reserved. 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 c...
import os import luigi import numpy as np from astropy.table import Table from astra.tasks.base import BaseTask from astra.utils import log from astra_thecannon.tasks.base import TheCannonMixin, read_training_set import astra_thecannon as tc class TrainingSetTarget(BaseTask): training_set_path = luigi.Paramete...
"""Purpose: This module is for spectrometry analysis will have functions for general spectrum processing """ from pyne.utils import QA_warn import copy QA_warn(__name__) class PhSpectrum(object): """Pulse height spectrum class""" def __init__( self, spec_name="", start_chan_...
import numpy as np import bisect class Hertz(float): def __init__(self, hz): try: self.hz = hz.hz except AttributeError: self.hz = hz def __neg__(self): return Hertz(-self.hz) def __add__(self, other): try: other = other.hz exce...
#copyright openpyxlzip 2010-2018 """ Excel office art descriptors """ from openpyxlzip.xml.constants import REL_NS, DRAWING_NS, DRAWING_16_NS, DRAWING_14_NS from openpyxlzip.compat import safe_string from openpyxlzip.xml.functions import Element from openpyxlzip.descriptors import ( Typed,) from . import ( M...
# -*- coding: utf-8 -*- # Copyright (2017) Hewlett Packard Enterprise Development LP # # 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...
#coding=utf-8 #该脚本用来对json文件标准化以保证不同环境下的识别率 import os NAME = "tem_01" try: w = open( r"C:\evepi\%s\fuckpath.md" % NAME, "w" ) except: os.system( "MD C:\evepi" ) os.system( "MD C:\evepi\%s" % NAME ) w = open( r"C:\etc\%s\fuckpath.md" % NAME, "w" ) path = os.getcwd() + "\\fuck.json" w.write( path ) w.c...
############################################################################### # PyDial: Multi-domain Statistical Spoken Dialogue System Software ############################################################################### # # Copyright 2015 - 2019 # Cambridge University Engineering Department Dialogue Systems Grou...
import sys import time import numpy as np from matplotlib.backends.qt_compat import QtCore, QtWidgets, is_pyqt5 if is_pyqt5(): from matplotlib.backends.backend_qt5agg import ( FigureCanvas, NavigationToolbar2QT as NavigationToolbar) else: from matplotlib.backends.backend_qt4agg import ( Figure...
# Copyright 2015 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" file accompa...
import pytest @pytest.fixture() def datacenter_response(): return { "datacenter": { "id": 1, "name": "fsn1-dc8", "description": "Falkenstein 1 DC 8", "location": { "id": 1, "name": "fsn1", "description": "Falke...
# Generated by Django 3.1.3 on 2020-11-26 22:59 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('subscriptions', '0001_initial'), ] operations = [ migrations.AlterModelOptions( name='subscription', options={'order...
from block_model.controller.block_model import BlockModel from drillhole.controller.composites import Composites from geometry.controller.ellipsoid import Ellipsoid from kriging.controller.search_ellipsoid import SearchEllipsoid from kriging.controller.point_kriging import PointKriging from variogram.controller.model i...
#!/usr/bin/python # # This source file is part of appleseed. # Visit https://appleseedhq.net/ for additional information and resources. # # This software is released under the MIT license. # # Copyright (c) 2012-2013 Jonathan Topf, Jupiter Jazz Limited # Copyright (c) 2014-2018 Jonathan Topf, The appleseedhq Organizat...
from django import forms from .validators import validate_url, validate_dot_com class SubmitUrlForm(forms.Form): url = forms.CharField( label='', validators=[validate_url], widget = forms.TextInput( attrs ={ "placeholder": "Long URL...
from typing import Tuple import math from random import choices as random_choices from PIL import Image padding_info_bytes = 2 def get_min_image_size(data: bytearray) -> Tuple[int, int]: """ Find the minimum pixels required to create a square from an array. Calculates the minimum dimensions used to create a...
from noggin._version import get_versions from noggin.plotter import LivePlot from noggin.logger import LiveLogger from noggin.utils import create_plot, save_metrics, load_metrics, plot_logger __version__ = get_versions()["version"] del get_versions __all__ = [ "create_plot", "plot_logger", "save_metrics",...
# Generated by Django 2.0.5 on 2018-07-17 13:15 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('parkrundata', '0001_initial'), ] operations = [ migrations.AddField( model_name='event', name='is_discontinued', ...
import time from wraptor.decorators import timeout, TimeoutException def test_basic(): @timeout(1) def fn(): try: time.sleep(2) assert False except TimeoutException: pass fn() def test_catch_exception_outsize(): @timeout(1) def fn(): tim...
""" Module to set up run time parameters for Clawpack. The values set in the function setrun are then written out to data files that will be read in by the Fortran code. """ from __future__ import absolute_import import os import numpy as np # used to create ruled rectangle: from clawpack.amrclaw import regio...
""" Maya-related functions, which are useful to both `api` and `core`, including `mayaInit` which ensures that maya is initialized in standalone mode. """ from __future__ import print_function from __future__ import absolute_import from __future__ import division from builtins import zip from builtins import object imp...
#!/usr/bin/python3 # -*- coding: UTF-8 -*- """ 响应按钮 """ import RPi.GPIO as GPIO import time class Buttons(): # 设置引脚编码模式 gpioMode = GPIO.BCM # 检测电平是上升还是下降 GPIO.PUD_UP / GPIO.PUD_DOWN: pudMode = GPIO.PUD_UP # 0 视为按下还是 1 视为按下 isDownVal: int = 0 # 按键时可能有电平抖动,进行几次重复验证 chkDownTimes: int = 2...
""" Implements the gridworld MDP. Matthew Alger, 2015 matthew.alger@anu.edu.au """ import numpy as np import numpy.random as rn import matplotlib.pyplot as plt class Gridworld(object): """ Gridworld MDP. """ def __init__(self, grid_size, wind, discount): """ grid_size: Grid size. int...
#!/usr/bin/env python # Python Network Programming Cookbook -- Chapter - 9 # This program is optimized for Python 2.7. # It may run on any other version with/without modifications. import os from scapy.all import * pkts = [] count = 0 pcapnum = 0 def write_cap(x): global pkts global count global pcapnum ...
import pandas as pd from datetime import datetime, date def compute_weekday(timestamp): date_str = timestamp.split('+')[0] date = datetime.strptime(date_str, '%Y-%m-%dT%H:%M:%S.%f') return date.weekday() data = pd.read_csv('data.temp.csv') data['weekday'] = float("NaN") for index, row in data.iterrows(...
from django.contrib.auth.models import User from django.db import models # Create your models here. class Doctor(models.Model): identity_fk = models.OneToOneField(User, on_delete=models.CASCADE) mobile = models.IntegerField() designation = models.CharField(max_length=100, blank=True) hospital = model...
# !/usr/bin/python # -*- coding: utf-8 -*- # @Time : 2020/9/18 11:57 # @Author : WardenAllen # @File : pluto_tcp_server.py # @Brief :
"""A python version of the EVIL-MC code""" __version__ = '0.26' __author__ = 'Brian Jackson <bjackson@boisestate.edu>' __all__ = ['evilmc'] from .evilmc import *
"""Contains all automatically generated Semirings from CFFI. This documentation does not show all the semirings in this module because of the sheer number of them (over 1700). Please see the SuiteSparse User Guide for more information on the semirings usable in The GraphBLAS. All the standard and extension semirings...
""" file_extensions.py Copyright 2019 Andres Riancho This file is part of w3af, http://w3af.org/ . w3af 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 version 2 of the License. w3af is distributed in the hope ...
# Generated by Django 2.2.20 on 2021-04-23 18:16 from django.db import migrations import wagtail.core.blocks import wagtail.core.fields class Migration(migrations.Migration): dependencies = [ ('ask_cfpb', '0042_share_and_print_help'), ] operations = [ migrations.AddField( mo...
import numpy as np import subprocess import pathlib def support_vector_machine(objects: np.array, results: np.array, c: int): executablePath = "%s/support-vector-machine" % pathlib.Path(__file__).parent.absolute() p = subprocess.Popen(executablePath, stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=True) ...
from easilyb.urlselector import UrlSelector from easilyb.net.requestqueue import Requester from lxml.html import fromstring import logging logger = logging.getLogger(__name__) def _crawler_callback(resp, index=None): url,counter, depth, crawler = index crawler._parse_response(url, depth, resp) class LxmlX...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('accounts', '0017_auto_20150129_1257'), ] operations = [ migrations.AlterField( model_name='user', na...
from matplotlib import pyplot as plt from typing import Any, NoReturn, Tuple, List def plot_range(params: Tuple[Tuple[Any], ...], functions: Tuple[(Any, )], x_label: str = 'input', x_axis_labeling_function: (Any) = lambda i: i[0]) -> NoReturn: """ plots the time each function took to execute ea...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
version https://git-lfs.github.com/spec/v1 oid sha256:3b8f51dee337fe8b24d70642383ff0257e4a18a20fcfe9bcdcfd4c47073d9515 size 16016
import numpy as np import platform import os import sys from common.kalman.ekf import FastEKF1D, SimpleSensor # radar tracks SPEED, ACCEL = 0, 1 # Kalman filter states enum rate, ratev = 20., 20. # model and radar are both at 20Hz ts = 1./rate freq_v_lat = 0.2 # Hz k_v_lat = 2*np.pi*freq_v_lat*ts / (1 + 2*np.pi...
# Copyright (C) 2021 Members of the Simons Observatory collaboration. # Please refer to the LICENSE file in the root of this repository. import matplotlib.pyplot as plt import matplotlib.transforms as mtransforms from ref import band_params, smurf_keepout_zones_ghz colors = ['BlueViolet', 'Brown', 'CadetBlue', 'Cora...
# -*- coding: utf-8 -*- from odoo import api, exceptions, fields, models, _ from odoo.exceptions import UserError from uuid import uuid4 class ProductTemplate(models.Model): _inherit = 'product.template' onesphere_product_type = fields.Selection([('screw', 'Screw'), ('bolt', 'Bolt'), ('vehicle', 'Vehicle')],...
# -*- coding: utf-8 -*- import png def print_qrcode(path): """ 将二维码输出到控制台 需要终端尺寸足够大才能显示 :param path: 二维码图片路径 (PNG 格式) :return: None """ reader = png.Reader(path) width, height, rows, info = reader.read() lines = list(rows) planes = info['planes'] # 通道数 threshold = (2 **...
""" Budget module """ class Budget: """ Create a budget for placing bets """ def __init__(self, balance: float = 0.00, period: str = "Day") -> None: """ Initialize the budget object >>> budget = Budget() >>> budget <__main__.Budget object at 0x...> >>> budget....
class Solution: def pacificAtlantic(self, matrix): """ :type matrix: List[List[int]] :rtype: List[List[int]] """ if len(matrix) == 0 or len(matrix[0]) == 0: return [] # pacific canaccess = [[0 for i in range(len(matrix[0]))] for j in range...
from .cpuinfo import getCpuInfo from .revinfo import getRevInfo def getInfo(filename=None): cpuInfo = getCpuInfo(filename) if cpuInfo is not None and 'revision' in cpuInfo: revInfo = getRevInfo(cpuInfo['revision']) revInfo['code'] = cpuInfo['revision'] return { **cpuInfo, 'revision': revInfo } else...
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="scatter.unselected.textfont", **kwargs ): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_n...
Q_all = 'L1tmu:GOOD,Hlt:GOOD,Lumi:GOOD,All:GOOD' Q_1 = ',Pix:GOOD,Strip:GOOD,Track:GOOD' Q_2 = ',Ecal:GOOD,Es:GOOD,Egamma:GOOD' Q_3 = ',Hcal:GOOD,Jetmet:GOOD' Q_4 = ',Dt:GOOD,Rpc:GOOD,Csc:GOOD,Muon:GOOD' Q_not_mu = ',L1tcalo:GOOD' #Virginia's feedback:All except: BTagCSV, MET, Tau, BTagMu, Charmonium, DoubleM...
print("Os planos são: 100mb, 200mb, 250mb, 500mb, 1gb, 2gb, 5gb") credito = 0 vez = [0,0,0,0,0,0,0] mais = "sim" saldo = int(input("digite a quantidade de dinheiro que você irá gastar ")) while mais == "sim": quero = input("Qual plano vc quer ativar? 1, 2, 3, 4, 5, 6, 7\n") if quero == "1": print("o valor é: ...
import tensorflow as tf from tensorflow.python.ops import rnn_cell from tensorflow.python.ops import seq2seq import numpy as np class Model(): def __init__(self, args, infer=False): self.args = args if infer: args.batch_size = 1 args.seq_length = 1 if args.model ==...
# Databricks notebook source # MAGIC %md ## Import Run # MAGIC # MAGIC Import run from folder that was created by [Export_Run]($Export_Run) notebook. # MAGIC # MAGIC #### Widgets # MAGIC * Destination experiment name - Import run into this experiment. Will create if it doesn't exist. # MAGIC * Input folder - Input di...
#!/usr/bin/env python import os import sys import json import yaml import conda.cli.python_api as conda_api TMP_CONDA_PREFIX = '_conda/' # SO: https://stackoverflow.com/a/39681672 class Dumper(yaml.Dumper): def increase_indent(self, flow=False, *args, **kwargs): return super().increase_indent(flow=flow...
# coding=utf-8 # Copyright 2018 The TF-Agents 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...
"""Defines the core data classes and types for Gearbox environments.""" from dataclasses import dataclass from typing import Any, Callable, Iterable, Union @dataclass class Action: """Base class that all actions are suggested to extend.""" @dataclass class State: """Base class that all states are suggested...
import inspect import functools import uuid import marshmallow as ma from marshmallow import validate, fields from sqlalchemy.dialects import postgresql, mysql, mssql import sqlalchemy as sa from .exceptions import ModelConversionError from .fields import Related, RelatedList def _is_field(value): return isinst...
from conans import ConanFile, CMake class JWTUtilsTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "cmake_find_package" options = {"gtest": ["1.7.0", "1.8.1", "1.10.0"], "openssl": ["1.0.2n", "1.0.2s", "1.1.1g", "1.1.1k"]} default_options = {"gtest":"1.10.0", "opens...
from unittest import TestCase import validictory class TestSchemaErrors(TestCase): valid_desc = { "description": "My Description for My Schema" } invalid_desc = { "description": 1233 } valid_title = { "title":"My Title for My Schema" } invalid_title = { "title": 1233 } # doesn't matter what this ...
import os.path as osp import mmcv import numpy as np from torch.utils.data import Dataset from mmdet.core import eval_map, eval_recalls from .builder import DATASETS from .pipelines import Compose @DATASETS.register_module() class CustomDataset(Dataset): """Custom dataset for detection. The annotation form...
""" clearance dataset loader. """ from __future__ import division from __future__ import unicode_literals import os import logging import deepchem logger = logging.getLogger(__name__) def load_clearance(featurizer='ECFP', split='random', reload=True, move_mea...
#!/usr/bin/env python3 import sys import numpy as np import sympy as sp from rednose.helpers import KalmanError from rednose.helpers.ekf_sym import EKF_sym, gen_code from rednose.helpers.sympy_helpers import (euler_rotate, quat_matrix_r, quat_rotate) EARTH_GM = 3.986005e14 # m^3/s^2 (gravitational constant * mass of...
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import absolute_import from flexmock import flexmock import os import os.path import subprocess import pytest import datetime...
# -*- 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.async_support.base.exchange import Exchange # ----------------------------------------------------------------------------- try...
#!/usr/bin/env python """An abstract class that holds get, put, post, delete for any REST api.""" import requests import concurrent.futures import asyncio import abc class GenericRestApi(abc.ABC): """The object that holds the stache environment variables.""" @abc.abstractmethod def __init__(self, host, he...
# # Licensed Materials - Property of IBM # # (c) Copyright IBM Corp. 2007-2008 # import unittest, sys import ibm_db import config from testfunctions import IbmDbTestFunctions class IbmDbTestCase(unittest.TestCase): def test_200_MultipleRsltsetsUniformColDefs(self): obj = IbmDbTestFunctions() obj.assert_...
from Engine.importmodule import * # ------------------------------------------------------------------------------- #------------------------------------------------------------------------------- def DataPrep(args): # Collects and organizes all relevant information on target observations and associated telluric s...
import os import numpy as np from datetime import datetime as dt,timedelta import pandas as pd import requests import pickle from scipy.interpolate import interp1d from scipy.ndimage import gaussian_filter as gfilt,gaussian_filter1d as gfilt1d from scipy.ndimage.filters import minimum_filter import matplotlib.dates as...
""" Some codes from https://github.com/Newmu/dcgan_code """ from __future__ import division import math import pprint import random from time import gmtime, strftime import numpy as np import scipy.misc import tensorflow as tf import tensorflow.contrib.slim as slim from six.moves import xrange pp = pprint.PrettyPrin...
# -*- coding: utf-8 -*- # Generated by Django 1.11.9 on 2018-03-22 10:48 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('central', '0005_add_separate'), ] operations = [ ]
import sklearn def sklearn_version_is(version): if sklearn.__version__.startswith(version): return True return False def sklearn_is_at_least(version): if sklearn.__version__ >= version: return True return False def get_refactored_tests_to_skip(): """These tests have been edited...
import random import threading import time from statistics import mean from cereal import log from common.realtime import sec_since_boot from common.params import Params, put_nonblocking from common.hardware import TICI from selfdrive.swaglog import cloudlog PANDA_OUTPUT_VOLTAGE = 5.28 CAR_VOLTAGE_LOW_PASS_K = 0.091 ...
cups = [1, 0, 0] s = str(input()) for c in s: if c == "A": cups[0], cups[1] = cups[1], cups[0] elif c == "B": cups[2], cups[1] = cups[1], cups[2] else: cups[0], cups[2] = cups[2], cups[0] print(cups.index(1) + 1)
from rest_framework import viewsets from Evento import models from Evento.api import serializers class EventoViewsets(viewsets.ModelViewSet): serializer_class = serializers.EventoSerializer queryset = models.Evento.objects.all()
# Example of secrets file token = b'tokenstring'
# coding: utf-8 #import sys # to get OS import pdb # for debugging from random import choice # TODO def input_number(prompt, min_value, max_value): value = None while value is None: try: value = int(raw_input(prompt)) except ValueError: print 'Please enter a numb...
#!/usr/bin/env python3 """ Author: Ted Bracht <ted@bracht.uk> Purpose: Shout hello to the world """ import argparse def get_args(): parser = argparse.ArgumentParser(description="Say hello") parser.add_argument("-n", "--name", metavar="name", default="World", help="Name to greet") r...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jul 21 08:24:22 2021 @author: lukem """ import pandas as pd import os import sys import re import uuid import requests import os.path aen_config_dir = (os.path.abspath( os.path.join(os.path.dirname(__file__), '..'))) sys.path.append(aen_config_di...
# coding=utf-8 # Copyright 2020 The HuggingFace Datasets Authors and the TensorFlow Datasets 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/LI...
# -*- coding: utf-8 -*- # MinIO Python Library for Amazon S3 Compatible Cloud Storage, # (C) 2015, 2016 MinIO, 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.o...