content stringlengths 5 1.05M |
|---|
#!/usr/bin/env python3
"""RZFeeser@alta3.com | Alta3 Research
Using the CSV library to work with CSV data."""
# standard library import
import csv
# open our csv data (we want to loop across this)
with open("csv_users.txt", "r") as csvfile:
# counter to create unique file names
i = 0
# loop across our ... |
import requests
import json
import uuid
import boto3
client = boto3.client('rekognition')
# store each person by a uuid instead of by name
uuid_to_person_map = {}
photo_link = ("https://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/"
"Official_portrait_of_Vice_President_Joe_Biden.jpg/"
... |
import tornado.ioloop
import tornado.web
import os
import uuid
import json
dictFood={'burger':5.4, 'french_fries':5.08 ,'chicken':3.88, 'toast':3.125, 'egg':1.95, 'pizza':2.66, 'cookie':5.1, 'hot dog':2.9, 'steak':2.7}
class NewHandler(tornado.web.RequestHandler):
def get(self):
#n = int(self.get_argumen... |
from django.contrib import admin
from django.contrib.auth import get_user_model
CustomUser = get_user_model()
admin.site.register(CustomUser) |
#!/usr/bin/env python3
# coding: utf-8
from .base_test import BaseTest
from testgres.connection import ProgrammingError
class OTablesTest(BaseTest):
def assertTblCount(self, size):
self.assertEqual(size,
self.node.execute('postgres',
'SELECT count(*) FROM orioledb_table_oids();')[0][0])
def t... |
# -*- coding: utf-8 -*-
"""Yelp_Hotel_Reviews_Web_Scraper.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/13awHtJ5dnpdutcAMoxECNnlvbApnoB7z
"""
import bs4
import urllib
import urllib.request as url
import pandas as pd
url_list=[
['https://www.ye... |
from django.http import HttpResponse
# from lib.handler import dispatcherBase
def ass_IP(request):
return HttpResponse("IP分析") |
import numpy as np
from stl import mesh
from sklearn.decomposition import PCA
import json
import os
import sys
from tqdm import tqdm
def get_stl_paths(full_path, json_filename=''):
dir_list = os.listdir(full_path)
data = {}
for d in dir_list:
file_list = os.listdir(os.path.join(full_path, d))
... |
import xmc.tools as tools
from exaqute import *
# TODO When MomentEstimator is updated to specs, one level of nesting will have to be added above solver level: each element of sampleGroup is to be a list of sample components; as of now, it is just a single component.
@task(keep=True, estimators=INOUT, sample... |
# Copyright (c) Yugabyte, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... |
'''
Created on May 28, 2020
bdio_update_project_name - updates project name referenced in bdio file
@parameters
bdio_in - original bdio file
--bdio-out bdio_ot - output bdio file
--project-name projetc_name - new Project name
Invoked without --bdio-out and --project-name will read project name refe... |
"""
2D bimodal example
====================
This example shows how to use ``lightkde.kde_2d`` and how it compares to
``scipy.stats.gaussian_kde`` for a bimodal bivariate case.
"""
# %%
# Import packages:
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import gaussian_kde, multivariate_normal
from ... |
import os
import json
import pandas as pd
import collections
from .adjuster import Adjuster
from .desired_adjustment_calculator.calc_config import DesiredPlatformAdjustmentCalculatorConfig
from autoscalingsim.scaling.scaling_model import ScalingModel
from autoscalingsim.scaling.state_reader import StateReader
from au... |
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import gym
import random
import numpy as np
from typing import Optional, List, Tuple
from itertools import count
from more_itertools import pairwise
from collections import deque, namedtuple
import matplotlib.pyplot as plt
... |
import collections
import pickle
import os
import spacy
import pandas as pd
from tqdm import tqdm
from nltk import pos_tag
from nltk.corpus import stopwords, wordnet as wn
from nltk.stem import WordNetLemmatizer
from typing import Dict
from embeddings import get_best_sentence, get_data_from_articles
def create_stats_d... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 12 14:38:37 2021
@author: afo
"""
import asyncio
import json
from os.path import abspath
from inspect import getsourcefile
import os
import aiohttp
import time
import sys
from understat import Understat
import nest_asyncio
nest_asyncio.apply()
... |
from tictactoe_helper import StartState
beginGame()
|
#!/usr/bin/env python3
#
# - import a csv table of score files (and possibly edf files)
# - strip out spaces in column names
# - consolidate into trial datablocks (with consensus)
# TODO: use relative paths in csv?
#======================================
import pdb
import os
import argparse
import pandas as pd
... |
'''OpenGL extension EXT.blend_subtract
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_EXT_blend_subtract'
_DEPRECATED = False
GL_FUNC_SUBTRACT... |
import socket
class FakeButton:
def right_click(self):
pass
def left_click(self):
pass
def both_click(self):
pass
def close(self):
pass
class Button:
def __init__(self, server: str, port: int) -> None:
self.socket = socket.socket(socket.AF_INET, socket.... |
from modules import skeleton
from lib.core import utils
from lib.mode import speed
from lib.sender import execute
from lib.sender import polling
from lib.sender import report
from lib.sender import summary
from lib.sender import summary
class SubdomainScanning(skeleton.Skeleton):
"""docstring for subdomain"""
... |
import tempfile, csv
class Batchinator:
def __init__(self, batchSize:int):
self.workingDir = tempfile.TemporaryDirectory()
self.currentFile = tempfile.NamedTemporaryFile(mode='w',delete=False,dir=self.workingDir.name)
self.csvWriter = csv.writer(self.currentFile, delimiter=',', quotechar='"... |
import mock
import six
import unittest
from types import FunctionType
from kazoo.handlers.gevent import SequentialGeventHandler
from kazoo.testing.harness import KazooTestHarness
from lymph.core.container import ServiceContainer
from lymph.core.connection import Connection
from lymph.core.interfaces import Interface,... |
from typing import Union, List, Iterable
from datetime import datetime
from .internals.base_classes import (
BaseSyncCinnamon,
BaseCinnamonField,
QueryFieldSet,
QueryField,
)
from .internals.constants import CinnamonUndefined
from .internals import scalars
from . import fields as fields_module
from . im... |
from datetime import date, timedelta
from random import choice
from flask import g
from telebot.types import InlineKeyboardMarkup, InlineKeyboardButton
import telebot_login
from app import new_functions as nf
from app.constants import (
emoji, all_stations, loading_text, fast_trail_answer_select_day
)
from tg_bot... |
from django.test import TestCase
from django.contrib.auth.models import User
from users.models import User_Profile
class AnimalTestCase(TestCase):
def setUp(self):
user = User.objects.create(username='testcase',
first_name='test',
last_... |
import cudamat as cm
import ctc_fast as ctc
import numpy as np
import pdb
class NNet:
def __init__(self,inputDim,outputDim,layerSize,numLayers,maxBatch,
train=True,temporalLayer=-1):
# Initialize cublas
cm.cublas_init()
self.outputDim = outputDim
self.inputDim = inputD... |
from models.ae import AutoEncoder
from models.disentangle_vae import DisentangleVAE
from models.parallel_ae import ParallelAE
from models.syntax_guide_vae import SyntaxGuideVAE
from models.syntax_vae import SyntaxVAE
from models.vanilla_vae import VanillaVAE
MODEL_CLS = {
'AutoEncoder': AutoEncoder,
'VanillaVA... |
import os
import common
import constant
import creds
from . import common as ami_common
DEFAULT = {
'PACKER_SSH_AGENT_AUTH': 'false',
'PACKER_SSH_INTERFACE': 'public_ip',
'PACKER_ASSOCIATE_PUBLIC_IP': 'true',
'PACKER_IAM_GROUPS': ami_common.DEFAULT['IAM_GROUPS'],
}
def main(hmrc_role, environment,... |
import app.frequent_rules as frq
from model.dataframe import DataFrameWrapper
def kamiran(input_file, output_file, min_sup, min_conf, alpha, attr, d_attr, d_attr_dep, index, label, rank):
db = DataFrameWrapper(input_file)
rules = frq.get_frequent_rules(db, attr, min_sup, min_conf)
fr = frq.get_frequent_cl... |
from torch import nn
from catalyst.core.callbacks import CriterionCallback
from catalyst.core import State
from src.models.prediction_heads import HeadOutputKeys
from src.label_encodings import CtcLabelEncoding, SequenceLabelEncoding
class CtcCriterionCallback(CriterionCallback):
"""
Callback for CTC Loss cal... |
from django.apps import AppConfig
class TimerecorderConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'timerecorder'
|
import os
import sys
import re
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='galstreams',
version='1.0.0',
author='C. Mateu',
author_email='cmateu@fisica.edu.uy',
packages=['bovy_coords','galstreams','gcutils','galstreams/lib'],
packag... |
from django import forms
from django.db import models
from django.db.models import fields
from .models import CreatorProfile, LearnerProfile, Courses, Modules, Classroom, Reviews, FollowList, ClassroomModules
class CreatorRegisterForm(forms.ModelForm):
class Meta:
model = CreatorProfile
fields = [
... |
blockchain_address = '172.26.71.249'
port = ':5000'
CA_addresses = ["18.191.21.38"]
chain_file = "data/chain"
transactions_file = "data/transactions"
mine_time = 10 |
import unittest
import my_lib
import random
import statistics
class TestLib(unittest.TestCase):
@classmethod
def setUpClass(cls):
print("\n Running class setUp...")
@classmethod
def tearDownClass(cls):
print("\n Running class tearDown...")
def setUp(self):
... |
from django.contrib import admin
from .models import CertContent
from .models import ProductContent
from .models import UsesContent
from .models import ProductButton
from home.admin import ContentAdmin
# Register your models here.
admin.site.register(CertContent,ContentAdmin)
admin.site.register(ProductContent,Content... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
#!/usr/bin/env python3
import pytest
from pathlib import Path
from bin import telescope_status
import signal
class TestTelStatus():
@staticmethod
def handler(signum, frame):
print('Exiting call')
raise TimeoutError('The function reached timeout without other errors')
# This is problemati... |
import rpyc
from pandaharvester.harvestercore.plugin_base import PluginBase
from pandaharvester.harvestercore import core_utils
from .ssh_tunnel_pool import sshTunnelPool
# logger
_logger = core_utils.setup_logger('rpc_herder')
# RPC herder
class RpcHerder(PluginBase):
# constructor
def __init__(self, **kw... |
"""
Implementation of k-nearest-neighbor classifier
"""
from numpy import *
from pylab import *
from binary import *
class KNN(BinaryClassifier):
"""
This class defines a nearest neighbor classifier, that support
_both_ K-nearest neighbors _and_ epsilon ball neighbors.
"""
def __init__(self, op... |
import graphene
from uuid import uuid4
from flask_graphql_auth import mutation_jwt_required, get_jwt_identity, AuthInfoField
from app.models import User, ToDo, Milestone, Type
from app.schema.unions import ResponseUnion
from app.schema.fields import ResponseMessageField
from app.schema.utils import todo_activity_logg... |
import torch
class MatrixFactorization(torch.nn.Module):
def __init__(self, n_users, n_items, n_factors=20):
super().__init__()
self.user_factors = torch.nn.Embedding(n_users, n_factors, sparse=True)
self.item_factors = torch.nn.Embedding(n_items, n_factors, sparse=True)
def forward(... |
import tkinter as tk
import tkinter.font as tkFont
from tkinter import ttk
from config import Config
import ui.main_menu
class SettingPage(tk.Frame):
def __init__(self, parent, controller):
super().__init__(parent)
self.controller = controller
self.rowconfigure(0, weight=1)
se... |
commandTable = {
#Add: Get Top, Decrement SP, Get Top, Add, Store
'add' : '@SP\nM=M-1\nA=M\nD=M \n@SP\nM=M-1\nA=M \nD=D+M \n@SP\nA=M\nM=D \n@SP\nM=M+1\n',
'sub' : '@SP\nM=M-1\nA=M\nD=M \n@SP\nM=M-1\nA=M \nD=M-D \n@SP\nA=M\nM=D \n@SP\nM=M+1\n',
'and' : '@SP\nM=M-1\nA=M\nD=M \n@SP\nM=M-1\nA=M \nD=D&M \n@S... |
n = int(input())
uid_list = []
for i in range(1,n+1):
uid = input()
uid_list.append(uid)
alpha = '''abcdefghijklmnopqrstuvwxyz'''
Alpha = '''ABCDEFGHIJKLMNOPQRSTUVWXYZ'''
numeric = '0123456789'
N = 0
A = 0
a = 0
valid = []
rep = 0
for i in uid_list:
for j in i:
if j in Alpha:
... |
#!/usr/bin/python
#-*- coding:utf-8 -*-
import sys
import platform
import argparse
try:
from geopy.geocoders import Nominatim
except ImportError:
sys.exit("\033[31m[!] Error Geopy Not Found !")
def get_address(latlong):
geolocator = Nominatim(user_agent="get_address_by_latlong")
location = geolocato... |
"""
Typing for All Injector Dependencies
:license: MIT
"""
class Boto3SFN():
'''
Boto3 SFN Type
'''
def __init__(self):
super()
class Boto3SQS():
'''
Boto3 SQS Type
'''
def __init__(self):
super()
class Boto3SNS():
'''
Boto3 SNS Type
... |
test_list = [
############################################
# ONLY UNPROCESSED TICKER AS INPUT SECTION #
############################################
{
'input': {
'u_ticker': 'FUN.N',
'summary': None,
'link': None
},
'output': {
... |
"""Tests DataProcessor object serialization during dataset publication."""
import os
import shutil
from typing import Dict
import numpy as np
from mlops.dataset.data_processor import DataProcessor
from mlops.dataset.versioned_dataset_builder import VersionedDatasetBuilder
from mlops.dataset.versioned_dataset import Ve... |
class Solution:
def buddyStrings(self, A: str, B: str) -> bool:
if len(A) != len(B):
return False
char_count = {}
indexes_to_swap = []
dup = False
for idx, string in enumerate(A):
curr_char_count = char_count.get(string, 0)
curr_ch... |
import numpy
import os
import bz2
import gzip
import multiprocessing
import time
import zipfile
class scio:
def __init__(self,fname,arr=None,status='w',compress=None,diff=False):
if not(compress is None):
if len(compress)==0:
compress=None
self.fid=open(... |
class ConsoleCancelEventArgs(EventArgs):
""" Provides data for the System.Console.CancelKeyPress event. This class cannot be inherited. """
Cancel = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets a value indicating whether simultaneously pressing the System.Con... |
install = []
import os
import sys
try: from colorama import Fore, init
except: install.append("colorama")
# Trying to install the needed modules if there not already
if install:
to_install = " ".join(install)
os.system(sys.executable + " -m pip install " + to_install)
print("[STARTUP] INSTALLED... |
from types import ClassMethodDescriptorType
import selenium
from bs4 import BeautifulSoup
import requests
import time
import random
import sys
id = sys.argv[1]
print(sys.argv[1])
url = f'https://github-readme-stats.vercel.app/api?username={id}&count_private=true'
langurl = f'https://github-readme-stats.vercel.app/api/... |
#! /usr/bin/env python
from __future__ import print_function
import logging
import json
import os
import posixpath
import shutil
import sys
try:
from urllib import unquote
except Exception:
from urllib.parse import unquote
try:
from BaseHTTPServer import BaseHTTPRequestHandler
except ImportError:
from... |
from . import drawer
class Screen(drawer.Screen):
def render_frame(self):
self.rendered_frame = ""
if self.border:
self.rendered_frame += self.default_symbol * (self.field_width + 2)
self.rendered_frame += "\n"
for row in range(self.field_height):
if se... |
from peak.util.addons import AddOn
import protocols
class IAliasProvider(protocols.Interface):
def get_alias(name, service, protocol=None):
pass
def set_alias(name, service, protocol, alias):
pass
class StubAliasProvider(AddOn):
protocols.advise(instancesProvide=(IAliasProvider... |
# here are the main analytics functions
import random
def score_ideas(ideas):
"""
This is a function that assigns scores to the ideas.
Inputs:
ideas (list): a list of ideas to be scored.
Output:
ranked_ideas (list): a list of idea and score tuple ranked descending.
"""
ranked_... |
# terrascript/data/shell.py
import terrascript
class shell_script(terrascript.Data):
pass
__all__ = [
"shell_script",
]
|
# -*- coding: utf-8 -*-
""" Sahana Eden Staff Search Module Automated Tests
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal... |
# Make me coffee!
# maybe someday we'll actually make this order coffee using a phone-connection service :D
from espresso.main import robot
@robot.respond(r'(?i)make (me )?(a )?coffee')
def make_coffee(res):
res.reply(res.msg.user, "http://dreamatico.com/data_images/coffee/coffee-3.jpg")
|
import yaml
import pprint
import os
def generate_cass_yaml():
with open('../res/cassandra.yaml') as inFile:
# The FullLoader parameter handles the conversion from YAML
# scalar values to Python the dictionary format
cassandra_yaml = yaml.load(inFile, Loader=yaml.FullLoader)
del cassand... |
import time
import torch
import math
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from utils_multi import *
def build_targets(pred_corners, target, num_keypoints, anchors, num_anchors, num_classes, nH, nW, noobject_scale,
object_scale, sil_thresh, seen):
... |
from sensors.gyroscope import get_orientation
from sensors.barometer import get_pressure
from sensors.hygrometer import get_humidity
from sensors.thermometer import get_temperature
from sensors.magnetometer import get_compass
from sensors.accelerometer import get_acceleration
def get_readings(sense_hat):
readings = ... |
import logging
import os
import shutil
import pytest
import salt.serializers.json as jsonserializer
import salt.serializers.msgpack as msgpackserializer
import salt.serializers.plist as plistserializer
import salt.serializers.python as pythonserializer
import salt.serializers.yaml as yamlserializer
import salt.states.... |
import os
import time
from datetime import datetime, timedelta
from botocore.vendored import requests
from src.stations import stations
API_KEY = os.environ.get('API_KEY')
BASE_URL = 'https://api-v3.mbta.com/'
class TrainCalculator:
"""
Class for calculating train arrivals
"""
@staticmethod
de... |
# Copyright (c) 2013 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from naclports.error import Error, PkgFormatError, DisabledError
from naclports.pkg_info import ParsePkgInfoFile, ParsePkgInfo
from naclports.util i... |
import numbers
class IntegralField(object):
"""data descriptor:数据描述符"""
def __init__(self):
self.valuexx = 0
def __get__(self, instance, owner):
print("__get__",instance)
return self.valuexx
def __set__(self, instance, value):
# print("__set__",instance,value)
if... |
import math
from pathlib import Path
from typing import Union
import pytest
from planingfsi import config
from planingfsi.config import SubConfig, ConfigItem
class TestClass(SubConfig):
"""A simple configuration class to test behavior of attribute descriptors."""
float_attr = ConfigItem(default=0.0)
in... |
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the abbreviation function below.
def abbreviation(a, b):
A = [[None for j in range(len(b))] for i in range(len(a))]
if a[0].upper() == b[0]:
A[0][0] = True
else:
A[0][0] = False
upper_encountered = a[0]... |
# code-checked
# server-checked
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision.models import resnet
def init_weights(m):
if isinstance(m, nn.Conv2d) or isinstance(m, nn.Linear):
m.weight.data.normal_(0, 1e-3)
if m.bias is not None:
m.bias.data.zero_... |
# coding=utf-8
class TMDbType:
pass
|
import contextlib
import os
import sys
import click
import yaml
from dagster.utils.indenting_printer import IndentingStringIoPrinter
if sys.version_info.major >= 3:
from io import StringIO # pylint:disable=import-error
else:
from StringIO import StringIO # pylint:disable=import-error
def _construct_yml(e... |
import functools
import re
import os
from jsonschema import validate, draft7_format_checker
import jsonschema.exceptions
import json
from flask import (
Blueprint, g, request, session, current_app, session
)
from passlib.hash import argon2
from sqlalchemy.exc import DBAPIError
from sqlalchemy import or_
from flas... |
import os
from galaxy.util import galaxy_root_path
from .framework import (
selenium_test,
SeleniumTestCase
)
STOCK_TOURS_DIRECTORY = os.path.join(galaxy_root_path, "config", "plugins", "tours")
class TestStockToursTestCase(SeleniumTestCase):
# Test doesn't pass consistently on Jenkins yet, something i... |
class tube(object) :
# tube is-a shape
def __init__(self,Dt_mm,Ltw_mm,Lt_mm):
self.Dt_mm = Dt_mm #Tube outer diameter, mm
self.Ltw_mm = Ltw_mm #Tube wall thickness, mm
self.Dti_mm = Dt_mm - 2 * Ltw_mm #Tube inner diameter, mm
self.Lt_mm = Lt_mm #Tube length of Active Heat Transfer Area, ... |
from multiprocessing import cpu_count
# socket
bind = "127.0.0.1:8000"
# Worker options
workers = cpu_count() * 2 + 1
worker_class = "uvicorn.workers.UvicornWorker"
loglevel = "debug"
|
# Copyright (c) Django Software Foundation and individual contributors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright not... |
#!/usr/bin/env python
""" Problem 39 daily-coding-problem.com """
class GameOfLife:
def __init__(self, cells=[], steps=5):
self.cells = cells
self.steps = steps
def start(self):
for _ in range(self.steps):
print(self)
self.next_tick()
def next_tick(self):
... |
#-*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os
import sys
PY3 = sys.version_info[0] == 3
if PY3:
install_requires = ["six"]
else:
install_requires = ["six", "simplejson"]
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
setup(
name='yandexwebdav',
... |
import json
import os.path
from datetime import datetime
import threading
import time
# ChatLogger
create_json_file = True
threadLock = threading.Lock()
def logToFile(history, userid):
thread = threading.Thread(target=__appendToLogFile, args=[history, userid])
thread.daemon = False
thread.run()
def __a... |
# Constants
NB_ROOMS = 4
NB_ZONES = 4
DIMENSION = [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 120, 180, 210, 241]
DIMENSION_SIZE = len(DIMENSION)
INFINITY_IDX = DIMENSION.index(241)
MIN_TAU_VALUE = 5
MAX_NB_DEVICES = 6
URGT_TIME = 30
T_SYNCHRO = 30
THIRTY_SECONDS = 30
TWO_MINUTS = 120
THREE_HOURS = 180
TIMEO... |
#-------------------------------------------------------------------------------
# Copyright 2017 Cognizant Technology Solutions
#
# 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:... |
import os
import math
import discord
from discord.ext import menus
class ViewMenu(menus.Menu):
def __init__(self, *, auto_defer=True, **kwargs):
super().__init__(**kwargs)
self.auto_defer = auto_defer
self.view = None
self.__tasks = []
def button_check(self, interaction):
... |
import discogs_client
import json
import libtmux
import os
import subprocess
import shutil
import time
from dotenv import dotenv_values
from PIL import Image
from imgcat import imgcat
from rich import print, box
from rich.console import Console
from rich.table import Table
# from rich.rule import Rule
def get_info(s... |
from .stream_interface import TDKLambdaGenesysStreamInterface
__all__ = ['TDKLambdaGenesysStreamInterface']
|
# Script to grab data from HYCOM model and save it.
from __future__ import division
import netCDF4 as nc
import datetime
import os
import numpy as np
SAVE_DIR = '/ocean/nsoontie/MEOPAR/HYCOM/'
HYCOM_URL = 'http://nomads.ncep.noaa.gov:9090/dods/rtofs/'
FILENAMES = ['rtofs_glo_2ds_{}_3hrly_diag', # ssh files
... |
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
from interfaceBuilder import interface
from interfaceBuilder import file_io
from interfaceBuilder import inputs
from interfaceBuilder import utils as ut
class Structure():
"""
Class for holding structure data from a general simulation... |
#!/usr/bin/env python
import click
import os
import codecs
import json
from nlppln.utils import create_dirs, out_file_name, get_files
@click.command()
@click.argument('in_dir', type=click.Path(exists=True))
@click.option('--out_dir', '-o', default=os.getcwd(), type=click.Path())
@click.option('--mode', default='word... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pyoverwatch import app
# app.run(use_reloader=False, ssl_context='adhoc')
app.run(use_reloader=True)
|
from pyomo.core.base import ConcreteModel, Set, Param, NonNegativeReals, Reals, Var, Binary, Constraint
from pyomo.environ import inequality
from ...simulation.individual.hwt import HWT
def factory(model: ConcreteModel, name: str, hwt: HWT, **kwargs):
def s(key, value):
setattr(model, name+'_'+key, value)... |
from waldur_core.core import WaldurExtension
class MarketplaceVMwareExtension(WaldurExtension):
@staticmethod
def django_app():
return 'waldur_mastermind.marketplace_vmware'
@staticmethod
def is_assembly():
return True
|
__all__=['grad_reverse', 'svhn2mnist', 'syn2gtrsb', 'usps'] |
# -*- coding: utf-8 -*-
# Copyright 2019 ICON Foundation
#
# 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 o... |
"""
* Copyright 2020, Maestria de Humanidades Digitales,
* Universidad de Los Andes
*
* Developed for the Msc graduation project in Digital Humanities
*
* This program 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 Foun... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Project: Macaron O/R Mapper
# Module: Tests
"""
Testing for basic usage.
"""
import unittest, warnings
import macaron
from models import Team, Member, Song
DB_FILE = ":memory:"
class TestQueryOperation(unittest.TestCase):
names = [
("Ritsu" , "Tainaka" , "... |
# conding: utf-8
# paramiko
# windows ssh http://www.freesshd.com/, putty
# http://www.techrepublic.com/blog/tr-dojo/set-up-a-free-ssh-server-on-windows-7-with-freesshd/
# http://www.janaka.co.uk/2012/12/how-to-configure-freesshd-on-windows.html
#
# Win:
# https://www.youtube.com/watch?v=Zei2DPCnMl4
# https://askubu... |
import hcuppy.utils as utils
import string
class CPT:
def __init__(self):
fn = "data/cpt_sections.csv"
self.cpt2sect = utils.read_cpt_sect(fn)
def download_data(self):
utils.download_cpt()
def get_cpt_section(self, x_lst):
output_type = "list"
if not isinstance(x... |
from django.http import HttpRequest, HttpResponse
from zerver.decorator import internal_notify_view
from zerver.lib.email_mirror import mirror_email_message
from zerver.lib.exceptions import JsonableError
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success
@internal... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.