text stringlengths 6.04k 39.5k |
|---|
import flask
from flask import Flask
from flask import render_template
from flask import request
import logging
import uuid
# Date handling
import arrow # Replacement for datetime, based on moment.js
from dateutil import tz # For interpreting local times
# OAuth2 - Google library implementation for convenience
fr... |
import vim
import os
import re
import subprocess
import xml.etree.ElementTree as ET
import signal
from collections import deque
import vimbufsync
vimbufsync.check_version("0.1.0", who="coquille")
#: Pipe used to discuss with coqtop
coqtop = None
#: See vimbufsync ( https://github.com/def-lkb/vimbufsync )
saved_syn... |
# -*- coding: utf-8 -*-
# 2022-02-25 - Python 3 remove maxint - replaced by maxsize - https://stackoverflow.com/a/13795777
from kivy.uix.widget import Widget
from kivy.clock import Clock
from kivy.graphics import Color, Callback, Rotate, PushMatrix, PopMatrix, Translate, Quad
from kivy.graphics.opengl import glBlendF... |
# This Python module is part of the PyRate software package.
#
# Copyright 2021 Geoscience Australia
#
# 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 subprocess
import os
import errno
from itertools import groupby
import logging
import shutil
import time
import xmltodict
from arteria.exceptions import ArteriaUsageException
from bcl2fastq.lib.illumina import Samplesheet
log = logging.getLogger(__name__)
class Bcl2FastqConfig:
"""
Container for c... |
import argparse
import datasets as nlp
import sys
import os
import openai
import csv
import random
import time
from tqdm import tqdm
import ast
from datetime import datetime
import git
import copy
import itertools
import jsonlines
"""
Usage: python get_cose_gpt3_completion_accuracy.py [task_type] [model_engine] [num_s... |
# Copyright (c) 2020-2022, NVIDIA 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 agre... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ### ### ### ###... |
from __future__ import annotations
import math
import os
import logging
import pathlib
import threading
from collections import defaultdict
from dataclasses import dataclass
from tempfile import TemporaryFile
from typing import List, Optional, Union, Tuple, Dict, Generator, IO, Callable
from .tools import (
gener... |
#!/usr/bin/python
# _*_ coding: utf-8 _*_
"""
@author: <NAME>, <EMAIL>
@github: https://github.com/sunnymarkLiu
@time : 2019/4/9 11:51
"""
import itertools
import json
import sys
import zipfile
sys.path.append('../')
from check.metric.bleu import BLEUWithBonus
from check.metric.rouge import RougeL
from nltk.translat... |
# coding: utf-8
from os import path
import toml
import typing
from rolling.action.base import ActionDescriptionModel
from rolling.action.utils import fill_base_action_properties
from rolling.exception import ConfigurationError
from rolling.game.stuff import StuffManager
from rolling.game.world import WorldManager
from... |
import time, array, random, copy, math
import pandas as pd
import numpy as np
from math import sqrt
from deap import algorithms, base, creator, gp, benchmarks, tools
from deap.benchmarks.tools import diversity, convergence, hypervolume
from deap.tools import History
import json, codecs
import csv
from functions import... |
import random
from prop import AtomForm, NegForm, ConForm, DisForm, ImpForm, Form
# region generation procedure from DEEP LEARNING FOR SYMBOLIC MATHEMATICS
def memoize(f):
cache = {}
def decorate(*args):
if args in cache:
return cache[args]
else:
cache[args] = f(*arg... |
# Copyright (C) 2016 The Regents of the University of Michigan
#
# 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.
#
# ... |
# re-write of the dosleg parser to have
# the same output as senapy
import sys
import re
from urllib.parse import urljoin
import dateparser
from bs4 import BeautifulSoup
from lawfactory_utils.urls import clean_url, download, parse_national_assembly_url, AN_OLD_URL_TEMPLATE
from anpy.dossier_from_opendata import par... |
from __future__ import annotations
import re
from copy import copy
from dataclasses import dataclass
from functools import partial
import numpy as np
import pandas as pd
import matplotlib as mpl
from matplotlib.ticker import (
Locator,
Formatter,
AutoLocator,
AutoMinorLocator,
FixedLocator,
Lin... |
import tensorflow as tf
import tensorlayer as tl
import helpers
def focal_lossIII(prediction_tensor,
target_tensor,
weights,
gamma=2.,
epsilon=0.00001,
):
"""Compute loss function.
This function was adapted from the Ten... |
# -*- coding: utf-8 -*-
import time
import numpy as np
from numpy import transpose as tr
from numpy.linalg import inv
from scipy.linalg import pinvh
from scipy.special import logsumexp
from scipy.special import psi, gammaln
from sklearn.utils import check_array
from sklearn.cluster import KMeans
from sklearn.decomposit... |
from numba import cuda
from numba.cuda.random import create_xoroshiro128p_states, xoroshiro128p_uniform_float32
import numpy as np
import numba
import math
import time
@cuda.jit
def rand_weights(rng_states, d_weights):
"""
Kernel para inicializar aleatoriamente la 'matriz' de pesos con valores
... |
# * The MIT License (MIT) Copyright (c) 2017 by <NAME>.
# * The formulation and display of an AUdio Spectrum using an ESp8266 or ESP32 and SSD1306 or SH1106 OLED Display using a Fast Fourier Transform
# * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated docu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from anki.hooks import wrap
from anki.media import MediaManager
from aqt.utils import tooltip, showWarning
from aqt.editor import Editor, EditorWebView
from aqt import mw
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4.QtWebKit import *
import os
import p... |
# AMZ-Driverless
# Copyright (c) 2019 Authors:
# - <NAME> <<EMAIL>>
#
# 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,... |
from __future__ import print_function
import argparse
import os, sys, subprocess, json, re
def run(*args, **kwargs):
# use the current environment, but override the vars the caller
# specified
env = os.environ.copy()
env.update(kwargs.get('env', {}))
ret = subprocess.call(args, stdout=sys.stdout,... |
from django.core.exceptions import ValidationError
import string
import ipaddr
def do_zone_validation(domain):
"""Preform validation on domain. This function calls the following
functions::
check_for_soa_partition
check_for_master_delegation
validate_zone_soa
.. note::
T... |
#!/usr/bin/python3
import werobot
from html import unescape
from lxml import html, etree
from werobot.replies import ArticlesReply, Article,TextReply
from werobot.utils import cached_property
import json,sys,os,time,re
import warnings,logging
import threading,subprocess
import random,requests
import MyDB
import MyLocat... |
import pandas as pd
import networkx as nx
import numpy as np
import os
import random
'''
code main goal: make a graph with labels and make a knowledge-graph to the classes.
~_~_~ Graph ~_~_~
Graph nodes: movies
Graph edges: given 2 movies, an edge determined if a cast member play in both of the movies.
Label: the genre... |
from datetime import datetime
import itertools
import string
from decimal import Decimal
import re
import dateutil.parser
from gogapi.contentsystem import Build, SecureLinkV2
from gogapi.download import Download
from gogapi.normalization import normalize_system, normalize_language
from gogapi.base import GogObject, M... |
# .. coding: utf-8
# $Id: __init__.py 8854 2021-10-15 16:03:31Z milde $
# :Author: <NAME> <<EMAIL>>
# Based on the html4css1 writer by <NAME>.
# :Maintainer: <EMAIL>
# :Copyright: © 2005, 2009, 2015 <NAME>,
# portions from html4css1 © David Goodger.
# :License: Released under the terms of the `2-Cl... |
# -*- coding: utf-8 -*-
""" # Idle/Jupyter Startup File
Defines functions for use in `IDLE`, but so far they seem to work in `python3`,
`iPython`, `IDLE`, and `jupyter`.
They WON'T work in Python 2! Hopefully this won't cause problems when
PYTHONSTARTUP is set to this file's path, but it may very well... |
__author__ = 'DGriffith, ARamkilowan'
"""
.. module:: electro
:synopsis: Realises electronic components in the imaging chain of a remote sensing or surveillance system.
- Detectors and focal plane arrays
- Image processing modules
- Displays
"""
import numpy as np
import pandas as pd
impo... |
import os
import json
import argparse
import logging
from pathlib import Path
import time
from typing import Tuple
import pandas as pd
import numpy as np
import tqdm
from melloddy_tuner.utils import hash_reference_set
from melloddy_tuner.utils.helper import (
load_config,
load_key,
make_dir,
read_input... |
#!/usr/bin/env python
#
# Copyright 2014 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 require... |
import tensorflow as tf
import time
from MODEL.model_clam import S_CLAM, M_CLAM
from UTILITY.model_train import train_step
from UTILITY.model_val import val_step
from UTILITY.model_test import test_step
from UTILITY.util import model_save, restore_model, tf_shut_up, str_to_bool
def train_val(train_log, val_log, trai... |
import tensorflow as tf
import tensorflow.keras as ks
from kgcnn.ops.partition import change_partition_by_name, partition_row_indexing
from kgcnn.layers.base import GraphBaseLayer
@tf.keras.utils.register_keras_serializable(package='kgcnn',name='PoolingTopK')
class PoolingTopK(GraphBaseLayer):
"""Layer for pooli... |
from datetime import datetime
from pathlib import Path
from .common import run_prepare_cli, check_prepare_outputs
from eodatasets.prepare import ls_usgs_l1_prepare
from eodatasets.prepare.ls_usgs_l1_prepare import normalise_nci_symlinks
L71GT_TARBALL_PATH: Path = Path(__file__).parent / 'data' / 'LE07_L1GT_104078_201... |
import gym
import time
import os
import sys
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from gym import wrappers
from gym.wrappers.monitoring import stats_recorder, video_recorder
from datetime import datetime
import tensorflow as tf
import random
from sklearn.preprocessin... |
"""
Heads are build on Brains.
Like in real life, heads do all the difficult part of receiving stimuli,
being above everything else and not falling apart.
You take brains out and they just do nothng. Lazy.
The most common use case is when one head contains one brain.
But who are we to say what you can and cannot do.
Yo... |
""" Functions for working with VCF files. Each function either takes a VCF or
a line from a VCF file
<NAME>
"""
from itertools import cycle
import functools
import numpy as np
import pandas as pd
from .genotype import Genotype
def parse_chr(entry):
try:
chrom = int(entry.lstrip("chr"))
return(c... |
# Adapted from CIFAR-10 training example at https://github.com/kuangliu/pytorch-cifar
'''Train CIFAR10 with PyTorch.'''
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import logging
import torchvision
import torchvision.transforms as ... |
# Copyright (c) 2006-2013 Regents of the University of Minnesota.
# For licensing terms, see the file LICENSE.
import lxml.etree as et
import math
import conf
import g
from grax.access_level import Access_Level
from item.feat import byway
from item.grac import group
from item.util.item_type import Item_Type
from uti... |
# -*- coding: utf-8 -*-
# BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis Modules
# Copyright (C) 2020-2021, <NAME> <<EMAIL>>
#
# This module is under the UIUC open-source license. See
# github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LICENSE.txt
# for license details.
"""
General functiona... |
# -*- coding: utf-8 -*-
# =================================================================
# uspec
#
# Copyright (c) 2020 <NAME>
#
# This software is released under the MIT License.
# http://opensource.org/licenses/mit-license.php
# =================================================================
from __future__ im... |
"""
imports
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from PySide import QtCore, QtGui
from PySide.QtCore import Qt
from mcedit2.handles.boxhandle import BoxHandle
from mcedit2.rendering.depths import DepthOffsets
from mcedit2.rendering.scenegraph.matrix i... |
import numpy as np
import torch
from torch.nn import Linear, Module, Parameter, ReLU, Sequential
from torch.nn.functional import cross_entropy
# from torch.nn import functional
from torch.optim import Adam
# from torch.utils.data import DataLoader, TensorDataset
from torchsummary import summary
from ctgan.transformer ... |
import sys
from draw import *
import random
import json
# GAME RULES
# 1)Any live cell with fewer than two live neighbours dies, as if by underpopulation.
# Default is UNDER_THRESH = 2
# 2)Any live cells that does not die due to underpopulation or overpopulation remains alive.
# 3)Any live cell with more than three... |
# -*- coding: utf-8 -*-
import sys
import os
import time
from time import sleep
###########################################################################
## Python code generated with wxFormBuilder (version Oct 26 2018)
## http://www.wxformbuilder.org/
###############################################################... |
import numpy as np
from config.config import *
from lib.machinelearning import feature_engineering, feature_engineering_raw, get_label_for_directory, get_highest_intensity_of_wav_file, get_recording_power
import pyaudio
import wave
import time
import scipy
import scipy.io.wavfile
import hashlib
import os
import operato... |
# Python std library
import os
import os.path
# Google Sheets API
import pickle
import random as rd
import urllib.parse
# Django
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.views import View
from google.auth.transport.requests import Request
from google_a... |
# Log processor, extracts timings and memory consumption stats
#
#
import argparse
import logging
import re
import json
import collections
import coloredlogs
logger = logging.getLogger(__name__)
coloredlogs.CHROOT_FILES = []
coloredlogs.install(level=logging.INFO, use_chroot=False)
# Data collected by calling diag(... |
import tkinter as tk
#--------------------------------------------Escritura------------------------------------------
def remove_sobrenome_pequeno(nome, sobrenomes):
"""Se a pessoa tiver um sobrenome menor que quatro letras, este sobrenome será removido para ser escrito aparte.
Arguments:
nome {st... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) 2002-2018 "Neo4j,"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
# 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 L... |
import queue
import numpy as np
import cv2
import dlib
import requests
from typing import Union
import pathlib
from queue import Queue
import threading
import multiprocessing
import time
import timeit
def rect_to_np(rect, dtpye=np.int32):
x1 = rect.left()
y1 = rect.top()
x2 = rect.right()
y2 = rect.... |
# Import python modules
import numpy
import kaggle
import torch
import autograd
import autograd.numpy as np
from autograd.misc import flatten
import matplotlib.pyplot as plt
import plotly.graph_objects as go
import time
from sklearn.metrics import accuracy_score
from sklearn.tree import DecisionTreeClassifier
from skle... |
# Copyright 2019 Jetperch 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,... |
#Last updated to be useful for: Anki 2.1.11
from anki.lang import _
from aqt import mw
from aqt.qt import *
from anki.hooks import runHook,addHook
from anki.lang import _
from aqt.utils import showWarning
from aqt.toolbar import Toolbar
from aqt.editor import Editor,EditorWebView
from aqt.reviewer import Reviewer
from ... |
import keyboard
import time
import sys
import random
from utils import clear
from utils import GoBack
from utils import User
from rich import print
from rich.console import Console
from rich.align import Align
from rich.prompt import Prompt
from rich.panel import Panel
from rich.layout import Layout
from rich.text impo... |
from itertools import groupby
import numbers
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from models.layers.meta_sequential import MetaSequential
from models.layers.meta_patch import MetaPatchConv2d, make_meta_patch_conv2d_block
class HyperGen(nn.Module):
""" Hypernetwork... |
import cv2
import random
import numpy as np
from . import functional as F
from ...core.transforms_interface import DualTransform, to_tuple
__all__ = ["ShiftScaleRotate", "ElasticTransform", "Perspective"]
class ShiftScaleRotate(DualTransform):
"""Randomly apply affine transforms: translate, scale and rotate the... |
import h5py as hp
import numpy as np
import pandas as pd
import argparse, sys, os
import matplotlib.pyplot as plt
class PlotOptions:
def __init__(self, dictIn=None):
if dictIn:
self.__dict__.update(dictIn)
else:
self.resetDefaults()
def resetDefaults(self):
... |
# # Copyright (c) 2019-present, HuggingFace Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import logging
import random
from argparse import ArgumentParser
from itertools import chain
from pprint import pforma... |
#!/usr/bin/env python
from __future__ import print_function
import logging
LOG_FORMAT = '%(asctime)s %(levelname)s %(pathname)s:%(lineno)s: %(message)s'
logging.basicConfig(format=LOG_FORMAT, level=logging.DEBUG)
import os
import signal
import sys
import six
import threading
import time
import pprint
import psutil
i... |
from __future__ import absolute_import, division, print_function
from cctbx.array_family import flex
from iotbx.cif import builders, model, errors
import libtbx.load_env
from libtbx import smart_open
import copy
import os
import shutil
import re
import sys
from six import string_types
from six.moves.urllib.request impo... |
from copy import deepcopy
from logging import getLogger
import joblib
import numpy as np
import sklearn
import xarray as xr
from replay_trajectory_classification.bins import (atleast_2d, get_centers,
get_grid, get_track_grid,
... |
import torch
import torch.nn as nn
from torch.nn import init
import functools
def weightsInit(layer):
classname = layer.__class__.__name__
if classname.find('Conv') != -1:
init.xavier_normal(layer.weight.data, gain=1)
elif classname.find('Linear') != -1:
init.xavier_normal(layer.weight.data... |
import numpy as np
from scipy import ndimage
import tifffile as tiff
import matplotlib.pyplot as plt
import pandas as pd
from enum import Enum
from skimage.transform import resize
# Worldview-3 - Panchromatic (3349, 3338): 400nm - 800nm
# Worldview-3 RGB (3350, 3338)
# Worldview-3 - 8 Multispectral bands (838, 835):... |
import math
from collections import OrderedDict
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
import sys
from pathlib import Path
root_dir = (Path(__file__).parent / '..' / '..' ).resolve()
if str(root_dir) not in sys.path:
sys.path.insert(0, str(root_dir))
__all__ = [
'm... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
import json
import logging
import os
import re
from decimal import Decimal
from django.core.cache import cache
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.db.models.aggregates import Count
from django.db.models.expressions import Subquery, Value
from django.db.models.functions.co... |
"""
Test module that executes the external S3 Tests.
The purpose of this test module is to execute the test suites available @
https://github.com/ceph/s3-tests. Over here, we have three stages
- Test Setup
- Execute Tests
- Test Teardown
In the test setup stage, the test suite is cloned and the necessary... |
from . import common as common
from .settings import CONVERT_URL, PROJECT_DIRECTORY
from . import display, schema, settings
from ccl_scratch_tools import Parser, Scraper
from datetime import datetime, timedelta
from math import inf
import celery.decorators
import jinja2
import json
import logging
import mongoengine as ... |
import numpy as np
from . import _pisathon
import json
import shutil
import sys
import pandas as pd
from pathlib import Path
import tempfile
import os
import more_itertools
import threading
from warnings import warn
from typing import Optional, Union, List
from enum import Enum
from collections import Counter
import py... |
from TokenType import TokenType
from Environment import Environment
from Errors import *
from Kobe import Kobe
from Structures import *
from Functions import *
kobes = []
glob_env = Environment()
glob_env.loadFunction("randi", RandInt())
glob_env.loadFunction("randf", RandFloat())
cur_env = glob_env
d... |
"""
This module solves for the orbit of the planet given Keplerian parameters.
"""
import numpy as np
import astropy.units as u
import astropy.constants as consts
from orbitize import cuda_ext, cext
if cext:
from . import _kepler
if cuda_ext:
# Configure GPU context for CUDA accelerated compute
from orbi... |
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import QFile
from PythonMessage import WhatMsg
import webbrowser
import keyboard
import time
import qdarkstyle
# Arayüz Kodu
class Ui_WP_AutoSender_by_Altemur_v1_3_1(object):
def setupUi(self, WP_AutoSender_by_Altemur_v1_3_1):
# Programımızın ad... |
from utils import *
from math import floor
import os
os.environ['OPENBLAS_NUM_THREADS'] = '1' # https://stackoverflow.com/a/57549064
import numpy as np
row_units = [cross(r, cols) for r in rows]
column_units = [cross(rows, c) for c in cols]
square_units = [cross(rs, cs) for rs in ('ABC','DEF','GHI') for cs in ('123'... |
import os
import json
import torch
import threading
import numpy as np
from functools import partial
from PyQt5 import QtWidgets
import matplotlib.pyplot as plt
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as Navigat... |
import io
from freezegun import freeze_time
import pytest
import json
from CommonServerPython import DemistoException, EntryType, EntryFormat
from datetime import datetime
from SaasSecurity import Client
import demistomock as demisto
def util_load_json(path):
with io.open(path, mode='r', encoding='utf-8') as f:
... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import dict
from builtins import int
from future import standard_library
standard_library.install_aliases()
import os
import pwd
import json
from hysds_com... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import (StandardScaler, OneHotEncoder,
... |
import contextlib
import copy
import datetime
import logging
import requests
import time
_LOG = logging.getLogger('somecomfort')
FAN_MODES = ['auto', 'on', 'circulate', 'follow schedule']
SYSTEM_MODES = ['emheat', 'heat', 'off', 'cool', 'auto', 'auto']
HOLD_TYPES = ['schedule', 'temporary', 'permanent']
EQUIPMENT_OUT... |
import requests
import time
import pandas as pd
from bs4 import BeautifulSoup
import xml.etree.ElementTree as ET
from abc import ABCMeta, abstractmethod
class BaseCommodity(metaclass = ABCMeta):
def __init__(self, commodity, year, month):
self.commodity = commodity
self.year = year
self.month = month
self.url... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from six.moves import urllib
import os
import json
import warnings
import numpy as np
from scipy import constants as spc
from scipy import interpolate as spi
from ._material_base import _Material
class Data(_Material):
'''
An object that facilita... |
import os.path
import bdpy
import h5py
import matplotlib.pyplot as plt
import numpy as np
from bdpy.preproc import select_top
from bdpy.stats import corrcoef
def data_prepare(subject):
print('Start plotting...')
print('-----------------')
# Model setting:
model_setting = 1
# 0: print all ROI for... |
#
# Copyright (c) 2014, <NAME>, 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... |
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plot
import matplotlib.patches as mpatches
import sys, itertools
from scipy import stats
from BernoulliMixture import BernoulliMixture
import externalpaths
sys.path.append(externalpaths.arcplot())
import arcPlot
sys.path.app... |
# Copyright 2018 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
"""
Created on Sat Mar 10 14:50:38 2018
@author: macbook2
"""
import calendar
from time import time
import datetime as dt
from pathlib import Path
import numpy as np
import pandas_datareader.data as web
from dateutil.relativedelta import relativedelta
import feather
from XmlConverter import XmlConverter
from urllib.r... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Test script for deko module
"""
# This code is a part of chirptext library: https://github.com/letuananh/chirptext
# :copyright: (c) 2012 <NAME> <<EMAIL>>
# :license: MIT, see LICENSE for more details.
import logging
import os
import unittest
from chirptext import ... |
"""Read/Write image files using ITK
"""
# Copyright (c) 2013-2018 <NAME>, Haukeland University Hospital, Bergen, Norway
import os.path
import logging
import tempfile
import itk
import numpy as np
import imagedata.formats
import imagedata.axis
from imagedata.formats.abstractplugin import AbstractPlugin
logger = loggi... |
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 11 16:50:07 2022
@author: docs9
"""
import numpy as np
import pandas as pd
from sklearn.cluster import AgglomerativeClustering
from TechnicalAnalysis import TaLib
from TechnicalLibrary import S_ATR
from Math import Math
from const import BasicConst, IndicatorConst, Param... |
import logging
import time
import argparse
import requests
import configparser
from howlongtobeatpy import HowLongToBeat
from statistics import mean
logger = logging.getLogger()
temps_debut = time.time()
PROTONDB_RATINGS = {
"Platinum": 4,
"Gold": 3,
"Silver": 2,
"Bronze": 1,
"Borked": 0,
}
def ... |
from graphics import *
from Tkinter import RIGHT, LEFT, TOP, BOTTOM
import random
############################################################
# BLOCK CLASS
############################################################
class Block(Rectangle):
''' Block class:
Implement a block for a tetris piece
At... |
import math
class Vec2D(object):
def __init__(self, x=0, y=0):
self.x = x
self.y = y
def magnitude(self):
return math.sqrt(self.x ** 2 + self.y ** 2)
def __add__(self, other):
return Vec2D(self.x + other.x, self.y + other.y)
def __sub__(self, other):
return V... |
"""
Library Features:
Name: lib_jupyter_plot_ts
Author(s): <NAME> (<EMAIL>)
Date: '20210113'
Version: '1.0.0'
"""
#######################################################################################
# Libraries
import os
import pandas as pd
from library.jupyter_generic.lib_jupyter_utils... |
"""
Filter rows by subject, predicate, object values.
"""
from argparse import Namespace, SUPPRESS
import typing
from kgtk.cli_argparse import KGTKArgumentParser, KGTKFiles
def parser():
return {
'help': 'Filter rows by subject, predicate, object values.',
'description': 'Filter KGTK file based on... |
from datetime import datetime, timedelta
from typing import Optional
import logging
import _strptime # NOQA fixes _strptime deferred import issue
from snuba import settings
from snuba.processor import (
_as_dict_safe,
_boolify,
_collapse_uint32,
_ensure_valid_date,
_ensure_valid_ip,
_floatify... |
# coding: utf-8
# Distributed under the terms of the MIT license.
""" This file implements classes to store and manipulate electronic and
vibrational DOS, with or without projection data.
"""
import warnings
import copy
import functools
import numpy as np
import scipy.integrate
import scipy.interpolate
from matador... |
# 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 distributed in the hope that it will be useful,
# but... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 3 09:49:54 2020
@author: enzo
"""
from sklearn.preprocessing import StandardScaler
import pandas as pd
import numpy as np
from sklearn.base import ClassifierMixin
class CombClass(ClassifierMixin):
def __init__(self):
return
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.