text stringlengths 2 999k |
|---|
#!/usr/bin/env python
"""
<Program Name>
schema.py
<Author>
Geremy Condra
Vladimir Diaz <vladimir.v.diaz@gmail.com>
<Started>
Refactored April 30, 2012 (previously named checkjson.py). -Vlad
<Copyright>
See LICENSE for licensing information.
<Purpose>
Provide a variety of classes that compare objects
... |
from .sections import Section
from .question import Question
from .choices import Choice
# answers
from .text_answer import TextAnswer
from .choice_answer import ChoiceAnswer
from .multiple_choice_answers import MultipleChoiceAnswer |
# flake8: noqa: F811, F401
import asyncio
import logging
from secrets import token_bytes
from typing import List, Optional
import pytest
from littlelambocoin.consensus.blockchain import ReceiveBlockResult
from littlelambocoin.consensus.multiprocess_validation import PreValidationResult
from littlelambocoin.consensus.... |
#!/usr/bin/env python3
# Copyright (c) 2017-2020 The UFO Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test HD Wallet keypool restore function.
Two nodes. Node1 is under test. Node0 is providing transactions a... |
#!/usr/bin/env python
# define_constants.py
#
# Use this script to define and load any constants.
#
# name value description units
density_ref = 2.6867E19 # Ideal gas denisty at Tref [molecules/cm^3]
Tref = 273.15 # reference temperature [K]
btz = 1.4387863... |
################################################################################
# Version 1.0 Revision: 1 #
# #
# Copyright 1997 - 2015 by IXIA ... |
import re
import math
from enum import Enum
import os
os.system("")
class TokenEnum(Enum):
num = 1
newline = 2
skip = 3
lparen = 4
rparen = 5
compopr = 6
binopr = 7
const = 8
func = 9
end = 10
mismatch = 11
class Token():
def __init__(self, type, value, line, start, ... |
from parsimony.generators import Generator
from parsimony import ParsimonyException
import os.path
class PathMonitor(Generator):
"""Monitors the path for changes. This is primarily useful as a parameter key
"""
def __init__(self, key, file_path):
"""
:param key: generator key
:p... |
from pandas import Series
from pandas import read_csv
from statsmodels.tsa.arima_model import ARIMA
import numpy
# create a differenced series
def difference(dataset, interval=1):
diff = list()
for i in range(interval, len(dataset)):
value = dataset[i] - dataset[i - interval]
diff.append(value)
return numpy.arr... |
import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="text", parent_name="layout.scene.zaxis.title", **kwargs
):
super(TextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=p... |
from pynumdiff.paper import plot
|
import torch
import torch.nn as nn
class DCENet(nn.Module):
'''https://li-chongyi.github.io/Proj_Zero-DCE.html'''
def __init__(self, n=8, return_results=[4, 6, 8]):
'''
Args
--------
n: number of iterations of LE(x) = LE(x) + alpha * LE(x) * (1-LE(x)).
return_resul... |
import tf_rllab.core.layers as L
import tensorflow as tf
import numpy as np
import itertools
from rllab.core.serializable import Serializable
from tf_rllab.core.parameterized import Parameterized, Model
from tf_rllab.core.layers_powered import LayersPowered
from rllab.baselines.base import Baseline
from rllab.misc.ove... |
#!/usr/bin/env python
"""Model scoring (WIP) - Contributions welcome!!
"""
# import argparse
import joblib
import json
import numpy
from azureml.core.model import Model
from sklearn import datasets
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
def init():
globa... |
import csv
import io
import json
import os
import requests
from .constants import *
from .dialects import ACCDB, CSV, ALL_DIALECTS
from .dataworld_publisher import DataWorldPublisher
from .github_publisher import GitHubPublisher
from .s3_publisher import S3Publisher
from .utils import *
# The settings file is option... |
# ----------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License
# ----------------------------------------------------------------------
"""Contains the scalar type info objects"""
import os
import textwrap
... |
import sys
import time
from direct.directnotify import DirectNotifyGlobal
from direct.showbase import DirectObject
from pandac.PandaModules import *
from otp.chat.ChatGlobals import *
from otp.chat.TalkGlobals import *
from otp.chat.TalkHandle import TalkHandle
from otp.chat.TalkMessage import TalkMessage
from otp.otpb... |
#
# Copyright 2016 The BigDL 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 ... |
#!/usr/bin/env python3
import sys, os
from math import sqrt, floor
def isprime_slow(n):
assert n>0
assert int(n)==n
if n==1:
return False
i = floor(sqrt(n))
#print("isprime", i, n)
for j in range(2, i+1):
if n%j == 0:
return False
return True
isprime = ispr... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
##################################################
## This script allows to append one file to
## another and write the result to the specified
## output which results in a simple polyglot file.
##################################################
## Author: Paul Kalauner
... |
"""Indy utilities for revocation."""
from time import time
from marshmallow import fields
from ...messaging.models.base import BaseModel, BaseModelSchema
from ...messaging.valid import INT_EPOCH
class NonRevocationInterval(BaseModel):
"""Indy non-revocation interval."""
class Meta:
"""NonRevocatio... |
# pylint: disable=E1103
import nose
import unittest
from numpy.random import randn
import numpy as np
import random
from pandas import *
from pandas.tseries.index import DatetimeIndex
from pandas.tools.merge import merge, concat
from pandas.util.testing import (assert_frame_equal, assert_series_equal,
... |
import logging
import threading
from queue import Queue, Empty
logger = logging.getLogger(__name__)
class BaseWorker:
"""
Base worker class.
Each worker must implement the run method to start listening to the queue
and calling handler functions
"""
def __init__(self, queue: Queue):
... |
from django.conf.urls import url,include
from . import views
from django.conf.urls.static import static
from django.conf import settings
urlpatterns=[
url('^$',views.welcome,name = 'welcome'),
url(r'^profile/$', views.profile, name='profile'),
url(r'home/',views.Home,name='Home'),
url(r'about/',views.a... |
from app import application
if __name__ == "__main__":
application.run()
|
from uuid import uuid4
class User:
def __init__(self, name=None, email=None, password=None):
self.name = name or str(uuid4())[24:]
self.email = email or f'{self.name}@example.com'
self.password = password or str(uuid4())[24:]
|
import time
from ggp.util import shuffle
from ggp.cache import FIFOCache
class VF:
"""
Tuple: (value, features)
"""
def __init__(self, tup):
self.tup = tup
def __cmp__(self, other):
return cmp(self.tup[0], other.tup[0])
def __repr__(self):
return str(self.tup)
... |
#!/usr/bin/env python
"""Tests for administrative flows."""
import os
import subprocess
import sys
import time
import psutil
from grr.lib import action_mocks
from grr.lib import aff4
from grr.lib import config_lib
from grr.lib import email_alerts
from grr.lib import flags
from grr.lib import flow
from grr.lib imp... |
def superSeq(X, Y, m, n):
if (not m):
return n
if (not n):
return m
if (X[m - 1] == Y[n - 1]):
return 1 + superSeq(X, Y, m - 1, n - 1)
return 1 + min(superSeq(X, Y, m - 1, n),
superSeq(X, Y, m, n - 1))
X = "AGGTAB"
Y = "GXTXAYB"
print("... |
"""Provide CudaNdarrayType
"""
import os
import copy_reg
import warnings
import numpy
import theano
from theano import Type, Variable
from theano import tensor, config
from theano import scalar as scal
from theano.compat.six import StringIO
try:
# We must do those import to be able to create the full doc when nv... |
from __future__ import absolute_import
from __future__ import print_function
import argparse
import sys
from aetros.starter import start_keras
from aetros.backend import JobBackend
from aetros.utils import unpack_full_job_id
class StartSimpleCommand:
def __init__(self, logger):
self.logger = logger
... |
from twilio.rest import Client
#envia msg para whatsapp
def enviaMsg(msg,num):
# Your Account Sid and Auth Token from twilio.com/console
# DANGER! This is insecure. See http://twil.io/secure
account_sid = 'ACf359d87d80dec8e234eb846a8401d673'
auth_token = '[DELETED]'
client = Client(account_sid... |
# -*- coding: utf-8 -*-
'''
Retrieve Pillar data by doing a MySQL query
:maturity: new
:depends: python-mysqldb
:platform: all
Theory of mysql ext_pillar
=====================================
Ok, here's the theory for how this works...
- If there's a keyword arg of mysql_query, that'll go first.
- Then any non-keyw... |
import tkinter as tk
import tkinter.ttk as ttk
from tkinter import scrolledtext
from tkinter import filedialog
from .control import Control
from .gridframe import GridFrame
from .workspacecanvas import WorkspaceCanvas
class Primary(GridFrame):
def __init__(self, parent, *args, **kwargs):
GridFrame.__in... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 Robin Wen <blockxyz@gmail.com>
#
# Distributed under terms of the MIT license.
import socket
import os
import sys
def get_ip(host):
"""
Get ip of host.
"""
try:
host_ip = socket.gethostbyname(host)
ret... |
# Generated by Django 2.1.2 on 2018-10-29 13:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("motions", "0015_metadata_permission")]
operations = [
migrations.AddField(
model_name="state",
name="merge_amendment_into_final",... |
from .common import *
def cluster_and_client(cluster_id, mgmt_client):
cluster = mgmt_client.by_id_cluster(cluster_id)
url = cluster.links.self + '/schemas'
client = rancher.Client(url=url,
verify=False,
token=mgmt_client.token)
return cluster, c... |
#!/usr/bin/python3
from email.mime.text import MIMEText
from email.header import Header
import smtplib
import constants
def send(title, content):
try:
smtpObj = smtplib.SMTP(constants.MAIL_SMTP_SERVER, constants.MAIL_SMPT_PORT)
smtpObj.starttls()
smtpObj.login(constants.MAIL_SMTP_USERNAME, constants.MAIL_SMTP_P... |
import numpy as np
from tqdm import tqdm
import torch
import pandas as pd
class GradMinimizerBase():
def __init__(self, energy_fn, protein, num_steps=1000, log_interval=10):
self.energy_fn = energy_fn
self.protein = protein
self.optimizer = None
self.x_best = self.protein.coords
... |
# Copyright 2020 Alibaba Group Holding Limited. 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 ... |
#coding=utf-8
import tensorflow as tf
from object_detection2.data.dataloader import DataLoader
import time
import tensorflow as tf
import wml_tfutils as wmlt
import wsummary
import wml_utils as wmlu
import iotoolkit.coco_tf_decodev2 as cocodecode
import iotoolkit.coco_toolkit as cocot
import wsummary
import iotoolkit.t... |
from pydantic import BaseModel
class ContribStats(BaseModel):
contribs: int
commits: int
issues: int
prs: int
reviews: int
other: int
class MiscStats(BaseModel):
total_days: str
longest_streak: str
weekend_percent: str
class LOCStats(BaseModel):
loc_additions: str
loc_d... |
import os
if __name__ == "__main__":
import sys
sys.path.append(os.path.abspath(""))
import math
import torch
from torch.nn import LayerNorm
from megatron.model.fused_softmax import FusedScaleMaskSoftmax, SoftmaxFusionTypes
from megatron.model.gpt2_model import gpt2_attention_mask_func as attention_mask_f... |
import os
import json
import mock
import unittest
import requests
from loginpass._core import UserInfo
from loginpass import (
BattleNet,
Twitter,
GitHub,
Yandex,
Reddit,
Dropbox,
Discord,
Twitch,
Gitlab,
Strava,
LinkedIn,
ORCiD,
)
TEST_DIR = os.path.dirname(os.path.abs... |
from ..kast import KAtt, KClaim, KRule, KToken
from ..ktool import KompileBackend
from ..prelude import Sorts
from .kprove_test import KProveTest
class SimpleProofTest(KProveTest):
KOMPILE_MAIN_FILE = 'k-files/simple-proofs.k'
KOMPILE_BACKEND = KompileBackend.HASKELL
KOMPILE_OUTPUT_DIR = 'definitions/simp... |
# flake8: noqa
from typing import Dict
from collections import OrderedDict
from pathlib import Path
import pandas as pd
from catalyst.contrib.data.nlp.dataset import TextClassificationDataset
from catalyst.dl import ConfigExperiment
class Experiment(ConfigExperiment):
"""
@TODO: Docs. Contribution is welcom... |
# !/usr/bin/python
# -*- coding: utf-8 -*-
# @time : 2020/4/22 21:42
# @author : Mo
# @function: |
from __future__ import unicode_literals, absolute_import, division, print_function
from django.contrib.auth.models import AnonymousUser
from django.http import Http404
from django.test import RequestFactory
from django.test.utils import override_settings
from .test_app import views
from waffle.middleware import Waff... |
def rebase_parser(rebase_file):
"""
:param rebase_file: the rebase file to parse
:type rebase_file: file object
:return: at each call return a tuple (str enz name, str binding site)
:rtype: iterator
"""
def clean_seq(seq):
"""
remove each characters which are not a base
... |
# 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, software
# distribu... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-05-10 21:51
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sources', '0016_auto_20170630_2040'),
]
operations = [
migrations.AlterFie... |
import json
import torch
from parameterized import parameterized
from torchaudio.models.wav2vec2 import (
wav2vec2_base,
wav2vec2_large,
wav2vec2_large_lv60k,
)
from torchaudio.models.wav2vec2.utils import import_huggingface_model
from torchaudio_unittest.common_utils import (
get_asset_path,
skipI... |
#!/usr/bin/env python3
import pop.hub
def start():
hub = pop.hub.Hub()
hub.pop.sub.add('pb.pb')
|
import os
recompile = True
lib_ext ='_lib.so'
def work_dir( v__file__ ):
return os.path.dirname( os.path.realpath( v__file__ ) )
PACKAGE_PATH = work_dir( __file__ )
CPP_PATH = os.path.normpath( PACKAGE_PATH + '../../cpp/' )
print(" PACKAGE_PATH = ", PACKAGE_PATH)
print(" CPP_PATH = ", CPP_PATH)
de... |
# -*- coding: utf-8 -*-
"""
建造者模式,建造器,是创建一个Product对象的各个部件指定的抽象接口
Created by 相濡HH on 3/15/15.
"""
from build.product import Product
class Builder(object):
"""
创建产品各个部分的接口
"""
def build_product_head(self):
"""
创建产品头部部分
:return:
"""
def build_product_body(self):
... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import os
import sys
import logging
import numpy as np
import importlib
import warnings
import argparse
import torch.optim as ... |
# 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 ... |
"""Unit tests for vectorization functions."""
import tests.helper as helper
import geomstats.backend as gs
import geomstats.tests
import geomstats.vectorization
class TestVectorization(geomstats.tests.TestCase):
def setUp(self):
class Obj:
def __init__(self):
self.default_po... |
ELECTRUM_VERSION = '4.0.0-rc2' # version of the client package
APK_VERSION = '4.0.0.0' # read by buildozer.spec
PROTOCOL_VERSION = '1.4' # protocol version requested
# The hash of the mnemonic seed must begin with this
SEED_PREFIX = '01' # Standard wallet
SEED_PREFIX_SW = '100' # Segwit w... |
from django.test import TestCase
from django.urls import reverse
class PyAvagenViewTestCase(TestCase):
def setUp(self) -> None:
pass
def test_avatar_generate_view(self):
url = reverse("pyavagen:generator", args=[300, 'Trump'])
res = self.client.get(url)
self.assertEqual(res.... |
test = {
'name': 'q3_2',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> 4 <= spread_5_outcome_average <= 6
True
""",
'hidden': False,
'locked': False
}
],
'scored': True,
'setup': '',
'teardown'... |
#!/usr/bin/env python3
from cereal import car
from panda import Panda
from selfdrive.car.tesla.values import CANBUS, CAR
from selfdrive.car import STD_CARGO_KG, gen_empty_fingerprint, scale_rot_inertia, scale_tire_stiffness, get_safety_config
from selfdrive.car.interfaces import CarInterfaceBase
class CarInterface(Ca... |
from resources.core.permissions import has_admin_permissions
from resources.database.role import add_role, remove_role, get_roles
def check_if_role_exists(guild, discord_role):
roles = get_roles(guild)
return any(map(lambda role: role.admin_role_id == str(discord_role.id), roles))
async def add_admin_role(m... |
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('loginsystem.urls')),
]
|
import numpy as np
from cvxopt import matrix, solvers
from .. import tools
from ..algo import Algo
solvers.options["show_progress"] = False
class ONS(Algo):
"""
Online newton step algorithm.
Reference:
A.Agarwal, E.Hazan, S.Kale, R.E.Schapire.
Algorithms for Portfolio Management based o... |
# -*- coding: utf-8 -*-
class InstitutionsCertificationSubscriptionRequest(object):
"""Implementation of the 'Institutions Certification Subscription Request' model.
TODO: type model description here.
Attributes:
webhook_url (string): Webhook URL to send the notifications to
""... |
import sys
sys.path.append('..')
import torch.nn as nn
import torch.nn.functional as F
class OthelloNNet(nn.Module):
def __init__(self, game, args):
# game params
self.board_x, self.board_y = game.getBoardSize()
self.action_size = game.getActionSize()
self.args = args
su... |
"""
Multi-Scale Binned Activation.
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
class MSBA(nn.Module):
def __init__(self, out_nc=3, bins=64):
super(MSBA, self).__init__()
self.in_nc = out_nc * bins
self.out_nc = out_nc
self.bins = bins
self.norm_fa... |
class Creator:
def __init__(self, identifier: str = None):
self.identifier = identifier
|
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
from __future__ import absolute_import, print_function, unicode_literals
import functools
from ptvsd.common import fmt, json, log, messaging, util
ACCEPT... |
# coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-255
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class SyslogPolicyRef(object):
"""
NOTE: This class... |
import re
import shutil
import argparse
import importlib
from io import BytesIO
from pathlib import Path
from typing import Optional
from zipfile import ZipFile
from urllib.request import urlopen
DOC = "https://github.com/hlovatt/PyBoardTypeshed/archive/master.zip"
MOD = "https://github.com/Josverl/micropython-stubs/a... |
CARD = {
'width': 1016,
'height': 638,
'front': {
'titleAM': {
'top': 59,
'left': 78,
'width': 151,
'height': 42
},
'armenia': {
'top': 443,
'left': 770,
'width': 175,
'height': 37
... |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.internet.protocol}.
"""
from io import BytesIO
from zope.interface import implementer
from zope.interface.verify import verifyObject
from twisted.internet.defer import CancelledError
from twisted.internet.interfaces imp... |
#!/usr/bin/python
# (c) 2017, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['deprecated'],
... |
from o3seespy.base_model import OpenSeesObject
import tempfile
import os
class RecorderBase(OpenSeesObject):
op_base_type = "recorder"
class RecorderToArrayCacheBase(RecorderBase): # TODO: implement NodeToArray where data saved to memory and loaded as array without collect
fname = None
def... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './renderer_q3d_ui.ui',
# licensing of './renderer_q3d_ui.ui' applies.
#
# Created: Fri May 14 15:07:54 2021
# by: pyside2-uic running on PySide2 5.13.2
#
# WARNING! All changes made in this file will be lost!
from PySide2 import QtCor... |
import numpy as np
import copy
import collections
from . import arc
from . import entities
from ..nsphere import fit_nsphere
from ..util import unitize, diagonal_dot
from ..constants import log
from ..constants import tol_path as tol
def fit_circle_check(points, scale, prior=None, final=False, verbose=False):
... |
import math
import time
from queue import Queue
HOST = 'raspberrypi' # The server's hostname or IP address
PORT = 65432 # The port used by the server
""" This thread gets data from the socket, parses it, and sends it to the queue to be displayed """
class RasPi_coms():
def __init__(self, s):
... |
import pytest
from presidio_anonymizer.entities import InvalidParamException
from presidio_anonymizer.operators import OperatorsFactory, OperatorType
def test_given_anonymizers_list_then_all_classes_are_there():
anonymizers = OperatorsFactory.get_anonymizers()
assert len(anonymizers) == 6
for class_name ... |
"""Create PIL images from depth or stencil buffers
This module allows you to capture the current depth
or stencil buffer to a PIL image. This allows you
to, for instance, save the image to disk and examine
it with an image editor to confirm that the buffer
includes the expected results.
"""
from OpenGL.GL import *
fr... |
"""
Module: 'ntptime' on esp8266 v1.9.3
"""
# MCU: (sysname='esp8266', nodename='esp8266', release='2.0.0(5a875ba)', version='v1.9.3-8-g63826ac5c on 2017-11-01', machine='ESP module with ESP8266')
# Stubber: 1.1.2 - updated
from typing import Any
NTP_DELTA = 3155673600
host = "pool.ntp.org"
def settime():
pass
... |
import strawberry
from strawberry.annotation import StrawberryAnnotation
from strawberry.field import StrawberryField
from strawberry.lazy_type import LazyType
from strawberry.types.fields.resolver import StrawberryResolver
# This type is in the same file but should adequately test the logic.
@strawberry.type
class L... |
#!/usr/bin/env python3
from unittest import TestCase
try:
from rnaindel.rnaindel_lib import SequenceWithIndel
except:
from ..rnaindel_lib import SequenceWithIndel
class TestIndelEquivalentSolver(TestCase):
def setUp(self):
# insertion equivalent case 1
self.idl1 = SequenceWithIndel(... |
#!/usr/bin/env python
# Copyright 2019-2021 The University of Manchester, UK
# Copyright 2020-2021 Vlaams Instituut voor Biotechnologie (VIB), BE
# Copyright 2020-2021 Barcelona Supercomputing Center (BSC), ES
# Copyright 2020-2021 Center for Advanced Studies, Research and Development in Sardinia (CRS4), IT
#
# Licens... |
##########################################################################
#
# Copyright (c) 2007-2011, 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... |
# encoding: utf-8
# module PySide.QtGui
# from C:\Python27\lib\site-packages\PySide\QtGui.pyd
# by generator 1.147
# no doc
# imports
import PySide.QtCore as __PySide_QtCore
import Shiboken as __Shiboken
class QTileRules(__Shiboken.Object):
# no doc
def __copy__(self, *args, **kwargs): # real signature unkno... |
"""
Django settings for website project.
Generated by 'django-admin startproject' using Django 3.2.9.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
import os
fro... |
class A:
def f(self):
print("F in A")
class B:
def f(self):
print("F in B")
class C(B,A):
pass
c = C()
c.f()
|
# Copyright (c) 2014 VMware, 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 a... |
from spaceone.core.error import *
class ERROR_NOT_SUPPORT_RESOURCE_TYPE(ERROR_INVALID_ARGUMENT):
_message = 'Resource type not supported. (resource_type = {resource_type})'
class ERROR_STATISTICS_QUERY(ERROR_INVALID_ARGUMENT):
_message = 'Statistics query failed. (reason = {reason})'
class ERROR_STATISTIC... |
# (C) Datadog, Inc. 2019
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
# Exceptions for the CLI module.
class CLIError(Exception):
def __init__(self, standard_distribution_name):
self.standard_distribution_name = standard_distribution_name
def __str__(self):
... |
# 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)
import argparse
import os
import pytest
import spack.cmd.create
import spack.util.editor
from spack.url import Undetectab... |
from argparse import ArgumentParser
from SnapWrap import Snapchat
class StorifierBot(Snapchat):
def on_snap(self, sender, snap):
print "New snap from: " + repr(sender)
self.post_story(snap)
def on_friend_add(self, friend):
self.add_friend(friend)
parser = ArgumentParser("Storifier B... |
#!/usr/bin/env python
from argparse import ArgumentParser
import random
import string
def get_words():
dictionary_file = "/usr/share/dict/words"
words = []
try:
with open(dictionary_file) as file:
for line in file:
words.append(line.rstrip())
except FileNotFoundEr... |
#!/usr/bin/env python
"""Base test classes for API handlers tests."""
from __future__ import print_function
from __future__ import unicode_literals
import abc
import json
import logging
import os
import re
import socket
import sys
from future.utils import iteritems
from future.utils import itervalues
from future.uti... |
import collections
import functools
import itertools
import threading
import six
import numpy as np
import scipy.sparse as sps
import theano.sparse as sparse
from theano import theano, tensor as tt
from theano.tensor.var import TensorVariable
from pymc3.theanof import set_theano_conf
import pymc3 as pm
from pymc3.mat... |
from rest_framework import serializers
class WaardeSerializer(serializers.Serializer):
code = serializers.CharField(required=False)
omschrijving = serializers.CharField(required=False)
|
#!/usr/bin/env python
"""
Analyze docstrings to detect errors.
If no argument is provided, it does a quick check of docstrings and returns
a csv with all API functions and results of basic checks.
If a function or method is provided in the form 'pandas.function',
'pandas.module.class.method', etc. a list of all error... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-17 09:39
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.