text stringlengths 2 999k |
|---|
lista_parole = [
'asso',
'america',
'ancora',
'alfabeto',
'analisi',
'aperto',
'battere',
'bagnino',
'battello',
'bicchiere',
'cannone',
'canoa',
'capperi',
'canzone',
'cenone',
'citronella',
'comodino',
'dente',
'dinosauro',
'drappo'
]
|
"""Stuff to parse WAVE files.
Usage.
Reading WAVE files:
f = wave.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
When the setpos() and rewind() methods are not used, the seek()
method is not necessary.
This ... |
#!/usr/bin/env python
'''
Copyright (C) 2020, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
NAME = 'yxlink (yxlink Technologies)'
def is_waf(self):
schemes = [
self.matchContent(r'<TITLE>访问禁止'),
self.matchContent(r'检测到可疑访问'),
]
if all(i for i in schemes):
... |
# -*- coding: UTF-8 -*-
from django.shortcuts import render_to_response, HttpResponse
from django.http import HttpResponseRedirect, Http404
from django.contrib.auth.models import User
from django.contrib.auth import logout
from forms import *
from models import UserPreferences, Organization
from common.models import Z... |
# Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template_file: python-cli-command.j2
# justice-gdpr-service (1.14.6)
# pylint: disable=duplicate-code
#... |
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 20 17:19:02 2019
@author: LKK
"""
#will build 3 different databases
#each database has 10,0000 tuples
#A tuple has d attributes of type double and one bulk attribute with garbage characters to ensure that each tuple is 100 bytes long.
#The valus of the d doubles of a tup... |
import common.database as db
import common.util.urlFuncs as urlFuncs
import logging
import os.path
import settings
class Clean(object):
def __init__(self):
print("Clean __init__()")
self.log = logging.getLogger("Main.Cleaner")
super().__init__()
def clean_files(self):
with db.session_context() as sess:
... |
from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField, SubmitField,SelectField
from wtforms.validators import Email, InputRequired
from app import email
class BlogForm(FlaskForm):
title = StringField('Title', validators=[InputRequired()])
post = TextAreaField('Your Blog', validators=[... |
#!/usr/bin/env python
import new
def attach(*args):
"""Class decorator that adds test_* methods to decorated class
Params:
*args: source classes with test_* methods to add to decorated class
"""
def wrapper(target_class):
suffix = getattr(target_class, 'SUFFIX', '')
suffix = '... |
#!/usr/bin/env python
# Copyright 2015 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.
"""Runs isolate bundled Telemetry unittests.
This script attempts to emulate the contract of gtest-style tests
invoked via recipes. Th... |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
import scrapy
class Mp3DownloadItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
movie_name = scrapy.Field()
... |
from __future__ import division
from __future__ import print_function
'''
From PyTorch:
Copyright (c) 2016- Facebook, Inc (Adam Paszke)
Copyright (c) 2014- Facebook, Inc (Soumith Chintala)
Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert)
Copyright (c) 2012-2014 Deepmind... |
# coding=utf-8
import inspect
import unittest
from unittest import mock
from unittest.mock import MagicMock
from faker import Faker
from faker.config import DEFAULT_LOCALE
from faker.sphinx.docstring import DEFAULT_SAMPLE_SIZE, DEFAULT_SEED, ProviderMethodDocstring, Sample
class TestProviderMethodDocstring(unittest... |
import torch
from torch import nn, Tensor
class TemporalAttention(nn.Module):
def __init__(self, features_size: int = 512, hidden_size: int = 128):
super().__init__()
self.phi_x = nn.Linear(features_size, 1, bias=False)
self.phi_h = nn.Linear(hidden_size, 1, bias=False)
self.softm... |
"""
Base classes for matrix styles.
"""
import logging
from abc import ABCMeta, abstractmethod
import pandas as pd
from pytools.api import AllTracker
from pytools.viz import DrawingStyle
log = logging.getLogger(__name__)
#
# Exported names
#
__all__ = ["MatrixStyle"]
#
# Ensure all symbols introduced below are ... |
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv("./df_covid19.csv")
df_mujer = df[df.SEXO == 1]
df_hombre = df[df.SEXO == 2]
# HOMBRES
si_tiene_hombre = list(df_hombre.DIABETES).count(1)
no_tiene_hombre = list(df_hombre.DIABETES).count(2)
no_aplica_hombre = list(df_hombre.DIABETES).count(98)
f... |
# Copyright 2016 Mirantis 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,... |
#!/usr/bin/python
#
# Copyright 2018-2022 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 ... |
import time
import requests
from typing import Union, List
from ..exceptions import APIError, InvalidResponse
from ..utils import check_status_code
from .baseendpoint import BaseEndpoint
from .. import resources
from ..compat import json
class InPlayService(BaseEndpoint):
"""
In play service operations.
... |
import random
import time
import uuid
from abc import ABC, abstractmethod
from os import getcwd, path
import odml
from odml.tools.rdf_converter import RDFReader, RDFWriter
from odml.tools.odmlparser import ODMLWriter
RANDOM_MAX = 1000000000 # might be collisions so better change to uuid
MAX_VALUE_LIST_NUMBER = 5
MA... |
#This is the entry point for all of the URLs in our app
"""profiles_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a ... |
from os.path import join, exists, dirname, realpath
from setuptools import setup
import os, sys
# validate python version
if sys.version_info < (3,6):
sys.exit('Sorry, PixPlot requires Python 3.6 or later')
# populate list of all paths in `./pixplot/web`
web = []
dirs = [join('pixplot', 'web'), join('pixplot', 'mod... |
# https://www.analog.com/media/en/technical-documentation/data-sheets/ADXL345.pdf
from machine import Pin
from machine import I2C
import time
import ustruct
class ADXL345:
EXPECTED_ADXL345_ADDR = 0xE5
DEVICE_ADDR = 0x53
DATA_FORMAT = 0x31
BW_RATE = 0x2c
POWER_CTL... |
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
from transformers import pipeline
class QuestionAnswering(object):
def __init__(self, model_path):
self._model_path = model_path
self.pipeline = pipeline("question-answering", model=model_path)
def find_answers(self, data, topk=1):
answers = []
# see data/formatted/squad/dev-v... |
from collections import deque
from typing import List
class Solution:
def numIslands(self, grid: List[List[str]]) -> int:
#[ print(item) for item in grid]
if len(grid) == 0: return 0
# print( [ 3 in row for row in grid] )
visited = [ [False] * len(row) for row in gr... |
from discord.ext import commands
from Exts.config import Config
config = Config()
bot = commands.Bot(
command_prefix=config["command_prefix"],
case_insensitive=config["case_insensitive"],
description=config["description"],
owner_id=config["owner_id"]
) |
import oandapy
import os
import sys
from win32com.client import Dispatch
from datetime import datetime
import tkinter
from sys import argv
import tkinter
from tkinter import *
import time
lastClose = 0
# Please edit account, token and environment before proceeding.
account = 12345
token = "qwerty"
AmiBr... |
from haversine import haversine, Unit
from statistics import mean
import ast
import urllib
import aiohttp
import asyncio
import json
import sqlite3
import googlemaps
from db_handler import DatabaseHandler
class ApiClient:
base_url_walk_score = "https://api.walkscore.com/score?"
base_url_google_geocode = "http... |
import cv2
import numpy as np
import tensorflow as tf
import glob
import argparse
import os
INPUT_SIZE = 512 # input image size for Generator
ATTENTION_SIZE = 32 # size of contextual attention
def sort(str_lst):
return [s for s in sorted(str_lst)]
# reconstruct residual from patches
def reconstruct_residual_... |
pkgname = "util-linux-cbuild"
_mver = "2.37"
pkgver = f"{_mver}.2"
pkgrel = 0
build_style = "gnu_configure"
configure_args = [
"--without-ncurses", "--without-ncursesw", "--without-udev",
"--without-systemd", "--disable-libuuid", "--disable-libblkid",
"--disable-libmount", "--disable-mount", "--disable-lose... |
import json
import linecache
import logging
import os
import sys
import threading
import subprocess
from datetime import datetime
import sentry_sdk
from sentry_sdk._compat import urlparse, text_type, implements_str, PY2
from sentry_sdk._types import MYPY
if MYPY:
from types import FrameType
from types impor... |
# coding: utf-8
"""
AsyncMirrorConnectionsResponse.py
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following condi... |
# this holds hardware info based on raspberry pi SSN
def getHostSerialNumber():
ssn = None
a=check_output(["cat", '/proc/cpuinfo'])
for s in a.split('\n'):
if s.find('Serial') > -1:
ssn = s.split()[2]
return ssn
ssn = getHostSerialNumber()
if ssn == '00000000f4e2702a': # real R2D2
arduino_port = '/dev/se... |
import os
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
from glue.compat import text_type
from .base import BaseJSONFormat
class JSONFormat(BaseJSONFormat):
extension = 'json'
build_per_ratio = True
@classmethod
def populate_argument_parse... |
# Copyright 2019 The Magenta 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 to in ... |
from http import HTTPStatus
from unittest import TestCase
from pyrdf4j.api_graph import APIGraph
from pyrdf4j.errors import URINotReachable
from pyrdf4j.rdf4j import RDF4J
from tests.constants import AUTH, RDF4J_BASE_TEST
class TestEmpty(TestCase):
def setUp(self):
self.rdf4j = RDF4J(RDF4J_BASE_TEST)
... |
#! /usr/bin/env python
"""
Unit & functional tests for the Community ID package. Run with something like:
python -m unittest communityid_test
nose2 -C --coverage ../communityid --coverage-report term-missing communityid_test
You can also invoke this file directly.
"""
import os
import socket
import struct
import subp... |
"""Classes and functions for cache persistence"""
# flake8: noqa: F401
from ..cache_keys import normalize_dict
from .base import BaseCache
# All backend-specific keyword arguments combined
BACKEND_KWARGS = [
'connection',
'db_name',
'endpont_url',
'extension',
'fast_save',
'ignored_parameters',... |
GeometryConf={
'DBExtended' : 'DB:Extended',
'DBExtendedGFlash' : 'DB:ExtendedGFlash',
'DBExtendedLiMax' : 'DB:ExtendedLiMax',
'DBExtendedLiMin' : 'DB:ExtendedLiMin',
'DBExtendedX0Max' : 'DB:ExtendedX0Max',
'DBExtendedX0Min' : 'DB:ExtendedX0Min',
'DBExtended2015' : 'DB:Extended',... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 9
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_2_2
from i... |
import tensorflow as tf
count = 0
file = open('example.txt','w')
for example in tf.python_io.tf_record_iterator("train.tfrecord"):
file.write(str(tf.train.Example.FromString(example)))
count += 1
if count == 2:
break
|
from numbers import Number
from datetime import datetime
from requests import get
class Indicator():
def __init__(self, indicator):
self.code = indicator["code"]
self.name = indicator["name"]
self.featured = indicator["featured"]
self.categories = indicator["categories"]
... |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "hector_quadrotor_gazebo"
PROJECT_SPAC... |
#!/usr/bin/env python3
#
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Big number routines.
This file is copied from python-bitcoinlib.
"""
import struct
# generic big endian MPI format
def bn_bytes(v, have_ext=False):
... |
# from .backend import * # noqa: F401,F403
from .sbackend import * |
import cv2
import time
import numpy as np
## Preparation for writing the ouput video
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out = cv2.VideoWriter('output.avi', fourcc, 20.0, (640, 480))
##reading from the webcam
cap = cv2.VideoCapture(0)
## Allow the system to sleep for 3 seconds before the webcam starts
time.s... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import threading
import webbrowser
import BaseHTTPServer
import SimpleHTTPServer
import json
from os import curdir, sep
PORT = 8080
logs = {}
class AjaxHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
print """The ajax handler is running..."""
def __init_... |
import argparse
import gym
from torch import optim
from prl.agents.agents import REINFORCEAgent
from prl.environments.environments import Environment
from prl.function_approximators import PytorchFA
from prl.function_approximators.pytorch_nn import PolicyGradientLoss
from prl.function_approximators.pytorch_nn import ... |
import unittest
from bqs.d_list import DList
class TestQueue(unittest.TestCase):
def test_dlist(self):
dlist = DList()
self.assertTrue(dlist.is_empty())
self.assertEqual(dlist.size(), 0)
self.assertTrue(dlist.is_empty())
def test_dlist2(self):
dlist = D... |
#!/usr/bin/python
DOCUMENTATION = '''
---
module: cd_ecs_compose
short_description: converts composer file into ansible dict for modules.
description:
- This module allows the user to converts compose file for docker into ansible dict for modules..
version_added: "1.1"
options:
aws_access_key:
description:
... |
import os.path
import pandas as pd
import networkx as nx
from tqdm import tqdm
years = [2019, 2020, 2021]
# Read dataframe
df = pd.read_csv('https://github.com/alvarofpp/dataset-flights-brazil/raw/main/data/anac.zip')
df_airports = pd.read_csv('https://github.com/alvarofpp/dataset-flights-brazil/raw/main/data/airport... |
import pytest
import numpy as np
from math import isclose
from scipy.stats import multivariate_normal
from py21cmmc.cosmoHammer import Params
from py21cmmc.prior import DataWhitener, PriorBase, PriorFunction, PriorGaussianKDE
@pytest.fixture(scope="module")
def astro_params():
ap = {
"L_X": [40.0, 38.0,... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sublime
from os.path import basename
ST3 = int(sublime.version()) >= 3000
if ST3:
from .common import first, set_proper_scheme, calc_width, get_group
else:
from common import first, set_proper_scheme, calc_width, get_group
def set_active_group(wind... |
from pathlib import Path
import torch
import torch.optim as optim
from torch.utils.data import DataLoader
from utils import create_dataset, create_pytorch_datasets, create_query_dataset, \
evaluate_queries, load_data
from train_model import train
from evaluate_model import evalu... |
# Copyright 2015 Isotoma 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 required by applicable law or agreed to in writing... |
from typing import List
from .server_error import ServerErrorMiddleware
__all__: List[str] = [
'ServerErrorMiddleware'
] # pragma: no cover
|
from fastapi import FastAPI
from typing import Optional
from starlette.middleware.cors import CORSMiddleware
from fastapi.encoders import jsonable_encoder
from fastapi.responses import JSONResponse
import httpx
import os
app = FastAPI()
HEADERS = {'Token': os.environ["TOKEN"], 'Route-User': os.environ["ROUTE_USER"]}
... |
"""
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, ... |
import datetime
from django.apps import apps
from django.contrib.gis.db import models
from django.contrib.auth.models import User
from config.current_user import get_current_user
from django.contrib.postgres.fields import ArrayField, JSONField
from django.core.serializers.json import DjangoJSONEncoder
import uuid
cla... |
# Copyright 2022 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... |
# import Flask and pymongo
from flask import Flask, render_template
from flask_pymongo import PyMongo
# import scrape_mars.py
import scrape_mars
# Create an app, being sure to pass __name__
app = Flask(__name__)
# Create connection variable to load in
mongo = PyMongo(app, uri="mongodb://localhost:27017/mars_info"... |
# Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... |
#!/usr/bin/env python
'''
Pynet : Learning Python
- Week9, Question 1
'''
class IPAddress(object):
" IP address class "
def __init__(self, ip_address):
" Create IPAddress object, takes an IP address string input "
self.ip_address = ip_address
def get_ip(self):
" Returns the I... |
# Copyright 2021 European Centre for Medium-Range Weather Forecasts (ECMWF)
#
# 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... |
# Copyright 2015 Red Hat, 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... |
from signal import pause
import cv2
from pitop import Camera
from pitop.processing.algorithms.faces import EmotionClassifier, FaceDetector
def detect_emotion(frame):
face = face_detector(frame)
emotion = emotion_classifier(face)
if emotion.found:
print(f"{emotion_lookup[emotion.type]}", end="\r... |
"""
Utility functions to fetch files from various Workspace object types.
Depends on the more general util.py that's here, too.
"""
from pprint import pprint
from installed_clients.AssemblyUtilClient import AssemblyUtil
from installed_clients.ReadsUtilsClient import ReadsUtils
from installed_clients.SetAPIServiceClien... |
import os
import sys
import time
from collections import namedtuple
import pendulum
from dagster import check, seven
from dagster.core.definitions.run_request import InstigatorType
from dagster.core.definitions.sensor_definition import DefaultSensorStatus, SensorExecutionData
from dagster.core.errors import DagsterErr... |
# encoding: utf-8
###########################################################################################################
#
#
# Reporter Plugin
#
# Read the docs:
# https://github.com/schriftgestalt/GlyphsSDK/tree/master/Python%20Templates/Reporter
#
#
##############################################################... |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created: Fri Apr 30 14:38:03 2010
# by: The Resource Compiler for PySide (Qt v4.6.1)
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore
qt_resource_data = "\
\x00\x00\x22\x34\
\x3c\
\x75\x69\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x2... |
import h5py
from matplotlib import pyplot as plt
import argparse
import os.path as osp
parser = argparse.ArgumentParser()
parser.add_argument('-p', '--path', type=str, required=True,
help="path to h5 file containing summarization results")
args = parser.parse_args()
h5_res = h5py.File(args.path, 'r')
keys = h5_r... |
import numpy as np
import tensorflow as tf
from tensorflow.keras import Model
import tensorflow.keras.backend as K
from MLib.Core.Cells import SIR_Cell
from tensorflow.keras.layers import RNN
class MarkovChainRNN_Model(Model):
def __init__(self, population):
super(MarkovChainRNN_Model, self).__init__()
cell =... |
#!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the follo... |
def split_and_join(line):
return ("-".join(line.split()))
if __name__ == '__main__':
line = input()
result = split_and_join(line)
print(result)
|
"""A scene suitable for vector spaces."""
__all__ = ["VectorScene", "LinearTransformationScene"]
from typing import Optional
import numpy as np
from colour import Color
from manim.utils.config_ops import update_dict_recursively
from .. import config
from ..animation.animation import Animation
from ..animation.cre... |
#!/usr/bin/env python3
fahrenheit = float(
input(
'What temperature (in Farenheit) would you '
'like to convert to Celsius? '
)
)
celsius = (fahrenheit - 32) * 5 / 9
print(fahrenheit, 'F is', round(celsius, 2), 'C')
|
#!/usr/bin/env python
"""Distutils setup file, used to install or test 'setuptools'"""
import io
import os
import sys
import textwrap
import contextlib
# Allow to run setup.py from another directory.
os.chdir(os.path.dirname(os.path.abspath(__file__)))
src_root = None
from distutils.util import convert_path
command... |
import dash_html_components as html
layout = html.Div(
id="banner",
className="banner"
) |
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and re... |
"""
WSGI config for E_OnlineShop project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_... |
#from __future__ import absolute_import, unicode_literals
import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
app = Celery('dashboard')
app.config_from_object('django.conf:settings', namespace='CELERY')
# ... |
#
# Copyright (C) 2020 Arm Mbed. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
import pathlib
from unittest import TestCase, mock
from tests.devices.factories import CandidateDeviceFactory
from mbed_tools.devices._internal.candidate_device import CandidateDevice
from mbed_tools.devices._internal.darwin ... |
import FWCore.ParameterSet.Config as cms
process = cms.Process("HGCGeomAnalysis")
process.load('Configuration.StandardSequences.Services_cff')
process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load('Configuration.EventContent.EventContent_cff')... |
# Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from .aws import Action as BaseAction
from .aws import BaseARN
service_name = "Amazon Elastic Container Registry"
prefix = "ecr"
class Action(BaseAction):
def __init__(self, action: str = None) -> ... |
import discord
from discord.ext import commands
import utils
import requests
class Weather(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command()
async def weather(self, ctx, *, city: str):
city_name = city
url = f"http://api.openweathermap.org/data/2.5/weather?appid=64dfdf8642... |
# coding: utf-8
"""
Copyright 2016 SmartBear Software
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... |
"""Utilities used for configuration parsing and validation."""
import functools
import itertools
import re
import datetime
from tron.config import ConfigError
from tron.config.schema import MASTER_NAMESPACE
from tron.utils import dicts
from tron.utils.dicts import FrozenDict
MAX_IDENTIFIER_LENGTH = 255
IDENTIFI... |
# 生成八面体形的结构元素。
#
# 这与钻石的3D等效。 如果像素与邻域中心之间的城市街区/曼哈顿距离不大于半径,则该像素是邻域的一部分(即标记为1)。 |
# 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 ex... |
"""Dataset with 'Mumps rubulavirus' sequences.
A dataset with 296 'Mumps rubulavirus' genomes.
THIS PYTHON FILE WAS GENERATED BY A COMPUTER PROGRAM! DO NOT EDIT!
"""
import sys
from catch.datasets import GenomesDatasetSingleChrom
ds = GenomesDatasetSingleChrom(__name__, __file__, __spec__)
ds.add_fasta_path("data... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Time : 2019-04-10 09:44
@Author : zhangyu
@Contact : zhangycqupt@163.com
@File : text_abstract.py
@Software: PyCharm
@Site : https://github.com/zhangyuo
"""
import io
import subprocess
import os
from subprocess import STDOUT, PIPE
class summary(object):
... |
from azul import (
config,
)
from azul.deployment import (
aws,
)
from azul.modules import (
load_app_module,
)
direct_access_role = config.dss_direct_access_role('service')
service = load_app_module('service')
policy = {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "All... |
'''
Pedagogical example realization of seq2seq recurrent neural networks, using TensorFlow and TFLearn.
More info at https://github.com/ichuang/tflearn_seq2seq
'''
from __future__ import division, print_function
import os
import sys
import tflearn
import argparse
import json
import numpy as np
import tensorflow as t... |
import torch
print("torch version: {}".format(torch.__version__))
print("torch cuda version: {}".format(torch.version.cuda))
print("torch cuda available: {}".format(torch.cuda.is_available()))
x = torch.rand(4, 512, 512, 3).to('cuda')
print(torch.sum(x))
|
matriz = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
for l in range(0, 3):
for c in range(0, 3):
matriz[l][c] = int(input(f'Digite um valor para [{l},{c}]'))
print('-='*30)
for l in range(0,3):
for c in range(0, 3):
print(f'[{matriz[l][c]}]', end= '')
print()
|
import os
from gevent import monkey; monkey.patch_all()
from socketio import socketio_manage
from socketio.server import SocketIOServer
from socketio.namespace import BaseNamespace
from socketio.mixins import BroadcastMixin
import redis
class NupicNamespace(BaseNamespace, BroadcastMixin):
def recv_connect(self):... |
# GENERATED BY KOMAND SDK - DO NOT EDIT
from .action import DeleteNote
|
import os
import unittest
from custodian.lobster.handlers import (
ChargeSpillingValidator,
EnoughBandsValidator,
LobsterFilesValidator,
)
# get location of module
TEST_DIR = os.path.dirname(os.path.abspath(__file__))
test_files_lobster = os.path.join(TEST_DIR, "../../../test_files/lobster/lobs... |
"""
Test the Grid objects.
"""
import random
import unittest
from mesa.space import Grid, SingleGrid, MultiGrid, HexGrid
# Initial agent positions for testing
#
# --- visual aid ----
# 0 0 0
# 1 1 0
# 0 1 0
# 1 0 1
# 0 0 1
# -------------------
TEST_GRID = [[0, 1, 0, 1, 0], [0, 0, 1, 1, 0], [1, 1, 0, 0, 0]]
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.