text stringlengths 6.04k 39.5k |
|---|
from protocol import Protocol
from typing import Optional
import logging
import struct
from dataclasses import dataclass
from usb.core import USBTimeoutError
from Crypto.Cipher import AES
from Crypto.Hash import HMAC, SHA256
from Crypto.Random import get_random_bytes
from crccheck.crc import Crc32Mpeg2
USB_CHUNK_SIZE... |
"""This file contains code for use with "Think Bayes",
by <NAME>, available from greenteapress.com
Copyright 2012 <NAME>
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function, division
import math
import numpy
import random
import sys
import correlation
import thinkplot
i... |
# -*- coding: utf-8 -*-
# Copyright 2018 by dhrone. All Rights Reserved.
#
import time
from .iot import Iot
from .utility import get_utc_timestamp
from .objects import ASHO
class Interface(object):
interface = None
version = None
properties = None
def __init__(self,thing=None, uncertaintyInMillisec... |
import argparse
import os
from misc import logger
from misc import constants
from collections import defaultdict, OrderedDict
import numpy
import re
class ExecutionResult:
def __init__(self):
self.test_number = 0
self.execution_time = ExecutionTime()
class ExecutionTime:
def __init__(self, to... |
import argparse
from fnmatch import fnmatch
import os.path
import re
import sys
from ii_irods.coll_utils import resolve_base_path, convert_to_absolute_path, get_dataobjects_in_collection
from ii_irods.coll_utils import get_direct_subcollections, get_subcollections, collection_exists
from ii_irods.do_utils import get_d... |
import csv
import json
import os
import shutil
from collections import OrderedDict
from time import time
import numpy
import redis
from sklearn import model_selection
from MLLogger import BaseMLLogger
from exception_handler import MLExceptionHandler
from general_helper import (
get_oauth, make_stream_from_sdf, ma... |
import logging
import math
from collections import deque
from node import Node
from operator import itemgetter
from h3math import compute_radius, compute_hyperbolic_area, compute_delta_phi, compute_delta_theta
import mpl_toolkits.mplot3d.art3d as art3d
from matplotlib.patches import Circle
import matplotlib.pyplot as ... |
###############################################################################
# The MIT License (MIT)
#
# Copyright (c) 2017 <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... |
import random
import matplotlib.pyplot as plt
import tensorflow as tf
import keras as K
from os import path
from src.lib import *
#from src.logging import *
from copy import deepcopy
from datetime import datetime
class Agent:
def __init__(self, model, batch_size=12, discount_factor=0.95,
buffer_size=200, pre... |
#!/usr/bin/env python3
# Copyright (c) 2020 The Bitcoin Developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Test deactivation of sigops counting
based on abc-schnorrmultisig-activation.py (D3736).
"""
from test_framewo... |
#!/usr/bin/env python3
import inkex
import math
import string
from lxml import etree
from inkex.transforms import Transform
# Function for calculating a point from the origin when you know the distance
# and the angle
def calculate_point(angle, distance):
if (angle < 0 or angle > 360):
return None
els... |
#-*- coding =utf-8 -*-
import bpy
from bpy.props import *
from bpy.types import Menu,Panel,AddonPreferences
from .Ops_Light import getlight
# shift a menu
def add_cam_menu(self, context):
# add menu
if context.mode == 'OBJECT':
self.layout.operator("object.add_view_camera",icon='VIEW_CAMERA',text = "A... |
import glob
import numpy as np
import os
import pandas as pd
import strictyaml
import tempfile
import shutil
import warnings
from collections import defaultdict
from inspect import signature
from strictyaml import Map, Str, Optional, Int, CommaSeparated
import topicnet
from topicnet.cooking_machine.dataset import Da... |
import numpy as np
import scipy
import scipy.io
import pickle
from scipy.special import lpmv, spherical_jn, spherical_yn
class Directivity:
def __init__(self, data_path, rho0, c0, freq_vec, simulated_ir_duration, measurement_radius, sh_order, type, sample_rate=44100, **kwargs):
''... |
import getpass
import argparse
import boto3
import sys, os, csv
from github import Github
from github.InputFileContent import InputFileContent
import json
from datetime import timedelta
from collections import OrderedDict
from . import utils
from .utils import ensure, ymd, splitfilter, vals, lmap, lfilter, utcnow
MAX_... |
import typing
from typing import Optional, Callable, Iterable, Iterator, Dict, Union
import dataclasses
import argparse
from functools import partial
import yaml
import os
__all__ = [
'confclass',
'confparam'
]
# A sentinel object to detect if a parameter is supplied or not.
# Use an empty class to give it ... |
import networkx as nx
import random, pickle, string
from src.util.gen_files import *
import threading
import time
from src.net.topology import NetTopology
from src.algorithm import *
import os, sys
from random import randint, shuffle, sample
from src.util.utils import *
from src.algorithm.cache import *
from src.util.s... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import math
import time
import ctypes
import socket
import urllib.request
from threading import Event, Thread
from socketserver import ThreadingMixIn
from http.server import BaseHTTPRequestHandler, HTTPServer
try:
import mss
except:
print('Inst... |
import inspect
import io
import itertools
import os
import struct
import sys
import math
from typing import Any, Optional, IO
from quo.accordance import (
DEFAULT_COLUMNS,
get_winterm_size,
bit_bytes,
isatty,
strip_ansi_colors,
)
from quo.color import ansi_color_codes, _a... |
# Copyright (c) 2016-2019 Intel Corporation
#
# 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... |
# https://www.cefconnect.com/closed-end-funds-screener
# https://www.cefa.com/
# http://cefdata.com/funds/clm/
# https://www.cefconnect.com/fund/CLM
# https://www.cefchannel.com/clm/
from framework.utils import *
from framework.base import *
from framework.meta_data import *
from framework.stats_basic import *
from ... |
# -*- coding: utf-8 -*-
"""
This module holds functions for displaying different kinds of menus.
All menus are reaction based.
"""
import asyncio
from copy import copy
from inspect import isawaitable
from typing import List, Optional, Union, Callable
import discord
from discord import Embed
from discord.ext import c... |
#Ui Widgets for pygame
#this is supposed to make it as easy as possible to make and use buttons and other widgets
#Documentation at 'https://github.com/TheBigKahuna353/PygameUI'
#All made by <NAME>
import pygame
#make screen quick
def Window(w = 500, h = 500):
pygame.init()
return pygame.display.set... |
import argparse
import os
import shutil
import time
import random
import json
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
from torch.utils.data import DataLoader
from torchtext.vocab import GloVe
from progress.bar imp... |
#!/usr/bin/env python3
from __future__ import print_function
from copy import copy
from collections import OrderedDict
from abc import ABCMeta, abstractmethod, abstractproperty
from textboard.ansi import ANSI
LOG_BOARD_DEFAULT_LINES_COUNT = 20
LOG_BOARD_SECTOR_DEFAULT_LINES_COUNT = 4
def _validate_id_property(cls... |
# -*- coding: utf-8 -*-
"""Implementation of the ``somatic_variant_filtration`` step
=====================
Default Configuration
=====================
The default configuration is as follows.
.. include:: DEFAULT_CONFIG_somatic_variant_filtration.rst
=========
Important
=========
Because the EB Filter step is so t... |
#!/usr/bin/python3
import threading, queue, time
import picamera.array as picamarray, numpy, pathlib
import numpy.ma as nma
import png, io
from pootlestuff import watchables as wv
class piCamCPU(wv.watchablesmart):
"""
a base class for things that want to analyse images in detail for movement detection, expos... |
import os
import re
import time
from os.path import dirname, exists, join
import pytest
import yaml
from alpenhorn import acquisition as ac
from alpenhorn import archive as ar
from alpenhorn import storage as st
if ("RUN_DOCKER_TESTS" not in os.environ) and ("PLAYGROUND" not in os.environ):
pytestmark = pytest... |
import torch
from torch import nn, optim
from torch.nn import functional as F
from torch.utils import data
import os
import time
from collections import deque
import numpy as np
import torch
from a2c_ppo_acktr import algo
from a2c_ppo_acktr import utils
from a2c_ppo_acktr.envs import make_vec_envs
from a2c_ppo_acktr... |
from django.shortcuts import render, redirect
from student.models import Admission
from .forms import SearchChallan
from django.utils import timezone
from django.db.models import Q
from .models import Voucher
from payroll.models import Salary
from django import forms
from django.contrib import messages
from dj... |
import datetime
from decimal import Decimal
import json
import os
import pytz
import tempfile
from unittest.mock import patch
from freezegun import freeze_time
from ditto.core.utils import datetime_now
from ditto.core.utils.downloader import DownloadException, filedownloader
from django.test import override_settings
... |
from . import *
from . import Base as Scheme
__module__ = __name__
Schema = Scheme.Model
class Base(Schema):
"""
...
"""
class Config(Schema.Configuration): title = "Gitlab" + "-" + "{0}".format(__module__.split(".").pop())
class Query(Base):
"""
API Search-Query Schema
"""
archive... |
#!/usr/bin/env python3
import sys, os, shutil, json, yaml
from time import localtime
ONLY_SIMULATED = False
ONLY_GIAB = True
# Make import from parent directory possible
sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
import modules.file_utils as file_utils
with open(... |
# rabbitdnssec.py -- DNSSEC management through a RabbitMQ cluster
#
# These routines can be used somewhat generally within a cluster of
# DNSSEC signers as we are using at SURFnet.
#
# From: <NAME> <<EMAIL>>
import sys
import socket
import time
import os.path
import importlib
import ssl
import json
import syslog
imp... |
"""
Distributed Proximal Policy Optimization (Distributed PPO or DPPO) continuous
version implementation with distributed Tensorflow and Python’s multiprocessing
package. This implementation uses normalized running rewards with GAE. The code
is tested with Gym’s continuous action space environment, Pendulum-v0 on Colab... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# rule_engine/types.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list ... |
# coding=utf-8
# Copyright (C) 2019 ATHENA AUTHORS; <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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2006-2009 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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; e... |
import os
import time
import numpy as np
import tensorflow as tf
from tqdm import tqdm
from ntopo.monitors import SimulationMonitor
from ntopo.physics import compute_elasticity_energies, compute_opt_energy, compute_volume_penalty
from ntopo.filter import apply_sensitivity_filter
from ntopo.utils import write_to_file... |
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt
"""Basic Error checker from the basic checker."""
from __future__ import annotations
import iter... |
#!/usr/bin/env python
"""
Artificial Intelligence for Humans
Volume 3: Deep Learning and Neural Networks
Python Version
http://www.aifh.org
http://www.jeffheaton.com
Code repository:
https://github.com/jeffheaton/aifh
Copyright 2015 by <NAME>
Licensed under the Apache License, Versio... |
# -*- coding: utf-8 -*-
#
# Copyright 2017 Google 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 requ... |
'Game1'
'''
x.type são os seguintes
(Tudo em Capslock)
quit
atctiveevent
keydown
keyup
mousemotion
mousebuttonup
mousebuttondown
videioresize
'''
#40pygame
import pygame_textinput
import pygame
import random
width=800
height=600
bsize=20
thick=20
fps=60
direction = 270
wall = 10
pygame.init()
gdisplay=pygame.display.... |
"""Types that help building the final representation of the data.
From the point of view of the internal API, the main type in this module is
:py:class:`Builder`, which uses the data stored in an
:py:class:`~muscle_synergies.vicon_data.aggregator.Aggregator` to build the
:py:class:`ViconNexusData`. That object, in tur... |
import asyncio
import concurrent
import functools
import json
import numpy as np
import torch
from aiohttp import web
from aiohttp.web_runner import GracefulExit
import aiohttp_cors
import logging
import csv
import multiprocessing
import queue
import pickle
# Local imports:
from torchfcts import function_from_code, get... |
import argparse
import bz2
import calendar
from datetime import datetime
# import ftplib
import gzip
import logging
import netCDF4
import numpy as np
import os
import shutil
import urllib.error
import urllib.request
import warnings
#-----------------------------------------------------------------------... |
# -*- coding: utf-8 -*-
import collections
import functools
import gzip
import json
import inspect
import os.path
import shutil
import sys
import struct
import time
from functools import wraps
from utlz._version import __version__
# inspired by: http://stackoverflow.com/a/6618825
def flo(string):
'''Return the s... |
# Copyright (c) 2017-2019 Soft8Soft LLC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distribute... |
import pygame
import random
import random
import itertools
import json
import os
import matplotlib.pyplot as plt
from IPython import display
plt.ion()
def plot(scores, mean_scores,save=False):
display.clear_output(wait=True)
display.display(plt.gcf())
plt.clf()
plt.title('Training...')
plt.xlabel... |
import urllib.request, urllib.parse, urllib.error
import logging
import os
from datetime import datetime
import sys
import importlib
importlib.reload(sys) # Reload does the trick!
from src.helpers import upload_file
from scripts.loading.database_session import get_session
from scripts.loading.ontology import read_owl
... |
# -*- coding: utf-8 -*-
"""HTTP client."""
import logging
import warnings
from urllib.parse import urlparse, urlunparse
import requests
from .constants import (
LOG_LEVEL_HTTP,
MAX_BODY_LEN,
REQUEST_ATTR_MAP,
RESPONSE_ATTR_MAP,
TIMEOUT_CONNECT,
TIMEOUT_RESPONSE,
)
from .exceptions import HttpE... |
"""
## =========================================================================== ##
MIT License
Copyright (c) 2021 <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, inc... |
# -*- coding: utf-8 -*-
"""Data-storage containers for internal use."""
import copy
import math
from collections import OrderedDict, deque
from enum import IntEnum
from random import random
from typing import Dict, List, NamedTuple, Union, Tuple, Deque
from .config import (BASE_FREQUENCY, PSG_SQUARE_FREQUENCY, PSG_SQU... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import pandas as pd
from pandas.api.types import CategoricalDtype
__all__ = ['diamonds', 'economics', 'economics_long',
'midwest', 'mpg', 'msleep', 'presidential',
'seals', 'txhousing', 'luv_colours',
... |
import warnings
import itertools
import numpy as np
import operator
from collections import namedtuple
import parmed as pmd
import mbuild as mb
from mbuild.utils.sorting import natural_sort
from mbuild.utils.io import import_
from mbuild.utils.conversion import RB_to_OPLS
from .hoomd_snapshot import to_hoomdsnapshot
... |
# coding=utf-8
# Copyright 2018 The Dopamine 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... |
import math
import random
import torch
import numpy as np
from torch.utils.data.dataset import Dataset
from PIL import Image
import os
from torchvision import transforms
from utils import *
# 1 x n_class x height x width tensor
def decode_output_to_label(temp):
n, c, h, w = temp.size()
temp = temp.transpo... |
from dataloader_utils import Gender, HeartPart, EndPhase
from enum import Enum
import numpy as np
import math
import cv2
# --------------------------------------
# Shape (contour) similarity
# --------------------------------------
def __areas(curve1, curve2):
# floats come in
# find the corners of the bbox
... |
from math import floor
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db.models import Q
from django.http import HttpResponseRedirect, HttpResponse, HttpResponseForbidden
from django.shortcuts import get_object_or_404
from django.template.context_processors import csrf
from django.views import ge... |
'''
Optimal hyperparameters for CM + Laplacian kernel
Ea: alpha 1e-11, gamma 1e-4
polarizability: alpha 1e-3, gamma 1e-4
HOMO-LUMO gap: alpha 1e-2, gamma 1e-4
Dipole moment: alpha 1e-1, gamma 1e-3
Optimal hyperparameters for BoB + Laplacian kernel
Ea: alpha 1e-11, gamma 1e... |
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim.lr_scheduler import MultiStepLR
import json
import os
import argparse
import utils
from model import vgg
import itertools
import numpy as np
import random
import torchvision
import torchvision.transforms as transforms
from torch.utils... |
"""
This module finds diffusion paths through a structure based on a given potential field.
If you use PathFinder algorithm for your research, please consider citing the following work:
<NAME>, <NAME>, <NAME>, <NAME>, <NAME>,
The Journal of Chemical Physics 145 (7), 074112
"""
from __future__ import division
... |
# Author: <NAME>
# Created: 8/5/20, 8:25 AM
import logging
import math
import os
from textwrap import wrap
import pandas as pd
from typing import *
import seaborn
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
from mg_general import Environment
from mg_io.general import load_obj, save_o... |
from bisect import bisect
import ColladaMaterial
# Named array of points.
class PointArray():
def __init__(self, n, ofs):
self.name = n
self.points = []
self.stride = 1
self.offset = int(ofs)
def GetFirstChildElement(node):
for elem in node.childNodes:
if elem.nodeType == elem.ELEMENT_NODE:
... |
from collections import defaultdict
from typing import Dict, List, DefaultDict, Tuple
from kivy.clock import Clock
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.popup import Popup
from core.common import OUTPUT_DEBUG, OUTPUT_ERROR
fr... |
from common.hgraph.hgraph import NonterminalLabel
from common import log
import itertools
# Some general advice for reading this file:
#
# Every rule specifies some fragment of the object (graph, string or both) that
# is being parsed, as well as a visit order on the individual elements of that
# fragment (tokens or e... |
import ynet
from util import *
from singa.layer import Conv2D, Activation, MaxPooling2D, AvgPooling2D, Flatten, Slice, LRN
from singa import initializer
from singa import layer
from singa import loss
from singa import tensor
import cPickle as pickle
import logging
import os
import numpy as np
from numpy.core.umath_te... |
#!/usr/bin/python
from string import Formatter
_STATS_TEMPLATE = '''#ifndef {INCLUDE_GUARD}
#define {INCLUDE_GUARD}
// clang-format off
#ifdef {MACRO_PREFIX}ON
{INCLUDES}
#include <iomanip>
#include <sstream>
#include <string>
#include <vector>
// comment out any stats you don't want, and thing... |
#!/usr/bin/env python
import os
import glob
import shutil
import pytest
import hypothesis.strategies as st
from hypothesis import given, settings
from radical.entk import Task
from radical.entk import states
import radical.entk.exceptions as ree
# Hypothesis settings
settings.register_profile("travis", ma... |
import pytest
import midas
import ke
import re
def assert_pattern(pattern, matches, not_matches=()):
if isinstance(pattern, str):
pattern = ke.compile(pattern)
for m in matches:
assert pattern.match(m), (pattern, m)
for m in not_matches:
assert not pattern.match(m), (pattern, m)
... |
import csv
from datetime import datetime, timedelta
import random
import string
import os
from os.path import expanduser
from pathlib import Path
from monitor.dbt_runner import DbtRunner
import click
any_type_columns = ['date', 'null_count', 'null_percent']
FILE_DIR = os.path.dirname(__file__)
def generate_date_ran... |
from termcolor import cprint, colored
# Reference: https://ufal.mff.cuni.cz/pdt/Morphology_and_Tagging/Doc/hmptagqr.html
# Morphodita online demo: http://lindat.mff.cuni.cz/services/morphodita/
categories = [
{'POS': 'Part of Speech'},
{'SUBPOS': 'Detailed Part of Speech'},
{'GENDER': 'Gender'},
{'NUM... |
"""
Utilities - CVPRO
BY: <NAME>
CODING HEAVEN
"""
import math
import time
import logging
import cv2
import numpy as np
import copy
def stackImages(_imgList, cols, scale):
"""
Stack Images together to display in a single window
:param _imgList: list of images to stack
:param cols: t... |
import argparse
import time
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
from dgl.nn.pytorch import GraphConv
import dgl.multiprocessing as mp
from torch.nn.parallel import DistributedDataParallel
import os
import sys
import samgraph.torch as sam
impo... |
# -*- coding: utf-8 -*-
import os
import uuid
import platform
import warnings
from pathlib import Path
from collections import defaultdict
from dataclasses import replace
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
from convergence import Convergence
from snl_d3d_cec_veri... |
import numpy as np
import torch
def fexp(x, p):
return torch.sign(x)*(torch.abs(x)**p)
def cuboid_inside_outside_function(X, shape_params, epsilon=0.25):
"""
Arguments:
----------
X: Tensor with size BxNxMx3, containing the 3D points, where B is the
batch size and N is the number... |
"""Contains the links that can be downloaded."""
from hashlib import sha1
import logging
import os
from pathlib import Path
import re
import warnings
from bs4 import BeautifulSoup
from requests import Response
import unidecode
from vcm.core.exceptions import AlgorithmFailureError, MoodleError, ResponseError
from vcm.... |
from __future__ import print_function
"""
Author: <NAME>
Email: <EMAIL>
Copyright 2016 <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... |
import datetime
import os, sys, six, base64, copy
from jinja2 import Environment, FileSystemLoader, Template
from google.auth.transport import requests
from google.cloud import datastore
from google.cloud import storage
from google.cloud import bigquery
import google.oauth2.id_token
from flask import Flask, render_t... |
import os
# os.environ["OMP_NUM_THREADS"] = "16"
import logging
logging.basicConfig(filename=snakemake.log[0], level=logging.INFO)
import pandas as pd
import numpy as np
# seak imports
from seak.data_loaders import intersect_ids, EnsemblVEPLoader, VariantLoaderSnpReader, CovariatesLoaderCSV
from seak.scoretest impo... |
# -*- coding: utf-8 -*-
"""
Part of slugdetection package
@author: <NAME>
github: dapolak
"""
import numpy as np
import pandas as pd
from datetime import datetime
import matplotlib.pyplot as plt
from pyspark.sql import functions as F
from pyspark.sql.window import Window
class Data_Engineering:
"""
Tools to ... |
from pathlib import Path
import pandas as pd
import numpy as np
import logging
#patching
import unittest
try:
# python 3.4+ should use builtin unittest.mock not mock package
from unittest.mock import patch
except ImportError:
from mock import patch
#app
import methylcheck
import methylprep
TESTPATH = 'te... |
#!/usr/bin/env python3
"""
usage: put under source folder, required files: evolving_state.txt, calib_state.txt, state.txt
After first run, integration_states.txt, vio_states.txt are generated and figures are saved in current dir
You can move the figures and state.txt, integration_states.txt, vio_states.txt into a fold... |
#!/usr/bin/env python3
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import os
import subprocess
from glob import glob
import pandas as pd
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
import base64
import json
import numpy as np
impor... |
"""
Writer for amber
"""
import time
import pandas as pd
import math
import re
import numpy as np
from collections import Counter
# Python 2/3 compat
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import eex
import logging
# AMBER local imports
from . import amber_metadata a... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from utils.torch_utils import *
class Content_Encoder(nn.Module):
def __init__(self, conv_dim=64, repeat_num=4, norm='in', activation='relu'):
super(Content_Encoder, self).__init__()
layers = []
... |
from utils import *
from mpmath import ellipe, ellipk, ellippi
from scipy.integrate import quad
import numpy as np
C1 = 3.0 / 14.0
C2 = 1.0 / 3.0
C3 = 3.0 / 22.0
C4 = 3.0 / 26.0
def J(N, k2, kappa, gradient=False):
# We'll need to solve this with gaussian quadrature
func = (
lambda x: np.sin(x) ** (... |
import numpy as np
import pandas as pd
import datetime
from okokyst_metadata import surveys_lookup_table
import os
import re
import glob
import gsw
from okokyst_tools import pressure_to_depth
encoding = "ISO-8859-1"
__author__ = '<NAME>'
__email__ = '<EMAIL>'
__created__ = datetime.datetime(2020, 9, 23)
__versi... |
from sympy.functions import sqrt, sign, root
from sympy.core import S, Wild, sympify, Mul, Add, Expr
from sympy.core.function import expand_multinomial, expand_mul
from sympy.core.symbol import Dummy
from sympy.polys import Poly, PolynomialError
from sympy.core.function import count_ops
def _mexpand(expr):
return ... |
import datetime
import os
import shutil
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.cache import cache
from django.db import transaction, IntegrityError
from django.db.models import Q, F
from django.http import FileResponse
from django.utils.encoding import escape_u... |
#!/bin/env python3
import sys
import argparse
import configparser
import docx
from docx import Document
from docx.shared import Pt, Inches
from docx.enum.dml import MSO_THEME_COLOR_INDEX
from docx.enum.section import WD_ORIENT, WD_SECTION
from datetime import datetime
from mediumroast.api.high_level import Auth as au... |
# coding: utf-8
#
# This code is part of lattpy.
#
# Copyright (c) 2021, <NAME>
#
# This code is licensed under the MIT License. The copyright notice in the
# LICENSE file in the root directory and this permission notice shall
# be included in all copies or substantial portions of the Software.
"""Spatial algorithms a... |
import copy
import queue
import pydot
class NZP:
def __init__(self):
self.names = ['-', '0', '+']
self.vals = [-1, 0, 1]
self.stationary = [False, True, False]
class ZP:
def __init__(self):
self.names = ['0', '+']
self.vals = [0, 1]
self.stationary = [True, Fa... |
# Figure 5 in https://arxiv.org/pdf/1909.13404.pdf (towards modular and programmable architecture search)
import sane_tikz.core as stz
import sane_tikz.formatting as fmt
frame_height = 9.5
frame_width = 10.0
frame_spacing = 0.2
frame_roundness = 0.6
frame_line_width = 4.5 * fmt.standard_line_width
module_height = 1.6... |
import glob
import os
import pandas as pd
import json
import ast
from tqdm import tqdm
import click
import pickle
from multiprocessing import Pool, cpu_count, Queue
from functools import partial
import itertools
import sys
sys.setrecursionlimit(15000)
import logging
logpath = "./tree_matches.log"
logger = loggin... |
# Copyright 2020 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, ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import os
import logging
from functions.et_helper import findFile,gaze_to_pandas
import functions.et_parse as parse
import functions.et_make_df as make_df
import functions.et_helper as helper
import imp # for edfread reload
im... |
# -*- coding: utf-8 -*-
import os
import argparse
import pathlib
import pickle
import shutil
import time
from functools import partial
import sys
sys.path.append('../')
from pathlib import Path
import fire
import numpy as np
import torch
import torch.nn as nn
import os
print(torch.__version__)
print(os.environ['PYTHONP... |
# Copyright 2021 The Pigweed 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
import random
import urllib.parse
import sqlite3
import asyncio
import aiohttp
import discord
from discord.ext import commands
import loadconfig
class fun(commands.Cog):
def __init__(self, bot):
self.bot = bot
async def cog_command_error(self, ctx, error):
print('Error in {0.comm... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.