text stringlengths 1 927k |
|---|
# If not stated otherwise in this file or this component's LICENSE file the
# following copyright and licenses apply:
#
# Copyright 2021 Sky UK
#
# 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... |
#-*- coding: utf-8 -*-
# pysqlite2/test/types.py: tests for type conversion and detection
#
# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any ... |
from flask import Flask
from flask_restful import Api
from flask_cors import CORS
from returnpath.config_helper import ConfigHelper
import sys
import returnpath.log
this_path = sys.path[0]
app = Flask(__name__)
app.url_map.strict_slashes = False
CORS(app)
config = ConfigHelper.get_config_path('config.yml')
appconfi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import re
import codecs
from PySide2.QtWidgets import (QLineEdit, QPushButton, QApplication, QTextEdit, QWidget,
QVBoxLayout, QHBoxLayout, QDialog, QFileSystemModel, QTreeView, QLabel, QSplitter,
QInputDialog, QMessageBox, QHeaderView, QMenu, ... |
"""
from from https://github.com/huangtinglin/MixGCF
Created on October 1, 2020
@author: Tinglin Huang (huangtinglin@outlook.com)
"""
import torch
import torch.nn as nn
from cogdl.models import BaseModel, register_model
class GraphConv(nn.Module):
"""
Graph Convolutional Network
"""
def __init__(s... |
#!/usr/bin/env python
import os
import sys
if 'sdist' not in sys.argv:
print('')
print('As of v1.0.0, `pip install dbt` is no longer supported.')
print('Instead, please use one of the following.')
print('')
print('**To use dbt with your specific database, platform, or query engine:**')
print('... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, 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 cop... |
"""
General test suite for all SeisFlows3 modules. Defines required parameters and
functions for each of the modules, tests importing each of the modules and that
each of the required parameters and functions exist. A sort of first-pass test
which makes sure the package is set up correctly.
"""
import os
import sys
imp... |
#!/usr/bin/env python
"""Convnet example using CIFAR10 or CIFAR100 dataset
This code is a custom loop version of train_cifar.py. That is, we train
models without using the Trainer class in chainer and instead write a
training loop that manually computes the loss of minibatches and
applies an optimizer to update the mo... |
# Generated by Django 1.11.25 on 2019-10-23 15:47
from django.db import migrations, models
class Migration(migrations.Migration): # lint-amnesty, pylint: disable=missing-class-docstring
dependencies = [
('entitlements', '0011_historicalcourseentitlement'),
]
operations = [
migrations.... |
# encoding: utf-8
__docformat__ = "restructuredtext en"
#-------------------------------------------------------------------------------
# Copyright (C) 2005 Fernando Perez <fperez@colorado.edu>
# Brian E Granger <ellisonbg@gmail.com>
# Benjamin Ragan-Kelley <b... |
# Copyright (C) 2021 Raven Computing
#
# 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 sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, Text, Boolean
from sqlalchemy_utils import ArrowType
from notif.config import DB_URI
Base = declarative_base()
class Notification(Base):
"""Notification database table."""
__tablename__ = 'notifications'
i... |
# 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... |
"""
Django settings for multichat project.
Generated by 'django-admin startproject' using Django 1.10.dev20151126161447.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings... |
import pytest
from profit.wallet.chialisp import (
apply,
args,
cons,
eval,
fail,
first,
is_zero,
make_if,
make_list,
nth,
quote,
rest,
sexp,
)
class TestChialisp:
def test_sexp(self):
assert sexp() == "()"
assert sexp(1) == "(1)"
assert... |
from qtpy.QtWidgets import QFileDialog
from pathlib import Path
from brainrender_gui.widgets.add_from_file import AddFromFileWindow
from brainrender_gui.utils import (
get_color_from_string,
get_alpha_from_string,
)
class AddFromFile:
def __init__(self):
"""
Collection of functions to... |
from datetime import datetime, timedelta
from typing import List, Optional
import mock
from django.utils.timezone import utc
from django.http import HttpResponse
import ujson
from analytics.lib.counts import COUNT_STATS, CountStat
from analytics.lib.time_utils import time_range
from analytics.models import FillState,... |
import os
import cv2
import sys
import json
import time
import codecs
import argparse
import logging
import numpy as np
import warnings
try:
with warnings.catch_warnings():
warnings.filterwarnings("ignore",category=FutureWarning)
from keras.models import load_model
from keras.preprocessing ... |
r"""
Jack Symmetric Functions
Jack's symmetric functions appear in [Ma1995]_ Chapter VI, section 10.
Zonal polynomials are the subject of [Ma1995]_ Chapter VII.
The parameter `\alpha` in that reference is the parameter `t` in this
implementation in sage.
REFERENCES:
.. [Jack1970] \H. Jack,
*A class of symmetric f... |
# -*- encoding: utf-8 -*-
r"""
The ``pretty_print`` command.
Works similar to the ``print`` function, except that it always tries
to use a rich output for an object. Only if that is not available it
is falling back on the plain text.
EXAMPLES::
sage: pretty_print(1, 2, 3)
<html><script type="math/tex">\newco... |
import glob
from yt.data_objects.time_series import DatasetSeries
from yt.funcs import only_on_root
from yt.loaders import load
from yt.utilities.exceptions import YTOutputNotIdentified
from yt.utilities.logger import ytLogger as mylog
from yt.utilities.parallel_tools.parallel_analysis_interface import parallel_object... |
# -*- coding: utf-8 -*-
'''
Created on 1 Septembre 2013
@author: jyp
OpenEdge backend for Django.
South Apdaptation done 20131102
Extents handling:
-----------------
When this backend is used on 4GL Tables, the fields with extents are seen like char fields where
each extent value is separated from each other with... |
from celery import conf
from celery.utils import gen_unique_id, fun_takes_kwargs, mattrgetter
from celery.result import AsyncResult, EagerResult
from celery.execute.trace import TaskTrace
from celery.registry import tasks
from celery.messaging import with_connection
from celery.messaging import TaskPublisher
extract_e... |
from django.contrib.auth.models import (
AbstractBaseUser,
BaseUserManager,
PermissionsMixin,
)
from django.db import models
from django_countries.fields import CountryField
from phonenumber_field.modelfields import PhoneNumberField
from ..core.choices import AuthFromType, ProfessionType, SexType
from ..co... |
# 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 ... |
"""
======================
Zoom region inset axes
======================
Example of an inset axes and a rectangle showing where the zoom is located.
"""
import matplotlib.pyplot as plt
import numpy as np
def get_demo_image():
from matplotlib.cbook import get_sample_data
import numpy as np
f = get_sampl... |
__author__ = 'bakalor'
__maintainer__ = "Igor Bakalo"
__email__ = "bigorigor.ua@gmail.com"
__status__ = "Development"
import re
from defusedxml import ElementTree as ET
from dojo.models import Finding
class SpotbugsParser(object):
def get_scan_types(self):
return ["SpotBugs Scan"]
def get_label_f... |
"""
-*- coding: utf-8 -*-
Time : 2019/7/12 14:25
Author : Hansybx
"""
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
# from app.models import grade_point, student_info, teacher_class |
"""
Spirent TestCenter Command Shell
Command shell that provides STC Automation API functionality using an
interactive command line interface, or command file. This program accesses a
TestCenter Server over its HTTP interface, so no local BLL installation is
needed.
Type help to see help info. Use <TAB> for command... |
import torch
import torch.nn as nn
from torch.distributions.gumbel import Gumbel
from dglt.contrib.moses.moses.model.gvae.utils import Flatten
class CVAE(nn.Module):
"""Character Variational Autoencoder."""
def __init__(self, vocab, config):
"""Constructor function.
Args:
* vocab: mo... |
"""
============================
Lasso with held-out test set
============================
This example shows how to perform hyperparameter optimization
for a Lasso using a held-out validation set.
"""
# Authors: Quentin Bertrand <quentin.bertrand@inria.fr>
# Quentin Klopfenstein <quentin.klopfenstein@u-bou... |
from sklearn_explain.tests.skl_datasets import skl_datasets_test as skltest
skltest.test_class_dataset_and_model("BreastCancer" , "BaggingClassifier_14") |
# -*- coding: utf-8 -*-
"""
mslib.msui.constants
~~~~~~~~~~~~~~~~~~~~
This module provides constants
This file is part of mss.
:copyright: Copyright 2008-2014 Deutsches Zentrum fuer Luft- und Raumfahrt e.V.
:copyright: Copyright 2011-2014 Marc Rautenhaus (mr), Tongxi Lou (tl)
:copyright:... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayPayAppCarPayModel(object):
def __init__(self):
self._out_trade_no = None
self._qr_code = None
self._subject = None
self._total_amount = None
@property
... |
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
import functools
import math
import numpy as np
# the next line can be removed after installation
sys.path.insert(0, os.path.dirname(os.path.dirname(
os.path.dirname(os.path.abspath(__file__)))))
import nngen as ng
... |
# Copyright (c) 2015 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... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... |
# CODING-STYLE CHECKS:
# pycodestyle test_data.py
import os
import tempfile
import pytest
import numpy as np
import pandas as pd
from taxcalc import Data, GrowFactors
# Test specification and use of simple Data-derived class.
# This derived class is called Recs and it contains aged data.
#
# The following pytest fix... |
# The MIT License (MIT)
#
# Copyright (c) 2019 Michael Schroeder
#
# 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,... |
"""
Copyright 2015 Rackspace
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
dist... |
"""This module contains the general information for SwSystemStats ManagedObject."""
from ...ucscentralmo import ManagedObject
from ...ucscentralcoremeta import UcsCentralVersion, MoPropertyMeta, MoMeta
from ...ucscentralmeta import VersionMeta
class SwSystemStatsConsts():
SUSPECT_FALSE = "false"
SUSPECT_NO =... |
from behave import *
from django.urls import reverse
from features.steps import *
from features.helpers import *
use_step_matcher("re")
@given("some google and facebook accounts")
def step_impl(context):
google_client_id = '230288808995-4c5f9sf26l43u1jpcgftv6uh8vcoipsq.apps.googleusercontent.com'
google_secr... |
# 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 2.3.33.0
# ... |
#!/usr/bin/env python
# Copyright 2013 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.
"""Archives a set of files or directories to an Isolate Server."""
from __future__ import print_function
import collection... |
#!/usr/bin/env python3
import os
import sys
import time
import subprocess
import shutil
import hashlib
import argparse
import urllib.request
start_time = time.time()
current_path = os.path.abspath(os.curdir)
# Helpers ------------------------------------------------------------------------------------------
def ... |
# Generated by Django 2.2 on 2020-10-17 10:54
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='UserProfile',
... |
import logging
import argparse
import asyncio
import aiohttp
from lbry import wallet
from lbry.wallet.orchstr8.node import (
Conductor,
get_lbcd_node_from_ledger,
get_lbcwallet_node_from_ledger
)
from lbry.wallet.orchstr8.service import ConductorService
def get_argument_parser():
parser = argparse.Ar... |
import numpy as np
from .constants import *
from .Bulk import BulkModel, BulkModelFD, BulkModelTails
from .base import MosModelBase, writeable_property
from math import sqrt
from scipy.integrate import quad
__all__ = ['DefaultQV', 'BeckersQVpy',
'DiracQVpy', 'TailsQVpy',
'GildenblatQVpy', 'Defa... |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Blob helper functions."""
import numpy as np
# from scipy.misc impo... |
from django.db import models
from django.db import models
from django.db.models.signals import pre_save
from django.conf import settings
from django.utils import timezone
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
class Head(models.M... |
#!/usr/bin/env python3
# Usage: ./main.py
"""
Copyright (C) 2020-2021 John C. Allwein 'johnnyapol' (admin@johnnyapol.me)
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, includ... |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... |
"""distutils.command.bdist_rpm
Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions)."""
import subprocess, sys, os
from distutils.core import Command
from distutils.debug import DEBUG
from distutils.file_util import write_file
from distutils.errors import *
from distutils.sysconfi... |
import numpy as np
import scipy.io as sio
from collections import defaultdict
BIG_NUM = 1000000
def area(box, mode="xyxy"):
if mode == "xyxy":
TO_REMOVE = 1
area = (box[:, 2] - box[:, 0] + TO_REMOVE) * (box[:, 3] - box[:, 1] + TO_REMOVE)
elif mode == "xywh":
area = box[:, 2] * box[:, ... |
import hashlib
import skbio
import numpy as np
def add_node_names(tree: skbio.TreeNode, scheme: str = 'md5-xor') \
-> skbio.TreeNode:
HASH_SIZE = 128 // 8
for node in tree.postorder(include_self=True):
if not node.children or node.name is not None:
continue
xor = np.zero... |
from datetime import datetime
from bson import ObjectId
from flask import jsonify, request, current_app
from flask_security import login_required
from app import app
from models.test_suite_param import TestSuiteParam
from utils import common
# Not yet used
@app.route('/api/project/<project_id>/testEnv/<test_env_id... |
from setuptools import setup
setup(
name='flask-io',
version='1.14.1',
packages=['flask_io'],
url='https://github.com/viniciuschiele/flask-io',
license='MIT',
author='Vinicius Chiele',
author_email='vinicius.chiele@gmail.com',
description='Flask-IO is a library for parsing Flask request... |
"""
Created on Mon Oct 26 16:23:24 2020
@author: Sunitha Basodi
"""
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
with open('requirements.txt') as f:
required_packages = f.read().splitlines()
setuptools.setup(
name="coinstac_pyprofiler", # Replace with your own user... |
from collections import OrderedDict
from .utility import Utility
from .base import OperatorLayerBase
class RandPerm(OperatorLayerBase):
def __init__(self, d):
marker = eval(d.argMarker[0])
mod = marker['mod']
op = marker['op']
args = marker['args']
self.marker = marker
self.mod_ = mod
self.op_ = op
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutStrings(Koan):
def test_double_quoted_strings_are_strings(self):
string = "Hello, world."
self.assertEqual(True, isinstance(string, str))
def test_single_quoted_strings_are_also_strings(self):
string =... |
#!/usr/bin/env python
# pylint: disable=C0116,W0613
# This program is dedicated to the public domain under the CC0 license.
"""
Basic example for a bot that works with polls. Only 3 people are allowed to interact with each
poll/quiz the bot generates. The preview command generates a closed poll/quiz, exactly like the
... |
# Generated by Django 2.0.13 on 2019-06-18 13:00
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("terra_layer", "0011_auto_20190612_1721")]
operations = [
migrations.AlterField(
model_name="layer",
... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'connect', views.connect, name='connexion')
] |
# Copyright 2016 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... |
import tensorflow as tf
class Dream:
def __init__(self, observers, actors, nna_internal_layer_deminsions, nno_internal_layer_deminsions, nnt_internal_layer_deminsions):
self.nna
for d in nna_internal_layer_deminsions:
self.nno
for d in nno_internal_layer_deminsions:
self.nn... |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..brainsfit import BRAINSFit
def test_BRAINSFit_inputs():
input_map = dict(NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_00=dict(argstr='--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_00 ',
),
NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_... |
# Generated by Django 3.0.2 on 2020-01-20 14:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('WebAXEL', '0052_auto_20200109_1300'),
]
operations = [
migrations.AddField(
model_name='dataset',
name='nb_vues',
... |
"""
class student:
def __init__(self ,name , contact):
self.name=name
self.contact=contact
def getdata(self):
print("accept the data")
self.name=input("enter name")
self.contact=input("entaer contact")
def putdata(self):
print("the name of student is :"+se... |
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, Boolean, String, DateTime
Base = declarative_base()
class Anomaly(Base):
__tablename__ = 'anomalies'
id = Column(Integer, primary_key=True)
query_name = Column(String)
datasource_id = Column(String)
de... |
# 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 use ... |
from WebApp import RAS_APP as application # move statics to ./ before deployment
if __name__ == "__main__":
application.run() |
#!/usr/bin/env python3
import unittest
import diff_edit
class OverlayListTestCase(unittest.TestCase):
def test_overlay_list(self):
self.assertEqual(diff_edit.overlay_list([1, 2, 3, 4], [5, 6], 0), [5, 6, 3, 4])
self.assertEqual(diff_edit.overlay_list([1, 2, 3, 4], [5, 6], 3), [1, 2, 3, 5])
... |
# Always prefer setuptools over distutils
from setuptools import setup
# To use a consistent encoding
from codecs import open
from os import path
import json
import re
here = path.abspath(path.dirname(__file__))
def parse_req_line(line):
line = line.strip()
if not line or line.startswith('--hash') or line[0]... |
class CalcController:
def __init__(self, model, view):
self.model = model
self.model.OnResult = self.OnResult
self.model.OnError = self.OnError
self.view = view
self.model.AllClear()
# interface for view
def command(self, command):
if command in ['0','1','2'... |
"""
Module for obtaining data from Amazon Web Service
"""
from abc import ABC, abstractmethod
import logging
import os.path
from .download import DownloadRequest, get_json, AwsDownloadFailedException
from .opensearch import get_tile_info, get_tile_info_id
from .time_utils import parse_time
from .config import SHConfi... |
# model settings
model = dict(
type='CutMixImageClassifier',
#type='ImageClassifier',
cutmix_prob = 0.5,
cutmix_beta = 1.,
backbone=dict(
type='SK2NeXt29',
depth=29,
cardinality=6,
base_width=24,
scale=4,
ratio=48,
#cardinality=8,
#bot... |
# Configuration file for the Sphinx documentation builder
import os
import sys
import inspect
import importlib
sys.path.insert(0, os.path.abspath('..'))
## Project
package = 'lampe'
project = 'LAMPE'
copyright = '2021-2022, François Rozet'
repository = 'https://github.com/francois-rozet/lampe'
## Extensions
exten... |
import cv2
import os, sys
import time
import matplotlib.pyplot as plt
inputFolder = r''
outPath = os.path.join(inputFolder,'outpy1.avi')
w = 1280
h = 960
out = cv2.VideoWriter(outPath, cv2.VideoWriter_fourcc('M', 'J', 'P', 'G'), 20, (w, h))
for fileName in os.listdir(inputFolder):
imgPath = os.path.join(inputFolder... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2016 Juniper Networks, Inc. All rights reserved.
#
"""
Schema Transformer monitor logger
"""
from sandesh_common.vns.ttypes import Module
from cfgm_common.vnc_logger import ConfigServiceLogger
from schema_transformer.config_db import DBBaseST, VirtualNetw... |
from kulka import Kulka
import time
ADDR = 'XX:XX:XX:XX:XX:XX'
STEPS = 10
SPEED = 0x30
SLEEP_TIME = 0.3
def make_a_step(kulka, current_angle):
kulka.roll(SPEED, current_angle)
time.sleep(SLEEP_TIME)
kulka.roll(0, current_angle)
def make_a_circle(kulka, steps):
rotate_by = 360 // steps
curren... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018-2020 Christiaan Frans Rademan <chris@fwiw.co.za>.
# 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 ... |
# Copyright (c) Open-MMLab. All rights reserved.
from .alexnet import AlexNet
# yapf: disable
from .bricks import (ACTIVATION_LAYERS, CONV_LAYERS, NORM_LAYERS,
PADDING_LAYERS, PLUGIN_LAYERS, UPSAMPLE_LAYERS,
ContextBlock, Conv2d, Conv3d, ConvAWS2d, ConvModule,
... |
#!/usr/bin/env python
# coding=utf8
import os
import time
from modules import android_users
#from modules import apktool
from modules import command
from modules import files
#from modules import report
from modules import strings
from modules import utils
from modules.logs import Logs
APKSIGNER_ENABLED = False
KEY_... |
from hunspell import Hunspell
import string
class ROT:
ALPHABET_LETTER_COUNT = 26
ALPHABET = alphabet = string.ascii_letters
def __init__(self, shift: int = 13):
# shift cannot be negative
assert shift >= 0
self._shift = shift % self.ALPHABET_LETTER_COUNT
@property
def s... |
from typing import Any, List, Optional
from ...mutator import Mutator
from ...graph import Model, Node
class LayerChoiceMutator(Mutator):
def __init__(self, nodes: List[Node]):
super().__init__()
self.nodes = nodes
def mutate(self, model):
n_candidates = len(self.nodes[0].operation.p... |
from music21 import converter, instrument, note, chord, stream, midi
import numpy as np
import pandas as pd
# Melody-RNN Format is a sequence of 8-bit integers indicating the following:
# MELODY_NOTE_ON = [0, 127] # (note on at that MIDI pitch)
MELODY_NOTE_OFF = 128 # (stop playing all previous notes)
MELODY_NO_EVENT... |
"""instaproject 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-... |
a = 1
b = 2
c = 3
d = 4
e = 5
f = 6
g = 7
h = 8
i = 9
list_1 = [a,b,c,d,e,f,g,h,i]
print (' ', end='')
for j in range(len(list_1)):
print (list_1[j], ' ', end='')
print('\n')
for j in range(len(list_1)):
print (j + 1, ' ', end='')
for k in range(len(list_1)):
print (list_1[j]*list_1[k], ' ', ... |
__title__ = "python-olm"
__description__ = ("python CFFI bindings for the olm "
"cryptographic ratchet library")
__url__ = "https://github.com/poljar/python-olm"
__version__ = "3.0.0"
__author__ = "Damir Jelić"
__author_email__ = "poljar@termina.org.uk"
__license__ = "Apache 2.0"
__copyright__ = "Cop... |
"""Track the progress of species and remove those that have stalled.
TODO: Add stagnation tests.
TODO: Update module docstrings, and clean up comments and code.
"""
import sys
from neat.config import ConfigParameter, DefaultClassConfig
from neat.math_util import stat_functions
# TODO: Add a method for the user to ch... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-07-24 08:14
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('mainclone', '0004_auto_20180724_0814'),
]
operations = [
migrations.RenameModel(
... |
# Own shares of a company!
company: public(address)
total_shares: public(currency_value)
price: public(num (wei / currency))
# Store ledger of stockholder holdings
holdings: currency_value[address]
# Setup company
def __init__(_company: address, _total_shares: currency_value,
initial_price: num(wei / currenc... |
import json
from flask import Blueprint
from flask import request
from flask import Response
from backend.auth import login_required, current_user
from backend.models.prices import PriceDB
from backend.utils import json_error, json_success, crossdomain
price_blueprint = Blueprint("prices", __name__, url_prefix="/api... |
import os
import sys
import pytest
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
from base import TestBaseClass
class TestClassOelintVarsNoTrailingSlash(TestBaseClass):
@pytest.mark.parametrize('id', ['oelint.vars.notrailingslash'])
@pytest.mark.parametrize('occurance', [1])
@pytest.ma... |
# 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/env python3
# (c) 2021 Martin Kistler
import argparse
import sys
from twisted.logger import globalLogPublisher, ILogObserver, eventAsText
from zope.interface import provider
import requests
import defaults
from client import P2PClient
# argument parsing
parser = argparse.ArgumentParser()
parser.add_argum... |
"""
===============================================================
Partial Dependence and Individual Conditional Expectation Plots
===============================================================
Partial dependence plots show the dependence between the target function [2]_
and a set of features of interest, marginaliz... |
from codecs import open
from os import path
from jupyter_packaging import (
combine_commands,
create_cmdclass,
ensure_python,
ensure_targets,
get_version,
install_npm,
)
from setuptools import find_packages, setup
pjoin = path.join
ensure_python(("2.7", ">=3.7"))
name = "jupyterlab_templates... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.