text stringlengths 6.04k 39.5k |
|---|
import logging
from datetime import datetime
from django.db.models import Q
from django.shortcuts import get_object_or_404
from django.contrib.auth import get_user_model
from rest_framework.permissions import IsAuthenticated, IsAuthenticatedOrReadOnly
from rest_framework.exceptions import NotFound, PermissionDenied
fro... |
# Version: 3.0
# Data : 2019/03/21
# License : GPL
# USAGE: python3 polymer-generator.py
def backbone_generator():
import configparser
import os.path
if not os.path.exists('polymer_init.ini'):
raise IOError('sorry, you should generate init template first, by "polymer_generator.generate_lt()"')
... |
# encoding: utf-8
"""Test suite for pptx.chart.chart module"""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
import pytest
from pptx.chart.axis import CategoryAxis, DateAxis, ValueAxis
from pptx.chart.chart import Chart, ChartTitle, Legend, _Plots
from pptx.chart.data im... |
import re, html, nltk, os, argparse, time
from w3lib.html import replace_entities
from nltk.stem.porter import PorterStemmer
from math import log
from math import sqrt
from collections import Counter
# global variable
idx_table = {}
docu_table = {}
stop_words = set()
def dotAcronym(match):
temp = match.... |
# -*- coding: utf-8 -*-
"""
DEEP LEARNING FOR HYPERSPECTRAL DATA.
This script allows the user to run several deep models (and SVM baselines)
against various hyperspectral datasets. It is designed to quickly benchmark
state-of-the-art CNNs on various public hyperspectral datasets.
This code is released under the GPLv3... |
import functools
import numpy as np
import scipy.optimize as opt
from ..models import utils
TOL = 1e-8
EPS = 1e-12
MAX_PERM = 1e8
NUM_NULL = 10
class Core:
"""
Model core enables efficient computation of likelihood
and gradients by maintaining the current parameter state
Parameters
----------
... |
# SPDX-License-Identifier: GPL-2.0
#
# Parses test results from a kernel dmesg log.
#
# Copyright (C) 2019, Google LLC.
# Author: <NAME> <<EMAIL>>
# Author: <NAME> <<EMAIL>>
import re
from collections import namedtuple
from datetime import datetime
from enum import Enum, auto
from functools import reduce
from typing ... |
import subprocess
import traceback
import os
from typing import Dict, List, Union, Sequence
from pathlib import Path
import git
import pandas as pd
import numpy as np
import yaml
import gmhazard_utils as su
import gmhazard_calc
import project_gen as pg
from . import psha
EMPIRICAL_VERSION = "v21p10emp"
FLT_SITE_SOUR... |
import codecs
import itertools
import logging
import numpy as np
import os
import re
from bs4 import BeautifulSoup
from builtins import object
from builtins import range
from builtins import str
from collections import defaultdict
from lxml import etree
from lxml.html import fromstring
from pprint import pformat
from ... |
import itertools
import logging
from collections import defaultdict, namedtuple
from itertools import chain
from typing import Any, Dict, List, Tuple
import numpy as np
import torch
import torch.nn as nn
from sklearn.metrics import classification_report, accuracy_score
from rationale_benchmark.metrics import (
... |
#!/usr/bin/env python
# Filename: plot_results
"""
introduction: plot some statistic of the results
authors: <NAME>
email:<EMAIL>
add time: 28 October, 2017
"""
import os,sys
from optparse import OptionParser
import parameters
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid.axislines import Subplot
imp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import urllib3
import requests
import json
import grpc
import gigagenieRPC_pb2
import gigagenieRPC_pb2_grpc
import gkit
import os
import datetime
import hmac
import hashlib
import pyaudio
import audioop
from six.moves import queue
from... |
#!python3
# This file is a baseline python file
import os
import sys
import logging
import json
import shutil
def CreateHTMLdir(tmp_dir, html_display_files_dir):
"""
We create the HTML directory in the tmp dir.
We need to copy baseline files from html_display_files_dir to this directory
This is where... |
"""Script to parse models download from NMC portal and convert to NML2"""
# pylint: disable=F0401, C0325, W0603, R0914, R0912, W0602, E1103
import os
import sys
from pyneuroml.neuron import export_to_neuroml2
from pyneuroml.neuron.nrn_export_utils import clear_neuron
from pyneuroml.lems import generate_lems_file_for... |
from __future__ import annotations
from typing import Optional, List, Iterable
from collections import namedtuple
import logging
import threading
import binascii
from blatann.nrf import nrf_types, nrf_events
from blatann import gatt
from blatann.uuid import Uuid
from blatann.waitables.event_waitable import IdB... |
# coding: utf-8
from __future__ import unicode_literals
import random
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
from ..utils import (
ExtractorError,
int_or_none,
parse_age_limit,
parse_duration,
)
class NRKBaseIE(InfoExtractor):
_faked_ip = Non... |
"""
Mapping helpers
"""
import numpy as np
import pandas as pd
import scanpy as sc
import torch
import logging
from scipy.sparse.csc import csc_matrix
from scipy.sparse.csr import csr_matrix
from . import mapping_optimizer as mo
from . import utils as ut
# from torch.nn.functional import cosine_similarity
logg... |
#################################################################################
# SiEPIC Tools - metal_menu_helper #
#################################################################################
'''
Overview:
Functions to control the adding of pins to paths on metal ... |
import logging
import lzma
import pickle
import numpy as np
from .formats import read_corpus, fix_tid, read_corpus_with_babelfied_synset
CURRENT_DATASET_VERSION = 2
class LabelMapper(object):
def __init__(self, labels):
label_to_indices = {}
for i, e in enumerate(labels):
label_to_... |
"""Module for creating Cloudnet liquid water content file
using scaled-adiabatic method.
"""
import numpy as np
import numpy.ma as ma
from cloudnetpy import utils, output
from cloudnetpy.categorize import atmos, DataSource
from cloudnetpy.products import product_tools as p_tools
from cloudnetpy.metadata import MetaData... |
"""
Meters for the purpose of statistics tracking
<NAME> <<EMAIL>>
The Australian National University
Australian Centre for Robotic Vision
"""
import time
import torch
import multiprocessing
from torch import Tensor
from collections import deque
from typing import Optional, Iterable, Any, List, Union, Tuple
from ..... |
#!/usr/bin/env python3
import argparse
import datetime
import os
import logging
import json
import sys
import stat
from abc import ABC, abstractmethod
from urllib.parse import urljoin
from subprocess import Popen, PIPE, DEVNULL
from pathlib import Path
from typing import Optional, Dict, Any, List
from urllib3.util.re... |
#!/usr/bin/env python3
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "L... |
import time
import torch
from torch.autograd import Variable
from torch.nn.parameter import Parameter
import torch.nn as nn
import torch.optim as optim
import numpy as np
from transformer import Models
from transformer import Beam
from transformer import Translator
from transformer.Optim import ScheduledOptim
impor... |
import numpy as np
def normal_pdf(x, mu, cov, log=True):
"""
Calculate the probability density of Gaussian (Normal) distribution.
Parameters
----------
x : float, 1-D array_like (K, ), or 2-D array_like (K, N)
The variable for calculating the probability density.
mu : float or 1-D array... |
from email_validator import validate_email, EmailNotValidError
import requests
from openpyxl.worksheet.datavalidation import DataValidation
from openpyxl.utils import quote_sheetname, column_index_from_string
from openpyxl.styles import Font
from openpyxl.workbook.defined_name import DefinedName
from urllib.parse impo... |
"""
This module provides the `make_lrparser` function, which creates
a parser from a grammar in LR(k) form and return an object providing
a single function, `parse`. Most often, `k` is set to 1.
>>> g1 = Grammar(
... Rule('list', ()),
... Rule('list', ('list', 'item'))
... )
>>> p1 = ma... |
import torch
import torch.nn as nn
import lib.utils as utils
from lib.utils import get_device
from lib.encoder_decoder import *
from lib.base_models import VAE_Baseline
from torch.distributions.normal import Normal
class ME(nn.Module):
def __init__(self, dim):
super(ME, self).__init__()
self.fix ... |
# pip install pyannote.metrics
# pip install pyannote.pipeline
# pip install pescador
# pip install optuna
# pip install filelock
# pip install git+https://github.com/pyannote/pyannote-audio
import os
import argparse
import json
import torch
import torch.nn as nn
import torch.nn.functional as F
import audio
import mode... |
import argparse
# import matplotlib
# matplotlib.use('pdf')
import matplotlib
import numpy as np
import os
import pickle
import warnings
warnings.filterwarnings('ignore', category=FutureWarning)
import tensorflow as tf
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from collections import namedtuple
from itert... |
"""
Trust Region Step Calculation
-----------------------------
This module provides the machinery to calculate different trust-region(
-reflective) step proposals
"""
import numpy as np
import scipy.linalg as linalg
import scipy.sparse.linalg as slinalg
from numpy.linalg import norm
from scipy.sparse import csc_mat... |
import frappe
import json
from frappe.utils.background_jobs import enqueue
from frappe.utils.data import now, format_datetime
@frappe.whitelist(allow_guest=False)
def create_sales_invoice(**args):
"""
Decider whether it goes to backendjob or not.
"""
try:
requested_json = frappe.request.data.decode('... |
#!/usr/bin/env python
import time
import sys
import os
from optparse import OptionGroup, OptionParser
from datetime import datetime
from multiprocessing import Process, Pool
import subprocess as subprocess
from shlex import split
import pydpiper.queueing as q
import logging
import socket
import signal
import threading... |
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from flask import Flask, request
from flask_cors import CORS
import re... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
import frappe.defaults
from frappe.utils import flt, add_days, nowdate
from erpnext.buying.doctype.purchase_order.purchase... |
import warnings
from collections import namedtuple
from astropy.table import Table
from .utils import (Namespace, hide_null_values,
null_values, camel_case_split_and_lowercase)
# The format for a data type name looks like this:
# {sources}_{properties}_{statistic_type}[_{statistic_subtype}]
# ... |
from finngen_common_data_model.genomics import Locus, Variant
import attr
import uuid
from finngen_common_data_model.colocalization import Colocalization as BaseColocalization, \
CausalVariant as BaseCausalVariant
from finngen_common_data_model.genomics import Locus, Variant
rel = 123
@attr.s(frozen=True, slots=T... |
# coding: utf-8
# In[1]:
from contextlib import contextmanager
import sqlite3
import os
# In[2]:
@contextmanager
def db(db_filename='stock.db'):
conn = sqlite3.connect(os.path.join('..', 'data', db_filename), detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES)
cur = conn.cursor()
... |
#!/usr/bin/env python
'''
===============================================================================
Interactive Image Segmentation using GrabCut algorithm.
README FIRST:
Two windows will show up, one for input and one for output.
At first, in input window, draw a rectangle around the object using the
ri... |
"Create RDKit fingerprints"
# Copyright (c) 2010 <NAME> Scientific, AB (Gothenburg, Sweden)
# See the contents of "__init__.py" for full license details.
from __future__ import absolute_import
import os
import sys
import gzip
import rdkit
from rdkit import Chem
from rdkit.Chem import rdMolDescriptors
import rdkit.r... |
# coding: utf-8
from __future__ import with_statement, print_function, absolute_import
import math
import numpy as np
import torch
from torch import nn
from torch.autograd import Variable
from torch.nn import functional as F
from .modules import Embedding, _conv1x1_forward
from .modules import Conv1d1x1, ResidualCo... |
"""Meta-regression estimator classes."""
from abc import ABCMeta, abstractmethod
from inspect import getfullargspec
from warnings import warn
import numpy as np
import wrapt
from scipy.optimize import Bounds, minimize
from ..results import BayesianMetaRegressionResults, MetaRegressionResults
from ..stats import ensu... |
"""P4Python - Python interface to Perforce API
Perforce is the fast SCM system at www.perforce.com.
This package provides a simple interface from Python wrapping the
Perforce C++ API to gain performance and ease of coding.
Similar to interfaces available for Ruby and Perl.
"""
from __future__ import print_function
c... |
import logging
import random
from collections import defaultdict
from copy import deepcopy
from functools import partial
from multiprocessing import Pool
from typing import Any, Dict, Iterator, List, Optional, Sequence, Tuple
import numpy as np
from transformers import PreTrainedTokenizer
from benchmarker.data.data_c... |
# ---------------------------------------------------------------------------
# Unified Panoptic Segmentation Network
#
# Copyright (c) 2018-2019 Uber Technologies, Inc.
#
# Licensed under the Uber Non-Commercial License (the "License");
# you may not use this file except in compliance with the License.
# You may obtai... |
from warnings import warn
class ConflictingVersionWarning(Warning):
pass
_undefined_parent_error = RuntimeError('corrupted handlers in Storable')
class StorableHandler(object):
'''Defines how to store an object of the class identified by `_parent`.
Attributes:
version (tuple): version number.
... |
# vim:ts=4:sts=4:sw=4:expandtab
from django.core.management.base import BaseCommand, CommandError
import os
from sphinx.application import Sphinx
import sphinx.ext.autodoc
import shutil
import sys
from satori.ars.model import *
from docutils import nodes
from sphinx import addnodes
from sphinx.builders import BU... |
#!/usr/bin/env python3
"""
Based on:
https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html
https://blog.floydhub.com/long-short-term-memory-from-zero-to-hero-with-pytorch/
"""
import argparse
import copy
import functools
import math
import multiprocessing
import os
from os import path
import pickle
import... |
# --------------------------------------------------------
# DenseCap-Tensorflow
# Written by InnerPeace
# This file is adapted from Linjie and Xinlei's work
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
... |
### Follow nasbench, create a dataset, even only with a few data points.
import json
import logging
import os
import random
import IPython
import torch
import time
import numpy as np
import utils
from ..api import BenchmarkDatasetTemplate, _NumpyEncoder
from nasws.cnn.search_space.search_space import OpSpecTemplate, ... |
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 21 06:23:56 2018
@author: <NAME>, PhD (<EMAIL>)
"""
def generate_multimodal_data(centers = 3, mean_LB = 500, mean_UB = 1000,
max_cv = 0.05, seed = 0, size = 100):
'''
This function generates random multimodal data using gaussian ... |
from tkinter import *
from tkinter import ttk
from tkinter import messagebox
from tkinter import filedialog
instructions = {0x0:"cpy", 0x1:"swp", 0x20:"ld", 0x22:"ld.i", 0x23:"st", 0x31:"in", 0x30:"out",
0x4:"add", 0x5:"sub", 0x6:"and", 0xB:"ceq", 0x8:"clt", 0xA:"not", 0xD:"mul",
0xE:"d... |
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
import datetime
# Structure based on National Nutrient Database for Standard Reference
# source: https://www.ars.usda.gov/Services/docs.htm?docid=8964
# Based on Table 4 - Food Description File
# /... |
#!/usr/bin/env python
"""Ingest Generic Database tables using multi-value insert statements and multiprocessing.
Usage:
%s <configFile> <inputFile>... [--fileoffiles] [--table=<table>] [--tableDelimiter=<tableDelimiter>] [--bundlesize=<bundlesize>] [--nprocesses=<nprocesses>] [--nfileprocesses=<nfileprocesses>] [--l... |
import asyncio
import functools
from ..errors import (ConnectionClosedError, MultiExecError, PipelineError,
RedisError, ReplyError)
from ..util import _set_exception, get_event_loop
from .util import parse_cluster_response_error
class InvalidPipelineOperation(RedisError):
"""
Raised whe... |
from typing import ByteString, Any
import ctypes
import os
import secrets
import hashlib
from . import fe
# path to the share library file libsodium
# we require a custom version which also exports the function crypto_core_ed25519_scalar_mul
LIBSODIUM_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "... |
## @ingroup Methods-Weights-Correlations-FLOPS
# wing.py
#
# Created: May 2020, <NAME>
# Modified: Aug 2021, <NAME>
# ----------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------
import SUAVE
from SUAVE.Core import Units
imp... |
# -*- coding: utf-8 -*-
"""
.. moduleauthor:: <NAME> (<EMAIL>, <EMAIL>)
"""
import gc
import json
import os
import re
import time
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from .shared import unpickle_file, apply_cyclic_transform
class DuplicateColumnName(Exception):
pass
class... |
"""Highway assignment and skim component.
Performs equilibrium traffic assignment and generates resulting skims.
The assignmend is configured using the "highway" table in the source config.
See the config documentation for details. The traffic assignment runs according
to the list of assignment classes under highway.... |
# coding: utf-8
import numpy as np
from rcwa.common import matmul, redheffer_star_prod, get_input
from rcwa.source import Source
from rcwa.structure import PeriodicStructure
class Harmonics():
'''Keeps track of Fourier expansion paramters'''
def __init__(self, input_toml):
# number of spatial harmonic... |
# -*- coding: utf-8 -*-
"""
A module containing NodeEditor's class for representing Socket and Socket Position Constants.
"""
import math
from time import sleep
from qtpy.QtGui import *
from qtpy.QtCore import *
from qtpy.QtWidgets import *
from collections import OrderedDict
from nodeeditor.node_serializable import ... |
from django.shortcuts import render, redirect
from django.utils.http import urlencode
from django.contrib import messages
from child.models import Child
from project.models import Project
from .forms import DonorForm, DonationForm, DonationWithinProjectForm
from django.urls import reverse
from django.contrib.auth.model... |
#!/usr/bin/env python3
import argparse
import yaml # requires pip3 install pyyaml
import json
from json import JSONDecodeError
import pytest
import datetime
import dateutil
import dateutil.parser
import traceback
from dateutil import relativedelta
import sys
import warnings
import os
from os import access, R_OK, W_OK... |
## This file alters the game described in new_simpy_fire_smdp.py
# Here, agents receive a local observation (location,strength,status,interest) for 5 closest fires
# Also, each fire gets random number of UAV-minutes needed to extinguish it, where the mean is a
# function of fire level
# Rewards are equal to the fire l... |
#!/usr/bin/env python3
from auto.config import ARM, GOPTS, RV32, SBT, TOOLS, X86
from auto.utils import cat, path, unique
class ArchAndMode:
def __init__(self, farch, narch, mode=None):
self.farch = farch
self.narch = narch
self.mode = mode
# get arch prefix string
def prefix(self... |
from picamera.array import PiRGBArray
from picamera import PiCamera
import numpy as np
import cv2 as cv
from scipy.spatial.distance import cdist
import scipy.io as spio
from scipy.optimize import linear_sum_assignment
import subprocess
from collections import defaultdict
import time
import socket
import random
from plo... |
# Deep-Q-Network (DQN) model for self driving car
import os
import random
from torch import cat
from torch import load
from torch import save
from torch import Tensor
from torch import LongTensor
from torch.nn import Linear
from torch.nn import Module
from torch.nn.functional import relu
from torch.nn.functional imp... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 9 21:54:49 2021
@author: dejan
"""
import numpy as np
import scipy.ndimage as nd
from visualize import NavigationButtons
from matplotlib import pyplot as plt
from matplotlib.widgets import Slider
import scipy
from scipy.ndimage import median_filter... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
管理应用程序生命期、全局对象、任务、全局消息响应
"""
import itertools
import logging
import os
import re
import signal
import subprocess
import sys
import time
from pathlib import Path
from typing import Any, Callable, List, Union
import aioredis
import asyncpg
import cfg4py
import fire
impo... |
# +
from theforce.regression.gppotential import PosteriorPotential, PosteriorPotentialFromFolder
from theforce.calculator.posterior import AutoForceCalculator
from theforce.descriptor.atoms import AtomsData, LocalsData, TorchAtoms
from theforce.util.util import date, class_of_method, iterable
import torch
import ase
fr... |
import os
import cv2
from skimage import io
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import argparse
import segmentation_models_v1 as sm
from segmentation_models_v1 import Unet, Linknet, PSPNet, FPN, AtUnet
from helper_function import plot_history_flu, plot_set_prediction, generate_fo... |
from html.parser import HTMLParser
from bs4 import BeautifulSoup
import urllib.parse
import re
from statistics import median, mean
import lexicutils
def makeBeautifulSoup(html):
soup = BeautifulSoup(html, 'html.parser')
return soup
def countScriptTags(soup):
return len(soup.find_all('script'))
def coun... |
import os
import pytorch_lightning as pl
from transformers import BertModel, BertConfig
from transformers import AdamW, get_linear_schedule_with_warmup
import torch.distributed as dist
import metric_utils
from emb_utils import *
class CovidTwitterMisinfoModel(pl.LightningModule):
def __init__(
self, pre_model_... |
""" This file contains most of the graphing for the suburbs analysis. It does not rely on raw parcel data, but the
cached versions instead."""
import numpy as np
import pandas as pd
import geopandas as gpd
import folium
from plotnine import *
from ..utilities import measurements
from ..data_processing import boundari... |
# codeing: utf-8
import argparse, tarfile
import math
import os
import numpy as np
import logging
import json
import datetime
import io
import mxnet as mx
import mxnet.ndarray as F
import codecs
import itertools
import gluonnlp as nlp
import functools
import warnings
from gluonnlp.base import numba_njit
from gluonnlp.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import copy
import json
import os
import shutil
from collections import defaultdict
import numpy as np
from torsiondrive.dihedral_scanner import DihedralScanner, get_geo_key, measure_dihedrals
from torsiondrive.priority_queue import ... |
"""
Simple parser for LaTeX math expression (capture commands).
Grammar:
```
BSLASH := '\' ;
LCB := '{' ;
RCB := '}' ;
LSB := '[' ;
RSB := ']' ;
DOWN := '_' ;
UP := '^' ;
escaped_char := BSLASH (BSLASH | LCB | LSB) ;
char_m := (CHAR \ { BSLASH | LCB | RCB | UP | DOWN }) | escaped ;
word := [a-zA-Z]* ;
string := char... |
# Copyright (c) 2016, <NAME>
# Licensed under MIT
import time
import math
from kervi.hal import I2CSensorDeviceDriver
I2C_GYRO_ADDRESS = 0x6A
I2C_ACCL_ADDRESS = 0x1e
MAG_X_MAX = 419
MAG_Y_MAX = 683
MAG_Z_MAX = 528
MAG_X_MIN = -658
MAG_Y_MIN = -397
MAG_Z_MIN = -472
MAG_LPF_FACTOR = 0.4
ACC_LPF_FACTOR = 0.1
RAD_TO_D... |
import numpy as np
from collections import defaultdict
import math
from scipy.spatial.distance import cdist
from cplex import Cplex
import time
import random
#np.random.seed(0)
#random.seed(0)
def iterative_rounding_lp(df, centers, distance, color_flag, res):
num_points = len(df)
num_centers = len(centers)
... |
from asyncio import gather, sleep
from collections import defaultdict
from contextlib import closing, contextmanager
from datetime import datetime, timedelta
from itertools import chain
from logging import getLogger
from discord import Colour, Forbidden, HTTPException, Member, PermissionOverwrite, Role
from discord.ex... |
"""Module containing methods for parsing GEDCOM files.
"""
__all__ = ['GedcomReader', 'ParserError', 'CodecError', 'IntegrityError',
'guess_codec', 'GedcomLine']
import codecs
import io
import logging
import re
from typing import List, NamedTuple, Optional
from .detail.io import check_bom, guess_lineno, B... |
# -*- coding: utf-8 -*-
# © 2016 <NAME> <<EMAIL>>, Trustcode
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from datetime import datetime
from random import SystemRandom
from odoo.addons import decimal_precision as dp
from odoo import api, models, fields
from odoo.exceptions import UserError
cl... |
import logging
import re
import time
import warnings
import nltk.data
import numpy as np
import pandas as pd
import sklearn
from bs4 import BeautifulSoup
from gensim.models import KeyedVectors, word2vec
from nltk.corpus import stopwords
from sklearn import metrics
from sklearn import naive_bayes, svm, preprocessing
fr... |
"""
Description:
-----------
This script hosts many helper functions to make notebooks cleaner. The hope is to not distract users with ugly code.
Alot of these were sourced from Dr. Lagerquist and found originally in his gewitter repo (https://github.com/thunderhoser/GewitterGefahr).
"""
#additional libraries need... |
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
from dataclasses import dataclass
from enum import Enum
from functools import partial
from operator import eq
from typi... |
# Copyright (c) <NAME>, ArChip Lab.
# This source code is licensed under the Apache 2.0 license found in the
# LICENSE file in the root directory of this source tree.
import torch
import argparse
import time
import os
import sys
import math
import torch.nn as nn
import config as cfg
from tqdm import tqdm
from mypat... |
import argparse
import os
import logging
import time
import sys
import shutil
import subprocess
from types import SimpleNamespace
from collections import namedtuple
import datetime
import filecmp
import copy
def is_media_file(filename, args):
img_exts = [".jpg", "jpeg", ".png", ".cr2", ".bmp", ".tif"]
vid_exts... |
# -*- coding: utf-8 -*-
"""
Created on Sun May 2 2021
@name: Greatschools Pages Download Application
@author: <NAME>
"""
import sys
import os.path
import warnings
import logging
import traceback
import regex as re
from abc import ABC
MAIN_DIR = os.path.dirname(os.path.realpath(__file__))
MOD_DIR = os.path.abspath(... |
import pickle as pickle
import sys
import os
import re
import types
import shutil
import string
import urllib.request
import urllib.parse
import urllib.error
import time
import traceback
import urllib.request
import urllib.error
import urllib.parse
import http.client
from subprocess import *
from xml.parsers.expat impo... |
'''
Source: https://github.com/JesseCorrington/binance-api-python/blob/master/binance.py
'''
import urllib.request
import urllib.parse
import json
import datetime
import hmac
import hashlib
import time
import asyncio
import websockets
from decimal import Decimal
from collections import namedtuple
__URL_BASE = "https:... |
import pandas as pd
import datetime as dt
from scipy.interpolate import interp1d
from trios.utils.sunposition import sunpos
from trios.config import *
class awr_data:
'''
Above-water radiometry
'''
def __init__(self, idpr=None, files=None, Edf=None, Lskyf=None, Ltf=None):
# ''' get file name... |
#! /usr/bin/python3
# Copyright 2012, 2013 <NAME> <<EMAIL>>.
# Use, modification, and distribution are subject to the
# Boost Software License, Version 1.0. See the file LICENSE
# or http://www.boost.org/LICENSE_1_0.txt for detailed terms.
# This program will compile cxxfmt once for each compiler you like and
# test... |
import sys
import argparse
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as st
import pandas as pd
from scipy import interpolate
from scipy.spatial import Delaunay
from sklearn.model_selection import train_test_split
from sklearn.model_selection import KFold
from ATE import UniformSamplingStrat... |
# Copyright 2021 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <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 applicab... |
#!/usr/bin/env python
"""
.. module:: pulley-system
:synopsis: The pulley-system function.
.. moduleauthor:: <NAME>
"""
import math
import numbers
import numpy
import opensdraw.lcad_language.belt as belt
import opensdraw.lcad_language.curveFunctions as curveFunctions
import opensdraw.lcad_language.geometry as ge... |
import torch
import torch.nn as nn
import torch.utils.data as Data
import torchvision.transforms as transforms
import torch.nn.functional as f
from torch.autograd import Variable
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from mat... |
from sklearn import svm
from sklearn.externals import joblib
import sys
sys.path.append('../')
from scripts import inference
from models.CAE import CAE_encoder
from utils import util
import os
import argparse
import numpy as np
import pickle
import time
from utils import evaluate
# prefix = '/data/jiachang/'
# if not... |
import pandas as pd
import math as m
import numpy as np
from scipy.spatial import distance_matrix
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.ensemble import RandomForestClassifier
def get_aa_distr():
aa = [
"A",
"C",
"D",
"E",
"F",
"G",
... |
""" Handles options for PyVOL. Reads configuration files and objects and converts them to option dictionaries and then back again. Accepts and parses string input for all parameters from commandline/gui inputs. """
from . import utilities
import configparser
import logging
import numpy as np
import os
import re
impor... |
#!/usr/bin/env python
"""Randomly Generate Silhouette from Pieces.
Usage:
program <input_json> <output_dir> [-n <n>]
[--no_image] [--skip_overwrap_check]
[--discard_overwrap]
Options:
<input_json> json file of silhouette puzzle
<output_dir> output directory. create if not exist.
-n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.