content stringlengths 5 1.05M |
|---|
# -*- coding: utf-8 -*-
# *****************************************************************************
# Copyright (c) 2021, Intel Corporation All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# ... |
#!/usr/bin/env python
"""Copyright (c) 2014, Thomas Skowron
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 conditi... |
import tweepy
import pymysql as MySQLdb
from time import sleep
import conexao
def erro_limite():
print('Limite de acesso da API atingido... aguarde')
sleep(60 * 3)
api = conexao.get_api()
con = conexao.get_mysql()
cursor = con.cursor()
while True:
paginas = ['@G1','@sbtjornalismo','@VEJA','@folha','@portalR7']
... |
# coding: utf-8
###
# feature_extractor.py -
# This file implements the extraction pipeline to obtain the expected features from a standardized data set of patients
# and lesions.
# This script outputs a csv file containing the computed feature per patient.
#
# Pseudo code Implementation scheme:
#
# Create an empty li... |
#!/usr/bin/env python3
with open("input") as infile:
starting_state = [int(x) for x in infile.read().strip().split(",")]
state = []
for i in range(9):
state.append(0)
# state is the count of each lanternfix, the index represents the number of days until
# reproduction
for st in starting_state:
state[st]... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import print_function
import time
import os.path
import keyring
import numpy as np
import re
import tarfile
import string
import requests
from requests import HTTPError
import sys
from pkg_resources import resource_filename
from bs4 import ... |
#!/usr/bin/env python
'''
Write a Python program using ciscoconfparse that parses the 'cisco_ipsec.txt'
config file. Note, this config file is not fully valid (i.e. parts of the
configuration are missing).
The script should find all of the crypto map entries in the file (lines that
begin with 'crypto map CRYPTO') and p... |
from collections import OrderedDict
from tqdm import tqdm
def load_flickr_set(images, text, file, test):
"""
Produces a ordered dict of tuples of data and label from the ids defined in file.
Train Structure:
{
id: (id, img_data, word vector)
}
Test Structure:
{
... |
"""
This module is home to the Location class
"""
from pyecobee.ecobee_object import EcobeeObject
class Location(EcobeeObject):
"""
This class has been auto generated by scraping
https://www.ecobee.com/home/developer/api/documentation/v1/objects/Location.shtml
Attribute names have been generated by c... |
#coding:utf-8
#
# id: bugs.core_3475
# title: Parameters inside the CAST function are described as not nullable
# decription:
# tracker_id: CORE-3475
# min_versions: ['3.0']
# versions: 3.0
# qmid: None
import pytest
from firebird.qa import db_factory, isql_act, Action
# version: 3.0... |
import ssl
import asyncio
from ..client import Client
from ..common import hexlify
from . import to_int
async def subscriber(host,
port,
cafile,
check_hostname,
client_id,
topic,
keep_alive_s... |
from urllib.parse import urlparse
from ckan_cloud_operator import kubectl
from ckan_cloud_operator import logs
from ckan_cloud_operator.providers.routers import manager as routers_manager
def get_datapusher_url(instance_datapusher_url):
if instance_datapusher_url and len(instance_datapusher_url) > 10:
ho... |
"""
Copyright (c) 2018, Toby Slight. All rights reserved.
ISC License (ISCL) - see LICENSE file for details.
"""
import os
if os.name == 'nt':
CHARS = ['/', '"', ':', '<', '>', '^', '|', '*', '?']
else:
CHARS = ['\\', '"', ':', '<', '>', '^', '|', '*', '?']
def mknames(name):
"""
Iterate over char ar... |
import re
import gnupg
from django.conf import settings
from . import exceptions
GPG = None
def is_enabled():
return settings.SNOOP_GPG_HOME and settings.SNOOP_GPG_BINARY
def _get_gpg():
global GPG
if is_enabled():
if not GPG:
GPG = gnupg.GPG(gnupghome=settings.SNOOP_GPG_HOME,
... |
#!/usr/bin/env python
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
install_requires = [
'simplejson',
'pyaml',
'requests'
]
test_requires = [
'testtools',
'nose',
'mock',
]
setup(name='qubell-api-python-client',
version... |
from django.apps import AppConfig
class DjAuthConfig(AppConfig):
name = 'dj_auth'
def ready(self):
import dj_auth.signals
|
''' Helper class and functions for loading KITTI objects
Author: Charles R. Qi
Date: September 2017
Modified by Yurong You
Date: June 2019
'''
import os
import data_utils.kitti_util as utils
class kitti_object(object):
'''Load and parse object data into a usable format.'''
def __init__(self, root_dir=None,... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... |
import unicodedata
"""Functions related to CJK characters"""
def count_cjk_chars(s):
"""Count numbers of CJK characters in a string.
Arg:
s (str): The string contains CJK characters.
Returns:
int: The number of CJK characters.
"""
if not (type(s) is str):
raise TypeError("... |
# coding=utf-8
__title__ = 'gmusicapi_scripts'
__version__ = "0.5.0"
__license__ = 'MIT'
__copyright__ = 'Copyright 2016 thebigmunch <mail@thebigmunch.me>'
|
import argparse
from scipy import signal
import pandas as pd
import numpy as np
def argument_parser():
parser = argparse.ArgumentParser(description='resample time series data')
parser.add_argument(
'filename', type=argparse.FileType('r'),
help='name of the file to convert')
parser.add_arg... |
def initials_only(first, middle, last):
initials = first[0]+middle[0]+last[0]
return initials
firstn = input("put your first name: ")
middlen = input("put your middle name: ")
lastn = input("put your last name: ")
initials=initials_only(firstn,middlen,lastn)
print("This is your initials,"... |
# Generated by Django 3.1.5 on 2021-01-11 12:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project_core', '0159_call_part_introductory_text_blank'),
]
operations = [
migrations.AlterField(
model_name='proposalscientific... |
import numpy as np
A = np.array([[n+m*10 for n in range(5)] for m in range(5)])
np.dot(A, A)
"""
array([[ 300, 310, 320, 330, 340],
[1300, 1360, 1420, 1480, 1540],
[2300, 2410, 2520, 2630, 2740],
[3300, 3460, 3620, 3780, 3940],
[4300, 4510, 4720, 4930, 5140]])
"""
v1 = np.arange(0, 5)
... |
import sys
args = sys.argv
length = len(args)
def wrong():
print('Available Arguments:')
print(' [-h, --help, help] Open rx7 Documention Page (pypi Page)')
print(' [color, colors] Open a html Page That Contains All Colors and Information About style Class')
print(' ... |
import numpy as np
from sklearn import preprocessing, neighbors
from sklearn.model_selection import train_test_split
import pandas as pd
df = pd.read_csv('breast-cancer-wisconsin.csv')
df.replace('?', -99999, inplace=True)
df.drop(['id'], axis=1, inplace=True)
X = np.array(df.drop(['class'], 1))
y =np.array... |
"""Contains logic to acquire urls from a CSV file
This file can be imported as a module and contains the following classes:
* CsvUrlsProvider - Provides access to urls from a CSV file
"""
import csv
import io
import typing
import pydantic
from .file_urls_provider import FileUrlsProvider
from ..models import Url... |
from flask import Request as BaseRequest
from flex.utils.decorators import cached_property
class Request(BaseRequest):
@property
def input(self):
"""The submitted data. If the mimetype is :mimetype:`application/json`
this will contain the parsed JSON data or ``None``. Otherwise, returns
the :attribute:`form` ... |
"""The rules for skipping a recurring task."""
from dataclasses import dataclass
from typing import Optional
from jupiter.framework.errors import InputValidationError
from jupiter.framework.value import Value
@dataclass(frozen=True)
class RecurringTaskSkipRule(Value):
"""The rules for skipping a recurring task."... |
import os
import shutil
import json
from utils import download_file, extract_file, copy_directory, remove_inner_ear_landmarks, crop_and_resize_image
with open('config.json', 'r') as f:
config = json.load(f)
data_dir = config['data_dir']
downloads_path = os.path.join(data_dir, config['downloads_dir'])
original_pa... |
class Solution:
def findPivot(self, nums):
# find the total sum of nums
total = 0
for num in nums:
total += num
# keep a track of left sum
leftsum = 0
for i in range(len(nums)):
# if total - sum of all elements to left of current element - cur... |
import datetime
import numpy as np
import pandas as pd
if __name__ == '__main__':
# Load and process ratings
names = ['user', 'item', 'rating', 'timestamp']
dtype = {'user': str, 'item': str, 'rating': np.float64}
def date_parser(timestamp):
return datetime.datetime.fromtimestamp(float(times... |
import torch
import torch.nn as nn
class encoder3(nn.Module):
def __init__(self, W, v2):
super(encoder3,self).__init__() # W - width
# vgg
# 224 x 224
self.conv1 = nn.Conv2d(3,3,1,1,0)
self.reflecPad1 = nn.ZeroPad2d((1,1,1,1))
# 226 x 226
self.conv2 = nn.C... |
import z3
import tempfile
import random
from ..wire import Input, Output, Register, Const, WireVector
from ..fuzz.aflMutators import int2bin
from ..core import Block
from ..memory import RomBlock, MemBlock
def transfer_to_bin(value, bitwidth):
return "#b" + int2bin(value, bitwidth)
def translate_to_smt(block... |
#server code
import socket, cv2, pickle,struct,imutils
# Socket Create
server_socket = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
# host_ip = '169.254.250.37'
host_name = socket.gethostname()
host_ip = socket.gethostbyname(host_name)
print('HOST IP:',host_ip)
port = 9999
socket_address = (host_ip,port)
# Sock... |
from .s3_book_image import S3BookImageStorage
|
"""Unit test package for smart_pandas."""
|
# -*- coding: utf-8 -*-
"""urls.py: messages extends"""
from django.conf.urls import patterns, url
urlpatterns = patterns('',
url(r'^mark_read/(?P<message_id>\d+)/$', 'messages_extends.views.message_mark_read', name='message_mark_read'),
url(r'^mark_read/all/$', 'messages_extends.views.message_mark_all_read',... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import json
import os
from tqdm import tqdm
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-d', '--question_file', type=str)
parser.add_argument('-o', '--out_file', type=str)
args = parser.parse_args()
... |
from assurvey.survey.models import *
import csv
s = Survey.objects.get(slug='furry-philosophy')
all_questions = [
'How old are you?',
'What gender do you identify as?',
'Does your gender identity align with your sex assigned at birth?',
'What species is your primary character?',
'Where in the wor... |
# Generated by Django 3.1.6 on 2021-02-07 07:59
import multiselectfield.db.fields
from django.conf import settings
from django.db import migrations, models
try:
if getattr(settings, "ADMIN_CHARTS_USE_JSONFIELD", True):
from django.db.models import JSONField
else:
from jsonfield.fields import ... |
""""
``test fstab``
================
"""
from insights.parsers import fstab
from insights.tests import context_wrap
FS_TAB_DATA = ['#',
'# /etc/fstab',
'# Created by anaconda on Fri May 6 19:51:54 2016',
'#',
'/dev/mapper/rhel_hadoop--test--1-root / ... |
from constants import *
import os
import numpy as np
import pandas as pd
from sklearn import preprocessing
from sklearn.metrics import classification_report
def can_ignore(file, key):
if key in file:
return True
return False
def flatten(binary_labels):
return np.argmax(binary_labels, axis=1)... |
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
def main():
extras_require = {
... |
#
# PySNMP MIB module DVMRP-STD-MIB-JUNI (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DVMRP-STD-MIB-JUNI
# Produced by pysmi-0.3.4 at Wed May 1 12:55:05 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, ... |
import unittest
from chainer import dataset
from chainer import testing
class SimpleDataset(dataset.DatasetMixin):
def __init__(self, values):
self.values = values
def __len__(self):
return len(self.values)
def get_example(self, i):
return self.values[i]
class TestDatasetMixi... |
#!/usr/bin/env python
#-----------------------------------------------------------------------------
# Copyright (c) 2020, Greg Landrum
# All rights reserved.
#
# The full license is in the LICENSE file, distributed with this software.
#-----------------------------------------------------------------------------
from... |
from flask import Flask, render_template, url_for, Response
from model import Face
app = Flask(__name__, static_folder='static')
@app.route('/', methods=["GET"])
def index():
return render_template('index.html')
def livestream(source):
while True:
frame = source.input()
yield (b'--frame\r\n... |
from dataclasses import dataclass
from raiden.constants import EMPTY_ADDRESS, UINT256_MAX
from raiden.utils.formatting import to_checksum_address
from raiden.utils.typing import (
Address,
ChainID,
ChannelID,
T_Address,
T_ChainID,
T_ChannelID,
TokenNetworkAddress,
typecheck,
)
@datacl... |
import datetime
from django.contrib import admin
from django.core import serializers
from django.http import HttpResponse
from django.utils.translation import ugettext_lazy as _
from bento.models import TextBox, ImageBox
class TextBoxAdmin(admin.ModelAdmin):
list_display = ('name', 'modification_date')
acti... |
"""
API Response Objects
These are JSON Responses from APIs
"""
import datetime
from typing import Any, Dict, Iterator, List, Optional, Union
from camply.config.api_config import RecreationBookingConfig
from camply.containers.base_container import CamplyModel
class _CampsiteEquipment(CamplyModel):
EquipmentNam... |
# -*- coding: utf-8 -*-
import requests
from pymongo import MongoClient
import time
from redis import StrictRedis
import traceback
from parsel import Selector
import urlparse
#redis config
import json
import re
from multiprocessing import Pool
from collections import Counter
redis_setting = {
'dev': {
'host... |
#!/usr/bin/env python
import sys
from intcomputer import Intcomputer
def read_input_to_list(path):
with open(path) as file:
return [int(x) for x in file.readline().split(",")]
if __name__ == "__main__":
puzzle = sys.argv[1]
input = read_input_to_list(sys.argv[2])
if puzzle == "1":
in... |
"""
Loxone Cover
For more details about this component, please refer to the documentation at
https://github.com/JoDehli/PyLoxone
"""
import logging
from typing import Any
import random
from homeassistant.components.cover import (ATTR_POSITION, ATTR_TILT_POSITION,
DEVICE_CLA... |
from libs.primelib import Prime
import time
# The sum of the squares of the first ten natural numbers is,
# 12 + 22 + ... + 102 = 385
# The square of the sum of the first ten natural numbers is,
# (1 + 2 + ... + 10)2 = 552 = 3025
# Hence the difference between the sum of the squares of the first ten natural numbers an... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# --------------------------------------------------------
# Attributes2Classname: A discriminative model for attribute-based unsupervised zero-shot learning.
# Written by berkan
# Contact: demirelberkan@gmail.com
# --------------------------------------------------------
... |
import config
from numba.core import types
from numba.typed import Dict
import numpy as np
import numba
numba.config.THREADING_LAYER = 'safe'
def to_typed_dict_rule_tensor(untyped_d, dimension, pi=False):
if dimension == 1:
t = types.float64[:]
elif dimension == 2:
t = types.float64[:, :]
... |
from main import decompose
from main import decompose2
def test(benchmark):
assert benchmark(decompose, 5) == [3, 4]
def test2(benchmark):
assert benchmark(decompose2, 5) == [3, 4]
'''''''''
---------------------------------------------------------------------------------- benchmark: 2 tests -------------... |
from django.contrib import admin
from watchlist_app.models import Review, MovieList, StreamPlatform, Genre
# Register your models here.
admin.site.register(Genre)
admin.site.register(Review)
admin.site.register(MovieList)
admin.site.register(StreamPlatform)
|
# -*- coding: utf-8 -*-
"""Advent of Code 2020 - Day 10 - Adapter Array."""
import argparse
import pdb
import traceback
from itertools import combinations
from typing import Any, List, Set, Tuple
def read_adapters(fname: str) -> List[int]:
with open(fname, "rt") as inf:
return [0] + list(sorted(map(int, ... |
from colosseum.agents.episodic.q_learning.agent import QLearningEpisodic
Agent = QLearningEpisodic
|
import numpy
import torch
import torch.nn as nn
import torch.nn.functional as F
from . import TORCH
def parameter_count(model: nn.Module):
total = 0
for parameter in model.parameters():
total += numpy.prod(parameter.shape)
return int(total)
def dense_net(in_channels: int,
out_chan... |
import asyncio
import hashlib
import hmac
from time import time
from typing import Optional
import stomper
import websockets
import requests
class LatokenClient:
baseWS = 'wss://api.latoken.com/stomp'
baseAPI = 'https://api.latoken.com'
# REST (calls)
# Basic info
user_info_call = '/v2/auth/use... |
import tensorflow as tf
import sys
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
path = sys.path[0]
class Cifar(object):
def __init__(self):
#初始化操作
self.height = 32
self.width = 32
self.channels = 3
#字节数
self.image_bytes = self.height * self.width * self.cha... |
import tkinter, sys
from math import sqrt, pi, atan2
from cmath import exp
from optparse import OptionParser
def get_parent_indices(i, j, nbran):
return (i-1, j//nbran)
class fractal_tree:
def __init__(self, ratio=0.8, angle=pi/2., ngen=3, nbran=2):
"""
ratio: ratio of branch length with resp... |
from ..utils.parsing_utils import sanitize_text
class DoorStyle:
def __init__(
self, style_name: str, species: str, y_range: range, text_lines: list
) -> None:
self.name = style_name
self.species = species
self.ypos_range = y_range
self.text_lines = text_lines
s... |
# -*- coding: utf-8 -*-
from qcloudsdkcore.request import Request
class CdbTdsqlRenameInstanceRequest(Request):
def __init__(self):
super(CdbTdsqlRenameInstanceRequest, self).__init__(
'tdsql', 'qcloudcliV1', 'CdbTdsqlRenameInstance', 'tdsql.api.qcloud.com')
def get_cdbInstanceId(self):
... |
from hashlib import md5
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy import select, func
from flask_security import RoleMixin, UserMixin
from src import db, BaseMixin, ReprMixin
from src.utils.serializer_helper import serialize_data
roles_users = db.Table('roles_users',
db.... |
import importlib
import grpc
import web3
from snet.snet_cli.utils.utils import RESOURCES_PATH, add_to_path
class ConcurrencyManager:
def __init__(self, concurrent_calls):
self.__concurrent_calls = concurrent_calls
self.__token = ''
self.__planned_amount = 0
self.__used_amount = 0
... |
from http.client import RemoteDisconnected
from xmlrpc.client import Fault
from fastapi import APIRouter, HTTPException
from XenAPI.XenAPI import Failure
from XenGarden.session import create_session
from XenGarden.VIF import VIF
from API.v1.Common import xenapi_failure_jsonify
from app.settings import Settings
from ... |
"""
Bosons.
Package:
RoadNarrows elemenpy package.
File:
boson.py
Link:
https://github.com/roadnarrows-robotics/
Copyright:
(c) 2019. RoadNarrows LLC
http://www.roadnarrows.com
All Rights Reserved
License:
MIT
"""
from copy import copy
from enum import Enum
from elemenpy.core.common import (isderive... |
import asyncio
import unittest
from asgi.stream import AsgiHttpRequest, AsgiHttpResponse
from fakes import StreamReader, StreamWriter
class TestAsgiHttpRequest(unittest.TestCase):
def test_reading_scope(self):
raw_request = (
b"GET /api/v1/ HTTP/1.0\r\n"
b"User-Agent: curl/7.54.0... |
# coding: utf-8
import numpy as np
import re
import copy
import sys
import networkx as nx
#import matplotlib.pyplot as plt
#import operator
#from collections import defaultdict
from collections import Counter
from collections import deque
import time
def parse_input(ii, DBG=True):
world = {}
index = 0
init... |
import os
from PIL import Image
def get_img_size(file_name: str):
im = Image.open(file_name)
return im.size
types = {"带电芯充电宝": "core", "不带电芯充电宝": "coreless"}
template = """
<object>
<name>{}</name>
<pose>Frontal</pose>
<truncated>0</truncated>
... |
'''
Generative Adversarial Network
version: 1.1.1
date: Jan/13/2019 version: 1.0.0
Jan/14/2019 1.1.0 deal with STL10 dataset
Jan/16/2019 1.1.1 bug fix
'''
import argparse
import os
import torch.nn as nn
import torch.optim as optim
import torchvision.utils a... |
import json
import typing as t
from datetime import datetime
from aio_anyrun import const as cst
class BaseCollection:
def __init__(self, raw_data: dict):
self.raw_data = raw_data
self._ignores = ['items', 'json', 'raw_data', 'keys', 'values']
self.properties = [prop for prop in dir(self)... |
class PatchServerException(Exception):
pass
class Unauthorized(PatchServerException):
pass
class InvalidPatchDefinitionError(PatchServerException):
pass
class SoftwareTitleNotFound(PatchServerException):
pass
class InvalidWebhook(PatchServerException):
pass
class PatchArchiveRestoreFailure... |
from pandas import Timestamp
from google.protobuf import timestamp_pb2 as pr_ts
from zipline.assets import ExchangeInfo, Equity, Future
from zipline.finance.order import Order
from zipline.finance.transaction import Transaction
from zipline.finance.position import Position
from zipline import protocol
from protos im... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
T2_VERSION = "0.5.0-SNAPSHOT"
|
import enum
class RecordsetType(enum.Enum):
worksheet = 'worksheet'
table = 'table'
view = 'view'
|
import numpy as np
from .VariableUnitTest import VariableUnitTest
from gwlfe.MultiUse_Fxns.Runoff import AgRunoff
class TestAgRunoff(VariableUnitTest):
# @skip("not ready")
def test_AgRunoff(self):
z = self.z
np.testing.assert_array_almost_equal(
AgRunoff.AgRunoff_f(z.NYrs, z.Day... |
#!/usr/bin/python
import sys
import Quartz
d = Quartz.CGSessionCopyCurrentDictionary()
# we want to return 0, not 1, if a session is active
sys.exit(not (d and
d.get("CGSSessionScreenIsLocked", 0) == 0 and
d.get("kCGSSessionOnConsoleKey", 0) == 1))
|
print("Why is Rohan such a smooth criminal?")
|
from setuptools import setup, find_packages
with open("DOCUMENTATION.md", "r") as fh:
long_description = fh.read()
setup(name="neowise",
version='0.1.0',
description="A Deep Learning library built from scratch using Python and NumPy",
author="Pranav Sastry",
author_email="pranava.sri@gmail.... |
import cv2
class Webcam(object):
def __init__(self, cam_id=0):
self.cam = cv2.VideoCapture(cam_id)
def getFrame(self):
return self.cam.read() |
"""
Common type operations.
"""
from typing import Any, Callable, Union
import warnings
import numpy as np
from pandas._libs import algos
from pandas._libs.tslibs import conversion
from pandas._typing import ArrayLike, DtypeObj
from pandas.core.dtypes.dtypes import (
CategoricalDtype,
DatetimeTZDtype,
E... |
__all__ = [
"AlexNet", "DeeplabV1", "DeeplabV2", "DeeplabV3", "DenseASPP", "FCN", "GoogLeNet", "LeNet5", "ResNet", "UNet", "VGG"
]
from .AlexNet import AlexNet
from .DenseASPP import DenseASPP
from .GoogLeNet import GoogLeNet
from .LeNet5 import LeNet5
from .VGG import VGG11, VGG13, VGG16, VGG19
from .ResNet impor... |
#
# Story Time App
# Integration tests for the story_time_service functions
#
from storytime import story_time_service
def test_get_stories_by_category_id():
category_funny = story_time_service.get_category_by_label('Funny')
stories = story_time_service.get_published_stories_by_category_id(category_funny.id)... |
def pretty_table(headers, rows):
"""
:param headers: A list, the column names.
:param rows: A list of lists, the row data.
"""
if not all([len(headers) == len(row) for row in rows]):
return "Incorrect number of rows."
rows = [[stringify(s) for s in row] for row in rows]
headers = [stringify(s) for s... |
"""Auto-generated file, do not edit by hand. GA metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_GA = PhoneMetadata(id='GA', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='1\\d(?:\\d{2})?', possible_length=(2, 4... |
import tensorflow as tf
from utility import draw_toolbox
from utility import anchor_manipulator
import cv2
import numpy as np
def load_graph(model_file):
graph = tf.Graph()
graph_def = tf.GraphDef()
with open(model_file, "rb") as f:
graph_def.ParseFromString(f.read())
with graph.as_default():
... |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 6 11:29:45 2021
@author: sefaaksungu
"""
def MLearning(x1,x2,x3,x4):
# Python version
import sys
#print('Python: {}'.format(sys.version))
# scipy
import scipy
#print('scipy: {}'.format(scipy.__version__))
# numpy
import numpy
#print('n... |
# the revised Cambridge Reference Sequence (rCRS)
# http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?db=nucleotide&val=115315570
# see http://www.mitomap.org/mitoseq.html for explanation
rCRS = "GATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGCATTTGGTATTTTCGTCTGGGGGGTATGCACGCGATAGCATTGCGAGACGCTGGAGCCGGAGCACCCTATGTCGCAGTAT... |
import DoublyLinkedLists
unitTests = True
class Deque:
def __init__(self):
self.items = DoublyLinkedLists.DoublyLinkedList()
self.head = self.items.head
self.tail = self.items.tail
self.empty = True
def enqueueLeft(self, item):
self.items.insert(item)
... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
'''
* __ __
* ____ / /_ ____ ___ __ __ ____ ____ ____ / /
* / __ \/ __ \ / __ `__ \/ / / / / __ \/ __ \/ __ \ / /
* / /_/ / / / / / / / / / / /_/ / / /_/ / /_/ / /_/ / /_/
* \____/_/... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import quadpy
import src.fem_base.master.nodal_basis_2D as nb2d
import src.fem_base.master.barycentric_coord_tools as bct
import src.fem_base.master.master_1D as m1d
class Master2D(object):
def mk_shap_and_dshap_at_pts(self, pts):
shap = s... |
def get_pandigital_multiple(n):
tmp_digit_list = []
multiplicator = 1
# find pandigital multiples while preserving the instruction
while (len(set(tmp_digit_list)) == len(tmp_digit_list)) and (len(tmp_digit_list)<9):
product = str(n * multiplicator)
digit_list = list(product)
... |
"""
ENCODERS: given a set of images, return their encoded representation.
"""
from __future__ import print_function, division
__author__ = 'Vlad Popovici'
__version__ = 0.1
from abc import ABCMeta, abstractmethod
from future.utils import bytes_to_native_str as nstr
import gzip
import pickle
import numpy as np
impor... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import tensorflow as tf
import numpy as np
from libs.configs import cfgs
def bbox_transform_inv(boxes, deltas, scale_factors=None):
dx = deltas[:, 0]
dy = deltas[:, 1]
dw... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.