text stringlengths 2 999k |
|---|
import machine
t = machine.WDT(0, 5000) # init wdt 0, timeout 5s
t.feed() # feed it
t.delete() # close it
# t.feed() # feed it
import time
while True:
print("watchdog...")
# t.feed() # feed it
time.sleep(1)
|
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import atexit
import contextlib
import sys
from .ansitowin32 import AnsiToWin32
orig_stdout = None
orig_stderr = None
wrapped_stdout = None
wrapped_stderr = None
atexit_done = False
def reset_all():
if AnsiToWin32 is... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Time : 14:31
# Email : spirit_az@foxmail.com
# File : soundLabel.py
# +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ #
# +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ #
# +--+--+--+--+... |
from flask_wtf import Form
from wtforms import StringField, TextAreaField, BooleanField, SelectField,\
SubmitField
from wtforms.validators import Required, Length, Email, Regexp
from wtforms import ValidationError
from flask_pagedown.fields import PageDownField
from ..models import Role, User
class NameForm(Form)... |
# -*- coding: utf-8 -*-
"""Generate the Resilient customizations required for fn_secureworks_ctp"""
try:
from resilient import ImportDefinition
except ImportError:
# Support Apps running on resilient-circuits < v35.0.195
from resilient_circuits.util import ImportDefinition
def codegen_reload_data():
... |
# coding: utf-8
#
# Copyright 2019 The Oppia 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 requi... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2015 jaidev <jaidev@newton>
#
# Distributed under terms of the MIT license.
"""Tools for pushing pandas dataframes into aerospike servers."""
import aerospike
class DataFrameExporter(object):
def __init__(self, namespace=None, data... |
# Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'includes':
[
'../build/standalone.gypi',
'../build/common.gypi',
'compiler.gypi',
'libGLESv2.gypi',
... |
#!/usr/bin/env python3
# Copyright (c) 2016-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test label RPCs.
RPCs tested are:
- getaddressesbylabel
- listaddressgroupings
- setlabel
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import unittest
import random
from mongodb_store.message_store import MessageStoreProxy
from std_msgs.msg import String
from geometry_msgs.msg import Pose, Point, Quaternion
import rospy
class TestMessageStoreProxy(unittest.TestCase):
def test_add_message(... |
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.db.models import Q, Sum
from django.http import HttpRequest
from django.shortcuts import redirect
from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _
from django.views.gen... |
import graphene
from graphene_django.types import DjangoObjectType
from tiveU.news.models import News
from tiveU.helpers import paginate_data
class NewsType(DjangoObjectType):
"""DjangoObjectType to acces the News model."""
count_thread = graphene.Int()
count_likers = graphene.Int()
class Meta:
... |
import pandas as pd
import re
from collections import OrderedDict
def parse_inferExperiment(sample, file):
"""Parse rseqc infer expeirment.
Parameters
----------
sample: str
Sample name which will be added as row index.
file: str
Path to the fastqc zip file.
"""
with open(f... |
#!/usr/bin/env python
"""
mbed CMSIS-DAP debugger
Copyright (c) 2015-2018 ARM Limited
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 r... |
# bdateutil
# -----------
# Adds business day logic and improved data type flexibility to
# python-dateutil. 100% backwards compatible with python-dateutil,
# simply replace dateutil imports with bdateutil.
#
# Author: ryanss <ryanssdev@icloud.com>
# Website: https://github.com/ryanss/bdateutil
# License: MIT ... |
from setuptools import setup, find_packages
requirements = [
"python-vlc",
"pyyaml",
"protobuf",
"flask",
]
dev_requirements = [
'black',
'flake8',
'isort',
'mypy',
'mypy-protobuf',
'pylint',
'pylint-flask',
'pytest',
'pytest-cov',
'pytest-env',
'pytest-mock... |
from setuptools import setup
import codecs
with codecs.open("README.rst", encoding="utf-8") as f:
long_description = f.read()
setup(
name = "pyPGdiff",
version = "0.1.3",
description = "Generate on-the-fly migrations between PostgreSQL schemas",
long_description = long_description,
url = "htt... |
import dash
from dash_google_charts import Sankey
app = dash.Dash()
app.layout = Sankey(
height="400px",
data=[
["From", "To", "Weight"],
["A", "X", 5],
["A", "Y", 7],
["A", "Z", 6],
["B", "X", 2],
["B", "Y", 9],
["B", "Z", 4],
],
)
if __name__ == "... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
##
## lbx.py
##
## Created on: Jan 9, 2017
## Author: Alexey S. Ignatiev
## E-mail: aignatiev@ciencias.ulisboa.pt
##
"""
===============
List of classes
===============
.. autosummary::
:nosignatures:
LBX
==================
... |
"""Classes for controlling sampling of Markov chains split into stages."""
import abc
from collections import OrderedDict, namedtuple
ChainStage = namedtuple("ChainStage", ["n_iter", "adapters", "trace_funcs"])
class Stager(abc.ABC):
"""Abstract chain iteration stager."""
@abc.abstractmethod
def stage... |
import keyword
import os
from pycharm_generator_utils.util_methods import *
is_pregenerated = os.getenv("IS_PREGENERATED_SKELETONS", None)
class emptylistdict(dict):
"""defaultdict not available before 2.5; simplest reimplementation using [] as default"""
def __getitem__(self, item):
if item in sel... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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 _utilities
__... |
# coding: utf-8
import os
import subprocess
import numpy as np
import caffe
def main():
if os.path.isfile('../models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel'):
print('CaffeNet found.')
else:
print('Downloading pre-trained CaffeNet model...')
subprocess.call(['pytho... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
"""Test the stream worker corner cases.
Exercise the stream worker functionality by mocking av.open calls to return a
fake media container as well a fake decoded stream in the form of a series of
packets. This is needed as some of these cases can't be encoded using pyav. It
is preferred to use test_hls.py for example... |
import argparse
import logging
from experiments.common.definitions import remat_data_dir
from experiments.common.graph_plotting import plot
from remat.core.dfgraph import gen_linear_graph
from remat.core.enum_strategy import ImposedSchedule
from remat.core.solvers.lower_bound_lp import lower_bound_lp_relaxation
from r... |
num = int(input('Digite um número e veja se ele é par ou impar:'))
if num % 2 == 0:
print('O número digitado é par!')
else:
print('O número digitado é impar!')
|
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import un... |
import os
class Config:
FLASK_APP = os.getenv("FLASK_APP")
FLASK_ENV = os.getenv("DEVELOPMENT")
DEBUG = False
DEVELOPMENT = False
SECRET_KEY = os.getenv("SECRET_KEY", "this-should-be-changed-to-a-real-key")
class ProductionConfig(Config):
pass
class StagingConfig(Config):
DEBUG = True
cl... |
from dbfaker.cli import run
from dbfaker.cli import faker
from dbfaker.utils.gendata import DataGenerator
from dbfaker import table2yml |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
"""Image encoder using ResBlocks"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from geneva.definitions.res_blocks import ResDownBlock
class ImageEncoder(nn.Module):
def __init__(self, cfg):
... |
# ******************************************************************************
# This file is part of the AaMakro5oul project
# (An OSC/MIDI controller for Ableton Live with DJ features)
#
# Full project source: https://github.com/hiramegl/AaMakro5oul
#
# License : Apache License 2.0
# Full license: https://githu... |
# Copyright 2013-2022 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.package import *
class RScatterpie(RPackage):
"""Scatter Pie Plot.
Creates scatterpie plots, especia... |
from training_data.eddies import eddy_detection,dataframe_eddies,plot_eddies,julianh2gregorian
from tools.machine_learning import sliding_window
from matplotlib.patches import Rectangle
from tools.load_nc import load_netcdf4
from numpy import savez_compressed
import matplotlib.pyplot as plt
from tools.bfs import bfs
fr... |
from tweet_builder import TweetBuilder
def handler(event, context):
return TweetBuilder().post_tweet()
|
import math, mpmath
__all__ = [
'computation_time_device_1',
'downlink_data_rate',
'downloading_transmission_time',
'energy_consumption_device_1',
'energy_consumption_device_2',
'energy_consumption_local',
'eta',
'exec_time_edge',
'exec_time_local',
'offloading_transmission_ener... |
# coding: utf-8
from __future__ import unicode_literals
import re
import time
import itertools
from .common import InfoExtractor
from .naver import NaverBaseIE
from ..compat import compat_str
from ..utils import (
ExtractorError,
merge_dicts,
remove_start,
try_get,
urlencode_postdata,
)
class VL... |
from collections import defaultdict
from ..core import OrderedDict
from ..core import Store
class KeywordSettings(object):
"""
Base class for options settings used to specified collections of
keyword options.
"""
# Dictionary from keywords to allowed bounds/values
allowed = {}
defaults = O... |
import os
import json
import numpy as np
import pandas as pd
import FeaturesStack as FS
def calculate_gmdh_model(img_f):
if task_type == "1":
if sensor_type == "convex":
prob = (
-0.946477
+ img_f["std_vert"] * np.cbrt(img_f["P95(1)_vert"]) * 0.01712... |
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 14 19:28:11 2020
@author: Ray
@email: 1324789704@qq.com
@wechat: RayTing0305
"""
###chapter5
import pandas as pd
from pandas import Series, DataFrame
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(12345)
plt.rc('figure', figsize=(10,... |
import pytest
from webtest import TestApp
from pyramid.config import Configurator
from pyramid.response import Response
def test_app():
def hello(request):
return Response('Hello world!')
config = Configurator()
config.add_route('hello_world', '/')
config.add_view(hello, route_name='hello_wo... |
GEONODE_TYPES = {
"vanilla": "vanilla",
"geoshape": "geoshape"
}
ISO_CATEGORIES = {
"biota": "biota",
"boundaries": "boundaries",
"climatologyMeteorologyAtmosphere": "climatologyMeteorologyAtmosphere",
"economy": "economy",
"elevation": "elevation",
"environment": "environment",
"fa... |
"""
Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
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/L... |
# coding: utf-8
"""
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environmen... |
'''blox/base.py
The base for all blox
Copyright (C) 2015 Timothy Edmund Crosley
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 u... |
#Programmer: Alfredo Yebra Jr.
#Date: September 11, 2015
#Description: This program simulates an RPN (Reverse Polish Notation) Calculator. It implements a stack of
# integers and reads a file and determines if the data is an operation or an number value. It then evaluates
# an expression and calculate... |
# Lint as: python3
# Copyright 2018, The TensorFlow Federated 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 ... |
# Copyright 2017,2018,2019,2020,2021 Sony 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... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
import pygame
from pygameUtils import displayManager
from pygameUtils import displaysConsts
import logger
import logging
from shapely.geometry import Point
cf_logger = logger.get_logger(__name__, logging.INFO)
BOARD_BOUND_RECT = pygame.Rect(400, 50, displayManager.MAIN_RECT.width-450, displayManager.MAIN_RECT.height-... |
# -*- coding: utf-8 -*-
'''
Manage the information in the aliases file
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import python libs
import os
import re
import stat
import tempfile
# Import salt libs
import salt.utils.files
import salt.utils.path
import salt.utils.stringutils
from ... |
import pickle
import sys
if __name__ == '__main__':
with open(sys.argv[1], 'rb') as f:
print(pickle.load(f)['rules']) |
# install Postman local for testing
# flask run
# Postman Testing: POST -> localhost:5000/add -> Body -> raw -> Text -> JSON
# {
# "x": 5,
# "y": 6
# }
from flask import Flask, jsonify, request
from flask_restful import Api, Resource
app = Flask(__name__)
api = Api(app)
def check_posted_data(posted_data, ... |
from unittest.mock import mock_open, patch
from y_2020.day5 import Day
with patch("builtins.open", mock_open(read_data=":")):
day = Day()
def test_preprocess_input():
day._input_data = ["FBFBBFFRLR"]
day._preprocess_input()
assert day._Day__decoded_seats == [357]
day._input_data = ["BFFFBBFRRR"... |
from typing import Optional, List
import logging
import torch
logger = logging.getLogger(__name__)
class Batch:
def __init__(
self,
x: torch.Tensor,
y: torch.Tensor,
x_len: Optional[torch.Tensor] = None,
y_len: Optional[torch.Tensor] = None,
paths: Optional[List... |
# Copyright 2020 Xilinx Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# qubit number=4
# total number=12
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += H(0) # number=1
pr... |
import numpy as np
import pytest
from numpy.testing import assert_allclose
from fracdiff import Fracdiff
from fracdiff import FracdiffStat
from fracdiff.stat import StatTester
class TestFracdiffStat:
"""
Test `FracdiffStat`.
"""
@staticmethod
def _is_stat(x):
return StatTester().is_stat(... |
from datetime import datetime
from picamera import PiCamera
from pathlib import Path
from PyQt5.QtCore import pyqtSignal, QObject
from threading import Lock, Thread
from src.cameratimerbackend import RepeatedTimer
class FileNameHelper():
def __init__(self):
# set default save directory, make folder if d... |
# -*- coding: utf-8 -*-
"""
Defines unit tests for :mod:`colour.volume.mesh` module.
"""
from __future__ import division, unicode_literals
import numpy as np
import unittest
from itertools import permutations
from colour.volume import is_within_mesh_volume
from colour.utilities import ignore_numpy_errors
__author__... |
from codegen.constants import MAX_N
from codegen.gen_parmap import signature_variables, signature_return_generics
# To generate the actual function
def generate_parmap_n_main_fn() -> str:
return f"""
def par_map_n(
func1: Callable[[], A1],
func2: Callable[[], A2],
{optional_signature_variables(start=3,... |
## Copyright 2015-2019 Ilgar Lunin, Pedro Cabrera
## 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... |
""" This file plots the trees with their predicted states for lapatinib. """
import pickle
from .figureCommon import getSetup, sort_lins
from ..plotTree import plotLineage
# open lapatinib
pik1 = open("lapatinibs.pkl", "rb")
lapt_tHMMobj_list = []
for _ in range(4):
lapt_tHMMobj_list.append(pickle.load(pik1))
l... |
from django.contrib import admin
from django.contrib.admin.sites import AdminSite
from .models import *
@admin.register(Datacenter)
class Datacenter(admin.ModelAdmin):
list_display = [field.attname for field in Datacenter._meta.fields]
list_editable = ('datacenter','order_num')
list_display_links = ()
@... |
import WRSUtil
WRSUtil.loadProject(
"MultiSceneViews", "SG1L-Capsule", "AISTSimulator", "DoubleArmV7S")
|
##############################################################################################
# Created by Fuyuan Lyu Tommy at 2018-12/18
# MIT License
# Contain GoogLeNet Structure
##############################################################################################
import util.layer as layer
impor... |
from collections import Counter
from multiprocessing import Queue, Process
from queue import Empty
from typing import Tuple
import numpy as np
from allennlp.common.testing import AllenNlpTestCase
from allennlp.data.dataset_readers import MultiprocessDatasetReader, SequenceTaggingDatasetReader
from allennlp.data.datas... |
import requests
import threading
from random import randrange
import datetime
def getUrl(limit) :
# url = f"https://e9ea25810dfb.ngrok.io?limit={limit}"
url = f"http://localhost:3000?limit={limit}"
payload = {}
headers= {}
i=0
while i<1000:
try:
s = datetime.datetime.now()
response = reques... |
import copy
import json
from collections import Mapping
from inspect import isclass
from .base import Environment, Object
from .naming import Namable, frozendict
from .typing import Type, TypeCheck, TypeFactory, TypeMetaclass
class Empty(object):
"""The Empty sentinel representing an unspecified field."""
pass
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from abc import ABCMeta, abstractmethod, abstractproperty
import logging
# https://stackoverflow.com/questions/13646245/is-it-possible-to-make-abstract-classes-in-python
class BaseFilter:
__metaclass__ = ABCMeta
def __init__(self, filterConfig):
self.fil... |
import unittest
from validate import extract_students
class IncorrectTests(unittest.TestCase):
def test_nothing_found(self):
names = extract_students("./tests/incorrect_file.c")
self.assertEqual(0, len(names))
if __name__ == '__main__':
unittest.main()
|
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/master/LICENSE
import argparse
import ast
import copy
import os
import sys
from collections import OrderedDict
import yaml
CURRENT_DIR = os.path.dirname(os.path.realpath(__file__))
KERNEL_WHITELIST = [
"awkward_new_Identities",
"awkwa... |
# Copyright (c) 2020 The ZMK Contributors
#
# SPDX-License-Identifier: MIT
'''Test runner for ZMK.'''
import os
import subprocess
from textwrap import dedent # just for nicer code indentation
from west.commands import WestCommand
from west import log # use this for user output
class Tes... |
# https://www.python.org/dev/peps/pep-0440/
version_str = "0.4.3"
|
from .. import Provider as CompanyProvider
class Provider(CompanyProvider):
formats = (
'{{last_name}} {{company_suffix}}',
'{{last_name}} {{last_name}} {{company_suffix}}',
'{{last_name}}',
'{{last_name}}',
)
nouns = (
'a segurança', 'o prazer', 'o conforto', 'a s... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import locale
import sys
import time
from tailer import head, tail, follow_path
def _test():
import doctest
doctest.testmod()
def _m... |
import os
import subprocess
from django.conf import settings
from django.core.checks import Warning, register
from papermerge.core.importers.imap import login as imap_login
USED_BINARIES = {
settings.BINARY_FILE: {
"msg": (
"Without it, Papermerge won't be"
" "
"able ... |
# Copyright (c) MONAI Consortium
# 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, so... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from shop.modifiers.base import BaseCartModifier
class ShippingModifier(BaseCartModifier):
"""
Base class for all shipping modifiers.
"""
def get_c... |
#!/usr/bin/env python3
# @generated AUTOGENERATED file. Do not Change!
from dataclasses import dataclass
from datetime import datetime
from gql.gql.datetime_utils import DATETIME_FIELD
from gql.gql.graphql_client import GraphqlClient
from gql.gql.client import OperationException
from gql.gql.reporter import FailedOper... |
#!C:\Users\jerry\AppData\Local\RLBotGUI\MyBots\BeardBot\BeardBot\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip3'
__requires__ = 'pip==19.0.3'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|... |
from .CloneProgress import CloneProgress
from .git import clone_repository, remove_local_changes, update_repository
from .NotAGitRepo import NotAGitRepo
|
import webbrowser
from pathlib import Path
import sys
import argparse
from gitgud import __version__
from gitgud.operations import Operator, get_operator, InitializationError
from gitgud.skills.definition import gitgud_skills
from gitgud.user_messages import force_initializing
from gitgud.user_messages import cant_i... |
from sqlalchemy import *
from sqlalchemy.types import *
from sqlalchemy.ext.declarative import declarative_base
class Weibo(declarative_base()):
__tablename__ ='weibo'
id = Column(Integer,primary_key=True)
weibo = Column(Text)
user_id = Column(Integer)
weibo_id = Column(Integer)
url = Col... |
from .flow_model import FlowModel
from .flow_att_model import FlowAttModel
|
# Generated by Django 3.2 on 2021-04-25 00:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('registration', '0002_auto_20210424_1959'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='id'... |
# -*- coding: utf-8 -*-
from abc import ABCMeta, abstractmethod, abstractproperty
import re
from textwrap import dedent
import numpy as np
def funccall(name, args):
# Delimit such that we have one (indented) argument per line
sep = ',\n' + ' '*(len(name) + 1)
cal = sep.join(args).split('\n')
# Add ... |
import uuid
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Psv(models.Model):
id = models.UUIDField(_("PSV Id"), primary_key=True, default=uuid.uuid4, editable=False)
type = models.ManyToManyField("users.UserType", verbose_name=_("P.S.V types"),)
name = models.... |
#O exercício pede para fazer um jogo da velha, porém foi feito sem usar funções, uma vez que no capítulo onde esse exercício esta localizado não havia sido ensinado ainda a usar funções.
intro = input("Bem-vindo ao Jogo da Velha! (pressione Enter para começar):")
vez_do_jogador = False
vitoria = False
numero_rodada = ... |
# -*- coding: utf-8 -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##... |
import os
import sys
import multiprocessing
import copyreg
import types
import time
from six import string_types
from progressbar import ProgressBar, FormatLabel, Percentage, Bar, ETA
import numpy as np
import pandas as pd
from subprocess import Popen
from collections import OrderedDict
from basic_class import BasicCla... |
import requests
import time
token = "TOKEN"
headers = {
'User-Agent' : 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7',
'Authorization' : token
}
id = input(f"[?] Salon ID: ")
print("")
while True:
requests.post(
f"https://discord.com/api/... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 12/8/2018 6:54 PM
# @Author : chinshin
# @FileName: train_ddi.py
from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
import random
import chainer
import logging
import numpy as np
import matplotli... |
"""Implementation of special members of sys."""
from pytype import abstract
from pytype import overlay
class SysOverlay(overlay.Overlay):
"""A custom overlay for the 'sys' module."""
def __init__(self, vm):
member_map = {
"version_info": build_version_info
}
ast = vm.loader.import_name("sys"... |
import torch.nn as nn
from torch.optim import Adam
from src.models.Seq2seq import Seq2Seq
from src.models.Decoder import Decoder, OneStepDecoder, OneStepDecoderWithAttention, DecoderWithAttention
from src.models.Encoder import Encoder, EncoderAttention
from src.models.Attention import Attention
from src.data.config imp... |
# Copyright 2013-2021 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)
import pytest
import spack.cmd.diff
import spack.config
import spack.main
import spack.store
import spack.util.spack_json... |
#!/usr/bin/python
# Copyright 2016 Attic Labs, Inc. All rights reserved.
# Licensed under the Apache License, version 2.0:
# http://www.apache.org/licenses/LICENSE-2.0
import argparse, os, os.path, subprocess, sys, shutil, urlparse
def main():
parser = argparse.ArgumentParser(description='Dependency snapshotter')... |
from block import Block
from frame import Frame
from function import Function
import dis
import operator
import sys
class VirtualMachine:
UNARY_OPERATORS = {
"POSITIVE": operator.pos,
"NEGATIVE": operator.neg,
"NOT": operator.not_,
"CONVERT": repr,
"INVERT": operator.invert... |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
# -*- test-case-name: twisted.python.test.test_release -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Twisted's automated release system.
This module is only for use within Twisted's release system. If you are anyone
else, do not use it. The interface and behaviour will change without... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.