text
stringlengths
3.07k
22.1k
import os from shutil import copyfileobj import urllib3 from urllib3.util import parse_url from checksumming_io.checksumming_io import ChecksummingSink from .parallel_logger import logger from .utils import sizeof_fmt, measure_duration_and_rate from .s3 import S3Location, S3Agent, S3ObjectTagger from bundle_tools imp...
# pylint: disable=too-many-arguments, line-too-long """ The functions in this module generate cloud formation scripts that install common AWS environments and components """ from troposphere import Ref, Tags, Join, Base64, GetAtt from troposphere.autoscaling import AutoScalingGroup, LaunchConfiguration, Tag import ...
import matplotlib.pyplot as plt import seaborn as sns import numpy as np import pandas as pd import scipy as sc import pickle import os from . import preprocess from scipy.sparse import vstack, csr_matrix, csc_matrix, lil_matrix from sklearn.metrics.pairwise import cosine_similarity from sklearn.preprocessing import no...
import hashlib import json import os import wormhole.errors from PyQt5.QtCore import QObject from twisted.internet.defer import inlineCallbacks, returnValue, TimeoutError from twisted.protocols.basic import FileSender from wormhole import create from wormhole.cli.cmd_send import APPID from wormhole.cli.public_relay im...
# -*- coding: utf-8 -*- __version__ = '0.9.2' __author__ = '<NAME> <<EMAIL>>' __license__ = "Apache 2" import os import sys import copy import uuid import hashlib import argparse import functools import pkg_resources import sphinx from sphinx.util.osutil import copyfile try: from sphinx.util import logging ...
from collections import defaultdict from braces.views import LoginRequiredMixin from django.contrib import messages from django.contrib.auth.context_processors import PermWrapper from django.db.models import Count, F, Q from django.forms.utils import timezone from django.http import HttpResponseRedirect, JsonResponse ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ sbpy Bibliography Tracking Module sbpy classes and functions can automatically report citations to the user through a bibliography registry. """ __all__ = [ 'register', 'reset', 'status', 'stop', 'track', 'Tracking', 'cite...
""" Utility functions for EO charge transfer inefficiency tests """ import numpy as np import lsst.afw.math as afwMath import lsst.geom as lsstGeom __all__ = ["Estimator", "SubImage", "estimateCti"] class Estimator: "Abstraction for a point estimator of pixel data and its errors" def __init__(self, *args,...
#!/usr/bin/env python3 from __future__ import division, print_function import string, time, random, msvcrt import sounddevice as sd import numpy as np from scipy import io import scipy.io.wavfile import csv from collections import Counter import morse SPS = 8000 LETTERS = string.ascii_uppercase FREQ = 750 WPM = 25 F...
""" Implementation of Cosmic RIM estimator""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf physical_devices = tf.config.experimental.list_physical_devices('GPU') print("\nphysical_devices\n", physical_devices) world_size = len(phys...
#!/usr/bin/python3 # #!/usr/bin/env python # -*- coding: utf-8 -*- # # *-* coding: iso-8859-1 *-* # # -*- coding: latin-1 -*- # https://python.codnex.net/ import sys import random anrede = ["Frau", "Herr"] nachname = ["M\u00fcller ", " Schmidt ", " Schneider ", " Fischer ", " Weber", " Meyer", " Wagner", " Becker", ...
# -*- coding: utf-8 -*- """ src.api.hackers ~~~~~~~~~~~~~~~ Functions: create_hacker() """ from flask import request, make_response, json from src.api import Blueprint from mongoengine.errors import ( NotUniqueError, ValidationError, FieldDoesNotExist, DoesNotExist ) from werkzeug...
from utils import copy_vocab import run_setting from train import train_lm, train_cls, get_model_name from nltk import ToktokTokenizer as ToktokTokenizer_ from fastai.text.data import NumericalizeProcessor, TextList, ItemLists, TokenizeProcessor from fastai.basic_data import DatasetType from fastai.text.transform...
################################################################################ # Module: setup_aggr.py # Description: this module contains functions to set up within and across city indicators ################################################################################ import json import os import time import p...
import json import re import shlex import asyncio import html from nbsubmit import cluster from notebook.base.handlers import IPythonHandler from tornado.web import MissingArgumentError comet = cluster.get("comet") comet.mount() class ShellExecutionHandler(IPythonHandler): async def run_command(self, command=Non...
# -*- coding:utf-8 -*- __author__ = 'Gvammer' from PManager.models import PM_Task, listManager, PM_Milestone from django.contrib.auth.models import User import datetime #from django.db.models import Sum,Count #from PManager.viewsExt.tools import templateTools #from django.contrib.contenttypes.models import ContentType ...
import zlib BIBLIOTIK_ZDICT = '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta nam...
# This is the simulation of our evolving RS model under the SECOND framework of our assumptions on edge weights. import numpy as np import random import matplotlib.pyplot as plt import powerlaw import pandas as pd class assumption_2nd: # initializing the whole model def __init__(self, beta, iterations, rating_...
#!/usr/bin/env python3 # coding: utf8 import argparse import csv import sys import numpy from abc import ABCMeta, abstractmethod class CLI: def __init__(self): pass def parse(self): self.__stdin = [line.rstrip('\n') for line in sys.stdin.readlines()] # print(self.__stdin) parser = argpar...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @File : memory.py # @Author: zixiao # @Date : 2019-04-01 # @Desc : import numpy as np class SumTree(object): data_index = 0 def __init__(self, size, frame_len, w, h): self.data_size = size self.tree_size = 2 * size - 1 self.tree = np....
#!/usr/bin/env python """ Score the predictions with gold labels, using precision, recall and F1 metrics. """ import argparse import sys, os from collections import Counter import numpy as np from pathlib import Path NO_RELATION = "no_relation" def parse_arguments(): parser = argparse.ArgumentP...
import numpy as np import pickle import os from PIL import Image import time from tqdm import tqdm, trange import shutil from random import randint import argparse import glob import pdb import random import math import time import argparse import matplotlib.pyplot as plt from copy import deepcopy import sys sys.path.a...
import pandas as pd import math from pandas import read_csv, to_numeric import numpy from numpy import nan import statistics as sta #df = pd.read_csv('/Users/king/Documents/python/control2/athlete_events.csv') fields = ['Height', 'Year', "Sport"] df = pd.read_csv('/Users/king/Documents/python/control2/athlete_even...
import tensorflow.keras from tensorflow.keras import layers import os import matplotlib.pyplot as plt from PIL import Image #from numpy import asarray import numpy as np from tensorflow.keras import backend as K from tensorflow.keras.applications.vgg16 import preprocess_input from tensorflow.keras.preproc...
""" ESDL Drive extension - A CDO based ESDL storage solution Connects to the ESDL Drive API for file sharing """ # This work is based on original code developed and copyrighted by TNO 2020. # Subsequent contributions are licensed to you by the developers of such code and are # made available to the Project u...
#! /usr/bin/env python from __future__ import print_function import argparse import collections import json import os import shlex import subprocess import sys import boto3 import botocore.exceptions import requests MAILGUN = 'https://api.mailgun.net/v3' AWS_DEFAULT_REGION = boto3.Session().region_name or 'us-east-1...
import os import re import discord import logging import mimetypes import datetime from time import time from glob import glob from utils.dataIO import dataIO from discord.ext import commands from TextToOwO import owo config = dataIO.load_json("config/settings.json") token = config["TOKEN"] globprefix = config["PREF...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division import re import datetime from splash.utils import to_bytes, to_unicode from twisted.python import log try: import lupa except ImportError: lupa = None import six from splash.exceptions import ScriptError _supported = None _lua = None ...
import eyekit sentence = "The quick brown fox [jump]{stem_1}[ed]{suffix_1} over the lazy dog." txt = eyekit.TextBlock( sentence, position=(100, 500), font_face="Times New Roman", font_size=36 ) seq = eyekit.FixationSequence( [ [106, 490, 0, 100], [190, 486, 100, 200], [230, 505, 200, 30...
# flake8: noqa import datetime import uuid from typing import Mapping, cast, MutableMapping import json from behave import given, when, then from hamcrest import assert_that, equal_to, instance_of, none, less_than, is_not from test.e2e.steps.common import make_request from bookshop.sqlalchemy.model.Author import Auth...
import tensorflow as tf # Generally, definitions of different layers of the network. Also, combinations of those layers # to form a full network graph # Set of functions for implementing the tensor module from Ng et al. # https://cs.stanford.edu/~danqi/papers/nips2013.pdf # closer to implementation by Ma et al. # htt...
# Copyright 2018 AT&T Intellectual Property. All other 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...
""" Module for reading and indexing Starbound assets """ import os import json import re import sqlite3 import logging import starbound import starbound.btreedb4 from assets.blueprints import Blueprints from assets.items import Items from assets.species import Species from assets.player import Player from assets.mon...
# coding=utf-8 # Copyright (c) 2016-2018, F5 Networks, 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 applicabl...
from typing import Tuple, Iterable, List, Union, TypeVar, ClassVar, Any import numpy as np import re from .utils import split State = np.array Action = np.array Reward = float Done = bool Datum = Tuple[State, Action, Reward, State, Done] Data = Tuple[Iterable[State], Iterable[Action], Iterable[Reward], Iterable[State]...
#!/usr/bin/python3 """ /** ****************************************************************************** * @file dominant_attribute.py * @author <NAME> * $Rev: 1 $ * $Date: Sat Nov 17 15:12:04 CST 2018 $ * @brief Functions related to Dominant Attribute Algorithm *************************************************...
#!/home/hiroya/Documents/Git-Repos/Lets_Play_Your_Waveform/.venv/bin/python # -*- coding: utf-8 -*- import cv2 import sys import struct import pyaudio import pygame import numpy as np from matplotlib import pyplot import matplotlib.gridspec as gridspec from pygame.locals import K_s, K_d, K_f, K_g, K_h, K_j, K_k, K_l f...
# # Copyright (c) 2018-2019 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # # vim: tabstop=4 shiftwidth=4 softtabstop=4 from __future__ import absolute_import import logging import fmclient as fm_client from django.conf import settings from openstack_dashboard.api import base # Fault managemen...
""" """ from keras.models import Model from keras.layers import Input, Dropout, Dense, Embedding, concatenate from keras.layers import GRU, LSTM, Flatten from keras.preprocessing.sequence import pad_sequences #from keras.preprocessing import text, sequence from keras.preprocessing.text import Tokenizer from keras impor...
class TOS(QTextEdit): tos_signal = pyqtSignal() error_signal = pyqtSignal(object) class Plugin(TrustedCoinPlugin): def __init__(self, parent, config, name): super().__init__(parent, config, name) @hook def on_new_window(self, window): wallet = window.wallet if not isinstance(wallet, self.wallet_class): re...
# import native Python packages import random # import third party packages from fastapi import APIRouter, Request from fastapi.responses import HTMLResponse from fastapi.templating import Jinja2Templates import pandas import numpy import scipy # import api stuff from src.api.autobracket import single_sim_bracket #...
#!/usr/bin/env python # # Copyright (c) 2017 All rights reserved # This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # # http://www.apache.org/licenses/LICENSE-2.0 # import logging import re imp...
#!/usr/bin/env python import requests import json import time import bs4 as bs import datetime as dt import os import pandas_datareader.data as web import pickle import requests import yaml import yfinance as yf import pandas as pd import dateutil.relativedelta import numpy as np from datetime import date from datetim...
# Copyright (c) 2017-present, GoodAI # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE_CHALLENGE file in the root directory of this source tree. import re import unittest import core.environment as environment import core.serializer as serializer import tasks.c...
from django.http import HttpResponse, HttpResponseRedirect from django.urls import reverse from django.core.serializers.json import DjangoJSONEncoder from django.contrib import messages from django.utils.translation import ugettext_lazy as _ from annoying.decorators import render_to from blockexplorer.decorators impor...
import frappe import json from frappe import _ from frappe.utils import has_common, flt item_fields = ["item_code", "item_name","qty", "discount_percentage", "description", "rate", "amount", "image"] @frappe.whitelist(allow_guest=True) def get_cart_details(quote_id): """ return quotation details. items, taxes ...
import discord from discord import Option from discord.ext import commands from discord.ext.commands import BucketType, cooldown import asyncio import random from Utilities import Checks, CombatObject, PlayerObject, Vars from Utilities.CombatObject import Belligerent, CombatInstance from Utilities.Confirm...
from django.shortcuts import render, redirect from django.views.generic import View from utils.views import LoginRequiredMixin, LoginRequiredJSONMixin, TransactionAtomicMiXin from django.core.urlresolvers import reverse from goods.models import GoodsSKU from django_redis import get_redis_connection from users.models im...
# -*- coding: utf-8 -*- """A collection of combination methods for clustering """ # Author: <NAME> <<EMAIL>> # License: BSD 2 clause import numpy as np from sklearn.utils import check_array from sklearn.utils.validation import check_is_fitted from numpy.testing import assert_equal from pyod.utils.utility import che...
"""Debug utilities for EGL operations""" from OpenGL.EGL import * import itertools def eglErrorName(value): """Returns error constant if known, otherwise returns value""" return KNOWN_ERRORS.get(value, value) KNOWN_ERRORS = { EGL_SUCCESS: EGL_SUCCESS, EGL_NOT_INITIALIZED: EGL_NOT_INITIAL...
import torch from torch import nn from utils import spatial_softmax class Block(nn.Module): def __init__(self, in_channels, out_channels, kernel_size=(3, 3), stride=1, padding=1): super(Block, self).__init__() self.conv = nn.Conv2d( in_channels, out_channels, kernel_si...
# -*- coding: utf-8 -*- import os import platform from tcfcli.common.user_exceptions import * home = os.path.expanduser('~') _USER_CONFIG_FILE = home + '/.tcli_config.ini' version = platform.python_version() if version >= '3': from configparser import ConfigParser else: from ConfigParser import ConfigParser ...
import os import torch import numpy as np import json import dgl import constants def read_partitions_file(part_file): """ Utility method to read metis partitions, which is the output of pm_dglpart2 Parameters: ----------- part_file : string file name which is the output of metis part...
import cgi import unittest from whodat.http import * class HTTPRequestTest(unittest.TestCase): def test_method(self): request = HTTPRequest.get() self.assertEqual(request.method, 'GET') request = HTTPRequest.head() self.assertEqual(request.method, 'HEAD') request = HTTPRe...
import functools import logging import logging.handlers import signal import sys import threading import time import click import json from jsonrpcserver import Methods from jsonrpcserver.exceptions import ServerError from path import Path from two1.wallet import daemonizable from two1.wallet.socket_rpc_server import ...
import torch import torch.nn as nn import numpy as np import FrEIA.framework as Ff from .. import InvertibleArchitecture __all__ = ['beta_0', 'beta_1', 'beta_2', 'beta_4', 'beta_8', 'beta_16', 'beta_32', 'beta_inf'] model_base_url = 'https://heibox.uni-heidelberg.de/seafhttp/files/6f91503d-7459-4080-b10a-e979f8b3d2...
# # 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 # "License"); you may not...
from collections import deque import dash import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html import plotly.graph_objects as go from src.layout import * from src.model import Model, generate_features # Models gbr = Model(name='gbr').load() mlp = Model(name='...
#!/usr/bin/env python # -*- coding: utf-8 -*- """PYStructure Usage: pystructure.py SRC_PATH [-o FILE | --output=FILE] Options: -o FILE --output=FILE Save result to output file. -h --help Show help information. --version Show version. """ import os from colle...
"""Tests for distutils.util.""" import os import sys import unittest import sysconfig as stdlib_sysconfig from copy import copy from test.support import run_unittest from unittest import mock from distutils.errors import DistutilsPlatformError, DistutilsByteCompileError from distutils.util import ( get_platform, ...
import os os.environ['KMP_DUPLICATE_LIB_OK']='True' import warnings warnings.filterwarnings("ignore") import gym import pybullet_envs import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.distributions import Normal import torch.multiprocessing as mp import time impo...
# -*- coding: utf-8 -*- # Copyright (c) 2016 by University of Kassel and Fraunhofer Institute for Wind Energy and Energy # System Technology (IWES), Kassel. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. from sys import stderr from numpy imp...
#!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. 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 # # U...
""" Basic tests for ParaRead """ import itertools import os import pytest from pysam import AlignmentFile from pararead.exceptions import \ CommandOrderException, IllegalChunkException, \ MissingHeaderException, MissingOutputFileException from pararead.processor import ParaReadProcessor from tests import \ ...
#!/usr/bin/env python3 """ Generate TERRA REF canopy cover """ import argparse import logging import os import stat import subprocess from typing import Optional import globus_sdk GLOBUS_ENDPOINT = 'Terraref' GLOBUS_PATH = '/ua-mac/public/season-6/Level_2/rgb_fullfield/' LOCAL_SAVE_PATH = os.path.realpath(os.getcwd(...
from itertools import combinations from sage.algebras.lie_algebras.lie_algebra import LieAlgebra from sage.arith.misc import gcd from sage.categories.lie_algebras import LieAlgebras from sage.combinat.integer_vector import IntegerVectors from sage.matrix.constructor import matrix from sage.modules.free_module import Fr...
import unittest import os import torch from torch.optim import Optimizer import apex from apex.multi_tensor_apply import multi_tensor_applier from itertools import product class RefLAMB(Optimizer): r"""Implements Lamb algorithm. It has been proposed in `Large Batch Optimization for Deep Learning: Training BE...
# Import base tools import os ## Note, for mac osx compatability import something from shapely.geometry before importing fiona or geopandas ## https://github.com/Toblerity/Shapely/issues/553 * Import shapely before rasterio or fioana from shapely import geometry import rasterio import random from cw_tiler import main ...
# -*- coding:utf-8 -*- # Copyright (c) 2018 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merg...
import math import pytest from compas.geometry import Point from compas.geometry import Polyline from compas.utilities import pairwise def test_polyline(): points = [[0, 0, x] for x in range(5)] polyline = Polyline(points) assert polyline.points == points assert polyline.lines == [(a, b) for a, b in ...
"""Uses the same strategy as ``adjacency_list.py``, but associates each DOM row with its owning document row, so that a full document of DOM nodes can be loaded using O(1) queries - the construction of the "hierarchy" is performed after the load in a non-recursive fashion and is more efficient. """ # PART...
# Something import os import sys import matplotlib.pyplot as plt import numpy as np import pandas as pd # Magic to get the library directory properly sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib')) from common import moving_average def graph_seed_scatter(sdlabel, xdata, ...
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
# Copyright 2021 <NAME> (rafsaf). All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
from typing import Dict, List from cachetools import cached, TTLCache from infi.clickhouse_orm.database import Database from contrail.configuration import config from contrail.loader.warehouse import InstanceData, InstanceDataLastPointView, InstanceDataLastPointViewAllReserved, InstanceDataHourlyPriceView, InstanceDa...
import json import os from yunionclient.common import base from yunionclient.common import exceptions from yunionclient.common import utils from yunionclient.common.utils import url_unquote, url_quote class Image(base.ResourceBase): def _normalize_attribute_dict(self, attr_dict): props = attr_dict.get('...
import numpy as np import scipy as sp import matplotlib.pyplot as plt import matplotlib as mpl import matplotlib.animation import json import nibabel as nib from scipy.ndimage.interpolation import zoom def save_history(filename, trainer): """Save the history from a torchsample trainer to file.""" with open(f...
#!/usr/bin/env python """Unique Crater Distribution Functions Functions for extracting craters from model target predictions and filtering out duplicates. """ from __future__ import absolute_import, division, print_function from PIL import Image import matplotlib import cv2 import matplotlib.pyplot as plt import numpy...
import calendar import json from json.decoder import JSONDecodeError from django.contrib import auth from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist from dja...
""" Representations of template-with-slots-like patterns over token strings. """ from typing import List, Mapping, Optional, Tuple, Union from more_itertools import quantify from adam.language import TokenSequenceLinguisticDescription from adam.language_specific.english import ENGLISH_DETERMINERS from adam.learner.lan...
""" User credential and auth token module See [README](../README.html) for more details. Copyright 2020. Bloomberg Finance L.P.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, ...
"""Tests for the Meteo-France config flow.""" from meteofrance.model import Place import pytest from homeassistant import data_entry_flow from homeassistant.components.meteo_france.const import ( CONF_CITY, DOMAIN, FORECAST_MODE_DAILY, FORECAST_MODE_HOURLY, ) from homeassistant.config_entries import SO...
# pylint: disable=exec-used """ Sphinx extension for including live rendered GMT plots within sphinx documentation. For example:: .. gmt-plot:: import gmt fig = gmt.Figure() fig.coast(region="g", projection="W0/10i", land="gray") fig.show() The *last statement* of the code-block s...
import functools as f from foowise.channels import Index as Id from foowise.channels import InfoPair as I from foowise.math import Set as S from foowise.math import LinAlg as Alg from foowise.math import Dual as D @D.dualizable(duals=[ ('tok', 'typ'), ('get_tokens', 'get_types'), ('tokens_agree', 'types_...
import torch import torch.nn as nn import torch.utils.data as data import torch.nn.functional as F import torchvision import torchvision.transforms as transforms import argparse # import matplotlib.pyplot as plt import numpy as np from torch.autograd import Variable # from sklearn.decomposition import PCA import sett...
import inspect from abc import abstractmethod, ABCMeta from typing import Callable, Union, Optional, List from joblib import Memory # import cupy as cp from warnings import warn import numpy as np from scipy.integrate import quad # from Operator import Quadrature from decorators import timer, vectorize location = ...
'''Train DCENet with PyTorch''' # from __future__ import print_function import torch import torch.nn as nn import torch.optim as optim from torch.utils.data import DataLoader import os import json import neptune import argparse import numpy as np from loader import * from utils.plots import * from utils.utils impor...
import numpy as np import pandas as pd from collections import Counter import re import string import itertools from sklearn.metrics import confusion_matrix from sklearn.model_selection import train_test_split from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer from sklearn.linear_model impor...
# Copyright 2020 The TensorFlow 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 applica...
""" Routines for solving the KS equations via Numerov's method """ # standard libs import os import shutil # external libs import numpy as np from scipy.sparse.linalg import eigsh, eigs from scipy.linalg import eigh, eig from joblib import Parallel, delayed, dump, load # from staticKS import Orbitals # internal lib...
#!/usr/bin/env python3 # # Copyright 2022 Graviti. Licensed under MIT License. # """Portex record field releated classes.""" from collections import ChainMap from itertools import chain from typing import Any from typing import ChainMap as ChainMapType from typing import ( Dict, Iterable, Iterator, Li...
from codecs import ignore_errors from .tools import abort import sys import docker import json import importlib.util from retrying import retry import traceback from threading import Thread import subprocess import shutil from datetime import datetime import inquirer import os import click from pathlib import Path from...
import os,sys try: from PyProjects.config.pyconfig import * except ImportError as e: from config.pyconfig import * class PyProjects(): def __init__(self): pass ''' Create the setup.py file. @PARAM: temp_dir = The dir that the file is created in. @PARAM: project_name =...
#!/usr/bin/env python3 # coding=utf-8 """ Version 1.3 Script to manage IP list usages and to remove allow rule IP pattern All actions operate on the newest saved or active configuration and will save a new configuration. """ from urllib import request import ssl import json import os import sys import re from argparse...
# Author: <NAME> # This game does not run on windows due to the lack of # support for the curses library import atexit import random import curses import time import threading import os # An IOController controls the input (keyboard) and output # (console) of the game class IOController(): # TODO: curses is b...
import datetime import simplejson as json from django.conf import settings from django.http import HttpResponse from django.utils.encoding import force_text from django.utils.functional import Promise from django.views.generic import FormView from .app_settings import SLICK_REPORTING_DEFAULT_END_DATE, SLICK_REPORTING...
import os import sublime import string import random import tempfile import subprocess import sublime_plugin WINDOWS_LINE_ENDING = b'\r\n' UNIX_LINE_ENDING = b'\n' settingsFile = "SublimeOpenFileOverSSH.sublime-settings" isWindows = (sublime.platform() == "windows") viewToShell = {} #Maps view.id() to an sshShell. ...
""" Module: Doccode Mapping form grouping changer Project: Adlibre DMS Copyright: Adlibre Pty Ltd 2012 License: See LICENSE for license information Author: <NAME> """ from djangoplugins.models import Plugin, PluginPoint from django import forms from django.utils.importlib import import_module from .models import Doc...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ A Python implementation of the method described in [#a]_ and [#b]_ for calculating Fourier coefficients for characterizing closed contours. References ---------- .. [#a] <NAME> and <NAME>, “Elliptic Fourier Features of a Closed Contour," Computer Vision, Graphics ...
#!/usr/bin/env python3 from termcolor import colored, cprint import threading import requests import argparse import signal import time import sys import os import re logo = """ ___ _____ _ _ __ | _ \___ ____ __ ___ _ _ _____|_ _| |_ (_)___ / _| | / -_(_-| '_ / _ | ' \(_-/...