content stringlengths 5 1.05M |
|---|
"""empty message
Revision ID: 8c7f8fa92c20
Revises: c925e4d07621
Create Date: 2018-08-17 13:09:27.720622
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '8c7f8fa92c20'
down_revision = 'c925e4d07621'
branch_labels = None... |
import toml
t = toml.load("Cargo.toml")
crate_version = t['package']['version']
t = toml.load("pyproject.toml")
wheel_version = t['tool']['poetry']['version']
assert crate_version == wheel_version
print(crate_version)
|
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from typing import Dict, Optional, Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
from torch.nn import Parameter
from fairseq import utils
from fairseq.modul... |
import nltk, json, pickle
from HelperFunctions import find_author
class MessageSentiment:
"""Generate mood sentiments for messages"""
MINIMUM_CERTAINTY_PROBABILITY = 0.85
TRAINING_SET_SIZE = 5000
try:
STOP_WORDS = set(nltk.corpus.stopwords.words('english'))
except:
nltk.download('stopwords')
STO... |
import os, cv2, shutil
import numpy as np
import argparse
def read_coords(coord_file):
coord_data, inds_pos = [], []
assert os.path.exists(coord_file), "File does not exist! %s"%coord_file
with open(coord_file, 'r') as f:
for ind, line in enumerate(f.readlines()):
x_coord = int(line.str... |
# Type of the message
FIELD_MSGTYPE = "t"
MSG_OP = 1 # This is an operation
MSG_REPLY = 2 # This is a regular reply
MSG_EXCEPTION = 3 # This is an exception
MSG_CONTROL = 4 # This is a control message
MSG_INTERNAL_ERROR = 5 # Some internal error happened
# Fields for operations/control
FIELD_OPTYPE = "o"
FIELD_TA... |
import logging
from typing import List, Union, Iterable
from matplotlib.pyplot import Figure
import matplotlib.ticker as mtick
import pandas as pd
from py_muvr.permutation_test import PermutationTest
from matplotlib import pyplot as plt
from py_muvr.data_structures import FeatureSelectionResults
log = logging.getLogg... |
# WEATHER RETRIEVING MICROSERVICE
# By: Cody Jennette
# CS 361 - Software Engineering I
# jennettc@oregonstate.edu
import requests
import urllib.request
# Program fetches local machine's external IP address, later used for current location:
external_ip = urllib.request.urlopen('https://ident.me').read().decode('utf8... |
# -*- coding: utf-8 -*-
# pylint: disable=no-member,invalid-name,duplicate-code
"""
REST API Documentation for the NRS TFRS Credit Trading Application
The Transportation Fuels Reporting System is being designed to streamline
compliance reporting for transportation fuel suppliers in accordance with
the ... |
import time
import requests
import threading
from filibuster.logger import debug
TIMEOUT_ITERATIONS = 100
SLEEP = 1
def num_services_running(services):
num_running = len(services)
for service in services:
if not service_running(service):
debug("! service " + service + " not yet running!"... |
class ParkingSystem(object):
def __init__(self, big, medium, small):
"""
:type big: int
:type medium: int
:type small: int
"""
self.lot = {
1: [big,0],
2: [medium,0],
3: [small,0]
}
def addCar(self, carType):
"... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... |
# test_hello_add.py
from API import app
from flask import json
def test_predict():
response = app.test_client().post(
'/predict',
data=json.dumps({"gender":["Male"],
"SeniorCitizen":["0"],
"Partner":["0"],
"Dependents":["0"],
... |
import argparse
import marshal
import os
import py_compile
from importlib import import_module
from pathlib import Path
from zipfile import ZipFile, PyZipFile
from Crypto.Cipher import AES
from loaders import register, PycZimpLoader, PyZimpLoader
def get_key(path):
if path is None:
return None
with... |
from brick_wall_build import task
@task()
def clean():
pass
# Should be marked as task.
def html():
pass
# References a non task.
@task(clean,html)
def android():
pass
|
def INSERTION_SORT(list):
for n in range(1, len(list)):
for i in range(0, len(list) - 2):
if list[i] > list[i + 1]:
tmp = list[i]
list[i] = list[i + 1]
list[i + 1] = tmp
k = 0
for i in range(0, len(list) - 2):
if list[-1] > list[i]:... |
"""placeholder
Revision ID: 57539722e5cf
Revises: c1b5abada09c
Create Date: 2019-12-03 00:55:16.012247
"""
# revision identifiers, used by Alembic.
revision = '57539722e5cf'
down_revision = 'c1b5abada09c'
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic - ... |
first_number=1+1
print(first_number)
second_number=105+10
print(second_number)
|
from flask import Flask, request, jsonify, url_for, Blueprint
from api.models import db, User
from api.utils import generate_sitemap, APIException
from flask_jwt_extended import create_access_token
from flask_jwt_extended import get_jwt_identity
from flask_jwt_extended import jwt_required
import os
api = Blueprint('api... |
import os
import package1.process as process
import package1.loadsettings as loadsettings
filenames = os.listdir("./task") #Create list of mediafiles to run through
if filenames == []:
print( "\nERROR: Task folder is empty. Put in video file(s) that you want to condense." )
quit()
if 'deletethis.txt' in file... |
import urllib
from BeautifulSoup import *
class ComputerLab():
def __init__(self, room, num, time):
self.room = room
self.num = num
self.time = time
def __repr__(self):
str = "Room: %s\nNum: %s\nTime: %s\n" % (self.room, self.num, self.time)
return str
url = "https://tomcat.itap.purdue.edu:8445/ICSWeb/Av... |
#!/usr/bin/env python
# encoding: utf-8
"""
mssql2csv.py
Created by Bill Wiens on 2010-05-04.
"""
import sys, os, getopt, getpass
import optparse
import logging
import csv
import pymssql
def main():
parser = optparse.OptionParser()
parser.description="""Python script to dump a MSSQL Server Database to folder of ... |
#! usr/bin/python3.6
"""
Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445
.. warning::
The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only.
They are there as a guide as to how the visual basic / catscript function... |
import numpy as np
import read_thres as thrs
def test_thr(check_thr):
data, x = thrs.ths_def(check_thr, threshd=1.E-5)
dat_nw = check_thr.drop(columns=["norm", "<x>", "<y>"])
x_nw = dat_nw.columns.values
assert len(x) == len(x_nw)
assert np.array_equal(x, x_nw)
assert data.equals(dat_nw)
|
import os
import yaml
import getpass
from ConfigParser import SafeConfigParser
from twisted.internet import defer, reactor
from twisted.internet.endpoints import TCP4ClientEndpoint
from os.path import abspath, expanduser
from ooni.utils.net import ConnectAndCloseProtocol, connectProtocol
from ooni import geoip
from ... |
#!/usr/bin/env python3
import pandas as pd
from tqdm import tqdm
from collections import defaultdict
import os, re, time, warnings, sys
import warnings
import pickle
from mutagen.mp3 import MP3
import numpy as np
def create_df(tsv, audio_dir):
tqdm.pandas()
df = pd.read_csv(tsv, sep='\t')
df['dur'] = df['... |
from unittest import TestCase
from cards.businesslogic.description_generator.DescriptionAppender import DescriptionAppender
class DescriptionAppenderTestCase(TestCase):
def test_sample_description1(self):
appender = DescriptionAppender()
text1 = "line1"
text2 = "line2"
appender.a... |
# Copyright 2020 Thomas Rogers
# SPDX-License-Identifier: Apache-2.0
import typing
import yaml
from direct.gui import DirectGui, DirectGuiGlobals
from direct.task import Task
from panda3d import core
from ... import constants, edit_mode
from ...tiles import manager
from ...utils import gui
from .. import descriptors... |
import tkinter as tk
import pygubu
import csv
import serial
import rospy
import numpy as np
import PID
import ctypes
from can_msgs import msg
import fcntl
import termios
import sys
import select
import subprocess
import os
from threading import Timer
import signal
from termios import tcflush, TCIOFLUSH
from rospy.core... |
# Generated by Django 2.0.3 on 2018-04-07 13:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects', '0035_auto_20180402_1507'),
]
operations = [
migrations.AddField(
model_name='project_attendees',
name='m... |
from .fpath import *
from .tree import * |
from .constants import AWSRegion
def parse_aws_region(region_arg: str) -> AWSRegion:
for region in AWSRegion:
if region_arg == region.value[0]:
return region
raise ValueError(f'Invalid AWS region {region_arg}') |
import os
import json
import dfd
extended_python_path = dfd.get_path_if_exists('extended_python_path')
environment_path = dfd.get_path_if_exists('environment')
if extended_python_path:
import site
site.addsitedir(extended_python_path)
if environment_path:
with open(environment_path) as env_file:
... |
from typing import Optional, Tuple
from munch import Munch
import logging
from api.jwt import Jwt, JwtPayload
ADMIN_AUTHORITY = "ADMIN"
BASIC_AUTHORITY = "BASIC"
class Auth:
def __init__(self, event):
self._event = Munch.fromDict(event)
self.jwt = Jwt()
@property
def auth_header(self) -... |
import choraconfig, re, sys, os.path
def master_theorem_bounds_callout(params) :
if "logpath" not in params :
print "ERROR: duet_bounds_callout was called without a path"
sys.exit(0)
#output = ""
with open(params["logpath"],"rb") as logfile : output = logfile.read().strip()
return outp... |
import numpy as np
class Territory:
def __init__(self,name,adjacent_territories,occupying_player=None,troops=None):
self.name = name
self.adjacent_territories = adjacent_territories
self.occupying_player = occupying_player
self.troops = troops
def __str__(self):
return ... |
# This file will contain the entry point where you load the data and init the variables
|
from mars_profiling.report.presentation.core.collapse import Collapse
from mars_profiling.report.presentation.core.container import Container
from mars_profiling.report.presentation.core.duplicate import Duplicate
from mars_profiling.report.presentation.core.frequency_table import FrequencyTable
from mars_profiling.rep... |
from django.urls import path, include
from users.api.loginviews import LoginAPI
urlpatterns = [
path('', LoginAPI.as_view())
] |
def corrupt_part_data_on_disk(node, table, part_name):
part_path = node.query(
"SELECT path FROM system.parts WHERE table = '{}' and name = '{}'".format(
table, part_name
)
).strip()
corrupt_part_data_by_path(node, part_path)
def corrupt_part_data_by_path(node, part_path):
... |
#!/usr/bin/python3
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
import numpy as np
import pandas as pd
import bbi
import pysam
##only mappabilty_by_idx called from top level
def load_chromsizes(f_bw):
chroms = bbi.chromsizes(f_bw)
chroms.pop('chrM')
chroms.pop('chrX')
chroms.pop('chrY')
return chroms
def mappability_by_window(f_mapp, window, overlap=0):
ch... |
import unittest
import io
from contextlib import redirect_stdout
from rdflib import Namespace, Graph
from sparqlslurper import SlurpyGraph
from sparqlslurper._graphdb_slurpygraph import GraphDBSlurpyGraph
endpoint = 'https://graph.fhircat.org/repositories/fhirontology'
class SparqlParametersTestCase(unittest.TestC... |
import pathlib
import subprocess
import signal
import time
import os
import sys
import argparse
def main():
parser = argparse.ArgumentParser(prog="run-snet-services")
parser.add_argument("--daemon-config-path", help="Path to daemon configuration file", required=False)
args = parser.parse_args(sys.argv[1:]... |
from django.urls import path
from.import views
urlpatterns = [
path('index',views.index,name='Iniciowarehouse')
] |
# coding=utf-8
from collections import namedtuple
CamouflageInfo = namedtuple('CamouflageInfo', ['id', 'schemeId'])
|
lua_1 = """
local k = 1/math.sqrt(0.05)
local val = tonumber(ARGV[1])
local old_vals = redis.call('get',KEYS[1])
local new_vals = {}
if (old_vals) then
old_vals = cjson.decode(old_vals)
new_vals["count_1"] = old_vals['count_1'] + 1
local delta = val - old_vals["me... |
import time
from django.core.management.base import BaseCommand
from django.db import transaction
import database_locks
class Command(BaseCommand):
help = 'Lock it!'
def add_arguments(self, parser):
parser.add_argument('lock_name', help='lock name to be used')
parser.add_argument(
... |
import logging.config
import uvicorn
from fastapi import FastAPI, Request, status
from fastapi.encoders import jsonable_encoder
from dotenv import load_dotenv
from fastapi.responses import JSONResponse, PlainTextResponse
from starlette.exceptions import HTTPException as StarletteHTTPException
from fastapi.exceptions i... |
import io
import nextcord
async def send_code_block_maybe_as_file(ctx, text):
"""
Sends a code block to the current context.
If it's too long to fit in a single message, it will
instead be sent as a file.
"""
if len(text) > 2000:
file = io.StringIO()
file.writelines(text)
... |
import itertools
import binascii
def detect_ecb(s,klen):
blocks = [s[i:i+klen] for i in range(0,len(s),klen)]
pairs = itertools.combinations(blocks,2)
score = 0
for p in pairs:
if p[0] == p[1]:
score += 1
return score > 0
def main():
f = open('8.txt', 'r')
data = f.read()
lines = data.split('\n')... |
# Copyright 2017 The Sonnet Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import Counter, defaultdict
def load_fish(file):
with open(file) as f:
fish = f.read().strip()
fish = fish.split(",")
fish = [int(i) for i in fish]
return fish
def get_num_fish(fish, days):
counts = Counter(fish)
while ... |
import chainer
import chainer.functions as F
import chainer.links as L
import inspect
import ast, gast
import itertools
from contextlib import ExitStack
from chainer_compiler.elichika.parser import config
from chainer_compiler.elichika.parser import nodes
from chainer_compiler.elichika.parser import values
from chaine... |
import insightconnect_plugin_runtime
from .schema import GetAlertsInput, GetAlertsOutput, Input, Output, Component
# Custom imports below
class GetAlerts(insightconnect_plugin_runtime.Action):
def __init__(self):
super(self.__class__, self).__init__(
name='get_alerts',
des... |
from pydantic import BaseModel
from typing import Optional
import typing as T
class Member(BaseModel):
user_id: int
nickname: str
card: T.Optional[str]
sex: str
age: int
area: str
level: str
role: T.Optional[str]
title: T.Optional[str]
# 以下是 getGroupMemberInfo 返回的更多结果
group_... |
import config as config
import utils.log as log
# import tests cases
import test_api_config
import test_api_crush_map
import test_api_crush_node
import test_api_crush_rule_set
import test_api_crush_rule
import test_api_crush_type
import test_api_logs
import test_api_mon
import test_api_pool
import test_api_request
imp... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 - 2022 -- Lars Heuer
# All rights reserved.
#
# License: BSD License
#
"""\
EPC QR Codes.
Test against issue <https://github.com/heuer/segno/issues/55>.
"""
from __future__ import absolute_import, unicode_literals
import decimal
import pytest
from segno.helpers import mak... |
import rope.base.builtins
import rope.base.codeanalyze
import rope.base.pynames
from rope.base import ast, exceptions, utils
from rope.refactor import patchedast
class Scope(object):
def __init__(self, pycore, pyobject, parent_scope):
self.pycore = pycore
self.pyobject = pyobject
self.pare... |
import websocket
import json
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM) # set board mode to Broadcom
GPIO.setup(17, GPIO.OUT) # set up pin 17 TV
GPIO.setup(18, GPIO.OUT) # set up pin 18 Lights
GPIO.setup(22, GPIO.OUT) # set up pin 12 A/C
GPIO.setup(27, GPIO.OUT) # set up pin 27 Alarm
GPIO.output(17, 0) # ... |
from replays_fetching.replay_fetcher import ReplayFetcher
replay_fetcher = ReplayFetcher()
replays = replay_fetcher.get_replays()
for index in range(len(replays)):
print('Replay #{0}: '.format(index) + str(replays[index]))
|
# 2.3.5 Example: Range Class
class Range:
"""A class that mimic's the built-in range class."""
def __init__(self,start,stop=None,step=1):
"""Initialize a Range instance.
Semantics is similar to built-in range class.
"""
if step == 0:
raise ValueError('step cannot b... |
# Copyright 2018 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 ... |
#
# Generated with RIFLEXDynamicCalculationParametersBlueprint
from dmt.blueprint import Blueprint
from dmt.dimension import Dimension
from dmt.attribute import Attribute
from dmt.enum_attribute import EnumAttribute
from dmt.blueprint_attribute import BlueprintAttribute
from sima.sima.blueprints.moao import MOAOBluepr... |
# -*- coding: utf-8 -*-
from permutive.exceptions import PermutiveApiException
from .util import none_default_namedtuple
from .base import Resource
User = none_default_namedtuple('User', 'id, custom_id, properties, updated')
class UserResource(Resource):
def create(self):
"""
Creates a new user ... |
# control.applications - Controller for comodit Applications entities.
# coding: utf-8
#
# Copyright 2010 Guardis SPRL, Liège, Belgium.
# Authors: Laurent Eschenauer <laurent.eschenauer@guardis.com>
#
# This software cannot be used and/or distributed without prior
# authorization from Guardis.
from __future__ import a... |
foods = ('yu','wa','fan','cai','tang')
for foods2 in foods:
print(foods2)
foods = ('yu','wa','fan','cai','tang')
print(foods)
foods = ('yu','wa','fan','cai','tang','xia')
print(foods)
# 4 |
import dojo.dojo as d
def test():
print(dir(d))
assert(d.test_function() is True)
|
"""
Unittests for staros plugin
Uses the mock_device.py script to test the plugin.
"""
__author__ = "dwapstra"
import unittest
from unicon import Connection
from unicon.core.errors import SubCommandFailure
class TestStarosPluginConnect(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.c... |
# -------------------------------------------------------------------------------
# Copyright (c) 2017, Battelle Memorial Institute All rights reserved.
# Battelle Memorial Institute (hereinafter Battelle) hereby grants permission to any person or entity
# lawfully obtaining a copy of this software and associated docum... |
import binascii
from web3.auto import w3
with open("/home/koshik/.ethereum/rinkeby/keystore/UTC--2018-06-10T05-43-22.134895238Z--9e63c0d223d9232a4f3076947ad7cff353cc1a28") as keyfile:
encrypted_key = keyfile.read()
private_key = w3.eth.account.decrypt(encrypted_key, 'koshik93')
print(binascii.b2a_hex(private_k... |
# Copyright 2021 Ian Eborn
# A sub-class of the "SimpleThirdPersonCamera" class, providing one implementaton of
# the collision-related elements of the camera-system.
#
# Specifically, this class primarily implements the "setupCollision" and "getNearestCollision" methods,
# using Panda3D's built-in collision system.
#... |
from hms_workflow_platform.core.queries.base.base_query import *
class EncounterQuery(BaseQuery):
def __init__(self, site):
super().__init__()
self.adapter = self.get_adapter(site)
self.query = self.adapter.query
self._site = site
def encounter_create(self, date_obj):
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Email: chenwx716@163.com
# DateTime: 2019-08-06 22:08:14
__author__ = 'chenwx'
import json
import requests
app_url = "http://127.0.0.1:9002"
req_url = app_url + "/api/v2/local"
json_headers = {"content-type": "application/json"}
class ShowLocal(object):
"""docstr... |
#42) Coded triangle numbers
#The nth term of the sequence of triangle numbers is given by, tn = (1/2)*n*(n+1); so the first ten triangle numbers are:
#1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...
#By converting each letter in a word to a number corresponding to its alphabetical position and adding these values we form a wo... |
# Authors: Jose C. Garcia Alanis <alanis.jcg@gmail.com>
#
# License: BSD-3-Clause
# -- WIP -- {
fig, ax = plt.subplots()
im = ax.imshow(np.median(channel_corrs, axis=0), cmap="YlGn", )
# Create colorbar
cbar = ax.figure.colorbar(im, ax=ax)
cbar.ax.set_ylabel('Channels correlation', rotation=-90, va="bottom")
# Show al... |
class Aws_Utils:
@staticmethod
def run_code_in_lambda(code):
file_Path = 'temp_code/code.py'
temp_Dir = 'temp_code'
zip_file = 'temp_code.zip'
def create_temp_files():
if not os.path.exists(temp_Dir):
os.mkdir(temp_Dir)
with open(file_P... |
#
# resolution(KB, q): Given a propositional knowledge base and query, return
# whether the query can be inferred from the knowledgebase using resolution.
# The implementation is more efficient than pl_resolution in the AIMA code.
# KnowledgeBasedAgent: An abstract class that makes decisions to navigate
# through a w... |
from django.db import models
from ...apps import UFDLCoreAppConfig
class LicenceQuerySet(models.QuerySet):
"""
A query-set of data-set licences.
"""
pass
class Licence(models.Model):
"""
The licence for a data-set.
"""
# The name for the licence
name = models.CharField(max_lengt... |
"""
This script contains all the functions related to the model
"""
import tensorflow as tf
import numpy as np
import random
from math import ceil
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Flatten, Conv2D, LeakyReLU, Dropout
from game import MOVES_POSSIBLE, ALL_BLOCK_PO... |
from Templates.make_excel import make2exel
import Main.Tenderplan.participants2excel as p2ex
import openpyxl
excel_name = r'E:\Лиды_экспорт.xlsx'
make2exel(
['Название компании', 'ИНН', 'Список выигранных тендеров', 'Список остальных тендеров c участием'], excel_name)
wb = openpyxl.load_workbook(excel_name)
she... |
#!/usr/bin/env python
from HTMLParser import HTMLParser
import re
import os
import sys
import string
class Html2MarkdownParser(HTMLParser):
def __init__(self):
self._markdown = ''
self._tag_stack = []
self._tag_attr_data = {}
self._handled_tag_body_data = ''
self._converti... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function
def pe5(n=20):
"""
What is the smallest number divisible by each of the numbers 1 to 20?
>>> pe5()
232792560
"""
if n < 2:
return 1
p = 2
m = [2]
for x in range(3, n + 1):
... |
import aiohttp
import argparse
import asyncio
import ssl
from urllib.parse import urlsplit
from bs4 import BeautifulSoup
from sitemap.utils import write_text_sitemap, clean_link
# Have these at global scope so they remain shared.
urls = []
results = []
def sitemap(url, verbose=False):
""" Main mapping functio... |
import list_wifi_distances
import requests
def report(rogue_mac):
pi_id = 8
distance = list_wifi_distances.get_network(rogue_mac.upper())
print(distance)
requests.post("http://10.10.10.93:8000/report", data={'id':pi_id, 'dist': distance})
|
import logging
from cellfinder.figures import heatmap
def run(args, atlas, downsampled_shape):
logging.info("Generating heatmap")
heatmap.run(
args.paths.downsampled_points,
atlas,
downsampled_shape,
args.brainreg_paths.registered_atlas,
args.paths.heatmap,
smo... |
# Generated by Django 3.1.2 on 2021-04-08 02:58
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('bpmn', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Diagram',
fi... |
"""Aramaic Bible Module tool"""
from pathlib import Path
import click
from abm_tools.sedra.bible import parse_sedra3_bible_db_file
from abm_tools.sedra.db import from_transliteration, parse_sedra3_words_db_file, sedra4_db_word_json
@click.group()
def tool():
"""Tools for generating Aramaic bible software module... |
#!/usr/bin/env python
>>> import snmp_helper
c. Create a script that connects to both routers (pynet-rtr1 and pynet-rtr2) and prints out both the MIB2 sysName and sysDescr.
|
##
##
##
import queue
class BundGrammarQueue:
def __init__(self):
self.q = {}
self.default_queue_name = "__root__"
self.createLIFO("__root__")
def queue(self, name, auto_create=True):
if name not in self.q:
if auto_create:
self.default_queue_name = na... |
import vcr
from umm.cli.client import umm_request
from umm.server.utils import setup_folder
@vcr.use_cassette()
def test_umm_request():
setup_folder()
resp = umm_request([])
assert resp == {"commands": []}
|
"""
Copyright (c) 2016-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
"""Fabric commands for pack... |
def fun(x: int) -> str:
return str(x)
class SomeClass:
def meth(self, x: int) -> str:
return str(x)
|
from typing import (
Any,
Callable,
Dict,
Iterable,
Iterator,
NamedTuple,
Optional,
Set,
)
from contextlib import contextmanager
import pendulum
import prefect
from prefect.core import Edge, Flow, Task
from prefect.engine.result import Result
from prefect.engine.results import ConstantR... |
''' Menu Module
Module to deal with menus and buttons. Used initially for start menu.
Can be extended if required to create pause and other menues throughout
the game.
@author: Robert (unless stated otherwise)
'''
import pygame
from classes.text import Text
from classes.sfxbox import SFXBox
button_... |
from loguru import logger
import cv2
import os
import pickle
import typing
import numpy as np
from sklearn.svm import LinearSVC
from stagesepx.classifier.base import BaseModelClassifier
from stagesepx import toolbox
from stagesepx.video import VideoFrame
from stagesepx import constants
class SVMClassifier(BaseModelC... |
from fastapi import APIRouter
from client.api.api_v1.endpoints import twitter, disk_space
router = APIRouter()
router.include_router(disk_space.router, prefix="/diskspace", tags=["diskspace"])
router.include_router(twitter.router, prefix="/twitter", tags=["twitter"])
|
import socket
import imagezmq
import cv2
import time
sender = imagezmq.ImageSender(connect_to='tcp://localhost:5555')
sender_name = socket.gethostname() # send your hostname with each image
# image = open("C:/Users/H S/PycharmProjects/Kivy/Untitled.png", 'rb')
image = cv2.imread("C:/Users/H S/PycharmProjects/Kivy/Unt... |
import zerorpc
client = zerorpc.Client()
client.connect("tcp://127.0.0.1:4242")
num = 7
result = client.double(num)
print("Double", num, "is", result)
|
from Components.Converter.Converter import Converter
from Components.config import config
from Components.Element import cached
from Poll import Poll
from enigma import eDVBVolumecontrol
class ArcticVolume(Poll, Converter):
def __init__(self, val):
Converter.__init__(self, val)
Poll.__... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.