text stringlengths 1 927k |
|---|
# -*- coding: utf-8 -*-
"""
Base classes for writing management commands (named commands which can
be executed through ``django-admin`` or ``manage.py``).
"""
from __future__ import unicode_literals
import os
import sys
from argparse import ArgumentParser
import django
from django.core import checks
from django.core.... |
from __future__ import absolute_import
# flake8: noqa
# import apis into api package
from openapi_client.api.alert_api import AlertApi
from openapi_client.api.facility_api import FacilityApi
from openapi_client.api.line_api import LineApi
from openapi_client.api.live_facility_api import LiveFacilityApi
from openapi_c... |
from __future__ import unicode_literals
from django.db import models
from mptt.models import MPTTModel, TreeForeignKey
import datetime
def get_sentinel_user():
return get_user_model().objects.get_or_create(name='deleted')[0]
class User(models.Model):
name = models.CharField(max_length=30)
email = models.... |
"""instagram URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... |
SUFFIXES = {
1000: ["KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"],
1024: ["KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"],
}
def approximate_size(size, a_kilobyte_is_1024_bytes=True):
"""Convert a file size to human-readable form.
Keyword arguments:
size -- file size in bytes
a_kilo... |
#!/usr/bin/python
# this is for python 2.7. Converting to python3 should be trivial
import ssl
# from http.server import BaseHTTPRequestHandler, HTTPServer
import BaseHTTPServer, SimpleHTTPServer
# class myHTTPServer_RequestHandler(BaseHTTPServer):
class myHTTPServer_RequestHandler(BaseHTTPServer.BaseHTTPRequestHandl... |
# 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... |
"""Wrapper for the generated Python code in ui/eula_quiz.py."""
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QDialog
from PyQt5.QtCore import Qt
from crocpad.configuration import app_config, save_config
from crocpad.ui.eula_quiz import Ui_EulaQuizDialog
class EulaQuizDialog(QDialog, Ui_EulaQuizDialog):
... |
import time
import pytest
from helpers.cluster import ClickHouseCluster
from helpers.test_tools import assert_eq_with_retry
cluster = ClickHouseCluster(__file__)
node1 = cluster.add_instance('node1', main_configs=['configs/fast_background_pool.xml'], with_zookeeper=True)
node2 = cluster.add_instance('node2', main_con... |
"""Script for dwr prediction benchmarking.
"""
# Sample usage:
# (shape_ft) : python -m factored3d.benchmark.suncg.dwr --num_train_epoch=1 --name=dwr_shape_ft --classify_rot --pred_voxels=True --use_context --save_visuals --visuals_freq=50 --eval_set=val --suncg_dl_debug_mode --max_eval_iter=20
from __future__ impor... |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/0.2_mgmnt.prep.files_mgmnt.ipynb (unless otherwise specified).
__all__ = ['logger', 'get_file_name', 'get_files_list', 'jsonl_list_to_dataframe', 'jsonl_to_dataframe',
'csv_to_dataframe', 'load_np_vectors', 'get_vector_paths_4_sample_set']
# Cell
import pand... |
#!/usr/bin/env python
def RDF_to_YAML(infile_name, outfile_name):
# if __name__ == "__main__":
# import sys
from spdx.parsers.rdf import Parser
from spdx.parsers.loggers import StandardLogger
from spdx.parsers.rdfbuilders import Builder
from spdx.writers.yaml import write_document
# file ... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
with open('requirements.txt', 'r') as fh:
requirements = fh.read().split('\n')
setuptools.setup(
name="PW_explorer",
version="0.0.25",
author="Sahil Gupta",
author_email="",
description="An Extensible Possib... |
#
# 如果目标值存在返回下标,否则返回 -1
# @param nums int整型一维数组
# @param target int整型
# @return int整型
#
class Solution:
def search(self, nums, target):
begin, end = 0, len(nums) - 1
while begin < end:
mid = (begin + end) // 2
if nums[mid] >= target:
end = mid
else... |
"""
Plot signal-to-noise ratios for XLENS simulations
Method 4 = mean temperature change / mean std of temperature in 1920-1959
Reference : Deser et al. [2020, JCLI] & Barnes et al. [2020, JAMES]
Author : Zachary M. Labe
Date : 28 October 2020
"""
### Import packages
import math
import time
import matplotli... |
# Copyright (c) 2013 Mirantis 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 or agreed to in writi... |
from Xlib import X, display, Xutil, Xatom |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
import json
import os
try:
with open('secrets.json', 'r') as secrets_file:
secrets = json.load(secrets_file)
except FileNotFoundError:
secrets = os.environ
class Config:
CONSUMER_KEY = secrets["CONSUMER_KEY"]
CONSUMER_SECRET = secrets["CONSUMER_SECRET"]
ACCESS_TOKEN = secrets["ACCESS_TOKEN... |
import django.contrib.postgres.fields.jsonb
import django.core.serializers.json
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("credit_integration", "0004_set_operational_start_date_nullable"),
]
operations = [
migrations.AddField(
m... |
# Template for binding columns from 2 datasets with the same number of rows.
# Recipe won't perform any joins/mapping but rather stitch 2 datasets together into wider dataset with
# the same number of rows and columns from both.
#
# Specification:
# Inputs:
# X: datatable - primary dataset
# Y_name: string - datase... |
#!/usr/bin/python
import os
import sys
import time
import signal
import importlib
import argparse
import subprocess
import xml.etree.ElementTree as ET
import xml.dom.minidom
import board
import timer
class Server(object):
"""
Othello server, implements a simple file-based playing protocol
"""
def ... |
### This gears will pre-compute (encode) all sentences using BERT tokenizer for QA
tokenizer = None
def loadTokeniser():
global tokenizer
from transformers import BertTokenizerFast
tokenizer = BertTokenizerFast.from_pretrained("bert-large-uncased-whole-word-masking-finetuned-squad")
# tokenizer = Aut... |
"""Python wrappers around TensorFlow ops.
This file is MACHINE GENERATED! Do not edit.
"""
import collections as _collections
from tensorflow.python.eager import execute as _execute
from tensorflow.python.eager import context as _context
from tensorflow.python.eager import core as _core
from tensorflow.python.framew... |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for implementations of L{ITLSTransport}.
"""
__metaclass__ = type
from zope.interface import implements
from twisted.internet.test.reactormixins import ReactorBuilder
from twisted.internet.protocol import ServerFactory, ClientFactory,... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import glob
import csv
import numpy as np
from numpy import genfromtxt
import gc # garbage collection
import hickle as hkl
class Aggregate():
def __init__(self):
self.csv_dir = "./csv_data/raw/"
# 40N-47N, 7E-15E - northern Italy
# ''Aquila 6 Apri... |
"""A Future class similar to the one in PEP 3148."""
__all__ = ['CancelledError', 'TimeoutError',
'InvalidStateError',
'Future', 'wrap_future',
]
import concurrent.futures._base
import logging
import reprlib
import sys
import traceback
from . import compat
from . import events
# Sta... |
# -*- coding: utf-8 -*-
import datetime as dt
import os
import random
import string
import sys
import time
import pandas as pd
import yaml
from past.builtins import basestring
this_dir = os.path.dirname(__file__)
def get_config(prog=None):
cfg_file = os.path.join(this_dir, 'conf.yaml')
with open(cfg_file, ... |
# coding: utf-8
from dohq_teamcity.custom.base_model import TeamCityObject
# from dohq_teamcity.models.snapshot_dependency import SnapshotDependency # noqa: F401,E501
class SnapshotDependencies(TeamCityObject):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the c... |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... |
''' nio_pe.py: A specialization of the PE class, for use with Nick's Accelerator
'''
from core.defines import Operator
from core.pe import PE
from core.messaging import Message
from core.utils import *
class NioPE(PE):
EXEC = 1
DONE = 3
RESP = 4
WAIT = 5
def __init__(self, system_clock_ref, m... |
#!/usr/bin/env python
from __future__ import print_function
from collections import OrderedDict
import re
regexes = {
'dalmiaa/Sample_NF': ['v_pipeline.txt', r"(\S+)"],
'Nextflow': ['v_nextflow.txt', r"(\S+)"],
'FastQC': ['v_fastqc.txt', r"FastQC v(\S+)"],
'MultiQC': ['v_multiqc.txt', r"multiqc, versio... |
from setuptools import setup
with open('README.md') as f:
long_description = f.read()
setup(
name = 'pyiptmnet',
packages = ['pyiptmnet'], # this must be the same as the name above
version = '0.1.7',
description = 'Python client for iPTMNet REST API - https://research.bioinformatics.udel.edu/iptmnet/',
... |
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__) |
from xml.dom import minidom as xd
import re
from Rules.AbstractRule import AbstractRule
class FileNamingRule(AbstractRule):
def __init__(self):
AbstractRule.__init__(self)
self.DictionaryList = []
self.DictionaryBaseClassList = []
self.DictionaryExceptionBaseClassList = []
def execute(self):
... |
from argus.metrics.metric import Metric
from argus.utils import AverageMeter
class Loss(Metric):
name = 'loss'
def __init__(self):
self.avg_meter = AverageMeter()
super().__init__()
def reset(self):
self.avg_meter.reset()
def update(self, step_output: dict):
self.avg... |
import torch
import torch.nn.functional as F
from torch import nn
class NTMHead(nn.Module):
def __init__(self, mode, controller_size, key_size):
super().__init__()
self.mode = mode
self.key_size = key_size
# all the fc layers to produce scalars for memory addressing
self.... |
# -*- coding: utf-8 -*-
#
# Sage documentation build configuration file, created by
# sphinx-quickstart on Thu Aug 21 20:15:55 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable... |
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
def rsp_findpeaks(rsp_cleaned, sampling_rate=1000, method="khodadad2018", amplitude_min=0.3):
"""Extract extrema in a respiration (RSP) signal.
Low-level function used by `rsp_peaks()` to identify inhalation and exhalation onsets (troughs and pea... |
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. 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 r... |
import logging
from ..interfaces import Address, Addressable, PinState, IMessage, IMsgRouter
from ..actor import Actor
from .pins import NullPin, BufferPin
class BestEffortActor(Actor):
def __init__(self, name: str = 'a', out_address: Address = None):
self.trigger_pin = NullPin('trigger', PinState.CLOSED,... |
class Calculator(object):
"""calclator class"""
def add(self, a, b):
return a + b
def sub(self, a, b):
return a - b
def mul(self, a, b):
return a * b
def div(self, a, b):
return a / b |
# coding=utf-8
from corefgraph.resources.lambdas import equality_checker, matcher, fail
__author__ = ''
# Features questions
female = matcher(".*FEM.*")
male = matcher(".*MASC*")
neutral = fail()
singular = matcher(".*SING.*")
plural = matcher(".*PLUR.*")
animate = fail()
inanimate = fail()
# Adjectives
adjective... |
default_app_config = 'djtools.seo.apps.SEOConfig' |
"""
__InstCProcDefCpart1_Complete_MDL.py_____________________________________________________
Automatically generated AToM3 Model File (Do not modify directly)
Author: gehan
Modified: Fri Mar 6 10:56:11 2015
_________________________________________________________________________________________
"""
from stickylink ... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mediapipe/calculators/image/bilateral_filter_calculator.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from goo... |
#!/usr/bin/env ipython
"""
Validator script for raft-level PRNU analysis.
"""
import astropy.io.fits as fits
import numpy as np
import lcatr.schema
import siteUtils
import eotestUtils
import camera_components
raft_id = siteUtils.getUnitId()
raft = camera_components.Raft.create_from_etrav(raft_id)
results = []
for slo... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... |
"""Scans directories for files that satisfy a specific mask and updates
version tags of all actions.
Example:
python3 update_actions.py live.yml action.y*ml folder/*.y*ml
"""
import argparse
import re
from pathlib import Path
from typing import Dict, List, Optional
from github import Github
ACTION_PATTERN = r"... |
from __future__ import division
import glob
import json
import os.path
golden_files = glob.glob('cases/*.out')
wins = 0
for golden_file in sorted(golden_files):
test_name = os.path.basename(golden_file)
output_file = '/usr/testguest/' + test_name
if not os.path.isfile(output_file):
print(test_name ... |
from alexa_skills.responses.Card import Card
from alexa_skills.responses.Dialog import Dialog
from alexa_skills.responses.OutputSpeech import OutputSpeech
from alexa_skills.responses.Reprompt import Reprompt
from alexa_skills.responses.Response import Response
from alexa_skills.responses.ResponseConstructor import Resp... |
'''
非递归快排
快速排序的核心思想是使用元素的值对数组进行划分。实现其非递归方案。
输入的每一行表示一个元素为正整数的数组,所有值用空格隔开,第一个值为数值长度,其余为数组元素值。
输出的每一行为排序结果,用空格隔开,末尾不要空格。
输入样例
13 24 3 56 34 3 78 12 29 49 84 51 9 100
输出样例
3 3 9 12 24 29 34 49 51 56 78 84 100
'''
'''
代码出处:
https://blog.csdn.net/u014204761/article/details/80536940
'''
def quick_sort_other(array, l, r):
... |
import time
import math
class Simulator:
def __init__(self):
self.amplitude = pow(10,-3)
self.frequency = 1
def sin_wave(self):
t = time.time()
frequency = self.frequency
amp = self.amplitude
phase = 0
value = amp*math.sin(frequency*t+phase)
return t, value;
def cos_wave(self):
t = time.time()
... |
# 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)
"""Debug signal handler: prints a stack trace and enters interpreter.
``register_interrupt_handler()`` enables a ctrl-C h... |
"""
Provide functionality to interact with vlc devices on the network.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.vlc/
"""
import logging
import voluptuous as vol
from homeassistant.components.media_player import (
SUPPORT_PAUSE, S... |
# DO NOT EDIT THIS FILE!
#
# This file is generated from the CDP specification. If you need to make
# changes, edit the generator and regenerate all of the modules.
#
# CDP domain: Debugger
from __future__ import annotations
from cdp.util import event_class, T_JSON_DICT
from dataclasses import dataclass
import enum
im... |
import os
import yaml
import tensorflow as tf
from NMTmodel.NMT.dataset import data_util
cur_dir = os.path.dirname(os.path.abspath(__file__))
par_dir = os.path.dirname(cur_dir)
class DatasetTest(tf.test.TestCase):
def setUp(self):
self.config_file = os.path.join(par_dir, "config.yml")
def test_datas... |
# Copyright 2020 Akamai Technologies, 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 or agreed to... |
# Copyright 2014 Google 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
from kopf.structs.credentials import VaultKey, ConnectionInfo
def test_key_as_string():
key = VaultKey('some-key')
assert isinstance(key, str)
assert key == 'some-key'
def test_creation_with_minimal_fields():
info = ConnectionInfo(
server='https://localhost',
)
assert info.server == ... |
# coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... |
import os
import tensorflow as tf
from os import path
from absl import app, flags, logging
from absl.flags import FLAGS
from tensorflow_serving.apis import model_pb2, predict_pb2, prediction_log_pb2
from yolov3_tf2.dataset import preprocess_image, load_tfrecord_dataset
flags.DEFINE_string('dataset', None,
... |
from django.db import models
from aziende.models import *
# Create your models here.
class Anagrafica(models.Model):
nome = models.CharField(null=False, max_length=128)
cognome = models.CharField(null=False, max_length=128)
codice_fiscale = models.CharField(null=False, max_length=16)
azienda = models... |
# Generated by Django 2.2.12 on 2020-05-12 21:55
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('contentPages', '0017_auto_20200507_1147'),
('contentPages', '0033_auto_20200505_1041'),
]
operations = [
] |
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect
from django.views.decorators.cache import never_cache
from django.views.generic import TemplateView, FormView
from django_otp import user_has_device, devices_for_user
from ..forms import Dis... |
# Natural Language Toolkit: Word Sense Disambiguation Algorithms
#
# Authors: Liling Tan <alvations@gmail.com>,
# Dmitrijs Milajevs <dimazest@gmail.com>
#
# Copyright (C) 2001-2017 NLTK Project
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from nltk.corpus import wordnet
def lesk(cont... |
from argparse import ArgumentParser
from subprocess import run
from pathlib import Path
from lexer import Lexer
from parser import Parser, TokenError
from compiler import Compiler
argparser = ArgumentParser(description='Compile PL0 source.')
argparser.add_argument('source_file', metavar='file', type=str, help='source... |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ...comments import Comments
class TestInitialisation(unittest.TestCase):
"""
T... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Sione Taumoepeau and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestAccessControlUser(unittest.TestCase):
pass |
# Copyright 2020 Dakewe Biotech Corporation. 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... |
data = {'level_index': 10241, 'move_count': '30',
'board_info': {(0, 8): {'next': (0, -1), 'prev': (1, 0)}, (0, 7): {'next': (0, -1), 'prev': (0, 1)},
(0, 6): {'next': (0, -1), 'prev': (0, 1)}, (0, 5): {'next': (0, -1), 'prev': (0, 1)},
(0, 4): {'next': (0, -1), 'pr... |
# Future
from __future__ import annotations
# My stuff
from aiospotify import exceptions
__all__ = (
"EXCEPTION_MAPPING",
"SCOPES",
"VALID_SEED_KWARGS",
)
EXCEPTION_MAPPING = {
400: exceptions.BadRequest,
401: exceptions.Unauthorized,
403: exceptions.Forbidden,
404: exceptions.NotFound,... |
"""Test code suite.
"""
import unittest
from .test_computations import ComputationsTests # noqa: F401
from .test_vector import VectorTests # noqa: F401
def main_tests() -> None:
unittest.main()
if __name__ == "__main__":
main_tests() |
# coding: utf-8
# In[ ]:
#Query `apiso:ServiceType` on data.gov
# In[17]:
from owslib.csw import CatalogueServiceWeb
from owslib import fes
import numpy as np
# In[18]:
#endpoint = 'http://catalog.data.gov/csw-all' #granule level production catalog
endpoint = 'http://uat-catalog-fe-data.reisys.com/csw-all' # ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import defaultdict
import numpy as np
from scipy.ndimage.morphology import binary_dilation
from scipy.ndimage.interpolation import map_coordinates
from dipy.segment.clustering import QuickBund... |
# coding: utf-8
"""
Influx API Service.
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: 0.1.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class PipeLiteral(object)... |
from setuptools import setup
setup(
name='ecoinvent_row_report',
version="0.2.1",
packages=["ecoinvent_row_report"],
author="Chris Mutel",
author_email="cmutel@gmail.com",
license=open('LICENSE.txt').read(),
url="https://bitbucket.org/cmutel/ecoinvent-row-report",
package_data={'ecoinve... |
import time
from dataclasses import dataclass, field
from typing import Optional
from rlbot.setup_manager import SetupManager
from rlbot.training.training import Grade, Pass, Fail
from rlbot.utils.game_state_util import GameState
from rlbot.utils.structures.game_data_struct import GameTickPacket
from rlbot.utils.struc... |
"""
We implement this top-down view render based on eleurent/Highway-Env
See more information on its Github page: https://github.com/eleurent/highway-env
"""
from pgdrive.world.top_down_observation.top_down_multi_channel import TopDownMultiChannel
from pgdrive.world.top_down_observation.top_down_observation import TopD... |
"""
Classes from the 'Pegasus' framework.
"""
try:
from rubicon.objc import ObjCClass
except ValueError:
def ObjCClass(name):
return None
def _Class(name):
try:
return ObjCClass(name)
except NameError:
return None
PGControlsViewModelValues = _Class("PGControlsViewModelValue... |
"""dsdsddds_34505 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/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')
Clas... |
# flake8: noqa
"""Set up gtkwrapper for GTK+ 3 and replace this module with it."""
import sys
import warnings
import gi
# Ignore the GTK+ 2 warning.
with warnings.catch_warnings():
warnings.simplefilter('ignore')
gi.require_version('Gtk', '2.0')
from gi.repository import Gtk
gi.require_version('Gdk', '2... |
# -*- coding: utf-8 -*-
from ._common import *
class Ku6(SimpleExtractor):
name = '酷6 (Ku6)'
def init(self):
self.url_pattern = 'flvURL: "([^"]+)'
self.title_pattern = 'title = "([^"]+)'
pass
def list_only(self):
return match(self.url, 'https://www.ku6.com/detail/\d+')
... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
#
# FreeType high-level python API - Copyright 2011-2015 Nicolas P. Rougier
# Distributed under the terms of the new BSD license.
#
# -----------------------------------------------------------------------------
''... |
from app import create_app, db
from app.models import User,Pitch,Comment
from flask_script import Manager,Server
from flask_migrate import Migrate, MigrateCommand
# Creating app instance
app = create_app('production')
manager = Manager(app)
migrate = Migrate(app,db)
manager.add_command('server',Server)
manager.add_co... |
# -*- coding: utf-8 -*-
"""
Copyright 2022 Mitchell Isaac Parker
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 ... |
# test builtin hash function with float args
# these should hash to an integer with a specific value
for val in ("0.0", "-0.0", "1.0", "2.0", "-12.0", "12345.0"):
print(val, hash(float(val)))
# just check that these values are hashable
for val in ("0.1", "-0.1", "10.3", "0.4e3", "1e16", "inf", "-inf", "nan"):
... |
# 12-12-19 nembery@paloaltonetworks.com
import os
import re
import sys
from lxml import etree
from skilletlib import Panoply
config_source = os.environ.get('skillet_source', 'offline')
if config_source == 'offline':
# grab our two configs from the environment
base_config_path = os.environ.get('BASE_CONFIG', ... |
# Copyright 2018 Google 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
"""Class for generating sequences
Adapted from https://github.com/tensorflow/models/blob/master/im2txt/im2txt/inference_utils/sequence_generator.py"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import heapq
from .config import EOS
class Sequence(objec... |
import os
from os import path
from base import BaseTest
from keystore import KeystoreBase
class TestKeystore(KeystoreBase):
"""
Test Keystore variable replacement
"""
def setUp(self):
super(BaseTest, self).setUp()
self.keystore_path = self.working_dir + "/data/keystore"
if p... |
#!/usr/bin/env python3
# @@@LICENSE
#
# Copyright (c) 2014 LG Electronics, 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 requi... |
# image_transport::SubscriberFilter wide_left; // "/wide_stereo/left/image_raw"
# image_transport::SubscriberFilter wide_right; // "/wide_stereo/right/image_raw"
# message_filters::Subscriber<CameraInfo> wide_left_info; // "/wide_stereo/left/camera_info"
# message_filters::Subscriber<CameraInfo> wide_right_in... |
#!/usr/bin/env python3
#-----------------------------------------------------------------------------
# This file is part of the rogue software platform. It is subject to
# the license terms in the LICENSE.txt file found in the top-level directory
# of this distribution and at:
# https://confluence.slac.stanford.edu... |
# Python Essential Libraries by Joe Marini course example
# Example file for Pendulum library
from datetime import datetime
import time
import pendulum
# TODO: create a new datetime using pendulum
dt1 = pendulum.datetime(2020, 1, 31)
print(dt1)
print(isinstance(dt1, datetime))
print(dt1.timezone_name)
dt_us = pendulu... |
from myproject import db
from myproject import db,login_manager
from werkzeug.security import generate_password_hash,check_password_hash
from flask_login import UserMixin
@login_manager.user_loader
def load_user(user_id):
return User.query.get(user_id)
class User(db.Model,UserMixin):
__tablename__ = 'users'
id =... |
# MIT License
#
# Copyright (c) 2019 Johan Brichau
#
# 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... |
"""
This file is required to allow conftest.py to import
pynonymizer stuff
""" |
from __future__ import absolute_import, division, print_function
import torch
import pyro
import pyro.distributions as dist
import pyro.poutine as poutine
from pyro.infer import EmpiricalMarginal, TracePredictive
from pyro.infer.mcmc import MCMC, NUTS
from tests.common import assert_equal
def model(num_trials):
... |
#(c) 2016 by Authors
#This file is a part of ABruijn program.
#Released under the BSD license (see LICENSE file)
"""
Separates alignment into small bubbles for further correction
"""
from __future__ import absolute_import
from __future__ import division
import logging
from bisect import bisect
from flye.six.moves imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.