text stringlengths 1 927k |
|---|
import sys
import pprint
from rlpyt.utils.launching.affinity import affinity_from_code
from rlpyt.ul.algos.downstreams.bc_vel_regressor import VelRegressBc
from rlpyt.ul.runners.behavior_cloning import BehaviorCloning
from rlpyt.utils.logging.context import logger_context
from rlpyt.utils.launching.variant import load_... |
import os
import numpy as np
import torch
import shutil
import torchvision.transforms as transforms
from torch.autograd import Variable
import sklearn
from sklearn import metrics
from sklearn.metrics import roc_curve, auc
import pdb
class AvgrageMeter(object):
def __init__(self):
self.reset()
def re... |
#!/usr/bin/env python
# coding=utf-8
"""
Handles configuration updates for Bugbase
"""
from configparser import ExtendedInterpolation
import io
import logging
import os
from lib import constants
from lib.helper import Git
from lib.configuration.update.formatters import format_list_numbered, format_closed_question
fr... |
import json
import logging
from functools import reduce
import boto3
from samtranslator.model.exceptions import InvalidDocumentException
from samtranslator.translator.managed_policy_translator import ManagedPolicyLoader
from samtranslator.translator.transform import transform
from samtranslator.yaml_helper import yam... |
# Main network and testnet3 definitions
params = {
'argentum_main': {
'pubkey_address': 23,
'script_address': 5,
'genesis_hash': '88c667bc63167685e4e4da058fffdfe8e007e5abffd6855de52ad59df7bb0bb2'
},
'argentum_test': {
'pubkey_address': 111,
'script_address': 196,
... |
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import pins
from esphome.components import switch
from esphome.const import CONF_ID, CONF_INTERLOCK, CONF_PIN, CONF_RESTORE_MODE
from .. import gpio_ns
GPIOSwitch = gpio_ns.class_('GPIOSwitch', switch.Switch, cg.Component)
GPIOSwitchResto... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# Note: To use the 'upload' functionality of this file, you must:
# $ pip install twine
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
# Package meta-data.
NAME = 'p... |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from ydb.public.api.protos import ydb_scripting_pb2 as ydb_dot_public_dot_api_dot_protos_dot_ydb__scripting__pb2
class ScriptingServiceStub(object):
"""Mis... |
#!/usr/bin/python
from dateutil import parser
class User(object):
STATE_UNAPPROVED = 0
STATE_APPROVED = 1
STATE_REJECTED = 2
STATE_UNLICENSED = 3
STATUS_UNACTIVATED = 0
STATUS_ACTIVE = 1
STATUS_SUSPENDED = 2
STATUS_LOCKED = 3
STATUS_PASSWORD_EXPIRED = 4
STATUS_AWAITING_PASSW... |
# Copyright 2017-2021 Andrew Myers, David Grote, Weiqun Zhang
#
#
# This file is part of WarpX.
#
# License: BSD-3-Clause-LBNL
# This is intended to be a Python level example of how one might write a customized
# time stepping loop. This would replace the functionality of the WarpX::Evolve routine.
# Wrappers are avai... |
from sqlalchemy import (
Column,
Integer,
BigInteger,
Float,
Text,
String,
Date,
DateTime,
Boolean,
ARRAY,
ForeignKey,
UniqueConstraint,
Table
)
from sqlalchemy.orm import relationship
from geoalchemy2 import Geometry
import datetime
from .constant import Constant
... |
# Modifications Copyright 2016-2017 Reddit, Inc.
#
# Copyright 2013-2016 DataStax, 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
#
# Unle... |
'''
================================================
## VOICEBOOK REPOSITORY ##
================================================
repository name: voicebook
repository version: 1.0
repository link: https://github.com/jim-schwoebel/voicebook
author: Jim Schwoebel
author contact: js@neur... |
# coding: utf-8
"""
finAPI RESTful Services
finAPI RESTful Services # noqa: E501
OpenAPI spec version: v1.42.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
im... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
__all__ = (
'assert_input',
'refute_input',
'assert_page_title',
'assert_content_title',
'assert_breadcrums_title',
'assert_management_form_inputs',
'refute_delete_button',
'select_element',
)
def assert_input(response, name, value=None):
'''
Verify if the input with ``name`` ex... |
import collections
import json
from unittest import mock
import marshmallow_jsonapi
import pytest
from marshmallow_jsonapi import fields
from flask_jsonapi import api
from flask_jsonapi import filters_schema
from flask_jsonapi import resource_repository_views
from flask_jsonapi import resources
from flask_jsonapi.r... |
from binaryninja import BinaryReader, BinaryView
from typing import Callable, List, Union
import copy
from .vmt import DelphiVMT
from .constants import VMTOffsets
class DelphiAnalyzer(object):
'''
TODO: Doc
'''
def __init__(self, bv: BinaryView, delphi_version: int, offset_ptr_size = -1, start = -1,... |
from django.contrib import messages
from django.db import transaction
from django.db.models import Sum
from django.db.models.functions import Coalesce
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import redirect
from django.urls import reverse
from django.utils.translation import ugettext... |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup ------------------------------------------------------------... |
import pathlib
import argparse
import os
import re
import yaml
from collections import namedtuple, Counter
from typing import List, Dict, Union, Sequence, Optional, Callable, Iterable, Iterator, Tuple, Type
from tools.codegen.dest.lazy_ir import LazyIR, TSLazyIR
from tools.codegen.gen import get_grouped_native_function... |
#
# Copyright (C) 2021-2022 by TeamYukki@Github, < https://github.com/TeamYukki >.
#
# This file is part of < https://github.com/TeamYukki/YukkiMusicBot > project,
# and is released under the "GNU v3.0 License Agreement".
# Please see < https://github.com/TeamYukki/YukkiMusicBot/blob/master/LICENSE >
#
# All rights res... |
#!/usr/bin/env python3
#
# Copyright (c) 2019 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
import argparse
import yaml
from os import path
import sys
from pprint import pformat
PERMITTED_STR_KEYS = ['size', 'region']
END_TO_START = 'end_to_start'
START_TO_END = 'start_to_end'
C... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
#############################################################################
# Copyright (c) 2020 Huawei Technologies Co.,Ltd.
#
# openGauss is licensed under Mulan PSL v2.
# You can use this software according to the terms
# and conditions of the Mulan PSL v2.
# You may o... |
"""
Utility functions for find in project
"""
import gconf
import os
def filebrowser_root():
base = u'/apps/gedit-2/plugins/filebrowser/on_load'
client = gconf.client_get_default()
client.add_dir(base, gconf.CLIENT_PRELOAD_NONE)
path = os.path.join(base, u'virtual_root')
val = client.get(path)... |
import bpy
import os
import sys
sys.path.append(os.path.dirname(__file__))
from . import DataBase
from . import Versions
from . import MatDct
from . import DtbMaterial
from . import Util
from . import Global
from . import Poses
from bpy_extras.io_utils import ImportHelper
from bpy.props import StringProperty
from bpy.t... |
import argparse
import data_helper
from sklearn.model_selection import train_test_split
import re
import lstm
from lstm import *
import time
from viterbi import Viterbi
xrange = range
def simple_cut(text,dh,lm,viterbi):
"""对一个片段text(标点符号把句子划分为多个片段)进行预测。"""
if text:
#print("text: %s" %text)
te... |
# -*- coding: utf-8 -*-
import math
import random
import simpy
customers_count = 0
total_latency = 0
log_fd = open('single.log', 'a')
def cur_time(environment): # получение времени в читаемом виде для логов
seconds = environment.now
hours = int(seconds / 3600) % 24 + 9 # магазин начинает работу с 9 часов ... |
#!/usr/bin/env python
"""
Standard python setup.py file for CMSMonitoring
"""
import os
import sys
import fnmatch
import subprocess
from distutils.core import setup
def datafiles(dir, pattern=None):
"""Return list of data files in provided relative dir"""
files = []
for dirname, dirnames, filenames in os... |
# Copyright 2018 Sergio Oller
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribut... |
# -*- coding: utf-8 -*-
"""threat.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1RXBu5d8AKHr3Da4IIENHH_5YWWjXLYn4
"""
'''data = pd.read_csv("/content/drive/My Drive/New KS/Toxicity and Insult Detection/Training/Datasets/hatekeyword.csv")
threat... |
def make_subject(sector: str, year: str, q: str):
return f'[업종: {sector}] {year}년도 {q}분기'
def make_strong_tag(value: str):
return f'<strong>{value}</strong>'
def make_p_tag(value: str):
return f'<p>{value}</p>'
def make_img_tag(name: str, src: str):
return f'<img src="{src}" alt="{name}">'
def m... |
import gzip
import json
import logging
import os
import tempfile
import zipfile
import pytest
import retrying
import test_helpers
from dcos_test_utils.diagnostics import Diagnostics
from dcos_test_utils.helpers import check_json
__maintainer__ = 'mnaboka'
__contact__ = 'dcos-cluster-ops@mesosphere.io'
# Expected la... |
def gen259():
yield 2
yield 5
yield 9 |
#Embedded file name: ACEStream\Core\exceptions.pyo
class ACEStreamException(Exception):
def __init__(self, msg = None):
Exception.__init__(self, msg)
def __str__(self):
return str(self.__class__) + ': ' + Exception.__str__(self)
class OperationNotPossibleAtRuntimeException(ACEStreamExcepti... |
import logging
import logging.handlers
import utils
logfile = utils.GetApplicationDir() + "\\logs\\"
utils.ForceDirectories(logfile)
logfile = logfile + "test.log"
fileHandle = logging.handlers.TimedRotatingFileHandler(logfile,when='D',interval=1,backupCount=40) # 实例化handler
fmt = '%(levelno)s,%(asctime)s,%(pro... |
import constants
from model.LehnertGridworldModelHMM import LehnertGridworldModelHMM
from runners.bisim.lehnert_gridworld.LehnertGridworldGMM import LehnertGridworldGMMRunner
class LehnertGridworldHMMRunner(LehnertGridworldGMMRunner):
def __init__(self, runner_config, model_config):
super(LehnertGridwor... |
from core.model.meta_column import MetaColumn
from core.service.column_generator.base import SingleColumnGenerator, RegisteredGenerator
from core.service.column_generator.decorator import parameter
from core.service.data_source.data_provider import DataProvider
from core.service.generation_procedure.database import Gen... |
import os
import sys
import time
import re
import argparse
import numpy as np
from tqdm import tqdm
from tensorboardX import SummaryWriter
import matplotlib.pyplot as plt
plt.switch_backend('agg')
sys.path.append('../Utils')
from CPCTrans.dataset_3d import *
from CPCTrans.model_3d import *
from Backbone.resnet import... |
from ....twitter.twitter_user import TwitterUser
from ....genius.match import Match
from .. import utils
user = TwitterUser("MontellFish")
matcher = Match()
def test_basic_match():
query = ""
top_words = user.get_top_words()
word_limit = 1
for index, word_freq in enumerate(top_words):
query ... |
#!/usr/bin/env python3
# KicadModTree is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# KicadModTree is distributed in the hope that... |
# -*- coding: utf-8 -*-
"""
Global fixtures for testing CastorStudy
@author: R.C.A. van Linschoten
https://orcid.org/0000-0003-3052-596X
"""
pytest_plugins = [
"tests.test_castor_objects.fixtures_castor_objects",
"tests.test_integration.fixtures_integration",
"tests.test_api_endpoints.fixtures_api",
"... |
import numpy as np
def ids2str(encoder, ids, num_reserved):
if num_reserved:
if np.any(np.where(ids==1)[0]):
eos = np.where(ids==1)[0]
ids = ids[:eos[0]]
reserved_tokens = np.where(ids < num_reserved)[0]
if reserved_totkens.size > 0:
split_l... |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... |
# -*- coding: utf-8 -*-
# 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:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
from reentry import manager
manager.scan()
# -- Path setup --... |
import numpy as np
import os
import sys
import ntpath
import time
from . import util, html
from subprocess import Popen, PIPE
from scipy.misc import imresize
if sys.version_info[0] == 2:
VisdomExceptionBase = Exception
else:
VisdomExceptionBase = ConnectionError
def save_images(webpage, visuals, image_path, ... |
import os
import pprint
import shutil
import sys
import textwrap
from pathlib import Path
from typing import List
import pytest
from _pytest.config import ExitCode
from _pytest.fixtures import FixtureRequest
from _pytest.main import _in_venv
from _pytest.main import Session
from _pytest.monkeypatch import MonkeyPatch
... |
# Copyright 2014 The Oppia 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 applicable ... |
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Python source expertise for coverage.py"""
import os.path
import types
import zipimport
from coverage import env, files
from coverage.misc import (
contrac... |
#Copyright (c) 2009,2010 George Dahl
import numpy as num
from singleSoftmax import singleSoftmax
import cudamat as cm
class GaussianRBM(object):
def __init__(self, numVis, numHid, mbsz = 256, initHidBias = 0.0, initWeightSigma = 0.05):
self._mbsz = mbsz
self.numVis, self.numHid = numVis, numHid
... |
import js2py
js2py.translate_file('tk.js', 'tk.py') |
import logging
import numpy as np
from fbpca import pca
from scipy.stats import norm
from .sparseutils import nonzero_mean, nonzero_std, find_zeroed_indices
log = logging.getLogger("ALRA")
def choose_k(X, k=100, pval_thresh=1e-10, noise_start=80, n_iter=2):
if k > min(X.shape):
raise ValueError(
... |
import logging
import os
from threading import Thread
import celery
from firexapp.broker_manager.broker_factory import RedisManager
from firex_flame.controller import FlameAppController
from firex_flame.event_file_processor import process_recording_file
from firex_flame.event_broker_processor import BrokerEventConsum... |
from samtranslator.public.sdk.resource import SamResourceType
from samtranslator.public.intrinsics import is_intrinsics
from samtranslator.swagger.swagger import SwaggerEditor
from six import string_types
class Globals(object):
"""
Class to parse and process Globals section in SAM template. If a property is ... |
# -*- coding: utf-8 -*-
# File: eval.py
import itertools
import sys
import os
import json
import numpy as np
from collections import namedtuple
from concurrent.futures import ThreadPoolExecutor
from contextlib import ExitStack
import cv2
import pycocotools.mask as cocomask
import tqdm
import tensorflow as tf
from ten... |
# coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class GlanceAddImageMemberRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict)... |
# Copyright 2017 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... |
#!/usr/bin/python
#encoding=utf-8
import subprocess
pingP=subprocess.Popen(args=’ping –n 4 www.sina.com.cn’, shell=True, stdout = subprocess.PIPE)
pingP.wait() #等待进程完成
print pingP.stdout.read() #读取进程的输出信息
print pingP.pid
print pingP.returncode |
import csv
import copy
import datetime
import os
import re
import sys
import tempfile
from operator import attrgetter, itemgetter
from clockwork import db_connection, db_schema, isolate_dir, fastqc, lock_file, mykrobe, reference_dir, samtools_qc, utils
from clockwork import __version__ as clockwork_version
class Error... |
from .clean import Clean
from .create import Create
from .link import Link
from .shell import Shell |
#
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
import json
import logging
import os
import pkgutil
from abc import ABC, abstractmethod
from typing import Any, Mapping, Optional
import yaml
from airbyte_cdk.models import AirbyteConnectionStatus, ConnectorSpecification
def load_optional_package_file(pa... |
# generated by update to not change manually
import dataclasses as dt
import typing as t
from enum import Enum, Flag
from bungieapi.json import to_json
from bungieapi.types import ManifestReference
@dt.dataclass(frozen=True)
class DestinyProgression:
"""Information about a current character's status with a Progr... |
def decode(file_path):
import qrtools
qr = qrtools.QR()
qr.decode(file_path)
return qr.data
def encode(data, file_path):
import qrtools
qr = qrtools.QR(data.encode("utf-8"))
return qr.encode(filename=file_path)
def greetings(name):
return "Hello "+ name |
import unittest
from cradlepy.components.event import *
class EventStub(EventTrait):
pass
class EventHandlerStub(EventHandler):
pass
class TestEventObserver(unittest.TestCase):
def setUp(self):
def callback(self):
return self
self.instance = EventObserver(callback)
def ... |
import torch
from torch import nn
class Metric(nn.Module):
def __init__(self, name=None, **kwargs):
super().__init__()
self.name = name
self.reset_states()
def forward(self, *args, **kwargs):
raise NotImplementedError
def update_state(self):
raise NotImplementedE... |
# Generated by Django 2.1.3 on 2019-02-28 19:40
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("areas", "0002_add_contra... |
"Misc. utility functions/classes for admin documentation generator."
import re
from email.parser import HeaderParser
from email.errors import HeaderParseError
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from django.utils.encoding import force_bytes
try:
import docuti... |
# What file are we fitting?
file_name = 'FeNi_DAC11_P8a_030'
# What NRIXS experiment does this correspond to?
NRIXSexp = 'FeNi_DAC11_P8'
# How many background parameters do we need to fit the background?
bg_par_num = 4
# What range should we fit data in?
range_2theta = [22,30]
primaryphase = 'hcp FeNi'
# What phase... |
#!/usr/bin/env python
###############################################################################
# flight.py - A fast binning algorithm spinning off of the methodology of
# Lorikeet
###############################################################################
# ... |
from auto_yolo import envs
readme = "Testing yolo_air variational autoencoder with math."
distributions = None
durations = dict(
long=dict(
max_hosts=1, ppn=6, cpp=2, gpu_set="0,1", wall_time="24hours",
project="rpp-bengioy", cleanup_time="20mins",
slack_time="5mins", n_repeats=6, step_ti... |
# Generated by Django 4.0.2 on 2022-03-21 17:23
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
n... |
import pandas as pd
from pathlib import Path
from collections import Counter
import datetime
from collections import defaultdict
from faker import Factory
import faker
from preprocessing.nfeProvider import Invoice
import csv
def convert_to_numeric(num):
"""
Converte strings que representam valores monetários ... |
from __future__ import print_function, division
import os
import sys
import pytest
import warnings
import numpy
from galpy.util import galpyWarning
from test_actionAngle import reset_warning_registry
_TRAVIS= bool(os.getenv('TRAVIS'))
PY2= sys.version < '3'
# Print all galpyWarnings always for tests of warnings
warning... |
import csv
import os
fname = "./data/user_study/userStudy_yes_no_regional.csv"
fname_out = "./data_/correlation/userStudy_scores_regional.csv"
sentences_ = list()
actions = list()
bias_dict = dict()
with open(fname, "r") as f:
for i, line in enumerate(f.readlines()):
if i == 0:
continue
... |
# This should match the schema defined in external_deps.bzl.
REPOSITORY_LOCATIONS_SPEC = dict(
bazel_skylib = dict(
project_name = "bazel-skylib",
project_desc = "Common useful functions and rules for Bazel",
project_url = "https://github.com/bazelbuild/bazel-skylib",
version = "1.0.... |
"""
Ridge regression
"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# Reuben Fletcher-Costin <reuben.fletchercostin@gmail.com>
# Fabian Pedregosa <fabian@fseoane.net>
# Michael Eickenberg <michael.eickenberg@nsup.org>
# License: BSD 3 clause
from abc import ABCMeta, abstractmethod
impor... |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 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 mempool persistence.
By default, b3ccd will dump mempool on shutdown and
then reload it on startu... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 7
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_2_0
from i... |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "ur3_e_moveit_config"
PROJECT_SPACE_DI... |
# lambdata/__init__.py
# nothing to see here |
#!/usr/bin/env python2
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
fro... |
# Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... |
#!/bin/env python
#===============================================================================
# NAME: InstanceTopologyHTMLVisitor.py
#
# DESCRIPTION: A visitor responsible for the generation of HTML tables
# of event ID's, etc.
#
# AUTHOR: reder
# EMAIL: reder@jpl.nasa.gov
# DATE CREATED : Sep. 13, ... |
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import pytest
import contextlib
import os.path
import jsonschema
import llnl.util.cpu
import llnl.util.cpu.detect
impo... |
# coding: utf-8
"""
NiFi Rest API
The Rest API provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ... |
#
# 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... |
from setuptools import find_packages, setup
setup(
name="ownca-rest-api",
version="1.0.0",
url="https://github.com/ownca/ownca-rest-api",
author="Kairo de Araujo",
author_email="kairo@dearaujo.nl",
description="OwnCA REST API",
packages=find_packages(),
install_requires=["flask", "flask... |
# performing preprocessing part
from sklearn.preprocessing import StandardScaler
sc = StandardScaler()
X_train = sc.fit_transform(X_train)
X_test = sc.transform(X_test) |
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 24 23:18:54 2018
@author: Rupesh
"""
# Multiple Linear Regression
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
plt.style.use("ggplot")
# loading dependies
df = pd.read_csv("50_Startups.csv")
df.head()
X = df.iloc[:, :-... |
import markdown
from verto.VertoExtension import VertoExtension
from verto.tests.ProcessorTest import ProcessorTest
class ScratchInlineTest(ProcessorTest):
'''Scratch blocks are unique in that they override behaviour in markdown.
'''
def __init__(self, *args, **kwargs):
'''Sets name for loading t... |
import os
import subprocess
import typer
from typer.testing import CliRunner
from options.autocompletion import tutorial008 as mod
runner = CliRunner()
app = typer.Typer()
app.command()(mod.main)
def test_completion():
result = subprocess.run(
["coverage", "run", mod.__file__, " "],
stdout=sub... |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
"""
shared options and groups
The principle here is to define options once, but *not* instantiate them
globally. One reason being that options with action='append' can carry state
between parses. pip parses general options twice internally, and shouldn't
pass on state. To be consistent, all options will follow this de... |
import sys
import unittest
from typing import List
from unittest.mock import MagicMock
from src.dayof.day_8.model import random_gift_text
sys.modules['telegram'] = MagicMock()
sys.modules['telegram.ext'] = MagicMock()
sys.modules['src.commands'] = MagicMock()
sys.modules['src.config'] = MagicMock()
sys.modules['src.c... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.9.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import sys
import os
im... |
import pickle
'''
This code uses the saved neural net to solve the nim game.
Original output has 9 bits. Each bit of the output of NN is rounded to closest integer.
The three most significant bits tell us which pile should change.
The pile that has a value of 1 must change (the order is from left to right).
The 6 least... |
#!/usr/bin/env python3
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
import pandas as pd
import numpy as np
def load_csv(path, filter_no_labels=False, balance_labels=True, only_slice=False, no_slice=False):
'''Load feature vectors from a csv file.
Expects a header row with feature columns prefixed with 'F-' and
label columns prefixed with 'L-'.
@param filter_no_labels... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
"""
Most of the code here was initially stolen from C-lightning's test suite.
Credits to Rusty Russell and Christian Decker from Blockstream who wrote most
of the file i originally copied! (MIT licensed)
"""
from concurrent import futures
from ephemeral_port_reserve import reserve
from test_framework.bitcoind import Bi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.