content stringlengths 5 1.05M |
|---|
__version__ = '1.2.8'
|
import json
from . import sha256 as sha
import os
class bloque:
def __init__(self, numero, data, anterior, hashid, estructura):
self.id = numero
self.data = data
self.anterior = anterior
self.hash = hashid
self.estructura = estructura
def get(self):
return {"id... |
from django.contrib import admin
from .models import ProductData
# Register your models here.
# admin.site.register(user_info_10004)
admin.site.register(ProductData)
# redis-server
# celery -A inventory_scrapping worker -l info
# celery -A inventory_scrapping beat -l info |
import imptools
def enable_relative():
"""
Enable relative imports for scripts that are not executed as module.
Usually, scripts that are part of a module and use relative imports must be
run as `python3 -m module.script`. However, this requires being in the
correct working directory and can be annoying. T... |
# LMS Adaptive Notch Filter
# pr7_1_2
from Noisy import *
from Universal import *
if __name__ == '__main__':
filename = 'bluesky1.wav' # file path
speech = Speech() # Speech class instantiation
ss, fs = speech.audioread(filename, 8000) # read data
ss = ss - np.mean(ss... |
/usr/local/python3/lib/python3.7/stat.py |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
from proctor_lib import Proctor
class ProctorConfig(AppConfig):
name = 'proctor'
def ready(self):
p = Proctor()
p.load_plugins() |
#Faça um algoritmo que leia o preço de um produto e mostre seu novo preço,
#com 5% de desconto.
preço = float(input("Entre com o preço do produto: "))
desconto = (preço * 5) / 100
preço = preço - desconto
print("O novo preço do produto será de {} com 5% de desconto!".format(preço))
|
"""Autogenerated 2021-11-16T11:37:36.465555 by redcap_classfiles.py
"""
from ....pgrest import *
from ...constants import Constants
from ..rcconstants import REDCapConstants
from ..rcaptable import RcapTable
__all__ = ["RcapPainCatastrophizingQuestionnairePcs6"]
class RcapPainCatastrophizingQuestionnairePcs6(RcapT... |
#!/usr/bin/env python
# encoding: utf-8
# MIT License
# (c) baltasar 2016
import webapp2
from google.appengine.ext import ndb
from model.session import Session
class AddSessionHandler(webapp2.RequestHandler):
def get(self):
try:
client_id = self.request.GET['client_id']
... |
"""Constants for the ical integration."""
VERSION = "0.9"
DOMAIN = "ical"
CONF_MAX_EVENTS = "max_events"
CONF_DAYS = "days"
ICON = "mdi:calendar"
DEFAULT_NAME = "iCal Sensor"
DEFAULT_MAX_EVENTS = 5
|
from collections import OrderedDict
import networkx as nx
from .test_graph import TestGraph as _TestGraph
from .test_graph import BaseGraphTester
from .test_digraph import TestDiGraph as _TestDiGraph
from .test_digraph import BaseDiGraphTester
from .test_multigraph import TestMultiGraph as _TestMultiGraph
from .test_mu... |
from PIL import Image
import sys
from functools import reduce
fname = sys.argv[1]
im = Image.open(fname, 'r')
f = open(fname.rsplit('.', 1)[0] + '.hbmp', "wb")
# turn image into bit stream
px_data = im.load()
bitstream = ''
for j in range(im.size[1]):
for i in range(im.size[0]):
bitstream += "1" if px_da... |
class PoolUsedCapacity(object):
def read_get(self, name, idx_name, unity_client):
return unity_client.get_pool_size_used(idx_name)
class PoolUsedCapacityColumn(object):
def get_idx(self, name, idx, unity_client):
return unity_client.get_pools()
|
import logging
import numpy
import zmq
from numpy.lib.format import header_data_from_array_1_0
from fuel.utils import buffer_
logger = logging.getLogger(__name__)
def send_arrays(socket, arrays, stop=False):
"""Send NumPy arrays using the buffer interface and some metadata.
Parameters
----------
s... |
from django import forms
from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
class Profile(forms.ModelForm):
class Meta:
model = User
fields = ('username','password','first_name','last_name',)... |
# Copyright The PyTorch Lightning team.
#
# 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 i... |
# Generated by Django 3.2.11 on 2022-02-03 09:56
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("change_log", "0002_auto_20220202_1535"),
]
operations = [
migrations.AlterModelOptions(
name="change",
options={"get_latest... |
from sspdatatables.forms import AbstractFooterForm
from django.forms import ChoiceField
from django_countries import countries
class BookFieldSelectForm(AbstractFooterForm):
def get_author_nationality_choices(self):
return [(None, 'Select')] + list(countries.countries.items())
class Meta:
fie... |
prenom = "Vivien"
print(f'Bonjour {prenom} !') |
import discord
from discord.ext import commands
import random
import random
import asyncio
class emote(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command(brief="gives a random kawaii emoji.",aliases=["ka"])
async def kawaii_random(self,ctx,*,message=None,amount=1):
if me... |
import os
from setuptools import setup
from microbot import __version__
name = "microbot"
here = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(here, "README.md"), "r") as file:
long_description = file.read()
with open(os.path.join(here, "requirements.txt"), "r") as file:
install_requires... |
from cms.models import CMSPlugin
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
CLASS_NAMES = getattr(settings, "CMS_STYLE_NAMES", (
('info', _("info")),
('new', _("new")),
('hint', _("hint"))
)
)
class Style(CMSPlugi... |
from summit.strategies.base import Transform
from summit.experiment import Experiment
from summit.domain import *
from summit.utils.dataset import DataSet
import numpy as np
import pandas as pd
from scipy.integrate import solve_ivp
import os
import json
import requests
from requests.auth import HTTPBasicAuth
... |
import datetime
from functools import wraps, lru_cache
from time import time
from typing import Union, Type, Sequence, NamedTuple, Callable
import joblib
from ..functions import curry
from ..seq import as_seq
MemoryProvider = Callable[[str], joblib.Memory]
MEMORY_PROVIDER: MemoryProvider = None
PERIOD_ALIASES = {
... |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/05_data.block.ipynb (unless otherwise specified).
__all__ = ['DQN', 'TestDataset']
# Cell
# Python native modules
import os
# Third party libs
from fastcore.all import *
from fastai.torch_basics import *
from fastai.data.all import *
from fastai.basics import *
from tor... |
from functools import wraps
import inspect
def traceable(*args):
def _traceable(f):
@wraps(f)
def decorated(*args, **kwargs):
res = f(*args, **kwargs)
broker = EventBroker.get_instance()
# Create the initial dictionary with args that have defaults
a... |
# Copyright (c) 2022 PaddlePaddle 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 app... |
from django.db import models
from site_reserva import settings
import requests
class Pessoa(models.Model):
posto_graduacao_choices = (
('Gen Ex', 'Gen Ex'),
('Gen Div', 'Gen Div'),
('Gen Bda', 'Gen Bda'),
('Cel', 'Cel'),
('TC', 'TC'),
('Maj', 'Maj'),
('Cap', 'Cap'),
('1º Ten', '1º T... |
class Solution:
def recurse(self, num, target, index, prev, cur, val, s, ans):
if index == len(num):
if val == target and cur == 0:
ans.append(''.join(s[1:]))
return
cur = cur * 10 + int(num[index])
strop = str(cur)
if cur > 0:
sel... |
from django.conf import settings
from django.conf.urls import include
from django.contrib import admin
from django.urls import path
admin.autodiscover()
urlpatterns = [
path("admin/", admin.site.urls),
path("api/", include("evan.api.urls")),
path("", include("evan.site.urls")),
]
if settings.DEBUG:
... |
from pypy.interpreter.mixedmodule import MixedModule
class ErrorsModule(MixedModule):
"Definition of pyexpat.errors module."
appleveldefs = {}
interpleveldefs = {}
def setup_after_space_initialization(self):
from pypy.module.pyexpat import interp_pyexpat
space = self.space
# Th... |
from django.conf.urls import url
from rest_framework import routers
from cameras.views import CameraViewSet
router = routers.DefaultRouter()
router.register(r'camera', CameraViewSet)
urlpatterns = router.urls
|
import time
from playground.slam.frame import Frame
from playground.slam.posegraph import PoseGraph
class BackEnd:
def __init__(self, edge_sigma, angle_sigma):
self.__pose_graph = PoseGraph(edge_sigma_x=edge_sigma, edge_sigma_y=edge_sigma,
edge_sigma_angle=angle_sigm... |
import requests
import yaml
import json
import os
from pathlib import Path
class BaseClient:
CONFIG_PATH = Path(f"{str(Path.home())}/.datahen.yml")
def __init__(self, auth_token = None):
self._config = self._load_yaml_config()
self._init_token(auth_token)
self._base_headers = {
"Authorization":... |
class Solution(object):
def isPalindrome(self, a):
"""
:type s: str
:rtype: bool
"""
b=list(a)
c=[]
for i in range(len(b)):
if b[i].isalnum():
c.append(b[i].lower())
i=0
j=len(c)-1
loop=True
while j>... |
"""
The MIT License (MIT)
Copyright (c) 2018 Zuse Institute Berlin, www.zib.de
Permissions are granted as stated in the license file you have obtained
with this software. If you find the library useful for your purpose,
please refer to README.md for how to cite IPET.
@author: Gregor Hendel
"""
from PyQt4.QtGui impor... |
from algorithms.Pairwise.PairRank import PairRank
from utils.argparsers.simulationargparser import SimulationArgumentParser
from utils.datasimulation import DataSimulation
def func_pairrank(args, dir_name):
ranker_params = {
"learning_rate": args.lr,
"learning_rate_decay": args.lr_decay,
"... |
from player import Player # class for creating player character
class Action():
def __init__(self, method, name, hotkey, **kwargs):
self.method = method # function/method to be executed
self.hotkey = hotkey # hotkey to use action
self.name = name # display name
self.kwarg... |
'''
制作 m 束花所需的最少天数
给你一个整数数组 bloomDay,以及两个整数 m 和 k 。
现需要制作 m 束花。制作花束时,需要使用花园中 相邻的 k 朵花 。
花园中有 n 朵花,第 i 朵花会在 bloomDay[i] 时盛开,恰好 可以用于 一束 花中。
请你返回从花园中摘 m 束花需要等待的最少的天数。如果不能摘到 m 束花则返回 -1 。
示例 1:
输入:bloomDay = [1,10,3,10,2], m = 3, k = 1
输出:3
解释:让我们一起观察这三天的花开过程,x 表示花开,而 _ 表示花还未开。
现在需要制作 3 束花,每束只需要 1 朵。
1 天后:[x, _, _,... |
secret_message = [word for word in input().split()]
secret_message_parts_1 = []
secret_message_parts_2 =[]
for word in secret_message:
ascii_digits = ""
for el in word:
if el.isdigit():
ascii_digits += el
secret_message_parts_1.append(chr(int(ascii_digits)))
for word in secret_messag... |
# Copyright 2014 Cloudwatt
#
# Author: Jordan Pittier <jordan.pittier@cloudwatt.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
#
# Un... |
import warnings
import numpy as np
import pygsp as gsp
from pygsp import graphs, filters, reduction
import scipy as sp
from scipy import sparse
from sortedcontainers import SortedList
from loukas_coarsening.maxWeightMatching import maxWeightMatching
import loukas_coarsening.graph_utils as graph_utils
try:
import ma... |
# Generated by Django 2.0.4 on 2019-02-26 12:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('carPooling', '0012_auto_20190225_1123'),
]
operations = [
migrations.RemoveField(
model_name='carpoolingassdetail',
... |
#!/usr/bin/python
# -*- coding:utf-8 -*-
# **************************
# * Author : baiyyang
# * Email : baiyyang@163.com
# * Description :
# * create time : 2018/4/8下午4:53
# * file name : train_model.py
import tensorflow as tf
from rcnn_model import RCNN
import time
import os
import sys
import date... |
"""Legacy installation process, i.e. `setup.py install`.
"""
import logging
import os
import sys
from distutils.util import change_root
from pip._internal.exceptions import InstallationError
from pip._internal.utils.logging import indent_log
from pip._internal.utils.misc import ensure_dir
from pip._interna... |
from math import inf
from math import log
class nGrams(object):
def __init__(self):
self.value = {}
pass
def NGram(self, dictionary, poem, nGram):
Number_of_Ngrams = len(poem)-nGram+1
for position in range(Number_of_Ngrams):
words = []
for nWord in rang... |
# ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import sys
import os
import stat
import argparse
def process_cmd(ns):
ip = ns.ip
ip = ip.strip()
L = ip.split(".")
if len(L) == 4:
L2 = ["%02X" %int(x) for x in L]
print ip, " => ", " ".join(L2)
else:
v = int(ip, 0)
L = []... |
import os
from bkp_test_util import sync_testdir
from bkp_core import sync_mod,util,fs_mod
from io import StringIO
import time
import re
import math
def test_sync_mod_fs(sync_testdir):
""" test suite for the sync_mod testing for file system functionality """
do_sync_mod_test(sync_testdir,sync_testdir["remote_f... |
from injector import inject
from vc.command.base import BaseCommand
from vc.service.abme import AbmeService, AbmeOptions
class AbmeCommand(BaseCommand):
description = 'Runs abme on an input file'
args = [
{
'dest': 'first_file',
'type': str,
'help': 'First file',
... |
from ScriptingBridge import SBApplication, SBObject
import weakref
import struct
import shlex
import subprocess
import objc
from contextlib import contextmanager
from enum import Enum
from typing import Mapping
from typing import List, Optional, Generator
from collections import namedtuple
SIZE = namedtuple('Size', ('... |
from zentral.utils.apps import ZentralAppConfig
class ZentralSantaAppConfig(ZentralAppConfig):
name = "zentral.contrib.santa"
verbose_name = "Zentral Santa contrib app"
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the Android Application Usage history parsers."""
import unittest
from plaso.parsers import android_app_usage
from tests.parsers import test_lib
class AndroidAppUsageParserTest(test_lib.ParserTestCase):
"""Tests for the Android Application Usage History... |
# Generated by Django 2.2.3 on 2019-09-18 15:14
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('filebeat', '0004_auto_20190607_1533'),
]
operations = [
migrations.AlterField(
model... |
# coding: utf-8
import unittest
import muse.audio
class AudioTest(unittest.TestCase):
def test_parse_m4a_tags(self):
m4a_path = r"C:\Users\phone\Desktop\01 覚醒~Alternative Heart~.m4a"
m = muse.audio.Music(m4a_path)
self.assertTrue(m.tags.title == "覚醒~Alternative Heart~")
self.asser... |
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to us... |
from application import create_app # pragma: no cover
app = create_app() # pragma: no cover
if __name__ == '__main__': # pragma: no cover
app.run()
|
speed = 108
time = 12
dist = speed * time
print(dist)
# + Сложение 11 6 17
# - Вычитание 11 6 5
# * Умножение 11 6 66
# // Целочисленное деление 11 6 1
# % Остаток от деления 11 6 5
# ** Возведение в степень 2 3 8
goodByePhrase = 'Hasta la vista'
person = 'baby'
print(goodByePhrase + ', ' + person + '!')
answer = '2... |
"""
Utility module to use python logging uniformly.
usage:
```python
from deb.utils.logging import logger
logger.info("all good in the neighborhood!")
```
Author: Par (turalabs.com)
Contact:
license: GPL v3 - PLEASE REFER TO DEB/LICENSE FILE
"""
import logging
from logging import DEBUG, INFO, WARNING, WARN, ERROR,... |
class Language:
line_hashes = '###############################################'
line_apprx = '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
line_non_linux_distro = "This script must run in a Kali or any Linux distro.\nGood bye! :)\n"
line_not_python3 = "Need python3 to run this script\nGood bye! :)\... |
from eth_tester.exceptions import TransactionFailed
from pytest import fixture, mark, raises
from utils import longTo32Bytes, TokenDelta, EtherDelta, longToHexString, PrintGasUsed, AssertLog
from reporting_utils import proceedToNextRound, finalize, proceedToDesignatedReporting
def test_initial_report(localFixture, uni... |
from core.advbase import *
from slot.a import *
from slot.d import *
def module():
return Ramona
class Ramona(Adv):
a1 = ('primed_att',0.10)
a3 = ('bc',0.13)
conf = {}
conf['slots.a'] = Summer_Paladyns()+Primal_Crisis()
conf['slots.burn.a'] = Resounding_Rendition()+Elegant_Escort()
conf['a... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import logging
import os
from collections import defaultdict
logger = logging.getLogger(__name__)
FPS = 30
# AVA_VALID_FRAMES = range(902, 1799)
def load_image_lists(cfg, is_train):
"""
Loading image paths from c... |
from django.urls import path
from . views import *
from django.conf import settings
from django.conf.urls.static import static
urlpatterns=[
path('connect/',main,name="connect_caller"),
path('connect/file',calulate_distance_view,name="connect_caller"),
#path('connect/file/1',show_assistant,name="connect_ca... |
"""
modules for DQAS framework
"""
import sys
import inspect
from functools import lru_cache, partial
from multiprocessing import Pool, get_context
import functools
import operator
import numpy as np
import scipy as sp
import sympy
import tensorflow as tf
from typing import (
List,
Sequence,
Any,
Tuple... |
# File: fireeyeetp_consts.py
#
# Copyright (c) Robert Drouin, 2021-2022
#
# 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 ... |
{
"name": "Listado de Bancos Argentinos",
'version': '13.0.1.0.0',
'category': 'Localization/Argentina',
'sequence': 14,
'author': 'ADHOC SA',
'license': 'AGPL-3',
'summary': '',
'depends': [
'base',
],
'data': [
'data/res_bank.xml',
'views/l10n_ar_bank.xm... |
# coding=utf-8
"utility helper functions"
import os
import re
from elifetools import xmlio
from elifetools import utils as etoolsutils
# namespaces for when reparsing XML strings
XML_NAMESPACE_MAP = {
"ali": "http://www.niso.org/schemas/ali/1.0/",
"mml": "http://www.w3.org/1998/Math/MathML",
"xlink": "ht... |
# Generated by Django 3.1.12 on 2021-07-15 10:51
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Tour',
fields=[
('id', models.AutoField(au... |
from ..lib.utils import eprint
from .verilog_modeling import Bel, Site
# Mapping of IOB type to its IO ports
IOB_PORTS = {
"IBUF": ("I", ),
"IBUF_INTERMDISABLE": ("I", ),
"IBUF_IBUFDISABLE": ("I", ),
"OBUF": ("O", ),
"OBUFT": ("O", ),
"IOBUF": ("IO", ),
"IOBUF_INTERMDISABLE": ("IO", ),
... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Cloudbase Solutions SRL
# 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.ap... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-01-24 12:20
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('payouts', '0019_auto_20190110_1155'),
('payouts', '0020_auto_20190123_1731'),
]
ope... |
#coding: utf-8
from django.db import models
from django.utils import timezone
class Blog(models.Model):
short_name = models.SlugField(max_length=50, unique=True)
pub_date = models.DateTimeField(default=timezone.now())
blog_title = models.CharField(max_length=100)
blog_content = models.TextField()
... |
#!/usr/bin/env python3
# =====================
# Зависнуть у маркера
# =====================
import numpy as np
import cv2
import cv2.aruco as aruco
from aruco_calibration import Calibration as clb
import argparse
# ARGPARSER
parser = argparse.ArgumentParser()
parser.add_argument('--write', dest='write', action='st... |
import os
import testCoverage as coverage
CSS_CONTENTS = \
r"""
body {font-family: "Arial", san-serif;}
h1 {font-family: "Tahoma","Arial", sans-serif;
color: #333333;}
h3 {display: inline;}
h3.passed {text-decoration: none; display: inline;
color: black; background-color: lime; padding: 2px;}
a.pas... |
from model.game_object import GameObject
from model.missile import AbsMissile
from utils.geometry import Position
from visitor import Visitor
from abc import abstractmethod
from config import ENEMY_A_IMG
class AbstEnemy(GameObject):
def __init__(self, position: Position, icon_path: str, health: int, score_points:... |
# KidsCanCode - Game Development with Pygame video series
# Shmup game - part 1
# Video link: https://www.youtube.com/watch?v=nGufy7weyGY
# Player sprite and movement
import pygame as pg
from pygame.sprite import Sprite
import random
from os import path
from pathlib import Path
img_folder = Path("img")
bg_img = img_fol... |
import time
import torch
import torch.nn as nn
inputs = torch.randn(64, 751).cuda(0)
targets = torch.randint(0, 751, (64,), dtype=torch.int64).cuda(0)
logsoftmax = nn.LogSoftmax(dim=1)
while True:
inputs = torch.randn(64, 751).cuda(0)
targets = torch.randint(0, 751, (64,), dtype=torch.int64).cuda(0)
log... |
from django.urls import path
from .views import pdf_upload_view, pdf_upload, pdf_explore, single_pdf_view, search_results_pdf
from .views import delete_tag_from_image, edit_page_view, add_tag_to_image, update_caption_pdf_image, search_pdf_view
urlpatterns = [
path('pdf_upload_view/', pdf_upload_view, name="upload_... |
# -*- encoding:utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from abc import ABCMeta, abstractmethod
import logging
import time
from . import ABuXqFile
from ..CoreBu import env
# noinspection PyUnresolvedReferences
from ..CoreBu.ABuFixes impor... |
import decimal
from flask import Blueprint, Response, jsonify, request
from sqlalchemy import text
from db import db, create_session
from helpers.auth import user_required
from model.dataset_model import Dataset
from model.percentile_model import Percentile
from model.metadata_model import Metadata
from mod... |
import sys
import yaml
def smudge_or_clean(do_smudge):
try:
with open('secret.yml') as secret_yml:
secret = yaml.safe_load(secret_yml)
except FileNotFoundError:
secret = {}
for line in sys.stdin:
line = line.rstrip()
key = line.split('=', 1)[0].strip() if '=' in... |
"""
This part communicates with the database
Author: Max Marshall
Project: Fridge Tracker
"""
import datetime
import math
import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
import readings as read
import light_sensor as ls
import mario
cred = None
try:
... |
from django.conf.urls import url, include
import backend.view.specimenreportview as specimenreportview
import backend.view.specimenview as specimenview
import backend.view.specimenfcsfileview as specimenfcsfileview
import backend.view.specimengateview as specimengateview
urlpatterns = [
# manage specimen object
... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: github.com/metaprov/modelaapi/services/review/v1/review.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf impo... |
"""
This script generates and saves the states closest to the solved state.
It stores the results as an hd5 file as an array. See the code at the end
for how to load the data.
It stores three values (stored in parallel arrays).
- A bit array representing the state.
- A boolean array which marks all actions which... |
'''
:class:`GlycanComposition`, :class:`MonosaccharideResidue`, and :class:`SubstituentResidue` are
useful for working with bag-of-residues where topology and connections are not relevant, but
the aggregate composition is known. These types work with a subset of the IUPAC three letter code
for specifying compositions.
... |
import os
import pybullet as p
import pybullet_data
p.connect(p.GUI)
pandaUid = p.loadURDF(os.path.join(pybullet_data.getDataPath(), "franka_panda/panda.urdf"),useFixedBase=True)
while True:
p.stepSimulation() |
"""
LC 26
Given an array of sorted numbers,
remove all duplicates from it. You should not use any extra space;
after removing the duplicates in-place return the length of the subarray that has no duplicate in it.
Example 1:
Input: [2, 3, 3, 3, 6, 9, 9]
Output: 4
Explanation: The first four elements after removing th... |
#!/usr/bin/env python3
import argparse
import sys
import os
from ibonPrinter import IBON
def main():
parser = argparse.ArgumentParser(
prog='ibonprinter',
description='7-11 iBon printer uploader.'
)
parser.add_argument(
'--name',
type=str,
default=' ',
hel... |
from setuptools import setup
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 3",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Topic :: Software Development :: Libraries",
"Topic :: Utilities",
]
with open("READM... |
from collections import defaultdict
from hashlib import sha1
from typing import Any, List, Dict
from record import Record
def index_code(value: Any) -> int:
sha_obj = sha1(str(value).encode())
return int(sha_obj.hexdigest(), 16)
def create_index(
collection: Dict[int, Record],
attribute: str,
) ->... |
from azureml.core import Workspace, Run, Experiment
from api import TesApi
import pytest
from azureml.exceptions import ServiceException
import datetime
def test_init():
"""Tests if init function works"""
workspace = Workspace.from_config(path="./config", _file_name="workspace.json")
tes_api = TesApi(work... |
def run(**kwargs):
print('####################$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$##############################')
# if __debug__:
# kwargs.update(notebook='irisdataset')
notebook = kwargs['notebook']
out_notebook = kwargs['out_notebook']
import papermill as pm
pm.execute_notebook(
n... |
import torch.nn as nn
import torch.optim as optim
from losses import *
from data_utlis import ProteinNetDataset
from torch.utils.data import DataLoader
class ModelConfig():
def __init__(self, in_dim, linear_out=20, cell='LSTM',
num_layers=2,
alphabet_size=20,
... |
# -*- coding: utf-8 -*-
"""
Created on Fri May 10 18:48:12 2019
@author: DiPu
"""
file=open("romeo.txt")
counts = dict()
for line in file:
words = line.split()
for word in words:
if word not in counts:
counts[word] = 1
else:
counts[word] += 1
print(counts)
|
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
n1 = float(input('Primeira nota: '))
n2 = float(input('Segunda nota: '))
media = (n1 + n2) / 2
if media < 5:
print(f'Sua média foi de {media} e você está \033[31mREPROVADO\033[m.')
elif media >= 5 and media <= 6.9: # Também é possível utilizar elif 7 < media <= 5
print(f'Sua média foi de {media} ... |
# -*- coding: UTF-8 -*-
"""
This module is intend to solve the matrix equation
sum_i=1^r Ax_i X Ay_i = F
Where Ay_i are circulant matrices
Ax_i is in general are band matrices
"""
import numpy as np
from scipy.linalg import circulant, inv
from scipy.sparse import csr_matrix, diags
from scipy.sparse.linalg... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.