filename
stringlengths
13
19
text
stringlengths
134
1.04M
the-stack_106_23214
#!/usr/bin/env python # encoding: utf8 # # Copyright © Burak Arslan <burak at arskom dot com dot tr>, # Arskom Ltd. http://www.arskom.com.tr # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
the-stack_106_23216
from django.conf.urls import url from django.urls import path, include, re_path from posts.views import post_create,post_detail,post_list,post_update,post_delete urlpatterns = [ re_path(r'^$',post_list,name='list'), re_path(r'^create/$',post_create), re_path(r'^(?P<slug>[\w-]+)/$',post_detail,name='detail...
the-stack_106_23217
#Make a shot map and a pass map using Statsbomb data #Set match id in match_id_required. #Function to draw the pitch import matplotlib.pyplot as plt import numpy as np #Size of the pitch in yards (!!!) pitchLengthX=120 pitchWidthY=80 #ID for England vs Sweden Womens World Cup match_id_required = 69301 h...
the-stack_106_23218
# -*- coding: utf-8 -*- from datetime import datetime, time import warnings import numpy as np from pytz import utc from pandas._libs import lib, tslib from pandas._libs.tslib import Timestamp, NaT, iNaT from pandas._libs.tslibs import ( normalize_date, conversion, fields, timezones, resolution as libreso...
the-stack_106_23219
from adafruit_circuitplayground.express import cpx # Set to check for single-taps. cpx.detect_taps = 1 tap_count = 0 # We're looking for 2 single-taps before moving on. while tap_count < 2: if cpx.tapped: print("Single-tap!") tap_count += 1 print("Reached 2 single-taps!") # Now switch to checking...
the-stack_106_23220
import re def assign(service,arg): if service == 'cmseasy': return True,arg def audit(arg): url = arg + '/celive/live/header.php' payload = ("xajax=LiveMessage&xajaxargs[0]=<xjxobj><q><e><k>name</k><v>%27," "(UpdateXML(1,CONCAT(0x5b,mid((SELECT/**/GROUP_CONCAT(md5(1))),1,32),0x...
the-stack_106_23224
# model settings model = dict( type='FastRCNN', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), norm_eval=True, style='pytorch', init...
the-stack_106_23225
import csv import os voter = 0 khan = 0 correy = 0 li = 0 OTooley = 0 # read csv file with open('Resources/election_data.csv', newline='', encoding="utf-8") as FreeBritney: # Create variable to store contents of budget_data.csv Free = csv.reader(FreeBritney, delimiter = ',') # Start the second row ...
the-stack_106_23227
#!/usr/bin/python """ The goal of Artificial Intelligence is to create a rational agent (Artificial Intelligence 1.1.4). An agent gets input from the environment through sensors and acts on the environment with actuators. In this challenge, you will program a simple bot to perform the correct actions based on environme...
the-stack_106_23230
def notas(*notas, sit=False): """ -> Função para analisar notas e situações de vários alunos. :param *notas: uma ou mais notas dos alunos :param sit: valor opcional, indicando se deve ou não adicionar a situação :return: dicionário com várias informações sobre a situação da turma """ d = {'...
the-stack_106_23231
from __future__ import print_function, absolute_import from collections import defaultdict from six.moves import range from six import iteritems from h5Nastran.defaults import Defaults from h5Nastran.h5nastrannode import H5NastranNode from .input_table import InputTable, TableDef class Dynamic(H5NastranNode): ...
the-stack_106_23232
#!/usr/local/env python3 __author__ = 'duceppemo' __version__ = '0.1' """ https://www.biostars.org/p/97409/ """ from ete3 import Tree from argparse import ArgumentParser class TreeCollapser(object): def __init__(self, args): # Arguments self.input_tree = args.input self.output_tree = ...
the-stack_106_23233
import random from flask import Flask from flask_restful import Api, Resource from flask_rest_paginate import Pagination from marshmallow import Schema, fields """ Initialize the app """ app = Flask(__name__) api = Api(app) # Possible configurations for Paginate # app.config['PAGINATE_PAGE_SIZE'] = 20 # app.config['P...
the-stack_106_23234
# -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab # pylint: disable=invalid-name """ csv2ofx.mappings.stripe ~~~~~~~~~~~~~~~~~~~~~~~~ Provides a mapping for transactions obtained via Stripe card processing Note that Stripe provides a Default set of columns or you can download All columns. (as well as custom). The De...
the-stack_106_23235
import pandas as pd def _filter_variant_motif_res( motif_res, variant_start, variant_end, motif_length, seq, ): """ Remove MOODS motif hits that don't overlap the variant of interest. Parameters ---------- motif_res : list Result from MOODS search like [(21, 3.9...
the-stack_106_23236
import time import asyncio import contextlib from appyter.ext.asyncio import helpers from appyter.ext.itertools import alist import logging logger = logging.getLogger(__name__) import pytest from appyter.ext.pytest import assert_eq, assert_exc from appyter.ext.asyncio.event_loop import with_event_loop @pytest.fixtur...
the-stack_106_23237
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
the-stack_106_23239
import numpy as np import matplotlib.pylab as plt import cv2 from skimage.metrics import structural_similarity as ssim from skimage.metrics import peak_signal_noise_ratio as psnr import os from os.path import join as opj from os.path import dirname as opd from tqdm import tqdm def plot(img,title="",savename=""...
the-stack_106_23241
# Copyright (c) 2018-2019, 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 copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
the-stack_106_23243
# -*- coding: utf-8 -*- # Copyright 2018 IBM. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
the-stack_106_23244
#cpu time 0.03s all_times = [] while True: i = input() if i == '0': # let's end with the final output for hour, minute, ampm in all_times[:-1]: # for every time in all times, except the last hour = hour[0].replace('0', '12') if len(hour) == 1 else hour prin...
the-stack_106_23245
from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'), path('add/', views.add, name='add'), path('update/', views.update, name='update'), path('delete/', views.delete, name='delete'), ]
the-stack_106_23246
# Only used for PyTorch open source BUCK build CXX = "Default" ANDROID = "Android" APPLE = "Apple" FBCODE = "Fbcode" WINDOWS = "Windows" UNIFIED = "Unified" # Apple SDK Definitions IOS = "ios" WATCHOS = "watchos" MACOSX = "macosx" APPLETVOS = "appletvos" xplat_platforms = struct( ANDROID = ANDROID, A...
the-stack_106_23248
import sys sys.path.append('../../configs') sys.path.append('../../utils') sys.path.append('../../tfops') # ../../configs from info import ACTIVATE_K_SET_IMGNET # ../../utils from datasetmanager import DATASETMANAGER_DICT from format_op import params2id, listformat from shutil_op import remove_file, remove_dir, copy_...
the-stack_106_23249
import time from PyQt4.QtGui import * from PyQt4.QtCore import * from electrum_twist_gui.qt.util import * from electrum_twist_gui.qt.amountedit import AmountEdit from electrum_twist.twist import COIN from electrum_twist.i18n import _ from decimal import Decimal from functools import partial from electrum_twist.plugin...
the-stack_106_23250
from dataclasses import dataclass, field from kikit.sexpr import Atom, parseSexprF from itertools import islice import os from typing import Optional @dataclass class Symbol: uuid: Optional[str] = None path: Optional[str] = None unit: Optional[int] = None lib_id: Optional[str] = None in_bom: Option...
the-stack_106_23253
""" Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. Example 1: Input: nums = [2,7,11,15], ta...
the-stack_106_23254
""" Creating prime sieve (optimized version). .. module:: sieve_of_eratosthenes_optimized :platform: Unix, Windows :synopis: creating prime sieve .. moduleauthor:: Thomas Lehmann <thomas.lehmann.private@googlemail.com> ======= License ======= Copyright (c) 2015 Thomas Lehmann Permission is...
the-stack_106_23255
# coding=utf8 """ meetbot.py - Willie meeting logger module Copyright © 2012, Elad Alfassa, <elad@fedoraproject.org> Licensed under the Eiffel Forum License 2. This module is an attempt to implement at least some of the functionallity of Debian's meetbot """ from __future__ import unicode_literals import time import o...
the-stack_106_23256
import datetime import shutil from dataclasses import dataclass from pathlib import Path from subprocess import check_output from typing import Callable, Tuple import pytest from cryptography import x509 from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes from cry...
the-stack_106_23257
import re, math class Int(int): # def __repr__(self): # return hex(self) def __str__(self): return hex(self) def __add__(self, other): return Int(super().__add__(other)) def __sub__(self, other): return Int(super().__sub__(other)) def __lshift__(self, other): ...
the-stack_106_23259
from hyperopt import Trials, STATUS_OK, tpe from hyperas import optim from hyperas.distributions import choice, uniform import os, sys import numpy as np from sklearn.utils import class_weight import tensorflow as tf from keras.backend.tensorflow_backend import set_session from keras.utils import to_categorical from k...
the-stack_106_23261
# 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...
the-stack_106_23266
from point import Point import socket import json class Connection: """A simple TCP wrapper class that acts a client OR server with similar methods regardless of which it is connected as """ def __init__(self, port, host=None): """Creates a connection, basically a simple TCP client/server wrap...
the-stack_106_23268
""" picasso.simulate-gui ~~~~~~~~~~~~~~~~ GUI for Simulate : Simulate single molcule fluorescence data :author: Maximilian Thomas Strauss, 2016 :copyright: Copyright (c) 2016 Jungmann Lab, MPI of Biochemistry """ import csv import glob as _glob import os import sys import time import yaml i...
the-stack_106_23269
# Copyright 2013 OpenStack Foundation # 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 requ...
the-stack_106_23270
from collections import deque import logging import time import socket import hashlib import requests import pdpyras import yaml LOG = logging.getLogger(__name__) hostname = socket.getfqdn() class Check(object): def __init__(self, url, pd_api_key, **kwargs): self.url = url self.pd_api_key = ...
the-stack_106_23273
# Copyright 2019 The TensorFlow Authors, Pavel Yakubovskiy. 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 ...
the-stack_106_23274
# Copyright 2021 Northern.tech AS # # 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 ag...
the-stack_106_23277
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. import os import sys from distutils import dist from distutils.ccompiler import get_default_compiler from distutils.command.config import ...
the-stack_106_23278
# class to handle scorecard from turtle import Turtle class Scoreboard(Turtle): def __init__(self): super().__init__() self.score = 0 self.high_score = 0 self.get_high_score() self.color("white") self.penup() self.update_score() self.hideturtle() #...
the-stack_106_23279
from .base_options import BaseOptionsTest class TestOptions(BaseOptionsTest): def initialize(self, parser): parser = BaseOptionsTest.initialize(self, parser) parser.add_argument('--ntest', type=int, default=float("inf"), help='# of test examples.') parser.add_argument('--results_dir', type...
the-stack_106_23280
"""Project views for authenticated users.""" import logging from allauth.socialaccount.models import SocialAccount from celery import chain from django.contrib import messages from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.http import ( Http404, ...
the-stack_106_23285
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve. # #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_23288
from threading import Thread, Event import os, datetime, uuid, time, math, ast from typing import List, Dict from alphaz.models.database.structure import AlphaDatabase from alphaz.models.main import AlphaClass, AlphaTransaction from ..libs import transactions_lib from core import core LOG = core.get_logger('request...
the-stack_106_23290
class Solution: def isMatch(self, s: str, p: str) -> bool: dp = [[False for _ in range(len(s) + 1)] for _ in range(len(p) + 1)] dp[0][0] = True for i in range(1,len(p)+1): if p[i-1] == '*': dp[i][0] = dp[i-2][0] for i in range(1, len(p) + 1): ...
the-stack_106_23292
import logging import numpy as np import torch from rdkit import Chem from rdkit import RDLogger from rdkit.Chem.Scaffolds import MurckoScaffold from federatedscope.core.splitters.utils import dirichlet_distribution_noniid_slice from federatedscope.core.splitters.graph.scaffold_splitter import generate_scaffold logge...
the-stack_106_23293
""" Contains functions that handles command line parsing logic. """ import argparse def create_parser(): """ Creates a command line parser. There are four arguments allowed for this parser: (1) the dns server ip (required) (2) the domain name to be resolved (resolved) (3) a verbose option, ...
the-stack_106_23294
# Copyright 2020 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 required by applicable law or a...
the-stack_106_23296
# Loss functions import torch import torch.nn as nn from ..utils.general import bbox_iou from ..utils.torch_utils import is_parallel def smooth_BCE(eps=0.1): # https://github.com/ultralytics/yolov3/issues/238#issuecomment-598028441 # return positive, negative label smoothing BCE targets return 1.0 - 0.5 * ...
the-stack_106_23298
# -*- coding: UTF-8 -*- import os import numpy as np from migrate_db import People, db, app uuid = '28DDU17531000102' embedding_basedir = '/home/actiontec/PycharmProjects/DeepLearning/FaceRecognition/facenet/src/faces/' \ 'ae64c98bdff9b674fb5dad4b/front/face_embedding' url = '' style = 'front' gro...
the-stack_106_23299
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
the-stack_106_23303
""" @Version: 1.0 @Project: BeautyReport @Author: Raymond @Data: 2017/11/15 下午5:28 @File: __init__.py.py @License: MIT """ import os import sys from io import StringIO as StringIO import time import json import unittest import platform import base64 from distutils.sysconfig import get_python_lib import traceback from ...
the-stack_106_23305
import os import threading import time import sys, getopt def client(i,results,loopTimes): print("client %d start" %i) command = "./single-cold_warm.sh -R -t " + str(loopTimes) r = os.popen(command) text = r.read() results[i] = text print("client %d finished" %i) def warmup(i,warmupTimes,a...
the-stack_106_23307
#!/usr/bin/env python3 # Copyright (c) 2013-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Generate seeds.txt from Pieter's DNS seeder # NSEEDS=512 MAX_SEEDS_PER_ASN=2 MIN_BLOCKS = 615801 #...
the-stack_106_23309
# coding: utf-8 # General Modules # import os, shutil # import re, string import os import re import math import numpy as np import pandas as pd import datetime as dt import copy import scipy.constants as sc # natural constants def read_calibration_files( photopic_response_path, pd_respon...
the-stack_106_23310
import argparse import sys from virtual_coach_db.dbschema.models import Users from virtual_coach_db.helper.helper import get_db_session from niceday_client import NicedayClient, TrackerStatus from niceday_client.definitions import Tracker def enable_custom_trackers(userid: int): """ Enable custom trackers fo...
the-stack_106_23311
# -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick and Sean Bell # -------------------------------------------------------- # ------------------------------------------------------...
the-stack_106_23313
#!/usr/bin/env python3.8 # Copyright 2021 The Fuchsia Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import unittest import tempfile from depfile import DepFile class DepFileTests(unittest.TestCase): """Validate the d...
the-stack_106_23314
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012, Nachi Ueno, NTT MCL, Inc. # 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://ww...
the-stack_106_23315
import matplotlib as mpl mpl.use('agg') import sys import glob import numpy as np import argparse from time import time import tensorflow as tf from os.path import isfile sys.path.insert(0,'../../unet/tf_unet') import pylab as plt from sklearn.metrics import matthews_corrcoef from mydataprovider imp...
the-stack_106_23316
"""Test Home Assistant logging util methods.""" import asyncio import logging import queue import pytest import homeassistant.util.logging as logging_util from tests.async_mock import patch def test_sensitive_data_filter(): """Test the logging sensitive data filter.""" log_filter = logging_util.HideSensiti...
the-stack_106_23318
# -*- coding: utf-8 -*- import warnings from datetime import datetime import time import numpy as np import pandas as pd from numpy.linalg import LinAlgError from scipy.integrate import trapz from lifelines.fitters import BaseFitter from lifelines.utils import ( _get_index, inv_normal_cdf, epanechnikov_...
the-stack_106_23319
#!/usr/bin/env python3 import copy import nose.tools as nose from cachesimulator.cache import Cache class TestSetBlock(object): """set_block should behave correctly in all cases""" def reset(self): self.cache = Cache({ '010': [ {'tag': '1000'}, {'tag': '...
the-stack_106_23320
import torch import torch.nn as nn # OPS is a set of layers with same input/output channel. OPS = { 'none': lambda C, stride, affine: Zero(stride), 'avg_pool_3x3': lambda C, stride, affine: nn.AvgPool2d(3, stride=stride, padding=1, count_include_pad=False), 'max_pool_3x3': lambda C, stride,...
the-stack_106_23322
""" cluster_toolkit is a module for computing galaxy cluster models. """ import cffi import glob import os import numpy as np __author__ = "Tom McClintock <mcclintock@bnl.gov>" cluster_toolkit_dir = os.path.dirname(__file__) include_dir = os.path.join(cluster_toolkit_dir,'include') lib_file = os.path.join(cluster_to...
the-stack_106_23323
import re class Star: def __init__(self, x, y, dx, dy): # print(x, y, dx, dy) self.x = int(x) self.y = int(y) self.dx = int(dx) self.dy = int(dy) def step(self): self.x += self.dx self.y += self.dy def __repr__(self): return 'x={} y={}'.for...
the-stack_106_23324
import numpy as np import tensorflow as tf from tensorflow.contrib import rnn import random import collections import time from tensorflow.python.ops import array_ops from tensorflow.contrib.rnn.python.ops import rnn_cell from tensorflow.python.ops import variable_scope from tensorflow.python.ops import init_ops from t...
the-stack_106_23325
from typing import Optional, Tuple, Union from fibo.consensus.pot_iterations import calculate_ip_iters, calculate_iterations_quality, calculate_sp_iters from fibo.types.blockchain_format.reward_chain_block import RewardChainBlock, RewardChainBlockUnfinished from fibo.types.blockchain_format.sized_bytes import bytes32 ...
the-stack_106_23326
from typing import Tuple, List class O_equationset: """ the equationset as given by equation (4) defined by different non-negative integers """ def __init__(self, l: int, W: int, a_i: List[int], b_i: List[int]): self.l = l self.W = W self.a_i = a_i self.b_i = b_i ...
the-stack_106_23330
# 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 agreed to in writing, ...
the-stack_106_23333
from __future__ import absolute_import, division, print_function, unicode_literals import socket import matplotlib import numpy as np import os import collections import argparse machine = socket.gethostname() if machine == "bsccv03": matplotlib.use('wxagg') elif 'login' in machine: matplotlib.use('TkAgg') impo...
the-stack_106_23334
# -*- coding:utf-8 -*- import os import random import math import numpy as np import torch class GenDataIter(object): """ Toy data iter to load digits""" def __init__(self, data_file, batch_size): super(GenDataIter, self).__init__() self.batch_size = batch_size self.data_lis = self.rea...
the-stack_106_23335
# 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_23336
import pandas as pd import numpy as np # import matplotlib.pyplot as plt from collections import defaultdict from sklearn import preprocessing from scipy import sparse from operator import itemgetter # from scipy.spatial.distance import cosine import pickle # import seaborn from sklearn.neighbors import NearestNeighbor...
the-stack_106_23339
"""Block-level tokenizer.""" import logging from typing import List, Optional, Tuple from .ruler import Ruler from .token import Token from .rules_block.state_block import StateBlock from . import rules_block LOGGER = logging.getLogger(__name__) _rules: List[Tuple] = [ # First 2 params - rule name & source. Sec...
the-stack_106_23340
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import sys import math import shutil import time import argparse import pprint import random as pyrandom import logging import numpy as np import torch import torch.nn as nn import torch.nn.function...
the-stack_106_23341
# Copyright 2021, 2022 IBM Corporation # # 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 ...
the-stack_106_23343
#Faça um programa que leia 5 números e informe a soma e a média dos números. soma=0 media=0 contador=0 for i in range(5): n=float(input("digite o número: ")) soma=soma+n contador=contador+1 media=(soma)/contador print('A soma é:', soma) print("A média é:", media)
the-stack_106_23345
""" Support for Honeywell Round Connected and Honeywell Evohome thermostats. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.honeywell/ """ import logging import socket import datetime import requests import voluptuous as vol import homeassistan...
the-stack_106_23346
#!/bin/python3 """ Copyright kubeinit contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
the-stack_106_23347
# Copyright 2018 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_23349
r""" Cavity solvation in different states of HCN4 ============================================ In selective sodium/potassium channels, the internal cavity of the pore is walled off from the solvent if the channel is closed. Upon activation, the internal gate opens and exchange of water molecules between the cavity and...
the-stack_106_23350
"""Utility functions and classes used within the `yapapi.executor` package.""" import asyncio import logging from typing import Callable, Optional logger = logging.getLogger(__name__) class AsyncWrapper: """Wraps a given callable to provide asynchronous calls. Example usage: with AsyncWrapper(func) ...
the-stack_106_23354
"""Session object for building, serializing, sending, and receiving messages in IPython. The Session object supports serialization, HMAC signatures, and metadata on messages. Also defined here are utilities for working with Sessions: * A SessionFactory to be used as a base class for configurables that work with Sessio...
the-stack_106_23355
# -*- coding: utf-8 -*- ### # (C) Copyright (2012-2019) Hewlett Packard Enterprise Development LP # # 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 limi...
the-stack_106_23356
import sys import zlib if sys.version >= '2.7': from io import BytesIO as StringIO else: from cStringIO import StringIO try: from hashlib import md5 except ImportError: from md5 import md5 from nose.tools import eq_, ok_, assert_raises from webob import BaseRequest, Request, Response def simple_app(e...
the-stack_106_23357
# Copyright 2016 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
the-stack_106_23361
# 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...
the-stack_106_23364
import os, sublime, sublime_plugin, subprocess, json, re FILE_REGEX = '^(..[^:\n]*):([0-9]+):?([0-9]+)?:? (.*)' SYNTAX = 'Packages/Makefile/Make Output.sublime-syntax' WORKING_DIR = '${folder:${project_path:${file_path}}}' CANNED = { 'target': 'make_targets', 'file_regex': FILE_REGEX, 'working_dir': WORKING_D...
the-stack_106_23365
# Copyright 2020 QuantStack # Distributed under the terms of the Modified BSD License. from sqlalchemy.orm import Session, joinedload, aliased from .db_models import Profile, User, Channel, ChannelMember, Package, PackageMember, ApiKey, \ PackageVersion from quetz import rest_models import uuid class Dao: d...
the-stack_106_23366
import numpy as np import logging class MyRand(object): ''' Class that provides the function random() which returns a 'random number' in the open(!) interval (0,1). The class has been created for TESTING and DEVELOPMENT purposes and PRODUCES THE SAME SEQUENCE of 'random numbers' for a given seed < ...
the-stack_106_23368
from prometheus_api_client import PrometheusConnect, MetricsList from prometheus_api_client.utils import parse_datetime import pandas as pd import os import time import logging from kubernetes import config, client from scipy.stats import norm import numpy as np import subprocess import copy from pynvml import * import...
the-stack_106_23369
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator import os import sys OUT_CPP="qt/moselbitstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' fo...
the-stack_106_23371
""" Datadog exporter """ from setuptools import find_packages, setup dependencies = ['boto3', 'click', 'pytz', 'durations', 'tzlocal', 'datadog', 'requests', 'python-dateutil'] from os import path this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), encoding='utf-8')...
the-stack_106_23372
#!/bin/env python import sys import boto3 from botocore.exceptions import ClientError # To get a list of the AWS regions we have access to: ec2 = boto3.client('ec2') aws_regions = ec2.describe_regions() print ('\nRegions we have access to:\n') for region in aws_regions['Regions']: region_name = region['Region...
the-stack_106_23373
import json import logging from django.conf import settings from django.core.exceptions import ValidationError from django.db import models from django.urls import reverse from django.utils.encoding import force_text from django.utils.translation import ugettext_lazy as _ from mayan.apps.acls.models import AccessCont...
the-stack_106_23375
class LogicB(object): def __init__(self, device_instance): self.di = device_instance def update_status(self): """ """ if not len(self.di._hourly_prices): # no hourly prices have been calculated return # update the charge on the device self...
the-stack_106_23376
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
the-stack_106_23379
#!/usr/bin/python # (c) 2018, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...