text stringlengths 3.07k 12.6k |
|---|
import requests
import random
from datetime import datetime, timedelta
import time
from getters import get_room_dict, get_user
from setters import add_new_room, closed_exits
storage = "https://wegunnagetit.herokuapp.com/rooms/"
room_db = "https://lambda-treasure-hunt.herokuapp.com/api/adv/"
# "Token <PASSWORD>",
# "T... |
__all__ = (
"Challenge",
"load_challenges",
"get_challenge",
)
import sys
from importlib import import_module
from io import TextIOWrapper, BytesIO
from itertools import count
from pathlib import Path
from types import TracebackType
from typing import (
Callable,
Iterator,
Literal,
Optiona... |
# Python implemented of Fast Data Compression library (quicklz)
# Currently implemented decompression with compression level 3
# (default value for resource packer/unpacker).
__all__ = (
'qlz_decompress',
'qlz_stream_decompress',
)
import io
from typing import BinaryIO
from . import b2i, io2int
QLZ_STREAMI... |
#!/usr/bin/env python3
"""
MiSTer SNES Controller display based on retrospy
(c) 2021 <NAME>
License: MIT
To be honest, this script is really shitty and I just did it quick and
dirty on a free afternoon to simply show inputs on my SNES compatible
controller from my MiSTer FPGA. The client viewer from the
suggested ap... |
from datetime import timedelta
import json
from ocean_spark.extra_links import OceanSparkApplicationOverviewLink
import time
from typing import TYPE_CHECKING, Any, Callable, Dict, Optional, Union
from airflow.exceptions import AirflowException
from airflow.models import BaseOperator
from airflow.utils.decorators impo... |
import fcntl
import sys
import time
import numpy as np
import pandas as pd
from keras.layers import Dense, BatchNormalization, Dropout
from keras.models import Sequential
from keras.optimizers import SGD
from keras.wrappers.scikit_learn import KerasClassifier
from sklearn.model_selection import GridSearchCV
from sklea... |
# coding: utf-8
# Copyright (c) <NAME>. MIT license.
import os
import sys
import json
import logging
import tornado
import tornado.web
import tornado.ioloop
import tornado.options
import tornado.httpserver
from tornado.options import define, options
from centrifuge.log import logger
from centrifuge.utils import named... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import configparser
import ctypes
import inspect
import json
import logging
import logging.config
import os
import re
import threading
import time
import gevent
from gevent import monkey, pool
monkey.patch_all()
import pymysql
import requests
import yaml
from sele import se... |
import TrainingModel, Utils
import tensorflow as tf
import transformers
import numpy as np
import tqdm
import pickle
import time
home_path='../../'
data_path=home_path+'/data/'
ckpt_path=home_path+'weights/cp.ckpt'
modelBase = 'distilbert-base-multilingual-cased'
numValidationSamples = 2000
clipEmbeddingSize = 640
l... |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
import os,sys
import h5py, time, itertools, datetime
import numpy as np
import copy
import torch
from torch_connectomics.model.loss import *
from torch_connectomics.utils.net import *
from torch_connectomics.utils.vis import *
def train(args, train_loader, models, device, loss_fns, optimizer, scheduler, logger, wri... |
"""
usage: pascal_voc_to_yolo.py [-h] [-x XML_DIR] [-o OUTPUT_PATH] [--relative_img_path RELATIVE_IMG_PATH] [--train_txt_path TRAIN_TXT_PATH]
[--negative_image_dir NEGATIVE_IMAGE_DIR]
Sample Pascal VOC XML-to-YOLO converter
optional arguments:
-h, --help show this help messag... |
"""
mcpython - a minecraft clone written in python licenced under the MIT-licence
(https://github.com/mcpython4-coding/core)
Contributors: uuk, xkcdjerry (inactive)
Based on the game of fogleman (https://github.com/fogleman/Minecraft), licenced under the MIT-licence
Original game "minecraft" by Mojang Studios (www.m... |
from typing import Optional
from app.models import Chart, ChartTypes, Event, Point, Series, Skew
TOP = "TOP"
BOTTOM = "BOTTOM"
class PrinterMixin:
verbose = True
def _print_progress(self, name: str, idx: int, steps: int):
if self.verbose:
full = 50
step = int(idx / steps * fu... |
import scipy
from keras_contrib.layers.normalization import InstanceNormalization
from keras.layers import Input, Dense, Reshape, Flatten, Dropout, Concatenate
from keras.layers import BatchNormalization, Activation, ZeroPadding2D, Add
from keras.layers.advanced_activations import PReLU, LeakyReLU
from keras.layers.con... |
from flask import Flask, render_template, request, redirect, url_for
from nltk.corpus import stopwords
import nltk
nltk.download('stopwords')
from nltk.tokenize import TreebankWordTokenizer
from nltk.stem.porter import *
import numpy
from math import log,sqrt
import pandas as pd
import timeit
import pickle
f... |
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
# GPU参数配置
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
tr... |
import os
#path = '.' + os.sep + '10fold' + os.sep + 'cnn' + os.sep + 'Output0.txt'
path = '.' + os.sep + 'Output7.txt'
list_pre = []
list_lbl = []
flag = 0
with open(path, 'r', encoding='UTF-8') as f:
for line in f.readlines():
if flag == 0:
flag = 1
continue
line = line.strip()
if len(line) > 0 :
... |
#!/usr/bin/env python
#
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License 2.0;
"""Unit Tests for Google Analytics API query objects.
AnalyticsClientTest: Tests making live requests to Google Analytics API.
"""
# __author__ = '<EMAIL> (<NAME>)'
import unittest
from gdata.analytics import clien... |
import os
import time
import re
import argparse
import pandas as pd
from medpy.metric.binary import dc,jc
import numpy as np
from common.measures import hd,assd
from common.file_io import load_nrrd
HEADER = ["Name", "Dice","JC","HD","ASSD"
]
VOXEL_SPACING = (0.625, 0.625, 0.625)
#
# Utils functions us... |
from discord.ext import commands
import discord
import asyncio
from ultron.utils import make_embed
import youtube_dl
# Suppress noise about console usage from errors
youtube_dl.utils.bug_reports_message = lambda: ''
ytdl_format_options = {
'format': 'bestaudio/best',
'outtmpl': '%(extractor)s-%(id)s-%(title)... |
"""Generate fake property data for the cloud function example"""
import datetime
import random
from dataclasses import dataclass, field
from faker import Faker
from faker.providers import BaseProvider
fake = Faker("en_GB")
@dataclass(init=False)
class Property(BaseProvider):
"""Property details generic to any ... |
import cv2
import torch
import json
import os
from pathlib import Path
from tqdm import tqdm
from ensemble_boxes import weighted_boxes_fusion, nms
import sys
sys.path.insert(0, "model/yolo5/yolov5-master")
from models.experimental import attempt_load
from utils.plots import colors, plot_one_box
from utils.datasets i... |
'''
Messed code that exemplifies
Object-Oriented Programming.
'''
class Employee:
num_of_emps = 0
raise_amount = 1.04
def __init__(self, first, last, pay):
self.first = first.strip().title()
self.last = last.strip().title()
self.pay = float(pay)
Employee.num_of_emps += 1
... |
################################################################################
# Copyright (c) 2020 ContinualAI #
# Copyrights licensed under the MIT License. #
# See the accompanying LICENSE file for terms. ... |
# Copyright 2015-2018 <NAME>
#
# This file is part of Platypus, a Python module for designing and using
# evolutionary algorithms (EAs) and multiobjective evolutionary algorithms
# (MOEAs).
#
# Platypus is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... |
import re, unicodedata
import inflect
import pandas as pd
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from nltk.stem import PorterStemmer, WordNetLemmatizer
from collections import Counter
from sklearn.model_selection import train_test_split
from bs4 import BeautifulSoup
import time
def ... |
# OPERATIONS MODULE - Containing useful operations that the models depend on.
import tensorflow as tf
def batch_norm(x, is_training=True, scope="batch_norm", epsilon=1e-5, decay=0.9):
""" Pefroms batch normalization on the input shape.
Args:
x: Shape to have batch normalization applied to.
... |
import os
import sys # to exit properly
import platform # to check the OS
# import subprocess # to call batch files
import shutil # to clean the destination
from zipfile import ZipFile
from lib import ask # to declutter the code
from lib import copy # to declutter the code
# define error handling
global fuckups
fuckup... |
'''
Copyright 2013 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,... |
"""
此脚本负责 - 定义Replay以及如何训练DQN
"""
import os
import datetime
from collections import namedtuple
import random
import numpy as np
import torch
import torch.nn as nn
from game.tetris import block
from model.cnn_model import DQN
# 俄罗斯方块矩阵的高度和宽度
row_count, col_count = 20, 10
MAX_Batch_Size = 51200
Rep... |
import datetime
from typing import List
import bibtexparser
from bibtexparser.bparser import BibTexParser
import iso639
from .bibliographic_date import BibliographicDate, BibliographicDateType
from .bibliographic_item import BibliographicItem, BibliographicItemType
from .bib_item_locality import BibItemLocality
from ... |
#!/bin/python3
import json
import re
import time
import traceback
import urllib.parse
from pathlib import Path
import difflib
import requests
from flask import Flask, request
from sec_font import secFont2Map, secFontDec, secFontEnc
from xuexiaoyi_pb2 import ReqOfSearch, RespOfSearch
app = Flask(__name__)
API_XUEXI... |
import numpy as np
import pandas as pd
import warnings
from sklearn.preprocessing import LabelEncoder
def find_dtype(arr, len_sample=1000):
"""Find the general dtype of an array.
Three possible dtypes :
- Number
- Datetime
- Object
Parameters
----------
arr: array-like
Array... |
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import json
import os
import subprocess
import sys
from textwrap import dedent
from typing import Text, Tuple
import pytest
from pex.common import safe_open
from pex.testing import ALL_P... |
#!/usr/bin/python3
import sys
import os
from brownie import *
import csv
'''
This script simulates an ITYT protocol instance given (n,k) using Brownie.
Current configuration
n -> [1 to 10]
k -> [2 to n]
Naming Conventions
script -> paper
secret_value -> V economic value assigned to the secret
n ... |
import numpy as np
from numpy import column_stack, dot, eye, row_stack, zeros
from numpy.linalg import solve
from dolo.algos.dtcscc.steady_state import find_deterministic_equilibrium
from dolo.numeric.extern.qz import qzordered
from dolo.numeric.taylor_expansion import TaylorExpansion as CDR
class GeneralizedEigenva... |
from causal_world.intervention_actors.base_actor import \
BaseInterventionActorPolicy
from causal_world.utils.rotation_utils import quaternion_to_euler, \
euler_to_quaternion
import gym
import numpy as np
class ObjectSelectorActorPolicy(BaseInterventionActorPolicy):
def __init__(self):
"""
... |
import inspect
import os
import types
from importlib import import_module
from pkgutil import iter_modules
from os_aio_pod.config import BlankConfig
def pydantic_dict(d, exclude=None):
if isinstance(d, dict):
return d
return dict(pydantic_items(d, exclude))
def pydantic_items(d, exclude=None):
... |
import click
import json
import mimetypes
import logging
import os
import pathlib
import requests
import sys
TEMPLATE_FILENAME = 'template.json'
def walk_files(root_dir):
for root, dirs, files in os.walk(root_dir):
for file in files:
yield root, file, os.path.join(root, file)
def extract_al... |
# pylint: disable=C0301, C0103
# https://www.reddit.com/r/dailyprogrammer/comments/5wnbsi/20170228_challenge_304_easy_little_accountant/
import sys
import datetime
MONTH = {'JAN':1, 'FEB':2, 'MAR':3, 'APR':4, 'MAY':5, 'JUN':6, 'JUL':7, 'AUG':8, 'SEP':9, 'OCT':10, 'NOV':11, 'DEC':12}
def find_accounts(start, end, jou... |
from rest_framework import viewsets
# importing serializers
# from django.contrib.auth import get_user_model
# User = get_user_model()
from rest_framework.decorators import action
from rest_framework.permissions import IsAuthenticated
from django.forms.models import model_to_dict
# importing models
from rest_framewo... |
import pandas as pd
import argparse
from matplotlib_venn import venn3
import matplotlib.pyplot as plt
import math
def get_args():
desc = 'Given sj files, see which splice junctions are shared/unique between datasets'
parser = argparse.ArgumentParser(description=desc)
parser.add_argument('-sj_1', dest='sj_1',
h... |
import pygame, sys, random
def draw_floor():
screen.blit(floor_surface, (floor_x_pos,900))
screen.blit(floor_surface, (floor_x_pos + 576,900))
def create_pipe():
random_pipe_pos = random.randint(350,800)
bottom_pipe = pipe_surface.get_rect(midtop = (700,random_pipe_pos))
top_pipe = pipe_s... |
import base64
import os
import time
from ipaddress import ip_address
import kubernetes
from kubernetes.client.rest import ApiException
import click
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primit... |
from lxml.etree import LIBXML_VERSION
import pytest
from libweasyl.text import markdown, markdown_link
libxml_xfail = pytest.mark.xfail(LIBXML_VERSION < (2, 9), reason='libxml2 too old to preserve whitespace')
user_linking_markdown_tests = [
('<~spam>', '<a href="/~spam">spam</a>'),
('<!spam>', '<a href="/~... |
import xbmc
import xbmcgui
import kodigui
from lib import util
class ActionDialog(kodigui.BaseWindow, util.CronReceiver):
name = 'GUIDE'
xmlFile = 'script-tablo-action.xml'
path = util.ADDON.getAddonInfo('path')
theme = 'Main'
BUTTON1_ID = 400
BUTTON2_ID = 401
def __init__(self, *args, *... |
from pathlib import Path
import xarray
import numpy as np
from datetime import datetime
from matplotlib.pyplot import figure, draw, pause
from matplotlib.colors import LogNorm
def jointazel(cam: xarray.Dataset, ofn: Path = None, ttxt: str = ""):
fg, axs = plotazel(cam, ttxt)
# %% plot line from other camera ... |
"""
Support for X10 modules via Mochad or CM17a FireCracker.
# Tested with Home Assistant 0.114.4
For more information and documentation see
https://github.com/clach04/home-assistant-x10
"""
import logging
import voluptuous as vol
from homeassistant.components.light import (
PLATFORM_SCHEMA,
)
# matbe togle fro... |
from __future__ import print_function, division
from PIL.Image import NONE
import warnings
warnings.filterwarnings("ignore")
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
import numpy as np
import torchvision
from torchvision import datasets, models, transforms
im... |
import ipaddress
import getpass
import json
import logging
import os
import re
import requests
import sys
import time
from urllib.request import urlopen
from urllib.error import HTTPError
from urllib3.exceptions import InsecureRequestWarning
def create_dir(directory):
"""
create directory recursively
... |
from tkinter import Tk, Canvas, Frame, BOTH, ARC, PIESLICE
from math import sin, cos, pi, tan
# color
WARNING = '#ff0'
DANGER = '#f44'
SAFE = '#4f4'
class gfxView():
def __init__(self, tk, model):
tk.title('Lidar. IP: {}. Port: {}'.format(model.ip, model.port))
tk.geometry('800x600+10+10')
... |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
import random
from populus.utils.wait import wait_for_transaction_receipt
from ecdsa import SigningKey, SECP256k1
import sha3
import gevent
from ethereum.utils import encode_hex
from web3.formatters import input_filter_params_formatter, log_array_formatter
from web3.utils.events import get_event_data
from web3.utils.f... |
"""
@author: <NAME>
@since: 26/08/2016
@modified:
Similarity between strings
a subsequence of a string is defined as a sequence of characters of that string that are not necessarily contiguous but
are taken in order.
AGGA is a substring of TAGGCTA
Approach:
1. Naive: enumerate over all subsequences of the stri... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: jiankaiwang
@version: 0.0.1
@date: 2020/03
@desc: An Entry Example of IOU Tracker on MOT Datasets
@note:
Style: pylint_2015
@reference:
Article: http://elvera.nue.tu-berlin.de/files/1517Bochinski2017.pdf
"""
import os
import time
import cv2
import numpy a... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, msgprint, utils
from frappe.utils import flt, cint, getdate, datetime
from datetime import datetime, timedelta
def ... |
#pywhatkit guide thingy
import pywhatkit as kit
from pywhatkit.exceptions import CountryCodeException, InvalidBrowserName
import countrydatabase
# About : PyWhatKit is a Python library with no addition setup. Can do a lot of things other than sending a text
# Can be installed via pip : pip install pywhatkit
# First i... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Developed by <NAME> <<EMAIL>>
'''ref: http://pytorch.org/docs/master/torchvision/transforms.html'''
import cv2
import numpy as np
import torch
import torchvision.transforms.functional as F
from config import cfg
from PIL import Image
import random
import numbers
class Co... |
import re
from models.course import Course
from models.course_detail import CourseDetails
from models.course_header import CourseHeader
from models.course_summary import CourseSummary
from models.pre_reqs import PreRequisites
from models.anti_reqs import AntiRequisites
def generate_course_summary_list(course_headers_... |
# Class adapted from:
# https://github.com/TheMrGhostman/InceptionTime-Pytorch
# and
# https://github.com/okrasolar/pytorch-timeseries
import numpy as np
from typing import cast, Union, List
import torch
from torch import nn
from DeepLearning.deep_learning_utils import Conv1dSamePadding
class ShortNetwork(nn.Module... |
#!/usr/bin/python3
import sys
sys.path.append("icon/")
import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from PyQt5.QtWidgets import (QApplication, QAction, QWidget, QSizePolicy,
qApp, QDesktopWidget, QMainWindow, QMessageBox, ... |
# Copyright 2015: Mirantis 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 ap... |
#!/usr/bin/env python
"""
Catalog the note src dir tree to create index.html.
Along the way, convert input files to output files.
"""
import os
import shlex
import shutil
import subprocess
import sys
import time
from note_src import file
class Config():
pass
class Dir():
def __init__(self, parentdirs=[], ... |
import math
import cv2
import numpy as np
from PyQt5.QtCore import QRect, QPoint
from PyQt5.QtGui import QPainter, QPen, QColor, QBrush
from stytra.utilities import HasPyQtGraphParams
class CalibrationException(Exception):
""" """
pass
class Calibrator(HasPyQtGraphParams):
""" """
def __init__(se... |
# Processing to retrieve counts of the characteristics of the narrators or their stories,
# or related to nouns/verbs which are not 'known'/understood by the ontology
# Called by details_summary.py
import csv
import logging
import PySimpleGUI as sg
from database import query_database
from nlp import get_nouns_verbs
f... |
from datetime import datetime, timedelta
import calendar
from backtester.instrumentUpdates import *
from backtester.constants import *
from backtester.dataSource.data_source import DataSource
import os.path
from backtester.dataSource.data_source_utils import groupAndSortByTimeUpdates
TYPE_LINE_UNDEFINED = 0
TYPE_LINE_... |
from dictdiffer import diff, dot_lookup
from collections import deque
from classes import classes
def getClass(opname, default):
return classes.get(opname, default)
state = {}
diffs = []
def apply(newState):
global state
# Step 1: create new nodes
prevState = state
state = newState
ddiff = diff(prevSta... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
# -*- coding:utf8 -*-
# encoding = utf-8
import sys
import urllib2
sys.path.append("..")
from hackathon.functions import get_remote, get_config, convert
from hackathon.log import log
from . import user_manager
import json
from hackathon.constants import OAUTH_PROVIDER
class LoginProviderBase():
def login(self, a... |
# -*- coding: utf-8 -*-
# Copyright 2015 <NAME>
# <<EMAIL>>
#
# Apache License, Version 2.0
# <http://www.apache.org/licenses/LICENSE-2.0>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License a... |
import copy
import dsl
class ProgramNode(object):
def __init__(self, program, score, parent, depth, cost, order):
self.score = score
self.program = program
self.children = []
self.parent = parent
self.depth = depth
self.cost = cost
self.order = order
clas... |
import warnings
import numpy as np
from .. import Variable
from ..conventions import pop_to, cf_encoder
from ..core import indexing
from ..core.utils import FrozenOrderedDict, NDArrayMixin
from ..core.pycompat import iteritems, basestring, OrderedDict
from .common import AbstractWritableDataStore
from .netcdf3 impor... |
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack Foundation
#
# 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... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 5 15:33:05 2019
@author: scott
"""
import re
import numpy as np
from matplotlib import pyplot as plt
unit_to_ppb = {
"ppt": 1e-3,
"ng/l": 1e-3,
"ppb": 1,
"ug/l": 1,
"ppm": 1000,
"mg/l": 1000,
}
float_match = "[-]?\d+[\.]?\... |
import os
import pickle
import argparse
import numpy as np
import torch
from BloomCDM import BloomCDM
from sklearn.metrics import roc_auc_score
from sklearn.metrics import mean_squared_error, mean_absolute_error
def load_model(model, filename):
f = open(filename, 'rb')
model.load_state_dict(torch.load(f, map_l... |
from random import randint
import numpy as np
from pandas import read_excel
from dssg_challenge.ga.problem.problem_template import ProblemTemplate
from dssg_challenge.ga.problem.objective import ProblemObjective
from dssg_challenge.ga.problem.solution import PIP_Solution
pip_encoding_rule = {
"Size": -1, # It mu... |
from __future__ import absolute_import
import logging
import smtplib
import socket
from datetime import datetime, date
from dateutil.relativedelta import relativedelta
from django.core.mail import EmailMultiAlternatives
from django.core.mail import get_connection
from django.conf import settings
from django.utils imp... |
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# Copyright 2009 <NAME>. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Implements ThreadPoolExecutor."""
__author__ = '<NAME> (<EMAIL>)'
import atexit
from concurrent.futures import _base
import itertools
import queue
import threading
import weakref
import os
# Workers are created as daem... |
import numpy as np
from autoarray.structures import grids
from autogalaxy.profiles import geometry_profiles
from autogalaxy.profiles import mass_profiles as mp
from autogalaxy import convert
import typing
from scipy.interpolate import griddata
from autogalaxy import exc
class MassSheet(geometry_profiles.S... |
#!/usr/bin/env python
"""
Upload random values to non-repeating forms in order to force Redcap autocalc.
DO NOT USE THIS ON REPEATING FORMS.
"""
import argparse
import pdb
import sibispy
from sibispy import sibislogger as slog
from sibispy import bulk_operations as bulk
import random
import redcap as rc
from typing im... |
#!/usr/bin/env python3
#
# Copyright (c) 2014-2018 Cesanta Software 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/LICE... |
import copy, itertools, json, os, re
from pprint import pprint
from PIL import Image, ImageOps
from django import forms
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ImproperlyConfigure... |
import io
import pstats
import cProfile
import pdb
import uuid
import importlib
import pkgutil
import logging
import types
import base64
import json
import functools
import traceback
from time import time
from datetime import datetime
from pprint import pformat
# Get an instance of a logger
def connect_logger_handler... |
# This file is part of Hypothesis, which may be found at
# https://github.com/HypothesisWorks/hypothesis/
#
# Most of this work is copyright (C) 2013-2021 <NAME>
# (<EMAIL>), but it contains contributions by others. See
# CONTRIBUTING.rst for a full list of people who may hold copyright, and
# consult the git log if yo... |
#!/usr/bin/env python3
#
# This file is part of the MicroPython project, http://micropython.org/
#
# The MIT License (MIT)
#
# Copyright (c) 2020 <NAME>
# Copyright (c) 2020 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the... |
"""Test great circle module."""
from numpy.testing import assert_array_almost_equal as assert_array
from pyvims.misc.greatcircle import (great_circle, great_circle_arc, great_circle_lat,
great_circle_patch, great_circle_path,
great_circle_pole,... |
from __future__ import absolute_import
'''Copyright 2015 LinkedIn Corp. 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 ... |
#!/usr/bin/env python
# coding: utf-8
# @Author: dehong
# @Date: 2020-06-09
# @Time: 18:24
# @Name: model_tools
from sklearn import ensemble, gaussian_process, linear_model, naive_bayes, neighbors, svm, tree, discriminant_analysis
from sklearn import model_selection, feature_selection
from xgboost import XGBClassifie... |
from youtubesearchpython import VideosSearch
import os
from os import path
import random
import asyncio
import shutil
from time import time
import yt_dlp
from .. import converter
from pyrogram import Client
from pyrogram.types import Message
from pyrogram.types import Voice
from Yukki import (app, BOT_USERNAME, BOT_ID)... |
#!/usr/bin/python
import os
import sys
import imp
import subprocess
from os.path import basename, dirname, join, realpath, split
conf_path = "/etc/opt/microsoft/omsagent/conf/omsadmin.conf"
metamof_path = "/etc/opt/omi/conf/omsconfig/generated_meta_config.mof"
agentid_path = "/etc/opt/omi/conf/omsconfig/agentid"
omshe... |
# Author: <NAME>
# Date: Dec.8.2020
# Title: Helper functions for processing data or output of model
# Affiliation: JLK Genome Research Centre
from rdkit import Chem
from rdkit.Chem import rdmolfiles, rdmolops, AllChem
from rdkit.Chem.EnumerateStereoisomers import EnumerateStereoisomers
from rdkit.Chem import ... |
"""
High-level operations for numpy structured arrays.
Some code and inspiration taken from numpy.lib.recfunctions.join_by().
Redistribution license restrictions apply.
"""
from itertools import chain
import collections
from collections import OrderedDict, Counter
from collections.abc import Sequence
import numpy as... |
""" fontTools.misc.classifyTools.py -- tools for classifying things.
"""
from __future__ import print_function, absolute_import
from fontTools.misc.py23 import *
class Classifier(object):
"""
Main Classifier object, used to classify things into similar sets.
"""
def __init__(self, sort=True):
self._things = ... |
import numpy as np
from numpy.random import multivariate_normal as multi_norm
from scipy.spatial import cKDTree as ckdt
from collections import defaultdict
from scipy.stats import norm
import warnings
class GMM: # gaussian mixture model
def __init__(self, pis, params):
self.params = params # [[mu1, sig1... |
"""
"""
import numpy as np
from astropy.tests.helper import pytest
from astropy.utils.misc import NumpyRNGContext
from ..model_helpers import custom_spline, create_composite_dtype
from ..model_helpers import bounds_enforcing_decorator_factory, enforce_periodicity_of_box
from ..model_helpers import call_func_table, bin... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Appier Framework
# Copyright (c) 2008-2016 Hive Solutions Lda.
#
# This file is part of Hive Appier Framework.
#
# Hive Appier Framework is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apach... |
"""Simple command line utilties for interacting with Onshape API.
A sketch is considered a feature of an Onshape PartStudio. This script enables adding a sketch to a part (add_feature), retrieving all features from a part including sketches (get_features), and retrieving the possibly updated state of each sketch's ent... |
# BioPandas
# Author: <NAME> <<EMAIL>>
# License: BSD 3 clause
# Project Website: http://rasbt.github.io/biopandas/
# Code Repository: https://github.com/rasbt/biopandas
from biopandas.pdb import PandasPdb
import os
import numpy as np
import pandas as pd
from nose.tools import raises
try:
from urllib.request impo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.