content stringlengths 5 1.05M |
|---|
import requests
import aiohttp
class taromaru():
"""
If your looking for async, use `taromaruasync()`
Example:
```py
taromaru = taromaru("Apikey")
print(taromaru.image(taromaru))
```
Result:
```json
{"error": "false", "image": "url"}
... |
import numpy as np
from mms.utils.mxnet import image
from skimage import transform
import mxnet as mx
import cv2 as cv
from mxnet_model_service import MXNetModelService
# One time initialization of Haar Cascade Classifier to extract and crop out face
face_detector = cv.CascadeClassifier('haarcascade_frontalface.xml')
... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'zoo_AboutWin.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_AboutWin(object):
def setupUi(self, AboutWin):
AboutWin... |
import lcd,image, time
bg = (236, 36, 36)
lcd.init(freq=15000000)
lcd.direction(lcd.YX_RLDU)
lcd.clear(lcd.RED)
time.sleep(1)
lcd.draw_string(120, 120, "hello maixpy", lcd.WHITE, lcd.RED)
time.sleep(2)
img = image.Image()
img.draw_string(60, 100, "hello maixpy", scale=2)
img.draw_rectangle((120, 120, 30, 30))
lcd.di... |
from flask import Flask, render_template,request, redirect, send_file
from scrapper import get_jobs
app = Flask("SuperScrapper")
from exporter import save_to_file
db = {}
@app.route("/")
def home():
return render_template("home.html")
@app.route("/report")
def report():
word = request.args.get('word')
if word... |
# Project Quex (http://quex.sourceforge.net); License: MIT;
# (C) 2005-2020 Frank-Rene Schaefer;
#_______________________________________________________________________________
#! /usr/bin/env python
import os
import sys
sys.path.insert(0, os.environ["QUEX_PATH"])
from quex.engine.state_machine.core ... |
"""Main entry point for application"""
import os
import logging
from starlette.middleware import Middleware
from starlette.middleware.cors import CORSMiddleware
from fastapi import FastAPI, status, Request
from .api import auth_api, client_api, provider_api, blockchain_api
import uuid
logging.basicConfig(format='%(le... |
import os
import sys
from configparser import ConfigParser
import zipfile
import requests
from git import Repo
import subprocess
first = True
command = "req"
InstallMode = "Auto"
config = ConfigParser()
try:
os.environ["GIT_PYTHON_GIT_EXECUTABLE"] = os.getcwd() + "/Git/cmd"
config.read("config.ini")
vs_u... |
# -*- coding:ascii -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 10
_modified_time = 1426544011.476607
_enable_loop = True
_template_filename = '/Users/Nate/chf_dmp/catalog/scripts/index.jsm'
_template_uri = 'index.jsm'
_s... |
"""常用网络函数库封装"""
import json
import uuid
import http
import gzip
import zlib
import os.path
import urllib.parse as urlparse
import urllib.request as request
from collections import namedtuple
import xml.etree.cElementTree as et
from typing import Tuple, Dict, Optional, Union
from . import file
from ..algorithm impor... |
from random import choices
import string
from os.path import isfile
from celery import shared_task
from django.core.files import File
from groups.libs.latex import Renderer, DocumentPresenter
from groups.models import Document
@shared_task
def render_document(document_id):
document = Document.objects.get(id=docum... |
"""Constant values needed for string parsing"""
intervals = {
"intervalToTuple": {
"1": (1,0),
"2": (2,2),
"b3": (3,3),
"3": (3,4),
"4": (4,5),
"b5": (5,6),
"5": (5,7),
"#5": (5,8),
"6": (6,9),
"bb7": (7,9),
"b7": (7,10),
... |
import supybot.utils as utils
import re
from supybot.commands import *
import sys
import supybot.plugins as plugins
import supybot.ircmsgs as ircmsgs
import supybot.ircutils as ircutils
import supybot.callbacks as callbacks
try:
from supybot.i18n import PluginInternationalization
_ = PluginInternationalizatio... |
"""Message handler functions."""
from stickerfinder.models import (
Change,
Sticker,
StickerSet,
)
from stickerfinder.session import message_wrapper
from stickerfinder.enum import TagMode
from stickerfinder.logic.tag import (
handle_next,
tag_sticker,
current_sticker_tags_message,
handle_req... |
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def diameterOfBinaryTree(self, root: TreeNode) -> int:
self.result = 0
def depth(root):
if root == None: return 0
left ... |
from github import Github as PyGithub
from github.Organization import Organization as PyGithubOrganization
from github_team_organizer.classes.github import GitHubWrapper
class Organization:
__instance = None
def __new__(cls, *args, **kwargs):
if Organization.__instance is None:
Organiza... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the L... |
from bert-serving.client import BertClient
import numpy as np
bc = BertClient()
strings = ['hej hopp', 'hej hopp']
enc = bc.encode(strings)
def cosine_sim(s1, s2):
return np.dot(s1[0,:],s2[0,:])/(np.linalg.norm(s1)*np.linalg.norm(s2)+1e-9)
|
from crcapp.models import Employee,Store
from django.contrib.auth.hashers import make_password, check_password
from django.core.exceptions import ValidationError
from django.contrib.sessions.models import Session
from django.utils import timezone
# Create functions related to staff
class StaffController:
# Develo... |
# Warning: this is messy!
import requests
import datetime
import dateutil.parser
from functools import reduce, lru_cache
from itertools import groupby
import data
def greenline(apikey, stop):
"""
Return processed green line data for a stop.
"""
# Only green line trips
filter_route = "Green-B,Green... |
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.flatpages.sitemaps import FlatPageSitemap
from django.contrib.sitemaps import views
from django.urls import path, include
from django.views.decorators.cache import cache_page
from rest_framew... |
import torch
import torch.nn.functional as F
class SmoothGradCAMpp(GradCAM):
"""
Smooth Grad-CAM++, inherit from GradCAM
"""
def __init__(self, model_dict):
super(SmoothGradCAMpp, self).__init__(model_dict)
def forward(self, input_image, class_idx=None, param_n=35, mean=0, sigma=2, retain_... |
from icontrol.session import iControlRESTSession
from icontrol.exceptions import iControlUnexpectedHTTPError
from requests.exceptions import HTTPError
import argparse
import json
import os
import sys
import logging
# /mgmt/shared/authz/roles/iControl_REST_API_User
# /mgmt/shared/authz/resource-groups
# /mgmt/share... |
# Generated by Django 2.2.24 on 2021-09-29 10:54
import dashboard.models
from django.conf import settings
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
def modify_job_template(apps, schema_editor):
if not settings.MIGRATE_INITIAL_DATA:
re... |
from factory.django import DjangoModelFactory
import factory
from ..models import *
class DepartmentFactory(DjangoModelFactory):
FACTORY_FOR = Department
name = factory.Sequence(lambda n: 'Department_%s' % n)
class ApplicationFactory(DjangoModelFactory):
FACTORY_FOR = Application
name = factory.Se... |
import os.path
from urllib.parse import urlparse
import colander
import pyramid.httpexceptions as exc
from pyramid.view import view_config, view_defaults
from ..models import Group
from .predicates import load_tag, load_file, load_group
from .validation import errors_to_angular
def normpath(path):
url = urlpars... |
# -----------------------------------------------------------------------------
# This file contains the API for the WWL kernel computations
#
# December 2019, M. Togninalli
# -----------------------------------------------------------------------------
from .propagation_scheme import WeisfeilerLehman, ContinuousWeisfe... |
# ORDERING is a dictionary that describes the required ordering of Web ACL rules for a
# given web acl ID. Map the Web ACL ID to an ordered tuple of Web ACL rule IDs
# Example usage:
# ORDERING{
# 'WebAclId-123': ('FirstRuleId', 'SecondRuleId', 'ThirdRuleId'),
# }
ORDERING = {
"EXAMPLE_WEB_ACL_ID": ("EXAMPLE_RULE... |
import json
from pprint import pprint
filename = input("Input filename: ")
with open(filename) as f:
data = json.load(f)
pprint(data)
ipV4Neighbors_list = data['ipV4Neighbors']
ipV4Neighbors_dict = {}
for dicts in ipV4Neighbors_list:
for descriptions, val in dicts.items():
print(descriptions, val)
... |
from django.db import models
# Create your models here.
class Session(models.Model):
owner = models.ForeignKey('auth.user', null=False, blank=False, related_name="session_owner")
uuid = models.CharField(max_length=36, null=False, blank=False)
#major_step = models.IntegerField()
#minor_step = models.IntegerFie... |
from giotto.programs import Program, Manifest
from giotto.programs.shell import shell
from giotto.programs.tables import syncdb, flush
from giotto.views import BasicView
management_manifest = Manifest({
'syncdb': Program(
name="Make Tables",
controllers=['cmd'],
model=[syncdb],
view... |
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('registration', '0004_supervisedregistrationprofile'),
]
operations = [
migrations.AlterField(
model_name='registrationprofile',
name='activation... |
from os import walk
import os.path
readme = open('./Todo.md', 'w+')
readme.write('# TODOs\n\n')
for (dirpath, dirnames, filenames) in walk('..\\src\\'):
for (filename) in filenames:
file = open(dirpath + '\\' + filename)
line = file.readline()
lineNumber = 1
todosInFile = ''
while (line != ''):
se... |
"""
class mask, data handler for the function rn in rn.py, used to permit a more user-friendly approach
to RN object instantiation
"""
# Imports
from fractions import Fraction
from decimal import Decimal
from numpy import array
from rnenv110.rn.mathfuncs.funcs import fraction_from_float
# mask class
class Mask:
... |
from .Negamax import Negamax
from .NonRecursiveNegamax import NonRecursiveNegamax
from .TranspositionTable import TranspositionTable
from .solving import solve_with_iterative_deepening, solve_with_depth_first_search
from .MTdriver import mtd
from .SSS import SSS
from .DUAL import DUAL
from .HashTranspositionTable impor... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
from hubcheck.pageobjects.po_generic_page import GenericPage
class TagsPage(GenericPage):
"""tags page"""
def __init__(self,browser,catalog):
super(TagsPage,self).__init__(browser,catalog)
self.path = "/tags"
# load hub's classes
TagsPage_Locators = self.load_class('TagsPage_L... |
import numpy as np
def lerp(a, b, x):
return a * (1-x) + b * x
def clamp(x, max_x, min_x):
if x > max_x:
return max_x
elif x < min_x:
return min_x
return x
def softmax(x, k) :
c = np.max(x)
exp_a = np.exp(k * (x-c))
sum_exp_a = np.sum(exp_a)
y = exp_a / sum_exp_a
... |
'''
https://practice.geeksforgeeks.org/problems/subarray-with-given-sum/0/?ref=self
Given an unsorted array of non-negative integers, find a
continuous sub-array which adds to a given number.
Input:
The first line of input contains an integer T denoting the number of test cases.
Then T test ... |
"""Module for the auth login command"""
from ostorlab.cli.auth.login import login
|
import re
import time
from Jumpscale import j
ZEROTIER_FIREWALL_ZONE_REGEX = re.compile(r"^firewall\.@zone\[(\d+)\]\.name='zerotier'$")
FORWARDING_FIREWALL_REGEX = re.compile(r"^firewall\.@forwarding\[(\d+)\].*?('\w+')?$")
class BuilderZeroBoot(j.baseclasses.builder):
def install(self, network_id, token, zos_v... |
import numpy as np
import random
import cv2
from augraphy.base.augmentation import Augmentation
from augraphy.base.augmentationresult import AugmentationResult
class FoldingAugmentation(Augmentation):
"""Emulates folding effect from perspective transformation
:param fold count: Number of applied fo... |
"""Common NCDR Alerts Data class used by both sensor and entity."""
import logging
import json
from aiohttp.hdrs import USER_AGENT
import requests
import http
from .const import (
ALERTS_TYPE,
ALERTS_AREA,
BASE_URL,
HA_USER_AGENT,
REQUEST_TIMEOUT
)
_LOGGER = logging.getLogger(__name__)
class Nc... |
from io import StringIO
import pandas as pd
import pytest
from calliope import locations, utils
class TestLocations:
@pytest.fixture
def sample_locations(self):
setup = StringIO("""
test:
techs: ['demand', 'unmet_demand', 'ccgt']
override:
demand:
... |
from flask import Flask, render_template, request, Request
from werkzeug.formparser import parse_form_data
class InputProcessed():
"""A file like object that just raises an error when it is read."""
def read(self, *args):
raise EOFError(
'The wsgi.input stream has already been consumed, c... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 8 18:02:38 2022
@author: marco
"""
import subprocess
def name_generator(old, shock_nr, test='no'):
"""
Generates a unique name for .gro, .top and .tpr files according to the cycle
number (shock_nr).
Parameters:
-----------
... |
from __future__ import print_function
import argparse
import time
import os
import sys
import datetime
import math
from distutils.version import LooseVersion
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.tensorboard import SummaryWriter
from torch.optim... |
"""Tests for the :mod:`campy.util.randomgenerator` module."""
from campy.util.randomgenerator import RandomGenerator
def test_feed_int():
rgen = RandomGenerator.get_instance()
rgen._feed_int(5)
assert rgen.randint(0, 10) == 5
|
import cv2 as cv
src = cv.imread("D:/Images/lena.jpg")
cv.namedWindow("rgb", cv.WINDOW_NORMAL)
cv.imshow("rgb", src)
# RGB to HSV
hsv = cv.cvtColor(src, cv.COLOR_BGR2HSV)
cv.namedWindow("hsv", cv.WINDOW_NORMAL)
cv.imshow("hsv", hsv)
# RGB to YUV
yuv = cv.cvtColor(src, cv.COLOR_BGR2YUV)
cv.namedWindow("y... |
from collections import namedtuple, defaultdict
from datetime import datetime, date
import pytest
from freezegun import freeze_time
from flask import current_app
from app.exceptions import DVLAException, NotificationTechnicalFailureException
from app.models import (
NotificationHistory,
NOTIFICATION_CREATED,
... |
# Module that defines the basic interface that wrappers must implement.
#
# Author: Fernando García <ga.gu.fernando@gmail.com>
#
from abc import ABCMeta, abstractmethod
class WrapperBase:
"""
Base class for wrapper classes.
"""
__metaclass__ = ABCMeta
def __repr__(self):
return "WrapperB... |
'''
Descripttion: densechen@foxmail.com
version: 0.0
Author: Dense Chen
Date: 1970-01-01 08:00:00
LastEditors: Dense Chen
LastEditTime: 2020-08-12 20:44:20
'''
import random
import cv2
import numpy as np
import pytorch3d.transforms as transforms3d
import torch
import torch.nn as nn
import torch.nn.functional as F
from... |
"""Constants for the MagicMirror integration."""
from logging import Logger, getLogger
LOGGER: Logger = getLogger(__package__)
DOMAIN = "magicmirror"
PLATFORMS = ["binary_sensor", "switch", "number"]
|
# Error.py
#
# Copyright (C) 2018 OSIsoft, LLC. All rights reserved.
#
# THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE SECRETS OF
# OSIsoft, LLC. USE, DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT
# THE PRIOR EXPRESS WRITTEN PERMISSION OF OSIsoft, LLC.
#
# RESTRICTED RIGHTS LEGEND
# Use, duplication, o... |
# Generated by Django 3.1.6 on 2021-02-05 20:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sales', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='license',
name='activated',
f... |
from glob import glob
from nltk.corpus import wordnet as wn
import numpy as np
import pickle
IMAGENET_DIR = "/media/jedrzej/Seagate/DATA/ILSVRC2012/TRAIN/"
folders_list = glob(IMAGENET_DIR+"*")
categories_list = []
all_parents = []
for category in folders_list:
category_no = category.split("/")[-1][1:]
categories_l... |
"""
Just enough CRUD operations to get you going
"""
import hashlib
from sqlalchemy.orm import Session
from sqlalchemy.sql.functions import mode
from app.db import models, schemas
""" These constants need to be moved to a config """
SALT = "This is my salt. There are many like it, but this one is mine."
HMAC_ITER = ... |
#!/usr/bin/env python
#
# (c) Copyright Rosetta Commons Member Institutions.
# (c) This file is part of the Rosetta software suite and is made available under license.
# (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
# (c) For more information, see http://www.rosettacommons.or... |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
from __future__ import print_function, absolute_import, division
import numpy as np
from numpy import random
#
from functools import partial
from multiprocessing import Pool
#
from scipy.spatial.distance import pdist, cdist
from scipy.stats import kstwobign, pearsonr
from sc... |
#!/usr/bin/python
import random
import os
import time
import sys
secure_random = random.SystemRandom()
if len(sys.argv) == 2:
gpu = sys.argv[1]
elif len(sys.argv) > 2:
sys.exit('Unknown input')
else:
gpu = '0'
for _ in range(1):
#seed = str(random.randint(1, 10**6))
seed = secure_random.choice... |
def generate_discount_codes_producer():
pass
|
from django.shortcuts import render
from django.utils import timezone
from .models import Post
def post_list(request):
posts = Post.objects.filter(published_date__lte=timezone.now()).order_by('published_date')
return render(request, 'blog/post_list.html', {'posts': posts})
def homepage_view(request):
return... |
import discord
from discord.ext import commands
import aiohttp
import requests
class Image(commands.Cog, name='Image'):
def __init__(self, bot):
self.bot = bot
@commands.command()
@commands.cooldown(1, 10, commands.BucketType.user)
async def cat(self, ctx):
"""Gives You Random Image O... |
# coding: utf-8
from euclid3 import Vector2 as vec
vec.__repr__ = lambda self: 'vec({0}, {1})'.format(self.x, self.y)
|
import json, requests, os, logging
from rtpipe.parsecands import read_candidates
from elasticsearch import Elasticsearch
import activegit
from rflearn.features import stat_features
from rflearn.classify import calcscores
from IPython.display import Image
from IPython.core.display import HTML
logging.basicConfig()
es ... |
import torch
import numpy as np
import argparse
import time
import util
import os
import matplotlib.pyplot as plt
import torch.nn as nn
import pandas as pd
from fastprogress import progress_bar
import torch.nn.functional as F
from model_stgat import stgat
os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"
os.environ["CUDA_... |
"""Command executor router class."""
from __future__ import annotations
from typing import Union
from opentrons.util.helpers import utc_now
from opentrons.hardware_control.api import API as HardwareAPI
from ..state import StateView
from ..errors import ProtocolEngineError, UnexpectedProtocolError
from .. import resour... |
from redcmd.api import maincmd, execute_commandline
from .polls import Polls
@maincmd
def cli(poll_name, id=None):
params = {}
params['post_id'] = id
polls = Polls()
polls.run(poll_name, params=params)
def main():
execute_commandline()
|
import json
import os
import shutil
import stat
import sys
import platform
import tarfile
import zipfile
from enum import Enum
import requests
import urllib3
import managed_tool
from maintenance import Maintenance
from tool import Tool
HOME_PATH = os.environ.get("HOME")
DEVTC_HOME_PATH = "{}/.devtc".format(HOME_PATH... |
# -*- encoding: utf-8 -*-
#
#
# Copyright (C) 2004-2006 André Wobst <wobsta@users.sourceforge.net>
#
# This file is part of PyX (http://pyx.sourceforge.net/).
#
# PyX 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 Founda... |
#!/usr/local/bin/python3
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the L... |
import unittest
from nzmath.group import *
from nzmath.finitefield import FinitePrimeFieldElement, FinitePrimeField
from nzmath.intresidue import *
from nzmath.permute import Permute, PermGroup
a1 = GroupElement(Permute([2, 4, 1, 3])) #Multiplication Group
a2 = GroupElement(Permute([3, 1, 4, 2]))
aa1 = a1.getGroup()
... |
# -*- coding: utf-8 -*-
'''
Tests to try out packeting. Potentially ephemeral
'''
# pylint: skip-file
# pylint: disable=C0103
from ioflo.base.odicting import odict
from salt.transport.road.raet import (raeting, nacling, packeting,
devicing, transacting, stacking)
def test():
... |
from fastapi import APIRouter, Depends, Form
from typing import List, Dict, Optional
from instagrapi import Client
from instagrapi.mixins.insights import POST_TYPE, TIME_FRAME, DATA_ORDERING
from dependencies import ClientStorage, get_clients
router = APIRouter(
prefix="/insights",
tags=["insights"],
r... |
suma = 0.0
fraccion = 0.1
for c in range(10):
suma = suma + fraccion
print(suma)
if (suma == 1.0):
print("La suma es 1")
else:
print("La suma no es 1")
|
# Created by Patrick Kao
import itertools
from pathlib import Path
import stable_baselines
from stable_baselines import DQN, A2C, ACER, ACKTR, PPO2
from stable_baselines.common.evaluation import evaluate_policy
from stable_baselines.common.policies import MlpPolicy
from gameRL.game_simulators.blackjack import Blackja... |
# -*- coding=utf8 -*-
## process the images from `raw/` into single letters, save them in `processed/`
from PIL import Image
from os import walk
from rawimg import randomName
RAW_PATH = 'raw/'
TEMP_PATH = 'monochrome/'
TARGET_PATH = 'processed/'
THRESHOLD = 150 # gray pixel threshold
# SURROUNDING = [(x, y) for y in [... |
from flask import Flask
app = Flask(__name__)
@app.route('/')
def main():
return 'Hello, Solar Pi'
|
from typing import Dict, NewType, Tuple, Union
import torch
import torch.nn as nn
# Load all model builders
from .poolings.stats import STAT_POOLINGS
class ClassificationHead(nn.Module):
def __init__(self,
num_classes: int,
input_features_chan: int,
head_hidden... |
from pyhocon import ConfigFactory
conf = ConfigFactory.parse_file("application.conf")
static_dir = conf.get("static_dir")
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lic... |
#/usr/bin/env python3
import logging
import time
from sqlalchemy.sql.expression import func
from ngk.schema import Comment, Post, ScopedSession, User
from ngk.html_util import normalize_text
def main() -> None:
BATCH_SIZE = 50000
total_count = 0
with ScopedSession() as session:
offset = 0
... |
# Copyright (c) WiPhy Development Team
# This library is released under the MIT License, see LICENSE.txt
import unittest
import numpy as np
from wiphy.code.modulator import *
from wiphy.util.general import getMinimumEuclideanDistance
class Test(unittest.TestCase):
def test_PSK(self):
for L in 2 ** np.a... |
# app/home/__init__.py
from . import views
#from flask import Blueprint
#home = Blueprint('home', __name__)
|
import requests, json, re, time, Config
from bs4 import BeautifulSoup as BS
def Get_Grades(UserName, Password):
headers = {}
Login_data = {
'UserName': UserName,
'Password': Password}
session = requests.Session()
# Get SAMLRequest and RelayState
response = session.get('https://duval.focusschoolsoftware.com/fo... |
# Simple django settings module (required when importing management commands).
SECRET_KEY = 'fake-key'
INSTALLED_APPS = (
'organisms',
'genes',
)
|
from pygluu.containerlib.document.rclone import RClone # noqa: F401
|
# Copyright (c) 2019 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License"). This software is distributed "AS IS"
# as set forth in the License.
import logging
from steelscript.common import timeutils
from steelscript.apprespo... |
# -*- coding: utf-8 -*-
"""
koordinates.sets
================
The `Sets API <https://help.koordinates.com/api/publisher-admin-api/sets-api/>`_
is used for grouping layers, tables and documents together.
"""
import logging
from koordinates.permissions import PermissionObjectMixin
from koordinates.users import Group
... |
import numpy as np
def binstep(y, th=0):
return [1 if i > th else 0 for i in y]
def hebb_assoc_train(s, t):
w = np.zeros((len(s[0]), len(t[0])))
for r, row in enumerate(s):
for c, col in enumerate(row):
w[c] = [w[c, i] + col * t[r, i] for i in range(len(t[r]))]
return w
def h... |
from datetime import datetime
import dateutil.parser
from botocore.exceptions import ClientError
from autobot_helpers import context_helper, boto3_helper, policy_helper
from services.aws.utils import Constants, Helpers
class EC2:
def __init__(self, region_name=Constants.AWSRegions.VIRGINIA.value):
self... |
import os.path
import json
class Probe:
service = "service"
request_url = ""
units = "metric"
response = {}
api_key = ""
user_location = ()
# Mock variables
response_stub = {}
request_sent = False
request_sent_to = ""
def get_weather_data(self):
self.response = se... |
from spynnaker.pyNN import *
__version__ = "2016.001"
|
from django.contrib import admin
# Register your models here.
from .models import Blocked, Follower, Following, Muted
admin.site.register(Following)
admin.site.register(Follower)
admin.site.register(Muted)
admin.site.register(Blocked)
|
from django.conf.urls import url
from .consumers import ChatConsumer
websocket_urlpatterns = [
url(r"^messages/(?P<username>[\w.@+-]+)/$", ChatConsumer),
] |
import re
import socket
import platform
import sshuttle.helpers as helpers
import sshuttle.client as client
import sshuttle.firewall as firewall
import sshuttle.hostwatch as hostwatch
import sshuttle.ssyslog as ssyslog
from sshuttle.options import parser, parse_ipport
from sshuttle.helpers import family_ip_tuple, log, ... |
from .arch import ( # noqa # NOTE: If you want to add your architecture, please add YourCustomArchConfig class in this line.
ArchConfig,
Resnet34Config,
Resnet50Config,
Resnet56Config,
Wideresnet40Config,
)
from .datamodule import ( # noqa # NOTE: If you want to add your datamodule, please add You... |
'''
This is internal definitions used by the latextools_plugin module
This separate module is required because ST's reload semantics make it
impossible to implement something like this within that module itself.
'''
import re
_REGISTRY = None
# list of tuples consisting of a path and a glob to load in the plugin_loa... |
__all__ = ["OAuth2Token", "get_storage_handler"]
import datetime
import json
import logging
import pathlib
from abc import abstractmethod
from typing import Optional, Type
from . import errors
_logger = logging.getLogger('coresender')
_storage_handlers = {}
def get_storage_handler(name: str) -> Type['OAuth2TokenS... |
import csv
import json
import os.path
from ConfigParser import SafeConfigParser, NoOptionError, NoSectionError
from decorator import decorator
from logger import logger
from perfrunner.helpers.misc import uhex
REPO = 'https://github.com/couchbase/perfrunner'
@decorator
def safe(method, *args, **kargs):
try:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.