content stringlengths 5 1.05M |
|---|
import os
from distutils.sysconfig import get_python_lib
# For gfortran+msvc combination, extra shared libraries may exist (stored by numpy.distutils)
if os.name == 'nt':
HAS_DLL = False
extra_dll_dir = os.path.join(get_python_lib(), 'ace_cream', '.libs')
if os.path.isdir(extra_dll_dir):
HAS_DLL = T... |
"""
Module for plotting MCMC results.
"""
import os
import warnings
from typing import List, Optional, Tuple, Union
import h5py
import corner
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from typeguard import typechecked
from matplotlib.ticker import ScalarFormatter
from scipy.interpo... |
from django.forms.models import ModelForm
from .models import (Menu,)
|
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-28 21:01
from __future__ import unicode_literals
from django.db import migrations, models
import tinymce.models
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.C... |
"""Support for the Mopar vehicle sensor platform."""
from homeassistant.components.mopar import (
ATTR_VEHICLE_INDEX,
DATA_UPDATED,
DOMAIN as MOPAR_DOMAIN,
)
from homeassistant.const import ATTR_ATTRIBUTION, LENGTH_KILOMETERS
from homeassistant.core import callback
from homeassistant.helpers.dispatcher impo... |
from pydesim.constants import INF
import matplotlib.pyplot as plt
from pydesim import Simulation, INF
from pysnn.nu import v2
from pysnn import Ports
from generator import Generator
weights = []
times = []
def extt(model, message):
weights.append(model.w)
times.append(message.time)
def intt(model, args, outpu... |
from __future__ import absolute_import
from dictshield.fields import BaseField
class ListField(BaseField):
def __init__(self, field, **kwargs):
self.field = field
kwargs.setdefault('default', list)
super(ListField, self).__init__(**kwargs)
def to_python(self, value):
return ... |
import sys
import io
import time
import pprint
input_txt = """
6
2 1
2 2
4 2
6 2
3 3
5 4
2
2 4 0 4
4 10 2 5
"""
#sys.stdin = io.StringIO(input_txt); tmp = input()
sys.stdin = open("DSL_1_A_in14.txt")
#sys.stdout = open("out.dat","w")
start = time.time()
# copy the below part and paste to the sub... |
# KineticAnalysis/Constants.py
# =========
# Constants
# =========
# Universal gas constant (R; J K^-1 mol^-1).
UniversalGasConstant = 8.3145;
|
import numpy
import os
from pylab import plot, show, bar
from sklearn import svm
from sklearn.datasets import make_multilabel_classification
from sklearn.multiclass import OneVsRestClassifier
from sklearn.model_selection import GridSearchCV
from sklearn import preprocessing
from sklearn.ensemble import RandomForestCl... |
from pathlib import Path
from texttaglib.elan import open_eaf
TRANSCRIPT_FOLDER = 'data/transcript/'
csv_data = []
for child_file in Path(TRANSCRIPT_FOLDER).iterdir():
if child_file.suffix.endswith('.eaf'):
print(child_file.name)
c = 0
elan2 = open_eaf(child_file)
for tier in elan2... |
#!/usr/bin/env python
# emrun: Implements machinery that allows running a .html page as if it was a standard executable file.
# Usage: emrun <options> filename.html <args to program>
# See emrun --help for more information
from __future__ import print_function
import os, platform, argparse, logging, re, pprint, atexi... |
import json
from jwt_encoder import sign_with_hs256
def signature_is_valid(header: dict, payload: dict, signature: bytes, secret: str) -> bool:
is_valid = False
try:
algorithm = _get_algo(header)
if algorithm is 'HS256':
expected_signature = sign_with_hs256(header, payload, secret... |
from flask import Blueprint, Response, render_template, flash, redirect, session, url_for, request, g
from app import app, db
from app.agents.forms import RegisterAgentForm
from app.agents.models import Agent
mod = Blueprint('agents', __name__)
@mod.route('/agents/', methods=('GET', 'POST'))
def agents_view():
... |
__version__ = "0.1.0.dev0"
from . import register
from .transpile import transpile
__all__ = ["register", "transpile"]
|
try:
import IPython
from IPython.html import widgets
from IPython.core import display
from IPython.utils.traitlets import Unicode, Integer, Float
import json
from numpy.random import seed
import time
from .backends.base import MultiTrace
from .sampling import _iter_sample
except Impo... |
# DEFININAOD O CABEÇALHO
print("\033[1:35m-=-\033[m" * 13)
print("\033[1:31mCALCULE A SUA MÉDIA E OBTENHA SEU RESULTADO")
print("\033[1:35m-=-\033[m" * 13)
# INPUTS DAS NOTAS DOS ALUNOS
nota1 = float(input("Digite sua primeira nota: "))
nota2 = float(input("Digite sua segunda nota: "))
media = (nota1 + nota2) / 2
print... |
import SimpleITK as sitk
import itk
def itk_image_to_sitk_image(image):
origin = tuple(image.GetOrigin())
spacing = tuple(image.GetSpacing())
direction = itk.GetArrayFromMatrix(image.GetDirection()).flatten()
image = sitk.GetImageFromArray(
itk.GetArrayFromImage(image),
isVector=image.... |
# Standard library
import argparse
from typing import List, Optional
# Local
import dbtenv
from dbtenv import Args, Dbt, DbtenvError, Environment, Installer, Subcommand, Version
import dbtenv.homebrew
import dbtenv.pip
import dbtenv.version
logger = dbtenv.LOGGER
class WhichSubcommand(Subcommand):
"""
Show... |
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this... |
import os, json
files = json.loads( file( '.builds/current/compile_commands.json', 'r' ).read() )
flags = {}
for f in files:
flags[str( f['file'] )] = str( f['command'] ).split()
def FlagsForFile( filename, **kwargs ):
try:
result = flags[filename]
except:
# Try to find a file in the sam... |
from rest_framework.exceptions import PermissionDenied
from rest_framework.viewsets import ModelViewSet, ReadOnlyModelViewSet
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from rest_framework.decorators import action
from django.db.models import Q
from .models imp... |
# -*- coding: utf-8 -*-
"""decorators for api resources"""
from functools import wraps
from flask import current_app, _request_ctx_stack
from flask_principal import Identity, identity_changed
from flask_jwt import current_identity, _jwt_required
from webargs.flaskparser import use_args
from ..auth import (permissio... |
import functools
import inspect
import json
import os
import warnings
# State numbers:
#
# 0: `state` is None. The stream has no more elements. `step` can't be called.
#
# 1: `state` is a function. Calling `step` with a 2-tuple of positional and
# keyword arguments passes those arguments to the function, and th... |
# Dummy file required to make `python -m unittest` discover tests in this dir
|
#!flask/bin/python
from app import app
app.run(debug = False, ssl_context=('./ssl.crt', './ssl.key'))
|
import numpy as np
from scipy.sparse.linalg import eigsh
import imagehash
from PIL import Image
import os
def similarity_scc(contact_map_file1, contact_map_file2, TAD, output):
np.savetxt(os.path.join(output, 'TAD.tmp'), TAD)
print(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'similarity_scc.R'))... |
i = 100
num =1
while i != 0:
num *= i
i -= 1
num = str(num)
sum = 0
for x in num:
sum += int(x)
print(sum) |
from django.contrib import admin
from django.conf.urls.defaults import patterns, url
from django.db import transaction
from django.db.models.fields.related import RelatedField
from django.contrib.admin.actions import delete_selected
from django.utils import timezone
from .models import Game, CarouselItem, Channel, Cha... |
class Solution:
def numSquares(self, n: int) -> int:
|
"""
==========================================
TradeBots
Version: 0.0.1
Math Utility Functions
==========================================
Authors: Connor Sanders and Daniel Pivalizza
"""
import datetime
# Base Interval Mapping Dict
base_interval_scales_mapping = {
"seconds": 0,
"minutes": 60,
"hours": 3... |
# Generated by Django 2.2 on 2021-12-13 12:51
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("vacancy", "0001_initial"),
]
operations = [
migrations.AlterField(
model_name="resume",
... |
import sys
import argparse
from stm32_gfxmmu_tool.gfxmmu import *
from stm32_gfxmmu_tool.shape_round import *
from stm32_gfxmmu_tool.gen import *
def main():
parser = argparse.ArgumentParser()
parser.add_argument( "xsize", type=int, help="number of pixel in x direction")
parser.add_argument( "ysize", type... |
#!/bin/python
import unittest
from app import db
from app.home_module.models.user import User
class TestCase(unittest.TestCase):
def tearDown(self):
db.session.remove()
db.drop_all()
def test_insert(self):
u = User.create(name='john', email='john@example.com', password='john')
... |
#!/usr/bin/env python
# coding: utf-8
import torch
from transformers import T5Tokenizer, T5ForConditionalGeneration
from sentence_embeddings import SentenceEmbeddings
trained_model_path = 'ZhangCheng/T5-Base-Fine-Tuned-for-Question-Generation'
trained_tokenizer_path = 'ZhangCheng/T5-Base-Fine-Tuned-for-Question-Gene... |
from django.contrib import admin
from django.utils.html import format_html
from django.utils.translation import ugettext as _
from blog import models
class TagAndCategoryAdmin(admin.ModelAdmin):
prepopulated_fields = {'slug': ['name']}
search_fields = ['name', 'slug']
list_display = ['name', 'slug']
o... |
import datetime
from datetime import timedelta as timedelta
from math import floor
class TimeHelper:
def convert_timedelta_to_dictionary(self, time_period: timedelta):
# Convert days into years, months and days
years = floor(time_period.days / 365)
remaining_days = time_period.days % 36... |
# coding: utf-8
# Author: codeskyblue 2018-06-04
import argparse
import ctypes
import os
import pathlib
import sys
import tkinter as tk
import winreg
import apkutils
def _bind_apk_right_menu():
if not ctypes.windll.shell32.IsUserAnAdmin():
ctypes.windll.shell32.ShellExecuteW(
None, "runas", ... |
import logging
logging.basicConfig(format='%(message)s', level=logging.INFO)
logger = logging.getLogger(__package__)
|
import argparse
import sys
import numpy as np
import subprocess as sp
import cv2
from hand_tracker import HandTracker
def parse_args():
parser = argparse.ArgumentParser(
description='Dump weights from a Caffe model'
)
parser.add_argument(
'--video',
dest='video',
help='video... |
import torch
from torch import nn
from GlobalAttention import GlobalAttention
from torch.autograd import Variable
from Beam import Beam
from decoders import DecoderState, Prediction
class RegularDecoder(nn.Module):
def __init__(self, vocabs, opt):
super(RegularDecoder, self).__init__()
self.opt = opt
se... |
import threading
class StoppableThread(threading.Thread):
"""Thread with an event object to stop itself.
Args:
stop_event (threading.Event): Event that stops the thread if it is set.
*args, **kwargs: Forwarded to `threading.Thread`.
"""
def __init__(self, stop_event, *args, **kwargs)... |
"""
Crie um programa que leia nome, sexo e idade de várias pessoas, guardando os dados de cada pessoa em um dicionário e
todos os dicionários em uma lista. No final, mostre:
A) Quantas pessoas foram cadastradas
B) A média de idade
C) Uma lista com as mulheres
D) Uma lista de pessoas com idade acima da média
"""
... |
import logging
import os
from clickhouse_driver import Client, errors
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
CLICKHOUSE_URI = os.environ.get("CLICKHOUSE_URI", "clickhouse")
project_table = """\
CREATE TABLE project
(
created_time DateTime,
user_id Integer,
id Integ... |
import argparse
import os
import sys
import json
import time
from datetime import datetime
import logging
from functools import partial
import torch
import torch.distributed as dist
import torch.distributed.nn as distnn
from torch import nn, einsum
import torch.nn.functional as F
from torch.optim import Adam
import tor... |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import seaborn as sns
from scipy.spatial import distance
from scipy.spatial.distance import euclidean
from fastdtw import fastdtw
sns.set()
def plot_dtw_dist(x, y, figsize=(12, 12), annotation=True, col_map="P... |
# original ircbot code by TestRunner ( https://github.com/TestRunnerSRL )
# sporcle bot integration by TheOnlyOne ( https://github.com/LumenTheFairy/ )
from sporcle_classes import SporcleQuiz, SporcleDriver
# set up logging
import logging
FORMAT = "[%(levelname)s] %(asctime)-15s: %(message)s"
logging.basicConfig(form... |
# coding=utf-8
import pytest
import pygame
from pygame.locals import *
from pygame.event import Event
from GUI.base import *
from GUI.locals import *
@pytest.fixture
def widget():
return BaseWidget((100, 200), (50, 20))
@pytest.fixture
def widget2():
return BaseWidget((0, 0), (100, 100), TOPLEFT)
@pytes... |
import strings.message_strings as strings
import random
import argparse
import time
import re
import praw
from prawcore import NotFound
import requests
import yaml
import os
import logging
import google.cloud.logging
from google.cloud.logging.handlers import CloudLoggingHandler
import urllib.parse
from urllib.error imp... |
#
# @lc app=leetcode.cn id=401 lang=python3
#
# [401] 二进制手表
#
# https://leetcode-cn.com/problems/binary-watch/description/
#
# algorithms
# Easy (53.37%)
# Likes: 227
# Dislikes: 0
# Total Accepted: 23.9K
# Total Submissions: 44.7K
# Testcase Example: '0'
#
# 二进制手表顶部有 4 个 LED 代表 小时(0-11),底部的 6 个 LED 代表 分钟(0-59)。... |
# -*- coding: utf-8 -*-
#!/usr/bin/python3
import os, sys
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.dirname(CURRENT_DIR))
import getopt
import time
import random
import shutil
import tarfile
from urllib import request
from bs4 import BeautifulSoup
from common import common, db, co... |
import curses
import time
import sys
from model import CamConfig
class CursesUi(object):
def __init__(self):
self.camConfig = CamConfig()
self.selectedLine = 3
self.stdscr = None
def initCurses(self):
self.stdscr = curses.initscr()
curses.noecho()
curses.cbrea... |
from collections import defaultdict
from datetime import datetime
from typing import Dict, List, Union
from src.models import BarData, BarDatum, FullUserPackage
from src.utils import format_number
def get_bar_data(data: FullUserPackage) -> BarData:
months: Dict[int, Dict[str, int]] = defaultdict(
lambda:... |
import os
from yacs.config import CfgNode as CN
from .constants import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, DEFAULT_CROP_PCT
_C = CN()
_C.root_dir = os.getcwd() # root dir
_C.seed = -1.0 # random seed (default: 42)
_C.logger_name = 'log' ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from rdkit import DataStructs
import plugin_api
__license__ = "X11"
class LbvsEntry(plugin_api.PluginInterface):
"""
Compute Tanimoto similarity.
"""
def __init__(self):
self.stream = None
self.counter = 0
self.first_... |
def cylinder_volume(r, h):
h * <selection>PI * r ** 2</selection>
|
from Generator import Generator
class FileGenerator(Generator):
path = ''
_package = None
_imports = None
def __init__(self, path = '.'):
self.path = path
pass
def add_component(self, component):
self.components += component.build()
return self
def generate(se... |
from p5 import *
img = load_image('../wave-512.png')
def setup():
size(512, 512)
no_loop()
def draw():
image(img, (0, 0))
if __name__ == '__main__':
run()
|
from aiogram import types
kb_back_units = types.InlineKeyboardMarkup()
btn_back_units = types.InlineKeyboardButton(
text="назад", callback_data="back_units"
)
kb_back_units.add(btn_back_units) |
#!/usr/bin/env python
# coding=utf-8
import sys
def validate(data):
if 'username' in data and data['username'].startswith('_'):
raise ValueError('Username must not start with underscore')
if __name__ == '__main__':
username = sys.argv[0]
# username = '_name'
try:
validate({'username':... |
from unittest import TestCase
from wiggle_subsequence import Solution
class TestWiggleSubsequence(TestCase):
def test_when_already_wiggle_subsequence(self):
self.assertEqual(
5,
Solution().wiggleMaxLength([1, 3, 2, 4, 0])
)
def test_when_remove_some(self):
sel... |
import time
from oauthlib.oauth2 import BackendApplicationClient
from oauthlib.oauth2.rfc6749.errors import TokenExpiredError
from requests_oauthlib import OAuth2Session
from .credentials import Credentials
try:
from urllib import urlencode
except ImportError:
from urllib.parse import urlencode
PINGBOARD_OA... |
from tkinter import *
from PIL import ImageTk, Image
import subprocess
import pytesseract
from googletrans import Translator
import time
class ScreenTranslate:
def __init__(self, master):
self.master = master
master.title("Screen Translate")
self.lang_src = "chi_sim"
... |
from simian.scene.base_scene import BaseScene
from simian.input.keyboard_manager import Keyboard
from examples.template_player_object import Player
from simian.math.vector import Vec2
class TemplateScene(BaseScene):
def draw(self, graphics):
for game_object in self.game_objects:
game_object.d... |
# python3
from collections import namedtuple
from unittest import TestCase
test = namedtuple('test', 'expression expected')
def calculate(a: int, b: int, op: chr) -> int:
if op == '+':
return a + b
elif op == '-':
return a - b
elif op == '*':
return a * b
else:
assert ... |
#!/usr/bin/env python
import os
from pathlib import Path
import numpy as np
import neuropixels_data_sep_2020 as nd
import spikeextractors as se
# specify the ids of the recordings you want to download
sorting_ids = [
'cortexlab-single-phase-3:curated',
'cortexlab-single-phase-3:curated_good',
'allen_mouse... |
import typing
from .attachment import Attachment
from .base_object import DiscordObject
from .emoji import Emoji
from .reaction import Reaction
from .user import User
from ..client import DiscordClientAsync
from ..util import SingularEvent
class Message(DiscordObject):
MESSAGE_TYPE_DEFAULT = 0
MESSAGE_TYPE_R... |
from getratings.models.ratings import Ratings
class NA_Shen_Mid_Aatrox(Ratings):
pass
class NA_Shen_Mid_Ahri(Ratings):
pass
class NA_Shen_Mid_Akali(Ratings):
pass
class NA_Shen_Mid_Alistar(Ratings):
pass
class NA_Shen_Mid_Amumu(Ratings):
pass
class NA_Shen_Mid_Anivia(Ratings):
pass
clas... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from simpleoncall import api
from simpleoncall import internal
urlpatterns = patterns(
'',
url(r'^$', 'simpleoncall.views.dashboard', name='dashboard'),
url(r'^login', 'simpleoncall.views.login', name='login'),
url(r'... |
import keras
import numpy as np
from keras.models import Sequential
from keras.layers import LSTM , Input , Dense , Dropout
from keras.optimizers import Adam
def lstm():
input_shape = (40,12)
model = Sequential()
model.add(LSTM(40,return_sequences = False , input_shape = input_shape,dropout = 0.5))
mo... |
import os
import tempfile
from unittest import TestCase
from pygmy.app.link import shorten, unshorten, link_stats
from pygmy.core.initialize import initialize_test
from pygmy.config import config
class URLClickStatsTest(TestCase):
"""Test for clickmeta i.e. click stats"""
DBPath = None
def setUp(self):... |
# Problem code
def isRectangleOverlap(rec1, rec2):
x1, x2 = rec1[0], rec1[2]
y1, y2 = rec1[1], rec1[3]
x3, x4 = rec2[0], rec2[2]
y3, y4 = rec2[1], rec2[3]
return lineIntersection(x1, x2, x3, x4) and lineIntersection(y1, y2, y3, y4)
def lineIntersection(x1, x2, x3, x4):
return max(x1, x3) < m... |
"""Loading functions for use in FastAPI's depedency injection."""
from typing import Generator
from app.core.database import Database
async def load_db() -> Generator:
with Database() as db:
yield db |
#!/usr/bin/env python
"""
@author : 'Muhammad Arslan <rslnrkmt2552@gmail.com>'
"""
#TODO add a graceful exit
import paramiko
host = raw_input("[*] Enter IP > ").strip()
user = raw_input("[*] Enter username > ").strip()
passwd = raw_input("[*] Enter password > ").strip()
com = raw_input("[*] Enter command > ").strip... |
import sys
import numpy as np
from argparse import ArgumentParser
from rdkit import Chem
from collections import defaultdict
parser = ArgumentParser()
parser.add_argument('--sparsity', type=float, default=20)
parser.add_argument('--prop', type=float, default=0.8)
args = parser.parse_args()
stats = []
data = defaultdi... |
## LAZY-- some basic imports and shared params
##
##
from glob import glob
from os import popen, system, chdir, remove, getcwd, mkdir
from os.path import exists, isdir, isfile
import math
from math import floor,sqrt
from sys import stderr,argv,exit
import random
from ..convert_svg_to_png import convert_svg_to_png, MON... |
from __future__ import print_function
import os
def show_text():
print(open(os.path.join(os.path.dirname(__file__), "some_text.txt"), "r").read())
def verify_exclusion():
try:
from . import excluded
except ImportError:
print("success")
else:
print("failed!")
raise Ex... |
#!/usr/bin/python3
import os
import time
import json
import base64
import random
import hashlib
import requests
import datetime
from bs4 import BeautifulSoup
def check_license(hostname, hostip, licensekey, localkey=None):
WHMCSURL = "YOUR URL"
verifyfilepath = 'modules/servers/licensing/verify.php'
licen... |
from setuptools import find_packages, setup
setup(
name="erdos-pylot",
version="0.2",
author="ERDOS Team",
description=("A platform for developing autonomous vehicles."),
long_description=open("README.md").read(),
url="https://github.com/erdos-project/pylot",
keywords=("autonomous vehicles ... |
# Simple program to output a text file with all the tweets from each of the two accounts
import json
import os
from commonfunctions import commonfunctions as cf
filenames = ['HillaryClintonTweets.json', 'realDonaldTrumpTweets.json']
for x in filenames:
with open(os.path.abspath(os.path.join('twitter',x)), 'r') a... |
def grid_grid_packages(grid):
return "grid:grid_packages:%s" % grid.id |
# Copyright 2017 British Broadcasting 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
#
# Unless required by applicable law or a... |
import random
import statistics
from collections import Counter
from operator import eq
from typing import List, Tuple
import pytest
from convtools import conversion as c
from convtools.aggregations import MultiStatementReducer
class SumReducer1(MultiStatementReducer):
reduce = ("%(result)s = {0} + ({1} or 1)",... |
#!/usr/bin/env python
"""
=================
dMRI: Camino, DTI
=================
Introduction
============
This script, camino_dti_tutorial.py, demonstrates the ability to perform basic diffusion analysis
in a Nipype pipeline.
python dmri_camino_dti.py
We perform this analysis using the FSL course data, which ca... |
# Use experience replay to train Q-learning and EV-SARSA
import numpy as np
import matplotlib.pyplot as plt
import random
from collections import deque
import gym
from qlearning import *
from pandas import DataFrame
class ReplayBuffer(object):
def __init__(self, size):
"""
Parameters
----... |
BASE_COMPLEMENTS = {'A': 'T', 'C': 'G', 'G': 'C', 'T': 'A'}
class SingleEndSubsequences(object):
def __init__(self, read_length):
self.read_length = read_length
def get_subsequences(self, sequence):
subsequences = []
if len(sequence) == self.read_length:
subsequences = [se... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('data', '0011_auto_20160725_1017'),
]
operations = [
migrations.AlterField(
model_name='schooldatum',
... |
"""
170201041
Oğuzhan Taşımaz
"""
import numpy as np
from sklearn import svm
def svr(df):
train_data = df[:370]
check_data = df[370:462]
cases = np.array([])
check_data_as_array = np.array([])
dates = np.array(list(range(1, 371))).reshape(-1, 1)
check_dates = np.array(list(range(370, 462))).r... |
import argparse
import requests
import os
import sys
import time
from requests.packages import urllib3
from concurrent.futures import ThreadPoolExecutor
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
#create the parser
parser = argparse.ArgumentParser()
#add argumnets
parser.add_argument('--sub... |
import unittest
import numpy as np
from maenv.core import World
N_AGENTS = 6
class WorldAvailableTargetActionsTestCases(unittest.TestCase):
def setUp(self):
self.world = World(grid_size=10, n_teams=2, n_agents=4)
self.world.attack_target_mask = np.array([
[0, 0, 1, 1], # attacker
... |
#!/usr/bin/env python
### dotfiles.venv.__main__
"""
"""
if __name__ == "__main__":
from dotfiles.venv import venv_ipyconfig
venv_ipyconfig.main()
|
{
"targets": [
{
"target_name": "hwsl2",
"sources": [
"hwsl2.c",
"addon.cc"
],
"include_dirs": ["<!(node -e \"require('nan')\")"],
"cflags_c": ["-mavx2", "-msse2", "-msse4.1", "-mpclmul", "-O3", "-Wno-ignored-qualifiers"],
'xcode_settings': {
'OTHER_CFLA... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="azure_blobstorage_utils",
version="0.1.1",
author="François Valadier",
author_email="francois.valadier@gmail.com",
description="Azure Blob Storage utils",
long_description=long_descrip... |
import argparse
import requests
import json
class graphql:
def __init__(self, authenticator, password, username, role, endpoint):
self.current_bearer_token = ""
self.parser = None
self.args = None
self.parser = argparse.ArgumentParser()
self.parser.add_argument... |
i = int (input())
if i % 2 == 0:
print("чётное")
else:
print ("нечётное")
|
# - * - encoding : utf - 8 - * -
# pylint: disable=fixme, line-too-long
"""
Autoregressive Integrated Moving Average (ARIMA) model.
:copyright: 2017-2019 H2O.ai, Inc.
:license: Apache License Version 2.0 (see LICENSE for details)
"""
import numpy as np
class ARIMA(object):
""" Autoregressive integrated moving ... |
from sqlalchemy.event import listen
import asyncio
from boucanpy.core import logger
ORM_EVENTS = ["after_insert"]
# TODO: is this a legit async approach?
def make_event(func):
def _event(*args, **kwargs):
loop = asyncio.get_event_loop()
# task = loop.create_task(func(*args, **kwargs))
# l... |
__all__ = ["PapersWithCodeError"]
from tea_client.errors import TeaClientError
PapersWithCodeError = TeaClientError
|
# -*- coding: utf-8 -*-
#
# ngsv-console
# http://github.com/xcoo/ngsv-console
# Copyright (C) 2012-2013, Xcoo, 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.apac... |
import random
from typing import List
def in_order(numbers: List[int]) -> bool:
return all(numbers[i] < + numbers[i+1] for i in range(len(numbers) - 1))
# for i in range(len(numbers) - 1):
# if numbers[i] > numbers[i + 1]:
# return False
# return True
def bogo_sort(numbers: List[int]) ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.