text stringlengths 3.07k 12.6k |
|---|
#!/usr/bin/env python3
import abc
from functools import partial
from loomast import *
class ProgramGenerator:
def __init__(self):
self.string_count = 0
self.set_count = 0
self.program = []
self.environment = dict()
def visit(self, node):
if type(node) == Program:
... |
import sys, re
import pandas as pd, numpy as np
from data_processing import split_wrd, space_fill
def df_format_print(df,file=sys.stdout,index=False,align='c',squeeze=False,uwidth=2,spcwidth=1,kind="simple",margin=None):
lengths = []
if index: df = df.reset_index()
collen = len(df.columns)
delta = uw... |
__all__ = ('APIHooker', 'form', 'Config')
import functools
import json
import os
import re
import textwrap
import uuid
from typing import Iterable
from flask import render_template, request, redirect
class APIHooker:
def __init__(self, app, upload='data'):
self._app = app
self._upload = upload... |
import os
import numpy as np
import cv2
import pickle
from flask import Flask, flash, render_template, request, redirect, url_for
from sklearn.datasets import load_files
from keras.applications.resnet50 import ResNet50, preprocess_input
from keras.preprocessing import image
from keras.models import load_model
from werk... |
import os
import h5py
import math
import copy
from tqdm import tqdm
import torch
import torch.nn as nn
import itertools
from torch.utils.data import DataLoader
import torch.optim as optim
from torch.utils.tensorboard import SummaryWriter
import numpy as np
import skimage.io as skio
import utils.io as io
from utils.con... |
from collections import defaultdict, deque
import dataclasses
import numpy
import re
from typing import Dict, List, Set
import utils
@dataclasses.dataclass
class Edge:
actual: str
def _symetrical_string(self) -> str:
return "".join(sorted([self.actual, self.actual[::-1]]))
def _... |
import csv, sys, time
data = []
wordFreq = {}
totalWords = set()
# spreadsheetWords = set()
# nonSpreadsheetWords = set()
def testPost(term, poem, numOccur, partSpeech, definition, tags):
# def testPost(term, poem, numOccur, context, partSpeech, officialDef, tags, etymology, webster1907Def, oedDef, loyUsage, categori... |
"""
An active learning example using linear regression.
-- <EMAIL>
"""
# pylint: disable=invalid-name
# pylint: disable=no-name-in-module
# pylint: disable=abstract-method
import numpy as np
try:
from scipy.stats import multivariate_normal
except ImportError:
from numpy.random import multivariate_normal
# Loc... |
from pyspark import SparkContext, SparkConf, StorageLevel
import urllib3
import re
from bet_database import SqlMaker
import time
# from surebets_calculator import surebet
def loadPage(url):
# Fetching all content from url
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
url_... |
from __future__ import absolute_import, print_function
import logging
import pprint
import json
from googleapiclient.discovery import build as google_build
from oauth2client.client import GoogleCredentials
from six import iteritems
from . import utils
from .s3 import events_s3
from .schema import mk_bigquery_schema
... |
import argparse
import os
import os.path as osp
import numpy as np
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from feat.dataloader.samplers import CategoriesSampler
from feat.utils import pprint, set_gpu, ensure_path, Averager, Timer, count_acc, compute_confidence_interval
from... |
#!/usr/bin/env python3
# coding: utf-8
# Copyright 2016 <NAME>, https://github.com/tywtyw2002, and https://github.com/treedust
#
# 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:/... |
from pathlib import Path
from cfpq_data import RSM
from pyformlang.cfg import CFG
from pygraphblas import Matrix, BOOL
from src.graph.graph import Graph
from typing import Iterable, Union
from src.grammar.rsa import RecursiveAutomaton
from src.graph.label_graph import LabelGraph
from src.problems.AllPaths.algo.tensor.... |
from collections import namedtuple
from .cellobject import make_cell
from bytefall._internal.cache import GlobalCache
from bytefall._internal.exceptions import VirtualMachineError
__all__ = ['Block', 'Frame']
_Namedtuple_Block = namedtuple('Block', 'type, handler, level')
class Block(_Namedtuple_Block):
__slo... |
import os
import pyttsx3
import speech_recognition as sr
from fuzzywuzzy import fuzz
import datetime
import win32com.client as wincl
import time
import sqlite3
from progress.bar import IncrementalBar
import site
import calculator
import envelope
import translator
conn = sqlite3.connect(r'DataBase/tes... |
import os, inspect, time, scipy.misc, pickle
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
PACK_PATH = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))+"/.."
def make_dir(path):
try: os.mkdir(path)
except: print("%s is already exists." %(path))
def data2... |
# -*- coding: utf-8 -*-
"""
Compares spin resampling arrays when using different parcel centroid definition
methods and different nulls that rely on parcel centroids
"""
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial.distance import cdist
import seaborn as sns
from net... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
The pre-matching parts of the procedure for simulating the merger/ringdown
portions of gravitational waves from binary black holes, collected into modular
functions.
"""
import numpy as np
def quasi_normal_modes(eta):
"""
Calculation of the final spin and qua... |
"""Verify that the CGR implementations yield the same routing decisions."""
import argparse
from multiprocessing import Pool
from io import StringIO
from collections import OrderedDict
import sys
from pydtnsim import Simulator, ContactPlan, ContactGraph, Contact
from pydtnsim.nodes import SimpleCGRNode
from pydtnsim.... |
from time import time
from typing import List, Dict, Iterable
import numpy
import plotly.graph_objects as go
from plotly.subplots import make_subplots
from assignment_2_3_4.config import COLORS
from assignment_2_3_4.line_searches import AbstractLineSearch
from assignment_2_3_4.optimizers import AbstractOptimizer, Opt... |
import os
import numpy as np
import torch
from torchvision import datasets, transforms
from datasets.sbmnist import load_sbmnist_image
class StackedMNIST(datasets.MNIST):
def __init__(self, root, train=True, transform=None, target_transform=None, download=False):
super().__init__(root=root, transform=tran... |
# Copyright 2017 reinforce.io. 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 or... |
import json
import logging
from django.conf import settings
from django.contrib.auth.models import User
from django.http import Http404, HttpResponse
from django.shortcuts import get_object_or_404
import django_filters
from drf_yasg.utils import swagger_auto_schema
from rest_framework import exceptions as drf_excepti... |
# -*- coding: utf-8 -*-
# Copyright (C) 2012, <NAME>
#
# This code is subject to the (new) BSD license:
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the abov... |
# Copyright 2015 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 required by applicable law or a... |
import matplotlib as plt
import numpy as np
from qiskit import QuantumCircuit, Aer, transpile, assemble
from qiskit.visualization import plot_histogram
from math import gcd
from numpy.random import randint
import pandas as pd
from fractions import Fraction
print("Imports Successful")
### Problem: Period Finding
# Bu... |
"""
Pre-train classifiers
Author: <NAME>
Date: 04/19/2016
"""
import os
import re
import Porter_stemming as ps
import math
from sklearn.svm import SVC
from sklearn.neighbors import KNeighborsClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.externals import joblib
# Helper function
def tokenize_... |
import face_recognition
import cv2
import os
import numpy as np
from keras.models import load_model
from statistics import mode
from utils.datasets import get_labels
from utils.inference import detect_faces
from utils.inference import draw_text
from utils.inference import draw_bounding_box
from utils.inference import a... |
"""Tests for the base printer.
"""
import subprocess
import textwrap
import pytest
from drudge import Drudge, Range
from sympy import Symbol, IndexedBase, symbols
from sympy.printing.python import PythonPrinter
from gristmill import BasePrinter, FortranPrinter, EinsumPrinter, mangle_base
@pytest.fixture(scope='mod... |
#!/usr/bin/env python
import isilon
import logging
import argparse
import threading
import Queue
import json
import time
import httplib
import pprint
import collections
pp = pprint.PrettyPrinter(indent=4)
#httplib.HTTPConnection.debuglevel = 1
logging.basicConfig()
logging.getLogger().setLevel(logging... |
from django.db import transaction
from django.contrib.postgres.aggregates import ArrayAgg
from ..models import Media
from ..models import MediaType
from ..models import StateType
from ..models import State
from ..models import Project
from ..schema import StateTypeListSchema
from ..schema import StateTypeDetailSchema
... |
import os
import sys
from helpers.preprocessing_helper import *
import time
from datetime import datetime
# run weather_parser.py to generate data/weather.csv before
def sum_times(x, year, time_col):
year_time = time.mktime(datetime.strptime(str(x[year]), "%Y").timetuple())
return year_time + int(x[time_col... |
import re
import pandas as pd
import numpy as np
import jieba.posseg as pseg
import jieba
entity_ac = np.array(('原告', '上诉人', '申请人'))
entity_df = np.array(('被告', '被上诉人', '被申请人'))
entity = np.vstack((entity_ac, entity_df))
### Ultimate function we need is Entity_Extractor()
def StruStr(String):
pattern = ':|:|。|、... |
import boto3
import requests
import os
from datetime import datetime, timezone
import pprint
import json
import logging
log = logging.getLogger('rs_tracker_lambda')
log.setLevel(logging.DEBUG)
bucket = os.environ['bucket']
def lambda_handler(event=None, context=None):
"""
Handle main functionality
... |
import numpy as np
import theano as th
import theano.tensor as tt
import theano.tensor.signal.conv as sigconv
from .layer import Layer
float_x = th.config.floatX
# ############################## Input Layer ##################################
class InputLayer(Layer):
def __init__(self, inpt, img_sz, num_maps=1,... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2021/7/15 2:47 下午
# @File : my_ppo.py
# @Author: johnson
# @Desc : 使用stable-baseline3 的PPO算法
import os
import sys
import time
import gfootball.env as football_env
import argparse
from stable_baselines3 import PPO
from stable_baselines3.common.callbacks import C... |
# flake8: noqa
"""
Example docker deployment to AWS ECS cluster.
The script does the following:
1. Loads environment variables from .env file in the project root
For each service in TASKS
2. Generates a populated ECS task definition
- You can configure your task definitions in the get_task_defin... |
from flask import Flask, render_template, request
from pandas import read_excel
from datetime import datetime
import os
import pdfkit # pdfkit requires that wkhtmltopdf be installed in order to work
import platform
import shutil
import socket
NAME_DICTIONARY = {
'Fresh Food': 'fresh-food',
'Freezer Meats':... |
import subprocess
import zmq
import time
class PortManager(object):
"""Port manager produces open ports within a defined range"""
def __init__(self, min_port, max_port):
super(PortManager, self).__init__()
self.max_port = max_port
self.min_port = min_port
self.low_port = min_port
def get_port(self):
sel... |
"""Associate submissions to users through project groups.
Revision ID: a364e6e9c14
Revises: 3<PASSWORD>
Create Date: 2013-09-18 16:24:20.626636
"""
# revision identifiers, used by Alembic.
revision = 'a364e6e9c14'
down_revision = '34ac45196731'
from alembic import op
from sqlalchemy.sql import table, column
import ... |
import logging
import asyncio
from typing import Union, List, Optional, TYPE_CHECKING, Iterable, Callable, Awaitable
from aiohttp import web
from aiohttp.web_request import Request
from aiohttp.web_response import Response
from aiohttp.web_urldispatcher import StaticResource
from slim.base.types.doc import Application... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
import scipy.io as scio
import cv2
import PIL as Image
import mediapipe as mp
import torch
import numpy as np
# a = scio.loadmat("D:\Dataset\Hand_Dataset\hand_dataset\\training_dataset\\training_data\\annotations\Buffy_17.mat")
# b = list(a['boxes'])
# c = cv2.imread("D:\Dataset\Hand_Dataset\hand_dataset\\training_da... |
import pandas as pd
import argparse
import numpy as np
import seaborn as sns
import matplotlib.pylab as plt
titles = ["Evaluation on all documents", "Evaluation on tweets only"]
def visualize_days(path, count):
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(9, 3))
for enum, algo in enumerate(["louvain_macro_t... |
import torch
from torch.distributions import constraints, Beta, Uniform
from torch.distributions.transformed_distribution import TransformedDistribution
from torch.distributions.transforms import AffineTransform, PowerTransform
from torch.distributions.utils import broadcast_all
from torch.distributions.gumbel import ... |
#! /usr/bin/env python
"""
A set of plotting utilities.
"""
# ==========================================================================================================================================================
# Copyright 2021 Carnegie Mellon University.
#
# NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND S... |
from pprint import pprint
import math
from typing import List, Tuple, Dict
from algorithm.dummy import is_consistant,select_unassigned_variable as dummy_select_unassigned_variable
from model.case import case
from utils.paths.points import get_constrained_nighbours
from utils.paths.modifiers import refresh_connected_ter... |
#!/usr/bin/env python3
'''
this script is used to scrape the data from a popular weather website
'''
# loading necessary modules
import urllib.request
import pandas as pd
import random
from sqlalchemy import create_engine
from datetime import date, timedelta
import time
# Postgres_helpers
# Functions us... |
"""
Unit and regression test for the despasito package.
"""
# Import package, test suite, and other packages as needed
import despasito.input_output.read_input as ri
import despasito.parameter_fitting as fit
import despasito.equations_of_state
import pytest
import sys
import numpy as np
## EOS Object
beads = ["CH3OH"... |
from __future__ import absolute_import
import glob
import os
import sys
import random
import shutil
import tempfile
import datetime
import traceback
from unittest import TestCase
import numpy as np
from numpy.testing import assert_equal, assert_array_equal
def assert_tail_equal(a, *rest, **kwargs):
"""Assert th... |
import argparse
import hail as hl
import pandas as pd
import string
from itertools import product
from fm_insights import checkpoint_tmp, register_log
def merge_info(overwrite=False):
ht = hl.import_table(
"gs://meta-finemapping-simulation/imputed_info/*.bgz",
impute=True,
source_file_fiel... |
# flake8: noqa
from functools import partial
import os
from tempfile import TemporaryDirectory
from pytest import mark
import torch
from torch import nn, optim
from torch.utils.data import DataLoader
from catalyst import dl, utils
from catalyst.contrib.datasets import MNIST
from catalyst.data import ToTensor
from c... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import bisect
import copy
import logging
import torch.utils.data
from maskrcnn_benchmark.utils.comm import get_world_size
from maskrcnn_benchmark.utils.imports import import_file
from . import datasets as D
from . import samplers
from .collate_b... |
# Imports
from os import system, name
import pyautogui
#
# Variable Declaration/Config
#
# Pyautogui config
pyautogui.FAIL_SAFE = True
pyautogui.PAUSE = .6
# Modifiers:
mouse_duration = .15
key_duration = .2
# Fun & games (at work?!)
counter = 0
animation_display_count = 3
# Events list:
... |
"""
Lab 4
"""
import re
from lab_4.ngrams.ngram_trie import NGramTrie
def tokenize_by_sentence(text: str) -> tuple:
if not isinstance(text, str):
raise ValueError
sentences = re.split(r'[.?!]', text)
tokens_list = []
for sentence in sentences:
tokens = re.sub(r'[^a-z \n]', '', sente... |
from database_handler.database_handler import DatabaseHandler
from grounding_lib.spatial import SpatialRelation, StatusEnum
import numpy as np
from typing import Optional
from scripts.vision_controller import VisionController as FakeVisionController
from enum import Enum
class GroundingErrorType(Enum):
UNKNOWN = ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import re
import sqlalchemy as sa
from sqlalchemy.ext.hybrid import Comparator, hybrid_property
from sqlalchemy.ext.declarative import declared_attr
from hyputils.memex._compat import string_types
from hyputils.memex.db import Base
from ... |
from __future__ import print_function
import os
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from torch.autograd import Variable
import torch.optim as optim
from torchvision import datasets, transforms
from models.wideresnet import *
from models.resnet import *
... |
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
import unittest
from contextlib import contextmanager
from textwrap import dedent
from pants.base.exceptions import DuplicateNameError, UnaddressableObjectError
from pants.base.... |
import os
import warnings
import pandas as pd
from argparse import ArgumentParser
from autopandas_v2.generators.ml.traindata.generation import ArgDataGenerator, RawDataGenerator, \
FunctionSeqDataGenerator
from autopandas_v2.utils import logger
from autopandas_v2.utils.cli import subcommand, ArgNamespace
def p... |
# Natural Language Toolkit: Language Models
#
# Copyright (C) 2001-2021 NLTK Project
# Authors: <NAME> <<EMAIL>>
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
"""Language Model Interface."""
import random
from abc import ABCMeta, abstractmethod
from bisect import bisect
from itertools impor... |
from __future__ import absolute_import
from __future__ import print_function
import logging
import requests
from .base import Provider as BaseProvider
logger = logging.getLogger(__name__)
def ProviderParser(subparser):
identity_group = subparser.add_mutually_exclusive_group()
identity_group.add_argument("-... |
from next_hop import NextHop
from packet_common import ip_prefix_str
from utils import system_id_str
DEST_TYPE_NODE = 1
DEST_TYPE_PREFIX = 2
DEST_TYPE_POS_DISAGG_PREFIX = 3
DEST_TYPE_NEG_DISAGG_PREFIX = 4
def make_node_dest(system_id, name, cost, is_leaf):
return SPFDest(DEST_TYPE_NODE, system_id, name, None, set... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
import six
import time
from exam import fixture, patcher
from sentry.quotas.redis import (
is_rate_limited,
BasicRedisQuota,
RedisQuota,
)
from sentry.testutils import TestCase
from sentry.utils.redis import clusters
def test_i... |
import time
from functools import update_wrapper
from multiprocessing import Process
from typing import Callable, List
import click
from gs_manager.utils import get_param_obj, surpress_stdout
def require(param: str):
"""
decorator for a Click command to enforce a param from CLI or config
"""
def _w... |
"""
commandline utilities functions
"""
import json
import os
import re
import subprocess
import sys
from shopyoapi.init import db
from shopyoapi.uploads import add_admin
from shopyoapi.uploads import add_setting
from shopyoapi.uploads import add_uncategorised_category
from shopyoapi.cmd_helper import remove_pycache
f... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
"""A collection of full training and evaluation pipelines."""
import collections.abc
import json
import time
from dataclasses import dataclass
from pathlib import Path
from typing import Any, List, Mapping, Optional, Sequence, Type, Union
import pandas as pd
import torch
from class_resolver import FunctionResolver, H... |
import sdeint
import complex_analysis
import numpy as np
import numexpr as ne
from typing import Type, List, NoReturn, Union, Dict
RealNumber = Union[np.float16, np.float32, np.float64, float];
ComplexNumber = Union[np.complex64, np.complex128];
def vslit_zip(z:Un... |
import requests as rq
import json
import time
from datetime import datetime
import urllib3
import logging
import dotenv
from random_user_agent.user_agent import UserAgent
from random_user_agent.params import SoftwareName, HardwareType
logging.basicConfig(filename='Shopifylog.log', filemode='a', format='%(asctime)s - %... |
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import sys
import random
import numpy as np
import scipy as scp
import scipy.misc
import tensorflow as tf
import fcn16_vgg
import loss
import utils
RESOURCE = '../datase... |
import pybullet
import math
def groundVertices(size, basez, world, base_position, view_range, chunk_view_adjustment):
"""This is a function which takes a set of vertices, the size of the
desired square and base z and returns the triangles for OpenGL to render.
It also creates the collision shape for the terrai... |
# -*- coding: utf-8 -*-
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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 app... |
# Copyright 2020 - 2021 MONAI Consortium
# 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 wri... |
# ZCA and MeanOnlyBNLayer implementations copied from
# https://github.com/TimSalimans/weight_norm/blob/master/nn.py
#
# Modifications made to MeanOnlyBNLayer:
# - Added configurable momentum.
# - Added 'modify_incoming' flag for weight matrix sharing (not used in this project).
# - Sums and means use float32 datatyp... |
from opentrons.types import Point
from opentrons.protocol_api import execute_v3, ProtocolContext, execute
from opentrons.protocols.parse import parse
def test_load_labware_v2(loop, get_labware_fixture):
ctx = ProtocolContext(loop=loop)
custom_trough_def = get_labware_fixture('fixture_12_trough')
data = {
... |
# ===============================================================================
# Copyright 2014 <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/... |
from Modules import *
def make_model(src_vocab, tgt_vocab, N=6, d_model=256, d_ff=512, h=4, dropout=0.1):
c = copy.deepcopy
attn = MultiHeadedAttention(h, d_model)
ff = PositionwiseFeedForward(d_model, d_ff, dropout)
position = PositionalEncoding(d_model, dropout)
model = EncoderDecoder(En... |
"""Utilities for loading raw genomics data from the git repo
https://github.com/NelleV/genomic_time_series_bnp into a format that
can be used with our analyis.
Before using this scripts, you must:
1. Run ``make`` in ``genomic_time_series_bnp/data/``
2. Then run `make all` in
``genomic_time_series_bnp/src/explorator... |
#!/usr/bin/env python2
## -*- coding: utf-8 -*-
##
## $ ./build/triton ./src/examples/pin/path_constraints.py ./src/samples/crackmes/crackme_xor a
## [+] 10 bytes tainted from the argv[1] (0x7ffd4a50c60e) pointer
## loose
## B1: SymVar_0:8 = 65 (e) | B2: SymVar_0:8 = 0 ()
##
## $ ./build/triton ./src/examples/pi... |
'''
sphinxcontrib.swf
~~~~~~~~~~~~~~~~~
This module provides :rst:directive:`swf`, which you can use to embed
flash objects into your documentation.
'''
from docutils import nodes
from docutils.parsers.rst import Directive, directives
import os, sys, re, shutil
__version__ = '0.3'
def bool_optio... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" test_processinblocks.py
Description:
"""
__author__ = "<NAME>"
__copyright__ = "Copyright 2021, <NAME>"
__credits__ = ["<NAME>"]
__license__ = ""
__version__ = "0.1.0"
__maintainer__ = "<NAME>"
__email__ = ""
__status__ = "Prototype"
# Default Libraries #
import asynci... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
# Copyright (c) 2017 <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without lim... |
"""This module contains the general information for LsbootHdd ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class LsbootHddConsts:
STATE_DISABLED = "Disabled"
STATE_ENABLED = "Enabled"
SUBTYPE_LOCALHDD = "LOCALHDD... |
"""This module contains classes and functions to work with video files. It
depends on FFmpeg.
"""
import pathlib
import numpy as np
from .ffmpeg import videofileinfo, iterread_videofile, count_frames, \
get_frameat, extract_audio
from .frameprocessing import frameiterator
from .utils import progress, walk_paths
... |
"""This module implements many helper functions to check types."""
from __future__ import annotations
import logging
import numbers
from collections.abc import Sequence
from typing import Any
from typing import Iterable
from typing import Mapping
from typing import Sized
import numpy as np
from typing_extensions impo... |
# Copyright (c) 2013, <NAME> <<EMAIL>>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty, Tags
from .validators import positive_integer, s3_bucket_name
try:
from awacs.aws import Policy
policytypes = (dict, Policy)
except ImportError:
policytypes = dict,
P... |
import json
import logging
import os
import traceback
from abc import abstractmethod, ABC
from collections import Iterator, Iterable
from logging import Logger
from typing import Union, Any, Callable
from commentjson import commentjson
from rx import Observable, from_
from rx.core.abc import Observer
from faddist.ref... |
# Copyright 2021-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 agreed to ... |
# Copyright (c) 2004 Divmod.
# See LICENSE for details.
from nevow.testutil import TestCase
from nevow.flat.flatsax import parse, parseString
from nevow.flat import flatten
from nevow.stan import Tag, slot
def norm(s):
return ' '.join(s.split())
class Basic(TestCase):
"""
Tests for Nevow documents which... |
##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
# -*- coding: utf-8 -*-
import os
import unittest
import sqlalchemy as sa
from repository import Repository
import db
class Tag2:
def __init__(self, label, description=None, comment=None, num_of_tables=0):
assert isinstance(label, unicode)
assert isinstance(description, unicode) or description ... |
"""
Google OpenId, OAuth2, OAuth1, Google+ Sign-in backends, docs at:
https://python-social-auth.readthedocs.io/en/latest/backends/google.html
"""
from ..exceptions import AuthMissingParameter
from ..utils import handle_http_errors
from .oauth import BaseOAuth1, BaseOAuth2
class BaseGoogleAuth:
def get_user_i... |
# 30.05.2007, c
# last revision: 25.02.2008
from __future__ import absolute_import
from sfepy import data_dir
import six
filename_mesh = data_dir + '/meshes/2d/square_unit_tri.mesh'
material_1 = {
'name' : 'coef',
'values' : {
'val' : 1.0,
},
}
material_2 = {
'name' : 'm',
'values' : {
... |
import pandas as pd
from pandas.core.frame import DataFrame
import numpy as np
import json
def get_acc(RATIO1, RATIO2, RATIO3):
pred1 = np.load('resnet_pred.npy')
pred2 = np.load('xception_pred.npy')
pred3 = np.load('densenet_pred.npy')
pred4 = np.load('inception_resnet_pred.npy')
lookup_table = j... |
#!/usr/bin/env python
"""
setup.py: Install ForceBalance.
"""
from __future__ import print_function
__author__ = "<NAME>"
from setuptools import setup,Extension
import os,sys,re
import shutil
import glob
import argparse
import subprocess
#===================================#
#| ForceBalance version number |#
#| ... |
import discord
import custom_checks
import global_functions
from discord.ext import commands
from config import discordClient, DB_conn, cur
class ReactionRoles(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.group(invoke_without_command=True, aliases=["reactionroles", "reaction roles... |
import httplib2
import json
import os
from apiclient.discovery import build
from oauth2client.client import OAuth2WebServerFlow, flow_from_clientsecrets,Credentials
from oauth2client.file import Storage
from oauth2client.tools import run_flow, argparser
from utils import utils
class OAuthGmailAPI:
'''Authentic... |
# !/usr/bin/python3
# -*- coding: utf-8 -*-
# *****************************************************************************/
# * Authors: <NAME>, <NAME>
# *****************************************************************************/
""" configToText.py
This module contains the basic functions for turning a con... |
#####################################################################
#
# audio.py
#
# Copyright (c) 2015, <NAME>
#
# Released under the MIT License (http://opensource.org/licenses/MIT)
#
#####################################################################
from __future__ import print_function
import pyaudio
import n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.