text stringlengths 3.07k 22.1k |
|---|
import asyncio
import datetime
import uuid
import cv2
import numpy as np
import os
import urllib
import requests
import time
import csv
from bs4 import BeautifulSoup
import logging
from pymongo import MongoClient
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
reqbsWelcome = r... |
#!/router/bin/python
import zmq
import json
import re
from collections import namedtuple
import zlib
import struct
from .trex_stl_types import *
from .utils.common import random_id_gen
from .utils.zipmsg import ZippedMsg
from threading import Lock
class bcolors:
BLUE = '\033[94m'
GREEN = '\033[32m'
YELLO... |
import numpy as np
import h5py
from tqdm import tqdm, tqdm_notebook
import torch
import faiss
def save_submission(
embed_qry_d,
embed_ref_d,
save_path='./submission.h5',
):
with h5py.File(save_path, "w") as f:
f.create_dataset("query", data=embed_qry_d['embedding'])
f.create_dataset("r... |
import argparse, logging
import re
import shutil
import os
from pathlib import Path
from typing import Union
"""This is the order in which functions are called:
main(): Receives parsed inputs and copies renamed files to new dir
map_pattern_grps_to_regex(): Get group names from pattern. Rewrite in regex.
convert_to_re... |
__author__ = '<NAME> <<EMAIL>>'
__date__ = 'Aug 21, 2013'
__copyright__ = 'Copyright (c) 2013 <NAME>'
import weakref
from functools import partial
from Queue import Queue
from threading import Lock
from collections import defaultdict
import wpf
from System import TimeSpan
from System.Windows.Input import ICo... |
# Copyright 2016 Red Hat, 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... |
import os
from contextlib import contextmanager
block_to_format = {
"ROCKS": {
1: "5s,5d,10.4e,10.4e,10.4e,10.4e,10.4e,10.4e,10.4e",
2: "10.4e,10.4e,10.4e,10.3e,10.4e,10.4e,10.4e,10.4e,10.4e", # Tortuosity can be <0 in TOUGHREACT
# TOUGHREACT
3: "5d,5s,10.3e,10.3e,10.3e",
4... |
#!/usr/bin/env python3
#
# Copyright 2016-2017 Games Creators Club
#
# MIT License
#
import paho.mqtt.client as mqtt
import time
import traceback
import smbus
DELAY = 0.15
current_speed = 100
STRAIGHT = 1
SLANT = 2
SIDEWAYS = 3
wheelPosition = STRAIGHT
client = mqtt.Client("DriveAgent")
gyroCentre = 0
gyroMin =... |
from typing import List, Any, Dict
from base_automation import BaseAutomation
from lib.actions import TurnOnAction, get_action, TurnOffAction
from lib.actions import figure_light_settings
from lib.constraints import get_constraint, Constraint
from lib.core.monitored_callback import monitored_callback
from lib.triggers... |
import os
import shutil
import tempfile
import numpy as np
import h5py
from scipy.interpolate import interp1d
from typing import List, Set, Tuple, Callable
def get_paths(group: h5py.Group, path: str) -> Set[str]:
"""Recursively find all the paths of Datasets which are children of this group"""
"""The first ca... |
"""
Declares and exports the domain objects that describe each entities existing in the BiblioAlly Catalog.
The domain classes declared in this module carry annotations specific to be worked by SQL Alchemy, the
ORM engine used to persist and retrieve the objects during a session of BiblioAlly.
"""
import datetime
fro... |
from itertools import product
import numpy as np
import matplotlib.pyplot as plt
import networkx as nx
from garageofcode.mip.maxflow import get_flows
from garageofcode.chem.equilibrium import get_concentrations
def get_political_matching():
"""
A graph that models political tolerance
as far as dating is... |
import os
import re
import stat
import uuid
from pathlib import Path
import click
import texttable as tt
from modelcatalog import ApiException, SampleResource
from dame._utils import log
from dame.executor import prepare_execution, get_engine, DOCKER_ENGINE, \
run_docker, get_docker_cmd, check_if_cwl_compatible
f... |
## Copyright (c) 2022, <NAME>
## SPDX-License-Identifier: BSD-3-Clause
import csv
import json
import lz4.frame
from enum import IntEnum
class SymbolType(IntEnum):
UNKNOWN = 0
FUNCTION = 1
THUNK_FUNCTION = 2
EXT_FUNCTION = 3
LABEL = 4
DATA_LABEL = 5
INSN_LABEL = 6
@staticmethod
de... |
#!/usr/bin/env python3
# restic wrapper and status checker
# Written by <NAME> <<EMAIL>>, 2021
# Released under MIT license
# v0.1 - 04/02/21 - Initial release
# v0.2 - In progress - Minor fixes, restic auto-update
# ---- imports ----------------------------------------------------------------
import sys
import sub... |
# -*- coding: utf-8 -*-
'''
@Time : 2020/05/06 21:09
@Author : Tianxiaomo
@File : dataset.py
@Noice :
@Modificattion :
@Author :
@Time :
@Detail :
'''
from functools import partial
import os
import random
import sys
from copy import deepcopy
import albumentation... |
##########################################################################
#
# Copyright (c) 2008-2012, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... |
"""
outpu by npy
"""
import xml.etree.ElementTree as ET
import cv2
import numpy as np
from pathlib import Path
import matplotlib.pyplot as plt
import matplotlib
# return number of vectors
def compute_vector(
black, pre, nxt, result, result_l, result_y, result_x, result_z, ks, zv, sgm
):
img_l = black.copy... |
#!/usr/bin/env python
from __future__ import print_function
import roslib
roslib.load_manifest('object_detection_tensorflow')
import sys
import rospy
import cv2
import time
from std_msgs.msg import String
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
from sensor_msgs.msg import Compres... |
from omniidl import idlast, idltype
import string
DIRECTION_IN=0
DIRECTION_INOUT=1
DIRECTION_OUT=2
DIRECTION_RET=3
# Table from omniORB...
# CORBA2.3 P1-21 1.9 Mapping for Structured Types
typeIsVariableLength = {
idltype.tk_null: 0,
idltype.tk_void: 0,
idltype.tk_short: ... |
import os
from gittip import NotSane
from aspen.utils import typecheck
from psycopg2 import IntegrityError
# Exceptions
# ==========
class UnknownPlatform(Exception): pass
class NeedConfirmation(Exception):
"""Represent the case where we need user confirmation during a merge.
This is used in the workflow ... |
#!/usr/bin/python
# review office 365 audit csv
# requires ipaddress module installed https://docs.python.org/3/library/ipaddress.html
# requires https://ipstack.com API key
# tested on python v2.7.x, not tested on python v3.x
import os
import csv
import json
import urllib
import urllib2
import datetime
import ipaddres... |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015-2017 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
... |
"""arbiting.py arbiter deed module
"""
#print("module {0}".format(__name__))
import time
import struct
from collections import deque
import inspect
from ..aid.sixing import *
from ..aid.odicting import odict
from . import doing
from ..aid.consoling import getConsole
console = getConsole()
#Arbiter Class
class Ar... |
"""
A collection of utility functions used either by other provided functions
or directly in the primary figure-generating code.
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
from .differentiation import smooth_data
def normalize_columns(X):
"""Normalize columns of a ... |
# -*- encoding: utf-8 -*-
import warnings
import numpy as np
import pandas as pd
import geopandas as gpd
from copy import deepcopy
from tqdm import tqdm as TQ
from shapely.geometry import Point
from ..libs import *
from ..config import UNITS, CRS, METRICS
from ..commons.DistanceFunctions import HaversineDistance
fro... |
#!/usr/bin/env python3
# by dongchao <<EMAIL>>
from flask import make_response, render_template, jsonify, request, session
from werkzeug.security import generate_password_hash
from . import article
from app import db
from app.models import Article, Category, Pwdmap
from flask import current_app as app
import datetime... |
import argparse
import attr
import cv2
import math
import numpy
import os
import pytesseract
import sys
import uuid
from io import BytesIO
from multiprocessing import cpu_count, Pool
from typing import Iterator, List, Tuple
from PIL import Image
from PyPDF2 import PdfFileReader
from PyPDF2.generic import DictionaryO... |
#!/bin/env python
#
# Script name: IDP_html_gen.py
#
# Description: Script to generate IDP page of QC html report.
#
## Author: <NAME>
import pandas as pd
import numpy as np
import sys
import os
from ast import literal_eval
def formatter(x):
try:
return "{:e}".format(float(x))
except:
retur... |
"""
Fichero con funciones implementadas en python, por ejemplo la función necesaria para cargar las imagenes.
<NAME>.
"""
import cv2 as cv
import numpy as np
import os
from sklearn.model_selection import train_test_split
import pandas as pd
PATH_POSITIVE_TRAIN = "ECI.Practica/data/train/pedestrians/"
PATH_NEGATIVE_T... |
#!/usr/bin/env python
'''
Shows an IP or IPs, optionally masked, in various formats.
Example:
$ incidr 1.2.3.4/24
1.2.3.4/24 :
==========
1. 2. 3. 4 <=> 00000001 00000010 00000011 00000100 <=> 01020304 <=> 0016909060
& 255.255.255. 0 <=> 11111111 11111111 11111111 00000000 <=> ffffff00 <=> 429... |
from flask import Flask, render_template, request, redirect, url_for, flash, make_response, session
from models.invoice import Invoice, InvoiceDAO
from models.profile import Profile, ProfileDAO
from days.days import nb_day_between_date
from settings.tools import get_profile_from_session, CACHE_INVOICE
from urls.urls_in... |
# --------------
import pandas as pd
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
import sklearn_crfsuite
from sklearn_crfsuite import metrics
import eli5
# Start of code
# Read the file with the given encoding and do not throw any error, ignore it.
df = pd.read_csv(p... |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Scans the Chromium source for histograms that are absent from histograms.xml.
This is a heuristic scan, so a clean run of this script does not guarantee ... |
# modified from script by <NAME> in 2015 summer
import requests
import json
import sys
from operator import and_
from functools import reduce
# use your CATMAID fafb Token
# %run /Users/zhengz11/myscripts/mushroom_v9/credential/fafb_tokens.py
fafbServer = (1, 'https://neuropil.janelia.org/tracing/fafb/v14')
class ... |
import os
import ray
from json import load, dump
from os.path import dirname
import argparse
import numpy as np
from environment import (
BaseEnv,
BenchmarkEnv,
RRTWrapper,
RRTSupervisionEnv,
TaskLoader
)
from environment.utils import get_observation_dimensions
import torch
from tensorboardX import ... |
import wx
from wx import WHITE, HORIZONTAL, VERTICAL, ALIGN_RIGHT, ALIGN_CENTER_VERTICAL, EXPAND, ALIGN_LEFT, ALL
from cgui import SimplePanel
from gui.uberwidgets.PrefPanel import PrefPanel
from gui.validators import NumericLimit
import util.proxy_settings
ID_NONPROX = wx.NewId()
ID_SYSPROX = wx.NewId()
... |
import re
import time
import datetime
import ipaddress
from dateutil.relativedelta import relativedelta
from . import botsite
from .core import check, log, EditQueue
from .botsite import cur_timestamp, get_summary
DEBUG = False
DELAY = 180
LONG_SLEEP = 120
SHORT_SLEEP = 30
VIP = 'Wikipedia:当前的破坏'
RFP = 'Wikipedia:请求... |
""" This module provides unit test coverage for
the PasswordService project.
"""
import logging
import os
import os.path
import time
from django.test import TestCase
from django.conf import settings
# Test Views
from django.urls import reverse
from pwdsvc.data import PWD_TYPENAME, GRP_TYPENAME, DataManager
logge... |
import collections
from copy import deepcopy
import logging
import warnings
from typing import Any, Dict, Sequence, Union
import numpy as np
from sacred import Experiment
import torch
from experiments.common import get_local_attack_nodes, prepare_attack_experiment
from rgnn_at_scale.attacks import create_attack
from ... |
import gzip
import hashlib
import json
import logging
import random
from abc import ABC, abstractmethod
from typing import Any, Callable, Dict, Generator, List, Set, Tuple, ValuesView
import numpy as np
import tensorflow as tf
from loganary.ranking.common import deep_get
from loganary.ranking.data import (
TfRecor... |
from random import random
import os
# DEFAULT LIST OF PLAYERS AND INFORMATIONS FOR THE GAME
players = [
{ "id": 0, "name": "Player1", "score": 0, "exit": False },
{ "id": 1, "name": "Player2", "score": 0, "exit": False }
]
# DEFAULT LIST OF COUNTS AND INFORMATIONS FOR EACH ROUND
counts = [
{... |
from __future__ import print_function
import sys
import numpy as np
import os
import fitsio
import matplotlib
matplotlib.use('Agg')
import astropy.io.fits
from astrometry.util.fits import fits_table, merge_tables
from astrometry.util.file import trymakedirs
from legacypipe.survey import LegacySurveyData
'''
This sc... |
import numpy as np
from probgf.discretization import Discretization
from probgf.validation import HIDE_VAL
class SpatioTemporalBase:
@classmethod
def method_id(cls):
if 'Base' in cls.__name__: # only base class that should not be used
return ''
return cls.__name__
def ... |
"""Medium.py
Algorithms for media; see e.g. my paper arxiv:cs.DS/0206033.
As a very brief introduction to media theory:
- A medium consists of a set of states, a set of tokens,
and an "action" that produces a new state St from a state S and a token t.
An action is "effective" if St != S.
- Each token t has a "rev... |
#
# This is an extension to the Nautilus file manager to allow better
# integration with the Subversion source control system.
#
# Copyright (C) 2006-2008 by <NAME> <<EMAIL>>
# Copyright (C) 2007-2008 by <NAME> <<EMAIL>>
# Copyright (C) 2008-2010 by <NAME> <<EMAIL>>
#
# RabbitVCS is free software; you can redistribu... |
import traceback
import os
import json
from functools import reduce
from collections import Counter
import warnings
import qualipy
from qualipy.util import set_value_type
from qualipy.util import set_title_name
import pandas as pd
import numpy as np
import altair as alt
import banpei
def trend_line_altair(
tren... |
"""Bridge based network management service.
"""
import errno
import logging
import os
import subprocess
import netifaces
from .. import logcontext as lc
from .. import netdev
from .. import vipfile
from .. import iptables
from ._base_service import BaseResourceServiceImpl
_LOGGER = lc.ContainerAdapter(logging.getL... |
from itertools import repeat
import StringIO as StringIO
import cPickle as cPickle
import cStringIO as cStringIO
import struct
import zlib
from array import array
from itertools import imap
from itertools import repeat
BLOCK_SIZE = 65536000
registered = True
class Decompression:
def __init__(self):
sel... |
import json
import math
import random
import torch
import subprocess as sp
from torch.utils.data import DataLoader, Sampler, Dataset
from torch.nn.utils.rnn import pad_sequence
from gpt2_training.train_utils import (InputFeatures, InputFeatures_train,RedditExample)
END_OF_TEXT_TOKEN = '<|endoftext|>'
class BucketSamp... |
import ctypes
from timsconvert.constants import *
def init_baf2sql_dll(baf2sql_file_name: str=BAF2SQL_DLL_FILE_NAME):
baf2sql_dll = ctypes.cdll.LoadLibrary(baf2sql_file_name)
# Functions for .baf files
# .baf open
baf2sql_dll.baf2sql_array_open_storage.argtypes = [ctypes.c_int, ctypes.c_char_p]
b... |
import sys, math
import subprocess
from os import listdir
from os.path import isfile, join, abspath
import xml.dom.minidom
from ontology import *
import tweepy
from tweepy import OAuthHandler
import numpy as np
from tweepy import API
from tweepy import Cursor
from datetime import datetime, date, time, timedelta
from co... |
"""App management utilities"""
import os
import platform
import subprocess
from datetime import datetime
from typing import List, Dict, Union
from uuid import uuid4 as random_uuid
from flask_sqlalchemy import DefaultMeta
# noinspection PyProtectedMember
from sqlalchemy.ext.declarative.clsregistry import _ModuleMarker
... |
# main program for the project
# Author: <NAME> (<EMAIL>) and <NAME> (<EMAIL>)
# Date: 2021.12.8
import threading
import RPi.GPIO as GPIO
import cv2
import numpy as np
# from GoBang.GUI import GoBang_GUI # display should be written in another file
from HardDriver.motor import Motor
from HardDriver.pi_camera import Ca... |
# Simulation data loader
import os
import cv2
import pdb
import h5py
import platform
import matplotlib
import numpy as np
from pathlib import Path
from functools import partial
# from scipy.ndimage import geometric_transform, map_coordinatesl
from util.transform import LogPolartoPolar, Resize
# Change... |
import pickle
import os
import json
from tqdm import tqdm
import pandas as pd
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from transformers import LxmertForQuestionAnswering, LxmertTokenizer
from transformers import AdamW # is this needed for training?
from config.util import get_co... |
import math
# https://fr.wikipedia.org/wiki/Congruence_lin%C3%A9aire
# https://stackoverflow.com/questions/4798654/modular-multiplicative-inverse-function-in-python
REV, CUT, INC = 0, 1, 2
def get_data(n):
if n == 0:
with open('22.txt') as f:
shuffle = f.read()
length... |
import os
from typing import Optional
from . import xdr as stellar_xdr
from .exceptions import FeatureNotEnabledError, ValueError
from .keypair import Keypair
from .strkey import StrKey
from .type_checked import type_checked
__all__ = ["MuxedAccount"]
_SEP_0023_ENABLE_FLAG: str = "ENABLE_SEP_0023"
def _sep_0023_en... |
# Copyright (c) 2014 King's College London
# Created by the Software Development Team <http://soft-dev.org/>
#
# 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 w... |
import copy
from collections.abc import Iterable
from functools import reduce
from itertools import accumulate
from typing import List, Mapping, NamedTuple, Optional, Sequence, Tuple, Union
import h5py
import numpy as np
import torch
from torch.utils.data import Dataset
from pearl.common import NodeValueType, same_de... |
# -*- coding: utf-8 -*-
"""
Created on Sat Dec 31 13:22:36 2016
@author: <NAME>
Just a CNN
"""
import sys
sys.path.append('../')
from Lib.TensorBase.tensorbase.base import Model, Data, Layers
from Lib.test_aux import test_net, vis_detections
from Networks.convnet import convnet
from Networks.faster_rcnn_networks_... |
"""Test causal graph building functionality."""
import copy
import dataclasses
import itertools
import math
import numpy as np
import pytest
import whynot as wn
from whynot.dynamics import BaseConfig, BaseIntervention, BaseState
#################################
# Basic dependency tracing tests.
####################... |
"""
Speech recognition and synthesis library for Windows - Python 2 and 3.
Based on the abandoned Python 2 library https://github.com/michaelgundlach/pyspeech.
This module adds contains a few more features, the important one being the ability to create
in-process speech recognizers.
Author: <NAME> <<EMAIL>>
GitHub: h... |
# piexif is faster than Hachoir, and so has prececence
# Even if it cannot treat as many files, the speed gain is worthy
#
import piexif
import os
import sys
import hashlib
from tqdm import tqdm
import magic
import re
from hachoir.metadata import extractMetadata
from hachoir.parser import createParser
from hachoir.c... |
# Inspired by https://deap.readthedocs.io/en/master/examples/gp_symbreg.html
# it is used by search.py
import os
import random
import copy
import math
import time
import json
import cProfile
import pstats
import sys
from deap import gp # gp.PrimitiveSet, gp.genHalfAndHalf, gp.PrimitiveTree, gp.genFull, gp.from_string... |
import brainscore
from brainscore.benchmarks._neural_common import NeuralBenchmark, average_repetition, apply_keep_attrs
from brainscore.metrics.ceiling import InternalConsistency, RDMConsistency
from brainscore.metrics.rdm import RDMCrossValidated
from brainscore.metrics.regression import CrossRegressedCorrelation, ma... |
# 22 minutes on dev.wormbase for 646727 documents from filesystem. 12G of xml to 6.0G of jso1
# import json
import urllib
# import xmltodict
# python3 split_xml.py -f /home/azurebrd/git/agr_literature_service_demo/src/xml_processing/inputs/alliance_pmids -x
# python3 split_xml.py -f /home/azurebrd/git/agr_literature_... |
from collections import namedtuple
from abc import ABC, abstractmethod
import numpy as np
from scipy.signal import find_peaks
from scipy.ndimage import maximum_filter
# Helper functions for validating inputs.
def ensure_covariance_size(R, array):
"""Ensures the size of R matches the given array design."""
m = ... |
import collections
import tensorflow as tf
from modeler.tfmodel import TFModel
class Block(collections.namedtuple('Block', ['scope', 'unit_fn', 'args'])):
"""A named tuple describing a ResNet block.
Its parts are:
scope: The scope of the `Block`.
unit_fn: The ResNet unit function which takes as... |
from gensim.models import Word2Vec
from gensim.corpora import Dictionary
from preprocessing.data import get_data, Word2VecVectorizer, TrainableVectorizer
from preprocessing.word_models import train_word2vec_model, save_dictionary
import os
from models.aspect_specific_model import AspectSummarizer
from models.model_help... |
import numpy as np
import torch, math
import torch.nn as nn
from onmt.modules.Transformer.Layers import PositionalEncoding
from onmt.modules.Transformer.Layers import EncoderLayer, DecoderLayer
from onmt.modules.StochasticTransformer.Layers import StochasticEncoderLayer, StochasticDecoderLayer
from onmt.modules.Transfo... |
# -*- coding: utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the... |
import numpy as np
from vivarium.core.process import Process
from vivarium.core.engine import Engine, pf
from tqdm import tqdm
import readdy
NAME = "READDY"
class ReaddyProcess(Process):
"""
This process uses ReaDDy to model arbitrary
reaction diffusion systems
"""
name = NAME
defaults = ... |
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import re
import logging
import datetime
from django.db.models import Q
from position.models import *
from public.models import... |
# 6.0001 Spring 2020
# Problem Set 3
# Written by: sylvant, muneezap, charz, anabell, nhung, wang19k, asinelni, shahul, jcsands
# Problem Set 3
# Name: <NAME>
# Collaborators: <NAME>
# Time Spent: 12 hours
# Late Days Used: (only if you are using any)
import string
# - - - - - - - - - -
# Check for simi... |
import pandas as pd
import numpy as np
import nltk
import os
import cv2
import imutils
import matplotlib.pyplot as plt
import re
from nltk.corpus import stopwords
from IPython.display import clear_output, display
import time
# Montamos el Drive al Notebook
from google.colab import drive
drive.mount('/content/drive', ... |
#!/usr/bin/env python3
import argparse
import csv
from datetime import datetime
from difflib import SequenceMatcher
from typing import List
import spotipy
from dotenv import load_dotenv
from spotipy import SpotifyOAuth
def dict_get(adict: dict, *keys: str):
current = adict
for key in keys:
if curren... |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Parameter
def get_activation(name):
name = name.lower().split('-')[0]
if name == 'relu':
return nn.ReLU
elif name == 'softplus':
return nn.Softplus
else:
raise NameError('No acti... |
import logging
import numpy as np
from mcerp import *
from scipy.optimize import minimize
from sympy import *
from sympy.utilities.lambdify import lambdify, lambdastr
from uncertainties import ufloat
from uncertainties import umath as a_umath
from Charm.utils.gaussian_decomposition import gaussian_decomposition
from ... |
import datetime
import os
import smtplib
import sys
import webbrowser
from cv2 import clipLine
import pyjokes
import pyttsx3
import requests
import speech_recognition as sr
import wikipedia
from requests import get
from bs4 import BeautifulSoup
from wikipedia.wikipedia import search
from pywikihow impor... |
import pygame, random, sys, math, gym
width, height = 1000, 600
class Env:
global width, height
def random_coordinate(self):
return random.randrange(100, width - 100), random.randrange(100, height - 100)
def __init__(self):
self.stage = 1
self.stage_clear = True
self.enem... |
import socket
import time
import numpy as np
import os
from src.algorithms.QDoubleDeepLearn import QLearn # can be QLearn, QDeepLearn, QDoubleDeepLearn or RandomAgent
from src.environments.jsbsim.JSBSimEnv import Env # can be jsbsim.JSBSimEnv or xplane.XPlaneEnv
from src.scenarios.deltaAttitudeControlScene import Sce... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: peter
csvtools.py: Tools for handling metadata CSV files
**CSV types**
Four types of CSV files are supported, differentiated by the presence of 'run'
and 'probe columns.
Experiment constants -> No runs column, no probe column. Data that applies to
... |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import asyncio
# noinspection PyUnresolvedReferences
import errno
import lz4.frame
import pytz
import secret
import sys
from datetime import datetime, timedelta
from io import BytesIO
from quart import Quart, request, Response
from telethon import TelegramClient
from tele... |
### Report Rebalance& Grid !!!!! ####
# import neccessary package
import ccxt
import json
import numpy as np
import pandas as pd
import time
import decimal
from datetime import datetime
import pytz
import csv
import sys
# Api and secret
api_key = ""
api_secret = ""
subaccount = ""
# Set y... |
"""
Elasticsearch Handlers
biothings.web.handlers.BaseESRequestHandler
Supports: (all features above and)
- access to biothing_type attribute
- access to ES query pipeline stages
- pretty print elasticsearch exceptions
- common control option out_format
Subclasses:
- biothings.web.handler... |
# system packages
from __future__ import annotations
from datetime import datetime
from statistics import mean
from typing import Dict, List, NamedTuple, Optional
# local packages
from src.config import Config
from src.plots import Plots
class Range (NamedTuple):
start:datetime
end:datetime
class Analyze... |
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2022 Osyris contributors (https://github.com/osyris-project/osyris)
import numpy as np
from pint.quantity import Quantity
from .base import Base
from .array import Array
from .tools import value_to_string
def _binary_op(op, lhs, rhs):
if isinstance(rhs, (int... |
import argparse
import os
import os.path as osp
import sys
import numpy as np
from sklearn.metrics import f1_score
from detectron2.data import DatasetCatalog, MetadataCatalog
import mmcv
from tqdm import tqdm
cur_dir = osp.dirname(osp.abspath(__file__))
sys.path.insert(0, osp.join(cur_dir, "../../../"))
import ref
fro... |
import sqlite3
from datetime import datetime
from functools import wraps
from pathlib import Path
from pkg_resources import resource_filename
from tveebot_tracker.config import Config
from tveebot_tracker.episode import TVShow, Quality, Episode, State, EpisodeFile
# region Errors/Exceptions
class EntryNotFoundErr... |
# -*- coding: utf-8 -*-
"""
Created on the 30th Apr 2018
@author : <EMAIL>
"""
import re
import datetime
from termcolor import colored
import datetime
import sys
from dateutil.relativedelta import relativedelta
import re
from .Traditional2Simplified_module import Converter
import datetime
import jieba
from periodDetec... |
#!/usr/bin/env python
# coding=utf-8
'''
Author: wjm
Date: 2021-03-03 11:02:10
LastEditTime: 2021-08-22 10:48:45
Description: batch_size=16, patch_size=48, L1 loss, epoch=250, lr=1e-5, decay=250, ADAM
'''
import os
import torch
import torch.nn as nn
import torch.optim as optim
from model.base_net import *
# from torch... |
import cv2
import numpy as np
import tensorflow as tf
from tensorflow import keras
from settings import *
import os
pwdpath=os.getcwd()
#modified from- https://medium.com/towards-data-science/robust-facial-landmarks-for-occluded-angled-faces-925e465cbf2e
def findc(img):
# ret, img = cap.read()
# img =... |
import torch
from torch.optim import Optimizer
import math
class _LRScheduler(object):
def __init__(self, optimizer, warmup_epochs, epochs):
if not isinstance(optimizer, Optimizer):
raise TypeError("{:} is not an Optimizer".format(type(optimizer).__name__))
self.optimizer = optimizer
... |
"""jsonstreamer provides a SAX-like push parser via the JSONStreamer class and a 'object' parser via the
class which emits top level entities in any JSON object.
Useful for parsing partial JSON coming over the wire or via disk
Uses 'again' python module's 'events.EventSource' framework for event boilerplate
again -> h... |
# (C) Copyright 2020- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernme... |
#!/usr/bin/python
GUI_VERSION = '1.0.0.dev1'
import tkinter as tk
from tkinter import ttk, filedialog
from tkinter.messagebox import showinfo, showerror
from ttkthemes import ThemedTk
import webbrowser
from mdiocre.wizard import Wizard
from mdiocre.__meta__ import __version__ as MD_VERSION
import contextlib
from ... |
"""
Network utiliy functions
"""
# pylint: disable=line-too-long,unused-argument,missing-function-docstring
from __future__ import absolute_import
import logging
import mxnet as mx
from mxnet.gluon import HybridBlock
from mxnet.gluon import nn
from mxnet.gluon.contrib import nn as contrib_nn
from .mobilenet import ge... |
from django.db import models
from django.db.models import Count, Max, Min, Avg
from django.utils.html import mark_safe
from django.utils.translation import gettext as _
from skyfield.api import Star
from taggit.managers import TaggableManager
from .utils import create_shown_name
from .vocabs import DISTANCE_UNIT_CHOICE... |
from inspect import signature, Parameter
from collections import defaultdict
from ordered_set import OrderedSet
from plums.commons.path import Path
from plums.commons.data import DataPoint
from .base import SizedDataset
from ..utils.cache import DatasetCache, NotInCacheError
from ..utils.path import PathResolver
de... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.