text stringlengths 2 999k |
|---|
"""This file is auto-generated by setup.py, please do not alter."""
__version__ = "0.0.3"
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Python version: 3.6
import yaml
import time
from core.test import test_img
from utils.Fed import FedAvg, FedAvgGradient
from models.SvrgUpdate import LocalUpdate
from utils.options import args_parser
from utils.dataset_normal import load_data
from models.ModelBuilder imp... |
"""
Simple dynamic model of a LI battery.
"""
from __future__ import print_function, division, absolute_import
import numpy as np
from scipy.interpolate import Akima1DInterpolator
from openmdao.api import ExplicitComponent
# Data for open circuit voltage model.
train_SOC = np.array([0., 0.1, 0.25, 0.5, 0.75, 0.9, 1.... |
# Copyright 2022 The EvoJAX 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 w... |
# correct version.py is written by setup.py
# this is a backup in case that one isn't written
version = "Unknown"
full_version = \
"Unknown: Incorrect installation. Use pip or setup.py to install"
|
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
import struct
import socket
from .util import get_random_id, validate_int, validate_bytes, disconnect
from .packet import AlfredVersion, AlfredPacketType
from .exceptions import *
class ... |
#!/usr/bin/python
from .elements import Outputs, Parameters, Summary
def new_parameters(parms_dict):
return Parameters(parms=parms_dict)
def parameters(boto3_session, stack_name):
return Parameters(_get_stack(boto3_session, stack_name))
def outputs(boto3_session, stack_name):
return Outputs(_get_stac... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilitie... |
"""ApiGatewayV2Backend class with methods for supported APIs."""
import random
import string
import yaml
from moto.core import BaseBackend, BaseModel
from moto.core.utils import BackendDict, unix_time
from moto.utilities.tagging_service import TaggingService
from .exceptions import (
ApiNotFound,
AuthorizerNo... |
# Copyright (C) 2013,2014 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013,2014 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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
#
... |
from datetime import timedelta
from enum import Enum
import re
import os
from typing import Any, Dict, List, Optional, Union
import yaml
from .utils import resolve_type, substitute_env_vars
"""
This implements a simple semi-declarative configuration system based on type
annotations. Configuration objects derive fro... |
from textwrap import dedent
from numbers import Number
import warnings
from colorsys import rgb_to_hls
from functools import partial
import numpy as np
import pandas as pd
try:
from scipy.stats import gaussian_kde
_no_scipy = False
except ImportError:
from .external.kde import gaussian_kde
_no_scipy = ... |
import subprocess
import sys
def check_language(language):
#checks if the language input is valid. If invalid,program quits
accepted=["c", "c++", "java", "pasc", "m2", "lisp", "mira", "8086"]
if language not in accepted:
print("language not accepted")
quit()
################
#Take u... |
try:
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
except ImportError:
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from libs.lib import newIcon, labelValidator
BB = QDialogButtonBox
class LabelDialog(QDialog):
def __init__(self, text="Enter objec... |
class PartItemController():
def __init__(self, part_item, model_part):
self._part_item = part_item
self._model_part = model_part
# end def
connections = [
('partZDimensionsChangedSignal', 'partZDimensionsChangedSlot'), # noqa
('partParentChangedSignal', 'partParen... |
class Solution:
def romanToInt(self, s: str) -> int:
values = {"I": 1, "V": 5, "X": 10, "L": 50, "C": 100, "D": 500, "M": 1000}
ans = 0
for i, c in enumerate(s):
ans += values[c]
if i and (values[s[i]] > values[s[i - 1]]):
ans -= 2 * values[s[i - ... |
import utils, torch, time, os, pickle
import numpy as np
import torch.nn as nn
import torch.optim as optim
from dataloader import dataloader
import copy
class generator(nn.Module):
# Network Architecture is exactly same as in infoGAN (https://arxiv.org/abs/1606.03657)
# Architecture : FC1024_BR-FC7x7x128_BR-(... |
from django.contrib import admin
# Register your models here.
from .models import bitly
admin.site.register(bitly) |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# @Date : 2020/6/29
# @Author : mingming.xu
# @Email : xv44586@gmail.com
from setuptools import setup, find_packages
setup(
name='toolkit4nlp',
version='0.6.0',
description='an toolkit for nlp research',
long_description='toolkit4nlp: https://github... |
from django.contrib import admin
from ticker_app import models
class ExchangeTickerAdmin(admin.ModelAdmin):
list_display = [field.name for field in models.ExchangeTicker._meta.fields]
class Meta:
model = models.ExchangeTicker
admin.site.register(models.ExchangeTicker, ExchangeTickerAdmin)
|
from os.path import join
import logging
########################################################################################################################
# Connection/Auth
########################################################################################################################
# API URL.
... |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
"""
Desenvolva um script que calcule a soma dos N primeiros números naturais. Utilize a recursividade para obter o resultado.
"""
def soma(n):
if n == 1:
return 1
else:
return n + soma(n - 1)
print(soma(3)) |
import numbers
import torch
import torch.nn as nn
class DCGAN_D(nn.Module):
def __init__(self, isize, nz, nc, ndf, n_extra_layers=0, use_batch_norm=True):
super(DCGAN_D, self).__init__()
if isinstance(isize, numbers.Number):
isize = (int(isize), int(isize))
assert len(isize)... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... |
import pytest
from optconstruct.types.argument import Argument
from optconstruct.types.toggle import Toggle
from optconstruct.types.dummy import Dummy
from optconstruct.types.prefixed import Prefixed
from optconstruct.optionabstract import OptionAbstract
def test_abstract_generate():
obj = OptionAbstract('', '')... |
#!/usr/bin/python3
# -*- coding:utf-8 -*-
# @Time : 2018/8/17 0:28
# @Author : Bill Steve
# @Email : billsteve@126.com
# @File : City.py
# @Software : PyCharm
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from .BaseModel import *
Base = d... |
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# Copyright (c) 2009, Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# d... |
# -*- coding: utf-8 -*-
# @Author : Yupeng Hou
# @Email : houyupeng@ruc.edu.cn
# @File : sampler.py
# UPDATE
# @Time : 2020/8/17, 2020/8/31, 2020/10/6, 2020/9/18
# @Author : Xingyu Pan, Kaiyuan Li, Yupeng Hou, Yushuo Chen
# @email : panxy@ruc.edu.cn, tsotfsk@outlook.com, houyupeng@ruc.edu.cn, chenyushuo@ruc.edu.... |
from flask import abort, jsonify, request, g
from application.misc.query_wrapper import QueryWrapper
from application.auth.required import auth_required
class JobTargetTemplate(QueryWrapper):
decorators = [auth_required] # Jobs are bound to a user, so we must authenticate
def get(self):
job_id = req... |
from ..graph.node import Node
class Environment(object):
def __init__(self, envMap):
self.envMap = envMap
def isValidPoint(self, point):
pass
class GridEnvironment(Environment):
def __init__(self, envMap, rows, cols):
super(GridEnvironment, self).__init__(envMap)
self.rows... |
import numpy as np
from tensorflow.keras.layers import *
from tensorflow.keras import backend as K
import tensorflow as tf
__all__ =["SubpixelLayer2D","conv_up","SubpixelLayer2D_log"]
class SubpixelLayer2D(Layer):
def __init__(self,filters=None,ksz=1, scale=2, **kwargs):
self.scale=scale
self.out... |
# (c) 2012, Jan-Piet Mens <jpmens(at)gmail.com>
#
# This file is part of Ansible
#
# Ansible 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 ver... |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLES1 import _types as _cs
# End users want this...
from OpenGL.raw.GLES1._types import *
from OpenGL.raw.GLES1 import _errors
from OpenGL.constant import Constant as _C
... |
import RPi.GPIO as GPIO
import time
# Set counter to limit running time
def count(timer):
for i in range(1,timer):
time.sleep(1)
timer-=1
print(timer)
while True:
# Setup trigger and echo
GPIO.setmode(GPIO.BOARD)
TRIG=11
ECHO=13
GPIO.setup(TRIG,GPIO.OUT)
GPIO.setup... |
#!/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 = '''
---
module: rax_keypair
short_description: Create a keypair for use wit... |
#!/usr/bin/env python3
import numpy as np
from astropy.wcs import WCS
from astropy.utils.exceptions import AstropyWarning
import os,time,vos,warnings
from astropy.io import fits
warnings.filterwarnings('ignore')
def CFIS_tile_radec(ra,dec):
# find tile (see Stacking in docs)
# https://www.cadc-ccda.hia-iha.nr... |
CLASSIFIERS = {
"Development Status :: 1 - Planning",
"Development Status :: 2 - Pre-Alpha",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Development Status :: 5 - Production/Stable",
"Development Status :: 6 - Mature",
"Development Status :: 7 - Inactive",
"Envi... |
from flask import Flask, render_template, flash, redirect, url_for, session, logging, request, Response
import requests
from urllib.request import urlopen
import os
import static.files.running as running
from pyDes import des
from pyfladesk import init_gui
import subprocess
import hashlib
import time
from random import... |
import requests
import zipfile
import shutil
import csv
import pandas as pd
from datetime import date
from datetime import datetime
from pathlib import Path
from urllib.parse import urlparse
class BhavCopy(object):
"""description of class"""
def __init__(self, date: date):
self.date = date
self... |
from setuptools import setup, find_packages
from setuptools.extension import Extension
import os
import glob
version = '2.0'
platform = os.uname()[0]
if not platform == 'Darwin':
c_ext = Extension("facs/_facs", define_macros = [('NODEBUG', '1'), ('FILE_OFFSET_BITS', '64'), ('LARGE_FILE', '1')],
sources = [f f... |
#!/usr/bin/python
# Generate arbitrary onset and offset timing gratings.
#
# Copyright (C) 2010-2011 Huang Xin
#
# See LICENSE.TXT that came with this file.
from __future__ import division
import sys
import random
import numpy as np
from StimControl.LightStim.SweepSeque import TimingSeque
from StimControl.LightStim.Li... |
from functools import partial
from ignite.metrics import EpochMetric
def average_precision_compute_fn(y_preds, y_targets, activation=None):
try:
from sklearn.metrics import average_precision_score
except ImportError:
raise RuntimeError("This contrib module requires sklearn to be installed.")
... |
class Solution:
def isAlienSorted(self, words: List[str], order: str) -> bool:
# handle the edge case, as well as a cheap optimization
if len(words) <= 1:
return True
letter_order = {}
for rank, letter in enumerate(order):
letter_order[letter] = rank
... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... |
import logging
from django.db.models import Q
from django.http import HttpResponse
from django.utils import timezone
from zentral.contrib.mdm.models import (ArtifactType, ArtifactVersion,
Channel, CommandStatus,
DeviceCommand, UserCommand)
... |
import unittest
from .exceptions import *
class ExceptionsTests(unittest.TestCase):
def test_str(self):
for exception, exception_str in [
(
InvalidHandshake("Invalid request"),
"Invalid request",
),
(
AbortHandshake(200,... |
class Node:
def __init__(self, info):
self.info = info
self.left = None
self.right = None
self.level = None
def __str__(self):
return str(self.info)
class BinarySearchTree:
def __init__(self):
self.root = None
def create(self, val):
i... |
import json
import numpy as np
from scipy import sparse
from nilearn._utils import rename_parameters
from .. import datasets
from . import cm
from .js_plotting_utils import (add_js_lib, mesh_to_plotly,
encode, colorscale, get_html_template,
to_color_str... |
"""
numpy and scipy based backend.
Transparently handles scipy.sparse matrices as input.
"""
from __future__ import division, absolute_import
import numpy as np
import scipy.sparse
import scipy.sparse.linalg
import scipy.linalg
def inv(matrix):
"""
Calculate the inverse of a matrix.
Uses the standard ``... |
import os
import subprocess
from avatar2 import *
filename = 'a.out'
GDB_PORT = 1234
# This is a bare minimum elf-file, gracefully compiled from
# https://github.com/abraithwaite/teensy
tiny_elf = (b'\x7f\x45\x4c\x46\x02\x01\x01\x00\xb3\x2a\x31\xc0\xff\xc0\xcd\x80'
b'\x02\x00\x3e\x00\x01\x00\... |
import collections.abc
import io
import os
import sys
import errno
import pathlib
import pickle
import socket
import stat
import tempfile
import unittest
from unittest import mock
from test import support
from test.support import TESTFN, FakePath
try:
import grp, pwd
except ImportError:
grp = pwd = None
cla... |
from torch import nn
#from torch.autograd import Variable
import torch
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
import numpy as np
#from models.vgg_tro_channel1 import vgg16_bn
from recognizer.models.vgg_tro_channel3 import vgg16_bn, vgg19_bn
#torch.cuda.set_device(1)
cuda = torch.devic... |
from __future__ import unicode_literals
from django.contrib.auth.forms import AuthenticationForm
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions
f... |
"""Contains the main display widget used for representing an entire device."""
import enum
import inspect
import logging
import os
import pathlib
import webbrowser
from typing import List, Optional, Union
import ophyd
import pcdsutils
import pydm.display
import pydm.exception
import pydm.utilities
from pcdsutils.qt i... |
"""
`feature_utils.py`
-------------------
Extract different types of features based on the properties of nodes within the AST or within the graph.
@author: Thao Nguyen (@thaonguyen19)
License: CC-BY 4.0
"""
import numpy as np
import ast_utils
import gensim
import re
class FeatureExtractor():
def __init__(self... |
import numpy as np
import matplotlib.pyplot as plt
Q= 8
N=5
A=2
step_size=0.5
iterations =400
gamma =.92
al = 0.05
phi = np.ones(Q)
chi= np.ones((Q,A))
shi= np.ones((N,Q,N,Q,A)) # Dimension(i,q0,j,q_next,a)
def softmax_intialmemory(phi):
alpha = np.exp(phi)
alpha /= np.sum(alpha)
q_0 = np.random.choice(Q,p... |
# terrascript/data/digitalocean.py
import terrascript
class digitalocean_account(terrascript.Data):
pass
class digitalocean_certificate(terrascript.Data):
pass
class digitalocean_container_registry(terrascript.Data):
pass
class digitalocean_database_cluster(terrascript.Data):
pass
class digita... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... |
from __future__ import division
import logbook
import numpy as np
import pandas as pd
from pandas.lib import checknull
try:
# optional cython based OrderedDict
from cyordereddict import OrderedDict
except ImportError:
from collections import OrderedDict
from six import iteritems, itervalues
from zipline.p... |
""" Calls functions with RFont object's children.
Calls functions with RFont object's children. RFont object's child is one of the
RGlyph, RContour and RPoint. This module helps you to iterate RFont object easily.
Last modified date: 2019/09/26
Created by Seongju Woo.
"""
from functools import wraps
def iter_with_f... |
# Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return "<h1>Hello Jenkins</h1>"
if __name__ == '__main__':
app.run(host="0.0.0.0", port=5001)
|
'''
@author: DiedeKemper
Trains a random forest to the data with features per business.
Gives a classification for the test data.
'''
from sklearn import cross_validation
from sklearn.ensemble import RandomForestClassifier
from CreateClassification import create
from CreateClassification import createProbFile
from Loa... |
import pytest
import bluesky.plan_stubs as bps
from bluesky_adaptive.per_start import adaptive_plan
from bluesky_adaptive.on_stop import recommender_factory
def test_scipy_minimize_recommender(RE, hw):
pytest.importorskip("scipy")
from bluesky_adaptive.scipy_reccomendations import MinimizerReccomender
r... |
import json
import requests
from dragoneye.utils.app_logger import logger
from dragoneye.dragoneye_exception import DragoneyeException
class AzureAuthorizer:
@staticmethod
def get_authorization_token(tenant_id: str, client_id: str, client_secret: str) -> str:
logger.info('Will try to generate JWT be... |
import math
def get_bigger_rect(r1, r2):
"""
Returns bigger rectangle.
If given two rectangles have the same size then returns first one
"""
r1_x, r1_y, r1_x2, r1_y2, r1_w, r1_h = __get_rectangle_with_bounds(r1)
r2_x, r2_y, r2_x2, r2_y2, r2_w, r2_h = __get_rectangle_with_bounds(r2)
... |
import math
import random as rn
import sys
from greedy_functions import greedy_optimization, calcola_scenario
from graph_functions import minimum_spanning_tree
from utility_functions import get_gateways_classes, set_verbosity
from display_functions import find_sensor_by_id
from feasibility_functions import controlla_am... |
import tempfile
import subprocess
import re
FILENAME_RE = re.compile(r'^ - "(.+?)"')
PROGRESS_RE = re.compile(r'^\[.*?(\d{1,3}.\d)% +(.+B/s)')
FILTERED_STRINGS = [b"\x1b[K", b"\r", b"\n"]
def extract_gui():
with tempfile.TemporaryDirectory() as tempdir:
innoextract_cmd = [INNOEXTRACT_BIN, "-e", "-q", "--... |
from client.TemplateManager.TemplateManager import template_manager
from db.model.Bill import Bill
def bill_client_routes(app):
@app.route("/summarization", methods=['GET'])
def get_bills():
return template_manager.get_template('bill.html')
@app.route("/bill", methods=['GET'])
def get_bill_nu... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
"""
Tests tleap tools.
"""
import random as random
import shutil
import pytest
from paprika.align import *
from paprika.dummy import *
from paprika.tleap import *
@pytest.fixture
def clean_files(directory=os.path.join(os.path.dirname(__file__), "tmp")):
# This happens before the test function call
if os.pa... |
import pytest
from random import seed
from data_reader.dataset import EmailDataset
from adlib.learners.simple_learner import SimpleLearner
from sklearn import svm
@pytest.fixture
def data():
dataset = EmailDataset(path='./data_reader/data/test/100_instance_debug.csv', raw=False)
# set a seed so we get the sam... |
MONGODB_SETTINGS = {'DB': 'todo_db'}
|
#!/usr/bin/python3
from __future__ import print_function
import datetime
from scrape_bioarxiv import *
if __name__ == "__main__":
start_date = datetime.date(2016, 1, 11)
scrape_articles(start_date=start_date)
|
# -*- coding:utf-8 -*-
import os
import sys
path = os.path.dirname(__file__) + os.sep + '..' + os.sep
sys.path.append(path)
from tools.util import *
from tools.mydb import *
def get_daily():
list_sql = '''
select * from cn_stocks_info;
'''
start = datetime.now()
stk_info... |
#!/usr/bin/env cmsRun
import FWCore.ParameterSet.Config as cms
process = cms.Process("Geometry")
readGeometryFromDB = False
# N.B. for the time being we load the geometry from local
# XML, whle in future we will have to use the DB. This is
# only a temporary hack, since the material description has
# been updated i... |
# coding=utf-8
"""
THE SERVICE, STRUCTURE.
"""
import json
from dicttoxml import dicttoxml
from src import *
from src.custom.handlers import CustomJSONEncoder
from src.estimator import *
class CovidService(object):
"""
SERVICE CLASS FOR HANDLING COVID REQUESTS
"""
@classmethod
def hash_data(c... |
from .._tier0 import create_matrix_from_pointlists
from .._tier0 import execute
from .._tier0 import plugin_function
from .._tier0 import Image
@plugin_function(output_creator=create_matrix_from_pointlists)
def generate_angle_matrix(coordinate_list1 :Image, coordinate_list2 :Image, angle_matrix_destination :Image = No... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Setup script for GDAL Python bindings.
# Inspired by psycopg2 setup.py file
# http://www.initd.org/tracker/psycopg/browser/psycopg2/trunk/setup.py
# Howard Butler hobu.inc@gmail.com
gdal_version = '3.1.0'
import sys
import os
from glob import glob
from distutils.sysc... |
import cProfile
import timeit
import pyfiglet
import click
from flask.cli import with_appcontext
from src.extensions import db
from src.routes.fibonacci import subset_sum_from_fibonacci_set
@click.command(name='create_database')
@with_appcontext
def create_db():
db.create_all()
@click.command(name='fib_benchm... |
import psycopg2
import psycopg2.extras
def get_output_params_names(db_config_params):
""" Gets the names of the output parameters from the database
Args:
db_config_params (dict): contains the connection parameters of the database
Returns:
list: contains the name of the ou... |
#!/usr/bin/env python
# coding: utf-8
# # Spherical and Cylindrical Coordinates
# 
# <i>Caption</i>: The spherical coordinate system (red axes) uses radius r (the distance from the origin which is often the center of the body), theta $\theta$ (the angle between the x and y... |
# Version: 5.1
# Architecture: i386
import vstruct
from vstruct.primitives import *
POLICY_AUDIT_EVENT_TYPE = v_enum()
POLICY_AUDIT_EVENT_TYPE.AuditCategorySystem = 0
POLICY_AUDIT_EVENT_TYPE.AuditCategoryLogon = 1
POLICY_AUDIT_EVENT_TYPE.AuditCategoryObjectAccess = 2
POLICY_AUDIT_EVENT_TYPE.AuditCategoryPrivi... |
from Core.IFactory import IFactory
from Regs.Block_0 import R0002
class R0002Factory(IFactory):
def create_block_object(self, line):
self.r0002 = _r0002 = R0002()
_r0002.reg_list = line
return _r0002 |
# Copyright 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, softwa... |
# pylint: disable=W0621
import os
from dataclasses import dataclass, field
from pathlib import Path
import pytest
from bentoctl.operator import get_local_operator_registry
from bentoctl.operator.registry import OperatorRegistry
TESTOP_PATH = os.path.join(os.path.dirname(__file__), "test-operator")
@pytest.fixture
... |
import xml.etree.ElementTree as ET
import numpy as np
from PIL import Image
import glob
class MaskDataset:
def __init__(self):
# 根目录;数据路径;
self.root = '/home/team/xiaonan/dataset/mask/'
self.data_path = {
'sample': self.root,
'train': self.root,
'test': ... |
from __future__ import absolute_import
from __future__ import print_function
import veriloggen
import dataflow_connect
expected_verilog = """
module test
(
);
reg CLK;
reg RST;
main
uut
(
.CLK(CLK),
.RST(RST)
);
initial begin
$dumpfile("uut.vcd");
$dumpvars(0, uut, CLK, RST);
end
... |
from __future__ import print_function
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
torch.backends.cudnn.bencmark = True
import os,sys,cv2,random,datetime
import argparse
import numpy as np
import zipfile
from dataset import ImageDa... |
from django.contrib import admin
# Register your models here.
from .models import *
admin.site.register(User)
admin.site.register(Course)
admin.site.register(Quiz)
admin.site.register(Student)
admin.site.register(Question)
admin.site.register(Subject) |
import flask
from flask_required_args import required_data
app = flask.Flask(__name__)
@app.route("/")
@required_data
def home():
return 'ok'
@app.route("/<name>")
@required_data
def get_name(name):
return name
@app.route('/hello', methods=['POST'])
@required_data
def hello_name(name="World"):
retur... |
# This function will take an irregular list composed of lists
# and flatten it
from compiler.ast import flatten
class FilterModule (object):
def filters(self):
return {
"flatten": flatten
}
|
# Python module for handling calculations for times and dates
# www.scienceexposure.com
# Copyright 2015 Ismail Uddin
# 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.apach... |
from feature.feature import EmptyFeature
import tulipy as ti
class Vwap(EmptyFeature):
def __init__(self, lookback, raw_data_manager, history_lengh=None):
self.per = lookback
super().__init__(lookback, raw_data_manager,history_lengh=history_lengh)
def compute(self, data_dict):
close ... |
"""Sample download file shell command definition."""
import sys
import click
from gencove.command.common_cli_options import add_options, common_options
from gencove.constants import Credentials, Optionals
from gencove.logger import echo_error
from .main import DownloadFile
@click.command("download-file")
@click.ar... |
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
# -*- coding: utf-8 -*-
# Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
# -*- coding: utf-8 -*-
"""
RelatedViewFunction
~~~~~~~~~
:copyright: (c) 2018 by geeksaga.
:license: MIT LICENSE 2.0, see license for more details.
"""
from sqlalchemy import Column, Integer, ForeignKey
from sqlalchemy.orm import relationship, backref
from . import Base
class RelatedConditionScript... |
"""
Testing sum_for_list function
"""
# Created by Egor Kostan.
# GitHub: https://github.com/ikostan
# LinkedIn: https://www.linkedin.com/in/egor-kostan/
# ALGORITHMS NUMBERS ARRAYS
import allure
import unittest
from utils.log_func import print_log
from kyu_4.sum_by_factors.sum_for_list import sum_for_list
@all... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.