content stringlengths 5 1.05M |
|---|
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='actcrm-python',
version='0.1.0',
description='API wrapper for Act! CRM written in Python',
long_description=read('README.md'),
url='https://github.com/Ge... |
import setuptools
from os import path
from purviewcli import __version__
# Read the contents of README.md
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setuptools.setup(
name='purviewcli',
version... |
from deloslib.users.models import DelosApplication, DelosSite
from django.contrib.sites.models import get_current_site
from django.conf import settings
from django.utils.cache import patch_vary_headers
from django.utils import translation
class UserMiddleware(object):
def process_request(self, request):
... |
# Copyright 2019 D-Wave Systems 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... |
from statistics import mean
scoreList=[]
n=int(input())
for i in range(n):
scoreList.append(float(input()))
scoreList.sort()
print('Mean: %f ,Max: %f ,Min: %f' %(mean(scoreList), scoreList.pop(), scoreList[0]))
|
#!/usr/bin/env python3
"""Fetch all famly.co pictures of your kid
Auth has two versions:
- "non-v2" has a `?accessToken=XXX` as a GET-parameter
- v2-urls demands a `x-famly-accesstoken: XXX` header
"""
import argparse
import json
import shutil
import urllib.request
class FamlyClient:
_access_token = None
... |
# coding: utf-8
"""
Openmoney API
Openmoney API # noqa: E501
OpenAPI spec version: 2.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class AccountsGet(object):
"""NOTE: This class is auto generated by the swagger... |
#!/usr/bin/python
import os
import json
import numpy as np
# import dysts
# from dysts.utils import find_significant_frequencies
# from dysts.flows import *
# from dysts.base import *
import sktime.datasets
from sktime.transformations.panel.tsfresh import TSFreshFeatureExtractor
from sklearn.linear_model import Ridg... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Nikita Seleznev, 2016
# Great thanks to github.com/RomanDubinin
def explicit_euler(xs, h, y0, f, **derivatives):
"""Explicit Euler"""
ys = [y0]
for k in range(len(xs)):
next_y = ys[k] + f(xs[k], ys[k]) * h
ys.append(next_y)
return ys[:-... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import web, random
from bson.objectid import ObjectId
from bson.dbref import DBRef
from config import setting
import helper
db = setting.db_web
url = ('/plat/sku_store_new')
class handler: # PlatSkuStoreNew
def GET(self):
if helper.logged(helper.PRIV_USER,'PLA... |
import numpy as np
from pandas import read_csv
from pandas import datetime
from pandas import DataFrame
from pandas import Series
from pandas import concat
from matplotlib import pyplot as plt
from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics import mean_squared_error
from tensorflow.keras.models impo... |
# -*- coding: utf-8 -*-
"""
pip_services_runtime.ICache
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Interface for transient cache components.
:copyright: Digital Living Software Corp. 2015-2016, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
from .IComponent import ICompon... |
import os
import json
import time
import logging
import asyncio
import concurrent.futures
import subprocess
from datetime import datetime
from functools import partial
import docker
import psutil as ps
import platform as pl
from subprocess import check_output, CalledProcessError
from grpclib.client import Channel
fro... |
# Used example scanner from web3 documentation : https://web3py.readthedocs.io/en/stable/examples.html#eth-getlogs-limitations
import datetime
import json
import logging
import time
from typing import Any, Callable, Iterable, List, Optional, Tuple
from eth_abi.codec import ABICodec
from eth_typing.evm import ChecksumA... |
"""Example workflow pipeline script for customer churn pipeline.
. BatchTransform
. -RegisterModel -> CreateModel .
... |
'''
Created on Jun 18, 2013
@author: Yubin Bai
All rights reserved.
'''
import time
from multiprocessing.pool import Pool
parallelSolve = False
INF = 1 << 30
def solve(par):
entries = par
countries = {}
for e in entries:
try:
countries[e[0]] += 1
except:
countri... |
# Generated by Django 3.1.2 on 2020-11-05 17:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('collaboration', '0006_convert_null_to_empty'),
]
operations = [
migrations.AlterField(
model_name='historicalteammember',
... |
import sqlite3
connection = sqlite3.connect('.\\Ficheros\\demo1.db')
cursor = connection.cursor()
|
from orjson import dumps
COUNTERS_DATA = dumps(
{
"rows": 2,
"counters": [
{
"id": 12345678,
"status": "Active",
"owner_login": "Aaaaa",
"code_status": "CS_ERR_UNKNOWN",
"activity_status": "low",
... |
"""
Task:
Given an array of size n, find the majority element. The majority element
is the element that appears more than n/2 times.
You may assume that the array is non-empty and the majority element always
exist in the array.
>>> major_elem(['a', 'b', 'a'])
'a'
>>> major_elem(['a', 'a', 'b', 'b', 'b... |
sample = "The quick brown fox jumps over the lazy dog"
def wordLen(length, item):
long_words = []
split_item = item.split(" ")
for i in split_item:
if len(i) > length:
long_words.append(i)
return long_words
print(wordLen(3, sample)) |
from libqtile.dgroups import simple_key_binder
from libqtile.config import Group
from grayskull.constants import MOD_KEY
groupings = [
Group("www"),
Group("chat"),
Group("editor"),
Group("term"),
Group("etc"),
]
bindings = simple_key_binder(MOD_KEY, "uiop7")
|
from prismriver.plugin.common import Plugin
from prismriver.struct import Song
class UtaNetPlugin(Plugin):
ID = 'utanet'
RANK = 9
def __init__(self, config):
super(UtaNetPlugin, self).__init__('Uta-Net', config)
def search_song(self, artist, title):
link = 'https://www.uta-net.com/se... |
from unittest import TestCase
from hello_gh_actions.fizzbuzz import fizzbuzz
class TestFizzBuzz(TestCase):
def test_valid_input(self):
self.assertEqual('fizzbuzz', fizzbuzz(0))
self.assertEqual('', fizzbuzz(4))
self.assertEqual('fizz', fizzbuzz(5))
self.assertEqual('buzz', fizzbuz... |
def scat(x,y,filename,lx,ly,color="black", s=0.9):
print("creating plot: {}".format(filename))
fig = plt.figure(figsize=(18,8))
plt.scatter(x,y, s=s, color=color)#, cmap=cmap)
plt.xlabel(lx,fontsize=23)
plt.ylabel(ly,fontsize=23)
plt.savefig("data/{}.png".format(filename))
plt.clf()
def hi... |
# Generated by Django 2.0.13 on 2019-03-27 14:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djangosaml2idp', '0004_auto_20190327_1453'),
]
operations = [
migrations.AlterField(
model_name='agreementrecord',
... |
import cached_github
import streamlit as st
import pandas as pd
import zipfile
import os
import itertools
import base64
"# S4A App Explorer"
# Parsing the user's input
def err(msg):
"""Print an error message to the user and stop."""
st.warning(msg)
st.stop()
def get_config():
"""Returns all the conf... |
#!/usr/bin/env python3
#****************************************************************************************************************************************************
# Copyright 2018 NXP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted ... |
code_msg = {"404":("Page Not Found","没有该页面或页面已被删除"),
"500":("Internal Server Error","服务器内部错误,请联系管理员提交问题"),
"405":("Method Not Allowed","请使用正确方式调用api"),
"401":("Unauthorized","请先登录"),
"403":("Forbidden","您没有权限进行这个操作")}
class errorpage(object):
def __init__(self,erro... |
# See the LICENSE file for licensing information
'''The bot itself.'''
import re
from time import sleep
from . import tubes
from . import sed
class Queue:
size = 0
data = []
head = 0
tail = 0
count = 0
def __init__(self, size):
self.size = size
self.data = [None]*size
def... |
from collections import defaultdict
from typing import Dict, NamedTuple, Any, Optional
import gym
from flatland.envs.rail_env import RailEnv, RailEnvActions
import numpy as np
from flatlander.envs.utils.gym_env import StepOutput
class SingleFlatlandGymEnv(gym.Env):
def render(self, mode='human'):
pass
... |
from utils.utils import *
import glob
from params import Params
from training import train
from utils.plotters import *
import time
from datetime import datetime
import argparse
from generating import AudioGenerator
import random
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser... |
from django.http import JsonResponse
def validate_with_form(form_class):
def decorator(view):
def wrapper(request, *args, **kwargs):
if request.method == 'GET':
data = request.GET
elif request.method == 'POST':
data = request.POST
else:
... |
__doc__ = """ Factory function to allocate variables for Cosserat Rod"""
__all__ = ["allocate"]
import numpy as np
from numpy.testing import assert_allclose
from elastica.utils import MaxDimension, Tolerance
from elastica._linalg import _batch_cross, _batch_norm, _batch_dot
def allocate(
n_elements,
start,
... |
''' A module for demonstrating raise '''
import sys
def div(x, y):
''' convert string to an integer '''
if y == 0:
raise ValueError("y cannot be zero {}".format(y))
return x / y
if __name__ == "__main__":
print("Division div(10,5) ", div(10, 5))
print("Division div(10,0)", ... |
import urllib.parse
def get_gmaps_link(address: str):
return "https://maps.google.com/maps/place/" + address.replace(" ", "+")
def get_osm_link(address: str):
return "https://www.openstreetmap.org/search?query=" + urllib.parse.quote_plus(address)
if __name__=="__main__":
address = "Rynek, Wrocław"
p... |
from django.shortcuts import render
from django.http import HttpResponse
from django.http import JsonResponse
from .models import Document, Create_page
import json
from datetime import date
import datetime
# Create your views here.
def send_html_element_from_python_function(request):
if request.method == 'GET':
Va... |
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
import PySimpleGUI as sg
import time
import os
from random import randrange
bot= ChatBot('Bot')
trainer = ChatterBotCorpusTrainer(bot)
trainer.train('chatterbot.corpus.portuguese')
trainer.train('chatterbot.corpus.english')
train... |
from typing import List, Tuple
import numpy as np
import torch
from natsr import (
THRESHOLD_ACC,
THRESHOLD_ALPHA,
THRESHOLD_SIGMA,
Mode,
ModelType,
)
from natsr.dataloader import build_loader, get_nmd_data
from natsr.losses import (
build_classification_loss,
build_reconstruction_loss,
... |
""" images """
# imports
import numpy as np
import scipy.io
import os
from nilearn.masking import compute_epi_mask
from nilearn.image import load_img
import matplotlib.pyplot as plt
from sklearn.feature_extraction.image import extract_patches_2d
from pisap.base.utils import min_max_normalize
import scipy.fftpac... |
#!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from haruhi_dl.aes import aes_decrypt, aes_encrypt, aes_cbc_decrypt, aes_cbc_encrypt, aes_decrypt_text
from haruh... |
# Generated by Django 2.1.5 on 2019-04-16 17:40
from django.db import migrations
from django.contrib.auth.models import User
def create_dummy_super_user(pps, schema_editor):
"""
creating dummy user for admin site
:param pps:
:param schema_editor:
:return:
"""
User.objects.create_superuser... |
# -*- coding: utf-8 -*-
"""setup.py: setuptools control."""
import re
from setuptools import setup
version = re.search(
'^__version__\s*=\s*"(.*)"',
open('zoql/zoql.py').read(),
re.M
).group(1)
with open("README.md", "rb") as f:
long_descr = f.read().decode("utf-8")
setup(
name = "cmdl... |
import os
from sklearn.metrics import accuracy_score, confusion_matrix, f1_score
from churnprediction.config import config
from churnprediction.features.build_features import build_features
from churnprediction.models import test_model, train_model
from churnprediction.utils.generate_roc import generate_roc
from churnp... |
"""
Say you have an array for which the ith element is the price of a given stock on day i.
If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), design an algorithm to find the maximum profit.
Example 1:
Input: [7, 1, 5, 3, 6, 4]
Output: 5
max. difference = 6-... |
import time
import praw
# Configure this section yourself
USERAGENT = "XXXXX:vX.X (by /u/XXXXX)"
BOT_USERNAME = "XXXXX"
BOT_PASSWORD = "XXXXX"
RECEIVING_USERNAME = "XXXXX"
SUBREDDIT = "XXXXX"
KEYWORD = "XXXXX".lower()
def main():
r = praw.Reddit(user_agent = USERAGENT)
r.login(USERNAME, PASSWORD);
submiss... |
from enum import Enum
class TrainingStrategies(Enum):
AUTO = None
DEFAULT = [
{
"max_steps": 1000,
"method_b": "brent",
"update_b_freq": 5,
"ftol_b": 1e-6,
"max_iter_b": 1000
},
]
GD = [
{
"max_steps": 100... |
import core.decorators
from config import Config
@core.decorators.private_command.init
def init(update, context):
update.message.reply_text('Ciao sono {bot} \n'\
'creata da InfocomTeam\nSorgente: {repo}'
.format(repo=Config.SOURCE,
bot=Config.BOT_... |
import FWCore.ParameterSet.Config as cms
# -*-TCL-*-
from RecoMuon.MuonIsolationProducers.muIsoResultInputBlocks_cfi import *
from RecoMuon.MuonIsolationProducers.muIsolatorBlocks_cfi import *
muIsoResultM2C = cms.EDProducer("MuIsoCandidateResultProducer",
IsolatorByDepositR03,
VetoPSet = cms.PSet(
Sel... |
import justpy as jp
import definition
from webapp import layout
from webapp import page
class Dictionary(page.Page):
path = "/dictionary"
@classmethod
def serve(cls, req):
wp = jp.QuasarPage(tailwind=True)
lay = layout.DefaultLayout(a=wp)
container = jp.QPageContainer(a=lay)
... |
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 13 21:30:12 2019
@author: Tony Yang
@email: t2yang@eng.ucsd.edu
@github: erza0211064@gmail.com
Description:
Class Lidar_temporal implement temporal_filter, which returns the median of the current and previous d scans.
You can add more scan in one object. Multiple scan... |
def common_elements(list1, list2):
return [element for element in list1 if element in list2]
ngap_best = 0
glimit_best = 0
fit_best = -1
for ngap in range(5,50):
for glimit in range(100,1500,100):
data = t2
data = updateArray(data)
#data = findClusterRedshift(data)
data['CLU... |
"""Quit View [Timecard]
Author(s): Jason C. McDonald
Prompts the user whether they want to quit or not.
"""
from PySide2.QtCore import Qt
from PySide2.QtWidgets import QWidget, QGridLayout, QLabel, QPushButton
from PySide2.QtGui import QIcon
from timecard.interface.app import App
class QuitView:
widget = QWidg... |
import creeps.worker
def __pragma__(*args, **kwargs):
pass
for size, body in creeps.worker.RemoteCarrier.body_composition.items():
print(size,body) |
# Generated by Django 3.2.12 on 2022-03-24 15:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('bookings', '0005_alter_booking_state'),
]
operations = [
migrations.RenameField(
model_name='booking',
old_name='price',
... |
import unittest
import endurox as e
import exutils as u
import gc
class TestTpacall(unittest.TestCase):
# Validate async call by cd
def test_tapcall_cd(self):
w = u.NdrxStopwatch()
while w.get_delta_sec() < u.test_duratation():
cd = e.tpacall("OKSVC", { "data":{"T_STRING_FLD":"Hi J... |
from abc import ABCMeta,abstractmethod
class Co2senserError(Exception):
pass
class Co2senserController(metaclass = ABCMeta):
def __init__(self):
pass
@abstractmethod
def get_co2_data(self):
pass
@abstractmethod
def check_vaital(self):
raise Co2senserError('')
|
# Copyright 2021 Fedlearn authors.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
from pulp import *
import pandas as pd
from scipy.stats import norm
import json
import re
def course_with_name(name, dataframe):
index = 0
for row in data.values:
if name in row[0]:
return index
else:
index += 1
return None
# Load in data and config
parameters = j... |
#!/usr/bin/env python3
#
# Copyright (c) 2019 LG Electronics, Inc.
#
# This software contains code licensed as described in LICENSE.
#
import os
import lgsvl
sim = lgsvl.Simulator(os.environ.get("SIMULATOR_HOST", "127.0.0.1"), 8181)
if sim.current_scene == "BorregasAve":
sim.reset()
else:
sim.load("BorregasAve")
... |
# Generated by Django 2.1.7 on 2019-02-28 10:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wxapp', '0004_auto_20181116_1501'),
('account', '0017_auto_20181201_1514'),
]
operations = [
migrat... |
# create bits->next_bits
bits_dcts = [{} for i in xrange(17)]
for t in xrange(5):
bits = [1<<i for i in xrange(2**t)]
bits_dct = bits_dcts[2**t]
#print bits
for i in xrange(t):
new_bits = set([])
for b1 in bits:
bits_dct[b1] = []
for b2 in bits:
if... |
import requests
from .models import Profile, ActivityLog, DailyActivity, SyncInformation
class HttpClient:
def __init__(self):
self.headers = {}
def set_header(self, key, value):
self.headers[key] = value
def get(self, url, params=None):
response = requests.get(url, pa... |
"""
Used for patent landscaping use-case.
"""
import os
import pandas as pd
import keras
from keras.models import Sequential, Model
from keras.layers import Dense, Input, Embedding, BatchNormalization, ELU, Concatenate
from keras.layers import LSTM, Conv1D, MaxPooling1D
from keras.layers.merge import concatenate
from ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `codex-africanus` package."""
from itertools import product
import numpy as np
import pytest
from africanus.constants import c as lightspeed
from africanus.gridding.util import estimate_cell_size
def rf(*a, **kw):
return np.random.random(*a, **kw)
d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 2019年4月19日
@author: Irony
@site: https://pyqt5.com https://github.com/892768447
@email: 892768447@qq.com
@file: CustomWidgets.CColorPicker.CColorPicker
@description:
"""
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QColor
from PyQt5.QtWi... |
from . rules_list import ProvisionRulesList
|
"""Chapter 7 Practice Question 2
Is each spam a global or local variable?
"""
spam = 42 # global/local
def foo() -> None:
"""Prints spam.
Prints the contents of the spam variable.
Returns:
Prints spam variable.
"""
global spam
spam = 99 # global/local
print(spam)
def main()... |
# Copyright 2017 the pycolab Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
#!/usr/bin/python
def smallest(arr, considered):
least = float('infinity')
leastp = (0, 0)
for p in considered:
num = arr[p[0]][p[1]][1]
if num <= least:
least = num
leastp = p
if len(considered) == 0:
print arr[79][79][1]
return leastp
if __name__ =... |
import discord
from discord.ext import commands
import json
class Misc(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def elevate(self, ctx, member: discord.Member):
if ctx.author.id == 401063536618373121:
with open('./data/json/elevated.json'... |
import json
import requests
import os
import time
import sys
from dotenv import load_dotenv
load_dotenv()
def create_dirs(dirpath):
"""Creating directories."""
if not os.path.exists(dirpath):
os.makedirs(dirpath)
def join_path(*args):
return os.path.join(*args).replace("\\", "/")
class CryptoStr... |
import logging
from typing import Callable, List, Optional, Set, Union
from .logger import Logger
PACKAGE_LOGGER = "aws_lambda_powertools"
def copy_config_to_registered_loggers(
source_logger: Logger,
log_level: Optional[str] = None,
exclude: Optional[Set[str]] = None,
include: Optional[Set[str]] = ... |
from chemutils.obabelutils import obConvert, obGetMolBonds
from chemutils.xyzutils import xyzToAtomsPositions
from compchemparser.helpers.utils import get_xyz_from_parsed_json
from chemaboxwriters.common.randomidgenerator import get_random_id
from compchemparser.parsers.ccgaussian_parser import ATOM_MASSES, \
... |
from kpis import KPIs
from currentkpis import CurrentKPIs
from forecastkpis import ForecastKPIs
# Report on current KPI values
kpis = KPIs()
currentKPIs = CurrentKPIs(kpis)
forecastKPIs = ForecastKPIs(kpis)
kpis.set_kpis(25, 10, 5)
kpis.set_kpis(100, 50, 30)
kpis.set_kpis(50, 10, 20)
print ('\n***Detachin... |
from enum import Enum
from fastapi import Depends, FastAPI, HTTPException
from fastapi.security.http import HTTPAuthorizationCredentials, HTTPBearer
from pydantic import BaseModel
from . import model
from .model import SafeUser, WaitRoomStatus
app = FastAPI()
# Sample APIs
@app.get("/")
async def root():
retu... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from datetime import timedelta
from django.conf import settings
default_app_config = 'tandlr.scheduled_classes.apps.ScheduledClassesConfig'
if not settings.CELERYBEAT_SCHEDULE:
settings.CELERYBEAT_SCHEDULE = {
#
# Excecutes every ... |
from .loggable import *
from .math import *
from .text import *
from .randomwords import RANDOM_WORDS
|
#!/usr/bin/env python3
import json
from pathlib import Path
from shlex import split
from shutil import move, rmtree
from subprocess import PIPE, Popen, run
from typing import Dict, List
colors = {
"reset": "\033[0m",
"bold": "\033[01m",
"red": "\033[31m",
"green": "\033[32m",
"cyan": "\033[36m",
... |
"""
Utility to dump an AST from a set of files.
@author: Dylan Bourgeois (@dtsbourg), Thao Nguyen (@thaonguyen19)
License: CC-BY 4.0
"""
import os
from collections import namedtuple
import astor
import argparse
import yaml
from utils import create_dir
import json
# CFG
with open("config-thesis.yml", 'r') as ymlfile... |
import argparse
import torch
import numpy as np
from tqdm import tqdm
import lpips
import jittor as jt
import jittor.nn as nn
def normalize(x):
return x / jt.sqrt(x.pow(2).sum(-1, keepdim=True))
def slerp(a, b, t):
a = normalize(a)
b = normalize(b)
d = (a * b).sum(-1, keepdim=True)
p = t * jt.... |
from github import Github
from subprocess import DEVNULL, STDOUT, check_call
from pathlib import Path
from configparser import ConfigParser
import os
class ProjectHandler:
@staticmethod
def create(argc: int, argv: list) -> int:
# check whether config exists is filled out
# --------------------... |
"""
Stage to implement the inclusive neutrino flux as calculated with MCEq,
and the systematic flux variations based on the Barr scheme.
It requires spline tables created by the `pisa/scripts/create_barr_sys_tables_mceq.py`
Pre-generated tables can be found at `fridge/analysis/common/data/flux/
Tom Stuttard, Ida Stor... |
from type import OpUnit
_Q1_P1 = [(OpUnit.SEQ_SCAN, [600000, 48, 7, 600000]),
(OpUnit.OP_INTEGER_COMPARE, [600000, 4, 1, 600000]),
(OpUnit.OP_INTEGER_PLUS_OR_MINUS, [600000, 4, 1, 600000]),
(OpUnit.OP_DECIMAL_PLUS_OR_MINUS, [4800000, 4, 1, 4800000]),
(OpUnit.OP_DECIMAL_MULTIPLY,... |
import st4
def test_st4():
s = st4.ST4('/dev/ttyUSB0')
s.go_rapid(0, 0)
assert s.readline() == 'Rapid to:,X0,Y0,Z0,W0'
|
#
# Copyright (c) 2020 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# coding=utf-8
# All Rights Reserved.
#
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'cnheider'
from .model import *
from .statistics import *
|
# imports
from sqlalchemy.ext.declarative import declarative_base
DeclarativeBase = declarative_base()
|
from st2reactor.sensor.base import Sensor
from aoscx_websocket import Client # NOQA
class PortSensor(Sensor):
def __init__(self, sensor_service, config=None):
super(PortSensor, self).__init__(sensor_service=sensor_service,
config=config)
self._logger = sel... |
"""
atinline: forcibly inline python functions to their call site
==============================================================
This is a Python hack to let you specify functions as "inline" in much the
same way you'd do in C. You save the cost of a function call by inlining
the code of the function right at the c... |
from django.db import models
# Create your models here.
class Auto(models.Model):
mark = models.CharField(max_length=50)
model = models.CharField(max_length=50)
colour = models.CharField(max_length=50)
gov_number = models.IntegerField()
class Owner(models.Model):
first_name = models.CharField(max... |
# syslib
import os
import time
from pathlib import Path
# data processing
import pandas as pd
# pyas
from pyas.transcoder import Transcoder
from pyas.prober import Prober
from pyas.variant_generator import VariantGenerator
from pyas.error import raise_exception
from pyas.profiler import Profiler
class Experimenter:
... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Project'
db.create_table(u'kanban_project', (
... |
import torch
import torch.utils.data as data
import numpy as np
import os
import sys
import subprocess
import shlex
import pickle
from .data_utils import grid_subsampling
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(BASE_DIR)
def pc_normalize(pc):
# Center and rescale point fo... |
import numpy as np
import cv2
import pickle
import random
import scipy.interpolate
from utils import path_constants
def random_erasing(image, area_ratio_bounds=(0.06,0.10), aspect_ratio_bounds=(0.5,2)):
# copiamo l'immagine e recuperiamo le dimensioni
image = image.copy()
height, width = image.shape[:-1]
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `oal` module."""
import pytest
from contextlib import contextmanager
from click.testing import CliRunner
from oal.__main__ import cli
class TestOal(object):
@classmethod
def setup_class(cls):
pass
def test_no_args(self):
"""Tes... |
"""Contains helpers to elevate the user rights under Windows"""
from __future__ import absolute_import
from __future__ import unicode_literals
import ctypes
import sys
from builtins import str as text
__version__ = '0.0.0'
def elevate(args=None):
"""Tries to rerun the current script with admin rights"""
if not ... |
#!/usr/bin/env python
import os
import sys
import dotenv
"""
The command will look like:
python t_manage.py migrate_one schema:aSchemaName
"""
if __name__ == "__main__":
dotenv.read_dotenv()
os.environ.setdefault(
"DJANGO_SETTINGS_MODULE", "practice_platform_backend.settings.dev"
)
try:
... |
#! /usr/bin/env python3
import sys
import errno
import os
import re
import gzip
import threading
import requests
from collections import defaultdict
import pandas as pd
import matplotlib.pyplot as plt
import argparse
import urllib.request
import urllib.error
plt.rcParams.update({'figure.max_open_warning': 0})
""" Fo... |
API_ID = 1686243
API_HASH = "e6ff820963be298cfef580c81e5ee281"
SUDO_CHAT_ID = -1001178564235 # Chat where the bot will play the music.
SUDOERS = [1569115700] # Users which have special control over the bot.
# don't make changes below this line
ARQ_API = "http://35.240.133.234:8000"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.