text stringlengths 3.07k 22.1k |
|---|
"""
Utility functions useful for TrajOpt algos
"""
import numpy as np
import multiprocessing as mp
from trajopt import tensor_utils
from trajopt.envs.utils import get_environment
from trajopt.envs.herb_pushing_env import HerbEnv
import cv2
import trimesh
import copy
max_action=0.1
#@profile
def do_env_rollout(env_na... |
"""
Generate environment.yml from pyproject.toml
"""
from __future__ import annotations
import argparse
import json
import typing
import urllib.request
from copy import deepcopy
from datetime import datetime, timedelta, timezone
from enum import Enum, auto
from pathlib import Path
from shutil import copyfileobj
fro... |
'''
Urban-PLUMBER processing code
Associated with the manuscript: Harmonized, gap-filled dataset from 20 urban flux tower sites
Copyright (c) 2021 <NAME>
Licensed under the Apache License, Version 2.0 (the "License").
You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
'''
__title__ =... |
"""
roc_w_tf-servimg.py
Sending RGB image tiles to a running tf-serving POST for prediction and plotting ROC curve
author: @DevelopmentSeed
usage:
python3 roc_w_tf-servimg.py --test_path=test \
--keyword1=not_school \
--keyword2=school \
--server_endpoint='http://localhost:8501/v1/models/2nd-... |
import os
import json
import numpy as np
import pandas as pd
save_as_csv = False
print_latex = True
def print_scores(model_desc: dict) -> None:
return " ".join(
[f"{key}@{k}={model_desc[key][i][1]}" for key in ("hit", "ndcg") for i, k in enumerate(model_desc['ks'])])
def print_mean(models: list) -> str... |
import sys
import pytest
from tests.utils import FakeDispatchView
sys.path.append('../engel')
from engel.widgets.base import BaseElement
class BuildTriggerWidget(BaseElement):
def build(self):
self._attributes['ok'] = True
class BuildArgsWidget(BaseElement):
def build(self, hello):
self.... |
# coding: utf-8
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import itertools
import copy
import numpy as np
from .parameter import ParameterTes
from .parameter import ParameterJes
from .parameter import ParameterLe... |
import argparse
from calendar import timegm
from collections import namedtuple
from contextlib import closing
import datetime
import importlib
import logging
import os
from pythonjsonlogger import jsonlogger
import socket
import sys
from termcolor import colored
import time
import uuid
try:
_, TERMINAL_COLUMNS = ... |
import datetime
import os
import time
import traceback
import random
import re
from django import template
from django.contrib.auth import logout
from django.core.exceptions import PermissionDenied
from django.conf import settings
from django.http import HttpResponseRedirect, HttpResponseForbidden, Http404, HttpRespon... |
#! /usr/bin/env python
# vim: set et sts=4 sw=4:
# -*- coding: utf-8 -*-
"""
This Module contains several convenient parsers and fonctions to easily parse
formatted text into values usable with python of Numpy fonctions.
The main function is parseConfigFile which allow to read a text file
structured in sections and co... |
#coding=utf-8
from fontTools.pens.basePen import BasePen
from defconAppKit.windows.baseWindow import BaseWindowController
from mojo.events import addObserver, removeObserver
from AppKit import * #@PydevCodeAnalysisIgnore
from vanilla import * #@PydevCodeAnalysisIgnore
from mojo.drawingTools import *
from mojo.UI impor... |
import logging
import numpy as np
import torch
import torch.nn.functional as F
import wandb
from torch import nn, optim
import RL
from RL.agents.exp_buff_agent import ExperienceBuffer
from RL.utils.standard_models import FFModel
from RL.utils.util_fns import toNpFloat32
logger = logging.getLogger(__name__)
ldebug = ... |
import asyncio
import math
from contextlib import asynccontextmanager
from hashlib import sha1
from typing import Any
import node as NodeFactory
# from . import node as NodeFactory
from abcchord import INode
from errors import NodeLeaveError, NodeRPCError, InvalidRPC
from network import TIMEOUT, FINGER_AMOUNT
class ... |
import os
import sys
import time
import pandas as pd
import numpy as np
from scipy.stats import kurtosis
from scipy.stats import skew
from statsmodels import robust
columns_intermediate = ['frame_no', 'ts', 'ts_delta', 'protocols', 'frame_len', 'eth_src',
'eth_dst', 'ip_src', 'ip_dst', 'tcp_src... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import os
import re
import sys
import time
import urllib.parse
from functools import wraps
from pathlib import Path
from uuid import uuid4
import telegram
from logzero import logger
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, ParseMode
fr... |
'''
Person Detector and Leg Estimator based on OpenPose Project.
OpenPose Project Repo: https://github.com/CMU-Perceptual-Computing-Lab/openpose
'''
# NOTE:
# LD_LIBRARY_PATH should be set as [OPENPOSE_CAFFE_HOME]/build/lib/:[CUDA_HOME]/lib64:[OPENPOSE_HOME]build/lib:[Python3.5_Path]/dist-packages
import logging
from t... |
from tools import *
import json
import pickle
import copy
debug = True
analy_mode = 3 # 1.raw xyz data to results
# 2.raw xyz data to tempRec
# 3.temRecs to results
def trackBlocks(fnames,trackList):
Rstep = []
speRec = []
tempList=[]
istep = 1
step = 1
bnd... |
#!/usr/bin/env python3
"""Module containing the Cmip class and the command line interface."""
import os
import argparse
import shutil
from pathlib import Path
from biobb_common.generic.biobb_object import BiobbObject
from biobb_common.configuration import settings
from biobb_common.tools import file_utils as fu
from b... |
#!/usr/bin/env/ python3
"""Trackerian - a command line time tracker."""
import argparse
import collections
import datetime
import pickle
import sys
def parse_arguments(args):
"""Parse arguments and return them in a dictionary.
Args:
args (list): List of arguments and associated values to parse.
... |
#!/usr/bin/python3
# coding=utf8
# Date:2021/05/04
# Author:Aiden
import sys
import cv2
import math
import rospy
import numpy as np
from threading import RLock, Timer
from std_srvs.srv import *
from sensor_msgs.msg import Image
from sensor.msg import Led
from object_tracking.srv import *
from hiwonder_servo_msgs.msg ... |
import csv
import random
from timeit import default_timer as timer
from datetime import timedelta
import statistics as st
Main_list=[] #a String list include alle the file's info
with open('european_cities.csv', 'r') as csv_file:
csv_file=csv.reader(csv_file)
for line in csv_file:
for e i... |
import os
import time
import datetime
from datetime import datetime, timedelta
from os import listdir
from secrets import TOKEN
import discord
from multipledispatch import dispatch
client = discord.Client()
parent_path = "ServerLogs/" #parent path where all server logs will be put
if not(os.path.isdir(parent_path))... |
import numpy as np
def filter_AR_stationary(x,mask,model):
"""
Compute filtering distribution for a partially-observed AR process
"""
n = len(x)
params = model.params
sigma2 = model.em.std**2
n_p = len(params)
filtered_means = np.zeros((n, n_p))
filtered_covs = np.zeros((n, n_p, ... |
__all__ = ['CoverageInstructions', 'TestCoverage', 'TestSuiteCoverage']
from typing import (Dict, List, Set, Iterator, Any, Iterable, FrozenSet, Type,
Optional, Mapping)
from collections import OrderedDict
import logging
import yaml
import attr
from .language import Language
from .fileline import... |
# Copyright 2016 <NAME>. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at: http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
# (c) 2019 by Authors
# This file is a part of centroFlye program.
# Released under the BSD license (see LICENSE file)
import argparse
import os
import subprocess
import math
import statistics
import edlib
from collections import defaultdict
from utils.os_utils import smart_makedirs
from ncrf_parser import NCRF_Report... |
# -*- coding: utf-8 -*-
from django import forms
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.dispatch import receiver
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy, ugettext_noop
from o... |
import numpy
from . import utils
from .ov_blocks import one_e_blocks
from .ov_blocks import two_e_blocks
from .ov_blocks import two_e_blocks_full
from .ov_blocks import make_two_e_blocks_full
def make_random_F(no, nv):
foo = numpy.random.random((no, no))
fov = numpy.random.random((no, nv))
fvv = numpy.ran... |
"""Manage Network Application files."""
import json
import logging
import re
import shutil
from pathlib import Path
from kytos.core.napps import NApp
LOG = logging.getLogger(__name__)
class NAppsManager:
"""Deal with NApps at filesystem level and ask Kytos to (un)load NApps."""
def __init__(self, controlle... |
import pandas as pd
import numpy as np
import os
import matplotlib.pyplot as plt
from io import BytesIO,StringIO
import cv2
import lxml.etree as et
from PIL import Image
import cairosvg
import rdkit
from rdkit import Chem
from rdkit.Chem import AllChem, Draw
from rdkit.Chem.Draw import MolDrawOptions
import cssutils
... |
"""
This module simulate a single NBA games given two teams
"""
# general import
import json
import random
from os.path import join
from constant import TEAM_DICT, TEAM_BASE_PATH, PLAYER_RATING_PATH
class GameSimulation:
"""This class will rate two teams and give each of them a score. A winner
will be deter... |
import time
import sys
import logging
import socket
logger = logging.getLogger("job")
TASK_STARTING = 0
TASK_RUNNING = 1
TASK_FINISHED = 2
TASK_FAILED = 3
TASK_KILLED = 4
TASK_LOST = 5
class Job:
def __init__(self):
self.id = self.newJobId()
self.start = time.time()
def slaveOffer(... |
import numbers
import warnings
import numpy as np
import chainer
import chainer.functions as F
import brancher.distributions as distributions
import brancher.geometric_ranges as geometric_ranges
from brancher.variables import var2link, Variable, DeterministicVariable, RandomVariable, PartialLink
from brancher.utiliti... |
__author__ = '3ev0'
"""
Whois library.
See RFC 3912
https://www.icann.org/resources/pages/approved-with-specs-2013-09-17-en#whois
We parse the key/value pairs as-is and do not try to transform to a uniformish format. This should be good enough.
How to deal with domain intermediaries? This is, afaik, limited to .com, ... |
#! /usr/bin/python
# -*- coding: utf8 -*-
#
# Copyright (c) 2016 Linux Documentation Project
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals
import os
import sys
import stat
import time
import errno
import codecs
import shutil
import logging
import inspect
from... |
import asyncio
from ..base import BaseApplicationBackend, BaseCanvasBackend, BaseTimerBackend
from ...app import Timer
from ...util import keys
from ._offscreen_util import OffscreenContext, FrameBufferHelper
try:
from jupyter_rfb import RemoteFrameBuffer
except Exception:
RemoteFrameBuffer = object
_msg... |
#!/usr/bin/env python3
import os
import pickle
from base64 import b64decode,b64encode
from binascii import hexlify, unhexlify
from os import popen
from lxml import etree
import html
from Crypto.Cipher import AES
from Crypto import Random
from flask import Flask, request, make_response, render_template_string
app = ... |
import re
import dateutil.parser
import http.client as http_client
import logging
import requests
from bs4 import BeautifulSoup
from pprint import pprint
class MyVoteInfoResult(object):
def __init__(self, registrants):
self.registrants = registrants
def parsed(self):
return self.registrants
class MyVoteI... |
# -*- coding: utf-8 -*- #
# Copyright 2015 Google LLC. 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 requir... |
# -----------------------------------------------------------------------------
# Copyright (c) 2009-2016 <NAME>. All rights reserved.
# Distributed under the (new) BSD License.
# -----------------------------------------------------------------------------
import csv, json
import numpy as np
from glumpy import app, gl... |
#!/usr/bin/env python3
# The MIT License (MIT)
#
# Copyright (c) 2016 <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
# t... |
import contextlib
from contextlib import contextmanager
import hashlib
import inspect
import logging
import os
from pathlib import Path, PurePath
import tempfile
from typing import Generator
from urllib.error import HTTPError
from urllib.parse import urlparse
from urllib.request import urlopen
from django.conf import ... |
import mmcv
import numpy as np
import torch
import cv2
import random
from skimage.util import random_noise
__all__ = [
'ImageTransform', 'BboxTransform', 'MaskTransform', 'SegMapTransform',
'Numpy2Tensor'
]
class ImageTransform(object):
"""Preprocess an image.
1. rescale the image to expected size
... |
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
from django.db.models import Q
from .models import Channel, Message, Reply, Stamp, MessageStamp, ReplyStamp
from .forms import NewThrea... |
import os
import json
import requests
from twitchio.ext import commands
# Note to a less lazy future self: YO DUDE JUST USE GOOGLE DRIVE TO DISPLAY STATS
# TO RUN THE BOT: do "pipenv run python bot.py" in cmd (when in this directory, of course)
strat = "PrayAgainstMe"
test = False
test_tour_id = "tournament_15978132... |
import h5py
import numpy as np
import os
import torch
from mod_shift.implemented_functions import w_clipped_linear
# loads datasets in the format Batch * spatial dims * embedding dims
# individual functions for loading dataset
def load_cremi(dir_path, downsample_factor, slices, set, gt=False):
file = h5py.File(... |
import wpilib
from networktables.networktable import NetworkTable
import logging
logger = logging.getLogger("forklift")
import enum
class ForkliftMode(enum.Enum):
MANUAL = 1
AUTO = 2
class Forklift (object):
def __init__ (self, limit_port, init_down_speed):
self.target_position = None
... |
from os.path import abspath
from sys import path
# add the root of the project into the path to allow cd-ing into this folder and running the script.
from time import sleep
path.insert(0, abspath(__file__).rsplit('/', 2)[0])
# Load Django
from config import load_django
from kombu.exceptions import OperationalError
... |
import os
import queue
import sqlite3
import sys
import threading
import urllib.parse
from time import sleep
import requests
from Crypto.Cipher import AES
from requests.adapters import HTTPAdapter
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:72.0) Gecko/20100101 Firefox/72.0',
... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
from collections import defaultdict
import torch
import torch.nn as nn
import torch.nn.functional as F
from fairnr.modules.modul... |
"""
based on https://github.com/xunzheng/notears
"""
import igraph as ig
import matplotlib.pyplot as plt
import numpy as np
import scipy.linalg as slin
import scipy.optimize as sopt
from scipy.special import expit as sigmoid
def is_dag(W):
G = ig.Graph.Weighted_Adjacency(W.tolist())
return G.is_dag()
def s... |
# -*- encoding: utf-8 -*-
'''
Created on 27.11.2011
@author: xaralis
'''
from django.db.models import Q
from django.utils.translation import ugettext as _
from boris.classification import SEXES, ANONYMOUS_TYPES, DISEASES, \
DRUG_APPLICATION_TYPES, DRUGS
from boris.clients.models import Town, District
from boris.r... |
import itertools
from . import jade, pretty, config
from .errors import *
############## HElPER FUNCTIONS #####################################
def _out(inHeader,inData):
if args.outputFile != "":
jade._out(args.outputFile,inHeader,inData)
pretty.message("Results exported to " + args.outputFile + ".... |
# mk_update.py new <output> <firmware> <model>
# mk_update.py old <output> <firmware>
# mk_update.py verify <update_file>
#
# Convert a raw firmware binary into an update file for our bootloader.
#
# New Update Format (Little endian, unless otherwise stated):
# File Header:
# 4 bytes: 'FFUP'
# 4 bytes: <offse... |
# -*- coding:utf-8 -*-
#
# Author : 寒江雪
# E-mail :
# Date : 19/11/09 21:03:30
# Desc : 使用DDPG的方法玩flappy bird
#
"""
Dependencies:
tensorflow r1.14
pygame 1.9.4
"""
from __future__ import print_function
import tensorflow as tf
import cv2
import sys
sys.path.append("game/")
import wrapped_flappy_bird ... |
"""Attribute selector plugin.
Oftentimes when testing you will want to select tests based on
criteria rather then simply by filename. For example, you might want
to run all tests except for the slow ones. You can do this with the
Attribute selector plugin by setting attributes on your test methods.
Here is an example:... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import itertools
from math import *
from pprint import pprint
class stock:
""" Object permettant de manipuler un etat """
def __init__(self, etat, maximum=20):
self.etat = etat
self.maximum = maximum
def charge(self, charge):
... |
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import shutil
import sys
from functools import partial
import azlmbr.editor
import azlmbr.legacy.gen... |
#
# Copyright 2018 Analytics Zoo 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 applicable law or agreed to... |
import numpy as np
from numba import njit, prange
from time import time
from sklearn.base import BaseEstimator, RegressorMixin
from sklearn.utils import check_X_y, check_random_state
from sklearn.metrics import check_scoring
from sklearn.model_selection import train_test_split
from pygbm.binning import BinMapper
from ... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
import pdb
#pdb.set_trace()
import pickle
from collections import defaultdict
from argparse import ArgumentParser
import os
import sys
def Check_contig_in_HCbk_dict(HCbk_dict,PS_flag_1,PS_flag_2):
break_flag = 0
for key,val in HCbk_dict.items():
PS_flag_1_curr = key[0]
PS_flag_2_curr = key[1]
... |
import numpy as np
import cv2
import math
import sys
def circle(x, y, circleXcenter, circleYcenter, circleRadius):
# Circular obstacle
if (x - circleXcenter)**2 + (y - circleYcenter)**2 - circleRadius**2 <= 0:
workSpace[x, y] = 0
def minkowski(xUnits, yUnits, resolution, rad, clc):
'''
This function calculate... |
# Copyright 2022 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
'''
Analysis script for the benchmark results, comparing
results with voltage control enabled and disabled.
'''
import matplotlib.pyplot as plt
import pandas as pd
START_TIME = '2019-02-01 00:00:00'
DROP_FIRST_DAYS_DATA = True
PLOT_DICT = {
'tank temperatures': [
'temperature in °C',
[
... |
"""Example 013: Embedded Signing Ceremony from template with added document"""
from flask import render_template, url_for, redirect, session, flash, request
from os import path
import json
from app import app, ds_config, views
import base64
import re
from docusign_esign import *
from docusign_esign.rest import ApiExce... |
#!/usr/bin/env python3
import collections
import datetime
import json
import os
import pathlib
import re
import sys
from enum import Enum
from typing import Dict, List, NamedTuple, Optional, Text
from bs4 import BeautifulSoup, ResultSet
from bs4.element import Tag
from vaccine_feed_ingest.utils.log import getLogger
... |
# Collection of small helper functions
import numpy as np
import pyaudio
from scipy.fftpack import fft
from .codec import audio_read
import logging
import decimal
import math
class _error(Exception):
pass
def linlin(x, smi, sma, dmi, dma):
"""Linear mapping
Parameters
----------
x : float
... |
import os
import argparse
import json
import numpy as np
def parse_args():
parser = argparse.ArgumentParser(description='Test Retina Model with MIO or Bogota images')
parser.add_argument( '--annotfile', help="annotation json file", default='', type=str)
parser.add_argument('--output', help="output dir", default=''... |
# Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
# justice-seasonpass-service (1.12.2)
# pylint: disa... |
# -*- coding: utf-8 -*-
import shutil
import locm, routem, mapm, dropboxm, gmaps, tools, bokehm, tspm
import logging.config, os, yaml, inspect
import numpy, time
tver_coords = {u'lat':56.8583600,u'lng':35.9005700}
ryazan_coords = {u'lat':54.6269000,u'lng':39.6916000}
def setup_logging(
default_path='app_logging.y... |
import numpy as np
import torch
from torch import nn
from torch import optim
from torch.autograd import Variable
from collections import OrderedDict
from torchvision import datasets, transforms, models
from torchvision import models
from torch.autograd import Variable
from PIL import Image
mean_normalization = [0.485,... |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2021 <NAME> (The Compiler) <<EMAIL>>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, e... |
"""
Benchmark script for LHAPDF comparison.
"""
import lhapdf
import pdfflow.pflow as pdf
import argparse
import subprocess as sp
import numpy as np
import tensorflow as tf
from time import time
import tqdm
parser = argparse.ArgumentParser()
parser.add_argument("--pdfname", "-p", default="NNPDF31_nlo_as_0118/0", type=... |
from keras import layers
from keras.models import Model
from keras.layers import Input, Conv2D, MaxPooling2D, UpSampling2D, core, Dropout
from keras.layers import Conv2DTranspose
from keras.layers.normalization import BatchNormalization
from keras.optimizers import Adam
from keras.layers.core import Activation
from ker... |
# standard lib
import datetime
# 3rd party libs
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
def plot_price_volume(dates, values, volume, start_date, end_date):
'''
extract specified slice from total series, generate and return matplotlib figure for slice
'''
# extract... |
from telegram import InlineKeyboardButton, InlineKeyboardMarkup,ReplyKeyboardRemove,ReplyKeyboardMarkup
import calendar
import datetime
import requests
from config import ANSWER_CALLBACK_QUERY, EDIT_MESSAGE_TEXT, EDIT_MESSAGE_REPLY_MARKUP,DELETE_MESSAGE,SEND_MESSAGE
import db
import button_maker as button
def show_use... |
#!/usr/bin/env python3
# Copyright 2020 The Johns Hopkins University (author: <NAME>)
import torch
import numpy as np
from torch import nn
import librosa
class MaskedLoss(torch.nn.Module):
def __init__(self, loss, mask_free=False):
super(MaskedLoss, self).__init__()
self.loss = loss
self... |
import itertools
import time
import numpy
import pytest
from helpers import *
from reikna.helpers import product
from reikna.fft import FFT
import reikna.cluda.dtypes as dtypes
from reikna.transformations import mul_param
def pytest_generate_tests(metafunc):
perf_log_shapes = [
(4,), (10,), (13,), # 1... |
import random
import struct
import sys
from collections import OrderedDict
from typing import List, Union
from constants import WORD_SIZE
from numpy import float32
from constants import WORD_MASK
from interpreter import exceptions as ex
from interpreter import utility
from interpreter.instructions import overflow_dete... |
"""
There are eight planar symmetries of a square:
Rotation: R_0, R_90, R_180, R_270
Reflection about the horizontal axis
Reflection about the vertical axis
Reflection about the main diagonal
Reflection about the secondary diagonal
The composition of two symmetries (functions) is closed and associative, and
has an id... |
import base64
import copy
from typing import List, Optional, Sequence, Union
from typing import List, Optional
import attr
from terra_proto.cosmos.tx.v1beta1 import SimulateResponse as SimulateResponse_pb
from terra_sdk.core import AccAddress, Coins, Dec, Numeric, PublicKey
from terra_sdk.core.broadcast import (
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# stats.py
"""Modified DVHA-Stats for IQDM-PDF output"""
#
# Copyright (c) 2021 <NAME>
# This file is part of IQDM-Analytics, released under a MIT license.
# See the file LICENSE included with this distribution, also
# available at https://github.com/IQDM/IQDM-Analy... |
import os
import sys
import glob
import json
import anytree
from tqdm import tqdm
import sys
import spacy
from copynews.qald import QaldParser
path = os.getcwd()
sys.path.insert(0, path)
from common.utility.utility import find_mentions
from copynews.lc_quad_linked import LC_Qaud_LinkedParser
# sys.path.append('/clust... |
#!/usr/bin/env python
# Copyright (C) 2015 <NAME>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
... |
import argparse
import pyRAPL
import os
import cpufreq
import shutil
import signal
import json
# CPU DEFAULT SOCKET-CORES CONFIGURATION
CORES_LIST = list(range(16))
SOCKET_LIST = [0, 1]
SOCKET_DICT = {
0: CORES_LIST[0:8],
1: CORES_LIST[8:16]
}
# ENVIRONMENT CONFIG
DEF_ENVCONFIG = {
'socket' : 1,
'co... |
#!/usr/bin/env python3
"""Augment Rosette API entity extraction results with information from
Wikipedia."""
import csv
import json
import os
import sys
import urllib
import warnings
from operator import methodcaller
from getpass import getpass
from iso639 import Iso639
from functools import lru_cache
from rosette.a... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ------- IMPORT DEPENDENCIES -------
from datetime import *
from dateutil import *
from dateutil import tz
import time
from jinja2 import Environment
import bleach
import jinja2
# security
import os
import binascii
from cryptography.fernet import Fernet
from werkzeug.secu... |
# -*- coding: utf-8 -*-
"""A Python client for the Open States API"""
from __future__ import unicode_literals, print_function, absolute_import
import os
from sys import version_info
from datetime import datetime
from requests import Session
from time import sleep
"""Copyright 2016 <NAME>
Licensed under the Apache L... |
'''
Names (Please write names in <Last Name, First Name> format):
1. <NAME>
2. <NAME>
3. Arteaga, Andrew
Project type:
Image Denoising with VOC 2012 Dataset
Report what each member did in this project:
Lucille: Network Architecture, Training, and Evaluation
Andrew: Image visualizations, Data Plotting, an... |
"""Report utils."""
# Standard Python Libraries
from datetime import datetime
import json
import os
import os.path
import subprocess # nosec
# Third-Party Libraries
from PyPDF2 import PdfFileReader, PdfFileWriter
from faker import Faker
from flask import render_template
from flask.templating import render_template_st... |
#!/usr/bin/env python3
"""See README.md for usage"""
import argparse
import contextlib
import glob
import json
import logging
import os
from collections import defaultdict
import requests
# Categories that do not allow self-serving.
CATEGORIES_TO_UPDATE = ("featured",)
CHARM_TYPE_MAPPING = {
'charm': 'charm',
... |
"""Tests for variantkey nrvk module."""
# test_nrvk.py
# @category Libraries
# @author <NAME> <<EMAIL>>
# @copyright 2017-2018 GENOMICS plc
# @license MIT (see LICENSE)
# @link https://github.com/genomicsplc/variantkey
import variantkey as bs
import os
import time
from unittest import TestCase
testD... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Utility functions for spatial processing."""
import click
import logging
import numpy as np
import numpy.ma as ma
import os
import pdb
import rasterio
import scipy.stats
from importlib.machinery import SourceFileLoader
utils = SourceFileLoader("lib.utils", "src/00_li... |
"""
MIT License
Copyright (c) 2021 NamNam#0090 & OTTWAW team
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, mer... |
#!/usr/bin/env python3
import os
import glob
from multiprocessing import Pool
import argparse
from itertools import groupby
def parse_args():
parser = argparse.ArgumentParser(
description="Extract alignment information from BAM/SAM file and splits reads into distinct transcriptional intervals")
parse... |
'''
Copyright 2019 <NAME>.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 23 08:28:54 2019
@author: victor
"""
import numpy as np
import warnings
warnings.filterwarnings("ignore", category=RuntimeWarning)
def getData(data_set_x):
'''
Clease dataset and split into inputs and outputs
Arguments:
data_... |
import os
import re
import numpy as np
from matplotlib import pyplot as plt
import sys
def extract_loss(logs):
res_loss = []
res_map = {}
lr = 0.0
cur_epoch = -1
best = 0.0
for l in logs:
l = l.strip()
if not l.startswith('2020'):
continue
regex_epoch = re... |
# https://github.com/checktheroads/hyperglass
"""
Main Hyperglass Front End
"""
# Standard Imports
import json
import logging
# Module Imports
import redis
import logzero
from logzero import logger
from flask import Flask, request, Response
from flask_limiter import Limiter
from flask_limiter.util import get_ipaddr
fr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.