content stringlengths 5 1.05M |
|---|
# Copyright (c) 2022 PaddlePaddle 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 appli... |
# -*- coding: utf-8 -*-
"""
:author: T8840
:tag: Thinking is a good thing!
:description:
"""
import mitmproxy.http
import json
import os,sys
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0,parentdir)
from utils import get_yaml_data
data = get_yaml... |
from argparse import Namespace
import pandas as pd
import game
import argparse
import time
import random
class Play():
def __init__(self):
'''Initiate a new play'''
self.args_keys = []
self.len_gkeys = 0
self.args_read = self._set_parser()
self.arg_d = {}
self.collection = []
self.log = []
self.df =... |
# MIT License
#
# Copyright (c) 2021 Soohwan Kim
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#****************************************************************************************************************************************************
# Copyright 2020 NXP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modifi... |
'''
DDS: DDS image loader
'''
__all__ = ('ImageLoaderDDS', )
from kivy.lib.ddsfile import DDSFile
from kivy.logger import Logger
from kivy.core.image import ImageLoaderBase, ImageData, ImageLoader
class ImageLoaderDDS(ImageLoaderBase):
@staticmethod
def extensions():
return ('dds', )
def load(... |
# Program to calculate tax band
print('Start')
# Set up 'constants' to be used
BASIC_RATE_THRESHOLD = 12500
HIGHER_RATE_THRESHOLD = 50000
ADDITIONAL_RATE_THRESHOLD = 150000
# Get user input and a number
income_string = input('Please input your income: ')
if income_string.isnumeric():
annual_income = int(income_st... |
'''
'''
import os
from keras.applications.resnet50 import ResNet50
BASE_FOLDER = os.path.join(os.environ['HOME'], 'workspace/Maestria/')
KERAS_MODEL_FOLDER = os.environ['HOME']+'/.keras/models/'
MODELS_FOLDER = os.path.join(BASE_FOLDER, 'Model')
TRAIN_PATH = os.path.join(BASE_FOLDER, 'Videos/tf_pascal_voc')
model = ... |
"""
Created on Thu Mar 24 22:46:30 2022
@author: csemn
"""
import pandas as pd
dataset = pd.read_csv("diabetes.csv")
#Preparing the Data
x = dataset.iloc[:, :-1].values
y = dataset.iloc[:, -1].values
from sklearn.model_selection import train_test_split
x_train, x_test, y_train, y_test = train_test_split(x, y, test_si... |
from io import BytesIO
from unittest import SkipTest
import av
from .common import Image, MethodLogger, TestCase, fate_png, fate_suite, run_in_sandbox
from .test_encode import assert_rgb_rotate, write_rgb_rotate
class BrokenBuffer(BytesIO):
"""
Buffer which can be "broken" to simulate an I/O error.
"""
... |
# Generated by Django 2.0 on 2017-12-14 05:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('devices', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='device',
name='type',
field... |
#!/usr/bin/env python3
from PIL import Image
from struct import pack
def pre(p):
p = list(p)
p[0] = p[0]*p[3]//255
p[1] = p[1]*p[3]//255
p[2] = p[2]*p[3]//255
return p
def write(i, o, X, Y):
for y in range(Y):
for x in range(X):
p = pre(i.getpixel((x, y)))
o.wri... |
from dataclasses import dataclass
from bindings.gmd.topo_curve_type import TopoCurveType
__NAMESPACE__ = "http://www.opengis.net/gml"
@dataclass
class TopoCurve(TopoCurveType):
"""gml:TopoCurve represents a homogeneous topological expression, a
sequence of directed edges, which if realised are isomorphic to ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from collections import namedtuple
from corehq.apps.callcenter.data_source import get_sql_adapters_for_domain
from corehq.apps.reports.analytics.esaccessors import get_form_counts_for_domains
from corehq.apps... |
from django.apps import AppConfig
class PointsConfig(AppConfig):
name = 'poznaj.points'
verbose_name = 'Points'
|
import os
import uuid
import click
def test_var_name_preservation(runner):
@click.command()
@click.option('--modelFileCamelCase', '-m', type=click.Path())
def cli(modelFileCamelCase):
"""Hello World!"""
click.echo("I EXECUTED w/ a camelCaseVariable!")
result = runner.invoke(cli, ["--... |
import seaborn as sns
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
fig_folder = "figure_data/fig3_SEI/"
lb_fs = 12
tl_fs = 10
#e_color =
sns.set_palette("Set1", n_colors=8, desat=.5)
# get the data
dos = pd.read_csv(fig_folder+"dos_interp.txt", sep='\t', skiprows=1, names=["E", "DOS"])... |
#!/usr/bin/env python3
"""
Main module for the deployable project.
"""
# Shared imports for bootstrap and normal use
from pathlib import Path # For bootstrap and figuring out paths from args
# Bootstrap to be able to perform absolute imports as standalone code
if __name__ == "__main__":
from absolute_import import... |
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django.http import HttpResponseRedirect
from django.views.decorators.csrf import csrf_exempt
from django.conf import settings
from pgweb.util.decorators import cache
import httplib
import urllib
import psycopg2
imp... |
# .................................................................................................................
level_dict["regal"] = {
"scheme": "bronze_scheme",
"size": (7,3,9),
"intro": "regal",
"help... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
#######################################
# Script que permite la generación de mapas para las variables de
# temperatura (máxima, mínima y promedio),
# Humedad Relativa (máxima, mínima y promedio),
lluvia, y reflectividad de radar.
# Author: Jorge Mauricio
# Email: jorg... |
# Warm-up + cosine Learning Rate scheduler. Based on the formulas from:
#
# "Bag of Tricks for Image Classification with Convolutional ...." paper
#
# Stores LR to plot in the end
import math
import matplotlib.pyplot as plt
import torch.optim as optim
from callbacks.cb import Callbacks # base
class LR_SchedCB_W... |
__version_info__ = (1, 7, 2)
__version__ = '.'.join(map(str, __version_info__))
|
from typing import TypeVar, Callable, Any
from amino import Either, Boolean, do, Do
from amino.state import State
from amino.boolean import true
from ribosome.nvim.api.data import NvimApi
from ribosome.nvim.io.compute import NvimIOSuspend, NvimIOPure, NvimIOError, NvimIO, NvimIORecover, lift_n_result
from ribosome.nv... |
# coding: utf-8
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)
from pydocx.openxml.packaging import FootnotesPart, MainDocumentPart
from pydocx.test import DocumentGeneratorTestCase
from pydocx.test.utils import WordprocessingDocumentFactory
class FootnoteTestCase(Documen... |
from tkinter import *
def buttonClick():
print("Clicked!")
root=Tk()
f=Frame(root, height=400, width=500)
f.propagate(0)
#f.propagate(1)
f.pack()
b=Button(f, text='Click Here', width=15, height=2, bg='yellow', fg='green', activebackground='blue', activeforeground='red')
#b.bind('<Button-1>',butto... |
def redCountours(image):
frame_threshold = cv2.inRange(image, (0, 100, 100), (10, 255, 255))
thresh2 = cv2.inRange(image, (150, 140, 100), (180, 255, 255))
frame_threshold_both = frame_threshold + thresh2
#Dialate Color Threshold Mask after Eroding to Beef Up detected areas for analysis
frame_t... |
ORANGE, WHITE = '\033[93m', '\033[0m'
def warning(message):
print("\n " + ORANGE + "Warning: " + WHITE + message + "\n")
class _Options:
def __init__(self):
self.values = tuple() # options with non-Boolean values (strings or numbers)
self.flags = tuple() # Boolean options
self.par... |
from django.shortcuts import render, redirect
from LogESP import __version__
# Create your views here.
def index(request):
return render(request, 'index.html', {'version': __version__})
|
#!/usr/bin/env python
# coding: utf-8
"""
A rudimentary backward- and forward-compatible script to benchmark pystache.
Usage:
tests/benchmark.py 10000
"""
import sys
from timeit import Timer
try:
import chevron as pystache
print('Using module: chevron')
except (ImportError):
import pystache
print(... |
#
# PySNMP MIB module TRAPEZE-NETWORKS-CLIENT-SESSION-TC (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TRAPEZE-NETWORKS-CLIENT-SESSION-TC
# Produced by pysmi-0.3.4 at Wed May 1 15:27:13 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using... |
'''
f(n) = 3 g(n-1)
''' |
__version__ = "v1.0"
__copyright__ = "Copyright 2021"
__license__ = "MIT"
__lab__ = "Adam Cribbs lab"
import time
import pandas as pd
class reader(object):
def __init__(self, ):
pass
def todf(self, seqs, names):
"""
Parameters
----------
seqs
names
... |
from glob import iglob
from multiprocessing import Pool
from os import getcwd
from os import path
from os import sep
from sys import platform
from sys import version_info
from tempfile import gettempdir
import pytest
from pytesseract import ALTONotSupported
from pytesseract import get_languages
from pytesseract impor... |
import re
from typing import Any
from dragn.dice.die import DieBuilder
def __getattr__(name: str) -> Any:
"""
Module level __getattr__ to automatically create dice when
one a die of non-standard sizes.
"""
m = re.match(r"D(\d+)", name)
if m is None:
raise AttributeError(f"Name {name} ... |
'''This script uses OpenCV's haarcascade (face and eye cascade) to detect face
and eyes in a given input image.'''
#Import necessary libraries
import cv2 as cv #wrapper package for openCv bindings
import numpy as np
#Load face cascade and hair cascade from haarcascades folder
face_cascade = cv.CascadeClassifier("haar... |
#!/usr/bin/env python
# -*- coding: utf-8
import argparse
import socket
import json
from flask import Flask, render_template, request
from src import osint
def validate_address_port(address, port):
"""
Validate IP address and port
"""
try:
socket.inet_aton(address)
except socket.error:
... |
# pylint: disable=invalid-name, unused-variable
"""Schedule for dense operator"""
from __future__ import absolute_import as _abs
import tvm
from tvm.contrib import rocblas
import topi
from ..nn.dense import dense, dense_default
from .. import tag
from .. import generic
@dense.register("rocm")
def dense_rocm(data, weig... |
import pytest
from xnd import xnd
import test_scalar as m
def unpack(x):
if isinstance(x, xnd):
return str(x.type), x.value
if isinstance(x, tuple):
return tuple(map(unpack, x))
return x
def assert_equal(x, y):
assert unpack(x) == unpack(y)
def test_scalar_input():
dt = 'int6... |
from time import time
import torch
import random
import numpy as np
import os
from pypinyin import lazy_pinyin
import jieba
def time_cost(func):
def wrapper(*arg, **kargs):
t0 = time()
res = func(*arg, **kargs)
t1 = time()
print(f'[{func.__name__}] cost {t1 - t0:.2f}s')
ret... |
import unittest
import datafilereader
class TestParents(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.project = datafilereader.construct_project(
datafilereader.SIMPLE_TEST_SUITE_PATH)
cls.directory = cls.project.data
cls.test = datafilereader.get_ct... |
import click, os, functools, sys
from carbin import __version__
from carbin.prefix import CarbinPrefix
from carbin.prefix import PackageBuild
import carbin.util as util
aliases = {
'rm': 'remove',
'ls': 'list'
}
class AliasedGroup(click.Group):
def get_command(self, ctx, cmd_name):
rv = click.Gr... |
#!/usr/bin/env python
"""
Something like
https://github.com/vs-uulm/nemesys/blob/c03cafdaed3175647d5bc690488742745acbd0eb/src/nemesys_fms.py
adopted to test l2pre with Fomat Match Score (FMS)
"""
# system import
import argparse
from IPython import embed
from time import time
# nemere import
from nemere.validation.di... |
import unittest
from code.evallib import recall
class TestRecall(unittest.TestCase):
'''
Recall tests
recall excepts two parameters: two document sets (relevent and retrieved)
It returns the value of: |(relevent INTERSECTION retrieved)| / |relevent|
'''
def test_expected(self):
releve... |
from typing import List, Optional
from athenian.api.models.web.base_model_ import Model
from athenian.api.models.web.contributor import Contributor
class Team(Model):
"""Definition of a team of several developers."""
openapi_types = {
"id": int,
"name": str,
"members": List[Contribut... |
#!/usr/bin/env python
"""
Module for stats and fitting classes.
Created June 2015
Copyright (C) Damien Farrell
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 ... |
from load_data.ILoadUnsupervised import ILoadUnsupervised
from os import listdir
from os.path import join, splitext
#from pims import ImageReader
from PIL import Image
class LoadAnimeFaces(ILoadUnsupervised):
def __init__(self, folderpath="train_data/Folder_Manga_Anime/anime-faces"):
self.folderpath = fold... |
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from future import standard_library
import twitter_scraper as twitter_scraper
import json
import codecs
standard_library.install_aliases()
def main():
def build_list... |
from copy import deepcopy
from py_ecc import bls
import build.phase0.spec as spec
from build.phase0.utils.minimal_ssz import signed_root
from build.phase0.spec import (
# constants
EMPTY_SIGNATURE,
# SSZ
AttestationData,
Deposit,
DepositInput,
DepositData,
Eth1Data,
VoluntaryExit,
... |
from serial import Serial
import time
print("Starting.")
port = "/dev/cu.usbmodem14201" #port for Arduino.
ser = Serial(port, 9600)
time.sleep(2) #wait for Arduino.
sendedBytes = ser.write("90,90,90".encode())
print(sendedBytes)
print(ser.readline()) #wait and read string from... |
# -*- coding: utf-8 -*-
import cv2
import numpy as np
import matplotlib.pyplot as plt
## Grayscale
def BGR2GRAY(img):
gray = 0.2126 * img[..., 2] + 0.7152 * img[..., 1] + 0.0722 * img[..., 0]
gray = gray.astype(np.uint8)
return gray
# Sobel filter
def sobel_filter(img, K_size=3):
H, W = img.shape
... |
from audioop import add
from typing import Text
from linebot.models import TemplateSendMessage, ButtonsTemplate, LocationAction
from models.message_request import MessageRequest
from skills import add_skill
@add_skill('{action_location}')
def get(message_request: MessageRequest):
location = TemplateSen... |
"""
Copyright (c) 2016-2020 Keith Sterling http://www.keithsterling.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, m... |
import tempfile
import time
from pybloom.pybloom import BloomFilter
NS = 10**9
for _p in xrange(1, 3):
p = 10 ** _p
for e in xrange(9):
X = int(1000 * 10 ** (e / 2.0))
print X, p,
bloomfilter = BloomFilter(X + 1, 1.0/p)
t = time.time()
for x in xrange(X):
b... |
# Copyright (C) 2021 DB Systel GmbH.
#
# 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 w... |
test_cases = int(input().strip())
for t in range(1, test_cases + 1):
N = int(input().strip())
nums = ''
while len(nums) != N:
nums += ''.join(input().strip().split())
num = 0
while True:
if str(num) not in nums:
break
num += 1
print('#{} {}'.format(t, num)... |
import FWCore.ParameterSet.Config as cms
from RecoJets.JetProducers.ak4TrackJets_cfi import ak4TrackJets
from CommonTools.RecoAlgos.TrackWithVertexRefSelector_cfi import *
from RecoJets.JetProducers.TracksForJets_cff import *
recoTrackJetsTask =cms.Task(trackWithVertexRefSelector,
trac... |
# encoding: utf-8
from __future__ import absolute_import
import csv
import datetime
import json
import six
from auth.constants import ROLES
from auth.models import Role, Network, Gateway, Voucher, Country, Currency, Product, db, users
from auth.services import manager
from flask import current_app
from flask_script ... |
from Layer.MulLayer import MullLayer
from Layer.AddLayer import AddLayer
# Buy Apple Pattern
apple = 100
applefigure = 2
appleLayer = MullLayer()
taxLayer = MullLayer()
tax = 1.1
# forward
print("\n---forward---")
applePrice = appleLayer.forward(apple, applefigure)
print("applePrice:" + str(applePrice))
allprice = ... |
#
# 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 logging import getLogger
from django.conf import settings as django_settings
from django.core.mail import EmailMessage
from django.core.mail.backends.smtp import EmailBackend
from django.template.loader import render_to_string
from django.utils import translation, timezone
from core.version import __version__
fro... |
import argparse
import os
import torch
import numpy as np
from utils.config import create_config
from utils.common_config import get_model, get_train_dataset,\
get_val_dataset, get_val_dataloader, get_val_transformations
from utils.memory import MemoryBank
from utils.utils import fill_m... |
import sys
from pathlib import Path
file_dir = Path(__file__).parent
sys.path.append(str(file_dir.parent))
|
# _*_coding:utf-8_*_
# Author: xiaoran
# Time: 2018-12-13
import numpy as np
def zero_one_loss(y_true, y_pred):
'''
param:
y_true: narray or list
y_pred: narray or list
return: double
'''
y_true = np.array(y_true)
y_pred = np.array(y_pred)
return 1.0 * (len(y_true)... |
import numpy as np
name = input("Config file name: ")
configs = np.load("data/"+name+".npy")
print(len(configs))
dataset = input("Dataset: ")
n = int(input("Number of parts: "))
size = int(len(configs)/n)+1
for i in range(n):
np.save("data/"+dataset+"_conf"+str(i), configs[ size*i : size*(i+1) ]) |
# Copyright (c) 2018, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
'''
Fields to move from item group to item defaults child table
[ default_cost_center, default_expense_account, default_income_account ]
''... |
#
# @lc app=leetcode id=987 lang=python3
#
# [987] Vertical Order Traversal of a Binary Tree
#
# https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree/description/
#
# algorithms
# Medium (37.69%)
# Likes: 1345
# Dislikes: 2343
# Total Accepted: 131.6K
# Total Submissions: 338.5K
# Testcase Exam... |
from tree import BinarySearchTree, BinaryTree
import pytest
def test_class():
assert BinarySearchTree
def test_traverse():
tree = BinarySearchTree()
tree.add('bananas')
tree.add('apples')
tree.add('cucumbers')
items = list(tree.traverse_in_order())
assert items == ['apples','bananas','c... |
from tg import expose, TGController, AppConfig
from controllers import RootController
from controllers import ArtistFileService
service = ArtistFileService.ArtistFileService('controllers/artists.json')
controller = RootController.RootController(service)
config = AppConfig(minimal=True, root_controller=controller)
ap... |
#!/usr/bin/python
def do_sum(n):
sum = 0
for i in xrange(n):
sum += i
print(sum)
if __name__ == '__main__':
import sys
n = int(sys.argv[1])
do_sum(n)
|
from bauh.api.abstract.model import SuggestionPriority
ALL = {
'com.spotify.Client': SuggestionPriority.TOP,
'com.skype.Client': SuggestionPriority.HIGH,
'com.dropbox.Client': SuggestionPriority.MEDIUM,
'us.zoom.Zoom': SuggestionPriority.MEDIUM,
'org.telegram.desktop': SuggestionPriority.MEDIUM,
... |
TARGET_FILE_FIELD='targetFile'
TARGET_METHOD_FIELD='targetMethod'
TARGET_METHOD_ARGS_FIELD='targetMethodArgs'
TARGET_METHOD_RETURN_FIELD='targetMethodReturn'
TARGET_METHOD_RETURN_VALUE='targetMethodReturnValue'
CHALLENGE_YAML='challenge.yaml'
API_ADRESS='127.0.0.1'
API_PORT=6070
MISSION_USER_SCORE_ENDPOINT='/deadlock/... |
from scipy import spatial
from .validator import validate_keys
import numpy as np
import time
from .utils import paral_query, print_histo, parallel_query
_VALID_KWARGS = {"k1": None,
"k5": None,
"k10": None,
"min_dist_vec": None,
"n": None,
"MRR": None,
"mean": None}
class Indicators(o... |
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from scipy import optimize
from PIL import Image
import PIL
import cv2
# pip install opencv-python pip install pillow
# Variables outside Loop
period, periodUncertainty = [],[]
graphDirectory = "Lab/Ter... |
import numpy
numpy.random.seed(0)
import CDAE
import movie_lens
import metrics
# data
train_users, train_x, test_users, test_x = movie_lens.load_data()
train_x_users = numpy.array(train_users, dtype=numpy.int32).reshape(len(train_users), 1)
test_x_users = numpy.array(test_users, dtype=numpy.int32).reshape(len(test_us... |
"""Bunny worker solutions
"""
import timeit
def solution(x, y, mode=1):
# This is essentially a Fibonacci sequence problem
if mode == 1:
# Calculate starting number
c_0 = 1
for i in range(1, y+1):
c_0 += i - 1
# Calculate ID
bunny_id = c_0
for i ... |
import torch
from torch import nn
from torch.nn import *
__all__ = ["Squeeze"]
class
|
import numpy as np
from spyne.models import NeuralNetwork
from spyne.layers import FullyConnectedLayer
# generate some data
x = np.random.normal(0, 1, (50000, 5))
y = 3.14 * x[:, 0] + 1.41 * np.square(x[:, 1]) - 2.72 * np.power(x[:, 1], 4) - 1.62 * x[:, 4]
train_x = x[:40000]
train_y = y[:40000]
test_x = x[40000:]... |
import FWCore.ParameterSet.Config as cms
import FWCore.ParameterSet.VarParsing as VarParsing
process = cms.Process("DISPLAY")
options = VarParsing.VarParsing ()
options.register ('file',
"xxx", # default value
VarParsing.VarParsing.multiplicity.singleton,
VarPars... |
"""
File: abstractstack.py
Author: Ken Lambert
"""
from abstractcollection import AbstractCollection
class AbstractStack(AbstractCollection):
"""An abstract stack implementation."""
def __init__(self, sourceCollection = None):
"""Sets the initial state of self, which includes the
contents of ... |
#!/usr/bin/env python
import imp
"""
service example
"""
resources_dir = 'RESOURCES_PATH'
mypydoc=imp.load_source('mypydoc',resources_dir+'/mypydoc.py')
mypydoc.cli()
|
from setuptools import setup
setup(
name='fgdb2postgis',
version=__import__('fgdb2postgis').get_current_version(),
description="""ESRI file geodatabase to PostGIS converter""",
long_description=open('README.rst').read(),
author='George Ioannou',
author_email='gmioannou@cartologic.com',
url=... |
"""
Generate results presented in selective indexing paper.
Three figures are generated, as well as a text file containing
precision and recall scores for ensemble, cnn, and combined models
at a series of thresholds.
"""
import json
import numpy as np
import sys
import pandas as pd
import matplotlib.pyplot as plt
fr... |
import os, tempfile, random, cStringIO
os.environ['MPLCONfigureDIR'] = tempfile.mkdtemp()
try:
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure
from matplotlib.patches import Ellipse
except ImportError:
raise HTTP(200, "requires mathplotlib... |
user='simple_user'
pw='simple_user'
url='db:5432'
db='commentcloud'
|
# Copyright 2017-2020 Fitbit, Inc
# SPDX-License-Identifier: Apache-2.0
"""JLink related tasks"""
import re
import socket
from functools import reduce # pylint: disable=W0622
from invoke import task
from ..deps import version_check, build_instructions
@task
def check_version(ctx, abort=True):
'''Check if JLin... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
###############################################################################
#
# searcher.py - File search utility
#
###############################################################################
import fnmatch
import os.path
import re
import sys
import subprocess
import threading
import time
import... |
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (c) 2019 HERE Europe B.V.
#
# SPDX-License-Identifier: MIT
# License-Filename: LICENSE
#
###############################################################################
from ..common.error import make... |
from mmseg.ops import DepthwiseSeparableConvModule
from ..builder import HEADS
from .fcn_head import FCNHead
@HEADS.register_module()
class DepthwiseSeparableFCNHead(FCNHead):
"""Depthwise-Separable Fully Convolutional Network for Semantic
Segmentation.
This head is implemented according to Fast-SCNN pap... |
#Constroi o arquivo e path de backup e retorna
from datetime import datetime, date
class Datahora:
date = datetime.now()
print ( date.hour, ':', date.minute, ' ', date.day, '-',
date.month, '-', date.year )
class Backup:
@staticmethod
def gerabackup( backup ):
# date = (time.strftim... |
import time
import serial
import queue
from threading import Thread
from tkinter import *
PASSWORD = 'pms'
LOGIN_NUM = 3
def login_handler(pass_entry, info, q):
# Check if the entered password is correct.
text = pass_entry.get()
if text == PASSWORD:
# Inform other threads that user tried to lo... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import rospy
from actionlib import ActionClient, ActionServer
from actionlib_msgs.msg import GoalStatus
from rpn_recipe_planner_msgs.msg import RPNRecipePlannerAction
from rpn_recipe_planner_msgs.srv import RPQuery, RPQueryResponse
from rpn_recipe_planner_msgs.srv import RPUpda... |
__version__ = '0.3.0'
__description__ = 'The Keb Docker wrapper'
|
# Copyright 2021 The Pigweed 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 License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
#!/usr/bin/env python3.9
"""
Sever driver, this should be run first
"""
from SockMonkey.Domain.Client.cli import main as cli_main
from SockMonkey.Domain.Server.server import main as server_main
# cli_main()
server_main([])
|
# -*- coding: utf-8 -*-
# PyAlgoTrade
# @ rebuild by chinese xuefu@pyalgteam.sdu,please call me leiFeng.<sdu.xuefu@gmail.com>
# 实现tushare的livefeed读写,与tushare格式兼容,同时允许自定义在开始livefeed前加载前面n天或者小时等的历史数据,请教我雷锋
# 饿肚子饿到下午
# Copyright 2011-2015 Gabriel Martin Becedillas Ruiz
# Licensed under the Apache License, Version 2.0 (the... |
import abc
from typing import Optional
import logging
logger = logging.getLogger(__name__)
use_keyring = True
"""
``use_keyring`` is a :class:`bool` which denotes whether it is possible to use
:class:`KeyringSecretStore`.
"""
try:
import keyring
logger.info('Using keyring')
except ModuleNotFoundError:
... |
import sys
XOR_KEY = 0xFF
CHUNK_SIZE = 2048
def main():
file_name = 'gta3.img'
with open(file_name, 'rb') as infile, \
open(file_name + '-xor', 'wb') as outfile:
for chunk in iter(lambda: infile.read(CHUNK_SIZE), b''):
xored = bytearray(chunk)
for i, _ in enumerate(xore... |
from django.conf.urls import url
from .views import ReleaseList, Artifact, GroupsRelaseList
app_name = 'mystery'
urlpatterns = [
url(r'^release/list$', ReleaseList.as_view(), name='release_list'),
url(r'release/(?P<release>[0-9]*)$', Artifact.as_view(),
name='artifact_view'),
url(r'release/group/(?... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.