content stringlengths 5 1.05M |
|---|
# adapted from baselines.trpo_mpi.trpo_mpi
from baselines.common import explained_variance, zipsame, dataset
from baselines import logger
import baselines.common.tf_util as U
import tensorflow as tf, numpy as np
import time
from baselines.common import colorize
from collections import deque
from baselines.common impor... |
# #####################################################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... |
class ExtractionError(Exception):
"""
Base exception for extraction errors
"""
pass
|
import json
import logging
import math
import asyncio
from datetime import datetime
from .exceptions import (
ModelError,
ApiError,
SpecificationError,
TrainMLException,
)
from .connections import Connection
class Models(object):
def __init__(self, trainml):
self.trainml = trainml
as... |
from . import graphite
__all__ = ['graphite']
|
import json
import boto3
import logging
from typing import Dict, Any, List, Union
from pandas import DataFrame
from io import StringIO
_logger = logging.getLogger()
class Bucket(object):
def __init__(self, bucket: str):
"""Initialize the bucket.
Parameters:
- bucket (str): The name of th... |
class Solution:
def __init__(self):
self.path = []
self.res = []
def DFS(self, arr):
if not arr:
self.res.append(self.path[:]) # do not forget to append the leaf path
return
self.res.append(self.path[:])
for i, x in enumerate(arr):
... |
import logging
import dotenv
import hydra
from omegaconf import DictConfig
dotenv.load_dotenv(override=True)
logger = logging.getLogger(__name__)
@hydra.main(config_path="configs/", config_name="config.yaml")
def main(config: DictConfig):
logger.info(config.pretty())
# Imports should be nested inside @hyd... |
import numpy as np
from os import listdir, path, environ
import cv2
import tarfile
from sklearn.model_selection import train_test_split
from xview.settings import DATA_BASEPATH
from .data_baseclass import DataBaseclass
from .augmentation import augmentate
from copy import deepcopy
WILDDASH_BASEPATH = path.join(DATA_... |
from abc import (
ABC,
abstractmethod
)
from argparse import (
ArgumentParser,
Namespace,
_SubParsersAction,
)
from enum import (
auto,
Enum,
)
import logging
from multiprocessing import (
Process
)
from typing import (
Any,
Dict,
)
from lahja import (
BroadcastConfig,
E... |
"""Add OrganizationGroup.order column
Revision ID: c4379beee223
Revises: aa51a9aacd00
Create Date: 2018-04-06 00:44:49.028529
"""
from alembic import op
import sqlalchemy as sa
import lifeloopweb.db.models
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'c4379beee223'
down_... |
#
# This file is part of Orchid and related technologies.
#
# Copyright (c) 2017-2022 Reveal Energy Services. All Rights Reserved.
#
# LEGAL NOTICE:
# Orchid contains trade secrets and otherwise confidential information
# owned by Reveal Energy Services. Access to and use of this information is
# strictly limited and... |
import gzip, sys
input_file = sys.argv[1] # must be a gzipped fastq
output_file = sys.argv[2] # writes output in fastq.gz format
output_file_handle = gzip.open(output_file, "wb") # write out the output file in gzipped format
passes_list=[] # list of floats holding pass numbers
with gzip.open(input_file, 'r') as fh:
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unicodedata
from dataclasses import dataclass
from model.error.user_error import NameDivisionError
@dataclass
class UserName(object):
fullname: str
firstname: str
lastname: str
def __init__(self, fullname: str):
self.fullname = fullname
... |
from django.core.management.base import BaseCommand
from django.db.models import Q
from ...models import EthereumTx
from ...services import IndexServiceProvider
class Command(BaseCommand):
help = 'Check all stored ethereum_txs have a valid receipt and block. Fixes them if a problem is found'
def handle(self... |
import pytest
from django.conf import settings
from django.utils.encoding import force_text
@pytest.mark.urls('pytest_django_test.urls_overridden')
def test_urls():
try:
from django.urls import is_valid_path
except ImportError:
from django.core.urlresolvers import is_valid_path
assert sett... |
from .adaptive import A2CAdaptive
|
import json
from tweepy import Stream, OAuthHandler
from tweepy.streaming import StreamListener
import sentiment
# derived from <https://gist.github.com/graydon/11198540>
AUS_BOUND_BOX = (113.338953078, -43.6345972634, 153.569469029, -10.6681857235)
class MyListener (StreamListener):
"""
In case we want to ... |
"""
Test cases for testing if it is possible to pickle
Objective-C objects
"""
from PyObjCTools.TestSupport import *
# Test cases for pickling ObjC objects
class TestPickleObjC (TestCase):
pass
# Test cases for pickling mixed Python/ObjC
# object graphs
class TestPickleMixedGraph (TestCase):
pass
# Test c... |
#
# Endpoint:
# /pinfo
#
def pinfo_get(channel_disc, channel_type, channel, etime) -> str:
import datetime, pytz, configparser
config = configparser.ConfigParser()
config.read('conf/screen.ini')
mytz = pytz.timezone("Asia/Tokyo")
timestr = datetime.datetime.fromtimestamp(etime, tz=mytz)
sql... |
import setuptools
with open('README.md', 'r') as f:
long_description = f.read()
setuptools.setup(
name='django_tenant_schemas_q',
version='1.0.1',
author='Rajesh Yogeshwar',
author_email='rajesh.yogeshwar@gmail.com',
include_package_data=True,
description='An integration package for Django... |
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor
from myproject.items import Headline
class NewsCrawlSpider(CrawlSpider):
name = "news_crawl" # Spiderの名前。
# クロール対象とするドメインのリスト。
allowed_domains = ["news.yahoo.co.jp"]
# クロールを開始するURLのリスト。
start_urls = (
... |
import re
import numpy as np
import pandas as pd
import transformers
import hazm
from cleantext import clean
import gc
from transformers import AdamW
from transformers import get_linear_schedule_with_warmup
from transformers import AutoConfig, AutoTokenizer, AutoModel
from transformers import BertForSequenceClassi... |
# Program 50 : Merge Two Dictionaries
dict_1 = {1: 'a', 2: 'b'}
dict_2 = {2: 'c', 4: 'd'}
print({**dict_1, **dict_2}) |
"""
This button is similar to :mod:`libraries.base.qtWidgets.button`, but is reserved for executing the main
function of a widget. Includes some helper checkboxes such as allowing the widget to run on receiving input
or any user change.
The commitButton is a special button used for widget commits. This works jus... |
# https://codeforces.com/problemset/problem/1335/D
t = int(input())
cases = [[input() for row in range(9)] for _ in range(t)]
for sudoku in cases:
for row in sudoku:
print(row.replace('1', '2')) |
import torch
import torch.nn.functional
import cvxpy as cp
class Hinge:
def solve_dual(self, P, c):
# extract information and convert tensors to numpy. CVXPY
# works with numpy arrays
dtype = P.dtype
m = P.shape[1]
P = P.data.numpy()
c = c.data.numpy()
# de... |
import requests
import unicodedata
import nltk
import random
import itertools
import torch
from typing import List, Tuple
CONSTANTS = {'PAD_token': 0,
'SOS_token': 1,
'EOS_token': 2,
'UNK_token': 3,
'WORD2INDEX_URL': "http://zissou.infosci.cornell.edu/convokit/models... |
import os
from settings.base import *
from decouple import config
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
#SECRET_KEY = os.environ.get('SECRET_KEY')
SECRET... |
"""Run overlap-based tracker on detectron outputs on FBMS."""
import argparse
import collections
import logging
import pprint
import subprocess
from pathlib import Path
import numpy as np
from tqdm import tqdm
import tracker.track as tracker
import utils.log as log_utils
from utils.fbms import utils as fbms_utils
... |
import os
import pytest
from pydm import Display
# The path to the .ui file used in these tests
test_ui_path = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"test_data", "test.ui")
def test_display_raises_without_filename(qtbot):
"""If you don't specify a ui_filename argument, or don't reimp... |
#!/usr/bin/env python3
"""Infiniband Class."""
import logging
import os
import shlex
import shutil
import subprocess
from pathlib import Path
from ops.framework import Object, StoredState
from slurm_ops_manager.utils import operating_system
logger = logging.getLogger()
BASE_DIR = os.path.dirname(os.path.abspath(__... |
import toga
from consts import *
class PokeDex(toga.App):
def __init__(self,title,id):
toga.App.__init__(self,title,id)
self.title=title
self.size=(WIDTH,HEIGHT)
self.heading=['Name']
self.data=['python','laravel','c++']
self.create_elements()
def startup(self):
self.main_window = toga.MainWindow('ma... |
#!/usr/bin/python3
import argparse
import sys
from time import time
from matrix_client.client import MatrixClient
from matrix_client.api import MatrixRequestError
from requests.exceptions import MissingSchema
from getpass import getpass
# A simple application to set the status of services on Matrix.
# Error Codes:
# 1... |
import pandas as pd
import numpy as np
import nltk
import re
from nltk.stem import WordNetLemmatizer
from sklearn.svm import LinearSVC
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn import grid_search
from sklearn.linear_model impor... |
from scenarios import *
scenario = (
send_stanza("<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/RegisteredUser' ><x xmlns='http://jabber.org/protocol/muc'/></presence>"),
sequences.connection(),
simple_channel_join.expect_self_join_presence(jid = '{jid_one}/{resource_one}', chan = "#... |
import logging
from luigi import Task, LocalTarget
from luigi.util import inherits
from sklearn.externals import joblib
from sklearn.metrics import (
confusion_matrix, f1_score, precision_score, recall_score, accuracy_score,
hamming_loss
)
from dctool2.categories.training import (
TrainMultilabelClassifie... |
# rocketdump: scrape all public rocketchat channels
# usage: python rocketdump.py > rocketdump.out
# requires python 3 and with the ``requests`` library
from functools import partial
import json
from multiprocessing.dummy import Pool
import os
import sys
import requests
ROCKET_CHAT_API = "https://magenta.rocket.cha... |
#!/usr/bin/env python
import os
from setuptools import setup
if not 'VERSION' in os.environ:
raise Exception('Specify package version by <VERSION> environment variable')
if not 'EXT_LIB' in os.environ:
raise Exception('Specify <EXT_LIB> environment variable with a path to extensions library')
setup(name='ope... |
from fcfs import FCFS
|
from .active_state import (
ActiveState,
)
from .exclusive_balance_allotment import (
ExclusiveBalanceAllotment,
)
from .minimum_available_balance_marker import (
MinimumAvailableBalanceMarker,
)
from .blacklist import (
BlacklistEntry
)
from .blockchain_transaction import (
BlockchainTransaction,
... |
import json
import time
import pyautogui
from enum import Enum
import winsound
MIN_SLEEP_TIME = 10
SMALL_PAUSE = 3
MEDIUM_PAUSE = 10
LARGE_PAUSE = 20
WAIT_WINDOW = 40
class ImageType (Enum):
JPEG = 1
PNG = 2
BMP = 3
imageTypeMap = {}
imageTypeMap[ImageType['JPEG']] = ".jpg"
imageTypeMap[ImageType['... |
from django.db import models
class Product(models.Model):
name = models.CharField(max_length=140)
price = models.PositiveIntegerField()
quantity = models.PositiveIntegerField()
deleted = models.BooleanField(default=False)
def __str__(self):
return f"{self.name} {(self.price/100):.2f}€ {se... |
"""MPI Async Communication Interface."""
import io
import pickle
import logging
import collections
from mpi4py import MPI
from .evars import (
get_max_message_size,
get_min_send_size,
get_num_recv_buffers,
get_max_send_buffers,
)
COMM_WORLD = MPI.COMM_WORLD
WORLD_RANK = COMM_WORLD.Get_rank()
WORLD_S... |
from .mlp_mixer import *
|
"""Calculate mean End of Track.
This script was used to calculate the mean Precision, Recall and F-measure
for the end-of-track detection given the pickled output files from evaluate dataset.
The paths to the pickle files are specified down in the main
Example:
$ python compare_resuslts.py
"""
import pickle
imp... |
#!/usr/bin/env python
import os
import sys
sys.path[0] = os.path.dirname(sys.path[0])
from common.appenginepatch.aecmd import setup_env
setup_env()
from prefixes.models import Prefix, Suffix
LENGTHS = range(2, 7)
def auth_func():
return open('.passwd').read().split(':')
def most_popular(model, variable, leng... |
# Create your models here.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
# Feel free to rename the models,... |
# -*- coding:utf-8 -*-
# com.yunmall.lc/com.yunmall.ymctoc.ui.activity.MainActivity
from appium import webdriver
# server启动参数
desired_caps = {}
# 设备参数
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '6.0'
desired_caps['deviceName'] = 'MDQNW17331025978'
# app参数
desired_caps['appPackage']... |
# flake8: noqa
# Convenience imports
from . import user as user_repo
|
import sys
def F1(TP, FP, FN):
if (TP == 0. and (FP == 0. or FN == 0.)):
F = 0.
prec = 0
rec = 0
else:
prec = float(TP) / float(TP+FP)
rec = float(TP) / float(TP + FN)
if (prec == 0 and rec == 0):
F = 0.
else:
F = (2.*prec*rec)/(pr... |
from nltk.corpus import wordnet
# A=['design','thing']
# B=['box','quality']
# cont=0
# cont1 = 0
# for A1 in A:
# for B1 in B:
# wordFromList1 = wordnet.synsets(A1,'n')
# wordFromList2 = wordnet.synsets(B1,'n')
# print 'wordFromList1',wordFromList1
# print 'wordFromL... |
from django.conf.urls import url
from apps.reports.views import package_csv
urlpatterns = [url(regex=r"^package/$", view=package_csv, name="package_csv")]
|
#
# partially ripped from https://github.com/lil-lab/ciff/
from collections import deque
import pdb
import torch
import torch.nn.functional as F
from image_encoder import FinalClassificationLayer
from mlp import MLP
from language import SourceAttention
class BaseUNet(torch.nn.Module):
def __init__(self,
... |
#!/usr/bin/env python
import flask
app = flask.Flask(__name__)
@app.route("/")
def index():
return flask.render_template('manual.html')
def webserver():
server = 'local'
if server == 'local':
print(' * using debug server - localhost only')
app.run(debug=True)
else:
print(' * ... |
import random
feet_in_mile = 5280
meters_in_kilometer = 1000
beatles = ["John Lennon", "Paul McCartney", "George Harrison", "Ringo Star"]
def get_file_ext(filename):
return filename[filename.index(".") + 1:]
def roll_dice(num):
return random.randint(1, num)
|
from .AudioCommon import *
from .DataBlock import *
from .DataAugmentation import *
import mimetypes
from fastai.vision import *
from fastai.text import *
import torchaudio
from torchaudio import transforms
# for jupyter Display
from IPython.display import Audio
class AudioSequenceItem(ItemBase):
def __init__(s... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-22 00:29
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('property_api', '0004_auto_20161121_1928'),
]
operations = [
migrations.Remo... |
import numpy as np
import matplotlib.pyplot as plt
def _lchirp(N, tmin=0, tmax=1, fmin=0, fmax=None):
fmax = fmax if fmax is not None else N / 2
t = np.linspace(tmin, tmax, N, endpoint=True)
a = (fmin - fmax) / (tmin - tmax)
b = (fmin*tmax - fmax*tmin) / (tmax - tmin)
phi = (a/2)*(t**2 ... |
import time
# Base line method (use list)
def find_fib_list(n):
data_list = [0, 1]
if n < len(data_list):
return data_list[n]
while len(data_list) - 1 != n:
data_list.append(data_list[len(data_list) - 2] + data_list[len(data_list) - 1])
return data_list[-1]
# Base line method (us... |
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from pants.backend.scala.subsystems.scala import ScalaSubsystem
from pants.core.goals.repl import ReplImplementation, ReplRequest
from pants.core.util_ru... |
import json
import os
import time
import argparse
import uuid
import subprocess
import sys
import datetime
reload(sys)
sys.setdefaultencoding('utf8')
import yaml
from jinja2 import Environment, FileSystemLoader, Template
import base64
import re
import thread
import threading
import random
import shutil
import textwra... |
#
# PySNMP MIB module FSM7326-QOS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/FSM7326-QOS-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:16:22 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from .deprecation import PDS4ToolsDeprecationWarning
class PDS4StandardsException(Exception):
""" Custom exception thrown when PDS4 Standards are violated. """
... |
# -*- coding: utf-8 -*-
from typing import Optional, List
from pip_services3_commons.data import FilterParams, PagingParams, DataPage
from pip_facades_sample_python.clients.version1.IInvitationsClientV1 import IInvitationsClientV1
from pip_facades_sample_python.clients.version1.InvitationV1 import InvitationV1
cla... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.http import Http404
from rest_framework.response import Response
from rest_framework.views import APIView
from ralph_assets.models_... |
# Dany jest zbiór klocków K = [K1, ..., Kn]. Każdy klocek K[i] opisany jest jako jednostronnie
# domknięty przedział (a[i], b[i]], gdzie a[i], b[i] ∈ N, i ma wysokość 1 (należy założyć, że żadne
# dwa klocki nie zaczynają się w tym samym punkcie, czyli wartości a[i] są parami różne). Klocki
# są zrzucane na oś liczbową... |
__version__ = "1.0.1"
from . import * |
from typing import List
from src.main.serialization.codec.codec import Codec
from src.main.serialization.codec.object.noneCodec import NoneCodec
from src.main.serialization.codec.utils.byteIo import ByteIo
from src.main.serialization.codec.utils.bytes import from_byte, to_byte
class CharArrayCodec(Codec[List[str]]):... |
from motor.motor_asyncio import AsyncIOMotorClient
class MongoDriver:
client: AsyncIOMotorClient = None
db = MongoDriver()
async def get_database() -> AsyncIOMotorClient:
return db.client
|
# Generated by Django 3.0.7 on 2020-06-08 19:58
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='user',
nam... |
import random
def gen_maze(x,y):
maze = []
for n in range(1, x+1):
maze1 = []
for m in range(1, y+1):
maze1.append("0")
maze.append(maze1)
return maze
def logic(maze):
for i in range(1, x+1):
for j in range(1, y+1):
wall = random.randint(0,1)
... |
# -*- coding: utf-8 -*-
from time import mktime
from google.cloud import ndb
import config
class LoveLink(ndb.Model):
"""Models an instance of a Love Link."""
hash_key = ndb.StringProperty()
message = ndb.TextProperty()
recipient_list = ndb.TextProperty()
timestamp = ndb.DateTimeProperty(auto_no... |
import collections
import os
import string
import gensim
import numpy as np
import sklearn.feature_extraction.text
from gensim.models.doc2vec import Doc2Vec
import gensim.downloader as api
import gensim.corpora as corpora
import nlp
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.feature_... |
class Solution:
def longestCommonPrefix(self, strs):
"""
:type strs: List[str]
:rtype: str
"""
if len(strs) == 0:
return ''
elif len(strs) == 1:
return strs[0]
else:
cmn = strs[0]
for i in range(1, len(strs)):... |
# Contains the objects found on our user dashboard.
# Imports -------------------------------------------------------------------------------------------------
from tests.functional_tests.page_objects.common_page_objects import CommonPageObject, PatientNavBar
# Page Objects -----------------------------------------... |
__version__ = "0.1.0"
from allennlp_multi_label.dataset_reader import MultiLabelTextClassificationJsonReader
from allennlp_multi_label.model import MultiLabelClassifier
|
import os
import pprint
import sys
from typing import *
from cognite.client import utils
from cognite.client._version import __api_subversion__
from cognite.client.exceptions import CogniteAPIKeyError
_DEFAULT_API_SUBVERSION = __api_subversion__
class _ThreadLocalConfig:
def __init__(self):
self.api_key... |
```
#!/usr/bin/env python
import gym
import numpy
import time
import cv2
# ROS packages required
import rospy
import rospkg
from openai_ros.openai_ros_common import StartOpenAI_ROS_Environment
rospy.init_node('example_deepsoccer_soccer_qlearn', anonymous=True, log_level=rospy.WARN)
task_and_robot_environment_name = ... |
# Mika "AgenttiX" Mäki & Alpi Tolvanen, 2017
# Strongly based on Tampere University of Technology course FYS-1320 ESIMERKKI_dp.m by Joni Kalliokoski 2014-08-14
# Our work is licensed with the MIT license.
# However, the license of the example code our work is based on is unclear and thereby so is the license
# for tho... |
# Copyright 2021 Huawei Technologies 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
# Copyright 1999-2020 Alibaba Group Holding 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
"""
_FindRecoReleaseDatasets_
Oracle implementation of FindRecoReleaseDatasets
Return a list of datasets in any runs that wait
for PromptReco release.
"""
from WMCore.Database.DBFormatter import DBFormatter
class FindRecoReleaseDatasets(DBFormatter):
def execute(self, conn = None, transaction = False):
... |
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import logging
import pathlib
from typing import List
"""
File Utils provide related functions to work with fi... |
"""
API endpoints for filter options
"""
import logging
from django.utils.translation import ugettext as _
from django.views.generic import View
from braces.views import JSONResponseMixin
from corehq.apps.domain.decorators import LoginAndDomainMixin
from corehq.elastic import es_wrapper, ESError
from dimagi.utils.de... |
#!/usr/bin/env python
# encoding: utf-8
from __future__ import division
import numpy as np
from scipy.interpolate import interp1d
from . import model
__author__ = 'Albert Kottke'
class AbrahamsonSilvaKamai2014(model.Model):
"""Abrahamson, Silva, and Kamai (2014, :cite:`abrahamson14`) model.
This model wa... |
class Orchestrator():
def __init__(self) -> None:
self.state = 'OFF'
self.cpu = '1.5'
self.memory = 1024
def __repr__(self) -> str:
return f'state: {self.state}, cpu: {self.cpu}, memory: {self.memory}'
def __str__(self) -> str:
return 'state: %s, cpu: %s, ... |
"""
Crie um programa onde o usuário possa digitar varios valores e cadastre-os em uma lista.
Caso o numero já exista la dentro, ele não será adicionado. No final serão exibidos todos os valores únicos
digitados em ordem crescente
"""
num = []
cont = ''
valor = 0
while True:
valor = int(input('Digite um valor: '))
... |
from docarray import Document
from jina import Flow
f = Flow().add(uses='executor1/config.yml')
with f:
da = f.post('/', [Document(), Document()])
print(da.texts)
|
"""Support for Buienradar.nl weather service."""
import logging
from buienradar.constants import (
CONDCODE,
CONDITION,
DATETIME,
MAX_TEMP,
MIN_TEMP,
RAIN,
WINDAZIMUTH,
WINDSPEED,
)
import voluptuous as vol
from homeassistant.components.weather import (
ATTR_CONDITION_CLOUDY,
A... |
import numpy as np
from IMLearn.learners.classifiers import Perceptron, LDA, GaussianNaiveBayes
from typing import Tuple
from utils import *
import plotly.graph_objects as go
from plotly.subplots import make_subplots
from math import atan2, pi
def load_dataset(filename: str) -> Tuple[np.ndarray, np.ndarray]:
"""... |
from pywcsgrid2.axes_wcs import GridHelperWcsFloating, AxesWcs
from mpl_toolkits.axisartist.floating_axes import floatingaxes_class_factory
import matplotlib.axes as maxes
_FloatingAxes = floatingaxes_class_factory(AxesWcs)
class FloatingAxes(_FloatingAxes):
def __init__(self, fig, rect, header=None, extremes=No... |
import os
import shutil
import numpy as np
import scipy.ndimage
import cv2
import scipy.interpolate as interp
from skimage.transform import resize
from PIL import Image
from skimage import io
from skimage import img_as_ubyte
from skimage import filters
def main():
in_path = 'dataset/point/'
for path in os.li... |
import argparse
import json
import os
import sys
import warnings
from pathlib import Path
import dill as pkl
import numpy as np
import pandas as pd
from sklearn.exceptions import UndefinedMetricWarning
from sklearn.metrics import f1_score
from aaai20.exp import collect_results, collect_timings
from aaai20.io import (... |
import tvm, inspect, sys, traceback, numpy
from tvm.hybrid import script
from tvm.hybrid.intrin import HYBRID_GLOBALS
@script
def outer_product(n, m, a, b, c):
for i in range(n):
for j in range(m):
c[i, j] = a[i] * b[j]
#Test global function
#Test bridge between frontend and backend
def test_... |
#!/usr/bin/env python3
"""
Author : mal1
Date : 2019-01-31
Purpose: Rock the Casbah
"""
import os
import sys
# Set up main fuction
def main():
args = sys.argv[1:]
if len(args) == 0:
print('Usage: {} FILE [NUM_LINES]'.format(os.path.basename(sys.argv[0])))
exit(1)
if not os.path.isfile... |
# auth: christian bitter
# name: start_template
# desc: the starting template
# vers: 0.5
import pygame
def main():
if not pygame.font:
print("Pygame - fonts not loaded")
if not pygame.mixer:
print("Pygame - audio not loaded")
pygame.init()
w, h, t = 640, 480, "Elisa - <The Name of ... |
from mesh_functions import *
def get_points_full_pincell(r_fuel,
r_ifba,
r_gap,
r_clad,
l_mod,
num_points_fuel,
num_points_ifba,
... |
import RPi.GPIO as gpio
import time
from Motor import Motor
"""
For the Steer Motor and back motor, not the servo motor steering that I added
"""
class TwoMotorDriver:
def __init__(self, backMotor, steerMotor):
self._BM = backMotor
self._SM = steerMotor
def StopAll(self):
'''self._BM.... |
from django.conf.urls import url
from . import views
app_name = 'orders'
urlpatterns = [
url(r'^create/$', views.order_create, name='order_create'),
url(r'^pay/(?P<product_id>\d+)/$', views.charge, name='charge'),
url(r'^email/(?P<product_id>\d+)/$', views.email_one, name='email_one'),
url(r'^emailfiv... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.