content stringlengths 5 1.05M |
|---|
'''
@date: 12/03/2015
@author: Stefan Hegglin
'''
import unittest
import numpy as np
from scipy.constants import c, e, m_p
from PyHEADTAIL.particles.particles import Particles
from PyHEADTAIL.general.printers import AccumulatorPrinter
from PyHEADTAIL.aperture.aperture import (
RectangularApertureX, Rectangular... |
import os
from SS_Embedding_Calculation.process_KG import get_semantic_aspects
#################
## Input ##
#################
"""
:param dataset_name: name of the dataset
:param proxy: proxy name (e.g. SEQ, PFAM, PhenSeries, PPI)
:param ontology: the ontology file path
:param ontology_annotations: annotations f... |
"""
Django settings for libmanager project.
Generated by 'django-admin startproject' using Django 3.1.3.
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/
"""
... |
import pytest
import irrigation30 as irr
def test_input_types():
with pytest.raises(ValueError) as exception:
model = irr.Irrigation30(center_lat="f", center_lon=77.0,
edge_len=0.005, num_clusters=2)
with pytest.raises(ValueError) as exception:
model = irr.Irr... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from pyDes import des, ECB, PAD_PKCS5
import base64
secret_key = ':M)g>0C9'
def DesEncrypt(s):
iv = secret_key
k = des(secret_key, ECB, iv, pad=None, padmode=PAD_PKCS5)
en = k.encrypt(s.encode('utf-8'), padmode=PAD_PKCS5)
return str(base64.b64encode(en),... |
"""
.. _ex-opm-resting-state:
======================================================================
Compute source power spectral density (PSD) of VectorView and OPM data
======================================================================
Here we compute the resting state from raw for data recorded using
a Neurom... |
import sys
import os
import json
import requests
fileAddress = os.path.abspath(sys.argv[1])
with open(fileAddress) as f:
data = json.load(f)
server = "http://localhost:" + sys.argv[2]
url = server + "/LB/" + data["type"] + "/"
headers = {
'Content-type': 'application/json',
'Accept': 'text/plain'
}
body ... |
#
# Copyright (C) 2019 Pico Technology Ltd. See LICENSE file for terms.
#
# TC-08 SINGLE MODE EXAMPLE
import ctypes
import numpy as np
from picosdk.usbtc08 import usbtc08 as tc08
from picosdk.functions import assert_pico2000_ok
# Create chandle and status ready for use
chandle = ctypes.c_int16()
status ... |
import json
import pandas as pd
import os
from constants import *
import csv
from Scrape import *
from bs4 import BeautifulSoup
import requests
from GetUrls import *
from pathlib import Path
import datetime
import sys
import zerorpc
from functions import *
import numpy as np
import time
from time import sleep
|
from django.db import models
from olympia.amo.models import ManagerBase, ModelBase
from olympia.translations.fields import (
LinkifiedField, PurifiedField, TranslatedField, save_signal)
class TranslatedModel(ModelBase):
name = TranslatedField()
description = TranslatedField()
default_locale = models.... |
#!/usr/bin/env python
# coding: utf-8
import json, time, os, sys, logging
from datetime import datetime
import torch
from torch import nn
from torch import optim
import torch.nn.functional as F
from torchvision import datasets, transforms, models
from collections import OrderedDict
from PIL import Image
import seaborn ... |
# Copyright 2016-present CERN – European Organization for Nuclear Research
#
# 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... |
#!/bin/python3
# Generates matrix for GitHub Actions
# For workflow https://github.com/kivymd/KivyMD/blob/master/.github/workflows/build-demos.yml
# See https://stackoverflow.com/a/62953566/11948346
import json
import os
import sys
from pathlib import Path
diff = sys.argv[1]
is_workflow_dispatch = sys.argv[2] == "tru... |
from datetime import datetime
from django.conf import settings
from main.models import Logs
import secrets
import string
def generate_characters(num_characters):
characters = string.ascii_letters + string.digits
return ''.join(secrets.choice(characters) for i in range(num_characters))
def save_log(user, act... |
count = 0
def execute(ins, item, dic):
global count
if ins == "insert":
if item in dic:
dic[item] += 1
if dic[item] == 2:
count += 1;
else:
dic[item] = 1
else:
if item in dic:
dic[item] -= 1
if dic[item] == ... |
from .Toolbox import Tool
class Fetch(Tool):
def __init__(self):
Tool.__init__(self)
print('Fetch is ready!')
class Clean(Tool):
def __init__(self):
Tool.__init__(self)
print('Clean is ready!')
class Prepare(Tool):
def __init__(self):
To... |
import time
import MySQLdb
print "dbapi v3.0"
def openDB_TerenceHill():
con = MySQLdb.connect(host='192.168.1.121', #host="192.168.88.249", # your host, usually localhost
user="windControl_user", # your username
passwd="Aero-1234", # your password
... |
################################################
################# GUI ##################
################################################
import tkinter as tk
import tkinter.messagebox
from tkinter.filedialog import *
from sudoku_solver import check_sudoku,Solver
from sudoku_solver_v2 import Sudo
from sudoku_... |
import json
import os
import sys
import torch
import matplotlib.pyplot as plt
import numpy as np
from gru import GRUNet
from utils import context_target_split
from torch.utils.data import DataLoader
from datasets import mnist, celeba, SineData
from neural_process import NeuralProcessImg
from neural_process import Neura... |
'''
>>> import random
>>> random.choice(["Rock", "Paper", "Scissors"])
'Paper'
>>> random.choice(["Rock", "Paper", "Scissors"])
'Rock'
>>> random.choice(["Rock", "Paper", "Scissors"])
'Scissors'
>>> random.choice(["Rock", "Paper", "Scissors"])
'Paper'
>>> random.choice(["Rock", "Paper", "Scissors"])
'Scissors'
>>> ran... |
# -*- coding: utf-8 -*-
import partner
import account
import account_payment
import account_invoice
import account_bank_statement
import account_move
import chart_template
import account_analytic_line
import account_journal_dashboard
import product
import company
import res_config
import web_planner
|
from webbrowser import open
def search_google(query):
open("https://www.google.com/search?q="+str(query))
def search_wikipedia(query):
open("https://en.wikipedia.org/wiki/"+str(query))
def search_youtube(query):
open("http://www.youtube.com/results?search_query="+str(query))
def open_google():
open(... |
import cv2
def getName(tnId):
if tnId == 1:
return 'jean'
elif tnId == 2:
return 'desconhecido'
path = "/Users/jeanfernandes/Documents/git/Py_facial/source/scripts/"
file = "haarcascade_frontalface_default.xml"
detector = cv2.CascadeClassifier(path + file)
reconhecedor = cv2.face.FisherFaceRe... |
"""
Conversion between 2 alternative representations of a Bayer array.
| 1-channel representation: ``(..., 1, 2h, 2w)``
| 4-channel representation: ``(..., 4, h, w)`` where the 4 color channels are separated
Notice that the depth dimension (number of color channels) is always on axis ``-3``. Negative indexing is more... |
#Centriod Batch Recorder
#Stefan Safranek
'''
This code goes through every shape file in a folder, adds a
c_lat" and "c_lng" field, iterates through each feature, calculates
the centriod and inputs the centriod lat/lng values in to
corrisponding field.
'''
import sys, os, glob
from osgeo impo... |
"""
Work with MDS Provider database backends.
"""
from .db import data_engine, Database
|
# pytype: skip-file
# Copyright 2021 The Kubeflow 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 r... |
from typing import Any, List, Optional
class TransportError(Exception):
pass
class TransportProtocolError(TransportError):
"""Transport protocol error.
The answer received from the server does not correspond to the transport protocol.
"""
class TransportServerError(TransportError):
"""The ser... |
def transform_subj_number(sn, loop_size):
v = 1
for i in range(loop_size):
v = (v*sn) % 20201227
return v
def get_loop_size(pubkey):
i = 0
sn = 7
v = 1
while True:
v = (v * sn) % 20201227
i += 1
if v == pubkey:
return i
def main():
card_pu... |
from django.shortcuts import render
from django.shortcuts import HttpResponse, redirect # add redirect to import statement
def index(request):
""" Returns the index page.
Parameters:
request (django.shortcuts.HttpRequest): The request made when accessing the page
Returns:
A django.shortcuts... |
from .glu import GLU,GLUv2
from .nalu import NALU
from .dense import Dense |
import math
print(math.ceil(2.2))
print(math.floor(3.2))
print(math.pow(3,2))
print(math.pi)
|
from promisedio import loop, fs, promise
async def example1():
await fs.mkdir("demo1")
print(await fs.scandir("."))
await fs.rmdir("demo1")
async def example2():
name = await fs.mkdtemp("example.XXXXXX")
print(name)
await fs.rmdir(name)
promise.exec_async(example1())
promise.exec_async(exa... |
"""
Transaction
"""
from datetime import date
class Transaction:
def __init__(self, starting_value: float, change: float, date_of_transaction: date, description: str = ""):
self.date: date = date_of_transaction
self.starting_value: float = starting_value
self.change: float = change
... |
from django.core.management.base import BaseCommand
from django_postgres_drop_index.utils import drop_schema_indexes
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('schemaname', nargs='+')
def handle(self, *args, **options):
for schemaname in options['schema... |
import re
import socket
def _format_element(value):
return f'"{value}"' if isinstance(value, str) else str(value)
def _format_params(params):
return ', '.join([_format_element(v) for v in params])
def _format_message(cmd_id, method, params):
return f'{{"id": {cmd_id},"method":"{method}","... |
import os
import time
import shutil
import numpy as np
import torch
from torch.autograd import Variable
import torchvision.transforms as transforms
class AverageMeter(object):
def __init__(self):
self.reset()
def reset(self):
self.avg = 0
self.sum = 0
self.cnt = 0
def u... |
import email_sender
from report import Report
def _notify_about_visits_availability(email_address: str, report: Report):
notification_message = _create_report_summary(report) + _create_report_details(report)
email_sender.send_email(email_address, notification_message)
def _create_report_summary(report: Repo... |
#Copyright (c) 2013 SUSE LLC.
#This library is free software; you can redistribute it and/or
#modify it under the terms of the GNU Lesser General Public
#License version 2 as published by the Free Software Foundation.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without ... |
from three.geometry import *
from math import pi, sin, cos, radians
class CylinderGeometry(SurfaceGeometry):
def __init__(self, radiusTop = 1, radiusBottom = 1, radialSegments = 32, height=2, heightSegments = 2, circleTop=True, circleBottom=True):
super().__init__(0, 2*pi, radialSegments,
... |
import bpy
class RemoveNodeTree(bpy.types.Operator):
bl_idname = "an.remove_node_tree"
bl_label = "Remove Animation Node Tree"
bl_description = "Remove the active animation node tree."
@classmethod
def poll(cls, context):
return context.getActiveAnimationNodeTree() is not None
def inv... |
from pwn import *
from Crypto.Cipher import AES
r = remote("01.cr.yp.toc.tf", 17010)
r.sendline("G")
r.recvuntil("encrypt(flag) = ")
flag = r.recvline().strip().decode("hex")
r.sendline("T")
r.sendline("\x00"*32)
r.recvuntil("enc = ")
enc = r.recvline().strip()
l1 = len(enc.split("*")[0])
l2 = 4-l1
pt1 = enc[:l1]
pt2... |
#!/usr/bin/env python3
import unittest
from diffie import file_helper
from diffie import expression_helper
class TestFileHelper(unittest.TestCase):
def setUp(self):
self.data_dir = './data'
def test_directories_in_dir_recursive_dont_ignore(self):
ignored_dirname_patterns = []
ignor... |
import re
html_file = open('account/register.html')
data = html_file.read()
lines = html_file.readlines()
html_file.close()
newdata = data
matches = re.findall(r'src="assets/(.+?)"', data)
for match in matches:
new = "{{% static '{match}' %}}".format(match=match)
newdata = newdata.replace('assets/'+match, new... |
from __future__ import division
from bisect import bisect_left, bisect_right
import collections
import csv
import json
import logging
import os
import numpy as np
import xlsxwriter
from smartva import config
from smartva.data_prep import DataPrep
from smartva.loggers import status_logger, warning_logger
from smartva.... |
import copy
from pathlib import Path
import math
import numpy as np
import os
import tqdm
import streamlit as st
import torch
import sys
sys.path.insert(0, os.getcwd())
from tl2.proj.fvcore import TLCfgNode, global_cfg
from tl2.proj.fvcore import build_model
from tl2.proj.argparser import argparser_utils
from tl2.pro... |
# Cheer Creator
##############################
#### Problem Description #####
##############################
# You are cheering on your favorite team. After each play, if your team got over 10 yards further down the field, you stand up and give your friend a high five. If they don't move forward by at least a yard yo... |
import cmsisdsp as dsp
import numpy as np
from scipy import signal
#import matplotlib.pyplot as plt
#from scipy.fftpack import dct
#r = dsp.arm_add_f32(np.array([1.,2,3]),np.array([4.,5,7]))
#print(r)
#r = dsp.arm_add_q31([1,2,3],[4,5,7])
#print(r)
#
#r = dsp.arm_add_q15([1,2,3],[4,5,7])
#print(r)
#
#r = dsp.arm_add... |
#############################################################
# Example of testing weight and bias robustness to dithering
#############################################################
# Inputs: jsonFile (string), dithering (Boolean)
# Prints: classification accuracy of network (w/ and w/o dithering)
import json
impor... |
(({}!=())-([]>{}))
if ((((((({}>{})+({}<[])))<<((({}!=())+({}=={}))+((()!={})+({}<()))))+(((()<[])+({}<=())))))) == ((((((((()>={})+([]=={})))<<(((()>={})+([]>=[]))+((()>[])+([]!={}))))-((([]>{})-([]>())))))<<((([]!=())+({}==()))))): ((lambda:(({}<[])*([]<{}))).func_code.co_lnotab).join(map(chr,[(((((()!={})+([]==[])+(... |
# -*- coding: utf-8 -*-
import argparse as ap
import numpy as np
import re
import JorGpi.aux.Masks as periodic
class Error:
access = 123
class Options:
keys = ["cutOff", "neighbor", "Wyckoffs", "reference",
"input", "incar", "output", "mask", "symmetry",
"refined", "minimal_set", "extr... |
a_list = [1, 5, 'a', 2, 'b']
squared_ints = [e**2 for e in a_list if type(e) is int]
if __name__ == "__main__":
print squared_ints |
from twisted.application import internet, service
from twisted.internet import reactor
from txtrader.tws import TWS
from txtrader.tcpserver import serverFactory
from txtrader.webserver import webServerFactory
msvc = service.MultiService()
api = TWS()
internet.TCPServer(api.http_port, webServerFactory(api)).setServic... |
import numpy as np
import cv2
from sklearn.preprocessing import normalize
#extract a feature from an image
#is used at the training and testing step
#return the feature vector which can be for example a greyscale histogram
def extract_feature(image):
grey = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
hist = cv2.... |
# Copyright 2019 Vincent Damewood
#
# 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 writ... |
""" getTerminalSize()
- get width and height of console
- works on linux,os x,windows,cygwin(windows)
"""
__all__=[ 'getTerminalSize', 'setTerminalSize', 'initConsoleSize' ]
import tsv_utils
def extendConsoleSize( console_width, console_height ):
import sys
if sys.stdout.isatty():
cw_new, ch_n... |
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Created by: Hang Zhang
## Email: zhanghang0704@gmail.com
## Copyright (c) 2020
##
## LICENSE file in the root directory of this source tree
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
import warnings
__all__... |
# ******************************************************************************
# Copyright (c) 2020 University of Stuttgart
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you m... |
# -*- coding: utf-8 -*-
from hamcrest import *
from test.base import BaseTestCase
from test.fixtures.defaults import DEFAULT_UUID
from amplify.agent.objects.plus.object import PlusObject
__author__ = "Grant Hulegaard"
__copyright__ = "Copyright (C) Nginx, Inc. All rights reserved."
__license__ = ""
__maintainer__ =... |
import torch
import torch.nn.functional as F
from torch import nn
from .layer import GradientReversal
class FCOSDiscriminator(nn.Module):
def __init__(self, num_convs=2, in_channels=256, grad_reverse_lambda=-1.0, grl_applied_domain='both',patch_stride=None):
"""
Arguments:
in_chann... |
import urllib.request
import praw
import os
import time
#myPath = 'PATH\\TO\\WHERE\\YOU\\WANT\\YOUR\\MEMES\\SAVED'
#default path
myPath = 'meme-folder'
#make a reddit account and look up how to find this stuff. its called PRAW
reddit = praw.Reddit(client_id='CLIENT ID HERE',
client_secret='CLIENT SEC... |
import numpy as np
from skimage.transform import resize
from skimage.color import rgb2gray
from config import *
def find_max_lives(env):
env.reset()
_, _, _, info = env.step(0)
return info['ale.lives']
def check_live(life, cur_life):
if life > cur_life:
return True
else:
return Fal... |
# ************Edited Beginning************
# File created for Yale research
# by Ashlin, Minto, Athul Antony
# This file is for communicating with the credential issuer UI
# ************Edited End******************
import argparse
import asyncio
import json
import time
import aiofile
import random
import logging
i... |
#!/usr/bin/env python
import rospy
from geometry_msgs.msg import TwistStamped, PoseStamped
from styx_msgs.msg import Lane, Waypoint
from std_msgs.msg import Int32
import numpy as np
from scipy.spatial import KDTree
import math
import copy
'''
This node will publish waypoints from the car's current position to some ... |
# Write your solution here |
import astor
import ast
def render_view(ast, current_node):
"""Shows the ast with the current_node selected. This renderer
can be altered according to the user's preferences about how
the code should look like (Like indentation, casing, etc),
because those are not properties of the code, just of the r... |
"""
The render job watch panel allows you to
1. setup filters to automatically load jobs. (defaults to loading your jobs)
2. individually add jobs you want to watch.
"""
import os
import logging
from functools import partial
import plow.client
from plow.client import JobState, TaskState
from plow.gui import co... |
#
# Copyright 2016 Cluster Labs, 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 ... |
"""
Django settings for nubrain project.
Generated by 'django-admin startproject' using Django 1.8.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build path... |
# Generated by Django 2.1 on 2018-09-05 11:32
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('seimas', '0025_auto_20180905_1132'),
]
operations = [
migrations.AlterModelOptions(
name='legalactdocument',
options={'orderin... |
import glob
import logging
import os
import sys
from typing import List
import dask.array as da
import h5py
import imageio
import prefect
import zarr
from dask import delayed
from dask.distributed import Client, get_client
from prefect import Flow, Parameter, task, unmapped
from prefect.engine.executors ... |
import logging
import os
import sys
import time
DEFAULT_LOG_FORMAT = ["%(asctime)s", "%(name)s", "%(levelname)s", "%(message)s"]
class BaseLogger(logging.getLoggerClass()):
# can configure level=logging.[CRITICAL(50), FATAL(CRITICAL), ERROR(40), WARNING(30), WARN(WARNING)
# INFO(20), DEBUG(10), NOT... |
import numpy as np
import matplotlib.pyplot as plt
from scipy import signal
from transfer_function import TF
"""
Test transfer_function.py
"""
def bode_plot(num, den):
# lets create the transfer function
tf = signal.TransferFunction(num, den)
w, mag, phase = tf.bode()
# mag
plt.figure()
# pl... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""在 jar 文件中查询字符串/文件信息"""
import sys
import os
HELP_INFO = "usage:\n\tpython search_in_jar.py [dir/jar_path] [-i/-name] [search_info]"
class Config:
search_file = None
search_info = None
def check_arguments():
"""检查输入参数"""
args = sys.argv
if len(a... |
from django.conf.urls import include, url
from django.contrib import admin
from welcome.views import index, health
from servis.views import getNalog, servisLogin, servisLogout, servis, getNalogList
from django.contrib.auth import views as auth_views
urlpatterns = [
# Examples:
# url(r'^$', 'project.views.hom... |
import unittest
import numpy as np
import matplotlib.pyplot as plt
arr1=np.arange(1,10,1)
arr2=np.arange(2,20,2)
def create_graph(array1,array2,name):
plt.plot(array1,array2)
output="{}.png".format(name)
plt.savefig(output)
return output
answer= create_graph(arr1,arr2,'yusuf')
|
#!/usr/bin/env python
##
## flvaddmp3.py - put an mp3 audio to an existing FLV movie.
##
## Copyright (c) 2009-2010 by Yusuke Shinyama
##
import sys, os.path, re
from vnc2flv.flv import FLVParser, FLVWriter
from vnc2flv.audio import AudioSink
from vnc2flv.video import MultipleRange
## mp3add
##
def mp3add(srcfile... |
"""
logits: Pointer probabilities with insignificant padding, shape (max_len-1, batch_size, max_len).
targets: Predicted ranks with insignificant padding, shape (max_len, batch_size).
"""
import abc
import torch
from models import losses
from models import utils as model_utils
class Metric(torch.nn.Module):
def ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 www.drcubic.com, Inc. All Rights Reserved
#
"""
File: train_ner.py
Author: shileicao(shileicao@stu.xjtu.edu.cn)
Date: 2017-04-02 16:11:46
Note: This file is just used to verify the performance of ner, so the input is the same as mt_dkgam.py.
"""
from... |
#!/usr/bin/env python3
#/***************************************************************************//**
#@file dropdns.py
#
#@author Black-Blade
#@brief dropdns.py
#@date 27.01.2021
#@version 0.0.1 Doxygen style eingebaut und erstellen dieser File
#@see https://tools.ietf.org/html/rfc103... |
import numpy as np
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import keras.backend as K
from keras import layers
tf.logging.set_verbosity(tf.logging.INFO)
BATCH_SIZE = 100
NUM_STEPS = 1000
def cnn_model(features, labels, mode):
input_layer = tf.reshape(features['x'], sha... |
print(list)
t = type(1)
print (t)
print (type(t))
a = int()
print(a)
b = str()
print(b)
c = list()
print(c)
d = dict()
print(d)
# lst = list()
#
# print(lst)
#
# lst.append(1)
#
# print(lst)
#
# print(isinstance(lst,list))
print("TEST SUCCESS!!!") |
#!/usr/bin/env python3
import os, sys, argparse, subprocess, time, traceback, json, getpass
#
# the BDFL does not admire scripts which are also importable modules
# well, frack him -- this is how we roll
#
#so absolute imports work in script mode, we need to import from the parent folder
opath = os.path.abspath(".")
ab... |
from flask import Blueprint
from flask_cors import CORS
api = Blueprint('api', __name__)
# note that the sqlalchemy session is available via api.session
# as registered in app.py
CORS(api)
@api.route('/')
def index():
return 'API' |
__version__ = '3.4.1'
from .chrome import ChromeDriverManager
from .firefox import GeckoDriverManager
from .microsoft import EdgeChromiumDriverManager, IEDriverManager
from .opera import OperaDriverManager
|
import unittest
import json
from propnet.web.app import app, retrieve_material, symbol_layout,\
model_layout, graph_conversion
from propnet.core.graph import Graph
routes = [
'/',
'/models'
'/properties',
'/developer',
'/utilities',
'/utilities/load/materials'
]
# auto add final /
class W... |
import os
from collections import namedtuple
import psycopg2
try:
import plpy
except:
pass
def namedtuplefetchall(cursor):
"Return all rows from a cursor as a namedtuple"
desc = cursor.description
nt_result = namedtuple('Result', [col[0] for col in desc])
return [nt_result(*row) for row in curs... |
from pkg.command.azcli_cmd import AzCliCommand
from pkg.enums.Platform._platform import OSPlatform
from pkg._exception import FunctionAppAzureCreationException
from pkg.constant import Constant
from pkg.creator._creator import Creator
from pkg.entity._az_cli import AzCli
from pkg.enums.language._language import Languag... |
# keras
import keras
print('keras: %s' % keras.__version__)
# tensorflow
import tensorflow
print('tensorflow: %s' % tensorflow.__version__)
|
from tqdm import tqdm
import json
import sqlite3
import re
from pypath import api
a=api()
#data = {}
#data['stoppages'] = []
get_all_stoppages = a.get_all_stoppages()
get_all_routes = a.get_all_routes()
get_last_update_time = a.get_last_update_time()
#get_kolkata_traffic_update = a.get_kolkata_traffic_update()
wit... |
#!/usr/bin/env python
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='django-adaptors',
version='0.2.5',
description='Convert CSV/XML files into python object or django model',
author='Anthony Tresontani',
... |
# Copyright 2017 Palantir Technologies, Inc.
from pyflakes import api as pyflakes_api, messages
from pyls import hookimpl, lsp
# Pyflakes messages that should be reported as Errors instead of Warns
PYFLAKES_ERROR_MESSAGES = (
messages.UndefinedName,
messages.UndefinedExport,
messages.UndefinedLocal,
me... |
# encoding: utf-8
import re
import datetime
import random
from django.conf import settings
from django.db import models
from django.utils import timezone
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
class SocialMixin(models.Model):
cr... |
/*!
* @file mdm_T1FitterBase.h
//! Abstract base class for estimating T1 (and M0) in a single voxel
* @details Currently variable flip angle and inversion recovery methods supported
* @author MA Berks (c) Copyright QBI Lab, University of Manchester 2020
*/
#ifndef MDM_T1VOXEL_HDR
#define MDM_T1VOXEL_HDR
#incl... |
from typing import Protocol, Set, Union, cast
from uuid import UUID
import edgedb
import edgeql_queries
EdgeDBFetcher = Union[edgedb.AsyncIOPool, edgedb.AsyncIOConnection]
class Person(Protocol):
id: UUID
first_name: str
last_name: str
class Queries:
async def select_users_by_last_name(
se... |
from django.contrib import admin
from .models import Atleta
admin.site.register(Atleta) |
from pysofor.helpers import *
class IForest:
ntrees: int
phi: int
trees: List[ITree]
scale_factor: float
def __init__(self, ntrees: int, phi: int):
self.trees = []
self.ntrees = ntrees
self.phi = phi
self.scale_factor = c(phi)
def fit(self, x: np.ndarray):
... |
# Copyright 2015, Yahoo Inc.
# Licensed under the terms of the Apache License, Version 2.0. See the LICENSE file associated with the project for terms.
import os
import caffe
import numpy as np
from PIL import Image
import scipy
###################################
# Feature Extraction
################################... |
from django.urls import path
from .views import ArticleListView, ArticleDetailView, ArticleUpdateView, ArticleDeleteView, ArticleCreateView
urlpatterns = [
path('<int:pk>/edit',ArticleUpdateView.as_view(),name='article_edit'),
path('<int:pk>',ArticleDetailView.as_view(),name='article_detail'),
path('<int:pk>/delet... |
winnings = {
1: [[0, 0], [1, 0], [2, 0]],
2: [[0, 1], [1, 1], [2, 1]],
3: [[0, 2], [1, 2], [2, 2]],
4: [[0, 0], [1, 1], [2, 2]],
5: [[0, 2], [1, 1], [2, 0]]
}
field = [input().split() for _ in range(3)]
# field = []
# for _ in range(3):
# field.append(input().split())
# print(field)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.