content stringlengths 0 1.05M | origin stringclasses 2
values | type stringclasses 2
values |
|---|---|---|
import lit.formats
from lit.llvm import llvm_config
config.name = 'Nacro'
config.test_format = lit.formats.ShTest(True)
config.suffixes = ['.c', '.cpp', '.cc']
config.excludes = ['CMakeLists.txt']
config.test_source_root = os.path.dirname(__file__)
config.test_exec_root = os.path.join(config.nacro_obj_root, 'test')... | nilq/baby-python | python |
import requests
from dhooks import Webhook
def banner():
print("""
Fuck Off Loggers
Input Webhook URL
""")
def deleter():
start = input(">")
hook = Webhook(start)
hook.send("Stop logging shit whore")
x = requests.delete(start)
banner()
deleter()
# Simple shit can be used for anything... | nilq/baby-python | python |
#!/usr/bin/env python3
'''
This script reads program files and concatenates the beginning of
all files to create a input prompt which is then fed to OpenAI
Codex to generate a README.
'''
import sys
# Check if the openai module is installed.
try:
import openai
except ImportError:
print('openai module not foun... | nilq/baby-python | python |
"""
Connects to a given SP3 instance and sends the given packets.
"""
import argparse
import asyncio
import binascii as bi
import colors
import json
import netifaces
import time
from scapy.all import IP, TCP, Raw
import websockets
def get_packets(public_ip, victim_ip, protocol, sport):
"""
Returns a list of ... | nilq/baby-python | python |
from .psg_extractors import extract_psg_data
from .hyp_extractors import extract_hyp_data
from .header_extractors import extract_header
| nilq/baby-python | python |
from flask import Flask
app = Flask(__name__)
app.config['DEBUG'] = True
# Note: We don't need to call run() since our application is embedded within
# the App Engine WSGI application server.
import sys
sys.path.insert(0, 'lib')
import json
import urllib, urllib2
import httplib
import time
from BeautifulSoup import ... | nilq/baby-python | python |
from flask import Flask
def create_app(**config_overrides):
app = Flask(__name__)
# Load default config then apply overrides
app.config.from_object('config.config')
app.config.update(config_overrides)
app.url_map.strict_slashes = False
from .views import views
app.register_blueprint(vie... | nilq/baby-python | python |
#******************************************************************************************
# Copyright (c) 2019 Hitachi, Ltd.
# All rights reserved. This program and the accompanying materials are made available under
# the terms of the MIT License which accompanies this distribution, and is available at
# https://ope... | nilq/baby-python | python |
from typing import List
class Solution:
@staticmethod
def two_sum(nums: List[int], target: int) -> List[int]:
for i in range(len(nums)):
for j in range(1, len(nums)):
if (nums[i] + nums[j]) == target:
return [i, j]
if __name__ == '__main__':
twoSum... | nilq/baby-python | python |
#!/usr/bin/env python3
import os
import pathlib
import re
import ssl
import time
from enum import Enum
from typing import Dict, Optional
import mutagen
import mutagen.easyid3
import requests
import requests.exceptions
from podcastdownloader.exceptions import EpisodeException
class Status(Enum):
blank = 0
p... | nilq/baby-python | python |
#!/usr/bin/python3
import argparse
import csv
import os
import re
import sqlite3
from sqlite3 import Error
#import sys
DB_FOLDER = "database"
DB_FILE = "boxiot.db"
DB_SCHEMA = "schema.sql"
CSV_FOLDER = "database/csv"
CSV_ACTIONS = "actions.csv"
CSV_COMBINATIONS = "combinations.csv"
# DB_TABLE_ACTION_TYPES = "ActionTy... | nilq/baby-python | python |
from django.test import TestCase
from recipe import models
class ModelTests(TestCase):
def test_recipe_str(self):
"""Test that the string representation of recipe is correct"""
recipe = models.Recipe.objects.create(
name='Test Recipe',
description='A recipe used for tests... | nilq/baby-python | python |
from AzureRiskyUsers import Client
import json
BASE_URL = 'https://graph.microsoft.com/v1.0/'
ACCESS_TOKEN_REQUEST_URL = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token'
def load_mock_response(file_name: str) -> dict:
"""
Load one of the mock responses to be used for assertion.
Args:
... | nilq/baby-python | python |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from .operations import mesh_split_face
__all__ = [
'mesh_quads_to_triangles',
]
def mesh_quads_to_triangles(mesh, check_angles=False):
"""Convert all quadrilateral faces of a mesh to triangles by ... | nilq/baby-python | python |
from .rpg_object import RPGObject
class Class(RPGObject):
config_filename = "classes.yaml"
| nilq/baby-python | python |
from unittest import TestCase
from dragonfly.template.template import Converter
import importlib
class TestTemplate(TestCase):
def test_convert(self):
res = Converter('test.html').convert()
def test_erroneous_if(self):
res = Converter('if_error.html').convert()
with open('if_error.p... | nilq/baby-python | python |
from checkio.electronic_station.roman_numerals import checkio
def test_checkio():
assert checkio(6) == "VI", "6"
assert checkio(76) == "LXXVI", "76"
assert checkio(499) == "CDXCIX", "499"
assert checkio(3888) == "MMMDCCCLXXXVIII", "3888"
def test_checkio_extra_all_small():
assert checkio(1) == "... | nilq/baby-python | python |
# Copyright (c) 2016-2019 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
import logging
from ...listener import EventListener
logger = lo... | nilq/baby-python | python |
#!/usr/bin/python3
def magic_string(repit=[-1]):
repit[0] += 1
return "Holberton, " * repit[0] + "Holberton"
| nilq/baby-python | python |
def flip_word(s, start, end):
l = (end - start) // 2
for i in range(l):
s[start + i], s[end - i - 1] = s[end - i - 1], s[start + i]
def solution(s):
l = len(s)
for i in range(len(s) // 2):
s[i], s[l - 1 - i] = s[l - 1 - i], s[i]
start = 0
for i in range(len(s) + 1):
if... | nilq/baby-python | python |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The Project U-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
""" Database files available for a tile ty... | nilq/baby-python | python |
"""
Vishnu... Thank you for electronics.
Author: Manas Kumar Mishra
Task:- D(3) D--> Decimal number system.
"""
"""
Task :Apply the optical flow algorithm with shi-tumasi to define the motion path and
print that is there any change in the person or image is is motion or not.
"""
"""
Theory:-
Optical flow t... | nilq/baby-python | python |
import os
import yaml
import shlex
import re
def get_gputree_config():
"""Fetch host config from gputree configuration file if found.
Returns:
dict: The configuration dictionnary.
"""
if os.environ.get("GPUTREE_CONFIG_FILE"):
config_path = os.environ["GPUTREE_CONFIG_FILE"]
elif o... | nilq/baby-python | python |
from django.shortcuts import render
from httptest2.testmodule import tasks
from httptest2.testmodule.forms import TestModuleForm, DisplayModuleForm
import time
import json
# Create your views here.
def display_all(request):
if request.method == 'POST':
form = DisplayModuleForm(request.POST)
if form... | nilq/baby-python | python |
import pytest
@pytest.fixture(autouse=True)
def xray(mocker):
"""
Disables AWS X-Ray
"""
mocker.patch('aws_xray_sdk.core.xray_recorder')
mocker.patch('aws_xray_sdk.core.patch_all')
@pytest.fixture(autouse=True)
def mock_boto3_client(mocker):
"""
Patches Boto3
"""
mocker.patch('bo... | nilq/baby-python | python |
import essentia
import numpy as np
from essentia.standard import *
import os
import re
class FeatureExtractor():
def __init__(self, train_folders=None, test_folders=None):
self.train_path = os.environ['IRMAS_TRAIN']
self.test_path = os.environ['IRMAS_TEST']
self.train_folders = train_... | nilq/baby-python | python |
# DRUNKWATER TEMPLATE(add description and prototypes)
# Question Title and Description on leetcode.com
# Function Declaration and Function Prototypes on leetcode.com
#407. Trapping Rain Water II
#Given an m x n matrix of positive integers representing the height of each unit cell in a 2D elevation map, compute the volu... | nilq/baby-python | python |
"""
Track Atmosphere transactions across our system.
"""
from django.db import models
from uuid import uuid1
from django.utils import timezone
class T(models.Model):
"""
Track Atmosphere transactions across our system.
"""
# A unique UUID (V)alue for the transaction.
V = models.CharField(max_len... | nilq/baby-python | python |
from collections import deque
N, Q = map(int, input().split())
city = [[] for _ in range(N + 1)]
for i in range(N - 1):
a, b = map(int, input().split())
city[a].append(b)
city[b].append(a)
n_city = [-1] * (N + 1)
q = deque([])
q.append(1)
n_city[1] = 0
while q:
x = q.pop()
p = n_city[x]
for i i... | nilq/baby-python | python |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
"""driver drowsiness detection
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1Yjex8oAKte4yIZu91YXjJLsZLlR7pa0y
"""
from keras.models import Sequential
from keras.layers import MaxPool2D,Dropout,BatchNormalization,Dense,Conv2D,... | nilq/baby-python | python |
# Construtores
'''
class carro:
def __init__(self,portas,preço,):
self.numero_portas = portas
self.preço = preço
print("Objeto instanciado com sucesso")
def get_numero_portas(self):
return self.numero_portas
carro1 = carro(6,50000,)
portas_carro1 = carro1.get_numero_portas()
pr... | nilq/baby-python | python |
import torch
import torch.nn as nn
from torch.nn import init
import torch.nn.functional as F
from library.text.modules.base.rnn import lstm_encoder
INI = 1e-2
class ConvSentEncoder(nn.Module):
"""
Convolutional word-level sentence encoder
w/ max-over-time pooling, [3, 4, 5] kernel sizes, ReLU activation
... | nilq/baby-python | python |
from django.contrib import admin
from django.contrib import messages
from django.utils.translation import ngettext
from .models import Category, Product
# Register your models here.
@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
list_display = ('name', 'slug')
prepopulated_fields = {'slug':... | nilq/baby-python | python |
#
# Copyright (c) 2021 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 by applicable law or agreed to... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
from odoo import models, fields, api, exceptions
class LibraryBook(models.Model):
_name = "library.book"
name = fields.Char(string="Name")
active = fields.Boolean("Is active", default=True)
image = fields.Binary()
pages = fields.Integer(string="# Pages")
isbn = fields... | nilq/baby-python | python |
# Copyright 2010 Chet Luther <chet.luther@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | nilq/baby-python | python |
import frappe
import json
import frappe.utils
from frappe import _
from frappe.model.naming import make_autoname
import frappe.defaults
import phonenumbers
from frappe.utils import encode
# from erpnext.selling.doctype.customer.customer import get_customer_outstanding
@frappe.whitelist(allow_guest=True)
def get_custom... | nilq/baby-python | python |
from PyQt5 import QtGui,QtWidgets,QtCore
from PyQt5.QtWidgets import QApplication,QRadioButton,QPushButton,QListWidget,QDial,QSpinBox,QLCDNumber,QMessageBox,QLabel
from PyQt5.QtGui import QPixmap
import sys
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
import numpy as np
from matplotlib.ba... | nilq/baby-python | python |
#!/usr/bin/env python3
import csv
import os
import re
from glob import glob
from unittest import TestCase, main
from g2p.app import APP
from g2p.cli import convert, doctor, generate_mapping, scan, update
from g2p.log import LOGGER
from g2p.tests.public.data import __file__ as data_dir
class CliTest(TestCase):
"... | nilq/baby-python | python |
from cli import banner, list_files, menu, device_monitor
from cli import access
import os
def main():
os.system('clear')
print("\n")
banner.display()
print("\n")
###
device_monitor.display()
print("\n")
# password check
# password_check = access.password_check()
# if password_ch... | nilq/baby-python | python |
time=[]
while True:
gols = []
dic={}
dic['nome']=input('nome do jogador: ')
dic['jogos']=int(input(f'numero de partidas de {dic["nome"]}: '))
for l in range(0,dic['jogos']):
gols.append(int(input(f'quantos gols na partida {l+1}: ')))
dic['gols']=gols[:]
dic['total']=sum(gols)
tim... | nilq/baby-python | python |
from torch.nn.modules.loss import _Loss
__all__ = ['JointLoss', 'WeightedLoss']
class WeightedLoss(_Loss):
"""Wrapper class around loss function that applies weighted with fixed factor.
This class helps to balance multiple losses if they have different scales
"""
def __init__(self, loss, weight=1.0)... | nilq/baby-python | python |
import os
import hashlib
from urllib.parse import parse_qs #系统的查询参数解析方法
import jinja2
from DBHelper import DBHelper
from Response import *
# 处理模块
# 读取文件
def load_file(fileName):
try:
with open(fileName, 'rb') as fp:
return fp.read() # 文件存在
except Exception as e:
return b"File n... | nilq/baby-python | python |
from repl import start
def main() -> None:
print("Hello! This is the Monkey programming language!")
print("Feel free to type in commands")
start()
if __name__ == "__main__":
main()
| nilq/baby-python | python |
"""
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | nilq/baby-python | python |
from tests.package.test_perl import TestPerlBase
class TestPerlDBDmysql(TestPerlBase):
"""
package:
DBD-mysql XS
direct dependencies:
DBI XS
"""
config = TestPerlBase.config + \
"""
BR2_PACKAGE_PERL=y
BR2_PACKAGE_PERL_DBD_MYSQL=y
"""
def te... | nilq/baby-python | python |
MIXNODE_CONFIG = {
'api_key': 'your api key' # available at https://www.mixnode.com/account/api
};
| nilq/baby-python | python |
from rest_framework import serializers
# from rest_framework_recursive.fields import RecursiveField
from . import models
class TagSerializer(serializers.ModelSerializer):
class Meta:
model = models.Tag
fields = ('title', )
class ExperienceSerializer(serializers.ModelSerializer):
user = seri... | nilq/baby-python | python |
import csv
from urllib.request import Request, urlopen
import urllib.error
import dateutil.parser
import re
from os import system
from sys import argv
from bs4 import BeautifulSoup
import scrape_util
default_sale, base_url, prefix = scrape_util.get_market(argv)
temp_raw = scrape_util.ReportRaw(argv, prefix)
#report_... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-07 13:59
from __future__ import unicode_literals
from django.db import migrations, models
import sendinblue.forms
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailembeds.blocks
import wagtail.wagtailimages.blocks
... | nilq/baby-python | python |
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import pdb
def init_weights(m):
if isinstance(m, nn.Conv2d):
torch.nn.init.xavier_uniform_(m.weight)
m.bias.data.fill_(0.01)
class UNet(nn.Module):
def __init__(self, init_weights=True):
... | nilq/baby-python | python |
from .. import ssl
from . import base
class LocalCa(base.CaManager):
"""Class implementing a certificate authority based on a private key retrieved from CA storage
"""
def __init__(
self,
ca_config,
staging=True,
storage_api=None,
ca_private_key=... | nilq/baby-python | python |
from autode.transition_states.ts_guess import TSguess
from autode.transition_states.transition_state import TransitionState
__all__ = ['TSguess',
'TransitionState']
| nilq/baby-python | python |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
# Copyright 2020 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.... | nilq/baby-python | python |
from .c_distribution_gaussian import CDistributionGaussian
from .c_density_estimation import CDensityEstimation
| nilq/baby-python | python |
#!/usr/bin/env python
import json
import sys
# http://docs.python.org/2/library/urlparse.html
from urlparse import urlparse
if len(sys.argv) < 2:
print "Usage:", sys.argv[0], "<file.json>"
raise SystemExit
data = open(sys.argv[1]).read()
har = json.loads(data)
domain_map = {}
for e in har['log']['entries']:
ur... | nilq/baby-python | python |
"""Audio Overlay Tool
Usage:
aot.py <input_dir> <output_dir> <num_generate> <samples_per_sample> [options]
Options:
-f RGX --filter=RGX a filter for selecting the input files from the input directory.
-o FMT --outfmt=FMT Output format of the files (file a information in {a+cg} file b inform... | nilq/baby-python | python |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | nilq/baby-python | python |
# Copyright 2015 PerfKitBenchmarker 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 appli... | nilq/baby-python | python |
import unittest
from http import HTTPStatus
from test.flask_test_app import create_app
class TestRequestArg(unittest.TestCase):
def assertInHTML(self, value, response):
HTML_text = response.data.decode("utf-8")
self.assertIn(value, HTML_text)
def setUp(self) -> None:
_app = create_ap... | nilq/baby-python | python |
#%%
## command-line arguments
import argparse
parser = argparse.ArgumentParser(description="Runner script that can take command-line arguments")
parser.add_argument("-i", "--input", help="Path to a FASTA file. Required.", required=True)
parser.add_argument("-o", "--output_dir", default="", type=str,
... | nilq/baby-python | python |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="migeo", # Replace with your own username
version="v0.0.1",
author="Projeto EM UFPA/Petrobrás",
author_email="isadora.s.macedo@gmail.com",
description="Modelagem e inversão eletromagnética ... | nilq/baby-python | python |
# Author: Mohammad Samani
# Date: 1.12.2021
# Place: Basel, Switzerland
import time, platform, struct, binascii, asyncio
from config import conf
from error import RecordError
from bleak import BleakClient
from bleak.backends.winrt.client import BleakClientWinRT
import db
ADDRESS = conf['mac_address']
TEMP_UUID = co... | nilq/baby-python | python |
from datetime import datetime
from sqlalchemy import Column, Integer, String, DateTime
from app.db.session import Session
from app.models import Base
class Captcha(Base):
__tablename__ = 'covid_captcha'
id = Column(Integer, autoincrement=True, primary_key=True, comment="主键")
create_time = Column(DateTim... | nilq/baby-python | python |
from migen import *
from photonsdi.constants import *
class FrameExtractor(Module):
def __init__(self, elementary_stream_count=2):
assert elementary_stream_count in [2]
datapath_width = elementary_stream_count * SDI_ELEMENTARY_STREAM_DATA_WIDTH
self.i_data = Signal(datapath_width)
... | nilq/baby-python | python |
from typing import NamedTuple, Dict, Generator
import re
CommandArgs = NamedTuple('CommandArgs',
[('command', str), ('args', list[str])])
def variable_expansion(word: str, environment: Dict[str, str]) -> str:
"""Подставляет значения из окружения вместо переменных."""
return re.sub(... | nilq/baby-python | python |
# coding=utf-8
from contracts import contract, describe_value, describe_type
from geometry import logger
import numpy as np
from .manifolds import DifferentiableManifold
#
# def array_to_lists(x):
# return x.tolist()
#
# def packet(space, rep, value):
# return {'space': space, 'repr': rep, 'value': value}
#
# ... | nilq/baby-python | python |
from manga_py.provider import Provider
from .helpers import tapas_io
from .helpers.std import Std
class TapasIo(Provider, Std): # TODO: Login\Password
helper = None
def get_archive_name(self) -> str:
ch = self.chapter
return self.normal_arc_name([
ch['scene'],
ch['tit... | nilq/baby-python | python |
import logging
from collections import namedtuple
from io import StringIO
from typing import List
from urllib.parse import quote_plus
from aiohttp import ClientSession, ClientTimeout
from lxml import etree
from lxml.html import HtmlElement
CourtInfo = namedtuple("CourtAddress", ["name", "address", "note"])
def to_... | nilq/baby-python | python |
import json
import logging
import os
import sys
import boto3
import domovoi
from botocore.exceptions import ClientError
pkg_root = os.path.abspath(os.path.join(os.path.dirname(__file__), 'domovoilib')) # noqa
sys.path.insert(0, pkg_root) # noqa
from dss import stepfunctions
from dss.stepfunctions import SFN_TEMPLA... | nilq/baby-python | python |
import py
from pypy.lang.prolog.interpreter.parsing import parse_file, TermBuilder
from pypy.lang.prolog.interpreter import engine, helper, term, error
from pypy.lang.prolog.builtin import builtins, builtins_list
from pypy.rlib.objectmodel import we_are_translated
class Builtin(object):
_immutable_ = True
def... | nilq/baby-python | python |
import argparse
import errno
import json
import os
import shutil
import sys
import tempfile
import bdbag.bdbag_api
from galaxy.datatypes import sniff
from galaxy.datatypes.registry import Registry
from galaxy.datatypes.upload_util import (
handle_sniffable_binary_check,
handle_unsniffable_binary_check,
Up... | nilq/baby-python | python |
from concurrent.futures import ThreadPoolExecutor
import lib.HackRequests as HackRequests
task_status = 0
def uploadfile(data):
global task_status
if task_status==1:
return 'Success'
hack = HackRequests.hackRequests()
hack.httpraw(data)
def requestfile(url):
global task_status
if task... | nilq/baby-python | python |
#In this assignment you will write two functions. Your functions should not make any print statements.
#Any printing should be done by driver code outside the functions.
#Problem 1:
#Write a function tha will take two parameters: city and country. You can name it whatever you want.
#The function should return a forma... | nilq/baby-python | python |
from infi.clickhouse_orm import migrations # type: ignore
from ee.clickhouse.sql.events import (
EVENTS_WITH_PROPS_TABLE_SQL,
MAT_EVENT_PROP_TABLE_SQL,
MAT_EVENTS_WITH_PROPS_TABLE_SQL,
)
operations = [
migrations.RunSQL(EVENTS_WITH_PROPS_TABLE_SQL),
migrations.RunSQL(MAT_EVENTS_WITH_PROPS_TABLE_S... | nilq/baby-python | python |
#!/usr/bin/env python
# coding=utf-8
# This file is copied from torchvision.models
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import tensorboardX as tbx
import libs.c... | nilq/baby-python | python |
from flask import Flask, request, jsonify
from flask_cors import CORS, cross_origin
import json
import os
import random
import requests
import src.services.providers.python.fetch_git_data
import src.services.providers.python.fetch_lingo_data
import src.services.providers.python.fetch_lab_data
def create_app():
ap... | nilq/baby-python | python |
import StockAnalysisSystem.core.api as sasApi
from StockAnalysisSystem.core.SubServiceManager import SubServiceContext
from StockAnalysisSystem.core.Utility.relative_import import RelativeImport
from StockAnalysisSystem.core.Utility.event_queue import Event, EventDispatcher
with RelativeImport(__file__):
from WebS... | nilq/baby-python | python |
"""'On-fly' avatar changer.
This script allows to change avatar of bot while it's running.
Script gets randomly choosen avatar data to replace current avatar.
This file can also be imported as a module and contains the following functions:
* get_avatar_bytes - gets bytes from avatar picture
"""
import pathlib
im... | nilq/baby-python | python |
import queue
from typing import Tuple
from agents.abstract_agent import AbstractAgent
from games.game import Game
from utils import print_turn
from utils import print_board
from utils import print_move
from utils import print_visit_count
from utils import print_winner
from games.game_types import UIEvent
class CUI:
... | nilq/baby-python | python |
import numpy as np
import threading
#from federatedml.ftl.encryption import mulmatOT
import mulmatOT
import sys,getopt
import socket
import pickle
from time import *
BITS_LEN=16
ROW_A=6
COL_A=6
ROW_B=6
COL_B=6
# a=np.array([[ 0.00514600],
# [ 0.02252000],
# [-0.01941000],
# [ 0.04263000],
# [-0.01234000],
# [ 0.... | nilq/baby-python | python |
import poplib
import getpass
import sys
import mailconfig
# Configuramos o servidor
mailserver = mailconfig.servidor_pop
# O nome do usuário
mailuser = mailconfig.usuário_pop
# Pedimos por uma senha
mailpasswd = getpass.getpass('Senha para %s?' % mailserver)
# Iniciamos o processo de conexão com o servidor
print('C... | nilq/baby-python | python |
import os
import pathlib
# Clone the tensorflow models repository if it doesn't already exist
if "models" in pathlib.Path.cwd().parts:
while "models" in pathlib.Path.cwd().parts:
os.chdir('..')
elif not pathlib.Path('models').exists():
!git clone --depth 1 https://github.com/tensorflow/models
import matplotli... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
"""
Author: Keurfon Luu <keurfon.luu@mines-paristech.fr>
License: MIT
"""
__all__ = [ "progress_bar", "progress_perc", "progress" ]
def progress_bar(i, imax, n = 50):
bar = list("[" + n * " " + "]")
perc = (i+1) / imax
bar[1:int(perc*n)+1] = int(perc*n) * "="
imid = (n+2) // ... | nilq/baby-python | python |
import pytz
from pytz import timezone, common_timezones
from datetime import datetime
def local_to_utc(local_time, local_tz, aware=True):
if local_tz not in common_timezones:
raise ValueError('Timezone: %s is not in common list' % (local_tz))
utc = pytz.utc
tz = timezone(local_tz)
if aware:
... | nilq/baby-python | python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# @uthor: Makram Jandar
# ____ __ ___ __ ______ ___ ___
# | | | | \| | | | / _] \
# |__ | | | o ) | | |/ [_| D )
# __| | | | _/| ~ |_| |_| _] /
# / | | : | | |___, | | | | [_| \
# \ ` | |... | nilq/baby-python | python |
import sys, re
try:
from Bio import Entrez
except ImportError as exc:
print(f"### Error: {exc}", file=sys.stderr)
print(f"### This program requires biopython", file=sys.stderr)
print(f"### Install: conda install -y biopython>=1.79", file=sys.stderr)
sys.exit(-1)
from biorun.libs import placlib as ... | nilq/baby-python | python |
'''
Agilent 33220A
Created on October 11, 2009
@author: bennett
'''
# Future functions GetLoad and SetLoad, GetUnits and SetUnits
import gpib_instrument
class Agilent33220A(gpib_instrument.Gpib_Instrument):
'''
The Agilent 33220A Arbitrary Function Generator GPIB communication class (Incomplete)
'''
... | nilq/baby-python | python |
from collections import Counter
import json
import math
from pprint import pprint
import re
import sys
import urllib.request
import glob
files = glob.glob(
"/Users/nakamura/git/d_umesao/umesao_images/docs/iiif/item/*/manifest.json")
files = sorted(files)
selections = []
prefix = "https://nakamura196.github.io/vi... | nilq/baby-python | python |
# Generated by Django 2.0.6 on 2018-06-29 16:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('grafik', '0004_auto_20180629_2115'),
]
operations = [
migrations.RemoveField(
model_name='passenger',
name='kecamata... | nilq/baby-python | python |
# Generates simulation data for time-series count data with decoupled mean and variance
import numpy as np
import pandas as pd
from scipy.stats import norm
import statsmodels.api as sm
from datetime import datetime as dt
from dateutil.relativedelta import relativedelta
from dataclasses import dataclass
def generate_d... | nilq/baby-python | python |
import machine
import utime
class KitronikPicoMotor:
#Pins 4 and 5 motor 1
#Pins 9 and 10 motor 2
#'Forward' is P5 or P9 driven high, with P4 or P10 held low.
#'Reverse' is P4 or P10 driven high, with P5 or P9 held low
#Driving the motor is simpler than the servo - just convert 0-100% ... | nilq/baby-python | python |
from django import test
import actrack
from actrack.managers.inst import get_user_model
from actrack.actions import save_queue
__test__ = False
__unittest = True
class TestCase(test.TestCase):
@property
def user_model(self):
return get_user_model()
def log(self, *args, **kwargs... | nilq/baby-python | python |
# DmrSmashTools by Dreamer
# Github Link: https://github.com/Dreamer13sq/DmrSmashTools/tree/main/DmrSmashTools_Blender
bl_info = {
"name": "Dmr Smash Tools",
"description": 'Some tools used to make modelling more efficient.',
"author": "Dreamer",
"version": (1, 0),
"blender": (2, 90, 0),
"categ... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
from nose import tools as nose
from tests.integration.resource import ResourceTestCase
class AlbumResourceTestCase(ResourceTestCase):
"""
GET /albums/ [artist=<int>]
200 OK
401 Unauthorized
POST /albums/ name=<str> [year=<int>] [cover_url=<str>]
201 Created... | nilq/baby-python | python |
"""
train.py
Entry point for training Hasse diagrams.
"""
from ehreact.train import calculate_diagram
def train(args):
"""
Computes a Hasse diagram based on the inputted arguments
Parameters
----------
args: Namespace
Namespace of arguments.
"""
if not args.quiet:
print(... | nilq/baby-python | python |
# grid relative
from .fl_controller import FLController
processes = FLController()
| nilq/baby-python | python |
'''
Nome: Andre Devay Torres Gomes
NUSP: 10770089
'''
# Função principal que roda a interface e chama as outras funções
def main():
global solucao
n = int(input('Digite o número N (entre 4 e 26) de rainhas que deseja no tabuleiro NxN :'))
matriz = []
solucao = []
for i in range(n):
... | nilq/baby-python | python |
# Copyright 2012 Red Hat, 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 writing... | nilq/baby-python | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.