content stringlengths 5 1.05M |
|---|
from unittest import TestCase
import numpy as np
import numpy.testing as npt
from distancematrix.util import diag_length
from distancematrix.util import diag_indices
from distancematrix.util import diag_indices_of
from distancematrix.util import cut_indices_of
from distancematrix.util import shortest_path_distances
fr... |
# -*- coding: utf-8 -*-
from typing import Optional, List, Dict, Any
from overrides import overrides
from docker.models.volumes import Volume
from recc.container.interfaces.container_volume import ContainerVolume
from recc.container.struct.volume_info import VolumeInfo
from recc.container.docker.mixin.docker_base impo... |
#Getting Input
strInput = input('Enter a string: ')
if strInput == "":
#Check if string is empty
print('The string is empty.')
else:
#Uppercase function
print(strInput.upper()) |
import os
import GPUtil
# If you need one GPU, I will pick it here for you
if 'CUDA_VISIBLE_DEVICES' not in os.environ:
gpu = [str(g) for g in GPUtil.getAvailable(maxMemory=0.2)]
assert len(gpu) > 0, 'No available GPUs'
print('Using GPU', ','.join(gpu))
os.environ['CUDA_VISIBLE_DEVICES'] = ','.join(gpu... |
import unittest
from game_of_life.model import World
from game_of_life.model import Pattern
from game_of_life.model import OutOfBoundError
class PatternTestCase(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_init(self):
# The "Glider" pattern
... |
from setuptools import setup,find_packages
import sys
from os import path
with open(path.join(path.dirname(__file__), 'VERSION')) as v:
VERSION = v.readline().strip()
setup(name = "fyplot",
packages=find_packages('.'),
version = VERSION,
description="minimal interface for dynamic tim... |
# Generated by Django 2.1.3 on 2018-11-20 06:16
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... |
import matplotlib
matplotlib.use("TKagg")
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns; sns.set()
def show():
plt.show()
plt.clf()
#unsupervised estimator, principle component analysis (PCA)
#Intro to PAC
#lets generate some data
rng = np.random.RandomState(1)
X = np.dot(rng.rand... |
# #####################################################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... |
import os
import re
import csv
import pandas as pd
def stream_local_csv(file_path, options):
reader = pd.read_csv(file_path, chunksize=1000, **options)
if reader:
return reader
def stream_csv_from_s3(s3_file_url, options):
AWS_ACCESS_KEY_ID = os.getenv("AWS_ACCESS_KEY_ID")
AWS_SECRET_ACCESS_... |
#!/usr/bin/env python3
""" Makes a PR curve based on output from generate_detection_metrics.py """
import argparse
import numpy as np
import matplotlib.pyplot as plt
if __name__=="__main__":
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('data_file')
parser.add_argument('--outp... |
import time
import numpy as np
from concurrent.futures import ThreadPoolExecutor
from ConfigSpace import Configuration
def execute_func(params):
start_time = time.time()
evaluator, config, subsample_ratio = params
try:
if isinstance(config, Configuration):
score = evaluator(config, nam... |
import os
import re
import requests
from invoke import task
def _get_aws_token(c):
token = os.getenv("AWS_TOKEN")
if not token:
token = c.run("aws ecr get-authorization-token --output text "
"--query 'authorizationData[].authorizationToken'", hide=True).stdout.strip()
return ... |
for i in range(4):
print(i) |
from django.core.files.base import ContentFile
from django.utils.six import b
from django.test import TestCase
from wagtail.wagtaildocs.models import Document, document_served
from downloadcounter.models import DownloadCount
class TestCounter(TestCase):
def test_count(self):
fake_file = ContentFile(b("E... |
bot_token = ""
users = [
]
website_links =[
"https://www.google.com",
]
|
class Solution:
def sortArrayByParityII(self, a):
"""
:type A: List[int]
:rtype: List[int]
"""
evens = (x for x in a if x % 2 == 0)
odds = (x for x in a if x % 2 == 1)
return list(itertools.chain.from_iterable(zip(evens, odds)))
|
import os
import sys
print("HELLO")
sys.path.insert(0, os.path.join(os.getcwd(), os.pardir))
print(sys.path[0])
sys.path.insert(0, os.getcwd())
print(sys.path[0])
|
from arch.unitroot import ADF, PhillipsPerron, KPSS
import pandas as pd
class StationarityTests:
"""
Stationarity Testing
Also often called Unit Root tests
Three commonly used tests to check stationarity of the data
"""
def __init__(self, significance=.05):
self.SignificanceLevel = si... |
# Generated by Django 2.0.2 on 2018-04-02 20:54
from django.db import migrations, models
import re
CALENDAR_PERIODS = [
{
"calendar_period_id": 9999,
"calendar_period_name": "TemporaryValue",
},
]
def extract_year(semester_name):
answer = re.findall(r'^\d{4} ', semester_name)
if len(... |
from core.viewsets import ModelViewSet
from core.models import Service
from core.services.serializers import ServiceSerializer
from core.permissions import FRONT_DESK, CASE_MANAGER, ADMIN
class ServiceViewSet(ModelViewSet):
queryset = Service.objects.all()
serializer_class = ServiceSerializer
permission_gr... |
import streamlit as st
#%% fuction for the second page
def lenet_page():
#%%% En tête :
st.markdown("<h1 style='text-align: center'>Architecture LeNet</h1>", unsafe_allow_html=True)
st.write("")
st.write("L’architecture LeNet est introduit par LeCun et al. en 1998" )
st.write("")
st.image("arch... |
from . import git_autopep8
|
from vosk import Model, KaldiRecognizer
import os
import pyaudio
import pyttsx3
import json
import core
# Começo da sintese de fala
engine = pyttsx3.init()
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[-2].id) # garante que sairá em portugues
# Função para receber a mensagem falada
def ... |
"""
Tests for the basic scenarios for the scanner.
"""
import os
import sys
import tempfile
from test.pytest_execute import InProcessExecution
from project_summarizer.__main__ import main
from project_summarizer.main import ProjectSummarizer
JUNIT_COMMAND_LINE_FLAG = "--junit"
COBERTURA_COMMAND_LINE_FLAG = "--cobertu... |
from k5test import *
entries = ('URI _kerberos.TEST krb5srv::kkdcp:https://kdc1 1 1\n',
'URI _kerberos.TEST krb5srv::kkdcp:https://kdc3:300/path 3 1\n',
'URI _kerberos.TEST krb5srv:m:kkdcp:https://kdc2/path 2 1\n',
'URI _kerberos.TEST KRB5SRV:xMz:UDP:KDC4 4 1\n',
'URI _kerbe... |
from usersimulator.UserModel import GoalGenerator, UMGoal
import yaml
import random
from ontology import Ontology
import copy
class SGDGoalGenerator(GoalGenerator):
def __init__(self, dstring):
super(SGDGoalGenerator, self).__init__(dstring)
self.domain = dstring
self.goals = {}
... |
import sys
from pyspark.sql import SparkSession
from knn.utils import deleteHeader
if __name__ == '__main__':
if len(sys.argv) == 5 :
fileLocation = sys.argv[1]
numPartitions = int(sys.argv[2])
d = int(sys.argv[3])
k = int(sys.argv[4])
spark=SparkSession.builder.appName(sys.argv[0]).getOrCreate()... |
from werkzeug.security import check_password_hash, generate_password_hash
from rent_a_car import users_collection,cars_collection, app,session_handler
from flask import jsonify, request,url_for,redirect,session
from bson.json_util import ObjectId,loads
# Ruta de Registro
@app.route("/register", methods=["GET","POST"])... |
#from random import randint
import random
import time
print('='*20, 'DESAFIO 028', '='*20)
print('Vou pensar em um número entre 0 e 5. Tente adivinhar....')
computador = random.randint(0, 5)
resposta=int(input('Em que número pensei? '))
print('PROCESSANDO.....')
time.sleep(3)
if resposta == computado... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# @Time : 2021/12/2 15:49
import matplotlib.pyplot as plt
from stochastic.processes.continuous import FractionalBrownianMotion
def fbm(t_len, hurst):
f = FractionalBrownianMotion(hurst=hurst, t=t_len)
n = int(t_len) * 100
t = f.times(n)
x = f.sample(n)
... |
from django.db import models
class Journalist(models.Model):
first_name = models.CharField(max_length=31)
last_name = models.CharField(max_length=31)
bio = models.TextField(blank=True)
def __unicode__(self):
return "{} {}".format(self.first_name, self.last_name)
def __str__(self):
... |
from django.contrib import admin
from import_export import fields, resources
from import_export.admin import ExportMixin
from remo.featuredrep.models import FeaturedRep
class FeaturedRepResource(resources.ModelResource):
user = fields.Field()
class Meta:
model = FeaturedRep
def dehydrate_users... |
from pyspark import SparkContext
import re
import sys
def main():
# Insure a search term was supplied at the command line
if len(sys.argv) != 2:
sys.stderr.write('Usage: {} <search_term>'.format(sys.argv[0]))
sys.exit()
# Create the SparkContext
sc = SparkContext(appName='SparkWordCount')
... |
def solution(arr1, arr2):
return [[c + d for c, d in zip(a, b)] for a, b in zip(arr1, arr2)]
|
from .Provider import Provider
from .MappingProvider import MappingProvider, PropMappings
from .DefaultFileProvider import DefaultFileProvider
|
# -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='scrapy-statsd-middleware',
version='0.0.8',
description='Statsd integration middleware for scrapy',
long_description=readme,
au... |
from labrad.gpib import GPIBDeviceWrapper
from twisted.internet.defer import inlineCallbacks, returnValue
class Agilent33210AWrapper(GPIBDeviceWrapper):
# GENERAL
@inlineCallbacks
def reset(self):
yield self.write('*RST')
@inlineCallbacks
def toggle(self, status):
# setter
... |
# Copyright 2013-2014 Mitchell Stanton-Cook Licensed under the
# Educational Community 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.osedu.org/licenses/ECL-2.0
#
# Unless required by applicable law or agr... |
"""
This script provides tools for creating and updating resources.
Here, a resource is anything that has below properties:
1) it is used by the Flask application;
2) it should not be added to Git repository.
For example, a resource can be SQLite database or a Markdown
file with content that is very close to that of ... |
from typing import List, Optional, Tuple
import matplotlib as mpl
mpl.use("Agg")
from theseus.opt import Opts
import os
import cv2
import torch
import numpy as np
from theseus.opt import Config
from theseus.cps.models import MODEL_REGISTRY
from theseus.cps.augmentations import TRANSFORM_REGISTRY
from theseus.cps.dat... |
import device_comms
from device_comms import *
position = 0
def set_VCO(link, varactor_voltage, power_state):
max_supply = 5.0
send_size = 0
send_size = add_float(link, send_size, varactor_voltage)
send_size = add_float(link, send_size, power_state)
link.send(send_size, packet_id=0)
wait_fo... |
from django.core.management.base import BaseCommand, AppCommand
from optparse import make_option
from django.contrib.gis.utils import LayerMapping
from django.contrib.gis.gdal import DataSource
from lingcod.studyregion.models import StudyRegion
class Command(BaseCommand):
option_list = AppCommand.option_list + (
... |
import pytest
from hls4ml_ipbb import Port, IOType, VHDLStdLogic, VHDLStdLogicVector
from hls4ml_ipbb import PortPurpose, ValueType
@pytest.mark.parametrize('name', ['test1', 'test2', 'test3'])
def test_port_name_returns_correct_name(name):
port = Port(name=name, io_type=IOType.INPUT, value_type=VHDLStdLogic())
... |
"""
AASIST
Copyright (c) 2021-present NAVER Corp.
MIT license
"""
import os
if __name__ == "__main__":
cmd = "curl -o ./LA.zip -# https://datashare.ed.ac.uk/bitstream/handle/10283/3336/LA.zip\?sequence\=3\&isAllowed\=y"
os.system(cmd)
cmd = "unzip LA.zip"
os.system(cmd) |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2021 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The module file for ios_snmp_server
"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
---
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import rospy
from dvs_slam_msgs.msg import VoxelGrid
from rospy.numpy_msg import numpy_msg
import matplotlib.cm
import colormaps as cmaps
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
import cv2
cv_bridge = CvBridge()... |
"""
Content Provider: Flickr
ETL Process: Use the API to identify all CC licensed images.
Output: TSV file containing the images and the respective meta-data.
Notes: https://www.flickr.com/help/terms/api
Rate limit: 3600 queries per hour.
"""
... |
import inspect
import os
import pickle
import re
import struct
import subprocess as sp
import textwrap
_re_var_name = re.compile(r'^[a-zA-Z_]\w*$', re.UNICODE)
_re_module_name = re.compile(r'^[a-zA-Z_.][\w.]*$', re.UNICODE)
# TODO: Use fd's besides stdin and stdout, so that you don't mess with code that reads or wr... |
# # from django.contrib.auth.models import User, Group
# from rest_framework import viewsets
# # from rest_framework import permissions
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from covidmap.serializers import CovidGeneralDataSerializer
fr... |
# coding: utf-8
import pprint
import re
import six
class IncidentSubTypeV2Do:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the valu... |
n1 = int(input('Insira um número: '))
print('O dobro de {} é {}, \nseu triplo é {}, \ne sua raiz quadrada é {:.2f}'.format(n1, n1*2, n1*3, (pow(n1, 1/2))))
|
from abc import ABC, abstractmethod
import contextlib
from enum import Enum, unique
from typing import Dict, Optional
from mlpiot.base.utils.dataset import auto_detect_dataset, DatasetParams
from mlpiot.proto import TrainerMetadata, VisionPipelineDataset
class Trainer(ABC):
@abstractmethod
def initialize(se... |
from random import randint, seed
import hashkernel.base_x as bx
def random_bytes(sz):
return bytes(randint(0, 255) for _ in range(sz))
b58 = bx.base_x(58)
def test_nulls():
assert b58.decode("12") == b"\x00\x01"
assert b58.decode(b"12") == b"\x00\x01"
assert b58.encode(b"\0\1") == "12"
assert... |
import time
def execute_athena_query(output_location, query, athena_client):
"""Executes the given individual query against athena and return the result.
Keyword arguments:
output_location -- the s3 location to output the results of the execution to
query -- the query to execute
"""
print(
... |
from .backend import Backend
class TPUBackend(Backend):
pass
|
import json
import os
import cv2 as cv
import numpy as np
from keras.applications.inception_resnet_v2 import preprocess_input
from keras.models import load_model
if __name__ == '__main__':
img_size = 139
model = load_model('models/model.10-0.0156.hdf5')
names = [f for f in os.listdir('data') if f.endswit... |
# http://www.codewars.com/kata/5612e743cab69fec6d000077/
a = "dev"
b = "Lab"
name = a + b
|
# Generated by Django 2.1.4 on 2019-09-03 07:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('game', '0005_auto_20190903_1508'),
]
operations = [
migrations.AddField(
model_name='game',
name='round',
... |
from .. import *
from ..bitswap import get_bit, set_bit
#
# Fast, efficient 8-bit math functions specifically
# designed for high-performance LED programming.
#
# Because of the AVR(Arduino) and ARM assembly language
# implementations provided, using these functions often
# results in smaller and faster code t... |
from asyncorm.serializers.serializer import ModelSerializer, ModelSerializerMeta, SerializerMethod
__all__ = ("ModelSerializerMeta", "SerializerMethod", "ModelSerializer")
|
# -*- coding:utf-8 -*-
# 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 "Lic... |
import os
import shutil
import tempfile
from .query import Query
from .metadata import Metadata
from .system import system
from . import exceptions
from . import helpers
from . import errors
from . import config
class File(Metadata):
"""File representation
API | Usage
-------- | --------
Public ... |
import sys
from typing import Union, Any, Callable
def esc(*codes: Union[int, str]) -> str:
return t_('\x1b[{}m').format(t_(';').join(t_(str(c)) for c in codes))
def t_(b: Union[bytes, Any]) -> str:
return b.decode() if isinstance(b, bytes) else b
def make_color(start, end: str) -> Callable[[str], str]:
... |
# Generated by Django 3.1.4 on 2021-01-23 07:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('process', '0014_auto_20210123_1610'),
]
operations = [
migrations.RemoveField(
model_name='process',
name='process',... |
# -*- coding: utf-8 -*-
"""
forms.py
:copyright: (c) 2014 by Openlabs Technologies & Consulting (P) Limited
:license: BSD, see LICENSE for more details.
"""
from flask_wtf import Form
from wtforms import TextField, TextAreaField, SelectField, DecimalField, \
validators
from wtforms.validators import Va... |
# Distributed under the Apache License, Version 2.0.
# See accompanying NOTICE file for details.
import os
import cv2
import json
import ntpath
import numpy as np
from scipy.spatial import cKDTree
from trailblazer.traffic.vital import Detection
from trailblazer.traffic.vital import Track
from trailblazer.traffic.vita... |
from collections.abc import Mapping
def nested_set(d, keys, value):
"""Set d[keys[0]]...[keys[-1]] to `value`.
Example:
>>> d = {}
>>> nested_set(d, ['person', 'address', 'city'], 'New York')
>>> d
{'person': {'address': {'city': 'New York'}}}
From:
https://stackoverflow.com/question... |
import sys
def main():
input = sys.argv[1]
output = sys.argv[2]
with open(output, 'w') as out:
out.write('*Nodes\nid*int\tlabel*string\n')
nodes = {}
node_id = 0
has_weight = False
for line in open(input):
row = line.split()
if len(row) == 3:
has_weight = True
sourc... |
## @file
# Automate the process of building the various reset vector types
#
# Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
import glob
import os
import subprocess
import sys
def RunCommand(commandLine):
return subproces... |
"""Middleware that captures all 'eth_sign' requests to the JSON-RPC-Server.
An adaptation of the signing middleware from `web3.py
<https://github.com/ethereum/web3.py/blob/master/web3/middleware/signing.py>`_.
This middleware intercepts all 'eth_sign' requests to
an ethereum JSON RPC-Server and signs messages with a l... |
default_app_config = 'councilmatic_core.apps.CouncilmaticConfig'
|
def characterReplacement(s, k):
max_length, i, seen = 0, 0, set()
while i < (l := len(s)):
curr, j, rem, length = s[i], i, k, 0
while rem and j < l:
if s[j] != curr or j in seen: # if we've already seen it, then it isn't the same letter
rem -= 1
else:
... |
from django.urls import path, include
from .views import current_user, UserList, CliqueRequests, UserEmailDetails, CliqueIdMembers, InvitationDetails, UserToDos, index, UserDetails, CliqueDetails, CliqueEvents, UserEvents, UserInvitations, CliqueMembers, UserSchedules, ScheduleTimeFrames, CliqueAnnouncements, CliqueCli... |
# coding: utf-8
import time
import os
import tornado.web
from pony import orm
from ._base import BaseHandler
from collipa.helpers import get_year, get_month, gen_random_str, mkdir_p, get_relative_path
from collipa import config
class UploadHandler(BaseHandler):
@orm.db_session
@tornado.web.authenticated
... |
import numpy as np
from copulae.copula import Summary, TailDep
from copulae.special.debye import debye_1, debye_2
from copulae.special.optimize import find_root
from copulae.special.special_func import log1mexp, log1pexp, poly_log
from copulae.stats import random_uniform
from copulae.stats.log import random_log_series... |
import numpy as np
import torch
import torchvision
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional as F
from collections import namedtuple
from functools import partial
from PIL import Image
import data_transforms
import data_iterators
import pathfinder
import utils
import app
restart_f... |
import xlwings as xw
import xwpandas as xp
import pandas as pd
import numpy as np
import csv
from xlwings.constants import Constants as C
import importlib
import time
#%%
arrays = [np.array(['bar', 'bar', 'baz', 'baz', 'foo', 'foo', 'qux', 'qux']),
np.array(['one', 'two', 'one', 'two', 'one', 'two', 'one', ... |
from .models import User
from .auth import orminAuth
from .resources import RegisterResource, LoginResource
|
import time
import itertools as it # NOQA
class LongIterable:
def __init__(self, duration=20):
self.duration = duration
n = 1000
start = time.perf_counter()
def test_iter():
for index in range(n):
yield index
for _ in test_iter():
p... |
import os
import cv2
import re
import glob
import math
import torch
import numpy as np
from skimage import io
from torchvision import transforms
from torch.utils.data import Dataset
from config import parser
age_cls_unit = int(parser['RacNet']['age_cls_unit'])
# distribution of IMDB-WIKi dataset I: IMDB-Wiki
imdb_d... |
"""API Blueprint
This is a subclass of Flask's Blueprint
It provides added features:
- Decorators to specify Marshmallow schema for view functions I/O
- API documentation registration
Documentation process works in several steps:
- At import time
- When a MethodView or a view function is decorated, relevant in... |
# coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------... |
"""
Routines for input and output.
This includes routines to produce, merge and analyse data produced by
simulations.
:Author:
Eric Huang
"""
import numpy as np
import datetime
import os
import json
from .bpauli import bvectors_to_ints
from .utils import sizeof_fmt
def serialize_results(
i_trial: int, n_tri... |
#coding: UTF-8
import ConfigParser
configFile='config.ini'
def get_butlers_from_ini():
parser = ConfigParser.ConfigParser()
try:
parser.readfp(open(configFile))
modules = parser.get("Cases","modules")
return modules.split(",")
except:
print "Read config.ini error"
|
from openerp.osv import osv, fields
from datetime import date
import datetime
import re
class student_ragistration(osv.osv):
_name = "student_reg_rec"
_columns = {
'state': fields.selection(
[('new', 'New'),('approve', 'Approve'),('confirmed', 'Confirmed')], 'Status'),
'seq_id_a'... |
class Constraint(object):
# Each constraint must have an implicit test
def __init__(self, types=tuple(), test=lambda *args: False):
self.types = types
#self.test = None # None instead of test
self.test = test
# TODO - separate the test or keep it here? We could try to plan without the test
class Cons... |
"""
Copyright notice
================
Copyright (C) 2018
Julian Gruendner <juliangruendner@googlemail.com>
"""
import queue
import socketserver
import threading
import time
import ssl
import uuid
import os
import json
import ipaddress
from ds_http.ds_http import HTTPRequest, HTTPResponse
from logger i... |
# Copyright 2010 New Relic, 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 or agreed to in writ... |
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
plt.style.use('seaborn')
A = pd.read_csv('ref.csv', delim_whitespace=True).append(pd.read_csv('file.csv', delim_whitespace=True))
plt.figure(figsize=(11, 8));
plt.title('Performance');
plt.cla();
plt.subplot(311)
plt.title('Feedback and Gain'... |
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Bin Xiao (Bin.Xiao@microsoft.com)
# ------------------------------------------------------------------------------
from __future__ import absolute_import
from __futu... |
#! /usr/bin/env python
import unittest
import rospy
from geometry_msgs.msg import TwistStamped
from gazebo_msgs.srv import DeleteModel
class TwistTopicTest(unittest.TestCase):
def __init__(self, robot_name, delete_model):
super(TwistTopicTest, self).__init__('twistTopicTest')
self.robot_name = rob... |
"""
The FixedWidth class definition.
"""
from decimal import Decimal, ROUND_HALF_EVEN
from datetime import datetime
from six import string_types, integer_types
class FixedWidth(object):
"""
Class for converting between Python dictionaries and fixed-width
strings.
Requires a 'config' dictonary.
E... |
import FishEngineInternal
from FishEngine import SceneManager, Material, MeshManager, Vector3, Quaternion, Script
from timing import timing
import demo1, demo2
from collections import OrderedDict
from FishEditor import EditorApplication
import sys, yaml
def Vector3_representer(dumper, v:Vector3):
return dumper.r... |
"""
Combine speaker and listener for easier training
"""
from torch import nn
class Pair(nn.Module):
def __init__(self, speaker, listener):
super().__init__()
self.speaker = speaker
self.listener = listener
self.bce_criterion = nn.BCEWithLogitsLoss()
self.xent_criterion = ... |
"""COMMAND : .left"""
import asyncio
from telethon import events
from telethon.tl.types import ChannelParticipantsAdmins
from uniborg.util import admin_cmd
@borg.on(admin_cmd(pattern="left ?(.*)"))
async def _(event):
if event.fwd_from:
return
mentions = "Why Are Some People Left-Handed?\n\n`Being a ... |
from enum import IntEnum
class CommandOpcode(IntEnum):
PING_OBC = 0x00
GET_RTC = 0x01
SET_RTC = 0x02
READ_OBC_EEPROM = 0x03
ERASE_OBC_EEPROM = 0x04
READ_OBC_RAM_BYTE = 0x05
SET_INDEF_BEACON_ENABLE ... |
import unittest
import utilities.src.latlon as latlon
class LatLonTest(unittest.TestCase):
p1: latlon.Point
p2: latlon.Point
def setUp(self):
self.p1 = latlon.Point(1.14, 1.21)
self.p2 = latlon.Point(1.52, 1.35)
def test_distance(self):
self.assertAlmostEqual(45.03, latlon.dis... |
import numpy as np
import pycuda.driver as cuda
import pycuda.autoinit
############### cuda ###############
from pycuda import gpuarray
def getcudadevice():
"""
initial shell device, if found return device, else return None
:return:
"""
devices = []
for i in range(cuda.Device.count()):
... |
# Copyright (c) 2021. Nicolai Oswald
# Copyright (c) 2021. University of Edinburgh
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.