text stringlengths 2 999k |
|---|
# coding=utf-8
# Copyright 2020 The TF-Agents 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 la... |
from autosklearn.pipeline.components.base import find_components # noqa
from autosklearn.pipeline.components.base import AutoSklearnClassificationAlgorithm # noqa
|
from collections import defaultdict
import psutil
from system_monitor.msg import Cpu as CpuMsg
_prev_total = defaultdict(int)
_prev_busy = defaultdict(int)
def collect_all():
"""
parse /proc/stat and calculate total and busy time
(more specific USER_HZ see man 5 proc for further information )
"""
... |
# coding:utf-8
from __future__ import absolute_import, unicode_literals
from scrapy.utils.misc import load_object
from scrapy.utils.reqser import request_from_dict, request_to_dict
import json
from .mongo import Mongo
__author__ = "golden"
__date__ = '2017/6/6'
class MongoScheduler(object):
def __init__(self, du... |
import sut as SUT
import sys
rout = open("replay.out",'w')
file = sys.argv[1]
t = SUT.sut()
t.restart()
i = 0
for l in open(file):
name = l[:-1]
if name == "<<RESTART>>":
#print "RESTART"
rout.write("RESTART\n")
t.restart()
else:
#print "STEP",i,name
rout.write("ST... |
import time as t
def MainLoop(func):
def wrapper():
while True:
t.sleep(0.01)
func()
return wrapper |
"""
This library for transformations partly derived and was re-implemented from the
following online resources:
* http://www.lfd.uci.edu/~gohlke/code/transformations.py.html
* http://www.euclideanspace.com/maths/geometry/rotations/
* http://code.activestate.com/recipes/578108-determinant-of-matrix-of-any-o... |
#!/usr/bin/env python
from setuptools import setup
with open('README.md') as f:
long_description = f.read()
setup(name="pipelinewise-target-s3-csv",
version="1.4.0",
description="Singer.io target for writing CSV files and upload to S3 - PipelineWise compatible",
long_description=long_descriptio... |
# file: share/when-wizard/templates/cond-event-batterylow.py
# -*- coding: utf-8 -*-
#
# Condition plugin for the low battery event
# Copyright (c) 2015-2018 Francesco Garosi
# Released under the BSD License (see LICENSE file)
import locale
from plugin import EventConditionPlugin, PLUGIN_CONST, plugin_name
# setup i1... |
"""
These are borrowed from SciPy and used under their license:
Copyright (c) 2001, 2002 Enthought, Inc.
All rights reserved.
Copyright (c) 2003-2012 SciPy Developers.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following condi... |
from .base import GenericDecorator
class use_self_property(GenericDecorator):
"""
for one argument class functions.
if non-self argument is missing, use a property from self
e.g.
@use_self_property("foobar")
def bar(self,foo):
print foo
if bar doesn't recieve foo... |
from django.conf.urls.defaults import *
from celery.task.builtins import PingTask
from celery.views import task_view
from celery import views as celery_views
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns("",
url(r'^apply/(?P<t... |
import random
### Standard Array ####
standardArray = [15, 14, 13, 12, 10, 8]
#testing
print("Standard Array = ", standardArray) |
#!/usr/bin/env python3
"""
Copyright 2015 Zalando SE
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... |
#!/usr/bin/env python
# CAVEAT UTILITOR
#
# This file was automatically generated by TatSu.
#
# https://pypi.python.org/pypi/tatsu/
#
# Any changes you make to it will be overwritten the next time
# the file is generated.
from __future__ import annotations
import sys
from tatsu.buffering import Buffer
from tatsu... |
import logging
import os
import shutil
import subprocess
from subprocess import TimeoutExpired
_logger = logging.getLogger("ppqm.sh")
def command_exists(cmd):
""" Does this command even exists? """
path = shutil.which(cmd)
if path is None:
return False
return True
def switch_workdir(path... |
from .space import *
from .task import *
from .decorator import *
|
from re import S
import sys
import signal
sys.path.insert(0, ".")
from fungit.event.key import Key
from fungit.term import Term
def signal_test(signum, frame):
print(signum)
print(frame)
if __name__ == "__main__":
signal.signal(signal.SIGINT, signal_test)
Term.init()
Key.start()
while Tru... |
# -*- coding: utf-8 -*-
#
# 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
... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from ..velocity import (
FaucherKaspi2006VelocityMaxwellian,
Paczynski1990Velocity,
FaucherKaspi2006VelocityBimodal,
VMAX,
VMIN,
)
velocity_models_1D = {
FaucherKaspi2006VelocityMaxwellian: {
"parameters": [1, 265],
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 11 15:39:27 2021
@author: alef
"""
"""
Implementar uma função que retorne verdadeiro se o número for primo
falso caso o contrário. Testar de 1 a 100
"""
def primo(num):
soma = 0
for i in range(1, num+1):
# print('i = >',i)
... |
from __future__ import division
import os
import argparse
import glob
import torch
import torch.nn as nn
import numpy as np
from skimage.io import imread, imsave
import tqdm
import imageio
import neural_renderer as nr
current_dir = os.path.dirname(os.path.realpath(__file__))
data_dir = os.path.join(current_dir, 'dat... |
#%% Import libraries
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.python.client import device_lib
from sklearn.model_selection import train_test_split
from keras import metrics
from keras.models import Sequential
from keras.layers import Dense
from keras.callbacks impor... |
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
#
# tagTests.py: test out tag-related commands
import os
import time
from test_base import TestBase
class TagTests(TestBase):
def __init__(self):
return super(TagTests, self).__init__("TagTests")
def set_tags_test(self, names... |
# standard libraries
import numpy as np
import random
import time
from collections import namedtuple, Counter
import operator
import os
from copy import deepcopy
import heapq
# pytorch
import torch
import torch.nn as nn
import torch.optim as optim
# import from other files
from .toric_model import Toric_code
from .tori... |
#
# 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 us... |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
#
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# 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 l... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from statsmodels.tsa.seasonal import seasonal_decompose
from statsmodels.tsa.holtwinters import SimpleExpSmoothing # SES
from statsmodels.tsa.holtwinters import Holt # Holts Exponential Smoothing
from statsmodels.tsa.hol... |
#import pygame
import codecs
import random
from collections import defaultdict
from menu import Menu
class ChargeQuizz(Menu):
def __init__(self, game):
Menu.__init__(self, game)
self.game = game
self.state=0
self.fail = False
self.a, self.b = None, None
self.cost = 7... |
"""
Git
===
This module provides low-level tools for managing `Git`_ repositories. You
should normally not use them directly but rather use the high-level wrapper
:func:`fabtools.require.git.working_copy` instead.
.. _Git: http://git-scm.com/
"""
from fabric.api import run
from fabric.api import sudo
from fabric.c... |
from flask import session
from functools import wraps
def login_required(f):
@wraps(f)
def decorated_function(*args, **kwargs):
user = dict(session).get('profile', None)
# You would add a check here and usethe user id or something to fetch
# the other data for that user/check if they e... |
from django.contrib import admin
from .models import Question, Response
@admin.register(Question)
class QuestionAdmin(admin.ModelAdmin):
list_display = ('title', 'slug', 'author', 'date_posted')
list_filter = ('date_posted', 'author')
search_fields = ('title', 'content')
prepopulated_fields = {'slug': ... |
from django.contrib import admin
from .models import Traffic
admin.site.register(Traffic) |
"""ntou URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vi... |
from templates import OutputProcessor
import hashlib
from pprint import pprint
class Hashes(OutputProcessor):
def process(self, filename, name, data):
filedata = open(filename).read()
result = {'malware': name}
result['md5'] = hashlib.md5(filedata).hexdigest()
result['sha256'] = hashlib.sha256(filedata).hexdi... |
"""Various utility functions for dealing with images, such as
reading images as numpy arrays, resizing images or making them sharper."""
import os.path
import cv2
import numpy
import exifread
from .utils import file_cache
@file_cache
def read_image(image_path, ROI=None):
"""Read an image from a file in graysca... |
import itertools
import sys
sys.path.append('..')
from intcode.intcode import IntCodeComputer
class Amplifiers:
def __init__(self, program):
self.memory = list(map(lambda m: int(m), program.split(',')))
def find_highest_signal(self):
power_combos = list(itertools.permutations([0, 1, 2, 3, 4],... |
"""
This file offers the methods to automatically retrieve the graph Eubacterium yurii.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protein asso... |
# Copyright 2014: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
from setuptools import setup
setup(
name="autotrade",
version="0.1.0",
description="Auto Trade Bot",
author="Karunakar Gadireddy",
author_email="karu2412@gmail.com",
packages=["autotrade"],
package_data={"": ["*.so", "*.dll"]},
include_package_data=True,
)
|
# coding:utf8
class Plugin(object):
__doc__ = '''Плагин предназначен для приостановки работы бота (игнорирование сообщений).
Для использования необходимо иметь уровень доступа {protection} или выше
Ключевые слова: [{keywords}]
Использование: {keyword} <секунды>
Пример: {keyword} 60'''
name = ... |
#@PydevCodeAnalysisIgnore
import unittest
from numpy.core.numeric import Inf
from pymote.networkgenerator import NetworkGenerator, NetworkGeneratorException
from pymote.conf import settings
from pymote.environment import Environment2D
from pymote.channeltype import Udg
from pymote.sensor import NeighborsSensor
from pym... |
#! /usr/bin/env python3
import argparse
import os
import re
import csv
import PyPDF2
def get_data_re():
return re.compile('Individual Education Plan for (.+?)Student ID.+?OEN ([0-9]{3}-[0-9]{3}-[0-9]{3}).+?Accommodations Instructional Environmental Assessment(.+?)(Human|!).+?Jennifer Meeker Date')
def file_che... |
# -*- coding: utf-8 -*-
"""
Plotting tool for Optimizer Analysis
This module is built on top of :code:`matplotlib` to render quick and easy
plots for your optimizer. It can plot the best cost for each iteration, and
show animations of the particles in 2-D and 3-D space. Furthermore, because
it has :code:`matplotlib` ... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'MegaBlog.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Impor... |
# for document clustering |
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... |
# that need to be manually curated
import ontology
import re
import scanpy as sc
import sys
# Read shendure big data
dataset = sc.read('./Survey_of_human_embryonic_development-processed.h5ad', 'r')
cell_types = list(dataset.obs['sub_cluster_name'].unique())
# Creeate look up table
print("original_cell_type", "str... |
# coding=utf-8
# Copyright 2022 The Google Research 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
"""
07 单身狗配对2
"""
# @Author: Anderson
# @Date: 2018-08-11 17:26:45
# @Last Modified by: Anderson
# @Last Modified time: 2018-08-17 16:26:44
s = input()
s_list = s.split(' ')
stack = []
can_match =True
for item in s_list:
if item[0] == 'm':
stack.append(item)
else:
if len(stack) == 0:
... |
#!/usr/bin/env python3
import os
import sys
from aiohttp_prodtools.version import VERSION
git_tag = os.getenv('TRAVIS_TAG')
if git_tag:
if git_tag.lower().lstrip('v') != str(VERSION).lower():
print('✖ "TRAVIS_TAG" environment variable does not match package version: "%s" vs. "%s"' % (git_tag, VERSION))
... |
_base_ = [
'../../_base_/models/mocov3/vit_small.py',
'../../_base_/datasets/cifar100/mocov3_vit_sz224_bs64.py',
'../../_base_/default_runtime.py',
]
# interval for accumulate gradient
update_interval = 8 # total: 8 x bs64 x 8 accumulates = bs4096
# additional hooks
custom_hooks = [
dict(type='Cosine... |
# 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 u... |
# Copyright 2018 Open Source Robotics Foundation, Inc.
#
# 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... |
"""
Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's
Smalltalk testing framework.
This module contains the core framework classes that form the basis of
specific test cases and suites (TestCase, TestSuite etc.), and also a
text-based utility class for running the tests and reporting th... |
from flask import Flask, request
from twilio.twiml.messaging_response import MessagingResponse
from utils import fetch_reply
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello, World!"
@app.route("/sms", methods=['POST'])
def sms_reply():
"""Respond to incoming calls with a simple text message... |
from ..utils.config import config
cfg = config()
font_size = cfg['window']['font-size']
style = """
QWidget {
font-size: %s;
background-color: black;
color: white;
}
#Motd, #Motd > * {
background-color: none;
color: none;
font-size: auto;
}
QListVi... |
from . import tool
from .. import options as opts, safe_str
from .common import SimpleCommand
from ..file_types import Library
from ..iterutils import uniques
from ..path import BasePath, InstallRoot, Root
@tool('patchelf')
class PatchElf(SimpleCommand):
def __init__(self, env):
super().__init__(env, name... |
# Copyright (c) 2017-2019, NVIDIA CORPORATION. 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 a... |
#############################################################################
# Content to LMS converter for CyLMS
#############################################################################
# External imports
from distutils import dir_util
from distutils.errors import DistutilsFileError
import os
import io
import ... |
import seaborn as sns
import pandas as pd
from . import useful
from .tcrdist import stats as stat
import matplotlib.pyplot as plt
import numpy as np
import logomaker
from collections import Counter
def plot_distance_matrix(
data,
row_colors : str = None,
**kwargs) :
if row_colors :
if row_colors not in data.... |
from axolotl.util.keyhelper import KeyHelper
from axolotl.identitykeypair import IdentityKeyPair
from axolotl.groups.senderkeyname import SenderKeyName
from axolotl.axolotladdress import AxolotlAddress
from axolotl.sessioncipher import SessionCipher
from axolotl.groups.groupcipher import GroupCipher
from axolotl.groups... |
import pandas as pd
import numpy as np
df_list= list()
if 'frequency' not in snakemake.input[0]:
d= pd.read_csv(snakemake.input[0], sep= '\t', header= None, names= ['segment', 'n', 'beta', 'sd', 'pvalue'])
d[['chr', 'cM1', 'cM2']]= d['segment'].str.split(':', expand= True)
d[['chr', 'cM1', 'cM2']]= d[['chr', 'cM1'... |
'''
Universidade Tecnológica Federal do Paraná
Aluno: Clodoaldo A. Basaglia da Fonseca
RA: 968692
Engenharia de Software 2
'''
import math, sys
'''
IN: String com o caminho até o arquivo com valores
Recebe o caminho do arquivo, faz um split na quebra de linha e devolve um vetor
de valores
OUT: Vetor de valores
'''... |
# -*- coding: utf-8 -*-
"""
Created on 2021/02/27 21:13:39
@File -> config_loader.py
@Author: luolei
@Email: dreisteine262@163.com
@Describe: 项目配置工具
"""
import logging
logging.basicConfig(level=logging.INFO)
import matplotlib.pyplot as plt
import logging.config
import logging
import yaml
import sys
import os
BA... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 29 08:58:00 2020
@author: simon
SEE EXAM in the SECTION BELOW
"""
#%%
import sympy as sp
import numpy as np
import matplotlib.pyplot as plt
# Quantizer
# quant(0.111, [-0.125, 0.125]) ==> 1 out of range[0, 1, 2]
# returns value in range [0 to n+1] where... |
# Copyright 2021 The Blqs Developers
#
# 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 ... |
import requests
import json
import numpy as np
import sys
"""
This python script is used to get all ec2 instances
python3 get_ec2_instances.py 0000000000000000000000000000000000000000000000000000000000000000
"""
def get_token_ec2_instances(admin_api_key, env, account_name, i, next_token):
# if first time the met... |
# -*- coding: utf-8 -*-
# Copyright 2015 www.suishouguan.com
#
# Licensed under the Private License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://github.com/samuelbaizg/ssguan/blob/master/LICENSE
#
# Unless re... |
# file: config.py
# Author : Abinash Mohanty
# Date : 05/05/2017
# Project : RRAM training NN
"""
Configuration file for RRAM training.
"""
from easydict import EasyDict as edict
import os
import os.path as osp
__C = edict()
__C.TRAIN = edict()
__C.TEST = edict()
__C.RRAM = edict()
cfg = __C
__C.ROOT_DIR = osp.a... |
from functools import partial
from pdb import set_trace as st
import tensorflow as tf
import numpy as np
import random
from foolbox.attacks import (
FGSM,
DeepFoolAttack,
DeepFoolLinfinityAttack,
DeepFoolL2Attack,
IterativeGradientSignAttack,
SaliencyMapAttack,
RandomPGD,
CarliniWagnerL... |
# This code is made to run on the user's computer. Not on the server unit
import numpy as np, requests, time
from PIL import ImageGrab
def timePrint(printVal, newLine=False):
if newLine:
print("\n")
currentTime = time.strftime("%H:%M:%S", time.localtime())
print(f"{currentTime}: {printVal}")
def ... |
from .handshake_ecdh_anon import EcdhAnon
from .handshake_ecdhe_psk import EcdhePsk
from .helper import Helper
from ..connection_manager.connection import Connection
from ..connection_manager.connection_manager import ConnectionManager
from ..const import tls as const_tls
from ..constructs import dtls
from ..tls.handsh... |
# -*- coding: utf-8 -*-
"""
13 July 2020
Author: Xiandi Ooi
Dataset version update 03
Adding newly released datasets.
"""
import pandas as pd
# Adding the new datasets released in June 2020
df = pd.read_csv(r"filepath\Aggregate-API.csv", sep = ";")
df1 = pd.read_csv(r"filepath\API_Melaka_2019_cleaned.csv")
df2 = ... |
from torch.utils.data import Dataset
import csv
import numpy as np
from matplotlib import image
from constant.constPath import *
import torch
import random
def setSeed(seed):
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.cuda.manual_seed_all(seed... |
#!/usr/bin/env python
# Copyright 2012 - 2017, New York University and the TUF contributors
# SPDX-License-Identifier: MIT OR Apache-2.0
"""
<Program Name>
test_updater.py
<Author>
Konstantin Andrianov.
<Started>
October 15, 2012.
March 11, 2014.
Refactored to remove mocked modules and old repository t... |
'''
ms1 experiment (:mod:`calour.ms1_experiment`)
=======================================================
.. currentmodule:: calour.ms1_experiment
Classes
^^^^^^^^
.. autosummary::
:toctree: generated
MS1Experiment
'''
# ----------------------------------------------------------------------------
# Copyright ... |
from pathlib import Path
import time
import numpy
import psutil
import pytest
from ..client import from_config
from ..server.object_cache import ObjectCache, get_object_cache, NO_CACHE
from ..trees.files import DEFAULT_POLL_INTERVAL
def test_tallying_hits_and_misses():
cache = ObjectCache(1e6)
assert cache.... |
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 20 19:05:43 2017
@author: bokorn
"""
import numpy as np
import torch
from torch.autograd import Variable
from quat_math import quatAngularDiff, quat2AxisAngle
def quaternionLoss(preds, labels, mean = True):
"""
:param preds: quaternion predictions (batch_size,... |
try:
from . import generic as g
except BaseException:
import generic as g
class ExportTest(g.unittest.TestCase):
def test_svg(self):
for d in g.get_2D():
if g.np.isclose(d.area, 0.0):
continue
# export and reload the exported SVG
loaded = g.trim... |
from django.conf.urls import url
from django.contrib import admin
from django.contrib.auth import views as auth_views
from accounts import views as accounts_views
from boards import views
urlpatterns = [
url(r'^$', views.BoardListView.as_view(), name='home'),
url(r'^signup/$', accounts_views.signup, name='sig... |
import cv2
import numpy as np
import random
import os
import sys
import math
from pixellib.mask_rcnn import MaskRCNN
from pixellib.config import Config
import colorsys
import time
from datetime import datetime
import imantics
from imantics import Polygons, Mask
class configuration(Config):
NAME = ... |
'''
Some utility functions
'''
import os.path
def cm2inch(value):
'''
convert from cm to inches
'''
return value / 2.54
def read_pdb_distribution(residue):
'''
read the pdb distributions
'''
if residue.lower() == 'ile':
path = os.path.join(
os.path.split(__file_... |
# 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 u... |
#!/usr/bin/env python3
# encoding: utf-8
"""This file contains compatibility code to stay compatible with as many python
versions as possible."""
import vim
def _vim_dec(string):
"""Decode 'string' using &encoding."""
# We don't have the luxury here of failing, everything
# falls apart if we don't retur... |
import os
import pickle
import torch
from torch_em.util import get_trainer, import_bioimageio_model
from .prepare_shallow2deep import _get_filters, _apply_filters
# optional imports only needed for using ilastik api for the predictio
try:
import lazyflow
from ilastik.experimental.api import from_project_file
... |
# -*- coding: utf-8 -*-
# File generated according to DTableData.ui
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_DTableData(object):
def setupUi(self, DTableData):
DTableData.setObjectName("DTableData")
DTableData.resize(746, 536)
... |
# -*- coding: utf-8 -*-
import floppyforms as forms
from ionyweb.forms import ModuloModelForm
from ionyweb.widgets import DatePicker
from models import PageApp_Book, Reference
from tinymce.widgets import TinyMCE
from ionyweb.widgets import DatePicker
class PageApp_BookForm(ModuloModelForm):
class Meta:
... |
#**********************************************************************
# Copyright 2020 Advanced Micro Devices, Inc
# 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.o... |
# /*******************************************************************************
# Copyright Intel Corporation.
# This software and the related documents are Intel copyrighted materials, and your use of them
# is governed by the express license under which they were provided to you (License).
# Unless the License pro... |
from lighthouse.config.defaults import * # noqa: F403, F401
# setting here will overwrite those in 'defaults.py'
# Flask config
TESTING = True
# APScheduler config
SCHEDULER_RUN = False
# Eve config
MONGO_HOST = "127.0.0.1"
MONGO_DBNAME = "lighthouseTestDB"
MONGO_QUERY_BLACKLIST = ["$where"] # not sure why this w... |
from django import forms
try:
from django.apps import apps
except ImportError:
from django.db.models.loading import cache as apps
from django.utils.translation import ugettext_lazy as _
try:
from django_comments.forms import CommentForm
except ImportError:
from django.contrib.comments.forms import Comm... |
# coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... |
"""
Run the following commands in ~ before running this file
wget http://image-net.org/small/train_64x64.tar
wget http://image-net.org/small/valid_64x64.tar
tar -xvf train_64x64.tar
tar -xvf valid_64x64.tar
wget http://image-net.org/small/train_32x32.tar
wget http://image-net.org/small/valid_32x32.tar
tar -xvf train_32... |
# ---------------------------------------------------------------------
# Vendor: Supertel
# OS: K2X
# ---------------------------------------------------------------------
# Copyright (C) 2007-2014 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# ... |
"""The tests for the TTS component."""
import ctypes
import os
import shutil
from unittest.mock import patch, PropertyMock
import requests
import homeassistant.components.http as http
import homeassistant.components.tts as tts
from homeassistant.components.tts.demo import DemoProvider
from homeassistant.components.me... |
from django.contrib import admin
from accounts.models import Customer, Vendor, Driver
# Register your models here.
class CustomerAdmin(admin.ModelAdmin):
list_display = ('company_name', 'email', 'name', 'customer_type', 'acl',)
def name(self, obj):
return obj.user.name
def company_name(self, obj... |
### tensorflow==2.3.0
### https://developer.nvidia.com/compute/machine-learning/tensorrt/secure/6.0/GA_6.0.1.5/local_repos/nv-tensorrt-repo-ubuntu1804-cuda10.1-trt6.0.1.5-ga-20190913_1-1_amd64.deb
# os="ubuntu1804"
# tag="cuda10.1-trt6.0.1.5-ga-20190913"
# sudo dpkg -i nv-tensorrt-repo-${os}-${tag}_1-1_amd64.deb
# su... |
people = 12
families = people / 4
candy = 0
for family in range(int(families)):
candy += 2
print(candy)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.