content stringlengths 5 1.05M |
|---|
from libpysal.examples import load_example
import geopandas as gpd
import numpy as np
from segregation.multigroup import MultiDissim
from segregation.dynamics import compute_multiscalar_profile
import quilt3
import pandana as pdna
p = quilt3.Package.browse('osm/metro_networks_8k', "s3://spatial-ucr/")
p['40900.h5'].f... |
import tensorflow as tf
from tensorflow.keras.layers import LSTM, Dense
from tensorflow.keras.callbacks import TensorBoard
from TensorflowLearning.common import deal_label
n_inputs = 28 # 一次传1行,传28个像素
max_time = 28 # 一幅图有28行
lstm_size = 100 # 100个cells
n_classes = 10
batch_size = 100
(train_images, train_labels), ... |
from click.testing import CliRunner
import packtivity.cli
def test_maincli(tmpdir):
runner = CliRunner()
result = runner.invoke(
packtivity.cli.runcli,
[
"tests/testspecs/localtouchfile.yml",
"-p",
'outputfile="{workdir}/hello.txt"',
"-w",
... |
# Gevent imports
import gevent
from gevent.queue import Queue
import gevent.socket as socket
from gevent.event import Event
import logging
import pprint
import urllib
class NotConnectedError(Exception):
pass
class ESLEvent(object):
def __init__(self, data):
self.parse_data(data)
def parse_data... |
import tensorflow as tf
lstm_cell = tf.contrib.rnn.LSTMCell(
256,
state_is_tuple=False,
)
print lstm_cell.zero_state(64,tf.float32) |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Lane detection functions
'''
import math
import cv2
import numpy as np
import matplotlib.image as mpimg
from functools import partial
from moviepy.editor import VideoFileClip
def convert_colorspace(img, colorspace='grayscale'):
"""Converts RGB image to another c... |
# Copyright 2018 The Bazel 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 la... |
# Programa que quando informado a medida em metros retorne ela em: km, hm, dam, dm, cm, mm
try:
medida = float(input("Informe a medida em Metros: "))
print(f"Em km: {medida/1000}km")
print(f"Em hm: {medida/100}hm")
print(f"Em dam: {medida/10}dam")
print(f"Em dm: {medida*10}dm")
print(f"Em cm: {m... |
# I made an external file so to be able to add features when needed.
from lib.server import hcX
if __name__ == '__main__':
# run the server..
hcX.main()
|
import uuid
from sqlalchemy import Column, DateTime, ForeignKey, String, UniqueConstraint, func
from sqlalchemy.orm import backref, relationship
from quetz.db_models import UUID, Base
class TermsOfService(Base):
__tablename__ = 'quetz_tos'
id = Column(UUID, primary_key=True, default=lambda: uuid.uuid4().by... |
from sqlalchemy import Column, Integer, String, Boolean
from common.base import Base
class Tile(Base):
__tablename__ = 'tile'
id = Column(Integer, primary_key=True)
name = Column(String)
display_emoji = Column(String)
interactive = Column(Boolean, default=False)
traversable = Column(Boolean,... |
from flask import Flask, render_template, request, redirect, url_for, flash, jsonify
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from database_setup import Base, Restaurant, MenuItem
app = Flask(__name__)
# engine = create_engine('sqlite:///restaurantmenu.db?check_same_thread=False')
... |
# Copyright 2016 IBM Corp.
#
# 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 agree... |
"""Work derived from curio written by David Beazley.
Reference:
https://github.com/dabeaz/curio/blob/3d610aea866178800b1e5dbf5cfef8210418fb58/curio/meta.py
Removed in:
https://github.com/dabeaz/curio/commit/66c60fec61610ae386bc03717724e6438948a419
See original licenses in:
https://github.com/dabeaz/curio/b... |
#!/usr/bin/env python
# Copyright 2013-2019 Lukas Burget, Mireia Diez ([email protected], [email protected])
# Licensed under the Apache License, Version 2.0 (the "License")
import numpy as np
import scipy.linalg as spl
import errno, os
from scipy.special import softmax
def twoGMMcalib_lin(s, niters=20):
""... |
"""GARET is Generic Average Reward Environment Testbed.
It is a special case of Bhatnagar et al.'s GARNET:
https://era.library.ualberta.ca/items/8fc4a1f6-95c9-4da8-aecd-96867babdf4c
The current implementation does not support online, sample-based operation.
Instead, it is appropriate for value/policy iteration algor... |
#! /usr/bin/env python3
######################################################################
#
# TOSCA Implementation Landscape
# Copyright (c) 2021 Inria
#
# This software is distributed under the Apache License 2.0
# the text of which is available at http://www.apache.org/licenses/LICENSE-2.0
# or see the "LICENSE-... |
import data.fonts.character
class MetaFile:
def __init__(self, file, text_mesh_creator):
self.PAD_TOP = 0
self.PAD_LEFT = 1
self.PAD_BOTTOM = 2
self.PAD_RIGHT = 3
self.DESIRED_PADDING = 3
self.SPLITTER = " "
self.NUMBER_SEPARATOR = ","
... |
from .code import qsort as sort_func
EXAMPLES = [
[],
[1],
[1, 2],
[2, 1],
[1, 1],
[1, 2, 3],
[1, 3, 2],
[2, 1, 3],
[2, 3, 1],
[3, 1, 2],
[3, 2, 1],
[1, 2, 2],
[1, 1, 2],
[1, 1, 1],
]
def print_examples():
for example in EXAMPLES:
try:
pr... |
# -*- coding: utf-8 -*-
import io
import ast
from re import compile
from setuptools import setup
def _get_version():
version_re = compile(r"__version__\s+=\s+(.*)")
with open("up2s3.py", "rb") as fh:
version = ast.literal_eval(
version_re.search(fh.read().decode("utf-8")).group(1)
... |
from __future__ import unicode_literals
from django.apps import AppConfig
class ThreadsConfig(AppConfig):
name = 'threads'
|
from __future__ import absolute_import, division
from __future__ import print_function
import matplotlib.pyplot as plt
from jax.api import jit, grad
from jax.config import config
import jax.numpy as np
import jax.random as random
import numpy as onp
import sys
JAX_ENABLE_X64=True
np.set_printoptions(threshold=sys.max... |
# coding:utf-8
import logging
import time
import xlwings as xw
import pandas as pd
import re
import datetime
import pythoncom
logger = logging.getLogger('ghost')
class BoardExcel(object):
'''
基带板测试模板
'''
sheets_name = ['整机设定', '定标', '灵敏度', '搜网', '自激']
dl_keywords = ['基带设定', '输出功率测试', 'EVM测试', 'A... |
import numpy as np
from nn.nn import NN
from config import config
from mcts import UCTPlayGame
import cPickle as pickle
import os
if __name__ == "__main__":
""" Play a single game to the end using UCT for both players.
"""
nn = NN(config)
nn.setup()
pickle.dump(config, open(o... |
from .knn import NNClassifier
from .sklearn import SKLearnKnnClassifier, SKLearnSVMClassifier
|
# Copyright 2017 Battelle Energy Alliance, LLC
#
# 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 t... |
from __future__ import division, absolute_import, with_statement
import io
import sys
import math
import logging
import warnings
from datetime import datetime, timedelta
import collections
from . import widgets
from . import widgets as widgets_module # Avoid name collision
from . import six
from . import utils
from .... |
# Generated by Django 3.1.13 on 2021-12-06 07:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('xero', '0005_auto_20210308_0707'),
]
operations = [
migrations.AlterField(
model_name='banktransactionlineitem',
na... |
import logging
from typing import Dict, List, Tuple
import torch
from allennlp.common.util import pad_sequence_to_length
from allennlp.data.token_indexers import PretrainedTransformerIndexer
from allennlp.data.token_indexers.token_indexer import IndexedTokenList, TokenIndexer
from allennlp.data.tokenizers.token import... |
#coding=utf-8
"""
__create_time__ = '13-10-29'
__author__ = 'Madre'
"""
from django.forms import ModelForm, CharField, Textarea
from brief.models import Brief
class BriefCreateForm(ModelForm):
brief = CharField(max_length=1000, widget=Textarea(attrs={'cols': 2, 'rows': 2}))
class Meta:
model = Brief
... |
# Generated by Django 2.1 on 2019-03-13 02:22
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Crea... |
#!/usr/bin/python
from __future__ import absolute_import, print_function, unicode_literals
from setuptools import setup, find_packages
setup(
name="dice",
version="3.1.2",
author="Sam Clements",
author_email="[email protected]",
url="https://github.com/borntyping/python-dice",
description="... |
#!/usr/bin/env python3
# -*-Python-*-
#
# Contains the process_rst() function, which turns ReST files into
# HTML output that can be included in a page.
#
import io
from docutils import core
from docutils.writers import html4css1
class WeblogWriter (html4css1.Writer):
def __init__ (self):
super().__init__... |
import marshal,zlib,base64
exec(marshal.loads(zlib.decompress(base64.b16decode("789CED7D09781CD779D89B5D2C80C57D1120780E49110429E15A5C04259022095E122F2F4981A2CC6C063B036080BDB8334B0232683B96EBCF69D3D87224CB75E42B75DCA47595D64913E7FCECAF4DE2A4B19DE48B73D5496CBA8E93A66E92B6768E3A71FFFF7FEFCDB13BBB58502225C7E2F1F6CD9B77CD... |
#!/usr/bin/env python
#coding:utf-8
import xlsxwriter
datos = [{'item1':1, 'item2':2, 'item3':3 }, {'item1':1, 'item2':3, 'item3':5 }]
# Seteo las filay columna inicial
row = 0
col = 0
# Creo el libro y le agrego una hoja
workbook = xlsxwriter.Workbook('tablaConFormulas.xlsx')
worksheet = workbook.add_worksheet()
#... |
from men_and_mice_base_action_test_case import MenAndMiceBaseActionTestCase
from run_operation import RunOperation
from run_operation import CONFIG_CONNECTION_KEYS
from st2common.runners.base_action import Action
import copy
import mock
import zeep
import logging
class TestActionRunOperation(MenAndMiceBaseActionTes... |
# Copyright 2016 Semaphore Solutions, Inc.
# ---------------------------------------------------------------------------
from ._internal import ClarityElement
from six import BytesIO, StringIO, string_types
import logging
import os
from . import ETree
from ._internal.props import subnode_property
from .exception im... |
__all__ = [
"ATOMIC_RADII",
"KHOT_EMBEDDINGS",
"CONTINUOUS_EMBEDDINGS",
"MAX_ATOMIC_NUM",
]
from .atomic_radii import ATOMIC_RADII
from .continuous_embeddings import CONTINUOUS_EMBEDDINGS
from .khot_embeddings import KHOT_EMBEDDINGS
MAX_ATOMIC_NUM = 100
|
class Solution:
def nth(self, n: int, verbose=False):
if n == 1:
return "1"
if n == 2:
return "11"
s = "11"
for i in range(3, n + 1):
if verbose:
print(s)
s += "$"
l = len(s)
cnt = 1
t... |
# -*- coding: utf-8 -*-
# Copyright (C) 2017 by Juancarlo Añez
# Copyright (C) 2012-2016 by Juancarlo Añez and Thomas Bragg
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
from grako.parser import GrammarGenerator
from grako.tool import compile
from grako.util i... |
"""
geometry
~~~~~~~~
Methods to help with geometry work. Uses `shapely`.
"""
import numpy as _np
import math as _math
from . import data as _data
import logging as _logging
# For what we use this for, we could use e.g binary search; but why re-invent
# the wheel?
import scipy.optimize as _optimize
_logger = _loggi... |
def selection_6():
# Library import
import numpy
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
# Library version
matplotlib_version = matplotlib.__version__
numpy_version = numpy.__version__
# Histo binning
xBinning = numpy.lin... |
#!/usr/bin/python3
"""
Login Manager
"""
import math
import os
import sys
import time
import cairo
import yutani
import text_region
import toaru_fonts
import fswait
import panel
from panel import PanelWindow, FillWidget, VolumeWidget, NetworkWidget, DateWidget, ClockWidget, RestartMenuWidget, LabelWidget
from inpu... |
import requests
from selenium import webdriver
from bs4 import BeautifulSoup
session = requests.Session()
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) '
'Chrome/58.0.3029.110 Safari/537.36'
}
proxies = {
'http': 'socks5://... |
from sandbox.rocky.tf.algos.maml_il import MAMLIL
from rllab.baselines.linear_feature_baseline import LinearFeatureBaseline
from rllab.baselines.gaussian_mlp_baseline import GaussianMLPBaseline
from rllab.baselines.maml_gaussian_mlp_baseline import MAMLGaussianMLPBaseline
from rllab.baselines.zero_baseline import Zero... |
"""
Zinc Material Chooser Widget
Widget for chooses a material from a material module, derived from QComboBox
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
try:
f... |
from .base_controller import BaseController
from telebot import TeleBot
from telebot.types import InlineKeyboardButton
from repositories.callback_types import NoneCallback
class NoneController(BaseController):
def callback_name(self) -> str:
return self.callback_name
def get_menu_btn(self) -> Inline... |
from django.contrib import admin
from userapp import models
admin.site.site_header = u"欢迎来到逸鹏说道"
admin.site.site_title = u"逸鹏说道后台"
# Register your models here.
admin.site.register(models.Express)
admin.site.register(models.ExpressOrder)
# 文件上传
class FileInfoAdmin(admin.ModelAdmin):
list_display = ["file_md5", "... |
import requests
class API(object):
"""
A dataset on the HMD instance
"""
def __init__(self, api_token, service_url="http://api.himydata.com/v1/dataset"):
self.service_url = service_url
self.api_token = api_token
def get(self, name, data=None):
"""
Method calls the... |
# This file was automatically created by FeynRules 2.3.35
# Mathematica version: 12.1.0 for Linux x86 (64-bit) (March 18, 2020)
# Date: Tue 18 Aug 2020 11:58:04
from object_library import all_couplings, Coupling
from function_library import complexconjugate, re, im, csc, sec, acsc, asec, cot
|
from .data import Document
|
import Petrinet
#This mode is for reacheable marking
def Item4():
free = int(input("Input the token in free state: "))
wait = int(input("Input the token in wait state: "))
busy = int(input("Input the token in busy state: "))
inside = int(input("Input the token in inside state: "))
docu = int(input("Inp... |
def py2and3_test(**kwargs):
original_name = kwargs.pop("name")
kwargs["main"] = original_name + ".py"
py2_name = original_name + "_py2"
py3_name = original_name + "_py3"
native.py_test(
name = py2_name,
python_version = "PY2",
**kwargs
)
native.py_test(
name... |
# Generated by Django 3.2.4 on 2021-06-18 02:02
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('systems', '0011_auto_20210617_2159'),
]
operations = [
migrations.RemoveField(
model_name='mana... |
list = ['table','chair','sofa','couch']
list.remove('table')
print(list)
|
import torch
from .. import model
import src
class Tier_1600(model.BaseModel):
def make_layers(self, D):
return [
src.modules.Reshape(1, D),
torch.nn.Conv1d(1, 4, 3, padding=1, stride=2),
src.modules.Transpose(1, 2),
src.modules.PrototypeClassifier(4, 16),
... |
"""
Removes stop words produced from the script SemanticParser.py when deriving the method call dependency graph.
ex. python remove_stop_words.py [input].csv [output].csv
"""
import csv
import sys
ebc_stop_words = ['com', 'ibm', 'elastic', 'build', 'cloud', 'api', 'core', 'external', 'system', 'bundle', 'feature', '... |
import pandas as pd
import numpy as np
from webull import paper_webull
# from webull import webull
from datetime import datetime
import time
import sched
import requests #for api considered gold standard for executing http request
import math # math formulas
from scipy.stats import percentileofscore as score # makes ... |
from setuptools import setup
try:
import enum # noqa
extra_requires = []
except ImportError:
extra_requires = ['enum34']
REQUIRES = ['marshmallow>=2.0.0'] + extra_requires
with open('README.md', 'r') as f:
readme = f.read()
with open('CHANGELOG', 'r') as f:
changelog = f.read()
if __name__ =... |
"""Class that defines the Mine Sweeper Game.
Author: Yuhuang Hu
Email : [email protected]
"""
from __future__ import print_function
from msboard import MSBoard
class MSGame(object):
"""Define a Mine Sweeper game."""
def __init__(self, board_width, board_height, num_mines,
port=5678, ip_... |
#%%
nboard = \
[[".",".",".",".","5",".",".","1","."],\
[".","4",".","3",".",".",".",".","."],\
[".",".",".",".",".","3",".",".","1"],\
["8",".",".",".",".",".",".","2","."],\
[".",".","2",".","7",".",".",".","."],\
[".","1","5",".",".",".",".",".","."],\
[".",".",".",".",".","2","."... |
# Copyright 2015 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 by applicable law or agreed ... |
from __future__ import print_function
import sys, os
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from h2o.automl import H2OAutoML
from tests import pyunit_utils as pu
from _automl_utils import import_dataset
def check_ignore_cols_automl(models,names,x,y):
models = sum(models.as_data_frame().valu... |
"""Universal vocoder"""
from typing import List
import torch
import torch.nn as nn
import torch.nn.functional as F
from tqdm import tqdm
from torch import Tensor
from torch.nn.utils.rnn import pad_sequence, pack_padded_sequence, pad_packed_sequence
class Vocoder(nn.Module):
"""Universal vocoding"""
def __i... |
#!/usr/bin/env python3
from test_framework.authproxy import JSONRPCException
from test_framework.test_framework import ElysiumTestFramework
from test_framework.util import assert_raises_message
class ElysiumPropertyCreationFeeTest(ElysiumTestFramework):
def get_new_address(self, default_balance = 0):
addr... |
import cv2
import numpy as np
from os import listdir
from os.path import isfile, join
screens_path = "/Users/andrewfinke/Library/Application Support/loggercli/screens/"
paths = [join(screens_path, f) for f in listdir(screens_path) if isfile(join(screens_path, f)) and ".png" in f]
combined_image = None
for index, pat... |
'''
AUTHOR :li peng cheng
DATE :2021/08/10 21:58
'''
import pandas as pd
import numpy as np
from torch.utils.data import TensorDataset, DataLoader
import torch.optim as optim
import torchtext
import torch
from collections import OrderedDict, Counter
from handle_text import *
from text_att_birnn import text_att_birnn
... |
#!/bin/python
# python-twitter docs
# https://python-twitter.readthedocs.io/en/latest/twitter.html
# Requires a json configuration file called quine_reply.config like this:
# {
# "api_key": "",
# "api_secret_key": "",
# "access_token": "",
# "access_token_secret": ""
# }
import twitter
import datetime
import... |
import distance
from sklearn.feature_extraction.text import CountVectorizer
import numpy as np
import Levenshtein
# Levenshtein distance
def edit_distance(s1, s2):
return distance.levenshtein(s1, s2)
def Levenshtein_test():
filename = '/data/dataset/test.txt'
output_file = '/data/other/Levenshtein_test.cs... |
import numpy as np
from keras.datasets import imdb
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM, Convolution1D, Flatten, Dropout
from keras.layers.embeddings import Embedding
from keras.preprocessing import sequence
from keras.callbacks import TensorBoard
from keras.... |
from django.urls import path
from . import views
urlpatterns = [
path("/", views.worldmap_f, name="worldmap"),
path("/player_position_up", views.update_player_position, name="player_position_up"),
path("/player_position_down", views.update_player_position, name="player_position_down"),
path("/player_po... |
import time
import unicodedata
import feedparser
import requests
from bs4 import BeautifulSoup as soup
class RssData:
title_class = None
div_class_article = None
p_class = None
img_lookup = None
div_img_class = None
rss_url = None
@staticmethod
def __write_data(entries):
"""
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pragma pylint: disable=unused-argument, no-self-use
#
# (c) Copyright IBM Corp. 2010, 2020. All Rights Reserved.
#------------------------------------------------------------------------------------------
#
# file_summary:
# -------------
#
# res-ml stores ml model ... |
from setuptools import setup
# Available at setup time due to pyproject.toml
from pybind11.setup_helpers import Pybind11Extension
from pybind11 import get_cmake_dir
import sys
__version__ = "0.0.1"
# The main interface is through Pybind11Extension.
# * You can add cxx_std=11/14/17, and then build_ext can be removed... |
# OWI-535 Robotic Arm - Web Interface / Python + Bottle
# imports
from bottle import Bottle, run, template, request
import usb.core, usb.util, time
# attempt to rewrite lizquilty's OWI 535 Robotic Arm Control Web Interface from Apache to Python Bottle
# objectives: learning Bottle / Python
# - having a simple 1 file ... |
# Generated by Django 2.2.4 on 2019-08-28 07:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sushi', '0010_counterreporttype_code_choices'),
]
operations = [
migrations.AddField(
model_name='sushifetchattempt',
... |
from datetime import datetime
from django.db import models
from django.utils import timezone
class FlowDefinition(models.Model):
status_choices = {
'draft': '草稿',
'online': '生效',
'offline': '下线',
'del': '删除'
}
uniq_key = models.CharField(max_length=32, unique=True,)
... |
# This an autogenerated file
#
# Generated with BodyEigenvalueResult
from typing import Dict,Sequence,List
from dmt.entity import Entity
from dmt.blueprint import Blueprint
from .blueprints.bodyeigenvalueresult import BodyEigenvalueResultBlueprint
from typing import Dict
from sima.sima.moao import MOAO
from sima.sima.... |
# import important libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import seaborn as sns
import os
import argparse
# import machine learning libraries
from sklearn.linear_model import Ridge, LogisticRegression
from sklearn.svm import SVR, SVC
from s... |
import math
from blessed import Terminal
from rich.console import Console
from rich.highlighter import RegexHighlighter
from rich.panel import Panel
from rich.style import Style
from rich.text import Text
from rich.theme import Theme
from boxscript.interpreter import Interpreter
co = Console()
class BoxScriptHighl... |
import matplotlib
matplotlib.use("Agg")
from imageio import imread
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
import scipy.signal as sg
import scipy as sp
def get_im2col_indices(x_shape, field_height, field_width, padding=1, stride=1):
# from cs231n assignments
#... |
import pandas as pd
from numpy.random import default_rng
from monte_carlo.dataset_maker import _get_price
from settings import OPTIONS_PARAMS_RANDOM_SEED
from utils.typing import OptionAvgType
VARIABLE_PARAMS_NUMBER = 4
ENTRIES_NUMBER = 10000
def create_fixed_datasets():
rng = default_rng(OPTIONS_PARAMS_RANDOM... |
#-*- coding: utf-8 -*-
import sys, os
from privtext.env import _TEST_MODE
from privtext.args import get_args
from privtext.utils import cross_input
from privtext import PrivateText
import re
def run(args=None):
if args is None:
args = sys.argv[1:]
args = get_args(args=args)
if os.isatty(sys.stdout.fil... |
import locale
import icu
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.http import Http404
from django.template.response import TemplateResponse
from django.utils.translation import ugettext_lazy as _
from . import ( # NOQA
account,
agegroup,
agreements,
... |
__version__ = '3.7.13'
|
# setup.py
from setuptools import find_packages, setup
setup(
name="rl_toolkit",
version="0.0.0",
packages=find_packages(exclude=["docs", "scripts", "tests"]),
install_requires=[
"gym",
"gym_fishing",
"gym_conservation",
"numpy",
"pandas",
"matplotlib",
... |
# Generated by Django 2.1.4 on 2019-09-20 21:40
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('river', '0001_initial'),
]
operations = [
migrations.AlterField(
... |
import datetime
from typing import Text
from uuid import uuid4
import bigfastapi.db.database as db
import sqlalchemy.orm as orm
from sqlalchemy.schema import Column
from sqlalchemy.types import String, DateTime, Integer
class qrcode(db.Base):
__tablename__ = "qrcode"
id = Column(String(255), primary_key=True, ... |
from __future__ import annotations
from enum import Enum
from datetime import datetime
from jsonclasses import jsonclass, types
from jsonclasses_pymongo import pymongo
@pymongo
@jsonclass(class_graph='simple')
class SimpleCalcUser:
id: str = types.readonly.str.primary.mongoid.required
name: str
first_name... |
from django.db import models
from django.db.models.signals import post_save
from django.db.models import Sum
from django.dispatch.dispatcher import receiver
from django.shortcuts import render
from datetime import date
from collections import OrderedDict
from alunos.models import Matricula
class Mensalidade(models.Mod... |
# -*- coding: utf-8 -*-
import os
from setuptools import find_packages
from setuptools import setup
with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), "README.md")) as fp:
long_description = fp.read()
setup(
name="multicontents",
version="0.3.0",
description="providing contents from ... |
# Copyright 2011 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 by applicable law o... |
import ompc
from ompclib.ompclib_numpy import _marray, _size, _dtype
def build_return(nargout, *args):
ret = []
for x in args[:nargout]:
if isinstance(x, _marray): ret += [ x ]
else: ret += [ _marray(_dtype(x), _size(x), x) ]
if len(ret) == 1:
ret = ret[0]
return ret... |
# Import required MicroPython libraries.
from usys import stdin
from uselect import poll
# Register the standard input so we can read keyboard presses.
keyboard = poll()
keyboard.register(stdin)
while True:
# Check if a key has been pressed.
if keyboard.poll(0):
# Read the key and print it.
k... |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import StringIO
import sys
import os
import optparse
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.pat... |
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
"""
Module encapsulates the interactions with the uw_gws,
valid endorser authorization test
Valid endorsers are defined as being in the GWS group defined
by VALID_ENDORSER_GROUP. Unless defined in settings, the group
used for valid... |
# coding: utf-8
import chainer
import chainer.functions as F
class Default(chainer.Chain):
def __init__(self):
super(Default, self).__init__()
def forward(self, x):
y1 = F.leaky_relu(x)
return y1
class Slope(chainer.Chain):
def __init__(self):
super(Slope, self).__init... |
from .functions import evaluate, init_params, train # NOQA
|
# coding: utf-8
from django.shortcuts import render, get_object_or_404
#from social.apps.django_app.default.models import UserSocialAuth
from social_django.models import UserSocialAuth
from djangobb_forum.models import Profile
from django.http import HttpResponseRedirect, HttpResponse
from django.core.paginator import ... |
import string
import random
s1 = string.ascii_lowercase
s2 = string.ascii_uppercase
s3 = string.digits
s4 = string.punctuation
s = []
s.extend(s1)
s.extend(s2)
s.extend(s3)
s.extend(s4)
while True:
plen = int(input("Enter Length Of Password: "))
random.shuffle(s)
password = s[0:plen]
print("Your Passwor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.