text stringlengths 1 927k |
|---|
# 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... |
import igraph
import json
data = []
f = open("./miserables.json", 'r')
f = open("./mygraph.json", 'r')
data = json.loads(f.read())
print(data.keys())
N=len(data['nodes'])
L=len(data['links'])
Edges=[(data['links'][k]['source'], data['links'][k]['target']) for k in range(L)]
G=igraph.Graph(Edges, directed=False)
... |
from django.shortcuts import render, redirect
from .credentials import REDIRECT_URI, CLIENT_SECRET, CLIENT_ID
from rest_framework.views import APIView
from requests import Request, post
from rest_framework import status
from rest_framework.response import Response
from .util import *
from api.models import Room
from .m... |
#!/usr/bin/env python
"""
<Program Name>
test_keydb.py
<Author>
Vladimir Diaz <vladimir.v.diaz@gmail.com>
<Started>
October 2012.
<Copyright>
See LICENSE for licensing information.
<Purpose>
Unit test for 'keydb.py'.
"""
# Help with Python 3 compatibility, where the print statement is a function, an
# i... |
from setuptools import setup
setup(
name='lucy_password',
version='0.1',
url='https://github.com/Mattis3403/lucy_password',
license='MIT',
author='Lucy',
author_email='m.seebeck@campus.tu-berlin.de',
description='A Password Manager'
) |
# Copyright (C) 2013 Intel Corporation
#
# Released under the MIT license (see COPYING.MIT)
# Main unittest module used by testimage.bbclass
# This provides the oeRuntimeTest base class which is inherited by all tests in meta/lib/oeqa/runtime.
# It also has some helper functions and it's responsible for actually star... |
#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2003 All Rights Reserved
#
# <LicenseText>
#
# ~~~~~~~~~~~~~~~~... |
import math
def iter_pi(epsilon):
down=1
res=0
count=0
while abs(res*4-math.pi)>epsilon:
if count%2==0:
res+=1/down
else:
res-=1/down
count+=1
down+=2
return [count, round(res*4,10)] |
import sys
import json
import requests
from flask import Flask
from flask import request
from tracing import init_tracer, flask_to_scope
import opentracing
from opentracing.ext import tags
from opentracing_instrumentation.client_hooks import install_all_patches
from flask_opentracing import FlaskTracer
from flask_cors ... |
import requests
import base64
import time
import os
import pathlib
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.keys import Keys
fr... |
import torch
from torch.autograd import Variable
import onmt.translate.Beam
import onmt.io
class Translator(object):
"""
Uses a model to translate a batch of sentences.
Args:
model (:obj:`onmt.modules.NMTModel`):
NMT model to use for translation
fields (dict of Fields): data fie... |
l=list(map(int,input().split()))
output=[]
l1=[ 2**i for i in range(2,26)]
a=1
l2=[]
for i in range(len(l1)):
a=l1[i]-a
l2.append(a)
l2.insert(0,1)
l2.insert(0,1)
l1.insert(0,2)
l1.insert(0,0)
l2.insert(0,0)
for i in range(1,len(l)):
a1=l[i]
output.append(l2[a1])
output.append(l1[a1])
for i in ... |
import unittest
from unittest import TestCase
import mechanize
def first_form(text, base_uri="http://example.com/"):
return mechanize.ParseString(text, base_uri)[0]
class MutationTests(TestCase):
def test_add_textfield(self):
form = first_form('<input type="text" name="foo" value="bar" />')
... |
'''
THE OXYTOCIN RECEPTOR METABOLIC PATHWAY
VERSION 1.0
G alpha q11 coupled receptor
last modification 4 October 2020
References:
1. Chang, Chiung-wen, Ethan Poteet, John A. Schetz, Zeynep H. Gümüş,
and Harel Weinst... |
# Copyright 2019 The Forte 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 ... |
#Is it possible to use numpy.ufunc.reduce over an iterator of ndarrays?
#I have a generator function that yields ndarrays (all of the same shape and dtype) and I would like to find the maximum value at each index.
#Currently I have code that looks like this:
def main():
import numpy as np
import cv2
sh... |
from flask.ext.testing import TestCase
from contracts_api.settings import TestConfig
from contracts_api.app import create_app as _create_app
from contracts_api.database import db
from contracts_api.api.models import Stage, Contract, StageProperty, ContractAudit, Flow
class BaseTestCase(TestCase):
'''
A base t... |
import os
os.environ.setdefault(
"DJANGO_SETTINGS_MODULE", "sayit.settings")
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise
public_path = os.path.join(
os.path.dirname(os.path.dirname(__file__)), 'public')
application = get_wsgi_application()
application = Dj... |
import json
import logging
import os
from unittest.mock import patch
from common import LicenseInfo, MockImageStore
import raw_pixel as rwp
_license_info = (
'cc0',
'1.0',
'https://creativecommons.org/publicdomain/zero/1.0/',
None
)
license_info = LicenseInfo(*_license_info)
rwp.image_store = MockIma... |
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... |
# Microsoft Azure Linux Agent
#
# Copyright 2018 Microsoft 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 b... |
# Copyright 2013-2020 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 os
class Mathematica(Package):
"""Mathematica: high-powered computation with thousands of... |
#######################################################################
# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
################################... |
# coding=utf-8
# Copyright 2020 The Google Research 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 applicab... |
import numpy
class Fragments:
"""
Stores arrays of intensities and M/z values, with some checks on their internal consistency.
For example
.. testcode::
import numpy as np
from matchms import Fragments
mz = np.array([10, 20, 30], dtype="float")
intensities = np.arra... |
# Django-Expenses
# Copyright © 2018-2021, Chris Warrick.
# All rights reserved.
# See /LICENSE for licensing information.
"""Category management."""
from collections import defaultdict
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from ... |
#!/usr/bin/env python
import mesos
import os
import pickle
import sys
CPUS = 1
MEM = 50*1024*1024
class NestedScheduler(mesos.Scheduler):
def __init__(self, todo, duration, executor):
mesos.Scheduler.__init__(self)
self.tid = 0
self.todo = todo
self.finished = 0
self.duration = duration
self... |
#!/usr/bin/python
'''
ST Micro Node Server for Polyglot
by Einstein.42(James Milne)
milne.james@gmail.com
'''
import sys
from polyglot.nodeserver_api import SimpleNodeServer, PolyglotConnector
from st_types import STControl
VERSION = "0.0.1"
class STNodeServer(SimpleNodeServer):
''' ST Micro Node Server '... |
#!/usr/bin/env python
'''
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")... |
#!/usr/bin/env python3
#
# Copyright (c) 2020, Somia Reality Oy
# All rights reserved.
# Installing dependencies:
#
# - Ubuntu/Debian: apt install python3-cryptography python3-jwcrypto
# - Using pip: pip3 install cryptography jwcrypto
from argparse import ArgumentParser
from base64 import b64decode, urlsafe_b64de... |
import _plotly_utils.basevalidators
class StreamValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name='stream', parent_name='cone', **kwargs):
super(StreamValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
d... |
### $Id: admin.py,v 1.29 2017/12/18 09:12:51 muntaza Exp $
from django.contrib import admin
from umum.models import Provinsi, Kabupaten, LokasiBidang, SKPD, SUBSKPD, KodeBarang, HakTanah, SatuanBarang, KeadaanBarang, SKPenghapusan, MutasiBerkurang, JenisPemanfaatan, AsalUsul, Tahun, GolonganBarang, Tanah, KontrakTanah... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 11 10:11:21 2017
@author: philipp
"""
from skpr.core.engines import CodedMeasurementEngine
from skpr.core.models import FarfieldCodedMeasurementNet
from skpr.core.parameters import *
from skpr.inout.h5rw import h5read
from skpr.nn import modules as... |
from helpers.executor import Executor
from helpers.util import *
import itertools
from itertools import *
import re
from re import *
import numpy as np
from typing import Any, Callable, Generator, Sequence
day, year = None, None # TODO: Update day and year for current day
split_seq = '\n'
class Solution(Executor)... |
#coding:utf-8
# DeviceActiveListKeyHash = 'blue_earth.device.active.list' # 存放所有上线设备id {a:Time,b:Time}
#
DeviceCommandQueue = 'smartbox.device.command.queue.{device_type}.{device_id}'
#
# DeviceSequence = 'blue_earth.device.sequence'
DeviceChannelPub = 'smartbox.device.channel.pub.{device_id}' # 设备所有原始数据读取之后分发的通道
D... |
#Python 2.7.9 (default, Apr 5 2015, 22:21:35)
# the full environment I used to test this is in basic_project_stats.yml
import sys
# file with raw classifications (csv)
# put this way up here so if there are no inputs we exit quickly before even trying to load everything else
try:
classfile_in = sys.argv[1]
except... |
import requests
import json
import sys
import re
from twisted.internet.error import ConnectionDone
from twisted.internet import protocol, threads, reactor
from twisted.protocols.basic import LineReceiver
from twisted.python import log
from autobahn.websocket import WebSocketServerFactory, WebSocketServerProtocol, Http... |
# Generated by Django 3.1.1 on 2020-10-08 12:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('publications', '0010_auto_20201007_2250'),
]
operations = [
migrations.AddField(
model_name='publication',
name='ema... |
# Copyright (C) 2010 Ion Torrent Systems, Inc. All Rights Reserved
import sys
def parseLog(logText):
metrics = {}
# Get Headings for beadfind
for line in logText:
if "=" in line:
name = line.strip().split("=")
key = name[0].strip()
value = name[1].strip()
... |
# -*- coding: utf-8 -*-
###############################################################################
#
# GetListByID
# Retrieves a list of NPR categories from a specified list type ID.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"... |
"""Unit test for Raf"""
import unittest
from Bio.SCOP import Raf
class RafTests(unittest.TestCase):
rafLine = "101m_ 0.01 38 010301 111011 0 153 0 mm 1 vv 2 ll 3 ss 4 ee 5 gg 6 ee 7 ww 8 qq 9 ll 10 vv 11 ll 12 hh 13 vv 14 ww 15 aa 16 kk 17 vv 18 ee 19 aa 20 dd 21 vv 22 aa... |
# Generated by Django 2.2.4 on 2019-12-30 23:38
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('phone_at_location', '0003_auto_20180910_1743'),
]
operations = [
migrations.AlterField(
model_n... |
"""
Base class for Filters, Factors and Classifiers
"""
from abc import ABCMeta, abstractproperty
from bisect import insort
from collections import Mapping
from weakref import WeakValueDictionary
from numpy import (
array,
dtype as dtype_class,
ndarray,
searchsorted,
)
from six import with_metaclass
f... |
#
# MIT License
#
# Copyright (c) 2020 Pablo Rodriguez Nava, @pablintino
#
# 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
# t... |
#!/usr/bin/env python3
#
# Copytright 2021 Graviti. Licensed under MIT License.
#
# pylint: disable=invalid-name
"""Dataloader of the SegTrack2 dataset."""
from .loader import SegTrack2
__all__ = ["SegTrack2"] |
# Copyright 2013 NEC Corporation. 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 ... |
import numbers
import uuid
import warnings
from packaging import version
import six
import numpy as np
import six
import tensorflow as tf
from packaging import version
from phi.backend.backend_helper import split_multi_mode_pad, PadSettings, general_grid_sample_nd, equalize_shapes, circular_pad, replicate_pad
from ph... |
"""
This file offers the methods to automatically retrieve the graph Flavobacterium hydatis.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021... |
class MyQueue:
def __init__(self):
""" Uses two stacks to implement a Queue. Storage holds elements
pushed right before the first pop.
"""
self.storage, self.tmp = [], []
def push(self, x: int) -> None:
""" Unconditionally add to storage. Equivalent to stack.push."""
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016-2018, Eric Jacob <erjac77@gmail.com>
#
# 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/LICENS... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
"""
TensorLayer provides rich layer implementations trailed for
various benchmarks and domain-specific problems. In addition, we also
support transparent access to native TensorFlow parameters.
For example, we provide not only layers for local response normalization, but also
... |
import flask
from pypi_org.infrastructure.view_modifiers import response
import pypi_org.services.cms_service as cms_service
blueprint = flask.Blueprint('cms', __name__, template_folder='templates')
@blueprint.route('/<path:full_url>')
@response(template_file='cms/page.html')
def cms_page(full_url: str):
print(... |
from robosuite.models.arenas import TableArena
class HoleArena(TableArena):
"""
Workspace that contains a tabletop with two fixed pegs.
Args:
table_full_size (3-tuple): (L,W,H) full dimensions of the table
table_friction (3-tuple): (sliding, torsional, rolling) friction parameters of the ... |
from collections import OrderedDict
from psycopg2.sql import Identifier, Literal, SQL
from rest_framework.request import Request
from rest_framework.response import Response
from rest_framework.views import APIView
from usaspending_api.common.cache_decorator import cache_response
from usaspending_api.common.helpers.s... |
# coding: utf-8
"""
Betfair: Exchange Streaming API
API to receive streamed updates. This is an ssl socket connection of CRLF delimited json messages (see RequestMessage & ResponseMessage)
OpenAPI spec version: 1.0.1423
Contact: bdp@betfair.com
Generated by: https://github.com/swagger-api/swagger... |
# PrettifyPage.py
from bs4 import BeautifulSoup
import requests
import BusinessPaths
import pathlib
class PrettifyPage:
def __init__(self):
self.bpath = BusinessPaths.BusinessPaths()
def prettify(self, soup, indent):
pretty_soup = str()
previous_indent = 0
for line in soup.pr... |
import json
name_site = {}
with open('rubygems_metadata.txt') as json_file:
data = json.load(json_file)
for p1 in data['ruby_package']:
dep = p1['dependencies']
if dep:
for val in dep:
print val
else:
print "list is empty..."
if p1['author'] in name_site:
con... |
from bert_embedding import BertEmbedding
import numpy as np
import pickle
import argparse
import json
import os
from os.path import join, isfile
import re
import h5py
def save_caption_vectors_flowers(data_dir):
import time
img_dir = join(data_dir, 'flowers/jpg')
image_files = [f for f in os.listdir(img_dir) if 'j... |
# ==================================
# Author : fang
# Time : 2020/4/8 pm 8:55
# Email : zhen.fang@qdreamer.com
# File : play_db.py
# Software : PyCharm
# ==================================
import datetime
DB = {}
class PlayDB:
def __init__(self, inherited=False):
if inherited:
s... |
import numpy as np
import pytest
import pandas as pd
from pandas import (
Categorical, DataFrame, DatetimeIndex, Index, Interval, IntervalIndex,
Series, TimedeltaIndex, Timestamp, cut, date_range, isna, qcut,
timedelta_range, to_datetime)
from pandas.api.types import CategoricalDtype as CDT
import pandas.c... |
import os
VERSION = '1.0.1'
SIEM_NAME = 'SentinelAddon'
XDR_HOSTS = {
'us': 'https://api.xdr.trendmicro.com',
'eu': 'https://api.eu.xdr.trendmicro.com',
'in': 'https://api.in.xdr.trendmicro.com',
'jp': 'https://api.xdr.trendmicro.co.jp',
'sg': 'https://api.sg.xdr.trendmicro.com',
'au': 'https:... |
import numpy as np
import pandas as pd
from gym.utils import seeding
import gym
from gym import spaces
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
# shares normalization factor
# 100 shares per trade
HMAX_NORMALIZE = 100
# initial amount of money we have in our account
INITIAL_ACCOUNT_BALA... |
""" Tests some user inputs to the model to make sure the validation is performed correctly """
# pylint: disable=redefined-outer-name
from copy import deepcopy
import pytest
from asldro.data.filepaths import GROUND_TRUTH_DATA
from asldro.validators.parameters import ValidationError
from asldro.validators.user_parameter... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
"""Module of the Cuda memory performance benchmarks."""
import os
import re
from superbench.common.utils import logger
from superbench.benchmarks import BenchmarkRegistry, Platform
from superbench.benchmarks.micro_benchmarks import MemBwBenchma... |
from django.shortcuts import render, redirect
from django.views.generic import DetailView, CreateView, TemplateView
from django.contrib.auth.mixins import LoginRequiredMixin
from .models import Project
from apps.bug.models import Bug, Comment
# Create your views here.
class ProjectDetail(DetailView):
model = Proj... |
from functools import partial, wraps
from logging import getLogger
from time import sleep
from cornice.resource import resource
from couchdb import ResourceConflict
from dateorro import calc_datetime
from jsonpointer import resolve_pointer
from pyramid.compat import decode_path_info
from pyramid.exceptions import URLD... |
# coding: utf-8
"""
Sematext Cloud API
API Explorer provides access and documentation for Sematext REST API. The REST API requires the API Key to be sent as part of `Authorization` header. E.g.: `Authorization : apiKey e5f18450-205a-48eb-8589-7d49edaea813`. # noqa: E501
OpenAPI spec version: v3
... |
# database.py creates a .db file for performing umls searches.
import atexit
import os
import sqlite3
import sys
from read_config import enabled_modules
features_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if features_dir not in sys.path:
sys.path.append(features_dir)
# find where umls tabl... |
"""Simon Says
Exercises
1. Speed up tile flash rate.
2. Add more tiles.
"""
from random import choice
from time import sleep
from turtle import *
from rohans2dtlkit import floor, square, vector
pattern = []
guesses = []
tiles = {
vector(0, 0): ('red', 'dark red'),
vector(0, -200): ('blue', 'dark blue'),
... |
import cv2
import mediapipe
import numpy
import pydirectinput
class FingerDetector:
wScr, hScr = pydirectinput.size() #Get the current screen resolution
pX, pY = 0, 0
cX, cY = 0, 0
def __init__(self):
"""
Initialize all objects
"""
#Load the mediapipe libraries/solut... |
"""
Django settings for myproject project.
Generated by 'django-admin startproject' using Django 3.0.4.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
... |
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: jernej@reciprocitylabs.com
# Maintained By: jernej@reciprocitylabs.com
"""Metaclasses module"""
from lib import decorator, exception, constants
c... |
"""Reusable components used in the project.""" |
"""
Copyright 2020 The OneFlow 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 law or agr... |
#!/usr/bin/python
#
# Copyright (c) 2011, The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import optparse
# This script generates a JSON .nmf file, which provides the mapping to indicate
# which .nexe fil... |
# import PIL
import matplotlib.pyplot as plt
import numpy as np
import math
import cv2
import torch
from torch_geometric.data import Data
def load_ply(path):
"""
Loads a 3D mesh model from a PLY file.
:param path: Path to a PLY file.
:return: The loaded model given by a dictionary with items:
'pt... |
from typing import List, Tuple
from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_format.program import Program
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.coin_spend import CoinSpend
from chia.types.condition_opcodes import ConditionOpcode
from chia.util.has... |
import unittest
import numpy as np
from sklearn import datasets
from sklearn.compose import ColumnTransformer
from sklearn.datasets import load_iris, load_diabetes
from sklearn.svm import LinearSVC, LinearSVR
from sklearn.datasets import make_regression
from sklearn.decomposition import PCA
from sklearn.linear_model i... |
#! /usr/bin/env python3
row = int(input("Enter the number of rows: "))
n = row
while n >= 0:
x = "*" * n
y = " " * (row - n)
print(y + x)
n -= 1 |
# -*- coding: utf-8 -*-
import unicodedata
import binascii
from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
@deconstructible
class NoControlCharactersValidator(... |
"""LCM type definitions
This file automatically generated by lcm.
DO NOT MODIFY BY HAND!!!!
"""
try:
import cStringIO.StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
class rgbd_t(object):
__slots__ = ["utime", "width", "height", "rgblen", "depthlen", "rgb", "depth"]
__typ... |
class LibraryMetadata(object):
def __init__(self, section=None):
self.section = section
class LibrarySection(object):
def __init__(self, title=None):
self.title = title
class Session(object):
def __init__(self, **kwargs):
self.rating_key = None
self.state = None
... |
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# Copyright 2016 National Research Foundation (South African Radio Astronomy Observatory)
# BSD license - see LICENSE for details
from __future__ import absolute_import, division, print_function
import random
import signal
import time
import tornado
from katcp import AsyncReply, DeviceServer, ProtocolFlags, Sensor
... |
"""
Codificar un algoritmo en Python que permita registrar la clave (Por el momento,
no esn ecesario validar si la clave es unica), el nombre y correo electrónico
de múltiples personas, hasta que el usuario indique que ha concluído con la captura
correspondiente (proponga usted el mecanismo para esto).
Una vez concluíd... |
#!../../../env/bin/python
"""
Script to scan through archive of mbox files and produce a spam report.
"""
# Standalone broilerplate -------------------------------------------------------------
from django_setup import do_setup
do_setup()
# -------------------------------------------------------------------------------... |
from datadog import initialize, api
# Intialize request parameters including API/APP key
options = {
'api_key': '<YOUR_API_KEY>',
'app_key': '<YOUR_APP_KEY>'
}
initialize(**options)
# Set Embed ID (token)
embed_id = "5f585b01c81b12ecdf5f40df0382738d0919170639985d3df5e2fc4232865b0c"
# Call Embed API function... |
# -*- coding: utf-8 -*-
#
#
# Copyright 2013 Netflix, 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 ... |
# -*- coding: utf-8 -*-
"""Cisco DNA Center Get Site Count data model.
Copyright (c) 2019-2021 Cisco Systems.
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 withou... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Created by magus0219[magus0219@gmail.com] on 2020/3/30
import datetime
from artascope.src.lib.user_status_manager import usm
class TestUserStatusManager:
def test_add_user(self):
usm.add_user(username="username")
us = usm.get_user(username="usern... |
# coding: utf-8
"""
TGS API
A production scale tool for BYOND server management # noqa: E501
OpenAPI spec version: 9.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.models.administration_rights impor... |
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
def show_image(image):
plt.imshow(-image, cmap='Greys')
plt.show()
def show_two(image1, image2):
plt.subplot(121)
plt.imshow(-image1, cmap='Greys')
plt.subplot(122)
plt.imshow(-image2, cmap='Greys')
plt.show()
def plot_hist(img)... |
#!/usr/bin/env python3
#
# Copyright (c) Greenplum Inc 2008. All Rights Reserved.
#
"""
base.py
common base for the commands execution framework. Units of work are defined as Operations
as found in other modules like unix.py. These units of work are then packaged up and executed
within a GpCommand. A GpCommand is j... |
from ulauncher.api.client.Extension import Extension
from ulauncher.api.shared.action.ExtensionCustomAction import ExtensionCustomAction
from ulauncher.api.client.EventListener import EventListener
from ulauncher.api.shared.event import KeywordQueryEvent, ItemEnterEvent
from ulauncher.api.shared.item.ExtensionResultIte... |
from setuptools import find_packages, setup
VERSION = 0.4
with open("README.md") as f:
README = f.read()
setup(
name = "pyscreenrec",
version = VERSION,
description = "A small and cross-platform python library for recording screen.",
long_description_content_type = "text/markdown",
long_descri... |
# Android Device Testing Framework ("dtf")
# Copyright 2013-2016 Jake Valletta (@jake_valletta)
#
# 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
... |
# pylint: disable=unused-argument
# pylint: disable=redefined-outer-name
import pytest
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance('node',
main_configs=["configs/config.d/storage_configuration.xml"],
... |
# Generated by Django 3.1.1 on 2020-10-05 20:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Home', '0005_auto_20201005_2107'),
]
operations = [
migrations.AlterField(
model_name='contact',
name='meeting',
... |
import pytest
from math import gcd
import numpy as np
import pandas as pd
from stochatreat import stochatreat
from stochatreat import get_lcm_prob_denominators
################################################################################
# fixtures
###############################################################... |
import pygame
from pygame.sprite import Sprite
class Ship(Sprite):
def __init__(self, ai_settings, screen):
super().__init__()
'''初始化飞船并设置其初始位置'''
self.screen = screen
self.ai_settings = ai_settings
# 加载飞船图像并获取其外接矩形
self.image = pygame.image.load('../images/ship.png... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.