text
stringlengths
2
999k
# 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. # -----------------------------------------------------...
from django.conf.urls.defaults import * from django.contrib import admin admin.autodiscover() from . import views urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^fake-login$', views.fake_login, name='sentry-fake-login'), url(r'^trigger-500$', views.raise_exc, name='sentry-rai...
# -*- coding: utf-8 -*- # # Copyright (c) 2016 - 2018 -- Lars Heuer - Semagia <http://www.semagia.com/>. # All rights reserved. # # License: BSD License # """\ Terminal output related tests. """ from __future__ import absolute_import, unicode_literals, division import io import re import pytest import segno def test_...
def print_primes_till_N(N): # Declare the variables i, j, flag = 0, 0, 0 # Print display message print("Prime numbers between 1 and ", N, " are:") # Traverse each number from 1 to N # with the help of for loop for i in range(1, N + 1, 1): # Skip 0 and 1...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2017 Ke Wang """Shuffle kaldi scp file.""" from __future__ import absolute_import from __future__ import print_function import argparse import os import pprint import random import sys def main(): """Shuffle file and save""" with open(FLAGS.inpu...
import pytest from komfovent_c5.api import Client, Settings pytestmark = pytest.mark.asyncio async def test_read_all(client: Client): settings = Settings(client) state = await settings.read_all() assert state
import numpy as np import torch def db(x): if isinstance(x, np.ndarray): # TODO:make a function return 10 * np.log10(x) elif isinstance(x, torch.Tensor): # TODO:make a function return 10 * torch.log10(x) else: # TODO:change to logger raise Exception("AA")
# Set plugin = True plugin = True plugin_dir = 'plugin/radar-v2/' #model = dict( # type='UNet', # in_channels=3, # out_channels=1, # base_channels=16, # num_stages=5, # strides=(1, 1, 1, 1, 1), # enc_num_convs=(2, 2, 2, 2, 2), # dec_num_convs=(2, 2, 2, 2), # downsamples=(True, True, True,...
import logging from typing import List from homeassistant.helpers.entity import Entity from homeassistant.util import slugify from .types import SteamGame from .util import get_steam_game try: from homeassistant.components.binary_sensor import BinarySensorEntity except ImportError: # Prior to HA v0.110 f...
import constants def lowercase_converter(split_line, idx): return [split_line[idx].lower()] def parse_roots_self_loop_converter(split_line, idx): # idx[0] is parse head, idx[1] is token id head = int(split_line[idx[0]]) id = int(split_line[idx[1]]) return [str(id if head == 0 else head - 1)] def strip_c...
from django.contrib.auth import get_user_model from django.test import TestCase from oauth2client.client import Credentials from ..models import CredentialsModel class CredentialsModelTest(TestCase): def test_save_credential(self): User = get_user_model() user = User.objects.create( ...
# coding:utf-8 import os import logging from flask import Flask, request from casslr.szradm import FarmRoleEngine logger = logging.getLogger(__name__) CONFIG_PATH = os.environ.get('CASSLR_CONFIG_FILE', '/etc/casslr.cfg') # 0-indexed server IDs that are modulo this number are used as seeds. # Server #1 is guarante...
#!/usr/bin/python ########################## # channon@hawk.iit.edu # ########################## # DSSnet # version 2.0 ##################### # Mininet Imports # ##################### from mininet.topo import Topo, SingleSwitchTopo from mininet.net import Mininet from mininet.node import CPULimitedHost, Contro...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/1/5 10:06 # @Author : glacier # @Site : 爬取淘宝商品 # @File : yiliao.py # @Software: PyCharm Edu import requests,re,time headers = { # 'Host': 'i.meizitu.net', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** 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 from .. import _utilitie...
import inspect import json import os from eveuniverse.models import ( EveConstellation, EveEntity, EveFaction, EveRegion, EveSolarSystem, EveType, ) from allianceauth.eveonline.models import ( EveAllianceInfo, EveCharacter, EveCorporationInfo, ) _currentdir = os.path.dirname(os.pa...
from typing import Any def number(value: Any) -> float: return float(value) def force_number(value: Any) -> float: return float(value) def string(value: Any) -> str: return str(value) def force_string(value: Any) -> str: return str(value)
import math t = 'Honda' m = 1500 v = 27 brakeJ = 250000 def v(t,m, v, brakeJ): E = m * pow(v, 2) / 2 E_delta = brakeJ / 10 E -= E_delta v = math.sqrt(2 * E / m) return v def pos_now(t, v, pos_now): time_delta = 0.1 pos_delta = time_delta * v pos_now += pos_delta return pos_now de...
class Test: def sum(self, x, y): return x + y
""" Copyright (c) 2021 ghcollin 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, publish, distribute, sublic...
import os from setuptools import find_packages, setup # include the non python files def package_files(directory, strip_leading): paths = [] for (path, directories, filenames) in os.walk(directory): for filename in filenames: package_file = os.path.join(path, filename) paths.a...
def decay_schedule(start_val=40, end_val=10, decay_period=30): return lambda epoch: round(end_val + start_val * max(decay_period-epoch,0)/decay_period)
import uuid import dash import dash_bootstrap_components as dbc import dash_html_components as html from dash.dependencies import Input, Output, State from dash.exceptions import PreventUpdate app = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP]) copy_alert = dbc.Alert( "Code copied to clipboard...
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2019, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
# Copyright 2019 Google 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 in writing, ...
from django.contrib import admin from paintings.models import Painting, Like, Comment class LikeInline(admin.TabularInline): model = Like class PaintingAdmin(admin.ModelAdmin): list_display = ('id', 'type', 'name', ) list_filter = ('type', ) inlines = ( LikeInline, ) admin.site.regis...
''' Define the Transformer model ''' from utils.utils import * from model.Decoder import Decoder from model.EncoderRNN import EncoderRNN __author__ = 'Jacob Zhiyuan Fang' class Model(nn.Module): ''' A sequence to sequence model with attention mechanism. ''' def __init__( self, n_cap_...
# Importing necessery packages from beene import beene_model from numpy import random from sklearn.preprocessing import OneHotEncoder import numpy as np from sklearn.model_selection import train_test_split # creating Random data with 3000 sample and 100 genes per sample. Xt = random.uniform(-1,1,(3000,100)) # With ...
from django.conf import settings from django.urls import path, re_path from django.views.generic import RedirectView from . import views LOCALE_PART = r"(?P<locale>[A-Za-z0-9\-\@\.]+)" PROJECT_PART = r"(?P<project>[\w-]+)" RESOURCE_PART = r"(?P<resource>.+)" urlpatterns = [ # For backwards compatibility, redir...
import securexgboost as xgb import os username = "user1" DIR = os.path.dirname(os.path.realpath(__file__)) HOME_DIR = DIR + "/../../../" sym_key_file = DIR + "/../../data/key_zeros.txt" priv_key_file = DIR + "/../../../config/user1.pem" cert_file = DIR + "/../../../config/user1.crt" print("Init user and enclave para...
# Copyright 2019 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
import sys import random import ctypes import os import subprocess import scriptfs_util_userspace syscall_num_scriptfs_pid = 333 syscall_num_scriptfs_state = 334 syscall_num_scriptfs_context = 335 libc = ctypes.CDLL(None) syscall = libc.syscall syscall(syscall_num_scriptfs_pid, os.getpid()) context_dir = {"poem": s...
""" Project Serializers """ from tasking.models import Project from tasking.serializers.base import GenericForeignKeySerializer class ProjectSerializer(GenericForeignKeySerializer): """ Project serializer class """ # pylint: disable=too-few-public-methods class Meta: """ Meta opti...
import discord import os import requests from discord.ext import commands, tasks from nerdlandbot.commands.GuildData import get_all_guilds_data, get_guild_data, GuildData from nerdlandbot.helpers.log import info, fatal from nerdlandbot.helpers.channel import get_channel from nerdlandbot.helpers.TranslationHelper impor...
class config: log_errors = True
from django.shortcuts import render, redirect from django.http import JsonResponse from django.views import View from django.utils.decorators import method_decorator from django.contrib.auth import get_user_model from django.contrib.auth.decorators import login_required from django.contrib import messages from django.v...
import os from je_api_testka import reformat_json from je_api_testka import read_action_json from je_api_testka import write_action_json from je_api_testka import execute_action test_list = \ [ ["test_api_method", {"http_method": "get", "test_url": "http://httpbin.org/get", "headers": { 'x-re...
# encoding: UTF-8 import json import csv import os from collections import OrderedDict from PyQt4 import QtGui, QtCore from eventEngine import * from vtFunction import * from vtGateway import * import vtText COLOR_RED = QtGui.QColor('red') COLOR_GREEN = QtGui.QColor('green') #------------------------------------...
import timeit import matplotlib.pyplot as plt import numpy as np from abr_control.arms import twojoint, ur5, jaco2 from abr_control.controllers import OSC def test_timing(arm, config_params, osc_params, use_cython): robot_config = arm.Config(use_cython=use_cython, **config_params) ctrlr = OSC(robot_config, ...
''' Misc Utility functions ''' import os import numpy as np import torch.optim as optim from torch.nn import CrossEntropyLoss, BCELoss from utils.metrics import segmentation_scores, dice_score_list from sklearn import metrics from .layers.loss import * def get_optimizer(option, params): opt_alg = 'sgd' if not has...
"""Somewhat Looser ISO date format YYYY-MM-DD HH:mm:SS +HH:mm ISO_date_loose -- YYYY-MM-DD format, with a month and day optional, month or day may be specified without leading 0 ISO_time_loose -- HH:mm:SS format, with minutes and seconds optional all numbers may be specified without leading 0 ISO_date_time_loos...
#!/usr/bin/env python # -*- coding: utf-8 -*- import random import logging from aiohttp import ClientSession, hdrs import opentracing from config import server logger = logging.getLogger("sanic") class Client: def __init__(self, name, app=None, url=None, client=None, **kwargs): self.name = name ...
import xmltodict import requests from datetime import datetime def kyn(nafn): if(nafn.find(u'dóttir') != -1): return 'kvk' elif(nafn.find(u'son') != -1): return 'kk' else: return '0' def kenninafn(nafn): if(nafn.find(u'dóttir') != -1): return nafn.split(' ')[-1][:-6] elif(nafn.find(u'son') != -1): retu...
from funcionesSLH import * import CrearPersonas as personas import tkinter as tk from tkinter import * from tkinter import Tk from tkinter import ttk from tkinter import messagebox import funcionesSLH as clase import webbrowser # Definición de Funciones def rgb(rgb): return "#%02x%02x%02x" % rgb #devuelve el forma...
# 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 ...
import math from functools import partial from typing import Tuple import torch from torch.quantization.observer import _ObserverBase from mqbench.utils import sync_tensor, pot_quantization, is_symmetric_quant from mqbench.utils.logger import logger class ObserverBase(_ObserverBase): ''' Support per-ten...
"""Tests for the Device Registry.""" import time from unittest.mock import patch import pytest from openpeerpower import config_entries from openpeerpower.const import EVENT_OPENPEERPOWER_STARTED from openpeerpower.core import CoreState, callback from openpeerpower.exceptions import RequiredParameterMissing from open...
import re import logging import json import uuid import base64 import codecs import xmltodict import collections import botocore.config import six from six import iteritems from six.moves.urllib import parse as urlparse from botocore.client import ClientError from requests.models import Response, Request from localstac...
# jsb/users.py # # """ bot's users in JSON file. NOT USED AT THE MOMENT. """ ## lib imports from jsb.utils.exception import handle_exception, exceptionmsg from jsb.utils.generic import stripped from jsb.utils.name import stripname from persiststate import UserState from persist import Persist from jsb.utils.lazydic...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: p2p.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.protobuf import message as _message from google.protobuf import ...
import requests class LoLAPITransport: def __init__(self, api_key, platform_routing, region_routing): self.api_key = api_key self.platform_routing = self._get_platform_routing(platform_routing) self.region_routing = self._get_region_routing(region_routing) @staticmethod def _get_p...
import logging import os import yaml from galaxy.tools import GALAXY_LIB_TOOLS_UNVERSIONED from galaxy.jobs import JobDestination log = logging.getLogger(__name__) CONTAINER_RULE_MAPPER_FILE = os.path.join( os.path.dirname(__file__), 'container-mapper-rules.yml') def _load_container_mappings(): if os.path....
# -*- coding: utf-8 -*- """ Created on Sun Dec 2 11:36:59 2018 使用giplt画等值线图 @author: chens """ from geoist import gridder import matplotlib.pyplot as plt from geoist.vis import giplt area = [-20, 20, -50, 50] x, y = gridder.scatter(area, n=100) data = x**2 + y**2 plt.figure() plt.axis('scaled') giplt.contourf(y, x, d...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
#!/usr/bin/env python # -*- coding: utf-8 -*- #...for the logging. import logging as lg # The CSV file wrapper class. from csvfile import CSVFile class ODD(CSVFile): """ Wrapper class for the oddity information CSV file format. """ def __init__(self, path): """ Constructor. """ super(...
# This file is part of Radicale Server - Calendar Server # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter # Copyright © 2008-2017 Guillaume Ayoub # Copyright © 2017-2018 Unrud <unrud@outlook.com> # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU G...
from eth_typing import ( Address, Hash32 ) from eth._warnings import catch_and_ignore_import_warning with catch_and_ignore_import_warning(): from eth_utils import denoms ANY = 'any' UINT256 = 'uint256' BYTES = 'bytes' UINT_256_MAX = 2**256 -1 UINT_256_CEILING = 2**256 UINT_255_MAX = 2**255 - 1 UINT_255_...
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters import logging import apisetings PROXY = {'proxy_url': 'socks5h://t2.learn.python.ru:1080', 'urllib3_proxy_kwargs': {'username': 'learn', 'password': 'python'}} logging.basicConfig(format='%(name)s - %(levelname)s - %(message)s', ...
import re from typing import List from . import consts from .channel_config_handler import ChannelFileConfig from .consts import logger from .prow_job import ProwJobFailure class ChannelMessage: def __init__(self, **kwargs): self._type = kwargs.get("type") self._user = kwargs.get("user") ...
# coding: utf-8 """ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ ...
def apple(): print("I AM APPLES!") tangerine ="Living reflection of a dream"
# Lovely Damage Skin success = sm.addDamageSkin(2433903) if success: sm.chat("The Lovely Damage Skin has been added to your account's damage skin collection.")
# Copyright (c) 2017, 2020, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2.0, as # published by the Free Software Foundation. # # This program is also distributed with certain software (including # ...
# pylint: disable=E1101,W0232 import textwrap from warnings import warn import numpy as np from pandas._libs import algos as libalgos, lib import pandas.compat as compat from pandas.compat import lzip, u from pandas.compat.numpy import function as nv from pandas.util._decorators import ( Appender, Substitution, ...
from typing import Callable, List, Optional from pykube import HTTPClient from pytest_helm_charts.giantswarm_app_platform.custom_resources import CatalogCR CatalogFactoryFunc = Callable[[str, str, Optional[str]], CatalogCR] def get_catalog_obj(catalog_name: str, catalog_namespace: str, catalog_uri: str, kube_clien...
# Generated by Django 2.1.3 on 2018-11-17 23:23 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ontofraud', '0002_auto_20181117_2314'), ] operations = [ migrations.AlterField( model_name='transaction', name='hash...
from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from django_simple_domain import services __author__ = 'Jisson | pierre@jisson.com' class CheckInstalledAppsTestCase(TestCase): def test_check_site_framework_disabled(self): # Disabling django site framework ...
#!/usr/bin/env python import os AUTHOR = 'Open Data Team' SITENAME = 'udata' SITEDESCRIPTION = 'Bla bla bla' TAGS = ('opendata', 'data') # PATH = 'articles' TIMEZONE = 'Europe/Paris' DEFAULT_LANG = 'en' # THEME = 'theme' PATH = os.path.dirname(__file__) OUTPUT_PATH = os.path.join(PATH, 'output') ARTICLE_PATHS =...
from machinetranslation import translator from flask import Flask, render_template, request import json app = Flask("Web Translator") @app.route("/englishToFrench") def englishToFrench(): textToTranslate = request.args.get('textToTranslate') return "Translated text to French is "+translator.englishToFrench(te...
import socket import threading import numpy as np import logging from data.bus import DataChunk """ Client for biosemi """ class BiosemiClient(object): """docstring for BioClient""" def __init__(self, host,port,dataBuilder): self.host=host self.port=port self.socket=None self.da...
#! /usr/bin/env python ''' Copyright (c) 2019-2020, Juan Miguel Jimeno 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, t...
import microbit from uln2003 import * # (c) IDWizard 2017 # MIT License. microbit.display.off() class Stepper(StepperBase): def _set_pin(self, pin, value): self.pins[pin].write_digital(value) def _wait(self): microbit.sleep(self.delay) if __name__ == '__main__': FULL_ROTATION = 4096 ...
""" ASGI config for TrainingApp project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ """ import os from django.core.asgi import get_asgi_application os.environ.setdefault('DJANGO_S...
#!/usr/bin/python # -*- coding: utf-8 -*- def index(): """ It adds a new client app to the database. You need to provide a name for the app and a valid callback URI. It will return the client_id and client_secret generated. """ from oauth.storage import web2pyStorage as storage # change t...
"""Base option parser setup""" # The following comment should be removed at some point in the future. # mypy: disallow-untyped-defs=False import logging import optparse import shutil import sys import textwrap from pip._vendor.contextlib2 import suppress from pip._internal.cli.status_codes import UNKNO...
# Author: Bichen Wu (bichen@berkeley.edu) 08/25/2016 """Image data base class for kitti""" import cv2 import os import numpy as np import subprocess from dataset.imdb import imdb from utils.util import bbox_transform_inv, batch_iou class kitti(imdb): def __init__(self, image_set, data_path, mc): imdb.__init_...
# Pyrogram - Telegram MTProto API Client Library for Python # Copyright (C) 2017-2021 Dan <https://github.com/delivrance> # # This file is part of Pyrogram. # # Pyrogram is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free...
# This file is part of the Hotwire Shell user interface. # # Copyright (C) 2007 Colin Walters <walters@verbum.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the Li...
# Copyright Pincer 2021-Present # Full MIT License can be found in `LICENSE` at the project root. from __future__ import annotations from dataclasses import dataclass from enum import IntEnum from typing import Optional, TYPE_CHECKING from ..guild import Guild from ..guild.channel import Channel from ..us...
""" Connect to a MySensors gateway via pymysensors API. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.mysensors/ """ import logging import socket import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.b...
# -*- coding: utf-8 -*- import attr from attrs_mate import AttrsClass @attr.s class WFItem(AttrsClass): """ Represent a Workflow Item. TODO: support custom icon. """ title = attr.ib(default="") subtitle = attr.ib(default="") arg = attr.ib(default=None) autocomplete = attr.ib(default=...
""" This file contains Visualizer class based on Facebook's visdom. Returns: Visualizer(): Visualizer class to display plots and images """ ## import os import time import numpy as np import torchvision.utils as vutils ## class Visualizer(): """ Visualizer wrapper based on Visdom. Returns: Visua...
# import import numpy as np import json from urllib.request import urlopen from dataUtil import parse_url_as_json from collections import Counter with open(r"log_data\users_to_conditions_in_experiment_by_name", 'rb') as lc: users_to_conditions_in_experiment_by_name = json.load(lc) user_to_uninstall_times = parse_...
from typing import Optional from torch.utils.data import Dataset, DataLoader import imageio from torchvision.transforms import transforms import os import pytorch_lightning as pl class MultipleImageDataset(Dataset): def __init__(self, image_path, data_rep): transform = transforms.Compose([ t...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ syncs address data between osm and municipality most likely only usable for slovak openstreetmap community usage: usage: syncer.py [-h] (-f OSM_DUMP | -i RELATION_ID) [-p] [-r] [-u] [-d] municipality_data.csv local csv files need to be formatted as follows: cadastra...
import inspect from typing import List, Optional, Tuple, Type import click from sxm_player.models import PlayerState from sxm_player.runner import Runner from sxm_player.workers import BaseWorker class BasePlayer: @staticmethod def get_params() -> List[click.Parameter]: return [] @staticmethod ...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.conch.ssh.keys}. """ try: import Crypto.Cipher.DES3 except ImportError: # we'll have to skip these tests without PyCypto and pyasn1 Crypto = None try: import pyasn1 except ImportError: pyasn1 = None i...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2015 Thomas Voegtlin # # 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...
from django.conf.urls import url from django.views.generic import View urlpatterns = [ url(r"^simple/action/$", View.as_view(), name="simpleAction"), ]
from django.conf.urls import patterns, url from django.contrib.staticfiles.urls import staticfiles_urlpatterns from apps.myapp import views urlpatterns = patterns('', url(r'^$', views.land, name='land'), #url(r'^tangle/$', views.tangle, name='tangle'), url(r'^land/$', views.land, name='land'), #url(r'^newdes...
""" Alavi et al., 2016, ApJ, 832, 56 Table 1. """ import numpy as np info = \ { 'reference': 'Alavi et al., 2016, ApJ, 832, 56', 'data': 'Table 2 (LBGs only)', } # u, g, and r dropouts, respectively redshifts = [1.65, 2.0, 2.7] wavelength = 1500. ULIM = -1e10 tmp_data = {} tmp_data['lf'] = \ { 1.65: {'M': lis...
from typing import Tuple, Callable, Union, Type, List, Dict, Any from itertools import combinations import torch import torch.nn as nn import torch.nn.functional as F from mars_gym.torch.init import lecun_normal_init from mars_gym.model.abstract import RecommenderModule import numpy as np from mars_gym.meta_config imp...
""" Integrate """ from .sourcebase import BaseDataSource import sys import logging import numpy as np try: from distutils.version import LooseVersion as V import spikeinterface if V(spikeinterface.__version__)>='0.90.0': HAVE_SI = True from neo.rawio.baserawio import BaseRawIO else: ...
import logging from django.conf import settings from django.contrib import messages from django.contrib.auth import get_user_model from django.http import Http404 from django.shortcuts import get_object_or_404, redirect, render from django.utils import timezone from django.utils.html import strip_tags from django.view...
from eval_ucf101 import UCFclassification from eval_kinetics import KINETICSclassification # ucf_classification = UCFclassification('../annotation_UCF101/ucf101_01.json', # '../results/val.json', # subset='validation', top_k=1) # ucf_class...
from pdip.data import EntityBase from pdi.domain.base.integration.DataIntegrationConnectionDatabaseBase import DataIntegrationConnectionDatabaseBase from pdi.domain.base.integration.DataIntegrationConnectionFileBase import DataIntegrationConnectionFileBase from pdi.domain.base.integration.DataIntegrationConnectionQueu...
# -*- coding: utf-8 -*- # # Sphinx documentation build configuration file, created by # sphinx-quickstart on Thu Nov 13 11:09:54 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 pickleab...
# 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 a...
from flask_wtf import FlaskForm from wtforms import StringField,SubmitField,BooleanField,PasswordField from wtforms.validators import Required,EqualTo,DataRequired,Length,Email class RegisterForm(FlaskForm): email = StringField('Email', validators=[DataRequired(), Length(1, 64), Email()]) username = StringFiel...
# coding=utf-8 # Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team. # # 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 # # ...