filename stringlengths 13 19 | text stringlengths 134 1.04M |
|---|---|
the-stack_106_23053 | """Proyecto_Merka URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cl... |
the-stack_106_23054 | """
The 'cat' Program Implemented in Python 3
The Unix 'cat' utility reads the contents
of file(s) and 'conCATenates' into stdout.
If it is run without any filename(s) given,
then the program reads from standard input,
which means it simply copies stdin to stdout.
It is fairly easy to implement such a progra... |
the-stack_106_23055 | import numpy as np
import itertools as it
from manimlib.imports import *
from old_projects.brachistochrone.curves import \
Cycloid, PathSlidingScene, RANDY_SCALE_FACTOR, TryManyPaths
class Lens(Arc):
CONFIG = {
"radius": 2,
"angle": np.pi/2,
"color": BLUE_B,
}
def __init__(s... |
the-stack_106_23058 | from __future__ import print_function
import sys
from stcrestclient import stchttp
session_name = 'extest'
user_name = 'someuser'
session_id = ' - '.join((session_name, user_name))
def bulkapi_device(stc):
port1 = 'port1'
port2 = 'port2'
isbulkserver = stc.has_bulk_ops()
print('Creating emulateddev... |
the-stack_106_23059 | import numpy as np
import pylab as plt
import matplotlib
from astropy import utils, io
from getpass import getpass
from astropy.visualization import make_lupton_rgb
from pyvo.dal import sia
from frastro import CoordinateParser, ImageUtils
from dl import authClient as ac, queryClient as qc
from dl import storeClient as ... |
the-stack_106_23062 | import unittest
from typing import List
# Your CombinationIterator object will be instantiated and called as such:
# obj = CombinationIterator(characters, combinationLength)
class CombinationIterator:
def __init__(self, characters: str, combinationLength: int) -> None:
self.index = 0
self.comb_lis... |
the-stack_106_23063 | # euler problem 1
sum = 0
for i in range(1000):
if (i%3==0 or i%5==0):
sum = sum + 1
print ("The sum of all multiples of 3 or 5 is equal to" , sum)
# euler problem 2
e0 = 1
e = 2
eTemp = 0
sum = 2
while e < 4000000:
if (e % 2 == 0): sum += e
eTemp = e
e = e + e0
e0 = eTemp
print("The... |
the-stack_106_23064 | import os
import sys
import string
import warnings
import wandb
import torch
import torchvision
from tts.utils import (
Alphabet,
LJSpeechDataset,
set_random_seed,
load_data,
split_data,
)
from config import set_params
from tts.model import tacotron
from tts.train import train
def main():
# se... |
the-stack_106_23067 | """
Parallelization class to handle processing threads and logging.
"""
import numpy as np
import multiprocessing
import logging
import logging.handlers
import os
import glob
logger = logging.getLogger(__name__)
class MultiprocessingJob:
"""
This object initiates the pool for multiprocessing jobs.
P... |
the-stack_106_23068 | from tensorflow.python.ipu import ipu_infeed_queue
from tensorflow.python.ipu import ipu_outfeed_queue
from tensorflow.python.ipu import loops
from tensorflow.python.ipu import ipu_strategy
from tensorflow.python.ipu.config import IPUConfig
import tensorflow as tf
# The dataset for feeding the graphs
ds = tf.data.Data... |
the-stack_106_23071 | # VMware vCloud Director Python SDK
# Copyright (c) 2017-2018 VMware, 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-... |
the-stack_106_23073 | # Copyright (c) 2014 The Bitcoin Core developers
# Copyright (c) 2014-2015 The Dash developers
# Copyright (c) 2015-2017 The PIVX developers
# Copyright (c) 2017 The Defense developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license... |
the-stack_106_23074 | # Copyright 2018 MLBenchmark Group. 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 appl... |
the-stack_106_23075 | """KeypadLinc command handler to trigger a button scene."""
from .. import ack_handler, direct_ack_handler
from ...topics import EXTENDED_TRIGGER_ALL_LINK
from ..to_device.direct_command import DirectCommandHandlerBase
class TriggerSceneOffCommandHandler(DirectCommandHandlerBase):
"""KeypadLinc command handler to... |
the-stack_106_23076 | championship_part = input()
ticket_type = input()
tickets_count = int(input())
trophy_pic = input()
one_ticket_price = 0
if trophy_pic == 'Y':
trophy_pic_price = 40
else:
trophy_pic_price = 0
if championship_part == 'Quarter final':
if ticket_type == 'Standard':
one_ticket_price = 55.50
elif ti... |
the-stack_106_23077 | #!/usr/bin/env python
# Copyright 2016 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All... |
the-stack_106_23078 | import sys
from g_python.gextension import Extension
from g_python.hmessage import Direction
extension_info = {
"title": "Packet Logger",
"description": "g_python test",
"version": "1.0",
"author": "sirjonasxx"
}
ext = Extension(extension_info, sys.argv)
ext.start()
def all_packets(message):
pa... |
the-stack_106_23079 | # 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.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
the-stack_106_23080 | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... |
the-stack_106_23081 | '''
Task 3.
Представлен список чисел. Определить элементы списка, не имеющие повторений.
Сформировать итоговый массив чисел, соответствующих требованию.
Элементы вывести в порядке их следования в исходном списке.
Для выполнения задания обязательно использовать генератор.
Пример исходного списка: [2, 2, 2, 7, 23, 1, 4... |
the-stack_106_23082 | import asyncio
import os
from aiohttp import web
from aiohttp_swagger import *
from subprocess import Popen, PIPE
from .api.admin import AdminApi
from .data.postgres_async_db import AsyncPostgresDB
def app(loop=None):
loop = loop or asyncio.get_event_loop()
app = web.Application(loop=loop)
async_db =... |
the-stack_106_23085 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
import support.kernels as kernel_factory
import torch
class BenchRunner:
def __init__(self, kernel, tensor_size, tensor_initial_device='cpu'):
# tensor_size = (4, 3)
# logger.info('BenchRunner::__in... |
the-stack_106_23088 | """PandasDiscreteMoveDataFrame class."""
from __future__ import annotations
import numpy as np
import pandas as pd
from pandas.core.frame import DataFrame
from pymove.core.grid import Grid
from pymove.core.pandas import PandasMoveDataFrame
from pymove.preprocessing.filters import clean_trajectories_with_few_points
fr... |
the-stack_106_23089 | # Copyright 2015 The TensorFlow Authors. 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 applica... |
the-stack_106_23090 | def cylinder_volume(height,radius):
pi = 3.14
return height * pi * radius**2
volume = cylinder_volume(10,3)
print(volume)
# another
def readable_timedelta(days):
"""Print the number of weeks and days in a number of days."""
#to get the number of weeks we use integer division
weeks = days // 7
... |
the-stack_106_23091 | import time
import os
from torch.autograd import Variable
import torch
import random
import numpy as np
import numpy
import networks
from my_args import args
import cv2
from AverageMeter import *
import shutil
torch.backends.cudnn.benchmark = True # to speed up the
DO_MiddleBurryOther = True
MB_Other_DATA = "./Midd... |
the-stack_106_23093 | import zipfile
from django.forms import ModelForm, Form
from django import forms
from django.utils.translation import ugettext_lazy as _
from .models import Exam, Resource, DiscountPart, RemarkPart, LTIConsumer, EditorLink, EditorLinkProject, ConsumerTimePeriod
from django.core.files import File
from io import Bytes... |
the-stack_106_23094 | #! /usr/bin/python3.4
# -*- coding: utf-8 -*-
#
# bug_reporter.py
#
# Окно для визуализации ошибок запуска приложения.
# Модуль взят и переработан из программы Kivy Designer -
# графическом строителе интерфейсов для фреймворка Kivy.
#
#
# MIT license
#
# Copyright (c) 2010-2015 Kivy Team and other contributors
#
# Perm... |
the-stack_106_23095 | """
This file offers the methods to automatically retrieve the graph Desulfoplanes formicivorans.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--pr... |
the-stack_106_23098 | import pickle, logging, numpy as np
from torch.utils.data import Dataset
import torch
import os
import glob
import random
class PoseDataset(Dataset):
def __init__(self, root,
inputs,
num_frame,
connect_joint,
transform=... |
the-stack_106_23100 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
the-stack_106_23101 | from jumpscale import j
from . import (PRIORITY_NORMAL, PRIORITY_RECURRING, PRIORITY_SYSTEM,
TASK_STATE_ERROR, TASK_STATE_NEW, TASK_STATE_OK,
TASK_STATE_RUNNING)
from .task import Task
from zerorobot.errors import Eco
def _instantiate_task(task, service):
func = getattr(service, tas... |
the-stack_106_23102 | import numpy
import logger
class MovingAverage:
'''''
def __init__(self):
#self.SMA = None
#self.EMA = None
'''''
def get_SMA(self, price, period, SMA, slow_to_fast_sma):
length = len(price)
index = 0
for interval in period:
n = lengt... |
the-stack_106_23103 | import shutil
import sqlite3
from datetime import datetime
from os import listdir
import os
import csv
from application_logging.logger import App_Logger
class dBOperation:
"""
This class shall be used for handling all the SQL operations.
Written By: iNeuron Intelligence
Version: 1... |
the-stack_106_23105 | import os
import subprocess
import copy
from troncli import utils
from troncli.constants import *
class Worker:
"""handler for manage multiple nodes in multiple processes"""
def __init__(self):
self.root_path = os.getcwd()
self.processes = {}
self.node_list = utils.Node()
async ... |
the-stack_106_23106 | import base64
import logging
# Import the email modules we'll need
import mimetypes
import os
import os.path
import pickle
from email.mime.audio import MIMEAudio
from email.mime.base import MIMEBase
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text imp... |
the-stack_106_23108 | import time
import pkg_resources
# anchore modules
import anchore_engine.common
import anchore_engine.subsys.metrics
import anchore_engine.subsys.servicestatus
import anchore_engine.subsys.simplequeue
from anchore_engine.service import ApiService, LifeCycleStages
from anchore_engine.subsys import logger
# A regular ... |
the-stack_106_23109 | import json
from transformers import *
import torch
import torch.nn.functional as F
import numpy as np
from model import MemeDialoGPT
from dataset import get_data, build_input_from_segments
import copy
import os
from tqdm import tqdm
# from train import input_construct
SPECIAL_TOKENS = ['[BOS]', '[EOS]', '[speaker1]'... |
the-stack_106_23110 | from concurrent.futures import ThreadPoolExecutor
import warnings
from metatools.deprecate import FunctionRenamedWarning
from sgfs import SGFS
GENERIC_FIELDS = (
'sg_link',
'sg_link.Task.entity',
'project',
'created_by',
)
SPECIFIC_FIELDS = (
'code',
'sg_version',
'description',
'sg... |
the-stack_106_23111 | import os
from bento.core.utils \
import \
resolve_glob
from bento.core.pkg_objects \
import \
Extension, CompiledLibrary
class SubPackageDescription:
def __init__(self, rdir, packages=None, extensions=None,
compiled_libraries=None, py_modules=None, hook_files=None):
... |
the-stack_106_23112 | # Built-in libraries.
import csv
import os
# Django core imports.
from django.core.management.base import BaseCommand
from django.db import IntegrityError
# Django app imports.
from api_root.models import (UserRatings)
class Command(BaseCommand):
help = 'Reads movie lens user ratings and saves them to the databas... |
the-stack_106_23115 | from setuptools import setup
with open('README.md', 'r') as f:
long_description = f.read()
setup(
name='cxnstr',
version='1.1.4',
author="Joe Boyd",
author_email="josefuboyd@gmail.com",
description="Parse database connection strings",
long_description=long_description,
long_descriptio... |
the-stack_106_23116 | '''
Main app runner.
Copyright 2020, Voxel51, Inc.
voxel51.com
'''
from flask import Flask
import pandemic51.config as panc
import pandemic51.core.api as pana
app = Flask(__name__)
@app.route("/snapshots")
def snapshots():
'''Serves snapshots for all cities.
Returns:
{
"data": {
... |
the-stack_106_23117 | from type4py.data_loaders import select_data, TripletDataset, load_training_data_per_model
from type4py.vectorize import AVAILABLE_TYPES_NUMBER, W2V_VEC_LENGTH
from type4py.eval import eval_type_embed
from type4py.utils import load_json
from type4py import logger, MIN_DATA_POINTS, KNN_TREE_SIZE
from torch.utils.data im... |
the-stack_106_23119 | from __future__ import print_function
import pickle
import os.path as path
import sklearn.utils
def dump_list(input_list, file_path):
"""
Dump list to file, either in "txt" or binary ("pickle") mode.
Dump mode is chosen accordingly to "file_path" extension.
Parameters
----------
input_lis... |
the-stack_106_23121 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
qm9.py:
Usage:
"""
# Networkx should be imported before torch
import networkx as nx
import torch.utils.data as data
import numpy as np
import argparse
import datasets.utils as utils
import time
import os,sys
import torch
reader_folder = os.path.realpath( os.path.absp... |
the-stack_106_23122 | from random import shuffle
from itertools import islice
import time
INF = float('inf')
RRT_ITERATIONS = 20
RRT_RESTARTS = 2
RRT_SMOOTHING = 20
# INCR_RRT_RESTARTS = 10
INCR_RRT_ITERATIONS = 30
def irange(start, stop=None, step=1): # np.arange
if stop is None:
stop = start
start = 0
while s... |
the-stack_106_23124 | #!/usr/bin/env python
from threading import Lock
import rospy
from hopper_msgs.msg import ServoTelemetry, HexapodTelemetry
from hopper_controller.msg import HexapodMotorPositions, LegMotorPositions, MotorCompliance, MotorSpeed, MotorTorque
from hopper_controller.srv import ReadHexapodMotorPositions, ReadHexapodMotorP... |
the-stack_106_23125 | # Copyright 2020, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... |
the-stack_106_23128 | from database.db import db_connection
import models.user_sql_queries as sql_queries
from models.user_model import User
def db_query(sql, data=None):
with db_connection:
db_cursor = db_connection.cursor()
db_cursor.execute(sql, data)
db_connection.commit()
return db_cursor
def fet... |
the-stack_106_23129 | """
This file offers the methods to automatically retrieve the graph Rhodococcus tukisamuensis.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--prot... |
the-stack_106_23130 | import django_filters
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
from django.forms import DateField, IntegerField, NullBooleanField
from nautobot.dcim.models import DeviceRole, DeviceType, Platform, Region, Site
from nautobot... |
the-stack_106_23131 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (C) 2018 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required b... |
the-stack_106_23132 | # coding: utf-8
from __future__ import unicode_literals
import base64
import datetime
import hashlib
import json
import netrc
import os
import random
import re
import socket
import sys
import time
import math
from ..compat import (
compat_cookiejar,
compat_cookies,
compat_etree_Element,
compat_etree_f... |
the-stack_106_23135 | import json
import sys
import time
from flask import render_template
from rq import get_current_job
from app import create_app, db
from app.models import User, Post, Task
from app.email import send_email
app = create_app()
app.app_context().push()
def _set_task_progress(progress):
job = get_current_job()
if ... |
the-stack_106_23139 | #!/usr/bin/env/python3
import socket
import _thread
import os
os.system('')
def main():
host = '127.0.0.1'
port = 5555
for x in range(70):
print('')
try:
file = open('config.txt', 'r+')
write = False
except:
file = open('config.txt', 'w')
write = True
... |
the-stack_106_23141 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Seek performance testing for <video>.
Calculates the short and long seek times for different video formats on
different network... |
the-stack_106_23142 | import numpy as np
from .element import Element
from .discrete_field import DiscreteField
class ElementH1(Element):
"""A global element defined through identity mapping."""
def gbasis(self, mapping, X, i, tind=None):
phi, dphi = self.lbasis(X, i)
invDF = mapping.invDF(X, tind)
if len... |
the-stack_106_23143 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... |
the-stack_106_23144 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Entry point for the ArdublocklyServer application.
Copyright (c) 2017 carlosperate https://github.com/carlosperate/
Licensed under the Apache License, Version 2.0 (the "License"):
http://www.apache.org/licenses/LICENSE-2.0
"""
from __future__ import unicode_... |
the-stack_106_23146 | # Specify the path caffe here
caffe_path = "../../caffe_gt"
# Specify wether or not to compile caffe
library_compile = True
# Specify the device to use
device_id = 2
# Specify the solver file
solver_proto = "net/solver.prototxt"
# Specify values for testing
test_net = "net/net_test.prototxt"
trained_model = "net_ite... |
the-stack_106_23150 | import sys
import os
import time
from resources.quizzes.quiz_format import Quiz
from resources.validation import Validation
from fileinput import close
def start_quiz(quiz):
os.system('cls')
Quizz = Quiz(quiz, Validation.current_username) #this defines that the "Quiz" is using the "Quiz()" class from quiz_for... |
the-stack_106_23152 | '''
GreenCoin base58 encoding and decoding.
Based on https://greencointalk.org/index.php?topic=1026.0 (public domain)
'''
import hashlib
# for compatibility with following code...
class SHA256:
new = hashlib.sha256
if str != bytes:
# Python 3.x
def ord(c):
return c
def chr(n):
return ... |
the-stack_106_23153 | import json
import os
import shutil
import tempfile
import numpy as np
import pandas as pd
import fiona
from shapely.geometry import Point
import geopandas
from geopandas import GeoDataFrame, GeoSeries, read_file
from geopandas.array import GeometryArray, GeometryDtype
from geopandas.testing import assert_geodatafr... |
the-stack_106_23155 | from abc import ABCMeta, abstractmethod
from pubnub import utils
from pubnub.enums import PNStatusCategory, PNOperationType
from pubnub.errors import PNERR_SUBSCRIBE_KEY_MISSING, PNERR_PUBLISH_KEY_MISSING, PNERR_CHANNEL_OR_GROUP_MISSING, \
PNERR_SECRET_KEY_MISSING, PNERR_CHANNEL_MISSING
from pubnub.exceptions impo... |
the-stack_106_23157 | import os
import rospkg
import rospy
import yaml
from python_qt_binding import loadUi
from python_qt_binding.QtWidgets import QPushButton, QWidget
from qt_gui.plugin import Plugin
from simulation_groundtruth.msg import GroundtruthStatus
from std_msgs.msg import Empty as EmptyMsg
class SimulationRendererPlugin(Plugin... |
the-stack_106_23160 | import os
import re
import socket
import time
from netmiko.cisco_base_connection import CiscoSSHConnection
from netmiko.cisco_base_connection import CiscoFileTransfer
from netmiko.ssh_exception import NetmikoTimeoutException
LINUX_PROMPT_PRI = os.getenv("NETMIKO_LINUX_PROMPT_PRI", "$")
LINUX_PROMPT_ALT = os.getenv("N... |
the-stack_106_23161 | from .util import *
from .query_result import QueryResult
class Graph(object):
"""
Graph, collection of nodes and edges.
"""
def __init__(self, name, redis_con):
"""
Create a new graph.
"""
self.name = name
self.redis_con = redis_con
self.nodes = {}
... |
the-stack_106_23162 | from flask import Flask, request, jsonify
app = Flask(__name__)
request_store = []
@app.route("/api/action/task_status_update_many", methods=['GET', 'POST'])
def task_status_update_many():
request_store.append({
"data": request.json,
"headers": dict(request.headers)
})
return 'ok'
@app.ro... |
the-stack_106_23164 | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
the-stack_106_23165 | # -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import logging
from fvcore.common.config import CfgNode as _CfgNode
from fvcore.common.file_io import PathManager
class CfgNode(_CfgNode):
"""
The same as `fvcore.common.config.CfgNode`, but different in:
1. U... |
the-stack_106_23166 | from error import error
import optimizar as opt
errores = list()
reservadas = {
'smallint' : 'SMALLINT',
'integer' : 'INTEGER',
'int' : 'INT',
'bigint' : 'BIGINT',
'decimal' : 'DECIMAL',
'numeric' : 'NUMERIC',
'real' : 'REAL',
'double' : 'DOUBLE',
'precision' : "PRECISION",
'mo... |
the-stack_106_23167 | from tests.system.action.base import BaseActionTestCase
class PollDeleteTest(BaseActionTestCase):
def test_delete_correct(self) -> None:
self.create_model("poll/111")
response = self.request("poll.delete", {"id": 111})
self.assert_status_code(response, 200)
self.assert_model_delete... |
the-stack_106_23168 | """
@package mi.instrument.sunburst.sami2_ph.ooicore.test.test_driver
@file marine-integrations/mi/instrument/sunburst/sami2_ph/ooicore/driver.py
@author Kevin Stiemke
@brief Test cases for ooicore driver
USAGE:
Make tests verbose and provide stdout
* From the IDK
$ bin/test_driver
$ bin/test_driver ... |
the-stack_106_23169 | print('=-'*20)
print('BOLETIM ESCOLAR')
print('=-'*20)
listacompleta = []
listaalunos = []
cont = 0
while True:
listaalunos.append(str(input('Nome do aluno: ')).upper().strip())
listaalunos.append(float(input('Digite a 1º nota: ')))
listaalunos.append(float(input('Digite a 2º nota: ')))
listacompleta.a... |
the-stack_106_23171 | #!/usr/bin/python3
import tkinter as tk
import tkinter.filedialog as filedialog
from tkinter import ttk
from collections import deque
from multiprocessing import Process, Queue, freeze_support
from threading import Thread
#from tqdm import tqdm
import os
import signal
multi_queue = Queue()
DELAY_PROGRESS = 50
DELAY_C... |
the-stack_106_23175 | #!/usr/bin/env python3
"""
Facet build script wrapping conda-build, and exposing matrix
dependency definition of pyproject.toml as environment variables
"""
import importlib
import importlib.util
import itertools
import os
import re
import shutil
import subprocess
import sys
import warnings
from abc import ABCMeta, abs... |
the-stack_106_23176 | # -*- coding: utf-8 -*-
from hearthstone.entities import Entity
from entity.spell_entity import SpellEntity
class LETL_005P3(SpellEntity):
"""
陨石术5
对一个角色造成$25点伤害,并对其相邻角色造成$10点伤害。
"""
def __init__(self, entity: Entity):
super().__init__(entity)
self.damage = 25
sel... |
the-stack_106_23177 | ########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. 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... |
the-stack_106_23179 | import copy
from .parser import stmt
from .field_group import FieldGroup
def parse_file(
filename:str,
normalize_occurs=True,
normalize_duplicate_field_names=True,
calculate_positions=True
) -> FieldGroup:
result:FieldGroup = stmt.parseFile(filename,parseAll=True)
# rearrange in a tree structure... |
the-stack_106_23181 | # Copyright (c) 2014, Yuta Okamoto <okapies@gmail.com>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty, Tags
from .validators import boolean, integer, mutually_exclusive
class Source(AWSProperty):
props = {
'Password': (basestring, False),
'Revis... |
the-stack_106_23185 | #!/usr/bin/python
'''
(C) Copyright 2020-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
import os
from nvme_utils import ServerFillUp
from dmg_utils import DmgCommand
from command_utils_base import CommandFailure
class NvmeFault(ServerFillUp):
# pylint: disable=too-many-ancestors
... |
the-stack_106_23186 | #!/opt/bin/lv_micropython -i
import time
import lvgl as lv
import display_driver
def event_cb(e,label):
code = e.get_code()
if code == lv.EVENT.PRESSED:
label.set_text("The last button event:\nLV_EVENT_PRESSED")
elif code == lv.EVENT.CLICKED:
label.set_text("The last button event:\nLV_EVENT... |
the-stack_106_23187 | import os
import pathlib
import tensorflow as tf
from shenanigan.utils.data_helpers import (
check_for_xrays,
create_image_caption_tfrecords,
create_image_tabular_tfrecords,
download_dataset,
get_record_paths,
)
DATASETS_DICT = {
"birds-with-text": "BirdsWithWordsDataset",
"flowers-with-te... |
the-stack_106_23189 | import os
import pytest
from minos import genotyper
this_dir = os.path.dirname(os.path.abspath(__file__))
data_dir = os.path.join(this_dir, "data", "genotyper")
def test_init():
"""test init"""
gtyper = genotyper.Genotyper(0, 20, 0.0001)
assert gtyper.min_cov_more_than_error == 0
assert gtyper.no_of... |
the-stack_106_23191 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Olivier Boukili <boukili.olivier@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version':... |
the-stack_106_23192 | '''
Configuration of network interfaces.
====================================
The network module is used to create and manage network settings,
interfaces can be set as either managed or ignored. By default
all interfaces are ignored unless specified.
Please note that only Redhat-style networking is currently
support... |
the-stack_106_23196 | """External dependencies for grpc-java."""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external")
def grpc_java_repositories(
omit_bazel_skylib = False,
omit_com_google_android_annotations = False,
o... |
the-stack_106_23197 | # Copyright 2019 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 agreed to... |
the-stack_106_23198 | # -*- coding: utf-8 -*-
"""
Configuration of network interfaces
===================================
The network module is used to create and manage network settings,
interfaces can be set as either managed or ignored. By default
all interfaces are ignored unless specified.
.. note::
RedHat-based systems (RHEL, C... |
the-stack_106_23199 | import time
import logging
from subprocess import Popen
from utils.run import run, RunError
from utils.strings import quote
from .base import Device
def _split_addr(addr):
comps = addr.split(":")
if len(comps) == 2:
return comps
elif len(comps) == 1:
return addr, "22"
else:
rais... |
the-stack_106_23200 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
the-stack_106_23202 | from __future__ import absolute_import
# import statements
import numpy as np
import matplotlib.pyplot as plt #for figures
from mpl_toolkits.basemap import Basemap #to render maps
import math
import GrowYourIC
from GrowYourIC import positions
from GrowYourIC import geodyn, geodyn_trg, geodyn_static
from GrowYourIC i... |
the-stack_106_23203 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import warnings
import numpy as np
import pandas as pd
import lightgbm as lgb
from ...model.base import ModelFT
from ...data.dataset import DatasetH
from ...data.dataset.handler import DataHandlerLP
from ...model.interpret.base import LightGBMFI... |
the-stack_106_23204 | import sys
import numpy as np
import collections
import torch
from configs import g_conf
from logger import coil_logger
from coilutils.general import softmax
from .coil_sampler import PreSplittedSampler, RandomSampler
def order_sequence(steerings, keys_sequence):
sequence_average = []
for i in keys_sequen... |
the-stack_106_23206 | """
feathers.py
Smoothly scroll mirrored rainbow colored random curves across the display.
"""
import random
import math
import utime
from machine import Pin, SoftSPI
import st7789py as st7789
def between(left, right, along):
"""returns a point along the curve from left to right"""
dist = (1 - math.cos... |
the-stack_106_23207 | import json
from os import makedirs, path
import requests
from Bio.PDB import parse_pdb_header
from py3pdb.utils import error
from py3pdb.download import download_pdb
def protein_sequence_search(aa_sequence, evalue_cutoff=1, identity_cutoff=1):
page = """https://search.rcsb.org/rcsbsearch/v1/query?json=
... |
the-stack_106_23209 | #!/usr/bin/env python
#ckwg +28
# Copyright 2011-2013 by Kitware, Inc.
# 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 copyright notice,... |
the-stack_106_23210 | import pytest
from test.cl_node.casperlabs_accounts import Account
from test.cl_node.common import HELLO_NAME_CONTRACT, PAYMENT_CONTRACT, MAX_PAYMENT_ABI
def test_non_account_precondition_failure(trillion_payment_node_network):
node = trillion_payment_node_network.docker_nodes[0]
# Getting a non-existent ac... |
the-stack_106_23211 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
import threading
from datetime import datetime
from math import floor
from pathlib import Path
import numpy as np
import pandas as pd
import yaml
class DumpConverter:
""" This class is used for convert binary snapshot dump conte... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.