content
stringlengths
0
1.05M
origin
stringclasses
2 values
type
stringclasses
2 values
import argparse import cv2 from glob import glob from itertools import product import numpy as np import os from tqdm import tqdm from scipy.special import erf import torch import torch.nn as nn from model.model import CompModel import arithmetic_coding as ac MAX_N = 65536 TINY = 1e-10 def load_img(path): img =...
nilq/baby-python
python
# This code is generated by [Atcoder_base64](https://github.com/kyomukyomupurin/AtCoder_base64) from base64 import b85decode import subprocess from pathlib import Path from zlib import decompress binary = "c%0=~Z){uD6~DIg$7xf?EiD9ERs&&bS7PF}DJfls?ZoXfIB96o(v?4#7u$)w`A=p)mxLi^skEwB(nV7@`hiJB>;pr5fN4VefV!Xz#-wcuQ>P)pq...
nilq/baby-python
python
from django.db import models from django.contrib.auth.models import User class Duck(models.Model): color = models.CharField(max_length=30, default='yellow') model = models.CharField(max_length=30) price = models.FloatField(default=0) owner = models.ForeignKey(User, null=True)
nilq/baby-python
python
from polyphony import testbench def if29(p0, p1, p2): x = 0 if p0 == 0: pass elif p0 == 1: if p1 == 0: if p2 == 0: x = 10 elif p1 == 1: pass elif p1 == 2: pass else: return -1 #x = -1 re...
nilq/baby-python
python
import json from django.core.management.base import BaseCommand from ...models import Item # BaseCommandを継承して作成 class Command(BaseCommand): # python manage.py help import_itemで表示されるメッセージ help = 'Create Item from json file' def remove_null(self, value, default): if value is None: ret...
nilq/baby-python
python
#!/usr/bin/python # encoding: utf-8 from helper import * import cv2 import numpy as np import os import pickle # https://klassenresearch.orbs.com/Plotting+with+Python #import matplotlib.rc # Make use of TeX #rc('text',usetex=True) # Change all fonts to 'Computer Modern' #rc('font',**{'family':'serif'...
nilq/baby-python
python
""" Developed by ThaumicMekanism [Stephan K.] - all credit goes to him! """ import contextlib import sys from typing import Callable, List from tqdm.contrib import DummyTqdmFile import examtool.api.download from examtool.api.gradescope_upload import APIClient from examtool.api.extract_questions import ( extract_g...
nilq/baby-python
python
from flask_wtf import FlaskForm from wtforms.validators import InputRequired from dmutils.forms.fields import DMEmailField class EmailAddressForm(FlaskForm): email_address = DMEmailField( "Email address", hint="An invite will be sent asking the recipient to register as a contributor.", va...
nilq/baby-python
python
import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(14, GPIO.OUT) GPIO.setup(15, GPIO.IN) try: while True: GPIO.output(14, GPIO.input(15)) finally: GPIO.output(14, 0) GPIO.cleanup()
nilq/baby-python
python
# -*- coding: utf-8 -*- """ Sony .spimtx LUT Format Input / Output Utilities ================================================ Defines *Sony* *.spimtx* *LUT* Format related input / output utilities objects. - :func:`colour.io.read_LUT_SonySPImtx` - :func:`colour.io.write_LUT_SonySPImtx` """ from __future__ import...
nilq/baby-python
python
import jwt from os import environ from datetime import datetime, timedelta from flask_restful import (Resource, request) from models.user import UserModel, UserSchema from webargs.flaskparser import use_args from webargs import fields from flask import flash, redirect, url_for user_args ={'username': fields.Str(requir...
nilq/baby-python
python
"""bsp methods""" import base64 import json import pprint import pyodata import sap.cli.core import sap.cli.helpers from sap import get_logger from sap.errors import ResourceAlreadyExistsError class CommandGroup(sap.cli.core.CommandGroup): """Management for BSP Applications""" def __init__(self): s...
nilq/baby-python
python
import pandas as pd from datetime import datetime from log import Log class Asset: def __init__(self): self.data = None self.name = None self.symbol = None self.exchange = None self.header_lines = None def read_header(self, filename): self.header_lines = 0 ...
nilq/baby-python
python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :mod:`ranges` ================== .. module:: ranges :platform: Unix, Windows :synopsis: .. moduleauthor:: hbldh <henrik.blidh@nedomkull.com> Created on 2015-06-04, 15:12 """ from __future__ import division from __future__ import print_function from __future__...
nilq/baby-python
python
from setuptools import setup setup( name="sup", author="Richard Liaw" )
nilq/baby-python
python
#!/usr/bin/env python """ Monitor system calls with dockit. """ import os import sys import atexit import logging import traceback import lib_uris import lib_util import lib_common from lib_properties import pc os.environ["PYTHONUNBUFFERED"] = "1" if True: # TODO: Make this cleaner. # FIXME: This does not ...
nilq/baby-python
python
from .video_resnet_triplet_attention import encoder as encoder_attention from .video_resnet_triplet_bilinear import encoder as encoder_bilinear from .video_resnet_triplet_gap import encoder as encoder_gap from .video_resnet_triplet_mxp import encoder as encoder_mxp from .video_resnet_triplet_frame_wise import encoder a...
nilq/baby-python
python
# -*- coding: utf-8 -*- # Copyright 2018 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Module for creating clang-tidy builds.""" from __future__ import print_function from chromite.cbuildbot import manifest_versi...
nilq/baby-python
python
from django.shortcuts import render from rest_framework import status, generics, viewsets, views from rest_framework.decorators import api_view from rest_framework.response import Response from django_filters.rest_framework import DjangoFilterBackend from .models import People, Companies from . import serializers cla...
nilq/baby-python
python
from django.db import models # Create your models here. class Locker(models.Model): is_using = models.BooleanField(default=False)
nilq/baby-python
python
# coding=utf-8 # Copyright 2014 Janusz Skonieczny """ Gra w kółko i krzyżyk """ import pygame import pygame.locals import logging # Konfiguracja modułu logowania, element dla zaawansowanych logging_format = '%(asctime)s %(levelname)-7s | %(module)s.%(funcName)s - %(message)s' logging.basicConfig(level=logging.DEBUG,...
nilq/baby-python
python
from django.db import models # Create your models here. # Con este archivo creo lo necesario para importar luego otro archivo que finalizara creando una BD en postgres # Los metodos STR son los que van a mostrarse en la pagina en django class Domicilio(models.Model): calle = models.CharField(max_length=255) n...
nilq/baby-python
python
from PyObjCTools.TestSupport import * from Foundation import * try: unicode except NameError: unicode = str class TestNSLinguisticTagger (TestCase): @min_os_level('10.7') def testConstants(self): self.assertIsInstance(NSLinguisticTagSchemeTokenType, unicode) self.assertIsInstance(NSLin...
nilq/baby-python
python
# Written by Jeremy Lee, 2020-10-30 from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('umap', '0007_auto_20190416_1757'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ ...
nilq/baby-python
python
from pyomo.core import * class Model: model = AbstractModel() model.T = Set() # Index Set for time steps of optimization horizon model.S = Set() # Index Set for time steps of optimization horizon ################################## PARAMETERS ################################# #...
nilq/baby-python
python
""" This module contains event handlers related to the restart options after a Codenames game ends. """ from flask_socketio import emit, leave_room from flask_login import current_user from app import socketio, db from app.models.user_data import UserData from app.games.codenames.models import CodenamesTeams from ap...
nilq/baby-python
python
from pyg_base import is_num, is_ts, df_concat import pandas as pd import numpy as np import numba @numba.njit def _p(x, y, vol = 0): if vol == 0: return 1. if x<y else -1. if x>y else 0.0 else: one_sided_tail = 0.5 * np.exp(-abs(y-x)/vol) return 1-one_sided_tail if x<y else one_sided_ta...
nilq/baby-python
python
from .data import * from .selector import * from .utils import * from .dataset import *
nilq/baby-python
python
# Search for lines that start 'X' followed by any non whitespace # characters and ':' then output the first group of non whitespace # characters that follows import re hand = open('mbox-short.txt') for line in hand: line = line.rstrip() x = re.findall('^X\S*: (\S+)', line) if not x: continue print(x)
nilq/baby-python
python
from datetime import datetime import numpy as np from multiprocessing import Pool, cpu_count import os import sys import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.tensorboard import SummaryWriter from .utils.preprocess_conllu import * from .utils.helpers import * from .utils.tools i...
nilq/baby-python
python
import sys, re from mk_yaml_ontology import ont_node, dump_yaml def replace_token(pattern, replacement, s): replacement = f' {replacement} ' s = re.sub(f' ?{pattern} ', replacement, s) s = re.sub(f' {pattern} ?', replacement, s) return s def mk_ont_node(line_string): fields = line_string.split("\t...
nilq/baby-python
python
import os import pytest from aztk.models.plugins import PluginConfiguration from aztk.models.plugins.internal import PluginManager from aztk.error import InvalidPluginReferenceError dir_path = os.path.dirname(os.path.realpath(__file__)) fake_plugin_dir = os.path.join(dir_path, "fake_plugins") def RequiredArgPlugin(r...
nilq/baby-python
python
from abt.cli import main
nilq/baby-python
python
import asyncio import logging from rsp1570serial.discovery import discover_source_aliases if __name__ == "__main__": logging.basicConfig( level=logging.INFO, format="%(asctime)s %(levelname)s:%(message)s" ) # asyncio.run(discover_source_aliases("socket://192.168.50.211:50002")) asyncio.run(disc...
nilq/baby-python
python
from copy import deepcopy class ensemble: def __init__(self, obj): self.vals = {None: (None,obj)} def get(self): if self.vals is None: return self.val if len(self.vals)==1: for nm in self.vals.values(): return nm[1] return self ...
nilq/baby-python
python
''' Created on May 2, 2016 @author: damianpa '''
nilq/baby-python
python
import yaml import os import git import logging from .i_repository_parser import IRepositoryParser class RosdistroRepositoryParser(IRepositoryParser): """ Pulls the rosdistro-package and gets all urls from the rosdistro files. """ def __init__(self, settings: dict): """ Creates a new ...
nilq/baby-python
python
import sklearn as sk import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import fetch_olivetti_faces faces = fetch_olivetti_faces() print "DESCR" print faces.DESCR print "images.shape" print faces.images.shape print "data.shape" print faces.data.shape print "target.shape" print faces.target.shape
nilq/baby-python
python
import argparse if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("-p","--principal",action="store", type=float, help="Principal", default=10000, required=True) parser.add_argument("-r", "--rate", action="store", type=float, help="rate of interest", default=10, req...
nilq/baby-python
python
from ASTModels import Node memory_size = 30000 def execute(ast: [Node]) -> ([int],int): memory = [0]*memory_size mp = 0 for node in ast: memory, mp = _evaluate(node,memory,mp) print() return memory, mp def _evaluate(node: Node, memory: [int], mp: int) -> ([int],int): if node.nod...
nilq/baby-python
python
from __future__ import print_function from __future__ import absolute_import from __future__ import division import os import sys import tensorflow as tf import numpy as np from tensorflow.python.client import timeline with tf.device("/cpu:0"): a = tf.Variable([1],) with tf.device("/cpu:1"): b = tf.Variable([2],) ...
nilq/baby-python
python
class Vehicle: def __init__(self, vin): self.vin=vin def GetVin(self): return self.vin class Car(Vehicle): def Accelerate(self): print("Car accelerating...") class Truck(Vehicle): def Accelerate(self): print("Truck accelerating...") def main(): cars=[Car("A12345689...
nilq/baby-python
python
# -*- coding: utf-8 -*- import webapp2 from webapp2_extras import routes import json from api import routes as apiRoutes from fetch import routes as fetchRoutes class MainPage(webapp2.RequestHandler): def get(self): self.response.headers['Content-Type'] = 'text/plain' self.response.write('QCurren...
nilq/baby-python
python
# -*- coding:utf-8 -*- import unittest from simple_ml.classify_data import DataCollector, get_iris import numpy as np class TestDataCollector(unittest.TestCase): def test_get_iris(self): dc = DataCollector() x = dc.fetch_handled_data("iris") self.assertIsInstance(x, np.ndarray) s...
nilq/baby-python
python
#!/usr/bin/env python # -*- coding: utf-8 -*- ################# # Module-Import # ################# #eegpy-modules try: import eegpy from eegpy.events import EventTable from eegpy.misc import FATALERROR from eegpy.ui.widgets.windowwidgets import EegpyBaseWin from eegpy.ui.icon import image_from_ee...
nilq/baby-python
python
#!/usr/bin/env python3 """ Prepares the test environment prior to starting hyperglass. """ import os import glob import shutil from logzero import logger working_directory = os.path.dirname(os.path.abspath(__file__)) parent_directory = os.path.dirname(working_directory) def ci_copy_config(): """Copies test confi...
nilq/baby-python
python
# Version: @VERSIONEER-VERSION@ """The Versioneer - like a rocketeer, but for versions. @README@ """ # pylint:disable=invalid-name,import-outside-toplevel,missing-function-docstring # pylint:disable=missing-class-docstring,too-many-branches,too-many-statements # pylint:disable=raise-missing-from,too-many-lines,too-m...
nilq/baby-python
python
from dj_rest_auth.serializers import PasswordResetSerializer from django.conf import settings class PasswordResetSerializerFrontendHost(PasswordResetSerializer): """ Serializer for requesting a password reset e-mail. """ def save(self): if "allauth" in settings.INSTALLED_APPS: fro...
nilq/baby-python
python
#!/usr/bin/env python # -*- coding: utf-8 -*- #2018-05-29 08-49 # Standard Modules import logging # Extra Modules dependencies_missing = False try: import teradata except ImportError: dependencies_missing = True from metasploit import module, login_scanner # Metasploit Metadata metadata = { 'name': 'Te...
nilq/baby-python
python
import itertools import discord from discord.ext import commands from bot.constants import Colours with open('bot/resources/evergreen/python_facts.txt') as file: FACTS = itertools.cycle(list(file)) COLORS = itertools.cycle([Colours.python_blue, Colours.python_yellow]) class PythonFacts(commands.Cog): """S...
nilq/baby-python
python
from django.core.management.base import BaseCommand, CommandError from ghu_main.email import EmailAPI class Command(BaseCommand): """This command refers to the API in email.py for sending emails in-app""" def __init__(self): super(Command, self).__init__() def add_arguments(self, parser): ...
nilq/baby-python
python
#!/usr/bin/python # # Copyright (c) 2016 Juniper Networks, Inc. All rights reserved. # import os import sys import argparse import ConfigParser import requests from netaddr.ip import IPNetwork from vnc_api.vnc_api import * class ProvisionVgwInterface(object): def __init__(self, args_str=None): self._ar...
nilq/baby-python
python
#!/usr/bin/env python def plain_merge(array_a: list, array_b: list) -> list: pointer_a, pointer_b = 0, 0 length_a, length_b = len(array_a), len(array_b) result = [] while pointer_a < length_a and pointer_b < length_b: if array_a[pointer_a] <= array_b[pointer_b]: result.append(arr...
nilq/baby-python
python
class RuleWriterMount(type): def __init__(cls, name, bases, attrs): if not hasattr(cls, 'rule_writers'): cls.rule_writers = {} else: cls.register_rule_writer(cls) def register_rule_writer(cls, rule_writer): instance = rule_writer() cls.rule_writers[insta...
nilq/baby-python
python
#!/usr/bin/env python import os import re import shutil import subprocess import sys toplevel = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) re_setup = re.compile(r'setup\(') re_version = re.compile(r'(?<=\bversion=[\'"])([0-9a-zA-Z._+-]+)') def update_version(gitversion, foundversion): """Choo...
nilq/baby-python
python
""" Merge the tools Consider the following: A string, s, of length n. An integer, k, where k is a factor of n. We can split s into n/k subsegments where each subsegment, t(i), consists of a contiguous block of k characters in s. Then, use each t(i) to create string u(i) such that: The characters in u(i) are a subseque...
nilq/baby-python
python
import string def is_pangram(sentence: str) -> bool: """ Determine if a given string contains all the characters from a to z. sentence -- Any string. returns -- true/false for if string contains all letters from a to z. """ letters = set(string.ascii_lowercase) return letters.issubset(se...
nilq/baby-python
python
import numpy as np from scipy.linalg import solve from js.geometry.quaternion import Quaternion for path in [ "../data/gazebo_winter/", "../data/mountain_plain/", "../data/gazebo_summer/" ]: #for path in [ "../data/stairs/", "../data/apartment/", "../data/wood_summer/" ]: with open(path+"pose_scanner_leica.csv") as...
nilq/baby-python
python
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Rackspace Hosting # # 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...
nilq/baby-python
python
nome = str(input('Digite seu nome: ')).strip().upper() print(f'Seu nome tem SILVA: ','SILVA' in nome)
nilq/baby-python
python
from .clip import * from .esresnet import * from .audioclip import AudioCLIP from .audioclip_finetune import AudioCLIPFinetune
nilq/baby-python
python
loan_amount = eval(input('Loan Amount: ')) r = eval(input('Annual Interest Rate: ')) n = eval(input('Loan Duration in Months: ')) payment = (r*loan_amount)/(1-((1+r)**-n)) print('$', payment)
nilq/baby-python
python
from .settings import * INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'myapp', ] # Uncomment if you want to use a mysql/mariadb database. Don't forget to c...
nilq/baby-python
python
# coding:utf-8 """ 以tushare为源的市场数据表 """ import loguru import random import time import datetime import tushare as ts import pandas as pd import matplotlib.pyplot as plt from .sqldata import SqlDayManager, SqlBaseManager import sys,os sys.path.append(os.path.abspath("../timedata")) import settings from loguru impor...
nilq/baby-python
python
from localstack.dashboard import infra from localstack.config import USE_SSL def test_infra_graph_generation(): try: graph = infra.get_graph() except Exception as e: if USE_SSL: print('TODO: the Web UI in combination with USE_SSL=true is currently broken.') return a...
nilq/baby-python
python
from typing import Optional from ..helpers.const import * class ConfigData: name: str host: str port: int username: Optional[str] password: Optional[str] password_clear_text: Optional[str] unit: int update_entities_interval: int update_api_interval: int monitored_devices: list...
nilq/baby-python
python
# Generated by Django 3.2.8 on 2021-11-30 17:55 from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AU...
nilq/baby-python
python
from user.models import CourseRegistration # TODO: # send mail with formatted relevant student test results to course adviser # generate a list of courses registered buy a student for the current semester and session def get_registered_courses(student, session, semester): reg = CourseRegistration.objects.filter(...
nilq/baby-python
python
from output.models.ms_data.regex.re_l32_xsd.re_l32 import ( Regex, Doc, ) __all__ = [ "Regex", "Doc", ]
nilq/baby-python
python
from app import app ''' set debug=False bellow when deploying to prod ''' app.run(host='0.0.0.0', debug=True)
nilq/baby-python
python
#!/usr/bin/python3 # -*- mode: python -*- """ s3_gateway: bottle/boto3 interface to view an s3 bucket in a web browser. 2021-02-15 slg - updated to use anonymous s3 requests, per https://stackoverflow.com/questions/34865927/can-i-use-boto3-anonymously 2021-02-20 slg - add support for database querie...
nilq/baby-python
python
from torch import Tensor, _VF # noqa: F401 from torch.nn.utils.rnn import PackedSequence import torch import warnings from typing import List, Optional, Tuple class QuantizedLinear(torch.jit.ScriptModule): __constants__ = ['scale', 'zero_point'] def __init__(self, other): super(QuantizedLinear, se...
nilq/baby-python
python
import argparse import os import json import xml.etree.cElementTree as ET import logging import numpy as np import sys sys.path.insert(0,'common') from transforms3dbatch import * from utils.quaternion import * def parse_motions(path): xml_tree = ET.parse(path) xml_root = xml_tree.getroot() xml_motions = x...
nilq/baby-python
python
from django.apps import apps as django_apps default_app_config = 'scrapyd_dash.apps.ScrapydDashConfig'
nilq/baby-python
python
__all__ = ['auth', 'constants', 'controllers', 'forms']
nilq/baby-python
python
#!/bin/python import sys S = raw_input().strip() try: r = int(S) print r except ValueError: print "Bad String"
nilq/baby-python
python
#!/usr/bin/env python3 # coding: utf-8 """Automatic EcoFlex sequences annotation pipeline. Edits: - Recolor all AmpR with the same color as YTK parts - Add AmpR terminator feature with standard color """ import copy import io import itertools import json import re import os import warnings import sys import bs4 as ...
nilq/baby-python
python
# hsrp parameters ng_order = (3072,) _ng_const = ( # 3072 ( """\ FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E08\ 8A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B\ 302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9\ A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE6\ 492866...
nilq/baby-python
python
import random import kivy from kivy.app import App from kivy.uix.boxlayout import BoxLayout kivy.require('1.9.0') class MyRoot(BoxLayout): def __init__(self): super(MyRoot, self).__init__() def generate_affirmation(self): affirmations = ["I am the architect of my life; \nI build its foundati...
nilq/baby-python
python
# Copyright 2020 Regents of the University of Minnesota. # # 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 applic...
nilq/baby-python
python
from rpcb.message_dispatch import MessageDispatch from rpcb.service import Service import threading import time import random import pika import queue import logging import pika.adapters.blocking_connection """ 消息调度器实现,用于批处理数据,多个数据来了会打包为一个batch输入到模型中,从而提高整体的吞吐量 """ class BatchMessageDispatcher(MessageDispatch): d...
nilq/baby-python
python
import vcs import cdms2 import os x = vcs.init() f = cdms2.open(os.path.join(vcs.sample_data, 'clt.nc')) u = f("u") v = f("v") V = x.createvector() V.linecolor = 242 V.scale = 5. V.type = "arrows" V.reference = 6. V.list() x.plot(u[::2], v[::2], V) x.png("vectors") x.interact()
nilq/baby-python
python
# OpenWeatherMap API Key api_key = "Goes here if needed"
nilq/baby-python
python
# Note that only the currently used fields are shown unless show_all is set to True. import os import pandas as pd import anytree from anytree.search import find from anytree.exporter import DotExporter import collections PolicyTuple = collections.namedtuple('PolicyTuple','layer_id agg_id calc_rules') CalcRuleTuple = ...
nilq/baby-python
python
# -*- coding: utf-8 -*- import os from Crypto import Random from Crypto.Cipher import AES from Crypto.Hash import SHA256 from common import xJiPZbUzlGCIdemowYnQNONypdeudgmd, ckAjUaLEXnferbefRGpQeOZRysoqlffQ FFVGFOvcuiKjdGKFcTRNoKJcuBaGjGEf = 'b14ce95fa4c33ac2803782d18341869f' class LVPFsEGShJELnCwtpptaZvXDbVmShyns(Exce...
nilq/baby-python
python
#!/usr/bin/env python3 import os import re import sys LOWP_SEARCH = "lowp" MEDIUMP_SEARCH = "mediump" HIGHP_SEARCH = "highp" VERTEX_SHADER_EXT = ".vsh.glsl" FRAG_SHADER_EXT = ".fsh.glsl" GLES3_PREFIX = "GLES3_" GLES3_SHADER_PREFIX = "gles3_" SHADERS_LIB_COMMON_PATTERN = "// Common" SHADERS_LIB_VS_PATTERN = "// VS" S...
nilq/baby-python
python
#!/usr/bin/env python3.8 # Copyright 2019 The Fuchsia Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import json import os import platform import sys def main(): parser = argparse.ArgumentParser() # TODO(fxbu...
nilq/baby-python
python
import filecmp import os def exists(path): return os.path.isfile(path) class FileApprover(object): def verify(self, namer, writer, reporter): base = namer.get_basename() approved = namer.get_approved_filename(base) received = namer.get_received_filename(base) writer.write_r...
nilq/baby-python
python
import socket import serial from config import DEFAULT_VELOCITY from config import TIME_INTERVAL import time import math import os class Robot: def __init__(self, mac: str, color: str, com: str): if os.name == 'posix': self.socket = socket.socket( socket.AF_BLUETOOTH, socket.S...
nilq/baby-python
python
# THIS FILE IS GENERATED FROM KIVY SETUP.PY __version__ = '1.11.0.dev0' __hash__ = '9b90467ec9efea3891e07be92c9bb4ba638a7ca0' __date__ = '20190329'
nilq/baby-python
python
# Tara O'Kelly - G00322214 # Emerging Technologies, Year 4, Software Development, GMIT. # Problem set: Python fundamentals # 6. Write a function that returns the largest and smallest elements in a list. user_list = [] # get user input n = int(input('How many numbers: ')) for x in range(n): numbers = int(input('E...
nilq/baby-python
python
#%% import numpy as np import pandas as pd # Load the data data = pd.read_csv('./input/2021-02-11_REL606_NCM3722_diauxie.csv') # DO some serious tidying melted = data.melt('Cycle Nr.') # Get the time indices time = melted[melted['Cycle Nr.']=='Time [s]'] time.sort_values(by='variable', inplace=True) time = time['val...
nilq/baby-python
python
"""Library for CIM sparql queries""" __version__ = "1.9.0"
nilq/baby-python
python
# -*- coding: utf-8 -*- """ Script to make test """ from indeed import params def test_indeed_params(): assert params('my_username', 'my_password') == ('my_username', 'my_password') assert params('your_username', 'your_password') == ('your_username', 'your_password')
nilq/baby-python
python
# # Copyright 2017-2018 Amazon.com, Inc. and its affiliates. All Rights Reserved. # # Licensed under the MIT License. See the LICENSE accompanying this file # for the specific language governing permissions and limitations under # the License. # import mount_efs import os import pytest from datetime import datetime ...
nilq/baby-python
python
from chibi.units.base import Unit from unittest import TestCase class Test_unit( TestCase ): def setUp( self ): self.unit = Unit( 10 ) def test_should_print_the_value_when_is_str( self ): self.assertIn( '10', str( self.unit ) ) def test_when_add_a_int_should_work( self ): r = 10 ...
nilq/baby-python
python
################################################################################################################### # Uses a trained network to predict the class for an input image # Notes - Run train.py first before this script # Basic usage: python predict.py /path/to/image checkpoint # Options: # Return top KK most ...
nilq/baby-python
python
from datetime import datetime import hashlib import uuid from google.cloud import firestore SONG_TEMPLATE = '{verse}\n\n{pre_chorus}\n\n{chorus}\n\n{pre_chorus}\n\n{chorus}\n\n{bridge}' class Song: collection_name = 'songs' def __init__(self, id, chorus_id=None, pre_chorus_id=None, verse_id=None, ...
nilq/baby-python
python
"""This module contains various decorators. There are two kinds of decorators defined in this module which consists of either two or three nested functions. The former are decorators without and the latter with arguments. For more information on decorators, see this `guide`_ on https://realpython.com which provides a...
nilq/baby-python
python
from typing import Tuple, List import pytest from predicates.state import State from predicates import guards, actions from predicates.guards import AlwaysTrue, AlwaysFalse from model.model import the_model, Model from model.operation import Operation, Transition from planner.plan import plan # -----------------------...
nilq/baby-python
python