text stringlengths 3.07k 22.1k |
|---|
"""
Launch material server
"""
import io
import errno
import json
import logging
import logging.config
import pkgutil
import inspect
from os import environ, strerror
from waitress import serve
from importlib import import_module
from pathlib import Path
from flask import Flask, jsonify, make_response, abort, reque... |
import dask.array as da
import numpy as np
import pytest
import astropy.modeling.models as m
import astropy.units as u
import gwcs
import gwcs.coordinate_frames as cf
from astropy.table import Table
from astropy.time import Time
from sunpy.coordinates.frames import Helioprojective
from dkist.dataset import Dataset
fr... |
import os
import torch
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from qutip import *
from plot_helpers import *
from model import load
import os
import matplotlib.ticker as mticker
train_end = 2
expo_start = 1.9732
expo_good_end = 6
np.random.seed(0)
torch.manual_seed(0)
matplotlib.rcParams... |
from __future__ import division, print_function, absolute_import
import os, sys
from collections import OrderedDict
import numpy as np
import pymongo as pm
import tensorflow as tf
from tfutils import base, data, model, optimizer, utils
import copy
NUM_GPUS = 1
if not isinstance(NUM_GPUS, list):
DEVICES = ['/gpu... |
import sys
import os
import re
#def read_json(json_name):
# json_text = open(json_name).read()
# json_dict = eval(json_text)
# json = sorted(json_dict.items(),
# key=lambda x: json_text.index('"{}"'.format(x[0])))
# #print(json)
# #json_lowercase = dict((k.lower(), v) for k, v in json.... |
# -*- coding: utf-8 -*-
from datetime import datetime
from dateutil.tz import tzlocal
import numpy as np
from pynwb import NWBFile, NWBHDF5IO, get_manager, ProcessingModule
from pynwb.device import Device
from pynwb.ecephys import LFP, ElectricalSeries
from pynwb.core import DynamicTable, DynamicTableRegion, VectorDat... |
# encoding: utf-8
import os
import time
import numpy as np
import numba
import argparse
from collections import OrderedDict
import torch
import torch.distributed as dist
from engine.logger import get_logger
logger = get_logger()
EPS = 1e-10
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet1... |
import mysql.connector
from elasticsearch import Elasticsearch
import elasticsearch.helpers
import pandas as pd
import numpy as np
from collections import defaultdict
import datetime
import os, re
def getLastTime(client, index):
"""
方法:查询指定索引记录的最新时间
返回:timestamp
"""
query_aggs = {
"size":... |
from enum import Enum
from ._ingenialink import ffi, lib
from ingenialink.utils._utils import *
from abc import ABC
# CANOPEN DTYPES
IL_REG_DTYPE_DOMAIN = 15
class REG_DTYPE(Enum):
"""Data Type."""
U8 = lib.IL_REG_DTYPE_U8
"""Unsigned 8-bit integer."""
S8 = lib.IL_REG_DTYPE_S8
"""Signed 8-bit i... |
"""IPC-ForceAtlas2: Network Layout using cuGraph
ForceAtlas2 layout algorithm through IPC using cuGraph.
"""
import numpy as np
try:
import cudf
import cugraph as cg
CUDF_AVAILABLE = True
except ImportError:
CUDF_AVAILABLE = False
from helios.layouts.base import NetworkLayoutIPCRender
from helios.l... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import json
from django.contrib import auth
from django.contrib.auth.backends import ModelBackend
from django.contrib.se... |
"""Split a BAM file by read supporting variants in a VCF file
"""
import argparse
import os
import operator
import pysam as ps
import ssw
def is_empty(values):
return len(values) == 0
def parse_region(region_str):
if ':' not in region_str or region_str[-1] == ':':
return region_str
else:
... |
'''Hypertrace wrapper around OTel GRPC instrumentor'''
import logging
import traceback
import grpc
from opentelemetry import trace
from opentelemetry.instrumentation.grpc import (
GrpcInstrumentorServer,
GrpcInstrumentorClient,
_server,
_client,
)
from opentelemetry.instrumentation.grpc.version import _... |
# This software is open source software available under the BSD-3 license.
#
# Copyright (c) 2020 Triad National Security, LLC. All rights reserved.
# Copyright (c) 2020 Lawrence Livermore National Security, LLC. All rights
# reserved.
# Copyright (c) 2020 UT-Battelle, LLC. All rights reserved.
#
# Additional copyright... |
#!/usr/bin/env python
from __future__ import division
from __future__ import print_function
import os
import re
import argparse
from wand.image import Image
from wand.exceptions import CoderError, CoderFatalError, CorruptImageError, \
CorruptImageFatalError, CorruptImageWarning, \
... |
from collections import OrderedDict
import torch
from torchvision.models import resnet18, resnet50
class NonLinearClassifier(torch.nn.Module):
def __init__(self, num_features: int = 128, num_hidden: int = 128, num_classes: int = 10):
super(NonLinearClassifier, self).__init__()
self.classifier = ... |
"""
Created on Mon Aug 25 13:17:03 2014
@author: anthony
"""
import time
from multiprocessing import Pool
import matplotlib.pyplot as plt
import numpy as np
import scipy.interpolate as interp
from .cp_tools import cp_loglikelihood
from .cp_tools import cp_loglikelihood_proj
from .cp_tools import cp_model
from .cp_to... |
from LanguagePrinter import LanguagePrinter
type_mappings = {
'BinNums.Z': 'int',
'Datatypes.bool': 'bool'
}
def convert_type(t):
global type_mappings
res = type_mappings.get(t)
if res:
return res
else:
return t
InstructionListCode = '''
typedef struct {
Instruction ins... |
"""AffinityTree and related objects definitions."""
import math
from typing import List, NewType, Dict, Optional
import newick
from pangtreebuild.pangenome import graph
from pangtreebuild.pangenome.parameters import msa
AffinityNodeID = NewType('AffinityNodeID', int)
class AffinityNode(object):
"""Node of Affi... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from builtins import range
from builtins import object
from .clustcompare import *
def _non_sequential_raise(basis):
"""Ensure that the linear function index of the cluster functions
is sane. That is, ... |
"""
This module provides utilities to assist in statistics calculations related
to SMYLE analysis. Functions provide tools to perform linear detrending along
a particular axis, determine skill metrics based on model and observation
DataArrays, and generate a distribution of skill scores using a smaller
ensemble member ... |
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import sys
def pa(lb, arr):
sys.stdout.write(lb+': ')
sys.stdout.write('[')
for a in arr:
sys.stdout.write('{:0.2E} '.format(a))
print(']')
def pi(lb, *ints):
sys.stdout.write(lb+': ')
for i in ints: ... |
import argparse
import imageio
import itertools
import matplotlib.pyplot as plt
import numpy as np
import os
import skimage
import yaml
import torch
import torch.backends.cudnn as cudnn
import _init_paths
from config import cfg
from config import update_config
from dataset.fecalbolidata import parse_fecal_boli_label... |
import numpy as np
import tensorflow as tf
import git
import copy
import functools
import time
import os
import pdb
from rl.tools.utils import logz
from rl.tools.online_learners import base_algorithms as bAlg
from rl.tools.online_learners.scheduler import PowerScheduler
from rl.tools import supervised_learners as Sup
... |
# -*- coding: utf-8 -*-
"""
"""
import os
import numpy as np
import pandas as pd
from oemof.network import Bus, Sink
from oemof.outputlib import views
from oemof.solph.components import GenericStorage
from oemof.tabular import facades
def component_results(es, results, select="sequences"):
""" Aggregated by co... |
import deep_experiment
import os
from data_loader import data_loader
import analyzer
import math
import matplotlib.pyplot as plt
import numpy as np
from datetime import datetime
import time
import utils
import csv
import pandas as pd
directory = os.path.dirname(os.path.abspath(__file__))
record_file_path = os.path.j... |
"""Source code for the Spanner probes the cloudprober will execute.
Each method implements Spanner grpc client calls to it's grpc backend service.
The latency for each client call will be output to stackdriver as metrics using
stackdriver_util.
"""
import os
from tracer import initialize_tracer
from google.cloud.spa... |
#!/usr/bin/env python
# Copyright (c) 2018 Mellanox Technologies, Ltd. All rights reserved.
# Licensed under BSD (MIT variant) or GPLv2. See COPYING.
"""This tool is used to create installable versions of the static libraries in rdma-core.
This is complicated because rdma-core was not designed with static libraries
i... |
# Copyright 2020 <NAME> (Falcons)
# SPDX-License-Identifier: Apache-2.0
#!/usr/bin/python
import math
import numpy as np
import pandas as pd
def convertTimeStamp(rtdbTimestamp):
return float(rtdbTimestamp[0]) + 1e-6 * float(rtdbTimestamp[1])
class BallMeasurement():
def __init__(self, sph, used=None, track... |
from StringIO import StringIO
from datetime import datetime, timedelta
import requests
from mock import patch
from spreedly.models import HttpUnprocessableEntity
from spreedly.models import Plan, Fee, FeeGroup, Subscription
from . helpers import SpreedlySubscriptionXML
from mocks import get_client_mock, set_client_moc... |
import os
import numpy as np
import h5py
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.utils import shuffle
import gc
import constants
def get_pixels_metadata(bg=False, n=-1, delta_R_min=float('-inf'), delta_R_max=float('inf'), same_file=False):
"""Return pixel data and meta... |
import h5py
from enum import Enum
import random
from typing import List, Dict, Tuple
from weighted_collection import WeightedCollection
from tdw.controller import Controller
from tdw.tdw_utils import TDWUtils
from tdw.librarian import ModelRecord, ModelLibrarian
from tdw_physics.dataset import Dataset
from tdw_physics.... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 15 09:36:48 2018
@author: mbarbier
"""
""" Clear all variables """
from IPython import get_ipython
get_ipython().magic('reset -sf')
import os
import argparse
from module_train import train
from module_utilities import writeDictToCsv
import time
from keras import losses
i... |
import bisect
import itertools
import random
from array import array
import pytest
from pygm import SortedList, SortedSet
def test_len():
assert len(SortedSet([1, 2, 3])) == 3
assert len(SortedSet([3, 1, 4, 3])) == 3
assert len(SortedSet([1] * 10)) == 1
def test_init():
assert list(SortedSet()) == ... |
"""
api for aggregation requests
"""
from typing import Optional
import pandas as pd
from pylana.aggregation.groupings import create_grouping
from pylana.aggregation.metrics import create_metric
from pylana.api import API
def extract_chart_values(jsn):
"""Cast json into data frame and remove artifacts columns... |
import torch
import torch.nn as nn
from torch.nn.init import kaiming_normal_, constant_
import torch.nn as nn
import torch.nn.functional as F
def conv(batchNorm, in_planes, out_planes, kernel_size=3, stride=1):
if batchNorm:
return nn.Sequential(
nn.Conv2d(in_planes, out_planes, kernel_size=ke... |
# Code adapted from https://github.com/andreasveit/triplet-network-pytorch/blob/master/train.py
from __future__ import print_function, division
import argparse
import os
import shutil
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torchvision
from torchvision impor... |
import pygame
import sys
import time
import random
class GridCell():
ocqupied = False
def __init__(self,x,y,width,height, pos, text='', color=(255,255,255)):
self.color = color
self.x = x
self.y = y
self.width = width
self.height = height
self.text = text
... |
import os
import random
from pathlib import Path
import numpy as np
import pandas as pd
import torch
from sklearn.metrics import accuracy_score, roc_auc_score
from sklearn.model_selection import StratifiedKFold
from sklearn.preprocessing import LabelEncoder
from torch import nn, optim
from torch.utils.data import Data... |
# coding: utf-8
# In[1]:
import mxnet as mx
import numpy as np
import matplotlib.pyplot as plt
import cv2
import scipy.io as sio
import pylab as pl
from collections import namedtuple
import time
Batch = namedtuple('Batch', ['data'])
# In[2]:
MAX_INPUT_DIM=5000.0
prob_thresh = 0.5
nms_thresh = 0.1
# In[3]:
def ... |
import copy
import importlib
import os
import time
from pathlib import Path
import operator
from flamingo.conf import default_settings
from flamingo.utils import exc
ENVIRONMENT_VARIABLE = "FLAMINGO_SETTINGS_MODULE"
empty = object()
def new_method_proxy(func):
def inner(self, *args):
if self._wrapped is... |
import math
import random
import Mutation
import Species
from Types import types, type_dict
# Configure the max number for base stat total here.
BASE_STAT_MAX = 600
# Returns the multiplier for damage on an attack against a Pokemon.
def damage_mult(attacking_move_type, attacked_pokemon_type_primary, attacked_pokemon_... |
import logging
from typing import List, Optional, Sized, Tuple
from PyQt5.QtCore import QObject, pyqtSignal
from concentration.fuzzy.classes import Interval
from concentration.interval import IntervalType
from util.logger import setup_logger
from util.path import to_abs_path
from util.sliding_window import DoubleTime... |
#!/usr/bin/env python
# -*- coding: utf-8; indent-tabs-mode: nil; python-indent: 2 -*-
"""Read bookmarks saved in a "Netscape bookmark" format
as exported by Microsoft Internet Explorer or Delicious.com (and
initially of course by Netscape).
Assumptions:
- The file is a Netscape bookmark file.
See a doc at http://m... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: valengo
"""
import contextlib
import sys
from collections import defaultdict
import configparser
import os
import errno
from typing import Union, Sized
import pkg_resources
from pandas import DataFrame
class GenericDescriptor(object):
"""
Get and s... |
# -*- coding: utf-8 -*-
import os
import unittest
from flask import Flask
from nose.tools import * # noqa (PEP8 asserts)
from framework.routing import Rule, json_renderer
from framework.utils import secure_filename
from website.routes import process_rules, OsfWebRenderer
from website.util import paths
from website.ut... |
import pygame
import random
import os
import time
import neat
pygame.font.init()
# game window dimensions
WIN_WIDTH = 900
WIN_HEIGHT = 600
# font variables
STAT_FONT = pygame.font.SysFont("comicsans", 50)
# initialize pygame window
WIN = pygame.display.set_mode((WIN_WIDTH, WIN_HEIGHT))
pygame.display.set_caption("Sp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
# CODE NAME HERE
# CODE DESCRIPTION HERE
Created on 2019-10-04 at 14:14
@author: cook
"""
import numpy as np
import os
import glob
from collections import OrderedDict
# =============================================================================
# Define variables
... |
import json
import requests
import os
from dataclasses import dataclass
from pprint import pprint
from datetime import datetime, timedelta
from collections import Counter
import numpy as np
import fire
import textwrap
from geopy import geocoders
from PIL import Image, ImageFont, ImageDraw
def _get_lon_lat_from_loc_st... |
# -*- coding: utf-8 -*-
import megengine as mge
import megengine.random as rand
import megengine.functional as F
import numpy as np
from config import config
from det_opr.bbox_opr import box_overlap_opr, bbox_transform_opr, box_overlap_ignore_opr
import pdb
def fpn_roi_target(rpn_rois, im_info, gt_boxes, fg_threshold ... |
import argparse
from collections import Counter
from unidecode import unidecode
import progressbar
import pandas as pd
from graphbrain.hypergraph import HyperGraph
from graphbrain.funs import *
import graphbrain.nlp.parser as par
import graphbrain.synonyms.synonyms as syn
MAX_PROB = -12
def read_predicate_table(fil... |
# This code is used to run logistic regression or the random forest classifier on the embedding
# of a tweet. To get an embeddings for the whole tweet we are averaging glove word embeddings.
# The Stanford University already has precomputed glove word embeddings for Twitter:
# https://nlp.stanford.edu/projects/glove/
... |
from .dolphin_api import DolphinAPI
from copy import deepcopy
class BaseEnv():
def __init__(self, frame_limit = 100000, pid = 0, options = {}):
self.api = DolphinAPI(**options)
self.frame_limit = frame_limit
self.pid = pid # player id
self.obs = None
self.prev_obs = None
... |
import sys, operator
import Xlib
import Xlib.display
import Xlib.ext.xinerama as xinerama
from Xlib import X, XK, Xatom
import Xlib.protocol.event as event
import command, utils
class QTileError(Exception): pass
class Key:
def __init__(self, modifiers, key, action, *args, **kwargs):
self.modifiers, self... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
"""
This module starts a webserver and handles websockets for the generic game server
"""
import posixpath
import base64
import hashlib
import struct
import os
import errno
import threading
import logging
log = logging.getLogger("web")
log.setLevel(logging.INFO)
_base_path = os.path.join(os.path.dirname(os.path.r... |
import torch
from inplace_abn import active_group, set_active_group
from grasp_det_seg.utils.bbx import shift_boxes
from grasp_det_seg.utils.misc import Empty
from grasp_det_seg.utils.parallel import PackedSequence
from grasp_det_seg.utils.roi_sampling import roi_sampling
from .detection import DetectionAlgo
from .rpn... |
from enum import Enum
HOUSE = 'House'
HOTEL = 'Hotel'
class Card():
def __init__(self, index, value):
self.index = index
self.value = value
class Cashable(Card):
pass
class CashCard(Cashable):
def __repr__(self):
return f'<CashCard (${self.value})>'
class ActionCard(Cashable)... |
import cv2
import numpy as np
import utils
import logging as log
import time
import csv
from model import FaceDetectorModel, FaceLandmarksModel, HeadPoseModel, GazeModel
from mouse_controller import MouseController
from argparse import ArgumentParser
log.basicConfig(level=log.DEBUG)
def build_argparser():
... |
#
# Copyright (c) 2017-2021 NVIDIA CORPORATION. All rights reserved.
# This file is part of the WebDataset library.
# See the LICENSE file for licensing terms (BSD-style).
#
"""Train PyTorch models directly from POSIX tar archive.
Code works locally or over HTTP connections.
"""
import os
import random
import sys
i... |
import io
from datetime import datetime, timedelta
import pytest
from disnake import Color, Embed, File
from disnake.utils import MISSING, utcnow
_BASE = {"type": "rich"}
@pytest.fixture
def embed() -> Embed:
time = utcnow() + timedelta(days=42)
return Embed(
type="link",
title="wow",
... |
import os
import yaml
# import copy
import testinfra.utils.ansible_runner
import requests
from ansible.inventory.manager import InventoryManager
from ansible.vars.manager import VariableManager
from ansible.parsing.dataloader import DataLoader
ansible_runner = testinfra.utils.ansible_runner.AnsibleRunner(
os.env... |
#!/usr/bin/env python
"""
Everything goes here when they do not fit anywhere else
Copyright 2017 California Institute of Technology
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
ht... |
from pathlib import Path
from importlib import import_module
from typing import List
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import train_test_split
from scipy.io import arff
from enum import Enum
import pandas as pd
import numpy as np
import re
import json
from autogoal.kb import ... |
# Date: Feb 2020
# Authors: <NAME> & <NAME>
# Affiliations: University of California San Diego
# Contact Information: <EMAIL>, <EMAIL>
from __future__ import print_function
import time
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torch.nn.functional as F
import torch.optim as optim
... |
from util import *
import numpy as np
K = np.array( [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0... |
import logging
import os.path
import sys
import pytest
from robocode_vscode.protocols import ActivityInfoDict, WorkspaceInfoDict, ActionResult
from typing import List
import time
from robocode_vscode_tests.protocols import IRobocodeLanguageServerClient
import py
log = logging.getLogger(__name__)
def test_missing_mes... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 24 11:53:16 2020
@author: gregz
"""
import matplotlib
matplotlib.use('agg')
import seaborn as sns
import matplotlib.pyplot as plt
from astropy.io import fits
import numpy as np
import sys
import glob
from astropy.convolution import convolve, Gaussia... |
# https://pyautogui.readthedocs.io/en/latest/
import pyautogui
import time
import keyboard
import sys
DOING_POINT_FINDING = False
SLEEP_BETWEEN_CLICKS_S = 0.05
# Replay, Next, Auto
POWER_BATTLE_ITEM_POINTS = [(868, 808), (930, 808), (990, 808), (1063, 808)]
POWER_HERO_POINTS = [(785, 881), (869, 881), (960, 881), (1... |
import setuptools
import os
import requests
import logging
import microcache
import pypandoc
import funcy
from . import helpers
# packaging got moved into its own top-level package in recent python versions
try:
from pkg_resources.extern import packaging
except ImportError:
import packaging
logger = logging.g... |
import sys
import json
from copy import copy
import numpy as np
import ds_format as ds
READ_EXT = ['ds']
WRITE_EXT = ['ds']
TYPES = {
'f': 'float',
'i': 'int',
'u': 'uint',
'b': 'bool',
'U': 'unicode',
'S': 'str',
}
class JSONEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, np.generic):... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
import sys
from PIL import Image
import io
def pad(a):
return "0"*(2-len(a)) + a
#def pad_bytes(data):
# return b"\0"*(2)
def generate_palette_t(data):
offset = 0
out_upper = []
out_lower = []
out_txt = ""
while offset<len(data):
out = (data[offset+2] >> 4) << 8 | (data... |
# code referenced from https://github.com/vincentherrmann/pytorch-wavenet/blob/master/model_logging.py
import threading
from io import BytesIO
import time
import tensorflow as tf
import numpy as np
from PIL import Image
import torch
class Accumulator:
def __init__(self, *keys):
self._values = {key: 0. fo... |
# -*- codeing = utf-8 -*-
from bs4 import BeautifulSoup # 网页解析,获取数据
import re # 正则表达式,进行文字匹配`
import urllib.request, urllib.error # 制定URL,获取网页数据
import xlwt # 进行excel操作
import time
import random
import re
import time
import requests
import threading
from lxml import html
etree=html.etree
from bs4 import BeautifulSo... |
# Database stuff for modules to store their stuff in.
import time
import datetime
import sqlite3
import threading
from . import version as michiru, \
config
config.item('db_file', 'db.sqlite3')
DB_FILE = config.get('db_file')
# SQLite 3 data definitions for abstraction.
INT = 'integer'
UINT = 'unsigned... |
""" Slide Editor.
"""
import numpy as np
from collections import UserDict
from collections.abc import Sequence
from figpptx.renderers import DummyRenderer
from matplotlib.artist import Artist
from figpptx import artist_misc
class SlideEditor:
"""This Class possess all the information required for adding ``Shapes`... |
from flask import Flask, request, jsonify, render_template
app = Flask(__name__)
'''
在线验证邮箱真实性
'''
import os
import random
import re
import smtplib
import logging
import subprocess
import time
import traceback
import dns.resolver
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s - ... |
# -*- coding: utf-8 -*-
"""
A minimalist klout API interface. Use of this API
requires klout *developer key*. You can get registered and
get a key at
<http://klout.com/s/developers/v2>
Supports Python >= 2.5 and Python 3
====================
Quickstart
====================
Install the PyPi package::
... |
"""
BSD 2-Clause License
Copyright (c) 2021, CGLAB
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of c... |
from cloudscraper import create_scraper
from diskcache import FanoutCache
from bs4 import BeautifulSoup
from typing import NamedTuple, Union, Set, List
from urllib.parse import urlparse
import copyreg, ssl
import re
url_pattern = re.compile('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))... |
#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
import discord
from discord.ext import commands
from discord import utils
import asyncio
import random
import json
import time
with open('CYBORGBASEDATA.json') as json_data:
database = json.load(json_data)
prefix = database['prefixes']
greetings = ["Sup!", "Wass... |
from binascii import hexlify
from binascii import unhexlify
from logging import getLogger
from sqlite_dissect.constants import BLOB_SIGNATURE_IDENTIFIER
from sqlite_dissect.constants import LOGGER_NAME
from sqlite_dissect.constants import TEXT_SIGNATURE_IDENTIFIER
from sqlite_dissect.exception import CarvingError
from ... |
from .. import logging as logg
from .utils import mkdir_p
from collections import Counter
from anndata import AnnData
import math
import numpy as np
import os
def get_model(model_name, model_path=None, vocab_file=None):
if model_name == 'esm1':
from ..tools.fb_model import FBModel
model = FBModel... |
from django.shortcuts import render
from django.http.response import HttpResponse
from django.http import JsonResponse
from django.core.cache import caches
from django.db.models.signals import *
from django.dispatch import receiver
from rest_framework.decorators import api_view
from rest_framework.response import Resp... |
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import i3d
import numpy as np
import tensorflow as tf
_IMAGE_SIZE = 224
_FRAME_COUNT = 64
_NUM_CLASSES = 400
_CHECKPOINT_PATHS = {
'rgb': 'data/checkpoints/rgb_scratch/model.ckpt',
'rgb600':... |
"""diag_msg.py module.
========
diag_msg
========
With **diag_msg** you can print messages with the time and caller info added
automatically. The default time format is H:M:S.f. The caller info includes
the module name, class name (or null), method name (or null), and the line
number relative to the start of the modu... |
# function for running multiqc and getting data objects back
from collections import defaultdict
from pathlib import Path
from types import ModuleType
from typing import List, TypedDict
import logging
log = logging.getLogger(__name__)
import multiqc
import pandas as pd
# iterable to remove suffixes and add them as s... |
import math
import sys
import operator
import networkx as nx
#import matplotlib.pyplot as plt
import numpy as np
import scipy.spatial.distance
import scipy.signal
import skimage
import skimage.io
from skimage.segmentation import slic
from skimage.util import img_as_float
from scipy.optimize import minimize
import pdb
... |
# -*- coding: utf-8 -*-
class Maze:
def __init__(self,side):
"""
builds an empty square maze of side "side" and
assumes start of maze is (0,0) and exit is (side-1,side-1)
"""
self.side = side
def map(self, x, y):
"""
maps the (x,y) coordinate into a cell... |
import subprocess
import time
import os
from datetime import datetime
import re
# RN_REUSE, RN_NEW, WEBVIEW
MODE = "WEBVIEW"
ITERATIONS=10
DEVICE_ID="R38M407P64Z"
ADB_PATH="e:\\nugetcache\\androidsdk.29.0.1\\platform-tools\\adb.exe"
totalPSSPattern = re.compile("^\\s*TOTAL:\\s*(\\d+).*")
javaHeapPatte... |
from SignInApp.mainApp import app, db
from SignInApp.models import Member
from flask_script import Manager, prompt_bool
import requests
from spreadsheet import sheet
from dues import transactions, member_info
manager = Manager(app)
@manager.command
def initdb():
db.create_all()
print('Initialized the database.')
@... |
# encoding: UTF-8
from __future__ import print_function
import hashlib
import hmac
import json
import ssl
import traceback
import sys
from queue import Queue, Empty
from multiprocessing.dummy import Pool
from time import time,sleep
from datetime import datetime
import urllib.parse as urlparse
from copy import copy
fr... |
from keys import charset
from glob import glob
import keras.callbacks
import random
import numpy as np
import codecs
from model import get_model
from PIL import Image
import keras.backend as K
import os
from keras.models import Model
class TrainDataGenerator(keras.callbacks.Callback):
def __init__(self, batch_si... |
# imports
import matplotlib.pyplot as plt
import scipy.stats as stats
import numpy as np
import json
import pickle
from urllib.request import urlopen
# helper functions
def bisection(array, value):
'''Given an ``array`` , and given a ``value`` , returns an index j such that ``value`` is between array[j]
a... |
import base64
import json
import re
from datetime import datetime
import requests
from django.conf import settings
from requests.auth import HTTPBasicAuth
from xauth.utils import valid_str, is_http_response_success
from djangoxpay.models import Money
class Mpesa:
COMMAND_IDS = ['CustomerPayBillOnline', 'Custome... |
import tensorflow as tf
import tensorflow.contrib.layers as tcl
from tensorflow.contrib.framework import arg_scope
import numpy as np
# Yitao-TLS-Begin
import os
import sys
from tensorflow.python.saved_model import builder as saved_model_builder
from tensorflow.python.saved_model import signature_constants
from tensor... |
# -*- coding: utf-8 -*-
"""
Analysis of a trajectory file:
Clustering of pockets in frames and printing out cluster centers and stability of pocket
"""
__all__ = ['wrapper_traj_anal']
import numpy as np
from scipy.cluster import hierarchy as h
def wrapper_traj_anal(file_cav_res, nframe, agglo_function = "... |
#!/usr/bin/env python
"""plot_lib.py: module is dedicated to plot and create the movies."""
__author__ = "<NAME>."
__copyright__ = "Copyright 2020, SuperDARN@VT"
__credits__ = []
__license__ = "MIT"
__version__ = "1.0."
__maintainer__ = "<NAME>."
__email__ = "<EMAIL>"
__status__ = "Research"
import matplotlib
matpl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.