content stringlengths 0 894k | type stringclasses 2
values |
|---|---|
# Generated by Django 2.1.3 on 2018-12-01 22:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Eprint_users', '0011_auto_20181130_0119'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='image... | python |
#!/usr/bin/env python
"""
Loop over a list of blog post src filenames and
generate a blog index markdown file.
"""
import sys
import os.path
from datetime import datetime
from utils import parse_metadata
POST_TEMPLATE = """
---
## [{title}]({htmlname})
### {subtitle}
{description}
_{datestr}_ | [Read more...]({... | python |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.http import HttpResponse
from django.shortcuts import render
def home(request):
"""return HttpResponse('<h1>Hello, Welcome to this test</h1>')"""
"""Le chemin des templates est renseigne dans "DIRS" de "TEMPLATES" dans settings.py
DONC P... | python |
#!/usr/bin/env python
# Copyright (c) 2013. Mark E. Madsen <mark@madsenlab.org>
#
# This work is licensed under the terms of the Apache Software License, Version 2.0. See the file LICENSE for details.
"""
Description here
"""
import logging as log
import networkx as nx
import madsenlab.axelrod.utils.configuration
... | python |
#!/usr/bin/env python3
# coding:utf-8
class Solution:
def maxInWindows(self, num, size):
if num == []:
return []
if len(num) < size:
return [max(num)]
res = []
queue = num[:size]
res.append(max(queue))
for i in range(size, len(num)):
... | python |
__all__=["greeters"]
# ***
# *** Use __init__.py to expose different parts of the submodules in the desired namespace
# ***
# *** Define what can be seen in the main "skeleton." namespace (as this is skeleton/__init__.py) like this:
# from .greeters.fancy import * # now you can do: from skeleton import FancyHelloWo... | python |
import iota_client
# client will connect to testnet by default
client = iota_client.Client()
print(client.get_info())
| python |
from django.apps import AppConfig
class SiteAdocaoConfig(AppConfig):
name = 'site_adocao'
| python |
# Copyright 2019 Quantapix 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 applicable l... | python |
import aita
if __name__ == "__main__":
# Development, Testing, Production
app = aita.create_app('Development')
app.run()
| python |
import json
from logging import root
import os
import warnings
from skimage.color import rgb2lab, gray2rgb, rgba2rgb
from skimage.util import img_as_float
import numpy as np
import numpy.typing as npt
import torch
from torch.utils.data import DataLoader
import torch.optim as optim
import torch.nn as nn
from torch... | python |
from functools import partial
from PyQt5.QtCore import pyqtSignal, QTimer, Qt
from PyQt5.QtWidgets import QInputDialog, QLabel, QVBoxLayout, QLineEdit, QWidget, QPushButton
from electrum.i18n import _
from electrum.plugin import hook
from electrum.wallet import Standard_Wallet
from electrum.gui.qt.util import WindowM... | python |
from data.scrapers import *
import pandas as pd
from wordcloud import WordCloud
import matplotlib.pyplot as plt
def model_run(model, freq='1111111', existing=None):
scraper = model(freq)
dfs = scraper.run()
for df in dfs:
existing.append(df)
return existing
def generate_wordcloud(text, year=... | python |
import numpy as np
from ..pakbase import Package
class ModflowFlwob(Package):
"""
Head-dependent flow boundary Observation package class. Minimal working
example that will be refactored in a future version.
Parameters
----------
nqfb : int
Number of cell groups for the hea... | python |
# globals.py
# Logic to get a list of the DBS instances available on DAS.
# Currently hardcoding. There's probably a better way!
instances = ['prod/global', 'prod/phys01', 'prod/phys02', 'prod/phys03', 'prod/caf'] | python |
from hashlib import sha1
from multiprocessing.dummy import Lock
m_lock = Lock()
z_lock = Lock()
print(f"是否相等:{m_lock==z_lock}\n{m_lock}\n{z_lock}") # 地址不一样
m_code = hash(m_lock)
z_code = hash(z_lock)
print(f"是否相等:{m_code==z_code}\n{m_code}\n{z_code}") # 值一样
# Java可以使用:identityhashcode
m_code = sha1(str(m_lock).enc... | python |
import codecs
import csv
import json
import os
import random
import sys
directory = str(os.getcwd())
final_data = {"url": "http://10.10.0.112"}
def getNumberRecords():
'''
Counts the number of username-password for admin.csv file
Arguments:
None
Returns:
number of username-pass... | python |
# Copyright 2020 Yuhao Zhang and Arun Kumar. 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 app... | python |
def ejercicio01MCM():
#Definir variables y otros
print("--> EJERCICIO 01 <--")
notaFinal=round(0.0)
#Datos de entrada
n1=float(input("Ingrese la 1ra nota: "))
n2=float(input("Ingrese la 2da nota: "))
n3=float(input("Ingrese la 2da nota: "))
n4=float(input("Ingrese la 4ta nota: "))
#Proceso
notaFinal... | python |
from __future__ import absolute_import
from django.test import RequestFactory
from exam import fixture
from mock import patch
from sentry.middleware.stats import RequestTimingMiddleware, add_request_metric_tags
from sentry.testutils import TestCase
from sentry.testutils.helpers.faux import Mock
class RequestTimingM... | python |
from django.conf.urls import url
from django.urls import path
from rest.quiklash import views
from rest.push_the_buttons.views import PushTheButtonView
urlpatterns = [
path('api/qa/game/start', views.QuicklashMainGame.as_view()),
path('api/qa/question/new', views.QuiklashQuestionListView.as_view()),
path('a... | python |
# coding: utf-8
from __future__ import annotations
from datetime import date, datetime # noqa: F401
import re # noqa: F401
from typing import Any, Dict, List, Optional # noqa: F401
from pydantic import AnyUrl, BaseModel, EmailStr, validator # noqa: F401
from acapy_wrapper.models.indy_proof_requested_proof_predic... | python |
# Basic training configuration file
from pathlib import Path
from torchvision.transforms import RandomVerticalFlip, RandomHorizontalFlip, CenterCrop
from torchvision.transforms import RandomApply, RandomAffine
from torchvision.transforms import ToTensor, Normalize
from common.dataset import get_test_data_loader
SEED ... | python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2021 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The module file for nxos_bgp_global
"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
modu... | python |
print("merhaba")
print("merhaba")
print("merhaba")
print("merhaba") | python |
r"""
Base class for polyhedra, part 6
Define methods related to plotting including affine hull projection.
"""
# ****************************************************************************
# Copyright (C) 2008-2012 Marshall Hampton <hamptonio@gmail.com>
# Copyright (C) 2011-2015 Volker Braun <vbraun.name... | python |
import discord
from discord.ext import commands
import traceback
import datetime
import asyncio
import random
from datetime import datetime
from storage import *
pat_gifs = [
"https://cdn.discordapp.com/attachments/670153232039018516/674299983117156362/1edd1db645f55aa7f2923838b5afabfc863fc109_hq.gif",
"https:/... | python |
import Tkinter as tk
import warnings
VAR_TYPES = {
int: tk.IntVar,
float: tk.DoubleVar,
str: tk.StringVar
}
class ParameterController(tk.Frame):
def __init__(self,parent, key, value):
tk.Frame.__init__(self, parent)
self.value_type = type(value)
self._var = VAR_TYPES[self.v... | python |
import factory
import factory.fuzzy
from user.models import User
from company.tests.factories import CompanyFactory
class UserFactory(factory.django.DjangoModelFactory):
sso_id = factory.Iterator(range(99999999))
name = factory.fuzzy.FuzzyText(length=12)
company_email = factory.LazyAttribute(
lam... | python |
class Solution:
def combine(self, n: int, k: int) -> List[List[int]]:
# Using dfs to record all possible
def dfs(nums, path=None, res=[]):
if path is None:
path = []
if len(path) == k:
res += [path]
return res
for id... | python |
from typing import Optional
import requests
from libgravatar import Gravatar
from bs4 import BeautifulSoup
def get_gravatar_image(email) -> Optional[str]:
"""Only will return a url if the user exists and is correct on gravatar, otherwise None"""
g = Gravatar(email)
profile_url = g.get_profile()
res =... | python |
patterns = ['you cannot perform this operation as root']
def match(command):
if command.script_parts and command.script_parts[0] != 'sudo':
return False
for pattern in patterns:
if pattern in command.output.lower():
return True
return False
def get_new_command(command):
... | python |
import json
import os
from py2neo import Graph
class GraphInstanceFactory:
def __init__(self, config_file_path):
"""
init the graph factory by a config path.
the config json file format example:
[
{
"server_name": "LocalHostServer",
"se... | python |
from datetime import datetime
class mentions_self:
nom = 'я'; gen = ['меня', 'себя']; dat = ['мне', 'себе']
acc = ['меня', 'себя']; ins = ['мной', 'собой']; abl = ['мне','себе']
class mentions_unknown:
all = 'всех'
him = 'его'; her = 'её'; it = 'это'
they = 'их'; them = 'их'; us = 'нас'
nam... | python |
from flask import (
Blueprint,
render_template,
)
from sqlalchemy import desc, func, or_, text
from .. import db
from ..models import (
Video,
Vote,
GamePeriod,
Reward,
)
game = Blueprint(
'game',
__name__,
template_folder='templates'
)
@game.route('/')
def index():
q = """
... | python |
import torch
import torch.nn.utils.rnn as rnn
import numpy as np
import pandas
from torch.utils.data import Dataset
from sklearn.preprocessing import LabelEncoder
from parsers.spacy_wrapper import spacy_whitespace_parser as spacy_ws
from common.symbols import SPACY_POS_TAGS
import json
import transformers
from transfo... | python |
# coding=utf-8
from selenium.webdriver.common.by import By
from view_models import certification_services, sidebar, ss_system_parameters
import re
import time
def test_ca_cs_details_view_cert(case, profile_class=None):
'''
:param case: MainController object
:param profile_class: string The fully qualifie... | python |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Author: Niccolò Bonacchi
# @Date: Thursday, January 31st 2019, 1:15:46 pm
from pathlib import Path
import argparse
import ibllib.io.params as params
import oneibl.params
from alf.one_iblrig import create
from poop_count import main as poop
IBLRIG_DATA = Path().cwd().pare... | python |
"""
Flask-Limiter extension for rate limiting
"""
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
from .errors import ConfigurationError, RateLimitExceeded
from .extension import Limiter, HEADERS
| python |
from foldrm import Classifier
import numpy as np
def acute():
attrs = ['a1', 'a2', 'a3', 'a4', 'a5', 'a6']
nums = ['a1']
model = Classifier(attrs=attrs, numeric=nums, label='label')
data = model.load_data('data/acute/acute.csv')
print('\n% acute dataset', np.shape(data))
return model, data
de... | python |
import tensorflow as tf
# 本节主要讲 placeholder
input1 = tf.placeholder(tf.float32)
input2 = tf.placeholder(tf.float32)
# 原教程中为 mul, 我使用的版本为 multiply
output = tf.multiply(input1, input2)
with tf.Session() as sess:
print(sess.run(output, feed_dict={input1: [7.], input2: [2.]}))
| python |
'''Statistical tests for NDVars
Common Attributes
-----------------
The following attributes are always present. For ANOVA, they are lists with the
corresponding items for different effects.
t/f/... : NDVar
Map of the statistical parameter.
p_uncorrected : NDVar
Map of uncorrected p values.
p : NDVar | None
... | python |
class SelectionSort:
@staticmethod
def sort(a):
for i, v in enumerate(a):
minimum = i
j = i+1
while j < len(a):
if a[j] < a[minimum]:
minimum = j
j += 1
tmp = a[i]
a[i] = a[minimum]
... | python |
# -*- coding: utf-8 -*-
# @Time : 2019/1/18 15:40
| python |
# 정수를 저장하는 큐를 구현한 다음, 입력으로 주어지는 명령을 처리하는 프로그램을 작성하시오.
# 명령은 총 여섯 가지이다.
# push X: 정수 X를 큐에 넣는 연산이다.
# pop: 큐에서 가장 앞에 있는 정수를 빼고, 그 수를 출력한다. 만약 큐에 들어있는 정수가 없는 경우에는 -1을 출력한다.
# size: 큐에 들어있는 정수의 개수를 출력한다.
# empty: 큐가 비어있으면 1, 아니면 0을 출력한다.
# front: 큐의 가장 앞에 있는 정수를 출력한다. 만약 큐에 들어있는 정수가 없는 경우에는 -1을 출력한다.
# back: 큐의 가장 뒤에 있는... | python |
from clickhouse_orm import migrations
from ..test_migrations import *
operations = [migrations.AlterIndexes(ModelWithIndex2, reindex=True)]
| python |
from functools import partial
import pytest
from stp_core.loop.eventually import eventuallyAll
from plenum.test import waits
from plenum.test.helper import checkReqNack
whitelist = ['discarding message']
class TestVerifier:
@staticmethod
def verify(operation):
assert operation['amount'] <= 100, 'a... | python |
import torch
from torch import autograd
def steptaker(data, critic, step, num_step = 1):
"""Applies gradient descent (GD) to data using critic
Inputs
- data; data to apply GD to
- critic; critic to compute gradients of
- step; how large of a step to take
- num_step; how finely to discretize fl... | python |
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
import pickle
import pprint
import datefinder
# What the program can access within Calendar
# See more at https://developers.google.com/calendar/auth
scopes = ["https://www.googleapis.com/auth/calendar"]
flow = Installe... | python |
# -*- coding: utf-8 -*-
"""binomial_mix.
Chen Qiao: cqiao@connect.hku.hk
"""
import sys
import warnings
import numpy as np
from scipy.special import gammaln, logsumexp
from .model_base import ModelBase
class MixtureBinomial(ModelBase):
"""Mixture of Binomial Models
This class implements... | python |
from keras.layers import Conv2D, SeparableConv2D, MaxPooling2D, Flatten, Dense
from keras.layers import Dropout, Input, BatchNormalization, Activation, add, GlobalAveragePooling2D
from keras.losses import categorical_crossentropy
from keras.optimizers import Adam
from keras.utils import plot_model
from keras import cal... | python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import json
from ..models import PermissionModel as Model
from ..models import GroupPermissionModel
from .base_dao import BaseDao
class PermissionDao(BaseDao):
def add_permission(self, permission):
# 如果存在相同app codename,... | python |
from itertools import permutations
with open("input.txt") as f:
data = [int(i) for i in f.read().split("\n")]
preamble = 25
for d in range(preamble + 1, len(data)):
numbers = data[d - (preamble + 1):d]
target = data[d]
sol = [nums for nums in permutations(numbers, 2) if sum(nums) == target]
... | python |
import collections
import pathlib
import time
from multiprocessing import Process
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from omegaconf import OmegaConf
from gdsfactory import components
from gdsfactory.config import CONFIG, logger
from gdsfactory.doe import get_settings_list
from gdsfac... | python |
#!/usr/bin/env python
import os
import sys
import logging
import requests
import time
from extensions import valid_tagging_extensions
from readSettings import ReadSettings
from autoprocess import plex
from tvdb_mp4 import Tvdb_mp4
from mkvtomp4 import MkvtoMp4
from post_processor import PostProcessor
from logging.confi... | python |
def do_print():
print "hello world"
def add(a, b):
return a + b
def names_of_three_people(a, b, c):
return a['name'] + " and " + b['name'] + " and " + c['name']
def divide(a, b):
return a / b
def float_divide(a, b):
return float(a) / float(b)
def func_return_struct(name, age, hobby1, hobb... | python |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
from marshmallow import fields, post_load, validate
from typing import Optional
from ..schema import PatchedSchemaMeta
from ..fields... | python |
from typing import Union, List, Dict
from py_expression_eval import Parser # type: ignore
import math
from . import error
def add(num1: Union[int, float], num2: Union[int, float], *args) -> Union[int, float]:
"""Adds given numbers"""
sum: Union[int, float] = num1 + num2
for num in args:
... | python |
#
# This file is part of DroneBridge: https://github.com/seeul8er/DroneBridge
#
# Copyright 2017 Wolfgang Christl
#
# 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... | python |
import errno
import gc
# from collections import namedtuple
import math
import os
import os.path
import time
from functools import lru_cache
from pathlib import Path
import numpy as np
import pandas as pd
import artistools as at
@lru_cache(maxsize=8)
def get_modeldata(inputpath=Path(), dimensions=None, get_abundanc... | python |
#Codeacademy's Madlibs
from datetime import datetime
now = datetime.now()
print(now)
story = "%s wrote this story on a %s line train to test Python strings. Python is better than %s but worse than %s -------> written by %s on %02d/%02d/%02d at %02d:%02d"
story_name = raw_input("Enter a name: ")
story_line = raw_inpu... | python |
import logging
import os
import json
from pprint import pformat
import pysftp
from me4storage.common.exceptions import ApiError
logger = logging.getLogger(__name__)
def save_logs(host, port, username, password, output_file):
cnopts = pysftp.CnOpts(knownhosts=os.path.expanduser(os.path.join('~','.ssh','known_hos... | python |
import builtins
import traceback
from os.path import relpath
def dprint(*args, **kwargs):
"""Pre-pends the filename and linenumber to the print statement"""
stack = traceback.extract_stack()[:-1]
i = -1
last = stack[i]
if last.name in ('clearln', 'finish'):
return builtins.__dict__['oldp... | python |
import config_cosmos
import azure.cosmos.cosmos_client as cosmos_client
import json
from dateutil import parser
def post_speech(speech_details, category):
speech_details = speech_details.copy()
collection_link = "dbs/speakeasy/colls/" + category
speech_details["id"] = speech_details["user_name"] + "_" + sp... | python |
#!/usr/bin/env python
# Outputs the relative error in a particular stat for deg1 and deg2 FEM.
# Output columns:
# mesh_num medianEdgeLength deg1Error deg2Error
import sys, os, re, numpy as np
from numpy.linalg import norm
resultDir, stat = sys.argv[1:]
# Input data columns
meshInfo = ["mesh_num", "corner_angle", "me... | python |
"""
Here we implement some simple policies that
one can use directly in simple tasks.
More complicated policies can also be created
by inheriting from the Policy class
"""
import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Categorical, Normal, Bernoulli
c... | python |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('person', '__first__'),
]
operations = [
migrations.CreateModel(
name='Attendee',
fields=[
... | python |
class GPSlocation:
"""used to translate the location system"""
_prop_ = 'GPSlocation'
import math
pi = 3.1415926535897932384626
a = 6378245.0
ee = 0.00669342162296594323
def gcj02_to_wgs84(self, lng, lat):
"""GCJ02 system to WGS1984 system"""
dlat = self._transformlat(lng - 1... | python |
# -*- coding: utf-8 -
import re
import copy
import urllib
import urllib3
import string
import dateutil.parser
from iso8601 import parse_date
from robot.libraries.BuiltIn import BuiltIn
from datetime import datetime, timedelta
import pytz
TZ = pytz.timezone('Europe/Kiev')
def get_library():
return BuiltIn().get_l... | python |
import sys
sys.path.append("C:\Program Files\Vicon\Nexus2.1\SDK\Python")
import ViconNexus
import numpy as np
import smooth
vicon = ViconNexus.ViconNexus()
subject = vicon.GetSubjectNames()[0]
print 'Gap filling for subject ', subject
markers = vicon.GetMarkerNames(subject)
frames = vicon.GetFram... | python |
from jinja2 import DictLoader, Environment
import argparse
import json
import importlib
import random
import string
HEADER = """
#pragma once
#include <rapidjson/rapidjson.h>
#include <rapidjson/writer.h>
#include <rapidjson/reader.h>
#include <iostream>
#include <string>
#include <vector>
#include <map>
struct... | python |
def summary(p,c=10,x=5):
print('-' * 30)
print(f'Value Summary'.center(30))
print('-' * 30)
print(f'{"analyzed price:"} \t{coins(p)}')
print(f"{'Half-price: '} \t{half(p, True)}")
print(f'{"double the price: "}\t{double(p, True)}')
print(f'{c}% {"increase: ":} \t{increase(p, c, True)... | python |
from ._sha512 import sha384
| python |
from app import app, api
from flask import request
from flask_restful import Resource
import json
import pprint
import os
import subprocess
import traceback
import logging
class WelcomeController(Resource):
def get(self):
return {'welcome': "welcome, stranger!"}
api.add_resource(WelcomeController, '/') | python |
import os
from dotenv import dotenv_values
config = {
**dotenv_values(os.path.join(os.getcwd(), ".env")),
**os.environ
}
VERSION = "0.0.0-alfa"
APP_HOST = config['APP_HOST']
APP_PORT = int(config['APP_PORT'])
APP_DEBUG = bool(config['APP_DEBUG'])
| python |
# -*- coding: utf-8 -*-
""" Views for the stats application. """
# standard library
# django
# models
from .models import Stat
# views
from base.views import BaseCreateView
from base.views import BaseDeleteView
from base.views import BaseDetailView
from base.views import BaseListView
from base.views import BaseUpdat... | python |
"""Session class and utility functions used in conjunction with the session."""
from .session import Session
from .session_manager import SessionManager
__all__ = ["Session", "SessionManager"]
| python |
''' 046 Faça um programa que mostre na tela uma contagem regressiva para o estouro de fogos de artifício, indo de 10 até 0
, com um pausa de 1 seg entre eles'''
from time import sleep
for c in range(10, -1, -1):
print(c)
sleep(1)
print('Fogos !!!!!') | python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Author: Shun Arahata
"""
Imitation learning environment
"""
import pathlib
# import cupy as xp
import sys
import numpy as xp
current_dir = pathlib.Path(__file__).resolve().parent
sys.path.append(str(current_dir) + '/../mpc')
sys.path.append(str(current_dir) + '/../')
from ... | python |
# -*- Python -*-
# Copyright 2021 The Verible Authors.
#
# 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 la... | python |
# https://github.com/ArtemNikolaev/gb-hw/issues/23
def run(array):
return [
array[i]
for i in range(1, len(array))
if array[i] > array[i-1]
]
test_input = [300, 2, 12, 44, 1, 1, 4, 10, 7, 1, 78, 123, 55]
print(run(test_input))
| python |
import glob
from hdf5_getters import *
import os
import numpy as np
from collections import Counter
from music_utils import *
tags_list = []
data_path = "/mnt/snap/data/"
count = 0
for root, dirs, files in os.walk(data_path):
files = glob.glob(os.path.join(root, '*h5'))
#if count > 1000: break
for f in fi... | python |
#!/usr/bin/env python3
import time
from data_output import DataOutput
from html_downloader import HtmlDownloader
from html_parser import HtmlParser
__author__ = 'Aollio Hou'
__email__ = 'aollio@outlook.com'
class Spider:
def __init__(self):
self.downloader = HtmlDownloader()
self.parser = HtmlPa... | python |
from django import forms
from .models import Project
class ProjectForm(forms.ModelForm):
class Meta:
model = Project
fields = ["title", "describe", "technology"]
| python |
#!/usr/bin/env python
# encoding: utf-8
"""Terminal UI for histdata_downloader project."""
import os
import sys
import logging
import subprocess
from datetime import date
import time
import npyscreen
from histdata_downloader.logger import log_setup
from histdata_downloader.histdata_downloader import load_available_p... | python |
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Jython example AMF server and client with Swing interface.
@see: U{Jython<http://pyamf.org/wiki/JythonExample>} wiki page.
@since: 0.5
"""
import logging
from wsgiref.simple_server import WSGIServer, WSGIRequestHandler
from pyamf.remoting.gatewa... | python |
from autodisc.systems.lenia.classifierstatistics import LeniaClassifierStatistics
from autodisc.systems.lenia.isleniaanimalclassifier import IsLeniaAnimalClassifier
from autodisc.systems.lenia.lenia import *
| python |
# MIT License
#
# Copyright (c) 2017 Anders Steen Christensen
#
# 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 without restriction, including without limitation the rights
# to use, copy, mo... | python |
import dash, os, itertools, flask
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import dash_html_components as html
from pandas_datareader import data as web
from datetime import datetime as dt
import plotly.graph_objs as go
import pandas as pd
from random import randint
import p... | python |
import tanjun
import typing
from hikari import Embed
from modules import package_fetcher
component = tanjun.Component()
@component.with_command
@tanjun.with_argument("repo_n", default="main")
@tanjun.with_argument("arch_n", default="aarch64")
@tanjun.with_argument("pkg_n", default=None)
@tanjun.with_parser
@tanjun.a... | python |
# Copyright 2020 The FastEstimator 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 appl... | python |
import data
from base import nbprint
from tokenizer.main import run_tokenizer
def check_requirements(info):
# Check if tokens file exists
if not data.tokenized_document_exists(info):
# Run Tokenizer
nbprint('Tokens missing.')
run_tokenizer(info)
# Check if it was successfull
... | python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###########################################################
# WARNING: Generated code! #
# ************************** #
# Manual changes may get lost if file is generated again. #
# Only code inside the [MANUAL] ta... | python |
import numpy as np
a = input("enter the matrix with ; after each row : ")
m =np.matrix(a)
b = input("enter the matrix 2 with row matching with matrix 1 : ")
n =np.matrix(b)
print(m)
print(n)
m3 = np.dot(m,n)
print(m3) | python |
#//////////////#####///////////////
#
# ANU u6325688 Yangyang Xu
# Supervisor: Dr.Penny Kyburz
# SPP used in this scrip is adopted some methods from :
# https://github.com/yueruchen/sppnet-pytorch/blob/master/cnn_with_spp.py
#//////////////#####///////////////
"""
Policy Generator
"""
import torch.nn as nn
from GAIL.... | python |
#!/usr/bin/env python3
from __future__ import print_function
import sys
import os
import time
sys.path.append('..')
import childmgt.ChildMgt
def create_children(num_children=5):
for child_num in range(0, num_children):
child_pid = os.fork()
if child_pid == 0:
time.sleep(3)
s... | python |
#!/usr/bin/env python
import rospy
from week2.srv import roboCmd, roboCmdResponse
import math as np
class Unicycle:
def __init__(self, x, y, theta, dt=0.05):
self.x = x
self.y = y
self.theta = theta
self.dt = dt
self.x_points = [self.x]
self.y_points = [self.y]
... | python |
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
"""
Get Jc, RA, etc from measured parameter DB
BB, 2015
"""
import sqlite3
import numpy as np
import matplotlib.pyplot as plt
# display units
unit_i = 1e-6 # uA
unit_v = 1e-6 # uV
unit_r = 1 # Ohm
unit_i1 = 1e-3 # mA; control I
unit_v1 = 1e-3 # mV; cont... | python |
#
# PySNMP MIB module ZHONE-COM-IP-DHCP-SERVER-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ZHONE-COM-IP-DHCP-SERVER-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:40:42 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python vers... | python |
"""Implementation classes that are used as application configuration containers
parsed from files.
"""
__author__ = 'Paul Landes'
from typing import Dict, Set
import logging
import re
import collections
from zensols.persist import persisted
from . import Configurable, ConfigurableError
logger = logging.getLogger(__n... | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.