content stringlengths 5 1.05M |
|---|
# Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.python.ops import array_ops
from tensorflow.python.keras.utils import tf_utils
from tf_tricks.nn.drop_block import drop_block
class DropBlock(tf.keras.layers.Layer):
def __init__(self, block_size=(7, 7), rate=.1, seed=None):
... |
import frappe
from frappe import _
from empg_erp.constants.table_names import EMP_ATT_PENALTIES, ATT_POLICY_RULES, \
EMP_ATT_ASSOCIATION, ATT_POLICY
from empg_erp.utils import get_table_name, unlock_doc, get_monthly_diff_dates,\
get_config_by_name,get_report_to,str_to_date
from datetime import datetime, timedelta
impor... |
class Solution:
def wordSquares(self, words):
pref, res = collections.defaultdict(set), []
for w in words:
for i in range(len(w)):
pref[w[:i + 1]].add(w)
def dfs(i, arr):
if i == len(arr[0]):
res.append(arr)
else:
... |
# coding: utf-8
import sys
sys.path.append('..')
import numpy as np
import matplotlib.pyplot as plt
from dataset import sequence
from common.optimizer import Adam
from common.trainer import Trainer
from common.util import eval_seq2seq
from seq2seq import Seq2seq
from peeky_seq2seq import PeekySeq2seq
# 데이터셋 읽기
(x_tra... |
# 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, overload
from . import ... |
from setuptools import setup, find_packages
from setuptools.extension import Extension
from codecs import open
import os
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "README.rst"), encoding="utf-8") as f:
long_description = f.read()
requires = [
"docopt",
"numpy",
"p... |
import logging
from config import CONFIG
from abstract import AbstractSwitch
if 'KuappiGPIO' in CONFIG.get('controls'):
import RPi.GPIO as GPIO
class KuappiGPIO(AbstractSwitch):
def __init__(self):
self.pin = CONFIG.get('gpio_pin')
GPIO.setmode(GPIO.BCM)
GPIO.setup(self.pin, GPIO.OUT... |
import unicornhat
class UnicornHAT:
dimensions = 2
width = 8
height = 8
@property
def rotation(self):
return unicornhat.get_rotation()
@rotation.setter
def rotation(self, value):
unicornhat.rotation(value)
@property
def brightness(self):
return unicornhat... |
import functools
import inspect
import typing as tg
import typecheck.framework as fw
def typecheck(method, *, input_parameter_error=fw.InputParameterError,
return_value_error=fw.ReturnValueError):
argspec = inspect.getfullargspec(method)
argnames = argspec.args
if not argspec.annotations or ... |
from masoniteorm.migrations import Migration
class CreateAccountsTable(Migration):
def up(self):
"""
Run the migrations.
"""
with self.schema.create('accounts') as table:
table.increments('id')
table.string('email')
table.string('access_token')
... |
import random
print('starting the game of hangman ...')
def game_start_home():
global attempts
print('')
attempts=(input('how many incorrect attempts do you want ?[1-25] '))
while attempts not in [str(x) for x in range(1,26)]:
print(attempts , 'is not between [1-25]')
attempts=(input(... |
def scale(x, in_min, in_max, out_min, out_max):
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min
def shift(text, num):
return text[num:], text[:num]
|
import hou
cur_nodes = hou.selectedNodes()
if len(cur_nodes) == 0:
raise hou.Error('You must select a node to perform this operation.')
cur_node = cur_nodes[0]
par_node = cur_node.parent()
exp_node = par_node.createNode('explodedview')
exp_node.setFirstInput(cur_node)
exp_node.moveToGoodPosition()
exp_node.setS... |
import time
from app.thirdparty.oneforall.common.search import Search
class Bing(Search):
def __init__(self, domain):
Search.__init__(self)
self.domain = domain
self.module = 'Search'
self.source = 'BingSearch'
self.init = 'https://www.bing.com/'
self.addr = 'https:... |
#!/usr/bin/env python
""" generated source for module ProjectSearcher """
# package: org.ggp.base.util.reflection
import java.lang.reflect.Modifier
import org.ggp.base.apps.kiosk.GameCanvas
import org.ggp.base.player.gamer.Gamer
import org.reflections.Reflections
import com.google.common.base.Objects
import com.go... |
## This script downloads the english package of stanza
import stanza
stanza.download('en')
stanza_nlp = stanza.Pipeline('en')
|
# import the libraries
import matplotlib.pyplot as plot
import numpy as np
# Define the list of frequencies
frequencies = np.arange(5,105,0.1)
# Sampling Frequency
samplingFrequency = 128
# Create two ndarrays
s1 = np.empty([0]) # For samples
s2 = np.empty([0]) # For signal
# Start Value of the sample
st... |
"""
The helpers classes/function of the Ultimate-Hosts-Blacklist project.
License:
::
MIT License
Copyright (c) 2019, 2020, 2021 Ultimate-Hosts-Blacklist
Copyright (c) 2019, 2020, 2021 Nissar Chababy
Copyright (c) 2019, 2020, 2021 Mitchell Krog
Permission is hereby granted, free of charge, to a... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @File : get_content_data.py
# @Description: 获取去标签后的文本数据
# @Time : 2020-5-30 上午 11:09
# @Author : Hou
import os
import pandas as pd
import pymysql.cursors
def get_id_list():
original_data = pd.read_excel(os.path.join(os.path.abspath('../..'), 'data'... |
from __future__ import unicode_literals
import time
from picraft import World, Vector, Block, Y
world = World()
world.say('Auto-bridge active')
try:
bridge = []
last_pos = None
while True:
this_pos = world.player.pos
if last_pos is not None:
# Has the player moved more than 0.1... |
import tensorflow as tf
import tensorflow.examples.tutorials.mnist.input_data as input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
x = tf.placeholder(tf.float32, [None, 784])
y_actual = tf.placeholder(tf.float32, shape=[None, 10])
W = tf.Variable(tf.zeros([784,10])) #初始化权值W
b = tf.Variab... |
from __future__ import annotations
from enum import Enum, auto
from typing import Any, Union
import attrs
from .. import UNSET, Client, Unset
from ..client.api.communication_way import (
create_communication_way,
delete_communication_way,
update_communication_way,
)
from ..client.models.communication_way... |
from fdfs_client.client import Fdfs_client
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet
from meiduo_admin.serializers.brand_serializers import *
from meiduo_admin.pages import UserPageNum
class BrandAdminView(ModelViewSet):
queryset = Brand.objects.all()
serial... |
#_*_coding:utf-8_*_
'''
Copyright (c) 2021 FranciscoCharles
para informações de licenca consulte o LICENCE.txt.
'''
import time#importa o modulo time.
import socket#importa o modulo socket.
import numpy#importa o modulo numpy
def ping(sock, ip_alvo, porta_alvo = 8080, n_repeticoes = 10):#define uma funcao.
... |
import os
import threading
import time
import socket
import json
import re
from .common import FileDownloader
from .http import HttpFD
from ..compat import (
compat_str,
compat_urllib_error,
)
from ..utils import (
encodeFilename,
int_or_none,
sanitize_open,
sanitized_Request,
)
class ParallelF... |
# Initialize App Engine and import the default settings (DB backend, etc.).
# If you want to use a different backend you have to remove all occurences
# of "djangoappengine" from this file.
from djangoappengine.settings_base import *
import os
# the project directory
ROOT_PATH = os.path.abspath(os.path.dirname(__file... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
import xml.etree.ElementTree as ET
from pprint import pprint
filename = 'GeoLogger.gpx'
def main():
tree = ET.parse(filename)
root = tree.getroot()
pprint(root.tag)
pprint(root.attrib)
pprint(root.findtext('.'))
if __name__ == "__main__":
main()... |
import numpy as np
from tdw.controller import Controller
from tdw.tdw_utils import TDWUtils
from tdw.output_data import OutputData, FlexParticles
"""
Create a Flex cloth object and "fix" one of its corners in mid-air.
"""
class FlexClothFixedParticle(Controller):
def run(self):
o_id = 0
... |
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By:
# Maintained By:
from ggrc import db
from sqlalchemy.ext.declarative import declared_attr
from .associationproxy import association_proxy
from .mix... |
#!/usr/bin/env python
# Copyright (c) 2016 The UUV Simulator 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... |
from abc import ABC
from functools import lru_cache
from typing import Any, List, Optional
from easytxt import text
from easydata.data import DataBag
from easydata.parsers.base import Base
from easydata.parsers.bool import Bool
from easydata.parsers.text import Text
from easydata.queries.base import QuerySearch
from ... |
from fundamentals.analysis.book_value_plus_dividends_increasing import BookValuePlusDividendsIncreasing
from fundamentals.analysis.cash_from_operating_activities_increasing import CashFromOperatingActivitiesIncreasing
from fundamentals.analysis.net_income_increasing import NetIncomeIncreasing
from fundamentals.analysis... |
###########################################################################
#
# Copyright 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org... |
# Generated by Django 3.1.2 on 2021-10-08 07:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('organization', '0001_initial'),
]
operations = [
migrations.CreateModel(
na... |
# Script to split the MSE values line by period & write into separate files as pandas dataframe:
import pandas as pd
import numpy as np
mse_file = "/Volumes/lowegrp/Data/Kristina/MDCK_WT_Pure/Sine_Wave/Grid_Search/2_gen/MSE_Grid_Search_Shortened.txt"
params = []
for amp in np.linspace(2.0, 12.0, 21):
for per in ... |
'''
Created on Oct 5, 2017
@author: Sku293
'''
import json
username = input("What is your name? ")
filename = 'username.json'
with open(filename, 'w') as f_obj:
json.dump(username, f_obj)
print("We'll remember you when you come back, " + username + "!") |
import numpy as np
from numpy.testing import assert_allclose
import pytest
import torch
from dca.dca import init_coef
from dca.data_util import form_lag_matrix
from dca.synth_data import gen_lorenz_data
from dca.cov_util import (calc_cross_cov_mats_from_cov,
calc_cov_from_cross_cov_mats,
... |
#!/usr/bin/env python
import sys, os, psycopg2
from time import sleep,time
import os
import subprocess
... |
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
RunAbove = get_driver(Provider.RUNABOVE)
driver = RunAbove('yourAppKey', 'yourAppSecret', 'YourConsumerKey')
image = [i for i in driver.list_images() if 'Debian 8' == i.name][0]
size = [s for s in driver.list_sizes() if s.na... |
__version__ = '0.1'
__all__ = [
'ups_open_device', 'ups_close_device', 'is_ups_connected',
'get_ups_vin', 'get_ups_vbat', 'get_ups_vout', 'get_ups_ccharge', 'get_ups_cdischarge',
'get_ups_cin', 'get_ups_vcell','get_ups_temperature', 'get_ups_ver_major','get_ups_ver_minor', 'get_ups_state',
'get_ups_year', 'get_ups_... |
import os
from unittest.mock import patch
from faker import Faker
from typer.testing import CliRunner
from hue import cli
class TestBridgeCLI:
fake = Faker()
ip = fake.ipv4_private()
user = fake.uuid4()
@classmethod
def setup_class():
try:
del os.environ["HUE_BRIDGE_IP"]
... |
from django.conf.urls import include, url
from django.contrib import admin
import project.views
admin.autodiscover()
urlpatterns = [
url(r'^$', project.views.home),
url(r'^catalog/', include('catalog.urls')),
url(r'^tenders/', include('tenders.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^article... |
import hometrainer.agents
import random
import reversialphazero.core
import reversi.network as network
import reversi.tournament as tournament
import definitions
class AITrivialAgent(hometrainer.agents.Agent):
def __init__(self,time_bonus=200):
self.time_bonus = time_bonus
"""'Wrapper' to use the ai ... |
from greenberry.wallet.puzzles.load_clvm import load_clvm
from greenberry.types.blockchain_format.program import Program, INFINITE_COST
DID_CORE_MOD = load_clvm("singleton_top_layer.clvm")
def test_only_odd_coins():
did_core_hash = DID_CORE_MOD.get_tree_hash()
solution = Program.to(
[
did... |
from django.urls import path
from . import views
from django.views.decorators.cache import cache_page
urlpatterns = [
path('register/',
views.StudentRegistrationView.as_view(),
name='student_registration'),
path('enroll-course/',
... |
from source.evaluation.top_k import *
from source.evaluation.classification import * |
import logging
from client import Submission, run_submission
from settings import CELERY_QUEUE, CELERY_CONCURRENCY
from tasks import app
logging.basicConfig(level=logging.DEBUG)
def start_sandbox():
s = Submission(sid=233,
task_url="file:///home/leo/Documents/fyp/aivle-worker/examples/aivle-s... |
from os import symlink, path, access, X_OK
from collections import namedtuple
import pytest
from leapp.libraries.actor import workaround
from leapp.libraries.common.utils import makedirs
SysVersionInfo = namedtuple('version_info', ['major', 'minor', 'micro', 'releaselevel', 'serial'])
def fake_symlink(basedir):
... |
#!/usr/bin/env python
from distutils.core import setup
setup (name = "nouvelle",
version = "pre-0.10",
description = "A very simple but effective pure-python web framework",
maintainer = "Micah Dowty",
maintainer_email = "micah@picogui.org",
license = "LGPL",
packages = ['Nouve... |
#!/usr/bin/python3
import datetime
import cv2
import argparse
import sys, os
"""Function to parse the following arguments:
1: Verbose mode (-v or --verbose), Run in verbose mode.
2: Input image file path (-i or --image), Path to the original image.
3: Output image file path (-o or --output), Path to the ne... |
from webtest import TestApp
from mailchute.api.app import app
app = TestApp(app)
def assert_correct_cors_headers(route):
response = app.options(route, status=200)
assert response.body == b'{}'
assert response.headers['Access-Control-Allow-Headers'] == \
'Origin, Accept, Content-Type, X-Requested... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
def Merge(A, left, mid, right):
L = A[left:mid]
R = A[mid:right]
L.append(None)
R.append(None)
item_L = L.pop(0)
item_R = R.pop(0)
global cmp_count
for i in range(left, right):
cmp_count += 1
if item_L == None:
A[i]... |
#!/usr/bin/env python2.7
# -*- coding: utf-8-unix; mode: python; -*-
##################################################################
# Imports
from __future__ import print_function, unicode_literals
from merge_conll_mmax import WSPAN_PREFIX_RE
from measure_corpus_agreement import BINARY_OVERLAP, PROPORTIONAL_OVERL... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Date : Nov-16-20 21:33
# @Author : Kelly Hwong (dianhuangkan@gmail.com)
# @Link : http://example.org
import os
def plot_PCA(components_train_bad, components_train_good)():
import matplotlib.pyplot as plt
plt.scatter(components_train_bad[:, 0... |
#!/usr/bin/env python
import roslib; roslib.load_manifest('simple_ur_driver')
import rospy
# QT
from qt_gui.plugin import Plugin
from PyQt4 import QtGui, QtCore, uic
from PyQt4.QtGui import *
from PyQt4.QtCore import *
# Other
import actionlib
from std_msgs.msg import *
from control_msgs.msg import *
from trajectory_ms... |
RAM AT BEGINNING: 0.22371673583984375
Latent replay turned on
CUDA is used
RAM BEFORE LOADING DATA: 0.22826385498046875
Preparing the data...
SPLIT RATIO: [50000, 10000]
--> mnist: 'train'-dataset consisting of 60000 samples
--> mnist: 'test'-dataset consisting of 10000 samples
RAM AFTER LOADING DATA: 0.289363861083... |
import unittest
from gwf_utilization.accounting import Job, get_jobs, get_jobs_from_string, _seconds
class TestAccounting(unittest.TestCase):
def test_seconds(self):
self.assertEqual(_seconds('05'), 5)
self.assertEqual(_seconds('05.123'), 5)
self.assertEqual(_seconds('02:11'), 131)
... |
"""Defines utility classes and functions used by the acquisition module."""
import multiprocessing
import threading
import numpy as np
def mock_data(n_records: int, n_cols: int, low: int = -1000, high: int = 1000):
"""Generator for mock data that streams a finite number of
records.
Parameters:
------... |
"""Author: Brandon Trabucco, Copyright 2019"""
import tensorflow as tf
from mineral.relabelers.relabeler import Relabeler
def default_goal_assigner(goal, observation):
observation["goal"] = goal
return observation
class HindsightRelabeler(Relabeler):
def __init__(
self,
... |
from django.urls import include, path
from dashing.utils import router
from .views import MultipleDashboards
urlpatterns = [
path('dashboard/', include(router.urls)),
path('multiple_dashboards/', MultipleDashboards.as_view()),
]
|
from __future__ import absolute_import
from __future__ import division
import os
import os.path as osp
import numpy as np
import subprocess
import glob
import matplotlib as mpl
if os.environ.get('DISPLAY','') == '':
mpl.use('Agg')
from matplotlib.patches import Arc, Rectangle, ConnectionPatch
from matplotlib import... |
"""
"""
from wheezy.http import (
HTTPResponse,
WSGIApplication,
bad_request,
bootstrap_http_defaults,
not_found,
)
def welcome(request):
response = HTTPResponse()
response.write(
"""
<html>
<head>
<script src="//code.jquery.com/jquery-1.11.2.min.js" type="text/javascript">
</scri... |
from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls import url
from .import views
urlpatterns = [
url('^$', views.index, name = 'Home'),
url(r'^photo/(\d+)',views.photo, name = 'photo'),
url(r'^tag/(\d+)',views.tags, name = 'tag'),
url(r'^search/',views.search_resu... |
from app.core.schema.jwt import Secret
from app.core.schema.message import Message
from app.core.utils.auth import auth
from app.crud.seller import authenticate_seller
from app.db.database import get_db
from fastapi import APIRouter, Depends, HTTPException, status
from fastapi.security import OAuth2PasswordRequestForm
... |
from configparser import ConfigParser
from datetime import datetime
from decimal import Decimal
import paho.mqtt.client as mqtt
from mqtt.MQTTConfig import MQTTConfig
# see https://learn.adafruit.com/adafruit-bme280-humidity-barometric-pressure-temperature-sensor-breakout/python-circuitpython-test
import board
import... |
import torch
import torch.nn as nn
from tqdm import tqdm
from utils import categorical_accuracy
def loss_fn(outputs, targets):
return nn.CrossEntropyLoss()(outputs, targets)
def train_fn(data_loader, model, optimizer, device, scheduler):
model.train()
train_loss, train_acc = 0.0, 0.0
for bi, d in t... |
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(
description="Start the comparison in Speechcommand"
)
parser.add_argument(
"--num_parts",
nargs="?",
type=int,
default=1,
help="Determines in how many parts the hyperparamters a... |
import json
import os
from pathlib import Path
from typing import Optional
from unittest.mock import patch, Mock, PropertyMock
import pytest
from confident import BaseConfig
from confident.loaders.source_loader_base import SourceLoader
from confident.utils import get_class_file_path
from tests.conftest import validat... |
from torch import nn
from torch.optim import Adam
from mask_generators import ImageMaskGenerator, DropoutMaskGenerator,DropoutUniformGenerator
from nn_utils import ResBlock, MemoryLayer, SkipConnection
from prob_utils import normal_parse_params, GaussianLoss
# sampler from the model generative distribution
# here we... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-03-11 14:35
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('photos', '0001_initial'),
]
operations = [
migrations.AlterField(
... |
import os
import sys
import uuid
from contextlib import contextmanager
@contextmanager
def temp_file_on_s3(local_path, bucket, key=None, verbose=False):
"""
Copy the given path to S3. Delete the object from S3 when the block
exits.
"""
import boto3
def pif(x):
if verbose:
... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""Test for Zoneout."""
import importlib
import pytest
import torch
def make_args(**kwargs):
args = dict(
zoneout_prob_h=0,
zoneout_prob_c=0,
)
args.update(kwargs)
return args
@pytest.mark.parametrize(
"rnn_type, args",
[
... |
import pandas as pd
from ..player import Player, PANDAS_PLAYER_CONVERSION_MAP, \
PLAYER_PANDAS_CONVERSION_MAP
from ...utils.data_loader import PLAYERS
pandas_player = PLAYERS[PLAYERS["player_id"] == 6419].iloc[0]
def test_from_to_pandas():
player = Player._from_pandas(pandas_player)
assert isinstance(p... |
import datetime
import os
import time
import jinja2
from dyson.tests import Test
class Report:
def __init__(self):
self._tests = list()
def render(self):
"""
Render a report
:return:
"""
template = """
<html>Hi there</html>
"""
# firs... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 14 13:19:16 2020
Updated on Thu Feb 20
@author: Anne S. Warlaumont
"""
import relabel, csv, fileinput
# Get the user to enter their ID
# so we can look up what they should be listening to
# and where their judgments should be written
userID = inpu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013-2020 European Commission (JRC);
# Licensed under the EUPL (the 'Licence');
# You may not use this work except in compliance with the Licence.
# You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
"""
Calculate/Validate *n_min_drive* pa... |
from setuptools import setup
def readme():
with open('README.md') as f:
README = f.read()
return README
setup(
name="fastai_ml",
version="1.0.0",
description="A Python package to get helper functions for ML while using latest fastai.",
long_description=readme(),
long_description_c... |
"""
normalization of the signals
"""
from typing import NoReturn, Any, Union, Tuple, List
from numbers import Real
import numpy as np
from .base import PreProcessor
from ..utils.utils_signal import normalize
__all__ = [
"Normalize",
"MinMaxNormalize",
"NaiveNormalize",
"ZScoreNormalize",
]
class ... |
print("hello")
#lambda for multiple arguments
x = lambda a,b: a+b
print(x(5,60))
def f1(n):
return lambda a:a*n
double= f1(2)
triple=f1(3)
print(double(11))
print(triple(11))
#Filter function
def prime(x):
for n in range(2,x):
if x%n == 0:
return False
else:
return Tru... |
from os.path import dirname, abspath, join
import sys
class GameObject:
def __init__(self, piece, colour, column, row, value):
self.row, self.value, self.piece, self.InCheck = row, value, piece, False
self.colour, self.column, self.possible_moves = colour, column, []
base_path = getattr(sy... |
""" compare light curves to PTF12gzk """
import numpy as np
import matplotlib.pyplot as plt
plt.rc("font", family="serif")
plt.rc("text", usetex=True)
from astropy.table import Table
from astropy.cosmology import Planck15
DIST = Planck15.luminosity_distance(z=0.0137).cgs.value
def optical():
# PTF12gzk
dat... |
from .metadata import __version__
from .cli import run
__all__ = ['__version__', 'run', ]
|
#!/usr/bin/env python
import os
import os.path as osp
import gc
import time
from mpi4py import MPI
import matplotlib.pyplot as plt
import pprint
import argparse
import sys
import pickle
import pyathena as pa
from pyathena.util.split_container import split_container
from pyathena.plt_tools.make_movie import make_movie... |
#!/usr/bin/env python
import os
import sys
import gzip
import time
import string
from distutils.spawn import find_executable
from distutils.version import LooseVersion
#################### Check Python version and modules ####################
if sys.version_info < (2,7,0):
sys.stderr.write("You need python 2.7 or lat... |
# Generated by Django 2.2.3 on 2019-07-16 03:06
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profile', '0024_student_products'),
]
operations = [
migrations.RemoveField(
model_name='produc... |
import argparse
from utils.data_loader import DataLoader
from algorithms.OFDClean import OFDClean
if __name__ == '__main__':
threshold = 20
sense_dir = ['sense2/', 'sense4/', 'sense6/', 'sense8/', 'sense10/']
sense_path = 'clinical' # sense_dir[1]
err_data_path = ['data_err3', 'data_err6', 'data_er... |
from flask import render_template, url_for, flash, redirect, request
from flaskblog import app, db, bcrypt
from flaskblog.forms import RegistrationForm, LoginForm, HashtagtForm
from flaskblog.models import User
from flask_login import login_user, current_user, logout_user, login_required
from flaskblog.sentiment import... |
import pytest
from steerage import base
def test_it_should_not_instantiate_document_storage():
with pytest.raises(TypeError):
base.DocumentStorage()
|
'''
Description:
On an infinite plane, a robot initially stands at (0, 0) and faces north. The robot can receive one of three instructions:
"G": go straight 1 unit;
"L": turn 90 degrees to the left;
"R": turn 90 degress to the right.
The robot performs the instructions given in order, and repeats them forever.
Ret... |
from alldigitalradio.io.xilinx_gtp import XilinxGTPSerdes
from nmigen.build import Resource, Pins, Attrs
def load():
from boards.trenz import TE0714
TE0714.resources += [
Resource("clk_n", 0, Pins("B5", dir="i"), Attrs(IOSTANDARD="LVDS_25")),
Resource("clk_p", 0, Pins("B6", dir="i"), Attrs(IOS... |
from setuptools import setup
setup(
name="cmsc-210",
version="1.0.0",
url="https://github.com/mazelife/cmsc-210",
author="James Stevenson",
author_email="author@gmail.com",
description="All code written in CMSC-210",
packages=["cmsc210"],
install_requires=["click == 8.0.4"],
)
|
#!/usr/bin/env python
# coding: utf-8
''' Dojo: Controle de Malha Fechada da Tartaruga
Bem vindos ao dojo de programação ROS-Works.
Objetivo:
Desenvolver algoritimos de controle de malha fechada no ambiente Turtlesim.
Materiais:
Este é o código fonte principal com que vocês devem trabalhar.
Como ponto de... |
input()
print(input()) |
# Copyright 1999-2017 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as readme_file:
readme = readme_file.read()
with open(path.join(here, 'VERSION'), encoding='utf-8') as version_file:
version = version_file.r... |
"""
Django settings for django_react project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build p... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv
import logging
import pprint
from gt import database_utils
logger = logging.getLogger(__name__)
def load_team_from_csv(db, csv_file):
team_info = dict()
with open(csv_file) as csvfile:
rows = csv.DictReader(csvfile)
for row in rows:
... |
import random
from typing import List
from typing import Optional
from typing import Union
import numpy as np
from torchvideo.samplers import FrameSampler
class RandomSampler(FrameSampler):
def __init__(self, frame_count: int, snippet_length: int, test: bool = False):
self.frame_count = frame_count
... |
# Unless explicitly stated otherwise all files in this repository are licensed under the the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2021 Datadog, Inc.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.