content stringlengths 5 1.05M |
|---|
from keras.preprocessing.image import img_to_array, load_img
import numpy as np
from ast import literal_eval
import traceback
def make_image_sample(photo_id_file,image_array_file):
images_root = "data/images_150X150/"
x_train = []
count = 0
means = None
stds = None
with open(ph... |
from .msvc import msvc_mangle, msvc_demangle
def mangle(name):
return msvc_mangle(name)
def demangle(obj):
return msvc_demangle(obj)
|
"""
This plugin adds a ``/server_part`` command to leave all rooms
on a server.
Command
-------
.. glossary::
/server_part
**Usage:** ``/server_part [<server> [message]]``
Leave all rooms on ``<server>``, if not provided and the current
tab is a chatroom tab, it will leave all rooms on t... |
# -*- coding: utf-8 -*-
"""
ngram.py
Class for NGram Analysis
@author: Douglas Daly
@date: 1/11/2017
"""
#
# Imports
#
import os.path
from collections import Counter
from .. import string_helpers
#
# Variables
#
_ngram_base_dir = "../resources/ngrams/"
#
# Class
#
class NGram(object):
"""
N-Gra... |
from __future__ import print_function
import os
import os.path as osp
import pickle
from scipy import io
import datetime
import time
from contextlib import contextmanager
import torch
from torch.autograd import Variable
def time_str(fmt=None):
if fmt is None:
fmt = '%Y-%m-%d_%H:%M:%S'
return datetime.datetim... |
"""
/*****************************************************************************
* Copyright (c) 2016, Palo Alto Networks. All rights reserved. *
* *
* This Software is the property of Palo Alto Networks. The Software and all *
... |
from stable_baselines3.ppo.policies import CnnPolicy, MlpPolicy
from stable_baselines3.ppo.ppo import PPO
from stable_baselines3.ppo.ppo_custom import PPO_CUSTOM
from stable_baselines3.ppo.ppo_with_reward import PPO_REWARD
|
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
import yfinance as yf
import pandas as pd
import os
from tqdm import tqdm
import time
import numpy as np
import datetime
import json
import collections
# In[ ]:
# download stock data and calculater factors for training
def cal_mean(data,r,period,fact):
return da... |
import numpy as np
import pandas as pd
NEARBY_THRESHOLD = 5 / 6371
def hav_dist(lat1, lon1, lat2, lon2):
lat1, lon1, lat2, lon2 = map(np.radians, [lat1, lon1, lat2, lon2])
dlat = lat2 - lat1
dlon = lon2 - lon1
hav = np.sin(dlat/2.0)**2 + np.cos(lat1) * np.cos(lat2) * np.sin(dlon/2.0)**2
angle = ... |
from django.db import connection
from django.core.exceptions import ImproperlyConfigured
def multitenant_key_func(key, key_prefix, version):
tenant_prefix = connection.get_threadlocal().get_cache_prefix()
if tenant_prefix is None:
raise ImproperlyConfigured('Multi-tenant cache prefix not available')
... |
import json
import sys
from collections import OrderedDict
from functools import wraps
# Ignore PyImportSortBear, PyUnusedCodeBear
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, Set
import attr
from dotenv import load_dotenv
from .exceptions import MissingError
from .vault.base import BaseVaul... |
converters = ['Humdrum', 'ABC notation', 'Braille notation', 'Capella notation', 'LilyPond file', 'MEI notation', 'MuseData', 'Noteworthy file', 'TinyNotation', 'Vexflow easyscore'] |
from typing import Union
from probability.custom_types.external_custom_types import AnyFloatMap
from probability.custom_types.internal_custom_types import AnyBetaMap, \
AnyDirichletMap
from probability.distributions import Beta, Dirichlet
class BayesRuleMixin(object):
_prior: Union[float, Beta, AnyFloatMap,... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Mailing List Archive',
'category': 'Website',
'description': """
Odoo Mail Group : Mailing List Archives
==========================================
""",
'depends': ['website_mail'],
... |
# 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
# distributed under th... |
#!/usr/bin/env python
# _*_coding:utf-8 _*_
# @Time :2020/5/26 15:46
# @Author : Cathy
# @FileName: lstm.py
import torch
import torch.nn as nn
import torchvision.datasets as dsets
import torchvision.transforms as transforms
from torch.autograd import Variable
# Hyper Parameters
sequence_length = 28 # 序列长度,将图像的... |
import logging
from datetime import datetime
from datetime import timezone
from aiogram.types import Chat as TelegramChat
from dasbot.models.chat import Chat, ChatSchema
log = logging.getLogger(__name__)
class ChatsRepo(object):
def __init__(self, chats_col, scores_col):
self._chats = chats_col
... |
import os
# the path of "examples/autonomous"
SELF_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
ALGORITHMS = [
"orchestra_sb", # 1
"orchestra_rb_s", # 2
"orchestra_rb_ns", # 3
#"orchestra_rb_ns_sr", # 4
# "link", # 5
# "msf", # 6
# "emsf", # 7
"alice", # 8
"alice_rx... |
"""
File: linked_list.py
Name:
--------------------------
This file shows how to construct a linked list
from scratch and use it to implement a priority queue.
"""
class ListNode:
def __init__(self, data, pointer):
# value & next 為慣用語
self.value = data
self.next = pointer
def main():
# Way 1
node1 = List... |
"""
Robot Framework Assistant offers IDE features for editing Robot Framework test
data in Sublime Text 3.
"""
import sys
import os
from string import Template
from .commands import *
if sys.version_info < (3, 3):
raise RuntimeError('Plugin only works with Sublime Text 3')
def plugin_loaded():
pa... |
from re import T
import re
import gstgva
import numpy as np
import json
from configuration import env
import os, sys, traceback
import logging
import datetime
import time
from notification import notification
from centroidtracker import CentroidTracker
from shapely.geometry import Point, Polygon
from db_query import DB... |
class UserStatistics:
def __init__(self):
self.files = 0
self.insertions = 0
self.deletions = 0
@property
def is_zero(self):
return self.files == self.insertions == self.deletions == 0
def __repr__(self):
return "files changed: {}, insertions: {}, deletions: {}"... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
# BE VERY CAREFUL WHEN USING THIS SCRIPT IT RENAMES THINGS THAT ARE POTENTIALLY IMPORTANT
# this script makes target.txt files that correspond to the directory each RUN is in
# this script also renumbers runs from being 8 times 0-~39 to be one consecutive list of 0 to 316
from glob import glob
import re
import os
ru... |
a="hello world"
print(a)
|
from Instrucciones.TablaSimbolos.Instruccion import Instruccion
from Instrucciones.TablaSimbolos.Tipo import Tipo_Dato, Tipo
from Instrucciones.Excepcion import Excepcion
from Instrucciones.Sql_select.Select import Select
from Instrucciones.Tablas.Tablas import Tablas
class SelectLista(Instruccion):
def __init__(s... |
from django.apps import AppConfig
class CheeseappConfig(AppConfig):
name = 'cheeseapp'
|
import matplotlib.pyplot as plt
import numpy as np
import torch
def show_failures(
model,
data_loader,
unnormalizer=None,
class_dict=None,
nrows=3,
ncols=5,
figsize=None,
):
failure_features = []
failure_pred_labels = []
failure_true_labels = []
for batch_idx, (features, ... |
RAW_QUEUES = {
"example_timed_set": {
"job_factory": lambda rawparam: {
"path": "example.Print",
"params": {
"test": rawparam
}
}
}
} |
from setuptools import setup
from setuptools import find_namespace_packages
from setuptools import find_packages
#README file :
with open("README.md","r") as readme_handle :
long_descriptions=readme_handle.read()
setup(
name="auto_translation",
author="Mohammed BADI",
author_email="badimohammed2019@gmai... |
from datetime import date, timedelta
import csv
f = open('html.txt', 'w')
#life_expect = []
#with open('behavior.csv') as csvfile:
# reader = csv.DictReader(csvfile)
# for row in reader:
# life_expect.append(row)
#f.write("INSERT INTO genetic VALUES")
code = 2018
while code >= 1900:
stCode = str(code)
f.write(... |
#!/usr/bin/env python
"""This is the GRR client installer module.
GRR allows several installers to be registered as plugins. The
installers are executed when the client is deployed to a target system
in their specified order (according to the registry plugin system).
Installers are usually used to upgrade existing cl... |
from typing import Optional, List
from stx.compiling.reading.location import Location
from stx.components import Component, Composite, CodeBlock, Table, Image, \
FunctionCall, CustomText
from stx.components import ListBlock, Paragraph, PlainText, StyledText
from stx.components import LinkText, Literal, Figure, Sec... |
"""
---
title: Diffusion models
summary: >
A set of PyTorch implementations/tutorials of diffusion models.
---
# Diffusion models
* [Denoising Diffusion Probabilistic Models (DDPM)](ddpm/index.html)
"""
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.db.models.deletion
from django.core.validators import MinValueValidator
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('cabotapp', '0006_auto_20170821_100... |
import pytest
from django.test import TestCase
from oauth2_provider.generators import BaseHashGenerator, generate_client_id, generate_client_secret
class MockHashGenerator(BaseHashGenerator):
def hash(self):
return 42
@pytest.mark.usefixtures("oauth2_settings")
class TestGenerators(TestCase):
def t... |
#! usr/bin/python3.6
"""
Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-07-06 14:02:20.222384
.. warning::
The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only.
They are there as a guide as to how the visual basic / catscript function... |
#!/usr/bin/env python3
###############################################################################
# Copyright 2018 The Apollo 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... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
# -*- coding: utf-8 -*-
"""Project metadata
Information describing the project.
"""
# The package name, which is also the "UNIX name" for the project.
package = 'soundly'
project = "python package for audio analysis"
project_no_spaces = project.replace(' ', '')
version = '0.2'
description = 'Python package for audio ... |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import json
import logging
import os
import pathlib
import shutil
import tempfile
import uuid
from typing import Dict
from azureml.core i... |
'''
Item display
'''
import configparser
import os.path
from ..config import CONFIG, CONFIGDIRECTORY
from ..version import __version__ as version
__all__ = 'NoConfig', 'load_items', 'load_dungeons', 'new_item', 'new_dungeons'
class NoConfig(Exception):
'''
Raised when item layout config is not available.
... |
# SCAR - Serverless Container-aware ARchitectures
# Copyright (C) 2011 - GRyCAP - Universitat Politecnica de Valencia
#
# 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 3 of the Li... |
#!/usr/bin/python
# Copyright 2008 Deutsches Forschungszentrum fuer Kuenstliche Intelligenz
# or its licensors, as applicable.
#
# You may not use this file except under the terms of the accompanying license.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in co... |
test = { 'name': 'q1e',
'points': 3,
'suites': [ { 'cases': [ {'code': ">>> top_selling_segments.labels == ('Segment_Category', 'Average Sales') and top_selling_segments.num_rows == 7\nTrue", 'hidden': False, 'locked': False},
{ 'code': ">>> np.all(top_selling_segmen... |
###########################################################################
# Created by: CASIA IVA
# Email: [email protected]
# Copyright (c) 2018
###########################################################################
from __future__ import division
import os
import numpy as np
import torch
import torch.nn as nn... |
from mp4box.box import TrackFragmentDecodingTime
def parse_tfdt(reader, my_size):
version = reader.read32()
box = TrackFragmentDecodingTime(my_size, version, 0)
if version == 1:
box.base_media_decode_time = reader.read64()
else:
box.base_media_decode_time = reader.read32()
|
import numpy as np
from intp_integrated import (AccumulatedInterpNN,
AccumulatedInterpDrizzle,
AccumulatedInterpLinear)
import matplotlib.pyplot as plt
def test_plot_accumulate_interp_nn():
x = [0, 1, 2, 3, 4]
y = [1, 3, 2, 4, 1.5]
xx = np.arange... |
import os
import glob
import hdf5_getters
def get_all_titles(basedir,ext='.h5') :
titles = []
for root, dirs, files in os.walk(basedir):
files = glob.glob(os.path.join(root,'*'+ext))
for f in files:
h5 = hdf5_getters.open_h5_file_read(f)
titles.append( hdf5_getters.get_ti... |
NumOfRows = int(input("Enter number of rows: "))
for i in range(NumOfRows, 0, -1):
for j in range(0, i):
print("* ", end=" ") #for numbers--> print(j, end=" ")
print("\n") |
# -*- coding: utf-8 -*-
import sys
from PySide2 import QtWidgets
from PySide2.QtTest import QTest
from pyleecan.Classes.LamHole import LamHole
from pyleecan.Classes.HoleM52 import HoleM52
from pyleecan.GUI.Dialog.DMatLib.MatLib import MatLib
from pyleecan.GUI.Dialog.DMachineSetup.SMHoleMag.PHoleM52.PHoleM52 import P... |
from django.urls import path
from .views import home, delete_todo
urlpatterns = [
path('', home, name='home'),
path('delete_todo/<int:todo_id>', delete_todo, name='delete'),
]
|
import os
import json
import sys
import pytest
import subprocess
import re
import shlex
from prettytable import PrettyTable
from collections import OrderedDict
from yattag import Doc
from pathlib import Path
from tests.conftest import TEST_ROOT, PROJECT_ROOT
BG_COLOR_GREEN_HEX = 'ccffcc'
BG_COLOR_YELLOW_HEX = 'ffffcc'... |
"""
Handles special relationships
"""
##########################################
# TODO - fix import mess
# Cannot import _general_copy here since it
# will result in a circular import
##########################################
from qcexport_extra_collection import _add_collection
from qcfractal.storage_sockets.mod... |
from random import randint
def sorteio(lst):
for x in range(0,5):
lst.append(randint(0,10))
print(f'Sorteando uma Lista de Valores: {lis} Pronto!')
def somapares(vl):
s=0
for x in vl:
if x % 2 == 0:
s += x
print(f'Os Valores da Lista {vl}, Somando seus Pares, ... |
"""
Module for reaction based on Ion class
TODO,
"""
import copy
import re
import io
import os
import time
from collections.abc import Iterable
import numpy as np
from numpy.linalg import matrix_power
from scipy.linalg import solve_banded
import isotope
from logged import Logged
from utils import stuple, project, ... |
import jwt
import pytest
from django.test.client import Client as TestClient
from oidc_apis.models import ApiScope
from tunnistamo.tests.conftest import (
DummyFixedOidcBackend, create_oidc_clients_and_api, get_api_tokens, get_tokens, get_userinfo, refresh_token,
social_login
)
def _get_access_and_id_tokens(... |
"""
Utilities for streaming data from various sources.
"""
import csv
import datetime as dt
import functools
import gzip
import itertools
import random
import types
import os
import numpy as np
try:
import pandas as pd
PANDAS_INSTALLED = True
except ImportError:
PANDAS_INSTALLED = False
from sklearn import... |
point_dict = {'Two': 2, 'Three': 3, 'Four': 4, 'Five': 5, 'Six': 6, 'Seven': 7, 'Eight': 8, 'Nine': 9, 'Ten': 10,
'Jack': 10, 'Queen': 10, 'King': 10, 'Ace': 11}
suits = ['Hearts', 'Diamonds', 'Spades', 'Clubs']
class Card:
def __init__(self, value, suit):
self.value = value
self.sui... |
# flake8: noqa
name = "abp_blocklist_parser"
from abp_blocklist_parser.BlockListParser import BlockListParser
|
# Sod shock tube
import numpy
from models import sr_swe
from bcs import outflow
from simulation import simulation
from methods import fvs_method
from rk import rk3
from grid import grid
from matplotlib import pyplot
Ngz = 4
Npoints = 400
L = 0.5
interval = grid([-L, L], Npoints, Ngz)
phiL = 0.41
phiR = 0.01
phiL = 0... |
# Copyright (c) 2011 Mattias Nissler <[email protected]>
#
# Redistribution and use in source and binary forms, with or without modification, are permitted
# provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# condition... |
import UcsSdk
import time
def EventHandler(mce):
print 'Received a New Event with ClassId: ' + str(mce.mo.classId)
print "ChangeList: ", mce.changeList
print "EventId: ", mce.eventId
def main():
ucs = UcsSdk.UcsHandle()
ucs.UcsHandle.Login(username='', password='')
ucs.UcsHandle.AddEventHa... |
"""
Script for generating simulated time series using the method of Timmer and Konig (1995).
"""
from numpy import log, zeros, sqrt, arange, exp, real, pi, interp, conj
from numpy.random import normal
from numpy.fft import fft
def ts_gen(n, dt=1., freq=[], pow=[], seed=None, time=0, spline=0, double=1, phase=[0], lo... |
import ccxtpro
from asyncio import get_event_loop
print('CCXT Pro version', ccxtpro.__version__)
async def main(loop):
exchange = ccxtpro.bitvavo({
'enableRateLimit': True,
'asyncio_loop': loop,
})
await exchange.load_markets()
exchange.verbose = True
symbol = 'BTC/EUR'
while... |
from typing import List, Union
from torch import nn as nn
import os
from path import Path
import inspect
import subprocess
import types
import importlib
def init_from(
class_name: str, modules: List[Union[str, types.ModuleType]], *args, **kwargs
):
"""Initializes class from its name and list of module names... |
from iml_common.blockdevices.blockdevice_lvm_volume import BlockDeviceLvmVolume
from iml_common.test.command_capture_testcase import CommandCaptureTestCase
class TestBlockDeviceLvmVolume(CommandCaptureTestCase):
def setUp(self):
super(TestBlockDeviceLvmVolume, self).setUp()
self.blockdevice = Blo... |
#!/usr/bin/env python
# Visual Modulator Constellation
# Josh Sanz
# 2019-01-24
import sys
import six
from os import environ, listdir
from os.path import isfile, join
import argparse
from matplotlib import pyplot as plt
import numpy as np
def hex_to_rgb(value):
value = value.lstrip('#')
lv = len(value)
r... |
class NoPendingBlockAvailableError(Exception):
pass
|
# Generated by Django 2.1.5 on 2019-02-03 11:19
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('calls', '0005_auto_20190130_2011'),
]
operations = [
migrations.AddField(
model_name='call',
... |
import os
import re
import gzip as gz
import json
def from_json(fname):
"""
Routine to extract the contents of a json file. no longer pretends to support PY2.
:param fname: json file, optionally gzipped
:return: a json-derived dict
"""
print('Loading JSON data from %s:' % fname)
if bool(r... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from _v8 import ffi, lib
from . import exceptions
from . import context
__all__ = ['VM']
class VM(object):
"""
Holds the VM state (V8 isolate).\
Running scripts within a VM is thread-safe,\
but only a single thread will execute code\... |
##############################################################################
# Copyright (c) 2015 Ericsson AB and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available... |
from sys import path
path.append("../QIK_Web/util/")
import constants
from sys import path
path.append("../ML_Models/DeepImageRetrieval")
from dirtorch import extract_features, test_dir, datasets
import numpy as np
is_initialized = False
net = None
image_data = []
def init():
print("dir_search :: init :: Start")... |
import gc
from queue import Queue, Empty
from threading import Thread
from time import sleep
import cv2
from torpido.config.constants import VIDEO_WIDTH
from torpido.util import resize
class Stream:
"""
Class that continuously gets frames from a VideoCapture object
with a dedicated thread, which actuall... |
import matplotlib
import datetime
import numpy as np
from dateutil.tz import tzutc
def polyfit(dates, levels, p):
"""Task 2F: Returns a tuple of the polynomial object and any shift of the time axis"""
# Convert dates to floats
dates_float = matplotlib.dates.date2num(dates)
# Find the time shift d0
... |
# Written in python2.7, meant to be run in the saliency conda env.
import os
from cfg import *
import numpy as np
import argparse
cfg = flickr_cfg()
with open(cfg.val_file, "r") as f:
lines = f.readlines()
val_ex = []
for line in lines:
val_ex.append(int(line.rstrip().split(".jpg")[0]))
with open... |
from dataclasses import dataclass, field
from typing import Any
import pygame as pg
from config.constants import CELLSIZE
from .screen import Screen
@dataclass(order=True)
class PrioritizedItem:
priority: int
item: Any = field(compare=False)
class GameObject:
priority = 100
def __init__(self):
... |
from __future__ import with_statement
from __future__ import absolute_import
from udsoncan.client import Client
from udsoncan import services
from udsoncan.exceptions import *
from test.ClientServerTest import ClientServerTest
class TestECUReset(ClientServerTest):
def __init__(self, *args, **kwargs):
Clie... |
class PlotOptions:
def __init__(self, plot_type="3d_plot", dims_plot=[], slices=[]):
if plot_type not in ["2d_plot", "3d_plot"]:
raise Exception("Illegal plot type !")
if plot_type == "2d_plot" :
if len(dims_plot) != 2:
raise Exception("Make sure that dim_plot size is 2 !!")
... |
import os
import torch
import elf
import numpy as np
import wandb
from elf.segmentation.features import compute_rag
from torch.nn import functional as F
from torch.optim.lr_scheduler import ReduceLROnPlateau
from torch.utils.data import DataLoader
from collections import namedtuple
import matplotlib.pyplot as plt
from ... |
# 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
# distributed under t... |
import json
import logging
import os
import re
from collections import namedtuple
from typing import Union
from auth.authorization import Authorizer
from config.exceptions import InvalidConfigException
from model import script_config
from model.model_helper import InvalidFileException
from model.script_config import g... |
import re
from datetime import datetime, time, date
from typing import Optional, List, Dict, Union
from scrapy.http import HtmlResponse
from lxml.html import fromstring, HtmlElement
from city_scrapers_core.constants import (
BOARD,
FORUM,
ADVISORY_COMMITTEE,
COMMITTEE,
CANCELLED,
CONFIRMED,
... |
# -*- coding: utf-8 -*-
import scrapy
from scrapy import Selector
from light_novel.items import LightNovelItem
# http://m.webqxs.com/0/42/
# http://m.webqxs.com/0/42/5678.html
# 设置要爬的开始章节和结束章节
global start_index,end_index
start_index = 1
end_index = 100
# 26
global end_url,current_index
end_url = ''
current_index ... |
# Autores: Ellen Junker, Kessy Roberta Staub e Mateus da Silva Francelino
# Data: 12/10/2021
import cv2
from FireDetector import FireDetector
from glob import glob
import matplotlib.pyplot as plt
import os
if __name__ == '__main__':
img_names = glob(os.path.join('fire_images','*.png')) #<<< para peg... |
# Copyright 2018-2019 The Kubeflow Authors
#
# 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 ... |
import discord
from discord.ext import commands
from .player import Player, Skill
from mysqldb import the_database
from extra.prompt.menu import Confirm, ConfirmButton
from extra import utils
import os
from datetime import datetime
import random
from typing import List, Optional, Union
from PIL import Image, ImageDraw,... |
"""This class implements the univariate kernel density estimator (KDE).
References
----------
Li, Q. and J. S. Racine (2007) "Nonparametric econometrics", Princeton
University Press, Princeton.
Silverman, B. W. (1986): Density estimation for statistics and data analysis,
CRC press.
"""
import numpy as np
im... |
from .base import EntityRef
from .exchange_ref import ExchangeRef
class MultipleReferences(Exception):
pass
class NoReference(Exception):
pass
class ProcessRef(EntityRef):
"""
Processes can lookup:
"""
_etype = 'process'
_ref_field = 'referenceExchange'
@property
def _addl(sel... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
import shlex
from pathlib import Path
import pytextnow
from nephele.command import Command
from nephele.events import Events
from nephele.telegram import Telegram
_EVENT_NAME = "textnow-message"
def send_sms(event):
telegram = Telegram(event)
username = event["textnow_username"]
sid_cookie = event["tex... |
"""Utility functions for the haproxy module."""
def cmd_succeeded(output, ignored_outputs=None):
"""Check if the given output contains an error.
Most commonly a succeeded command will return an empty string. However, some
commands even though have succeeded return an informative message to the
caller... |
from django.shortcuts import render
from django.http import HttpResponse
from django.conf.urls.static import static
import requests
HOST = 'http://127.0.0.1:8000/'
# Create your views here.
def index(request):
return render(request, 'contracts/index.html', {'num':3})
def contract_card(request):
if dict(reque... |
"""reservedkeywords
(C) 2004-2008 HAS
"""
kReservedKeywords = ["ID", "beginning", "end", "before", "after", "previous", "next", "first", "middle", "last", "any", "beginswith", "endswith", "contains", "isin", "doesnotbeginwith", "doesnotendwith", "doesnotcontain", "isnotin", "AND", "NOT", "OR", "begintransaction", "abor... |
import pytest
from geoconvert.convert import (
address_to_zipcode,
dept_name_to_zipcode,
fr_address_to_dept_code,
fr_dept_name_to_dept_code,
fr_postcode_to_dept_code,
)
class TestFrance:
@pytest.mark.parametrize(
"input_data, expected",
[
(u"Chemin du Solarium\\n L... |
import tqdm
import random
import argparse
from src.db.sqlalchemy import db_session
from src.model.user import User
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('max_value', type=float)
return parser.parse_args()
def add():
user_list = db_session().query(User).all()
f... |
# -*- coding: UTF-8 -*-
from flask.helpers import url_for
from leancloud.errors import LeanCloudError
from leancloud.query import Query
from leancloud.user import User
from forms.auth import LoginForm, RegisterForm
from admin_views import admin_view
from flask import redirect, render_template, request
from flask_login... |
from django.core.management.base import BaseCommand
from jdleden.ledenlijst import create_department_excels_from_file
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('members_file', nargs=1, type=str)
def handle(self, *args, **options):
create_department_exc... |
# Generated by Django 3.0.4 on 2020-04-12 01:48
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('user', '0003_auto_20200401_1056'),
('restapi', '0001_initial'),
]
operations = [
migrations.CreateM... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.