content
stringlengths
5
1.05M
from cmp.pycompiler import Production, Sentence, Symbol, EOF, Epsilon class ContainerSet: def __init__(self, *values, contains_epsilon=False): self.set = set(values) self.contains_epsilon = contains_epsilon def add(self, value): n = len(self.set) self.set.add(value) ret...
''' Faça um programa que leia 5 números e informe o maior número. ''' num_2 = 0 for i in range(0,5): num_1 = float(input('Digite um numero: ')) if num_1 > num_2: num_2 = num_1 print(num_2)
from threading import Thread, Lock class WordExtractor: INVALID_CHARACTERS = ["'", ",", ".", "/", "?", ";", ":", "(", ")", "+", "*", "[", "]", "{", "}", "&", "$", "@", "#", "%", "\"", "|", "\\", ">", "<", "!", "=", "(", ")", "`"] NUMBERS = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"] HIFEN = "-" ENCODING =...
# -*- coding: utf-8 -*- """ Created on Thu Aug 22 21:36:57 2019 @author: SJ """ import numpy as np import pickle import scipy def corr(a,b,doy): elliptical_orbit_correction = 0.03275104*np.cos(doy/59.66638337) + 0.96804905 a *= elliptical_orbit_correction b *= elliptical_orbit_correction ...
# encoding:utf-8
#!/usr/bin/env python """A module and command line tool for working with temporary directories.""" import calendar import contextlib import os import os.path import random import shlex import shutil import string import subprocess import sys import time import tarfile import tempfile import zipfile __version_info__ =...
from typing import Any, Dict, Type from marshmallow import fields, post_load from marshmallow_enum import EnumField from marshmallow_oneofschema import OneOfSchema from mf_horizon_client.data_structures.configs.stage_config import ( BacktestStageConfig, FeatureGenerationStageConfig, FilterStageConfig, ...
from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from typing import Any, TypeGuard, overload, ClassVar from typing_extensions import Self, LiteralString from tg_gui_core.shared import IsinstanceBase # OPTIMIZATION: # from tg_gui_core.implementation_support import isoncir...
import json, os, shutil, re, sys import urllib.request import requests import time import argparse from summaries import RFCsSummaries from groups import RFCsGroups # Adapted from https://github.com/AndreaOlivieri/rfc2json.git __COMPLETE_REGEX__ = r"\n(\d{4})\s(?:(Not Issued)|(?:((?:.|\s)+?(?=\.\s*\(Format))(?:\.\s*\...
from . circuit_element_group import CircuitElementGroup from . bus import Bus class BusGroup(CircuitElementGroup): dss_module_name = 'Bus' ele_class = Bus def _collect_names(self, dss): """ Override super() to use dss.Circuit.AllBusNames()""" self._names = dss.Circuit.AllBusNames() ...
from skimage import data from skimage.filter.rank import median from skimage.morphology import disk from skimage.viewer import ImageViewer from skimage.viewer.widgets import Slider, OKCancelButtons, SaveButtons from skimage.viewer.plugins.base import Plugin def median_filter(image, radius): return median(image, s...
import numpy as np import cv2 img=cv2.imread('c:\\users\\lenovo\\desktop\\bjork.jpg',0) cv2.imshow('Bjork',img) k=cv2.waitKey(0) if k==27: cv2.destroyAllWindows() elif k==ord('s'): cv2.imwrite('deepgray.jpg', img) cv2.destroyAllWindows()
from fastapi import APIRouter, Depends from core.dependencies import init_service from models.quiz import QuizInResponsePartial from services.quiz import QuizService router = APIRouter() @router.get('/{post_id}', response_model=QuizInResponsePartial) async def get_quiz_by_post_id(post_id: int, service: QuizService ...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
# ---------------------------------------------------------------- # YDK - YANG Development Kit # Copyright 2016-2019 Cisco Systems # # 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 # # htt...
from __future__ import annotations from contextlib import contextmanager from typing import List, Optional, Union import jigu.client.terra from jigu.client.object_query import AccountQuery from jigu.core import StdFee, StdMsg, StdSignMsg, StdTx from jigu.key import Key __all__ = ["Wallet"] class Wallet(AccountQuer...
"""Implement unmasked linear attention.""" import torch from torch.nn import Module from ..attention_registry import AttentionRegistry, Optional, Callable, Int, \ EventDispatcherInstance from ..events import EventDispatcher from ..feature_maps import elu_feature_map class LinearAttention(Module): """Impleme...
# ------------------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # -------------------------------------------------------------------...
#!/usr/bin/env python3 import os def get_fastq_file_name(fastq_file): if fastq_file.endswith(".fastq.gz"): file_name = os.path.basename(path_to_file).split(".fastq.gz")[0] return file_name if fastq_file.endswith(".fq.gz"): file_name = os.path.basename(path_to_file).split(".fq.gz")[0] return file_name if fa...
from __future__ import print_function import sys DEBUG_LOG_ENABLED = True # Debug Levels DEBUG_LOG_ERROR = 0 DEBUG_LOG_WARN = 1 DEBUG_LOG_INFO = 2 DEBUG_LOG_VERBOSE = 3 # Only output messages upto the Info Level by default. DEBUG_LOG_LEVEL = DEBUG_LOG_INFO def debug_print(msg): """Print a info debug message."...
from django.db import models from django.contrib.auth.models import User class Profile(models.Model): email = models.EmailField(blank=True) def __str__(self): return self.email class Invalidmail(models.Model): email = models.EmailField(blank=True) def __str__(self): ...
__author__ = 'Evgeny Demchenko' __email__ = '[email protected]' __version__ = '0.1.0'
from task_selector.task import Task def test_initializer(): task = Task("a", ["1"], 1) assert isinstance(task, Task) assert task.profit == 1.0 assert isinstance(task.profit, float) assert len(task.resources) == 1 def test_equality(): task = Task("a", ["1", "5", "8"], 1) task2 = Task("a", ...
'''This progamr takes a single integer as input and returns the sum of the integers from zero to the input parameter''' def addGivenInput(n): try: result = sum(range(n + 1)) except TypeError: result = "this is not valid postive number" return result print(addGivenInput(5)) print("*****...
#!/usr/bin/env python3 """Functional Python Programming Chapter 13, Example Set 1 """ # pylint: disable=unused-wildcard-import,wrong-import-position,unused-import from typing import Iterable from functools import reduce def prod(data: Iterable[int]) -> int: """ >>> prod((1,2,3)) 6 """ return reduc...
#!/usr/bin/python3 # ------------------------------------------------------------------------ # author : Shane.Qian#foxmail.com # createdat : Wednesday, June 19, 2019 PM06:50:11 CST @ China # ------------------------------------------------------------------------ # description : fmt mysql sql explain output wi...
#! /usr/bin/env python # --------------------------------------------------------------------- # Tests for tablefill.py # TODO(mauricio): Implement error codes in CLI version from subprocess import call import unittest import os import sys sys.path.append('../') from nostderrout import nostderrout from tablefill impor...
# from import_export.admin import ImportExportModelAdmin from django.contrib.admin import register, ModelAdmin, TabularInline from .models import Campus, Solicitacao class SolicitacaoInline(TabularInline): model = Solicitacao extra = 0 @register(Campus) class CampusAdmin(ModelAdmin): list_display = ['si...
from .MainMenu import MainMenu from .CategoryMenu import CategoryMenu from .MenuTypes import MenuTypes class FactoryMenu: @staticmethod def get_menu(_type: str): if _type == MenuTypes.category: return CategoryMenu() elif _type == MenuTypes.main: return MainMenu()
class BendVertex: def __init__(self,time,val): self.t = time self.v = val def copy(self): return BendVertex(self.t,self.v) def __eq__(self,other): return self.t == other.t \ and self.v == other.v class Bend: def __init__(self,vertices=[]): self.vs = list(vertices) def copy(self...
from services.scraper import Scraper def init_scraper_service(base_url=None, next_button_text=None, letter_list_uri=None, letter_list_page_uri=None, result_item_selector=None, printer=None, db=None, *args, **kwargs) -> Scraper: options = {...
import unittest from translator import english_to_french, french_to_english class TestE2F(unittest.TestCase): def test1(self): with self.assertRaises(TypeError): english_to_french() # pylint: disable=no-value-for-parameter self.assertEqual(english_to_french("Hello"), "Bonjour") # te...
""" Symbol Types to represent a symbolic evaluation. """ from typing import NewType, Union Constant = NewType('Constant', str) Variable = NewType('Variable', int) Symbol = Union[Constant, Variable] def constant(bin_str: str) -> Constant: """ Transform the given binary value into a typesafe Constant. En...
#!/usr/bin/python # -*- coding:utf-8 -*- # author: zsun # @Time : 2018/09/20 20:28 # @Author : Zhongyuan Sun class Singleton(type): def __init__(cls, name, bases, dict): super(Singleton, cls).__init__(name, bases, dict) cls.instance = None def __call__(cls, *args, **kwargs): if...
from flask import request, g, redirect, request, json, jsonify, Response from viewsource import app # import pydevd from urllib.error import URLError from urllib.request import urlopen, Request from urllib.parse import urlparse from hashlib import md5 from .helpers import beautify, file_extension, decorate_response @...
from django.shortcuts import render from .models import * # Create your views here. def users(request): Users = User_Model.objects.all() return render(request,'users.html',{'users':Users})
from django.apps import AppConfig class FinanceAppConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'finance_app'
# # PySNMP MIB module CISCO-UNIFIED-COMPUTING-AAA-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-UNIFIED-COMPUTING-AAA-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:58:20 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Pytho...
# PGD + Diversity Regularization on MNIST import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torchvision import torchvision.transforms as transforms from torchvision.datasets import DatasetFolder, ImageFolder import numpy as np import matplotlib.pyplot as plt impor...
# -*- coding: utf-8 -*- """ Assessments This module currently contains 2 types of Assessments * Flexible Impact Assessments (including Mobile access) * Rapid Assessment Tool (from ECB: http://www.ecbproject.org/page/48) @ToDo: Migrate this to a Template in the Survey module @ToDo...
# -*- coding: utf-8 -*- from iscc_schema import generator def test_iscc_request(): r = generator.IsccCodePostRequest(source_url="https://example.com") assert r.json(exclude_unset=True) == '{"source_url": "https://example.com"}' def test_data_uri(): durl = "data:application/json;charset=utf-8;base64,eyJl...
# Generated by Django 2.2.4 on 2019-08-09 17:28 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('editor', '0003_auto_20190809_1724'), ] operations = [ migrations.RenameModel( old_name='PythonLabs', new_name='PythonLab', ...
from pathlib import Path from datetime import datetime, timezone from onamazu import db_file_operator as dfo import os import shutil import logging import zipfile logger = logging.getLogger("o-namazu") def sweep(config, now: datetime = None): if now is None: now = datetime.now() logger.debug(f"Swee...
class Container(object): """ Holds hashable objects. Objects may occur 0 or more times """ def __init__(self): """ Creates a new container with no objects in it. I.e., any object occurs 0 times in self. """ self.vals = {} def insert(self, e): """ assumes e is hashable ...
from direct.gui.DirectGui import * from pandac.PandaModules import * from pirates.piratesgui import PiratesGuiGlobals import types class ButtonListItem(DirectButton): def __init__(self, item, itemHeight, itemWidth, parent=None, parentList=None, textScale=None, txtColor=None, **kw): optiondefs = ( ...
from .is_file import is_file from .is_string import is_string
import glob import pandas as pd from statistics import stdev CSV_DIRECTORY = "Concussion Subject Data/*" PROCESSED_CSV_TITLE = "processed_data" FILES = glob.glob(f"{CSV_DIRECTORY}/*.csv") DATAFRAMES = [pd.read_csv(filename) for filename in FILES] def abs_diff(dataframe, column_name: str) -> list: """Return the ...
'''Setup all relevant packages.''' from . import utils from . import statements from . import profile from . import indicators from . import prices
from time import time import numpy as np import scipy.io as sio from os.path import join from tqdm import tqdm from converter.tfrecord_converter import TFRecordConverter, DataSetConfig, DataSetSplit class MpiiConverter(TFRecordConverter): def __init__(self): self.num_kps = 16 self.mpii_order = ...
from pygame import * from random import randint window = display.set_mode((700,500)) background = transform.scale(image.load("galaxy.jpg"),(700,500)) class GameSprite(sprite.Sprite): def __init__(self, player_image,x,y,size_x,size_y,speed): sprite.Sprite.__init__(self) self.image = transform.sca...
import pytest from energytechnomodels import Bath @pytest.fixture() def fix_create(): b = Bath(2.7, 2.7, t_bath_init=50.0) b.p_heat = 50E3 b.step(2, "hours") return b def test_bath_step(fix_create): b = fix_create assert round(b.t_bath, 2) == 81.88
#!/usr/bin/env python3 # # utils.py """ General utility functions. """ # # Copyright © 2020 Dominic Davis-Foster <[email protected]> # # 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 Sof...
########################################################################## # NSAp - Copyright (C) CEA, 2016 # Distributed under the terms of the CeCILL-B license, as published by # the CEA-CNRS-INRIA. Refer to the LICENSE file or to # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html # for details. ##########...
import sys def opposite(number): return number * (-1) if __name__ == "__main__": if len(sys.argv) == 2: print(opposite(number=int(sys.argv[1]))) else: sys.exit(1)
from setuptools import setup, find_packages setup( name='jsonpkt', packages=find_packages(), version='0.0.1', author='Keito Osaki', author_email='[email protected]', )
import pytest from xclingo.preprocessor._utils import translate_show_all, translate_trace_all, translate_trace class TestUtils: def test_translate_trace_all(self, datadir): input_text = (datadir / 'test_trace_all_input').read_text() expected_text = (datadir / 'test_trace_all_output').read_text() ...
# -*- coding: utf-8 -*- """ Created on Mon Sep 28 08:12:43 2020 @author: cis-user """ # score=['小徐',5,9,6,8,7,10,6] # s=score[1:] # a=max(s) # print(a) # score=['小徐',5,9,6,8,7,10,6] # s=score[1:] # a=min(s) # print(a) # score=['wang',5,9,6,8,7,10,6] # s=score[1:] # y= sorted(s,reverse=True) # a,...
"""Demo Linear Programming (LP) solver. The LP solver returns a solution to the following problem. Given m x n matrix A, length-m vector b >=0, and length-n vector c. Find a length-n vector x minimizing c.x subject to A x <= b and x >= 0. The small (or, condensed) tableau variant of the Simplex algorithm is used. Th...
import logging import numpy import sys import rasterio from rasterio.features import rasterize from rasterio.transform import IDENTITY logging.basicConfig(stream=sys.stderr, level=logging.INFO) logger = logging.getLogger('rasterize_geometry') rows = cols = 10 geometry = {'type':'Polygon','coordinates':[[(2,2),(2,4.2...
#!/usr/bin/env python # # Set up a virtualenv environment with the prerequisites for csrv. # To use this, install virtualenv, run this script, and then run the generated # csrv-bootstrap.py to create an environment with the needed dependencies. # import virtualenv script = virtualenv.create_bootstrap_script(''' impor...
# Copyright 2016-present CERN – European Organization for Nuclear Research # # 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...
import os from pathlib import Path from watchdog.events import FileSystemEvent, PatternMatchingEventHandler from watchdog.observers import Observer from mitama._extra import _Singleton from mitama.app.http import Response from mitama.app.app import _session_middleware from .method import group from .router import Ro...
# -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Immunization Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from pydantic.validators import bytes_validator # noqa: F401 from .. import fhirtypes # noqa: F401 from .. import immunization def impl_...
# Something import matplotlib.pyplot as plt import numpy as np import pandas as pd def graph_scatter(sdlabel, xdata, ydata, ax, mtitle = '', xtitle = '', ytitle = '', color = 'b', ...
from house_regresion.housing_data import load_housing_data from sklearn.model_selection import train_test_split, StratifiedShuffleSplit from sklearn.impute import SimpleImputer from sklearn.preprocessing import LabelBinarizer from house_regresion.custom_transformer import CombinedAttributesAdder from pandas import Data...
# package imports from dash import html import dash_bootstrap_components as dbc layout = dbc.Container( [ html.Div( dbc.Container( [ html.H1( [ html.I(className='fas fa-skull-crossbones'), ...
#!venv/bin/python from stt_api import app import os import requests import tqdm if __name__ == "__main__": for asr_model_type in app.config['ASR_MODELS']: print("Checking if models exist.") asr_model = app.config['ASR_MODELS'][asr_model_type] model_path = f"{app.config['ASR_MODEL_FOLDER']}...
# coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import json import argparse #import argparse import torch def add_parser_params(parser): """add argument to the parser""" # checkpoint parser.add_argument('--resume', type=str, ...
import argparse import pkg_resources from argparse import Namespace def get_package_templates(): models = {} for entry_point in pkg_resources.iter_entry_points('stratus_package_templates'): models[entry_point.name] = entry_point.load() return models class PackageTemplate(object): def __ini...
""" Chef Two and Chef Ten are playing a game with a number X. In one turn, they can multiply X by 2. The goal of the game is to make X divisible by 10. Help the Chefs find the smallest number of turns necessary to win the game (it may be possible to win in zero turns) or determine that it is impossible. Input ...
# # Copyright 2016 The BigDL 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 ...
from wsgiref.simple_server import make_server bytes = chr(100)*1024*1024 def req(environ, start_response): start_response('200 OK', []) yield bytes server = make_server('localhost', 8000, req) server.serve_forever()
#!/usr/bin/python # -*- coding: utf-8 -*- """ This module contains common function for FARS parsers """ def value_by_mapping(value, year, mapping): if value == -1: return 'UNKNOWN' default = mapping['default'] all_keys = mapping.keys() all_keys.remove('default') all_keys.sort() from_y...
import requests # Vuln Base Info def info(): return { "author": "cckuailong", "name": '''Cisco ASA XSS''', "description": '''Multiple vulnerabilities in the web services interface of Cisco Adaptive Security Appliance (ASA) Software and Cisco Firepower Threat Defense (FTD) Software could al...
""" Status information for the CI infrastructure, for use by the dashboard. """ import threading import time import traceback import StringIO from llvmlab import util import buildbot.statusclient class BuildStatus(util.simple_repr_mixin): @staticmethod def fromdata(data): version = data['version'] ...
from rest_framework import viewsets, mixins from ..models import SparePartType from ..serializers import sparepart_types class SparePartTypeViewSet(mixins.CreateModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, mixins.ListM...
# suppress warnings import warnings; warnings.filterwarnings('ignore'); # common imports import pandas as pd import numpy as np import math import re import glob import os import json import random import pprint as pp import textwrap import sqlite3 import logging import spacy import nltk from tq...
# Generated by Django 2.1.4 on 2018-12-08 01:28 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('finance', '0014_auto_20181208_0124'), ] operations = [ migrations.AlterField( model_name='expen...
import utils.constants import logging, pytesseract, fitz import pandas as pd from pathlib import Path from PIL import Image def convert_pages_into_image(input_path, format): """Recursively finds all PDF files within a given directory and converts each page of each PDF to an image using PyMuPDF.""" # To g...
import argparse import re import requests from colorama import Fore, Style from bs4 import BeautifulSoup import pandas as pd from gamestonk_terminal.helper_funcs import ( check_positive, get_user_agent, patch_pandas_text_adjustment, parse_known_args_and_warn, ) from gamestonk_terminal.config_terminal i...
n = int(input()) s = {} for i in range(n): w, h = [int(x) for x in input().split()] if not w in s or h > s[w]: s[w] = h print(sum(s.values()))
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
from django.db import models from django.core.mail import EmailMessage # This class represents an unsent email class Email(models.Model): SUBJECT_MAX_LEN = 255 datetime = models.DateTimeField(auto_now_add=True, verbose_name='date') subject = models.CharField(max_length=SUBJECT_MAX_LEN, verbose_name='suje...
# generated by datamodel-codegen: # filename: openapi.yaml # timestamp: 2021-12-31T02:46:26+00:00 from __future__ import annotations from datetime import datetime from enum import Enum from typing import Annotated, Any, List, Optional from pydantic import BaseModel, Extra, Field class ApprovalRuleTemplateName...
#!h:\django~1\attend~1\myenv\scripts\python.exe from django.core import management if __name__ == "__main__": management.execute_from_command_line()
import sqlite3 from sqlite3 import Error class DBHelper: def __init__(self, filedb='db/pythonsqlite3.db'): self.filedb=filedb def __connect__(self): try: self.con = sqlite3.connect(self.filedb) self.cur = self.con.cursor() except Error as e: ...
# -*- coding: utf-8 -*- from .abod import ABOD from .cblof import CBLOF from .combination import aom, moa, average, maximization from .feature_bagging import FeatureBagging from .hbos import HBOS from .iforest import IForest from .knn import KNN from .lof import LOF from .mcd import MCD from .ocsvm import OCSVM from .p...
import io from setuptools import setup, find_packages from sotabenchapi.version import __version__ name = "sotabenchapi" author = "Robert Stojnic" author_email = "[email protected]" license = "Apache-2.0" url = "https://sotabench.com" description = ( "Easily benchmark Machine Learning models on selected tasks an...
# -*- coding: utf-8 -*- """ spotty_search.search.controllers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Flask Blueprint for searching """ from flask import Blueprint, jsonify, Response from spotty_search.api import spot from spotty_search.search import fuzzy_search # init Flask Blueprint at /search/ directory sear...
def part_1(data): chart = [([c for c in line] + [' '] * 200)[:200] for line in data] x, y = chart[0].index('|'), 0 dx, dy = 0, 1 letters = [] while True: x, y = x+dx, y+dy symbol = chart[y][x] if symbol == ' ': return "".join(letters) elif symbol.isalpha...
from datetime import time from mongoengine import DoesNotExist from pytz import UTC from models import ChatPeriodicTask from exceptions import SocialCreditError from .options import TransactionLimitChatOptions, TransactionLimitProfileOptions from .signals import * from .periodic import * DEFAULT_TIME = time(hour=1...
# Copyright 2021, Mycroft AI 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 to in writi...
# encoding: utf-8 """ @author: zeming li @contact: [email protected] @file: __init__.py.py """ if __name__ == '__main__': pass
""" Lejeune interpolator is basically a linear interpolator for a Lejeune grid based spectral library. This is the simplest interpolator but most commonly used. It takes care of boundary conditions by imposing limits to extrapolation on a given grid. """ import numpy as np from .interpolator import BaseInterpolator ...
"""EBP Usage: ebp use-default <root> ebp use <name> ebp show-default ebp save-default ebp (-h | --help) ebp (-v | --version) Options: -h --help Show this screen. -v --version Show version. """ import os import json import pprint from collections import OrderedDict from doc...
# 회문 # DP와 반복문을 이용한 풀이. # https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV14QpAaAAwCFAYi&categoryId=AV14QpAaAAwCFAYi&categoryType=CODE&&& # 반복문을 이용한 풀이 for tc in range(1, 11): n=int(input()) result=0 lis=[input() for _ in range(8)] rev_lis=list(map(list, zip(*lis))) ...
from pathlib import Path from datetime import datetime from echopype.calibrate.ecs_parser import ECSParser data_dir = Path("./echopype/test_data/ecs") CORRECT_PARSED_PARAMS = { "fileset": { "SoundSpeed": 1496.0, "TvgRangeCorrection": "BySamples", "TvgRangeCorrectionOffset": 2.0, }, ...
import re from django.utils.text import wrap from django.utils.translation import ugettext, ugettext_lazy as _ from django.contrib.sites.models import Site from django.template import Context, loader from django.template.loader import render_to_string from django.conf import settings # favour django-mailer but fall ba...
#!/usr/bin/env python """ http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-cloudwatch-metrics.html """ import boto.ec2 import os import sys import time AWS_REGION = os.environ['EC2_REGION'] AWS_ACCESS_KEY = os.environ['AWS_ACCESS_KEY'] AWS_SECRET_KEY = os.environ['AWS_SECRET_KEY'] def crea...
from hamlyn2021.data_processing.data_scraping import RandomDownloader, SequenceDownloader __all__ = [ RandomDownloader, SequenceDownloader, ]