text stringlengths 2 999k |
|---|
# -*- encoding: utf-8 -*-
from django.contrib import admin
from django.urls import path, include, re_path
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
# path('accounts/', include('allauth.urls')),
path('', include('authenticat... |
"""
The :mod:`sklearn.tree` module includes decision tree-based models for
classification and regression.
"""
from ._classes import BaseDecisionTree
from ._classes import DecisionTreeClassifier
from ._classes import DecisionTreeRegressor
from ._classes import ExtraTreeClassifier
from ._classes import ExtraTreeRegresso... |
# -*- coding: UTF-8 -*-
import sqlite3
import pytest
from vicuna.db import get_db
def test_get_close_db(app):
with app.app_context():
db = get_db()
assert db is get_db()
with pytest.raises(sqlite3.ProgrammingError) as e:
db.execute('SELECT 1')
assert 'closed' in str(e.value)
d... |
from urllib.parse import urlsplit, urlunsplit
import os
from .registry import is_model, is_model_in_modules, model_entrypoint
from .helpers import load_checkpoint
from .layers import set_layer_config
from .hub import load_model_config_from_hf
def parse_model_name(model_name):
model_name = model_name.replace('hf_... |
import os
import abc
import json
import logging
import time
from tempfile import NamedTemporaryFile
import numpy as np
import torch
import torch.distributed as dist
from pycocotools.cocoeval import COCOeval
from .distributed import synchronize, is_main_process, all_gather_container
# FIXME experimenting with speedup... |
from .wrapper import CDriveController |
from django.apps import AppConfig
class SupershopConfig(AppConfig):
name = 'supershop'
|
import pytest
from . import citations
from pyspark.sql import Row
from pyspark.sql import SparkSession
pytestmark = pytest.mark.usefixtures("with_spark_context")
def test_citation_e2e(with_spark_context):
# This is necessary in order for toDF() to be available.
spark = SparkSession(with_spark_context)
d =... |
import pandas as pd
pd.options.mode.chained_assignment = None # default='warn'
import numpy as np
import os
from py2neo import Graph, Node, Relationship, NodeMatcher, RelationshipMatcher
# from neo4j import GraphDatabase
# import neo4j
import networkx as nx
import json
import datetime
import matplotlib.pyplot as plt
#... |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import fnmatch
import time
import re
import datetime
import warnings
from collections import OrderedDict, defaultdict
import numpy as np
from astropy.utils.decorators import lazyproperty
from astropy.utils.exceptions import Astro... |
from django.conf import settings
from django.urls import include, path
from django.conf.urls.static import static
from django.contrib import admin
# from django.views.generic import TemplateView
from django.views import defaults as default_views
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
#... |
from java import lang, sql
lang.Class.forName('sun.jdbc.odbc.JdbcOdbcDriver')
excel_file = 'values.xls'
connection = sql.DriverManager.getConnection(
'jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=%s;READONLY=true}' %
excelfile, '', '')
# Sheet1 is the name of the Excel workbook we want. The field name... |
'''
.. autoclass:: TenableIO
.. automodule:: tenable.io.agent_config
.. automodule:: tenable.io.agent_exclusions
.. automodule:: tenable.io.agent_groups
.. automodule:: tenable.io.agents
.. automodule:: tenable.io.assets
.. automodule:: tenable.io.audit_log
.. automodule:: tenable.io.editor
.. automodule:: tenable.io.... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from ..import builder
from ..registry import TRYON
@TRYON.register_module
class Tryon(nn.Module):
def __init__(self,
ngf,
num_downs,
in_channels,
out_channels,
do... |
from django.contrib.auth.models import AnonymousUser
from django.http import HttpResponse
from django.test.client import RequestFactory
from kitsune.access.decorators import login_required, logout_required, permission_required
from kitsune.sumo.tests import TestCase
from kitsune.users.tests import UserFactory
def si... |
# Copyright 2016 Red Hat 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 a... |
# Generated by Django 2.2.6 on 2020-03-28 20:00
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('trips', '0005_auto_20200323_1822'),
]
operations = [
migrations.AlterField(
model_name='car',
... |
import base64
import json
import arc.tables
from event import Event
from event_handler import EventHandler
from slack_api import SlackApi
def handler(request, context):
slack_api = SlackApi()
event_handler = EventHandler(
slack_api,
user_table=arc.tables.table(tablename="users"),
karm... |
#!/usr/bin/env python3
# Copyright (c) 2017 The Crowncoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test RPC calls related to net.
Tests correspond to code in rpc/net.cpp.
"""
import time
from test_frame... |
def identity(f):
return f
@identity
def foo():
return 'bar'
def foo2():
return 'bar'
foo2 = identity(foo2)
|
# pylint: disable=too-many-lines
# 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) AutoRe... |
# Undergraduate Student: Arturo Burgos
# Professor: João Rodrigo Andrade
# Federal University of Uberlândia - UFU, Fluid Mechanics Laboratory - MFLab, Block 5P, Uberlândia, MG, Brazil
# Fourth exercise: Solving a Linear System --> ax = b
# Here I first set conditions
import numpy as np
from numpy import linalg as L... |
#!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
from operator import itemgetter
import unittest
from extensions_paths import CHROME_EXTENSIONS
from permissions_data_sourc... |
from django.db import models
from django.utils import timezone
from cms.models import NameSlugModel
class FeedbackCategory(NameSlugModel):
class Meta:
verbose_name = 'feedback category'
verbose_name_plural = 'feedback categories'
class IssueType(NameSlugModel):
class Meta:
verbose... |
"""File with functions to process input data and serve TF graph.
Create input function on processed data for training and evaluation and
serving function for out of sample unprocessed data.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import posixpa... |
# -*- coding: utf-8 -*-
import scrapy
import json
import re
from locations.items import GeojsonPointItem
STATES = ['NC', 'AL', 'GA', 'KY', 'MD', 'MS', 'SC', 'TN', 'VA', 'WV']
class CookoutSpider(scrapy.Spider):
name = "cookout"
item_attributes = {'brand': "Cookout", 'brand_wikidata': "Q5166992"}
allowed... |
from random import randint
class UnionFind:
ds = []
rank = []
def __init__(self, N):
self.ds = [i for i in range(N)]
self.rank = [0 for i in range(N)]
def find(self, x):
if self.ds[x] != x:
self.ds[x] = self.find(self.ds[x])
return self.ds[x]
def unio... |
# compute peak density in 100kb bins
import numpy as np
import sys
import gzip
# min and max distances to consider
maxdist = 280
mindist = 120
allPeaks = {}
for i in range(1, 23):
allPeaks["chr%d" % i] = []
allPeaks["chrX"] = []
allPeaks["chrY"] = []
# read in all peaks
fpeaks = gzip.open(sys.argv[1])
for line... |
#!/usr/bin/env python
from base64 import b64decode
from base64 import b64encode
from typing import Union
from typing import cast
from Cryptodome import Random
from Cryptodome.Cipher import AES
from Cryptodome.Cipher._mode_ccm import CcmMode
from Cryptodome.Cipher._mode_eax import EaxMode
from Cryptodome.Cipher._mode_g... |
from uuid import UUID
from flask import Blueprint, render_template, jsonify, flash, request, abort, redirect # noqa
from flask_login import login_required, current_user
from hive.models import User
route = Blueprint("profile", __name__)
@route.route("/me", methods=['GET', 'POST'])
@login_required
def profile():
... |
#Desafio 20
#Programa Sorteador de aluno, sorteia uma ordem de alunos
from random import shuffle
aluno1 = str(input("Digite aqui o nome de um dos alunos: "))
aluno2 = str(input("Digite aqui o nome de um aluno diferente do anterior: "))
aluno3 = str(input("Digite aqui o nome de um aluno, diferente dos anteriores: "))
al... |
import urllib.request
import test_util.proxy
import test_util.runner
import ssl
if __name__ == "__main__":
for bump in [False, True]:
queue, proxy_process = test_util.runner.run(
"./tests-proxy/server/tunnel_or_bump_callbacks_proxy",
["bump" if bump else "tunnel"],
)
... |
#!/usr/bin/env python3
#
# Copyright (c) 2018-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Download or build previous releases.
# Needs curl and tar to download a release, or the build depend... |
# coding=utf-8
# Copyright 2019 The TensorFlow GAN 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 applicabl... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# EXTRA CREDIT:
#
# Create a program that will play the Greed Game.
# Rules for the game are in GREED_RULES.TXT.
#
# You already have a DiceSet class and score function you can use.
# Write a player class and a Game class to complete the project. This
# is a free form ass... |
# 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... |
#!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import socket
import traceback, sys
from binascii import hexlify
import time, os
from socks5 import Socks5Conf... |
import http.cookiejar
from typing import TYPE_CHECKING, Dict, Optional, Union
from apiclient.utils.typing import BasicAuthType, OptionalStr
if TYPE_CHECKING: # pragma: no cover
# Stupid way of getting around cyclic imports when
# using typehinting.
from apiclient import APIClient
class BaseAuthenticati... |
from enum import Enum
from enum import IntEnum
from random import sample
import cv2
import gym
import numpy as np
from numpy.linalg import norm
import time
from growspace.plants.tree import PixelBranch
from numpy.linalg import norm
from scipy.spatial import distance
import sys
import itertools
from sklearn import prep... |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.WGL import _types as _cs
# End users want this...
from OpenGL.raw.WGL._types import *
from OpenGL.raw.WGL import _errors
from OpenGL.constant import Constant as _C
imp... |
# THIS FILE IS GENERATED FROM NUMPY SETUP.PY
#
# To compare versions robustly, use `numpy.lib.NumpyVersion`
short_version = '1.18.4'
version = '1.18.4'
full_version = '1.18.4'
git_revision = '94721320b1e13fd60046dc8bd0d343c54c2dd2e9'
release = True
if not release:
version = full_version
|
import os
import yaml
import json
import time
import shutil
import tempfile
from twisted.internet import defer
from twisted.trial import unittest
from ooni.tests.bases import ConfigTestCase
from ooni import errors as e
from ooni.tests.mocks import MockCollectorClient
from ooni.reporter import YAMLReporter, OONIBRepor... |
# coding: utf-8
"""
Molecule API Documentation
The Hydrogen Molecule API # noqa: E501
OpenAPI spec version: 1.3.0
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class PageTokenSupplyRes... |
# Copyright 2020 Makani Technologies LLC
#
# 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 json
import subprocess
import unittest
class TestIn(unittest.TestCase):
def test_happy_path(self):
with open('./data/in_request.json', 'r') as input_file:
completed_process = subprocess.run('/opt/resource/in', stdin=input_file, capture_output=True)
self.assertEqual(0, compl... |
import json
from pprint import pprint
#json_file='a.json'
json_file=r'd:\tempwork\temp\part-00000'
json_data=open(json_file)
out_file = open(r"d:\tempwork\temp\russell_out.txt", mode='w')
lines = json_data.readlines()
for l in lines:
data = json.loads(l)
cluster_id = data[:1][0]
for i in data[1:][0][:3... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'streamdeck_ui/main.ui',
# licensing of 'streamdeck_ui/main.ui' applies.
#
# Created: Fri Mar 20 12:20:26 2020
# by: pyside2-uic running on PySide2 5.13.2
#
# WARNING! All changes made in this file will be lost!
from PySide2 import QtC... |
##########################################################################
#
# Copyright (c) 2010-2012, 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:
#
# * Redis... |
# Authors: Ashim Bhattarai <ashimb9@gmail.com>
# Thomas J Fan <thomasjpfan@gmail.com>
# License: BSD 3 clause
import numpy as np
from ._base import _BaseImputer
from ..utils.validation import FLOAT_DTYPES
from ..metrics import pairwise_distances_chunked
from ..metrics.pairwise import _NAN_METRICS
from ..neig... |
# 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... |
###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2021, John McNamara, jmcnamara@cpan.org
#
import unittest
from io import StringIO
from ...workbook import Workbook
class TestWriteBookViews(unittes... |
# same imports as earlier.
from vtkmodules.util.vtkAlgorithm import VTKPythonAlgorithmBase
# new module for ParaView-specific decorators.
from paraview.util.vtkAlgorithm import smproxy, smproperty, smhint, smdomain
@smproxy.source(name="MagnetovisAxis", label="MagnetovisAxis")
@smhint.xml('<ShowInMenu category="Magne... |
# coding=utf-8
# Copyright 2019 The SEED 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 or agre... |
from django.db import models
class Question(models.Model):
enable = models.BooleanField("Question enabled", default=False)
message = models.CharField(max_length=255, null=False)
min_num_chosen = models.IntegerField("Minimum choices that must be chosen", default=1, null=False)
max_num_chosen = models.I... |
# pylint: disable=redefined-builtin, wildcard-import
"""TVM Operator Inventory.
TOPI is the operator collection library for TVM, to provide sugars
for constructing compute declaration as well as optimized schedules.
Some of the schedule function may have been specially optimized for a
specific workload.
"""
from __fu... |
import json
import logging
import os
import re
import sys
import traceback
from collections import OrderedDict
from cekit.builder import Builder
from cekit.errors import CekitError
LOGGER = logging.getLogger('cekit')
# Ignore any failure on non-core modules, we will catch it later
# and suggest a solution
try:
#... |
# SPDX-FileCopyrightText: : 2017-2020 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
"""
Rasters the vector data of the `Natura 2000 <https://en.wikipedia.org/wiki/Natura_2000>`_ natural protection areas onto all cutout regions.
Relevant Settings
-----------------
.. code:: yaml
renewable:
{tech... |
'''
Dijkstra's algorithm
by Carol Browning, January 26, 2020
Updated January 22, 2022
'''
#Code for user Input:
# goal = input("")
# Describe graph with list of vertex labels and adjacency matrix.
V=["A","B","C","D","E"]
'''
Change adjacency matrix to reflect graph given in the assignment.
'''
adjMatrix1 =[[0,3,0,7... |
from random import randint, random
def random_color():
red = randint(0,255)
blue = randint(0, 255)
green = randint(0, 255)
alpha = round(random())
|
# -*- coding: utf-8 -*-
import argparse
import configparser
import logging.config
import os
# loading config
config = configparser.ConfigParser()
config_file = os.path.abspath(os.path.join(os.path.dirname(__file__), '../ini/config.ini'))
config.read(config_file)
# load logging
file_name = ("%s.%s.log" % (config['env'... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutTuples(Koan):
def test_creating_a_tuple(self):
count_of_three = (1, 2, 5)
self.assertEqual(5, count_of_three[2])
def test_tuples_are_immutable_so_item_assignment_is_not_possible(self):
count_of_three ... |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
import gym
import numpy as np
class SinglePrecision(gym.ObservationWrapper):
def observation(self, observation: np.ndarray) -> np.ndarray:
return observation.astype(np.float32)
|
# Copyright (c) 2015 Clinton Knight. 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 requir... |
# -*- coding: utf-8 -*-
'''
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase
from tests.suppo... |
#!/usr/local/bin/python3
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import UnexpectedAlertPresentException
# from selenium.common.exceptions ... |
# Generated by Django 2.1.7 on 2019-08-15 19:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('curate', '0047_mediacoverage'),
]
operations = [
migrations.CreateModel(
name='Presentation',
... |
#
"""
"""
# end_pymotw_header
import textwrap
from textwrap_example import sample_text
print(textwrap.fill(sample_text, width=50))
|
import sys
import numpy as np
import logging
import pickle
import itertools
import time
import copy
from . import likelihood_invM as likelihood
from . import auxFunctions_invM as auxFunctions
from .utils import get_logger
logger = get_logger(level=logging.INFO)
"""
This is an O(N^2) algorithm for a greedy clusteri... |
from pepper.framework.abstract import AbstractBackend
from pepper.framework.backend.system import SystemCamera, SystemMicrophone, SystemTextToSpeech
from pepper.framework.backend.naoqi import NAOqiCamera, NAOqiMicrophone, NAOqiTextToSpeech,\
NAOqiMotion, NAOqiLed, NAOqiTablet
from pepper import config, CameraResolu... |
class CallbackDict:
def __init__(self):
self.callbacks = {}
def set_callback(self, key, callback):
self.callbacks[key] = callback
def do_callback(self, key, *args, **kwargs):
self.callbacks[key](*args, **kwargs)
def append_callback(self, key, callback):
... |
#!/usr/bin/python
import nipype.interfaces.mrtrix as mrt
tck2trk = mrt.MRTrix2TrackVis()
tck2trk.inputs.in_file = 'Allbrain.tck'
tck2trk.inputs.out_filename = 'Allbrain.trk'
tck2trk.inputs.image_file = 'dwicorr.nii'
tck2trk.run()
quit()
|
from package import redact_ex, ask_continue
from package import \
find_sols, \
falsi_solve
import numpy as np
EXERCISE_03 = """\
Calculate the solutions for f(x) using the Regula-Falsi method.\
"""
redact_ex(EXERCISE_03, 3)
####################################
def f(x):
return x**2 - 3*x + np.exp(x)... |
from __future__ import print_function, division
if __name__ == "__main__":
import argparse
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
from torchvision import datasets, models, transforms
import os
import math
import fnmatch
... |
"""
This file defines the core research contribution
"""
import copy
from argparse import Namespace
import torch
from torch import nn
import math
from configs.paths_config import model_paths
from models.encoders import psp_encoders
from models.encoders import psp_encoders_adain
from models.stylegan2.model import Gene... |
import collections
import datetime
from abc import abstractmethod
from dataclasses import MISSING, is_dataclass
from decimal import Decimal
from enum import Enum
from functools import partial
from inspect import isclass
from typing import (
Any,
AnyStr,
Callable,
Deque,
Dict,
FrozenSet,
Gene... |
"""
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
Author: Jun Zhu <jun.zhu@xfel.eu>
Copyright (C) European X-Ray Free-Electron Laser Facility GmbH.
All rights reserved.
"""
from enum import IntEnum
import os.path as osp
import functoo... |
"""customerprj 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-b... |
import os
from math import cos, sin, radians
from operator import add
from collections import OrderedDict
import linuxcnc
from random import choice
from qtpy.QtCore import Property, Signal, Slot, QTimer
from qtpy.QtGui import QColor
import vtk
# Fix poligons not drawing correctly on some GPU
# https://stackoverflo... |
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 23 21:29:10 2020
@author: ZongSing_NB
"""
from BWOA import BWOA
import numpy as np
import pandas as pd
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import StratifiedKFold
from sklearn.model_selection import cross_val_score
import functo... |
from dataclasses import dataclass, field
from typing import Optional
__NAMESPACE__ = "NISTSchema-SV-IV-atomic-base64Binary-length-3-NS"
@dataclass
class NistschemaSvIvAtomicBase64BinaryLength3:
class Meta:
name = "NISTSchema-SV-IV-atomic-base64Binary-length-3"
namespace = "NISTSchema-SV-IV-atomic... |
"""!
@brief CCORE Wrapper for G-Means algorithm.
@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause
"""
from ctypes import c_double, c_size_t, c_longlong, POINTER
from pyclustering.core.wrapper import ccore_library
from pyclustering.core.pyclustering_package impor... |
"""empty message
Revision ID: 533fc09a4d32
Revises: 7793ca45b7f9
Create Date: 2016-12-13 16:14:27.123196
"""
# revision identifiers, used by Alembic.
revision = '533fc09a4d32'
down_revision = '7793ca45b7f9'
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic ... |
from __future__ import print_function
# for localized messages
from . import _, NOTIFICATIONDOMAIN
# Config
from Components.config import config, ConfigYesNo, ConfigNumber, ConfigSelection, \
ConfigSubsection, ConfigClock, ConfigYesNo, ConfigInteger, NoSave
from Screens.MessageBox import MessageBox
from Screens.Stan... |
"""
WSGI config for silent_voice_29079 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('D... |
"""Module to perform QC on the xiRT performance."""
import numpy as np
import pandas as pd
from pyteomics import fasta, parser
from scipy.spatial import distance
def compute_composition_df(seq_df):
"""
Compute the composition matrix for all proteins.
Args:
seq_df: df, dataframe with sequences
... |
# -*- coding: utf-8 -*-
import datetime
import hashlib
import itertools
import os
import json
import random
import tempfile
from zipfile import ZipFile, ZIP_DEFLATED
from django.conf import settings
import pydenticon
import requests
from lib.video.tasks import resize_video
import mkt
from mkt.constants.application... |
class TrendUp:
def __init__(self, df, params):
self.df = df
self.H = self.df["high"]
self.L = self.df["low"]
self.numPeriods = params["numPeriods"] if "numPeriods" in params.keys() else 3
self.coef = params["coef"] if "coef" in params.keys() else 1
self.attrName = par... |
# Copyright 2020 The TensorFlow Probability 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 o... |
import numpy as np
from DREAM_and_DeepCFR.EvalAgentDeepCFR import EvalAgentDeepCFR
from DREAM_and_DeepCFR.TrainingProfile import TrainingProfile
from DREAM_and_DeepCFR.workers.driver.Driver import Driver
from HYPERS import *
from PokerRL.game.games import StandardLeduc # or any other game
if __name__ == '__main__':
... |
from dnl.IconEasySolver import ICON_scheduling, calculate_energy_from_solver, ICON_scheduling_relaxation
from KnapsackSolving import solveKnapsackProblem, solveKnapsackProblemRelaxation
from dnl.Params import KNAPSACK, ICON_SCHEDULING_EASY
import numpy as np
def get_relax_optimization_objective(Y, weights, opt_params,... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2018-09-21 20:33
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('lecture', '0004_evaluation'),
]
operations = [
migrations.RenameField(
m... |
#!/usr/bin/env python
"""AEMO 5MIN Data Parser from vizualizations page
"""
import logging
from datetime import datetime
from enum import Enum
from json.decoder import JSONDecodeError
from typing import Any, Dict, List, Optional
import requests
from pydantic.main import BaseModel
from opennem.core.normalizers import... |
# Importing sample Fusion Command
# Could import multiple Command definitions here
from .MesherCommand import MesherInterferenceCommand, MesherClearCommand, MesherInfoCommand
from .Demo2Command import Demo2Command
from .DemoPaletteCommand import DemoPaletteShowCommand, DemoPaletteSendCommand
commands = []
command_defi... |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import math
import torch
import t... |
#!/usr/bin/python
# vim: set expandtab ts=4 sw=4:
# %% -----------------------------------------------------
#
# This script runs the simulations and analysis of the noisy 12Hz oscillator
# seen in figures 3, 4 and 5. The oscillation is generated and some general EMD
# and wavelet frequency metrics are computed. The ... |
from django.db import models
from django.contrib.auth.models import User
from django.utils import timezone
from django.core.validators import MaxValueValidator, MinValueValidator
from Groups.models import ActionGroup
class UserMatch(models.Model):
author = models.ForeignKey(User, on_delete=models.CASCADE, relat... |
class GitManager:
def __init__(self, executor):
self.executor = executor
def clone(self, host, remote_url, target_dir):
self.executor.execute(host, f"git clone {remote_url} {target_dir}")
def fetch(self, host, target_dir, remote="origin"):
self.executor.execute(host, f"git -C {targ... |
from django.test import TestCase, Client
from django.core.urlresolvers import reverse
# Create your tests here.
class IndexViewsTestCase(TestCase):
def setUp(self):
self.cliente = Client()
self.url = reverse('index')
def tearDown(self):
pass
def test_status_code(self):
re... |
"""Stand-alone utility functions."""
from inspect import Parameter, Signature
from typing import Any, Dict, Optional, Tuple
def convert_docblock(doc: Optional[str]) -> Optional[str]:
"""Strip the comment syntax out of a docblock."""
if not isinstance(doc, str):
return doc
doc = doc.strip('/*')
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.