text stringlengths 2 999k |
|---|
import logging
class Logger:
def __init__(self, log_level, log_file):
self.logger = logging.getLogger()
self.logger.setLevel(log_level)
fh = logging.FileHandler(log_file)
fh.setLevel(log_level)
ch = logging.StreamHandler()
ch.setLevel(log_level)
formatter ... |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import skipIf, TestCase
from tests.support.mock import (
... |
# https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii
class Solution:
def maxProfit(self, prices):
"""
:type prices: List[int]
:rtype: int
"""
profit, buy = 0, float('inf')
for price in prices:
if price < buy:
buy = price
... |
from temboo.Library.Google.ComputeEngine.Snapshots.DeleteSnapshot import DeleteSnapshot, DeleteSnapshotInputSet, DeleteSnapshotResultSet, DeleteSnapshotChoreographyExecution
from temboo.Library.Google.ComputeEngine.Snapshots.GetSnapshot import GetSnapshot, GetSnapshotInputSet, GetSnapshotResultSet, GetSnapshotChoreogra... |
# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# type: ignore
from io import StringIO
from typing import Dict, List, Tuple
from dazl.model.types import ContractIdType, ListType, RecordType, Type, TypeReference
from dazl.mode... |
# ***************** Topic Modeling *******************
# *****************************************************
from __future__ import print_function
import os
import json
import sys
import time
from os import listdir
from os.path import isdir
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectoriz... |
"""See grid_tasks_sqs.py"""
import asyncio
import dataclasses
import datetime
import functools
import os
import pickle
import time
import traceback
import uuid
from typing import (
Any,
Callable,
Iterable,
List,
Optional,
Sequence,
Tuple,
TypeVar,
cast,
)
from azure.mgmt.storage.ai... |
"""
Copyright (c) 2018 iCyP
Released under the MIT license
https://opensource.org/licenses/mit-license.php
"""
import struct
from sys import float_info
class Gltf:
TEXTURE_INPUT_NAMES = [
"color_texture",
"normal",
"emissive_texture",
"occlusion_texture",
]
VAL_INPUT_NAME... |
# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY
# mf6/utils/createpackages.py
# FILE created on March 19, 2021 03:08:37 UTC
from .. import mfpackage
from ..data.mfdatautil import ListTemplateGenerator
class ModflowNam(mfpackage.MFPackage):
"""
ModflowNam defines a nam package.
Parameter... |
import random
import pandas as pd
import numpy as np
import statesmodels.api as sm
import matplotlib.pyplot as plt
from keras.utils.np_utils import to_categorical
from keras.models import Sequential
from keras.layers import Dense, Activation, Dropout
from keras.layers.recurrent import SimpleRNN, LSTM
from keras.layers.... |
#A* -------------------------------------------------------------------
#B* This file contains source code for the PyMOL computer program
#C* Copyright (c) Schrodinger, LLC.
#D* -------------------------------------------------------------------
#E* It is unlawful to modify or remove this copyright notice.
#F* -------... |
"""
Copyright (c) 2018 Martin Fuchs <martin.fuchs@gmx.ch>
Licensed under MIT. All rights reserved.
"""
import os
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.md'), ... |
"""purple_bird_29509 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 URL to urlpatterns: path('', views.home, name='home')
C... |
import asyncio
import logging
from aioftp import StatusCodeError
from bspump.abc.source import TriggerSource
###
L = logging.getLogger(__name__)
###
class FTPSource(TriggerSource):
ConfigDefaults = {
'remote_path': '/',
'mode': 'r', # r = read, p = pop
}
def __init__(self, app, pipeline, connection,id=... |
# Generated by Django 2.0.6 on 2018-08-22 22:03
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('charsheet', '0030_auto_20180822_1144'),
]
operations = [
migrations.CreateModel(
name='Attack',... |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from . import platform_pb2 as platform__pb2
class MpfHardwareServiceStub(object):
"""Missing associated documentation comment in .proto file."""
def _... |
from django import forms
from django.conf import settings
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.contrib.auth import authenticate, login
from manager import models as pmod
from . import templater
from django.conf import settings
import decimal, datetime
def process_req... |
from decimal import Decimal
from mintersdk.shortcuts import to_bip, to_pip
from mintersdk.sdk.deeplink import MinterDeeplink
from minter.consts import BASE_COIN, TX_TYPES, MIN_RESERVE_BIP
from minter.tx import estimate_custom_fee
from providers.nodeapi import NodeAPI
def find_gas_coin(balances, get_fee=False, paylo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Class that counts for each tweet how many NE there are and add this as a feature
Created on Thu Oct 14 11:07:32 2021
@author: rayaabuahmad
"""
import nltk
from nltk import pos_tag
import numpy as np
from code.feature_extraction.feature_extractor import FeatureExtract... |
motor_names = ['HLC', 'timing_system.hlcnd']
motor_labels = ['Position', 'Phase']
formats = ['%+6.3f', 'time.6']
nrows = 8
line0.description = 'Bypass'
line0.updated = '30 Oct 16:00'
line1.description = '988-1.5'
line1.updated = '30 May 13:24'
line2.description = '494-1.5'
line2.updated = '30 May 13:24'
line3.descripti... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class GetRou... |
import board
from adafruit_bmp280 import Adafruit_BMP280_I2C
class BMP280Config(object):
def __init__(self, config_dict=None):
if config_dict is None:
config_dict = {}
if 'I2CADDR' in config_dict:
self.I2CADDR = config_dict['I2CADDR']
if 'NChannels' in config_dic... |
"""
Copyright 2012-2019 Ministerie van Sociale Zaken en Werkgelegenheid
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 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import http
from odoo.http import request
from odoo.addons.website_form.controllers.main import WebsiteForm
class WebsiteForm(WebsiteForm):
# Check and insert values from the form on the model <model>
... |
from alento_bot import user_data_transformer, ConfigData, StorageManager
from evelib import EVEManager, SolarSystemData, PlanetData, TypeData, TypeManager, UniverseManager
from eve_module.storage.eve_config import EVEConfig
from eve_module.storage.user_auth import EVEUserAuthManager
from discord.ext import commands
fro... |
#!/usr/bin/env python3
# Copyright (c) 2018 The Cryptonecoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test RPC help output."""
from test_framework.test_framework import CryptonecoinTestFramework
from test... |
"""
# MIT License
# Copyright (c) 2021 eitieatgithub
# 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 use, copy, modify, mer... |
# IntradayBarExample.py
from __future__ import print_function
from __future__ import absolute_import
import copy
import datetime
from optparse import OptionParser, Option, OptionValueError
import os
import platform as plat
import sys
if sys.version_info >= (3, 8) and plat.system().lower() == "windows":
# pylint: ... |
income = float(input())
middle_grade = float(input())
minimal_payment = float(input())
scholarship = 0
if income < minimal_payment and middle_grade > 4.50:
scholarship = minimal_payment * 0.65
elif middle_grade <= 5.50:
scholarship = middle_grade * 25
|
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from tensorflow.core.framework import types_pb2 as tf_types # pylint: disable=no-name-in-module,import-error
# Suppress false positive pylint warning about function with too many arguments
# pylint: disable=E1121
# m... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-03-09 07:48
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='TxItem'... |
from dataclasses import dataclass, field
from enum import Enum
from typing import Optional
__NAMESPACE__ = "NISTSchema-SV-IV-list-string-enumeration-4-NS"
class NistschemaSvIvListStringEnumeration4Type(Enum):
MANIPULATE_IS_THIS_OF_WOULD_BUILT_FOR_USE = (
"manipulate",
"is",
"t... |
from __future__ import print_function
__author__ = 'mpetyx'
import boto3
import zipfile
import json
from StringIO import StringIO
print('Loading function')
destination_bucket = 'your-destination-s3-bucket-here'
source_bucket = 'your-source-s3-bucket-here'
s3_client = boto3.client('s3')
s3 = boto3.resource('s3')
... |
#coding=utf-8
str = ('3*4_4*3')
print str
for n in str.split('_'):
print type(int(n.split('*')[0])) |
"""Generic socket server classes.
This module tries to capture the various aspects of defining a server:
For socket-based servers:
- address family:
- AF_INET{,6}: IP (Internet Protocol) sockets (default)
- AF_UNIX: Unix domain sockets
- others, e.g. AF_DECNET are conceivable (see <socket.h>
... |
# coding: utf-8
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class UpdateDomainPasswordPolicyResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attri... |
question_data = [
{"text": "A slug's blood is green.", "answer": "True"},
{"text": "The loudest animal is the African Elephant.", "answer": "False"},
{"text": "Approximately one quarter of human bones are in the feet.", "answer": "True"},
{"text": "The total surface area of a human lungs is the size of ... |
from django.db import models
from django.utils.translation import ugettext as _
class CandidateList(models.Model):
candidates = models.ManyToManyField('persons.Person', blank=True, null=True, through='Candidate')
name = models.CharField(_('Name'), max_length = 80)
ballot = models.CharField(_('Ballot'), max... |
from djangosphinx.models import SphinxQuerySet
from django.db import models
import itertools
__all__ = ('sphinx_query',)
_all_sphinx_indexes_cache = None
def _all_indexes():
global _all_sphinx_indexes_cache
if _all_sphinx_indexes_cache is None:
indexes = []
model_classes = itertools.chain(*(m... |
import random
import os
import re
import numpy as np
import torch
import torch.utils.data
import librosa
import layers
from utils import load_wav_to_torch, load_filepaths_and_text
from text import text_to_sequence, cmudict
from yin import compute_yin
class TextMelLoader(torch.utils.data.Dataset):
"""
1) ... |
from time import sleep
def maior(*num):
cont = maior = 0
print("\n Analisando os valores passador...")
for valor in num:
print(f"{valor}", end="", flush=True)
sleep(0.2)
maior(2, 4, 8, 9, 0)
maior(4, 7, 0)
maior(1, 1, 2) |
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import nlpregex.abs_graph.double_link
import nlpregex.abs_graph.node
import nlpregex.abs_graph.edge
import nlpregex.abs_graph.graph
import nlpregex.regular_language.sse_forrest
# @brief finds common subtrees (regular subexpressions) in sseASForrest,
# and repla... |
"""
Constants for use by the neural classifier
"""
# data_clean slicing
SLICE_LENGTH = 300
SLICE_OVERLAP = .2
# glove embeddings neural_constants
GLOVE_FILE = "classifiers/neural/glove_embeddings/glove.6B.100d.txt"
#GLOVE_FILE = "classifiers/neural/glove_embeddings/glove.6B.50d.txt"
GLOVE_DIMENSIONS = 100
# neural_... |
# -*- coding: utf-8 -*-
from django.urls import path
from django.views.decorators.csrf import csrf_exempt
from . import views
app_name = 'polls'
urlpatterns = [
path('detail/<slug:slug>/', views.PollDetail.as_view(), name='detail-by-slug'),
path('<page:page>', views.PollList.as_view(), name='list'),
path('post/<... |
import torch
import torch.nn as nn
import pdb
class Cumulative_Probability_Layer(nn.Module):
def __init__(self, num_features, args, max_followup):
super(Cumulative_Probability_Layer, self).__init__()
self.args = args
self.hazard_fc = nn.Linear(num_features, max_followup)
self.bas... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
import sys
import string
import time
import socket
# ============================================================================
# System Constants
# ============================================================================
E36102A_IP = "192.168.1.3"
E36102A... |
# Copyright (c) 2016, Vladimir Feinberg
# Licensed under the BSD 3-clause license (see LICENSE)
import unittest
import numpy as np
from ..util.testing_utils import check_np_lists
from .zero import Zero
class ZeroTest(unittest.TestCase):
def test_f_one_one(self):
z = Zero(1, 1)
out = z.f([np.ara... |
import ptf
from ptf.base_tests import BaseTest
from ptf import config
import ptf.testutils as testutils
class DataplaneBaseTest(BaseTest):
def __init__(self):
BaseTest.__init__(self)
def setUp(self):
self.dataplane = ptf.dataplane_instance
self.dataplane.flush()
if config["log_... |
from brickpy import utility as u
test = u.Linear_Utility(3, 3, 2, 50)
test.continuity()
test.concavity()
test.plot() |
print (5+3)
print (4*2)
print (10-2)
print (16/2)
|
"""
Utility functions to pre- and post-process data for Tangram.
"""
import numpy as np
import pandas as pd
from collections import defaultdict
import gzip
import pickle
import scanpy as sc
from sklearn.model_selection import LeaveOneOut
from sklearn.model_selection import KFold
from comet_ml import Experiment
fr... |
from .core.typing import List, Dict, Any, Callable, Optional
from .core.types import WindowLike, ViewLike, ClientStates, ConfigRegistry
from .core.workspace import (ProjectFolders, get_workspace_folders, enable_in_project,
disable_in_project, sorted_workspace_folders)
from .core.settings im... |
##########################################################################
#
# Copyright (c) 2008-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... |
import helper
greeting("develop test")
|
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLES1 import _types as _cs
# End users want this...
from OpenGL.raw.GLES1._types import *
from OpenGL.raw.GLES1 import _errors
from OpenGL.constant import Constant as _C
... |
# loop through a code block by using the while statement
import random
roll = 0
count = 0
while roll != 5:
count = count + 1
roll = random.randint(1, 5)
print(roll)
print(f'It took {count} rolls to roll a 5!')
# Use the optional statements break and else
roll = 0
count = 0
print('First person to roll a 5 wi... |
# coding=utf-8
import torch
from torch import nn
import numpy as np
from src.models.api import AbstractModel, evaluate
class DistMult(AbstractModel):
def __init__(
self,
num_entities: int,
num_relations: int,
embedding_dim: int,
):
super(DistMult, self)... |
# Copyright 2016 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 cortext.text
import cortext.visualizer
import cortext.api_keys
from subprocess import call
def v(text):
t = cortext.text.Text(text).parse()
visualizer = cortext.visualizer.Visualizer(t, cortext.api_keys.API_CONFIG)
return visualizer.visualize_words()
# print([[w.__dict__ for w in s] for s in v('The chair is... |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Marker(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "area"
_path_str = "area.marker"
_valid_props = {
"color",
"colorsrc",
... |
from ..models import Area, Neighborhood
from index import app,redis_store,es
import json
from .. import settings
from pprint import pprint
import pandas as pd
import math
from numpy import irr
import numpy as np
import re
class EsqueryHelper(object):
'You can use this class query the complex query'
@classmethod
... |
import os
from threading import Thread
from contextlib import suppress
from astropy import units as u
from panoptes.pocs.base import PanBase
from panoptes.pocs.observatory import Observatory
from panoptes.pocs.state.machine import PanStateMachine
from panoptes.utils.time import current_time
from panoptes.utils.utils i... |
# Character field ID when accessed: 993000400
# ParentID: 993000400
# ObjectID: 0
|
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
"""Creates and saves a new user"""
if not email:
raise ValueError('Us... |
from django.core.management.base import BaseCommand
import subprocess
class Command(BaseCommand):
help = 'run the collector script to log data into the RRD file'
# Note: this will typically be a symlink to the real script
script = "./collector/collector.py"
def handle(self, *args, **options):
... |
a = input()
albet = "abcdefghijklmnopqrstuvwxyz" |
"""Test Transactin Builder class."""
from avatax.transaction_builder import TransactionBuilder
def test_initialize_builder_object(auth_client):
"""Test if a new transaction can be initialize."""
new_trans = TransactionBuilder(auth_client, 'DEFAULT', 'SalesInvoice', 'ABC123')
assert isinstance(new_trans, T... |
# -*- coding: UTF-8 -*-
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="pgui",
version="0.0.33",
author="Ciro Garcia",
author_email="kolterdev@gmail.com",
description="A GUI module compatible with pygame",
long_description=long_des... |
from flask import g, jsonify, request
from http import HTTPStatus
from lnbits.core.crud import get_user, get_wallet
from lnbits.core.services import create_invoice
from lnbits.decorators import api_check_wallet_key, api_validate_post_request
from lnbits.settings import WALLET
from lnbits.extensions.lnticket import ln... |
import discord
from discord.ext import commands
import cogs.cmds as biggay
import importlib
class Mycog:
"""My custom cog that does stuff!"""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
async def help(self, ctx, page: int=None):
"""This does stuff!"""
... |
import cellpylib as cpl
# implements the rule 60 sequential automaton from the NKS Notes on
# Chapter 9, section 10: "Sequential cellular automata"
# http://www.wolframscience.com/nks/notes-9-10--sequential-cellular-automata/
cellular_automaton = cpl.init_simple(21)
r = cpl.AsynchronousRule(apply_rule=lambda n, c... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import os
from utils.tools import Tools
from datetime import datetime
obj = Tools()
numChannels = 0
entries = os.listdir('./channels')
for entry in entries:
test = open('./channels/' + entry,)
data = json.load(test)
connection = data['DATA']['ur... |
"""
ASGI config for hospitable project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SE... |
# 中间人的配置信息
# 让中间人连接redis的 14号库
broker_url = "redis://127.0.0.1/14"
# 任务执行结果保存在 15号库
result_backend = "redis://127.0.0.1/15"
# #https://www.rabbitmq.com/
# broker_url= 'amqp://guest:guest@127.0.0.1:5673' |
#!/usr/bin/env python3
# coding: utf-8
import os.path as osp
from pathlib import Path
import numpy as np
import torch
import torch.utils.data as data
import cv2
import pickle
import argparse
from .io import _numpy_to_tensor, _load_cpu, _load_gpu
from utils.params import *
def reconstruct_vertex(param, whitening=Tru... |
import pytest
from validate import check_query_f
# Mark that all tests in this module can be run as server upgrade tests
pytestmark = pytest.mark.allow_server_upgrade_test
usefixtures = pytest.mark.usefixtures
@pytest.mark.parametrize("transport", ['http', 'websocket'])
@usefixtures('per_class_tests_db_state')
class... |
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'make_global_settings': [
['CC', '/usr/bin/clang'],
],
'target_defaults': {
'mac_bundle_resources': [
'TestApp/English.lproj/InfoPlist.strings... |
from django import forms
from .models import Berita
class formBerita(forms.ModelForm):
class Meta:
model = Berita
fields = '__all__' |
from abc import abstractmethod
from contextlib import contextmanager
from typing import (
Generator,
)
# Typeshed definitions for multiprocessing.managers is incomplete, so ignore them for now:
# https://github.com/python/typeshed/blob/85a788dbcaa5e9e9a62e55f15d44530cd28ba830/stdlib/3/multiprocessing/managers.pyi#L... |
from ansiblemetrics.ansible_metric import AnsibleMetric
from ansiblemetrics.utils import keyValueList
import re
class NTVR(AnsibleMetric):
"""
This class implements the metric 'Number Of Task Variables' in an Ansible script.
We create a list of every unique task variable in the script and return the length... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import timm
import torch.optim as optim
from torch.optim import lr_scheduler
from torch.optim.lr_scheduler import CosineAnnealingWarmRestarts, ReduceLROnPlateau
from warmup_scheduler import GradualWarmupScheduler
####### MODEL ARCHITECTURE
def ini... |
import net
import numpy as np
import tensorflow as tf
N_BATCH = 20
N_HIDDEN = 256
DISCOUNT = 0.9
EPS = 0.1
MAX_REPLAY_LEN = 5
MAX_EXPERIENCES = 10000
class AttentiveModel(object):
def __init__(self, config):
self.experiences = []
def prepare(self, world):
self.world = world
self.in... |
# !/usr/bin/env python
"""Define the unit tests for the :mod:`colour.plotting.graph` module."""
import platform
import tempfile
import unittest
from colour.plotting import plot_automatic_colour_conversion_graph
from colour.utilities import is_networkx_installed
__author__ = "Colour Developers"
__copyright__ = "Copyri... |
# 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 ... |
"""
ASGI config for djangoapi project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SET... |
# Copyright 2013-2019 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 import *
import glob
import os
import sys
class Verrou(AutotoolsPackage):
"""A floating-point error check... |
begin_unit
comment|'# Copyright 2014 Red Hat, Inc.'
nl|'\n'
comment|'# All Rights Reserved.'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'# not use this file except in compliance with the License. You may obtain'
nl|'\n'
comment|'... |
import os,sys,re
import numpy as np
import pandas as pd
import subprocess
import multiprocessing
from shutil import copyfileobj
import bz2
from distutils.util import strtobool
# parameters
BA = 0.529177 # Bohr - Angstrom conversion
numbers_pattern = re.compile(r"[-+]?\d*\.\d+|\d+")
# box dimensions:
# standard pr... |
# Copyright Lenna Peterson (2012)
# All rights reserved.
#
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included as part of this
# package.
"""Additional protein al... |
# Copyright 2016 The Kubernetes 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 ... |
from django.shortcuts import get_object_or_404, render
from django.template import loader
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.views import generic
from .models import Choice, Question
# Create your views here.
class IndexView(generic.ListView):
t... |
#!/usr/bin/env python
import os,sys
import numpy as np
import scipy
from scipy import ndimage
def main(*args):
if(len(args) < 1):
return 1
l = []
for f in args[1:]:
labels = np.genfromtxt(f,dtype='int16')
l.append(labels.max())
total = np.mean(np.array(l))
avgdiff = np.me... |
import zmq
from binascii import hexlify
ctx = zmq.Context(1)
sock = ctx.socket(zmq.SUB)
sock.connect('ipc:///tmp/zerogw')
sock.setsockopt(zmq.SUBSCRIBE, b"")
while True:
print("Status update for", hexlify(sock.recv()).decode('ascii'))
print(sock.recv().decode('ascii'))
|
"""
Plotting (requires matplotlib)
"""
from colorsys import hsv_to_rgb, hls_to_rgb
from .libmp import NoConvergence
class VisualizationMethods(object):
plot_ignore = (ValueError, ArithmeticError, ZeroDivisionError, NoConvergence)
def plot(ctx, f, xlim=[-5,5], ylim=None, points=200, file=None, dpi=None,
sing... |
try:
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
except ImportError:
from http.server import BaseHTTPRequestHandler, HTTPServer
from functools import wraps
from random import randint
import json
import ssl
import time
import threading
import unittest
def sslwrap(func):
@wraps(func)
... |
#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2005 All Rights Reserved
#
# <LicenseText>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~... |
"""
Test settings for SCT_annotation project.
- Used to run tests fast on the continuous integration server and locally
"""
from .base import * # noqa
# DEBUG
# ------------------------------------------------------------------------------
# Turn debug off so tests run faster
DEBUG = False
TEMPLATES[0]['OPTIONS'][... |
#!/usr/bin/env python
import sys,string,os
sys.path.insert(1, os.path.join(sys.path[0], '..')) ### import parent dir dependencies
import numpy as np
import pylab as pl
import os.path
import scipy
from import_scripts import sampleIndexSelection
import matplotlib.pyplot as plt
import export
from sklearn import dataset... |
from random import randint
from time import sleep
print ('=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=\n'
'Vou pensar em um numero entre 0 a 5 tente adivinhar!\n'
'=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=')
n1 = randint(0, 5)
n2 = int(input('digite o numero que pensei: '))
print ... |
depends = ["pil"]
description = """
Adds Django Imagekit support to your project
For more information, visit:
http://django-imagekit.readthedocs.org/en/latest/
"""
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.