text stringlengths 1 927k |
|---|
from discord.ext import commands
class Info(commands.CommandError):
def __init__(self, message, **kwargs):
super().__init__(message)
self.kwargs = kwargs
class Warning(commands.CommandError):
def __init__(self, message, **kwargs):
super().__init__(message)
self.kwargs = kwarg... |
"""
Visualisation
=============
"""
from ..utils import getLogger
logger = getLogger(__name__)
try:
import matplotlib
from .map_viewer import MapView
from .rotation_angle_plotter import RotationAnglePlotter
except ImportError:
logger.warning('Cannot use MapView or RotationAnglePlotter as matplotlib is ... |
#
# 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 m... |
from typing import Any, Dict, List, Union
from .binance import fetch_markets as binance_fetch_markets
from .bitfinex import fetch_markets as bitfinex_fetch_markets
from .bitget import fetch_markets as bitget_fetch_markets
from .bithumb import fetch_markets as bithumb_fetch_markets
from .bitmex import fetch_markets as ... |
#!/usr/bin/env python3
from abc import ABC, abstractmethod
class AgentBase(ABC):
def __init__(self):
""" Initialize agent.
Params
======
"""
pass
@abstractmethod
def select_action(self, state):
""" Given the state, select an action.
Params
... |
import numpy as np
from scipy.io import loadmat
from scipy.optimize import fmin_cg
# Ignore overflow and divide by zero of np.log() and np.exp()
# np.seterr(divide = 'ignore')
# np.seterr(over = 'ignore')
def sigmoid(z):
return 1.0 / (1.0 + np.exp(-z))
def computeCost(theta, X, y, lamba=1):
m = len(y)
... |
from django.contrib.auth.models import User
from django import forms
class UserForm(forms.ModelForm):
password = forms.CharField(widget=forms.PasswordInput)
class Meta:
model = User
fields = ['username', 'email', 'password'] |
from ._client import MugiMugiClient
from .add_book_to_user_list import AddBookToUserList
from .enum import *
from .get_item_by_id import *
from .remove_book_from_user_list import RemoveBookFromUserList
from .search_image import SearchImage
from .search_item import *
from .search_object import SearchObject
from .vote im... |
"""This module provides a set of classes which underpin the data loading and
saving functionality provided by ``kedro.io``.
"""
import abc
import copy
import logging
import re
import warnings
from collections import namedtuple
from datetime import datetime, timezone
from functools import partial
from glob import iglob... |
#! /usr/bin/env python
#-*- encoding:utf-8 -*-
import sys
import re
try:
reload(sys)
sys.setdefaultencoding('utf-8')
except:
pass
import codecs
from textrank4zh import TextRank4Sentence
def get_textrank(filename, filtername):
# replace the items to blackspace
parten = "“|”|'|-|\"".decode('utf-8'... |
# MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# 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,... |
from __future__ import print_function
from __future__ import absolute_import
import psutil
import os
import platform
import re
import logging
import inspect
from .common import *
import sillyfacter.config
MODULEFILE = re.sub('\.py', '',
os.path.basename(inspect.stack()[0][1]))
def fetch(... |
# Copyright 1999-2018 Alibaba Group Holding 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 a... |
""" IO classes for YOUR_FILE_TYPE_NAME file types
Copyright (C) 2013 DTU Wind Energy
Author: Juan Pablo Murcia
Email: jumu@dtu.dk
Last revision: 28.01.2014
License: Apache v2.0, http://www.apache.org/licenses/LICENSE-2.0
"""
from __future__ import print_function
from we_file_io import WEFileIO, TestWEFileIO
import... |
from __future__ import (division, print_function)
import os
import numpy as np
import pickle
from collections import defaultdict
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.utils.data
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader
from tensorboardX import Summary... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import os
import torch
from PIL import Image, ImageFile
from torchvision import transforms
import torchvision.datasets.folder
from torch.utils.data import TensorDataset, Subset
from torchvision.datasets import MNIST, ImageFolder
from torchvision.tr... |
import os
import queue
import traceback
from concurrent.futures import ThreadPoolExecutor
class BlockingExecutor:
def __init__(self, thread_count, cache_size):
if cache_size <= 0:
raise ValueError('cache_size must > 0')
self.finish = False
self.executor = ThreadPoolExecutor(thr... |
from unittest import TestCase, mock
from iclientpy import AbstractMap
class AbstractMapTestCase(TestCase):
def test_compute_bounds(self):
data = [[1, 2, 3], [4, 5, 6]]
lat_key = lambda d: d[0]
lng_key = lambda d: d[1]
map = AbstractMap()
result = map.compute_bounds(data, la... |
#!/usr/bin/python
# coding=utf-8
""" """
import argparse
import os, sys
from .pipeline_tools import make_perfect_path
def create_VOC_dirs(dir_name):
dir_name_ = make_perfect_path(dir_name)
# print(dir_name_)
# print(type(dir_name_))
if not os.path.exists(dir_name_):
os.system("mkdir " + dir_name_)
os.system(... |
from cornice.resource import resource, view
from ode.models import Source
from ode.resources.base import ResourceMixin, set_content_type
from ode.resources.base import COLLECTION_JSON_MIMETYPE
from ode.validation.schema import SourceCollectionSchema
from ode.validation.validators import has_provider_id
from ode.valida... |
'''
03_WindyGridWorld_nStepSARSA_OffPolicy.py : n-step off-policy SARSA applied to Windy Grid World problem (Example 6.5)
Cem Karaoguz, 2020
MIT License
'''
import numpy as np
import pylab as pl
from IRL.environments.Gridworlds import StochasticGridWorld
from IRL.agents.TemporalDifferenceLearning import nStepOffPoli... |
import Stack
from fractions import Fraction
class infix_to_suffix:
def __init__(self):
self.list_operators = ["+", "-", "×", "÷", "(", ")", "="]
self.pri_operators = {"+": 0, "-": 0, "×": 1, "÷": 1}
def to_suffix_expression(self, expression):
'''生成逆波兰表达式'''
stack_operator = St... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# librairies
import sys
import time
import serial
# connexion au bracelet
bracelet = serial.Serial('/dev/ttyUSB0', 115200, timeout=1)
# nombre de données enregistrées
data_number = 1000
# ouverture du fichier en écriture
file_name = str(int(time.time()))
if len(sys.argv... |
"""
Module to run tests on sort and arsetup
"""
from IPython import embed
import pytest
import numpy as np
from pypeit.core import framematch
from pypeit.tests.tstutils import dummy_fitstbl
from pypeit.pypmsgs import PypeItError
@pytest.fixture
def fitstbl():
return dummy_fitstbl()
def test_frame_selection(f... |
"""
A CapitalT class and functions that use/test it.
Authors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher,
Mark Hays, Amanda Stouder, Aaron Wilkin, their colleagues,
and Landen Berlin.
""" # Done: 1. PUT YOUR NAME IN THE ABOVE LINE.
import rosegraphics as rg
def main():
"""
... |
import sys
import warnings
from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
from django.core.paginator import InvalidPage
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models.fields import FieldDoesNotExist
from django.utils import six
from django.... |
import unittest
from test.helpers import get_last_stage_wrapper
class Rule02Test(unittest.TestCase):
def test_rule0_2(self):
context = """
FROM registry.a.com/acme/centos:7
LABEL maintainer="foo <foo@bar.com>"
EXPOSE 7000
EXPOSE 8080
"""
wrapper = get_last_... |
# Copyright 2020 Huawei Technologies Co., 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... |
import configparser
config = configparser.ConfigParser()
config.read('quicksystem.properties')
class Properties(object):
"""quicksystem properties reader """
def __init__(self):
self.randomSystem = RandomSystem()
self.beaker = Beaker()
self.jenkinsInstaller = JenkinsInstaller()
... |
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.template.loader import get_template
from ...checkout import AddressType
from ...checkout.utils import _get_products_voucher_discount
from ...core.utils.taxes import ZERO_MONEY
from ...discount import VoucherType
fr... |
# 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 warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... |
# A part of NonVisual Desktop Access (NVDA)
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
# Copyright (C) 2008-2019 NV Access Limited, Joseph Lee, Babbage B.V.
"""Manages information about available braille translation tables.
"""
import collections
#: The directo... |
import brownie
MAX_UINT256 = 2 ** 256 - 1
WEEK = 7 * 86400
def test_kick(chain, accounts, gauge_v3_1, voting_escrow, token, mock_lp_token):
alice, bob = accounts[:2]
chain.sleep(2 * WEEK + 5)
token.mint(alice, 10 ** 24)
token.approve(voting_escrow, MAX_UINT256, {"from": alice})
voting_escrow.cre... |
from model.ActionType import ActionType
from model.HockeyistType import HockeyistType
from model.Hockeyist import Hockeyist
from Constants import *
from PuckManPlay import *
from DefPlay import *
from MathFunc import *
from PlayerStates import *
from Strategy import *
def strategy_6x6(const, players):
for player i... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-07-05 18:39
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('bot', '0024_auto_20180705_1804'),
]
operations = [... |
from trainClass import *
from utils.loss import *
from utils.utils import *
from modelsTF import *
from tensorflow.keras.optimizers import Adam, SGD, Nadam
from sklearn.model_selection import train_test_split
from tensorflow.keras.metrics import Mean
import tensorflow as tf
import numpy as np
import logging
import os
i... |
# -*- coding: utf-8 -*-
import copy
import json
from cb_tools.cbstats import Cbstats
from couchbase_helper.documentgenerator import doc_generator
from failover.failoverbasetest import FailoverBaseTest
from membase.api.rest_client import RestConnection, RestHelper
from remote.remote_util import RemoteUtilHelper, Remote... |
from flask import Blueprint
api = Blueprint('api_v1', __name__)
# Import any endpoints here to make them available
from . import webhook
from . import webhook_dev |
from datetime import datetime
import numpy as np
import pandas as pd
import pytest
from featuretools.primitives.standard.datetime_transform_primitives import (
DistanceToHoliday,
)
def test_distanceholiday():
distance_to_holiday = DistanceToHoliday("New Year's Day")
dates = pd.Series(
[
... |
from __future__ import print_function, division
from collections import OrderedDict, deque
from datetime import datetime
from warnings import warn
import pandas as pd
from nilmtk.feature_detectors.cluster import hart85_means_shift_cluster
from nilmtk.feature_detectors.steady_states import (
find_steady_states_tra... |
from .send_gmail import jinja_render, markdown_render, send_email |
for i in range(1,10):
print(i)
print("Done")
for i in range(1,10):
print(i*i)
print("Test") |
"""
Test parsers
"""
from __future__ import print_function
import unittest
import filecmp
import sys
import os
import glob
import json
import shutil
from mock import patch, Mock, mock_open
from pyingest.parsers import arxiv
from pyingest.config import config
from pyingest.parsers.author_names import AuthorNames
from ... |
import audioop
import fractions
from av import AudioFrame
from ._opus import ffi, lib
CHANNELS = 2
SAMPLE_RATE = 48000
SAMPLE_WIDTH = 2
SAMPLES_PER_FRAME = 960
TIME_BASE = fractions.Fraction(1, SAMPLE_RATE)
class OpusDecoder:
def __init__(self):
error = ffi.new('int *')
self.decoder = lib.opus_... |
"""
Example application using Tornado and Curl
"""
import os
import sys
import tornado.httpclient
import tornado.ioloop
import tornado.web
tornado.httpclient.AsyncHTTPClient.configure(
'tornado.curl_httpclient.CurlAsyncHTTPClient')
class MainHandler(tornado.web.RequestHandler):
@tornado.web.asynchronous
... |
# Client application
import paho.mqtt.client as mqtt
import os
import time
# MQTT Broker info
broker = "m16.cloudmqtt.com"
port = 15432
ssl_port = 25432
username = "idimoiey"
password = "DtiBxZxDcQsI"
def on_message(client, userdata, message):
message_content = message.payload.decode('utf-8')
if message.topic == '... |
import cgi
import logging
import sys
import re
from signal import signal, SIGINT, SIGTERM, SIGABRT
from threading import Thread, Lock
from time import sleep
import types
import json
import requests
from cached_property import cached_property
from expiringdict import ExpiringDict
from requests import Request
from reque... |
from setuptools import setup, find_packages
setup (
name= 'deltasherlock',
version= '0.1.1',
description= 'Application Identification',
author='BU PEACLab',
classifiers = [
'Development Status :: 3 - Alpha',
'Programming Language :: Python :: 3'
],
packages= find_packages(),
include_package_data = True,
# pac... |
from typing import List
import numpy as np
from .mesh import StudioMesh
from .....library.utils.byte_io_mdl import ByteIO
class StudioModel:
vertex_dtype = np.dtype([
('id', np.uint32, (1,)),
('pos', np.float32, (3,)),
])
def __init__(self):
self.name = ''
self.unk_1 = 0... |
from django.test import TestCase
from .models import Category, Location, Image
class CategoryTestClass(TestCase):
def setUp(self):
self.category = Category(category_name='Wildlife')
self.category.save_category()
def test_instance(self):
self.assertTrue(isinstance(self.category, Categor... |
#####################################################################
# #
# /connections.py #
# #
# Copyright 2013, Monash University ... |
# Copyright 2016 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 a... |
#!/usr/bin/env python
import sys
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
description = "Python library for using the Cuckoo 2.0 ... |
from setuptools import setup, find_packages
from distribute_setup import use_setuptools
use_setuptools()
setup(
name='django-dilla',
version='0.2dev',
author='Adam Rutkowski',
author_email='adam@mtod.org',
packages=find_packages(),
url='http://aerosol.github.com/django-dilla/',
license='BS... |
#!/usr/bin/python
import sys
for line in sys.stdin:
data = line.strip().split(" ")
print(data[6]) |
#!/usr/bin/env python3
#
# This script figures the order in which workspace crates must be published to
# crates.io. Along the way it also ensures there are no circular dependencies
# that would cause a |cargo publish| to fail.
#
# On success an ordered list of Cargo.toml files is written to stdout
#
import os
import... |
import unittest
from ctypes import *
import _ctypes_test
class ReturnFuncPtrTestCase(unittest.TestCase):
def test_with_prototype(self):
# The _ctypes_test shared lib/dll exports quite some functions for testing.
# The get_strchr function returns a *pointer* to the C strchr function.
dll =... |
#!/usr/bin/python
L = [1, 2, [3, 4], (1, 2), [1, [2, 3, (2, 5)]], 8]
def sum_seq(sequence):
if len(sequence) == 0:
return 0
else:
if isinstance(sequence[0], (list, tuple)):
return sum_seq(sequence[0]) + sum_seq(sequence[1:])
else:
return sequence[0] + sum_seq(s... |
#python AlleleHMM.py prefix counts_plus_hmm.txt counts_minus_hmm.txt
import numpy as np
from math import *
import scipy.stats
#from sys import argv
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import time
import multiprocessing
import sys, getopt
counts_hmm="-"
counts_plus_hmm = "-"
counts_... |
"""traitcuration URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/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')
Class... |
from .base import BaseController
from views import RegisterView
from models import Registration, Student
from common_queries import get_section_name, get_username_and_full_name
from peewee import IntegrityError
from routes import *
class RegisterController(BaseController):
def __init__(self, router, payload):
supe... |
from __future__ import absolute_import
import logging
from datetime import datetime
from uuid import uuid4
import pytz
import urllib3
from sentry import quotas
from sentry.eventstream.base import EventStream
from sentry.utils import snuba, json
from sentry.utils.safe import get_path
logger = logging.getLogger(__na... |
import threading
from funcy import cached_property, wrap_prop
from dvc.scheme import Schemes
# pylint:disable=abstract-method
from .base import FileSystem
class WebHDFSFileSystem(FileSystem):
scheme = Schemes.WEBHDFS
REQUIRES = {"fsspec": "fsspec"}
PARAM_CHECKSUM = "checksum"
@classmethod
def ... |
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... |
import torch.nn as nn
import torch
import math
from torch.autograd import Variable
from typing import Dict, List
from flair.data import Dictionary
class LanguageModel(nn.Module):
"""Container module with an encoder, a recurrent module, and a decoder."""
def __init__(self,
dictionary: Diction... |
from django.urls import path
from . import views
app_name = 'esia'
urlpatterns = [
path('', views.index, name='index'),
path('esia/', views.callback, name='callback')
] |
import datetime
import mock
from pytest import raises
from serde import Model, field
from serde.error import DeserializationError, SerdeError, SerializationError, ValidationError
from tests import py2_patch_str_with_basestring
class TestModel:
def test___new__(self):
class Example(Model):
a... |
# Adapted for numpy/ma/cdms2 by convertcdms.py
import os, sys
import cdms2 as cdms, vcs
import EzTemplate
# Open file and retrieve data variable.
fname = os.path.join(vcs.sample_data, 'clt.nc')
cfile = cdms.open(fname)
data = cfile('clt')
# Initialize vcs.
x = vcs.init()
# Configure the template.
M = EzTemplate.Mul... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
"""
BMI203: Biocomputing algorithms Winter 2022
Assignment 6: Logistic regression
"""
from .logreg import (BaseRegressor, LogisticRegression)
from .utils import loadDataset
__version__ = '0.1.0' |
"""
Web handlers
"""
import logging
import arrow
import tornado.web
_FMT = 'YYYY-MM-DDTHH:mm:ssZ'
logging.getLogger('boto').setLevel(logging.CRITICAL)
class BaseHandler(tornado.web.RequestHandler):
def initialize(self, model, asset_env, gauges_site_id, ga_tracking_id,
ga_domain, google_sit... |
# Copyright 2017 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 dgcn.utils
from .Sample import Sample
from .Dataset import Dataset
from .Coach import Coach
from .model.DialogueGCN import DynaEval
from .Optim import Optim |
"""Network units wrapping TensorFlows' tf.contrib.rnn cells.
Please put all wrapping logic for tf.contrib.rnn in this module; this will help
collect common subroutines that prove useful.
"""
import abc
import tensorflow as tf
from dragnn.python import network_units as dragnn
from syntaxnet.util import check
class... |
#!/usr/bin/env python
# coding: utf-8
try:
import sys
import os
import pygame
except ImportError, error:
print >> sys.stderr, "Erro ao importar o modulo", error
os._exit(1)
class Audio:
"""Classe Audio é uma classe para manipular arquivos de Audio
:version: 224
:author: Felipe Mi... |
from setuptools import setup, find_namespace_packages
# Package metadata.
name = "methyl-opencv-suite"
description = "MOS: Utilities and computer vision operations for rapid development with OpenCV"
version = "0.0.1"
release_status = "Development Status :: 2 - Pre-Alpha"
dependencies = [
"opencv-contrib-python",
... |
MAILMAN_PATH_VAL="/var/lib/mailman" |
# ----------------------------------
# File: LeVoice.py
# ----------------------------------
import sys
if '..' not in sys.path:
sys.path.append('..')
import torch
import torch.nn.functional as F
import config
from torch import nn
# -----------------------------------------
def pad_freq(x, padding):
'... |
from core.advbase import *
from slot.a import *
from slot.d import *
def module():
return Ramona
class Ramona(Adv):
a1 = ('primed_att',0.10)
a3 = ('bc',0.13)
conf = {}
conf['slots.a'] = Summer_Paladyns()+Primal_Crisis()
conf['slots.burn.a'] = Resounding_Rendition()+Me_and_My_Bestie()
conf[... |
from pylab import *
from scipy import stats
import pandas as pd
ens1 = np.array([ 5. , 6. , 6. , 7. , 9.72, 9.89, 10.15, 10.16, 10.26, 10.49, 10.56, 10.86])
ens2 = np.array([ 9.18, 9.42, 9.45, 9.91, 9.96, 10.3 , 10.45, 10.55, 11.08, 11.12, 11.54, 11.74])
combine = np.append(ens1, ens2)
x=arange... |
from django.contrib import admin
from .models import Food, Reciept, Survey
admin.site.register(Food)
admin.site.register(Reciept)
admin.site.register(Survey) |
import struct
import unittest
import json
from manticore.platforms import evm
from manticore.core import state
from manticore.core.smtlib import Operators, ConstraintSet
import os
class EVMTest_BYTE(unittest.TestCase):
_multiprocess_can_split_ = True
maxDiff = None
def _execute(self, new_vm):
las... |
from django.contrib import admin
from django.contrib.contenttypes.generic import GenericStackedInline
from reversion import VersionAdmin
from inventory.devices.models import Ipad
class IpadAdmin(VersionAdmin):
list_display = ['lender', 'lendee', 'status','condition', 'updated_at']
admin.site.register(Ipad, Ipa... |
# coding: utf-8
import pprint
import re
import six
class ServerAttachableQuantity:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the... |
# Copyright 2015 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... |
#
# 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 us... |
#!/usr/bin/env python
from neml.math import tensors
import common
import unittest
import numpy as np
import numpy.linalg as la
class TestVector(unittest.TestCase):
def setUp(self):
self.a = np.array([2.2,-1.2,2.5])
self.b = np.array([0.0,5.8,1.1])
self.va = tensors.Vector(self.a)
self.vb = tensor... |
# Copyright 2018 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
'''
ein Class for login und logout session
'''
class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd # Zugang zu Driver wird benötigt
self.app.open_home_page()
wd.find_element_by_name("user").cl... |
# -*- coding: utf-8 -*- #
# Copyright 2014 Google 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/licenses/LICENSE-2.0
#
# Unless requir... |
"""
This module uses Frama-C to apply static slicing on the given input. In its default setting, it slices on the
reachability of __VERIFIER_error and assert calls.
"""
import os
import re
import subprocess
import sys
import tempfile
from pycparser import c_ast
from pycparserext.ext_c_generator import GnuCGenerator
f... |
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... |
# Copyright 2021 Northern.tech AS
#
# 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 ag... |
# Copyright (c) 2021 PPViT 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 applicable l... |
#GUI Imports
import PySimpleGUI as sg
#FileUpload Imports
import fitz
import os
import string
import re
import pprint
from DocSearcher import DocSearcher
from TextCleaner import TextCleaner
from TopicModeler import TopicModeler
from timeit import default_timer as timer
def GetFilepath(filepath, index):
file_contents... |
# -*- coding: utf-8 -*-
from django.db import models
from django.db.models import Q
from datetime import timedelta
from django.utils import timezone
from contest_app.models.contest_types import Contest_Type
from contest_app.models.metrics import Metric
from beauty_and_pics.consts import project_constants
from website.... |
"""
Dev config for uvicorn
"""
import uvicorn
from app.core.config import settings
if __name__ == "__main__":
if settings.PYDEVD:
import pydevd_pycharm
pydevd_pycharm.settrace(
settings.PYDEVD_HOST,
port=settings.PYDEVD_PORT,
stdoutToServer=True,
st... |
"""application URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Clas... |
import tkinter as tk
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
data = {
'0-9': 5000,
'10-19': 2000,
'20-29': 30000,
'30-39': 43490,
'40-49': 39898
}
clave = data.keys()
valor ... |
#!/usr/bin/env python
# coding: utf-8
import os
import sys
import threading
import time
import unittest
pkg_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) # noqa
sys.path.insert(0, pkg_root) # noqa
import dss.stepfunctions.lambdaexecutor as lambdaexecutor
from tests.infra import testmode
c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.