content stringlengths 0 894k | type stringclasses 2
values |
|---|---|
# -*- coding: utf-8 -*-
import nnabla as nn
import numpy as np
import common.rawdata as rdat
from tex_util import Texture
""" from nnc_proj.($$project_name_of_nnc) import network """
from nnc_proj.model import network
nn.clear_parameters()
nn.parameter.load_parameters('./nnc_proj/model.nnp')
ratios = rdat.ratios
mve... | python |
# Copyright 2021 Sean Robertson
#
# 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... | python |
"""
def main():
print('main')
TestCase1:
a = [1, 2, 3, 4]
b = [5, 6, 7]
# c = [1, 8, 0, 1]
TEst case2:
a = [1, 2, 3, 4]
b = [5, 6, 7,9]
#c =[6,9,1,3]
Test case3:
a = [2, 3, 4]
b = [5, 6, 7,9]
#c = [5,9,1,3]
"""
a = [2, 3, 4]
b = [5, 6, 7, 9]
sum = new_su... | python |
#!/bin/env python
import os
import json
import subprocess
import sys
import shutil
class Debug:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
def info(self, msg):
p... | python |
''' Class to construct circular parts of the eyepiece
'''
from kivy.uix.widget import Widget
from kivy.lang import Builder
from kivy.properties import NumericProperty
Builder.load_string('''
<Ring>:
canvas:
Color:
rgba: self.color
rgba: self.grey, self.grey, self.grey, 1 - app.tra... | python |
import mock
import pytest
@pytest.fixture
def contentful():
with mock.patch(
'contentful_proxy.handlers.items.DetailProxyHandler.contentful',
new_callable=mock.PropertyMock
) as mock_types:
yield mock_types
def test_get_item_by_id(app, contentful):
contentful.return_value... | python |
# Practice python script for remote jobs
import time
import os
print('starting')
time.sleep(30)
if os.path.exists('62979.pdf'):
os.remove('62979.pdf')
else:
print('The file does not exist')
print('done') | python |
from django.db import models
from django.utils.translation import gettext_lazy as _
from itertools import chain
from operator import attrgetter
# A model which represents a projects to be displayed on the projects page of the website.
class Project(models.Model):
# Define the possible statuses of a project, each ... | python |
import asyncio
import asyncpg
from aiohttp import web
loop = asyncio.get_event_loop()
loop.create_server(["127.0.0.1", "localhost"], port=1234)
async def handle(request):
"""Handle incoming requests."""
pool = request.app["pool"]
power = int(request.match_info.get("power", 10))
# Take a connection ... | python |
"""Utilities for converting notebooks to and from different formats."""
from .exporters import *
from . import filters
from . import transformers
from . import post_processors
from . import writers
| python |
import unittest
import suite_all_tests_chrome
import suite_all_tests_firefox
if __name__ == '__main__':
runner = unittest.TextTestRunner(verbosity=2)
suite = unittest.TestSuite()
suite_chrome = suite_all_tests_chrome.suite()
suite_firefox= suite_all_tests_firefox.suite()
suite.addTests(suite_chrome... | python |
# -*- coding: utf-8 -*-
''' pyrad_proc.py - Process and pipeline management for Python Radiance scripts
2016 - Georg Mischler
Use as:
from pyradlib.pyrad_proc import PIPE, Error, ProcMixin
For a single-file installation, include the contents of this file
at the same place (minus the __future__ import below).
'''
fro... | python |
import requests
import pandas as pd
import json
rply = []
regions = [172]
for region in regions:
url = "https://api.bilibili.com/x/web-interface/ranking/region?rid=" + str(region) + "&day=7&original=0&jsonp=jsonp"
response = requests.get(url=url)
text = response.text
ob = json.loads(text)
... | python |
# Agent.py
from Tools import *
from agTools import *
import commonVar as common
class Agent(SuperAgent):
def __init__(self, number, myWorldState,
xPos, yPos, lX=0, rX=0, bY=0, tY=0, agType=""):
# 0 definitions to be replaced (useful only if the
# dimensions are o... | python |
# -*- coding: iso-8859-15 -*-
#
# Copyright 2017 Mycroft AI 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 appli... | python |
#!/usr/bin/env python
import Pyro.naming
import Pyro.core
import connvalidator
class testobject(Pyro.core.ObjBase):
def __init__(self):
Pyro.core.ObjBase.__init__(self)
def method(self,arg):
caller = self.getLocalStorage().caller # TCPConnection of the caller
login = caller.authenticated # set by the co... | python |
from ThirdParty.CookiesPool.cookiespool.scheduler import Scheduler
def main():
s = Scheduler()
s.run()
if __name__ == '__main__':
main() | python |
from typing import List, Sequence, Optional, Union
import pandas as pd
import pyexlatex as pl
from datacode.sem.constants import STANDARD_SCALE_MESSAGE, ROBUST_SCALE_MESSAGE
def summary_latex_table(fit_df: pd.DataFrame, structural_dfs: Sequence[pd.DataFrame],
latent_dfs: Sequence[pd.DataFram... | python |
from devito.ir.ietxdsl.operations import * # noqa
from devito.ir.ietxdsl.cgeneration import * # noqa
| python |
def find_ocurrences(collection, item):
result = []
for i, word in enumerate(collection):
if word == item:
result.append(i + 1)
return result
words_count, lookup_count = map(int, raw_input().split())
collection_items = []
for i in enumerate(xrange(words_count)):
current_item = raw... | python |
# 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... | python |
ll = eval(open("day_17_2.out", "r").readline())
def lookup(sl, i, j):
for (l, v) in sl:
if l == (i, j):
return v
for sl in ll:
for j in range(-3, 4):
for i in range(-3, 4):
print(lookup(sl, i, j), end='')
print()
print()
| python |
import sqlite3
from string import Template
# import threading #MultiThreading
# 1: successful
# 2: in_progress
# 3: failed
class SQL_Lite_Logger:
def __init__(self, filename):
self.connection = sqlite3.connect(filename)
self.connection.row_factory = lambda c, r: dict([(col[0], r[idx]) for idx, col in enumerate... | python |
# Link: https://leetcode.com/problems/validate-stack-sequences/
# Time: O(N)
# Space: O(N)
# def validate_stack_sequences(pushed, popped):
# stack, i = [], 0
# while stack or popped:
# if i < len(pushed):
# stack.append(pushed[i])
# elif stack[-1] != popped[0]:
# return... | python |
# A singular message for an error. An error is made up of multiple error messages
# A error message defines the formatting of an error.
class _ErrorMessage:
def __init__(self, message:str = None,
content:str = None,
object = None,
tokens:[] = None... | python |
from pyqum import create_app
app = create_app()
app.run(host='127.0.0.1', port=5777, debug=True)
| python |
import smart_imports
smart_imports.all()
class SettingAdmin(django_admin.ModelAdmin):
list_display = ('key', 'value', 'updated_at')
def save_model(self, request, obj, form, change):
from . import settings
settings[obj.key] = obj.value
def delete_model(self, request, obj):
from .... | python |
from __future__ import division
import pandas as pd
import numpy as np
from sklearn.neighbors import NearestNeighbors
import sys
import pickle
__author__ = 'sladesal'
__time__ = '20171110'
"""
Parameters
----------
data : 原始数据
tag_index : 因变量所在的列数,以0开始
max_amount : 少类别类想要达到的数据量
std_rate : 多类:少类... | python |
from django.contrib.auth.models import User
from django.shortcuts import render
from ..date_checker import update_all
from ..forms import UserForm, UserProfileForm
from ..models import UserProfile
from random import randint
def register(request):
"""Registration Page View
Displays registration form for user ... | python |
import numpy as np
import pickle
import tensorflow as tf
import os
import sys
sys.path.append("../../..")
sys.path.append("../..")
sys.path.append("..")
import utils
import random
import math
from mimic3models.multitask import utils as mt_utils
from waveform.WaveformLoader import WaveformDataset
from mimic3models.prepr... | python |
import math
def get_client_ip(request) -> str:
"""Get real client IP address."""
x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')
if x_forwarded_for:
ip = x_forwarded_for.split(',')[0]
else:
ip = request.META.get('REMOTE_ADDR')
return ip
def get_pretty_file_size(size_in... | python |
"""
mmic
A short description of the project.
"""
# Add imports here
from . import components
# Handle versioneer
from ._version import get_versions
versions = get_versions()
__version__ = versions["version"]
__git_revision__ = versions["full-revisionid"]
del get_versions, versions
| python |
#!/usr/bin/env python
from __tools__ import MyParser
from __tools__ import XmlParser
#import matplotlib.pyplot as plt
import lxml.etree as lxml
import subprocess as sp
import numpy as np
parser=MyParser(description="Tool to create histogramm for iexcitoncl from jobfile")
parser.add_argument("--format",type=str,defau... | python |
#!/usr/bin/env python3
import sys
import os
import logging
import numpy as np
import PIL.Image as Image
import vboard as vb
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
kl = vb.detect_key_lines()
for filename in sys.argv[1:]:
name = os.path.basename(filename)
try:
... | python |
import argparse
import os
import json
from bs4 import BeautifulSoup
from tqdm import tqdm
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Script to process podcasts trascripts to json file')
parser.add_argument('--input_file', type=str, required=True)
parser.add_argument('--output... | python |
#!/usr/bin/env python
# encoding: utf-8
"""
File: thin_mrbayes_runs.py
Author: Brant Faircloth
Created by Brant Faircloth on 29 March 2012 09:03 PDT (-0700)
Copyright (c) 2012 Brant C. Faircloth. All rights reserved.
Description:
"""
import os
import sys
import glob
import shutil
import argparse
from phyluce.helpe... | python |
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Panda(CMakePackage):
"""PANDA: Parallel AdjaceNcy Decomposition Algorithm"""
homepage... | python |
import argparse
import json
import pickle
from bz2 import BZ2File
from pprint import pprint
# with open("wiki_data/properties.pkl", "rb") as props:
# properties_mapper = pickle.load(props)
properties_mapper = {}
properties_mapper.update(
{
"Q6581097": "male",
"Q6581072": "female",
}
)
d... | python |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | python |
from rest_framework.test import APITestCase
from rest_framework import status
from rest_framework.reverse import reverse as api_reverse
from survivor.models import Survivor, FlagAsInfected, Reports
class ReportsAPITestCase(APITestCase):
def setUp(self):
Survivor.objects.create(
name='New Name... | python |
import pathlib
from setuptools import setup
current_location = pathlib.Path(__file__).parent
README = (current_location / "README.md").read_text()
setup(
name="wiktionary-parser-ru",
version="0.0.1",
packages=["wiktionaryparserru", "tests"],
url="https://github.com/ShatteredMind/wiktionaryparserru",
... | python |
def convert(s):
s_split = s.split(' ')
return s_split
def niceprint(s):
for i, elm in enumerate(s):
print('Element #', i + 1, ' = ', elm, sep='')
return None
c1 = 10
c2 = 's'
| python |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
"""
LightGBM/Python training script
"""
import os
import sys
import argparse
import logging
import traceback
import json
from distutils.util import strtobool
import lightgbm
from collections import namedtuple
# Add the right path to PYTHONPATH
#... | python |
"""
Lark parser and AST definition for Domain Relational Calculus.
"""
from typing import Dict, NamedTuple, Set, Tuple
from lark import Lark, Token, Tree
from relcal import config
from relcal.helpers.primitives import Singleton
####################
# Type definitions #
####################
Fields = Tuple[Token, ...... | python |
import logging
import logging.config
import os
import signal
import sys
import click
import gevent
import gevent.pool
from eth_keys.datatypes import PrivateKey
from eth_utils import to_checksum_address
from gevent.queue import Queue
from marshmallow.exceptions import ValidationError
from toml.decoder import TomlDecode... | python |
# -*- coding: utf-8 -*-
"""
Test cases related to direct loading of external libxml2 documents
"""
from __future__ import absolute_import
import sys
import unittest
from .common_imports import HelperTestCase, etree
DOC_NAME = b"libxml2:xmlDoc"
DESTRUCTOR_NAME = b"destructor:xmlFreeDoc"
class ExternalDocumentTestC... | python |
import math
from tkinter import Tk, Canvas, W, E, NW
from tkinter.filedialog import askopenfilename
from tkinter import messagebox
from scipy.interpolate import interp1d
import time
import numpy as np
# Definición recursiva, requiere numpy
# def B(t,P):
# if len(P)==1:
# return np.array(P[0])
# else:
# ... | python |
from gensim.models.keyedvectors import KeyedVectors
import numpy as np
import pandas as pd
__author__ = "Sreejith Sreekumar"
__email__ = "sreekumar.s@husky.neu.edu"
__version__ = "0.0.1"
model = KeyedVectors.load_word2vec_format('/media/sree/venus/pre-trained-models/GoogleNews-vectors-negative300.bin', binary=True... | python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Filename: results_to_latex.py
import os, argparse, json, math
import logging
TEMPLATE_CE_RESULTS = r"""\begin{table}[tb]
\scriptsize
\centering
\caption{Chaos Engineering Experiment Results on %s}\label{tab:ce-experiment-results-%s}
\begin{tabularx}{\columnwidth}{lrrrXXXX}
... | python |
import yfinance as yf
import pandas as pd
import numpy as np
import quandl
API_KEY = '8ohVvwCgmzgRpFeza8FD'
quandl.ApiConfig.api_key = API_KEY
# Download APPL Stock price
df = yf.download('AAPL', start='1999-12-31', end='2010-12-31', progress=False)
df.rename(columns = {'Adj Close': 'adj_close'},inplace=True)
df = d... | python |
#!/usr/bin/env python
#############################################################################
##
## This file is part of Taurus, a Tango User Interface Library
##
## http://www.tango-controls.org/static/taurus/latest/doc/html/index.html
##
## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
## Tau... | python |
TEST = 'noe'
| python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
routines for getting network interface addresses
"""
# by Benjamin C. Wiley Sittler, BSD/OSX support by Greg Hazel
__all__ = [
'getifaddrs',
'getaddrs',
'getnetaddrs',
'getbroadaddrs',
'getdstaddrs',
'main',
'IFF_UP',
'IFF_BROADCAST',
... | python |
from .main import *
from .database import *
from .headless import *
from .bdi import *
from .spq import *
from .oci import *
from .stai import *
from .starter import *
from .two_of_four_ocd_practice import *
from .two_of_four_ocd_test import *
from .extra import *
from .teacher_practice import *
from .teacher_test imp... | python |
# Do not edit this file directly.
# It was auto-generated by: code/programs/reflexivity/reflexive_refresh
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
def imgui():
http_archive(
name = "imgui",
build_file = "... | python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Perform a functional test of the status command."""
import os
import orion.core.cli
def test_no_experiments(clean_db, monkeypatch, capsys):
"""Test status with no experiments."""
monkeypatch.chdir(os.path.dirname(os.path.abspath(__file__)))
orion.core.cli.... | python |
import json
import sqlite3
with open('../data_retrieval/authors/author_info.json') as data_file:
data = json.load(data_file)
connection = sqlite3.connect('scholarDB.db')
with connection:
cursor = connection.cursor()
for row in data:
name = row['name']
website = row['website']
emai... | python |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
"""
Custom Jupyterhub Authenticator to use Facebook OAuth with business manager check.
""... | python |
import numpy as np
import pandas as pd
from sklearn import *
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from matplotlib import pyplot
import time
import os
showPlot=True
#prepare data
data_file_name = "../FinalCost.csv"
data_csv = pd.read_csv(data_file_na... | python |
import numpy as np
class ZeroNoisePrng:
"""
A dummy PRNG returning zeros always.
"""
def laplace(self, *args, size=1, **kwargs):
return np.zeros(shape=size)
def exponential(self, *args, size=1, **kwargs):
return np.zeros(shape=size)
def binomial(self, *args, size=1, **kwargs):... | python |
'''
@author: Sana Dev Team
Created on May 24, 2011
'''
from __future__ import with_statement
import sys, traceback
from django.conf import settings
from django.core import urlresolvers
from piston.utils import decorator
from sana import api
from sana.api.fields import REQUEST, DISPATCHABLE
CRUD = {'GET':'read', 'PO... | python |
"""You are given an integer n, the number of teams in a tournament that has strange rules:
If the current number of teams is even, each team gets paired with another team. A total of n / 2 matches are played, and n / 2 teams advance to the next round.
If the current number of teams is odd, one team randomly advances i... | python |
from django.contrib import admin
from publicmarkup.legislation.models import Resource, Legislation, Title, Section
class LegislationAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("name",)}
class SectionInline(admin.TabularInline):
model = Section
extra = 5
class TitleAdmin(admin.Mod... | python |
from pyscenario import *
from util.arg import *
from util.scene import RoadSideGen
class Scenario(PyScenario):
def get_description(self):
return 'Test random boxes at the border of roads'
def get_map(self):
return arg_get('-map', 'shapes-1')
def init(self):
gen = RoadSideGen(self.... | python |
def two(x, y, *args):
print(x, y, args)
if __name__ == '__main__':
two('a', 'b', 'c')
| python |
#!/usr/bin/env python3
from _common import StreamContext
import sys
from argparse import ArgumentParser
import itertools
from shelltools.ressample import ReservoirSampler
from typing import Sequence
def _has_dupes(items: Sequence):
if len(items) <= 1:
return False
if len(items) == 2:
return it... | python |
import sys
import argparse
import matplotlib.pyplot as plt
import pandas as pd
import tensorflow as tf
from sklearn.utils import shuffle
def main(_):
# read data
df = pd.read_csv('../../data/boston/boston_train.csv', header=0)
print(df.describe())
f, ax1 = plt.subplots()
for i in range(1, 8):
... | python |
# Copyright 2021 Michal Krassowski
from collections import defaultdict
from time import time
from jedi.api.classes import Completion
from .logger import log
class LabelResolver:
def __init__(self, format_label, time_to_live=60 * 30):
self.format_label = format_label
self._cache = {}
sel... | python |
import pandas as pd
import numpy as np
#seri olusturma
#s = pd.Series(data, index=index) ile seri olusturulur
# s = pd.Series(np.random.randn(5)) #index --> 0,1,2,3,4
# s = pd.Series(np.random.randn(5),index=['a','b','c','d','e'])
# print(s)
# print('-'*50)
# print(s.index)
# print('*'*50)
# data = {'a':2... | python |
import numpy as np
def fieldFromCurrentLoop(current, radius, R, Z):
"""
Checks inputs to fieldFromCurrentLoop() for TypeErrors etc.
"""
if type(current) != type(0.):
raise TypeError("Current should be a float, "+str(type(current))+" detected.")
if type(radius) != type(0.):
raise ... | python |
n = int(input('number: '))
count = 0
for i in range(1, n+1):
if n % i == 0:
count += 1
print(i, end=' ')
print()
print('count:', count) | python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright © 2014, 2015, 2017 Kevin Thibedeau
# (kevin 'period' thibedeau 'at' gmail 'punto' com)
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software... | python |
import unittest
from sqlalchemy.orm import sessionmaker
from nesta.core.orms.nomis_orm import Base
from nesta.core.orms.orm_utils import get_mysql_engine
class TestNomis(unittest.TestCase):
'''Check that the WiktionaryNgram ORM works as expected'''
engine = get_mysql_engine("MYSQLDBCONF", "mysqldb")
Sessi... | python |
from django.apps import AppConfig
class DeptConfig(AppConfig):
name = 'dept'
| python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Amir Mofasser <amir.mofasser@gmail.com> (@amimof)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION = """
module: ibmim_installer
version_added: "1.9.4"
short_description: Install/Uninstall IBM Inst... | python |
"""
This file defines and implements the basic goal descriptors for PDDL2.2.
The implementation of comparison goals is implemented in DomainInequality.
"""
from typing import Union, List
from enum import Enum
from pddl.domain_formula import DomainFormula, TypedParameter
from pddl.domain_time_spec import TIME_SPEC
cl... | python |
# pylint # {{{
# vim: tw=100 foldmethod=indent
# pylint: disable=bad-continuation, invalid-name, superfluous-parens
# pylint: disable=bad-whitespace, mixed-indentation
# pylint: disable=redefined-outer-name
# pylint: disable=missing-docstring, trailing-whitespace, trailing-newlines, too-few-public-methods
# }}}
import... | python |
import mock
import unittest
import mongomock
from core.seen_manager import canonize, SeenManager
from core.metadata import DocumentMetadata
from tests.test_base import BaseTestClass
class TestSeenManager(BaseTestClass):
def test_canonize(self):
input_url = ["http://www.google.com",
"... | python |
""" Python generator utilities for DMT """
import shutil
from pathlib import Path
from setuptools import setup, find_packages
here = Path(__file__).parent.resolve()
# Remove build and dist folders
shutil.rmtree(Path("build"), ignore_errors=True)
shutil.rmtree(Path("dist"), ignore_errors=True)
# Get the lo... | python |
#!/usr/bin/env python
# coding: utf-8
# <!--BOOK_INFORMATION-->
# <img align="left" style="padding-right:10px;" src="images/book_cover.jpg" width="120">
#
# *This notebook contains an excerpt from the [Python Programming and Numerical Methods - A Guide for Engineers and Scientists](https://www.elsevier.com/books/pyth... | python |
import markdown
from django.template.loader import render_to_string
from modules.polygon import models
CONTEST_TAG_RE = r'(?i)\[polygon_contest\s+id:(?P<contest_id>\d+)\]'
class ContestExtension(markdown.Extension):
"""Contest plugin markdown extension for SIStema wiki."""
def extendMarkdown(self, md):
... | python |
########
# PART 1
def get_numbers():
numbers = None
with open("event2019/day16/input.txt", "r") as file:
for line in file:
numbers = list(map(int, line[:-1]))
#numbers = [int(x) for x in line[:-1]]
return numbers
def fft(inp):
''' TODO: optimize with part 2 '''
... | python |
import streamlit as st
def app():
st.write("# About")
col1, col2, col3 = st.columns([5,2,5])
with col1:
st.image("davide.jpg")
st.write("### Davide Torlo")
st.write("Ricercatore PostDoc all'Università SISSA di Trieste")
st.write("Ideatore principale di concept, metriche e g... | python |
keywords = {
".5" : "FOR[ITERATION]",
"wrap" : "KEYWORD",
"as" : "KEYWORD[ASSIGNMENT]",
"let" : "KEYWORD[RELOP]",
"pp" : "INCRE[RELOP]",
".2" : "IF[CONDITIONAL]",
"vomit" : "KEYWORD[PRINT]",
"|" : "PARANTHESIS",
"--" ... | python |
"""
JAX DSP utility functions
"""
from functools import partial
import jax
import jax.numpy as jnp
import librosa
from jax.numpy import ndarray
def rolling_window(a: ndarray, window: int, hop_length: int):
"""return a stack of overlap subsequence of an array.
``return jnp.stack( [a[0:10], a[5:15], a[10:20],... | python |
# -*- encoding: utf-8 -*-
'''
Created on 2012-3-23
@author: Neil
'''
from django.shortcuts import render_to_response
from grnglow.glow.views import people
from grnglow.glow.models.photo import Photo
def base(request):
return render_to_response('base.html')
def index(request):
if request.user.is_authenticat... | python |
# -*- coding: utf-8 -*-
"""
Created on Fri May 24 15:17:13 2019
@author: DaniJ
"""
'''
It is like the four_layer_model_2try_withFixSpeciesOption_Scaling.py, but with two surfaces. There is not Poisson-Boltzman interaction between the two surfaces.
'''
import numpy as np
from scipy import linalg
def four_layer_two_su... | python |
# Step 1 - Gather Data
import pandas as pd
import datetime
import re
import json
import os
import unittest
import time
import sys
# Own Imports
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
from deployment.Control_Enactor import Enactor
from deployment.Data_Retreiver import Data_Retreiver
class Contro... | python |
# Generated by Django 2.2.6 on 2020-01-18 06:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0002_auto_20200116_2309'),
]
operations = [
migrations.AddField(
model_name='enroll',
name='outofmid',
... | python |
# Copyright (c) 2016, Dennis Meuwissen
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions an... | python |
# Simple XML to CSV
# e.g. for https://ghr.nlm.nih.gov/download/ghr-summaries.xml
# Silas S. Brown 2017 - public domain - no warranty
# Bugs: may not correctly handle descriptions that mix
# tags with inline text on the same level.
# FOR EXPLORATORY USE ONLY.
# Where to find history:
# on GitHub at https://github.com... | python |
def seat_spec_to_id(seat_spec):
row = 0
for pos in range(7):
if seat_spec[pos] == 'B':
row = row + pow(2,6-pos)
# print("adding row", pow(2,6-pos))
# print("row", row)
col = 0
for pos in range(3):
if seat_spec[7+pos] == 'R':
col = col + pow(2,2-pos)
# print("adding col", pow(2,... | python |
import argparse
import math
import sys
def main() -> int:
parser = argparse.ArgumentParser(
description="Utility for generating the pitch register table C source.",
)
parser.add_argument(
'c',
metavar='C_FILE',
type=str,
help='The C file we should generate.',
)
... | python |
from llvmlite import ir as lir
import llvmlite.binding as ll
import numba
import hpat
from hpat.utils import debug_prints
from numba import types
from numba.typing.templates import (infer_global, AbstractTemplate, infer,
signature, AttributeTemplate, infer_getattr, bound_function)
fr... | python |
from py.webSocketParser import SurveyTypes
neo = [
{"sigma_tp": 7.2258e-06, "diameter": 16.84, "epoch_mjd": 56800.0, "ad": 1.782556743092633, "producer": "Otto Matic", "rms": 0.49521, "H_sigma": "", "closeness": 3366.5887401966647, "spec_B": "S", "K2": "", "K1": "", "M1": "", "two_body": "", "full_name": "433 Eros... | python |
#
# This script should be sourced after slicerqt.py
#
def tcl(cmd):
global _tpycl
try:
_tpycl
except NameError:
# no tcl yet, so first bring in the adapters, then the actual code
import tpycl
_tpycl = tpycl.tpycl()
packages = ['freesurfer', 'mrml', 'mrmlLogic', 'teem', 'vtk', 'vtkITK']
... | python |
import os
import shutil
import sys
from pathlib import Path
from subprocess import Popen
from cmd.Tasks.Task import Task
from cmd.Tasks.Tasks import Tasks
from cmd.Tasks.Build.manifest_config import manifest_config
import json
class Build(Task):
NAME = Tasks.BUILD
def __build_app(self):
print('****'... | python |
from django.apps import AppConfig
class Sql3Config(AppConfig):
name = 'SQL3'
| python |
# Testing environment setting
| python |
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 3 07:06:58 2019
@author: astar
"""
import random
import math
import matplotlib.pyplot as plt
from time import clock
class Ant:
def __init__(self, map_):
self.map = map_
self.path = []
self.path_length = math.inf
... | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.