content stringlengths 5 1.05M |
|---|
"""
Lazy Evaluation for Python - main package with primary exports
Copyright (c) 2004, Georg Bauer <gb@murphy.bofh.ms>,
Copyright (c) 2011, Alexander Marshalov <alone.amper@gmail.com>,
except where the file explicitly names other copyright holders and licenses.
Permission is hereby granted, free of charge, to any p... |
from irc_hooky.base_object import BaseObject
class GithubIssueLabel(BaseObject):
properties = [
'url',
'name',
'color'
]
def __init__(self, **kwargs):
super(GithubIssueLabel, self).__init__(**kwargs)
|
from bitmovin.errors import InvalidTypeError
from bitmovin.resources.models import AbstractModel
from bitmovin.resources.enums import FMP4RepresentationType
from bitmovin.utils import Serializable
class AbstractFMP4Representation(AbstractModel, Serializable):
def __init__(self, type, encoding_id, muxing_id, segm... |
from typing import Tuple, Union,Optional
import numpy as np
from highway_env.road.road import Road, Route, LaneIndex
from highway_env.utils import Vector
from highway_env.vehicle.controller import ControlledVehicle
from highway_env import utils
from highway_env.vehicle.kinematics import Vehicle
class IDMVehicle(Con... |
import collections
import json
class PythonObjectEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, collections.Set):
return dict(_set_object=sorted(list(obj)))
else:
return json.JSONEncoder.default(self, obj)
def as_python_object(dct):
if '_set_obj... |
import abc
from Interfaces import AbsObserver
class AbsSubject(metaclass = abc.ABCMeta):
def __init__(self) -> None:
self._observers = set()
def attach(self, obs):
if not isinstance(obs, AbsObserver.AbsObserver):
raise TypeError('Observer not derived from AbsObserver')
sel... |
from aoc.lib.util import Input, get_problem_input
problem_input: Input = get_problem_input()
test_input: Input = get_problem_input(test=True)
Point = tuple[int, int]
def solve(problem_input: Input) -> int:
split = problem_input.lines().index("")
points: list[Point] = []
paper: list[list[str]]
width ... |
import click
import csv
import gzip
import logging
import re
import sys
from collections import defaultdict
from itertools import groupby
logging.basicConfig(level=logging.INFO, datefmt="%Y-%m-%d %H:%M", format="[%(asctime)s] %(message)s")
def print_fasta_record(name, seq, out_handle=sys.stdout, wrap=100):
"""P... |
from praline.client.project.pipeline.stage_resources import StageResources
from praline.client.project.pipeline.stages.stage import stage
from praline.client.repository.remote_proxy import RemoteProxy
from praline.common.file_system import FileSystem
from typing import Any, Dict
@stage(requirements=[['formatted_heade... |
class Solution:
# @return a string
def convertToTitle(self, n: int) -> str:
capitals = [chr(x) for x in range(ord('A'), ord('Z')+1)]
result = []
while n > 0:
result.insert(0, capitals[(n-1)%len(capitals)])
n = (n-1) % len(capitals)
# result.reverse()
... |
from Jumpscale import j
skip = j.baseclasses.testtools._skip
def test_acls():
"""
to run:
kosmos 'j.data.bcdb.test(name="acls")'
test around acls
"""
def test(name):
if name == "RDB":
sqlitestor = False
rdbstor = True
elif name == "ZDB":
... |
# Copyright 2016 The Meson development 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 ... |
import imageio
import json
import numpy as np
import os
import torch
import random
from torch.nn.utils.rnn import pad_sequence
import torchvision.transforms as transforms
from PIL import Image
from seq2seq import Vocab
from seq2seq import hlog
class ShapeDataset(object):
def __init__(self, root="data/shapes/", spl... |
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
import hashlib
import re
from django import forms
from django.core.cache import cache
from django.core.exceptions import ObjectDoesNotExist
from django.utils import six
from django.utils.encoding import force_bytes, force_text
from yepes.contrib.registr... |
import torch
from mmdet.core.bbox.iou_calculators import bbox_overlaps
from mmdet.core.bbox.transforms import bbox_cxcywh_to_xyxy, bbox_xyxy_to_cxcywh
from .builder import MATCH_COST
@MATCH_COST.register_module()
class BBoxL1Cost(object):
"""BBoxL1Cost.
Args:
weight (int | float, optional): loss_w... |
import pygame
pygame.init()
screenwidth=957
screenheight=538
fulllength=8337
currentpos=0
velocity=10
gravity=9
win = pygame.display.set_mode((screenwidth,screenheight))
pygame.display.set_caption("ZomBers")
root='c:/Users/abid/Desktop/OwnGame/'
clock = pygame.time.Clock()
class projectile(o... |
""" Use the radius evolution to infer the size at the time of explosion """
import numpy as np
import matplotlib.pyplot as plt
plt.rc("font", family="serif")
plt.rc("text", usetex=True)
from scipy.integrate import quad
from scipy.optimize import curve_fit
from astropy.table import Table
if __name__=="__main__":
... |
import numpy as np
import matplotlib.pyplot as plt
TP = lambda y_true, y_pred: np.sum(y_pred[np.flatnonzero(y_true == 1)] == 1)
TN = lambda y_true, y_pred: np.sum(y_pred[np.flatnonzero(y_true != 1)] != 1)
FP = lambda y_true, y_pred: np.sum(y_pred[np.flatnonzero(y_true != 1)] == 1)
FN = lambda y_true, y_pred: np.sum(y_... |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='exchange_rates',
version='1.1',
description='Retrives currency exchange rates from http://api.fixer.io/',
author='Luke Shiner',
author_email='luke@lukeshiner.com',
url='http://exchange_rates.lukeshiner.com',
key... |
from setuptools import setup, find_packages
import io
import os
import sys
def read(*filenames, **kwargs):
encoding = kwargs.get('encoding', 'utf-8')
sep = kwargs.get('sep', '\n')
buf = []
for filename in filenames:
if os.path.isfile(filename):
with io.open(filename, encoding=encod... |
from typing import List
class TreeNode:
def __init__(self, x: int):
self.val = x
self.left = None
self.right = None
class Solution:
def path_sum(self, root: TreeNode, sum_: int) -> List[List[int]]:
self.result = []
self.sum_ = sum_
if root:
self.se... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.IcrowdUseParam import IcrowdUseParam
class AlipayDataDataserviceIcrowdUseModel(object):
def __init__(self):
self._icrowd_use_param = None
@property... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import logging,json
from django.conf import settings
from django.http import HttpResponse, HttpResponseServerError,HttpResponseForbidden
from trading.config import context_processor
from trading.controller.global_utils import *
from trading.controller.coin_utils im... |
"""
The MIT License (MIT)
Copyright (c) 2017 Erik Perillo <erik.perillo@gmail.com>
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
... |
import time
from monitor import MonitorNotAvailableError
def display_current_monitor_status(monitor, display):
try:
report = monitor.query_status()
if report.success:
display.show_success()
else:
display.show_failure()
except MonitorNotAvailableError:
d... |
from assign1 import mlParams
from assign2 import computePrior
from assign2 import classifyBayes
import labfuns
from labfuns import testClassifier
import numpy as np
from sklearn import decomposition
import matplotlib.cm as cm
import matplotlib.pyplot as plt
from matplotlib.colors import ColorConverter
class BayesClass... |
import mysql.connector
def creat_cone(host, usuario, senha, base):
return mysql.connector.connect(host=host, user=usuario, password=senha, database=base)
def close_cone(con):
return con.close()
#You should to create a data base in you mySQL |
import sys
global P
global Pila
P = 0
Pila = [None] * 1000
def funcionintermedia():
global P
global Pila
t0 = P+0
t1 = t0+1
t2 = Pila[t1]
print(t2)
def ValidaRegistros():
global P
global Pila
t0 = P+0
#Comienza instruccion de expresion
#Asignar variable
t1 = 9
#se coloca el dato en la posicion de la pi... |
#!/usr/bin/python
import csv
import numpy as np
from scipy.misc import imread
import cv2
from keras.models import Sequential
from keras.layers.core import Dense, Activation, Flatten, Dropout, Lambda
from keras.layers import concatenate, Input
from keras.models import Model
from keras.layers.convolutional import Convol... |
# source = http://stackoverflow.com/a/6894023/1585523
from threading import Thread
class ThreadWithReturnValue(Thread):
def __init__(self, group=None, target=None, name=None,
args=(), kwargs={}, Verbose=None):
Thread.__init__(self, group, target, name, args, kwargs, Verbose)
self... |
# Generated by Django 2.2.11 on 2020-03-27 12:15
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0014_restart_sequence_districts'),
('users', '0013_auto_20200326_2021'),
]
operations = [
]
|
# coding: utf8
"""
系统常量
"""
# SendCloud API
SEND_CLOUD_API_URL = "http://www.sendcloud.net/webapi/mail.send_template.json"
# SendCloud API_USER
SEND_CLOUD_API_USER = "cls1991_test_BmQKl0"
# SendCloud API_KEY
SEND_CLOUD_API_KEY = "iwJnOYQZzEo3R6GS"
|
import time
from dataintegrator import DataIntegrator as di
def main():
"""
STEPS:
1. read the data to be processed and formatted in uniform form
2. filter only the bi-allelic case and leave out other cases
3. deduplicate data to make sure unique key (chr+bp) exist. Re... |
import pygame
import math
class Car():
def __init__(self, x, y, path):
self.image = pygame.image.load(path).convert_alpha()
self.x = x
self.y = y
self.origin_x = -self.image.get_width() / 2
self.origin_y = -self.image.get_height() / 2
self.angle = 0
self.velo... |
from django.shortcuts import render,redirect
from django.http import HttpResponse,JsonResponse
from .models import BookInfo
# Create your views here.
def temp_var(request):
my_dict = {'title':'字典123'}
my_list = [1,2,3]
book = BookInfo.objects.get(id=105)
context = {'my_dict':my_dict,'my_list':my_list,... |
import yaml
import argparse
import numpy as np
import matplotlib.pyplot as plt
from models import *
import torch
from torchvision import transforms, datasets
import torchvision.utils as vutils
from torch.utils.data import DataLoader
from PIL import ImageFile
from sklearn.manifold import TSNE
from torchvision.datasets ... |
"""
Create isotropic volumes from directory of DICOM studies
"""
import os
import pydicom
import pickle
import numpy as np
import scipy.ndimage
import multiprocessing
from joblib import Parallel, delayed
import argparse
import json
def get_files(root):
"""Yields all file paths recursively from root filepath.
... |
import math
"""
Tm * constant = ly
ly / constant = Tm
"""
TERAMETER_2_LIGHTYEAR = 0.000105702977392
""" Distance between points """
def distance(x1, y1, z1, x2, y2, z2):
return ((x1 - x2) ** 2 + (y1 - y2) ** 2 + (z1 - z2) ** 2) ** 0.5
""" Add volumes """
def volume_add(r1, r2):
if r1 == 0:
return... |
from .private_function_check import private_function_check
from .singleton_check import singleton_check
|
# Placeholder for the neural network for testing purposes. Will substitute once Will has finished it
import random
def pol_net():
#return (random.randint(-10, 10), random.randint(-10, 10))
return (1, 1)
|
from django.db import models
from autoslug import AutoSlugField
from django.core.urlresolvers import reverse
import datetime
class Collection(models.Model):
owner = models.ForeignKey('users.User', related_name='%(class)s_owner_relation')
project = models.ForeignKey('project.Project', related_name='%(class)s_p... |
# -*- coding: utf-8 -*-
# (c) Copyright 2021 Sensirion AG, Switzerland
##############################################################################
##############################################################################
# _____ _ _ _______ _____ ____ _ _
# / ____| ... |
"""Widget showing an image."""
from typing import Optional, Union
from kivy.properties import ObjectProperty, NumericProperty, AliasProperty
from kivy.graphics import Rectangle, Color, Rotate, Scale
from mpfmc.uix.widget import Widget
MYPY = False
if MYPY: # pragma: no cover
from mpfmc.core.mc import MpfMc
... |
from django.apps import AppConfig
class SimpleSSOServer(AppConfig):
name = 'simple_sso.sso_server'
|
from argo_dataflow import pipeline, kafka
if __name__ == '__main__':
(pipeline("301-kafka")
.owner('argoproj-labs')
.describe("""This example shows reading and writing to a Kafka topic
* Kafka topics are typically partitioned. Dataflow will process each partition simultaneously.
* Adding replicas w... |
import pytest
from code_challenges.graphs.graphs import Graph, Vertex
def test_exists():
assert Graph
def test_add_node():
graph = Graph()
actual = graph.add_node('1')
expected_value = '1'
assert actual.value == expected_value
def test_add_edge():
graph = Graph()
vertex1 = graph.add_node(... |
from importing import *
# object controller is created
from time import sleep
while 1:
d = controller.get_distance()
print(d)
sleep(0.5)
|
import re
import random
import urllib
url1 = raw_input("Enter the URL ")
u = chr(random.randint(97,122))
url2 = url1+u
http_r = urllib.urlopen(url2)
http_r1 = urllib.urlopen(url2)
http_r2 = urllib.urlopen(url2)
flag =0
i=0
list1 = []
a_tag = "<*address>"
file_text = open("result.txt",'a')
while flag ==0:
if http_r.co... |
"""
============================================
K-fold cross-validation for model comparison
============================================
Different models of diffusion MRI can be compared based on their accuracy in
fitting the diffusion signal. Here, we demonstrate this by comparing two
models: the diffusion tensor ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-02-24 18:12
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0002_achievements'),
]
operations = [
migrations.RenameModel(
... |
import unittest
import time
from netmon.netmon import IpAddress
class TestIpAddress(unittest.TestCase):
INITIAL_TIME = 10
def setUp(self):
self.current_time = TestIpAddress.INITIAL_TIME
self.last_ok_ping_time = TestIpAddress.INITIAL_TIME
self.expected_downtime = 0
self.expected_... |
import sys
import csv
import time
import cvxopt
import numpy as np
import pandas as pd
from svmutil import *
import matplotlib.pyplot as plt
from sklearn.metrics import f1_score
from sklearn.metrics import confusion_matrix
# reading data from csv files
def get_data(data_path,issubset,digit1,digit2):
train_data = np.a... |
#!/usr/bin/python3
import os
from master import smalltool
import random
def rand_text(length = 50):
text_str = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
text_end = len(text_str) - 1
text = ''
for i in range(0,length-1):
text += text_str[random.randint(0,text_end)]
re... |
print('Chevette 73\n' * 73)
print('Olha que massa!')
|
# -*- coding: utf-8 -*-
# Copyright 2015 Objectif Libre
#
# 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 ... |
# Copyright 2016 Intel Corporation
#
# 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 ... |
import json
import numpy as np
import pytest
import yt
from yt_napari import napari_get_reader
# the following should be a valid json, need to add some functionality to
# test infrastructure for loading an actual dataset... as is, this requires
# the IsolatedGalaxy file so will only pass locally.
valid_jdict = {
... |
import tensorflow as tf
from tfdet.core.bbox import delta2bbox, offset2bbox
from tfdet.core.util import map_fn
def filter_detection(logit, regress, anchors, centerness = None, proposal_count = 100, iou_threshold = 0.3, score_threshold = 0.7, nms = True, soft_nms = False, mean = [0., 0., 0., 0.], std = [0.1, 0.1, 0.2,... |
import asyncio
import base64
from typing import List, Dict
from fastapi import APIRouter
from pydantic import BaseModel, Field
from modules.coins import ALL_COINS
from modules.exchanges import exchangeRates
from modules.helpers import JSONResponse
router = APIRouter(prefix='/api')
async def get_coins_raw():
sy... |
# -*- coding: utf-8 -*-
"""
Created on Mon May 4 15:37:46 2020
@author: PRIYANKA JAIN
"""
from spacy.lang.en import English
import numpy as np
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
def similarity(sent1,sent2):
# tokenization
X_list = word_tokenize(sent1)
Y_list = wo... |
# Lint as: python3
"""Add the new laikago robot."""
import gin
from pybullet_envs.minitaur.robots import laikago_constants
from pybullet_envs.minitaur.robots import quadruped_base
from pybullet_envs.minitaur.robots import robot_urdf_loader
@gin.configurable
class Laikago(quadruped_base.QuadrupedBase):
"""The Laika... |
import math
import torch
from torch.utils.data.sampler import Sampler
class DistributedSampler(Sampler):
"""Sampler wrapper that restricts data loading to a subset of the dataset.
Based on:
- torchnlp.samplers.DistributedSampler
- torch.utils.data.DistributedSampler
Args:
sampler (S... |
# -*- coding: utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the... |
# -*- coding: utf-8 -*-
"""Time series interpolator/re-sampler."""
import numpy as np
import pandas as pd
from scipy import interpolate
from sktime.transformations.base import BaseTransformer
__author__ = ["mloning"]
class TSInterpolator(BaseTransformer):
"""Time series interpolator/re-sampler.
Transformer... |
from types import FunctionType
from typing import Coroutine, Dict, Awaitable, List, Union
from discord import Message
from core import utils, types
from core.logging import get_logger
from core.abc.server import AbstractServer
logger = get_logger()
class CommandSystem:
__Commands: Dict[str, types.Coroutine] = ... |
import argparse
import logging
import logging.config
import sys
import time
import pandas as pd
from pathlib import Path
from typing import Optional, List
from functools import reduce
from . import data
from . import network_of_populations as ss
# Default logger, used if module not called as __main__
logger = loggin... |
import collections.abc
import datetime
import typing
from . import ast
from . import __version__ as _rezparser_version
__all__ = [
"REZ_VERSION",
"ArrayState",
"Evaluator",
"ResourceState",
"eval",
]
# Not a real Rez version number. Xcode 8.4's Rez and DeRez say "V3.7B1".
REZ_VERSION = b"python-rezparser versio... |
import utils
import tensorflow as tf
from tensorflow import keras
class callback(keras.callbacks.Callback):
def __init__(self,dataset):
super().__init__()
self.dataset = dataset
self.idx_mapping = utils.idx_mapping()
def on_epoch_end(self, epoch: int, logs=None):
predictions =... |
# *******************************************************************************************
# *******************************************************************************************
#
# Name : tokenstables.py
# Purpose : Create the token tables.
# Date : 19th August 2019
# Author : Paul Robson (paul@robso... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-10 01:13
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('network', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
... |
"""
Library to create neural nets with partially trainable layers.
In Keras currently, only the trainablilty of whole layers can be set.
To create partial trainabliity, I need to split the layer into two layers,
and assign one to trainable and the other one to not trainable. Both layers get
the same input. The out... |
from selenium import webdriver
import time
import math
def calc(x):
return str(math.log(abs(12 * math.sin(int(x)))))
try:
link = "http://suninjuly.github.io/get_attribute.html"
browser = webdriver.Chrome()
browser.get(link)
chest = browser.find_element_by_css_selector("#treasure")
x=chest... |
"""QuickSight"""
import os
from aws_cdk import core
from cdk.quicksight_status_stack import QuicksightStatusStack
from cdk.quicksight_migration_stack import QuicksightMigrationStack
from cdk.optional_infra_target_account_stack import OptionalInfraTargetAccountStack
from cdk.infra_target_account_stack import InfraTarge... |
from datetime import datetime
import pytest
from foreverbull.data.data import Database
from foreverbull.data.stock_data import Asset, Portfolio, Position, StockData
from sqlalchemy.orm import sessionmaker
date = datetime(2016, 1, 4, 21)
@pytest.fixture()
def sample_asset():
return Asset(sid=1, symbol="KEB", ass... |
class Solution:
def maxSatisfied(self, customers: list, grumpy: list, X: int) -> int:
k, v = 0, 0
for i in range(len(grumpy) + 1 - X):
# print(customers[i:i + X])
a = sum((x for x, y in zip(customers[i:i + X], grumpy[i:i + X]) if y > 0))
if a > k:
... |
#!/usr/bin/env python
# Argument handling
# Author: Joe G Greener
import argparse
import pkg_resources
parser = argparse.ArgumentParser(description=(
"Differentiable molecular simulation of proteins with a coarse-grained potential. "
"See https://github.com/psipred/cgdms for documentation and citation inform... |
## Standard libraries
import os
import random
import numpy as np
import pandas as pd
## tqdm for loading bars
from tqdm import tqdm
## PyTorch
import torch
import torch.utils.data as data
import torch.optim as optim
# Losses
from pytorch_metric_learning import regularizers, losses, distances
# Custom libraries
impo... |
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
import time
# Replace below path with the absolute path
# to... |
"""Provide the FullnameMixin class."""
class FullnameMixin:
"""Interface for classes that have a fullname."""
_kind = None
@property
def fullname(self) -> str:
"""Return the object's fullname.
A fullname is an object's kind mapping like ``t3`` followed by an underscore and
t... |
from django.conf.urls import url
import views
urlpatterns = [
url(r'^test', views.test),
]
|
"""Auto-generated file, do not edit by hand. IR metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_IR = PhoneMetadata(id='IR', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[129]\\d{2,5}', possible_length=(3, 4, ... |
# Future
from __future__ import annotations
# Packages
import discord
from discord.ext import commands
# My stuff
from core import colours, emojis, values
from core.bot import Life
from utilities import converters, custom, exceptions, objects, utils
def setup(bot: Life) -> None:
bot.add_cog(Tags(bot=bot))
cla... |
from random import randint
from os import mkdir
ops = ('insert', 'find', 'remove', 'merge', 'split', 'splay')
def values_generator(min_value: int = 0, max_value: int = 100000000):
"""Function to generate values for tests"""
for op in ops:
mkdir(op)
for elements_quantity in (100, 500, 10**3, 5*(... |
# -*- coding: utf-8 -*-
"""
conpaas.services.webservers.manager.config
==========================================
ConPaaS Web Hosting Service manager config.
:copyright: (C) 2010-2013 by Contrail Consortium.
"""
BACKEND_PORT = 9000
WEB_PORT = 8080
PROXY_PORT = 80
DEFAULT_WEIGHT = 100
memcache = Non... |
"""Alert on any Duo auth logs marked as a failure due to an Anonymous IP."""
from streamalert.shared.rule import rule
from streamalert.shared.lookup_tables.core import LookupTables
@rule(logs=['duo:authentication'])
def duo_lookup_tables_example(rec):
"""
description: Alert on Duo auth logs from blacklisted b... |
# 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... |
#!/usr/bin/python
from fvregress import *
import string # really? you have to do this?
import sys
# start up a flowvisor with 1 switch (default) and two guests
#h= HyperTest(guests=[('localhost',54321),('localhost',54322)],
# hyperargs=["-v0", "-a", "flowvisor-conf.d-base", "ptcp:%d"% HyperTest.OFPORT],valgr... |
import asyncio
import inspect
import itertools
import random
import time
import typing
from .. import events, utils, errors
from ..events.common import EventBuilder, EventCommon
from ..tl import types, functions
if typing.TYPE_CHECKING:
from .telegramclient import TelegramClient
class UpdateMethods:
# regi... |
from abc import ABC, abstractmethod
class Generator(ABC):
@abstractmethod
def generate(self, case_num):
pass
def p(self, *args):
self.output += ' '.join(map(str, args))
self.output += '\n'
print = p
def get_test_cases(self, N):
ret = []
for case_num in r... |
import face_recognition
from face_recognition.face_recognition_cli import image_files_in_folder
import math
import pickle
import sys
import pandas as pd
from sklearn.cluster import DBSCAN
import settings
import os
import os.path
import encoding
import shutil
MODELSET_DIR = os.getenv('MODELSET_DIR')
DATASET_RAW_DIR = ... |
from manga_py.provider import Provider
from .helpers.std import Std
class JurnaluRu(Provider, Std):
def get_chapter_index(self) -> str:
return str(self.chapter_id)
def get_main_content(self):
name = self._get_name(r'(online-reading/[^/]+/[^/]+)')
url = self.html_fromstring(
... |
# coding=utf-8
"""LARS.
Least Angle Regression - high dimensional data regression.
Sinus function regression.
"""
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import r2_score
from sklearn import linear_model
if __name__ == "__main__":
print("Generating data...")
x = np.arange(-20,... |
from event import *
class Story:
'''
A story points a reader to the first event.
It also holds metadata, such as its title.
Finally, it holds the function of impetus -- self.write().
This thing sets off all the recursion within the Event.
'''
def __init__(self):
# The content is long-form, unformatted text.... |
# coding: utf-8
# 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... |
import xml.etree.ElementTree as ET
import pandas as pd
from bibliographic_productions import Bibliographic_Productions
from other_professional_activities import OtherProfessionalActivities
from projects import Projects
from technical_productions import Technical_Productions
from professional_activities import Profess... |
import os
import json
import numpy as np
import seaborn as sns
import pandas as pd
from itertools import product
from pyitab.utils.matrix import copy_matrix, array_to_matrix
from pyitab.results.bids import filter_dataframe, get_results_bids
from pyitab.results.dataframe import apply_function, query_rows
from pyitab.pl... |
import asyncio
import discord
import youtube_dl
from discord.ext import commands
# Suppress noise about console usage from errors
youtube_dl.utils.bug_reports_message = lambda: ''
ytdl_format_options = {
'format': 'bestaudio/best',
'outtmpl': '%(extractor)s-%(id)s-%(title)s.%(ext)s',
'restrictfilenames... |
import pytest
from sovtoken.exceptions import InsufficientFundsError, ExtraFundsError, InvalidFundsError
from sovtoken.test.helper import libsovtoken_address_to_address
def test_xfer_handler_dynamic_validation_valid(xfer_handler, xfer_request):
xfer_handler.dynamic_validation(xfer_request, 0)
def test_xfer_hand... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# core modules
import random
import math
import os
import sys
import fcntl
# 3rd party modules
import gym
import numpy as np
from gym import spaces
# our implementation, you should change the path to your "gym-OptClang" relative path.
sys.path.append(os.path.abspath('/h... |
# -*- encoding: utf-8 -*-
#
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.