text stringlengths 3.07k 22.1k |
|---|
# code in this file is adpated from rpmcruz/autoaugment
# https://github.com/rpmcruz/autoaugment/blob/master/transformations.py
import random
import numpy as np
import torch
import torch.nn.functional as F
import torchvision.transforms.functional as TF
__all__ = ["RandAugment"]
def ShearX(img, v): # [-0.3, 0.3]
... |
from flask import Blueprint, request, render_template, \
flash, g, session, redirect, url_for, \
jsonify, make_response
from btsapi.modules.settings.models import Setting, SettingMASchema, SupportedVendorTech, CMFileFormats, \
CMFileFormatsMASchema, VendorCMFileFormatsMap
from btsapi.extensions import db
i... |
""" Module for risk-exploiting reward perimeter scenario
Environment will contain:
- A 2D reward distribution. The objective of the multi-agent system is to form a "perimeter" around the reward distribution
such that is maximize the surface integral of the reward distribution across the surface of the largest conve... |
import enum
import ipaddress
import re
import uuid
from distutils.version import StrictVersion
from typing import Any, Type, Union
from boltons.typeutils import classproperty
from boltons.urlutils import URL as BoltonsUrl
from ereuse_utils import if_none_return_none
from flask_sqlalchemy import BaseQuery, Model as _Mo... |
from m5.SimObject import SimObject
from m5.params import *
from m5.proxy import *
from PciHost import PciHost
import sys
import os
home = os.getenv('HOME')
sys.path.append(str(home) + '/t_gem5/gem5/src/mem')
#from MemObject import MemObject # MemObject is deprecated
from m5.objects.ClockedObject import ClockedObject
... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import gzip
import os
import sys
import time
import numpy
from six.moves import urllib
from six.moves import xrange # pylint: disable=redefined-builtin
import tensorflo... |
import cv2
import numpy as np
import matplotlib.pyplot as plt
import time
def cv_show(img, name='img'):
cv2.namedWindow(name, 0)
cv2.resizeWindow(name, 300, 300)
cv2.imshow(name, img)
cv2.waitKey(0)
cv2.destroyAllWindows()
def resize(image, width=None, height=None, inter=cv2.INTER_... |
#!/usr/bin/env python
"""
To use this script you'll need flac and lame
Usage :
flac2mp3 [origin directories containing flac files] mp3/repository/destination
"""
import getopt
from itertools import repeat
from logging import INFO
import logging
from multiprocessing import Pool
import multiprocessing
import locale
impor... |
import numpy as np
from gym import error, spaces
from mlagents_envs.environment import UnityEnvironment
from mlagents_envs.base_env import ActionTuple
from mlagents_envs.side_channel.environment_parameters_channel import (EnvironmentParametersChannel,)
from mlagents_envs.side_channel.engine_configuration_channel impor... |
import cv2
import numpy as np
from tifffile import imread
import random
import os
class AnnotatedObject:
mean_x = 0
mean_y = 0
min_x = 0
min_y = 0
max_x = 0
max_y = 0
img_ind = 0
def __init__(self,img_ind = 0,obj_ind = 0, mean_x = None, mean_y = None, min_x = None, min_y = None, max_x ... |
import torch
import numpy as np
from sklearn.metrics import roc_auc_score, precision_recall_curve, auc
from sklearn.utils import shuffle as skshuffle
import gpytorch
import rgpr.kernel as rgp_kernel
import torch.distributions as dist
@torch.no_grad()
def predict(dataloader, model, n_samples=1, T=1, delta=1, return_ta... |
import json
import logging
import src.server.cea_608_encoder.caption_string_utility as utils
import src.server.cea_608_encoder.scene_utility as scene_utils
import src.server.config as config
# At a future time this could live in it's own config file
# Leaving it here temporarily
supported_caption_formats = [
'CEA... |
import numpy as np
import pickle
import time
import os
import pandas as pd
import sys
import pandas.core.indexes
sys.modules['pandas.indexes'] = pandas.core.indexes
from sklearn.model_selection import GridSearchCV, ParameterGrid, StratifiedKFold
from sklearn.linear_model import LogisticRegression, SGDClass... |
#
# MIT License
#
# (C) Copyright 2019-2022 Hewlett Packard Enterprise Development LP
#
# 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 support.logging import log
from edp_modules.edp_system import EdpSystem
class Route:
def __init__(self):
self.node_list = []
self.length = 0
def pretty_string(self):
out = ''
i = 1
for node in self.node_list:
out = out + '{0:3d}: {1}\n'.format(i, no... |
"ops.py -- commands on tables"
# todo: need coverage of all the functions with execute() calls, i.e. test against DBs
import collections, six
from . import row
WILDCARD = '%s'
class UnkFieldError(row.MetamodError):
def __init__(self, rowclass, field):
self.rowclass = rowclass
self.field = field
... |
# Tris against the CPU with AI
#########################################################
from random import randrange
# Stampa la griglia del TRIS
def stampa_griglia(tris):
sepColonne = '| | | |'
sepRighe = '+-------+-------+-------+'
print(sepRighe)
print(sepColonne)
... |
# -*- coding: utf-8 -*-
import re
from django.core.validators import validate_email
from django.core.exceptions import ValidationError
from django.http import JsonResponse
class ValidateResult:
"""
Encapsulate is_valid, and message.
Message is generally used in the case which is_valid=False.
"""
... |
# -*- coding: utf-8 -*-
"""
editeur de Spyder
Ceci est un script temporaire.
"""
import numpy as np
import pandas as pd
import json
from pprint import pprint
File = {"Profiles" : { "Academie" : [60000, 30000, 40000], "Departement" : [5, 6, 7], "Dernier" : [80, 90, 100] },
"Content" : {"Academie" :... |
import sys
import os
import collections
# import sys
import yaml
# from datetime import datetime, date
from pymongo import MongoClient
# from bson.objectid import ObjectId
LIMIT = None
EXPORT_DIR = "~/Documents/DANS/projects/has/backupsYaml/2019-12-05"
DATABASE = "dariah"
DB = MongoClient()[DATABASE]
USER_CONTENT... |
#
# Copyright (c) 2015-2021 <NAME> <tflorac AT ulthar.net>
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE... |
"""
Name: FeatureServerExtraction
Purpose: Takes image input and provides resultant category
"""
import cv2
import pickle
import pandas as pd
import numpy as np
import scipy
import pytesseract
from scipy import stats
MODEL_PATH = 'static/adroast_model.sav'
def main():
extract_feature('52712850_2504348282... |
from __future__ import division
from __future__ import print_function
import sys
import argparse
from math import sqrt
import numpy as np
import cv2
import mxnet as mx
from sklearn import preprocessing
from skimage import transform as trans
from landmarks import FaceAlignment, LandmarksType
class Landmarks:
def... |
"""setup.py
Please see README for basic installation instructions.
"""
import os
import re
import sys
from distutils.command.build_ext import build_ext
from distutils.errors import (CCompilerError, DistutilsExecError,
DistutilsPlatformError)
try:
from setuptools import setup, Extens... |
import sys
import os
def solve(grid):
""" main function to solve the grid.
"""
availableOptions = {} # keys -> tuple(row, col) of blank spaces;
# values -> set of possibilties
m = len(grid)
sRow = int(m**0.5)
sCol = int(m**0.5) # sRow x sCol (size of subGrid)
assert m... |
"""
Tool for importing markdown and their metadata
"""
import os
import re
import yaml
from io import StringIO
from enum import Enum
from dataclasses import dataclass, asdict
from typing import List, Dict, Optional, Tuple, Set, Any, Union
from datetime import datetime as DateTime
from datetime import tzinfo
from ... |
import re
import json
import os
import logging
import time
from logging.handlers import RotatingFileHandler
from logging import Formatter
from fuzzywuzzy import fuzz
from hashlib import md5
from flask import Flask, jsonify, send_from_directory, send_file, render_template, request, redirect, make_response
import imgu... |
#-*- encoding: utf-8 -*-
from bs4 import BeautifulSoup
from html import unescape
from html.parser import HTMLParser
import os
import random
import re
import requests
requests.packages.urllib3.disable_warnings(
requests.packages.urllib3.exceptions.InsecureRequestWarning
)
from subprocess import Popen, PIPE
import s... |
from sklearn.datasets import load_files
import logging
import numpy as np
from optparse import OptionParser
import sys
from time import time
import matplotlib.pyplot as plt
from scipy.optimize import minimize
import bz2;
from tqdm import tqdm;
from math import exp;
from sklearn.datasets import fetch_20newsgroups
from ... |
"""
This module contains scripts to plot SWHLab ABF objects.
Try to keep analysis (event detection, etc) out of this.
"""
# start out this way so tests will import the local swhlab module
import sys
import os
sys.path.insert(0,os.path.abspath('../../'))
import swhlab
# now import things regularly
import logging
impor... |
import subprocess
import json
from dateutil.parser import parse
from datetime import datetime
from django.template.defaultfilters import slugify
from django.views.generic import ListView, DetailView, FormView
from django.http import HttpResponseRedirect, HttpResponse
from django.contrib.contenttypes.models import Cont... |
"""
DQN and its variants
------------------------
We support Double DQN, Dueling DQN and PER here.
Reference:
------------------------
1. Double DQN
<NAME>, <NAME>, <NAME>. Deep reinforcement learning with double
q-learning[C]//Thirtieth AAAI Conference on Artificial Intelligence. 2016.
2. Dueling DQN
<NAM... |
import netCDF4
import numpy as np
import matplotlib.pyplot as plt
import datetime
import time
from matplotlib import gridspec
from matplotlib import pylab
########################################################################
# Boxplot Exampe
########################################################################
... |
from pathlib import Path
import dask.dataframe as dd
import pandas as pd
import pytest
from pandas._testing import assert_frame_equal
from pyspark import pandas as ps
from pyspark.sql import DataFrame as SparkDataFrame, SparkSession
from datasets import Dataset, Mode
from datasets.exceptions import InvalidOperationEx... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Proxy models for augmenting our source data tables with methods useful for processing.
"""
from __future__ import unicode_literals
from django.db import models
from .people import OCDPersonProxy
from .elections import OCDElectionProxy
from django.db.models import Intege... |
#!/usr/bin/env python
import launchpad_py
import wx
import json
import os
import subprocess
import shlex
import time
import argparse
colors = {"black": 0}
class Util:
def choose_color(self, lp):
lp.ButtonFlush()
color = 20
ev = None
colors = None
starting_color = 0
... |
#!/usr/bin/python3
#
# UDP traceroute utility to check reachability and measure RTT between routers
# (e.g. VXLAN VTEP loopback IPs) across all uplinks and available paths
#
# Sends out UDP packets with destination ports in the range 33434-33464
# (as allowed by SR Linux in the default config). The port is incremented... |
"""
SSDO algorithm from:
<NAME>., <NAME>., <NAME>., <NAME>., <NAME>., & <NAME>. (2018, November).
Semi-supervised Anomaly Detection with an Application to Water Analytics.
In Proceedings/IEEE International Conference on Data Mining.. IEEE.
SSDO has no build-in out-of-sample functionality.
Best way to tackl... |
import pyperclip
import xlwt
import numpy as np
def read_max():
# read data
all_lines = []
for i in range(4):
with open('TDPAT_max_{}.txt'.format(i+1), 'r') as inf:
all_lines.append(inf.readlines())
n_line = 196
n_d = 10
steps_list = []
epss_list = []
... |
import collections.abc as abc_collections
from contextlib import contextmanager
import datetime
import logging
from unittest.mock import _ANY, MagicMock, Mock
from typing import Callable, Dict, Iterator, Optional, Tuple, Union
import dateutil.parser
import requests
from requests.adapters import HTTPAdapter
from reque... |
import socket
import asyncio
import struct
ETH_P_ALL = 0x0003
ETH_P_IP = 0x0800
ICMP = 0x01 # https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers
# Coloque aqui o endereço de destino para onde você quer mandar o ping
# Pode ser obtido com o comando arp -a | grep _gateway
dest_ip = '192.168.1.1'
# Coloque... |
#!/usr/bin/env python3
"""
一个自实现的web微框架
暂时只支持返回json数据
"""
import threading
import logging
from collections import OrderedDict
from .httpserver import run_simple
from .tree import Tree
from .exceptions import (AppBaseException, MethodNotAllowed, NotFound, InternalServerError)
from .context import AppR... |
import os
import colorama
from IMLearn.learners.regressors import LinearRegression
from IMLearn.utils.utils import split_train_test
from typing import NoReturn
import numpy as np
import pandas as pd
import plotly.graph_objects as go
import plotly.express as px
import plotly.io as pio
pio.templates.default = "simple_wh... |
import argparse, os, fnmatch, math
import pandas as pd
from scipy import stats as scipystats
TRACK_PREFIX = "week"
GAME_FILE = "games"
PLAY_FILE = "plays"
GAME_ID = "gameId"
PLAY_ID = "playId"
FRAME_ID = "frameId"
POSITION_FLD = "position"
TEAM_FLD = "team"
OFFENSE_FLD = "possessionTeam"
HOME_FLD = "homeTeamAbbr"
AWA... |
"""Library for interacting with InfluxDB."""
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2017 The Contributors
#
# 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 ... |
import os
import random
import string
from typing import Dict
import kopf
import kubernetes
# Some (key) default deployment variables...
default_image = 'jupyter/minimal-notebook:notebook-6.3.0'
default_sa = 'default'
default_cpu_limit = '1'
default_mem_limit = '1Gi'
default_user_id = 1000
default_group_id = 100
defa... |
import logging
import os
import re
import datetime
from irods.meta import iRODSMeta
from irods.models import Collection
from irods.models import User, UserGroup
import irods.keywords as kw
from .collection import iRodsCollection
from .utils import iRodsCollectionNotFlat
from .utils import get_irods_zone
__all__ = ['t... |
# Copyright 2020 DeepMind Technologies Limited. 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 a... |
import boto3
import yaml
import json
import argparse
import os
import time
import sys
import traceback
from deepmerge import always_merger
import sys
if sys.version_info[0] >= 3:
unicode = str
def save_template(s3_url, template):
s3 = boto3.resource('s3')
bucket = s3_url.replace("s3:/", )
s3object ... |
import ctypes
import os
import secrets
import sys
from ctypes import CFUNCTYPE, POINTER, byref, c_char, c_uint8, c_uint16, c_uint32
from ctypes import cast, c_void_p
import ctypes.util
from enum import Enum
if os.name == 'nt':
LIB_SUFFIX = '.dll'
elif os.name == 'posix':
LIB_SUFFIX = '.dylib' if sys.platform =... |
from __future__ import print_function
from easydict import EasyDict as edict
from lib.cfgs import c as dcfgs
import lib.cfgs as cfgs
import os
os.environ['JOBLIB_TEMP_FOLDER']=dcfgs.shm
import argparse
os.environ['GLOG_minloglevel'] = '3'
import os.path as osp
import pickle
import sys
from multiprocessing import Proces... |
import math
import os
import numpy as np
from monai.data import Dataset, SmartCacheDataset
from skimage.transform import resize
from image_reader import WSIReader
class PatchWSIDataset(Dataset):
"""
Load whole slide images and associated class labels and create patches
"""
def __init__(self, data, ... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File : visualizer.py
# Author : <NAME>
# Email : <EMAIL>
# Date : 08/02/2021
#
# This file is part of TOQ-Nets-PyTorch.
# Distributed under terms of the MIT license.
import os
import matplotlib.pyplot as plt
from toqnets.utils import make_video
from toqnets.data... |
# !/usr/bin/env python
# -- coding: utf-8 --
# @Time : 2020/6/8 15:31
# @Author : liumin
# @File : LEDnet.py
import torch
import torch.nn as nn
import torchvision
import torch.nn.functional as F
def ConvBNReLU(in_channels,out_channels,kernel_size,stride,padding,dilation=[1,1],groups=1):
return nn.Sequential(
... |
"""
Celery tasks module for Ona app
"""
from datetime import timedelta
from time import sleep
from urllib.parse import urljoin
from celery import task as celery_task
from celery.utils.log import get_task_logger
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.urls im... |
# This file is a python wrapper of hilensframework
import hilens_internal
import numpy as np
import json
import warnings
import functools
def deprecated(replacement):
def deprecated(func):
@functools.wraps(func)
def new_func(*args, **kwargs):
warnings.simplefilter('always', Deprecatio... |
import types
import torch
import torchvision
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor, FasterRCNN
from torchvision.models.detection.backbone_utils import resnet_fpn_backbone
from torchvision.models.detection.anchor_utils import AnchorGenerator
from torch.nn import functional as F
from xvi... |
"""usage: vk_photos.py [-h] [-m] [-s] [-sw] [-sp] [-ss] [-t]
username password path {album,group,user} link
Download the photos from a user, group vk.com page or any particular
album.
positional arguments:
username VK login
password <PASSWORD>
path ... |
import sys
# insert at 1, 0 is the script path (or '' in REPL)
sys.path.insert(1, '../src/data')
# from get_users_info import *
# from get_brand_category_info import *
# from get_preference_matrix import *
import implicit
import faiss
from tqdm import tqdm
from scipy.sparse import csr_matrix
from scipy.spatial.distanc... |
"""
Copyright (c) 2021 Cisco and/or its affiliates.
This software is licensed to you under the terms of the Cisco Sample
Code License, Version 1.1 (the "License"). You may obtain a copy of the
License at
https://developer.cisco.com/docs/licenses
All use of the material herein must be in accordance wit... |
# Copyright (C) 2021 <NAME> and <NAME>
#
# SPDX-License-Identifier: MIT
from typing import Dict
import dolfinx.mesh as dmesh
import numpy as np
import ufl
from dolfinx import fem
from mpi4py import MPI
from petsc4py import PETSc
from generate_team30_meshes import (mesh_parameters, model_parameters,
... |
import re
from cmdmenus import getEncoding
class EdaUserFields(object):
def __init__(self):
self.fieldIndex1 = '-1'
self.fieldIndex2 = '-1'
self.locked = '"N"'
self.angle = '0'
self.libPath = 0
self.modelType = '0'
self.modelString = '""'
self.lockPro... |
import inspect
from typing import List, Callable
import hcl_mlir
import numpy as np
from hcl_mlir import ASTVisitor, GlobalInsertionPoint
from hcl_mlir.dialects import affine, builtin
from hcl_mlir.dialects import hcl as hcl_d
from hcl_mlir.dialects import memref, std
from hcl_mlir.ir import *
from ..types import dty... |
import struct
import wtforms
from wtforms.validators import Length, NumberRange
from . import core
class BasicBinaryField(core.BinaryField):
# Some BinaryFields will have inherent value restrictions, based on the
# limitations of the serialized form. For example, a UInt8Field cannot
# store numbers abov... |
import json
from datetime import datetime
import docker
from apscheduler.schedulers.background import BackgroundScheduler
from mitmproxy import http
from mitmproxy import proxy, options
from mitmproxy.tools.dump import DumpMaster
from observer_hub.assertions import assert_test_thresholds
from observer_hub.constants im... |
import torch
from torch.utils.data import DataLoader, Dataset
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import torchvision.transforms as transforms
import torch.optim as optim
from warmup_scheduler import GradualWarmupScheduler
import math
from torch.nn.modules.loss import _WeightedLoss
f... |
"""Base Tornado handlers for the notebook.
Authors:
* <NAME>
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of ... |
# copyright (c) 2018 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 app... |
import zmq
from random import shuffle
class Player:
def __init__(self, pseudo):
self.pseudo = pseudo
self.hand = []
self.order = -1
def set_order(self, order):
self.order = order
def get_order(self):
return self.order
class Move:
def __init__(self, pseudo, c... |
# Copyright 2009-2010 Yelp
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... |
from django.db import models
from django.core.cache import cache
from django.core.cache.utils import make_template_fragment_key
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.utils import timezone
from uuslug import uuslug
from utils.renderer import render
from .util i... |
from model import Job, Seer
import tkinter as tk
from tkinter.ttk import *
from ttkthemes import ThemedTk
from tkinter.filedialog import askopenfilename
from PIL import Image
import os
import cv2
import pygubu
import re
from multiprocessing import Process # , Queue, Manager
import multiprocessing as mp
# -... |
import json # to read our json dictionary
import sys # for the argv
import time # to time our requests
from colorama import init # for colors
init()
# quiddler is a card game where you build words
# you score points for longest words, most words, or hard letters
# sometimes, you just cant... |
from __future__ import print_function
import re
import string
import subprocess
import sys
import copy
if sys.version_info[0] > 2:
class string:
expandtabs = str.expandtabs
else:
import string
##### Common utilities for update_*test_checks.py
def should_add_line_to_output(input_line, prefix_set):
# Skip an... |
"""Support for Apple TV media player."""
import logging
from pyatv import exceptions
from pyatv.const import (
DeviceState,
FeatureName,
FeatureState,
MediaType,
PowerState,
RepeatState,
ShuffleState,
)
from pyatv.helpers import is_streamable
from homeassistant.components.media_player impo... |
#---------------------------------------------------------------------------
# Copyright 2013 PwC
#
# 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/LICENS... |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
__author__ = '<NAME>'
from pybrain.supervised.evolino.gfilter import Filter, SimpleMutation
from pybrain.supervised.evolino.variate import CauchyVariate
from pybrain.supervised.evolino.population import SimplePopulation
from pybrain.tools.validation import Validator
from pybrain.tools.kwargsprocessor import KWArgsProc... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020 The Regents of the University of California.
# 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 cop... |
"""
Controllers for registration and user profile management.
Users are able to create a new arXiv account, and login using their username
and password. Each user can create a personalized profile with contact and
affiliation information, and links to external identities such as GitHub and
ORCID.
"""
from typing impo... |
import argparse
import logging
import math
from nmigen.compat import *
from ....gateware.pads import *
from ....gateware.i2c import I2CMaster
from ... import *
CMD_START = 0x01
CMD_STOP = 0x02
CMD_COUNT = 0x03
CMD_WRITE = 0x04
CMD_READ = 0x05
class I2CMasterSubtarget(Module):
def __init__(self, pads, out_fif... |
#!/usr/bin/python3 -i
#
# Copyright (c) 2013-2020 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0
import os,re,sys
from generator import *
doc = """
/*
** This target is no longer maintained and supported.
** See README.adoc for discussion.
**
** This is a simple extension loader which provides the imp... |
###
### Copyright (c) Microsoft Corporation. All rights reserved.
###
from ctypes import *
class IdCtrl(Structure):
"""Identify Controller"""
_pack_ = 1
_fields_ = [
('pci_vendor_id', c_uint16),
('pci_subsystem_vendor_id', c_uint16),
('serial_number', c_char * 20),
('model_... |
#!/usr/bin/env python3
import argparse
from os import makedirs, remove
from os.path import join, basename, exists
from subprocess import call
import csv
from pysam import VariantFile
import random
import numpy as np
default_measures = "AC AD AF ARF BQ CC CRF DP FRF GC GQ GQD NC MC MF MP MRC MQ MQ0 MQD PP PPD QD QUAL ... |
"""
PBjam uses MC sampling at several points during the peakbagging process.
Samplers added to PBjam should be called from this module.
"""
import emcee
import numpy as np
import scipy.stats as st
import cpnest.model
import pandas as pd
import os
class mcmc():
""" Class for MCMC sampling using `emcee'
U... |
"""Rasterio"""
from __future__ import absolute_import
from collections import namedtuple
from contextlib import contextmanager
import logging
try:
from pathlib import Path
except ImportError: # pragma: no cover
class Path:
pass
try:
from logging import NullHandler
except ImportError: # pragma:... |
"""
Writes the global keyword section of a MESS input file
"""
import os
from qcelemental import constants as qcc
from ioformat import build_mako_str
from varecof_io.writer import util
ANG2BOHR = qcc.conversion_factor('angstrom', 'bohr')
RAD2DEG = qcc.conversion_factor('radian', 'degree')
# OBTAIN THE PATH TO THE D... |
"""Common IO api utilities"""
import bz2
from collections import abc
import gzip
from io import BufferedIOBase, BytesIO, RawIOBase
import mmap
import os
import pathlib
from typing import IO, Any, AnyStr, Dict, List, Mapping, Optional, Tuple, Union
from urllib.parse import ( # noqa
urlencode,
urljo... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import json
from typing import Dict, Any, List, Union, Optional, Mapping
from azure.functions import _eventhub
from . import meta
class EventHubConverter(meta.InConverter, meta.OutConverter,
bindin... |
###############################################################################
# taskwarrior - a command line task list manager.
#
# Copyright 2006 - 2017, <NAME>, <NAME>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Softwa... |
# These module alos are used by protection code, so that protection
# code needn't import anything
import os
import platform
import struct
import sys
# Because ctypes is new from Python 2.5, so pytransform doesn't work
# before Python 2.5
#
from ctypes import cdll, c_char, c_char_p, c_int, c_void_p, \
pythonapi, py... |
############################################
## <NAME>
## <EMAIL>
## Intro to Python, Section 4
## Version 0.3
## 4/31/2021
## section4-week31-Christof-Mortensen-Coding-Project-Turtle-Creative-Mode.py
#
#
#############################################
#| version History: |
#|________... |
"""Normalize device configs, this module also maintains global normalized config state"""
import logging
import yaml
from .cmdproxies import (AirCoreProxy, I2CASCIIProxy, JBOLLedProxy,
PCA9535PinProxy, PinProxy, PWMProxy, ServoProxy)
LOGGER = logging.getLogger(__name__)
SECTION_CMDPROXY_MAP ... |
import bz2
import hashlib
import os
import re
import stat
import subprocess as subp
import sys
import tarfile
import time
import zipfile
from glob import glob
import urllib.request
def remove_prefix(text):
return re.sub(r'^[a-z]__', '', text)
def read_and_split(ofn):
return (l.decode('utf-8').strip().spli... |
# Copyright 2017 <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
#
# Unless required by applicable law or agree... |
import numpy as np
from scipy.special import gamma
import matplotlib.pyplot as plt
# Define patient arrival rate function
def arr_int(time, num_pats, peak_time):
# num_pats determines the magnitude of the event (i.e. the number of patients)
# peak_time controls when the peak arrival time will be
t = time... |
# -*- encoding: utf-8 -*-
# test_mst.py - unit tests for minimum spanning tree functions
#
# Copyright 2016 NetworkX developers.
#
# This file is part of NetworkX.
#
# NetworkX is distributed under a BSD license; see LICENSE.txt for more
# information.
"""Unit tests for the :mod:`networkx.algorithms.tree.mst` module.""... |
import os
import PySimpleGUI as sg
from audiofile import AudioFile
from toolbox import FileOps
from pfxbrick import *
from pfxbrick.pfxfiles import fs_error_check
class AudioFileGui:
def __init__(self, **kwargs):
self.size = (125, 20)
self.graph_el = None
self.parent = None
self.... |
#!/usr/bin/python3
from http.server import HTTPServer, BaseHTTPRequestHandler
from socketserver import ThreadingMixIn
import argparse
import ctypes
import functools
import sys
import threading
import traceback
import os.path
class BuildHTTPServer(ThreadingMixIn, HTTPServer):
allow_reuse_address = True
advapi32... |
#!/usr/bin/env python
#
# Copyright (c) 2018 10X Genomics, Inc. All rights reserved.
#
"""
Simple Good-Turing estimator.
Based on S implementation in
<NAME> & <NAME> (1995) Good-turing frequency estimation without tears,
Journal of Quantitative Linguistics, 2:3, 217-237, DOI: 10.1080/09296179508590051
"""
import ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.