text
stringlengths
3.07k
12.6k
import tensorflow as tf from absl import app, flags, logging from absl.flags import FLAGS from core.yolov4 import YOLO, decode, decode_train, filter_boxes import core.utils as utils from keras_flops import get_flops import tensorflow_model_optimization as tfmot flags.DEFINE_string('weights', './data/yolov4.weights', '...
from typing import List, BinaryIO, TextIO, Tuple, Any import os import sys import time import shlex import argparse import subprocess from ml.utils.ansi import ANSI def debug(msg: str) -> None: print(msg, file=sys.stderr) def run_command(command: List[str], **kwargs: Any) -> subprocess.Popen: # type: ignore ...
import logging import json from collections import OrderedDict from urllib.parse import urlparse from pulsar.api import Http404, ImproperlyConfigured from pulsar.apps.wsgi import Route from pulsar.utils.httpurl import remove_double_slash from pulsar.utils.importer import module_attribute from lux import models from l...
#!/usr/bin/python import socket import subprocess import os import platform import wget # for coloring the terminal from termcolor import cprint, colored #for printing arguments help and available options for users import optparse ''' Description: This tool is part of the ethical hacking toolset. This ...
# -*- coding:utf-8 -*- import sys sys.path.append("..") import re import time import requests from bs4 import BeautifulSoup from tools.Date_Process import time_process from tools.Emoji_Process import filter_emoji from tools.Mysql_Process import mysqlHelper from tools.Number_Process import num_process from search_spide...
#!/usr/bin/env python # -*- coding: utf-8 -*- import pathlib import argparse from datetime import datetime, timedelta from ybk.settings import ABBRS from ybk.config import setup_config from ybk.crawlers import crawl, crawl_all from ybk.parsers import parse, parse_all from ybk.quotes import realtime, realtime_all, hist...
# Copyright 2016 <NAME> and individual contributors # # 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 agr...
import threading import Queue from multiprocessing import Manager from multiprocessing import Process import os from splunktalib.common import log logger = log.Logs().get_logger("main") import splunktalib.event_writer as ew import splunktalib.timer_queue as tq import splunktalib.common.util as scutil import splunktal...
#!/usr/bin/env python # PLOT FSS DATA COMPUTED USING compute_sspf_fss.py import matplotlib matplotlib.use('Agg') from netCDF4 import Dataset import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from mpl_toolkits.basemap import * import matplotlib.colors as colors import matplotlib.gridspec as gr...
# -*- coding: utf-8 -*- from aubio import pvoc, float_type import aubio from numpy import zeros, log10, vstack ''' ir.py: Defines the intermediate representation API and the main components of the pipeline. These can be extended as seen fit. date: 4/3/17 author: <NAME> Overview: define abstract class Intermedi...
from collections import namedtuple from pymc3.theanof import join_nonshared_inputs, gradient, CallableTensor import theano import theano.tensor as tt Hamiltonian = namedtuple("Hamiltonian", "logp, dlogp, pot") def _theano_hamiltonian(model_vars, shared, logpt, potential): """Creates a Hamiltonian with shared ...
# -*- coding: utf-8 -*- import unittest from pyparsing import ParseException from tests.utils.grammar import get_record_grammar """ CWR Work Detail grammar tests. The following cases are tested: """ __author__ = '<NAME>' __license__ = 'MIT' __status__ = 'Development' class TestRecordingDetailGrammar(unittest.Tes...
# -*- coding: utf-8 -*- import math import wave from bitarray import bitarray from PIL import Image from .exceptions import LoadingError, UnloadingError from .pickers import LinearPicker class BaseShipment(object): """The base for all types of shipments. :param container: the container used to store the ca...
# This is the code used to generate the data for Figure 4(b) in the paper. import gurobipy as gp from gurobipy import GRB import numpy as np import pandas # from scipy.special import softmaxscipy import matplotlib.pyplot as plt import seaborn as sns import datetime def printGraph(X, Y, Y1, name): plt.figure('Dr...
#!/usr/bin/python3 # Author: Hegusung import argparse import traceback import socket from time import sleep from datetime import datetime from ipaddress import IPv4Network from vnc import VNC, VNCException def process(ip, port, timeout, password_list, ducky_script): try: print("Connecting to %s:%d" % (...
# # Copyright 2021 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
# Copyright 2011-2019, <NAME> and The Tor Project # See LICENSE for licensing information """ Utility functions used by the stem library. """ import datetime import stem.prereq __all__ = [ 'conf', 'connection', 'enum', 'log', 'lru_cache', 'ordereddict', 'proc', 'str_tools', 'system', 'term', '...
import os import torch import torch.utils.data as data import cv2 import numpy as np from .encoder import compute_iou, DataEncoder """Load image/classes/bounding boxes from an annotation file. The annotation file is organized as: image_name #obj xmin ymin xmax ymax class_index xmin2 ymin2 xmax2 ymax2 class_index2 .....
from math import ceil import numba as nb import numpy as np from numba import cuda from ..Aggregation import pbc_dist_cu from ..utils import cu_cell_id from ..utils import cu_cell_list_argsort from ..utils import ravel_index_f_cu from ..utils import unravel_index_f_cu @cuda.jit("void(int64[:], int64[:])", device=Tr...
import json from typing import Dict, Any, Optional from django.db.models import QuerySet from django.http import StreamingHttpResponse from classification.models import ClassificationModification, EvidenceKey, EvidenceKeyMap from classification.models.evidence_mixin import VCBlobDict from classification.views.classif...
"""Tools for dealing with XYZ data, including: Reading XYZ data and converting to useful objects and formats Reorientation of array data such as flip/rotation Filtering array data such as high and low pass filters This is branch 133 """ import numpy as np import pandas as pd from scipy import ndimage...
from django.shortcuts import render, redirect from django.http import HttpResponse, Http404, HttpResponseRedirect from .models import Projects, Profile from .forms import ProjectsLetterForm from .email import send_welcome_email from django.contrib.auth.decorators import login_required from .forms import NewProjectForm,...
#from .base import BaseModel from .backends.izhikevich import JIT_IZHIBackend from .backends.mat_nu import JIT_MATBackend from .backends.adexp import JIT_ADEXPBackend from copy import copy import collections import quantities as pq from sciunit import capabilities as scap from neuronunit import capabilities as ncap f...
import itertools from typing import Any, Callable, Dict, Generator, Iterator, Set, Tuple from eth_utils.toolz import thread_last from typing_extensions import Protocol from eth2.beacon.tools.fixtures.config_types import ConfigType from eth2.beacon.tools.fixtures.parser import parse_test_suite from eth2.beacon.tools.f...
import random import torch from torch.utils.data import Sampler, SequentialSampler from torch.utils.data.datapipes._decorator import functional_datapipe from torch.utils.data.datapipes.datapipe import IterDataPipe from typing import Dict, Iterator, List, Optional, Sized, Tuple, Type, TypeVar __all__ = [ "SamplerI...
import numpy as np from scipy.stats import norm, truncnorm class TransitionKernel(): ''' A transition kernel on a random variable (or a set of RVs) stores the current value of the RV, propose() will propose a new RV by setting the value attribute, and return forward and backward transition log probability. reve...
import json import logging import os import subprocess import sys from dataclasses import asdict, dataclass, field from pathlib import Path from typing import Optional import datasets import hydra import wandb from datasets import config, load_dataset, load_from_disk from hydra.core.config_store import ConfigStore fro...
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from sis_provisioner.events import SISProvisionerProcessor from sis_provisioner.dao.canvas import ( get_instructor_sis_import_role, ENROLLMENT_ACTIVE, ENROLLMENT_DELETED) from sis_provisioner.dao.course import is_time_schedule_c...
# Communicating with Benchtop DSA8300 (Tektronix Sampling Scope) from colorama import init, Fore, Back init(autoreset=True) #to convert termcolor to wins color from os.path import basename as bs mdlname = bs(__file__).split('.')[0] # module's name e.g. PSG import visa from pyqum.instrument.logger import address, set_...
#!/usr/bin/python # -*- coding: utf-8 -*- """ @author: brett """ import xlrd import os class WritableObject(object): def _keys(self): keys = [k for k in self.__dict__ if not k.startswith('__')] return sorted(keys) def __repr__(self): s = list() for key in self._keys(): ...
# This script can be used to ask DonkeyBot a question. # There are many more parameters we can tweak and change for both the search engines # and the answer detector. For the purpose of this demo we stick to the default values. # For more information refer to the source code and the documentation # bot modules from bo...
# Generated from Array.g4 by ANTLR 4.7.1 # encoding: utf-8 from antlr4 import * from io import StringIO from typing.io import TextIO import sys def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\7") buf.write("\26\4\2\t\2\4\3\t\3\3\2\3\2\3\2...
import save_load_model import json import torch from random import randint import process_image as pima import train import argparse import view_classify import signal from contextlib import contextmanager import requests def get_input_args(): if __name__ == "__main__": parser = argparse.ArgumentParser...
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import re import copy __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' modul...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import logging import random from abc import ABC from typing import List, Dict from transformers import AutoTokenizer, BasicTokenizer from .table_linearize import TableLinearize logger = logging.getLogger(__name__) class TableTruncate(ABC): ...
from sys import byteorder from array import array from struct import pack from python_speech_features import mfcc from python_speech_features import logfbank import scipy.io.wavfile as wav import numpy as np import dataset import pyaudio import wave import matar, soplo, izquierda, yes, lucha, reversa, babor, uno, tigr...
from django.shortcuts import redirect, render from django.views.decorators.csrf import csrf_exempt from account_app.models import Seller, Buyer from .models import Commodity, Order, Comment, Favorites def details(request): if request.method == "POST": if "favorite" in request.POST: try: ...
# Copyright 2008-2018 Univa Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
"""Generic async object pool""" from __future__ import annotations __all__ = [ "AsyncManager", "AsyncPool", ] import asyncio import contextlib import dataclasses import logging import queue import threading from abc import ABCMeta from concurrent.futures import Executor from typing import AsyncGenerator, Gen...
#!/usr/bin/env python3 # # Copyright (c) 2014-2015 the Sanzang authors # # 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,...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jun 12 14:47:12 2019 @author: minghao """ default_filename = '/Users/mac/Documents/University/Github/data_road/training/calib/um_000000.txt' import os import numpy as np import cv2 class BevParams(object): def __init__(self, bev_res, bev_xLimits,...
# =============================================================================================================== # Copyright (c) 2019, Cornell University. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that # the following conditions...
# coding=utf-8 """ Easier file operation. """ import os import datetime import shutil from .funcs import is_image, iterable from .funcs import remove_empty_dir, human_size def tree(path, depth=2, topdown=True, followlinks=False, showhidden=False): """A generator return a tuple with three elements (root, dirs, fi...
import os, sys, inspect, random, bpy, bmesh from math import radians from mathutils import Matrix def import_STL_file(file_loc=None): """ if file_loc is not given, it will pick last .STL in the current file location """ # selects last .STL file in the dictionary and imports it to the project #...
#!/usr/bin/env python import os import sys import numpy as np import matplotlib matplotlib.use('PDF') from mgplottools.mpl import get_color, set_axis, new_figure, ls def create_figure(outfile, ampl, final_1r_1200, final_rr_1200, max_1r_1200, max_rr_1200, blockeff_1200, final_1r_4200, final_rr_4200, max_1r_4200, ...
# ___________________________________________________________________________ # # EGRET: Electrical Grid Research and Engineering Tools # Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC # (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. # Government retains certain r...
""" Name: NMFconv Date: Jun 2019 Programmer: <NAME>, <NAME> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% If you use the 'NMF toolbox' please refer to: [1] <NAME>, <NAME>, <NAME>, and <NAME> NMF Toolbox: Music Processing Applications of Nonnegative Matr...
from IMLearn.learners.classifiers import Perceptron, LDA, GaussianNaiveBayes from typing import Tuple from utils import * import plotly.graph_objects as go from plotly.subplots import make_subplots from math import atan2, pi def load_dataset(filename: str) -> Tuple[np.ndarray, np.ndarray]: """ Load dataset fo...
#!/usr/bin/env python # -*- coding: utf-8 -*- #------------------------------------------------------------------ # LEIA E PREENCHA O CABEÇALHO # NÃO ALTERE OS NOMES DAS FUNÇÕES # NÃO APAGUE OS DOCSTRINGS # NÃO INCLUA NENHUM import ... #------------------------------------------------------------------ ''' Nome:...
import os import numpy as np import matplotlib.pyplot as plt import torch as t from torch import nn from torch.utils.data import DataLoader import torchvision import torchvision.transforms as transforms from torchvision.datasets import ImageFolder import uuid import optuna import pandas import slackweb from earlystopp...
import numpy as np try: from numpy import nanmean except ImportError: # obsolete location from scipy.stats import nanmean # initial implementation 90ms for 1132 sample window, # compared to 0.258ms for holey_psd # changing to nanmean -> 6ms. # mean takes just 3ms. def nan_detrend(x,order=1): valid=np....
from django.contrib import messages from django.contrib.sites.shortcuts import get_current_site from django.core.urlresolvers import reverse from django.db.models import Q from django.http import HttpResponseRedirect, Http404 from django.utils import timezone from django.views.generic import TemplateView, View from br...
from __future__ import absolute_import, unicode_literals from tensorflow.examples.tutorials.mnist import input_data import tensorflow as tf import shutil import os.path export_dir = './tmp/expert-export' if os.path.exists(export_dir): shutil.rmtree(export_dir) def weight_variable(shape): initial = tf.truncat...
""" Copyright 2019 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing...
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: __init__.py import _dsz import dsz import dsz.data import dsz.lp import mcl.tasking import sys import Queue import xml import xml.sax import xml.sax....
import logging import platform import threading import time from luma.core.legacy import text, textsize from luma.core.legacy.font import proportional, LCD_FONT from luma.core.render import canvas from luma.core.virtual import viewport if platform.machine().startswith('arm'): from g...
#!/usr/bin/python """ https://en.wikipedia.org/wiki/Chordal_graph PEO = Perfect Elimination Ordering """ try: integer_types = (int, long) except NameError: # Python 3 integer_types = (int,) xrange = range def find_peo_mcs(graph): # to nie jest najszybsza wersja! """Finding PEO in a chordal graph ...
import random import string from django.db import models from django.db.models import Sum from django.conf import settings from django_countries.fields import CountryField from products.models import Product from profiles.models import UserProfile from decimal import Decimal class OrderProgress(models.Model): ...
import logging import requests import os import json import boto3 from botocore.exceptions import NoCredentialsError, ClientError import botocore # Get environment variables ACCESS_KEY = os.environ.get('AWS_ACCESS_KEY_ID') SECRET_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY') BUCKET_LOCATION = os.environ.get('AWS_DEFAU...
import pandas as pd from src.tools.config_loader import Configuration from operator import or_ as union from functools import reduce import numpy as np config = Configuration.get_instance() io = config["IO"] local_config = config["CostCurveConfig"] column_map = {"id": "id", "source": "source", ...
# encoding: utf-8 __author__ = "<NAME>" __email__ = "sch<EMAIL>t89 at informatik.uni-marburg.de" ''' Utility for command-line interface ''' import sys from androlyze.log.Log import log, clilog from androlyze.model.script.ScriptUtil import dict2json from androlyze.error.AndroLyzeLabError import AndroLyzeLabError ...
"""Implement tables of test reports for Sphinx""" import typing # import os from docutils import nodes import docutils.parsers.rst as rst import yaml import yaml.scanner import yaml.parser RESULT_FILE = ":testresultfile:" TST_FILE = ":testfile:" TST_CLASS = ":testclass:" TABLE_TITLE = ":tabletitle:" KW_REQ_LST = [R...
""" The module for creating and running a transfer learning network """ import os import sys import numpy as np from os.path import dirname import tensorflow as tf from datetime import datetime import sklearn from tensorflow.python.keras.callbacks import TensorBoard, EarlyStopping from sklearn.model_selection import...
import trio from functools import partial from ghostricon import constants from ghostricon.bridge import Proxy from ghostricon.config import get_config, save_config from ghostricon.commands import server_types import gi gi.require_version('Gtk', '3.0') gi.require_version('Gdk', '3.0') # pylint: disable=E402 from gi...
import logging import ntpath import re import datetime class ParseLookupIndex(object): """ { "name": JOB_ID, "start_delimiter": "resolve for Job", "end_delimiter": "," } """ def _datetime(self, val): date_time_obj = datetime.datetime.strptime(val, '%Y-%m-%d %H:%M:%S...
import os from typing import Union import yaml import json from jinja2 import Template from copy import deepcopy header_msg1 = 'This file was automatically generated by jinjaroot. Do not edit directly. See the .jinjaroot dir.' header_msg2 = 'This file was automatically generated by jinjaroot. Do not edit directly.' d...
#!/usr/bin/env python3 """ The goal of this script is to ease the config generation by using an existing keystone file <NAME> (06 Jan 2019), contact: <EMAIL> """ import sys import os import argparse import re import tempfile import pprint import ehos.utils pp = pprint.PrettyPrinter(indent=4) from munch im...
import os import re import datetime import dateutil.parser import configparser import numpy as np import astropy.io.fits as fits from astropy.table import Table from ...utils.misc import extract_date from ..common import load_obslog, load_config from .common import print_wrapper, get_ccd_geometry from .reduce import ...
"""This script normalizes the data from recount3""" import argparse from typing import Dict import numpy as np import tqdm import utils def parse_gene_lengths(file_path: str) -> Dict[str, int]: """Parses a tsv file containing genes and their length Arguments --------- file_path - The path to the f...
#!/usr/bin/python3 import threading import socket import queue import random import logging, logging.handlers def i2b(n): b = b"" while n > 0: neon = n & 255 b += chr(neon).encode("utf8") n = n >> 8 return b def b2i(b): n = 0 for bt in b: n += bt n = n << 8 return n >> 8 class Peer: def __init__(sel...
import os import sys import time import webbrowser import logging from pathlib import Path from multiprocessing import Process from ..config import get_config from ..home import load_directories, remove_directories, add_directory from ..agent import load_agent_profiles, load_agent_profile from ..prov import Provenanc...
from collections import namedtuple import re inequalities = { '.lt': lambda x, y: x < y, '.leq': lambda x, y: x <= y, '.eq': lambda x, y: x == y, '.geq': lambda x, y: x >= y, '.gt': lambda x, y: x > y, } class Phrase(object): fields = ['text', 'words', 'char_offsets', 'pos_tags', 'ner_tags', ...
#!/bin/python3 # Time complexity: O(n) # Space complexity: O(n) # The logic: # The numbers in this problem are extremely large and are handled as strings. # The solution has two parts: mandatory and optimization. # Mandatory part - here we attempt to transform A and B so that A | B = C with # the minimum number of...
import re from collections import defaultdict from .annotation import IdedAnnotation SIMSTRING_DEFAULT_UNICODE = False def _parse_drawing(maybe_attribute_text): if maybe_attribute_text: attributes = dict(item.strip().split(':') for item in maybe_attribute_text[0].split(',')) else: attributes...
# global import os import ivy import logging import argparse import numpy as np # local import ivy_builder.builder as builder from ivy_builder.abstract.data_loader import DataLoader from ivy_builder.abstract.network import Network from ivy_builder.abstract.trainer import Trainer from ivy_builder.specs import DataLoade...
import numpy as np import pandas as pd from sklearn.metrics import confusion_matrix from sklearn.metrics import roc_auc_score from sklearn.metrics import mean_squared_error import matplotlib matplotlib.use("TkAgg") # initiating random number np.random.seed(11) #### Creating the dataset # mean and standard deviation...
from collections.abc import Mapping from typing import Any from typing import Dict from typing import Generic from typing import Iterable from typing import List from typing import Optional from typing import overload from typing import Set from typing import Type from typing import TypeVar from typing import Union fro...
import argparse import json import os import urllib import urllib.request import requests import sys from requests.auth import HTTPBasicAuth def get_course_page(api_url, token): return json.loads(requests.get(api_url, headers={'Authorization': 'Bearer ' + token}).text) def get_all_weeks(stepik_resp): return...
""" IdleX Windows Configuration Adds/removes "Edit with IdleX" to the right-click context menu for .py files. Author: <NAME> Date: 2011-11-28 2012-04-13 modified to work with setup.py License: See LICENSE.txt """ import os import sys import shlex WINREG = True if sys.version < '3': import Tkinter...
from nose.tools import * from os.path import abspath, dirname, join import numpy as np import wntr import unittest testdir = dirname(abspath(str(__file__))) def test_Concentration(): typestring = 'Concentration' data_expected = 1 # kg/m3 data = 1000 # mg/L for flowunit in range(10): execute_te...
# # Copyright (c) 2019 -2021 MINRES Technolgies GmbH # # SPDX-License-Identifier: Apache-2.0 # from cppyy import gbl as cpp from builtins import getattr import re from enum import Enum import logging class Mode(Enum): SIM = 1 BUILD = 2 mode=Mode.SIM module_list = list() connection_list = list() def dump_st...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # File : visualizer.py # Author : <NAME> # Email : <EMAIL> # Date : 08/02/2021 # # This file is part of TOQ-Nets-PyTorch. # Distributed under terms of the MIT license. import json import os import cv2 from toqnets.utils import make_video DATA_PATH = "/data/vision...
import sqlalchemy as sa from functools import lru_cache from itertools import groupby from dateutil.relativedelta import relativedelta from sqlalchemy import func, text from datahub.settings import UNKNOWN_TECHNOLOGY_LABEL from datahub.technology import Technology from datahub.measurements import Measurement from data...
#!/usr/bin/env python3 # coding: utf8 # Author: <NAME>, 2019 ''' Import terminology from a CRAFT OBO ontology. ''' import io import re import csv import logging import zipfile from pathlib import Path from ...util.util import smart_open from ..terminology import DictEntry ONTOLOGIES = { 'CHEBI': 'chemical',...
from aiogram import types from aiogram.dispatcher import FSMContext from data import config from handlers.users.settings import group_and_subgroups from keyboards import inline from keyboards.inline import back_callback, chats, continue_callback, notification, languages, faculties, courses, \ groups from k...
import re import math import operator constants = { "pi": math.pi, "e": math.e } operators = { "+": operator.add, "-": operator.sub, "*": operator.mul, "/": operator.truediv, "%": operator.mod, "//": operator.floordiv, "^": operator.pow } # sorted by descending precedence operator...
# coding=utf-8 # Dataset needs to be shuffled before calling TextReader() instance; # Use shuffle_dataset() to make a new CSV file, default is /datasets/train_set.csv import codecs import random, csv import numpy as np from nltk.tokenize import word_tokenize import sys import string import os from lib.utils import co...
# -*- coding: utf-8 -*-. """ pygsheets.datarange ~~~~~~~~~~~~~~~~~~~ This module contains DataRange class for storing/manuplating a range of data in spreadsheet. This classs can be used for group operations, eg changing format of ll cells in a given range. This can also represent, named ranges protetced ranegs, banne...
import hashlib import json import os from django import http from django.conf import settings from django.core.files.storage import default_storage as storage from django.shortcuts import get_object_or_404, redirect from django.views.decorators.http import etag import commonware.log import jingo from session_csrf imp...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. All Rights Reserved. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import json import logging import os import shutil from typing import List, Optional import to...
#! /usr/bin/env python # -*- coding: utf-8 -*- """ extract mpg from dvd, write encoding script """ from __future__ import print_function import os from roku_app.roku_utils import publish_transcode_job_to_queue from roku_app.util import run_command HOMEDIR = os.getenv('HOME') DIR = '%s/dvdrip' % HOMEDIR DEBUG = False ...
# coding: utf-8 # -------imports---------- # import os import sys import time import argparse import json import pandas as pd import numpy as np from keras.models import Model from keras.optimizers import Adam from keras.callbacks import EarlyStopping, ModelCheckpoint from sklearn.metrics import fbeta_score from skle...
import itertools import os import pickle import numpy as np from hypergrad.util import dictslice from hypergrad.mnist import random_partition def datapath(fname): project_dir = os.environ['EXPERI_PROJECT_PATH'] datadir = project_dir+"/library/hypergrad/data/mnist" # datadir = os.path.expanduser('/Users/...
import sys from typing import Callable, List, Optional, Union from nuclear.autocomplete.autocomplete import bash_autocomplete from nuclear.autocomplete.install import install_bash, install_autocomplete from nuclear.builder.decorator_builder import create_decorated_subcommand from nuclear.help.help import print_version...
# -*- coding: utf-8 -*- """ .. module:: courtship :synopsis: Class to hold tracking summaries (ts). .. moduleauthor:: <NAME> """ import h5py import numpy as np import pandas as pd from courtship.fly import Fly from .meta import ( VideoMeta, ArenaMeta, SoftwareTrackingMeta ) cl...
## EOF TRANSFORMATION OF LORENZ SYSTEM import numpy as np from eofs.standard import Eof import matplotlib.pyplot as plt ## define right hand side of lorenz system def rhs(xyz,sig=10.,rho=28.,beta=8./3.): xdot = sig*(xyz[1] - xyz[0]) ydot = xyz[0]*(rho - xyz[2]) - xyz[1] zdot = xyz[0]*xyz[1] - beta*xyz[2]...
#Author: <NAME> #Description: Extract subtitles and videos of approved shows from the RUV api #License: Apache 2 #TODO: follow pep8 # consider using BeautifulSoup to parse links #TODO: create a usage import csv import json import os import requests import sys import urllib.request from RUV_show import Season, Programm...
# Copyright 2020 Red Hat, 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 writing, s...
import re from typing import Any from openpyxl.cell.cell import Cell from .exceptions import ( InvalidTemplateProperty, InvalidExpression, ConflictDataTypeInExpression, InvalidIndexInExpression, DiscontinuousIndexInExpression, InvalidTemplateProperties, ) from .utils import get_and_validate_ce...
"""A PyZMQ based RPC service. Authors: * <NAME> """ #----------------------------------------------------------------------------- # Copyright (C) 2012. <NAME>, <NAME> # # Distributed under the terms of the BSD License. The full license is in # the file COPYING.BSD, distributed as part of this software. #-------...