text stringlengths 2 999k |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*
'''Helper functions for icecube specific labels.
'''
from __future__ import print_function, division
import numpy as np
from icecube import dataclasses, simclasses
# Try to import ShowerParameters from I3SimConstants
try:
from icecube.sim_services import I3SimConstants
... |
from app import app, cnx
from flask import request, render_template, session, g
from werkzeug.utils import redirect
from app.models.cliente_dao import Cliente, ClienteDAO
from app.models.corretor_dao import Corretor, CorretorDAO
from app.models.usuario_dao import Usuario
from app.models.login_dao import Login, LoginDA... |
import csv
import json
from itertools import zip_longest
with open('./output_data/bitbucket_pr_data.json') as f:
bitbucket_data = json.load(f)
bitbucket_url = [item.get('url') for item in bitbucket_data]
bitbucket_contents = [item.get('pr_contents') for item in bitbucket_data]
bitbucket_title = [item.get('pr_titl... |
#!/usr/bin/python
from setuptools import setup, find_packages
from dogen.version import version
import codecs
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setup(
name = "dogen",
version = version,
packages = find_packages(exclude=["tests"]),
package_data = {
'... |
# -*- coding: utf-8 -*-
import logging
import re
try:
from urllib import quote_plus
from urlparse import urljoin, urlparse, parse_qs
except ImportError:
from urllib.parse import quote_plus, urljoin, urlparse, parse_qs
import requests
from bs4 import BeautifulSoup
from requests_futures.sessions import Fut... |
"""
Simple async event emitter.
Add these environment variables:
server_endpoint
server_ws_port
"""
import os
import pygame
from pygame.locals import *
from pygame.transform import scale
import asyncio
import websockets
main_dir = os.path.dirname(os.path.abspath(__file__))
ACTIONS = [
K_UP,
K_DOWN,
K_L... |
#!/usr/bin/env python2
# Copyright (c) 2015 The Clicoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import ClicoinTestFramework
from test_framework.util import *
from test_fra... |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class ColorBar(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "densitymapbox"
_path_str = "densitymapbox.colorbar"
_valid_props = {
"bgcolor",
... |
from firstclasspostcodes.configuration import Configuration
class TestConfigurationClass:
def test_base_url_works_correctly(self):
config = Configuration(protocol='http', host='example.com', base_path='/test')
assert config.base_url() == 'http://example.com/test'
def test_request_params_works... |
import logging
import pathlib
import re
from bioblend import galaxy
from datetime import datetime, timedelta
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from ._core import (
GalaxyDriver,
do... |
# -*- coding: utf-8 -*-
# Copyright 2020 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... |
from typing import Union, Tuple
from transformers import PreTrainedModel
import torch
__all__ = ['greedy_decode']
DecodedOutput = Union[torch.Tensor, Tuple[torch.Tensor, torch.Tensor]]
@torch.no_grad()
def greedy_decode(model: PreTrainedModel,
input_ids: torch.Tensor,
length: in... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), ... |
id_name = {
'2': '施工',
'3': '监理',
'4': '勘察',
'5': '设计',
'6': '政府采购',
'8': '房建施工',
'9': '市政施工',
'10': '公路施工',
'11': '水利施工',
'12': '房建监理',
'13': '市政监理',
'14': '公路监理',
'15': '水利监理',
'16': '造价审计',
'17': 'EPC',
'18': 'PPP',
'19': '装修',
'20': '咨询服务',
... |
# Generated by Django 2.2.10 on 2020-04-24 14:54
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_ingredient'),
]
operations = [
migrations.CreateModel(
... |
"""
This Python script is designed to perform unit testing of Wordhoard's
Synonyms module.
"""
__author__ = 'John Bumgarner'
__date__ = 'September 20, 2020'
__status__ = 'Quality Assurance'
__license__ = 'MIT'
__copyright__ = "Copyright (C) 2021 John Bumgarner"
import unittest
import warnings
from wordhoard import S... |
"""
链家二手房数据抓取
"""
import requests
from lxml import etree
import time
import random
from fake_useragent import UserAgent
import pymongo
class LianJiaSpider:
def __init__(self):
self.url = 'https://lf.lianjia.com/ershoufang/pg{}/'
# 3个对象
self.conn = pymongo.MongoClient('localhos... |
from django.urls import path
from . import views
app_name = 'users'
urlpatterns = [
path('login/', views.login, name='login'),
path('logging_in/', views.logging_in, name='logging_in'),
path('logout', views.logout, name='logout'),
path('register/', views.register, name='register'),
path('... |
"""Test the Pip version."""
from pathlib import Path
import pytest
from universions import Version
from universions.pip import get_pip_version
from .mock_popen import BasicMockedPopen
PIP_19_3_1 = b"pip 19.3.1 from /path/python3.7/site-packages/pip (python 3.7)"
PIP_10_0_0B2 = b"pip 10.0.0b2 from /path/lib/python2... |
import re
from gensim.models import KeyedVectors
from gensim.models import word2vec
import subprocess
from subprocess import Popen
from janome.tokenizer import Tokenizer
from janome.analyzer import Analyzer
from janome.charfilter import *
from janome.tokenfilter import *
from cfg_parser import Parse
class NLP:
'''... |
from api_basebone.permissions import BasePermission
default_app_config = 'lightning.apps.LightningConfig'
APPS = [
'guardian',
'api_basebone',
'bsm_config',
'shield',
'storage',
'puzzle',
'lightning',
]
FUNC_SCENE_UNLIMIT = 'unlimit'
FUNC_SCENE_INLINE = 'inline'
FUNC_SCENE_BATCH = 'batch'
... |
from typing import List, Set
class ThroneInheritance:
def __init__(self, kingName: str):
self.names = [kingName]
self.index = {kingName: 0}
self.children: List[List[int]] = [[]]
self.died: Set[int] = set()
def birth(self, parentName: str, childName: str) -> None:
iC = l... |
from PIL import Image, ImageChops
import glob
from tqdm import tqdm
import concurrent.futures
import os
for i in range(3, 8):
os.mkdir("pngs/cropped_" + str(i))
def cropper(filename):
img = Image.open(filename)
pixels = img.load()
xlist = []
ylist = []
for y in range(0, img.size[1]):
... |
# ------------------------------------------------------------------------------
# CodeHawk Binary Analyzer
# Author: Henny Sipma
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2016-2020 Kestrel Technology LLC
# Copyright (c) 2020-2021 Henny Si... |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
class BasicBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride, dropRate=0.0):
super(BasicBlock, self).__init__()
self.bn1 = nn.BatchNorm2d(in_planes)
self.relu1 = nn.R... |
import time
# https://docs.datadoghq.com/integrations/amazon_lambda/#lambda-metrics
DATADOG_METRIC_TYPES = {"count", "gauge", "histogram", "check"}
# https://github.com/DataDog/datadogpy/blob/master/datadog/api/constants.py
# I kept the existing upstream structure to make it easy for future patches.
class CheckStatus... |
# register dep
from django.contrib.auth import get_user_model
# django aggregation function
from django.db.models import Count
from django.utils.translation import gettext_lazy as _
from rest_framework import exceptions, status, viewsets
# authentication class
from rest_framework.authentication import TokenA... |
import Foundation
from PyObjCTools.TestSupport import TestCase, min_os_level
class TestNSFileVersion(TestCase):
@min_os_level("10.7")
def testContants10_7(self):
self.assertEqual(Foundation.NSFileVersionAddingByMoving, 1 << 0)
self.assertEqual(Foundation.NSFileVersionReplacingByMoving, 1 << 0)... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 🚧
# Copyright 2021 Efabless Corporation
#
# 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... |
import json
import os
import pandas as pd
import sys
sys.path.append("..")
sys.path.append("../../column_matching")
import data_build_scripts.helpers as hlp
def main():
school_matching = hlp.return_college_matching_dict()
local_path = os.path.dirname(os.path.abspath(__file__))
f = open(os.path.join(loca... |
#!/usr/bin/env python
import auracle_test
class TestInfo(auracle_test.TestCase):
def testStringFormat(self):
p = self.Auracle(['info', '-F', '{name} {version}', 'auracle-git'])
self.assertEqual(p.returncode, 0)
self.assertEqual(p.stdout.decode(), 'auracle-git r74.82e863f-1\n')
def ... |
trans_dict_eng_rus = {
'а': 'А',
'в': 'В',
'е': 'Е',
'к': 'К',
'м': 'М',
'н': 'Н',
'о': 'О',
'р': 'Р',
'с': 'С',
'т': 'Т',
'у': 'У',
'х': 'Х',
'А': 'А',
'В': 'В',
'Е': 'Е',
'К': 'К',
'М': 'М',
'Н': 'Н',
'О': 'О',
'Р': 'Р',
'С': 'С',
... |
"""
Support for Insteon dimmers via local hub control.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/light.insteon_local/
"""
import json
import logging
import os
from datetime import timedelta
from homeassistant.components.light import (
ATTR_BRI... |
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from cfdi import views
router = DefaultRouter()
router.register('issued', views.CFDIIssuedViewSet)
router.register('received', views.CFDIReceivedViewSet)
app_name = 'cfdi'
urlpatterns = [
path('', include(router.urls))
]
|
"""mycloud URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/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')
Cla... |
"""Provides core stream functionality."""
import abc
import io
from typing import Callable
from aiohttp import web
import attr
from homeassistant.components.http import HomeAssistantView
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.event import async_call_later
from .const import... |
from nautobot.core.apps import HomePageItem, HomePagePanel
from nautobot.virtualization.models import Cluster, VirtualMachine
layout = (
HomePagePanel(
name="Virtualization",
weight=600,
items=(
HomePageItem(
name="Clusters",
link="virtualization... |
import unittest
import os, re
from pathlib import Path
class LookerSDKTestCase(unittest.TestCase):
base_url = os.environ.get('LOOKERSDK_BASE_URL')
api_id = os.environ.get('LOOKERSDK_CLIENT_ID')
api_secret = os.environ.get('LOOKERSDK_CLIENT_SECRET')
email_list = os.environ.get('THEMIS_EMAIL_RECIPIENTS'... |
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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 ... |
# Copyright (c) 2016 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... |
x = "There are %d types of people." % 10
binary = "binary"
do_not = "don't"
y = "Those who know %s and those who %s." % (binary, do_not)
print x
print y
print "I said: %r." % x
print "I also said: '%s'." % y
hilarious = False
joke_evaluation = "Isn't that joke so funny?! %r"
print joke_evaluation % hilarious
w = "... |
# ds_config.py
#
# DocuSign configuration settings
DS_CONFIG = {
"ds_client_id": "{INTEGRATION_KEY_AUTH_CODE}", # The app's DocuSign integration key
"ds_client_secret": "{SECRET_KEY}", # The app's DocuSign integration key's secret
"organization_id": "{ORGANIZATION_ID}", # A GUID value that identifies the... |
from django.urls import path
from . import views
urlpatterns = [
path('', views.OverView.as_view()),
path('list/user-profile', views.UserProfileListView.as_view()),
path('list/programming-language', views.ProgrammingLanguageListView.as_view()),
path('trending/questions/', views.TrendingQuestionListView.as_view()),
... |
"""
This file contains functions for moving all annotated audio files to a separate directory.
This functionality is needed when it is not practical to share all audio files (including the
unannotated files). This is necessary as many of the audio files downloaded from xeno canto
were never annotated or skipped due to ... |
#
# Unit tests for the multiprocessing package
#
import unittest
import unittest.mock
import queue as pyqueue
import time
import io
import itertools
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import subprocess
import struct
import operator
import p... |
import contextlib
import threading
import time
from .test_utils import (
TempDirectoryTestCase,
skip_unless_module,
skip_without_drmaa,
restartable_pulsar_app_provider,
integration_test,
)
from pulsar.manager_endpoint_util import (
submit_job,
)
from pulsar.managers.stateful import ActiveJobs
f... |
# -*- coding: utf-8 -*-
# Copyright 2020 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 o... |
#!/usr/bin/env python
import os
import sys
# Edit this if necessary or override the variable in your environment.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dragnet.settings')
# Add a temporary path so that we can import the funfactory
tmp_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
... |
def __bootstrap__():
global __bootstrap__, __loader__, __file__
import sys, pkg_resources, imp
__file__ = pkg_resources.resource_filename(__name__, '_imagingmath.cpython-37m-darwin.so')
__loader__ = None; del __bootstrap__, __loader__
imp.load_dynamic(__name__,__file__)
__bootstrap__()
|
"""
pyart.io.sigmet
===============
Reading and writing of Sigmet (raw format) files
.. autosummary::
:toctree: generated/
read_sigmet
ymds_time_to_datetime
_time_order_data_and_metadata_full
_time_order_data_and_metadata_roll
"""
from __future__ import division
import datetime
import numpy as... |
#------------------------------------------------------------------------------
# Copyright (c) 2013-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.
#------------------------------------------------... |
#-
# Copyright (c) 2015 Michael Roe
# All rights reserved.
#
# This software was developed by the University of Cambridge Computer
# Laboratory as part of the Rigorous Engineering of Mainstream Systems (REMS)
# project, funded by EPSRC grant EP/K008528/1.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed to BERI Open System... |
# -*- coding: utf-8 -*-
from __future__ import division, print_function
import unittest
import numpy as np
from nufft import nufft1d1, nufft1d2, nufft1d3
def _error(exact, approx):
return np.sqrt(np.sum(np.abs(exact - approx) ** 2) / np.sum(np.abs(exact)**2))
class NUFFT1DTestCase(unittest.TestCase):
"""Te... |
import os
from nose.tools import assert_equals
from corpkit import *
unparsed_path = 'data/test'
parsed_path = 'data/test-parsed'
def test_import():
import corpkit
from dictionaries.wordlists import wordlists
from corpkit import Corpus
assert_equals(wordlists.articles, ['a', 'an', 'the', 'teh'])
|
#!/usr/bin/python
logopic = """__________ .__. _________ ________
\_______ \____ _____| |__ \_ ___ \ \_____ \
| ___/ _ \/ ___/ | \ / \ \/ / ____/
| | ( <_> )___ \| Y \ \ \____/ \
|____| \____/____ >___| / \______ /\_______ \
... |
from django.http import JsonResponse
from django.utils.translation import pgettext
from partitialajax.mixin import CreatePartitialAjaxMixin
from django.urls import reverse_lazy
class JSONResponseMixin:
"""
A mixin that can be used to render a JSON response.
"""
def render_to_json_response(self, contex... |
#-*- coding:utf-8 -*-
import os
from flask import Flask
import logging
#-- create app --
app = Flask(__name__)
app.config.from_object("rrd.config")
@app.errorhandler(Exception)
def all_exception_handler(error):
logging.basicConfig(level=logging.DEBUG, filename="log/falcon.log")
logging.warn(u"exception: %s" %... |
"""
With these settings, tests run faster.
"""
from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = False
# https://docs.djangoproject.com/en/dev/ref/settings/#se... |
"""Driver module for `vara-cs`."""
import logging
import os
import re
import typing as tp
from argparse import ArgumentParser, ArgumentTypeError, _SubParsersAction
from enum import Enum
from pathlib import Path
from argparse_utils import enum_action
from plumbum import FG, colors, local
from varats.base.sampling_met... |
"""An example Python script showing IAI Style Guide format and argparse usage.
This Python script implements a dummy function that takes input and output file
paths. The main purpose of this script is to show how a Python file should look
in order to be presentable and conform to the IAI Python Style Guide. As a
bonus... |
import unittest
from manticore.core.cpu import bitwise
class Armv7RF(unittest.TestCase):
_multiprocess_can_split_ = True
def test_mask(self):
masked = bitwise.Mask(8)
self.assertEqual(masked, 0xff)
def test_get_bits(self):
val = 0xAABBCCDD
result = bitwise.GetNBits(val, ... |
# Copyright 2011 Nebula, 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 ... |
import cv2
import numpy as np
img = cv2.imread("./test_data/Background_Removal/CM_1.jpg")
mask = cv2.imread("./test_data/Background_Removal/CM_1_Mask.png")
mask = cv2.cvtColor(mask, cv2.COLOR_BGR2GRAY)
transparent = np.zeros((img.shape[0], img.shape[1], 4), dtype=np.uint8)
transparent[:,:,0:3] = img
transparent[:, :, ... |
from .base_reader import BaseReader
from .csv_reader import CsvReader
from .excel_reader import ExcelReader
from .exceptions import HookException, HookItemException, ItemsException
from .import_from_file import Errors, ItemError, Relative, BeforeCreate, Created, ImportFromFile
from .json_reader import JsonReader
from .... |
import unittest
import socket
import struct
from scapy.layers.inet import IP, ICMP, TCP, UDP
from scapy.layers.ipsec import SecurityAssociation, ESP
from scapy.layers.l2 import Ether
from scapy.packet import raw, Raw
from scapy.layers.inet6 import IPv6, ICMPv6EchoRequest, IPv6ExtHdrHopByHop, \
IPv6ExtHdrFragment, ... |
from __future__ import print_function
import shlex
import sys
import os
import subprocess
install_deps = '{{cookiecutter.install_dependencies}}'
project_shortname = '{{cookiecutter.project_shortname}}'
is_windows = sys.platform == 'win32'
if is_windows:
python_executable = os.path.join('venv', 'Scripts', 'pyth... |
import rest_framework_filters as filters
from qatrack.api.filters import MaxDateFilter, MinDateFilter
from qatrack.units import models
class VendorFilter(filters.FilterSet):
class Meta:
model = models.Vendor
fields = {
"name": ['exact', 'icontains', 'contains', 'in'],
}
cla... |
from midca.modules._plan.asynch import asynch
from midca import base
import copy
class SimpleAct(base.BaseModule):
'''
MIDCA module that selects the plan, if any, that achieves the most current goals, then selects the next action from that plan. The selected action is stored in a two-dimensional array in mem... |
"""Module exposing `Grassmannian` and `GrassmannianMetric` classes."""
import geomstats.backend as gs
import geomstats.errors
from geomstats.geometry.embedded_manifold import EmbeddedManifold
from geomstats.geometry.euclidean import EuclideanMetric
from geomstats.geometry.general_linear import GeneralLinear
from geoms... |
from skmultiflow.trees import HoeffdingTreeRegressor
from skmultiflow.trees.nodes import RandomLearningNodeForRegression
from skmultiflow.trees.nodes import InactiveLearningNodeForRegression
from skmultiflow.trees.nodes import RandomLearningNodePerceptron
from skmultiflow.trees.nodes import InactiveLearningNodePerceptr... |
import os
from django.conf import settings
def configure_settings():
"""
Configures settings for manage.py and for run_tests.py.
"""
if not settings.configured:
# Determine the database settings depending on if a test_db var is set in CI mode or not
test_db = os.environ.get('DB', None... |
__version__ = '0.1.2'
from .interpolator import CloudInterpolator, cloud2cloud
|
"""
Universe configuration builder.
"""
# absolute_import needed for tool_shed package.
import collections
import configparser
import errno
import ipaddress
import logging
import logging.config
import os
import re
import signal
import socket
import string
import sys
import tempfile
import threading
import time
from da... |
from .drnet import DRNET as DRNET_Seg |
import math
import torch
import numbers
from torch.nn.parameter import Parameter
from torch.nn import init
import fused_layer_norm_cuda
class FusedLayerNormAffineFunction(torch.autograd.Function):
def __init__(self, normalized_shape, eps=1e-6):
self.normalized_shape = normalized_shape
self.eps = eps
def ... |
import numpy as np
from skyfield.positionlib import ICRF
_deep = np.array([[[1]],[[0]],[[0]]])
def test_ecliptic_xyz_with_no_epoch():
p = ICRF(_deep)
x, y, z = p.ecliptic_xyz().au
assert x.shape == y.shape == z.shape == (1, 1)
|
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 10 11:52:54 2020
@author: aabdulaal
................................................................................................................................
"""
import numpy as np
import tensorflow as tf
from tensorflow.python.keras.constraints import NonNeg
from ... |
#! /usr/bin/env python3
import numpy as np
import pandas as pd
import os
filter_silents = True
hm_coeff = 0.02 # Threshold of mutation rate of genes to be considered
input_dir = 'gdac.broadinstitute.org_GBM.Mutation_Packager_Calls.Level_3.2016012800.0.0'
df_full_dir = 'gdac_firehose_gbm_full.csv' # can be set to No... |
#!/usr/bin/python
# Copyright (c) 2020 Fernando
# Url: https://github.com/fernandod1/
# License: MIT
# DESCRIPTION:
# This script executes 2 actions:
# 1.) Monitors for new image posted in a instagram account.
# 2.) If found new image, a bot posts new instagram image in a discord channel.
# 3.) Repeat after set inter... |
#!/usr/bin/env python
# -*- coding:utf8 -*-
# Copyright 2017, Schuberg Philis BV
#
# 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... |
# -*- coding: utf-8 -*-
"""Top-level package for Polar Web API Client."""
__author__ = """Nat Burns"""
__email__ = 'nbaccount@burnskids.com'
__version__ = '0.0.2'
from polarweb.main import PolarWeb |
from __future__ import absolute_import, print_function, division
import numpy
import pickle
from theano.tests import unittest_tools as utt
from theano.tensor.raw_random import *
from theano.tensor import (raw_random, ivector, dvector, iscalar, dcol,
dtensor3)
from theano import tensor
from... |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import abc
from dataclasses import dataclass
import os
import torch
from foundations.hparams import Hparams
import platforms.platform
@datac... |
import scrapy
from bs4 import BeautifulSoup
from cultureBigdata.items import CultureNewsItem, CultureBasicItem, CultureEventItem
import re
import json
import time
from datetime import datetime
def timestamp_to_str(timestamp):
time_local = time.localtime(timestamp)
dt = time.strftime("%Y-%m-%d %H:%M:%... |
import copy
import datetime
import inspect
import logging
import os
import sys
import time
import warnings
from inspect import signature
from pathlib import Path
from typing import Any, Dict, Optional, Tuple, Type, Union, cast
import torch
from torch.optim.sgd import SGD
from torch.utils.data.dataset import ConcatData... |
# Based on: https://www.statworx.com/at/blog/how-to-build-a-dashboard-in-python-plotly-dash-step-by-step-tutorial/
# Padding: https://www.htmldog.com/guides/css/beginner/margins/
# System
import base64
import datetime
import io
# Dash
import dash
from dash.dependencies import Input, Output, State
import dash_core_com... |
# $Id: expando.py $
# This script generates calls for display list compilation
# and state management.
import sys
sys.path.append( "../../glapi_parser" )
import apiutil
apiutil.CopyrightC()
print """
/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY expando.py SCRIPT */
#include <stdio.h>
#include "cr_error.h"
#... |
from pytorch_lightning.plugins.training_type.ddp import DDPPlugin # noqa: F401
from pytorch_lightning.plugins.training_type.ddp2 import DDP2Plugin # noqa: F401
from pytorch_lightning.plugins.training_type.ddp_spawn import DDPSpawnPlugin # noqa: F401
from pytorch_lightning.plugins.training_type.deepspeed import DeepS... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2017-07-25 23:43
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import jsonfield.fields
import phonenumber_field.modelfields
import text_office.validators
class Migration(migrations.Migration):
... |
# -*- coding: utf-8 -*-
# Copyright 2017 ProjectQ-Framework (www.projectq.ch)
#
# 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
#
# ... |
from collections import namedtuple
ReadstoreSample = namedtuple("ReadstoreSample", ["file_type", # tar or gz-tar
"URL", # place to get it
"size", # size of tarball, approx
... |
import curses
import sys
import io
# un-insane-ify the screen so we can debug
debugging=False
def debug():
global debugging
if not debugging:
curses.nocbreak()
curses.echo()
curses.endwin()
debugging = True
def end_debug():
global debugging
stdscr = curses.initscr(... |
# This function is for entering multiple numbers and entering "0" to finish.
def main():
n = int(input('Entering a number: '))
sum0 = 0
while n != 0:
sum0 = sum0 + n
n = int(input('Entering a number: '))
# Once completed, print the sum result.
print('The sum result is {}'.format(sum0... |
# -*- coding: utf-8 -*-
from base import BaseApi
class Groups(BaseApi):
def __init__(self, cfg):
super().__init__(cfg)
self.api = 'http://%s/api/v4/groups'
#def run(self):
# super().run()
def inserts(self, source):
new_res = []
exist_res = []
target_res = []
for src in source:
sname = src['name'... |
# Copyright (C) Authors and contributors 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 applic... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# visualization code for categorical recall difference between two models
"""
Example:
python visualization/visualize_recall_diff.py \
--baseline_result ../VCTree-Scene-Graph-Generation/caches/prd_recall.pkl \
--new_model_result checkpoints/predcls-cross_att-vis_gau... |
import uuid
from django.db import models
from django.utils.translation import gettext_lazy as _
from simple_history.models import HistoricalRecords
class UUIDModel(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
class Meta:
abstract = True
class TimeStamp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tests/client/__init__.py
#
# 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 li... |
from aiogram import Bot, types
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from aiogram.dispatcher import Dispatcher
from aiogram.types import ReplyKeyboardMarkup, KeyboardButton
from aiogram.utils import executor
from aiogram.utils.executor import start_webhook
from src.Interfaces import MessengerInt... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2019 Tomoki Hayashi
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import json
import os
import shutil
import tempfile
from argparse import Namespace
import numpy as np
import pytest
import torch
from espnet.nets.pytorch_backend.e2e_tts_fastsp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.