text stringlengths 2 999k |
|---|
# coding: utf-8
"""
Looker API 3.0 Reference
### Authorization The Looker API uses Looker **API3** credentials for authorization and access control. Looker admins can create API3 credentials on Looker's **Admin/Users** page. Pass API3 credentials to the **/login** endpoint to obtain a temporary access_token.... |
import sys
sys.path.append('../')
import re
from pyquery import PyQuery as pq#need install
from lxml import etree#need install
from bs4 import BeautifulSoup#need install
import json
from ADC_function import *
from WebCrawler import javbus
'''
API
注册:https://www.airav.wiki/api/auth/signup
设置:https://www.airav.wiki/api/... |
from .Command import *
from .Environment import Environment
from .Interpreter import Interpreter |
import csv
import io
import json
import logging
import uuid
from abc import ABCMeta, abstractmethod
from collections import defaultdict, namedtuple
from contextlib import closing
from itertools import chain
from typing import Set
import psycopg2
from botocore.exceptions import ClientError
from csp.decorators import cs... |
# 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 may ... |
# -*- coding: utf-8 -*-
# Copyright © 2015 Tiger Computing Ltd
# This file is part of pytiger and distributed under the terms
# of a BSD-like license
# See the file COPYING for details
# shortcut: from pytiger.nagios import NagiosCheck
from .nagioscheck import NagiosCheck # noqa: F401
|
import re
import subprocess
def get(value, regex):
output = subprocess.getoutput(value)
r = re.search(regex, output)
if r and len(r.groups()) > 0:
return r.groups()[0]
return None
|
import dash_bootstrap_components as dbc
from dash_extensions.enrich import Input, Output
from dash import html, dcc
def layout(*args, **kwargs):
return dbc.Container([
dbc.Row(html.Br()),
dbc.Row(dcc.Input(id="input"), justify="around"),
dbc.Row(html.Div(id="output"), justify="around"),
... |
"""
Manage transfers from arbitrary URLs to temporary files. Socket interface for
IPC with multiple process configurations.
"""
import os, subprocess, socket, logging, threading
from galaxy import eggs
from galaxy.util import listify, json
log = logging.getLogger( __name__ )
class TransferManager( object ):
"""... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import _init_paths
import os
import sys
import cv2
import json
import copy
import numpy as np
from opts import opts
from detector import Detector
from tools.accum_coco import AccumCOCODetResult
import pickle
... |
#
# Copyright 2019 The Eggroll Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... |
# Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
# model file: example-models/ARM/Ch.12/radon_no_pool.stan
import torch
import pyro
import pyro.distributions as dist
def init_vector(name, dims=None):
return pyro.sample(name, dist.Normal(torch.zeros(dims), 0.2 * torch.ones(dims))... |
"""
=================================================
Compare evoked responses for different conditions
=================================================
In this example, an Epochs object for visual and
auditory responses is created. Both conditions
are then accessed by their respective names to
create a sensor layout... |
from pybabelfy.babelfy import *
text = "BabelNet is both a multilingual encyclopedic dictionary and a semantic network"
lang = "EN"
# This only works for the demo example. Change it for your RESTful key (you must register at babelfy.org for it)
key = "5e962130-b37f-4105-8512-4c97b4f3cb30"
babelapi = Babelfy()
semant... |
# Generated by Django 2.0.2 on 2018-02-20 22:54
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('topology', '0003_link_status_and_openvpn_parser'),
]
operations = [
migrations.AlterField(
mode... |
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
from django.views import defaults as default_views
from django.views.generic import TemplateView
from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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 asyncio
import logging
import os
import signal
from typing import (
AsyncIterable,
AsyncIterator,
Awaitable,
Callable,
Tuple,
)
from async_generator import asynccontextmanager
from async_timeout import timeout
class AsyncProcessRunner():
logger = logging.getLogger("trinity.tools.async_... |
from easyquant import StrategyTemplate
# from easyquant import RedisIo
from easyquant import DataUtil
from threading import Thread, current_thread, Lock
import json
# import redis
import time
# import datetime
from datetime import datetime, date
import pandas as pd
# import pymongo
from QUANTAXIS.QAFetch import QATdx ... |
import sys
import numpy as np
import msgpack
import re
def reconstitute(filename, fieldnum):
chkpt = msgpack.load(open(filename, 'rb'))
mesh = chkpt['mesh']
primitive = np.zeros([mesh['ni'], mesh['nj'], 4])
for patch in chkpt['primitive_patches']:
i0 = patch['rect'][0]['start']
j0 = pat... |
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Ingredient, Recipe
from recipe.serializers import IngredientSerializer
INGREDIENTS_URL = reverse('recipe... |
# -*- coding: utf-8 -*-
import os
import json
from splash import defaults
from splash.utils import to_bytes, path_join_secure
from splash.errors import BadOption
class RenderOptions(object):
"""
Options that control how to render a response.
"""
_REQUIRED = object()
def __init__(self, data, max... |
from singleton.singleton import Singleton
@Singleton
class Config(object):
def __init__(self, vars = []):
self.vars = vars
def get_vars():
return Config.instance().vars
|
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def inorderSuccessor(self, root: 'TreeNode', p: 'TreeNode') -> 'TreeNode':
def inorder(node):
if(node==None):
... |
from urlparse import urlparse
import gevent
import os
import socket
import traceback
import boto
from . import calling_format
from wal_e import files
from wal_e import log_help
from wal_e.exception import UserException
from wal_e.pipeline import get_download_pipeline
from wal_e.piper import PIPE
from wal_e.retries im... |
""" Contains all the custom exceptions used. """
class DirectoryAccessError(Exception):
""" Exception to be raised when the directory can't be accessed. """
pass
class DirectoryCreateError(Exception):
""" Exception to be raised when the directory can't be created. """
pass
class ImageDownloadError(... |
from pkg_resources import parse_version
from configparser import ConfigParser
import setuptools
assert parse_version(setuptools.__version__) >= parse_version("36.2")
# note: all settings are in settings.ini; edit there, not here
config = ConfigParser(delimiters=["="])
config.read("settings.ini")
cfg = config["DEFAULT... |
import matplotlib
matplotlib.use("Agg")
import matplotlib.pylab as plt
import numpy as np
def save_figure_to_numpy(fig):
# save it to a numpy array.
data = np.fromstring(fig.canvas.tostring_rgb(), dtype=np.uint8, sep='')
data = data.reshape(fig.canvas.get_width_height()[::-1] + (3,))
return data
def ... |
#! /usr/bin/env python
from setuptools import setup, Command
from subprocess import check_call
from distutils.spawn import find_executable
import cpplint as cpplint
class Cmd(Command):
'''
Superclass for other commands to run via setup.py, declared in setup.cfg.
These commands will auto-install setup_requ... |
import sys
sys.path.append('..')
from helpers import render_frames
from graphs.PathTracer import PathTracer as g
from falcor import *
m.addGraph(g)
m.loadScene('Arcade/Arcade.pyscene')
# default
render_frames(m, 'default', frames=[128])
exit()
|
import numpy
from exojax.spec.rtransfer import nugrid
from exojax.spec import AutoXS
from exojax.spec import AutoRT
import matplotlib.pyplot as plt
if False:
nus=numpy.logspace(numpy.log10(1900.0),numpy.log10(2300.0),160000,dtype=numpy.float64)
#nus=numpy.logspace(numpy.log10(2041.6),numpy.log10(2041.7),10000,... |
"""This module contains the general information for StorageControllerReference ManagedObject."""
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class StorageControllerReferenceConsts:
CONTROLLER_TYPE_FLASH = "FLASH"
CONTROLLER_TYPE_HBA ... |
from bakujobs.models import Job, Category, Description
from froala_editor.widgets import FroalaEditor
from django import forms
class JobCreate(forms.ModelForm):
class Meta:
model = Job
#fields = ('job_title', 'company_name', 'category', 'job_description', 'job_type', 'location', 'description', 'web... |
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and re... |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... |
# pylint: disable=invalid-name,no-self-use
import pytest
import numpy
import torch
import torch.nn.init
from torch.nn.modules.rnn import LSTM
from torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence
from allennlp.common.checks import ConfigurationError
from allennlp.common.testing import AllenNlpTestCa... |
import os
import re
import string
import sys
import time
import types
OUT_ENCODING = 'utf-8'
version = (
(sys.hexversion & (0xff << 24)) >> 24,
(sys.hexversion & (0xff << 16)) >> 16
)
if version[0] >= 3:
#noinspection PyUnresolvedReferences
import builtins as the_builtins
string = "".__class__
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import argparse
import json
from utils import *
import logging
logging.basicConfig(filename='log',
filemode='a',
format='%(asctime)s,%(msecs)d %(name)s... |
import numpy as np
from schedgym.sched_env import SchedEnv
DATA_PATH = 'vmagent/data/Huawei-East-1.csv'
if __name__ == "__main__":
env = SchedEnv(5, 40, 90, DATA_PATH, render_path='../test.p',
allow_release=False, double_thr=32)
MAX_STEP = 1e4
env.reset(np.random.randint(0, MAX_STEP))
... |
import mysql.connector
import json
import re
import pandas as pd
import pymysql
from sqlalchemy import create_engine
import sys
# Adding the path of self-def Library
sys.path.append("C:/Users/A02wxy/Documents/GitHub/WayFinder/Direction/Library/script/")
from featureCollection import Feature, Vertex
from myio import rea... |
class Winding():
def __init__(self,type,voltage,current,taps=None,fill=True):
self.type = type
self.voltage = voltage
self.current = current
self.taps = taps
self.fillLast = fill
self.va = voltage*current
... |
# Set the absolute path in
import numpy as np
import pandas as pd
#from matplotlib import pyplot as plt
import os
import csv
if not os.getenv("LAB_PATH"):
print("Set Lab Path\n")
exit(1)
benchmarks = ['510.parest_r','541.leela_r','641.leela_s','531.deepsjeng_r','631.deepsjeng_s','505.mcf_r','605.mcf_s','523... |
import os
from mortar_rdb.testing import register_session, TestingBase
from mortar_rdb import get_session, declarative_base
from mortar_rdb.controlled import Config, Source
from testfixtures.components import TestComponents
from mock import Mock
from sqlalchemy.pool import StaticPool
from sqlalchemy.engine.reflection ... |
# 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 ... |
"""
Django settings for profiles_project project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
impor... |
"""config URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... |
import inspect
import os
import sys
import time
from functools import partial
import dill as pkl
from ..dtaiexperimenter import Function, Process
from ..io import dump_object
from .utils import extract_source_of_function
from ..execs import (
DTAIExperimenterFunctionExecutor,
DTAIExperimenterProcessExecutor,
... |
from os.path import expanduser
import re
import operator
from io import StringIO
import math
import os
import sys
if sys.version_info[0] < 3:
import ConfigParser as configparser
else:
import configparser
DEBUG = 0
def yes_or_no(title):
menu = {1:['Yes',True],2:['No',False]}
print("\n")
print... |
import numpy as np
import pytest
from beast.observationmodel.extra_filters import make_integration_filter, make_top_hat_filter
@pytest.mark.parametrize(
"lambda_start,lambda_finish,d_lambda",
[(90., 913., 1.), (1000, 3000, 100)],
)
def test_extra_filters(lambda_start, lambda_finish, d_lambda):
# create ... |
# urllib3/connectionpool.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import logging
import socket
import errno
from socket import error as SocketError, time... |
def now(ExTime = 600):
from ntptime import settime
import setting
import utime
import time
timeserver = setting.get('timeserver')
try:
print(utime.time())
timeset = False
nn = 0
while timeset == False:
try:
if timeser... |
# pylint: disable=missing-module-docstring
import sys
from .viewer import main as _main
if __name__ == "__main__":
sys.exit(_main())
|
import logging
from functools import partial
from datetime import datetime, timedelta
from typing import Mapping
from pprint import pformat
import attr
from crud.abc import Endpoint, Serializable
from crud.exceptions import GatewayConnectionError
from ..utils import FuncByDates
from ..utils.gateways import Montage as ... |
#!/usr/bin/env python3
import wx, os, effects
from PIL import Image
class MainGUI(wx.Frame):
def __init__(self,parent,title):
wx.Frame.__init__(self,parent,title=title,size=(1000,600))
self.panel = wx.Panel(self)
self.filePath = ""
self.wildcard = "images (*.jpeg,*.jpg,*.png)|*.jpeg... |
class Agent(object):
def __init__(self, init_pos = [1,1], goal_pos = [11,11], normal_pos = [11,2], bad_pos = [6,11]):
self.pos = [init_pos[0], init_pos[1]]
self.goal_pos = goal_pos
self.normal_goal_pos = normal_pos
self.bad_goal_pos = bad_pos
self.action_space = 4
sel... |
import numpy
import pytest
from ..adapters.array import ArrayAdapter
from ..adapters.mapping import MapAdapter
from ..client import from_tree
from ..queries import FullText
tree = MapAdapter(
{
"a": ArrayAdapter.from_array(
numpy.arange(10), metadata={"apple": "red", "animal": "dog"}
)... |
# Copyright 2018 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
from recipe_engine import recipe_test_api
from .api import EnsureFile
class CIPDTestApi(recipe_test_api.RecipeTestApi):
EnsureFile = EnsureF... |
import logging
from typing import Dict, Sequence
from django.contrib.auth.models import User, Group
from django.test import TestCase, client
# Create your tests here.
from rest_framework.reverse import reverse_lazy
from rest_framework.test import APIRequestFactory, APIClient
from rest_framework import status
from d... |
#!/usr/bin/env python
from setuptools import setup
from glob import glob
packages = ['sldr']
scripts = set(filter(lambda x: x.rfind(".") == -1, glob('scripts/*')))
setup(name='sldr',
version='0.7.5',
description='python package and scripts for working with SLDR',
long_description="""Modules and sc... |
# import math
# import librosa
import torch
import pickle
# import torch.nn as nn
# from torch_stft import STFT
# from nemo import logging
from nemo.collections.asr.parts.perturb import AudioAugmentor
# from nemo.collections.asr.parts.segment import AudioSegment
class RpycWaveformFeaturizer(object):
def __init_... |
#!/usr/bin/env python3
# Copyright (c) 2016-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the bumpfee RPC.
Verifies that the bumpfee RPC creates replacement transactions successfully when... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -------------------------------------------------------------------... |
# Copyright (c) 2010-2020 Benjamin Peterson
#
# 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, modify, merge, publi... |
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 6 20:31:10 2020
@author: pritz
"""
#import libraries
import pickle
#from flask import Flask, request
#import flasgger
#from flasgger import Swagger
#import numpy as np
#import pandas as pd
import streamlit as st
from PIL import Image
#app=Flask(__name__)... |
#!/usr/bin/env python
"""
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.LOW
def tamper(payload, **kwargs):
"""
Replaces space character (' ') with a pound character ('#') follow... |
from floodsystem.stationdata import build_station_list, update_water_levels
from floodsystem.flood import stations_level_over_threshold
def run():
# Build list of stations
stations = build_station_list()
# Update latest level data for all stations
update_water_levels(stations)
stations_over = st... |
'''Unit tests for ckan/logic/auth/create.py.
'''
import mock
import nose
import ckan.model as core_model
import ckan.new_tests.helpers as helpers
import ckan.new_tests.factories as factories
import ckan.logic.auth.create as auth_create
logic = helpers.logic
assert_equals = nose.tools.assert_equals
class TestCreat... |
# Some weird stuff perfectly legit since python 3.6
universe_age = 14_000_000_000
print (universe_age)
# return 14000000000
# 3 in a row !!! or more
x, y, z = 14, 'olivier', True
print (x, y, z)
# return 14 olivier True
MAX_CONNECTIONS = 5000
# A constant is like a variable whose value stays the same throughout the ... |
"""Reference implementation of the CWL standards."""
__author__ = "pamstutz@veritasgenetics.com"
CWL_CONTENT_TYPES = [
"text/plain",
"application/json",
"text/vnd.yaml",
"text/yaml",
"text/x-yaml",
"application/x-yaml",
]
|
from src.model.wall import Wall
WIDTH = 840
HEIGHT = 600
# Base room that contains only the outer walls
base_room = []
padding_base = 20
base_room.append(Wall((padding_base, padding_base), (WIDTH - padding_base, padding_base)))
base_room.append(Wall((padding_base, HEIGHT - padding_base), (WIDTH - padding_base, HEIGHT... |
import os
SCOPE = os.environ.get("SCOPE", "")
PROCESS_QUEUE = "{SCOPE}s3-sqs-lambda-async-chunked-process-queue".format(SCOPE=SCOPE)
from aws_scatter_gather.util.sqs_batch_sender import AsyncSqsBatchSender
def new_batch_sender(sqs_client):
return AsyncSqsBatchSender(sqs_client, queue_name=PROCESS_QUEUE)
|
__author__ = 'rcj1492'
__created__ = '2017.05'
__license__ = 'MIT'
# initialize logging
import logging
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
# retrieve schemas
from pocketlab import __module__
from jsonmodel.loader import jsonLoader
fields_schema = jsonLoader(__module__, 'models/lab-... |
# 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... |
"""A simple parser for extracting some meaning out of a code cell
The parser walks to the code coming from the kernel and separates it into
SQL code and magic commands.
The SQL code is passed further by the kernel to the MariaDB client for
execution.
The magic objects created here are invoked in the kernel to perform
... |
# Generated by Django 3.1.5 on 2021-02-10 12:55
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('application_evaluator', '0009_applicationroundattachment'),
]
operations = [
migrations.DeleteModel(
name='Comment',
),
]
|
#! /usr/bin/env python3
# MIT License
#
#Copyright 2020 Filipe Teixeira
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to us... |
from os import path
from kubetools.constants import (
GIT_BRANCH_ANNOTATION_KEY,
GIT_COMMIT_ANNOTATION_KEY,
GIT_TAG_ANNOTATION_KEY,
)
from kubetools.deploy.util import run_shell_command
from kubetools.exceptions import KubeBuildError
def _is_git_committed(app_dir):
git_status = run_shell_command(
... |
import subprocess
import uuid
import time
import socket
import os
import json
import pytest
import requests
import threading
import boto3
from pytest_localserver.http import WSGIServer
SYMBOLICATOR_BIN = [os.environ.get("SYMBOLICATOR_BIN") or "target/debug/symbolicator"]
AWS_ACCESS_KEY_ID = os.environ.get("SENTRY_SY... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# isochrones.py
# Ben Cook (bcook@cfa.harvard.edu)
"""Define the Isocrhone_Model class"""
import numpy as np
import pandas as pd
import os
import glob
import sys
from warnings import warn
from pkg_resources import resource_filename
##########################
# Useful Utilities
def load_MIST_dir(dir_path, iso_appen... |
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RVarselrf(RPackage):
"""Variable Selection using Random Forests.
Variable selection f... |
# python3
"""Definitions for Python AST objects.
AST nodes are not very convenient for comparing two files. Instead, they should
be parsed into these definitions. Each Definition subclass exposes the
attributes of a particular kind of AST node.
"""
from typing import ClassVar, Dict, Optional, List, Union
import datac... |
import pandas as pd
import numpy as np
import copy
import pickle
from datetime import datetime,timedelta
import os
import multiprocessing
import random
data_path = '../data/'
TEST = True
if TEST:
df = pd.read_csv(data_path + '201407_new.csv',sep = ';')
else:
data_path = '../data/'
df1 = pd.read_csv(da... |
from urllib.parse import urlparse
import pandas as pd
FILENAME = "LC_URLHAUS_Domains_List.txt"
url="https://urlhaus.abuse.ch/downloads/text/"
domains = pd.read_csv(url, skiprows=9, names=['url'], error_bad_lines=False, warn_bad_lines=False)
domains['source'] = ' urlhaus'
domains['url'] = domains['url'].apply(lambda u... |
from flask import Blueprint, render_template, url_for
from simplex import (
SimplexPage, SIMUI, SimplexLayout
)
index_view_bp = Blueprint('index_view', __name__)
@index_view_bp.route('/')
def index():
_sidebar_items = [
SimplexLayout.SimplexSidebarItem().add_content(
SIMUI.SIMUIListItem()... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core_project.settings')
try:
from django.core.management import execute_from_command_line
except... |
# coding: utf-8
import os
class NoDataError(Exception):
"""historyやindicatorのデータにアクセスした際に、取得対象のデータが存在しない場合に発生する例外です。
データが存在しない場合は「データが足りていない(※1)」や「範囲外へのアクセス(※2)」などがあります。
※1: 25日移動平均線の場合、1から24日目まではデータがないので集計できません。
※2: 明日以降などのデータにはアクセスできないようになっています。"""
pass
class OrderTypeError(Exception):
"""... |
"""
Polizei Brandenburg: App
Polizei Brandenburg Nachrichten, Hochwasser-, Verkehrs- und Waldbrandwarnungen # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import copy
import logging
import multiprocessing
import sys
from http import client a... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Chris Caron <lead2gold@gmail.com>
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# 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 th... |
import pytest
@pytest.fixture
def parser():
from math_expression_parser import Parser
return Parser()
@pytest.mark.parametrize('test_input, expected', [
('3 + 8', '3 8 +'),
('( 3 + 4 * 2 / ( 1 - 5 ) ^ 2 ^ 3 )', '3 4 2 * 1 5 - 2 3 ^ ^ / +'),
])
def test_eval(test_input, expected, parser):
assert p... |
"""
Perform inviscid drag minimization of initially rectangular wing with respect to
the chord distribution, subject to a lift and reference area constraint. Similar
to the twist optimization, the expected result from lifting line theory should
produce an elliptical lift distrbution. Check output directory for Tecplot
... |
from __future__ import annotations
import os
import random
from typing import Match
from bot.config import Config
from bot.data import command
from bot.data import format_msg
NO_QUOTES = '@{} sorry, there are no quotes :('
FILES_WITH_NO_QUOTES = set()
@command('!quote')
async def cmd_quote(config: Config, match: ... |
# BSD 3-Clause License
#
# Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyrig... |
# 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 may ... |
"""
@name: cluster_perturbation_validation.py
@description:
Look at differences in weight differences to find appropriate noise level
@author: Christopher Brittin
@email: "cabrittin"+ <at>+ "gmail"+ "."+ "com"
@date: 2019-12-05
"""
import sys
sys.path.append(r'./preprocess')
import os
from configparser import ConfigPa... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
from builtins import * # NOQA
standard_library.install_aliases() # NOQA
import basetest_dqn_like as base
from basetest_training impo... |
#! /usr/bin/env
# -*- encoding:utf-8 -*-
import unittest
import torch
from lempa import sum_product
from lempa import spmat
from torch.autograd import Variable
class TestDecoderModel(unittest.TestCase):
def test_sum_product_decoding(self):
filename = 'data/3x6irRegLDPC/parity_check_matrix.spmat'
... |
# Copyright 2019 The Blueqat Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
class Cookie:
# Constructor
def __init__(self, name, shape, chips='Chocolate'):
# Instance attributes
self.name = name
self.shape = shape
self.chips = chips
# The object is passing itself as a parameter
def bake(self):
print(f'This {self.name}, is being baked with the shape {self.shape} and chips of {sel... |
#make sure to type these two commands:
#export OMP_NUM_THREADS=64
#module load gsl
#python xiruncz.py --type ELG_HIP
import subprocess
import sys
import argparse
import os
#sys.path.append('../py')
#import LSS.mkCat_singletile.xitools as xt
#import LSS.SV3.xitools as xt
parser = argparse.ArgumentParser()
parser.add_a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.