content stringlengths 5 1.05M |
|---|
from tensorflow import keras
import neptune.new as neptune
run = neptune.init(project="common/quickstarts", api_token="ANONYMOUS")
PARAMS = {
"epoch_nr": 10,
"batch_size": 256,
"lr": 0.005,
"momentum": 0.4,
"use_nesterov": True,
"unit_nr": 256,
"dropout": 0.05,
}
mnist = keras.datasets.mn... |
"""
This module contains a DTD parser that reports DTD parse events to a listener.
Used by xmlproc to parse DTDs, but can be used for other purposes as well.
$Id: dtdparser.py,v 2.11 2000/05/11 11:48:04 anonymous Exp $
"""
from types import StringType
import string
string_find = string.find # optimization
from xmlu... |
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 23 2020
@name: Utility Objects
@author: Jack Kirby Cook
"""
import numpy as np
import warnings
from abc import ABC, abstractmethod
__version__ = "1.0.0"
__author__ = "Jack Kirby Cook"
__all__ = ["UtilityIndex", "UtilityFunction"]
__copyright__ = "Copyright 2020, Jack ... |
#!/usr/bin/env python3
"""
Main script for the pymace framework
"""
__author__ = "Bruno Chianca Ferreira"
__license__ = "MIT"
__version__ = "0.7"
__maintainer__ = "Bruno Chianca Ferreira"
__email__ = "brunobcf@gmail.com"
import sys, traceback, json, os, argparse, logging, shutil, time, subprocess, socket, auxiliar... |
from django.db import models
from django.db.models.base import Model
class Category(models.Model):
name = models.CharField(max_length=255)
def __str__(self):
return self.name
class Quizzes(models.Model):
title = models.CharField(max_length=255, default='New Quiz', verbose_name='Quiz Title')
... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import random
import warnings
from AER_theorist.darts.fan_out import Fan_Out
from AER_theorist.darts.operations import *
from AER_theorist.darts.genotypes import PRIMITIVES
from AER_theorist.darts.... |
'''
Entrada de dados
'''
num1 = int(input("Digite um numero: "))
num2 = input("Digite outro numero: ")
print(num1 + int(num2))
|
# 体素化 可见reconstruciton
import open3d as o3d
"""
volume = o3d.pipelines.integration.ScalableTSDFVolume(
voxel_length=4.0 / 512.0,
sdf_trunc=0.04,
color_type=o3d.pipelines.integration.TSDFVolumeColorType.RGB8)
for i in range(len(camera_poses)):
print("Integrate {:d}-th image into the volume.".format(i)... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '0005_auto_20150112_2229'),
]
operations = [
migrations.AddField(
model_name='gamesession',
na... |
# PA com while aninhado
termo1 = int(input('Digite o primeiro termo da PA: '))
razao = int(input('Digite a razão da PA: '))
#termos = int(input('Quantos termos deseja calcular? '))
an = termo1
mais = 10
print()
print('Os {} primeiros termos da PA são: '.format(mais), end='')
i = 1
total = 0
while mais != 0:... |
# System imports
import os
import sys
import copy
# 3rd-party library imports
import pandas as pd
from matplotlib import pyplot as plt
from matplotlib.offsetbox import AnchoredText
# Make sure the path of the framework is included in the import path
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__fi... |
import os
import os.path as osp
import argparse
import numpy as np
import pandas as pd
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from scipy.ndimage.filters import gaussian_filter1d
def parse_args():
parser = argparse.ArgumentPars... |
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
# Copyright 2021 deepset GmbH. 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.o... |
locations = input().split("||")
locations_dict = {}
while not locations[0] == "Sail":
location, population, gold = locations[0], int(locations[1]), int(locations[2])
if location not in locations_dict.keys():
locations_dict[location] = {"Population": population, "Gold": gold}
else:
locati... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from selenium.common.exceptions import NoSuchElementException
from ..testcases import SeleniumLiveTestCase
class IndexingTestCase(SeleniumLiveTestCase):
test_templates = [
(r'^$', 'indexing.html'),
(r'^nav_1/$', 'nav_1.html'),
... |
# -*- coding: utf-8 -*-
from flask import (
Blueprint,
current_app,
flash,
redirect,
render_template,
request,
url_for,
abort
)
from flask_login import login_required, login_user, logout_user, current_user
from eternity_backend_server.utils import flash_errors, redirect_back
from eternit... |
# Generated by Django 2.1.11 on 2020-03-02 11:06
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("iaso", "0034_form_version_upload_to")]
operations = [
migrations.AddField(model_name="form", name="periods_after_allowe... |
from PySide2.QtWidgets import QFrame, QVBoxLayout, QLabel, QTableWidget, QTableWidgetItem, QHeaderView, \
QWidget, QPushButton, QGridLayout, QSpacerItem, QFileDialog
from PySide2.QtGui import QFont
from PySide2.QtCore import Qt
import usb_msg as um
import agc
import time
TRACE_DEPTH = 163... |
FILTERS_KEY = 'FILTERS'
SAMPLE_RATE_METRIC_KEY = '_sample_rate'
SAMPLING_PRIORITY_KEY = '_sampling_priority_v1'
ANALYTICS_SAMPLE_RATE_KEY = '_dd1.sr.eausr'
ORIGIN_KEY = '_dd.origin'
NUMERIC_TAGS = (ANALYTICS_SAMPLE_RATE_KEY, )
|
from rest_framework import serializers
from .models import *
class ReviewSerializer(serializers.ModelSerializer):
author = serializers.ReadOnlyField(source='author.username')
class Meta:
fields = ('id', 'text', 'author', 'score', 'pub_date')
model = Review
class CommentSerializer(serializer... |
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
def fun(x, y, arr):
if y < arr.shape[0] and x < arr.shape[1]:
return arr[y, x]
return 0
# feat = np.load('features.npy')
def plotVideo2D(feat):
feat10 = []
for f in feat:
for _ in range(5):
... |
""" Contain tests for some postgrespy.fields class"""
from unittest import TestCase
from datetime import datetime
from postgrespy.fields import TextField, ArrayField, DateTimeField
from postgrespy.models import Model
import psycopg2.extras
from psycopg2.extras import Json
from .models import Movie, Entry, Student, ... |
import sys
sys.path.append("../../")
import unittest
import re
from dockerEE.remote import RemoteInterfaceImpl
from service_test_utils import ServiceTestUtils
from docker_container_test_utils import DockerContainerTestUtils
## TestEnvironmentEmulationServer
#
# The test case for EnvironmentEmulationService
class Te... |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
from collections import Counter
import os
import pandas as pd
import matplotlib.pyplot as plt
# text = "This is just a test string. I repeat, this is a text string"
def count_words(text):
"""
Skip punctutation
Create a dicti... |
from arc23.data import retrieval as rt
import numpy as np
metadata_path = './preprocessed_data.csv'
COL_TYPE = 1
COL_IMG_WEB = 0
metadata, len_metadata, metadata_headers, class_to_index, index_to_class, num_classes = rt.load_metadata(
metadata_path,
cols=(COL_IMG_WEB, COL_TYPE),
class_cols=(C... |
import datetime
part_schema = {
"P_PARTKEY": int,
"P_NAME": '<U55',
"P_MFGR": '<U25',
"P_BRAND": '<U10',
"P_TYPE": '<U25',
"P_SIZE": int,
"P_CONTAINER": '<U10',
"P_RETAILPRICE": float,
"P_COMMENT": '<U23'
}
supplier_schema = {
"S_SUPPKEY": int,
"S_NAME": '<U25',
"S_ADDR... |
import pytest
from collections import OrderedDict
from datetime import datetime, timezone
from model_mommy import mommy
from pathlib import Path
from usaspending_api.common.elasticsearch.client import instantiate_elasticsearch_client
from usaspending_api.common.helpers.sql_helpers import execute_sql_to_ordered_diction... |
from operator_symbols import OPERATOR_SIGNS
from truth_table import TruthTable
class NormalForm:
def __init__(self, truth_table: TruthTable, results, nf_params):
self.TT = truth_table
self.TT_results = self.set_results(results)
self.result = self.NF(*nf_params)
def __str__(self):
... |
from tastypie.resources import ModelResource
from tastypie import fields
from tastypie.authorization import DjangoAuthorization, ReadOnlyAuthorization
from tastypie.authentication import BasicAuthentication
from schnappsaccount.models import Claim,Person
from django.contrib.auth.models import User
class AnonymousGetAu... |
from django.views.generic import ListView, DetailView, CreateView, \
DeleteView, UpdateView, \
ArchiveIndexView, DateDetailView, \
DayArchiveView, MonthArchiveView, \
TodayArchiveView, Wee... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# COPYRIGHT NOTICE STARTS HERE
# Copyright 2019 © Samsung Electronics Co., Ltd.
#
# 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
#
#... |
#!/usr/bin/env python
import http.client
import json
API='278236859e9f4dff94372b4af8037d31'
connection = http.client.HTTPConnection('api.football-data.org')
headers = { 'X-Auth-Token': API }
connection.request('GET', '/v2/competitions/PL/matches', None, headers )
Response = json.loads(connection.getresponse().read()... |
"""
yoyo
本模块用于处理把windows中的\r\n 替换成\n 或 \r
by vacon
"""
import os
SUFFIX_LIST = [".sh", ".py", ".go", ".cpp", ".upload", ".yml", ".json"] # 没有过滤xml和html
def get_all_file(root_node):
"""
通过递归的方式获取root_node下所有的文件名
:param root_node:
:return:
"""
ab_root = os.path.abspath(root_node)
all_path_... |
# tensorflow_neuroproof_classify.py -- Does neuroproof classification for test data.
import os
import plugin
plugin_class="tensorflow_neuroproof_classify"
class tensorflow_neuroproof_classify(plugin.AriadneOp):
name="tensorflow_neuroproof_classify"
def run(self, args):
os.system("$PYTHON $ROOT/memb... |
import requests
class RandomProxyMiddleware(object):
def process_request(self, request, spider):
request.headers.setdefault('User-Agent',
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36")
proxy... |
# -*- coding: utf-8 -*-
import time
import logging
import threading as th
import pymumble.pymumble_py3 as mmbl
import pymumble.pymumble_py3.callbacks as mmbl_callbacks
from mumbleroni.settings.parser import SettingsParser
from mumbleroni.core.command.manager import CommandManager
from mumbleroni.core.module.loader im... |
from __future__ import print_function
try:
import vkaudiotoken
except ImportError:
import path_hack
from vkaudiotoken import supported_clients
import sys
import requests
import json
token = sys.argv[1]
user_agent = supported_clients.KATE.user_agent
sess = requests.session()
sess.headers.update({'User-Agent'... |
import numpy as np
from igibson.render.mesh_renderer.instances import InstanceGroup
import robosuite as suite
from robosuite.robots.robot import Robot
try:
import igibson
except ImportError:
raise Exception(
"Use `pip install igibson` to install iGibson renderer. "
"Follow instructions here: h... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework.test import APIClient
from rest_framework import status
# URL ##
CREATE_USER_URL = reverse('user:create')
Token_URL = reverse('user:token')
ME_URL = reverse('user:me')
def create_user(... |
'''
A primitive integration testing for the data set module
'''
from auto3dgm._nazar.dataset.datasetfactory import *
directorystring='/home/safari/Desktop/tutkimus/Slicer/HackathonJAN/testdata/20_Test_Teeth_PLY/'
A=DatasetFactory.ds_from_dir(directorystring)
filelist=[]
filelist.append('/home/safari/Desktop/tutkimus/S... |
from __future__ import absolute_import
# flake8: noqa
# import apis into api package
from octopus_deploy_swagger_client.octopus_deploy_client.accounts_api import AccountsApi
from octopus_deploy_swagger_client.octopus_deploy_client.action_templates_api import ActionTemplatesApi
from octopus_deploy_swagger_client.octop... |
_base_ = [
'../_base_/datasets/semkitti-20class.py',
'../_base_/models/pointnet2_msg.py',
'../_base_/schedules/seg_cosine_200e.py', '../_base_/default_runtime.py'
]
# dataset settings
# in this setting, we only use xyz as network input
# so we need to re-write all the data pipeline
dataset_type = 'Semantic... |
from .handler import VlsLinesTaskHandler
|
"""
The Custom Extension Block implementation of the GIF steganography suite
"""
from maybe_open import maybe_open
import struct
all_data = bytearray()
def copy_blocks(in_f, out_f, is_payload_and_extracting=False):
"""
Copy through blocks of data
"""
while True:
# Read the block size
... |
#!/usr/bin/env python
import argparse
from commands import list_local, list_remote, install, use, uninstall
from sys import exit
class Parser(argparse.ArgumentParser):
def error(self, message):
self.print_help()
exit(1)
parser = Parser(description='Manage Terraform and Terragrunt versions')
parser... |
import fsspec
import pandas as pd
def build_catalog(bucket='ncar-cesm-lens'):
fs = fsspec.filesystem(protocol='s3', anon=True)
dirs = fs.ls(bucket)
frequencies = []
components = ['ice_nh', 'ice_sh', 'lnd', 'ocn', 'atm']
for d in dirs:
if d.split('/')[-1] in components:
f = fs.l... |
"""
Purpose of the script: contains the definitions for each of the fields
(columns) derived in the process. By abstracting these definitions out of the
code and making them reuseable, we achieve some great benefits. First, it
becomes much easier to maintain. When the specifications change next year, we
only need t... |
# --------------------------------------------------------
# DaSiamRPN
# Licensed under The MIT License
# Written by Qiang Wang (wangqiang2015 at ia.ac.cn)
# --------------------------------------------------------
import cv2
import torch
import numpy as np
def to_numpy(tensor):
if torch.is_tensor(tensor):
... |
import os
from typing import Dict, List, Optional, Tuple, Union
import cv2
import matplotlib.patches as patches
import matplotlib.pyplot as plt
import numpy as np
from .retinanet.utilities import ifnone
# Turn interactive plotting off
plt.ioff()
def load_image(image_path: str):
image = cv2.cvtColor(cv2.imread(... |
from abc import ABC, abstractmethod
class MapSite(ABC):
@abstractmethod
def enter(self):
pass
|
import requests
from bs4 import BeautifulSoup
import json
from flask import Flask, request
app = Flask(__name__)
@app.route('/verify/wce',methods = ['POST'])
def login():
try:
params = json.loads(str(request.data.decode("utf-8")))
s = requests.Session()
s.get('http://112.133.242... |
# TODO: Just for development purposes. These should be removed before release
from .binding_experiments.controller import MyPersonalViewController
from .binding_experiments.dogModel import Dog, DogList
__all__ = ['MyPersonalViewController', 'Dog', 'DogList']
|
from __future__ import print_function
import traceback
import logging
import tempfile
import shutil
from random import random
from time import time
import yarom
from yarom import (connect, disconnect, config)
from yarom.configure import Configuration
class AcceptanceTest(object):
""" Acceptance testing """
... |
import json
def enrich(movie):
""" Enrich for search purposes """
if 'title' in movie:
movie['title_sent'] = 'SENTINEL_BEGIN ' + movie['title']
def reindex(es, analysisSettings={}, mappingSettings={}, movieDict={}, index='tmdb'):
import elasticsearch.helpers
settings = {
"settings": {
... |
#
# ==== Author:
#
# Relja Arandjelovic (relja@robots.ox.ac.uk)
# Visual Geometry Group,
# Department of Engineering Science
# University of Oxford
#
# ==== Copyright:
#
# The library belongs to Relja Arandjelovic and the University of Oxford.
# No usage or redistribution is allowed without explicit permission.
#
imp... |
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 29 10:14:07 2018
@author: Dell
"""
import uuid
from sqlalchemy.sql import and_
from .orm import Config,Point,Frame,Area,PointLoad,PointRestraint
import logger
def add_point(self,x,y,z):
"""
Add point object to model, if the name already exists, an exception wil... |
WIDTH = 32
HEIGHT = 32
FIRST = 0x20
LAST = 0x7f
_font =\
b'\x00\x4a\x5a\x0e\x4d\x57\x52\x46\x51\x48\x52\x54\x53\x48\x52'\
b'\x46\x20\x52\x52\x48\x52\x4e\x20\x52\x52\x59\x51\x5a\x52\x5b'\
b'\x53\x5a\x52\x59\x0b\x4a\x5a\x4e\x46\x4d\x4d\x20\x52\x4f\x46'\
b'\x4d\x4d\x20\x52\x56\x46\x55\x4d\x20\x52\x57\x46\x55\x4d\x0b'\
b'... |
# print(st.index(i))
# print(1)
|
import json
from django.http import HttpResponse
from django.views import View
from service.format_response import api_response
from service.ticket.ticket_base_service import TicketBaseService
class TicketListView(View):
def get(self, request, *args, **kwargs):
"""
获取工单列表
:param request:
... |
"""
Spatial lag operations.
"""
__author__ = "Sergio J. Rey <srey@asu.edu>, David C. Folch <david.folch@asu.edu>, Levi John Wolf <ljw2@asu.edu"
__all__ = ['lag_spatial', 'lag_categorical']
import numpy as np
def lag_spatial(w, y):
"""
Spatial lag operator.
If w is row standardized, returns the average of... |
from sys import stdin
n, *a = map(int, stdin.read().split())
l_count = {}
for l in a:
l_count.update({l: l_count.get(l, 0) + 1})
long_side, short_side = 0, 0
for l, c in sorted(l_count.items(), reverse=1):
if c != 1:
if not long_side:
if c >= 4:
print(l**2)
... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
"""Example usage of the Python library."""
from ictk import igc
# A single file reading
igc_file = "tests/igc_test_file.txt"
parsed = igc.get_corpus_from_file(igc_file)
for line in parsed:
print(line)
# ('Fyrirlestraröð', 'Framfara', 'stendur', 'fyrir', 'fyrirlestri', 'um', 'ástæður', 'ofþjálfunar', ',', 'eink... |
import cv2
import pytesseract
image = cv2.imread('./img.jpg')
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
canny_edge = cv2.Canny(gray_image, 170, 200)
contours, new = cv2.findContours(canny_edge.copy(), cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)
contours=sorted(contours, key = cv2.contourArea, reverse = ... |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
def swig_im... |
import os
import socket
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
from binarystory.private import SECRET_KEY
DEBUG = True
ALLOWED_HOSTS = []
ATOMIC_REQUESTS = True
ADMINS = (
('David Colgan', 'dvcolgan@gmail.com'),
)
HOSTNAME = socket.gethostname()
if HOSTNAME == 'luffy' in BASE_D... |
from flask_restplus import fields
from .errors import ValidationError
def handle_extra_payload(payload, api_model):
"""
Handles extra keys in payload
"""
# not checking list type bcoz no such API
if type(payload) != dict:
return payload
data = payload.copy()
for key in payload:
... |
from . import friendsAdminBP
from flask import render_template, abort
@friendsAdminBP.route('/')
def index():
return render_template("admin/friends.html")
|
from flask import Blueprint
news_blue = Blueprint('news', __name__, url_prefix='/news')
from .views import * |
"""
File: devices/views/config.py
Purpose:
This code is a class based view used to render
the login page
Functions for logging in users
"""
from accounts.forms import *
from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login
from django.views import View
class... |
from entities.content import Content, all_validator
class ReadingTip:
""" A class for handling singular reading tips.
"""
def __init__(self, tip_type, contents):
""" Initializes an empty reading tip. """
contents["title"] = Content()
contents["tip_id"] = Content()
contents... |
import os, gzip
import numpy as np
import torch
from torch.utils.data import Dataset
import pandas as pd
import fnmatch
def transform_viewpoint(v):
"""
Transforms the viewpoint vector into a consistent
representation
"""
w, z = torch.split(v, 3, dim=-1)
y, p = torch.split(z, 1, dim=-1)
#... |
# -*- coding: utf-8 -*-
__author__ = 'lposti'
from fJmodel import FJmodel
from warnings import warn
from sauron import sauron
from numpy import genfromtxt, zeros, linspace, exp, log10, column_stack, round, empty, nan, rot90, \
meshgrid, radians, ones_like, where, average, dstack, array, full, around, \
asarray... |
import pytest
from ..kernel_specs import (
RBFKernelSpec as RBF,
RQKernelSpec as RQ,
LinearKernelSpec as LIN,
PeriodicKernelSpec as PER,
AdditiveKernelSpec as ADD,
ProductKernelSpec as PROD,
TopLevelKernelSpec as TOP,
)
from ..expand_spec import (
expand_product_spec,
expand_additi... |
from collections.abc import Generator
from datetime import date
from bballer.models.gamelog import GameLog
from bballer.models.player import DraftPick
from bballer.models.stats import StatLine
from bballer.scrapers.PlayerPageScraper import PlayerPageScraper
from tests.scrapers.utils import get_resource
def lebron_ja... |
#!/usr/bin/env python
import chess
import chess.svg
import numpy as np
import math
values = {
"p": 1,
"r": 5,
"n": 3,
"b": 3,
"q": 9,
"k": 0,
}
def get_pieces (pieceMap, colour):
pieces = []
for piece in pieceMap.values():
if colour == 1 and piece.symbol().isupper():
... |
from influxdb_client import OrganizationsService, UsersService, Organization
class OrganizationsApi(object):
"""
The client of the InfluxDB 2.0 that implements Organizations HTTP API endpoint.
"""
def __init__(self, influxdb_client):
self._influxdb_client = influxdb_client
self._organ... |
from conans import ConanFile, tools
from conans.errors import NotFoundException
import os
class ConanFileBase(ConanFile):
_base_name = "gsoap"
version_major = "2.8"
version = version_major + ".101"
description = "The gSOAP toolkit is a C and C++ software development toolkit for SOAP and " \
... |
# %%
__author__ = "Islem Maboud"
__aka__ = "CoderOne"
__github__ = "https://github.com/ipenywis"
__link__ = "https://www.youtube.com/c/coderone"
__license__ = "MIT"
__version__ = "1.0.0"
__maintainer__ = "Islem Maboud"
__email__ = "islempenywis@gmail.com"
import numpy as np
import pandas as pd
#This will be used to... |
from .filelink import Filelink
from .client import Client
from .transformation import Transformation
from .security import Security
from .audiovisual import AudioVisual
|
import sys
gVersionStr = 'Version 0.1 2018/06/22'
#if True :
try :
import clr
clr.AddReference("IronPython.Wpf")
import wpf
clr.AddReference("StdLib")
import os
import subprocess
import shlex
import re
import string
import time
import math
import shut... |
from ...exceptions import BadRequestException
from ...utils import get_temp_dir
from biosimulators_utils.combine.data_model import CombineArchiveContent
from biosimulators_utils.combine.io import CombineArchiveReader, CombineArchiveWriter
import connexion
import datetime
import dateutil.tz
import flask
import os
import... |
from django.apps import AppConfig
class TraderConfig(AppConfig):
name = 'trader'
|
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 14 23:22:53 2017
@author: yxl
"""
import weakref
class WindowsManager:
wins = []
@classmethod
def add(cls, win):
if not win in cls.wins:cls.wins.append(win)
@classmethod
def get(cls, title=None):
if len(cls.wins)==0:return None
... |
import requests
import json
import time
import datetime
token = 'Bearer <TOKEN>'
url = 'https://api.ciscospark.com/v1/rooms'
r = requests.get(url, headers = {'Authorization': token})
if(r.status_code != 200):
print('Errore')
print('ERROR CODE: {}\nRESPONSE: {}'.format(r.status_code, r.text))
else:
jsonD... |
# Copyright (c) 2012 Cloudera, 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 by applicable law o... |
#!/usr/bin/python3
# File name : iotMotor.py
# Description : encapsulates a DC motor connected via Raspberry Pi's GPIO
from time import sleep
from .log import Log
from .iotNode import IotNode
# motor states:
# stop - the motor is stop
# starting - the motor is starting and ramping up to requested speed
# moving... |
from typing import List
from pydantic import BaseModel, Field, PrivateAttr
from pydantic.fields import ModelField
class MyDataSet:
asdf = 'a'
def __init__(self, parent):
self.parent = parent
class MyModel(BaseModel):
_my_data: MyDataSet = PrivateAttr()
def __init__(self, **data):
... |
import abc
class PasteSource:
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def new_urls(self, backend):
'''
@param backend an instance of an class that is an implementation
of the StorageBackend abc.
Must be implemented as generator yielding new, unvisited URLs
... |
from typing import Tuple
from sklearn import svm
from sklearn import linear_model
from lpot.pipelines.sklearn_wrappers import sklearn_regressor_wrapper
class LinearFinalElement(sklearn_regressor_wrapper.SklearnRegressorWrapper):
def __init__(self):
super().__init__(
sklearn_class=linear_mode... |
'''Έστω μία σκακιέρα 8*8 στην οποία τοποθετούμε πάνω της, σε τυχαίες θέσεις, έναν λευκό πύργο και ένα μαύρο αξιωματικό.
Σε κάθε γύρο, ο κάθε παίκτης παίρνει ένα βαθμό αν το κομμάτι του τρώει κομμάτι του αντιπάλου.
Μετά από 100 παιχνίδια, εμφανίστε τους βαθμούς των δύο παικτών.
Επαναλάβετε το πείραμα 100 φορές για σκακι... |
# __init__.py
# -*- coding: utf-8 -*-
# @Author: Sidharth Mishra
# @Date: 2017-04-05 20:29:06
# @Last Modified by: Sidharth Mishra
# @Last Modified time: 2017-04-05 23:13:28
'''
Houses the core logic used to build the reverse-indices for the words extracted from the PDFs.
'''
# CS 267 specific imports
from ... |
# Copyright 2018 Google 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 by applicable law or a... |
"""Package to fetch Chinese Cities"""
import os
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
class City():
"""Class to represent a Chinese City """
def __init__(self, name_en=None, name_cn=None, province=None):
self.name_en = name_en
self.name_cn = nam... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
import yaml
import pkg_resources
from shutil import copyfile
__backend_tflite_cfg_filename__ = 'backend_tflite_config.yaml'
__backend_openvino_cfg_filename__ = 'backend_openvino_config.yaml'
__ruletest_cfg_filename__ = 'ruletest_config.... |
from .http import HTTPPropagator
__all__ = [
"HTTPPropagator",
]
|
import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
def test1():
df = h2o.upload_file(pyunit_utils.locate("smalldata/jira/pubdev_2020.csv"))
splits = df.split_frame(ratios=[0.75])
assert df.nrow == splits[0].nrow + splits[1].nrow
part0 = splits[0]
split_was_sequential ... |
import unittest
from deepcomparer import deep_compare
class TestCompareList(unittest.TestCase):
def test_empty_list(self):
"""
Test empty list
"""
data1: list = []
data2: list = []
result = deep_compare(data1, data2)
self.assertTrue(result)
def test_di... |
from datetime import date
CurrentYear = date.today().year
SoftwareName = "SetCarModels"
Version = "1.0.0.0"
CopyrightName = "Heitor Bisneto."
print(f'Nome: {SoftwareName}')
print(f'Versão: {Version}')
print(f'Criado por: {CopyrightName}')
if CurrentYear == 2021:
print(f'Copyright © {CurrentYear} | {CopyrightName}... |
# -*- coding: utf-8 -*-
# @Author: Alexander Sharov
__all__ = ['importer']
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.