text stringlengths 3.07k 22.1k |
|---|
# -*- coding: utf-8 -*-
"""A collection of filling routines."""
from __future__ import absolute_import, print_function
from typing import List, Optional, Union
import mando
import numpy as np
import pandas as pd
import typic
from mando.rst_text_formatter import RSTHelpFormatter
from .. import tsutils
try:
from... |
# ==============================================================================
# This script executes common git commands for multiple folders.
#
# author: <NAME>
# ==============================================================================
import os
import sys
import subprocess
import argparse
import logging
fr... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, <NAME> <jcallen () csc.com>
# Copyright: (c) 2018, 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
DOC... |
from time import sleep
from botocore.exceptions import EndpointConnectionError, WaiterError
from spotty.commands.writers.abstract_output_writrer import AbstractOutputWriter
def get_snapshot(ec2, snapshot_name: str):
"""Returns a snapshot by its name."""
res = ec2.describe_snapshots(Filters=[
{'Name': ... |
# Copyright (c) 2021 - Jojo#7791
# Licensed under MIT
import asyncio
import logging
from typing import Dict, List, Optional, Union
import discord
from redbot.core import Config, commands
from redbot.core.bot import Red
from redbot.core.utils.chat_formatting import humanize_list, pagify
from redbot.core.utils.predicat... |
# -*- coding: utf-8 -*-
"""
drift - Logging setup code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Set up logging based on config dict.
"""
from __future__ import absolute_import
import os
import logging
from logging.handlers import SysLogHandler
import logging.config
import json
import datetime
import s... |
#
# Copyright IBM Corporation 2022
#
# 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 wri... |
from django.contrib.auth import login, logout, authenticate
from django.shortcuts import render, redirect
from django_redis import get_redis_connection
from django.views import View
from django import http
from django.conf import settings
import json
from .models import User, Address
from areas.models import Area
from... |
import requests
from bs4 import BeautifulSoup
import datetime
from time import sleep
import pyodbc
import urllib.request
import os
import glob
import ftplib
import re #regex kutuphanesi
def GetNewBookLinks(page):
#https://canyayinlari.com/kitaplar/?SayfaNo=1
#url = "https://www.kitapyurdu.com/index.php?route=... |
"""Defines the BertGFPBrightness landscape."""
import os
import numpy as np
import requests
import tape
import torch
import design_bench
import flexs
import flexs.utils.sequence_utils as s_utils
def print_mem():
t = torch.cuda.get_device_properties(0).total_memory
r = torch.cuda.memory_reserved(0)
a = to... |
# To run darknet video inference for snow plow
import sys, os
import pdb
import cv2
import numpy as np
import darknet as dn
import argparse
from time import time
def parser():
parser = argparse.ArgumentParser(description="YOLO Object Detection")
parser.add_argument("--input", type=str, default=0,
... |
"""PaperDatabase class."""
import sqlite3
import os
from . import utils
from .utils import XartaError, string_to_list, check_filter_is_sanitary, print_table
import requests
from arxivcheck.arxiv import check_arxiv_published
DATA_HEADERS = ["ref", "title", "authors", "category", "tags", "alias"]
def initialise_datab... |
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""
import io
import tempfile
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, get_object_or_404, redirect
from django.views.generic.list import L... |
import sys
import os
from os.path import abspath, basename, join
from tempfile import NamedTemporaryFile, mkdtemp
from shutil import rmtree
from vermin import combine_versions, InvalidVersionException, detect_paths,\
probably_python_file, Processor, process_individual, reverse_range, dotted_name, main, Config
from ... |
# Copyright (C) 2016 <NAME>. 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
# ========================================... |
"""Two Layer Network."""
# pylint: disable=invalid-name
import numpy as np
class TwoLayerNet(object):
"""
A two-layer fully-connected neural network. The net has an input dimension
of N, a hidden layer dimension of H, and performs classification over C
classes. We train the network with a softmax loss... |
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
"""
We show how to implement several variants of the Cormack-Jolly-Seber (CJS)
[4, 5, 6] model used in ecology to analyze animal capture-recapture data.
For a discussion of these models see reference [1].
We make use of two datase... |
# --
# Copyright (c) 2008-2021 Net-ng.
# All rights reserved.
#
# This software is licensed under the BSD License, as described in
# the file LICENSE.txt, which you should have received as part of
# this distribution.
# --
import json
import random
from nagare import partial
from nagare.renderers import xml
from naga... |
import math
from scipy import interpolate
class NoneInterpolator:
def __call__(self, level):
return None
class ProfileLevels:
def __init__(self, rotorGeometry, windSpeedLevels, windDirectionLevels=None, upflowLevels=None):
self.windSpeedLevels = windSpeedLevels
self.windDirectionLev... |
# <NAME>
from pyRazor import sexylexer
import html
from pyRazor.scopestack import ScopeStack
import re
class Token:
"""Simple list of token names"""
ESCAPED = "ESCAPED"
COMMENT = "COMMENT"
LINECOMMENT = "LINECOMMENT"
ONELINE = "ONELINE"
MULTILINE = "MULTILINE"
EXPLICITMULTILINEEND = "EXPLICITMULTILINEEND... |
from __future__ import print_function
import argparse
import numpy as np
import os
import shutil
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variable
from cifar.l1_norm_pruning.models import vgg
... |
import datetime
import logging
import numpy as np
import os
import platform
import sys
import time
import darwin.engine.strategies as strategies
import darwin.engine.executors as executors
import darwin.engine.space as universe
import darwin.engine.particles as particles
from darwin.engine.space import Coordinate
f... |
# Copyright 2013 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 ... |
# Copyright (c) Facebook, Inc. and its affiliates.
import gc
import unittest
import tests.test_utils as test_utils
import torch
from mmf.common.sample import SampleList
from mmf.models.uniter import (
UNITERForClassification,
UNITERForPretraining,
UNITERImageEmbeddings,
UNITERModelBase,
)
from mmf.util... |
# Wrap function for Vireo model
# Author: <NAME>
# Date: 22/03/2020
import sys
import numpy as np
import multiprocessing
from scipy.sparse import csc_matrix
from .vireo_base import optimal_match, donor_select
from .vireo_model import Vireo
from .vireo_doublet import predict_doublet, predit_ambient
def _model_fit(_mo... |
import logging
import os
import shutil
import ssl
import subprocess
import sys
import time
import urllib.request
from getpass import getpass
from pathlib import Path
from typing import Optional
from urllib.error import HTTPError, URLError
import psutil
from apscheduler.executors.pool import ThreadPoolExecutor
from ap... |
# -*- coding: utf-8 -*-
import numpy as np
from ._stft import stft, get_window, _check_NOLA
from ._ssq_cwt import _invert_components, _process_component_inversion_args
from .utils.cwt_utils import _process_fs_and_t, infer_scaletype
from .utils.common import WARN, EPS32, EPS64
from .utils import backend as S
from .utils... |
from typing import List, Tuple
import torch
from pytorch_lightning import LightningModule
from torch import nn
import neodroidaudition.audio_utilities.torch_transforms
class UNetConvBlock(nn.Module):
def __init__(self, in_channels: int, out_channels: int, kernel_size: int):
super().__init__()
self.conv = ... |
#!/usr/bin/env python
# vim: set ft=python list et ts=8 sts=4 sw=4:
# SSLsplit contributed code: Converts sslsplit -L log to PCAP.
# This script reads the log from standard input and converts it to a
# corresponding PCAP file. Information which is not contained in the
# log, such as TCP sequence numbers, IP ID etc a... |
# Copyright 2017 reinforce.io. 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... |
#!/usr/bin/env python
r"""
This module provides many valuable functions such as my_parm_file.
"""
# sys and os are needed to get the program dir path and program name.
import sys
import os
import ConfigParser
import StringIO
import re
import socket
import gen_print as gp
import gen_cmd as gc
robot_env = 1
try:
... |
# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the NiBabel package for the
# copyright and license terms.
#
### ### ### #... |
import pickle
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
CB_color_cycle = ['#377eb8', '#ff7f00', '#4daf4a',
'#f781bf', '#a65628', '#984ea3',
'#999999', '#e41a1c', '#dede00']
def __min_birth_max_death(persistence, band=0.0):
# Look... |
"""
Utility functions to fit and apply coordinates transformation from FVC to FP
"""
import json
import numpy as np
from desimeter.io import load_metrology
from desimeter.log import get_logger
from desimeter.transform.zhaoburge import getZhaoBurgeXY, transform, fit_scale_rotation_offset
#----------------------------... |
import requests , os, re
from bs4 import BeautifulSoup
from asyncio import sleep
from random import choice
from telethon import events
from emoji import get_emoji_regexp
from PIL import Image
from validators.url import url
async def get_readable_time(seconds: int) -> str:
count = 0
up_time = ""
time_list =... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: <NAME> (contact: <EMAIL>) and <NAME> (contact <EMAIL>)
# Created: Nov 2nd 2018
#
# Xarray wrapper around astropy.stats.circstats functions
# TODO: find a way to implement weights, both if weights == None, type(weights) == np.ndarray or type(weights) == xr.Data... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import dataclasses
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import (
Callable,
Generic,
List,
MutableMapping,
Optional,
Sequence,
Set,
Tuple,
)
import torch
from cached_pro... |
"""
Filename: plot_depth.py
Author: <NAME>, <EMAIL>
Description: Plot data that has a depth axis
"""
# Import general Python modules
import sys
import os
import pdb
import re
import argparse
import numpy
import matplotlib.pyplot as plt
import iris
from iris.experimental.equalise_cubes import equalise_a... |
import subprocess
import omegaconf
from hydra.utils import instantiate
from pathlib import Path
def _load_dataset(
data_files,
extension="json",
test_split_percentage=10,
min_tokens=5,
download_mode="reuse_dataset_if_exists",
num_proc=1,
):
from datasets import load_dataset
dataset = ... |
import torch
import numpy as np
import cv2
import tqdm
import os
import json
from pycocotools.mask import *
from src.unet_plus import SE_Res50UNet,SE_Res101UNet
import time
local_time = time.strftime('%Y-%m-%d-%H-%M',time.localtime(time.time()))
TEST_IMG_PATH = '/mnt/jinnan2_round2_test_b_20190424'
NORMAL_LIST_P... |
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Recipe, Tag, Ingredient
from recipe.serializers import RecipeSerializer, RecipeDetailSerializer
RECIPES_... |
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.http import HttpResponse, HttpResponseRedirect
from django.db.models import F, Q
from django.shortcuts import redirect, render
from django.vi... |
# Copyright: 2005-2011 <NAME> <<EMAIL>>
# License: GPL2/BSD
"""
built ebuild packages (vdb packages and binpkgs are derivatives of this)
"""
__all__ = ("package", "package_factory")
from functools import partial
from pkgcore.ebuild import ebuild_src, conditionals, eapi
from pkgcore.package import metadata
from sna... |
import re
import requests
import time
import logging
from genomic_data_service.constants import (
GENOME_TO_ALIAS,
GENOME_TO_SPECIES,
ENSEMBL_URL,
ENSEMBL_URL_GRCH37
)
log = logging.getLogger(__name__)
def ensembl_assembly_mapper(location, species, input_assembly, output_assembly):
# maps locatio... |
import PySimpleGUI as sg
import numpy as np
from pathlib import Path
from api import audio as ap
#############
# CONSTANTS #
#############
# Query prior
INPUT_RANGE = (-1, 1) # Slider limits
INPUT_RESOLUTION = .001 # Slider resolution
INDICATOR_SIZE = 10
PRIOR_CANVAS_WIDTH = 250
PRIOR_CANVAS_HEIGHT = 200
EMO_LABEL... |
import mne
import logging
import os.path as op
from mne_bids import (
write_raw_bids,
write_meg_calibration,
write_meg_crosstalk,
BIDSPath,
)
from pathlib import Path
from glob import glob
from pymento_meg.config import channel_types
from pymento_meg.orig.behavior import write_to_df
logging.basicCon... |
# -*- coding: utf-8 -*-
# Author: <NAME> <<EMAIL>>
#
# This module was developed with funding provided by
# the ESA Summer of Code (2011).
#
# pylint: disable=C0103,R0903
"""
Attributes that can be used to construct VSO queries. Attributes are the
fundamental building blocks of queries that, together with the two
oper... |
"""
Retrain the YOLO model for your own dataset.
"""
import glob
import numpy as np
import tensorflow.keras.backend as K
from keras.layers import Input, Lambda
from keras.models import Model
from keras.optimizers import Adam
from keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping
impo... |
import time
import terminalio
import displayio
import adafruit_imageload
from adafruit_display_text import label
from adafruit_bitmap_font import bitmap_font
from adafruit_magtag.magtag import MagTag
# --| USER CONFIG |--------------------------
STATION_ID = (
"9447130" # tide location, find yours here: https://t... |
import math
import time
import os
from math import atan2 # for computing polar angle
from random import randint, sample # for sorting and creating data pts
from matplotlib import pyplot as plt # for plotting
def create_points(num_points, minimum=0, maximum=50):
"""
Generates a list of fixed length of uniq... |
#####################################################################
# #
# /labscript_devices/SpinnakerCamera/blacs_workers.py #
# #
# Copyright 2019, Monash University and ... |
"""
This cog does not use .utils
This is in order to not further complicate things
for people using this cog with other bot setups.
"""
import discord
from discord.ext import commands
import pymongo
from codecs import open
from json import load as json_load
from PIL import Image
from numpy import arr... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from lib.model.utils.config import cfg
from lib.model.faster_rcnn.faster_rcnn import _fasterRCNN_BiDet
import lib.model.faster_rcnn.binary_utils as b_utils
import torch
import torch.nn as nn
import m... |
"""
This module implements training and evaluation of a Convolutional Neural Network in PyTorch.
You should fill in code into indicated sections.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import numpy as np
import os
# import cifar1... |
# Copyright 2019 DeepMind Technologies Limited and Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.modules as nnmodules
from torch.nn.modules.module import _addindent
import torchvision.transforms as transforms
import datasets.vegas_visual as vegas_visual
import numpy as np
import utils as ut # @UnresolvedImport
import values a... |
# MIT License
#
# Copyright (c) 2021 TrigonDev
#
# 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, pu... |
from selenium import webdriver
import concurrent.futures
import pandas as pd
from bs4 import BeautifulSoup
from datetime import datetime
import time
import codecs
import os
import glob
import gc
from pytz import timezone
tz = timezone('US/Eastern')
pd.set_option('display.max_columns', 500)
last_datetime = None
top_s... |
import os
import subprocess
from Chaos import Chaos
import random
from numba.core.decorators import jit
import numpy as np
from anim import *
from numba import njit
from functools import partial
OUTPUT_DIR = "gifs"
def randomCoef():
c = round(random.random() * 3, 6)
return random.choice([ -c, c, 0, 0, 0 ])
d... |
from collections import OrderedDict
from os import listdir
from os.path import isfile, join, splitext
import sqlite3
from dicom_parser import Image
def metadata_from_dicom_folder(dicom_folder):
"""Basic metadata from DICOM folder
Parameters
----------
dicom_folder : str
The folder where t... |
#################################################################################$$
# Copyright (c) 2011-2014, Pacific Biosciences of California, Inc.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted (subject to the limitations in the
# discla... |
#!/usr/bin/python3
try:
from PIL import Image
except ModuleNotFoundError:
print("Please ensure that module \"Pillow\" is installed, and is compatible with your Python version.")
exit(1)
import sys
import argparse
def sort_palette(palette):
palette.sort(key= lambda x: sum(x) / 3, reverse= True) # Sort palettes b... |
from collections.abc import ByteString
import functools
import sys
# TODO __getnewargs__ or whatever pickle uses
class Str8(bytes):
"""Str8(object='') -> Str8
Str8(bytes_or_buffer[, encoding[, errors]]) -> Str8
Create a new UTF-8 string object from the given object. If encoding or
errors is specifie... |
import logging
from base64 import b64encode
from asn1crypto.cms import CMSAttribute, ContentInfo, IssuerAndSerialNumber
from cryptography.hazmat.primitives.asymmetric import padding
from .asn1 import SCEPCMSAttributeType
from .cryptoutils import digest_for_data, decrypt, digest_function_for_type
from .enums import M... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from gma import Aggregate
from setrans import ExpandedFeatTrans
import copy
class FlowHead(nn.Module):
def __init__(self, input_dim=128, hidden_dim=256):
super(FlowHead, self).__init__()
self.conv1 = nn.Conv2d(input_dim, hidden_dim,... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
A CLI used to set up port forwarding sessions with public and private AWS instances that support SSH,
such as EC2 and RDS. This is done by piping stdin and stdout through a secured AWS SSM Session Manager session,
removing the need to publicly expose bastion servers.
... |
# For GUI
import tkinter as tk
# To delay time between blocks while visualizing
import time
# For handling arrays in more efficient manner
import numpy as np
# Node for each block containing values to help calculate the shortest path
class Node:
def __init__(self, parent=None, position=None):
# The Node's... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright © PyHelp Project Contributors
# https://github.com/cgq-qgc/pyhelp
#
# This file is part of PyHELP.
# Licensed under the terms of the MIT License.
# --------------------------------------------------------... |
# -*- coding: utf-8 -*-
from __future__ import (print_function, unicode_literals, absolute_import,
division)
from pusher.http import GET, POST, Request, request_method
from pusher.signature import sign, verify
from pusher.requests import RequestsBackend
from pusher.util import ensure_text, vali... |
combo_packages = {
"Freedom600": {
"onnet": "2,000",
"offnet": "300 Mins",
"sms": "2,000",
"data": "6,000 MBs",
"price": "Rs. 750 Incl. Tax",
"validity_in_days": "30"
},
"Freedom1000": {
"onnet": "unlimited",
"offnet": "500 Mins",
"sms"... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
sbpy Activity Core Module
Core module functions and classes, especially for handling coma
geometries.
created on June 23, 2017
"""
__all__ = [
'Aperture',
'CircularAperture',
'AnnularAperture',
'RectangularAperture',
'GaussianAp... |
"""
API to interface with CoinDix public API
"""
from adapters.apis.base import BaseAdapter
from adapters.apis.util import get_url_json
import json
import logging
from pathlib import Path
import requests
import time
from tqdm import tqdm
import typer
from typing import Any, Dict, List, Optional, Sequence
app = typer.T... |
'''
Author: Ligcox
Date: 2021-04-06 15:20:21
LastEditors: Ligcox
LastEditTime: 2021-08-20 16:15:36
Description: Program decision level, all robot decision information should be processed by this module and then sent.
Apache License (http://www.apache.org/licenses/)
Shanghai University Of Engineering Science
Copyright ... |
# Copyright (C) 2021 Intel Corporation
#
# 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 wri... |
# Copyright 2015 Intel Corporation
#
# 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... |
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from flask import url_for, Markup, render_template
from flask_mail import Message
from smtplib import SMTPRecipientsRefused
from flamejam import app, db, mail
from flamejam.filters import formattime, humandelta
from flamejam.models import Game, GamePack... |
import RPi.GPIO as GPIO
import time
import threading
import random
ServoLeftRightPos = 90
ServoUpDownPos = 90
g_frontServoPos = 90
g_nowfrontPos = 0
# engines of wheels
IN1 = 20
IN2 = 21
IN3 = 19
IN4 = 26
ENA = 16
ENB = 13
# supersonic wave
EchoPin = 0
TrigPin = 1
# RGB light
LED_R = 22
LED_G = 27
LED_B = 24
Fron... |
# Copyright 2010-present Basho Technologies, 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 a... |
#!/usr/bin/env python3
import argparse
import sys
import yaml
import ntpath
from nxapi.ldap import Ldap
from nxapi.blob import Blob
from nxapi.repo import Repo
from nxapi.user import User
from nxapi.role import Role
from nxapi.nexussession import NexusSession
def create_parser():
parser = argparse.ArgumentParser... |
#########################################################################################################
# Train a new network on a dataset and save the model as a checkpoint
# Notes -
# Basic usage: python train.py data_directory
# Prints out training loss, validation loss, and validation accuracy as the network tra... |
#!/usr/bin/env python
"""
This module provides classes to create phase diagrams.
"""
from __future__ import division
__author__ = "<NAME>"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "2.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Production"
__date__ = "Nov 25, 2012"
i... |
import threading
import copy
import pytz
import math
from dateutil.parser import parse
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.http import HttpResponse
from django.urls import reverse
from django.utils import timezone
from lightsteem.client import Client
from lightst... |
#
# Copyright 2019-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... |
import discord
from discord.ext import commands
from pymongo import MongoClient
import os
# Leveling system
bot_channel = [856724336344825909, 856443269143068682, 856442826958045194, 856804691521961994, 856804690522931220, 856804690628706335, 856811261219700746,
857435422673076254, 852085478659457040, ... |
import datetime
import pandas as pd
import numpy as np
import re
import os
def remove_blanks(df, col_name):
ctr = 0
working_df = pd.DataFrame(df)
# remove any blanks from the run
try:
while True:
value = working_df.at[ctr, col_name].lower()
if re.search("^blank\d*.*$", ... |
# Copyright 2021 Alibaba Group Holding 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... |
# export OPENBLAS_CORETYPE=ARMV8
import enum
import os
from re import X
from sre_constants import SUCCESS
import sys
import cv2
import math
import networktables
import torch
import torch.backends.cudnn as cudnn
import numpy as np
import time
from PIL import Image
from threading import Thread
from networktables import ... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for the mask module.
"""
import astropy.units as u
import numpy as np
from numpy.testing import assert_allclose, assert_almost_equal
import pytest
from ..bounding_box import BoundingBox
from ..circle import CircularAperture, CircularAnnulus
fro... |
from __future__ import absolute_import
import logging
from contextlib import contextmanager
from io import BytesIO
from abc import ABCMeta, abstractmethod
from unittest.mock import patch, Mock, MagicMock, MagicProxy
try:
from mock import Mock as DeprecatedMock # type: ignore
from mock import MagicMock as Dep... |
# Copyright (c) 2012, <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... |
from design import *
from config import *
from PyQt5.QtWidgets import QDialog, QMainWindow, QApplication, QDialogButtonBox
from PyQt5.QtCore import QSettings
import sys
import json
import random
class PassGenerador(QMainWindow, Ui_MainWindow):
def __init__(self, parent=None):
super().__init__(parent)
... |
import RPi.GPIO as GPIO
from time import sleep
GPIO.setmode(GPIO.BOARD)
##~ For property setter methods to work, the class must inherent the 'object' class
##~ NOTE: This class is still in development
class driver(object):
def __init__(self):
self._frequency = 50
self._cur_dutyCycle = .18
... |
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from uncertainties import ufloat
import uncertainties
from uncertainties.unumpy import uarray
from scipy.optimize import curve_fit
import os
# print("Cwd:", os.getcwd())
# print("Using matplotlibrc from ", mpl.matplotlib_fname())
fig = plt.f... |
import pdb
from functools import reduce
from operator import mul
import aoc
from tadhg_utils import splitstriplines, lmap, lconcat, lcompact, lfilter
INPUT, TEST = aoc.get_inputs(__file__)
TA1 = 4512
TA2 = 1924
A1 = 82440
A2 = None
def parse_input(data: str):
sections = data.split("\n\n")
numbers = sections... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 28 11:04:08 2018
@author: antony
"""
import pandas as pd
import phenograph
import collections
import os
from sklearn.manifold import TSNE
from sklearn.cluster import KMeans
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
i... |
# @copyright@
# Copyright (c) 2006 - 2018 Teradata
# All rights reserved. Stacki(r) v5.x stacki.com
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
# @copyright@
#
# @rocks@
# Copyright (c) 2000 - 2010 The Regents of the University of California
# All rights reserved. Rocks(r) v5.4 www.rocksclusters.org
# ... |
#!/usr/bin/python
#coding = utf-8
import QuantLib as ql
import pandas as pd
def getDigitsFromStr(string:str,withDigitPoint:bool = False):
"""
Extract number from a string. Return a list whose element is strings that is number.
Parameters
----------
string : str
The string that may contain numbers.
withDigitPo... |
# -*- coding: utf-8 -*-
"""
backend/interface_pupils.py - last updated 2021-05-22
Controller/dispatcher for pupil management.
==============================
Copyright 2021 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
... |
"""
This module represents a Device.
There are decorators for annotating which library the device can be found
in along with port labels.
The most important feature is that a Device can be an assembly, meaning is is
constructed of other Devices. This combined with the DeviceGraph allows for
hierarchical representatio... |
import warnings
import numpy as np
import networkx as nx
from scipy.stats import logistic
from mossspider.estimators.utils import fast_exp_map
def uniform_network(n, degree, pr_w=0.35, seed=None):
"""Generates a uniform random graph for a set number of nodes (n) and specified max and min degree (degree).
Add... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.