text stringlengths 3.07k 12.6k |
|---|
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""The Controller class for Cities."""
import re
from flask import Blueprint, render_template, redirect, url_for, current_app, \
request, abort, flash
from modules.Countries.model import Country
from modules.Regions.model import Region
from modules.Cities.model import City... |
import numpy as np
import pandas as pd
"""
Defaultly, in/out paramters are numpy array.
"""
DyTalibExpAdjust = True # pandas默认是True,同花顺默认是False。True时,最近的值权重会大些。数据足够多的时候,趋向一致。
def WMA(X, W, N):
"""
加权移动平均值
@X: 观察值序列
@W: 权重序列
@N: 周期
"""
assert len(X) == len(W)
# ... |
"""Flask Celery Helper."""
import os
import tempfile
from functools import partial, wraps
from celery import _state, Celery as CeleryClass
from flask_celery.lock_manager import LockManager, select_lock_backend
__author__ = '@Salamek'
__license__ = 'MIT'
__version__ = '1.4.1'
class _CeleryState:
"""Remember th... |
import cv2
# import keyboard
import numpy as np
import open3d as o3d
import pygame
import os
import os.path as osp
import json
import time
from transforms3d.axangles import axangle2mat
import config
from capture import OpenCVCapture
from hand_mesh import HandMesh
from kinematics import mpii_to_mano
from utils import O... |
# bing images scraper
# runs in python 3
# tested on macbook air and macbook pro
# running macos high sierra
# by <NAME>
# august 2018
# python dependencies
# these dont need any installation
# os is used for doing directory operations
import os
# sys is used for retrieving arguments from the terminal
import sys
# tim... |
#! /usr/bin/env pyhton3
# -*- coding:utf-8 -*-
# @Date : 2021/07/01
# @Author : 5wimming
import zipfile
import json
import os
import csv
import requests
from ASE import settings
from StrategyModel.models import NvdCve
import logging
# cve_results = []
logger = logging.getLogger("mdjango")
def get_file_info(filep... |
'''
SSMix
Copyright (c) 2021-present NAVER Corp.
Apache License v2.0
'''
import argparse
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from transformers import AdamW, get_linear_schedule_with_warmup, set_seed
from classification_model import ClassificationModel
from trainer import Traine... |
import datetime
import os
import subprocess
import sys
from typing import Union
import click
from great_expectations import DataContext
from great_expectations import exceptions as ge_exceptions
from great_expectations.cli.datasource import (
get_batch_kwargs,
select_datasource,
)
from great_expectations.cli.... |
#!/usr/bin/env python3
import time
from pyexplain.explain.ocus_non_incr_explain import OCUSExplainNotIncremental
from pyexplain.explain.greedy_incr_shared_explain import GreedyIncrSharedExplain
from pyexplain.explain.greedy_incr_naive_explain import GreedyIncrNaiveExplain
from pyexplain.explain.greedy_explain import G... |
import pickle
from datetime import datetime
import numpy as np
import pandas as pd
import pytest
import sqlalchemy
from numpy.testing import assert_array_equal
from sqlalchemy import Float
from sqlalchemy import PickleType
from estimagic.logging.database_utilities import append_row
from estimagic.logging.database_uti... |
"""
Class for interfacing with the Intel RealSense D400-Series.
"""
import logging
import numpy as np
try:
import pyrealsense2 as rs
except ImportError:
logging.warning('Unable to import pyrealsense2.')
from perception import CameraIntrinsics, CameraSensor, ColorImage, DepthImage
class RealSenseRegistrationM... |
import pytest
import os
import numpy as np
import orbitize
from orbitize.driver import Driver
import orbitize.sampler as sampler
import orbitize.system as system
import orbitize.read_input as read_input
import orbitize.results as results
import matplotlib.pyplot as plt
def test_mcmc_runs(num_temps=0, num_threads=1):... |
import pygame, random, time, math
pygame.init()
w_width = 1100
w_height = 700
mid_x = w_width / 2
mid_y = w_height / 2
white = (255, 255, 255)
black = (0, 0, 0)
red = (255, 50, 50)
player_clicked = False
tile_size = 40
half_tile = tile_size / 2
tile_hyp = math.sqrt((tile_size**2) + (half_tile)**2)
map_size = 5
vil_coo... |
import bpy
from bpy.props import *
from ...nodes.BASE.node_tree import RenderStackNode
from ...utility import *
from ...preferences import get_pref
def update_node(self, context):
if len(self.var_collect_list) != 0:
self.update_parms()
def set_active_task(self, context):
if self.is_active_task is Tr... |
import os
import numpy as np
import matplotlib.pyplot as plt
import json
from sklearn.metrics import f1_score, precision_score, recall_score, accuracy_score, average_precision_score
from sklearn.metrics import precision_recall_curve, average_precision_score, confusion_matrix
from sklearn.preprocessing import OneHotEnco... |
import torch
import torch.nn as nn
import torch.distributions as D
class Pass(nn.Module):
def forward(self, x):
return x
class Flatten(nn.Module):
def forward(self, input: torch.Tensor):
return input.view(input.size(0), -1)
class UnFlatten(nn.Module):
def __init__(self, output_shape: t... |
import logging
import os
import re
import sys
import textwrap
import numpy as np
import pytest
from yt.config import ytcfg
from yt.loaders import load_sample
from yt.sample_data.api import get_data_registry_table
from yt.testing import requires_module_pytest
from yt.utilities.logger import ytLogger
@pytest.fixture(... |
import numpy as np
import scipy.linalg as sl
from scipy import special
from collections import deque
import functools as fts
import operator as op
class MDLCPStat_adwin2:
def __init__(self, lossfunc=None, how_to_drop = 'none'):
self.lossfunc = lnml_gaussian if lossfunc is None else lossfunc
self.h... |
import math
import numbers
import sys
from typing import Dict, Hashable, Optional, Union
from ..utils import FeatureQuantizer, GradHess, GradHessStats
from river.base.typing import FeatureName, Target
from river import stats
class SGTSplit:
""" Split Class of the Streaming Gradient Trees (SGT).
SGTs only h... |
"""
A number of function that enhance IDLE on MacOSX when it used as a normal
GUI application (as opposed to an X11 application).
"""
import sys
import Tkinter
from os import path
_appbundle = None
def runningAsOSXApp():
"""
Returns True if Python is running from within an app on OSX.
If so... |
import sympy as sp
import numpy as np
import matplotlib.pyplot as plt
import cyllene.f_aux as fa
# Reserve some (real-valued) symbols in Sympy
a, b, c, d, p, q, r, s, t, w, x, y, z = sp.symbols(
'a b c d p q r s t w x y z', real=True)
MYLOCALS = {'a': a, 'b': b, 'c': c, 'd': d, 'p': p, 'q': q, 'r': r,
... |
# 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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class GetMan... |
import mdpopups
import sublime
import html
import sublime_plugin
import webbrowser
try:
from typing import Any, List, Dict, Optional
assert Any and List and Dict and Optional
except ImportError:
pass
from .core.configurations import is_supported_syntax
from .core.registry import session_for_view, client_f... |
""" Assemblies List View. """
from io import BytesIO
import logging
import math
from scipy import stats
from cornice.service import Service
from matplotlib.backends.backend_agg import FigureCanvasAgg
import numpy as np
from numpy import random
from fabrikApi.models.assembly import DBAssembly
from fabrikApi.model... |
"""
Provides a binary sensor which is a collection of ffmpeg tools.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.ffmpeg/
"""
import logging
from os import path
import voluptuous as vol
import homeassistant.helpers.config_validation as c... |
"""
You must have an AWS account to use the Amazon Connect CTI Adapter.
Downloading and/or using the Amazon Connect CTI Adapter is subject to the terms of the AWS Customer Agreement,
AWS Service Terms, and AWS Privacy Notice.
© 2017, Amazon Web Services, Inc. or its affiliates. All rights reserved.
NOTE: Other licen... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# 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... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 7 16:31:07 2020
@author: mike_ubuntu
"""
import numpy as np
import copy
from collections import OrderedDict
from src.supplementary import Define_Derivatives
from src.term import Term
from src.trainer import Equation_Trainer
from src.supplementary... |
import configparser
import os
from enum import Enum
from marshmallow import Schema
from envmanager.exceptions import UnsupportedKeyType, EagerValidationError
from envmanager.utils.resources import ReservableEnvSections, ReservableEnvKeys
def is_primitive(obj):
return isinstance(obj, type)
def env_get(raw_key,... |
import pandas as pd, re, os, pickle
from tqdm.auto import tqdm
from nltk.corpus import words
def fetch_text(path):
return [i for i in open(path).read().splitlines() if i != '']
def clean_token(token):
patterns = re.compile("[\.£$*\",”\(\)\[\]!:“&;?˩˧]+" # Punctuation
"|<eng... |
import os
import numpy as np
import wradlib as wrl
#from wradlab
def open_dem(dem_fn='australia_250m_dem.tif', invalid_terrain=-9999):
"""
Open a DEM file for generating masks. returns variables required for wradlib processing
"""
rasterfile = wrl.util.get_wradlib_data_file(dem_fn)
ds = wrl.io.ope... |
"""Support for Start.ca Bandwidth Monitor."""
from __future__ import annotations
from datetime import timedelta
from http import HTTPStatus
import logging
from xml.parsers.expat import ExpatError
import async_timeout
import voluptuous as vol
import xmltodict
from homeassistant.components.sensor import (
PLATFORM... |
import logging
import numba as nb
import numpy as np
from scipy.ndimage import convolve1d
from skimage.transform import resize
logger = logging.getLogger(__name__)
def triangle_kernel(n):
H = (np.r_[:n+1,n-1:-1:-1]+1).astype("f")
return H / H.sum()
def gradients(image):
H = np.array([1,2,1], "f4")
... |
# Copyright (c) 2020 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... |
import sys
import ConfigParser #Should be configparser in python v3
import os
import shutil
import imp
#Check cmdline
if len(sys.argv) != 5:
print('Usage:' + sys.argv[0] + ' cluster-ini app-ini launch-py output-dir')
sys.exit(-1)
#Static portmap
raft_baseport=5000
dispatcher_baseport=7000
service_ports=5 # as... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
import os
import sys
import time
import json
import numbers
import operator
import platform
from test.pystone import main as my_expensive_code
from nose.tools import with_setup
from pybenchmark import profile, stats, kpystones, CpuInfo, MemInfo, GProfiler
from pybenchmark.gprofiler import Node
POSITIVE_BENCHMARK_TI... |
# WARNING!!!
# WARNING!!!
#
# BAD CODE BELOW!!!!!
import functools
import random
from dataclasses import dataclass
from typing import AsyncGenerator, Union
import aiohttp
from simple_avk import SimpleAVK
from mvcbotbase.message_classes import (
AttachmentType, OutgoingAttachment,
OutgoingFileAttachment, Attac... |
#! /usr/bin/python3
# External deps
import sys, os
import matplotlib.pyplot as plt
# Internal deps
os.chdir(sys.path[0])
sys.path.append("..")
from df_common import JSON_ARC, JSON_CMP_STR, JSON_CMP_CNT, JSON_PRI_CMP_CNT, JSON_LNE_CNT, GEN_FILE_DIR
import analyses_common as ac
if os.path.exists(os.path.join(GEN_FILE_... |
# NMol per ASU Calculations based on the Kantardjieff & Rupp method.
#
# Implementing the cell volume calculations of Kantardjieff and Rupp,
# Protein Science volume 12, 2002. Uses "nmol-params.dat" from
# http://www-structure.llnl.gov/mattprob
#
# Relies on $XIA2_ROOT/Data/nmol-params.dat
import logging
import math
... |
# pedir gt
# pedir bps
# pedir Ancho de banda
# numero de armonicos = bw/primeroArmonico
import math
from mpl_toolkits import mplot3d
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import matplotlib.pyplot as plt
fake_gt = input("Ingrese g(t)")
# for each character in fake_gt, ... |
import os
import pytest
import qcengine as qcng
import qcdb
from .addons import *
from .utils import *
@pytest.fixture
def h2o():
return """
O
H 1 R
H 1 R 2 A
R=0.958
A=104.5
"""
@pytest.fixture
def nh2():
return """
0 2
N
H 1 R
H 1 R 2 A
R=1.008
A=105.0
"""
@pytest.mark.parametri... |
from __future__ import absolute_import
import six
from django.db import transaction, IntegrityError
from django.db.models import Q
from rest_framework import serializers
from rest_framework.response import Response
from django.conf import settings
from sentry.app import locks
from sentry import roles, features
from s... |
import base64
from email.utils import parsedate_to_datetime
import json
import logging
import requests
LOG = logging.getLogger(__file__)
LOG.setLevel(logging.INFO)
class APIException(Exception):
def __init__(self, message, method, url, status_code, text):
self.message = message
self.method = met... |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... |
"""Load WiLI-Dataset."""
# Core Library modules
import codecs
import csv
import logging
from typing import Any, Dict, List
# Third party modules
import numpy as np
from sklearn.model_selection import train_test_split
# First party modules
import lidtk.utils
from lidtk.utils import make_path_absolute
logger = loggin... |
"""Test suit for pairing process with Apple TV."""
import ipaddress
import pytest
from unittest.mock import MagicMock
from pyatv import conf
from pyatv.dmap import pairing, parser, tag_definitions
from pyatv.support import net
from tests import zeroconf_stub, utils
REMOTE_NAME = "pyatv remote"
# This is a valid c... |
import sys
sys.path.append('/home/user/research/refinenet-pytorch')
import os
import numpy as np
import tqdm
import argparse
from collections import OrderedDict
import torch
import torch.nn as nn
import datasets as ds
from torchvision import transforms as trf
# from torchvision.models._utils import IntermediateLayerGe... |
import os
import torch
from HED_VGG16Net import VGG16NetHED
from loadDataset import HEDDatasetTrain,HEDDatasetTest,HEDDatasetTrainOnLine
from torch.utils.data import Dataset, DataLoader
from torch.nn import DataParallel
import argparse
from torchvision import transforms,utils
import cv2
def MakeDir(path):
if os.... |
import logging
import sys
import time
import numpy
import tensorflow as tf
# ModuleNotFoundError is new in 3.6; older versions will throw SystemError
if sys.version_info < (3, 6):
ModuleNotFoundError = SystemError
try:
from . import exception
from . import util
except (ModuleNotFoundError, ImportError) a... |
import os
import re
from collections import OrderedDict
project = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
class ExternalResource:
def __init__(self, path, type, id):
self.path = path
self.type = type
self.id = id
def __str__(self):
... |
# -*- encoding: utf8 -*-
#
# Automate the installation of pip and IPyIDA.
#
# Copyright (c) 2016-2018 ESET
# Author: <NAME> <<EMAIL>>
# See LICENSE file for redistribution.
import idaapi
import os
import sys
from contextlib import contextmanager
import tempfile
import subprocess
import fileinput
import pkg_resources
i... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program 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 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
import nibabel as nib
import numpy as np
import torch
from torch.utils.data import DataLoader
import logging
from ivadomed import metrics as imed_metrics
from ivadomed import postprocessing as imed_postpro
from ivadomed import transforms as imed_transforms
from ivadomed.loader import loader as imed_loader, utils as ime... |
import os
import pandas as pd
import numpy as np
import solvers.statuses as statuses
MAX_TIMING = 1e8
def get_cumulative_data(solvers, problems):
for solver in solvers:
# Path where solver results are stored
path = os.path.join('.', 'results', 'benchmark_problems', solver)
# Initialize ... |
# -*- coding: utf-8 -*-
import six
from . import conf
import logging
from hashlib import md5
from django import forms
from .models import Payment
from .utils import get_object_or_None
logger = logging.getLogger('kassa')
readonly_widget = forms.TextInput(
attrs=dict(readonly='readonly')
)
class BaseShopIdForm(f... |
import unittest
from mopidy.models import Album, Artist, Playlist, TlTrack, Track
from mopidy.mpd import translator
from tests import path_utils
class TrackMpdFormatTest(unittest.TestCase):
track = Track(
uri="à uri",
artists=[Artist(name="an artist")],
name="a nàme",
album=Album... |
import abc
import itertools
import six
import numpy as np
import open3d as o3
from . import math_utils as mu
try:
from dq3d import op
except:
print("No dq3d python package, filterreg deformation model not available.")
@six.add_metaclass(abc.ABCMeta)
class Transformation():
def __init__(self):
pass... |
r"""
Incompressible Stokes flow with Navier (slip) boundary conditions, flow driven
by a moving wall and a small diffusion for stabilization.
This example demonstrates the use of `no-penetration` boundary conditions as
well as `edge direction` boundary conditions together with Navier or slip
boundary conditions.
Find... |
# Copyright (c) 2009-2010 Six Apart Ltd.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions an... |
"""This file contains functions for plotting out the current board
state and utility."""
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import unittest
def determinecell(board, pt, bounds_x, bounds_y):
# Determine X cell
for col in range(len(bounds_x)-1):
if ((pt[0] > bou... |
#!/usr/local/bin/python
import os
import random
import argparse
import matplotlib
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats, interpolate
def main(args):
check_inputs(args)
get_periods(args)
def check_inputs(args):
assert isinstance(args.path_to_known... |
import sys
import time
import serial
import logging
from colorama import init
from pathlib import Path
# Console colors
init()
W = '\033[0m' # white (normal)
R = '\033[31m' # red
G = '\033[32m' # green
O = '\033[33m' # orange
B = '\033[34m' # blue
P = '\033[35m' # purple
C = '\033[36m' # cyan
GR... |
import numpy as np
import tensorflow as tf
import cv2
import os
import random
import time
import struct
import requests
from Convert import Convert
import re
import socket
# number
number = ['1', '2', '3', 'b', 'c', 'm', 'n', 'v', 'x', 'z']
# 图像大小
IMAGE_HEIGHT = 22 # 80
IMAGE_WIDTH = 62 # 160
MAX_CAPTCHA = 4
ch... |
"""Tests for runway.cfngin.actions.diff."""
# pylint: disable=no-self-use,protected-access
# pyright: basic
from __future__ import annotations
import logging
import unittest
from operator import attrgetter
from typing import TYPE_CHECKING, Optional
import pytest
from botocore.exceptions import ClientError
from mock i... |
import pytest
from datetime import date
from tests.utils import file_response
from documenters_aggregator.spiders.ward_night import WardNightSpider, Calendar
from textwrap import dedent
test_response = file_response('files/ward_night.json')
spider = WardNightSpider(start_date=date(2017, 11, 1))
parsed_items = [item f... |
# Copyright (c) 2021 <NAME>. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the followin... |
"""
Copyright June 25, 2020 <NAME>
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, softwar... |
from flask import (
Blueprint,
render_template,
redirect,
url_for,
request,
flash,
session,
current_app,
)
from flask_login import (
login_user,
logout_user,
login_required,
current_user,
)
#Per le email
from project.email import send_email
#from project.utenti.forms i... |
import mysql.connector
import uuid
import sys
from PIL import Image
import base64
import io
from tkinter import *
import PIL.Image
from mysql.connector.errors import _ERROR_EXCEPTIONS, custom_error_exception
from datetime import datetime
#cnx = mysql.connector.connect(user="ugqiri0xcve8arnj", password="<PAS... |
import gc
import inspect
import os
import sys
import time
try:
import objgraph
except ImportError:
objgraph = None
import cherrypy
from cherrypy import _cprequest, _cpwsgi
from cherrypy.process.plugins import SimplePlugin
class ReferrerTree(object):
"""An object which gathers all referrers of an object ... |
import numpy as np
"""8 chaotic systems\n
include:\n
lorenz\n
chua\n
chen\n
lu\n
rucklidge\n
sprott_1\n
sprott_2\n
shimizu_morioka\n
"""
def lorenz(variables, t):
"""Lorenz, <NAME>..
"Deterministic Nonperiodic Flow."
Journal of the Atmospheric Sciences 20.2 (1963): 130-14... |
import gzip
import logging
from uuid import UUID
from yarl import URL
import dateutil.parser
from . import api_handler, InvalidRequestException
from ..policy import Policy
from ..starbelly_pb2 import JobRunState as PbRunState
logger = logging.getLogger(__name__)
@api_handler
async def delete_job(command, server_d... |
# Python binary that stitches together the various tools.type_whisperer.Types
# protos generated by type_whisperer.py for the entire API. The result is a type
# database in tools.type_whisperer.TypeDb format.
import re
import sys
from google.protobuf import text_format
from tools.type_whisperer.api_type_db_pb2 impor... |
r""""Contains definitions of the methods used by the _BaseDataLoaderIter workers.
These **needs** to be in global scope since Py2 doesn't support serializing
static methods.
"""
import torch
import random
import os
from collections import namedtuple
from torch._six import queue
from torch._utils import ExceptionWrapp... |
# Copyright 2021 DeepMind Technologies Limited
#
# 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 agr... |
import chesslib
import numpy as np
import math
import sys
import random
import tensorflow
from tensorflow import keras
def do_training(id, best_estimator: keras.Model, mutated_estimator: keras.Model):
print("start training session #", id)
wins = 0
ties = 0
defeats = 0
# play several training g... |
import torch
import framework
from layers import Transformer, Linear
import math
from typing import Optional
# Cannot be dataclass, because that won't work with gather
class TransformerResult(framework.data_structures.DotDict):
data: torch.Tensor
length: torch.Tensor
@staticmethod
def create(data: to... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 23 12:55:45 2018
@author: Alpoise
"""
import tensorflow as tf
def conv(input,fh,fw,n_out,name):
#第一层卷积用此函数,区别在于stride为4
n_in = input.get_shape()[-1].value
with tf.name_scope(name) as scope:
filter = tf.get_variable(scope+"w", s... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests that the seccomp filters don't let denied syscalls through."""
import os
import tempfile
import platform
import pytest
from host_tools.cargo_build import run_seccompiler
import framework.utils as u... |
# -*- coding: utf-8 -*-
"""Collect data to render from scene."""
from pathlib import Path
import attr
from avalon import harmony, api
import openpype.lib.abstract_collect_render
from openpype.lib.abstract_collect_render import RenderInstance
import openpype.lib
@attr.s
class HarmonyRenderInstance(RenderInstance):
... |
from __future__ import print_function
from __future__ import absolute_import
__all__ = ['Cheesefile', 'Cheese', 'CHEESEFILE', 'CHEESEFILE_LOCK']
import os
from contextlib import contextmanager
import pkg_resources
from pip.req import parse_requirements
from . import PBundlerException
from .dsl import DslRunner
from... |
"""
Copyright 2015 Rackspace
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, software
dist... |
"""
This file is part of SleekBot. http://github.com/hgrecco/SleekBot
See the README file for more information.
"""
import logging
from collections import defaultdict
def parts_of(address):
""" Given an e-mail address, generates al possible domains."""
yield address
if '@' in address:
dom... |
from turtle import forward
from pyparsing import Forward
import torch
import torch.nn as nn
import torch.nn.functional as F
from .modules import Layer_norm, ConvNeXtBlock
from timm.models.layers import trunc_normal_, DropPath
from timm.models.registry import register_model
class ConvNeXt(nn.Module):
"""
Args:
... |
import itertools
import uuid
from typing import Callable, Tuple, Any, Sequence, Iterable, Union, List, Mapping
import dask.array as da
import dask.array.core as dac
import numpy as np
IntTuple = Tuple[int, ...]
SliceTuple = Tuple[slice, ...]
IntIterable = Iterable[int]
IntTupleIterable = Iterable[IntTuple]
SliceTuple... |
import pandas as pd
from dagster import (
DependencyDefinition,
InputDefinition,
OutputDefinition,
PipelineDefinition,
check,
execute_pipeline,
lambda_solid,
)
from dagster.core.test_utils import single_output_transform
from dagster_pandas import DataFrame
def _dataframe_solid(name, inp... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# This module contains tests of a class equivalent to pre-1.0 NDData.
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import pytest
import numpy as np
from ..nddata import NDData
from ..compat... |
# -*- coding: utf-8 -*-
"""
sphinx.ext.ditaa
~~~~~~~~~~~~~~~~~~~~~~~~~
Allow ditaa-formatted graphs to by included in Sphinx-generated
documents inline.
:copyright: Copyright 2011 by <NAME>
:copyright: Copyright 2011 by Zenexity
Updated for Python 3 Compatibility by <NAME>
:license: ... |
from enum import Enum, unique
from functools import partialmethod
from collections import defaultdict, namedtuple
from unittest import mock
from urllib.parse import parse_qsl
import inspect
import json as json_mod
from aiohttp import payload
from aiohttp.client_reqrep import ClientResponse
from multidict import Multi... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import division
import array
from collections import namedtuple
from PIL import Image
import sys
if sys.version_info[0] <= 2:
range = xrange
ARRAY_DATATYPE = b'l'
else:
ARRAY_DATATYPE = 'l'
Rgb = namedtuple('Rgb', ('r', 'g',... |
import os
import json
from collections import Iterable
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from utils import module_path
# agg backend is used to create plot as a .png file
mpl.use('agg')
def boxplot_bss_eval_metrics(eval_results, save_name, figure_title):
# create a figu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# It is based on the idea of http://0pointer.net/blog/projects/copyright.ht... |
import base64
import binascii
import hashlib
import hmac
import rsa
from bs4 import BeautifulSoup
from kik_unofficial.datatypes.xmpp.base_elements import XMPPElement
from kik_unofficial.device_configuration import device_id, kik_version_info, android_id
from kik_unofficial.utilities.cryptographic_utilities import Cryp... |
#########################################################################################
# Copyright 2018 SKA South Africa (http://ska.ac.za/) #
# #
# BSD license - see LICENSE.txt for details ... |
#!/usr/bin/env python3
# Copyright (c) Aptos
# SPDX-License-Identifier: Apache-2.0
from nacl.signing import SigningKey
import hashlib
import requests
import time
from typing import Any, Dict, Optional
TESTNET_URL = "https://fullnode.devnet.aptoslabs.com"
FAUCET_URL = "https://faucet.devnet.aptoslabs.com"
#:!:>secti... |
#!/usr/bin/env python
'''
POS_w2v_keras.py
<NAME> <<EMAIL>>
Project: Deep Learning and POS tagging
Corpus: Treebank from NLTK
Libary: keras
Model: Neural Network
Word Embedding: Yes
Last Updated by <NAME> - Aug 2,2018
'''
import nltk, gensim, os
import numpy as np
from sklearn.feature_extraction import DictVector... |
from django.conf import settings
from django.contrib import admin
from django.urls import reverse
from django.db.models import Q
from django.utils.html import format_html
from django.utils.timezone import make_naive
from django.utils.translation import (
ugettext, gettext_lazy as _, pgettext_lazy as p,
)
from mode... |
import boto3
import time
import json
import csv
import botocore
import os
import uuid
import re
import sys
from datetime import datetime, timedelta, timezone, date
partitions = None
start = datetime(int(sys.argv[3]), int(sys.argv[1]), int(sys.argv[2]))
stop = datetime(int(sys.argv[6]), int(sys.argv[4]), int(sys.argv[... |
# Copyright 2019 TerraPower, 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 writi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.