content stringlengths 5 1.05M |
|---|
# This python script allows the user to automate the configuration of the build
DEBUG=1
ENABLE_CORBA=1
ENABLE_LIVE=1
ENABLE_OMNIEVENTS=0
ENABLE_SHARED=0
ENABLE_OMNIORBPY=1
ENABLE_PHANTOM_MIDDLEWARE=0
ENABLE_JAVA=0
ENABLE_MOBILAB=0
|
# SPDX-FileCopyrightText: © 2020 The insulin-reminder Authors
# SPDX-License-Identifier: MIT
import datetime
import json
import flask
app = flask.Flask("Insulin Reminder")
@app.route("/status_led")
def status_led():
try:
with open("last_button_click.json", mode="rt") as f:
data = json.load... |
"""
Fill in annotation text_rendered column
Revision ID: d536d9a342f3
Revises: 39b1935d9e7b
Create Date: 2016-08-10 14:09:01.787927
"""
from __future__ import unicode_literals
from __future__ import print_function
import sys
from collections import namedtuple
from alembic import op
import sqlalchemy as sa
from sqla... |
import itertools
from .. import Dataset
class VoiceStatistics(Dataset):
def __init__(self):
self.endpoint = 'https://github.com/voice-statistics/voice-statistics.github.com/raw/master/assets/data'
self.actors = [
{'name': '土谷麻貴', 'slug': 'tsuchiya'},
{'name': '上村彩子', 'slug'... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0015_userextended_photo_or_video'),
]
operations = [
migrations.RenameField(
model_name='userextende... |
"""
===========================================
HOWTO: Using caching without using Workflow
===========================================
Using nipype in an imperative way: caching without workflow
Note that in the following example, we are calling command-lines with
disk I/O that persists across runs, but we never hav... |
import sys
from cryptography.fernet import Fernet
def crypt_text(key, text, encrypt=True):
try:
if encrypt:
# if no key was provided, one will be generated
if key == "no_key":
key = Fernet.generate_key()
token_w_key = Fernet(key)
text = token_... |
import tkinter
from tkinter import *
def select():
selection = f"Awesome option: {var.get()}"
label.config(text=selection)
window = tkinter.Tk()
var = IntVar()
radio_1 = Radiobutton(
window,
text="Music",
variable=var,
value=1,
command=select
)
radio_1.pack(anchor=W)
radio_2 = Radiobu... |
import unittest
import os, sys
sys.path.append(
os.path.abspath(
os.path.join(os.path.dirname(__file__), "..", "src")
)
)
from running_median import runningMedian
class Test_RunningMedian(unittest.TestCase):
def test_sample_case0(self):
self.assertEqual(
runningMedian([1, 2, 3... |
from numpy import ones, cumsum, diff, sqrt, tile, r_
from numpy.random import randn
def SimulateBrownMot(x0,tau,mu,sigma,j_):
# This function generates j_ simulated paths of an arithmetic Brownian
# Motion with drift.
# INPUTS
# x0 :[scalar] starting point
# tau :[vector](1 x k_) vector of... |
from .magic import cell_magic, arg
import paramiko, time, os
@arg("--out", type=str, default=None, help="store stdout in shell environment variable")
@arg("--err", type=str, default=None, help="store stderr in shell environment variable")
@arg("--password", type=str, default=None, help="password")
@arg("-p", "--port"... |
import itertools
import warnings
import networkx as nx
import numpy as np
import pandas as pd
from tqdm import tqdm
from AppGenerator import AppGenerator
from ServerlessAppWorkflow import ServerlessAppWorkflow
warnings.filterwarnings("ignore")
class PerfOpt:
def __init__(self, Appworkflow, generate_perf_profile=... |
import math
def calc_distance(lat1, lon1, lat2, lon2):
R = 6371000
phi_1 = math.radians(lat1)
phi_2 = math.radians(lat2)
delta_phi = math.radians(lat2 - lat1)
delta_lambda = math.radians(lon2 - lon1)
a = math.sin(delta_phi / 2.0) ** 2 + \
math.cos(phi_1) * math.cos(phi_2) * \
... |
# -*- coding: utf-8 -*-
"""Code for the Drug Explorer (DrugEx)."""
from pkg_resources import resource_filename
from drugex.core.util import Voc
VOC_DEFAULT = Voc(resource_filename('drugex.core', 'voc.txt'))
|
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import tensorflow as tf
# In[2]:
label_dict={"with_mask":0, "without_mask":1} #dictionary
# In[3]:
categories=["with_mask","without_mask"] #list
# In[4]:
label=[0,1]
# In[5]:
data_path="C:\\Users\\anush\\Documents\\dataset"
# In[6]:
i... |
import pygame
pygame.init()
pygame.mixer.music.load('ex021.mp3')
pygame.mixer.music.play()
while pygame.mixer.music.get_busy():
pygame.time.Clock().tick(1)
|
# -*- coding: utf-8 -*-
# Copyright (c) 2018 MIT Probabilistic Computing Project.
# Released under Apache 2.0; refer to LICENSE.txt.
from cgpm.utils.general import merged
from .categorical import Categorical
from .chain import Chain
from .crp import CRP
from .distribution import DistributionCGPM
from .finite_array i... |
"""
This module is based on a rox module (LGPL):
http://cvs.sourceforge.net/viewcvs.py/rox/ROX-Lib2/python/rox/mime.py?rev=1.21&view=log
This module provides access to the shared MIME database.
types is a dictionary of all known MIME types, indexed by the type name, e.g.
types['application/x-python']
Applications c... |
# pylint: disable=missing-docstring
import unittest
import numpy as np
import tensorflow as tf
import tf_encrypted as tfe
class TestFIFO(unittest.TestCase):
def setUp(self):
tf.reset_default_graph()
def test_fifo(self):
shape = (10, 10)
with tfe.protocol.Pond():
q = t... |
'''Desenvolva um programa que leia o comprimento de três retas e diga ao usuário se elas podem ou não formar um triângulo.'''
a=float(input('Digite o comprimeiro da primeira reta:'))
b=float(input('Digite o comprimeiro da segunda reta:'))
c=float(input('Digite o comprimeiro da terceira reta:'))
if a<b+c and b<a+c and ... |
import json
from rltk.io.reader import Reader
from rltk.io.io_utils import get_file_handler
class JsonLinesReader(Reader):
"""
`JSON Lines <http://jsonlines.org/>`_ Reader.
Args:
file_handler (str/io.IOBase): File name or file handler of input file.
ignore_blank_line (bool): If blan... |
# __init__.py so that modules can be imported
|
# -*- coding: utf-8 -*-
import base64
from blueapps.utils.esbclient import get_client_by_user
from pipeline.conf import settings
# from pipeline.components.utils import cc_get_ips_info_by_str
from pipeline.core.flow.activity import Service
from pipeline.component_framework.component import Component
JOB_SUCCESS = [3,... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import codecs
import os
from lazagne.config.DPAPI.masterkey import MasterKeyPool
from lazagne.config.DPAPI.credfile import CredFile
from lazagne.config.DPAPI.vault import Vault
from lazagne.config.DPAPI.blob import DPAPIBlob
from lazagne.config.write_output import print_debug... |
import jester_vectorize
import movieLens_vectorize
import osm_vectorize
import wiki_vectorize
import model |
import os
import sys
from projects.hub import UserHandler, PreviewHandler, StatsHandler, pre_spawn_hook, spawner_escape
c = get_config()
# This is the address on which the proxy will bind. Sets protocol, ip, base_url
c.JupyterHub.bind_url = 'http://:80'
# Listen on all interfaces
c.JupyterHub.hub_ip = '0.0.0.0'
# c... |
from keras.models import load_model
import numpy as np
import sys
import os
import pickle as pk
import pandas as pd
from keras.utils import to_categorical ,Sequence
from keras import losses, models, optimizers
from keras.activations import relu, softmax
from keras.callbacks import (EarlyStopping, LearningRateSchedule... |
from dancywindow import *
from os import listdir
img_seq = [f"./assets/img_seq/{filename}" for filename in listdir("./assets/img_seq")]
print(img_seq)
window = AnimatedSketchWindow("textured_static", winsize[0] / 2, winsize[1] / 2, 800, 800)
window.set_img_seq(img_seq)
while True:
mousex, mousey = get_mouse_posit... |
# adopted from
# https://github.com/openai/improved-diffusion/blob/main/improved_diffusion/gaussian_diffusion.py
# and
# https://github.com/lucidrains/denoising-diffusion-pytorch/blob/7706bdfc6f527f58d33f84b7b522e61e6e3164b3/denoising_diffusion_pytorch/denoising_diffusion_pytorch.py
# and
# https://github.com/openai/gu... |
from __future__ import annotations
from typing import List, Optional, Tuple, Union
from abstract.semantics import SemanticError
class Node:
pass
class DeclarationNode(Node):
pass
class ExpressionNode(Node):
def __init__(self, line, column) -> None:
self.line = line
self.column = colum... |
from RSAwienerHacker import hack_RSA
from multiPrime import solveMulti
from x509extractor import extractx509
|
from .Confirm import sendConfirm, verifyToken
|
import pygame
import sys
from random import randint
class Settings:
def __init__(self):
self.screen_width = 1024
self.screen_height = 768
self.bg_color = (255, 255, 255)
self.dude_speed_factor = 1.5
self.ball_speed_factor = 1.0
self.ball_direction = 1
... |
import uuid
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from app_config import save_config, get_config, DATABASE_CONFIG_FILE
from database import models
class DatabaseManager:
def __init__(self):
self.load_db_config()
self.databases = dict(sqlite=self.__generate_s... |
import json
import ipdb
import torch
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
from datasets import get_CIFAR10, get_SVHN,get_CIFAR100
from model import Glow
import sklearn.metrics
import numpy as np
device = torch.device("cuda")
output_folder = 'glow/'
model_name = 'glow_affine_coupling.pt'
w... |
#!/usr/bin/env python
import argparse
import os
import sys
import pickle
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('filename')
args = parser.parse_args()
if os.path.splitext(args.filename)[1] != '.abc':
# We can not read this file type
sys.exit(... |
import re
from textwrap import dedent
from .sectionfileparser import parse_section_file, Section, Type
def test_sectionfileparser():
example, result = re.findall(r'```(.*?)```', parse_section_file.__doc__ or '', re.M | re.S)
parsed = list(parse_section_file(dedent(example).lstrip()))
evaluated = eval(result.st... |
from force import drdt, dvdt
def integrate_Euler_step(r, v, h):
"""Euler method"""
return (r + h*drdt(r, v), v + h*dvdt(r, v))
def integrate_EulerCromer_step(r, v, h):
"""Euler-Cramer method"""
# Integrate
v_half = v + 0.5*h*dvdt(r, v)
r_tot = r + h*drdt(r, v_half)
v_tot = r + 0.5*h*dv... |
import os
import torch
from torch import nn
from torch.utils.data import DataLoader, random_split
from torchvision import transforms
import pytorch_lightning as pl
from pytorch_lightning.metrics.functional import accuracy
from torch.optim.lr_scheduler import LambdaLR, CosineAnnealingLR, OneCycleLR
from functools import... |
# Monty Hall Simulator - Single Thread
#######################################
# Author: Dave Auld
# Version: 1.2
# Date: 10th September 2018
# Description: Monty Hall Simulation
# using single thread.
#
# License: MIT
#######################################
import argparse # ar... |
from __future__ import annotations
from typing import TYPE_CHECKING
from dataclasses import dataclass
from copy import deepcopy
import itertools
if TYPE_CHECKING:
GRID = list[list[bool]]
TEST_INPUT = """6,10
0,14
9,10
0,3
10,4
4,11
6,0
6,12
4,1
0,13
10,12
3,4
3,0
8,4
1,10
2,14
8,10
9,0
fold along y=7
fold along x... |
import sys
import third_party
import a
print(sys, third_party, a) |
# BLUI v0.8.6
import bpy, os, urllib.request, addon_utils
from bpy.app.handlers import persistent
@persistent
def load_handler_for_preferences(_):
print("Changing Preference Defaults!")
string = bpy.app.version_string
blenderversion = string.rstrip(string[-2:])
template_folder = str(os.pat... |
import datetime
GAME_QUEUE = [
{'unit': 'Militia', 'timestamp': datetime.time(0, 6, 40)},
{'unit': 'Militia', 'timestamp': datetime.time(0, 7, 0)},
{'unit': 'Militia', 'timestamp': datetime.time(0, 7, 0)},
{'unit': 'Scout Cavalry', 'timestamp': datetime.time(0, 9, 30)},
{'unit': 'Scout Cavalry', '... |
"""Server Anti-Raid, developed by ACPlayGames!"""
import json
import discord
from discord.ext import commands
async def get_prefix(bot_, message):
"""Returns the appropriate prefix for the bot."""
with open('./data/options.json', 'r') as options_file:
options_dict = json.load(options_file)
if m... |
from django.db.models.signals import post_save, pre_delete, pre_save
from django.dispatch import receiver
import auditor
from constants.jobs import JobLifeCycle
from db.models.notebooks import NotebookJob, NotebookJobStatus
from event_manager.events.notebook import (
NOTEBOOK_FAILED,
NOTEBOOK_NEW_STATUS,
... |
from src import *
some_data = gettingData()
check = input("Choose:")
if check:
curName = input(" Currency name:")
scrapper = getRequest(curName)
for i in scrapper:
print(i)
|
# This file is part of NEORL.
# Copyright (c) 2021 Exelon Corporation and MIT Nuclear Science and Engineering
# NEORL is free software: you can redistribute it and/or modify
# it under the terms of the MIT LICENSE
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED... |
import numpy as np
from opytimark.markers import two_dimensional
def test_ackley2():
f = two_dimensional.Ackley2()
x = np.array([0.5, 0.5])
y = f(x)
assert np.round(y, 2) == -173.62
def test_ackley3():
f = two_dimensional.Ackley3()
x = np.array([0.682584587365898, -0.36075325513719])
... |
import json
import imageio
import numpy as np
FILES = ["EasyStandard.dat"]
RATIO = 16 # length of a beat in BeatWalls units
SCALE = 0.05
THICKNESS = 0.1
SCROLL_DIST = 8
LETTER_SPACING = 2
DIV_WALL_WIDTH = 0.2
DIV_WALL_HEIGHT = 5
def load_font():
alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,'... |
import tkinter as t
import config.Parametro as param
from tkinter import ttk
from tela.CadastrarProjeto import cadastrarProjeto as CP
from util.binario import Dados as dd
from util.GerenciadorRecurso import GerenciadorRecurso as gr
from PIL import ImageTk
from PIL import Image
import shelve
from config.Parametro import... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello, world")
application = tornado.web.Application([
(r"/", MainHandler),
])
if __name__ == "__main__":
port = int(sys.argv... |
# Copyright 2021 MosaicML. All Rights Reserved.
import functools
import logging
import math
import warnings
from abc import ABC
from dataclasses import asdict, dataclass
from typing import TYPE_CHECKING, List, Union
import yahp as hp
from torch.optim.lr_scheduler import LambdaLR
from composer.core import State
from ... |
import sensor_read
import senstonote
import queue
from collections import deque
import numpy as np
import time
def main(simflag, pressflag, flexflag, chordflag, pnotes, fnotes):
# Variables
sensq = queue.Queue()
dataq = queue.Queue()
pressq = deque(maxlen = 50)
flexq = deque(maxlen = 50)
imuq... |
__version__ = '1.1.1'
from .io.load_geo import load_geo
from .io.load_dist import load_dist
from .io.load_price import load_price
from .map.carte_interactive import trajet
from .price_distribution.distribution import *
from .graph.graph import kmin_cost_out
|
import os, sys
import argparse
from collections import defaultdict
import numpy as np
from netCDF4 import Dataset
import adios2
try:
from mpi4py import MPI
if MPI.COMM_WORLD.Get_size() > 1:
parallel = True
else:
parallel = False
except ImportError:
parallel = False
def progress(cou... |
import pandas as pd
from visions.core.implementations import visions_complete_set
from visions.core.functional import type_cast_frame, type_inference_frame
from visions.application.summaries.summary import CompleteSummary
# Load dataset
df = pd.read_csv("https://www.opendisdata.nl/download/csv/01_DBC.csv")
df["JAAR"... |
####################################################################################################################
# Example code for controlling V-Rep using the remote API
# This is based on the old API (Legacy API) rather than the new API (BlueZero API)
# Read here for the Legacy API: http://www.coppeliarobotics.co... |
# -*- coding: utf-8 -*-
import Background
import Knil
from Tools import *
import xml.etree.ElementTree as ET
import Dialog
import Event
import Quest
def create(xml_file_path):
assert isinstance(xml_file_path, str)
root = ET.parse(xml_file_path).getroot()
pnjs= dict()
for p in root.findall("P... |
# -*- coding: utf-8 -*-
#
# Copyright 2017-2018 - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in c... |
#!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2020 FABRIC Testbed
#
# 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 ... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals, print_function
from astropy.extern import six
from astropy.utils.compat.odict import OrderedDict
import numpy as np
import yaml
from . constants import YAML_TA... |
import argparse
import pandas as pd
import os
ap = argparse.ArgumentParser()
ap._action_groups.pop()
required = ap.add_argument_group('required arguments')
optional = ap.add_argument_group('optional arguments')
required.add_argument("-x",
type = str,
metavar = "XLSX_FILE",
help = "Pot do datoteke XLSX s seznamom... |
from typing import NewType, Tuple
import stat
import cli_ui as ui
from path import Path
import tsrc.executor
Copy = NewType('Copy', Tuple[str, str])
class FileCopier(tsrc.executor.Task[Copy]):
def __init__(self, workspace_path: Path) -> None:
self.workspace_path = workspace_path
def on_start(self... |
from holoviews.element import Distribution
from .testplot import TestPlotlyPlot
class TestDistributionPlot(TestPlotlyPlot):
def test_distribution_filled(self):
dist = Distribution([1, 1.1, 2.1, 3, 2, 1, 2.2])
state = self._get_plot_state(dist)
self.assertEqual(state['data'][0]['type'], ... |
# -*- coding: utf-8 -*-
from fastapi import APIRouter
from fastapi import Path
from starlette.responses import PlainTextResponse
from starlette.responses import Response
from httpbin.helpers import status_code_response
from httpbin.helpers import weighted_choice
router = APIRouter()
@router.api_route(
'/status/... |
from __future__ import unicode_literals
default_app_config = 'reviewboard.oauth.apps.OAuthAppConfig'
|
"""
Setup module.
"""
from setuptools import setup, find_packages
import tq_recursive_scroll_scrape
def long_description():
"""
Returns the text of the readme.
:return: The text of the readme.
"""
with open("README.md", encoding="utf-8") as file:
return file.read()
setup(
name="tq-re... |
# encoding =utf-8
from os import path
import codecs
from setuptools import setup, find_packages
setup(
name='bert_encoder',
version='0.1.1',
description='convert text to vector via pretrained bert model',
url='https://github.com/4AI/bert-encoder',
long_description=open('README.md', 'r', encoding='... |
import os
from multiprocessing import Pool
from itertools import starmap
from .utils import (Spinner, Timer, pluralize, calculate_all_turns,
save_results, get_monopoly_cls, generate_games, play_game)
# This is needed to turn off multiprocessing when built with Nuitka.
# No matter what I tried I cou... |
import random
import time
from threading import Thread
import redis
class QueueMessageWorker(Thread):
def __init__(self, conn, delay):
Thread.__init__(self)
self.conn = conn
self.delay = delay
def run(self):
while True:
message = self.conn.brpop("queue:")
... |
import sys
from collections import namedtuple
import random
import jsons as jsons
from PIL import Image
# Determination of dominant colors by the k-means method
# source https://habr.com/ru/post/156045/
# point - 3D point in RGB space (coords)
# with associated number of uses in the original image (count)
# and numb... |
#!/usr/bin/env python3
# coding:utf-8
class Solution:
def multiply(self, A):
n = len(A)
left = [1] * n
right = [1] * n
B = [0] * n
for i in range(n-1):
left[i+1] = left[i] * A[i]
right[n-2-i] = right[n-1-i] * A[n-1-i]
for i in range(... |
# Generated by Django 4.0 on 2022-01-25 21:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0007_remove_warehousereply_files_alter_ticketimage_ticket_and_more'),
]
operations = [
migrations.AlterField(
model_name='... |
from rubik_solver.Move import Move
from rubik_solver.NaiveCube import NaiveCube
from rubik_solver.Cubie import Cube
from rubik_solver.Solver import Kociemba
import timeout_decorator
import unittest
class TestKociembaSolver(unittest.TestCase):
@timeout_decorator.timeout(300)
def _test_solution(self, c):
... |
class LRUCache:
def __init__(self, capacity: int):
self.capacity = capacity
self.cache = {}
self.priority = []
def get(self, key: int) -> int:
if key not in self.priority:
return -1
self.priority.remove(key)
self.priority.append(key)
retu... |
def bridge_problem(here):
here = frozenset(here) | frozenset(['light'])
explored = set() # set of states we have visited
# State will be a (peoplelight_here, peoplelight_there) tuple
# E.g. ({1, 2, 5, 10, 'light}, {})
# path = (state, (action, total_cost), state, ... )
frontier = [ [(here, froze... |
import numpy as np
def sigmoid(x):
return 1.0 / (1.0 + np.exp(-x))
def sigmoid_prime(x):
return sigmoid(x) * (1.0 - sigmoid(x))
def tanh(x):
return np.tanh(x)
def tanh_prime(x):
return 1.0 - x**2
def softplus(x):
return np.log(1.0 + np.exp(x))
class AutoEncoder:
def __init__(self, s1, s2,... |
import os
# Add parent directory for imports
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.sys.path.insert(0, parentdir)
import boto.swf
import settings as settingsLib
import log
import time
import importlib
from optparse import OptionParser
import provider.simpleDB as dblib
import provid... |
import sys
from yaku.scheduler \
import \
run_tasks
from yaku.context \
import \
get_bld, get_cfg
from yaku.conftests.fconftests \
import \
check_fcompiler, check_fortran_verbose_flag, \
check_fortran_runtime_flags, check_fortran_dummy_main, \
check_fortran_mangling... |
import unittest
from max_heap import max_heap
class TestMaxHeap(unittest.TestCase):
def setUp(self):
self.max_heap = max_heap.MaxHeap(100)
self.max_heap.heap = [i for i in range(100, 90, -1)]
self.max_heap.heap_size = 10
def test_get_max(self):
self.assertEqual(self.max_heap.g... |
from mathematics import *
import random
p, q = 7, 11
n = p * q
print('n:', n)
phi_n = totient(n)
print('totient:', phi_n)
phi_n_list = relatively_prime_numbers(phi_n)
print('relatively prime numbers to phi(n):', phi_n_list)
# e = phi_n_list[random.randint(0, len(phi_n_list))]
e = 13
print('e:', e)
d = multiplicative_... |
coco_download_link = ['wget http://images.cocodataset.org/annotations/image_info_test2014.zip',
'wget http://images.cocodataset.org/annotations/image_info_test2015.zip',
'wget http://images.cocodataset.org/annotations/annotations_trainval2014.zip',
'wget http://images.cocodataset.org/annotations/panoptic_annotations_tr... |
import logging
import time
import typing
import unittest
import bs4
from src.main import main
from src.database import Database, DatabaseItem
from src.search import Search
from src.html import HtmlOutput, HtmlItem
from tests.common import TestBase
LOG = logging.getLogger("test")
class DataItem(DatabaseItem, HtmlI... |
#
# Copyright (C) 2020 Satoru SATOH <satoru.satoh@gmail.com>.
# SPDX-License-Identifier: MIT
#
r"""Find network nodes.
"""
from __future__ import absolute_import
import collections.abc
import functools
import networkx
from . import netutils, utils
from .network import NODE_ANY
def validate(cnf, filepath='N/A'):
... |
"""This is a bot class which moves around the grid."""
import numpy as np
path = "../assets/ascii/text"
class Bot:
"""It is a moving object on the start screen in the white box."""
def __init__(self, x: int, y: int, facing: str = str("right"), botfile: str = str("bot.txt")) -> None:
"""Bot is an ent... |
#!/bin/env python
# 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, software
# d... |
import pyximport, numpy
pyximport.install(setup_args={'include_dirs': numpy.get_include()})
from .fatafl import Game
|
#!/usr/bin/env python
METADATA = dict(
name='django-socialregistration',
version='0.4.1',
author='Alen Mujezinovic',
author_email='alen@caffeinehit.com',
description='Django application enabling registration through a variety of APIs',
long_description=open('README.rst').read(),
url='http:/... |
from pathlib import Path
from uteis import *
from uteis.textos import *
def bt_armeno():
global bandeira_armeno
bandeira_armeno = PhotoImage(file="img/armenia.png")
janela = JanelaIdioma("Armênio", armeno, bandeira_armeno).criar_janela()
def bt_arabe():
global bandeira_arabe
bandeira_arabe = Ph... |
import discord
from discord.ext import commands
class Cog(commands.Cog):
def __init__(self, bot):
self.bot=bot
@commands.Cog.listener()
async def on_message(self, message :discord.Message):
ad_channel_id = 572737509923225600
if message.author.bot or not message.channel.id == ad_c... |
#
# Venn
#
# Copyright (c) 2019 Payson Wallach
#
# Released under the terms of the Hippocratic License
# (https://firstdonoharm.dev/version/1/1/license.html)
#
from venn import command
class ListCommand(command.BaseCommand):
"""
List virtual environments
list
{--a|all : List all virtual environm... |
# pylint: skip-file
# type: ignore
# -*- coding: utf-8 -*-
#
# tests.test_utilities.py is part of The RAMSTK Project
#
# All rights reserved.
# Copyright 2007 - 2017 Doyle Rowland doyle.rowland <AT> reliaqual <DOT> com
"""Test class for testing the Utilities module algorithms and models."""
# Standard Library Im... |
# Copyright (c) 2018, Daniele Venzano
#
# 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 w... |
import os
from tqdm import tqdm
import cleantext
from german_lemmatizer import lemmatize
from joblib import Parallel, delayed
def clean(x, **kwargs):
return cleantext.clean(x, lang="de", **kwargs)
def first_clean(x):
return clean(x, lower=False, no_line_breaks=True)
def second_clean(x):
return clean... |
## Copyright (c) 2016 Upstream Research, Inc. All Rights Reserved. ##
## Subject to an 'MIT' License. See LICENSE file in top-level directory ##
## #python-3.x
## python 2 does not work due mostly to issue with csv and io modules with unicode data
help_text = (
"CSV-JSON tool version 20170215\n"
"Transl... |
#!/usr/bin/python
from panonoctl import panono
import urllib2
import os
cam = panono.panono()
cam.connect()
print(cam.auth())
print(cam.getStatus())
upfs = cam.getUpfs()
for i in upfs['result']['upf_infos']:
print i['upf_url']
attempts = 0
while attempts < 3:
try:
response = urllib2... |
#!/bin/python3
# author: Jan Hybs
import random
import string
import typing
import hashlib
def random_string(l):
return ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(l))
def ensure_iterable(it) -> typing.List[typing.Any]:
if it is None:
return []
if isinstance(i... |
from .describers import (
WaveDescriber,
FlacDescriber,
MP3Describer
)
|
import click
from ckan_cloud_operator import logs
from . import manager
@click.group()
def cluster():
pass
@cluster.command()
@click.option('--values-yaml')
def create(values_yaml):
"""Create a Kamatera cluster using given values yaml file"""
manager.create(values_yaml)
@cluster.command()
@click.argum... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.