text
stringlengths
2
999k
def correct_ini_file(config_file): with open(config_file, mode='r') as raw_open: raw_open.seek(0) temp_api_details = raw_open.readlines(0) # print(type(temp_api_details[0])) with open(config_file, mode='w') as rewrite_config: if temp_api_details[0] != '[TELEGRAM]\n': ...
import json import unittest2 from normalize import from_json from normalize import JsonProperty from normalize import JsonRecord from normalize import Property from normalize import Record from normalize import to_json from unique.encoding import JSONRecordIO from testclasses import MultiLevelKeyValue from testclas...
#!/usr/bin/env python # -*- coding: utf-8 -*- """sc2autosave is a utility for reorganizing and renaming Starcraft II files. Overview ============== sc2autosave provides a simple mechanism for renaming replay files as they are copied or moved from a source directory to a destination directory. In between runs the stat...
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import functools import math import warnings import weakref import numpy as np from scipy import optimize as scipyoptimize import nevergrad...
# valid ranges rules = [] while True: try: ln = input() if not ln.strip(): break rule = [x.split("-") for x in ln.split(": ")[1].split(" or ")] for r in rule: rules.append([int(x) for x in r]) except EOFError: break while True: ...
import matplotlib as mp import pandas as pd import seaborn as sb import report.config as config from ..util import create_file, sort_dataframe from .util import savefig, set_scales, set_labels, task_labels def draw_parallel_coord(df, class_column, x_labels=True, yscale='linear', ...
async def greet(ctx): greetings = [ "Ahn nyong ha se yo", "Ahn-nyong-ha-se-yo", "Ahoj", "An-nyŏng-ha-se-yo", "As-salamu alaykum", "Assalamo aleikum", "Assalamualaikum", "Avuxeni", "Bonġu", "Bonjour", "Bună ziua", "Ciao",...
from sqlalchemy.dialects.postgresql import UUID from sqlalchemy.schema import FetchedValue from sqlalchemy.ext.associationproxy import association_proxy from sqlalchemy.ext.hybrid import hybrid_property from app.api.utils.models_mixins import Base from app.extensions import db from app.api.now_applications.models.act...
from django.apps import AppConfig class ContactConfig(AppConfig): name = 'contacts' def ready(self): import contacts.signals
#!/usr/bin/env python3 import re import sys import sqlite3 import traceback import os __location__ = os.path.realpath( os.path.join( os.getcwd(), os.path.dirname(__file__) ) ) input_failures = 0 try: DATABASE_NAME = os.path.join(__location__, 'data.sqlite') conn = sqlite3.connect(DAT...
""" Utility functions using the pyesgf package. """ import sys from urllib.parse import quote_plus def ats_url(base_url): """ Return the URL for the ESGF SAML AttributeService """ # Strip '/' from url as necessary base_url = base_url.rstrip('/') return '/'.join([base_url, ...
from datetime import datetime from decimal import Decimal import os from django import forms from django.conf import settings from django.core.files.storage import default_storage as storage from django.forms.formsets import formset_factory import commonware.log import happyforms from quieter_formset.formset import B...
import os from glob import glob import pandas as pd def get_list_of_full_child_dirs(d): """ For a directory d (full path), return a list of its subdirectories in a full path form. """ children = (os.path.join(d, child) for child in os.listdir(d)) dirs = filter(os.path.isdir, children) ...
def coding_problem_31(s, t, debt=0): """ Given two strings, compute the edit distance between them. The edit distance between two strings refers to the minimum number of character insertions, deletions, and substitutions required to change one string to the other. Example: >>> coding_problem_31...
import torch from .elliptical_slice import EllipticalSliceSampler class MeanEllipticalSliceSampler(EllipticalSliceSampler): def __init__(self, f_init, dist, lnpdf, nsamples, pdf_params=()): """ Implementation of elliptical slice sampling (Murray, Adams, & Mckay, 2010). f_init: initial val...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# coding:utf-8 ''' python 3.5 mxnet 1.3.0 gluoncv 0.3.0 visdom 0.1.7 gluonbook 0.6.9 auther: helloholmes ''' import mxnet as mx import numpy as np import os import time import pickle from mxnet import gluon from mxnet import init from mxnet import nd from mxnet import autograd from mxnet.gluon import nn class VGG16(nn...
import os import numpy as np def get_lax_sod_network(): return [12, 12, 10, 12, 10, 12, 10, 10, 12,1] def get_lax_sod_data_inner(): data_path = os.environ.get("LAX_SOD_REPO_PATH", "../lax_sod_tube") qmc_points = np.loadtxt(os.path.join(data_path, "parameters/parameters_sobol_X.txt")) forces = np...
# # The BSD License # # Copyright (c) 2008, Florian Noeding # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # Redistributions of source code must retain the above copyright notice, this # li...
# -*- coding: utf-8 -*- # Copyright (c) 2020-2021 Salvador E. Tropea # Copyright (c) 2020-2021 Instituto Nacional de Tecnologïa Industrial # License: Apache 2.0 # Project: KiAuto (formerly kicad-automation-scripts) import os import re import json import configparser from contextlib import contextmanager from sys import...
# Replace with DB URI; proto://user:pass@host/database DB_URI = "replace" # Replace with bot token TOKEN = "replace" # Replace with IDs of admin command users ADMIN_IDS = [] # Replace with voice channel for audio clue TARGET_VOICE_CHANNEL = 0
# -*- coding: utf-8 -*- # ***************************************************************************** # NICOS, the Networked Instrument Control System of the MLZ # Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS) # # This program is free software; you can redistribute it and/or modify it under # the t...
"""Lauda temperature controller class Python class for Lauda temperature controllers :platform: Unix :synopsis: Python class for Lauda temperature controllers .. moduleauthor:: Henrique Dante de Almeida <henrique.almeida@lnls.br> """ from threading import Event from epics import Device, ca from py4syn.epics.IScan...
import numpy as np import matplotlib.pyplot as plt import scipy.sparse.linalg as spLA import majoranaJJ.operators.sparse.qmsops as spop #sparse operators import majoranaJJ.lattice.nbrs as nb #neighbor arrays import majoranaJJ.lattice.shapes as shps #lattice shapes import majoranaJJ.modules.plots as plots #plotting fun...
#!/usr/bin/env python3.4 from flask import Blueprint, flash, redirect, render_template, request, url_for from flask.ext.login import login_user, logout_user, login_required from ..models import User from ..forms import LoginForm auth = Blueprint('auth', __name__) @auth.route('/login', methods=['GET', 'POST']) def...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #################################################################################################################################################################################################################################### ############################################...
from distutils.core import setup setup( name='TestLibrary_MR', # How you named your package folder (MyLib) packages=['TestLibrary_MR'], # Chose the same as "name" version='0.2', # Start with a small number and increase it with every change you make license='MIT', # Chose a license from here: https:...
import discord from discord.ext import commands from decorators import * from io import BytesIO from urllib.parse import quote from base64 import b64encode from json import loads class encoding(commands.Cog): def __init__(self): self.ciphers = loads(open("./assets/json/encode.json", "r").read()) pa...
import json import requests EDHREC_BASE_URL = 'https://edhrec-json.s3.amazonaws.com/commanders/%s.json' COMMANDER_PAGE_SLUGS = frozenset([ 'w', 'u', 'b', 'r', 'g', 'colorless', 'wu', 'ub', 'br', 'rg', 'gw', 'wb', 'ur', 'bg', 'rw', 'gu', 'wub', ...
import get_coefficients_as_list import check_diagonal_dominant # function that computes in gauss jacobi method def gauss_jacobi(no_of_unknowns): coefficient_list = get_coefficients_as_list.get_coefficients_as_list(no_of_unknowns) if check_diagonal_dominant.is_diagonally_dominant(coefficient_list): print("Compu...
# Copyright (c) 2015 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 applic...
import sys from os import path from setuptools import find_packages, setup import versioneer min_version = (3, 6) if sys.version_info < min_version: error = """ pcdscalc does not support Python {0}.{1}. Python {2}.{3} and above is required. Check your Python version like so: python3 --version This may be due ...
""" Interface to the accounts table. Data format is dicts, not objects. """ from anchore_engine.db import Account, AccountTypes, AccountStates from anchore_engine.db.entities.common import anchore_now class AccountNotFoundError(Exception): def __init__(self, account_name): super(AccountNotFoundError, self...
from keras.preprocessing.image import * from keras.applications.imagenet_utils import preprocess_input from keras import backend as K from PIL import Image import numpy as np import os #import cv2 def center_crop(x, center_crop_size, data_format, **kwargs): if data_format == 'channels_first': centerh, cen...
# 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 u...
# Generated by Django 2.2.9 on 2020-07-23 13:41 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('messier_objects', '0002_auto_20200723_1438'), ] operations = [ migrations.AlterField( model_name='messierobject', na...
# # Copyright (c) 2018 Juniper Networks, Inc. All rights reserved. # import sys import os import logging import json import test_case from vnc_api.exceptions import NoIdError, RefsExistError from vnc_api.gen.resource_client import * from vnc_api.gen.resource_xsd import * from vnc_api.utils import obj_type_to_vnc_class ...
# coding: utf-8 """ 3Di API 3Di simulation API (latest version: 3.0) Framework release: 1.0.16 3Di core release: 2.0.11 deployed on: 07:33AM (UTC) on September 04, 2020 # noqa: E501 The version of the OpenAPI document: 3.0 Contact: info@nelen-schuurmans.nl Generated by: https://openapi-gen...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-BASE 蓝鲸基础平台 is licensed under the MIT License. License for BK-BASE 蓝鲸基础平台: ------------------------------------------...
#main game section # %% plansza_do_gry = {'7':' ','8':' ','9':' ', '4':' ','5':' ','6':' ', '1':' ','2':' ','3':' '} klawisze_gry=[] for key in plansza_do_gry: klawisze_gry.append(key) # print(klawisze_gry) def drukuj_plansze(pole): print(f"{pole['7']} | {pole['8']} | {p...
""" WSGI config for thread_33988 project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
import compileall import re compileall.compile_dir( 'examples', maxlevels=0, )
from functools import partial from unittest.mock import Mock, patch import graphene import pytest from django.contrib.auth.models import AnonymousUser from django.db.models import Q from django.shortcuts import reverse from graphql.error import GraphQLError from graphql_relay import to_global_id from ...core.utils im...
import numpy import os import math from azureml.core.model import Model from azureml.core.dataset import Dataset from inference_schema.schema_decorators \ import input_schema, output_schema from inference_schema.parameter_types.numpy_parameter_type \ import NumpyParameterType import keras from keras.m...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Order.billing_call_prefix' db.add_column(u'shop_order', 'billing_call_prefix', self.gf('dj...
import unittest from simuloc.signal import Generator class GeneratorTestCase(unittest.TestCase): """GeneratorTestCase tests the generator class.""" def setUp(self): """Creates a instance of the generator class.""" self.cinst = Generator() def tearDown(self): pass def test_noi...
from source.camera import camera from source.LaneDetect import LaneDetect from moviepy.editor import VideoFileClip import glob import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import matplotlib.image as mpimg import numpy as np import cv2 # # def process_video(input_video_file): # clip1 = V...
# Mistral documentation build configuration file import os import sys on_rtd = os.environ.get('READTHEDOCS', None) == 'True' # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path....
# -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2018-07-08 17:37 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('reviews', '0008_auto_20180623_2009'), ] operations = [ migrations.AddField(...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import pprint from collections import defaultdict from .context_query_attention import StructuredAttention from .encoder import StackedEncoder from .cnn import DepthwiseSeparableConv from .model_utils import save_pickle, mask_logits, ...
from basic_functions import * import csv from collections import deque inf = 1000 def table_phase0(): trans_ep = [] with open('trans_ep_phase0.csv', mode='r') as f: for line in map(str.strip, f): trans_ep.append([int(i) for i in line.replace('\n', '').split(',')]) trans = [] w...
def numOfAbled(L,k): hori=0 verti=0 for i in range(len(L)): for j in range(len(L)-k+1): num=0 for m in range(k): if L[i][j+m]!=1: break else : num+=1 if num==k: if j==len(L)-k:...
#!/usr/bin/env python # Author: Dr. Konstantin Selyunin # License: MIT # Created: 2020.08.19 import logging import os.path import struct from abc import abstractmethod, ABC from typing import Union, Tuple from .rsl_xml_svd.rsl_svd_parser import RslSvdParser class ShearWaterRegisters(ABC): def __init__(self, ...
def binaryToInt (string: str, oneChar = "1", zeroChar = "0"): out = 0 for i in range(len(string)): currentDigit = None if string[len(string) - 1 - i] == oneChar: currentDigit = 1 elif string[len(string) - 1 - i] == zeroChar: currentDigit = 0 out +...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals from poetry.poetry import Poetry from poetry.utils._compat import Path from poetry.utils.toml_file import TomlFile fixtures_dir = Path(__file__).parent / "fixtures" def test_poetry(): poetry = Poetry.create(s...
#! python """ Modified version of barcode report for use on CCS inputs """ from pprint import pformat import functools import logging import json import os.path as op import sys from pbcommand.models import DataStore, FileTypes from pbcommand.models.report import PlotGroup from pbcommand.cli import pbparser_runner f...
# -*- coding: utf-8 -*- from typing import List, Dict, AnyStr from retry import retry from ratelimit import limits, RateLimitException import dataiku from dataiku.customrecipe import get_recipe_config, get_input_names_for_role, get_output_names_for_role from plugin_io_utils import ErrorHandlingEnum, validate_column_...
#!/usr/bin/python3 # mari von steinkirch @2013 # steinkirch at gmail def find_edit_distance(str1, str2): ''' computes the edit distance between two strings ''' m = len(str1) n = len(str2) diff = lambda c1, c2: 0 if c1 == c2 else 1 E = [[0] * (n + 1) for i in range(m + 1)] for i in range(m + 1): E[i][0] = i f...
#!/usr/bin/env python # coding: utf-8 # # Cats and Dogs Classification # Data Loading and Exploring # In[1]: import os base_dir = './cats_and_dogs_filtered' train_dir = os.path.join(base_dir, 'train') validation_dir = os.path.join(base_dir, 'validation') # cat training pictures train_cats_dir = os.path.join(train...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import pathlib from collections import namedtuple import torchaudio import shutil Speaker = namedtuple('Speaker', ['id', 'gender', 'subset']) FileRecord = namedtuple( 'FileRecord', ['fname', 'length', 'speaker', 'book', 'text_file']) def get...
import os PROJECT_DIR = os.path.abspath(os.pardir) RUN_DIR = os.path.join(PROJECT_DIR, "runs/") DATA_DIR = os.path.join(PROJECT_DIR, "data/") EMBEDDINGS_DIR = os.path.join(PROJECT_DIR, "embeddings/")
""" # BEGIN TAG_DEMO >>> tag('br') # <1> '<br />' >>> tag('p', 'hello') # <2> '<p>hello</p>' >>> print(tag('p', 'hello', 'world')) <p>hello</p> <p>world</p> >>> tag('p', 'hello', id=33) # <3> '<p id="33">hello</p>' >>> print(tag('p', 'hello', 'world', cls='sidebar')) # <4> <p class="sidebar">hello</p> <p class="s...
from functools import lru_cache class Solution: def longestPalindromeSubseq(self, s: str) -> int: @lru_cache(None) def helper(b,e): print(b,e) if b > e : return 0 if b == e : return 1 if s[b] == s[e] : return helper(b+1,e-1) + 2 ...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved """ A script to run multinode training with submitit. """ import argparse import os import uuid from pathlib import Path import main as detection import submitit def parse_args(): detection_parser = detection.get_args_parser() parser = ar...
"""Entity for Zigbee Home Automation.""" from __future__ import annotations import asyncio from collections.abc import Callable import functools import logging from typing import TYPE_CHECKING, Any from homeassistant.const import ATTR_NAME from homeassistant.core import CALLBACK_TYPE, Event, callback from homeassista...
# -*- coding:utf-8 -*- from __future__ import absolute_import, unicode_literals from exmail.client.api.base import EmailBaseAPI class Department(EmailBaseAPI): def create(self, department_data): ''' 创建部门 :param department_data: 创建部门所需数据 :return: ''' return self._...
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
import datetime as dt import os # ログファイル差分チェッカー # ファイル名を受け取り、update()実行ごとに差分を返す # 更新実行時の時間をもつ # 更新にかかった総所要時間の計測はせず、上のレイヤーに任せる # 監視対象のファイルは行を追加する形で情報が増えていくものとする class LogReader: # filename, last_update, tail_ix def __init__(self, filename): self.filename = filename self.last_update = dt.datet...
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-04-20 21:54 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blog', '0001_initial'), ] operations = [ migrations.AlterField( ...
import time import torch from torchtext.experimental.datasets import AG_NEWS from torchtext.experimental.vectors import FastText as FastTextExperimental from torchtext.vocab import FastText def benchmark_experimental_vectors(): def _run_benchmark_lookup(tokens, vector): t0 = time.monotonic() for ...
# Copyright 2012 New Dream Network, LLC (DreamHost) # # 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...
def check_lists(l1, l2): def contains(l1, l2):
"""Loads deepmind_lab.so.""" import imp import pkg_resources imp.load_dynamic(__name__, pkg_resources.resource_filename( __name__, 'deepmind_lab.so'))
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2018-05-05 02:05 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("PartyListV2", "0002_restrictedguest"), ] operations = [ migrations.AddField...
import random from urllib.request import urlopen import sys WORD_URL="http://learncodethehardway.org/words.txt" WORDS=[] PHRASES={"class %%%(%%%):": "Make a class named %%% that is-a %%%.", "class %%%(object):\n\tdef _init_(self,***)": "class %%% has-a _init_that takes self and *** params.", ...
"""Auto-generated file, do not edit by hand. HR metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_HR = PhoneMetadata(id='HR', country_code=385, international_prefix='00', general_desc=PhoneNumberDesc(national_number_pattern='[1-7]\\d{5,8}|[89]\\d{6,11}', possible_n...
from django.contrib import messages from django.utils import timezone from django.utils.translation import gettext_lazy as _ from ...admin.views import generic from ..models import Agreement from .forms import AgreementForm, FilterAgreementsForm from .utils import disable_agreement, set_agreement_as_active class Agr...
""" WSGI config for apiwrapper project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SE...
from django.urls import path from profiles_api import views urlpatterns =[ path('hello-view/',views.HelloApiView.as_view()) ]
# # 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...
import azureml from azureml.core import VERSION from azureml.core import Workspace, Experiment, Datastore, Environment from azureml.core.runconfig import RunConfiguration from azureml.data.datapath import DataPath, DataPathComputeBinding from azureml.data.data_reference import DataReference from azureml.core.compute im...
import torch import torch.nn as nn class Normalize_layer(nn.Module): def __init__(self, mean, std): super(Normalize_layer, self).__init__() self.mean = nn.Parameter(torch.Tensor(mean).unsqueeze(1).unsqueeze(1), requires_grad=False) self.std = nn.Parameter(...
import logging import os import torch import torch.nn as nn import torch.utils.model_zoo as model_zoo from modeling.layers.epipolar import Epipolar from modeling import registry from core import cfg from .basic_batch import find_tensor_peak_batch from utils.logger import setup_logger from utils.model_serialization imp...
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme 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 ...
import pandas as pd import numpy as np import statsmodels.api as sm from enum import Enum class ParValue(Enum): TSTAT = 1 PVALUE = 2 STD = 3 class OneReg: def __init__(self, reg, show_list=[], hide_list=[], blocks=[], bottom_blocks=[]): self.reg = reg if show_list == []: se...
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
#!/usr/bin/env python3 """Node para controlar um robô de sumô File ------- sumo_controller/src/sumo_controller_node.py Authors ------- ThundeRatz Team <comp@thunderatz.org> """ import rospy from std_msgs.msg import Float64 CONTROL_RATE = 60 # Hz def main(): """ Lógica principal do node de controle ""...
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import import os import subprocess import tempfile from subprocess import CalledProcessError from textwrap import dedent import pytest from pex.common im...
from cvxpy import Variable, Parameter, Minimize, Problem, OSQP, quad_form import numpy as np import scipy as sp import scipy.sparse as sparse import time if __name__ == "__main__": # Discrete time model of a quadcopter Ts = 0.2 M = 2.0 Ad = sparse.csc_matrix([ [1.0, Ts], [0, 1.0] ...
# Задача 1, Вариант 14 # Напишите программу, которая будет сообщать род деятельности и псевдоним под которым скрывается Мари Фрасуа Аруэ. После вывода информации программа должна дожидаться пока пользователь нажмет Enter для выхода. # Моренко А.А. # 07.03.2016 print("Мари Франсуа Аруэ, – великий французский п...
from sklearn import tree from sklearn import preprocessing from sklearn.model_selection import cross_val_score from sklearn.metrics import mean_absolute_error, f1_score import pandas as pd from pandas.api.types import ( is_numeric_dtype, is_bool_dtype, is_categorical_dtype, is_string_dtype, is_date...
# coding=utf-8 # Copyright (c) DIRECT Contributors import argparse import pathlib import sys from direct.types import FileOrUrl, PathOrString from direct.utils.io import check_is_valid_url def is_file(path): path = pathlib.Path(path) if path.is_file(): return path raise argparse.ArgumentTypeErro...
from django.contrib import admin from django.urls import path, include from django.conf import settings from django.conf.urls.static import static urlpatterns = [ path('admin/', admin.site.urls), path('', include('store.urls')) ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
# # Py-Alpha-AMD Registration Framework # Author: Johan Ofverstedt # Reference: Fast and Robust Symmetric Image Registration Based on Distances Combining Intensity and Spatial Information # # Copyright 2019 Johan Ofverstedt # # Permission is hereby granted, free of charge, to any person obtaining a copy of this softwa...
from .data_loader import StackOverflowLRDataLoader __all__ = [ 'StackOverflowLRDataLoader', ]
import argparse import discretisedfield as df def convert_files(input_files, output_files): for input_file, output_file in zip(input_files, output_files): field = df.Field.fromfile(input_file) field.write(output_file) def main(): parser = argparse.ArgumentParser( prog='ovf2vtk', ...
import os import argparse # import json from wallstreet import Stock from wallstreet_cli import xetra from forex_python.converter import CurrencyRates LOCAL_DB_PATH = os.path.join(os.path.dirname(__file__), "data", "db.txt") def _currency_conversion(source_v: float, source_currency: str, target_currency: str): ...
""" The core part of the SOTA model of CPSC2019, branched, and has different scope (in terms of dilation) in each branch """ from copy import deepcopy from itertools import repeat from collections import OrderedDict from typing import Union, Optional, Sequence, NoReturn import numpy as np np.set_printoptions(precision...
# Copyright 2016 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...