content stringlengths 5 1.05M |
|---|
#!/usr/bin/python
# @copyright Copyright 2019 United States Government as represented by the Administrator of the
# National Aeronautics and Space Administration. All Rights Reserved.
#
# @revs_title
# @revs_begin
# @rev_entry(Jason Harvey, CACI, GUNNS, March 2019, --, Initial implementation.}
# @revs_end
#... |
#!/usr/bin/env python
# Copyright 2014 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 ... |
import json
def parse(filename):
"""
Creates a json object from a file
Args:
filename: the path to the file
Returns:
a json object
"""
with open(filename, 'r') as f:
data = json.load(f)
return data
|
#!/usr/bin/python3.5
# -*- coding: utf-8 -*-
if __name__ == "__main__":
from constantes import famosos
print(famosos)
|
import pygame, sys, random, classes
pygame.mixer.init()
def process(player, FPS, total_frames, SCREENWIDTH):
velocity = 10
bullet_sound = pygame.mixer.Sound("audio/bullet.wav")
bullet_sound.set_volume(0.3)
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit(... |
from collections import deque
import logging
# Project imports
from utils import pipeline_logging
LOGGER = logging.getLogger(__name__)
pipeline_logging.configure(logging.INFO, add_console_handler=True)
RDR_SEX = 'rdr_sex'
EHR_SEX = 'ehr_sex'
MATCH_STATUS = 'match_status'
MATCH = 'match'
NO_MATCH = 'no_match'
MISSING... |
# Copyright Amazon.com, Inc. or its affiliates. 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... |
from datetime import date, datetime
weekdays_en = {0:"mon", 1:"tue", 2:"wen", 3:"thu", 4:"fri"}
weekdays_kr = {0:"월", 1:"화", 2:"수", 3:"목", 4:"금"}
def now_weekday(kr=False):
return weekdays_en[datetime.now().weekday()] if not kr else weekdays_kr[datetime.now().weekday()]
def get_date_string():
now = datetime... |
"""
Django settings for estore project.
Generated by 'django-admin startproject' using Django 2.1.3.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
i... |
from flask import g
from datetime import datetime, timedelta
from ..common.db_connect import sql_command, sql_select
def add_rental(new_rental):
'''Add a row to the rentals table using the given information and add a row to the inventory_rentals for each inventory item
Args:
new_rental: PaymentInfo ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from interface import EosMaterial
from evtk.hl import gridToVTK
import numpy as np
from numpy.testing import assert_allclose
def _3d_reshape(arr):
return arr.reshape(arr.shape+(1,))
def save_eostab_to_vtk(eosmat, filename):
for view in ['DT']:
for spec in ['e'... |
# -*- coding: utf-8 -*-
import pytest
from docopt import DocoptExit
def test_help_run():
from folklore_cli.cmds.help import run
cmd = run(['serve'])
assert cmd == 'serve'
def test_validation():
from folklore_cli.cmds.help import run
with pytest.raises(DocoptExit) as e:
run([])
asse... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-03-28 12:23
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('filter', '0016_auto_20180328_0759'),
]
operations = [
migrations.AlterModelOptions(... |
import datetime
import requests
from dataclasses import dataclass
from typing import Optional
from TemporaryStorage.providers import Provider, File, HostedFile
@dataclass
class ProviderInstance(Provider):
def __provider_init__(self):
self.provider = 'x0.at'
self.max_file_size = 1024
self.... |
import os
import pytest
directory = os.path.dirname(__file__)
@pytest.fixture
def http_mock(requests_mock):
text = open(os.path.join(directory, "data/conference_6.json")).read()
requests_mock.get("http://statsapi.web.nhl.com/api/v1/conferences/6", text=text)
text = open(os.path.join(directory, "data/divi... |
from __future__ import unicode_literals
from frappe import _
import frappe
from frappe.model.document import Document
from datetime import date
from frappe import _
from six import string_types
from frappe.utils import date_diff
from frappe.core.doctype.communication.email import make
class EmployeeSkillMap(Document):... |
###########################################################################
# Imports
###########################################################################
# Standard library imports
import os
# Local imports
from code.__init__ import print_hello_world
##########################################################... |
import sys
import time
class Logger:
def __init__(self, logfile):
self.logfile = logfile
def message(self, s):
lt = time.gmtime()
s = "{0:02d}.{1:02d}.{2:04d} {3:02d}:{4:02d}:{5:02d} UTC: {6}\n".format(lt.tm_mday, lt.tm_mon, lt.tm_year,
... |
#!/usr/bin/env python
"""
Code to load the policy learned from imitation learning and calculate reward
Example usage:
python3 run_imitation.py Humanoid-v2-epoch30 Humanoid-v2 --render \
--num_rollouts 20
Author of this script and included expert policies: Jonathan Ho (hoj@openai.com)
"""
import os
im... |
from os import system
import psycopg2
from operation.connector import conn
from operation.validation.userValidation import (
employeeNameValidation as employee_name_validation)
from statement.sqlmainstatement import get_delete_data_statement
def delete_data(employee_name):
try:
connect = conn()
... |
from region import *
class PseudoRegion(Region):
"""
PseudoRegion commands include: APERTURE, CUTV, DENP, DENS, DISP, DUMMY, DVAR, EDGE, GRID
OUTPUT, REFP, REF2, RESET, RKICK, ROTATE, TAPER, TILT, TRANSPORT, BACKGROUND, BFIELD, ENDB, ! or &
"""
def __init__(self, **kwargs):
pass
def... |
## tensor-based operations examples
from py3plex.core import multinet
from py3plex.core import random_generators
## initiate an instance of a random graph
ER_multilayer = random_generators.random_multilayer_ER(500,8,0.05,directed=False)
## some simple visualization
visualization_params = {"display":True}
ER_multilay... |
"""Add support for Django 1.4+ safe datetimes.
https://docs.djangoproject.com/en/1.4/topics/i18n/timezones/
"""
# TODO: the whole file seems to be not needed anymore, since Django has this tooling built-in
from datetime import datetime
try:
from django.conf import settings
from django.utils.timezone import n... |
from randluck.strategies import lucky_num
def test_get_lucky_num_from_birth_year():
birth_year = 1997
num = lucky_num.get_lucky_num_from_birth_year(birth_year)
assert num == 5430
|
import disnake as discord
from disnake.ext import commands
from datetime import datetime
from api.server import base, main
class OnMessagEdit(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_message_edit(self, before, after):
if base.gu... |
"""In this file, we define cascada's variable management system"""
from typing import Any, Union
import vartypes as vt
class CscType():
"""A generic cascada type"""
def __init__(self, nom, constructeur):
self.nom = nom
self.constructeur = constructeur
def __call__(self, *args, **kwargs... |
from cardiogrammer import create_app
app = create_app('production') |
# -*- coding: utf-8 -*-
"""
Created on Fri May 15 01:55:22 2020
@author: balajiramesh
"""
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 10 00:25:12 2020
@author: balajiramesh
Raw : 16,319230 2,641562
Within study timeline: 14393806 2247749
Within study area and timeline: 7892752 1246896
AFter removing washout pe... |
import os
import time
import numpy as np
import scipy.io as scio
import os.path as osp
from functools import partial
from .misc import img_exts, prog_map
from ..imagesize import imsize
def load_synthtext(img_dir, ann_dir=None, classes=None, nproc=10, box_key='wordBB'):
if classes is not None:
print('load... |
import RPi.GPIO as GPIO
import time
def main():
GPIO.setmode(GPIO.BCM)
GPIO.setup(21, GPIO.OUT)
while True:
GPIO.output(21, GPIO.HIGH)
time.sleep(1)
print('ON')
GPIO.output(21, GPIO.LOW)
time.sleep(1)
print('OFF')
try:
main()
except KeyboardInterrupt:
... |
# -*- coding: utf-8 -*-
import hashlib
import time
import inflection
from ...exceptions.orm import ModelNotFound
from ...query.expression import QueryExpression
from ..collection import Collection
import orator.orm.model
from .relation import Relation
from .result import Result
class BelongsToMany(Relation):
_t... |
import pandas as pd
import numpy as np
import stat_tools as st
import matplotlib.pyplot as plt
import datetime as dt
import os, glob
GHI_path2 = '~/ldata/GHI2/'
GHI_path = '~/ldata/GHI/'
sensors = np.arange(1,11)
for sensor in sensors:
with np.load(GHI_path2+'GHI_'+str(sensor)+'.npz') as data:
ty, y = dat... |
# Copyright 2019 StreamSets Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
# Generated by Django 3.2 on 2021-05-03 17:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('WalletTransition', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='transition',
name='Done',
... |
#!/usr/bin/env python3
import os
import sys
import argparse
import pkgutil
from importlib import import_module
import robosat_pink.tools
def main():
parser = argparse.ArgumentParser(prog="./rsp")
subparser = parser.add_subparsers(title="RoboSat.pink tools", metavar="")
try:
module = import_mod... |
"""
Coding - Decoding simulation of an image
========================================
This example shows a simulation of the transmission of an image as a
binary message through a gaussian white noise channel with an LDPC coding and
decoding system.
"""
# Author: Hicham Janati (hicham.janati@inria.fr)
#
# License: B... |
#! /usr/bin/python3
"""A helper program to test cartesian goals for the JACO and MICO arms."""
import roslib; roslib.load_manifest('kinova_arm')
import rospy
import numpy as np
import actionlib
import kinova_msgs.msg
import std_msgs.msg
from sensor_msgs.msg import JointState
import geometry_msgs.msg
import sys
imp... |
from pytest import fixture
from starlette.status import (
HTTP_200_OK,
HTTP_204_NO_CONTENT,
HTTP_401_UNAUTHORIZED,
HTTP_404_NOT_FOUND,
HTTP_409_CONFLICT,
)
from app.core.schemas import AccessTokenPayload, UserRead
user_dict = {"email": "email@domain.com"}
update_payload = {"email": "new@email.com"... |
def setup():
size(600, 500)
smooth()
background(255)
strokeWeight(30)
noLoop()
def draw():
stroke(20, 100)
i = range(1, 8)
for i in range(1, 5):
line(i*2*50, 200, 150 + (2*i-1)*50, 300)
line(i*2*50 + 100, 200, 50 + (2*i-1)*50, 300)
|
import matplotlib.pyplot as plt
import math
distance = 100
def draw_robot(robot, error):
line_length = 2
o = math.sin(robot.theta) * line_length + robot.y
a = math.cos(robot.theta) * line_length + robot.x
if error:
plt.plot([robot.x], [robot.y], 'ro', markersize=6)
else:
plt.plot(... |
import sublime, sublime_plugin
import time
import datetime
def log_error(ex, command):
error_msg = 'Error in ' + command + ': ' + str(ex)
print error_msg
sublime.status_message(error_msg)
class SubliMapCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.edit = edit
self.view... |
from envirophat import motion
from time import sleep
import pantilthat
import math
import pigpio
import keyboard
def track(init_heading, i, motor, prev):
acc = motion.accelerometer()
heading = (motion.heading() + i) % 360
# handle tilt
tilt = math.floor(90 * acc[0])
if tilt > 90:
tilt = 9... |
import pygame
from pygame.locals import *
from sgc.widgets._locals import *
from sgc.widgets.base_widget import Simple
class MyBasicWidget(Simple):
_default_size = (100,100)
class MyWidget(Simple):
_default_size = (100,100)
_available_images = ("over",)
_extra_images = {"thing": ((0.3, 0), (1, -4))}
... |
from typing import Union
__all__ = [
'num',
]
num = Union[int, float]
|
# coding=utf-8
import peewee as pw
import redis as redis_
from config import PG_HOST, PG_USER, PG_PWD
db = pw.PostgresqlDatabase('demo', **{'host': PG_HOST, 'user': PG_USER, 'password': PG_PWD})
redis = redis_.Redis()
|
#!/usr/bin/python3
import os
import sys
import operator
import numpy as np
"""
Script to collect f1 scores of different output files that are in the provided directory, the script conlleval.pl in the
output directory is used; the provided directory will afterwards contain a file named f1.scores, containing the sorted
... |
#!/usr/bin/env python
import importlib
import os
import sys
import copy
import numpy as np
from BaseDriver import LabberDriver
from sequence_builtin import CPMG, PulseTrain, Rabi, SpinLocking, iSWAP_Cplr
from sequence_rb import SingleQubit_RB, TwoQubit_RB
from sequence import SequenceToWaveforms
# dictionary with bu... |
"""
plotting utilities; best to import * to use utilities in this module for full functionality
"""
#####Imports#####
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.stats import linregress
import numpy as np
#####Defaults#####
mpl.rcParams['axes.formatter.useoffset'] = False
... |
"""
https://leetcode.com/problems/sort-array-by-parity/
Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the odd elements of A.
You may return any answer array that satisfies this condition.
Example 1:
Input: [3,1,2,4]
Output: [2,4,3,1]
The output... |
# Generated by Django 3.0.5 on 2020-06-10 04:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sg', '0004_auto_20200602_2018'),
]
operations = [
migrations.AddField(
model_name='writing',
name='category',
... |
# Copyright 2016 The TensorFlow 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 applica... |
###############################################################################################################
# DESAFIO: 014
# TÍTULO: Conversor de Temperaturas
# AULA: 07
# EXERCÍCIO: Escreva um programa qu converta uma temperatura digitada em ºC e converta para ºF.
###############################################... |
from flask import Blueprint, render_template, request, url_for, redirect
from cruddy.model import Events
from flask_login import login_required
from cruddy.query import *
app_events = Blueprint('events', __name__,
url_prefix='/events',
template_folder='templates/',
... |
# YouTube: https://youtu.be/27pMZOoPRzk
# Publicação: https://caffeinealgorithm.com/blog/20210924/if-elif-e-else-em-python/
'''
(if - se) condição for verdadeira:
o código dentro do if é executado
(elif - senão se) condição for verdadeira (só ocorre o elif caso a condição de if seja falsa):
o código... |
import pydash
class HookBootstrap():
def __init__(self, context):
self._iniitializers = {'battery':self._init_battery, 'location': self._init_location}
self._validators = {'battery': self._validate_battery, 'location': self._validate_location}
self._api_config = context.api_configuration
... |
import datetime
import time
class Time(object):
def __init__(self):
self.init_time = time.time()
self.cosmos_time = 0 # Cosmos time
self.microsecond = 0
self.second = 0
self.minute = 0
self.hour = 0
self.date = 0
self.month = 0
self.year =... |
class AriaException(Exception):
pass
class ProviderError(AriaException):
pass
class ProviderNotReady(ProviderError):
pass
class EmptyPlaylist(AriaException):
pass |
DEBUG = False
USERNAME = 'hikaru'
CHANNEL = 'random'
VOCAB = {
'RANDOM': ['random', ':troll:', ':trollface:'],
'PASS': ['pass', 'skip'],
'RESIGN': ['resign', 'give up'],
'VOTE': ['vote', 'move', 'play'],
'VOTES': ['votes', 'moves', 'voted', 'chance'],
'CAPTURES': ['captures'],
'SHOW': ['s... |
# 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... |
import shutil
from config import *
def clean_derived():
"""delete the derived files, leave the original movies"""
# TODO: add ENCODED_DIR to config.py
paths = [CLIP_DIR, IMG_DIR, RAW_AUDIO_DIR, AUDIO_DIR, ENCODE_DIR]
for derived_path in paths:
print("Deleting:", derived_path)
shutil.r... |
from easytello import tello
my_drone = tello.Tello()
#my_drone.streamon()
my_drone.takeoff()
for i in range(4):
#my_drone.forward(1)
my_drone.cw(90)
my_drone.land()
# my_drone.streamoff()
|
#!/usr/bin/env python3.9
# Copyright Pit Kleyersburg <pitkley@googlemail.com>
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modi... |
import random
import mock
import pytest
from statue.cache import Cache
from statue.commands_filter import CommandsFilter
from statue.commands_map_builder import CommandsMapBuilder
from statue.config.configuration import Configuration
from statue.context import Context
from statue.exceptions import CacheError, Command... |
import json
from types import SimpleNamespace
import relogic.utils.crash_on_ipy
from relogic.logickit.base.constants import MIXSENT_TASK
from relogic.logickit.dataflow import TASK_TO_DATAFLOW_CLASS_MAP, MixSentDataFlow
from relogic.logickit.tokenizer.tokenizer_roberta_xlm import RobertaXLMTokenizer
config = SimpleNam... |
import asyncio
import logging
from datetime import datetime
from discord.ext import commands
logger = logging.getLogger(__name__)
class Assign(commands.Cog):
"""A cog to assign specific roles."""
def __init__(self, bot):
self.bot = bot
@commands.command(name="assign")
async def assing_trus... |
from pipeline.logger import setup_logger
from pipeline.utils import load_config
from torch.utils.data import DataLoader
import argparse
import os
def main():
parser = argparse.ArgumentParser()
parser.add_argument("config_path")
args = parser.parse_args()
config = load_config(args.config_path)
... |
from app import db
from app.models.base_model import BaseEntity
category_page = db.Table(
'category_page',
db.Column('category_id', db.Integer, db.ForeignKey('category.id')),
db.Column('page_id', db.Integer, db.ForeignKey('page.id'))
)
# relationship required for adjacency list (self referencial many to ... |
import unittest
import os
from main import query, preprocess, matching_sim
class MainTesting(unittest.TestCase):
def query_test_nofile(self):
"""
Testing query method
"""
result = query("filename")
expected_result = []
self.assertEquals(len(expected_result), len(res... |
#faça um programa que leia um ano qualquer e mostre se ele é Bissexto
#minha resposta - nao consegui esta dando erro
#ano = int(input('Que ano quer analisar? Coloque 0 para analisar o ano atual:'))
#bissexto = ano % 4
#bissexto2 = ano % 100
#bissexto3 = ano % 400
#total = bissexto + bissexto2 + bissexto3
#if total == ... |
#!/usr/bin/env python3
import rospy
from nav_msgs.msg import Odometry
import rogata_library as rgt
import numpy as np
def odom_callback( odom, argv):
agent = argv[0]
rogata = argv[1]
pos = np.array([odom.pose.pose.position.x,
-odom.pose.pose.position.y])*100+np.array([500,500])
r... |
from gym.envs.registration import register
register(
id='correlatedbandit-v0',
entry_point='bandit_env.envs:CorrelatedBanditEnv',
max_episode_steps=100,
nondeterministic=True,
kwargs={'prob': 0.1}
) |
import logging
import kombu
from kombu import Connection, Producer, Exchange, Consumer
from mylogger import *
#from syslog_wrap import *
try:
import json
except:
import simplejson as json
import Queue
import threading
from statsd_operator import statsd_operator
#g_logger will be initlized in main thread
g_logge... |
import unittest
from eating_cookies import eating_cookies
class Test(unittest.TestCase):
def test_eating_cookies_small_n(self):
self.assertEqual(eating_cookies(0), 1)
self.assertEqual(eating_cookies(1), 1)
self.assertEqual(eating_cookies(2), 2)
self.assertEqual(eating_cookies(5), 13)
self.assert... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 License, or (at your option) any later version.
#
# This program is distrib... |
#! /usr/bin/env python
import time
import pyslet.odata2.csdl as edm
from pyslet.wsgi import WSGIDataApp
class MyApp(WSGIDataApp):
settings_file = 'samples/wsgi_data/settings.json'
def init_dispatcher(self):
super(MyApp, self).init_dispatcher()
self.set_method("/*", self.home)
def home... |
import tensorflow as tf
from tensorflow.python.keras import activations
from tensorflow.python.keras import backend as K
from tensorflow.python.keras import initializers, regularizers, constraints
from tensorflow.python.keras.backend import _preprocess_padding
from tensorflow.python.keras.layers import Conv2D, Add
from... |
EXTERNAL_API_URL = 'https://quoters.apps.pcfone.io/api/random'
# LocalHost
# POSTGRES_CONNECTION_STRING = 'postgresql://postgres:postgres@localhost/postgres'
# Docker
POSTGRES_CONNECTION_STRING = 'postgresql://postgres:postgres@postgres_database/postgres'
SQL_SERVER_CONNECTION_STRING_TEMPLATE = f'''
DRIVER={{ODBC Dr... |
#!/usr/bin/env python
# coding=utf-8
from __future__ import division, print_function, unicode_literals
import numpy as np
from brainstorm.handlers.base_handler import Handler
# ############################## Debug Array ################################ #
class DebugArray(object):
def __init__(self, arr):
... |
import scrapy
class ImageItem(scrapy.Item):
image_urls = scrapy.Field()
images = scrapy.Field()
# image_urls和images是固定的
|
x, y = 0, 1
while x < 1000:
print(x)
xnew = y
ynew = x+y
x = xnew
y = ynew
|
#!/usr/bin/env python
# coding: utf-8
# Designed by ARH.
# ticker = 'BBVA';
import os, sys
from urllib.request import urlopen, Request
from bs4 import BeautifulSoup
ticker = sys.argv[1]
print('****************************')
print('* Reading ticker: {0}.'.format(ticker))
# We define the global url from investing equ... |
# -*- coding: utf-8 -*-
# OpenTsiolkovskyから出力される.csvファイルに情報を追加する
# 特にIIPやアンテナ関係の値を出力
# outputフォルダの中にあるcsvファイルを読み込んで、extend.csvとして出力
# ****使い方****
# python extend_output.py (input_json_file)
#
# IIPの分散円の半径は、その時点でのロケットが推力をもって真横に加速された
# として、カットオフ時間までに増速される量を加算してIIPの移動距離から算出。
#
# ライブラリにpyprojを用いているために先にpyprojをインストールのこと。
# ... |
""" Searches using MCMC-based methods """
import sys
import os
import copy
import logging
from collections import OrderedDict
import subprocess
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from ptemcee import Sampler as PTSampler
import corner
import dill as pickle
import pyfstat.core as cor... |
# Copyright 2021 Collate
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 19 18:39:22 2018
@author: Paulo Andrade
"""
class LinearRegression:
def __init__ (self, x, t):
"""
Constructor de la clase
"""
self.x = x # valores de X
self.t = t # valores de t
self.n =... |
from app.models.db.account import Account
from app.models.db.role import Role
from app.models.db.policy import Policy
from app.models.db.user import User
from datetime import datetime
from unittest import TestCase
from unittest.mock import patch
test_account_object = {
"uuid" : "1234567890",
"foreign... |
import os
top_dir = './caffe'
f = open('files.txt','a+')
d = open('directories.txt','a+')
def os_list_dir(top_dir,d,f):
for file in os.listdir(top_dir):
file_path = os.path.abspath(os.path.join(top_dir, file))
if os.path.isfile(file_path):
if file_path[-3:] != 'mat' and file_path[-3:] != '.so' and... |
import numpy as np
import torch
import torch.nn as nn
import torch_scatter
from .. import backbones_2d
from ..model_utils.misc import bilinear_interpolate_torch
from ..model_utils.weight_init import *
class HH3DVFE(nn.Module):
def __init__(self, model_cfg, num_point_features, voxel_size=None, point_cloud_range=... |
from math import *
import json
waypoint_file = open('FlyMission.json','r+')
plan = json.load(waypoint_file)
print(plan)
waypoint_list = plan[0]['mission_waypoints']
obstacle_file = open('Obstacles.json','r')
obstacle_list = json.load(obstacle_file)['stationary_obstacles']
obstacle_file.close()
class Point:
... |
from setuptools import setup, find_packages
from distutils.extension import Extension
try:
from Cython.Distutils import build_ext
except ImportError:
use_cython = False
else:
use_cython = True
cmdclass = {}
ext_modules = []
if use_cython:
ext_modules.append(Extension("pydepta.trees_cython", ['pydepta/... |
# -*- coding: utf-8 -*-
"""
pytests for resource handlers
"""
import h5py
import numpy as np
import os
import pytest
from rex import TESTDATADIR
from rex.renewable_resource import NSRDB
def get_baseline(path, dset, ds_slice):
"""
Extract baseline data
"""
with h5py.File(path, mode='r') as f:
... |
import sys
def input():
return sys.stdin.readline()[:-1]
N = int(input())
plus = []
minus = []
for _ in range(N):
x, y = map(int, input().split())
plus.append(x+y)
minus.append(x-y)
print(max(max(plus)-min(plus), max(minus)-min(minus)))
|
# -*- coding: utf-8 -*-
"""Base Sender, father of all other providers"""
import random
import threading
import time
from .template_parser import TemplateParser
class BaseSender(threading.Thread):
"""Base provider main class"""
template = None
freq = None
prob = 100
generator = None
def __init... |
# RUN: %PYTHON %s 2>&1 | FileCheck %s
# This file contains small benchmarks with reasonably-sized problem/tiling sizes
# and codegen options.
from ..core.experts import *
from ..core.harness import *
from ..core.transforms import *
from ..core.utils import *
from .definitions import CopyProblem
from typing import L... |
from django.shortcuts import render, get_object_or_404, redirect
from django.contrib import messages
from django.core.mail import send_mail, EmailMessage
from profiles.models import User
from .models import Internship, Application
from .forms import CreateInternshipForm, ApplyToInternshipForm
from teacher.views import... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
# Copyright (c) 2012-2022, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
from . import AWSObject, AWSProperty, PropsDictType
class SnsChannelConfig(AWSProperty):
"""
`SnsChannelConfig <http://docs.aws.amazon.com... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\relationships\relationship_bit_add.py
# Compiled at: 2020-06-09 03:31:35
# Size of source mod 2**32:... |
from tinkoff_voicekit_client.STT.client_stt import ClientSTT
from tinkoff_voicekit_client.TTS.client_tts import ClientTTS
from tinkoff_voicekit_client.Operations import ClientOperations
from tinkoff_voicekit_client.uploader import Uploader
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.