text stringlengths 3.07k 22.1k |
|---|
from hwt.hdl.architecture import Architecture
from hwt.hdl.entity import Entity
from hwt.hdl.ifContainter import IfContainer
from hwt.hdl.operator import Operator
from hwt.hdl.operatorDefs import OpDefinition
from hwt.hdl.switchContainer import SwitchContainer
from hwt.hdl.types.array import HArray
from hwt.hdl.types.b... |
"""
Device tracker platform that adds support for OwnTracks over MQTT.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.owntracks/
"""
import asyncio
import json
import logging
import base64
from collections import defaultdict
import volupt... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 15 12:39:25 2021
@author: thomas
Functions for the selection of a plateau or crossing range
"""
#import sys
import numpy as np
from scipy import interpolate
from scipy.optimize import brentq, minimize_scalar
def find_zero(xs, j0, up=True):
"... |
# Copyright 2021 cstsunfu. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
from flask import (
Flask, jsonify, redirect, render_template, request, session, url_for, flash)
from flask_session import Session
from . import amprepo, app_config, constant, utils, app
from functools import wraps
from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import Mail
from datetime import d... |
# coding:utf-8
"""
交易模拟器,用于研究单标的的买卖点变化过程
"""
import sys
sys.path.insert(0, "C:\git_repo\zengbin93\chan")
import chan
print(chan.__version__)
import os
import time
import traceback
import pandas as pd
import tushare as ts
from datetime import datetime, timedelta
from chan import SolidAnalyze, KlineAnalyze
from chan im... |
#!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
This script builds and runs the comparison app, switching from one library to the next,
taking measurements as it go... |
# Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from numpy.testing import assert_allclose
import pytest
from jax import jit, random, value_and_grad
import jax.numpy as jnp
from jax.test_util import check_close
import numpyro
from numpyro import optim
import numpyro.distributions a... |
import argparse
import csv
import os.path
import random
import signal
import sqlite3
import sys
import time
from collections import OrderedDict
from datetime import datetime
from decimal import Decimal
from pathlib import Path
import yaml
from basePLC import BasePLC
from py2_logger import get_logger
import threading... |
import pygame, sys, os
import webbrowser
pygame.init()
## COLORS ##
# R G B
LIGHTGRAY = (229, 229, 229)
GRAY = (100, 100, 100)
GREY = (150, 150, 150)
NAVYBLUE = ( 60, 60, 100)
WHITE = (255, 255, 255)
RED = (255, 0, 0)
LIGHTRED = (255, 77, 0)
GREEN = ( ... |
from mycroft import MycroftSkill, intent_file_handler
from adapt.intent import IntentBuilder
from mycroft import intent_handler
from mycroft.util.time import now_local, default_timezone
from lingua_franca.parse import extract_datetime
from mycroft.util.log import LOG
import requests
import urllib.parse
import json
f... |
import os
import unittest
import random
from test import support
from test.support import threading_helper
import _thread as thread
import time
import weakref
from test import lock_tests
threading_helper.requires_working_threading(module=True)
NUMTASKS = 10
NUMTRIPS = 3
POLL_SLEEP = 0.010 # seconds = 10 ms
_print_m... |
import urllib
from django.db import models
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from django.contrib.sites.models import Site
from django.template import Template, Context
class SocialShareSettings( models.Model ):
... |
import json
import re
import socket
import requests
from collections import namedtuple
from contextlib import contextmanager
import django_hosts
from elasticsearch.exceptions import NotFoundError
from functools import wraps, lru_cache
from urllib.parse import urlencode
from pathlib import Path
import markdown
from djan... |
"""
Classifier evaluation within ARMORY
Scenario Contributor: MITRE Corporation
"""
import logging
from typing import Optional
import os
import random
import numpy as np
from tensorflow import set_random_seed, ConfigProto, Session
from tensorflow.keras.backend import set_session
from tensorflow.keras.utils import to... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
# 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.
import logging
import os
import subprocess
import sys
import time
from telemetry.core import exceptions
from telemetry.core import util
from telemetry.core.... |
"""Neural Network tf operations for protein structure prediction.
In general this module contains functions for constructing different parts
of GeomNetModel networks, excepting ones related to geometric operations.
Conventions in this module:
functions take both TF tensors and python objects
python objects ar... |
# reference: https://www.euclideanspace.com/maths/geometry/rotations/conversions/
import math
import numpy as np
eps = 1e-6
def DotProduct(vec_1, vec_2):
assert len(vec_1) == len(vec_2), "MathUtils DotProduct Dimension Error: Two vectors must have a same dimension"
out_scalar = 0
for i in range(len(vec_1... |
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 25 14:01:18 2020
@author: artmenlope
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from scipy.integrate import odeint
from mpl_toolkits.mplot3d import Axes3D
import streamtubes as st # Import the def... |
#!/usr/bin/env python
# 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
#
# Authors:
# - <NAME>, <EMAIL>, 2017
# - <NAME>, <EMAIL>, 2017-2021
# NOTE:... |
import requests, json, logging
from collections import Counter
from metagov.core.plugin_manager import Registry, Parameters, VotingStandard
from metagov.core.models import Plugin, GovernanceProcess, ProcessStatus, AuthType
from metagov.core.errors import PluginErrorInternal
import metagov.plugins.github.schemas as Sch... |
from typing import Optional, Sequence, Tuple, Union
import numpy as np
from pygrad.core import Function, Variable
from pygrad.utils import _log_sum_exp, _sum_to, handle_shape
class Exp(Function):
def forward(self, x: np.ndarray) -> np.ndarray:
return np.exp(x)
def backward(self, gy: Variable) -> Va... |
"""
Read the balance of your bank accounts via FinTS.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.fints/
"""
from collections import namedtuple
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.componen... |
"""
Extended Tables Extension for Python-Markdown
=============================================
Allows to create tables with colspans and rowspans and optional
header with Python-Markdown
Copyright 2021 phuel
License: [BSD](http://www.opensource.org/licenses/bsd-license.php)
based on:
Tables Extension for Pyth... |
#
# This file is part of GreatFET.
#
from nmigen.build import *
from nmigen.vendor.lattice_ecp5 import *
from .... import GreatFET
__all__ = ["FoxglovePlatformR01"]
def PortAResource(name, number, io_site, oe_site, sf_connection_sites):
""" Adds a pin resource for a Foxglove Port-A pin with connected level-sh... |
#
# SPDX-FileCopyrightText: Copyright (c) 1993-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# 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... |
#!/usr/bin/env python3
import os
import re
import shlex
import subprocess
import sys
GENERATED_FILE_NAME = "prometheus-metrics.md"
FILE_HEADER = """<!--
{
"name": "Prometheus Metrics",
"category": "5fcfd1ede5ded705a0bf5fd0",
"priority": 1000
}
-->
<!--
============================
GENERATED FILE - DO NOT EDI... |
"""
This script runs an atmosphere simulation
"""
import os
from datetime import datetime
if "STARTUP_DELAY_ATM_SIM" in os.environ:
import numpy as np
import time
delay = np.float(os.environ["STARTUP_DELAY_ATM_SIM"])
wait = np.random.rand() * delay
time.sleep(wait)
import sys
import argparse
imp... |
#!/usr/bin/python3
import sqlite3
import re
import shutil
import tempfile
import os
import json
import argparse
import atexit
# parse arguments (btw all are optional)
parser = argparse.ArgumentParser()
# options
parser.add_argument("-t","--trim", help="trim words from spaces, tabs and common delimiters ... |
# (c) 2012-2018, Ansible by Red Hat
#
# This file is part of Ansible Galaxy
#
# Ansible Galaxy is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by
# the Apache Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
... |
from __future__ import absolute_import, division, print_function
import re
import stat
import sys
from subprocess import Popen, check_output, PIPE, STDOUT, CalledProcessError
import os
from conda_build.os_utils.pyldd import inspect_rpaths
from conda_build import utils
from itertools import islice
from conda_build.os_u... |
import logging
# Global logger initialization
PRINT = logging.getLogger("output")
DEBUG = logging.getLogger("debug")
def printDict(di, format="%-25s %s", log=None, loglvl=logging.DEBUG):
for (key, val) in list(di.items()):
if log:
log.log(loglvl, format % (str(key) + ":", val))
else:
... |
"""
Root module for Raid audit
app.py handles flask routes, flask configuration, gathering data to display
from backend module(s) and rendering html templates to response.
Routes are documented with their respective methods. Omitted from docstrings
of single routes is that every route that corresponds to a rendered
t... |
import numpy as np
import random
import re
import torch
import pdb
import logging
def clean_name(name):
name = re.sub(r"\(.*\)", "", name)
name = re.sub(r"_", " ", name)
name = re.sub(r" ", " ", name)
return name
def sanity_check_target_after_processing(target):
assert(len(targe... |
#!/usr/bin/env python3
import copy
import math
import collections
import logging
from cluster_resource import ClusterResource
logger = logging.getLogger(__name__)
# cluster_total, cluster_available and cluster_unschedulable are of same type,
# they are map with key to be gpu type string, and value to be count.
# vc... |
import time
import pandas as pd
import numpy as np
CITY_DATA = { 'chicago': 'chicago.csv',
'new york city': 'new_york_city.csv',
'washington': 'washington.csv' }
def get_filters():
"""
Asks user to specify a city, month, and day to analyze.
Returns:
(str) city - name o... |
from typing import Any, Optional
from torch.nn import BatchNorm2d, CrossEntropyLoss, Identity, LeakyReLU, ReLU
from torch.optim import SGD, Adam, AdamW
from torch.optim.lr_scheduler import CosineAnnealingLR, ExponentialLR, ReduceLROnPlateau
from inplace_abn import InPlaceABN, InPlaceABNSync
from pydantic import BaseS... |
# 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
# d... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import os
from keras.layers import Dense,Input,LSTM,Bidirectional,Activation,Conv1D,GRU
from keras.callbacks import Callback
from keras.layers import Dropout,Embedding,GlobalMaxPooling1D, MaxPooling1D, Add, Flat... |
#!/usr/bin/env python
import os, sys
FORMAT = "%.4f"
def write_numbers(dataFile, Natom, Nbond, Nangle, Ndihedral, Nimproper):
dataFile.write("LAMMPS data file\n\n")
dataFile.write(str(Natom) + " atoms\n")
dataFile.write(str(Nbond) + " bonds\n")
dataFile.write(str(Nangle) + " angles\n")
... |
#!/usr/bin/env python
"""Widgets for selecting files and directories.
To do:
- If the user clicks to select a new dir or file and the current
one is missing, this could be handled a bit better:
- presently if the user cancels, the current value is left alone
even though it is now known to be invalid. It should prob... |
#!/usr/bin/env python
# coding: utf-8
import pybliometrics
from pybliometrics.scopus import ScopusSearch
from pybliometrics.scopus.exception import Scopus429Error
import pandas as pd
import numpy as np
from sklearn.utils import shuffle
import os
import multiprocessing
from os import system, name
import json
import tim... |
import copy
import re
from collections import OrderedDict, defaultdict
from conans.errors import ConanException
from conans.util.log import logger
def unquote(text):
text = text.strip()
if len(text) > 1 and (text[0] == text[-1]) and text[0] in "'\"":
return text[1:-1]
return text
class EnvValue... |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
import argparse
from ..model.constant import Q_IDX
import os
from typing import Dict, Tuple
from h5dataloader.common.structure import *
import numpy as np
import h5py
from tqdm import tqdm
import cv2
TAG_HEIGHT = 32
PADDING = 4
FONT_SCALE = 0.8
FONT_COLOR = (255, 255, 255)
FONT_FACE = cv2.FONT_HERSHEY_SIMPLEX
FONT_THI... |
import sys
from contextlib import contextmanager
from ctypes import (CDLL, c_bool, c_int, c_int32, c_int64, c_double, c_char_p,
c_char, POINTER, Structure, c_void_p, create_string_buffer)
from warnings import warn
import numpy as np
from numpy.ctypeslib import as_array
from openmc.exceptions impo... |
# uncomment to see debug output
import logging
from fuse import Misalign, Snapshot
from .run_augmentations import run_augmentations
# logging.getLogger('fuse.defect_augment').setLevel(logging.DEBUG)
logging.getLogger('fuse.elastic_augment').setLevel(logging.DEBUG)
# logging.getLogger('fuse.misalign').setLevel(loggin... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import xlrd
#----------------funções auxiliares ------------------
def inverteDicionario(dicionario):
#função que recebe um dicionario e devolve um outro dicionario igual, mas com a ordem do elementos invertidos
#obs: nã... |
"""
Helper functions for formatting NewETHPOP fertility, mortality and migration data
"""
UK_POP_2011 = 62740000.0
ALL_CATEGORIES = 2 * 86 * 12 # gender by age by eth
def from_census_eth(data):
""" Maps census categories (DC2101EW_C_ETHPUK11) to NewEthpop. Note this is a one-way mapping """
eth_map = { 0: "INV",
... |
import logging
from datetime import timedelta
from django import forms
from django.forms import widgets
import happyforms
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy as _lazy
import mkt
from mkt.api.forms import CustomNullBooleanSelect
from mkt.reviewers.mode... |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
"""
In "filter_questions_bak.py" we called entropy functions to filter those questions with
lower entropy (<0.5),... |
#-*- coding: utf-8 -*-
import datetime
import calendar
import re
import wtforms as wtf
from wtforms import validators
from wtforms.widgets import HTMLString, html_params
from pyramid.i18n import TranslationStringFactory
import utils
from intranet3.models import DBSession, Client, User, Project, Tracker
from intranet3... |
import os
import numpy as np
from copy import copy
from easyric.io import pix4d, geotiff, shp, plot
from easyric.calculate import geo2raw, geo2tiff, raw2raw
####################
# Software wrapper #
####################
class Pix4D:
def __init__(self, project_path, raw_img_path=None, project_name=None,
... |
from __future__ import annotations
import functools
import uuid
from typing import (
TYPE_CHECKING,
Callable,
Coroutine,
Dict,
List,
Optional,
Union,
Type,
Tuple,
)
from ..utils.payload import update_payload
from .enums import ButtonStyle, ComponentType
if TYPE_CHECKING:
from ... |
# Importing dependencies
from random import randint
from math import floor, exp
# For debugging purposes
import sys
if sys.version_info >= (3, 4):
from importlib import reload # Python 3.4+ only.
# Upper bound on all the values of sigma
sigma0 = 1.8205
# Lower bound on all the values of sigma
sigmin = ... |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
#!/usr/bin/env python
# Copyright (c) 2017-2019 Arm 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 applicabl... |
#!/usr/bin/env python3
# -*- coding: utf8 -*-
import os
import argparse
import xml.dom.minidom
import pymongo
'''
Inspired from:
https://github.com/argp/nmapdb/blob/master/nmapdb.py
'''
def print_banner():
banner = '-------------------\n' \
'~ Nmap to MongoDB ~\n' \
'-----------------... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: bigip_asm_policy_server... |
# -*- coding: utf-8 -*-
import sys, os
import codecs
import json
from argparse import ArgumentParser
from collections import defaultdict
sys.path.insert(1, os.path.join(sys.path[0], os.path.pardir))
from csv_utils import UnicodeReader
def parse_csv(fname, keys, pk, to_int=[], nonnull=[]):
csv = UnicodeReader(open... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 21 12:04:45 2020
import statement for ease of access
@author: steve
"""
import numpy as np
from kep_util_globvar import M1,M2,H,J
from kep_derivative_functions import nabla_q,nabla_H,nabla_l
from kep_derivative_functions import partial_Hpp,partial... |
#!/usr/bin/python
# coding: UTF-8
#
# Author: <NAME>
# Contact: <EMAIL>
#
# Last update: 12/03/2017
#
# Feel free to contact for any information.
#
# You can cite this code by referencing:
# <NAME>, "Python implementation of Kuramoto systems," 2017-,
# [Online] Available: http://www.laszukdawid.com/codes
#
# LICENC... |
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import mne
import numpy as np
import pandas as pd
import pytest
from braindecode.datasets import WindowsDataset, BaseDataset, BaseConcatDataset
from braindecode.datasets.moabb import fetch_data_with_moabb
from braindecode.preprocessin... |
#!/usr/bin/env python
# encoding: ISO8859-1
"""
Copyright (c)2011, <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:
* Redistributions of source code must retain the above copyright
not... |
# Impacket - Collection of Python classes for working with network protocols.
#
# SECUREAUTH LABS. Copyright (C) 2020 SecureAuth Corporation. All rights reserved.
#
# This software is provided under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#... |
"""
MIT License
Copyright (c) 2021 <NAME>
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, distri... |
#!/usr/bin/env python
import distutils.dist
import os.path
import re
import sys
import tempfile
import zipfile
from argparse import ArgumentParser
from glob import iglob
from shutil import rmtree
import wheel.bdist_wheel
from wheel.archive import archive_wheelfile
egg_info_re = re.compile(r'''(^|/)(?P<name>[^/]+?)-(?... |
from django.shortcuts import render, HttpResponse, get_object_or_404, HttpResponseRedirect, redirect, Http404
from django.utils import timezone
import datetime
from .forms import RandevuFormMezun, RandevuFormOgrenci, MesajOgrenciForm, MesajMezunForm
from .models import randevuMezun, randevuOgrenci, MesajRandevuOgrenci,... |
import pytest
import numpy as np
from datar.base.string import (
as_character,
is_character,
grep,
grepl,
gsub,
chartr,
endswith,
nchar,
nzchar,
paste,
paste0,
sprintf,
startswith,
strsplit,
strtoi,
sub,
substr,
substring,
tolower,
toupper... |
# Copyright 2021 The Magenta 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 ... |
"""
Copyright (c) Facebook, Inc. and its affiliates.
"""
import os
import logging
import faulthandler
from pickle import NONE
import signal
import random
import sentry_sdk
from multiprocessing import set_start_method
from collections import namedtuple
import subprocess
from droidlet.perception.craftassist import heuri... |
__author__ = "<NAME>"
__email__ = "<EMAIL>"
import json
import pandas as pd
import sys
from os.path import exists
from datetime import datetime
import numpy as np
import commons
import matplotlib.pyplot as plt
from itertools import groupby
#__________________________________________________________
def all_equal(iter... |
from pandas import read_csv, DatetimeIndex
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import confusion_matrix, f1_score, accuracy_score
from sklearn.metrics import roc_curve, auc
from sklearn.model_selection import cross_val_score, StratifiedKFold
from sklearn.utils import class_weight
fro... |
# -*- coding: utf-8 -*-
# Copyright 2017, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
# pylint: disable=invalid-name,missing-docstring
"""Test of QCVV/tomography module."""
import unittest
import numpy as np
... |
import copy
import asyncio
import logging
from dataclasses import dataclass, asdict
from typing import List, Optional
import requests # type: ignore
import aiohttp
from twilio.rest import Client as TwilioClient # type: ignore
import utils
from environment import Environment
logger = logging.getLogger(__name__)
log... |
import bpy
import os.path
import subprocess
import pathlib
bl_info = {
"name": "Trackmania Tools",
"description": "Adds unofficial Trackmania 2020 support to Blender.",
"author": "<NAME>",
"version": (0, 1),
"blender": (2, 90, 0),
"category": "Import-Export",
"location": "File > Export",
... |
"""Common functions used by multiple modules
"""
# Copyright 2017-2018 <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 req... |
import unittest
import datetime
from StringIO import StringIO
from lxml import etree
from mock import patch, Mock, call
import boris
from boris import BikeChecker, IllegalPointException, \
InvalidPostcodeException, InvalidDataException
class TestBoris(unittest.TestCase):
def test_time_ms(self... |
""" Packages import """
import numpy as np
import matplotlib.pyplot as plt
from numba import jit
import bottleneck as bn
import scipy.stats as sc
from math import log, sqrt
eps = 1e-15 #: Threshold value: everything in [0, 1] is truncated to [eps, 1 - eps]
@jit(nopython=True)
def rd_argmax(vector):
"""
Comp... |
import subprocess
from contextlib import contextmanager
from functools import partial, wraps
from itertools import product
from pathlib import Path
from shutil import rmtree
from tempfile import mkdtemp
import lightgbm as lgb
import numpy as np
import pytest
import statsmodels.api as sm
import xgboost as xgb
from ligh... |
from __future__ import absolute_import, division, print_function
from six.moves import range
# -*- Mode: Python; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8; -*-
#
# $Id$
from iotbx.detectors.detectorbase import DetectorImageBase, tile_manager_base
from scitbx.array_family import flex
from six.move... |
#!/opt/conda/envs/tethys/bin/python
import sys
import os
from glob import glob
import subprocess
import yaml
from typing_extensions import Literal
# colors
end_style = '\033[0m'
red_style = '\033[0;31m'
green_style = '\033[0;32m'
orange_style = '\033[0;33m'
blue_style = '\033[0;34m'
# variables
success = True
python... |
# -*- coding: utf-8 -*-
r'''
===========================
Manage the Windows registry
===========================
Many python developers think of registry keys as if they were python keys in a
dictionary which is not the case. The windows registry is broken down into the
following components:
-----
Hives
-----
This is... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 5 08:21:18 2018
@author: davidrounce
"""
# Built-in libraries
import argparse
import multiprocessing
import os
import zipfile
# External libraries
import numpy as np
import pandas as pd
import xarray as xr
# Local libraries
import py... |
import logging
import sys
import os
import numpy as np
import pickle
import tvm
import topi
from topi.testing import conv2d_nchw_python
from tvm import te
from tvm import autotvm
from tvm.autotvm.tuner import XGBTuner, GATuner, RandomTuner, GridSearchTuner
import tvm.contrib.graph_runtime as runtime
#from tvm.autotvm... |
# XXX: Copyright info here
"""Class for block-style AH domains"""
import hoomd
import hoomd.md as md
import gsd.hoomd
import enum
import itertools
import os
import random
import sys
import yaml
import numpy as np
from ahdomain import ahdomain
# Magic to get the library directory properly
sys.path.append(os.path.jo... |
import asyncio
import atexit
import dataclasses
import logging
import queue
import socketserver
import threading
import time
from collections.abc import Sequence
from typing import Any, Callable, Dict, NamedTuple, Optional, Set, Tuple, Union
from .captures import Capture, CaptureEntry
from .messages import OscBundle, ... |
import pytest
import re
from unittest import mock
from awx.sso.pipeline import (
update_user_orgs,
update_user_teams,
update_user_orgs_by_saml_attr,
update_user_teams_by_saml_attr,
)
from awx.main.models import (
User,
Team,
Organization
)
@pytest.fixture
def users():
u1 = User.obje... |
# Coder: <NAME>
# Github: https://github.com/wenxinxu/resnet_in_tensorflow
# ==============================================================================
import tarfile
from six.moves import urllib
import sys
import numpy as np
import _pickle as cPickle
import os
import cv2
data_dir = 'cifar100_data'
full_data_dir =... |
import json
from basin3d.models import DataSource, ObservedProperty, \
ObservedPropertyVariable, SamplingMedium, FeatureTypes, SpatialSamplingShapes
from basin3d.serializers import ObservedPropertySerializer
from basin3d.synthesis import models
from basin3d.synthesis.serializers import MonitoringFeatureSerializer,... |
from rpython.rtyper.lltypesystem import lltype, rffi
from hippy import consts
from hippy.error import PHPException
from hippy.objspace import getspace
from hippy.builtin import (
wrap_method, Optional, ThisUnwrapper, StringArg,
LongArg, BoolArg, InstanceUnwrapper, handle_as_exception
)
from hippy.klass import ... |
# 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... |
import magic
import os
from django.conf import settings
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.models import User
from django.http import HttpResponseForbidden, HttpResponseBadRequest
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from dj... |
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
"""
The MIT License (MIT)
Copyright (c) 2017 <NAME> (github.com/kanflo)
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, ... |
from __future__ import division
import math
from ..wrappers import JuliaObject
try:
string_types = (unicode, str)
except NameError:
string_types = (str,)
def test_peal(Main):
xs = Main.map(Main.identity, range(3))
assert all(xs == [0, 1, 2])
def test_wrapped_dict(julia):
dct = julia.eval("Dic... |
import csv
import argparse
from argparse import RawTextHelpFormatter
from operator import itemgetter
__version__='1.4'
__usage__="""
o o .oPYo. o o
8b d8 8 8 8
8`b d'8 .oPYo. oPYo. .oPYo. .oPYo... |
import numpy as np
import pandas as pd
import numpy.matlib as mp
import statsmodels.api as sm
import statsmodels
from scipy import signal
import scipy as sp
import matplotlib.pyplot as plt
import csaps
from statsmodels.tsa.seasonal import STL as STL
import scipy.stats as stats
import statsmodels.api as sm... |
# Python Türkiye Discord Botu
# <NAME> - 2020
# https://github.com/kadir014/python-turkiye-discord-bot
import os
import time
import discord
import utils
from libs.db import RedisWrapper
from libs import covidapi
import wikipedia
db = RedisWrapper()
intents = discord.Intents.all()
cl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.