content stringlengths 5 1.05M |
|---|
"""
CreateFloors
"""
__author__ = 'Danny Bentley - danny_bentley@hotmail.com'
__twitter__ = '@danbentley'
__Website__ = 'http://dannybentley.tech/'
__version__ = '1.0.0'
"""
Sample on how to create multiple floors.
Use this sample along with the Video on Youtube.
"""
import clr
# import ProtoGeometry
clr.AddReference(... |
__author__ = "Christian Kongsgaard"
__license__ = 'MIT'
# -------------------------------------------------------------------------------------------------------------------- #
# IMPORTS
# Modules
import mongoengine
from datetime import datetime
# RiBuild Modules
import delphin_6_automation.database_interactions.dat... |
from utils.alter import *
from utils.db import exec_return_query, exec_void_query, load_query
from utils.s3 import list_bucket_contents
from abc import *
class QueryBuilder(metaclass=ABCMeta):
# def __init__(self, table_name):
def __init__(self, schema_name='bobsim_schema', table_name=None, att_name=None,
... |
from __future__ import annotations
from spark_auto_mapper_fhir.fhir_types.uri import FhirUri
from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode
from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType
# This file is auto-generated by generate_classes so do not edi... |
import os
import psutil
_vmb_data = []
_pid = 0
def _VmB():
'''Private.
'''
process = psutil.Process()
mem_info = process.memory_info()
data = [mem_info.rss, mem_info.vms]
# for key in keys:
#
# try:
# i = v.index(key)
# except ValueError:
# contin... |
"""
Test matching module.
"""
import cog.matching
def test_substr_ind():
assert cog.util.substr_ind('ale', 'alex') == [0, 3]
assert cog.util.substr_ind('ALEX'.lower(), 'Alexander'.lower()) == [0, 4]
assert cog.util.substr_ind('nde', 'Alexander') == [5, 8]
assert not cog.util.substr_ind('ALe', 'Alexan... |
import asyncio
import collections
import logging
from elasticsearch.connection_pool import RoundRobinSelector
logger = logging.getLogger('elasticsearch')
class ConnectionPool:
def __init__(self, connections, *, dead_timeout=60, timeout_cutoff=5,
selector_factory=RoundRobinSelector,
... |
from fastapi import APIRouter
from fastapi import Depends
from auth.auth import auth_wrapper
from schema import Transfer as TransferSchema
from db import SQLITE_DB
from db import Person
from db import Card
from db import BankStatement
from datetime import datetime
transfer = APIRouter()
@transfer.post("/transfer"... |
import sys,os
import subprocess
import time, glob
L=2000
sim_prefix = '/20140820_seqs'
dt=100
valdt = 1
jobcount = 0
# inner loops = 2*2*4*1*3*4 = 2**7 * 3 approx 400
n=10
i=0
D=0.5
istep=0
first_gen = 5000
last_gen = 25000 #min(5000 + istep*(i+1)*dt, 24800)
dir_list= glob.glob('../data_new/N_10000_L_2*_sdt_1*')
for y... |
import numpy as np
x = np.arange(3, 9)
z = x.reshape(2, 3)
print(z[1][1])
x = np.arange(1, 5)
x = x*2
print(x[:3].sum())
|
# -*- coding: utf-8 -*-#
# -------------------------------------------------------------------------------
# Name: backtrace
# Description:
# Author: zhengyiming
# Date: 2020/10/10
# -------------------------------------------------------------------------------
# from labuladong
# 回溯算法的框架
# 🛩其实... |
sec = range(10)
def gen(sec):
for valor in sec:
yield valor
|
# Distributed under the MIT License.
# See LICENSE.txt for details.
import numpy as np
# Test functions for normal dot fluxes
def spacetime_metric_normal_dot_flux(spacetime_metric, pi, phi, gamma1, gamma2,
lapse, shift, inverse_spatial_metric,
... |
import numpy as np
class Layer():
def __init__(self, in_size, out_size, lam, name):
self.in_size = in_size
self.out_size = out_size
self.name = name
self.isActivation = (False if name is "linear" else True)
if not self.isActivation:
# Weights
self.W ... |
#!/usr/bin/python3
import sys
from PySide2.QtWidgets import *
from PySide2.QtGui import *
def main():
app = QApplication(sys.argv)
e1 = QLineEdit()
e1.setFont(QFont("Arial", 24))
e1.show()
app.exec_()
if __name__ == '__main__':
main()
|
from .. import app, cache
from ..dash_app_model import arima_model, arima_df, fare_arima_df, start_index, end_index, today
import plotly.graph_objs as go
import pandas as pd
from dash.dependencies import Input, Output, State
from datetime import datetime
import numpy as np
from .graph_utilities import *
@app.callback(... |
"""시뮬레이션에 사용되는 모듈들을 연동하여 시뮬레이션을 운영하는 SimulationOperator 클래스"""
import time
from .log_manager import LogManager
from .operator import Operator
class SimulationOperator(Operator):
"""각 모듈을 연동해 시뮬레이션을 진행하는 클래스"""
def __init__(self):
super().__init__()
self.logger = LogManager.get_logger(__class... |
board = []
for loop in range(0, 5):
treta = ["O"] * 5
board.append(treta)
print(board)
|
from __future__ import annotations
from types import MethodType
from copy import copy
from mongoengine import ValidationError
__all__ = ('Validator',)
class ValidatorMeta(type):
def __new__(cls, name, bases, attrs):
def wrap(f, m):
def check(self, value):
if not f(value):
... |
from impedance.models.circuits import BaseCircuit, CustomCircuit, Randles
import json
import matplotlib.pyplot as plt
import numpy as np
import os
def test_BaseCircuit():
initial_guess = [0.01, 0.02, 50]
base_circuit = BaseCircuit(initial_guess)
assert base_circuit.initial_guess == initial_guess
def te... |
# -*- coding: utf-8 -*-
from django.contrib import admin
from .models import WatsonComponents, WatsonAccess, WatsonLogs
@admin.register(WatsonComponents)
class AssistantComponentsAdmin(admin.ModelAdmin):
list_display = (
'pk_watson_components', 'dsc_comp', 'insert_date', 'update_date',
)
list_filt... |
import csv
'''
data = [[["Peter Lovett", "plovett@uoregon.edu"], ["Cathy Webster", "cwebster@uoregon.edu"]], [["Kathryn Lovett", "klovett2@uoregon.edu"], ["Wyatt Reed", "wyatt@uoregon.edu"], ["Bob Bogus", "bbogus@uoregon.edu"]]]
'''
def csv_writer(data, path):
with open(path, "w", newline='') as csv_file:
... |
"""Convert from .npy to .js dictionaries.
Usage:
convert.py <input_path> [options]
convert.py <input_path> <label_path> [options]
convert.py dir <raw_dir> <label_dir> [options]
Options:
--transform Whether or not
--out=<out> Directory or path for output [default: ./data/js]
--variable=... |
import sys
import os
dirpath = os.getcwd()
sys.path.append(dirpath)
sys.path.append(dirpath+"\\..\\")
if getattr(sys, "frozen", False):
os.chdir(sys._MEIPASS)
import engine
import game.data.components
import game.data.buttonCallbacks as buttonCallbacks
def main():
app = engine.getApp()
app.initGame("data/main.j... |
import glob
import logging
import os
import re
import shutil
import tempfile
import hydra
import numpy as np
import pyparsing as pp
from edalize import *
from hydra.core.hydra_config import HydraConfig
from hydra.utils import get_original_cwd
from omegaconf import DictConfig, OmegaConf
from do_blink.edalize.vivado im... |
import stactools.core
from stactools.bc_dem.stac import create_collection, create_item
__all__ = ['create_collection', 'create_item']
stactools.core.use_fsspec()
def register_plugin(registry):
from stactools.bc_dem import commands
registry.register_subcommand(commands.create_bcdem_command)
__version__ = ... |
import requests
from bs4 import BeautifulSoup
from Card import Card
class Character:
name = ""
cards = list()
link = ""
def __init__(self, title, link):
self.name = title
self.link = link
def __str__(self):
return "<" + self.name + " , " + self.link + ">"
def print_c... |
#!/usr/bin/env python3
##########################################################################################
# Developers: Icaro Alzuru and Aditi Malladi
# Project: HuMaIN (http://humain.acis.ufl.edu)
# Description: Simulated version of the regular expression Event Date extraction.
###########################... |
import argparse
import asyncio
import datetime
import gzip
import json
import sys
import zlib
import aiohttp
import influxdb
import os
import time
ANALYSIS_DIRECTORY = "../analysis/kairosdb"
BENCHMARK_TEST = "latency_meter"
QUERY_TYPE_LIST = {
'count': json.dumps({
"start_absolute": 154... |
from unittest import TestCase
from CTCI.Ch2_Linked_Lists.common.SinglyLinkedList import Empty
from CTCI.Ch2_Linked_Lists.exercises.CTCI_Ch2_Ex1 import RemoveDupsSinglyLinkedList
class TestRemoveDupsSinglyLinkedList(TestCase):
def setUp(self):
self.sll = RemoveDupsSinglyLinkedList()
def test_remove_d... |
import numpy as np
def calculate_distance(point1:tuple, point2:tuple) -> float:
"""
Description:
Calculates the distance between two points
Arguments:
- point1 : `tuple` first point
- point2 : `tuple` second point
Returns:
- `float` : dista... |
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 3 20:50:16 2018
@author: jimmybow
"""
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
import visdcc
app = dash.Dash()
app.layout = html.Div([
visdcc.Network(id = 'net',
... |
import os
import base64
import posixpath
import logging
import requests
from constance import config
from urllib.parse import urljoin, quote, unquote
import xml.etree.ElementTree as ET
from django.http import HttpResponse
from rest_framework import status
from rest_framework.views import APIView
from rest_framework... |
from oic.utils.time_util import in_a_while
__author__ = 'roland'
RT = {"C": "code", "D": "client cred", "T": "token"}
ATTR = ["profile"]
def to_profile(session, representation="list"):
p = session["profile"].split(".")
prof = [RT[p[0]]]
if representation == "list":
return prof
elif represe... |
from abc import ABC
import grpc
from anilius.core.permission import Permission
from anilius.core.serializer import Serializer
from anilius.core.serializer_field import SerializerField
from anilius.utils.jwt import decode_jwt
from jwt import InvalidAlgorithmError, InvalidSignatureError
class Controller(ABC):
perm... |
import json
import yaml
from aatest import Unknown
from aatest.func import factory as aafactory
__author__ = 'roland'
class MissingParent(Exception):
pass
def _get_cls(name, factories, use=''):
if use:
try:
cls = factories[use](name)
except Unknown:
pass
else... |
################################
# ARIMA DEVELOP AND DIAGNOSTIC #
################################
# This code takes raw (and corrected if applicable) data, applies an ARIMA time series model, and identifies anomalies.
import rules_detect
import anomaly_utilities
import modeling_utilities
import matplotlib.pyplot as p... |
import asyncio
import base64
import json
import logging
import os
from time import sleep
from typing import Tuple
from aiohttp import (
web,
ClientRequest,
)
from qrcode import QRCode
from python.agent_backchannel import (
AgentBackchannel,
RUN_MODE,
)
from python.utils import (
log_msg,
prom... |
"""
Django settings for Twitter Scraper App project.
Generated by 'django-admin startproject' using Django 3.1.1.
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/
"""
... |
# Generated by Django 3.1.13 on 2021-10-15 23:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('menus', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='module',
name='name',
fiel... |
"""
==================================================
Transport Metabolism and Gene Expression Composite
==================================================
"""
import os
import argparse
from vivarium.library.units import units
from vivarium.core.process import Generator
from vivarium.core.emitter import path_timeser... |
"""
Description:
Author: Jiaqi Gu (jqgu@utexas.edu)
Date: 2021-06-06 01:11:12
LastEditors: Jiaqi Gu (jqgu@utexas.edu)
LastEditTime: 2021-06-06 01:11:12
"""
from __future__ import print_function
import os
from os.path import join
import scipy.io
from torchvision import transforms
from torchvision.datasets import Visio... |
#!/usr/bin/env python3
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright 2012 California Institute of Technology. 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.
# Yo... |
import feedparser
import sqlite3, psycopg2
import datetime, time
import os
import string
from random import choice, randint
import lxml.html
import uuid
import random
def fill_start_data_news():
#db = sqlite3.connect(BASE_DIR+"\\db.sqlite3")
db = psycopg2.connect("dbname='test' user='testuser' host='' password... |
import requests
import sys
class API(object):
def __init__(self, token, cache):
self.addr = 'https://api.vscale.io/v1/'
self.token = token
self.cache = cache
self.cache.location = self._closest_location() or self.cache.location or 'spb0'
self.cache.plan = self.cache.plan o... |
# coding: utf-8
"""
Upbit Open API
## REST API for Upbit Exchange - Base URL: [https://api.upbit.com] - Official Upbit API Documents: [https://docs.upbit.com] - Official Support email: [open-api@upbit.com] # noqa: E501
OpenAPI spec version: 1.0.0
Contact: ujhin942@gmail.com
Generated by: https:... |
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import Type
from audio_source.countable_pcm_volume_transformer import CountablePCMVolumeTransformer
class IPCMSource(ABC, CountablePCMVolumeTransformer):
'''Interface representing a song.
Classes implementing this interf... |
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext_lazy as _
from imagekit.models import ProcessedImageField
from imagekit.processors import ResizeToFill
from .amazon import Amazon
class Continent(models.Model):
... |
# Generated by Django 2.0.9 on 2018-10-08 20:43
import colorfield.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0002_auto_20181008_2031'),
]
operations = [
migrations.AddField(
model_name='blogindexpage',
... |
import argparse
import pickle
import numpy as np
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
from matplotlib import pyplot as plt
import sys
import torch
from test_dl_model import get_predictions_from_FNC_1_Test
def parse_cmd_line_args():
parser = argparse.ArgumentParser(... |
from blspy import AugSchemeMPL, G1Element, G2Element, PrivateKey
from src.types.blockchain_format.coin import Coin
from src.types.blockchain_format.sized_bytes import bytes32
from src.util.ints import uint32, uint64
from src.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import puzzle_for_pk
def create_puzzleha... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2007,2009,2011 Zuza Software Foundation
#
# This file is part of translate.
#
# translate is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either vers... |
import datetime
import io
import discord
from discord.ext import commands, tasks
import constants
NO_DELETE_ROLES = (
516369428615528459, # DDB Staff
# 516370028053004306 # Moderator
)
# data schema:
# autodelete.json: dict int->int channel->days
class AutoDelete(commands.Cog):
def __init__(self, bo... |
"""
PFReader output module
Uses tablib
"""
import tablib
from pfreader.pfreader import data_classess
from . import exceptions
def get_output(lox_data):
for elem in data_classess:
try:
if hasattr(elem, "data_label"):
data = lox_data[elem.data_label]
else:
... |
# -*- coding:gb2312 -*-
import sys
reload(sys)
sys.setdefaultencoding( "utf-8" )
import os, hashlib,shutil,codecs
import numpy as np
from collections import defaultdict
from collections import OrderedDict
def VisitDir(arg,dirname,names):
for filespath in names:
name = os.path.join(dirname,files... |
import pytest
import requests
from bs4 import BeautifulSoup
def test_templates_loaded(hub):
"""
Tests if every hub has loaded their custom login template.
It checks that each hub's login page has their configured institutional logo.
"""
hub_domains = hub.spec['domain'] if isinstance(hub.spec['doma... |
from rest_framework import status
from rest_framework.permissions import AllowAny
from rest_framework.response import Response
from rest_framework.views import APIView
from .renderers import UserJSONRenderer
from .serializers import (
LoginSerializer
)
class LoginAPIView(APIView):
permission_classes = (AllowA... |
from PIL import Image
import cv2
import time
camera = cv2.VideoCapture(0)
time.sleep(0.2)
return_value, image = camera.read()
cv2im = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
pilim = Image.fromarray(cv2im)
del camera
bmp = pilim.convert('L').resize([60, 60])
bmp.save("Check\phand.jpg")
|
# Copyright 2017 The TensorFlow 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 applica... |
from collections import namedtuple
from serial.tools import list_ports
from unittest.mock import MagicMock
from mpf.exceptions.runtime_error import MpfRuntimeError
from mpf.platforms import autodetect
from mpf.tests.MpfTestCase import MpfTestCase
WINDOWS_PORTS = ['TEST', 'FOO', 'COM0', 'COM1', 'COM2', 'COM3', 'tty']
... |
# vim: set encoding=utf-8
# Copyright (c) 2016 Intel 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 require... |
"""
Create `Grabber` instances for list of resources we need to grab information
from.
"""
import importlib
import yaml
import settings
from utils import get_logger
from crawler.models.resource import Resource
from crawler.scheduled_task import ScheduledTask
from crawler.proxy import Proxy
from crawler.cache import C... |
from jenkinsapi import jenkins
username = "" #add username
password = "" #add your password
URL = "http://ccp-tests.xenrt.xs.citrite.net/jenkins"
j = jenkins.Jenkins(URL, username, password)
jobclient = j.get_job('Greenfield-Regression-Multi')
#p = jobclient.get_last_build().get_resultset()._data
p = jobclient.get_... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-05-31 23:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('breach', '0022_auto_20170203_2117'),
]
operations = [
migrations.AddField(
... |
from flask import Flask, render_template, make_response, request, send_file
from selenium import webdriver
from selenium.webdriver.support import expected_conditions as EC
import os, shutil
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
... |
import json
from collections import namedtuple
LibraryDs = namedtuple('LibraryDs', ['name', 'version'])
class InstalledLibrariesOutputLinesPostProcessor(object):
INSTALLED_LIBRARIES_AFTER_MODIFICATIONS_TASK = 'Final list of all installed libraries in the venv'
def __init__(self):
self.stop_line_proc... |
class MapperTransform(object):
"""
Abstract base class for all mapper transforms.
Subclasses should implement `__call__` method.
Internal Meta class supports the following properties:
- fields: mapper fields to be given as arguments to the __call__ method, defaults to all the fields.
"""
... |
# -*- coding: utf-8 -*-
"""
Module: rushhour_solver
File: parser.py
Creator: Nick Geense
Date: 23-11-2016
Rush Hour file parser for analysing board text representations.
Rush Hour Parser should receive a valid filename
and after all checks have passed return a Board object.
"""
import os.path
import logging
from... |
"""
Demonstrates similarities between pcolor, pcolormesh, imshow and pcolorfast
for drawing quadrilateral grids.
"""
import matplotlib.pyplot as plt
import numpy as np
# make these smaller to increase the resolution
dx, dy = 0.15, 0.05
# generate 2 2d grids for the x & y bounds
y, x = np.mgrid[slice(-3, 3 + dy, dy),... |
from ParallelCoordinates import ParallelCoordinates
import pandas as pd
import plotly.plotly as py
import os
py.sign_in('DemoAccount', '2qdyfjyr7o')
df = pd.read_csv('../data/iris.csv')
def test_ParallelCoordinates_plot():
pc = ParallelCoordinates(df)
pc.set_layout(plot_bgcolor='#E5E5E5',
paper_... |
# Copyright 2019 TerraPower, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
# Generated by Django 3.0.4 on 2020-03-18 22:17
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('producto', '0001_initial'),
('trabajador', '0001_initial'),
]
operation... |
from lmsquery import const
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name="LMSQuery",
version=const.LMSQUERY_VERSION,
author="Robert Einhaus",
author_email="robert@einhaus.info",
description=("Query library for Logitech Media Server"),
... |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2018, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
import numpy as np
import pytest
from procgen import ProcgenGym3Env
from .env import ENV_NAMES
import gym3
import multiprocessing as mp
NUM_STEPS = 10000
def gather_rollouts(
env_kwargs, actions, state=None, get_state=False, set_state_every_step=False
):
env = ProcgenGym3Env(**env_kwargs)
if state is no... |
from decimal import Decimal as D
from django.test import TestCase
from django.test.utils import override_settings
from mock import Mock
from oscar.apps.basket.models import Basket
from oscar.apps.order.models import Order
from oscar_testsupport.factories import create_product
from oscar.apps.order.utils import OrderC... |
a=0
for i in range (101):
if i % 2 == 0:
a=a+i
print(a)
for i in range (1000,0,-1):
if i%6==2 and i**3%5==3 :
print (i)
break
|
import policy.firewall
import policy.removable_devices_perms
import policy.printers
import policy.shortcuts
import policy.applications
from policy.common import Perms
data_roots = {}
data_roots.update(policy.firewall.data_roots)
data_roots.update(policy.removable_devices_perms.data_roots)
data_roots.update(policy.prin... |
import zipfile
import re
from book import Book
from cStringIO import StringIO
import logging
class Archive(object):
def __init__(self, path):
self.path = path
self.logger=logging.getLogger('performance')
self.logger.info("Opening archive " + path)
with open(path) as finfo:
... |
import logging
from settings.settings import DEBUG
logger = logging.getLogger()
if DEBUG:
logger.setLevel(20)
|
numeros = []
for i in range(5):
numeros.append(int(input('Digite o {} termo: '.format(i))))
if i > 0:
if numeros[i] > maior:
maior = numeros[i]
if numeros[i] < menor:
menor = numeros[i]
else:
maior = numeros[i]
menor = numeros[i]
print('-='*... |
# Copyright (c) 2019 Nathan Juraj Michlo
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pu... |
import pytest
from construct import Debugger, ValidationError
from bonfo.msp.fields.config import FeatureConfig, Features, SelectPID, SelectRate, SelectSetting
from .. import messages
def test_select_profile_out_of_range():
with pytest.raises(ValidationError):
data = SelectPID(10)
SelectSetting.... |
# encoding: utf8
#
# retrieved from http://www.aminus.net/wiki/Dowser at 2015-03-18
# this document were placed in public domain by their author
#
# This file is part of the Neurons project.
# Copyright (c), Arskom Ltd. (arskom.com.tr),
# Burak Arslan <burak.arslan@arskom.com.tr>.
# All rights reserved.
... |
import json
JC_SETTINGS_FOLDER_NAME = "javascript_completions"
JC_SETTINGS_FOLDER = os.path.join(PACKAGE_PATH, JC_SETTINGS_FOLDER_NAME)
class JavaScriptCompletions():
def init(self):
self.api = {}
self.API_Setup = sublime.load_settings('JavaScript-Completions.sublime-settings').get('completion_active_list')... |
from unittest import TestCase
from terraform_compliance.common.readable_dir import ReadableDir
import os
from mock import patch
class TestReadableDir(TestCase):
def test_readable_dir_call_git_repository_success(self):
class Namespace(object):
pass
resp = ReadableDir('parser', 'value')... |
from typing import Iterator
from torch.utils.data import Sampler
from lightning_rl.storage.IBuffer import Buffer
class EntireBufferSampler(Sampler):
def __init__(
self,
buffer: Buffer,
samples_per_epoch: int,
) -> None:
super().__init__(None)
self.buffer = buffer
... |
import discord
from config.globals import stable_client_id, testing_bot_prefix, testing_client_id, bot_prefix
async def get_default_prefix(bot):
"""Grabs the default prefix based on the branch version that is running. Allows testing and stable to coexist."""
if bot.user.id == stable_client_id:
return... |
"""
Write a function to find the longest common prefix string amongst an array of strings.
"""
def longestCommonPrefix(strs):
"""
:type strs: List[str]
:rtype: str
"""
if len(strs) > 0:
common = strs[0]
for str in strs[1:]:
while not str.startswith(common):
common = common[:-1]
return common
else:... |
"""
"""
from multipledispatch import dispatch
import dask.dataframe as dd
import dask.array as da
@dispatch(dd._Frame)
def exp(A):
return da.exp(A)
@dispatch(dd._Frame)
def absolute(A):
return da.absolute(A)
@dispatch(dd._Frame)
def sign(A):
return da.sign(A)
@dispatch(dd._Frame)
def log1p(A):
r... |
# -*- coding: utf-8 -*-
#!/usr/bin/env python3
import MySQLdb
import numpy as np
import re
import os
import json
import bibtexparser
from bibtexparser.bwriter import BibTexWriter
from bibtexparser.bibdatabase import BibDatabase
class DocManager(object):
"""docstring for DocManager."""
DELETE_ALL_TABLES_SQL =... |
Libs = {
"libGSFont.dylib",
"libwebrtc.dylib",
"libsysdiagnose.dylib",
"libsystem_trace.dylib",
"libnetwork.dylib",
"libAudioStatistics.dylib",
"libswiftCore.dylib",
"libxpc.dylib",
"libAWDSupportFramework.dylib",
"libswiftDispatch.dylib",
"libAXSpeechManager.dylib",
"lib... |
import datetime as dt
import html
import json
import re
from copy import deepcopy
from urllib import parse as urlparse
from support import config
def prepend_domain(url, domain_url, ignore_domain_splice=False):
if domain_url is None:
return url
if not url:
return None
url = url.strip()
... |
import os
from enums.dataset_type import DatasetType
DATA_FOLDER = 'data'
CHECKPOINTS_FOLDER = 'checkpoints'
RUNS_FOLDER = 'runs'
FEATURES_FOLDER = 'features'
MESSAGES_FOLDER = 'messages'
STEP3_FOLDER = 'step3'
class FileHelper:
def __init__(self):
dir_path = os.path.dirname(os.path.realpath(__file__))
... |
from __future__ import absolute_import, print_function
from abc import ABCMeta, abstractmethod
import numpy as np
import tensorflow as tf
class AbstractRecommender(metaclass=ABCMeta):
"""Abstract base class for evaluator class."""
@abstractmethod
def create_placeholders(self) -> None:
"""Create... |
"""
Signal models for fitting magnetization parameters from MR Images acquired with a Gradient Echo (GRE) Ultrashort TE (UTE) pulse sequence
"""
__author__ = "Dharshan Chandramohan"
import numpy as np
def T2strw_mag_simplified(K, TE, T2str, N):
"""Signal Model of T2str-weighted UTE GRE Magnitude Image
S ... |
import io
import struct
from confluent_kafka.avro import loads as avro_loads
from .mock_schema_registry import MockSchemaRegistryClient
from winton_kafka_streams.processor.serialization.serdes import AvroSerde
import winton_kafka_streams.kafka_config as config
string_avro = '{"type": "string"}'
def create_serde(regi... |
# !/usr/bin/python
# -*- coding:utf-8 -*-
# Author: Shengjia Yan
# Date: 2017/5/10
# Email: sjyan@seu.edu.cn
# 人工标注
import json
from table import *
class Mark(object):
# table_path: 表格路径
# baidubaike_candidates_path: baidubaike 候选实体路径
# hudongbaike_candidates_path: hudongbaike 候选实体路径
# zhwiki_candi... |
#!/usr/bin/env python3
"""
Tools for unit tests to activate and deactivate "demo-extension"
"""
import importlib
import sys
from pathlib import Path
from typing import List
demo_extension_path = str(Path(__file__).parent / 'demo-extension')
def get_namespace_package_path() -> List[str]:
# keep in own namespace
... |
import os
import urllib
import zipfile
def save_zip(url, loc):
if not os.path.exists(loc):
urllib.request.urlretrieve(url, loc)
def unzip(file, loc):
with zipfile.ZipFile(file, 'r') as zip_ref:
zip_ref.extractall(loc)
def mkdir_if_not_exists(loc):
if not os.path.exists(loc):
os... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.