text stringlengths 3.07k 12.6k |
|---|
from aiotfm.packet import Packet
class Player:
def __init__(self, username, id=-1, pid=-1, **kwargs):
self.gender = kwargs.get('gender', 0)
self.look = kwargs.get('look', '')
self.id = id
self.pid = pid
self.title = kwargs.get('title', 0)
self.title_stars = kwargs.get('title_stars', 0)
self.us... |
# Copyright (C) 2021, Pyronear contributors.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
from typing import List, Optional
from datetime import datetime
from pydantic import BaseModel, Field, validato... |
import json
import uuid
from collections import OrderedDict
from operator import attrgetter
from urllib.parse import urlencode
"""
Create Postman collections with ease.
"""
def newid():
return str(uuid.uuid4())
class Collection(object):
def __init__(self, name, id=None, description=None):
self.id =... |
import networkx as nx
from mycode import settings
from mycode.settings import config
from mycode.utilc import DynamicPriorityQueue
def _compute_path(parent_dict, current_node):
path = []
while True:
assert len(path) < 100
if current_node == None:
break
path.append(current_node)
current_node = parent_di... |
# -*- coding: utf-8 -*-
'''
Created on Mar 10, 2016
@author: fky
'''
import socket
from hashlib import sha1
from random import randint
from struct import unpack
from socket import inet_ntoa
from threading import Timer, Thread
from time import sleep
from collections import deque
from bencodepy impor... |
# -*- coding: utf-8 -*-
#
# Author: <NAME>
# Test Automation Technical Test Code
# This functionality is designed to be tested by interview candidates
#
# The code will process a csv file that has the following structure:
# ID, Product, Vendor, Transaction Date, Transaction Price, Transaction Status, VAT Number, Custom... |
import os
import json
import logging
import argparse
import torch
from src.inputters.batcher import prepare_batcher, load_vocab
from src.inputters.dataset import Lang
from src.models.GLMP import GLMP
from src.utils.trainer import Trainer
def model_config():
"""
model_config
"""
parser = argparse.Argu... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Main Controller
Created on Tue Aug 17 14:16:44 2021
Version: 1.0
Universidad Santo Tomás Tunja
Simulation
@author: <NAME>
@author: <NAME>
presented to: <NAME>
"""
from random import randint
import time
from controllers.settings import config
from models.atms impor... |
#!/usr/bin/env python
# Author: <NAME> <<EMAIL>>
# File: /Users/alexandretea/Work/backdoor/backdoor.py
# Purpose: Single-script backdoor implementation
# Created: 2016-08-09 21:32:41
# Modified: 2016-08-09 22:23:28
import sys
import socket
import argparse
import subprocess
import logging
import getpass
from t... |
import time
import sys
from app.common import values, definitions, utilities
from app.common.utilities import error_exit, save_current_state, load_state, get_source_name_from_slice
from app.tools import evolver, merger
from app.tools import emitter, reader, logger
from app.ast import ast_generator
file_index = 1
backu... |
import pandas as pd
import os
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import MultinomialNB
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.feature_extraction.text import CountVectorizer
from sklearn import svm
import wandb
from sklearn import metrics
impor... |
r"""
Contains a list of constants and user defined units
"""
__author__ = "<NAME>"
__version__ = "0.1"
import yaml
from dataclasses import replace, asdict, is_dataclass, field, dataclass as dat
from typing import Dict, Optional, List, Union, Literal, NamedTuple
import operator
import functools
from pydantic.datacla... |
""" Evaluate the baselines ont ROUGE/METEOR"""
""" Adapted from https://github.com/ChenRocks/fast_abs_rl """
import argparse
import json
import os
from os.path import join, exists
import numpy as np
import pickle as pkl
from utils.evaluate import eval_meteor, eval_rouge
from utils.utils_glue import acc_and_micro_f1, ac... |
#!/usr/bin/env python
#-*- coding: utf8 -*-
from bokeh.plotting import figure, output_file, show
from bokeh.layouts import column
from random import choice
from collections import OrderedDict
class Graph :
def __init__(self, name, *items) :
# output to static HTML file
output_file(name + ".html")
self.item... |
'''
Copyright (c) 2020 <NAME>/HiFiBerry
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribut... |
# -*- coding: utf-8 -*-
"""
deprecated cli mimicing old slack cleaner
"""
import argparse
from typing import Any, Callable, Dict, List
from colorama import Fore
from .predicates import match_user, match, is_name, and_, by_user, match_text, is_not_pinned, is_bot
from .model import SlackCleaner, SlackChannel
Predica... |
#!/usr/bin/env python
# coding: utf-8
# # BASE FUNCTIONS
# ### Functions for:
# - minimum down payment
# - mortgage rate by term
# - mortgage insurance
# - monthly payments
# - optimal monthly payment
# - total interest
# In[1]:
import pandas as pd, numpy as np
from mortgage_package.exceptions import *
# In[2]:
... |
import sys
import yaml
import argparse
import time
import datetime
import notify2
import threading
import termios
import fcntl
import Queue
class KeyboardCheckThread(threading.Thread):
def __init__(self, event_queue, exit_signal):
super(KeyboardCheckThread, self).__init__()
self.event_queue = even... |
#!/usr/bin/env python
#
# status.py - A simple interface for displaying messages.
#
# Author: <NAME> <<EMAIL>>
#
"""This is a little module which provides an interface for displaying a
message, or status update, to the user. The ``status`` module provides the
following functions:
.. autosummary::
:nosignatures:
... |
import numpy as np
from phonopy.harmonic.displacement import get_least_displacements, \
get_displacement, directions_axis, is_minus_displacement
from anharmonic.phonon3.displacement_fc3 import get_reduced_site_symmetry, get_least_orbits, get_next_displacements, get_bond_symmetry
def direction_to_displacement(datas... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 28 14:15:43 2021
@author: kahg8
"""
import argparse
import queue
import sys
from data_analysis import frame_generator
from matplotlib.animation import FuncAnimation
import matplotlib.pyplot as plt
import numpy as np
import sounddevice as sd
import webrtcvad
import tenso... |
"""AWS Braket backends."""
import datetime
import logging
from abc import ABC
from typing import Iterable, Union, List
from braket.aws import AwsDevice, AwsQuantumTaskBatch, AwsQuantumTask
from braket.circuits import Circuit
from braket.devices import LocalSimulator
from braket.tasks.local_quantum_task import LocalQ... |
import random
import math
import json
from copy import deepcopy
class Tran:
def __init__(self, tran_id, source, action, guards, reset, target):
self.tran_id = tran_id
self.source = source
self.action = action
self.guards = guards
self.reset = reset
self.target = tar... |
import otpcypher
import keygenerator
import helper
import argparse
import sys
import actions
# Run execution
def main(args = None):
parser = getParser()
run(parser, parser.parse_args())
def run(parser, args):
if (args.cmd == "enc" or args.cmd == "dec"):
cypher(args)
elif (args.cmd == "keygen")... |
from typing import List, Union, Optional
import os
import requests
import re
import time
import pandas as pd
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from bs4 import BeautifulSoup
class PatentDownloader:
url = "https://patents.google.com"
def __init__(self, chro... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
from copy import deepcopy
from colorama import Fore, Back, Style
DIRECTIONS = {"U": [-1, 0], "D": [1, 0], "L": [0, -1], "R": [0, 1]}
END = [[1, 2, 3], [4, 5, 6], [7, 8, 0]]
# unicode
left_down_angle = '\u2514'
right_down_angle = '\u2518'
right_up_angle = '\u2510'
left... |
import os
from typing import Any, Final, List, TypedDict
import torch
import torchvision
from torch import nn, optim
from torchvision import datasets, models, transforms
DATASET_DIR: Final[str] = "../../data/dataset/"
MODEL_PATH: Final[str] = "../../models/model.pth"
CLASSES: Final[List[str]] = sorted(
[
... |
import tensorflow as tf
import tensorflow.contrib.slim as slim
from nets import nets_factory, resnet_utils, resnet_v2
def patch_resnet_arg_scope (is_training):
def resnet_arg_scope (weight_decay=0.0001):
print('\033[91m' + 'Using patched resnet arg scope' + '\033[0m')
batch_norm_decay=0.9
batch... |
import json
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
vmanage_session = requests.session()
# Reserved sandbox
vmanage_node = {
"host": "10.10.20.90",
"username": "admin",
"password": "<PASS... |
import glob
import os
import h5py
import keras.layers as layers
import numpy as np
import tensorflow as tf
from keras import backend, optimizers, regularizers
from keras.models import Model
import joblib
import optuna
from optuna.integration import KerasPruningCallback
from optuna.visualization import *
from utils im... |
from collections import OrderedDict
from functools import wraps
from logging import getLogger
from typing import Any, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Type
import django_filters
from beam.registry import ViewsetMetaClass, default_registry
from django.db.models import Model, QuerySet
from djang... |
import logging
from botocore.exceptions import ClientError
from library.aws.utility import convert_tags
class EBSOperations:
@staticmethod
def snapshot_make_private(ec2_client, snapshot_id):
"""
Remove public permissions on EBS snapshot
:param ec2_client: EC2 boto3 client
:p... |
#! python34 $this
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
import os, sys
dirpath = os.path.dirname(os.path.abspath(__file__))
dirpath = os.path.dirname(dirpath)
sys.path.insert(0,dirpath)
isPython3 = sys.version_info[0]==3
if isPython3:
unicode = str
import yue
from yu... |
from google.cloud import spanner
instance_id = 'test-instance'
database_id = 'sales-db'
database_id2 = 'singers-db'
def main():
insert_data(instance_id, database_id2)
update_data(instance_id, database_id2)
delete_data(instance_id, database_id2)
# [START spanner_add_column]
def add_column(instan... |
OutputDocs = provider(fields = ["files", "name"])
def add_exclude_pkgs_command(excluded_pkgs):
"""If there are excluded packages, add extra sed command to exclude these pkges from runfile"""
if excluded_pkgs == []:
return ""
# Change pkg name to format understandable by Bazel
# e.g. azure_co... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
from typing import Tuple, Callable, Union, Any
import numpy as np
import torch
from torch.nn import Module, Parameter
from netlens.image_proc import IMAGENET_MEAN, IMAGENET_STD
class RawParam(Module):
"""
A raw 'parameterized image', that just wraps a normal tensor.
This has to be the first layer in the... |
import datetime
import time
import telepot
from telepot.loop import MessageLoop
from telepot.namedtuple import ReplyKeyboardMarkup, KeyboardButton
from telepot.namedtuple import InlineKeyboardMarkup, InlineKeyboardButton
def read_file() -> dict:
"""
Read file with schedule and returns
schedule as a dict ... |
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 4 21:18:49 2019
@author: Yoshin
"""
from SignalBuilder.functions import *
import numpy as np
class Node:
_time = None
_left = None
_right = None
_nType = 'normal'
def __init__(self, time=None, left_piece=None, right_piece=None, nType='normal'):
... |
# Copyright 2008 Divmod, Inc. See LICENSE file for details
# -*- test-case-name: xmantissa.test.test_webapp,xmantissa.test.test_publicweb,xmantissa.test.test_website -*-
"""
This unfortunate module exists to contain code that would create an ugly
dependency loop if it were somewhere else.
"""
from zope.interface impor... |
#!/usr/bin/env python
import cv2
import numpy as np
import yaml
import rospy
import rospkg
from camera_driver.srv import SetBlobInfo
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
from geometry_msgs.msg import PointStamped
from geometry_msgs.msg import Point
from std_msgs.msg impor... |
"""Example use of Popsearch.
Tunes hyper-parameters of a feed-forward network to to predict
:math:`y(x) = 1 + 0.3 * x_1 - 0.6 * x_2^2 - 0.2 * x_3^3 + 0.5 x_4^4`.
Hyper-parameters that we tune:
- Param init scale
- Number of layers
- Hidden layer size
- Activation function
- Learning rate
To run ... |
"""Detect Scratch Package.""" # coding=utf-8
#
# /************************************************************************************
# ***
# *** Copyright Dell 2021, All Rights Reserved.
# ***
# *** File Author: Dell, 2021年 12月 14日 星期二 00:22:28 CST
# ***
# ******************************************************... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# coding=utf-8
# Author: <NAME> Cruz <<EMAIL>>
#
# License: BSD 3 clause
"""
====================================================================
Dynamic selection with linear classifiers: XOR example
====================================================================
This example shows that DS can deal with non-lin... |
# Copyright (C) 2015-2021 Regents of the University of California
#
# 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 app... |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import math
import Useful
def planck(temp, lambda2):
""" /**
* Inputs: lambda: a single scalar wavelength in cm temp: a single scalar
* temperature in K Returns log of Plank function in logBBlam - B_lambda
* dis... |
import os,datetime,random,time
import tensorflow as tf
from multiprocessing import Process
from IutyLib.commonutil.config import Config
from prx.PathProxy import PathProxy
from prx.ClassProxy import ClassProxy
from object.Config import CNNDivParam,CNNDivSetting
import object.datasets as datasets
from object.models i... |
from inference.gp_tools import GpOptimiser
import matplotlib.pyplot as plt
import matplotlib as mpl
from numpy import sin, cos, linspace, array, meshgrid
mpl.rcParams['axes.autolimit_mode'] = 'round_numbers'
mpl.rcParams['axes.xmargin'] = 0
mpl.rcParams['axes.ymargin'] = 0
def example_plot_1d():
mu, sig = GP(x_g... |
# coding=utf-8
# The MIT License (MIT)
# Copyright (c) [2015] [<NAME>]
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the Aidez-moi), to deal
# in the Software without restriction, including without limitation the rights
# to use, c... |
import os
import sys
import configparser
import socket
import logging
from pathlib import Path
from multiprocessing import Process
from mlpipeline import log
from mlpipeline.utils import (set_logger,
is_no_log,
PipelineConfig)
from mlpipeline.entities import E... |
from django.shortcuts import render, redirect, get_object_or_404
from django.conf import settings
from django.utils.text import slugify
import os
# imported our models
from App.models.song import Song
from App.models.playlist import SongInPlaylist
from App.forms import SongFileInputForm, SongEditForm
# Create your v... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on March 10 2020
@author: <NAME>
Translated from C++ code by <NAME>
---
Camera models for pixel-to-vector transformation
"""
import os
import numpy as np
import xmltodict
import math
class OcamCalibCameraModel:
'''
OcamCalib camera model for fishey... |
import numpy as np
import torch.utils.data as tud
from sklearn.model_selection import train_test_split
from noge.constants import REAL_DATASETS, PLACES, DATA_DIR
from xlog.utils import load_pickle
class GraphDataset(tud.Dataset):
def __init__(self, graphs, mazes=None):
self.graphs = graphs
self... |
from youtube_transcript_api import YouTubeTranscriptApi
from urllib import parse
import streamlit as st
def transcribe_video(video_id, translate, language_from, translate_to, list_languages):
if translate == True:
transcript_list = YouTubeTranscriptApi.list_transcripts(video_id)
transcript = transc... |
"""
Tools for transcoding from an bitstring to dict according to an arbitrary mapping
"""
import bitstring
from bitstring import ConstBitStream as Bits
from abc import ABC
from abc import abstractmethod
from ais import DecodeError
AIS6toASCII8 = [chr(i+48) for i in range(40)] + [chr(i+96) for i in range(24)]
ASCII8... |
import pandas as pd
from scipy.stats import ttest_ind
import numpy as np
from statsmodels.stats.multitest import multipletests as multit
from warnings import warn
def count_reps(inseries):
inseries = inseries.tolist()
counts = {k:0 for k in list(set(inseries))}
out = [878 for i in range(len(inseries))]
... |
from modules.preprocessors.configs import PreProcessingConfigs
from modules.embeddings.word_features import train_word2vec
from utils.file_ops import create_dir, check_paths
from utils.common import check_data_set
from utils.logger import PrintLog
from nltk.corpus import stopwords
import scipy.sparse as sp
from time im... |
# https://github.com/Wireframe-Magazine/Wireframe56
# Wireframe #56:
import pgzrun
import pickle
editorState = True
editorEnabled = True
if editorState:
WIDTH = 1000
gameState = count = 0
editItem = "blank"
editorMessage = ""
editorMessageCount = 0
blockTypes = [
Actor('blank', center=(900, 250)),
Act... |
from __future__ import division
import simpy
import random
import numpy as np
from contextlib import suppress
import math
from printevent import print_event
class Task:
"""
Class: Creates a task object for elevators. Elevator object do not have visibility
to request but their own tasks. ElevatorControl c... |
import requests
import datetime
import lxml.html as html
import re
import random
months = ["января", "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "ноября",
"декабря"]
annivs = [1000, 500, 250, 100, 50, 5]
def get_events(marker, doc):
event_tags = []
catch_t... |
"""
This skill is a demo for the Girls Who Code visit to CNN.
The Intent Schema, Custom Slots, and Sample Utterances for this skill, as well
as how to open the skill are in https://github.com/cnnlabs/gwc-demo.
For additional samples, visit the Alexa Skills Kit Getting Started guide at
http://amzn.to/1LGWsLG
"""
from ... |
import logging
import random
from abc import abstractmethod
from typing import List, Callable, Tuple
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import colors
from matplotlib.colors import LinearSegmentedColormap
logger = logging.getLogger(__name__)
class SAModel:
"""
Use case specifi... |
from django.shortcuts import render, redirect
from hoax.models import Hoax
from django.db import connection
from gensim import corpora
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
import csv
from django.http import HttpResponse
# Cre... |
# /$$$$$$$ /$$ /$$
# | $$__ $$ | $$ |__/
# | $$ \ $$ /$$$$$$ /$$$$$$$ /$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$ /$$ /$$$$$$ /$$$$$$$
# | $$ | $$ /$$__ $$ /$$___... |
# Copyright (C) 2012-2015, <NAME> (<EMAIL>)
#
# 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 dist... |
import os
from random import random,randint, sample
from operator import itemgetter
# Simple [Binary] Evolutionary Algorithm
def sea(numb_generations,size_pop, size_cromo, prob_mut,prob_cross,sel_parents,recombination,mutation,sel_survivors, fitness_func,universe,sets):
# inicialize population: indiv = (cromo,f... |
#!/usr/bin/env python3
# This sample demonstrates how to use the siem/source_addresses and
# siem/local_destination_addresses endpoints in the REST API.
# Here we will be showing an example of how to get all offenses associated with
# an IP address. For this scenario to work there must already be offenses on
# the sys... |
__all__ = ["Block", "LCLayer", "LCStack", "make_2d"]
from functools import wraps
from math import ceil
from typing import List
import torch
from torch import nn
from torch.nn.modules import lazy
import torch.nn.functional as F
def make_2d(method):
"""Flattens 3D input, conserving batch size dimension."""
@... |
# The MIT License (MIT)
# Copyright (c) 2021 by Brockmann Consult GmbH and contributors
#
# 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... |
from procfs.core import ProcessFile, Dict
# /proc/net/rpc/nfsd documentation:
# <kernel src>/fs/nfsd/stats.c : nfsd_proc_show
# /net/sunrpc/stats.c : svc_seq_show
# /fs/nfsd/nfsproc.c : nfsd_procedures2
# /fs/nfsd/nfs3proc.c : nfsd_procedures3
# /fs/nfsd/nfs4p... |
import sys
import click
import time
import calendar
import datetime
from anchore.cli.common import anchore_print, anchore_print_err
from anchore import anchore_auth, anchore_feeds
from anchore.anchore_utils import contexts
config = {}
@click.group(name='feeds', short_help='Manage syncing of and subscriptions to Anch... |
from audio_process import AudioConverter
from concurrent import futures
from multiprocessing import freeze_support
from utils import print_results, get_paths, get_filename, is_dir
import features
from itertools import repeat
from tqdm import tqdm
import pandas as pd
import numpy as np
import os
TARGET_PATH = "/Volume... |
"""
Utilities to manage AWS Elastic Block Store volumes and snapshots.
To delete EBS volumes or snapshots, use ``aegea rm``.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import os, sys, argparse, getpass
from datetime import datetime
from . import register_parser
from .ls i... |
import re
from datetime import datetime
import discord
from discord import Embed, Color
from discord.abc import PrivateChannel
from discord.ext import commands
from discord.ext.commands import Context, Bot, CommandError, check, clean_content
from pytz import utc, timezone
from apollo import pluralise
from commands.ka... |
import requests
import urllib
import hashlib
import os
import re
import json
import math
import time
from pathlib import Path
from datetime import date
class CachedState:
def __init__(self):
self.cache_paths = {}
def add(self, route_id, cache_path):
self.cache_paths[route_id] = cache_path
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Submission for CVPR 2020 CLVision Challenge
# Copyright (c) 2020. <NAME>, <NAME>, and <NAME>. All rights reserved.
# Copyrights licensed under the CC-BY-NC 4.0 License.
# See the accompanying LICENSE file for terms.
# Based on the utils.train_test.py by <NAME>, <NAME>,... |
import os
import json
import click
import requests
import inquirer
import sentry_sdk
from absl import logging
from dotenv import load_dotenv
load_dotenv() # take environment variables from .env.
# Code of your application, which uses environment variables (e.g. from `os.environ` or
# `os.getenv`) as if they came fr... |
# -*- coding: utf-8 -*-
"""
Created on 23/03/18
Author : <NAME>
Produces 2D maps of Lick indices
"""
from __future__ import print_function, division
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__),
'..')))
import numpy as np
import astropy.units as ... |
'''
测试YOLO模型
'''
import cv2
import scipy
import scipy.misc
import numpy as np
import random
from math import *
def get_transform(center, scale, res, rot=0):
"""
General image processing functions
"""
# Generate transformation matrix
h = 200 * scale
t = np.zeros((3, 3))
t[0, 0] = float(res[... |
# Implementation of an interferometric direction finding algorithm for an orthoganal L antenna array
#
#
# 90 degrees
# |
# v
#
# 7
# |
# |
# |
# |
# 5
# |
# |
# 3
# |
# 1--2-----4------------6 <-- 0 degrees
#
# TODO: Fix ambiguities when the wavefront is parallel to one of the array's legs.
# In this situation ... |
import numpy as np
import pandas as pd
import os
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.metrics import confusion_matrix, accuracy_score
from sklearn.model_selection import train_test_split
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequ... |
import os
import sys
sys.path.append(os.getcwd())
import pickle
import pandas as pd
from hpo.utils import *
from hpo.helpers import *
from hpo.task2vec.task2vec import Task2Vec
from hpo.task2vec.models import get_model
import hpo.task2vec.task_similarity as task_similarity
def calculate_dataset_x_augmentation_embed... |
# File: problem1.py
# Author: <NAME>
# Date: 11/06/2019
# Class: ECE 555 - Probability for Electrical Engineers
# Description:
# Write and run a program to simulate an M/E2/1 queue and obtain realizations of
# the four stochastic processes defined in Example 6.2. Plot these realizations. You
# may use a simulatio... |
# global variables and constants
dataFile = 'FBI_the_Game_Data_2.txt'
hiddenBone = " X " # this is how hidden bones are represented in the 2D backyard array
foundBone = " B " # this is how bones that the player has found are represented in the backyard
def createBackyard(width, height):
"""
This functio... |
from __future__ import print_function
import matplotlib
matplotlib.use('Agg')
import numpy as np
import matplotlib.pyplot as plt
import sys
sys.path.insert(0,'../powderday/agn_models/')
from hopkins import agn_spectrum as hopkins_agn
from astropy import units as u
from astropy import constants as const
import h5py
fr... |
"""A Utility Module for generating interior boundaries in Fenics"""
__author__ = "<NAME>"
__copyright__ = __author__
__project__ = "Finmag"
__organisation__ = "University of Southampton"
#Note when restricting forms ('+') will be on the outside of the submesh,
#and ('-') will be on the inside
#TODO Expand the class I... |
#!/usr/bin/env python
import os
import youtube_dl
import spotipy
import spotipy.util as util
from spotipy.oauth2 import SpotifyClientCredentials
import spotipy.oauth2 as oauth2
from youtube_search import YoutubeSearch
import json
import webbrowser
## YouTube downloader options
ydl_opts = {
'format': 'bestaudio/be... |
import logging
import discord
from discord.ext import commands
from discord.commands import slash_command, Option
from PIL import Image, ImageFont, ImageDraw
from resizeimage import resizeimage
import requests
import json
import asyncpg
import os
from dotenv import load_dotenv
load_dotenv()
# Logging
logging.basicCo... |
# Private module to separate print logic from main logic of BinaryTree
from __future__ import annotations
import math
from typing import Any, Optional
from datastax.linkedlists import Queue
def _node_builder(data: Optional[str], piece_width: int) -> str:
value: str = data or ''
gap1 = int(math.ceil(piece_wi... |
#!/usr/bin/env python3
import time
import threading
import xml.etree.ElementTree as ET
import queue
# Custom modules/packages
import pixel_display.pixel_display as pix_display
import accel.accel as accel
# Event Base Class
class Event:
def __init__(self, type):
print("Setting up an event"... |
#!/usr/bin/env python
__doc__ = '''Deletes glyphs from a UFO based on list. Can instead delete glyphs not in list.'''
__url__ = 'http://github.com/silnrsi/pysilfont'
__copyright__ = 'Copyright (c) 2018 SIL International (http://www.sil.org)'
__license__ = 'Released under the MIT License (http://opensource.org/licenses/... |
#!/usr/bin/python
import fnmatch
import os.path
import re
from rime.basic import consts
import rime.basic.targets.solution # NOQA
import rime.basic.targets.testset # NOQA
from rime.basic import test
from rime.core import targets
from rime.core import taskgraph
from rime.util import files
class SubtaskTestCase(tes... |
import json
import subprocess
import sys
import tempfile
import os
import re
from collections import namedtuple
import logging
logger = logging.getLogger("jbx.nixutils")
def quote(item):
return '"{}"'.format(item)
def to_nix_list(list):
return "[{}]".format(" ".join(map(quote, list)))
def from_attrset_lis... |
#!/usr/bin/env python3
import logging
from logging import config
import os
from os import path
import sys
import ntpath
import smtplib
import email
from email import encoders
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
LOG_PATH = '/data/scrip... |
import argparse
import functools
import logging
from typing import NamedTuple
import gffutils
from general_gene_model import retrieve_segment_annotation
CACHE_MAX_SIZE = 2048
logger = logging.getLogger(__name__)
class Variant(NamedTuple):
chrom: str
start: int
end: int
tx_id: str
classificatio... |
#!/usr/bin/env python
import logging
from typing import List, Optional, Union
from ensure import check, ensure_annotations
import pandas as pd
logger = logging.getLogger(__name__)
VALID_TEETH = ('NA', '0', '1', 'A', 'B1', 'B2', 'C', 'D', 'E', 'F', 'G', 'H', 'I') # noqa: E221
VALID_CALCULUS = ('NA', '0', '1'... |
"""
The reader is part of the new database concept 2017.
The task of the reader is to take a database JSON and an dataset identifier as
an input and load all meta data for each observation with corresponding
numpy arrays for each time signal (non stacked).
An example ID often stands for utterance ID. In case of speak... |
import sys
import pandas as pd
import nltk
nltk.download(['stopwords', 'punkt', 'wordnet', 'averaged_perceptron_tagger'])
from nltk.corpus import stopwords
import re
from sqlalchemy import create_engine
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize, sent_tokenize
from sklearn.feature_... |
'''
==========================================================================
adapters.py
==========================================================================
Adapters for the master minion xbar. The field name of the opaque field is
currently hard-coded to be 'opaque'.
Author : <NAME>
Date : Apr 11, 2020
'''... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.