content stringlengths 5 1.05M |
|---|
import requests
import logging
import sys
import unittest
from urllib.parse import urljoin
class PopcornTime:
_BASE_URL: str = 'https://popcorn-ru.tk/'
_MIN_SEEDS: int = 0
_MIN_PEERS: int = 0
def __init__(self, debug: bool = False, min_peers: int = 0, min_seeds: int = 0):
self.log = logging.... |
import chainer
import chainer.functions as F
import cupy as cp
from argparser import args
def langevin(x_fake, y_fake, dis):
for i in range(args.num_steps):
x_fake = langevin_step(args, x_fake, y_fake, dis, steps=i, anealing=args.anealing)
return x_fake
def anealing_fn(steps, total_steps):
rat... |
from flask import Flask
from config import Config
app = Flask(__name__)
app.config.from_object(Config)
#workaround for circular import, so it is declared after initializing app variable
from app import routes
|
# -*- coding: utf-8 -*-
import os
import mock
import lxml
import pytest
import responses
from nose.tools import * # noqa
from datacite import schema40
from framework.auth import Auth
from website import settings
from website.identifiers.clients import DataCiteClient
from website.identifiers.utils import request_ide... |
# Copyright (c) 2020 kamyu. All rights reserved.
#
# Google Code Jam 2008 Round 1A - Problem C. Numbers
# https://code.google.com/codejam/contest/32016/dashboard#s=p2
#
# Time: O(logN)
# Space: O(1)
#
from itertools import izip
def matrix_mult(A, B):
ZB = zip(*B)
return [[sum(a*b for a, b in izip(row, col)) ... |
# -*- coding: utf-8 -*-
###############################################################################
# This file is part of metalibm (https://github.com/kalray/metalibm)
###############################################################################
# MIT License
#
# Copyright (c) 2018 Kalray
#
# Permission is here... |
"""group views"""
from django.apps import apps
from django.contrib.auth.decorators import login_required
from django.db import IntegrityError
from django.core.paginator import Paginator
from django.http import HttpResponseBadRequest
from django.shortcuts import get_object_or_404, redirect
from django.template.response ... |
import argparse
import yaml
import os
import anndata as ad
import scanpy as sc
from morphelia.plotting import pca_variance_ratio
def run(inp):
"""Calculate embeddings for morphological data."""
# where to save figures
figdir = os.path.join(inp['output'], './figures/')
# scanpy settings
sc.setting... |
from django.template import Context, Template
from django.test import TestCase
from dynamic_setting.models import Setting
class GetSettingTestCase(TestCase):
def _create_setting(self, name, data):
return Setting.objects.create(name=name, data=data)
def test_get_setting(self):
name = 'TEST_SE... |
import unittest
from hamcrest import equal_to, assert_that
from structural.adapter.adapter import InvokerTargetAdapter
from structural.adapter.target import InvokerTarget
def target_invoker(target: InvokerTarget):
return target.request()
class TestClient(unittest.TestCase):
def test(self):
target =... |
# nums = []
# maior = menor = 0
# for num in range(0, 5):
# nums.append(int(input(f'Digite um valor para a Posição {num}: ')))
# for cont, n in enumerate(nums):
# if cont == 0:
# maior = n
# menor = n
# else:
# if n > maior:
# maior = n
# if n < menor:
# ... |
# -*- coding: utf-8 -*-
"""
@Time : 2017/12/3 19:50
@Author : Elvis
"""
"""
fusion.py
"""
import torch
from torch import nn
import torch.nn.functional as F
from torchvision.models import resnet18, alexnet
class FusionNet(nn.Module):
def __init__(self, cnn0, cnn1, num_classes=200):
super(FusionNet,... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
QSDsan: Quantitative Sustainable Design for sanitation and resource recovery systems
This module is developed by:
Yalin Li <zoe.yalin.li@gmail.com>
This module is under the University of Illinois/NCSA Open Source License.
Please refer to https://github.com/QSD-G... |
#### Simple Classifier for Anomaly vs Normal
import torch
import torch.nn as nn
from torch_model import BinaryClassifier
import common as com
import os
import numpy as np
import ipdb
from sklearn.model_selection import train_test_split
from torch.utils.data import DataLoader, TensorDataset
from torch import Tensor
imp... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
from config import Config
import matplotlib.pyplot as plt
class Bottleneck(nn.Module):
expansion = 4
def __init__(self, infeat, outfeat, stride=1, downsample=None):
super(Bott... |
from keras.engine import topology
from keras import optimizers
from keras.models import Sequential
import keras.backend as K
import h5py, json
import numpy as np
def get_json_type(obj):
"""Serialize any object to a JSON-serializable structure.
# Arguments
obj: the object to serialize
# Returns
... |
# Generated by Django 3.2.3 on 2021-06-20 16:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('books', '0009_auto_20210621_0056'),
]
operations = [
migrations.AddIndex(
model_name='books',
index=models.Index(fie... |
# Exercise_1
# Example, do not modify!
print(5 / 8)
# Print the sum of 7 and 10
print(7+10)
--------------------------------------------------
# Exercise_2
# Division
print(5 / 8)
#Addition
print(7 + 10)
--------------------------------------------------
# Exercise_3
# Addition, subtraction
print(5 + 5)
print(5 ... |
data = [
{
'id': 1,
'name': 'One cool plane',
'wings': 5,
},
{
'id': 2,
'name': 'One very cool plane',
'wings': 8,
},
{
'id': 3,
'name': 'Boring plane',
'wings': 2,
},
]
|
from Environment import Environment
from Individual import Individual
class Passive_walker:
def __init__(self):
# Create the environment
environment = Environment(kind=Individual, size=100, maxgenerations=200, crossover_rate=0.90, mutation_rate=0.2, optimum=650)
# Find the best sample
... |
from .graphs import BidirectedGraph
from .graphs.sorting import TopologicalSorter
from holobot.sdk.ioc.models import ExportMetadata
from holobot.sdk.utils import get_or_add
from typing import Any, Dict, Generator, List, Set, Tuple, Type, TypeVar, get_args
import inspect, logging
TService = TypeVar("TService")
class ... |
# Copyright (c) 2019 Simón Flores (https://github.com/cheece)
# 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,... |
# Generated by Django 3.1.1 on 2021-02-17 14:00
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('esuits', '0026_auto_20210215_0105'),
]
operations = [
migrations.RemoveField(
model_name='questionmodel',
name='answer',
... |
import apache_beam as beam
import tensorflow as tf
import tensorflow_transform.beam as tft_beam
from tensorflow_transform.coders import example_proto_coder
from tensorflow_transform.tf_metadata import dataset_schema
from ..data.pipeline import read_csv
from ..features.preprocess import preprocess_recommender
from ..pi... |
m=int(input())
l=list(map(int,input().split()))
b=l[0]
for i in range(m):
for j in range(i+1,m):
if(b<l[j]):
b=l[j]
c=l[0]
for i in range(m):
for j in range(i+1,m):
if(c>l[j]):
c=l[j]
print(c,b)
|
import os
import subprocess
import json
import shelve
import time
import math
import threading
import shutil
import traceback
import random
from collections import defaultdict
from .common import * #pylint: disable=wildcard-import
# Settings per job. By default jobs are subsampled to <= 100 chunks.
MAX_CHUNKS_IN_FLIG... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------------------------
# - Generated by tools/entrypoint_co... |
import os
import uuid
TESTING_DIR = f'/tmp/docker-ops-testing/{uuid.uuid4()}'
PROJECT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
TESTING_TEMPLATE_DIR = os.path.join(PROJECT_DIR, 'docker_ops_test_templates')
|
"""Functions for extracting references."""
import re
import os
import logging
import argparse
import requests
LOGGER = logging.getLogger("inspiretools")
# blacklisted citation keys
BLACKLISTED_KEYS = [
# from using revtex-4.1
"REVTEX41Control",
"apsrev41Control",
]
def aux2texkey(filename):
"""Extr... |
class BinaryExecutableNotFound(Exception):
"""Raised if binary executable not found"""
def __init__(self, bin_path):
msg = f'{bin_path} not found.'
super(BinaryExecutableNotFound, self).__init__(msg)
class StreamBufferTooLargeException(Exception):
"""Raised if stream buffer size is greate... |
"""
Copyright (c) 2019 Heidi Neuhäuser (Modifications)
Copyright (c) 2017 Manuel Peuster
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/LICE... |
# flake8: noqa
from .action import ActionDispatcher
from .command import CommandDispatcher
from .event import EventDispatcher
from .message import MessageDispatcher |
# Global Parameters to unify interface
dirname = "models/attempt10/"
explorationRate = exploration_range=(0.9, 0.1) |
# title : tfMITOMIprotocols.py
# description : tf-MITOMI-specific protocols for experimental acquisition notebook
# authors : Daniel Mokhtari, Arjun Aditham, Nicole DelRosso
# credits : Scott Longwell
# date : 201711015
# version update : 20200913
# version ... |
import numpy as np
def precision_at_k(r, k):
"""
Precision calculation method
Parameters
----------
r : List, list of the rank items
k : int, top-K number
Returns
-------
pre : float, precision value
"""
assert k >= 1
r = np.asarray(r)[:k] != 0
if r.size != k:
... |
import cv2
import numpy as np
import dlib
from imutils import face_utils
import imutils
class FaceDetection(object):
def __init__(self):
self.detector = dlib.get_frontal_face_detector()
self.predictor = dlib.shape_predictor("dat/shape_predictor_68_face_landmarks.dat")
self.fa = ... |
from pwn import *
import functools
LOG_ADDR = lambda x, y: log.success('{} ===> {}'.format(x, hex(y)))
int16 = functools.partial(int, base=16)
context.update(arch='amd64', os='linux', endian='little')
def create_weapon(size:int, idx:int, name, sh:tube):
sh.sendlineafter("choice >> \n", '1')
sh.sendlineafter(... |
import numpy as np
from .interfaces.dataset import Dataset
from .interfaces.model import Model
from .interfaces.loss import Loss
from .interfaces.optimizer import Optimizer
from .interfaces.batch_scheduler import BatchScheduler
class DummyDataset(Dataset):
def __init__(self):
super(DummyDataset, self).__... |
#! /bin/bash/env python
def init():
global user_evalues
global allvsallfile
global similarity
global numthreads
global filelist
global species_id
global evalues
global outblastp_splitfiles
global flatfiles_and_foldernums
global flatfiles_foldernumber
global flatfiles_added
global current_numclusters
user_e... |
import argparse
def create_parser():
cli_parser = argparse.ArgumentParser()
cli_parser.add_argument('-u', '--url',
help='URL of archive file to be downloaded, unarchived and parsed',
dest='url',
nargs='+'
... |
# -*- coding: utf-8 -*-
CLOUD_USER_MAPPING = {
'cloud_user_list': {
'resource': 'cloud-user/',
'docs': '',
'methods': ['GET'],
},
'cloud_user_get': {
'resource': 'cloud-user/{id}/',
'docs': '',
'methods': ['GET'],
},
'cloud_user_create': {
're... |
import tensorflow as tf
import numpy as np
from collections import deque
from scipy.misc import imresize
class Model:
LEARNING_RATE = 1e-6
BATCH_SIZE = 32
EPSILON = 1
DECAY_RATE = 0.005
MIN_EPSILON = 0.1
GAMMA = 0.99
MEMORIES = deque()
INITIAL_GAME = True
MEMORY_SIZE = 50000
IN... |
# Generated by Django 3.1.5 on 2021-01-11 09:37
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('polls', '0002_auto_20210111_1831'),
]
operations = [
migrations.RenameField(
model_name='choice',
old_name='ch... |
import keras.layers
import keras.backend as K
import logging
from .utils import ensure_tf_type, ensure_numpy_type
# Handle python 2.7 import error
try:
from collections.abc import Iterable
except ImportError:
from collections import Iterable
def convert_clip(node, params, layers, node_name, keras_name):
... |
"""
richtext
~~~~~~~~
Currently, a very thin wrapper around `ttk.Label`.
In the future, the plan is to add simple HTML or markdown (or both) formatting.
"""
import tkinter as tk
import tkinter.ttk as ttk
import tkinter.font as tkfont
import open_cp.gui.tk.util as util
class RichText(tk.Frame):
"""Currently, a s... |
""" Module to handle the workflow of with the Downloader Class """
import logging
import os
from shutil import move
import bin.Helper as helper
from bin.Downloader import Downloader
def downloader(args):
""" the downloader function """
# Make the query
chapters = helper.getChapters(args.limit)
if a... |
import socket
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
host = socket.gethostname()
port = 12348
print "Waiting for connection"
s.bind((host,port))
s.listen(9)
socket_list = []
socket_list.append('send')
client_thread,address = s.accept()
print("Connection established. Send a message")
while True:
if... |
pocketmoney=int(input("enter the money you get:"))
if(pocketmoney>500):
print("you are rich")
elif(pocketmoney>100):
print("you have a good life")
else:
print("I know what you feel") |
import click
from .ps import ps
from .actions import start, stop, deploy
from .update import update, create
from .load_template import init, upgrade
from ..client.api import api_client
@click.group()
@click.pass_context
def apis(ctx):
ctx.obj['api_client'] = api_client(config=ctx.obj['config'])
apis.add_comman... |
# 1 Download the data
# Create a data frame for Airmar Data
import pickle
import datetime
import pandas as pd
import glob
import os
from collections import OrderedDict
from functools import reduce
from pandas._libs.tslibs import timestamps
from pandas.core.frame import DataFrame
from yaml.events import CollectionStar... |
import argparse
import ConfigParser
import sys
import itertools
from utils import chunks
from api_client import ApiClient
from influx_client import InfluxClient
from telegraf_config import TelegrafConfigFormatter
class Options(object):
CONFIG_FILE_SECTION = 'default'
def __init__(self, args):
parser... |
import numpy as np
N, D = list(map(int, input().split()))
X = [[int(i) for i in input().split()] for i in range(N)]
X = np.array(X)
# ans = 0
# for i in range(N):
print(X) |
# Copyright 2018 Cedric Mesnil <cslashm@gmail.com>, Ledger SAS
#
# 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... |
import requests
from django.core.files.temp import NamedTemporaryFile
from django.core.management.base import BaseCommand
from django.core.files import File
from django.contrib.auth.models import User
from authentication.models import UserProfile
class Command(BaseCommand):
help = 'Creates n random users'
de... |
class QuickUnion:
def __init__(self, size):
self.ids = [*range(size)]
def __root(self, i):
while (i != self.ids[i]):
i = self.ids[i]
return i
def union(self, p, q):
q_root = self.__root(q)
p_root = self.__root(p)
self.ids[p_root] = q_root
de... |
# Generated by Django 2.1.5 on 2019-02-13 06:43
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('feedback', '0002_feedbac... |
from ._generic import RootSitemapScraper
class AmbitiousKitchenScraper(RootSitemapScraper):
"""
A scraper for ambitiouskitchen.com
"""
NAME = "ambitiouskitchen"
RECIPE_URL_FORMAT = "https://www.ambitiouskitchen.com/{id}/"
# e.g. https://www.ambitiouskitchen.com/healthy-white-chicken-chili/
... |
#!/usr/bin/env python
"""
Settings for a simple app that we'll use to run test.
"""
DEBUG = True,
INSTALLED_APPS = (
'multifieldclean.tests.test_app',
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3'
},
}
SECRET_KEY = '*'
|
from DeckofCards import Deck
def card_value(card):
if type(card[0]) == int:
return card[0]
elif card[0] == "A":
return 11
else:
return 10
def hand_value(hand):
"""iterates through hand returns values"""
value = 0
acecount = 0
for i in range(len(hand)):
car... |
import os
import time
from pathlib import Path
import yaml
import numpy as np
import astropy.units as u
from gammapy.datasets import Datasets, MapDataset
from gammapy.irf import PSFMap, EDispKernelMap
from gammapy.maps import MapAxis, WcsGeom
from gammapy.modeling.models import (GaussianSpatialModel, Models,
... |
# Generated by Django 3.2.2 on 2021-05-23 19:35
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('login', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Fli... |
from PyObjCTools.TestSupport import *
import objc
import array
import sys
from objc import YES, NO
from AppKit import *
try:
unicode
except NameError:
unicode = str
try:
long
except NameError:
long = int
class TestNSBitmapImageRep(TestCase):
def testInstantiation(self):
# widthxheight R... |
import requests, os, bs4
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from .argument import ArgSession, Argument
from ..responses import ResponseMsg, ResponseImg
from ..utils import format_filename
from ..paths import PATHS
TEMP_DIR = PATHS['temp']
webdriver_dir = PATHS... |
from upnpavcontrol.core.discovery.advertisement import AdvertisementListenerInterface
from upnpavcontrol.core.discovery.advertisement import _DeviceAdvertisementHandler
class NullAdvertisementListener(AdvertisementListenerInterface):
"""
Does not actually listen to advertisement messages, instead provides
... |
'''
Created on 25 Dec 2016
@author: Fabian Meyer
'''
import random
class neuron:
def __init__(self, uid, weights, threshold):
self.uid = uid
self.weights = weights
self.threshold = threshold
self.outval = 0
def __net_func(self, invals):
return sum([w * v for w, v in zi... |
import time
def my_fuc(n):
data = []
for i in range(int(n)):
data.append(i**0.5)
return data
start = time.time()
my_fuc(400000)
my_fuc(400000)
my_fuc(400000)
my_fuc(400000)
my_fuc(400000)
end = time.time()
print(f"time: {round(end-start, 4)}") |
# -*- coding: utf-8 -*-
# test/unit/channel/test_datachannel.py
# Copyright (C) 2016 authors and contributors (see AUTHORS file)
#
# This module is released under the MIT License.
"""Test DataChannel class"""
# ============================================================================
# Imports
# ==================... |
import collections
try:
import numpy as np
except ImportError:
_numpy_is_imported = False
else:
_numpy_is_imported = True
__all__ = [
'NotFreezableError',
'ishashable',
'freeze',
'unfreeze',
'deepfrozendict'
]
class NotFreezableError(Exception):
def __init__(self, msg):
sel... |
"""
Caminata aleatoria unidimensional (Manera simple)
Luis Eduardo Sánchez González
Facultad de Ciencias Físico Matemáticas
Física Computacional
mar 13 abr 2021 15:56:19 CDT
Repositorio: https://github.com/Luis2501/Fisica-Computacional-1
"""
import numpy as np
def Random_Walk(N, p):
X = np.random.random(N) ... |
'''
You live in the city of Cartesia where all roads are laid out in a perfect grid. You arrived ten minutes too early to an appointment, so you decided to take the opportunity to go for a short walk. The city provides its citizens with a Walk Generating App on their phones -- everytime you press the button it sends yo... |
import os.path as op
import numpy as np
from mapVBVD import mapVBVD
test_data_vb = op.join(op.dirname(__file__),'test_data','meas_MID311_STEAM_wref1_FID115674.dat')
test_data_ve = op.join(op.dirname(__file__),'test_data','meas_MID00305_FID74175_VOI_slaser_wref1.dat')
def test_vb():
twixObj = mapVBVD(test_data_vb... |
from qstrader.execution.execution_handler import ExecutionHandler
from qstrader.execution.execution_algo.market_order import MarketOrderExecutionAlgorithm
from qstrader.portcon.pcm_mc import PortfolioConstructionModel_MC
from qstrader.portcon.optimiser.fixed_weight import FixedWeightPortfolioOptimiser
from qstrader.por... |
import boto3
import os
import json
from common_lib import id_generator
STEPFUNCTIONS_CLIENT = boto3.client('stepfunctions')
STEPFUNCTIONS_ARN = os.environ['STEP_FUNCTION_ARN']
def lambda_handler(event, context):
"""
The first lambda function that runs, triggered by a DynamoDB Transcripts table event
Star... |
#!/bin/python3
import math
class Vec3():
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
def __add__(self, other):
return Vec3(self.x + other.x, self.y + other.y, self.z + other.z)
def __sub__(self, other):
return Vec3(self.x - other.x, self.y - other... |
from collections.abc import Mapping
from six import string_types
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from rest_framework import serializers
from rest_framework.fields import empty
# NOTES: Code extracted from the project django-rest-polymorphic ! ( https://github.com/... |
from django.db import models
import simpleldap
# Create your models here.
class LDAPWrapper(models.Model):
# Constants
CONNECTION_DOMAIN = 'ldap.uniandes.edu.co'
BASE_DN = 'ou=People, dc=uniandes, dc=edu, dc=co'
# Attributes
conn = None
@classmethod
def create(cls):
me = cls()
... |
import pymongo
client = pymongo.MongoClient(host='192.168.56.128', port=27017)
db = client["db"]
sets = db["sets"]
dict = { "name": "mongdb插入测试", "url": "https://kui.ge" }
x = sets.insert_one(dict)
print(x) |
"""
legoBTLE.constants.SIUnit
~~~~~~~~~~~~~~~~~~~~~~~~~
Module modeling SI Units.
:copyright: Copyright 2020-2021 by Dietrich Christopeit, see AUTHORS.
:license: MIT, see LICENSE for details
"""
import math
from enum import Enum
class SIUnit(Enum):
""":class:`legoBTLE.constants.SIUnit.S... |
from main import (
read_adapters,
find_adapters,
options,
)
import unittest
class TestAdapters(unittest.TestCase):
"""Run: python -m unittest test_main.py"""
def setUp(self):
self.adapters = read_adapters(path='input_test.txt')
def test_part_1(self):
res = find_adapters(self.... |
import unittest
import warnings
from azure.core.exceptions import HttpResponseError
from azure.quantum.job.job import Job
from azure.quantum.target import IonQ
from azure.quantum.target.honeywell import Honeywell
from common import QuantumTestBase, ZERO_UID
class TestIonQ(QuantumTestBase):
"""TestIonq
Test... |
import numpy as np
pi = np.pi
e = np.exp(1)
inf = np.inf
np.set_printoptions(formatter={'float': lambda x: "{0:0.3f}".format(x)})
class Matrix(object):
def __init__(self, data, dtype=np.float64, ndarrayType='matrix'):
self.data = None
if ndarrayType == 'matrix':
self.data = np.asmatrix... |
import itertools
from intcode import Computer
class NAT:
def __init__(self, network):
self.network = network
self.input_data = None
self.need_first = True
self.output = []
def run(self, _):
if not any(c.input_data or c.output for c in self.network.values() if c is not... |
class SizeOrDash(basestring):
"""
@desc
"""
@staticmethod
def get_api_name():
return "size-or-dash"
|
from PyQt5 import QtGui
from PyQt5 import QtCore
from pandas.core.frame import DataFrame
import numpy as np
from ChannelMsgAuto import ChannelMessageSending
import os
import sys
import threading
# import win32com.shell.shell as shell
from DBM import DBMgr
from PyQt5 import QtWidgets
from PyQt5.QtGui import QStandardI... |
#!/usr/bin/python
#
# Copyright 2002-2019 Barcelona Supercomputing Center (www.bsc.es)
#
# 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
... |
import pandas as pd # データフレームワーク処理のライブラリをインポート
import matplotlib.pyplot as plt
from pandas.tools import plotting # 高度なプロットを行うツールのインポート
from sklearn.cluster import KMeans # K-means クラスタリングをおこなう
from sklearn.decomposition import PCA #主成分分析器
#from mpl_toolkits.mplot3d import Axes3D
#from PIL import Image
#from PIL import ... |
import numpy as np
import math
import time
import json
import os
from sklearn.neural_network import MLPClassifier
import controller as c
import utils as u
class Neuro_controller(c.Controller):
def __init__(self, config):
super(Neuro_controller, self).__init__("NEURO", config)
self.n_sonar = 0
... |
from dataclasses import dataclass, field
from typing import List
__NAMESPACE__ = "NISTSchema-SV-IV-list-gYear-pattern-2-NS"
@dataclass
class NistschemaSvIvListGYearPattern2:
class Meta:
name = "NISTSchema-SV-IV-list-gYear-pattern-2"
namespace = "NISTSchema-SV-IV-list-gYear-pattern-2-NS"
valu... |
try:
from torch.utils.data import Dataset
except ModuleNotFoundError:
raise ModuleNotFoundError("Pytorch not found. Install with pip install torch")
class BaseDataset(Dataset):
"""
Base Class for the PyTorch DataSets
"""
def __init__(self, tsd):
self.tsd = tsd
|
# 69
# It contains a pair of any two letters that appears at least twice in the string without overlapping,
# like xyxy (xy) or aabcdefgaa (aa), but not like aaa (aa, but it overlaps).
# It contains at least one letter which repeats with exactly one letter between them,
# like xyx, abcdefeghi (efe), or even aaa.
imp... |
"""
Fundamental schema attributes
These can be imported directly from `confu.schema`
"""
import os
import six
import collections
from inspect import isclass
from confu.exceptions import ValidationError, ValidationWarning, ApplyDefaultError
from confu.util import config_parser_dict
try:
import configparser
exce... |
# coding=utf-8
from OTLMOW.OTLModel.Datatypes.KeuzelijstField import KeuzelijstField
from OTLMOW.OTLModel.Datatypes.KeuzelijstWaarde import KeuzelijstWaarde
# Generated with OTLEnumerationCreator. To modify: extend, do not edit
class KlScheurremmendeLaagType(KeuzelijstField):
"""Types van scheurremmende laag."""
... |
'''
Created on 15 Aug 2016
@author: fressi
'''
from py_curl_example.command import main
if __name__ == '__main__':
main()
|
from amaranth_boards.ecp5_5g_evn import *
from amaranth_boards.ecp5_5g_evn import __all__
import warnings
warnings.warn("instead of nmigen_boards.ecp5_5g_evn, use amaranth_boards.ecp5_5g_evn",
DeprecationWarning, stacklevel=2)
|
import re
# As I'm submitting this I'm realizing there are more comments than code here. I may have gone overboard.
# open file read only
file = open("input.txt", 'r')
# read the entire file, don't like this but it's the best thing to close right away
lines = file.read()
# close file
file.close()
vowels = "aeiou"
# t... |
# -*- coding: utf-8 -*-
"""
Module for command execution functions.
Copyright:
2022 by Clemens Rabe <clemens.rabe@clemensrabe.de>
All rights reserved.
This file is part of gitcache (https://github.com/seeraven/gitcache)
and is released under the "BSD 3-Clause License". Please see the ``LICENSE`` file... |
from django.apps import AppConfig
class UnpoliticalConfig(AppConfig):
name = 'unpolitical'
|
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/01_patched.ipynb (unless otherwise specified).
from __future__ import annotations
__all__ = []
# Cell
#nbdev_comment from __future__ import annotations
import re
from fastcore.basics import patch_to
from flax.core import FrozenDict
from jaxlib.xla_extension import D... |
word_set = set()
def make_word_set():
with open('pylib/word_list.csv') as f:
for l in f.readlines():
if l.strip():
word_set.add(l.strip())
def letters_on_places(word, locked_positions):
for idx, letter in enumerate(locked_positions):
if letter.strip():
i... |
import signal
import sys
from PyQt5.QtWidgets import QApplication
import rospy
from arc_utilities.rviz_marker_repeater import RVizRepeater
if __name__ == '__main__':
rospy.init_node('rviz_marker_repeater')
signal.signal(signal.SIGINT, signal.SIG_DFL)
app = QApplication(sys.argv)
repeater = RVizRepea... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.