content stringlengths 5 1.05M |
|---|
import argparse
import httplib2
import os
from apiclient import discovery
from oauth2client import client, tools
from oauth2client.file import Storage
flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args()
flags.noauth_local_webserver = True
class GoogleSheetsClient(object):
"""Class to handle ... |
#!/usr/bin/env python
#
# Copyright 2019 GoPro Inc.
#
# 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... |
import json, requests
class WVPoster:
def __init__(self, host="localhost", port=None):
if port == None:
self.url = "http://%s/sioput/" % host
else:
self.url = "http://%s:%d/sioput/" % (host, port)
def postToSIO(self, name, obj):
url = self.url+name
print... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import uuid
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.sessions.models import Session
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.tr... |
@api_view(['GET'])
@permission_classes([IsAuthenticated])
def ExcursionDetail(request):
excursion = Excursion.objects.all()
data = ExcursionSerializer(excursion, many=True).data
return Response(data, status=status.HTTP_200_OK)
@api_view(['GET'])
@permission_classes([IsAuthenticated])
def ExcursionList(req... |
"""This module provides code that allows one to pickle the state of a
Python object to a dictionary.
The motivation for this is simple. The standard Python
pickler/unpickler is best used to pickle simple objects and does not
work too well for complex code. Specifically, there are two major
problems (1) the pickle fi... |
from pathlib import Path
NER_PATH = Path(__file__).parent
MODEL_PATH = NER_PATH / "model.pth"
MODEL_CONFIG_PATH = NER_PATH / "model_conf.json"
DATA_PATH = NER_PATH / "data"
BERT_INPUT_SEQUENCE_LENGTH = 128
LABELS = {
"B_technology": 0,
"I_technology": 1,
"B_malware": 2,
"I_malware": 3,
"B_company"... |
#!/usr/bin/env python3
"""
genSBoxesFlexAEADv11.py - module to generate FlexAE SBoxes.
Usage:
genSBoxesFlexAEADv11.py
Options:
no options
"""
__author__ = 'Eduardo Marsola do Nascimento'
__copyright__ = 'Copyright 2019-10-20'
__credits__ = ''
__license__ = 'MIT'
__version__ = '0.01'
__maintainer_... |
# Copyright 2020-2021 Efabless 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 by applicable law or agreed ... |
import tensorflow as tf
def apply_jitter(point_cloud_batch, label_cloud_batch):
# Jitter point and label clouds.
noise = tf.random.uniform(
tf.shape(label_cloud_batch), -0.005, 0.005, dtype=tf.float64
)
point_cloud_batch += noise[:, :, :3]
label_cloud_batch += tf.cast(noise, tf.float32)
... |
# NLP written by GAMS Convert at 04/21/18 13:54:24
#
# Equation counts
# Total E G L N X C B
# 14 1 2 11 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... |
'''
Created on Aug 14, 2018
@author: Burkhard A. Meier
'''
import tkinter as tk
from PIL import Image, ImageTk
class CanvasAndCar():
def __init__(self, win):
self.canvas = tk.Canvas(win, width=700, height=500) # create a tkinter canvas
self.canvas.pack() ... |
# 文件夹配置
model_save_dir = 'saved_models'
cache_dir = '/ext/A/cache'
# 数据配置
'''一个拼音最短大概0.1s,
若hop_s为0.016s,那么6.25个hop覆盖0.1s'''
stft_fea = {
'name':'stft',
'kwargs':{
'fft_s': 0.128, # fft_s:一个短时傅里叶变换的窗长,单位为秒
'hop_s': 0.016, # hop_s:窗之间间隔长,单位为秒
'target_sr': 8000, # 统一音频采样率目标,音频将自动重采样为该采... |
#!/usr/bin/env python3
# Errors severity
MAJOR = 0
MINOR = 1
C_TYPES = [ \
"int",
"long",
"short",
"char",
"void",
"float",
"double",
"struct",
"bool",
"[a-zA-Z]*_t",
"FILE",
"DIR",
"WIN",
"static",
"unsigned",
"int8_t",
"int16_t",
"int32_t",
"int64_t",
"uint8_t",
"uint16_t",
"uint32_t",
"uint64_t",
"union",
"enum",
... |
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from Moodipy.UserSummary import Person
from screeninfo import get_monitors
class ChoosePlaylistPG(QMainWindow):
def __init__(self):
max_screen_width = 1536
min_screen_width = 1000
max_screen_height = 864
min_scree... |
from setuptools import setup, find_packages
package_name = 'svo'
setup(
name=package_name,
version='0.1.0',
packages=find_packages(),
install_requires=[
'setuptools',
'nltk',
],
author='Andreas Klintberg',
maintainer='Andreas Klintberg',
description='NLTK SVO',
lice... |
while True:
try:
sequencia = input()
processosSimultaneos = int(input())
ciclos = 0
ciclos += sequencia.count('R' * processosSimultaneos)
sequencia = sequencia.replace('R' * processosSimultaneos, '')
for pos, char in enumerate(sequencia):
if pos == len(se... |
from typing import List
from base import version
class Solution:
@version("28ms, 16.4mb")
def nextGreatestLetter(self, letters: List[str], target: str) -> str:
l, r = 0, len(letters)
while l < r:
m = l + (r - l) // 2
if letters[m] > target:
r = m
... |
import os
import numpy as np
import pandas as pd
from statsmodels.sandbox.stats.multicomp import multipletests
from tqdm import tqdm
from .processing_schemes import Processor
from .utilities import recursivedict, get_outdir_path
class Scorer(Processor):
def __init__(self, settings=None):
super().__init_... |
import torch
__all__ = [
"compute_ent",
"compute_kld",
]
@torch.no_grad()
def compute_ent(confidences: torch.Tensor, reduction="mean", eps=1e-12) -> torch.Tensor:
"""
Args:
confidences (Tensor): a tensor of shape [N, K] of predicted confidences.
reduction (str): specifies the reducti... |
# coding: utf-8
def hook(event):
print 'mail handle'
print event
|
import asyncio
from typing import Generator
import os
import pytest
from fastapi.testclient import TestClient
from tortoise.contrib.test import finalizer, initializer
from app.setup import create_app
from app.models import User, Content
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
TEST_FILE = BASE_DIR + "/... |
import FWCore.ParameterSet.Config as cms
from DQMOffline.Trigger.DiDispStaMuonMonitoring_cfi import DiDispStaMuonMonitoring
hltDiDispStaMuonMonitoring = DiDispStaMuonMonitoring.clone()
hltDiDispStaMuonMonitoring.FolderName = cms.string('HLT/EXO/DiDispStaMuon/DoubleL2Mu23NoVtx_2Cha/')
hltDiDispStaMuonMonitoring.histoP... |
"""
simple example
Shows the basic steps for connecting to Iven Cloud:
1) Activate device
2) Send data
"""
import ivencloud
import Adafruit_DHT
# credentials
secret_key = "<your secret key>"
device_uid = "<your device uid>"
# server address
hostname = "staging.iven.io"
ivencloud.set_cloud_address(hostname) # def... |
from __future__ import annotations
from collections import defaultdict
class Facade:
_systems = defaultdict(list)
def __init__(self, sys1: Subsys1, sys2: Subsys2) -> None:
self.sys1 = sys1
self.sys2 = sys2
@classmethod
def get_sys_ops(cls, sys: Subsys1 or Subsys2) -> list:
... |
import numpy as np
import argparse
import Repo.Network as Network
import Repo.MnistHandler as mh
import Repo.GradientBasedOptimizers as gbo
# import Repo.CommonUtilityFunctions as cuf
parser = argparse.ArgumentParser()
parser.add_argument("--lr",help="initial learning rate for gradient descent based algorithms",type... |
import json
import torch
from sklearn.model_selection import train_test_split
curr_path = '../'
def load_dictionary():
index2word = torch.load(curr_path + 'data/dict.bin')
word2index = {v: k for k, v in index2word.items()}
return index2word, word2index
def load_data_v2():
i2w, w2i = load_dictionar... |
from .tprint import table_print, str_pad, str_len |
"""
File: quadratic_solver.py
Name:張文銓
-----------------------
This program should implement a console program
that asks 3 inputs (a, b, and c)
from users to compute the roots of equation:
ax^2 + bx + c = 0
Output format should match what is shown in the sample
run in the Assignment 2 Handout.
"""
import math
def m... |
# Copyright 2019 The KRules 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 writing,... |
#!/usr/bin/env python
"""
These are used at during testing to check the results.
Hazen 02/17
"""
import numpy
import storm_analysis.sa_library.sa_h5py as saH5Py
def verifyDriftCorrection(actual_drift_fname, measured_drift_fname):
"""
Return maximum difference between drift correction files.
"""
act... |
# -*- coding: utf-8 -*-
import pymysql
import xlwt
import logging
import os
from twisted.enterprise import adbapi
import traceback
from yzwspider.yzw.items import YzwItem
logger = logging.getLogger("YzwPipeline")
class YzwPipeline(object):
def __init__(self, pool, settings):
self.dbpool = pool
se... |
import numpy as np
import pandas as ps
import math
import sys
import random
### Negative windows
# prediction window and labeled window length in seconds
directory = sys.argv[1]
xSize = int(sys.argv[2]) # xwindow size
ySize = int(sys.argv[3]) # ywindow size
uID = sys.argv[4] # participant ID
norm = sys.argv[5] # norm... |
"""Salesforce Event Log
Retrieve hourly Salesforce event log files from the API
"""
import csv
import io
import json
import shutil
import os
import tempfile
from simple_salesforce import Salesforce
from runners.helpers import db, log
from runners.helpers.dbconfig import ROLE as SA_ROLE
from connectors.utils import y... |
import grequests
import requests
import json
import pandas as pd
import numpy as np
from datetime import datetime
# from multiprocessing import Pool
import os
from functools import reduce,partial
import re
class Project:
def __init__(self, url, id_var, date_var, token, project="cin"):
self.url = url
... |
from __future__ import absolute_import
from bokeh.core.properties import Int, String
from bokeh.util.options import Options
class DummyOpts(Options):
foo = String(default="thing")
bar = Int()
def test_empty():
empty = dict()
o = DummyOpts(empty)
assert o.foo == "thing"
assert o.bar == None
... |
# 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 ... |
# 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 logging
import re
import sys
from typing import Any, List
import pkg_resources
from hydra.experimental import compose, initialize_confi... |
from importlib.metadata import entry_points
from setuptools import find_packages
from setuptools import setup
setup(
name="daves_utilities",
version="1.0.0",
description="daves utilities are some fun little functions.",
author="David Kuchelmeister",
author_email="kuchelmeister.david@gmail.com",
... |
import pytest
from django.db.utils import IntegrityError
from tags.models import Tag
pytestmark = [pytest.mark.django_db]
def test_invalid_color():
color = 'invalid-color'
with pytest.raises(
IntegrityError,
match='CHECK constraint failed: HEX_color',
):
Tag.objects.create(
... |
import copy
import voluptuous as vol
from esphomeyaml import core
import esphomeyaml.config_validation as cv
from esphomeyaml.const import CONF_ABOVE, CONF_ACTION_ID, CONF_AND, CONF_AUTOMATION_ID, \
CONF_BELOW, CONF_CONDITION, CONF_CONDITION_ID, CONF_DELAY, \
CONF_ELSE, CONF_ID, CONF_IF, CONF_LAMBDA, \
CO... |
from .ModelParametersEstimation import *
from .LoadData import * |
from llvmlite import binding as ll
from llvmlite.llvmpy import core as lc
from numba.core.codegen import BaseCPUCodegen, CodeLibrary
from numba.core import utils
from .cudadrv import nvvm
CUDA_TRIPLE = {32: 'nvptx-nvidia-cuda',
64: 'nvptx64-nvidia-cuda'}
class CUDACodeLibrary(CodeLibrary):
# We ... |
import jax
import jax.numpy as jnp
import numpy as np
import numpyro.distributions as dists
from numpyro.primitives import sample, plate
import pandas as pd
from typing import Tuple, Iterable
def preprocess(orig_data: pd.DataFrame) -> Tuple[Iterable[pd.DataFrame], int]:
return (orig_data['first'].to_frame(), orig_... |
from Tkinter import *
import numpy as np
import json
import pfilter
from tkanvas import TKanvas
from collections import defaultdict
class Recogniser(object):
def __init__(self, pfilter, gestures):
self.screen_size = 500
c = TKanvas(draw_fn=self.draw, event_fn=self.event, quit_fn=self.quit, w=sel... |
__all__ = ['TAPTestRunner', 'TAPTestResult', 'run']
from .taprunner import TAPTestRunner, TAPTestResult
from .cli import run
|
import os
import nltk
import pickle
# in case cant download wordnet, run the following code:
# import ssl
# try:
# _create_unverified_https_context = ssl._create_unverified_context
# except AttributeError:
# pass
# else:
# ssl._create_default_https_context = _create_unverified_https_context
# nltk.downloa... |
from subsystems.snowveyorsubsystem import SnowveyorSubsystem
import commands2
import wpilib
from networktables import NetworkTables
class dropOff(commands2.CommandBase):
def __init__(self, duration: float, speed: float, snowveyor: SnowveyorSubsystem) -> None:
super().__init__()
self.snowveyor = sno... |
# -*- coding: utf-8 -*-
# /usr/bin/python3
import logging
import os
import tensorflow as tf
from models.encoderdecoder import EncoderDecoder
from utils.data_load import get_batch
from utils.hparams import Hparams
from utils.utils import get_hypotheses, load_hparams
logging.basicConfig(level=logging.INF... |
import sys, os
def eprint(*args, **kwargs):
"""
Print to stderr - see https://stackoverflow.com/a/14981125/8545455
"""
print(*args, file=sys.stderr, **kwargs)
def stripEnd(h, s):
if h.endswith(s):
h = h[:-len(s)]
return h
def hostCleanup(host):
"""
Condense URL into a standa... |
from django.shortcuts import render
from django.views.generic import ListView
from acheve_mgt.models import Student, MyClass, ScoreShip, Course
from django.contrib.auth.decorators import login_required
from django.http import JsonResponse
# Create your views here.
@login_required
def person(request, pk):
user = r... |
from . import utils # noqa
from .dfinity_gitlab_config import DfinityGitLabConfig # noqa
from .gitrepo import GitRepo # noqa
|
from django import forms
from .models import UserInfo
class UserForm(forms.ModelForm):
Discription = forms.CharField( widget=forms.Textarea (
attrs={
'placeholder':'Description',
'class': 'form-control',
}
))
UserBookName = forms.CharField( widget=forms.TextInput... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri May 1 17:01:45 2020
@author: natnem
"""
class Graph(object):
def __init__(self,adj):
self.adj = adj
def itervertices(self):
return self.adj.keys()
def neighbors(self,v):
return self.adj[v]
class dfsResult(object)... |
import os
import glob
import requests
from bs4 import BeautifulSoup
from tinydb import TinyDB
with open("./db.json", "w") as fp:
pass
DB = TinyDB("./db.json")
HOST = "https://batotoo.com"
SESSION = requests.Session()
def browse_pages(skip_saved=False):
if not os.path.exists("./browse"):
os.mkdir("br... |
# -*- coding: utf-8 -*-
"""
@author: Zheng Fang
"""
class Fetch:
k__ = None
|
# -*- coding: utf-8 -*-
"""
Created on 2020.05.19
@author: Jiahua Rao, Weiming Li, Hui Yang, Jiancong Xie
Code based on:
Shang et al "Edge Attention-based Multi-Relational Graph Convolutional Networks" -> https://github.com/Luckick/EAGCN
Coley et al "Convolutional Embedding of Attributed Molecular Graphs for Physical... |
from enum import Enum
class ScPythonEventType(Enum):
AddInputEdge = 0
AddOutputEdge = 1
ContentChanged = 2
EraseElement = 3
RemoveInputEdge = 4
RemoveOutputEdge = 5 |
MOCK = False
def get_saml_authenticator(*args, **kwargs):
if MOCK:
from . import mock
return mock.SamlAuthenticator(*args, **kwargs)
else:
from onelogin.saml2.auth import OneLogin_Saml2_Auth
return OneLogin_Saml2_Auth(*args, **kwargs)
|
from unittest.mock import Mock, patch
from weakref import ref
import pytest
try:
from django.db import models
# from parasolr.django.indexing import ModelIndexable
from parasolr.django.signals import IndexableSignalHandler
from parasolr.django.tests import test_models
except ImportError:
Indexable... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""SExtractor wrapper (limited functionality, but simple to use)
SExtractor: http://www.astromatic.net/software/sextractor
Other SExtractor Python wrappers (not BSD licensed!):
* http://chimera.googlecode.com/svn/trunk/src/chimera/util/sextractor.py
* h... |
import numpy as np
import pygame
from rllab.envs.box2d.parser import find_body
from rllab.core.serializable import Serializable
from rllab.envs.box2d.box2d_env import Box2DEnv
from rllab.misc import autoargs
from rllab.misc.overrides import overrides
# Tornio, Matti, and Tapani Raiko. "Variational Bayesian approach ... |
class DiagnosticPlots:
"""Reproduces the 4 base plots of an OLS model in R.
Original code from here: https://bit.ly/3a4YGH1, with modifications
by gt2447.
"""
def __init__(self, X, y):
self.X = X
self.y = y
self.fig, self.ax = plt.subplots(2, 2)
self.... |
import copy
import random
import re
from datetime import datetime
from functools import cached_property
from unittest.mock import MagicMock, Mock
import pytest
from bot import Bot
from command_handlers import HelpHandler
CHAT_ID = -593555199
UPDATE = {
"update_id": 360316438,
"message": {
"message_i... |
import os
import torch
from pytorch_pretrained_bert.optimization import BertAdam
from pytorch_pretrained_bert.tokenization import (
BertTokenizer, PRETRAINED_VOCAB_POSITIONAL_EMBEDDINGS_SIZE_MAP,
)
TF_PYTORCH_BERT_NAME_MAP = {
"bert-base-uncased": "uncased_L-12_H-768_A-12",
"bert-large-uncased": "uncase... |
# coding: utf-8
import pprint
import re # noqa: F401
import six
class Compare(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
... |
# ---------------------------------------------------------------
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the NVIDIA Source Code License
# for OSCAR. To view a copy of this license, see the LICENSE file.
# -----------------------------------------------------------... |
#!./venv/bin/python3.7
import argparse
import sys
import os
import cv2
import numpy as np
from src import lib
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input', help="Input image path", required=True)
parser.add_argument('-o', '--outdir', help="Output directory", required=True)
parser.add_argume... |
import sys
str1 = sys.argv[1]
str2 = str1.swapcase()
print(str2)
|
# -*- coding: utf-8 -*-
"""This module is designed to hold custom components with their classes and
associated individual constraints (blocks) and groupings.
Therefore this module holds the class definition and the block directly located
by each other.
SPDX-FileCopyrightText: Uwe Krien <krien@uni-bremen.de>
SPDX-Fil... |
"""Base Configuration File."""
from typing import TextIO, Type, TypeVar
from pydantic import Extra
from pydantic.dataclasses import dataclass
from ruamel.yaml import YAML
T = TypeVar("T", bound='ConfigModel')
@dataclass
class ConfigModel:
"""A base configuration class."""
class Config:
"""Configur... |
import logging
logger = logging.getLogger(__name__)
from typing import List
from . import SizeDistributionBaseModel as PSDBase
from .GaudinMeloy import GaudinMeloy
from .GGSSizeDistributionModel import GGS
from .LogNormalSizeDistributionModel import LogNormal
from .RRBSizeDistributionModel import RRB
from .SigmoidSiz... |
from .middleware import RequestIDMiddleware, get_request_id
|
import csv
from StringIO import StringIO
def csv_res2_dict_lst(res):
"""Convert CSV string with a header into list of dictionaries"""
return list(csv.DictReader(StringIO(res), delimiter=","))
def expected_repnames(repos_cfg):
"""Generate expected repository names '{account_name}/{repo_name}'"""
temp... |
from .resnest import build_resnest_backbone, build_resnest_fpn_backbone
from .config import add_resnest_config
|
# Generated by Django 2.0.8 on 2018-11-16 14:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workplace', '0019_model_translation'),
]
operations = [
migrations.AddField(
model_name='historicalreservation',
nam... |
from flask import Flask
from flask_restful import Api, Resource, reqparse
app = Flask(__name__)
api = Api(app)
animals = [
{
"id": "1",
"name": "Gallinazo Rey",
"class": "Ave",
"order": "Incertae Sedis",
"family": "Cathartidae",
"gender": "Sarcoramphus",
"sp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Filename: drawMSATopo.py
#
# Description:
# Visualize aligned membrane proteins by highlighting features of membrane
# topology
#
# Author:
# Nanjiang Shu nanjiang.shu@scilifelab.se
import string
import sys
import re
import os
import myfunc
import math
import lib... |
"""
Provides a suite of special data configurations for testing segmented
regression.
Notation: geographic: N,S,E,W
"""
# Author: Steven Lillywhite
# License: BSD 3 clause
from collections import namedtuple
from matplotlib import pyplot as plt
import numpy as np
from segreg.analysis import stats_plotting
from segr... |
import sys
import os
current_dir=os.path.dirname(__file__)
sys.path.append(os.path.join(current_dir,"../"))
import json
import random
from collections import deque,defaultdict,namedtuple
import numpy as np
from square_puzzle import SquarePuzzle
from sklearn.neural_network import MLPRegressor
from sklearn.pipe... |
import datetime
from django.test import TestCase
from django.urls import reverse
from ..models import EventCodeAccess
TESTCODE = "testcode"
BADCODE = "fakefake"
CREATED_AT = "2019-12-10 23:25"
EXPECTED_CREATED_AT = datetime.datetime.strptime(CREATED_AT, "%Y-%m-%d %H:%M")
class TestViewsWithActiveEvent(TestCase):
... |
import json
from numpy.testing import assert_almost_equal, assert_equal
import numpy as np
from obspy import read, UTCDateTime
import pytest
from geomagio.algorithm.FilterAlgorithm import FilterAlgorithm, get_nearest_time
import geomagio.iaga2002 as i2
def test_second():
"""algorithm_test.FilterAlgorithm_test.t... |
__all__ = ['P0DCutUtils',
'Base',
'makePlots',
'submit_analysis',
'highland_configurations',
'efficiency',
'constants']
|
#
# PySNMP MIB module HUAWEI-VO-GK-CLIENT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HUAWEI-VO-GK-CLIENT-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:49:31 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 ... |
#
# Copyright (C) 2014 Dell, 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 wri... |
import atexit
from mininet.net import Mininet
from mininet.topo import Topo
from mininet.cli import CLI
from mininet.log import info,setLogLevel
net = None
def createTopo():
topo=Topo()
#Create Nodes
topo.addHost("h1")
topo.addHost("h2")
topo.addHost("h3")
topo.addHost("h4")
topo.addSwitch('s1')
topo.addSwitch... |
import pygmaps
from sqlwrap import Database
def draw_map(ssid, coords):
gmap = pygmaps.maps('0', '0', '2')
for location in coords:
lat, lon = location
gmap.addpoint(float(lat), float(lon), '#FF0000')
gmap.draw('../ssid_html/{0}.html'.format(ssid.replace(' ', '_')))
def map_ssid_coords(ssid):
with Database('... |
import datetime
import json
from collections import deque
from enum import Enum, unique
from pathlib import Path
import unyt as u
from event_model import compose_resource
from ophyd import Component as Cpt
from ophyd import Device, Signal
from ophyd.sim import NullStatus, SynAxis, new_uid
from .shadow_handler import ... |
# AUTOGENERATED FILE - DO NOT MODIFY!
# This file was generated by Djinni from my_flags.djinni
from djinni.support import MultiSet # default imported in all files
from djinni.exception import CPyException # default imported in all files
from djinni import exception # this forces run of __init__.py which gives cpp opt... |
#!/usr/bin/env python
import datetime
import json
import logging
import os
import random
import re
import subprocess
import time
import tempfile
import shutil
import urllib2
import json
import csv
import pytz
import tzlocal
def do_ndt_test(country_code=""):
"""Runs the NDT test as a subprocess and returns the ra... |
#from pyspark.sql import SparkSession, functions, types
import sys
import json
import requests
#def join():
# real_game_info = spark.read.json('real_game_info')
# real_game_info = real_game_info.orderBy(real_game_info['count'].desc()).where(real_game_info.guid != '')
# real_game_info.select('guid').coalesce(1).write.... |
def reverseBits(n):
binaryNum = list(f'{n:32b}')
for i in range(len(binaryNum)):
if (binaryNum[i] == ' '):
binaryNum[i] = '0'
print ("binaryNum: " + str(binaryNum))
for i in range(math.floor(len(binaryNum)/2)):
temp = binaryNum[i]
binaryNum[i] = binaryNum[... |
from .base import Kernel, DevicePointer, CUDAStream, round_up
import ctypes
arith_kernel = Kernel(
"arith",
[
"cu_arith_global_scale",
"cu_arith_element_add",
"cu_arith_element_mul",
"cu_arith_batch_add_forward",
"cu_arith_batch_add_backward",
"cu_arith_ln_mul_ad... |
#para saber se seu nome tem o nome silva
s = str(input('digite seu nome: ')).upper()
print('tem silva em seu nome: {}'.format("SILVA" in s.strip()))
|
from diagnnose.attribute import ContextualDecomposer, Explainer
from diagnnose.config import create_config_dict
from diagnnose.models import LanguageModel, import_model
from diagnnose.tokenizer import create_tokenizer
from diagnnose.utils.misc import profile
if __name__ == "__main__":
config_dict = create_config_d... |
from barbell2.lib.xnat.xnatclient import XnatClient
|
#!/usr/bin/env python
from setuptools import setup
try:
long_description = open('README.md', 'r').read()
except:
long_description = ''
setup(
name='samp-client',
version='3.0.1',
packages=['samp_client'],
url='https://github.com/mick88/samp-client',
license='MIT',
author='Michal Dabski... |
import pytest
from test_deployers import InMemoryDeploymentBackend
from ee.models import Application, ApplicationEnvironment, EnvironmentDefinition
from ee.service import EnvironmentService
@pytest.fixture
def env_service(in_memory_store):
deployment_backend = InMemoryDeploymentBackend()
env_service = Enviro... |
from .main import find_and_write_commits
|
# -*- coding: utf-8 -*-
import attr
@attr.s
class BaseConfig:
def validate(self):
raise NotImplementedError
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.