filename
stringlengths
13
19
text
stringlengths
134
1.04M
the-stack_106_24427
from setuptools import find_packages, setup with open('README.md', 'r') as readme: long_description = readme.read() setup( name='epa-sld-update', package_dir={"": "src"}, packages=find_packages('src'), version='0.0.0', description='EPA Access to Jobs', long_description=long_description, ...
the-stack_106_24428
from dagster_graphql.client.util import parse_raw_log_lines from dagster_k8s.utils import get_pod_names_in_job, retrieve_pod_logs, wait_for_job_success from dagster import check def wait_for_job_and_get_logs(job_name, namespace): '''Wait for a dagster-k8s job to complete, ensure it launched only one pod, and...
the-stack_106_24429
#classe para tratar os dados do dataset from dataset import Dataset #classe para tratar os dados do modelo from model import Model #classe para logs e metricas from log import Log dataset = Dataset('dados1', 'dados2') x, y = dataset.normalize_dataset_train() real_cpf, normalized_df_production = dataset.normalize_dat...
the-stack_106_24431
from django.utils.deprecation import MiddlewareMixin from django.shortcuts import HttpResponse, redirect, reverse from django.conf import settings import re from rbac import models class RbacMiddleware(MiddlewareMixin): def process_request(self, request): # 获取当前访问url地址 url = request.path_info...
the-stack_106_24437
"""Sensor platform for Trakt""" from homeassistant.const import ATTR_ATTRIBUTION, CONF_NAME, CONF_CLIENT_ID from homeassistant.helpers.entity import Entity from .const import ATTRIBUTION, DOMAIN async def async_setup_entry(hass, config_entry, async_add_entities): """Set up device tracker for Mikrotik component....
the-stack_106_24439
#!/usr/bin/env python # # 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 requir...
the-stack_106_24441
#!/usr/bin/env python # Copyright 2017 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 require...
the-stack_106_24443
print(' '*20+'Version: String Encoder v0.0.1.5') print('.'*150) print('@copyright Bijoy_Maji') print('By - Bijoy Maji. Email:- majibijoy00@gmail.com') print('Note: There have a problem with some key. if you find it , please mail me the key at majibijoy00@gmail.') print('.'*150) import random import math as m #i...
the-stack_106_24445
#!/usr/bin/env python # Copyright (C) 2012-2013, The CyanogenMod Project # (C) 2017, The LineageOS Project # # 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.a...
the-stack_106_24446
# Write a function that extracts the words from a given text as a parameter. # A word is defined as a sequence of alpha-numeric characters. import re, os def extract_words(text): # pattern = re.compile('\w+\') # words = re.findall(pattern, text) # return words return re.split("[^\w]+", text) # p...
the-stack_106_24447
# -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more§ # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Li...
the-stack_106_24448
from pathlib import Path from setuptools import setup from csv_dataset import __version__ # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def ...
the-stack_106_24449
from typing import Union, Any from pyqtgraph.Qt import QtWidgets, QtGui from amitypes import Array1d, Array2d, Array3d from ami.flowchart.library.common import CtrlNode, GroupedNode from ami.flowchart.library.CalculatorWidget import CalculatorWidget, FilterWidget, gen_filter_func, sanitize_name import ami.graph_nodes a...
the-stack_106_24450
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import csv import random import argparse import operator import numpy as np import os, sys, json import os.path a...
the-stack_106_24452
# -*- coding: utf-8 -*- from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('taxbrain', '0045_taxsaveinputs_ald_invinc_ec_base_ryanbrady'), ] operations = [ migrations.RemoveField( model_name='taxsaveinputs', name='C...
the-stack_106_24453
import BirdRoostLocation.LoadSettings as settings import os import pandas def create_subset_labels(csv_input_path, subset_path, csv_output_path): full = pandas.read_csv(csv_input_path) subset = pandas.read_csv(subset_path) full_basenames = {} subset_basenames = [] full_file_list = list(full["AWS_...
the-stack_106_24454
import tweepy import random import time # Twitter API Keys import os consumer_key = os.getenv("consumer_key") consumer_secret = os.getenv("consumer_secret") access_token = os.getenv("access_token") access_token_secret = os.getenv("access_token_secret") # Setup Tweepy API Authentication auth = tweepy.OAuthHandler(con...
the-stack_106_24455
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making GameAISDK available. This source code file is licensed under the GNU General Public License Version 3. For full details, please refer to the file "LICENSE.txt" which is provided as part of this source code package. Copyright...
the-stack_106_24460
import os import sys from PySide6 import QtCore, QtWidgets, QtGui import idaapi from . import exceptions def capture_widget(widget, path=None): """Grab an image of a Qt widget Args: widget: The Qt Widget to capture path (optional): The path to save to. If not provided - will return image d...
the-stack_106_24463
# Sampling a truncated multivariate Gaussian by Rejection sampling from Mode # ("A New Rejection Sampling Method for Truncated Multivariate Gaussian Random Variables # Restricted to Convex Sets" https://hal.archives-ouvertes.fr/hal-01063978/document) # Author: Liaowang Huang <liahuang@student.ethz.ch> import numpy ...
the-stack_106_24464
def copy_untouched_quantities(old_state, new_state): for key in old_state.keys(): if key not in new_state: new_state[key] = old_state[key] def add(state_1, state_2): out_state = {} if 'time' in state_1.keys(): out_state['time'] = state_1['time'] for key in state_1.keys(): ...
the-stack_106_24466
""" Voice rooms module. Gives users the power to create and manage their own voice chat channels instead of relying on pre-defined channels. """ import asyncio import copy import functools import os import re from typing import Callable, Dict, List, Optional, Tuple, Union import yaml from discord import ( Colour,...
the-stack_106_24468
"""Support for SmartThings Cloud.""" import asyncio import logging from typing import Iterable from aiohttp.client_exceptions import ( ClientConnectionError, ClientResponseError) from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_ACCESS_TOKEN from homeassistant.exceptions im...
the-stack_106_24469
import abc from itertools import chain from pathlib import Path from typing import Set, List, Dict, Iterator, Tuple, Any, Union, Type, Optional, Callable from dbt.dataclass_schema import StrEnum from .graph import UniqueId from dbt.contracts.graph.compiled import ( CompiledSingularTestNode, CompiledGenericTe...
the-stack_106_24471
import os import logging import shutil import tempfile import re from pathlib import Path from ocs_ci.helpers.helpers import storagecluster_independent_check from ocs_ci.ocs.resources.pod import get_all_pods from ocs_ci.ocs.utils import collect_ocs_logs from ocs_ci.ocs.must_gather.const_must_gather import GATHER_COMMA...
the-stack_106_24472
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from rasa_core import restore def test_restoring_tracker(trained_moodbot_path, recwarn): tracker_dump = "data/test_trackers/tracker_moodbot.json" agent, tracke...
the-stack_106_24474
from bc.data import Table, Prototype, BytecodeDump, Instruction, InsType, Const from bc.stream import Stream class DumpWriter(object): def __init__(self, dump: BytecodeDump, filename, encoding): self.dump = dump self.encoding = encoding self.filename = filename self.stream: Stream ...
the-stack_106_24476
# Globales import tensorflow as tf AUTOTUNE = tf.data.AUTOTUNE BATCH_SIZE = 32 BUFFER_SIZE = 20000 EMBEDDING_DIM = 512 MAX_SEQ_LENGTH = 200 INPUT_VOCAB_SIZE = 8500 TARGET_VOCAB_SIZE = 8000 EPS_LAYERNORM = 1e-6
the-stack_106_24477
""" ============================================================================= t-SNE: The effect of various perplexity values on the shape ============================================================================= An illustration of t-SNE on the two concentric circles and the S-curve datasets for different perpl...
the-stack_106_24480
# coding: utf-8 """ Provides error handler for non API errors """ import logging import flask from api import helpers import config from main import app @app.errorhandler(400) # Bad Request @app.errorhandler(401) # Unauthorized @app.errorhandler(403) # Forbidden @app.errorhandler(404) # Not Found @app.errorhan...
the-stack_106_24481
from opentrons import __version__ from opentrons.protocol_api import MAX_SUPPORTED_VERSION def test_health(api_client, hardware): hardware.fw_version = "FW111" hardware.board_revision = "BR2.1" expected = { 'name': 'opentrons-dev', 'api_version': __version__, 'fw_version': 'FW111'...
the-stack_106_24483
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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_24484
""" The :class:`~allennlp.common.params.Params` class represents a dictionary of parameters (e.g. for configuring a model), with added functionality around logging and validation. """ from typing import Any, Dict, List from collections import MutableMapping, OrderedDict import copy import json import logging import os...
the-stack_106_24485
# 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_24486
# Copyright 2012 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_24487
# -*- coding=utf-8 import requests import logging import hashlib import base64 import os import sys import time import copy import json import xml.dom.minidom import xml.etree.ElementTree from requests import Request, Session from datetime import datetime from six.moves.urllib.parse import quote, unquot...
the-stack_106_24489
#!/usr/bin/python # # Copyright (c) 2012 Mikkel Schubert <MSchubert@snm.ku.dk> # # 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 #...
the-stack_106_24490
# 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 use ...
the-stack_106_24493
import cv2 import os import imutils import numpy as np class FindItConfig(object): cv_method = cv2.TM_CCORR_NORMED def load_from_path(pic_path): """ load grey picture (with cv2) from path """ raw_img = cv2.imread(pic_path) raw_img = raw_img.astype(np.uint8) grey_img = cv2.cvtColor(raw_img, cv2.C...
the-stack_106_24494
"""Copyright (c) 2020 Chengjie Wu""" import time import numpy as np class GibbsLDA: def __init__(self, n_components=3, doc_topic_prior=None, topic_word_prior=None, iterations=1000, verbose=True): """Latent Dirichlet Allocation with Gibbs sampling :param n_components: int, numbe...
the-stack_106_24496
# Copyright 2017 StreamSets Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
the-stack_106_24497
import sqlalchemy as db import os engine = db.create_engine('postgresql://user1:user1@localhost/mydb') for root, directories, filenames in os.walk('/home/user1/pg1/bin'): for directory in directories: print(os.path.join(root, directory)) for filename in filenames: print(os.path.join(root,filen...
the-stack_106_24498
#!/usr/bin/env python3 from glob import glob import json import os import sys import requests from socket import gethostname import hashlib import re # Authentication for user filing issue USE_GITHUB = True try: USERNAME = os.environ['GITHUB_USER'] except KeyError: print('WARN: Environent variable GITHUB_USER...
the-stack_106_24500
import pygame from sys import exit from random import randint, choice class Player(pygame.sprite.Sprite): # inherates from pygame.sprite.Sprite def __init__(self): super().__init__() # inherate sprite class inside itself. #Needs 2 attributes at minimum player_walk1 = pygame.image.load('gra...
the-stack_106_24501
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup -------------------------------------------------------------- # If extensions (or module...
the-stack_106_24502
import pytest from starlette.applications import Starlette from starlette.middleware import Middleware from starlette.middleware.base import BaseHTTPMiddleware from starlette.responses import PlainTextResponse, StreamingResponse from starlette.routing import Mount, Route, WebSocketRoute class CustomMiddleware(BaseHT...
the-stack_106_24504
# -*- coding: utf-8 -*- # author:lyh # datetime:2020/7/31 20:21 """ 169. 多数元素 给定一个大小为 n 的数组,找到其中的多数元素。多数元素是指在数组中出现次数大于 ⌊ n/2 ⌋ 的元素。 你可以假设数组是非空的,并且给定的数组总是存在多数元素。 示例 1: 输入: [3,2,3] 输出: 3 示例 2: 输入: [2,2,1,1,1,2,2] 输出: 2 """ from typing import List class Solution: def majorityElement(self, nums: List[int]) ->...
the-stack_106_24506
# Wrong answer 20% jipes = 0 turistas = 0 action = input() while action != "ABEND": if action == "SALIDA": jipes += 1 turistas += int(input()) elif action == "VUELTA": if jipes > 0: jipes -= 1 T = int(input()) if turistas > 0: turistas -= T e...
the-stack_106_24507
from database import EventStream dataset_id = "dataset-id" version = "version" sink_id = "0agee" event_stream_id = f"{dataset_id}/{version}" event_stream_stack_name = f"event-stream-{dataset_id}-{version}" event_subscribable_stack_name = f"event-subscribable-{dataset_id}-{version}" event_sink_stack_name = f"event-si...
the-stack_106_24509
import os, sys from flask import Flask, json app = Flask(__name__) @app.route('/', methods=['GET']) def get_method(): status=200 response = app.response_class( response=json.dumps({'status':'OK'}), status=status, mimetype='application/json' ) ...
the-stack_106_24510
from m5stack import * from m5ui import * from uiflow import * import espnow import wifiCfg import json import hat setScreenColor(0x111111) hat_BeetleC9 = hat.get(hat.BEETLEC) espnow.init() title0 = M5Title(title="Title", x=3 , fgcolor=0xFFFFFF, bgcolor=0x0000FF) label0 = M5TextBox(8, 56, "Text", lcd.FONT_Default,0...
the-stack_106_24515
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.init as init from torch.nn.utils import weight_norm as norm import numpy as np import module as mm from CookieTTS.utils.model.layers import ConvNorm, LinearNorm class ReferenceEncoder(nn.Module): """ Reference Encoder. 6 co...
the-stack_106_24517
import click from ...models import JudgeFactory from ...utils.constants import default_judge from ...utils.logging import logger from ...utils.exceptions import handle_exceptions from ...utils.launch import launch, substitute from ...utils import config judge_factory = JudgeFactory() OJs = judge_factory.available_jud...
the-stack_106_24518
import random import torch import torchvision class Flip(object): def __init__(self, params, data_types): self.mode = params['Mode'] self.data_types = data_types self.pre_torch = False def forward(self, batch): horizontal_flip = False vertical_flip = False if self.mode == 'both' or self.mode == 'horizon...
the-stack_106_24521
from folium import plugins import pandas as pd import numpy as np import folium class Map: def __init__(self, data: pd.DataFrame): lat = data.lat.sum()/len(data) lon = data.lon.sum()/len(data) self.map = folium.Map(location=[lat, lon], zoom_start=13) def print(self): return se...
the-stack_106_24523
# Copyright 2020 Toyota Research Institute. All rights reserved. import argparse import numpy as np import os import torch from glob import glob from cv2 import imwrite from packnet_sfm.models.model_wrapper import ModelWrapper from packnet_sfm.datasets.augmentations import resize_image, to_tensor from packnet_sfm.u...
the-stack_106_24526
#!usr/bin/python import socket import time sock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM) # para UDP udp_host = 'localhost' udp_port = 12345 msg = "hola mundo en minuscula" msg = bytes(msg,'utf-8') print ("IP destino:", udp_host) print ("Puerto:", udp_port) sock.sendto(msg,(udp_host,udp_p...
the-stack_106_24527
# 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, ...
the-stack_106_24528
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import from .base import * DEBUG = False TEMPLATE_DEBUG = False ALLOWED_HOSTS = ["*"] STATIC_ROOT = '/home/vagrant/static' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': '/tmp/db.sqlite3', } }...
the-stack_106_24531
"""Deprecated Magic functions. """ from __future__ import print_function #----------------------------------------------------------------------------- # Copyright (c) 2012 The IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, dist...
the-stack_106_24535
import unittest from apiai_assistant.widgets import SelectItem from apiai_assistant.widgets import OptionInfo class SelectItemTestCase(unittest.TestCase): def test_basic(self): key = "foobar" title = "bario" w_slct_item = SelectItem(title=title, option_info=OptionInfo(key)) self.a...
the-stack_106_24536
# -*- coding: utf-8 -*- """ Created on Wed May 30 13:41:15 2018 @author: mzw06 """ import torch.nn as nn import torch.nn.functional as F class RNNModel(nn.Module): """Container a recurrent module.""" def __init__(self, rnn_type, ninp, ntag, nhid, nlayers, dropout=0): super(RNNModel, self...
the-stack_106_24537
import newspaper from newspaper import Article import requests from dragnet import content_extractor, content_comments_extractor from eatiht import etv2 from eatiht import v2 import eatiht from readability.readability import Document import urllib from bs4 import BeautifulSoup TARGET = 'http://giaitri.vnexpress.net...
the-stack_106_24538
""" Author: Dr. John T. Hwang <hwangjt@umich.edu> This package is distributed under New BSD license. LHS sampling; uses the pyDOE2 package. """ from __future__ import division from pyDOE2 import lhs from six.moves import range from scipy.spatial.distance import pdist, cdist import numpy as np from smt.sampling_metho...
the-stack_106_24541
import markdown from peewee import DoesNotExist, fn import tornado.web from model.model import Post, User, Tag, PostTag from config.config import conf from util.gravatar import Gravatar class BaseHandler(tornado.web.RequestHandler): """基础 Handler 所有Handler都要继承此类以获取必要的应用内通用方法和数据 """ @property def...
the-stack_106_24542
# coding=utf-8 from typing import List from src.data_structure.data_structure import ListNode class Solution: """ 反转链表 """ def reverse_list(self, head: ListNode) -> ListNode: """ :param head: :return: """ pre, cur = None, head while cur: n...
the-stack_106_24545
#!/usr/bin/python # Copyright: Ansible Project # 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 DOCUMENTATION = r''' module: ec2_vpc_nacl short_description: create and delete Network ACLs...
the-stack_106_24546
#! /usr/bin/env python # Copyright 2019 Vimal Manohar # Apache 2.0. """This script converts an RTTM with speaker info into kaldi utt2spk and segments""" import argparse def get_args(): parser = argparse.ArgumentParser( description="""This script converts an RTTM with speaker info into kaldi ...
the-stack_106_24547
# Copyright 2019 The TensorTrade Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
the-stack_106_24550
""" This module is an example of a barebones numpy reader plugin for napari. It implements the ``napari_get_reader`` hook specification, (to create a reader plugin) but your plugin may choose to implement any of the hook specifications offered by napari. see: https://napari.org/docs/plugins/hook_specifications.html R...
the-stack_106_24551
# MIT License # Copyright (c) 2021 AWS Cloud Community LPU # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDER...
the-stack_106_24554
# -*- coding: utf-8 -*- """Version information for PyKEEN.""" import os import sys from functools import lru_cache from subprocess import CalledProcessError, check_output # noqa: S404 from typing import Optional __all__ = [ 'VERSION', 'get_version', 'get_git_hash', 'get_git_branch', 'env', ] VE...
the-stack_106_24555
import os import logging import subprocess from mlflow.exceptions import MlflowException from mlflow.utils.rest_utils import MlflowHostCreds from databricks_cli.configure import provider from mlflow.utils._spark_utils import _get_active_spark_session from mlflow.utils.uri import get_db_info_from_uri _logger = logging...
the-stack_106_24556
# encoding: utf-8 # Sample-based Monte Carlo Denoising using a Kernel-Splatting Network # Michaël Gharbi Tzu-Mao Li Miika Aittala Jaakko Lehtinen Frédo Durand # Siggraph 2019 # # Copyright (c) 2019 Michaël Gharbi # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in c...
the-stack_106_24557
# -*- coding: utf-8 -*- from __future__ import absolute_import import logging import os from django.db import models from django.utils import six from django.utils.translation import ugettext_lazy as _ from .. import settings as filer_settings from ..utils.compatibility import GTE_DJANGO_1_10, PILImage from ..utils....
the-stack_106_24558
from core.NDUDE_2D_sup_te import Test_NDUDE_2D_sup # window size = k^2-1 k_arr = [3,5,7,9,11,13,15,17] delta_arr = [0.05, 0.1, 0.2, 0.25] ep_ = 15 # Available test dataset : 1) Set13_256, 2) Set13_512, 3) BSD20 test_data = 'BSD20' # if not a blind case is_blind_ = False case_ = None for delta_ in delta_arr: ...
the-stack_106_24559
from typing import NamedTuple import tensorflow as tf from .types import * from .query import * from ..args import ACTIVATION_FNS from ..attention import * from ..input import get_table_with_embedding from ..const import EPSILON from ..util import * from ..layers import * from ..activations import * MP_State = tf....
the-stack_106_24563
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015 Carlos Jenkins <carlos@jenkins.co.cr> # # 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...
the-stack_106_24564
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY ...
the-stack_106_24565
'''Sequence to sequence example in Keras (character-level). This script demonstrates how to implement a basic character-level sequence-to-sequence model. We apply it to translating short English sentences into short French sentences, character-by-character. Note that it is fairly unusual to do character-level machine t...
the-stack_106_24566
# -*- coding: utf-8 -*- from .types import Types from ..Helpers.commands import Dup, Store, Push, BLoad, Load, Add, DBLoad, Label, Jump, Pop, Jz class Loop: """ Генератор команд для организации циклов """ load_commands = { 'stack': BLoad, 'heap': DBLoad } @staticmethod def base(c...
the-stack_106_24570
import six import json from kubernetes import watch from kubernetes.client.rest import ApiException from .apply import apply from .discovery import EagerDiscoverer, LazyDiscoverer from .exceptions import api_exception, KubernetesValidateMissing, ApplyException from .resource import Resource, ResourceList, Subresource...
the-stack_106_24571
# Copyright 2012 Nebula, 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 agree...
the-stack_106_24572
# Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import numpy as np from extensions.back.ReshapeMutation import ReshapeMutation from extensions.back.ReverseInputChannels import ApplyReverseChannels from mo.back.replacement import BackReplacementPattern from mo.front.common.partial_inf...
the-stack_106_24573
@staticmethod def fetch_statement(symbol, query='income-statement'): r = requests.get( 'http://www.nasdaq.com/symbol/{symbol}/financials?query={query}'.format( symbol=symbol, query=query)) soup = BeautifulSoup(r.content, 'html.parser') div = soup.find('div', attrs={'class': 'genTable'}) ...
the-stack_106_24574
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2018, 2019. # # 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...
the-stack_106_24575
"""Broker API.""" import logging import time from binascii import hexlify import zmq from . import zhelpers from . import definitions from . import broker_worker_api from . import broker_service_api # pylint: disable=R0902,E1101,R1705,R0912 _logger = logging.getLogger(__name__) class Broker: """Broker API. ...
the-stack_106_24576
# -*- coding: utf-8 -*- from collections import Counter __author__ = "Sergey Aganezov" __email__ = "aganezov(at)cs.jhu.edu" __status__ = "production" class KBreak(object): """ A generic object that can represent any k-break ( k>= 2) A notion of k-break arises from the bioinformatics combinatorial object Br...
the-stack_106_24577
from tacticalrmm.test import TacticalTestCase from .serializers import InstalledSoftwareSerializer from model_bakery import baker from unittest.mock import patch from .models import InstalledSoftware, ChocoLog from agents.models import Agent class TestSoftwareViews(TacticalTestCase): def setUp(self): self...
the-stack_106_24578
from cereal import car from collections import defaultdict from common.numpy_fast import interp from common.kalman.simple_kalman import KF1D from opendbc.can.can_define import CANDefine from opendbc.can.parser import CANParser from selfdrive.config import Conversions as CV from selfdrive.car.honda.values import CAR, DB...
the-stack_106_24580
import os import signal import socket import sys import py import pytest import tox from tox.logs import ResultLog @pytest.fixture(name="pkg") def create_fake_pkg(tmpdir): pkg = tmpdir.join("hello-1.0.tar.gz") pkg.write("whatever") return pkg def test_pre_set_header(): replog = ResultLog() d =...
the-stack_106_24582
from datetime import datetime, timedelta from glosowania.models import Decyzja, ZebranePodpisy, KtoJuzGlosowal from django.shortcuts import get_object_or_404 from django.db import IntegrityError from django.shortcuts import render from glosowania.forms import DecyzjaForm from django.http import HttpResponseRedirect, Ht...
the-stack_106_24584
# Copyright 2020-2021 Efabless 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 ...
the-stack_106_24585
import pytest import os import tempfile from contextlib import contextmanager from warnings import catch_warnings from distutils.version import LooseVersion import datetime from datetime import timedelta import numpy as np import pandas as pd from pandas import (Series, DataFrame, Panel, MultiIndex, Int64Index, ...
the-stack_106_24587
from __future__ import with_statement import re import os import subprocess from django.utils.datastructures import SortedDict from django.utils.encoding import smart_str from sorl.thumbnail.base import EXTENSIONS from sorl.thumbnail.conf import settings from sorl.thumbnail.engines.base import EngineBase from tempf...
the-stack_106_24588
from math import pi, sqrt import itertools from typing import List from raytracer.tuple import ( tuple, point, vector, magnitude, normalize, dot, cross, Color, ) from raytracer.util import equal from raytracer.matrices import Matrix, I from raytracer.transformations import ( transla...
the-stack_106_24590
# -*- coding: utf-8 -*- USERS = [ {"id": 0, "first_name": "Palmira", "last_name": "Haig", "email": "palmira@aol.com", "is_active": 1, "is_vip": 1, "site": "https://raccoon.ninja"}, {"id": 1, "first_name": "Arlette", "last_name": "Lowell", "email": "arlette@aol.com", "is_active": 1, "is_vip": 0, "site...
the-stack_106_24591
# Copyright (c) 2012-2018, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty, Tags from .validators import boolean, integer, json_checker, double try: from awacs.aws import Policy policytypes = (dict, Policy) except ImportError: pol...
the-stack_106_24592
"""Master server for lab-nanny Collects data from the different nodes and makes it available to the clients using websockets. The functionality of the master server is to join the data from the different nodes and make it available in two forms: -- clients using websockets -- store it in a database To do this, the m...
the-stack_106_24593
"""Tests for hermite module. """ from __future__ import division, absolute_import, print_function import numpy as np import numpy.polynomial.hermite as herm from numpy.polynomial.polynomial import polyval from numpy.testing import ( TestCase, assert_almost_equal, assert_raises, assert_equal, assert_, run_modu...