text stringlengths 1 927k |
|---|
# -*- coding: utf-8 -*-
import os
import sys
import shutil
from django.core.management.base import AppCommand
from django.core.management.color import color_style
from django_extensions.management.utils import _make_writeable, signalcommand
class Command(AppCommand):
help = ("Creates a Django management command... |
#------------------------------------------------------------------------------
# Copyright (c) 2020, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#-----------------------------------------------------... |
import logging
from datetime import datetime
from pathlib import Path
from secrets import token_bytes
from typing import List, Optional, Tuple
from blspy import AugSchemeMPL, G1Element, PrivateKey
from chiapos import DiskPlotter
from beet.plotting.plot_tools import add_plot_directory, stream_plot_info_ph, stream_plot... |
"""Predict lexical norms, either to evaluate word vectors, or to get norms for unnormed words."""
import numpy as np
import pandas as pd
import sklearn.linear_model
import sklearn.model_selection
import sklearn.preprocessing
import sklearn.utils
import argparse
import os
from .vecs import Vectors
from .utensils import ... |
# coding=utf-8
__author__ = 'renkse'
from forms import FeedbackForm
from django.template import RequestContext, loader
from django.http import HttpResponse, HttpResponseRedirect
from models import Contact, FeedbackMessage
from collections import OrderedDict
import json
def contacts_view(request):
fbform = Feedba... |
from django import forms
class CookieGroupWidget(forms.Widget):
template_name = "cookie_consent/cookie_group_widget.html" |
"""All config load functions."""
import os
import sys
import yaml
class config():
"""Create pia config class."""
def __init__(self):
super(config, self).__init__()
def config_read(self, config_file="~/.pia.conf"):
"""Read config in yaml format."""
try:
with open(os.pat... |
import datetime
import warnings
from dataclasses import dataclass
from functools import wraps
from django.contrib.sites.shortcuts import get_current_site
from django.core.paginator import EmptyPage, PageNotAnInteger
from django.http import Http404
from django.template.response import TemplateResponse
from django.urls ... |
import functools
import itertools
import os
from uitools.qt import Q
from maya import cmds
from sgfs import SGFS
import mayatools.shelf
from mayatools.tickets import ticket_ui_context
from mayatools.geocache import utils as geocache_utils
from sgpublish import uiutils as ui_utils
from sgpublish import check
from sg... |
# -*- coding: utf-8 -*-
"""
Copyright 2017-2018 Shota Shimazu.
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 appl... |
import pytest
from kidslanguages import english_to_pig_latin
@pytest.mark.parametrize(
"original,expected_pig_latinized",
[("inside job", "insideway objay"), ("i am groot", "iway amway rootgay")],
)
def test_latinize(original: str, expected_pig_latinized: str):
assert list(english_to_pig_latin(original)) ... |
# This work is based on original code developed and copyrighted by TNO 2020.
# Subsequent contributions are licensed to you by the developers of such code and are
# made available to the Project under one or several contributor license agreements.
#
# This work is licensed to you under the Apache License, Version 2... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import random
import numpy as np
import seaborn as sns
from datetime import datetime
import matplotlib.pyplot as plt
from preprocess import preprocess
import keras as K
import tensorflow as tf
from keras.regularizers import l2
from keras.utils import plot_model... |
#!/usr/bin/env python
"""
Copyright (c) 2020 Alex Forencich
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, merg... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
import re
class AboutRegex(Koan):
"""
These koans are based on Ben's book: Regular Expressions in 10
minutes. I found this book very useful, so I decided to write
a koan file in order to practice everything it taught... |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.forms import UserChangeForm
from models import (
Assignment,
AudioAsset,
Call,
Comment,
ContentLicense,
ContractorProfile,
ContractorSubscription,
Discussion,
DocumentAsset,
... |
import json
class OrderException(Exception):
pass
def first_step(event, context):
print(event)
if event.get('orderId') is None:
raise OrderException('No orderId was provided!')
if event['orderId'] != 'abc123':
raise OrderException(f'No record found for recordId: {event["orderId"]}')
... |
# Copyright 1999-2020 Alibaba Group Holding 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 a... |
import asyncio
import sys
import numpy as np
import pandas as pd
import serial
import serial.tools.list_ports
import bokeh.plotting
import bokeh.io
import bokeh.layouts
import bokeh.driving
from bokeh.server.server import Server
from bokeh.application import Application
from bokeh.application.handlers.function impo... |
#
# PySNMP MIB module HUAWEI-VPN-DIAGNOSTICS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HUAWEI-VPN-DIAGNOSTICS-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:49:42 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version ... |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/05-orchestrator.ipynb (unless otherwise specified).
__all__ = ['retry_request', 'if_possible_parse_local_datetime', 'SP_and_date_request', 'handle_capping',
'date_range_request', 'year_request', 'construct_year_month_pairs', 'year_and_month_request',
... |
# -*- coding: utf-8 -*-
'''
:codeauthor: Rahul Handay <rahulha@saltstack.com>
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase
from tests.support.mock import (
MagicMock,
... |
# -*- coding: utf-8 -*-
import sys
import numpy as np
def cal_rank_scores(label_num):
# rank scores [1 - 10]
# s = a(x - b)^2 + c
# if rank is 0, score is 10
# b = num-1
s_min = 1.0
s_max = 10.0
b = label_num - 1
c = s_min
a = (s_max - c) / b ** 2
rank_scores = [0] * label_n... |
from typing import Dict
import pytest
from tests import config as conf
from tests import experiment as exp
@pytest.mark.parallel # type: ignore
@pytest.mark.parametrize("tf2", [False]) # type: ignore
def test_tf_keras_native_parallel(tf2: bool) -> None:
config = conf.load_config(conf.cv_examples_path("cifar10... |
"""
RFCN
"""
import torch
from torch.autograd import Variable
from torch.utils.data import DataLoader
import torchvision
import torch.nn.functional as functional
from dataset import SBDClassSeg, MyTestData
from transform import Colorize
from criterion import CrossEntropyLoss2d
from model import RFCN, FCN8s
from myfunc... |
########################################################################
#
# Vision Macro - Python source code - file generated by vision
# Thursday 22 July 2010 11:38:41
#
# The Scripps Research Institute (TSRI)
# Molecular Graphics Lab
# La Jolla, CA 92037, USA
#
# Copyright: Daniel Stoff... |
import json
def clean(task_data_filename, task_vol_filename):
to_remove = []
with open(task_data_filename) as f:
task_data = json.load(f)
with open(task_vol_filename) as f:
task_vol = json.load(f)
for task in task_data:
if len(task_data[task]["aggregate"]) == 0:
to_... |
import csv
from mgs import MGSPiracy
from argparse import ArgumentParser
if __name__ == '__main__':
# parse arguments
argp = ArgumentParser()
argp.add_argument('--output', type=str, default='output.csv', help='CSV output file name')
argp.add_argument('--from', type=int, default=0, help='First page', de... |
# Copyright 2012 the V8 project authors. 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 copyright
# notice, this list of conditi... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('speech', '0002_speechdetail'),
]
operations = [
migrations.AlterField(
model_name='speechdetail',
na... |
from sympy.testing.pytest import raises
from sympy.polys.polymatrix import PolyMatrix
from sympy.polys import Poly
from sympy.core.singleton import S
from sympy.matrices.dense import Matrix
from sympy.polys.domains.integerring import ZZ
from sympy.polys.domains.rationalfield import QQ
from sympy.abc import x, y
de... |
# 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 ... |
# Copyright © 2021 Ingram Micro Inc. All rights reserved.
from multiprocessing import Process
from dj_cqrs.registries import ReplicaRegistry
from dj_cqrs.transport import current_transport
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = 'Starts CQRS worker,... |
# Copyright (c) 2009 Upi Tamminen <desaster@gmail.com>
# See the COPYRIGHT file for more information
import getopt
import hashlib
import re
import socket
import time
from twisted.internet import reactor
from twisted.python import log
from cowrie.core.config import CowrieConfig
from cowrie.shell.command import Honey... |
# 8b d8 Yb dP 88""Yb db dP""b8 88 dP db dP""b8 888888
# 88b d88 YbdP 88__dP dPYb dP `" 88odP dPYb dP `" 88__
# 88YbdP88 8P 88""" dP__Yb Yb 88"Yb dP__Yb Yb "88 88""
# 88 YY 88 dP 88 dP""""Yb YboodP 88 Yb dP""""Yb YboodP 888888
VERSION = (0, 5, 5)
__version_... |
def get_word(sentence, n):
# Only proceed if n is positive
if n > 0:
# Only proceed if n is not more than the number of words
words = sentence.split()
if n <= len(words):
return (words[n-1])
return ("")
print(get_word("This is a lesson about lists", 4)) # Should print:... |
import sys,traceback
from cued_datalogger.api.numpy_extensions import to_dB
from cued_datalogger.api.pyqt_extensions import BaseNControl, MatplotlibCanvas
from cued_datalogger.api.pyqtgraph_extensions import ColorMapPlotWidget
from cued_datalogger.api.toolbox import Toolbox
from PyQt5.QtCore import Qt, pyqtSignal
fro... |
import numpy as np
if __name__=="__main__":
b = np.load("logs/l_feas/test1.npy")
print(b) |
import sys,os
import face_recognition
import json
from os import path
def init(path_img,path_faces,path_text,path_volume):
extension = os.path.splitext(path_faces)[1]
to_write="0"
if extension==".json":
faces = json.loads(open(path_faces).read())
image_test = face_recognition.load_image_... |
# 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 rest_framework.renderers import TemplateHTMLRenderer
class MyTemplateHTMLRenderer(TemplateHTMLRenderer):
def get_template_context(self, data, renderer_context):
response = renderer_context['response']
if response.exception:
data['status_code'] = response.status_code
return... |
from django.contrib.auth.views import LoginView
from django.urls import path, include
from accounts.views import user_profile, signup_user, signout_user
urlpatterns = (
# path('signin/', LoginView.as_view(template_name='registration/login.html'), name='signin user', ),
path('', include('django.contrib.auth.ur... |
from otri.filtering.filter import Filter, Stream
from unittest.mock import MagicMock
import unittest
class FilterTest(unittest.TestCase):
def setUp(self):
self.s_A = Stream([1, 2, 3])
self.s_B = Stream([3, 4, 5])
self.s_D = Stream()
self.s_E = Stream()
self.s_F = Stream()
... |
# -*- coding: utf-8 -*-
# mk42
# mk42/apps/users/api/filters/__init__.py
from __future__ import unicode_literals
__all__ = [] |
##########################################################################
#
# Copyright (c) 2013-2015, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... |
from django.conf import settings
from model_utils import Choices
from assopy.models import Vat, VatFare
from conference.models import FARE_TICKET_TYPES, Conference, Fare
# due to historical reasons this one is basically hardcoded in various places.
SOCIAL_EVENT_FARE_CODE = "VOUPE03"
SIM_CARD_FARE_CODE = "SIM1"
FAR... |
from django.apps import AppConfig
from django.db.models.signals import post_migrate, post_save
from .settings.authentication import DJANGO_AUTH_TYPE
class AuthenticationConfig(AppConfig):
name = 'cvat.apps.authentication'
def ready(self):
from . import signals
from django.contrib.auth.models i... |
from queue import Queue
line1=input()
line1=line1.split(" ")
n=int(line1[0])
k=int(line1[1])
boy=[]
girl=[]
cake=[]
cnt=0
line2=input()
line2=line2.split(" ")
for i in range(0,n):
girl.append(int(line2[2*i]))
boy.append(int(line2[2*n-2*i-1]))
line3=input()
line3=line3.split(" ")
for i in range(0,k):
cake.... |
"""xy-tag."""
import io
import os
import re
from setuptools import find_packages, setup
VERSION_RE = re.compile(r"""__version__ = ['"]([0-9b.]+)['"]""")
HERE = os.path.abspath(os.path.dirname(__file__))
def read(*args):
"""Read complete file contents."""
return io.open(os.path.join(HERE, *args), encoding="u... |
import numpy as np
import torch
from halite_rl.utils import SubProcessWrapper
class EpisodeData():
def __init__(self):
self.observations = [] # Observations (states).
self.actions = [] # Selected actions.
self.act_log_probs = [] # Log probability of selected action.
self.v... |
def half(i, n):
return "".join(str(d%10) for d in range(1, n-i+1))
def line(i, n):
h = half(i, n)
return " " * i + h + h[-2::-1]
def get_a_down_arrow_of(n):
return "\n".join(line(i, n) for i in range(n)) |
"""Summary plot for model comparison."""
import numpy as np
import matplotlib.pyplot as plt
from .plot_utils import _scale_fig_size
def plot_compare(
comp_df,
insample_dev=True,
plot_standard_error=True,
plot_ic_diff=True,
order_by_rank=True,
figsize=None,
textsize=None,
plot_kwargs=No... |
# Copyright 2017 MongoDB, 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 writing, s... |
# -*- coding:utf-8 -*-
from logging.handlers import RotatingFileHandler
import logging
from celery import Celery
from flask import Flask
from flask_mail import Mail
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__, instance_relative_config=True)
# Load the default configuration
app.config.from_object('c... |
# -*- coding: utf-8 -*-
"""
Created on 2019/8/4 上午9:45
@author: mick.yi
"""
import torch
from torch import nn
import numpy as np
class GuidedBackPropagation(object):
def __init__(self, net):
self.net = net
for (name, module) in self.net.named_modules():
if isinstance(module, nn.ReLU... |
# -*- coding: utf-8 -*-
import json
from datetime import datetime
from django.core.cache import cache
from rest_framework.exceptions import NotFound
from rest_framework.settings import api_settings
from rest_framework.test import APIRequestFactory
from olympia import amo
from olympia.amo.templatetags.jinja_helpers ... |
from WMCore.Configuration import Configuration
config = Configuration()
#name='Pt15to30'
config.section_("General")
config.General.requestName = 'PCC_ZeroBias_DataCert_150820'
config.General.workArea = 'taskManagement'
config.section_("JobType")
config.JobType.pluginName = 'Analysis'
config.JobType.psetName = 'Run_P... |
''' show_eigrp.py
IOSXR parser for the following commands
* 'show eigrp ipv4 neighbors'
* 'show eigrp ipv4 vrf {vrf} neighbors'
* 'show eigrp ipv6 neighbors'
* 'show eigrp ipv6 vrf {vrf} neighbors'
* 'show eigrp ipv4 neighbors detail'
* 'show eigrp ipv4 vrf {vrf} neighbors detail'
* 'sho... |
import sys
from std_srvs.srv import Trigger, SetBool, SetBoolRequest
from mrs_msgs.srv import Vec4, ReferenceStampedSrv, ReferenceStampedSrvResponse, ReferenceStampedSrvRequest, StringRequest, String, Float64Srv, Float64SrvRequest
from mavros_msgs.srv import CommandBool, CommandBoolRequest, SetMode, SetModeRequest
impo... |
#!/usr/bin/env python3
#
# This file is part of LiteX-Boards.
#
# Copyright (c) 2019 David Shah <dave@ds0.me>
# SPDX-License-Identifier: BSD-2-Clause
import os
import argparse
from migen import *
from migen.genlib.resetsync import AsyncResetSynchronizer
from litex_boards.platforms import trellisboard
from litex.bu... |
from __future__ import division
import logging
from collections import namedtuple
from io import IOBase
from itertools import chain, islice
from threading import Thread
from ..buffers import RingBuffer
from ..packages.flashmedia import FLVError
from ..packages.flashmedia.tag import (AudioData, AACAudioData, VideoData... |
import torch
import numpy as np
def torch_nms(tlbr, scores, classes=None, thresh=.5, bias=0, fast=False):
"""
Non maximum suppression implemented with pytorch tensors
CURRENTLY NOT WORKING
Args:
tlbr (Tensor): Bounding boxes of one image in the format (tlbr)
scores (Tensor): Scores o... |
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from toontown.battle.BattleProps import *
from direct.directnotify import DirectNotifyGlobal
from toontown.suit import DistributedGoon
from toontown.toonbase import ToontownGlobals
from toontown.coghq import MovingPlatform
class Distributed... |
"""
.. _ref_create_explicit_structured_grid:
Creating an Explicit Structured Grid
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create an explicit structured grid from NumPy arrays.
Note this feature is only available for ``vtk>=9``.
"""
import numpy as np
import pyvista as pv
ni, nj, nk = 4, 5, 6
si, sj, sk = 20, 10, 1
... |
year = 2018
month = 7
day = 5
date = "목요일"
print("오늘은 " + str(year) + "년 " + str(month) + "월 " + str(day) + "일 " + date +"입니다.") |
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from kinova_msgs/FingerPosition.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class FingerPosition(genpy.Message):
_md5sum = "f56891e5dcd1900989f764a9b845c8e5"
_typ... |
# Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... |
#!/usr/bin/env python
# coding: utf-8
#
# ~~~
# This file is part of the paper:
#
# "A relaxed localized trust-region reduced basis approach for
# optimization of multiscale problems"
#
# by: Tim Keil and Mario Ohlberger
#
# https://github.com/TiKeil/Trust-region-TSRBLOD-code
#
# Copy... |
# -*- encoding=utf-8 -*-
import socket
import threading
class TCPServer:
def __init__(self, server_address, handler_class):
self.server_address = server_address
self.HandlerClass = handler_class
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.is_shutdown = Fal... |
"""
features.py
---------------
In trimesh.comparison, we arbitrarily threshold identifier values
at a certain number of significant figures.
This file permutates meshes around and observes how their identifier,
which is supposed to be pretty invariant to translation and tessellation
changes. We use this to generate ... |
import argparse
import datetime
import os
import traceback
import kornia
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
from torch.utils.data import DataLoader
from tqdm.autonotebook import tqdm
import models
from datasets import LowLightDataset, LowLightFDataset
from models impo... |
import praw
class RedditRelevancyChecker:
""" Class containing all reddit related methods."""
def __init__(self, system, time='month', client_id='JWw9vCj6-fEBfQ'):
self.reddit = praw.Reddit(client_id=client_id,
client_secret=None,
us... |
from setuptools import setup
import sdist_upip
def readme():
with open('README.md') as f:
return f.read()
setup(
name='micropython-pycayennelpp',
version='2.0.0',
description='Encoder and Decoder for CayenneLLP',
long_description=readme(),
long_description_content_type='text/markdown... |
# Generated by Django 2.2.10 on 2020-02-26 17:30
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('django_eveonline_connector', '0015_merge_20200226_1503'),
]
operations = [
migrations.AlterModelOptions(
name='eveclient',
... |
# coding=utf-8
# Copyright 2018 The TF-Agents 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... |
# Tests the following end-to-end:
#
# 1. Comet is imported
# 2. Conflicting modules (i.e., TensorFlow) are not imported
# 3. Overridden methods are called (train_init, train_model, etc.) and run without error
#
# This test runs in an isolated environment to ensure TensorFlow imports are not leaked
# from previous tests... |
import threading
import subprocess
import time
import thread
import settings
from errors import MultiObjectsError
logger = settings.logger
class ThreadPlayer(threading.Thread):
'''
This threading ought to play songs which in the playlist via the command "mplayer url"
As an optional parameter, mins represents th... |
#!/usr/bin/env python
#
# Copyright 2007 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 o... |
#-------------------------------------------------------------------------------
# Name: CONNECT 4 GAME
# Purpose: PROJECT FOR GAME DEVELOPMENT IN OOP
#
# Author: GROUP CATACUTAN, PASCUAL, LAURENT, VENERACION
#
# Created: 30/10/2019
# Copyright: (c) XENON_XEIN_XENLY 2019
# Licence: <your licen... |
from flask import Flask,render_template, request, jsonify
from . import main
@main.route('/')
def index():
return render_template('index.html') |
import argparse
import mir3.data.score as score
import mir3.module
class Score2Label(mir3.module.Module):
def get_help(self):
return """convert the internal score representation to the 3 column
text"""
def build_arguments(self, parser):
parser.add_argument('infile', type=argpar... |
import logging
import sys
import os
import pytest
import boto3
import fiona
from fiona.errors import FionaDeprecationWarning
from fiona.vfs import vsi_path, parse_paths
from .test_collection import TestReading
from .test_collection_legacy import ReadingTest
# Custom markers (from rasterio)
mingdalversion = pytest.... |
"""
Tests related to the swapiutils module.
"""
import unittest
import unittest.mock
import responses
from b2sw.swapiutils import SwapiSearch
from b2sw.config import SwapiConfig
class TestSwapiSearch(unittest.TestCase):
"""
Tests related to the SwapiSearch class.
"""
def setUp(self):
"""
... |
# Generated by Django 3.2.8 on 2021-10-15 16:16
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('main', '0001_initial'),
]
operations = [
migrations.RenameModel(
old_name='Blog',
new_name='Post',
),
migrat... |
import string
import pygame as pg
from data.core.constants import LOW_LIGHT_GREEN, HIGH_LIGHT_GREEN, BACKGROUND_BASE
BUTTON_DEFAULTS = {"call" : None,
"args" : None,
"call_on_up" : True,
"font" : None,
... |
#
# Copyright (c) 2021, NVIDIA 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 appl... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v4/proto/resources/feed_placeholder_view.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protob... |
# File: taniumthreatresponse_view.py
# Copyright (c) 2020-2021 Splunk Inc.
#
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)def get_events(headers, data):
def get_events(headers, data):
""" Build a list of dictionaries that have the detail and what that detail "contains".
Args:
... |
#!/usr/bin/env python
from enum import IntEnum
import re
from PyQt5.QtCore import Qt, QPersistentModelIndex, QModelIndex
from PyQt5.QtGui import QStandardItemModel, QStandardItem, QFont, QMouseEvent
from PyQt5.QtWidgets import QAbstractItemView, QComboBox, QLabel, QMenu, QCheckBox, QHeaderView
from electrum.i18n imp... |
# -*- coding: utf-8 -*-
# @Time : 2019/10/3 0003 21:39
# @Author : Erichym
# @Email : 951523291@qq.com
# @File : 118.py
# @Software: PyCharm
class Solution:
def generate(self, numRows: int) -> list:
if numRows==0:
return []
out=[]
for i in range(numRows):
if... |
#!/usr/bin/env python
import argparse
import re
import sys
import requests
from tablib import Dataset
def load_redirects(redirects_filename, from_index, to_index):
csv = redirects_filename.endswith(".csv")
mode = "rt" if csv else "rb"
with open(redirects_filename, mode) as f:
dataset = Dataset(... |
"""Solution init
Revision ID: cb023cff5fc8
Revises: a240cc945c0b
Create Date: 2020-04-25 15:27:37.805075
"""
from alembic import op
from sqlalchemy import Column, Integer, String, ForeignKey, UniqueConstraint
# revision identifiers, used by Alembic.
revision = "cb023cff5fc8"
down_revision = "a240cc945c0b"
branch_la... |
from os.path import abspath, basename, dirname, join
hooks_path = dirname(abspath(__file__)) |
'''audiotsm2/base/analysis_synthesis.py'''
import numpy as np
from auto_editor.audiotsm2.utils import (windows, CBuffer, NormalizeBuffer)
from .tsm import TSM
EPSILON = 0.0001
class AnalysisSynthesisTSM(TSM):
def __init__(self, converter, channels, frame_length, analysis_hop, synthesis_hop,
analysis_wi... |
# 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 ... |
from __future__ import division
import inspect
import json
import re
from datetime import datetime
from functools import wraps
import jsonschema
import sys
import numpy as np
import pandas as pd
from dateutil.parser import parse
from scipy import stats
from six import PY3, integer_types, string_types
from numbers impo... |
from django.db import models
class Chant(models.Model):
"""
A Chant belongs to a image page (or a chant can appear
on multiple pages?)
Feast and Concordances belong to a Chant
(assuming a chant corresponds to exactly one feast(many-to-one)
and many-to-many relationship betw... |
import datetime
import pytest
import pytest_aoc
def test_get_cookie(testdir):
testdir.maketxtfile(cookie='spam')
testdir.makepyfile(test_get_cookie='''
import pytest_aoc
def test_get_cookie_from_session_id():
assert pytest_aoc.get_cookie('eggs', 'cookie.txt') == 'eggs'
def... |
class PanelTypeSetIterator(APIObject, IDisposable, IEnumerator):
"""
An iterator to a panel type set.
PanelTypeSetIterator()
"""
def Dispose(self):
""" Dispose(self: PanelTypeSetIterator,A_0: bool) """
pass
def MoveNext(self):
"""
MoveNext(self: PanelTypeSetIterator) -> bo... |
import math
from qcodes.instrument.channel import InstrumentChannel
from qcodes.utils import validators as vals
from .alazar_multidim_parameters import Alazar0DParameter, Alazar1DParameter, Alazar2DParameter
from .acquisition_parameters import AcqVariablesParam, NonSettableDerivedParameter
class AlazarChannel(Instrume... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.