content stringlengths 5 1.05M |
|---|
from typing import List, Tuple, Union
import numpy as np
def beta_posteriors_all(
totals: List[int],
positives: List[int],
sim_count: int,
a_priors_beta: List[Union[float, int]],
b_priors_beta: List[Union[float, int]],
seed: Union[int, np.random.bit_generator.SeedSequence] = None,
) -> np.nda... |
# -*- coding: utf-8 -*- #
"""
Created on Thu Jun 8 14:00:08 2017
@author: grizolli
"""
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
xx=np.random.rand(50)
yy=np.random.rand(50)
zz=np.random.rand(50)
ax.scat... |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
# coding UTF-8
from sklearn import datasets
from sklearn import svm
from sklearn import metrics
import matplotlib.pyplot as plt
# 数字データの読み込み
digits = datasets.load_digits()
# データの形式を確認
# print (digits.data)
# print (digits.data.shape)
# データの数
n = len(digits.data)
# 画像と正解値の表示
# images = digits.images
# labels = digi... |
import matplotlib
from matplotlib.patches import Rectangle, Patch
import numpy as np
import matplotlib.pyplot as plt
import csv
import cv2
import os
from matplotlib.colors import LinearSegmentedColormap
import scipy.stats as stats
import seaborn as sns
from matplotlib import cm
from scipy.optimize import linear_sum_ass... |
#Develop a program that demonstrates the use of cloudmesh.common.Shell.
from cloudmesh.common import Shell
if __name__ == "__main__":
result = Shell.execute("dir")
print(result) |
import time
from nose.plugins.attrib import attr
from dxlclient import ResponseCallback, UuidGenerator, ServiceRegistrationInfo, Request
from dxlclient.test.base_test import BaseClientTest
from dxlclient.test.test_service import TestService
class AsyncCallbackTimeoutTest(BaseClientTest):
@attr('manual')... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-07-25 14:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('insta', '0008_auto_20180725_1214'),
]
operations = [
migrations.AddField(
... |
from vee.pipeline.base import PipelineStep
class DeferredStep(PipelineStep):
factory_priority = 9999
@classmethod
def factory(cls, step, pkg):
if pkg.url.startswith('deferred:'):
return cls()
def init(self, pkg):
pass
|
import tensorflow as tf
from .var_layer import VarLayer
class FC(VarLayer):
def __init__(self, in_channels, out_channels, dropout=None, **kwargs):
self.dropout = dropout
super(FC, self).__init__(
weight_shape=[in_channels, out_channels],
bias_shape=[out_channels],
... |
import re
from rdflib import Graph, Literal, XSD, RDF
"""
Post processing functions. The JSON-LD pre-processor is model independent -- the transformations, while having certain
intimate knowledge of the FHIR resource structure, do not draw on individual schema definitions.
The post processor handles context specifi... |
import time
import ast
import matplotlib.pyplot as plt
import numpy as np
with open('C:/Git/dyn_fol_times2', 'r') as f:
data = f.read().split('\n')
times = []
for line in data:
try:
if line == '':
continue
line = '{' + line.replace('one_it', '"one_it"').replace('mpc_id', '"mpc_id"') + '}'
# prin... |
# proxy module
from pyface.image_resource import *
|
import re
from typing import List, Dict, Set
def part_one(lines: List[str]) -> int:
all_ingredients, all_allergens, ingredient_allergen_map = process(lines)
count: int = 0
allergens: Set[str] = set()
for allergen in ingredient_allergen_map.values():
allergens |= allergen
safe_ingredient... |
import click
import os
import json
# from pyfiglet import Figlet
# f = Figlet(font='big')
# print(f.renderText('Android JS'))
import time
import sys
CWD = os.getcwd()
@click.group()
def cli():
pass
@cli.command()
@click.option('--app-name', prompt='App Name ? ', help='New App Name')
@click.option('--force', i... |
# coding: UTF-8
from .parser import ShiftReduceParser
|
import json
import pymongo
import sys
def connect_to_db_collection(db_name, collection_name):
'''
Return collection of a given database name and collection name
'''
connection = pymongo.Connection('localhost', 27017)
db = connection[db_name]
collection = db[collection_name]
return col... |
from checkov.common.vcs.vcs_schema import VCSSchema
class BranchRestrictionsSchema(VCSSchema):
def __init__(self):
schema = \
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"pagelen":... |
"""
Controller for the bookmarks
By: Tom Orth
"""
from app.bookmarks.model import BookmarkTranscript
from app.utils import convert_full_transcripts_to_json, check_if_parsed_transcripts_are_bookmarked
from app.bookmarks.form import SearchForm
from app.setup import conn
from flask import Blueprint, render_template, req... |
# coding: utf-8
"""
simple implementation of Longest common subsequence algorithm
https://en.wikipedia.org/wiki/Longest_common_subsequence_problem
"""
from __future__ import print_function
def lcs_length(str1, str2):
""" get longest common subsequence length
str1, str2 - strings
return C, B - ma... |
from .model_600_basicSaVs import BasicSaVs
|
import numpy as np
from psychopy.visual.grating import GratingStim
class GazeStim(GratingStim):
"""Stimulus linked to eyetracker that shows gaze location."""
def __init__(self, win, tracker):
self.tracker = tracker
super(GazeStim, self).__init__(win,
aut... |
#!/usr/bin/env python3
import os, sys, json, re, math, logging, traceback, pickle, hashlib
from lxml.etree import parse
from osgeo import gdal
import numpy as np
import isce
from iscesys.Component.ProductManager import ProductManager as PM
from isceobj.Orbit.Orbit import Orbit
from utils.time_utils import getTemporal... |
"""OpenAPI2(Swagger) with Starlette
"""
import pytest
from starlette.applications import Starlette
from starlette.endpoints import HTTPEndpoint
from starlette.requests import Request
from starlette.responses import JSONResponse
from starlette.testclient import TestClient
from uvicorn import run
from apiman.starlette i... |
def transform(dataset, rot_center=0, tune_rot_center=True):
"""Reconstruct sinograms using the tomopy gridrec algorithm
Typically, a data exchange file would be loaded for this
reconstruction. This operation will attempt to perform
flat-field correction of the raw data using the dark and
white back... |
import zss
class TreeDistanceComparator:
def __init__(self, tree1, tree2, maxComparisonDepth=None):
self.__tree1 = tree1.root
self.__tree2 = tree2.root
self.__treeHeight = max(tree1.getMaxDepth(), tree2.getMaxDepth())
self.__maxDepth = maxComparisonDepth
self.__treeEditDist... |
# script to segregate training and validation data
import cv2
import os
def load_images_from_folder(folder):
images = []
for filename in os.listdir(folder):
img = cv2.imread(os.path.join(folder,filename))
if img is not None:
images.append(img)
return images
image_list = load_im... |
import numpy as np
#Refer to magmom_handler.py for usage of variables defined here
spblock_metals = [3,4,11,12,19,20,37,38,55,56,87,88]
dblock_metals = np.concatenate((np.arange(21,30,1),np.arange(39,48,1),
np.arange(71,80,1),np.arange(103,112,1)),axis=0).tolist()
fblock_metals = np.concatenate((np.arange(57,71,1),np... |
#! /usr/bin/python
import time
import random
from sds import SDS, decode_mig_status
def main():
sds = SDS('sds')
# sds.capture(16)
if 1:
print "counts 0x%08x" % sds.read_soc_reg(0x212)
decode_mig_status(sds.read_soc_reg(0x211))
if 1:
print "Reset"
sds.write_soc_reg(... |
# -*- coding: utf-8 -*-
"""Model unit tests."""
import datetime as dt
import pytest
from flask_server.models import Admin, Article, Module
from .factories import UserFactory, ArticleFactory
@pytest.mark.usefixtures('db')
class TestUser:
"""User tests."""
def test_get_by_id(self):
"""Get user by ID... |
import math, time
import o80
from handle_contacts import MUJOCO_ID, ROBOT_SEGMENT_ID, BALL_SEGMENT_ID
from handle_contacts import get_table_contact_handle
handle = get_table_contact_handle()
ball = handle.frontends[BALL_SEGMENT_ID]
def _distance(p1, p2):
return math.sqrt([(a - b) ** 2 for a, b in zip(p1, p2)])
... |
from . import style_reader, lists
def read_options(options):
custom_style_map = _read_style_map(options.get("style_map") or "")
include_default_style_map = options.get("include_default_style_map", True)
options["ignore_empty_paragraphs"] = options.get("ignore_empty_paragraphs", True)
options["sty... |
from functools import wraps
from flask import request
from flask.ext import restful
from . import api
from .errors import BadRequest
from .jwt import jwt_required
class Resource(restful.Resource):
method_decorators = [jwt_required]
def link(rel, resource, method="GET", **kwargs):
href = api.url_for(resou... |
#!/usr/bin/python
# 2020, @oottppxx
import os
import re
import sys
import zlib
VERSION='202006141136'
TFTPD='192.168.0.50'
# 3726MiB max across partitions.
# for alignment, 7632895 works better?!
MAX_LBA=7634910
RECO_KLABEL='kernel'
IMG='disk.img'
TMP_PARTY='/mnt/hdd/party'
NEW_IMG=os.path.join(TMP_PARTY, 'new_di... |
from django.urls import path
from . import views
urlpatterns = [
#localhost:8000/Sumar
path('',views.index,name='El saludo'),
#sumando
path('<int:numero1>/<int:numero2>',views.Sumando,name='sumando'),
] |
# Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved.
#
# This software is licensed under the Apache License, Version 2.0 (the
# "License") as published by the Apache Software Foundation.
#
# You may not use this file except in compliance with the License. You may
# obtain a copy of the License at... |
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import cv2
import numpy as np
def draw_keypoints(kps, verbose=False):
lines = [(0,1),(1,2),(2,6),(6,3),(3,4),(4,5),(6,7),(7,8),(8,9),(10,11),(11,12),(12,7),(7,13),(13,14),(14,15)]
pose_dict = {0: 'right_ankle',
1: 'right_knee',
... |
from dictfetcher import DictFetcherMixin
d = {
"a": {
"b":{
"abc": "what",
"aba": "the",
"aa": "kkk",
"a": "lala"
},
"a": "somevalue",
"c": {
"x.y": "except",
"x": "bug",
"y": "ssss"
},
... |
from libra_client.canoser import Struct, RustEnum
from libra_client.lbrtypes.ledger_info import LedgerInfoWithSignatures
from libra_client.lbrtypes.transaction import TransactionWithProof, TransactionListWithProof
from libra_client.lbrtypes.account_state_blob import AccountStateWithProof
from libra_client.lbrtypes.cont... |
# -*- coding: utf-8 -*-
"""
Microsoft-Windows-Shell-Search-UriHandler
GUID : 606c6fe0-a9dc-4a9d-bdea-830aff6716e7
"""
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, Guid
from etl.dtyp import ... |
import json
from channels.generic.websocket import WebsocketConsumer
from asgiref.sync import async_to_sync
from backend.views import check_is_admin
from backend.models import Event
class ImportConsumer(WebsocketConsumer):
def connect(self):
user = self.scope["user"]
event_id = self.scope['url_rout... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
# Export this package's modules as members:
from .data_controller import *
from .get_data_controller import *
from .get_postgres_instance import *
from... |
"""
Check id() contra cmp()
"""
import support
try:
a={[1,2]:3}
if not a.has_key([1,2]):
raise support.TestError("Lists hash inconsistently")
except TypeError, e:
pass
else:
raise support.TestError("Should raise a TypeError")
|
import numpy as np
import open3d as o3d
import time
from utils.utils import prepare_dataset, draw_registration_result
def ransac_registration(source_down: o3d.geometry.PointCloud, target_down: o3d.geometry.PointCloud,
source_fpfh: o3d.pipelines.registration.Feature,
... |
# Copyright 2019 Regents of the University of Minnesota.
#
# 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... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import numpy as np
import argparse
import time
import cv2
import torch
from utils.config import opt
from imageio import imread
from model.rpn.bbox_transform import clip_boxes
from utils.dataset import... |
'''Read and write PCM 16 bits files.'''
import numpy as np
# open raw PCM audio file, return float array
def read_raw_pcm_16bits(filename):
fd = open(filename, 'rb')
data = np.fromfile(file = fd, dtype = np.int16)
fd.close()
return np.array(data, dtype=float)
# write a raw PCM audio file
def write_raw_pcm_1... |
''' Handling the data io '''
import argparse
import torch
import transformer.Constants as Constants
def read_instances_from_file(inst_file, max_sent_len, keep_case):
''' Convert file into word seq lists and vocab '''
word_insts = []
trimmed_sent_count = 0
with open(inst_file) as f:
... |
import tensorflow as tf
import numpy as np
class TextCNN(object):
"""
CNN 2-chanels model for text classification.
"""
def __init__(self, sentence_len, vocab_size, embedding_size, num_classes,
static_embedding_filter, filter_sizes, num_filters, l2_reg_lambda = 0.0):
... |
from email.mime import image
from django.shortcuts import render
from django.http import HttpResponse
from .models import Images, Location
from images.models import Images
# Create your views here.
def home(request):
images = Images.objects.all()
location_list = Location.objects.all()
return render(reques... |
"""route.py
Linux parsers for the following commands:
* route
"""
# python
import re
# metaparser
from genie.metaparser import MetaParser
from genie.metaparser.util.schemaengine import Schema, Any, Optional
# =======================================================
# Schema for 'route'
# ========================... |
"""
Main File for Program
"""
from libs.url_utils import send_msg_url as s_url
from libs.wsp import WebWSP as Wsp
from os.path import join as os_join
from os import getcwd
def sing_msg_multi_num(numb_path,
msg_path):
with open(numb_path) as numbers:
with open(msg_path) as msg_chunks... |
from rest_framework import serializers
from location.models import GeoLocation
class GeoLocationSerializer(serializers.ModelSerializer):
class Meta:
model = GeoLocation
fields = ('geofile',)
@property
def data(self):
return dict(
data=self.instance.create_coordinate_... |
"""empty message
Revision ID: 1df82b5937b
Revises: None
Create Date: 2016-06-08 11:11:54.020641
"""
# revision identifiers, used by Alembic.
revision = '1df82b5937b'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
... |
import numpy as np
import matplotlib.pylab as plt
import time
from IPython import display
## separating the input data to test and train
def create_test_train(finalOffense_tweet,none_tweet,ratio_to_train=0.75):
# Set random seed
np.random.seed(0)
## creating the new data matrix
full_data_mat = []
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import torch
from torchknickknacks import modelutils
model = torch.hub.load('pytorch/vision:v0.10.0', 'alexnet', pretrained = True)
# Register a recorder to the 4th layer of the features part of AlexNet
# Conv2d(64, 192, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2)... |
#!/usr/bin/python
from ftplib import FTP
import os, time
import zipfile
from os.path import join, exists
import subprocess, hashlib
from datetime import datetime
from time import gmtime
class DataGetter:
def __init__(self):
self.updatedFiles = []
self.newFiles = []
self.errorFiles = []
... |
# -*- coding:utf-8 -*-
#
# 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, softw... |
class ModelInfo(object):
def is_primary(self):
pass
def has_owner(self):
pass
def is_secondary(self):
pass
def primary_model(self):
pass
def needs_view(self):
pass
def get_verbs(self):
pass
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
#pylint: disable=I0011,W0231
"""Missile class"""
import item
class Missile(item.Item):
"""Missile"""
sprite = "|"
def __init__(self, x, y, player):
"""init bomb"""
item.Item.__init__(self, x, y)
self.player = player
def tick(self):
... |
#
# CreateStatusGraph.py
# Reads a status file (pickle), calculates code
# coverage and graphs the bitmap in PNG format
#
import sys
import pickle
try:
import png
HAS_PYPNG = True
except:
print "[!] PyPNG library not found."
print "[*] Install via PIP: pip install pypng"
HAS_PYPNG = False
def populate_array(... |
s = input()
n = int(input())
for _ in range(n):
l, r = map(int, input().split())
lstr = s[:l-1]
mstr = s[l-1:r]
mstr = mstr[::-1]
rstr = s[r:]
s = lstr + mstr + rstr
print(s)
|
import optparse
import Utils
import gensim
import numpy
def doc2vec(m, document):
vectors = [m[token] for token in document if token in m]
if len(vectors) == 0:
return None
doc = numpy.sum(vectors, axis=0)
return doc
def main():
parser = optparse.OptionParser()
parser.add_option('-d',... |
#! /usr/bin/env python
# Copyright 2017, RackN
#
# 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 t... |
from compas.geometry import Pointcloud
from compas.utilities import i_to_red, pairwise
from compas_plotters import Plotter
plotter = Plotter(figsize=(8, 5))
pointcloud = Pointcloud.from_bounds(8, 5, 0, 10)
for index, (a, b) in enumerate(pairwise(pointcloud)):
vector = b - a
vector.unitize()
plotter.add(... |
"""Test the list command."""
# mypy: ignore-errors
# flake8: noqa
import argparse
from unittest.mock import patch
import pytest
from dfetch.commands.list import List
from tests.manifest_mock import mock_manifest
DEFAULT_ARGS = argparse.Namespace()
DEFAULT_ARGS.projects = []
@pytest.mark.parametrize(
"name, pr... |
########################################
#
# Program Code for Fred Inmoov
# Of the Cyber_One YouTube Channel
#
# This is version 3 with MarySpech TTS,
# ProgramAB as the brain and Spinx
# Speech Recognition
#
########################################
# generate random integer values
from random import seed
from random ... |
from country_builder import CountryBuilder
from game_builder import GameBuilder
from event_builder import EventBuilder
from medal_builder import MedalBuilder
from team_builder import TeamBuilder
from coach_builder import CoachBuilder
from athletes_builder import AthletesBuilder
import os.path
my_path = os.path.abspat... |
#!/usr/bin/env python
# coding: utf-8
# Binary Search and Linear Search on a large number along with Time
import time
# Binary Search
def binary_search(given_list,item):
start = time.time()
low = 0
high = len(given_list)-1
mid = (low + high) // 2
while given_list[mid] != item:
if given... |
# -*- coding: utf-8 -*-
# Copyright 2016 Yelp 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 ag... |
class Solution:
def search(self, nums: List[int], target: int) -> int:
low, high = 0, len(nums) - 1
while (low <= high):
pivot = (high + low) // 2
# check lucky case
if nums[pivot] == target:
return pivot
# check i... |
"""Provides helper functions for dates."""
import datetime as dt
from typing import List, Optional
import pytz
BERLIN = pytz.timezone("Europe/Berlin")
UTC = pytz.UTC
def local_now() -> dt.datetime:
"""Generate current datetime (Berlin time zone).
Returns:
dt.datetime: Current datetime.
"""
... |
from matplotlib import pyplot as plt
import numpy as np
from tensorflow.keras.preprocessing import image
from PIL import Image, ImageOps
# Models to play around with:
from tensorflow.keras.applications.mobilenet_v2 import MobileNetV2, preprocess_input, decode_predictions
from tensorflow.keras.applications.resnet50 imp... |
# -*- coding: utf-8 -*-
"""
ui/gridbase.py
Last updated: 2021-10-10
Widget with tiles on grid layout (QGraphicsScene/QGraphicsView).
=+LICENCE=============================
Copyright 2021 Michael Towers
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in complia... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# ade:
# Asynchronous Differential Evolution.
#
# Copyright (C) 2018-20 by Edwin A. Suominen,
# http://edsuom.com/ade
#
# See edsuom.com for API documentation as well as information about
# Ed's background and other projects, software and otherwise.
#
# Licensed under th... |
import sys
import cv2
import math
import numpy as np
# H: 0-179, S: 0-255, V: 0-255 for opencv color ranges
class TrackedObj:
__rgb_color = None
__tolerance = None
lower_color = None
upper_color = None
name = None
coords = None
contour_filter = None
... |
# Copyright 2020 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, ... |
# Models
from django.contrib.auth.models import User
from django.test import TestCase
from users.views import spawn_user
from .models import MessageThread
from .views import send_message, find_group
# useful utility function to find members by username
# I should maybe actually put this in like users.members
def get... |
#!/usr/bin/env python
# encoding: utf-8
"""
基础配置文件
"""
DEBUG = False
CONNECT_TIMEOUT = 10
REQUEST_TIMEOUT = 10
|
from infinitystone.models.domains import infinitystone_domain
from infinitystone.models.endpoints import infinitystone_endpoint
from infinitystone.models.roles import infinitystone_role
from infinitystone.models.tenants import infinitystone_tenant
from infinitystone.models.users import infinitystone_user
from infinitys... |
from Environment import Environment
# import Environment as ev
# ev.generate_graph()
# L = Environment()
# print(L.generate_actions(L.state.drivers[0]))
# print(L.generate_all_actions())
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def create_pages(apps, schema_editor):
Page = apps.get_model("wagtailcore", "Page")
TopicListPage = apps.get_model("articles", "TopicListPage")
home_page = Page.objects.get(slug="home")
ContentTyp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class NaptConnectionEventArgs(object):
def __init__(self, conn, data = None, offset = 0, size = 0):
self.connection = conn
self.data = data
self.offset = offset
self.size = size
|
#!/usr/bin/env python3
import sys
import math
import numpy as np
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
from scipy.stats import norm
import subprocess as sp
from tqdm import tqdm
f... |
from django import test
from myapp import tests
from myapp import utils
class IsReadOnlyUserTest(test.TestCase):
def test_read_only_user(self):
"""Test a user whom is in the group Read_Only and ensure this returns True.
"""
user = tests.setup_test_user(True)
results = utils.is_re... |
from selenium import webdriver
from selenium.webdriver.common.keys import keys
import time
class botTwitter:
def __init__(self, username, password):
self.username = username
self.password = password
self.bot = webdriver.Firefox()
def login(self):
bot = self.bot
bot.get ... |
from pylab import *
import IPython
import fileio
from os import listdir
from os.path import isfile, join
def subplots(label):
"""Draws four subplots of each of the variables"""
data = [M,E,chi,Cv]
labels = ["$\overline{M}$","$\overline{E}$","$\overline{\chi}$","$\overline{C}_V$"]
for j in xrange(len(l... |
import os
import time
import docker
import pytest
import requests
from hamcrest import *
def build_helper_image(client):
basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
client.images.build(
tag='chaos-swarm-helper-test',
path=basedir,
rm=True,
)
def create_h... |
from importlib import import_module
import inspect
from django.test import TestCase
from django.urls import reverse, resolve
def test_events_urls():
# Order of elements in tuples of urls:
# 0: url name
# 1: url route
# 2: view function/class name
# -1: args/kwargs
# for kwargs, intege... |
from rest_framework import serializers
from .models import *
class UserVeriCodeSerializer(serializers.ModelSerializer):
class Meta:
model = UserVeriCodeModel
fields = ('uniq_id', 'user_mobile_no', 'verification_code', 'cre_date', 'upt_date')
class NaverCloudLogSerializer(serializers.ModelSeriali... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
from django.shortcuts import get_object_or_404
from django.core.exceptions import ObjectDoesNotExist
from django.views.decorators.csrf import csrf_exempt
from rest_framework.decorators import api_view
from rest_framework import status
from rest_framework.response import Response
from .models import Deck, Flashcard
fr... |
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext_lazy as _
from rest_framework import generics, authentication, permissions,\
status
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settings import api_settings
from rest_framework.response ... |
# Generated by Django 3.2.5 on 2021-11-30 10:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('takeouts_app', '0034_auto_20211013_1344'),
]
operations = [
migrations.AddField(
model_name='containerstakeoutrequest',
... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import *
from builtins import object
import urllib.request, urllib.parse, urllib.error... |
>>> cur.execute('''UPDATE PopByRegion SET Population=100600 WHERE Region = "Japan"''')
<sqlite3.Cursor object at 0x7f7f281921f0>
>>> cur.execute('SELECT * FROM PopByRegion WHERE Region = "Japan"')
<sqlite3.Cursor object at 0x7f7f281921f0>
>>> cur.fetchone()
('Japan', 100600)
>>> cur.execute('DELETE FROM PopByRegion WHE... |
"""这个是base64"""
print(__name__)
|
import setuptools
setuptools.setup(
name="buildbot-washer",
version="1.1.0",
author="Roberto Abdelkader Martínez Pérez",
author_email="robertomartinezp@gmail.com",
description="Buildbot Utility Library",
packages=setuptools.find_packages(exclude=["tests", "docs"]),
license="Apache",
cla... |
from __future__ import absolute_import, division, print_function
import sys
import libtbx.utils
import xml.etree.ElementTree as ET
from libtbx import easy_pickle
from libtbx.utils import Sorry
import libtbx.load_env
from libtbx import smart_open
import os
import csv
web_urls = {"rcsb": "http://www.rcsb.org/pdb/rest/c... |
from matplotlib import animation as animation
import numpy as np
import mpl_toolkits.mplot3d.axes3d as p3
import matplotlib.pyplot as plt
import time
import matplotlib
#from IPython.display import HTML
import matplotlib.patches as patches
class visualize2D_anim():
def __init__(self, dir=None,label=0):
self... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.