filename
stringlengths
13
19
text
stringlengths
134
1.04M
the-stack_106_24596
# Import functions from cohortextractor import ( StudyDefinition, patients, codelist_from_csv, codelist, Measure ) # Import codelists from codelists import * from datetime import date start_date = "2020-12-07" end_date = "2021-02-01" # Specifiy study definition study = StudyDefinition( def...
the-stack_106_24600
import inspect import hashlib import logging from django.core.cache import caches from django.conf import settings log = logging.getLogger(__name__) class cache_types(object): NONE = None DEFAULT = 'default' SIMPLE = 'simple' # Stores queryset objects directly in cache PK_LIST = 'pk_list' # Stores...
the-stack_106_24601
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class RFgsea(RPackage): """Fast Gene Set Enrichment Analysis. The package implements an ...
the-stack_106_24606
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modif...
the-stack_106_24609
# Download the Python helper library from twilio.com/docs/python/install import os from twilio.rest import Client # Your Account Sid and Auth Token from twilio.com/user/account # To set up environmental variables, see http://twil.io/secure account_sid = os.environ['TWILIO_ACCOUNT_SID'] auth_token = os.environ['TWILIO_...
the-stack_106_24610
import logging import os from django.core.exceptions import ImproperlyConfigured from django.conf import settings from api.utilities.basic_utils import get_with_retry from api.runners import get_runner from api.storage_backends.google_cloud import GoogleBucketStorage logger = logging.getLogger(__name__) def get_ins...
the-stack_106_24612
# Copyright 2015 Hewlett-Packard Development Company, L.P. # # 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...
the-stack_106_24614
import theano import theano.tensor as T import numpy as np from collections import OrderedDict from functools import reduce from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams from lasagne.utils import floatX __all__ = [ 'softmin', 'join', 'lsum', 'joinc', 'ldot', 'lmean', 'log_barri...
the-stack_106_24615
import curses import collections import tempfile import subprocess import multidict from metaindex import shared import metaindex.cache import metaindex.indexer from cursedspace import Key, InputLine, ShellContext from metaindexmanager import command from metaindexmanager import utils from metaindexmanager.utils im...
the-stack_106_24616
# 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, software # distributed under the Li...
the-stack_106_24617
# Lint as: python3 # Copyright 2020 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
the-stack_106_24619
import socket import time from io import BytesIO from random import randint from unittest import TestCase from block import Block from helper import ( hash256, decode_base58, encode_varint, int_to_little_endian, little_endian_to_int, read_varint, ) from tx import Tx TX_DATA_TYPE = 1 BLOCK_DAT...
the-stack_106_24622
# Copyright 2019 The TensorFlow Probability 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 o...
the-stack_106_24624
# Copyright 2019 Baidu 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 writing, s...
the-stack_106_24625
"""Support for fetching Vulcan data.""" async def get_lessons(client, date_from=None, date_to=None): """Support for fetching Vulcan lessons.""" changes = {} list_ans = [] async for lesson in await client.data.get_changed_lessons( date_from=date_from, date_to=date_to ): temp_dict = ...
the-stack_106_24626
from flask import Blueprint, Response, request from bson.json_util import dumps from config import db groups_routes = Blueprint('groups', __name__, url_prefix = '/groups') @groups_routes.route('') def getGroups(): try: groups = db.groups.find() return Response( dumps(g...
the-stack_106_24627
############################################################################# # Copyright (C) 2020-2021 German Aerospace Center (DLR-SC) # # Authors: # # Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance wi...
the-stack_106_24628
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ TBR """ ################################ #LOAD LIBRARIES ################################ from unittest import TestCase import flight import numpy as np class TestFlight(TestCase): def test_nchoosek(self): self.assertEqual(flight.nchoosek(1, 1), 1) ...
the-stack_106_24632
"""An async GitHub API library""" __version__ = "5.1.0.dev" import http from typing import Any, Optional class GitHubException(Exception): """Base exception for this library.""" class ValidationFailure(GitHubException): """An exception representing failed validation of a webhook event.""" # https://...
the-stack_106_24633
"""File controls the application while it is running""" import time from components.loding_screen import * from firebase_manager.handler import Handler from keys import keys def run() -> None: start_time = time.time() threshold_time = 15 * 60 # 15 minutes in secs handler = Handler(keys.keys_auth, keys....
the-stack_106_24635
import datetime import logging import os from learners.fasttext_learner import FasttextLearner from learners.spacy_learner import SpacyLearner class TrainerProcessor: """A TrainerProcessor class is in charge of consuming the learning task. """ def consume(self, task): """This method should be i...
the-stack_106_24638
import tensorflow as tf from tensorflow.python.client import timeline a = tf.random_normal([2000, 5000]) b = tf.random_normal([5000, 1000]) res = tf.matmul(a, b) with tf.Session() as sess: # 添加记录 session 执行的选项 options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE) run_metadata = tf.RunMetadata() ...
the-stack_106_24640
"""Read/Write image files using ITK """ # Copyright (c) 2013-2018 Erling Andersen, Haukeland University Hospital, Bergen, Norway import os.path import logging import tempfile import itk import numpy as np import imagedata.formats import imagedata.axis from imagedata.formats.abstractplugin import AbstractPlugin logge...
the-stack_106_24641
# coding=utf-8 import json import os.path import pickle import requests import time import threading # noinspection PyPackageRequirements import websocket # noinspection PyPackageRequirements from bs4 import BeautifulSoup from urllib.parse import urlparse import chatcommunicate import metasmoke from globalvars import G...
the-stack_106_24642
def params2name(params): params_str = [] for k, v in params.items(): try: param_str = '{0}-{1:g}'.format(k,v) except ValueError: param_str = '{0}-{1}'.format(k,v) params_str.append(param_str) return '_'.join(params_str) def name2params(name): params = {} ...
the-stack_106_24644
""" Split an image into small square pieces of side `SIZE` and save them to disk individually. """ from PIL import Image import numpy as np import os import glob # ------------------------------------------- # Edit these parameters as required INFILES = glob.glob('test/4J7A0146_*.jpg') CREATE_DIRS = True SIZE = 128 O...
the-stack_106_24645
from gateway_test import GATEWAY_URL import unittest import common GATEWAY_URL = "http://localhost/v0" class TestData(unittest.TestCase): def test_data(self): users = 10 forms_per_user = 10 responses_per_form = 100 for u in range(users): user = common.generate_user()...
the-stack_106_24647
from django.conf.urls import include, url from django.views.generic import TemplateView from django.conf.urls.static import static from django.conf import settings from django.contrib import admin from . import apiv1, apiv2 from . import views from .models import LastUpdated admin.autodiscover() class IndexView(Temp...
the-stack_106_24649
''' Created on 29 Aug 2017 @author: igoroya ''' class TreeNode(object): def __init__(self, name=None): ''' A very simple node of a tree, all what is needed to work with trees in the exercises ''' self.name = name self.children = [] def __repr__(self): return "...
the-stack_106_24652
"""Data Provider module for providing data blocks made from similar stocks over a set time period, but separated. This data provider is not intended to be used outside of this module, instead, upon import, this module will create an instance of a SplitBlockProvider and register it with the global DataProviderRegist...
the-stack_106_24653
#!/usr/bin/env python """ 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");...
the-stack_106_24654
# Description: # Author: # Update Date: import docx, copy, os,utils # global variable hidden_style = None normal_style = None #resource text = utils.get_heyheyhey() def run(): #global global text # open docs return obj doc = docx.Document("./test.docx") normal_style = utils.get_style("./s...
the-stack_106_24655
import sys ################################################## # python3 create_config.py d_min d_max num_proc # # # # @arg d_min - minimum delay # # @arg d_max - maximum delay # # @arg num_proc - number of processes # ###...
the-stack_106_24657
from abc import ABC, abstractmethod from typing import List from boatsandjoy_api.core.data_adapters import DjangoDataAdapter from . import domain, models from .exceptions import BoatNotFound class BoatsRepository(ABC): @classmethod @abstractmethod def filter( cls, obj_id: int = None, ...
the-stack_106_24658
import os from tarfile import TarFile import pytest from PIL import Image, ImageDraw from aizynthfinder.utils import image from aizynthfinder.chem import TreeMolecule, RetroReaction @pytest.fixture def new_image(): img = Image.new(mode="RGB", size=(300, 300), color="white") draw = ImageDraw.Draw(img) dr...
the-stack_106_24659
import os from jinja2 import Environment, PackageLoader def create_google_problem(directory_path, problem_name): """ :param problem_name: shall be formatted as a python variable (underscores between words). :type problem_name: str """ problem_class_name = "".join(map(lamb...
the-stack_106_24662
def left(i): return 2*i def right(i): return 2*i+1 def max_heapify(A,i): l = left(i) r = right(i) if l<=len(A) and A[l-1]>A[i-1]: largest = l else: largest = i if r<=len(A) and A[r-1]>A[largest-1]: largest = r if largest != i: A[i-1],A[largest-1] = A[lar...
the-stack_106_24663
import io import time import traceback import uuid from http import HTTPStatus from .imports import * from .ipc import redis_ipc_new from .templating import * def etrace(ex): return "".join(traceback.format_exception(ex)) # COMPAT: Python 3.10 only class WebError(): @staticmethod async def log(request,...
the-stack_106_24664
import math import statistics from collections import deque from ParadoxTrading.Indicator.IndicatorAbstract import IndicatorAbstract from ParadoxTrading.Utils import DataStruct class SharpRate(IndicatorAbstract): def __init__( self, _period: int, _use_key: str = 'closeprice', _idx_key: st...
the-stack_106_24666
# This file is modified version of benchmark.py. # benchmark.py was released by RAMitchell (Copyright (c) 2018 Rory Mitchell) under MIT License # and available at https://github.com/RAMitchell/GBM-Benchmarks/blob/master/benchmark.py # License text is available at https://github.com/RAMitchell/GBM-Benchmarks/blob/master...
the-stack_106_24668
# Copyright 2017, 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...
the-stack_106_24672
#!/usr/bin/env python3 """ Writes out the source and include files needed for AutoTools. This script will update the collected_files.md file. """ import os from typing import Iterable, Sequence, Tuple import re BANNER = "# This file was automatically generated by scripts/update_sources.py" VENDOR_SOURCES = ( ...
the-stack_106_24673
#@+leo-ver=5-thin #@+node:ekr.20031218072017.3439: * @file leoPlugins.py """Classes relating to Leo's plugin architecture.""" import sys from typing import List from leo.core import leoGlobals as g # Define modules that may be enabled by default # but that mignt not load because imports may fail. optional_modules = [ ...
the-stack_106_24674
#!/usr/bin/env python # -*- coding: utf-8 -*- import copy import argparse import cv2 as cv import numpy as np import mediapipe as mp from utils import CvFpsCalc def get_args(): parser = argparse.ArgumentParser() parser.add_argument("--device", type=int, default=0) parser.add_argument("--width", help='c...
the-stack_106_24675
# Chopsticks from dataclasses import dataclass from typing import Tuple, Generator from rl_games.core.game import Game, PlayerIndex MAX_ROUNDS = 100 FingerCount = int HandIndex = int PlayerState = Tuple[FingerCount, ...] @dataclass(frozen=True) class ChopsticksState: finger_counts: Tuple[PlayerState, ...] = ()...
the-stack_106_24677
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
the-stack_106_24678
from opencmiss.zinc.field import Field from opencmiss.zinc.graphics import Graphics from opencmiss.zinc.glyph import Glyph from opencmiss.zinc.material import Material from opencmiss.zinc.node import Node from opencmiss.zinc.streamregion import StreaminformationRegion from opencmiss.utils.zinc import create_finite_elem...
the-stack_106_24681
#!/usr/bin/env python """The setup script.""" from setuptools import setup, find_packages with open('README.rst') as readme_file: readme = readme_file.read() with open('docs/HISTORY.rst') as history_file: history = history_file.read() with open('requirements.txt') as req: requirements = req.read() se...
the-stack_106_24682
""" This part of the flask app responds to api requests """ from flask import Blueprint, jsonify, request from remote_camera.camera import CameraReader from io import BytesIO import base64 bp = Blueprint("api", __name__, url_prefix="/api/v1.0/") @bp.route("/get_image", defaults={'width': None, 'height': None}) @bp.r...
the-stack_106_24683
from django.conf import settings from django.forms.renderers import TemplatesSetting from django.contrib.gis.forms import widgets class LeafletPointWidget(widgets.BaseGeometryWidget): template_name = 'leaflet/point_widget.html' def render(self, name, value, attrs=None, renderer=None): # add point ...
the-stack_106_24684
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf import ray from ray.rllib.dqn import models from ray.rllib.dqn.common.wrappers import wrap_dqn from ray.rllib.dqn.common.schedules import LinearSchedule from ray.rlli...
the-stack_106_24686
from django.urls import path from .views import PostListView, PostDetailView, PostCreateView, PostUpdateView, PostDeleteView from . import views urlpatterns = [ path('', PostListView.as_view(), name='blog-home'), path('post/<int:pk>/', PostDetailView.as_view(), name='post-detail'), path('post/new/', Post...
the-stack_106_24692
# Bench mark function 12 # Generalized Penalized Function No.01 # HW dimension: 30 # Min = 0 # Range [-50,50] # Reference: https://al-roomi.org/benchmarks/unconstrained/n-dimensions/172-generalized-penalized-function-no-1 import math import numpy as np name = "F12" l_bound = -50 u_bound = 50 dim = 30 opt = 0 def u(u...
the-stack_106_24693
import io import setuptools with io.open('README.rst', 'r') as readme: try: long_description = readme.read() except IOError: long_description = '' setup_params = dict( author='Alex Malykh', author_email='a2m.dev@yandex.ru', name='cmsplugin-css-background', use_scm_version=di...
the-stack_106_24694
import os from src.loaders.depth_image.CameraConfig import CameraConfig from src.loaders.depth_image.CameraIntrinsics import CameraIntrinsics from src.loaders.depth_image.ImageLoader import ImageLoader class TumLoader(ImageLoader): def __init__(self, path): super().__init__(path) def _provide_config...
the-stack_106_24695
# # 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...
the-stack_106_24696
import functools from typing import Callable __all__ = ('Achievement',) class Achievement: """A class to represent a single osu! achievement.""" __slots__ = ('id', 'file', 'name', 'desc', 'cond') def __init__(self, id: int, file: str, name: str, desc: str, cond: Callable) -> None: ...
the-stack_106_24698
"""Support for Iperf3 network measurement tool.""" from __future__ import annotations from datetime import timedelta import logging import iperf3 import voluptuous as vol from homeassistant.components.sensor import ( DOMAIN as SENSOR_DOMAIN, SensorEntityDescription, ) from homeassistant.const import ( CO...
the-stack_106_24700
import pandas as pd TITLE_NAME = "Wrong data" SOURCE_NAME = "wrong_data" LABELS = ["Scout", "Team", "Match", "Alliance", "Double outtakes", "Wrong auto line", "Wrong climb"] def get_rows(manager): tracked_data_types = ['Tele intake', ...
the-stack_106_24701
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749 ~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for consuming OAuth 2.0 RFC6749. """ import time import warnings from oauthlib.common import generate_token from oauthlib.oauth2.rfc6749 import tokens from oauthlib.oauth2.rfc6749.error...
the-stack_106_24702
# TG-UserBot - A modular Telegram UserBot script for Python. # Copyright (C) 2019 Kandarp <https://github.com/kandnub> # # TG-UserBot 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 Li...
the-stack_106_24703
def insertionSort(lista): #Para cada elemento de la lista la rrecoremos hasta encontrar su posición donde es mayor que (i-1) y menor que (i+1) for i in range(1,len(lista)): lugar = i valor = lista[i] while lugar>0 and lista[lugar-1]>valor: lista[lugar]=lista[lugar-1] lugar = lugar...
the-stack_106_24704
import unittest import itertools import numpy from six import moves import chainer from chainer.backends import cuda from chainer import initializers from chainer import links from chainer import testing from chainer.testing import attr @testing.parameterize(*testing.product({ 'dtype': [numpy.float16, numpy.flo...
the-stack_106_24706
import logging import requests from django.http import Http404, HttpResponse, HttpResponseBadRequest, HttpResponseForbidden, JsonResponse from django.shortcuts import get_object_or_404 from django.urls import reverse from django.utils.cache import patch_response_headers from django.views.generic import View from gis...
the-stack_106_24707
import dragonfly as df from srabuilder import rules import title_menu, menu_utils, server, df_utils, game, container_menu, objective, server, constants CARPENTER_MENU = 'carpenterMenu' async def get_carpenter_menu(): return await menu_utils.get_active_menu(CARPENTER_MENU) async def click_button(name): menu =...
the-stack_106_24711
""" This file is part of the Semantic Quality Benchmark for Word Embeddings Tool in Python (SeaQuBe). Copyright (c) 2021 by Benjamin Manns :author: Benjamin Manns """ import time from os.path import join, basename, dirname import unittest from seaqube.benchmark.corpus4ir import WordCentroidSimilarityBenchma...
the-stack_106_24712
from flask import request, make_response, jsonify from cerberus import Validator from core.transactions import Transaction from lib.request import is_json from lib.db import session from .. import blueprint @blueprint.route('/', methods=['GET']) def get_transactions(): delivered = request.args.get('delivered'...
the-stack_106_24713
# 3p import rediscluster import wrapt # project from ...pin import Pin from ...ext import AppTypes, redis as redisx from ...utils.wrappers import unwrap from ..redis.patch import traced_execute_command, traced_pipeline from ..redis.util import format_command_args def patch(): """Patch the instrumented methods ...
the-stack_106_24715
import os import math from affine import Affine import pytest import numpy as np from distancerasters import DistanceRaster from distancerasters.utils import calc_haversine_distance @pytest.fixture def example_raster_array(): arr = [[0, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]] return np.array(arr) ...
the-stack_106_24717
from __future__ import division from pylab import * from mandelbulb import mandelbulb, pow3d, biaxial_julia, pow_quaternion_inplace, buddhabulb from shapes import tetrahedron, cube, merkaba from util import generate_mesh_slices, threaded_anti_alias from density import illuminate_and_absorb import numpy as np from threa...
the-stack_106_24719
# -*- coding: utf-8 -*- """ Created on Sun Jun 23 16:07:41 2019 @author: idswx """ import numpy as np class attackerConstraint: """ Create a class of attacker with constraint """ def __init__(self, i, j, d, m, n): """ Arguements: (i,j) - attacker is at location (i,...
the-stack_106_24720
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import os.path import socket from urllib3.poolmanager import PoolManager, proxy_from_url from urllib3.util import parse_url from urllib3.util import ...
the-stack_106_24723
# Copyright 2020 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...
the-stack_106_24724
"""Fourier Series""" from __future__ import print_function, division from sympy import pi, oo, Wild, Basic from sympy.core.expr import Expr from sympy.core.add import Add from sympy.core.compatibility import is_sequence from sympy.core.containers import Tuple from sympy.core.singleton import S from sympy.core.symbol ...
the-stack_106_24725
__author__ = 'sxjscience' import numpy import time import theano import logging import theano.tensor as TT from sparnn.utils import * from sparnn.optimizers import Optimizer logger = logging.getLogger(__name__) class AdaGrad(Optimizer): """ Duchi, J., Hazan, E., & Singer, Y. "Adaptive subgradient methods ...
the-stack_106_24727
""" Created on Apr 10, 2017 @author: lubo """ import os import matplotlib as mpl import numpy as np from dae.pheno.pheno_db import Measure import matplotlib.pyplot as plt from dae.pheno_browser.db import DbManager from dae.pheno.common import Role, MeasureType from dae.pheno_browser.graphs import draw_linregres f...
the-stack_106_24731
from .job import CronJob from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor import asyncio import subprocess import logging logger = logging.getLogger(__package__) class JobLoader: def __init__(self, name=None, loop=None, log_path=None, ...
the-stack_106_24733
""" Machine arithmetics - determine the parameters of the floating-point arithmetic system Author: Pearu Peterson, September 2003 """ __all__ = ['MachAr'] from numpy.core.fromnumeric import any from numpy.core._ufunc_config import errstate from numpy.core.overrides import set_module # Need to speed this up...especi...
the-stack_106_24734
import feedparser import datetime from django_yaba.models import * from django.conf import settings from django import template register = template.Library() def parse_github(): if settings.GITHUB_USERNAME: """ Grab latest commits from GitHub """ d = feedparser.parse("http://github.com/%s.atom" % ...
the-stack_106_24736
''' @author: l4zyc0d3r People who are happy makes other happy. I am gonna finish it slowly but definitely.cdt ''' #O(V+E) class Solution: def canFinish(self, N: int, P: List[List[int]]) -> bool: mp = collections.defaultdict(list) mp_pre = collections.defaultdict(list) for c, p in P: ...
the-stack_106_24737
# coding: utf-8 # Copyright (c) Tingzheng Hou. # Distributed under the terms of the MIT License. """ This module calculates species correlation lifetime (residence time). """ from typing import List, Dict, Union, Tuple import numpy as np import matplotlib.pyplot as plt from statsmodels.tsa.stattools import acovf from...
the-stack_106_24740
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) # noinspection PyUnresolvedReferences,PyCompatibility from builtins import * import cProfile import pprint import bag from bag.layout import RoutingGrid, TemplateDB #from adc_sar.sample...
the-stack_106_24742
#!python3 # -*- coding: utf-8 -*- ''' @name: life @author: Memory&Xinxin @date: 2018/11/19 @document: {"F11": 全屏, "空格": 暂停游戏, "点击": 复活或者杀死一个生命 } ''' import pygame from mxgames import game from random import randint ROWS = 50 SCREEN_SIZE = (500, 500) ...
the-stack_106_24745
print("Qual base de conversão você quer escolher?") n = int(input("Digite um número: ")) print("""Escolha uma das bases para conversão: [1] converter em binário [2] converter em octal [3] converter em hexadécimal""") escolha = int(input("Escolha sua opção: ")) if escolha == 1: print("{} convertido para binário é ...
the-stack_106_24748
""" @author: Maziar Raissi """ from Multistep_NN import Multistep_NN import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from plotting import newfig, savefig import matplotlib.gridspec as gridspec def colorline3d(ax, x, y, z, cmap): N = ...
the-stack_106_24750
# -*- coding: utf-8 -*- from __future__ import unicode_literals app_name = "kanban" app_title = "Kanban" app_publisher = "Alec Ruiz-Ramon" app_description = "Kanban views for ERPNext" app_icon = "octicon octicon-file-directory" app_color = "grey" app_email = "alec.ruizramon@me.com" app_version = "0.0.1" app_license = ...
the-stack_106_24751
import statistics import time from problog.engine import DefaultEngine from refactor.back_end_picking import get_back_end_default, QueryBackEnd from refactor.tilde_essentials.tree import DecisionTree from refactor.tilde_essentials.tree_builder import TreeBuilder from refactor.query_testing_back_end.django.clause_hand...
the-stack_106_24752
import vtk from array import * import numpy import os # todo range the folder to get the file name gridnum = 15 massR = 4 massOrigin = [6,0,6] initVlue = 1.5 targetValue = 7.5 # detect the value at iteration timestep 41 # interested event # i 6 7 8 9 # j 0 1 2 3 # k 6 7 8 9 rootDir = "./image" # refer to http...
the-stack_106_24753
import FWCore.ParameterSet.Config as cms from Configuration.Eras.Modifier_tracker_apv_vfp30_2016_cff import tracker_apv_vfp30_2016 as _tracker_apv_vfp30_2016 import RecoTracker.IterativeTracking.iterativeTkConfig as _cfg from Configuration.Eras.Modifier_fastSim_cff import fastSim # NEW CLUSTERS (remove previously used...
the-stack_106_24754
#!/usr/bin/env python3 """ Author : fpjrh <fjansen@redhat.com> Date : 2021-11-29 Purpose: Welcome the world to this wonder """ import argparse # -------------------------------------------------- def get_args(): """Get command-line arguments""" parser = argparse.ArgumentParser( description='Say he...
the-stack_106_24757
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2015-2016 Rapptz 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 without limitation the rights to u...
the-stack_106_24758
from selenium import webdriver from bs4 import BeautifulSoup import ipdb import pandas as pd import string from time import sleep def driver_init(): options = webdriver.ChromeOptions() options.add_argument('--ignore-certificate-errors') options.add_argument('--incognito') options.add_argument('--headle...
the-stack_106_24760
import _plotly_utils.basevalidators class DashValidator(_plotly_utils.basevalidators.StringValidator): def __init__(self, plotly_name="dash", parent_name="scattersmith.line", **kwargs): super(DashValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
the-stack_106_24761
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
the-stack_106_24766
from pathlib import ( Path ) from tempfile import ( gettempdir, ) import pytest from web3.providers.ipc import ( IPCProvider, ) from web3.providers.rpc import ( HTTPProvider, ) from populus.config.web3 import Web3Config def test_provider_property_when_not_set(): web3_config = Web3Config() ...
the-stack_106_24768
# -*- coding: utf-8 -*- # # Copyright 2021 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
the-stack_106_24770
# -*- coding: utf-8 -*- # # Copyright 2017 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 ...
the-stack_106_24771
from __future__ import absolute_import, print_function import collections import logging import six from django.conf import settings from django.db import transaction from django.utils.encoding import force_text from sentry.utils import json from sentry.utils.strings import truncatechars def safe_execute(func, *ar...
the-stack_106_24772
# 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 ...
the-stack_106_24773
# coding: utf-8 from django import forms from django.forms.models import modelform_factory from wagtail.images.edit_handlers import AdminImageChooser def get_embed_video_form(model): if hasattr(model, 'admin_form_fields'): fields = model.admin_form_fields else: fields = '__all__' return...