text stringlengths 1 927k |
|---|
# -*- coding: utf-8 -*-
"""
:author: Grey Li (李辉)
:Modify: oriyao
:url: http://greyli.com
:copyright: © 2018 Grey Li <withlihui@gmail.com>
:license: MIT, see LICENSE for more details.
"""
import os
import sys
basedir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
# SQLite URI compat... |
from sql_connection import db
from survey_builder import Survey_Builder
build= Survey_Builder()
build.begin()
'''
cursor = db.cursor()
cursor.callproc("get_questions")
results = []
for result in cursor.stored_results():
val = result.fetchall()
print(val)
results.append(val)
print(results)
cursor.callpro... |
import sys
import logging
import numpy as np
import tensorflow as tf
from keras.models import Model
from keras.applications.resnet50 import ResNet50
from keras.layers import Input
from keras.layers import Dense
from keras.layers import Conv2D
from keras.layers import Layer
from keras.layers import Reshape
from keras... |
"""
sphinx.util.docfields
~~~~~~~~~~~~~~~~~~~~~
"Doc fields" are reST field lists in object descriptions that will
be domain-specifically transformed to a more appealing presentation.
:copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
... |
from urllib.request import urlopen
from bs4 import BeautifulSoup
import requests
#import csv
def baixararquivo(url,nomearquivo):
nomearquivo=nomearquivo.replace("/", "-")
links_with_text2 = []
page = requests.get(url)
soup = BeautifulSoup(page.text, 'html.parser')
for page1 in soup.find_all('a'):
... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import generators
from __future__ import nested_scopes
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement
from django.http import HttpResponse... |
from .db import get_connection, get_data_dict
from flask import render_template, url_for, make_response, session
import requests
import traceback
from datetime import datetime
from time import sleep, process_time
from .config import load_config, is_debug
from .etsy import send_etsy_post_request
from .sources.etsy impor... |
import random
import time
from collections import namedtuple
import pytest
import torch
import numpy as np
from easydict import EasyDict
from functools import partial
import gym
from ding.envs.env.base_env import BaseEnvTimestep
from ding.envs.env_manager.base_env_manager import EnvState
from ding.envs.env_manager imp... |
import datetime
import json
import os
import requests
from django.contrib import messages
from django.contrib.auth import authenticate, login, logout
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from student_management_app.EmailBackEnd ... |
# Exercise 12.1 Snippets
import requests
request = requests.get('https://www.python.org')
request.content # gives back the page’s HTML
from bs4 import BeautifulSoup
soup = BeautifulSoup(request.content, 'html5lib')
text = soup.get_text(strip=True) # text without tags
#########################################... |
#!/usr/bin/env python
import warnings
import numpy
from cogent3.evolve.likelihood_tree import make_likelihood_tree_leaf
from . import substitution_calculation
__author__ = "Peter Maxwell"
__copyright__ = "Copyright 2007-2020, The Cogent Project"
__credits__ = ["Peter Maxwell"]
__license__ = "BSD-3"
__version__ = ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Leuven.MapMatching documentation build configuration file, created by
# sphinx-quickstart on Sat Apr 14 23:24:31 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present i... |
#!/usr/bin/env python
# -- coding: utf-8 --
from __future__ import (absolute_import, division,
print_function, unicode_literals)
try:
from PyDect200 import PyDect200
except:
print(u'PyDect200 is not installed!')
print(u'run: pip install PyDect200')
exit()
import ... |
#!/bin/env/python3
# -*- encoding: utf-8 -*-
import os
__version__ = '0.1.0dev'
__license__ = 'BSD3'
__author__ = 'Kyle B. Westfall'
__maintainer__ = 'Kyle B. Westfall'
__email__ = 'westfall@ucolick.org'
__copyright__ = '(c) 2018, Kyle B. Westfall'
def enyo_source_dir():
"""Return the root path to the DAP source... |
#
# PySNMP MIB module CISCOSB-SNMP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCOSB-SNMP-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:07:32 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar ... |
# 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 applica... |
import torch
import torch.nn as nn
from torch.nn.utils.rnn import pad_sequence
from decoder import ImageDecoder
import transformers
class Text2BrainModel(nn.Module):
def __init__(self, out_channels, fc_channels, decoder_filters, pretrained_bert_dir, decoder_act_fn=nn.Sigmoid, drop_p=0.5, decoder_input_shape=[4, 5... |
import base64
import bz2
import time
import os
import shutil
import util
def main():
dist_dir = util.get_launch_name()
print('zipping %s (%s)' % (dist_dir, os.path.abspath(dist_dir)))
shutil.make_archive(dist_dir, 'zip', dist_dir)
if __name__ == '__main__':
main() |
from __future__ import absolute_import
import six
from django.db import models
from django.utils import timezone
from sentry.db.models import Model
from django.utils.functional import cached_property
import semaphore
class Relay(Model):
__core__ = True
relay_id = models.CharField(max_length=64, unique=Tru... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018, freeioe.org and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestIOTApplicationConfVersion(unittest.TestCase):
pass |
# -*- coding: utf-8 -*-
__author__ = 'study_sun'
import sqlite3
import sys
from entity import FundInfo
reload(sys)
sys.setdefaultencoding('utf-8')
class FundCollector(object):
DATABASE_TABLE_NAME = u'fundinfo'
DATABASE_NAME = 'Fund.db'
def __init__(self):
self.db = sqlite3.connect(FundCollector.... |
# -*- coding: utf-8 -*-
import asyncio
import pytest
import logging
from bitshares.aio.blockchain import Blockchain
log = logging.getLogger("grapheneapi")
log.setLevel(logging.DEBUG)
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
ch = logging.StreamHandler()
ch.setFormatter(form... |
#!/usr/bin/python
"""
consoles.py: bring up a bunch of miniature consoles on a virtual network
This demo shows how to monitor a set of nodes by using
Node's monitor() and Tkinter's createfilehandler().
We monitor nodes in a couple of ways:
- First, each individual node is monitored, and its output is added
to its... |
# -*- coding: utf-8 -*-
# pragma pylint: disable=unused-argument, no-self-use
# (c) Copyright IBM Corp. 2010, 2020. All Rights Reserved.
"""Function implementation"""
import logging
from resilient_circuits import ResilientComponent, function, handler, StatusMessage, FunctionResult, FunctionError
from resilient_lib imp... |
import logging
import requests
from speculator.utils import date
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def json_to_url(json, symbol):
""" Converts a JSON to a URL by the Poloniex API
Args:
json: JSON data as a list of dict dates, where the keys are
... |
from .Ensemble import Ensemble, ensemble_dict
from .IMEnsemble import IMEnsemble
from .Branch import Branch
from .Leaf import Leaf |
# -*- coding: utf-8 -*-
"""
base.py
Base Alphabet class
@author: Douglas Daly
@date: 1/11/2017
"""
#
# Imports
#
from abc import ABCMeta, abstractmethod
#
# Class
#
class Alphabet(object, metaclass=ABCMeta):
"""
Base Alphabet Class
"""
@abstractmethod
def __init__(self):
""" Ab... |
import unittest
from BarCrawlrServer.model.plan import plan
import json
myPlan = "{" +\
"\"name\":\"Alex's Plan\"," +\
"\"places\":[" +\
"{" +\
"\"name\":\"Joe's Bar\"," +\
"\"address\":\"10 King's Street, Burlington, 05401 VT\"," +\
... |
from django.apps import AppConfig
class CopytterConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'copytter' |
import logging
import copy
import pytz
import emission.core.wrapper.consentconfig as ecws
import emission.net.usercache.formatters.common as fc
# Currently, we just reflect this back to the user, so not much editing to do
# here. Since we get the timezone from javascript guessing, though, let's just
# verify that it ... |
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
import os
os.environ["PATH"] += os.pathsep + os.path.join(os.path.dirname(__file__),... |
def convert_list_in_str(list_in: list) -> str:
list_another = []
for i in list_in:
if i.isdigit():
i = int(i)
list_another.append(f'"{i:02d}"')
elif i[0] == '+':
i = int(i[1:])
list_another.append(f'"{i:02d}"')
elif i[0] == '-':
... |
import unittest
from programy.config.file.yaml_file import YamlConfigurationFile
from programy.clients.polling.telegram.config import TelegramConfiguration
from programy.clients.events.console.config import ConsoleConfiguration
class TelegramClientConfigurationTests(unittest.TestCase):
def test_init(self):
... |
class Solution:
def fib(self, n: int) -> int:
memo = {}
def inner(n: int) -> int:
if n == 0: return 0
if n == 1: return 1
if n in memo:
return memo[n]
else:
val = inner(n - 1) + inner(n - 2)
memo[n] = va... |
import json
from machine_settings import _MachineConfig
import os.path as os_path
ENCODING = 'utf8'
def get_config():
config = Config()
return config
class _ConfigBase:
def __init__(self, parent):
self._parent = parent
machine_config = _MachineConfig()
self._initialize(machine_... |
# coding=utf-8
# Copyright (c) 2019 Uber Technologies, 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 applicabl... |
import os
import tensorflow as tf
######################
### Graph creation ###
######################
def create_session_and_graph(gpu_device=None, gpu_frac=None):
if gpu_device is None:
gpu_device = 0
if gpu_frac is None:
gpu_frac = 0.95
os.environ["CUDA_VISIBLE_DEVICES"] = str(gpu_devi... |
import json
import pika
import ssl
import logging
from os import environ
from datetime import datetime
from .config import Config
logging.basicConfig()
config = Config.get_instance()
ssl.match_hostname = lambda cert, hostname: True
PAYMENT_EXCHANGE = "payment_events"
class Publisher(object):
def __init__(self... |
import numpy as np
import skimage
from skimage import io, transform, exposure, data, color
from skimage.color import *
import matplotlib.pyplot as plt
from matplotlib.pyplot import imshow
def unmix_purple_img(purp_img, loud=False):
"""
Accepts a purple image object as a parameter
and returns the image wi... |
# -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
:para... |
from garagepi.common.configuration import validate_configuration
from garagepi.common.const import *
from garagepi.data.rpi import gpio
from garagepi.domain import App
from garagepi.domain.usecase.api import BuildApiUseCase, NotifyStateUseCase
from garagepi.domain.usecase.commands import (
CommandCloseUseCase,
... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: filter_condition.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.pro... |
# -*- coding: utf-8 -*-
import pytest
from storyruntime.utils import Dict
def test_dict_set_single():
a = {}
Dict.set(a, ['foobar'], 'string')
assert a == {'foobar': 'string'}
def test_dict_set_many_new():
a = {}
Dict.set(a, ['foo', 'bar'], 'string')
assert a == {'foo': {'bar': 'string'}}
... |
from camelq.struct_product import product
class currency(product.product):
def __init__(self, code = '', size = 0, price = 1):
self.code = code
self.size = size
self.price = price |
import sys
import file_util
def main(filename, output_filename):
host_info_dict = read_host_info(filename)
write_host_info(host_info_dict, output_filename)
def write_host_info(host_info_dict, output_filename):
"""
dictonary -> host info
:param host_info_dict: dict
:param output_filename: s... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
requirements = [
'numpy', 'pandas', 'joblib', 'h5py', 'Cython', 'anndata', 'scanpy', 'scikit-learn', 'scipy', 'matplotlib', 'POT'
]
extras_require = {
}
s... |
from __future__ import absolute_import
from django.utils.translation import ugettext_lazy as _
from permissions.models import Permission, PermissionNamespace
ocr_namespace = PermissionNamespace('ocr', _(u'OCR'))
PERMISSION_OCR_DOCUMENT = Permission.objects.register(ocr_namespace, 'ocr_document', _(u'Submit documents... |
l = [ "foo", "bar",
"baz"]
l = [
"foo",
"bar",
"baz",
]
l = []
l = [
] |
class Solution:
def decompressRLElist(self, nums: List[int]) -> List[int]:
ans = []
for i in range(0, len(nums), 2):
for n in [nums[i + 1]] * nums[i]:
ans.append(n)
return ans |
# Generated by Django 2.2 on 2019-06-25 19:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0013_auto_20190624_1403'),
]
operations = [
migrations.AlterField(
model_name='risk_factor_operation',
name='pe... |
import traceback
from ..utils import config
from ..utils.log import logger
from ..utils.recognize import Scene, RecognizeError
from ..utils.solver import BaseSolver, StrategyError
class MailSolver(BaseSolver):
"""
收取邮件
"""
def __init__(self, adb=None, recog=None):
super(MailSolver, self).__i... |
import logging
import os
import time
import pytest
from tests.test_helpers.docker_helpers import docker_compose_runner # noqa: F401
# Enable debug logging.
logging.getLogger().setLevel(logging.DEBUG)
os.putenv("DATAHUB_DEBUG", "1")
@pytest.fixture
def mock_time(monkeypatch):
def fake_time():
return 16... |
# 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... |
try:
from userbot.modules.sql_helper import SESSION, BASE
except ImportError:
raise AttributeError
import threading
from sqlalchemy import Integer, Column, String, UnicodeText, func, distinct, Boolean
DEF_COUNT = 0
DEF_LIMIT = 0
DEF_OBJ = (None, DEF_COUNT, DEF_LIMIT)
class FloodControl(BASE):
__tablename... |
"""General configuration CLI."""
import click
from statue.cli.common_flags import config_path_option
from statue.cli.config.config_cli import config_cli
from statue.config.configuration import Configuration
from statue.runner import RunnerMode
@config_cli.command("set-mode")
@click.argument(
"mode",
type=cli... |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2020, empress development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE.md, distributed with this software.
# -----------------------... |
#!/usr/bin/env python
from __future__ import with_statement
'''
Simple interface to for importing files into the data directory.
Author: Pontus Stenetorp <pontus is s u-tokyo ac jp>
Version: 2011-02-21
'''
from annotation import open_textfile
from common import ProtocolError
from config import DATA_DIR
fr... |
import os
import re
import regex
import cPickle as pickle
import pdb
import numpy as np
import pandas as pd
import time
from IPython.display import display
def open_nn_results(like, path='results', exactmatch=False, verbose=True):
"""
Open a list of nn results with file names matching like
"""
files ... |
"""
Autogenerated file - DO NOT EDIT
If you spot a bug, please report it on the mailing list and/or change the generator.
"""
import attr
from nipype.interfaces.base import (
Directory,
File,
InputMultiPath,
OutputMultiPath,
traits,
)
from pydra import ShellCommandTask
from pydra.engine.specs impor... |
__version__ = "0.6.0"
major_minor_version = "0.6" |
# Copyright 2019 Canonical Ltd.
#
# 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 writin... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
# Copyright (C) 2020 Northwestern University
#
# Invenio-Records-Resources is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""Common Errors handling for Resources."""
from json imp... |
"""Tests the communication module."""
import json
from mock import patch, call
import control.communication
@patch('serial.Serial')
def test_receiving_valid_data(mock_serial_class):
"""Confirm the json data is returned as actual data."""
expected = {'test': 5} # Random data
serial_mock = mock_serial_clas... |
import base64
import json
import logging
from datetime import datetime
from datetime import timezone
from forge_sdk import utils
from forge_sdk.did import lib
from forge_sdk.did.lib import HASH_MAP
from forge_sdk.did.lib import KEY_MAP
from forge_sdk.did.lib import ROLE_MAP
from forge_sdk.mcrypto.hasher import Hasher
... |
from os import listdir, makedirs
import os
import glob, shutil
from random import shuffle, random
if __name__ == "__main__":
PATH=os.getcwd()
annots_path="./Annotations_classes"
images_path="./JPEGImages_classes"
annots_dest="./Annotations"
images_dest="./JPEGImages"
sets_path="ImageSets/Main/"... |
#
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019 Intel 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 app... |
# Copyright 2013 Red Hat, 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 agre... |
### Double DQN Atari Config ###
env = {
# "name": it should be defined in the command. ex) python main.py --config config.AGENT.atari --env.name breakout
"render": False,
"gray_img": True,
"img_width": 84,
"img_height": 84,
"stack_frame": 4,
"no_op": False,
"reward_clip": True,
"dea... |
'''
This file
1. Reads in data from <data_dir>/<subfolder_name>
2. Merges ALL data together, shuffles the lines, and outputs the data into small chuns into <data_dir>/<subfolder_name>/<train/dev/test>
After this, run generate_slices.py
Example run command:
'''
import argparse
import collections
import copy
import ha... |
"""
Nested file in bar/
""" |
# -*- coding: utf-8 -*-
################ Server Ver. 19 (2020. 8. 6.) #####################
import sys, os
import asyncio, discord, aiohttp
import random, re, datetime, time, logging
from discord.ext import tasks, commands
from discord.ext.commands import CommandNotFound, MissingRequiredArgument
from gtts import gTT... |
B_1801_9 = {0: {'A': 0, 'C': 0, 'D': 4, 'E': 1, 'F': 0, 'G': 0, 'H': 0, 'I': 0, 'K': -1, 'L': 0, 'M': 0, 'N': 1, 'P': 0, 'Q': 0, 'R': -1, 'S': 0, 'T': 0, 'V': -1, 'W': 0, 'X': 0, 'Y': 0}, 1: {'A': 0, 'C': 0, 'D': 0, 'E': 10, 'F': 0, 'G': 0, 'H': 0, 'I': 0, 'K': 0, 'L': 0, 'M': 0, 'N': 0, 'P': 0, 'Q': 0, 'R': 0, 'S': 0,... |
"""
===========================
Calculate SHORE scalar maps
===========================
We show how to calculate two SHORE-based scalar maps: return to origin
probability (rtop) [Descoteaux2011]_ and mean square displacement (msd)
[Wu2007]_, [Wu2008]_ on your data. SHORE can be used with any multiple b-value
dataset l... |
import torch
from torch_geometric.data import InMemoryDataset, download_url
from torch_geometric.read import read_npz
class Amazon(InMemoryDataset):
url = 'https://github.com/shchur/gnn-benchmark/raw/master/data/npz/'
def __init__(self, root, name, transform=None, pre_transform=None):
self.name = nam... |
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.a... |
"""Directory to save the data files into"""
SAVE_DATA_PATH = ""
"""Directory to save the output jupyter notebook into"""
OUTPUT_JUPYTER_NOTEBOOK = "home/randall/Dev/uci_dataset_processor/processor/outputs/"
"""Location of jupyter notebook template"""
JUPYTER_NOTEBOOK_TEMPLATE = (
"home/randall/Dev/uci_dataset_pro... |
from swsscommon import swsscommon
import conftest
import sys
import functools
import typing
import re
import time
def to_string(value):
if isinstance(value, bool):
return "true" if value else "false"
return str(value)
class Table(object):
def __init__(self, database: conftest.DVSDatabase, table... |
# 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... |
from typing import Dict, Iterator, List, TextIO
from paikkala.models import Room, Zone
def read_csv(infp: TextIO, separator: str = ',') -> Iterator[Dict[str, str]]:
headers = None
for line in infp:
line_list = line.strip().split(separator)
if not headers:
headers = line_list
... |
"""Implementation of IntelliJ-specific information collecting aspect."""
load(
":artifacts.bzl",
"artifact_location",
"artifacts_from_target_list_attr",
"is_external_artifact",
"sources_from_target",
"struct_omit_none",
"to_artifact_location",
)
load(
":make_variables.bzl",
"expand_... |
import os
import biothings, config
biothings.config_for_app(config)
import biothings.hub.dataload.uploader
from .parser import load_druglabels
class DrugLabelsUploader(biothings.hub.dataload.uploader.BaseSourceUploader):
main_source = "pharmgkb"
name = "druglabels"
__metadata__ = {"src_meta": {}}
... |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyright (c) 2011 OpenStack Foundation
# (c) Cop... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2021 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="dispanderfixedbeta",
version="0.1.1",
author="susi-chaaaan",
author_email="sushi_code@outlook.jp",
description="Discord Message URL Expander-fixed-beta",
long_description=long_descript... |
#
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 Raphael Michel and contributors
# Copyright (C) 2020-2021 rami.io GmbH and contributors
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Public License as published by ... |
OVERLAY_WIDTH = 80
OVERLAY_HEIGHT = 40
PALETTE_COLORS = 256
BACKGROUND = '#E3E0D0'
PALETTE = [
('base', '', '', '', '#000000', BACKGROUND),
('button', '', '', '', '#000000,bold', BACKGROUND),
('highlight', '', '', '', '#ffa', BACKGROUND),
('faded', '', '', '', '#888', BACKGROUND),
('warning', '', '... |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
import binascii
import datetime
import ipaddress
import os
import typing
import pretend
import pytest
from cryptography import x509
fro... |
"""
Created on September 11th, 2021
Simple script to compute the size of a dataset (with one or multiple files) in memory (RAM).
Note that this measure will give an approximate approximate value
IMPORTANT NOTE:
The computation may stop with an error if the data does not fit in memory.
This makes training with such da... |
import os
MAIN_PATH = os.path.abspath("..")
DATA_PATH = os.path.join(MAIN_PATH, "data")
PDF_PATH = os.path.join(DATA_PATH, "pdf")
TXT_PATH = os.path.join(DATA_PATH, "txt")
BAD_ONLINE_COURSES = os.path.join(TXT_PATH, "badOnlineCourses.txt")
BAD_CATALOGUE_COURSES = os.path.join(TXT_PATH, "badCatalogueCourses.txt")
TES... |
from pygame import *
from random import randint, uniform
from time import time as timer
class GameSprite(sprite.Sprite):
def __init__(self, player_image, player_x, player_y, w, h, player_speed):
super().__init__()
self.image = transform.scale(image.load(player_image), (w, h))
self.speed = pl... |
# -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class SpacebattlesSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scr... |
#
# PySNMP MIB module RADLAN-IpRouter (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/RADLAN-IpRouter
# Produced by pysmi-0.3.4 at Wed May 1 14:47:13 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27... |
"""Utilities for comparing two versions of a module symbol table.
The goal is to find which AST nodes have externally visible changes, so
that we can fire triggers and re-process other parts of the program
that are stale because of the changes.
Only look at detail at definitions at the current module -- don't
recurse... |
SECRET_KEY = "1327-github-actions-secret-key"
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "1327",
"USER": "1327",
"PASSWORD": "1327",
"HOST": "postgres",
"PORT": "5432",
}
}
CACHES = {
"default": {
"BACKEND": "django_... |
inputs = [1.5,2.3,5.4]
weights = [3.1,2.1,8.7]
bias = 3
output = inputs[0]*weights[0] + inputs[1]*weights[1] +inputs[2]*weights[2] + bias
print(output) |
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
import math
import numpy as np
__all__ = [
'VGG', 'vgg11', 'vgg11_bn', 'vgg13', 'vgg13_bn', 'vgg16', 'vgg16_bn',
'vgg19_bn', 'vgg19',
]
model_urls = {
'vgg11': 'https://download.pytorch.org/models/vgg11-bbd30ac9.pth',
'vgg13': 'https://d... |
# -*- coding: utf-8 -*-
'''
etcd Database Module
:maintainer: SaltStack
:maturity: New
:depends: python-etcd
:platform: all
.. versionadded:: 2015.5.0
This module allows access to the etcd database using an ``sdb://`` URI. This
package is located at ``https://pypi.python.org/pypi/python-etcd``.
L... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
from django.db import migrations
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.RunSQL(
"CREATE EXTENSION IF NOT EXISTS ltree;",
"DROP EXTENSION ltree;"
)
] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import yaml
from PyQt5.QtWidgets import QWidget, QApplication, QLabel, QGroupBox, QVBoxLayout, QHBoxLayout, QMessageBox, \
QFileDialog, QPushButton, QListWidget, QAbstractItemView
import utils.HelperFunctions as HF
from GUI.GuiTwoLists_generic import TwoListG... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.