text stringlengths 2 999k |
|---|
# Generated by Django 2.1.8 on 2019-05-20 15:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('steambird', '0007_auto_20190520_1723'),
]
operations = [
migrations.AlterField(
model_name='course',
name='period',
... |
"""Forest covertype dataset.
A classic dataset for classification benchmarks, featuring categorical and
real-valued features.
The dataset page is available from UCI Machine Learning Repository
http://archive.ics.uci.edu/ml/datasets/Covertype
Courtesy of Jock A. Blackard and Colorado State University.
"""
# Aut... |
import numpy as np
import torch
from torch.nn.functional import mse_loss
from ._agent import Agent
class DQN(Agent):
'''
Deep Q-Network (DQN).
DQN was one of the original deep reinforcement learning algorithms.
It extends the ideas behind Q-learning to work well with modern convolution networks.
T... |
# -*- coding: utf-8 -*-
'''
Created on 2020-08-24
@author: Florian Stallmann
'''
from __future__ import absolute_import
import logging
import re #regex
import locale #to format number for clipboard and supertip
import bkt.dotnet as dotnet
Forms = dotnet.import_forms() #required to copy text to clipboard
import bkt
... |
from gameplay.card_constants import SPADES
# TODO:brandon.shute:2018-10-04: Allow for jokers
# TODO:brandon.shute:2018-10-14: Implement turn skip for same card
START_RANK = '3'
START_CARD_SHORT_NAME = '3'
START_CARD_SUIT = SPADES
TRUMP_CARD_SHORT_NAME = '2'
class Settings:
def __init__(self):
self.__lo... |
import logging
import math
import numpy as np
import torch
from .scheduler import Scheduler
logger = logging.getLogger(__name__)
class CosineLRScheduler(Scheduler):
"""
Cosine decay with restarts.
This is described in the paper https://arxiv.org/abs/1608.03983.
Inspiration from
https://github.... |
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.security.websocket import AllowedHostsOriginValidator
from django.core.asgi import get_asgi_application
from django.urls import path
from django_loci.channels.base import location_broadcast_path
from ... |
from time import sleep
from machine import Pin
led = Pin(5,Pin.OUT)
while True:
led.value(1)
sleep(1)
led.value(0)
sleep(1)
|
from typing import List
from pydantic import Field
from pystratis.api import Model
from .accounthistorymodel import AccountHistoryModel
class WalletHistoryModel(Model):
"""A pydantic model for a wallet history."""
history: List[AccountHistoryModel] = Field(alias='History')
"""A list of account histories."... |
"""cleanup_data.py."""
from django.core.management.base import BaseCommand
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from nautobot.extras.models import Status
class Command(BaseCommand):
"""Cleanup Database after migrations."""
help = "Clea... |
from setuptools import setup, find_packages
with open("README.md") as f:
readme = f.read()
with open("umbra/__init__.py") as f:
for line in f:
if line.startswith("__version__"):
version = line.split('"')[1]
setup(
name="umbra",
version=version,
description="Umbra - Emulating H... |
import numpy as np
import scipy as sp
from numpy import linalg as LA
from scipy.sparse import coo_matrix, csc_matrix
from scipy.sparse.linalg import spsolve
import cvxopt
import cvxopt.cholmod
def GetHomProp2D_PlaneStress(MetaDesign,E1,nu1,E2,nu2,Amat=np.eye(2)):
# Get unit cell full stiffness matrix Kuc -... |
"""
Copyright (c) 2020 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WI... |
"""
Модуль предназначен для тестирования urls проекта.
"""
from http import HTTPStatus
from django.core.cache import cache
from django.test import Client, TestCase
from posts.models import Group, Post, User
TEST_USER_USERNAME = 'amogus'
TEST_GROUP_TITLE = 'Заголовок'
TEST_GROUP_SLUG = 'test-slug'
TEST_GROUP_DESC = '... |
from django.shortcuts import render
from random import randint
# Create your views here.
def home(request):
"""home page"""
return render(request,'flashcard_app/home.html',{})
def addition(request):
"""addition page"""
#generate two new random numbers for quizz
new_num_1 = randint(0,9)
new_nu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ライブラリのインポート
import boto3
# テキストファイルから文章を読み出す
with open("./translate5.txt") as f:
input_text = f.read()
# 翻訳前の文を表示
print("------------------------------------")
print("○ 翻訳前:\n{}".format(input_text))
print("------------------------------------")
# AWSを使った翻訳の準備
tr... |
from django.db.models import Count
from ordered_model.models import OrderedModelManager
from django.db.models import Q, Subquery
from django.db.models.query import QuerySet
from django.utils import timezone
from .enums import PublisherChoices
class SponsorshipQuerySet(QuerySet):
def in_progress(self):
st... |
######################################################################
# @author : bidaya0 (bidaya0@$HOSTNAME)
# @file : program_language
# @created : Tuesday Sep 07, 2021 10:21:33 CST
#
# @description :
######################################################################
from django.db import mod... |
# coding=utf-8
# Copyright 2018 the HuggingFace Inc. team.
#
# 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... |
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 18 02:37:53 2021
@author: Mahfuz_Shazol
"""
import numpy as np
A=np.array([
[-1,4],
[2,-2]
])
lambdas,V=np.linalg.eig(A)
print('lambdas',lambdas)
#each column is separate eivactor V
print('V',V)
#A**v==Lamda**v
v=V[:,0]
print(v)
Lamda=lambdas[0]
r1=np.d... |
import smtplib, ssl
import pandas as pd
from string import Template
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from database import config
import daily_report
MY_ADDRESS = config.email_address
PASSWORD = config.app_password
from datetime import date
from lxml import html
... |
# coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.13
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from ... |
# Date: 10/21/2017
# Author: Ethical-H4CK3R
# Description: Pings Every Bot
import time
import socket
import threading
from Queue import Queue
class Ping(object):
''' Disconnects dead connecetions '''
def __init__(self):
self.dead = Queue()
def connection(self, bot):
try:bot.session.recv(1)
except socket... |
"""
Crie um programa que leia o nome e o preço de vários produtos. O programa
deverá perguntar se o usuário vai continuar.
"""
print('-'*30)
print('{: ^30}'.format('LOJA SUPER BARATÃO'))
print('-'*30)
prodcaros = totpreço = menor = cont = 0
barato = ' '
while True:
prod = str(input('Nome do produto: '))
preço... |
from django.urls import path
from .views import *
app_name = 'stories'
urlpatterns = [
path('', story_home, name = 'home'), # done
path('all/', story_list, name = 'list'), # done
path('my/', story_my, name = 'my'), # done
path('new/', story_new, name='new'),
path('new/valid/', story_valid, name='... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 10 19:56:02 2020
@author: nicholascooper
type <pyomo help --solvers> in a shell to see the supported list of solvers
https://towardsdatascience.com/modeling-and-optimization-of-a-weekly-workforce-with-python-and-pyomo-29484ba065bb
https://www.ima.... |
class Calculator:
__result = 0
def __init__(self):
pass
def add(self, i: int):
self.__result = self.__result + i
def subtract(self, i: int):
self.__result = self.__result - i
def getResult(self):
return self.__result
|
# -*- coding: utf-8 -*-
#
# Home Credit Default Risk documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configurat... |
# coding: utf-8
from .db_init import db
class RevokedTokenModel(db.Model):
tablename = 'revoked_tokens'
__tablename__ = 'revoked_tokens'
id = db.Column(db.Integer, primary_key=True)
jti = db.Column(db.String(120))
@classmethod
def is_jti_blacklisted(cls, jti):
query = db.session.query... |
from cccatalog.api.serializers.list_serializers import \
ImageListCreateSerializer, ImageListResponseSerializer, \
ImageListUpdateSerializer
from django.forms.models import model_to_dict
from cccatalog.api.models import ImageList
from cccatalog.api.utils.throttle import PostRequestThrottler
from drf_yasg.utils ... |
"""Handle registration and publication of supported message families."""
from typing import Mapping, Sequence
from ..classloader import ClassLoader
from ..config.injection_context import InjectionContext
class ProtocolRegistry:
"""Protocol registry for indexing message families."""
def __init__(self):
... |
import torch.nn as nn
import models.head.poly_yolo_head as yolov3_head
import models.backbone.poly_darknet.poly_darknet as darknet53
import models.backbone.poly_darknet.poly_neck as neck
import models.loss.poly_yolo_loss_anchor_free_module as loss
from utils.logger import print_logger
from models.layer.layer_fundation ... |
# Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
import logging
from datetime import datetime, timezone
from typing import Iterable, List, Optional, Set, Tuple
from copr.v3 import CoprAuthException, CoprRequestException
from ogr.abstract import GitProject
from ogr.parsing import parse_g... |
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
setup_args = generate_distutils_setup(
packages=['ros_sample'],
package_dir={'': 'src'},
)
setup(**setup_args)
|
# Copyright 2020 The TensorFlow 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 applica... |
"""
The :mod:`sklearn.feature_selection` module implements feature selection
algorithms. It currently includes univariate filter selection methods and the
recursive feature elimination algorithm.
"""
from ._univariate_selection import chi2
from ._univariate_selection import f_classif
from ._univariate_selectio... |
import boto3
import datetime
from optparse import OptionParser
import os
SCALE_IN_CPU_TH = int(os.getenv('SCALE_IN_CPU_TH', 60))
SCALE_IN_MEM_TH = int(os.getenv('SCALE_IN_MEM_TH', 60))
FUTURE_CPU_TH = int(os.getenv('FUTURE_CPU_TH', 70))
FUTURE_MEM_TH = int(os.getenv('FUTURE_MEM_TH', 70))
ASG_PREFIX = os.getenv('ASG_PR... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-10-23 17:01
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
import djangocms_bootstrap4.fields
from djangocms_bootstrap4.constants import TAG_CHOICES
class Migration(migrations.Migration):
... |
#!/usr/bin/python
from bluepy import btle
import struct
import time
import BB8_driver
import sys
bb8 = BB8_driver.Sphero()
bb8.connect()
bb8.start()
time.sleep(2)
bb8.set_rgb_led(255,0,0,0,False)
time.sleep(1)
bb8.set_rgb_led(0,255,0,0,False)
time.sleep(1)
bb8.join()
bb8.disconnect()
sys.exit(1)
|
import numpy as np
from statsmodels.distributions.empirical_distribution import ECDF
from scipy.stats import norm, poisson
def weighted_quantile(values, quantiles, sample_weight=None,
values_sorted=False, old_style=True):
"""
Very close to numpy.percentile, but supports weights. NOTE: q... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
import json
import os
import shutil
import sys
from time import sleep
import hashCheck
def install(chosenInterfaceIP):
kibanaLatest = '5.5.1'
cpuArch = os.uname()[4]
cwd = os.getcwd()
# Install Kibana
kibanaInstalled = False
if os.path.isfile('/opt/kibana/bin/kibana'):
kibanaVersion ... |
import argparse
import json
from generate_json_from_grid import gridToRoadnet
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("rowNum", type=int)
parser.add_argument("colNum", type=int)
parser.add_argument("--rowDistance", type=int, default=300)
parser.add_argument("--colum... |
import urllib
class cOutputParameterHandler:
def __init__(self):
self.__aParams = {}
def addParameter(self, sParameterName, mParameterValue):
if not mParameterValue:
return
self.__aParams[sParameterName] = urllib.unquote(str(mParameterValue))
def getParameterAsUri(s... |
# Copyright 2013 UnitedStack, Inc.
# Copyright 2014 INFN
# 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... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# 文件名:server.py
import socket # 导入 socket 模块
s = socket.socket() # 创建 socket 对象
host = "127.0.0.1" #socket.gethostname() # 获取本地主机名
port = 12345 # 设置端口
s.bind((host, port)) # 绑定端口
s.listen(5) # 等待客户端连接
c,addr = s.... |
"""
Proposals provide a mechanism for suggesting changes to submissions.
The primary use-case in the classic submission & moderation system is for
suggesting changes to the primary or cross-list classification. Such proposals
are generated both automatically based on the results of the classifier and
manually by moder... |
from typing import Optional
class Stack:
"""
Stack data structure implementation.
"""
def __init__(self):
self.items = []
def push(self, item) -> None:
"""
Accepts an item as a parameter and appends it to the end of the list.
The runtime of this meth... |
import sqlite3
import urllib
import re
from urllib.request import urlopen
from bs4 import BeautifulSoup, NavigableString
from phyllo.phyllo_logger import logger
import nltk
from itertools import cycle
def parseRes2(soup, title, url, cur, author, date, collectiontitle):
chapter = '-'
j = 1
s1=[]
[e.ext... |
# -*- coding: utf-8 -*-
"""
thai2fit - Thai word vector
Code by https://github.com/cstorm125/thai2fit
"""
from typing import List, Tuple
import numpy as np
from gensim.models import KeyedVectors
from gensim.models.keyedvectors import Word2VecKeyedVectors
from pythainlp.corpus import download as download_data
from pyth... |
import os
import random
import json
import cv2
import numpy as np
import torch.utils.data as data
import torch
import torchvision.transforms as transforms
from functional.utils.mask_io import read_mask
video_names = None
def dataloader_davis(filepath):
global video_names
video_txt = filepath + '/ImageSets/2... |
# -*- coding: utf-8 -*-
# @Time :
# @Author :
# @Email :
# @File :
# @Software:
import torch
import torch.nn.functional as F
import torch.nn as nn
from torch import Tensor
class SSIMLoss(nn.Module):
def __init__(self, kernel_size: int = 11, sigma: float = 1.5) -> None:
""... |
from scipy import sparse
import numpy as np
import codecs
import cv2
import os.path as osp
import json
class Data_extractor():
''' use to generate xml file '''
def __init__(self, XmlSavePath, ImgSavePath):
super().__init__()
self.XmlSavePath = XmlSavePath
self.ImgSavePath = ImgSavePa... |
# 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 ... |
import os
import subprocess
import sys
from invoke import task
class GoModule:
"""A Go module abstraction."""
def __init__(self, path, targets=None, condition=lambda: True, should_tag=True):
self.path = path
self.targets = targets if targets else ["."]
self.condition = condition
... |
# -*- coding: utf-8 -*-
'''
Manage virt
===========
For the key certificate this state uses the external pillar in the master to call
for the generation and signing of certificates for systems running libvirt:
.. code-block:: yaml
libvirt_keys:
virt.keys
'''
from __future__ import absolute_import
# Import... |
from vaemols.models.vae import VariationalAutoencoder
|
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# 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 applicabl... |
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible_collections.community.general.tests.unit.compat.mock import pa... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
from setuptools import find_packages, setup
version = __import__('filer').__version__
def read(fname):
# read the contents of a text file
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
... |
rs = (float(input('Quantos reais? R$: ')))
d = rs / 4.16
print('Com {:.2f}R$ que você tem, da para comprar {:.2f} dolares'.format(rs, d)) |
from sklearn.linear_model import Lasso
from sklearn.metrics import mean_squared_error
import numpy as np
import matplotlib.pyplot as plt
import datasetUtils as dsu
import embeddings
import sys
import os
#configs
method = "conc"
post_threshold = 3
x_scale = (0,5.5)
y_scale = (0,5.5)
def savePlot(y_true, y_pred, title,... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class MybankCreditCreditriskDsddAdmitConsultModel(object):
def __init__(self):
self._smid = None
@property
def smid(self):
return self._smid
@smid.setter
def smid(self... |
#!/usr/bin/env python
#
# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Usage: gn_to_cmake.py <json_file_name>
gn gen out/config --ide=json --json-ide-script=../../gn/gn_to_cmake.py
or
gn gen out/config --ide=json
python gn/gn... |
from django.db import models
from django.utils import timezone
from osf.utils.fields import NonNaiveDateTimeField
from website.mails import Mail, send_mail
from website.mails import presends
from website import settings as osf_settings
from osf.models.base import BaseModel, ObjectIDMixin
from osf.utils.datetime_aware... |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If exte... |
#!/usr/bin/env python3
"""----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
LANforge-GUI Source Code
Copyright (C) 1999-2021 Candela Technologies Inc
http:www.candelatech.com
This program is free software; you can redistribute it and/or
modify it under the terms ... |
from flask.views import MethodView
from openapi_spec_validator import validate_spec
from apiflask import APIBlueprint
from apiflask import auth_required
from apiflask.security import HTTPBasicAuth
from apiflask.security import HTTPTokenAuth
def test_auth_required(app, client):
auth = HTTPBasicAuth()
@auth.v... |
'''
================================================
## VOICEBOOK REPOSITORY ##
================================================
repository name: voicebook
repository version: 1.0
repository link: https://github.com/jim-schwoebel/voicebook
author: Jim Schwoebel
author contact: js@neur... |
from pandac.PandaModules import *
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import ToontownGlobals
from toontown.coghq import DistributedCashbotBossCraneAI
from toontown.coghq import DistributedCashbotBossSafeAI
from toontown.suit import DistributedCashbotBossGoonAI
#from toontown.coghq ... |
# This is an example of QView customization for a specific application
# (DPP in this case). This example animates the Phil images on the
# QView canvas. Additionally, there is a button in the middle of the screen,
# which, when clicked once pauses the DPP ("forks" are not being served).
# A second click on the button,... |
import os
from django.shortcuts import render
from rest_framework import viewsets
from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework import status
from pose_analyser.models import Pose, PoseAnalysis
from pose_analyser.serializers import PoseSerializer, Analys... |
#!/usr/bin/python
"""Simple script to analyze a standard http log file (common log format).
The script will finds most common IPs, user agents, and requests.
This script was developed for academic/educational purposes.
https://github.com/miketramontano/Access-Log-Summarizer
"""
import os
import re
import js... |
nombre= str(input("Primera palabra "))
letra = nombre[0].lower()
if letra == 'a':
print("Es vocal, a")
elif letra == 'e':
print("Es vocal, e")
elif letra == 'o':
print("Es vocal, o")
elif letra == 'i':
print("Es vocal, i")
elif letra == 'u':
print("Es vocal, u")
else:
print("No empieza por voc... |
# Copyright 2013 OpenStack Foundation
#
# 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 ... |
""" A convenience dataclass for configuring the simulator (pybullet).
"""
from dataclasses import dataclass
from typing import Any
from typing import Tuple
import pybullet
@dataclass
class SimulatorConf:
"""Simulator configuration dataclass.
connection_mode:
`None` connects to an existing simulation ... |
# Generated by Django 3.1.3 on 2021-05-06 20:43
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Lab_Dash', '0003_auto_20210506_1813'),
]
operations = [
migrations.AlterField(
model_name='grp',
... |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.utils.translation import ugettext as _
from appconf import AppConf
class ManageManageConf(AppConf):
MAINMENU = None
#MAINMENU = [{'title': _('Shop'),
# 'children':
# [{'url':'lfs_manage_shop',
# ... |
"""
Joy
===
Joy is a tiny creative coding library in Python.
BASIC USAGE
An example of using joy:
>>> from joy import *
>>>
>>> c = circle(x=100, y=100, radius=50)
>>> show(c)
The `cicle` function creates a new circle and the `show` function
displys it.
PRINCIPLES
Joy follows functional programmi... |
# Copyright 2017-2020 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 law or agreed ... |
# WordFilter.py
#
# Strip, Tokenize, Lemmatize, Remove non-alphabetical phrases
# and performs dictionary checks on input and returns an array of strings
from nltk.tokenize import word_tokenize
from nltk.stem import SnowballStemmer
from nltk.corpus import stopwords
from enchant import Dict
import sys
reload(sys)
sys.... |
import subprocess
import time
import sys
"""
Kicks off a pipeline that schedules Turk jobs for tool 1D,
collects results in batches and collates data.
1. Read in newline separated commands and construct CSV input.
2. Create HITs for each input command using tool 1D template.
3. Continuously check for completed assign... |
from __future__ import with_statement
import rpython.rlib.rcomplex as c
from rpython.rlib.rfloat import copysign, isnan, isinf
import os, sys, math, struct
def test_add():
for c1, c2, result in [
((0, 0), (0, 0), (0, 0)),
((1, 0), (2, 0), (3, 0)),
((0, 3), (0, 2), (0, 5)),
((10., ... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 23 18:35:16 2019
@author: Prakhar
"""
import numpy as np
import pandas as pd
from sklearn.linear_model import LassoCV
df = pd.read_csv("Admission_Predict.csv")
x=df.iloc[:,1:-2].values
y=df[df.columns[-1:]]
ls = LassoCV(cv=5, random_state=0)
ls.fit(x,y)
gre1=x[:,0].mea... |
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""),... |
# microblog/
# -*- coding:utf-8 -*-
from app import app
app.run(debug=True) |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack, LLC
# 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/... |
from .context import mango
def test_constructor():
secret_key = [0] * 32
actual = mango.Wallet(secret_key)
assert actual is not None
assert actual.logger is not None
assert actual.secret_key == secret_key
assert actual.account is not None
def test_constructor_with_longer_secret_key():
se... |
import argparse
from segmentation import SegModel
import tensorflow as tf
import os
parser = argparse.ArgumentParser(description='')
parser.add_argument('--dataset_path', dest='dataset_path',
default='dataset/',
help='name of the dataset')
parser.add_argument('--epoch', dest='ep... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('chul', '0004_auto_20160329_0642'),
]
operations = [
migrations.AlterField(
mode... |
import os, sys
from ConfigParser import SafeConfigParser
# This dequote() business is required for some older versions
# of mysql_config
def dequote(s):
if s[0] in "\"'" and s[0] == s[-1]:
s = s[1:-1]
return s
def compiler_flag(f):
return "-%s" % f
def mysql_config(what):
from os import pope... |
def main() -> None:
a, b = map(int, input().split())
print("Yes" if a <= b <= 6 * a else "No")
main()
|
import scrapy
import re
from locations.items import GeojsonPointItem
class ElPolloLocoSpider(scrapy.Spider):
name = "elpolloloco"
allowed_domains = ["www.elpolloloco.com"]
start_urls = (
'https://www.elpolloloco.com/locations/all-locations.html',
)
def parse_stores(self, response):
... |
import torch
from transformers import AutoConfig, AutoModelForSeq2SeqLM, BartTokenizer, BartForConditionalGeneration, BartExtendedForConditionalGeneration, BartConfig, BartExtendedModel
# Loading trained model
PATH = "/home/ec2-user/moymarce/transformers/checkpoints/5-source_oracle-double/"
tokenizer = BartTokenizer.f... |
from datetime import date, datetime, timedelta
from dateutil.relativedelta import relativedelta
from django.utils.timezone import localtime, now
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from nadine.models.profile import SpecialDay
from nadine import... |
"""
Module containing a class for
calibrating multiple calibration classes at once.
"""
import os
from typing import List
import numpy as np
from aixcalibuha import CalibrationClass, data_types
from aixcalibuha.calibration import Calibrator
class MultipleClassCalibrator(Calibrator):
r"""
Class for calibratio... |
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import cv2
from sys import exit
import torch
import torch.nn.functional as F
from lib.utils import (
grid_positions,
upscale_positions,
downscale_positions,
savefig,
imshow_image
)
from lib.exceptions import NoGradientError, EmptyTensorError
i... |
frase = str(input('Digite uma frase: ')).strip().upper()
print(f'A letra "A" aparece {frase.count("A")} vezes na frase.\n'
f'A primeira letra "A" aparece na posição {frase.find("A") + 1}.\n'
f'E a ultima letra "A" aparece na posição {frase.rfind("A") + 1}.')
|
from stix_shifter_utils.utils.error_mapper_base import ErrorMapperBase
from stix_shifter_utils.utils.utils.error_response import ErrorResponder, ErrorCode
from enum import Enum
from stix_shifter_utils.utils import logger
class ErrorCaptureType(Enum):
ERROR_MESSAGE = 'ERROR_MESSSAGE'
STRUCT_VALUE = 'STRUCT_VAL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.