content stringlengths 0 894k | type stringclasses 2
values |
|---|---|
from google.cloud import bigquery
from google.cloud.bigquery import LoadJobConfig
from google.cloud.bigquery import SchemaField
from queryless.parser import BasicParser
class BigQuery(object):
def __init__(self, project=None):
self._client = bigquery.Client(project=project)
@property
def client... | python |
# See in the Dark (SID) dataset
import torch
import os
import glob
import rawpy
import numpy as np
import random
from os.path import join
import data.torchdata as torchdata
import util.process as process
from util.util import loadmat
import h5py
import exifread
import pickle
import PIL.Image as Image
from scipy.io impo... | python |
from task import CustomTask
from Agent import Agent
if __name__ == '__main__':
goal_task=CustomTask("自定义任务")
aida=Agent()
goal_task.set_agent(aida)
goal_task.init_agent()
# 采集5个队伍,每次采集等待5秒
goal_task.run_collection(collection_team=5,wait_sec=5)
| python |
# * Copyright (c) 2020-2021. Authors: see NOTICE file.
# *
# * 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 ... | python |
import torch
from utils.helpers import *
import warnings
from PIL import Image
from torchvision import transforms
#from torchsummary import summary
def image_transform(imagepath):
test_transforms = transforms.Compose([transforms.Resize(255),
transforms.CenterCrop(224),
... | python |
"""
Compute or load tail cost of
"""
import scipy.io as sio
import numpy as np
class TailCost(object):
def __init__(self, dyn_system, gamma):
C = dyn_system.C
self.P0 = C.T.dot(C)
self.q0 = np.zeros(C.shape[1])
self.r0 = 0.
self.gamma = gamma
def load(self, name):
... | python |
from sqlalchemy import Column, Integer, String
from models.base import Base
class Tiered_Song(Base):
__tablename__ = 'tiered_songs'
id = Column(Integer, primary_key=True)
name = Column(String(256), nullable=False)
artist = Column(String(128), nullable=False)
song_type = Column(String(256), nulla... | python |
import getopt
args = [ '-a', '-b', 'foo', '--exclude', 'bar', 'x1','x2']
opts, pargs = getopt.getopt()
print `opts`
print `pargs`
| python |
from decimal import Decimal
from django.db.models import Sum
from trojsten.results.generator import (
BonusColumnGeneratorMixin,
PrimarySchoolGeneratorMixin,
ResultsGenerator,
)
from .default import CompetitionRules
from .default import FinishedRoundsResultsRulesMixin as FinishedRounds
class UFOResults... | python |
from .merchant_id import unique_order_id_generator
from django.db.models.signals import pre_save
from universal_billing_system.models import Merchant
def pre_save_create_bill_id(sender, instance, *args, **kwargs):
if not instance.bill_id:
instance.bill_id= unique_order_id_generator(instance)
pre_save... | python |
# -*- coding: utf-8 -*-
""" Copy + Paste in OS X
"""
import subprocess
from .base import *
def copy(string):
"""Copy given string into system clipboard."""
try:
subprocess.Popen(['pbcopy'], stdin=subprocess.PIPE).communicate(
string.encode("utf-8"))
except OSError as why:
... | python |
#import discord
from discord.ext import commands
import configparser
config = configparser.ConfigParser()
config.read("config.ini")
server_owner = config['role_name']['server_owner']
admin = config['role_name']['admin']
whis = config['id']['whis_id']
def possible(ctx, user, victim):
msg = f"{ctx.message.author.m... | python |
# SPDX-License-Identifier: MIT
# (c) 2019 The TJHSST Director 4.0 Development Team & Contributors
import os
import re
import shutil
from typing import Any, Dict
import jinja2
from .. import settings
from ..exceptions import OrchestratorActionError
from ..files import get_site_directory_path
TEMPLATE_DIRECTORY = os.... | python |
import re
import lorawanwrapper.LorawanWrapper as LorawanWrapper
def formatData(data):
result = ""
if data is None:
return result
else:
search = re.search('(.*)"data":"(.*?)"(.*)', data)
if search is not None: #means that a PHYPayload was received
result = "Pa... | python |
import sqlalchemy
import sqlalchemy_utils
from rentomatic.repository.postgres_objects import Base, Room
# Just for development purposes. Should never store password in plain text and into GitHub
setup = {
"dbname": "rentomaticdb",
"user": "postgres",
"password": "rentomaticdb",
"host": "localhost",
}
... | python |
import http.server
import logging
from urllib.parse import urlparse
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
class DefaultHTTPRequestHandler(http.server.BaseHTTPRequestHandler):
"""Default HTTP Request Handler Interface class."""
def do_OPTIONS(self):
"""Default OPTIONS fun... | python |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
"""
import meep as mp
import numpy as np
#import scipy as sp
#from scipy import optimize as op
from scipy import interpolate as itp
from matplotlib import pyplot as plt
from multiprocessing import Pool
# from mpl_toolkits.mplot3d import Axes3D
import meep_objects as ... | python |
from functools import partial
from ..experiment_base import ExperimentBase
from ...models.linear import Linear_S, Linear_M, Linear_L
from ..training_args import LMMixupArgs
from ...data_loaders.json_loader import JsonLoader
from ...utils.label_convertors import convert2vec
class ExperimentLinearGinFPNSNoPartial(Expe... | python |
import copy
import rdtest
import renderdoc as rd
class VK_Vertex_Attr_Zoo(rdtest.TestCase):
demos_test_name = 'VK_Vertex_Attr_Zoo'
def check_capture(self):
draw = self.find_draw("Draw")
self.check(draw is not None)
self.controller.SetFrameEvent(draw.eventId, False)
# Make a... | python |
#!/usr/bin/python
#######################################################
# Copyright (c) 2019 Intel Corporation. All rights reserved.
#
# GNU General Public License v3.0+
# (see LICENSE.GPL or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# Authors:
# - Marco Chiappero - <marco.chiappero@intel.com>
##################... | python |
r = float(input())
print("A=%.4f" % (3.14159 * (r ** 2))) | python |
# Copyright 2020 Unibg Seclab (https://seclab.unibg.it)
#
# 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... | python |
import play
import tactics.line_up
import behavior_sequence
import tools.sleep
import robocup
import constants
import time
import enum
class Brain(play.Play):
# initialize constants, etc.
def __init__(self):
# not sure if we need this
super().__init__(continuous=True)
class State(enum.Enu... | python |
from .na_syndra_top import *
from .na_syndra_jng import *
from .na_syndra_mid import *
from .na_syndra_bot import *
from .na_syndra_sup import *
| python |
import os
__version__ = 'v0.0.8' # update also in setup.py
root_dir = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
info = {
"name": "NiLabels",
"version": __version__,
"description": "",
"repository": {
"type": "git",
"url":... | python |
from random import randint
from time import sleep
itens = ('pedra', 'papel', 'tesoura')
computador = randint(0, 2)
print('''Suas opções:
[0] Pedra
[1] Papel
[2] Tesoura''')
jogador = int(input('Qual é a sua jogada? '))
print('JO')
sleep(1)
print('KEN')
sleep(1)
print('PO =!!!')
print('-=' * 12)
print('O computador jogo... | python |
"""683. Word Break III
"""
class Solution:
"""
@param s: A string
@param dict: A set of word
@return: the number of possible sentences.
"""
def wordBreak3(self, s, dict):
# Write your code here
## Practice:
lower_dict = set()
for word in dict:
lower_di... | python |
#!/bin/python3
import math
import os
import random
import re
import sys
from collections import deque, defaultdict
# Complete the findShortest function below.
#
# For the weighted graph, <name>:
#
# 1. The number of nodes is <name>_nodes.
# 2. The number of edges is <name>_edges.
# 3. An edge exists between <name>_fr... | python |
"""
Django settings for monitoramento project.
Generated by 'django-admin startproject' using Django 3.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from p... | python |
#!/usr/bin/env python
from subprocess import call
import sys
import subprocess
import dbus
import string
import os
import fcntl
import time
import pexpect
import glib
import gobject
import dbus.service
import dbus.mainloop.glib
DBUS_NAME = 'org.openbmc.UserManager'
INTF_NAME = 'org.openbmc.Enrol'
OBJ_NAME_GROUPS = '/... | python |
import bpy
from bpy import data as D
from bpy import context as C
from mathutils import *
from math import *
# bpy.ops.mesh.primitive_grid_add(
# x_subdivisions=10, y_subdivisions=10,
# radius=1, view_align=False, enter_editmode=False,
# location=(0, 0, 0), rotation=(0, 0, 0))
def new_grid(name='Grid',
... | python |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-29 19:55
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0009_auto_20170329_1938'),
]
operations = ... | python |
import logging
import re
from django.conf import settings
from django import forms
from django.db import models
from django.contrib.auth.models import User, AnonymousUser
from django.forms import FileField, CharField, Textarea, ValidationError
from django.core.validators import validate_email
try:
from tower imp... | python |
# Copyright 2021 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0
import json
import os
from unittest.mock import patch
from click.testing import CliRunner
from py._path.local import LocalPath
from pytest_httpserver.pytest_plugin import PluginHTTPServer
from taurus_datajob_api import DataJobDeployment
from taurus_da... | python |
import cv2 as cv
import numpy as np
pathj = 'D:\\MyProjects\\WearGlasses\\I.jpg'
pathg = 'D:\\MyProjects\\WearGlasses\\glasses.png'
pathf = 'D:\\MyProjects\\WearGlasses\\haarcascade_frontalface_default.xml'
pathe = 'D:\\MyProjects\\WearGlasses\\haarcascade_eye.xml'
def wear():
glasses = cv.imread(pathg)
... | python |
print("Phuong Hoang is here")
# move the code in to githep
# git add .
# git commit -m "remove ld"
# git push
#git pull origin master | python |
"""
Zemberek: Histogram Example
Original Java Example: https://bit.ly/2PmUyIV
"""
from os.path import join
from jpype import (
JClass, JInt, JString, getDefaultJVMPath, java, shutdownJVM, startJVM)
if __name__ == '__main__':
ZEMBEREK_PATH: str = join('..', '..', 'bin', 'zemberek-full.jar')
startJVM(
... | python |
"""newskylabs/tools/bookblock/scripts/bookblock.py:
Main of bookblock tool.
Description
bookblock - A tool to cut out pages from a scanned book.
bookblock is a tool to cut out pages from a scanned book.
When scanning a book each scan contains two book pages. The book
cover on the other side in often consists out ... | python |
#!/usr/bin/env vpython
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#pylint: disable=protected-access
import json
import os
import tempfile
import unittest
import mock
from pyfakefs import fake_files... | python |
from conans import ConanFile, CMake, tools
import os
import shutil
class PhysfsConan(ConanFile):
name = "physfs"
version = "3.0.1"
description = "Provides abstract access to various archives"
topics = ("conan", "physfs", "physicsfs", "archive")
url = "https://github.com/bincrafters/conan-physfs"
... | python |
import os.path
import random
def gerar_id():
return "AZ" + str(random.randrange(1, 1000))
def designar_arq():
return gerar_id() + ".txt"
def formulario(fich):
fich.write("Id: " + gerar_id() + "\n")
fich.write("Nome: " + input("Nome: ").capitalize() + "\n")
fich.write("Perfil: Docente\n")
f... | python |
#!/usr/bin/env python3
"""
#############################################################################
common resources for multiple scripts
#############################################################################
Sylvain @ GIS / Biopolis / Singapore
Sylvain RIONDET <sylvainriondet@gmail.com>
PLoT-ME: Pre-class... | python |
from typing import Generic, Iterator, Optional, Type, TypeVar
from fastapi.encoders import jsonable_encoder
from mongoengine import DoesNotExist
from pydantic import BaseModel
from app.models.base import BaseModel as BaseDBModel
ModelType = TypeVar("ModelType", bound=BaseDBModel)
CreateSchemaType = TypeVar("CreateSc... | python |
import datetime
import os
import uuid
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
import reversion
from markitup.fields import MarkupField
from model_util... | python |
#!/usr/bin/env python
# Bird Feeder - Feed Birds & Capture Images!
# Copyright (C) 2020 redlogo
#
# This program is under MIT license
import socket
from imutils.video import VideoStream
class RPiCamera:
"""
This is a class to get video stream from RPi.
"""
__slots__ = 'width', 'height', 'name', 'ca... | python |
class Vehiculo(object):
def __init__(self, name, date_of_release, passengers, number_of_wheels, terrain, type_of_vehicle):
self.name = name
self.date_of_release = date_of_release
self.passengers = passengers
self.number_of_wheels = number_of_wheels
self.terrain = terrain
... | python |
"""exceptions.py: Custom exceptions used by Miscreant"""
class CryptoError(Exception):
"""Parent of all cryptography-related errors"""
class IntegrityError(CryptoError):
"""Ciphertext failed to verify as authentic"""
class OverflowError(Exception):
"""Integer value overflowed"""
class FinishedError(... | python |
import turtle
turtle.setup(500,600)
turtle.penup()
turtle.hideturtle()
# CREATE NAMED CONSTANTS FOR THE STARS
LEFT_SHOULDER_X = -70
LEFT_SHOULDER_Y = 200
RIGHT_SHOULDER_X = 80
RIGHT_SHOULDER_Y = 180
LEFT_BELTSTAR_X = -40
LEFT_BELTSTAR_Y = -20
MIDDLE_BELTSTAR_X = 0
MIDDLE_BELTSTAR_Y = 0
RIGH... | python |
import numpy as np
import matplotlib.pyplot as plt
import plotly.plotly as py
from sys import argv
#%matplotlib inline
from tf_shuffle import shuffle
def check_shuffle(deck):
count = 0
for i in range(len(deck)-2):
diff = deck[i+1] - deck[i]
if (abs(deck[i+2] - deck[i+1]) == diff) a... | python |
import argparse
import simplePicStegoEmbed
import simplePicStegoError
import simplePicStegoReveal
class UnknownFunctionError(simplePicStegoError.Error):
"""
Raise error when unknown commands are given
"""
def __init__(self, message):
self.message = message;
version = "1.0"
def init_program... | python |
import ast
import csv
from typing import Iterable
from fastNLP import DataSet, Instance, Vocabulary
from fastNLP.core.vocabulary import VocabularyOption
from fastNLP.io import JsonLoader
from fastNLP.io.base_loader import DataBundle,DataSetLoader
from fastNLP.io.embed_loader import EmbeddingOption
from fastNLP.io.file_... | python |
import warnings
from ploceidae import core
warnings.filterwarnings("ignore", category=DeprecationWarning)
__all__ = ["core"]
| python |
#-*- coding: UTF-8 -*-
# 读取数据 bin 文件
import os
import struct
def read_data(file):
file_path = file_dir+"/"+file
final_text = open('final.txt', 'a')
data_bin = open(file_path, 'rb')
data_size = os.path.getsize(file_path)
for i in range(data_size):
for index in range(4):
data_i ... | python |
class Node:
def __init__(self, data, next_node=None, previous=None):
self.data = data
self.next_node = next_node
self.previous = previous
class DoublyLinkedList:
def __init__(self):
self.head = None
def insert_at_beginning(self, data):
if self.head is None:
... | python |
# bilibili
# @Bio-Hazard, @xue_tao_lu, @Medit_4
from math import log
from math import e
# 各种类型的竖直加速度以及助力,单位为 block/tick^2
DataTable = {
1:{'g':-0.08, 'f':0.02},
2:{'g':-0.04, 'f':0.02},
3:{'g':-0.04, 'f':0.05},
4:{'g':-0.03, 'f':0.01},
5:{'g':-0.05, 'f':0.01},
}
# 各种实体对应的类型id
EntityType={
'player':1,
'... | python |
#!/usr/bin/env python
#
# Copyright 2013-2014 Mike Stirling
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | python |
"""
Ethereum Spurious Dragon Hardfork
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The fifth Ethereum hardfork.
"""
MAINNET_FORK_BLOCK = 2675000
CHAIN_ID = 1
| python |
import libkol
from ..Error import InvalidActionError, UnknownError
from ..Trophy import Trophy
from .request import Request
class trophy_buy(Request[bool]):
def __init__(self, session: "libkol.Session", trophy: Trophy) -> None:
super().__init__(session)
data = {"action": "buytrophy", "whichtrophy... | python |
"""
Methods for validating input params given via url or ajax
"""
import logging
from typing import Optional, Union
from dbas.lib import Relations
from .database import DBDiscussionSession
from .database.discussion_model import Argument, Statement, Premise, StatementToIssue
LOG = logging.getLogger(__name__)
def is_... | python |
# 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
... | python |
# -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Topic, Course, Document
@admin.register(Topic)
class TopicAdmin(admin.ModelAdmin):
list_display = ('id', 'name', 'description')
search_fields = ('name',)
@admin.register(Course)
class CourseAdmin(admin.ModelAdmin):
list_displa... | python |
import requests
from indra.statements import *
base_url = 'http://localhost:8080'
def test_filter_by_type():
st1 = Phosphorylation(Agent('a'), Agent('b'))
st2 = Complex([Agent('a'), Agent('b')])
stmts_json = stmts_to_json([st1, st2])
url = base_url + '/preassembly/filter_by_type'
data = {'statemen... | python |
def main(j, args, params, tags, tasklet):
page = args.page
infomgr = j.apps.actorsloader.getActor("system", "infomgr")
args = args.tags.getValues(id=None, start=0, stop=0)
id = args["id"]
data = infomgr.extensions.infomgr.getInfo5Min(id, args["start"], args["stop"], epoch2human=True)
if dat... | python |
"""Package devops entry point."""
from pkg_resources import get_distribution, DistributionNotFound
try:
# The name must be the same as the value of the "name" key in the setup.py file
__version__ = get_distribution(__package__).version
except DistributionNotFound:
pass
| python |
from numa import bitmask_t, LIBNUMA
from typing import List
def get_bitset_list(bitmask: bitmask_t) -> List[int]:
return list(filter(lambda node: LIBNUMA.numa_bitmask_isbitset(bitmask, node) != 0, range(bitmask.contents.size)))
| python |
from pylab import *
import plotly.graph_objs as go
from scipy.interpolate import interp1d
from plotly.offline import iplot, _plot_html
from IPython.display import HTML, display
from plotly.tools import FigureFactory as FF
from .riemannian_manifold import RManifold
class SurfaceOfRevolution(RManifold) :
"Encodes a... | python |
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtWebEngineWidgets import *
import sys
import click
msg = QMessageBox()
urls = {
'github': "https://github.com/" ,
'youtube': "https://youtube.com",
'discord': "https://discord.com/",
'pypi': "http... | python |
N = int(input())
K = int(input())
dp1 = {0: 1}
for _ in range(K):
d = {}
for k in dp1:
for i in range(4, 6 + 1):
d.setdefault(k + i, 0)
d[k + i] += dp1[k] * 2
dp1 = d
for _ in range(N - K):
d = {}
for k in dp1:
for i in range(1, 6 + 1):
d.setdefau... | python |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from cs3.auth.provider.v1beta1 import provider_api_pb2 as cs3_dot_auth_dot_provider_dot_v1beta1_dot_provider__api__pb2
class ProviderAPIStub(object):
"""Au... | python |
#!/usr/bin/python
'''
GUI interface for extracting any level of image from an SVS file as a new TIFF.
Uses OpenSlide library to extract and decode the image stack.
Tkinter for GUI operations.
Code Quality:
http://xkcd.com/1513/
,
'''
import os
from openslide import *
from Tkinter import *
# import Tkinter.filedialog... | python |
import pytest
import sightreading.randnotes as s
def test_diatonic():
assert s.is_sharp(("A#2", 5))
assert s.is_flat(("Bb3", 3))
def test_frets():
assert s.fretnote(6, 0) == ["E2"]
assert set(s.fretnote(1, 2)) == set(["F#4", "Gb4"])
def test_padding():
notes = ["C2"] * 7
s.pad_line(notes, st... | python |
# ----------------------------------------------------------------------
# Test noc.core.hash functions
# ----------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
#... | python |
import json
import math
import sys
import traceback
import numpy as np
from sqlalchemy.orm import sessionmaker
import EOSS.historian.models as models
import EOSS.data.problem_specific as problem_specific
from EOSS.analyst.helpers import get_feature_unsatisfied, get_feature_satisfied, \
feature_expression_to_strin... | python |
#!/usr/bin/python
# coding: utf8
import sys
import mysql.connector
import facesearch.twittersearch as tw
import dbconf
if __name__ == '__main__':
mode = sys.argv[1]
conn = mysql.connector.connect(
host=dbconf.HOST,
port=dbconf.PORT,
db=dbconf.DB_NAME,
user=dbconf.DB_USER,
... | python |
import types
def _clean_acc(acc):
out = {}
for attr in ['genomic', 'protein', 'rna']:
if attr in acc:
v = acc[attr]
if type(v) is types.ListType:
out[attr] = [x.split('.')[0] for x in v]
else:
out[attr] = v.split('.')[0]
return out
... | python |
# Copyright (C) 2020 TU Dresden
# Licensed under the ISC license (see LICENSE.txt)
#
# Authors: Andres Goens
| python |
#!/usr/bin/env python3
#
# Copyright 2021 Graviti. Licensed under MIT License.
#
"""User, Commit, Tag, Branch and Draft classes.
:class:`User` defines the basic concept of a user with an action.
:class:`Commit` defines the structure of a commit.
:class:`Tag` defines the structure of a commit tag.
:class:`Branch` d... | python |
# coding: UTF-8
val_1 = 24
val_2 = 67
val_3 = 88
val_4 = 89
def p():
try:
print("\tval_1: {}".format(val_1))
except Exception as e:
print(e)
try:
print("\tval_2: {}".format(val_2))
except Exception as e:
print(e)
try:
print("\tval_3: {}".format(val_3)... | python |
# -*- coding: utf-8-*-
import platform
import logging
import argparse
import os
import sys
from abstract_tts import AbstractTTSEngine
path = os.path.dirname(os.path.abspath(__file__))
for py in [f[:-3] for f in os.listdir(path) if f.endswith('.py') and f != '__init__.py']:
mod = __import__(__name__ + '.' + py, fr... | python |
# coding=utf-8
import tensorflow as tf
import wml_tfutils as wmlt
import wnn
from basic_tftools import channel
import functools
import tfop
import object_detection2.bboxes as odbox
from object_detection2.standard_names import *
import wmodule
from .onestage_tools import *
from object_detection2.datadef import *
from ob... | python |
#
# PySNMP MIB module BRIDGE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BRIDGE-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 16:50:13 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:... | python |
from sqlalchemy import Column, Integer, String, DateTime, Float
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.sql.expression import func
from pow_comments.dblib import engine,session
from pow_comments.powlib import pluralize
import datetime
from sqlalchemy import orm
import sqlalchemy.inspectio... | python |
# Imports from 3rd party libraries
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
# Imports from this application
from app import app
# 1 column layout
# https://dash-bootstrap-components.opensource... | python |
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 7 22:06:42 2015
@author: hoseung
"""
import numpy as np
a = np.zeros(10)
b = [0,1,4,7]
c= a[b]
print(c)
c[2] = 1.2
print(c)
print(a)
#%%
x = np.array([(1.5, 4), (1.0, 2), (3.0, 4)], dtype=[('x', float), ('y', int)])
ind = np.where(x['x'] < 2)
b = x[ind]
#%%
fr... | python |
class Solution:
def XXX(self, matrix: List[List[int]]) -> None:
"""
Do not return anything, modify matrix in-place instead.
"""
n = len(matrix)
for i in range(n//2):
for j in range((n+1)//2):
matrix[i][j], matrix[j][n-i-1], matrix[n-i-1][n-j-1], m... | python |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('marketplace_openstack', '0007_change_billing_type_for_volumes_of_tenants'),
('invoices', '0043_drop_package_column'),
('marketplace', '0041_drop_package'),
]
operations = [
# Raw SQL... | python |
# 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 ... | python |
from frappe import _
#def get_data():
# return {
# 'heatmap': True,
# 'heatmap_message': _('This is based on the attendance of this Student'),
# 'fieldname': 'cargo',
# 'transactions': [
# {
# 'label': _('Gate1'),
# 'items': ['Gate1']
# },
# {
# 'label': _('Student Activity'),
# 'items': ['Gate2'... | python |
# stdlib
from typing import Any
from typing import Optional
# third party
from google.protobuf.reflection import GeneratedProtocolMessageType
# syft absolute
from syft import deserialize
from syft import serialize
# relative
from .. import python as py
from ...core.common.serde.serializable import bind_protobuf
from... | python |
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages, Extension
setup(name='Mumoro',
version='0.0.2a',
author= 'Tristram Graebener',
author_email = 'tristramg@gmail.com',
url = 'http://github.com/Tristramg/mumoro/',
description = 'Multim... | python |
def Wakeup():
return require('wakeup')
| python |
# Copyright (C) 2010 Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | python |
import sys, os, re, traceback
from PIL import Image
from skimage.io import imread, imsave
from resizeimage import resizeimage
cwd = os.getcwd()
rootDir = cwd + '/imagenes'
for file_name in os.listdir(rootDir):
folderDir = rootDir + '/' + file_name
if (os.path.isdir(folderDir)):
fileImages = os.listdir... | python |
import os
import webbrowser
from tkinter import *
from tkinter import filedialog
import win32com.client
import winshell
from PIL import Image
from PyInstaller.utils.hooks import collect_data_files
from tkinterdnd2 import *
datas = collect_data_files('tkinterdnd2')
iconPath = r"%systemroot%\system32\imag... | python |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 2 11:16:51 2019
@author: Kazuki
"""
import numpy as np
import pandas as pd
from tqdm import tqdm
from sklearn.preprocessing import KBinsDiscretizer
import utils
PREF = 'f006'
est = KBinsDiscretizer(n_bins=100, encode='ordinal', strategy='uniform... | python |
# Copyright (c) Chris Choy (chrischoy@ai.stanford.edu). All Rights Reserved.
#
# Please cite "4D Spatio-Temporal ConvNets: Minkowski Convolutional Neural
# Networks", CVPR'19 (https://arxiv.org/abs/1904.08755) if you use any part of
# the code.
from enum import Enum
import torch
from MinkowskiEngine import MinkowskiNe... | python |
from fractions import Fraction
import io
import importlib
import time
import json
from flask import (Flask, Response, render_template, send_file, request ,jsonify)
from flask_bootstrap import Bootstrap
from flask_httpauth import HTTPBasicAuth
from flask_socketio import SocketIO
from werkzeug.security import check_... | python |
# vim:ts=4:sts=4:sw=4:expandtab
from StringIO import StringIO
from satori.ars.thrift import ThriftWriter
from satori.core.export import generate_interface
import satori.core.models
ars_interface = generate_interface()
writer = ThriftWriter()
idl_io = StringIO()
writer.write_to(ars_interface, idl_io)
thrift_idl = i... | python |
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | python |
#!/usr/bin/python3
# -*- coding:utf-8 -*-
#fuction:client
from hashlib import sha1
import_flag = True
try:
from ckuser.sqlhelper.MySQLHelper import MySQLHelp
from ckuser.sqlhelper.RedisHelper import RedisHelp
from ckuser.config import *
except Exception:
import_flag = False
if import_flag == True:
pass
else:
fro... | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.