content stringlengths 5 1.05M |
|---|
import cv2
import io
import math
import numpy as np
import statistics
import s3_utils
from PIL import Image
def resize_with_aspect_ratio(image, width=None, height=None, inter=cv2.INTER_AREA):
dim = None
(h, w) = image.shape[:2]
if width is None and height is None:
return image
if width is No... |
#!/usr/bin/env python
import roslib; roslib.load_manifest('oled_ros')
import sys
import time
import rospy
from std_msgs.msg import String
if __name__ == '__main__':
rospy.init_node('pub_oled')
pub = rospy.Publisher("status", String, latch=True, queue_size=1)
msg = String()
msg.data = str(sys.argv[1])
#msg... |
import os
import errno
from multiprocessing.pool import Pool
from tqdm import tqdm
import requests
from PIL import Image
def download(pid, image_list, base_url, save_dir, image_size=(512, 512)):
colors = ['red', 'green', 'blue', 'yellow']
for i in tqdm(image_list, postfix=pid):
img_id = i.split('_', ... |
# roughly
# [print(bin(ord(x)).replace("0b", "")) for x in "Hello, world!\0\0\0"]
# python3 txtmunge.py --rotate 90 --flipy --invert hello1.txt test/tutorial1.txt
|
import numpy as np
import cantera as ct
import pyutils.ctutils as pc
import pyutils.filename as fn
from scipy.special import erfc
class PremixedFlameState:
def __init__(self, flame, fuel, oxidizer={'O2':1., 'N2':3.76}, T=None):
self.flame = flame
self.fuel = pc.gas.parser_stream(fuel)
sel... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-01 10:42
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('web', '0005_auto_20160131_2038'),
]
operations = [
migrations.RenameField(
... |
import torchvision
import torchvision.transforms as T
import torch
import numpy as np
import cv2
import requests
model = torchvision.models.detection.maskrcnn_resnet50_fpn(pretrained=True)
class Model:
def __init__(self,confidence_thresh=0.6):
self.model = torchvision.models.detection.maskrcnn_resnet50_fp... |
from math import log
def dataRange(X):
"""
Accepts a list of lists (X) and returns the "column" ranges. e.g.
X = [[8,7,3],
[4,1,9],
[5,6,2]]
dataRange(X) # returns: [ [4,8], [1,7], [2,9] ]
"""
def col(j):
return map(lambda x: x[j], X)
k = len(X[0]) # number ... |
# chat/consumers.py
from time import time
import json
from main.game.especialMoves import EnPassant
from main.game.game import selectPiece
from main.game.ConvertStringArray import arrayToStringallPieces, arrayTostring, stringToArray, arrayToHistory
from asgiref.sync import async_to_sync
from channels.generic.websocket... |
import os
import ray
import numpy as np
from glob import glob
import cv2
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--videos-path", type=str, default="./HMDB51_videos/")
parser.add_argument("--frames-path", type=str, default="./HMDB51_frames/")
parser.add_argument("--flows-path", type=str,... |
# coding=utf-8
# import modular
import bisect
import json
import matplotlib.pyplot as plt
import numpy as np
import os
import os.path
import pickle
import sys
from sklearn.manifold import MDS
from sklearn.manifold import TSNE
# define variables
CACHENAME_TD_MATRIX = "cache-td-matrix.pickle"
DIRNAME_NE... |
#This is a Nipype generator. Warning, here be dragons.
import sys
import nipype
import nipype.pipeline as pe
import nipype.interfaces.io as io
import nipype.interfaces.ants as ants
import nipype.interfaces.afni as afni
import nipype.interfaces.fsl as fsl
WorkingDirectory = "~/Porcupipelines/ThisStudy"
#Generic datagr... |
import setuptools, os, sys
import patch
with open("README.md", "r") as fh:
long_description = fh.read()
# Collect all files recursively from the data folder
data_folder = os.path.abspath(os.path.join(os.path.dirname(__file__), "patch", "data"))
data_files = []
for (dirpath, dirnames, filenames) in os.walk(data_fo... |
from typing import Any, Generator
def divisor_sum(number: int) -> int:
return sum(i for i in range(1, (number//2) + 1)
if number % i == 0)
def calculate_abundant_numbers(limit: int) -> Generator[int, Any, None]:
for x in range(1, limit):
if divisor_sum(x) > x:
yield x
de... |
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, Input, Activation, BatchNormalization
from tensorflow.keras import optimizers
from tensorflow.keras.optimizers.schedules import ExponentialDecay
from tensorflow.keras import backend as K
import ti... |
from stringfuzz.parser import parse
__all__ = [
'nop',
]
# public API
def nop(ast):
return ast
|
#!/usr/bin/evn python
# -*- coding: utf-8 -*-
# python version 2.7.6
import os,hashlib,datetime,logging
logging.basicConfig(filename = "md5.log",level = logging.INFO,format='[%(asctime)s %(levelname)s] %(message)s',datefmt='%Y%m%d %H:%M:%S')
#计算大文件的MD5
def getBigFileMD5(filePath):
m = hashlib.md5()
with open(fileP... |
#!/usr/bin/python3
import time
print("Start: %s" % time.ctime())
time.sleep(18)
print("End : %s" % time.ctime())
|
"""Firebase firestore services"""
import firebase_admin
from firebase_admin import firestore
from firebase_admin import credentials
class FirebaseService:
"""class holding all needed firestore operations
"""
def __init__(self):
"""initialize firebase firestore client.
"""
fireb... |
#
# PySNMP MIB module ACCORD-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ACCORD-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:12:42 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:... |
from persistry.plugins.generic import GenericProfile2
class PluginClass(object):
def __init__(self, hive_object):
self.hive = hive_object
self.result = []
def process_plugin(self):
current = self.hive.current_control_set
paths = ["Microsoft\\Windows NT\\CurrentVersion\\Winlogon\... |
#!/usr/bin/env python
import RPi.GPIO as GPIO
import subprocess
import time
GPIO.setwarnings(False) # Ignore warning for now
GPIO.setmode(GPIO.BCM) # Use Broadcom pin numbering
GPIO.setup(10, GPIO.OUT, initial=GPIO.LOW)
while (True):
time.sleep(1)
ps = subprocess.Popen(['iwgetid'], stdout=subprocess.PIPE, std... |
# Simple:
# a --> b
# --> c --> d
# --> d
graph1 = {
"a": ["b", "c", "d"],
"b": [],
"c": ["d"],
"d": []
}
# 2 components
graph2 = {
"a": ["b", "c", "d"],
"b": [],
"c": ["d"],
"d": [],
"e": ["g", "f", "q"],
"g": [],
"f": [],
"q": []
}
# cycle
graph3 = {
"a": ["b... |
{% if cookiecutter.use_bfio -%}
from bfio.bfio import BioReader, BioWriter
import bioformats
import javabridge as jutil
{%- endif %}
import argparse, logging, subprocess, time, multiprocessing, sys
import numpy as np
from pathlib import Path
if __name__=="__main__":
# Initialize the logger
logging.basicConfig(... |
import pickle as pkl
import os.path
import geopandas as gpd
import pandas as pd
import pandas_explode
pandas_explode.patch() # adds a `df.explode` method to all DataFrames
# above should be removed for Python 3.8 but as long as we're using
# dash we're on 3.7
import shapely
from shapely.geometry import Point, LineStr... |
from __future__ import unicode_literals
import requests
from requests.compat import urljoin
CLIENT_ID = '1e51d85f1b6d4025b6a5aa47bc61bf1c'
CLIENT_SECRET = 'af02034c5808483f9c09a693feadd0d6'
DISK_BASE_URL = 'https://cloud-api.yandex.net/v1/disk/'
OAUTH_TOKEN_URL = 'https://oauth.yandex.com/token'
SHORTLINK_URL = 'htt... |
import kdb
import socket
"""
Usage:
> sudo kdb mount file.ini /python python script=/path/to/dns_plugin.py
> kdb meta-set user:/python/my_hostname check/dns ''
> kdb set user:/python/my_hostname www.libelektra.org
"""
META_DNS_NAME = "meta:/check/dns"
def get_ipv4_by_hostname(hostname) -> bool:
return bool([
... |
colors = ['yellow', 'blue', 'red']
for color in colors:
print color
|
#!/usr/bin/env python
'''
MIT License
Copyright (c) 2017 Tairan Liu
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 use, copy, mod... |
# ======================================================================
# Syntax Scoring
# Advent of Code 2021 Day 10 -- Eric Wastl -- https://adventofcode.com
#
# Python implementation by Dr. Dean Earl Wright III
# ======================================================================
# ===========================... |
from . import data_structures |
import sys
import dataclasses
import string
from typing import Optional, List
source = ''
source_index = 0
tokens = []
token_index = 0
def get_char() -> Optional[str]:
global source, source_index
if source_index == len(source):
# byte でなくstrをとりあえず返すので
# 0として判断できるようなNoneを返す
return None... |
import glob
import sys
import os
import posixpath
import time
import numpy
from matplotlib.pyplot import subplots, colorbar
import pyFAI, pyFAI.units
from pyFAI.test.utilstest import UtilsTest
import fabio
from matplotlib.colors import LogNorm
import scipy.optimize
from pyFAI.opencl.peak_finder import OCL_PeakFinder
im... |
# Generated by Django 2.2.4 on 2019-08-11 14:27
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Intern',
f... |
from scitools.all import *
x0 = 100 # initial amount of individuals
M = 500 # carrying capacity
rho = 4 # initial growth rate in percent
N = 200 # number of time intervals
index_set = range(N+1)
x = zeros(len(index_set))
# Compute solution
x[0] = x0
for n in index... |
import math
import os
import numpy as np
from brainex.experiments.harvest_setup import generate_exp_set_from_root, run_exp_set_GENEX, generate_ex_set_GENEX
def run_gx_test(dataset_path, output_dir, dist_types, ex_config, mp_args):
"""
The start and end parameter together make an interval that contains the da... |
# thumbnail.py
#
# GameGenerator is free to use, modify, and redistribute for any purpose
# that is both educational and non-commercial, as long as this paragraph
# remains unmodified and in its entirety in a prominent place in all
# significant portions of the final code. No warranty, express or
# implied, is made reg... |
import os
import subprocess
from pathlib import Path
from typing import List
from testrunner.GradleFinder import GradleFinder
class TestSuiteRunner:
def __init__(self, couchEditRoot: str = None):
gradleFinder = GradleFinder(couchEditRoot)
self.__gradlePath = gradleFinder.getGradleExecutablePath()... |
__author__ = 'luissaguas'
from frappe.celery_app import celery_task
import frappe
pubsub = None
def publish(channel, message):
from frappe.async import get_redis_server
r = get_redis_server()
r.publish(channel, message)
def get_redis_pubsub():
from frappe.async import get_redis_server
global pubsub
if no... |
# -*- coding: utf-8 -*-
"""
Copyright ©2017. The Regents of the University of California (Regents). All Rights Reserved.
Permission to use, copy, modify, and distribute this software and its documentation for educational,
research, and not-for-profit purposes, without fee and without a signed licensing agreement, is
he... |
import torchvision.models as models
from pytorch_lightning.metrics.functional import accuracy
from torchvision.io import read_image
from skimage import io
import numpy as np
import pandas as pd
import os
from PIL import Image
from sklearn.utils import shuffle
from glob import glob
from sklearn.model_selection import t... |
#########################################################################
# -*- coding:utf-8 -*-
# File Name: ma.py
# Author: wayne
# mail: @163.com
# Created Time: 2015/8/27 9:46:34
#########################################################################
#!/bin/python
f = lambda x:x*x
print f(3)
t = map(f, [1,2,3,4]... |
#!/usr/bin/env python
#
# Copyright (c) 2016-2017 Nest Labs, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licen... |
from setuptools import setup, find_packages
setup(
name="MinkLoc3D",
version="0.0.1",
packages=find_packages(),
)
|
import torch
import torch.nn as nn
from torch_geometric.nn.glob.glob import global_mean_pool
from utils.models import unsorted_segment_sum
class EGNNEncoder(nn.Module):
"""PyTorch version of EGNN, mostly lifted from original implementation.
Sources:
- EGNN paper: https://arxiv.org/abs/2102.09844
... |
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
import json
from pykafka import KafkaClient
from scrapy.crawler import Crawler
from spiders import settings
from spiders.ite... |
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
from plot_2d_from_json import plot_community
from tqdm import tqdm
import json
import os
if __name__ == '__main__':
os.makedirs('image_data', exist_ok=True)
canvas_size = 1000
with open('ReCo_json.json', encoding='utf-8') as f:
data = json.l... |
try:
from django.conf.urls import patterns, url, include
except ImportError:
from django.conf.urls.defaults import *
urlpatterns = patterns('',
url(r'^', include('ratings.urls')),
)
|
# async
import asyncio
import random
async def marge(cookiejar, n):
for x in range(n):
print('marge producing {}/{}'.format(x+1, n))
await asyncio.sleep(random.random())
cookie = str(x+1)
await cookiejar.put(cookie)
async def homer(cookiejar):
while True:
... |
import numpy as np
from scipy import stats
'''
Distributions for prior weight precision (tausq_inv), defined as classes.
constant: Prior precision (tausq_inv) is treated as constant, i.e.
there is no attempt to change the initial hyperparameter values.
ard: Automatic relevance determination, i.e. the model tries... |
from ansible.parsing.dataloader import DataLoader
from ansible.template import Templar
import pytest
import os
import testinfra.utils.ansible_runner
import pprint
pp = pprint.PrettyPrinter()
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
... |
# -*- coding: utf-8 -*-
# Copyright (c) Polyconseil SAS. All rights reserved.
from __future__ import unicode_literals
import json
import os
import os.path
from dokang import api
from . import compat
def get_harvester(fqn):
module_fqn, function_fqn = fqn.rsplit('.', 1)
# Hack around https://bugs.python.org/... |
# Copyright (C) Microsoft Corporation. All rights reserved.
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# -*- codi... |
import pickle
import os
import re
import shutil
import subprocess
from functools import lru_cache
from typing import List, Tuple
from .column_model import CorrelationClusteringColumn
from .emd_utils import intersection_emd, quantile_emd
from .quantile_histogram import QuantileHistogram
from ...data_sources.base_column... |
from mygrad.tensor_base import Tensor
from .ops import MoveAxis, Roll, SwapAxes, Transpose
__all__ = ["transpose", "moveaxis", "swapaxes", "roll"]
def transpose(a, *axes, constant=False):
""" Permute the dimensions of a tensor.
Parameters
----------
a : array_like
The tensor... |
from pydantic import BaseModel
class BookGenre(BaseModel):
id: int
name: str
class BookGenreIn(BaseModel):
name: str
|
from pamqp.heartbeat import Heartbeat
from pamqp.commands import Connection
import amqpstorm
from amqpstorm import AMQPConnectionError
from amqpstorm.channel0 import Channel0
from amqpstorm.tests.utility import FakeConnection
from amqpstorm.tests.utility import FakeFrame
from amqpstorm.tests.utility import TestFramewo... |
g_id = 0
class Process:
def __init__(self, burst_time, arrival_time = 0, priority = 0):
global g_id
self.id = g_id
g_id += 1
self.priority = priority
self.burst_time = burst_time
self.arrival_time = arrival_time |
class Solution:
def exclusiveTime(self, n: int, logs: List[str]) -> List[int]:
ans = [0] * n
stack = []
prev = 0
for each in logs:
func, start_end, time = each.split(':')
func, time = int(func), int(time)
if start_end == 'start':
if... |
#!/usr/bin/env python
import json
import tweepy
from ryver import Post
import logging
from random import randint
from os import path
class Tweet(Post):
def __init__(self, tweet, config):
super(Tweet, self).__init__()
self.reviewUrl = config["reviewUrl"]
self.genAttr(tweet)
def genAt... |
import os
script_dir = os.path.dirname(os.path.realpath(__file__))
tmp_dir = os.path.abspath( script_dir + "/../../../../tmp/" ) + "/"
|
def average_speed(s1 : float, s0 : float, t1 : float, t0 : float) -> float:
"""
[FUNC] average_speed:
Returns the average speed.
Where:
Delta Space = (space1[s1] - space0[s0])
Delta Time = (time1[t1] - time0[t0])
"""
return ((s1-s0)/(t1-t0));
def average_acceleration(v1 : flo... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: feast/specs/ImportSpec.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import refle... |
from .rest import Restful
from .pgs import Pgs
from .transaction import Transaction
__all__ = ['Restful', 'Pgs', 'Transaction']
|
import json
import re
import pytest
from mealie.services.scraper.cleaner import Cleaner
from mealie.services.scraper.scraper import extract_recipe_from_html
from tests.test_config import TEST_RAW_HTML, TEST_RAW_RECIPES
# https://github.com/django/django/blob/stable/1.3.x/django/core/validators.py#L45
url_validation_r... |
'''
Created on Sep 24, 2020
@author: amir
'''
from datetime import datetime
import scipy.constants
class settings():
def __init__(self, dataEditing_mode=1):
self.filter = {
'ws' : 'ws/champ_2003_297_307/EKF/',# folder of observations/precise orbir/ephemeris/etc.
'begin' : self.... |
import time
import itertools
import cv2 as cv
import mediapipe as mp
import pyautogui
from model.gesture_classifier import \
Gesture, GestureClassifier
def main():
# Initialize mediapipe
mp_drawing = mp.solutions.drawing_utils
mp_drawing_styles = mp.solutions.drawing_styles
mp_hands = mp.solutions.hands... |
# Copyright 2010-2017 Luc Saffre
# License: BSD (see file COPYING for details)
"""A collection of utilities which require Django settings to be
importable.
This defines some helper classes like
- :class:`Parametrizable` and :class:`Permittable` ("mixins" with
common functionality for both actors and actions),
- the... |
# Copyright (c) 2012 The Chromium OS Authors.
#
# SPDX-License-Identifier: GPL-2.0+
#
import command
import gitutil
import os
def FindGetMaintainer():
"""Look for the get_maintainer.pl script.
Returns:
If the script is found we'll return a path to it; else None.
"""
try_list = [
os.pa... |
#!/usr/bin/env python
# -*-coding:utf-8-*-
# Author: nomalocaris <nomalocaris.top>
""""""
from __future__ import (absolute_import, unicode_literals)
from .adaptive_grid_construction import generate_adaptive_grid
from .adaptive_grid_construction import read_mdl_data
from .adaptive_grid_construction import cal_split
fro... |
# DESAFIO 019
# Um professor quer sortear um de deus 4 alunos para apagar a lousa. Faça um programa que ajude ele,
# lendo o nome deles e escrevendo o nome do escolhido.
from random import choice
a1 = str(input('Primeiro aluno: '))
a2 = str(input('Segundo aluno: '))
a3 = str(input('Terceiro aluno: '))
a4 = str(input(... |
import understand
import re
db = understand.open("fastgrep2.udb")
print(db.ents())
#for ent in sorted(db.ents(), key=lambda ent: ent.name()):
# print(ent.name(), " [", ent.kindname(), "]", sep="", end="\n")
# Create a regular expression that is case insensitive
searchstr = re.compile("r*.h", re.I)
for file in db... |
import numpy as _np
import numexpr as _ne
from ..util import fastlen as _fastlen
class correlator:
def __init__(self, mask, fftfunctions=(_np.fft.rfftn, _np.fft.irfftn)):
"""
nd-correlations with constant mask.
will not normalize between different added images, but each single image.
... |
"""atl_thymio2_ros2 controller."""
# You may need to import some classes of the controller module. Ex:
# from controller import Robot, Motor, DistanceSensor
from controller import Robot
import rclpy
from rclpy.node import Node
from thymio2_interfaces.msg import Thymio2Controller
from thymio2_interfaces.srv import T... |
# -*- coding: utf-8 -*-
from azureml.core import Model, Run
import argparse
import numpy as np
import iJungle
import joblib
run = Run.get_context()
print("iJungle version:", iJungle.__version__)
run.log('iJungle_version', iJungle.__version__)
parser = argparse.ArgumentParser()
# Input Data
parser.add_argument("--in... |
from AML.math2d import *
v1 = Vector2(50,50)
v1r = 40
v2 = Vector2(100,100)
v2r = 50
v1v2 = v2 - v1
v2v1 = -v1v2
v1v2u = v1v2/v1v2.mag()
v2v1u = v2v1/v2v1.mag()
v1rv = v1 + v1v2u*v1r
v2rv = v2 + v2v1u*v2r
vmid = v1rv - v2rv
print(vmid)
|
from semantic_aware_models.models.recommendation.random_recommender import RandomRecommender
from surprise.reader import Reader
import json
def main():
with open('random_recommender_config.json', 'r') as f:
config = json.load(f)
path = config['path']
separator = config['separator']
... |
"""Mesh representation of the MANO hand model.
See `here <https://mano.is.tue.mpg.de/>`_ for details on the model.
Their code has been refactored and documented by Alexander Fabisch (DFKI GmbH, Robotics Innovation Center).
License Notice
Software Copyright License for non-commercial scientific research purposes
This p... |
import telebot
import random
from collections import Counter
bot = telebot.TeleBot("200009247:AAHf6MAz5e3NOWr0Ypb_vnWhGiKuOrz8Fcg")
# Handles all text messages that contains the commands '/start' or '/help'.
d = open('diction.dictionary')
dictionaryItems = d.read().split("\n")
bigwords = []
for items in dictionaryItem... |
# Sync protocol PoC
import hashlib
import networksim
import networkwhisper
import random
import sync_pb2
import time
# Each group belongs to a client.
# Hardcoded for now.
# group\_id = HASH("GROUP\_ID", client\_id, group\_descriptor)
GROUP_ID = "0xdeadbeef"
# TODO: Introduce exponential back-off for send_time based... |
"""test signin util functions"""
from sqlalchemy.orm import Session
from app.controllers.users_controller import check_user
def get_user_test(sql: Session, username: str):
"""get user test data"""
return check_user(sql, username=username)
|
#!/usr/bin/env pypy
from commons import isRealistic
import random
if not isRealistic():
random.seed(0)
class ID:
@staticmethod
def getId(id):
return int(id.split('_')[-1])
"""
Represents a Hadoop attempt.
"""
class Attempt:
def __init__(self, attemptId=None, task=None, seconds=10, approx=False):
self.task =... |
import SocketServer
import socket
import threading
import numpy as np
import cv2
import pygame
from pygame.locals import *
import socket
import time
import os
# SocketServer.ThreadingTCPServer.allow_reuse_address = True
RASP_IP = '192.168.43.70'
RASP_SERV_PORT = 7879
COMP_IP = '192.168.43.210'
COMP_SERV_PORT = 8002
c... |
from telegram.ext import (Dispatcher, CommandHandler, Filters)
from telegram.ext.dispatcher import run_async
from libs.group.kvs import kvs
def attach(dispatcher: Dispatcher):
dispatcher.add_handler(
CommandHandler(
command='rule',
filters=Filters.group,
callb... |
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, get_object_or_404, redirect
from django.template import loader
from django.http import HttpResponse
from django import template
from djan... |
# -------------------------------------------------------------------------------------------
# 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 copy
import time
import argparse
import cv2 as cv
from yunet.yunet_tflite import YuNetTFLite
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("--device", type=int, default=0)
parser.add_argument("--movie", type=str, default=None... |
"""Models"""
from os.path import dirname, basename, isfile
from server import login
from server.models.taskyuser import TaskyUser
import glob
modules = glob.glob(dirname(__file__) + "/*.py")
__all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]
@login.user_loader
def load_user... |
from django.conf.urls import url, patterns
from news.views import News
urlpatterns = patterns('',
url(r'^$', News.as_view(), name='news'),
)
|
# -*- coding: utf-8 -*-
# Copyright (c) 2020-2021 Ramon van der Winkel.
# All rights reserved.
# Licensed under BSD-3-Clause-Clear. See LICENSE file for details.
from django.contrib import admin
from .models import Functie, VerklaringHanterenPersoonsgegevens
class FunctieAdmin(admin.ModelAdmin):
filter_horiz... |
from .errors import *
from .warnings import *
class LinkedEntities:
def __init__(self):
self.rider_category_ids = set()
self.fare_container_ids = set()
def check_linked_fp_entities(line, rider_categories, rider_category_by_fare_container, linked_entities_by_fare_product):
linked_entities = l... |
# Copyright 2021 The Bellman Contributors
#
# 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... |
from django.apps import AppConfig
class ReferralConfig(AppConfig):
name = 'referral'
|
'''
Created on Nov. 30, 2017
@author Andrew Habib
'''
import json
import os
import sys
from Util import load_parsed_sb, CustomEncoder
def match_sb_msg_no_lines(msg, msgs):
for msg2 in msgs:
if (msg.proj == msg2.proj and msg.cls == msg2.cls and
msg.cat == msg2.cat and msg.abbrev == msg2.ab... |
Nama = ("Mochamad Wilka Asyidiqi")
print(Nama)
|
"""
Plugin for Yo.
"""
from mimic.rest.yo_api import YoAPI
yo = YoAPI()
|
import requests
import json
def getEmoji(myWord):
myAPIkey = "8cb402f051b482a2dac6edef871dfdb2910c8aa2"
apiURL = "https://emoji-api.com/emojis?search={}&access_key={}".format(myWord, myAPIkey)
try:
page = requests.get(apiURL)
emojiJSON = page.json()[0]
emojiToReturn = emoji... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `klimaatbestendige_netwerken` package."""
import unittest
import logging
from pathlib import Path
from klimaatbestendige_netwerken import pyFIS
logging.basicConfig(level=logging.DEBUG)
class test_pyFIS(unittest.TestCase):
"""Tests for `klimaatbestend... |
lista = []
menor = 0
maior = 0
for c in range (0, 5):
lista.append(int(input(f'Digite o valor na posição {c}: ')))
if c == 0:
menor = maior = lista[c]
else:
if lista[c] > maior:
maior = lista[c]
if lista[c] < menor:
menor = lista[c]
print(f'Os número digita... |
#!/usr/bin/env python
from contextlib import contextmanager
from typing import List, Optional
import argparse
import logging
from git_helper import commit
from version_helper import (
FILE_WITH_VERSION_PATH,
ClickHouseVersion,
VersionType,
git,
get_abs_path,
get_version_from_repo,
update_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.