filename stringlengths 13 19 | text stringlengths 134 1.04M |
|---|---|
the-stack_0_5046 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.internal.backends.chrome_inspector import inspector_websocket
from telemetry.internal.platform import system_info
from py_utils import camel_c... |
the-stack_0_5050 | import logging
from threading import Thread
from telemetry_f1_2021.listener import TelemetryListener
from kafka.kafka_admin import KafkaAdmin
class TelemetryManager(Thread):
"""Class for adding packets to the packet queue.
Derived from the Thread class, this is run as part of a multithreaded program.
... |
the-stack_0_5051 | import logging
import multiprocessing
import os
from bootleg.utils import train_utils
def get_log_name(args, mode):
log_name = os.path.join(train_utils.get_save_folder(args.run_config), f"log_{mode}")
log_name += train_utils.get_file_suffix(args)
log_name += f'_gpu{args.run_config.gpu}'
return log_na... |
the-stack_0_5052 | # -*- coding: utf-8 -*-
# 本类实现了Richard Wallace博士在以下站点描述的AIML模式匹配算法:http://www.alicebot.org/documentation/matching.html '''
from __future__ import print_function
import marshal
import pprint
import re
from .constants import *
class PatternMgr:
# special dictionary keys
_UNDERSCORE = 0
_STAR = 1
... |
the-stack_0_5053 | import numpy as np
from sklearn.mixture import GaussianMixture
from sklearn.preprocessing import normalize, LabelEncoder
import sys
from process import load_names
from scanorama import *
NAMESPACE = 'hsc'
data_names = [
'data/hsc/hsc_mars',
'data/hsc/hsc_ss2',
]
# Computes the probability that the corrected... |
the-stack_0_5054 | from pynonymizer.database.provider import DatabaseProvider
from pynonymizer.database.provider import SEED_TABLE_NAME
from pynonymizer.strategy.update_column import UpdateColumnStrategyTypes
from pynonymizer.strategy.table import TableStrategyTypes
from pynonymizer.database.exceptions import (
UnsupportedColumnStrat... |
the-stack_0_5055 | """Based on BertForTokenClassification, implemented here since it's not in transformers currently."""
from torch import nn
from transformers import AlbertModel, AlbertPreTrainedModel
class AlbertForTokenClassification(AlbertPreTrainedModel):
def __init__(self, config):
super().__init__(config)
sel... |
the-stack_0_5057 | # -*- coding: utf-8 -*-
#
# Copyright 2017 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 ... |
the-stack_0_5058 | #!/usr/bin/env python
# coding: utf-8
# The MIT License (MIT)
# Copyright (c) 2015 Pavel Vomacka
# 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_0_5059 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the fetch_builds module."""
import errno
import unittest
# The third-party mock module is expected to be available in PYTHONPATH.
import ... |
the-stack_0_5060 | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test that we don't leak txs to inbound peers that we haven't yet announced to"""
from test_framework.m... |
the-stack_0_5062 | #!/usr/bin/env python
from Bio import SeqIO
import argparse as ap
import sys
def read_params():
p = ap.ArgumentParser(description = 'fastq2fasta.py Parameters\n')
p.add_argument('--ifn', required = False, default = None, type = str)
p.add_argument('--ofn', required = False, default = None, type = str)
... |
the-stack_0_5064 | """
# lex-ler
Compreender a motivação e mecanismos da análise léxica.
* Separar um código fonte em tokens e lexemas.
* Identificar os diferentes tipos de lexemas.
* Identificar lexemas em linguagens de programação reais como Python ou C.
----
Atenção! Este não é um exercício de programação, mas sim de compreensão ... |
the-stack_0_5065 | import argparse
import random
import math
from dali.utils import (
set_device_from_args,
add_device_args,
unpickle_as_dict,
)
from dali.data.utils import split_punctuation
from translation import TranslationModel
def parse_args():
parser = argparse.ArgumentParser()
add_device_args(parser)
par... |
the-stack_0_5071 | import os
from pathlib import Path
import pytest
from aqt.archives import QtArchives, SrcDocExamplesArchives
from aqt.helper import Settings
@pytest.fixture(autouse=True)
def setup():
Settings.load_settings(os.path.join(os.path.dirname(__file__), "data", "settings.ini"))
@pytest.mark.parametrize(
"os_name... |
the-stack_0_5073 | import kfp
from kfp import components
from kfp import dsl
sagemaker_hpo_op = components.load_component_from_file(
"../../hyperparameter_tuning/component.yaml"
)
@dsl.pipeline(
name="SageMaker HyperParameter Tuning", description="SageMaker HPO job test"
)
def hpo_pipeline(
region="",
job_name="",
... |
the-stack_0_5075 | # SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2015, ARM Limited and 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
#
# ... |
the-stack_0_5077 | #Crie um programa que vai gerar cinco números aleatórios e colocar em uma tupla. Depois disso, mostre a #listagem de números gerados e também indique o menor e o maior valor que estão na tupla
from random import randint
n1=randint(0,10)
n2=randint(0,10)
n3=randint(0,10)
n4=randint(0,10)
n5=randint(0,10)
maior=menor=... |
the-stack_0_5078 | #
# The Python Imaging Library.
# $Id$
#
# base class for image file handlers
#
# history:
# 1995-09-09 fl Created
# 1996-03-11 fl Fixed load mechanism.
# 1996-04-15 fl Added pcx/xbm decoders.
# 1996-04-30 fl Added encoders.
# 1996-12-14 fl Added load helpers
# 1997-01-11 fl Use encode_to_file where possibl... |
the-stack_0_5079 | import os
import copy
import re
import yaml
from fabric.colors import yellow as _yellow
from ghost_log import log
from .provisioner import FeaturesProvisioner
SALT_PILLAR_TOP = {'base': {'*': ['features']}}
class FeaturesProvisionerSalt(FeaturesProvisioner):
""" Build features with SaltStack """
def __ini... |
the-stack_0_5084 | # Copyright 2021 The Kubeflow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
the-stack_0_5085 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) Copyright IBM Corp. 2010, 2020. All Rights Reserved.
# Given a sentence and an incident id, check their similarity
# Usage:
# sen_incident.py _input_sentence_ -i incident id -v [optional]
# Need w2v for word2v, sif for SIF, vec for caced vecs
# if -v is... |
the-stack_0_5089 | #!/usr/bin/env python3
import os
from pathlib import Path
import shutil
import argparse
import json
from pprint import pprint
import kaitaistruct
from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO
from vfat import Vfat
# ---------------------------------------------------------------
## CONSTANTS
floppy_... |
the-stack_0_5094 | # File name: exercise3.py
# Author: Steve Hommy
# Description: Sorting list in ascending order
# Asking user for range of items that will be on list
number_of_elements = int(input("Enter number of elements in list: "))
# Creating lists
number_list = []
word_list = []
# Appending intgeres and strings to the list
for... |
the-stack_0_5096 | from typing import List, Optional
from spacy.language import Language
from spacy.tokens import Doc, Span, Token
from edsnlp.pipelines.qualifiers.base import Qualifier
from edsnlp.pipelines.terminations import termination
from edsnlp.utils.filter import consume_spans, filter_spans, get_spans
from edsnlp.utils.inclusio... |
the-stack_0_5097 | import os
import re
import datetime
def benchmarks_Z3(input_path, output_path, option):
if option == "linear":
save_path_QF_LRA = output_path + "/linear/QF_LRA"
save_path_QF_LIA = output_path + "/linear/QF_LIA"
save_path_QF_BV = output_path + "/linear/QF_BV"
if option == "nonlinear":... |
the-stack_0_5099 | #!/usr/bin/env python3
# Build and install fmt
import sys
import logging
from pathlib import Path
from subprocess import run, CalledProcessError
import multiprocessing
# Version check
if sys.version_info.minor < 6:
print("Python version is %s, 3.6+ is required." % sys.version)
sys.exit(1)
def build_fmt(fmt... |
the-stack_0_5101 | #!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2021 Eugenio Parodi <ceccopierangiolieugenio AT googlemail DOT com>
#
# 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 restricti... |
the-stack_0_5102 | import cv2 as cv
import argparse
import numpy as np
import sys
backends = (cv.dnn.DNN_BACKEND_DEFAULT, cv.dnn.DNN_BACKEND_HALIDE, cv.dnn.DNN_BACKEND_INFERENCE_ENGINE)
targets = (cv.dnn.DNN_TARGET_CPU, cv.dnn.DNN_TARGET_OPENCL)
parser = argparse.ArgumentParser(description='Use this script to run semantic segmentation ... |
the-stack_0_5103 | import attr
import json
from ._core import Enum
class GuestStatus(Enum):
INVITED = 1
GOING = 2
DECLINED = 3
@attr.s(cmp=False)
class Plan:
"""Represents a plan."""
#: ID of the plan
uid = attr.ib(None, init=False)
#: Plan time (timestamp), only precise down to the minute
time = attr... |
the-stack_0_5104 | from sklearn.cluster import DBSCAN
import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
df_energy = pd.read_csv('results/SklearnScaledEnergy.csv')
df_energy = df_energy.drop(['id', '1', '2', '3', '4', '5','6','7','8','9'], axis=1)
df_energy.columns = ['energy']
df_perplex = pd.read_csv('... |
the-stack_0_5105 | import unittest, random, sys, time
sys.path.extend(['.','..','py'])
import h2o, h2o_browse as h2b, h2o_exec as h2e, h2o_hosts, h2o_import as h2i
DO_COMPOUND = False
phrasesCompound = [
# use a dialetc with restricted grammar
# 1. all functions are on their own line
# 2. all functions only use data thru ... |
the-stack_0_5109 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# Copyright 2017-2020 Airinnova AB and the PyTornado authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# Y... |
the-stack_0_5110 | # Originally contributed by Stefan Schukat as part of this arbitrary-sized
# arrays patch.
from win32com.client import gencache
from win32com.test import util
import unittest
ZeroD = 0
OneDEmpty = []
OneD = [1, 2, 3]
TwoD = [[1, 2, 3], [1, 2, 3], [1, 2, 3]]
TwoD1 = [[[1, 2, 3, 5], [1, 2, 3], [1, 2, 3]], [[1, 2, 3], [... |
the-stack_0_5112 | """Package variables module.
Package-scoped configuration variable definitions.
"""
PKG_DEBUG_OPT = select({":enable_debug": ["-g"], "//conditions:default": []})
PKG_VERBOSE_OPT = select({":enable_verbose": ["-verbose"], "//conditions:default": []})
PKG_OPTS = PKG_DEBUG_OPT + PKG_VERBOSE_OPT
PKG_PPX_EXECUTABLE_OPTS... |
the-stack_0_5113 | # -*- coding: utf-8 -*-
# !/usr/bin/env python3 -u
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""sktime window forecaster base class."""
__author__ = ["@mloning", "@big-o"]
__all__ = ["_BaseWindowForecaster"]
import numpy as np
import pandas as pd
from sktime.forecasting.base._base impor... |
the-stack_0_5116 | import logging
import yaml
from .dict_util import deep_dict_merge
from .loader import IncludeLoader
logger = logging.getLogger(__name__)
def load_global_config(global_cfg_paths):
"""Given a list of file paths to global config files, load each of them and
return the joined dictionary.
This does a deep d... |
the-stack_0_5117 | """Media Player component to integrate TVs exposing the Joint Space API."""
from __future__ import annotations
from haphilipsjs import ConnectionFailure
from homeassistant.components.media_player import (
BrowseMedia,
MediaPlayerDeviceClass,
MediaPlayerEntity,
)
from homeassistant.components.media_player.... |
the-stack_0_5118 | # Copyright (c) 2021 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_0_5119 | """*********************************************************************
* *
* Description: A simple asynchronous http library *
* Date: 12/02/2021 *
* Author: Ma... |
the-stack_0_5120 | # Usage: python demo_receiver.py [dummy|ss|gbn]
import config
import sys
import time
import util
def msg_handler(msg):
print(repr(msg))
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: python demo_receiver.py [dummy|ss|gbn|sr]")
sys.exit(1)
transport_layer = None
name... |
the-stack_0_5124 | import json
import os
import requests # Install with easy_install or pip install
def get_release(version_tag):
print('Getting release metadata for {version_tag}...'.format(
version_tag=version_tag))
releases = requests.get(
'https://api.github.com/repos/facebook/buck/releases').json()... |
the-stack_0_5125 | #!/usr/bin/env -S python3 -B
# Copyright (c) 2022 Project CHIP 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 a... |
the-stack_0_5127 | import math
from datetime import datetime, timedelta
from .data_types import (
Header, FileControl, BatchHeader,
BatchControl, EntryDetail, AddendaRecord
)
class AchFile(object):
"""
This class is what stores the ach data. Its main external methods
are `add_batch` and `render_to_string`.
""... |
the-stack_0_5128 | # Copyright Pincer 2021-Present
# Full MIT License can be found in `LICENSE` at the project root.
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum, IntEnum
from typing import TYPE_CHECKING, overload
from ...exceptions import EmbedOverflow
from ...utils.api_object import APIO... |
the-stack_0_5129 | # -*- coding: utf-8 -*-
""" pykwalify """
# python stdlib
import logging
import logging.config
import os
__author__ = 'Grokzen <Grokzen@gmail.com>'
__version_info__ = (1, 8, 0)
__version__ = '.'.join(map(str, __version_info__))
log_level_to_string_map = {
5: "DEBUG",
4: "INFO",
3: "WARNING",
2: "ER... |
the-stack_0_5130 | # -*- coding:utf-8 -*-
import logging
def en_logging(log_file, log_level):
level = 0
if log_level == "debug":
level = logging.DEBUG
elif log_level == "info":
level = logging.INFO
elif log_level == "warn":
level = logging.WARN
elif log_level == "error":
level = loggin... |
the-stack_0_5131 | # -*- coding: utf-8 -*-
import pytest
import gevent
from raiden.utils import sha3
from raiden.api.python import RaidenAPI
from raiden.messages import (
decode,
Ack,
Ping,
)
from raiden.tests.utils.transport import UnreliableTransport
from raiden.tests.utils.messages import setup_messages_cb
from raiden.tes... |
the-stack_0_5132 | # coding=utf-8
#
# Copyright 2018 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 ap... |
the-stack_0_5134 | """
Script used to build the tiles databases for the Sentinel2,
Landsat5, and Landsat8 spacecrafts.
"""
import os
import geopandas as gpd
from pathlib import Path
def build_sentinel2_db():
"""Extract the Sentinel2 tiles information and store it in pickle format."""
data_dir = Path(__file__).parent
wrs_fil... |
the-stack_0_5135 | """Representation of an IHM mmCIF file as a set of Python classes.
Generally class names correspond to mmCIF table names and class
attributes to mmCIF attributes (with prefixes like `pdbx_` stripped).
For example, the data item _entity.details is found in the
:class:`Entity` class, as the `details` member.... |
the-stack_0_5136 | import tkinter
import csv
f = open('class.csv')
csv_f = csv.reader(f)
myList = []
myList1 = []
myList2 = []
myList3 = []
for row in csv_f:
#print (row[2])
#myList.append(row[2])
myList.append(row)
myList1.append(row[0])
myList2.append(row[1])
myList3.append(row[2])
#print (myLis... |
the-stack_0_5137 | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 6 17:56:23 2019
@author: Khizar Anjum
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from keras.layers import Input, Dense, MaxPooling1D, Dropout, Flatten, Add, Conv1D
from keras.models import Model
#%%
drp = [0.3,0.5,0.7,0.9];
files = [pd.re... |
the-stack_0_5139 | # Artificial Intelligence
# Grado en Ingeniería Informática
# 2017-18
# play_tennis.py (Unit 3, slide 8)
attributes=[('Outlook',['Sunny','Overcast','Rainy']),
('Temperature',['High','Low','Mild']),
('Humidity',['High','Normal']),
('Wind',['Weak','Strong'])]
class_name='Play Tennis... |
the-stack_0_5141 | """
Command Line Interface of the checker
"""
import argparse
import sys
import termcolor
def colored(text, color):
"""Returns string with colored text depending on platform"""
colored_text = text
if 'win' not in sys.platform:
# termcolor works only on linux
colored_text = termcolor.color... |
the-stack_0_5143 | from __future__ import unicode_literals
# For backwards-compatibility. keep this file.
# (Many people are going to have key bindings that rely on this file.)
from .app import *
__all__ = [
# Old names.
'HasArg',
'HasCompletions',
'HasFocus',
'HasSelection',
'HasValidationError',
'IsDone',
... |
the-stack_0_5144 | try:
from . import generic as g
except BaseException:
import generic as g
class GLTFTest(g.unittest.TestCase):
def test_duck(self):
scene = g.get_mesh('Duck.glb', process=False)
# should have one mesh
assert len(scene.geometry) == 1
# get the mesh
geom = next(ite... |
the-stack_0_5146 | from sqlalchemy import func
from fence.errors import NotFound, UserError
from fence.models import (
Project,
StorageAccess,
CloudProvider,
ProjectToBucket,
Bucket,
User,
AccessPrivilege,
Group,
UserToGroup,
)
__all__ = [
"get_project",
"create_project_with_dict",
"creat... |
the-stack_0_5147 | import tensorflow as tf
import numpy as np
def linear(input_, output_size, stddev=0.02, bias_start=0.0, activation_fn=None, name='linear'):
"""
Fully connected linear layer
:param input_:
:param output_size:
:param stddev:
:param bias_start:
:param activation_fn:
:param name:
:ret... |
the-stack_0_5149 | # model settings
model = dict(
type='SimSiam',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(3,), # no conv-1, x-1: stage-x
norm_cfg=dict(type='SyncBN'),
style='pytorch'),
neck=dict(
type='NonLinearNeck',
in_channels=2048,... |
the-stack_0_5150 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... |
the-stack_0_5151 | import numpy as np
import os
import sys
import math
from datetime import datetime
from importlib import reload
from pprint import pprint
from platform import python_version
print(python_version())
sys.path.append(os.getcwd())
import NDN3.NDNutils as NDNutils
import NDN3.NDN as NDN
import utils.data as udata
impor... |
the-stack_0_5152 | from setuptools import setup, find_packages
from PublisherAzureTestsResults.version import VERSION
classifiers = [
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3'
]
setup(
name='robotframework-publisher-results-azure',
url='https... |
the-stack_0_5153 | # /index.py
from flask import Flask, request, jsonify, render_template, redirect
import os
import dialogflow_v2 as dialogflow
import requests
import json
import pusher
from werkzeug.utils import secure_filename
from trim import song
from therapy import find
from sendemail import sendmail
from video_emotion import outpu... |
the-stack_0_5154 | # -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/Range
Release: STU3
Version: 3.0.2
Revision: 11917
Last updated: 2019-10-24T11:53:00+11:00
"""
import sys
from . import element
class Range(element.Element):
""" Set of values bounded by low and high.
A set of ordered Quantities ... |
the-stack_0_5155 | import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(("localhost", 1028))
s.listen(1)
while True:
client, address = s.accept()
data = client.recv(1024)
client.send(data)
client.close()
|
the-stack_0_5156 | import time
from cnn_model import *
from audio_data import CNNDataset
from cnn_training import *
import argparse
import torch
import torch.nn as nn
import hdf5storage
import os
def main(config):
dtype = torch.FloatTensor
ltype = torch.LongTensor
use_cuda = torch.cuda.is_available()
if use_cuda:
... |
the-stack_0_5157 | import zmq
PORT = 9123
def main():
"""Main.
"""
context = zmq.Context()
socket = context.socket(zmq.SUB)
print('Connecting port %s' % PORT)
socket.setsockopt(zmq.SUBSCRIBE, b'')
socket.connect("tcp://localhost:%s" % PORT)
print('Connected port %s' % PORT)
while True:
mess... |
the-stack_0_5159 | """
Run script for 2d example with two fractures. Dynamics driven by Dirichlet
values at the fracture endpoints, which are different from the matrix BC values.
Flow and cooling from left to right, leftmost fracture grows.
-----------------------
| |
| |
| |
|... |
the-stack_0_5161 | # System imports
from datetime import datetime
import time
import json
import logging
# Package imports
from flask import Blueprint
from flask import render_template
from flask import jsonify
from flask import request
# Local imports
import common
from ispyb_api import controller
api = Blueprint('ebic', __name__, ur... |
the-stack_0_5164 | """Functionality for awesome-streamlit.org"""
from panel.pane import Markdown
def title_awesome(body: str,) -> Markdown:
"""An *Awesome Panel* title as a Markdown with
- the text like 'Awesome Panel About'
- the [Awesome Badge](https://cdn.rawgit.com/sindresorhus/awesome/\
d7305f38d29fed78fa8565... |
the-stack_0_5166 | """
mfwel module. Contains the ModflowWel class. Note that the user can access
the ModflowWel class as `flopy.modflow.ModflowWel`.
Additional information for this MODFLOW package can be found at the `Online
MODFLOW Guide
<http://water.usgs.gov/ogw/modflow/MODFLOW-2005-Guide/index.html?wel.htm>`_.
"""
import sys
imp... |
the-stack_0_5167 | # objective is to get the cart to the flag.
# for now, let's just move randomly:
import gym
import numpy as np
env = gym.make("MountainCar-v0")
LEARNING_RATE = 0.1
DISCOUNT = 0.95
EPISODES = 25000
SHOW_EVERY = 1000
DISCRETE_OS_SIZE = [20, 20]
discrete_os_win_size = (env.observation_space.high - env.observation_space.l... |
the-stack_0_5168 | # -*- coding: utf-8 -*-
if __name__ == '__main__':
import os, sys
path = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(path, '..', '..'))
from ..Qt import QtGui
from .. import functions as fn
from .UIGraphicsItem import UIGraphicsItem
__all__ = ['VTickGroup']
class VTickGroup(... |
the-stack_0_5170 | # 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_0_5171 | from typing import Any, Dict, Iterable
def filter_dict(d: Dict[str, Any], exclude: Iterable[str]) -> Dict[str, Any]:
"""Return a new dict with specified keys excluded from the original dict
Args:
d (dict): original dict
exclude (list): The keys that are excluded
"""
result: Dict[str, ... |
the-stack_0_5173 | #!/usr/bin/env python3
# from __future__ import print_function
"""
@summary: Timing transactions that are getting into the chain
@version: v46 (03/January/2019)
@since: 17/April/2018
@organization:
@author: https://github.com/drandreaskrueger
@see: https://github.com/drandreaskrueger/chainhammer for updates
"... |
the-stack_0_5175 | from yt.fields.field_info_container import FieldInfoContainer
from yt.fields.magnetic_field import setup_magnetic_field_aliases
from yt.fields.species_fields import add_species_field_by_density, setup_species_fields
from yt.frontends.gadget.fields import GadgetFieldInfo
from yt.frontends.sph.fields import SPHFieldInfo
... |
the-stack_0_5178 | import abc
import builtins
import collections
import collections.abc
import copy
from itertools import permutations
import pickle
from random import choice
import sys
from test import support
import threading
import time
import typing
import unittest
import unittest.mock
import os
import weakref
import gc
from weakref ... |
the-stack_0_5179 | import PIL
import numpy as np
from datetime import datetime
from django.conf import settings
import anodos.tools
import swarm.models
import pflops.models
import distributors.models
import swarm.workers.worker
class Worker(swarm.workers.worker.Worker):
name = 'Service'
def __init__(self):
self.coun... |
the-stack_0_5180 | """
Item Exporters are used to export/serialize items into different formats.
"""
import csv
import io
import pprint
import marshal
import warnings
import pickle
from xml.sax.saxutils import XMLGenerator
from scrapy.utils.serialize import ScrapyJSONEncoder
from scrapy.utils.python import to_bytes, to_unicode, is_list... |
the-stack_0_5187 | from __future__ import print_function
from PIL import Image
from os.path import join
import os
import torch.utils.data as data
from utils import download_url, check_integrity, list_dir, list_files
import torch
import torchvision
from torchvision import transforms
from sampler import RandSubClassSampler
class Omniglot(... |
the-stack_0_5188 | # -*- coding: utf-8 -*-
"""Cisco DNA Center ComplianceDetailsOfDevice data model.
Copyright (c) 2019-2021 Cisco Systems.
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, inclu... |
the-stack_0_5190 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# 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 modifications or derivative wo... |
the-stack_0_5191 | # THIS IS PART 2 SINCE I SKIPPED BADLIBS!
from random import randint
import sys
guess_this_number = randint(1,10)
guess = 0
guesses = 0
clue = ""
first_round = True
while guess != guess_this_number:
if first_round == True:
guess = int(input("Enter an integer number: "))
firs... |
the-stack_0_5192 | import os
import subprocess
import sys
from functools import partial
from sofa_config import *
from sofa_print import *
def sofa_viz(cfg):
sofa_home = os.path.dirname(os.path.realpath(__file__))
subprocess.Popen(
['bash', '-c', 'cp %s/../sofaboard/* %s;' % (sofa_home, cfg.logdir)])
subprocess.Po... |
the-stack_0_5193 | import traceback
from queue import Empty
from queue import Queue
from threading import Thread
from .promise import Promise
class Task(object):
"""
Task runs a python function `target` when called.
"""
def __init__(self, target, *args, **kwargs):
"""Initialize the Task object."""
se... |
the-stack_0_5195 | #coding:utf-8
import pyglet
window = pyglet.window.Window()
label = pyglet.text.Label('Hello, world',
font_name='Times New Roman',
font_size=36,
x=window.width//2, y=window.height//2,
anchor_x='center', anchor_y='c... |
the-stack_0_5196 |
from env import *
from replayBuffer import *
from params import *
env = HyperGraphEnv()
tf_env = TFPyEnvironment(env)
#hypermaramters
fc_layer_params=[64,64,64,64,64,64]
q_net = QRnnNetwork(tf_env.observation_spec(), tf_env.action_spec(), lstm_size=(16,))
q_net_2 = q_net = QNetwork(
tf_env.observation_spec()... |
the-stack_0_5198 | #!/usr/bin/env python
'''
some index fastq's have a weird number of quality line characters. some have an extra
character; others seem to have a single character.
this script truncates quality lines longer than the sequence line and pads quality
lines that are shorter than the sequence line.
author : scott w olesen ... |
the-stack_0_5199 | from typing import Optional
import os
from fastapi import FastAPI
app = FastAPI()
# multiple path parameters.
@app.get("/users/{user_id}/items/{item_id}")
async def read_user_item(
user_id: int,
item_id: str,
q: Optional[str] = None,
short: bool = False
):
# http://127.0.0.1:11111/users/1/items/b... |
the-stack_0_5201 | import platform
import torch
#
from utils.dataset import train_data, test_data
from utils.model import SimpleLinear, SimpleCNN
from train import train
from test import test
if __name__ == '__main__':
# == Setting ==
device = torch.device('cpu')
# == Model ==
model = SimpleCNN()
model = model.to(de... |
the-stack_0_5202 | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 25 13:08:16 2020
@author: haolinl
"""
import copy
import os
import time
import numpy as np
import random
import scipy.io # For extracting data from .mat file
class inputFileGenerator(object):
"""
Generate input file for Abaqus.
Unit s... |
the-stack_0_5204 | # Copyright (c) WiPhy Development Team
# This library is released under the MIT License, see LICENSE.txt
import os
import unittest
import numpy as np
import numpy as np
import wiphy.util.general as me
import wiphy.code.modulator as mod
import wiphy.code.im as im
import wiphy.code.duc as duc
class Test(unittest.Test... |
the-stack_0_5205 | import numpy as np
import matplotlib.pyplot as plt
from modelling.utilities import ProgressBar
class Solver:
def __init__(self, function, initial=np.array([0,0])):
self._function = function
self._initial = initial
self._solution = np.array([])
self._solutions = np.zeros((len(functio... |
the-stack_0_5206 | # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
from __future__ import absolute_import
import pytest # noqa: F401
import numpy as np # noqa: F401
import awkward as ak # noqa: F401
def test_empty_listarray():
a = ak.Array(
ak.layout.ListArray64(
ak.l... |
the-stack_0_5208 | """
Sponge Knowledge Base
Demo Plus
"""
from java.lang import System
from os import listdir
from os.path import isfile, join, isdir
class DrawAndUploadDoodle(Action):
def onConfigure(self):
self.withLabel("Draw and upload a doodle").withDescription("Shows a canvas to draw a doodle and uploads it to the se... |
the-stack_0_5209 | """
Support for SSH access.
For more details about this platform, please refer to the documentation at
https://github.com/custom-components/switch.ssh
"""
import base64
import paramiko
import logging
import voluptuous as vol
from datetime import timedelta
import json
import asyncio
from homeassistant.helpers.entity ... |
the-stack_0_5210 | import datetime
from moto.organizations import utils
def test_make_random_org_id():
org_id = utils.make_random_org_id()
org_id.should.match(utils.ORG_ID_REGEX)
def test_make_random_root_id():
root_id = utils.make_random_root_id()
root_id.should.match(utils.ROOT_ID_REGEX)
def test_make_random_ou_id... |
the-stack_0_5211 | # flake8: noqa
from . import dataclasses
from .class_validators import root_validator, validator
from .decorator import validate_arguments
from .env_settings import BaseSettings
from .error_wrappers import ValidationError
from .errors import *
from .fields import Field, Required, Schema
from .main import *
from .networ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.