text stringlengths 957 885k |
|---|
<gh_stars>10-100
import unittest
import time
import winsound
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from configparser import ConfigParser
interval = 60
bad_interval = 60
number_fail = 0
iteration = 0
count = None
count2 = None
username = ""
driver_path = ""
password = ""
window_... |
<reponame>jensenbox/python-jamf
# coding: utf-8
"""
Jamf Pro API
## Overview This is a sample Jamf Pro server which allows for usage without any authentication. The Jamf Pro environment which supports the Try it Out functionality does not run the current beta version of Jamf Pro, thus any newly added endpoint... |
<reponame>zbmain/PGL
# Copyright (c) 2020 PaddlePaddle 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
#
# Unle... |
<gh_stars>10-100
from rtruffle.source_section import SourceSection
from som.compiler.method_generation_context import MethodGenerationContextBase
from som.interpreter.ast.nodes.field_node import create_write_node, create_read_node
from som.interpreter.ast.nodes.global_read_node import create_global_node
from som.inte... |
<gh_stars>0
#
# HyperParemeters container class
# Copyright EAVISE
#
import logging
import importlib.util
from collections import Iterable
import torch
__all__ = ['HyperParameters']
log = logging.getLogger(__name__)
class HyperParameters:
""" This class is a container for training hyperparameters.
It al... |
<gh_stars>1-10
# -------- BEGIN LICENSE BLOCK --------
# Copyright 2022 FZI Forschungszentrum Informatik
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above cop... |
import time
from typing import List
from narwhallet.core.kcl.transaction.input import MTransactionInput
from narwhallet.core.kcl.transaction.output import MTransactionOutput
class MTransaction():
def __init__(self):
self._txid: str = None
self._hash: str = None
self._version: int = None
... |
<reponame>mphoward/relentless<gh_stars>0
"""
Math functions
==============
This module implements some convenience objects for mathematical operations.
.. autosummary::
:nosignatures:
Interpolator
KeyedArray
.. autoclass:: Interpolator
:members:
.. autoclass:: KeyedArray
:members:
"""
import nu... |
import os, sys, re, types, copy, warnings, inspect, logging, glob, gzip
from collections import OrderedDict as odict
import collections
# Python 2/3 Compatibility
try: import ConfigParser as configparser
except: import configparser
import numpy
import pandas
import sqlalchemy
import sqlalchemy.exc as exc
import sqla... |
# Copyright (c) 2012 Spotify AB
#
# 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, s... |
#!/usr/bin/env python3
__author__ = 'tomarovsky'
import numpy as np
import matplotlib.pyplot as plt
plt.ioff()
from argparse import ArgumentParser
def draw_plot_by_window_stats(input_file, output_prefix, metric, separator="\t", min_x=None, max_x=None, min_y=None,
max_y=None, extensions=["png", "svg"], ... |
# Copyright (c) 2015, Narrative Science
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions a... |
<gh_stars>1-10
# Generated by Django 2.2.3 on 2019-12-27 16:23
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='CallType',
... |
# -*- coding: utf-8 -*-
"""
equip.analysis.constraint.container
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Constraint container.
:copyright: (c) 2014 by <NAME> (@rgaucher)
:license: Apache 2, see LICENSE for more details.
"""
import opcode
from ...utils.log import logger
from ..graph import Tree, TreeNode
from .... |
import time
USBI2C_error_messages = {
b'a': "NACK received",
b'A': "Invalid address",
b'L': "Invalid length",
b'C': "Unknown command",
b'U': "Unknown escape sequence",
b'T': "Timer expired"
}
class AdapterResponseException(Exception):
def __init__(self, char):
self.char = char
def __str__(self):
if sel... |
<reponame>TheLiteCrafter/AsepriteInstaller_Updater
from pathlib import Path
from tkinter import *
from tkinter import messagebox
from configparser import ConfigParser
import subprocess
import os
import zipfile
import sys
class MyDialog:
def __init__(self, parent, ttt):
top = self.top = Toplevel(parent)
... |
<filename>tools/py/serial/simpleobj.py
# versa.serial.csv
"""
Serialize and deserialize between a Versa model and CSV
Import as:
from versa.serial.csv import parse as csv_parse
"""
import re
import json
import logging
import operator
from operator import truth
from itertools import chain, islice, repeat, starmap, ... |
import csv
import os
import time
import unittest
from selenium.webdriver.support.select import Select
from Data.parameters import Data
from get_dir import pwd
from reuse_func import GetData
class Test_logs(unittest.TestCase):
@classmethod
def setUpClass(self):
self.data = GetData()
self.p =... |
<reponame>yaso9/vroom-scripts
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import sys
from utils.format_input import write_files
from utils.overpass import node_coordinates_bb, node_coordinates_city
def name_if_present(n):
if "name" in n["tags"]:
return n["tags"]["name"]
else:
... |
<gh_stars>1-10
# Utilities
import os
import logging
import attr
import hashlib
from enum import Enum
# Telegram bot API
import telegram
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackQueryHandler
# Support modules
from sheetmanager import SheetManager, DataSheetEnum
from inlinesele... |
<reponame>lit26/bokeh_fin
import pandas as pd
import yfinance as yf
from bokeh.layouts import column
from bokeh.models import (
BooleanFilter,
CustomJS,
ColumnDataSource,
CDSView,
HoverTool,
CrosshairTool,
NumeralTickFormatter,
)
from bokeh.plotting import figure, show
import os
INDEX_COL =... |
<gh_stars>1-10
import argparse
import http.server
import inspect
import random
import string
import threading
def main(handler):
app = HyperToyApp(handler)
pretty_ports = ','.join(map(str, app.ports))
print("Listening on {}:{}".format(app.host, pretty_ports))
app.run()
class HyperToyApp(object):
def __in... |
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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 t... |
<filename>profit/run/zeromq.py
""" zeromq Interface
Ideas & Help from the 0MQ Guide (zguide.zeromq.org, examples are licensed with MIT)
"""
from .runner import RunnerInterface
from .worker import Interface
import zmq
import numpy as np
import json
from time import sleep
from logging import Logger
import os
@Runner... |
<reponame>ebenh/django-flex-user
from rest_framework.test import APITestCase
from rest_framework import status
class TestFlexUserRetrieveUpdate(APITestCase):
"""
This class is designed to test django_flex_user.views.FlexUser
"""
_REST_ENDPOINT_PATH = '/api/accounts/users/user/'
def test_method_ge... |
<filename>source/sagemaker/src/package/data_privatization/container/train.py
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: LicenseRef-.amazon.com.-AmznSL-1.0
# Licensed under the Amazon Software License http://aws.amazon.com/asl/
import argparse
import os
from os... |
import torch
import numpy as np
import os
import torch.nn as nn
from torch.optim.lr_scheduler import ReduceLROnPlateau, MultiStepLR
from sklearn.metrics import confusion_matrix
from utils import make_log_name
class TrainerFactory:
def __init__(self):
pass
@staticmethod
def get_trainer(method, **k... |
<filename>tdd/app/drl/t_holt_winters.py
import unittest
import matplotlib.pyplot as plt
from app.drl.holt_winters import HoltWinters
class THoltWinters(unittest.TestCase):
def test_weighted_average(self):
holt_winters = HoltWinters()
series = [3.0, 10.0, 12.0, 13.0, 12.0, 10.0, 12.0]
weight... |
<filename>bigtable/tests/unit/test_instance.py<gh_stars>1-10
# Copyright 2015 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... |
<filename>CsvPlotter/internal/configuration.py
from .utils import Range
def _get_or_default(cfg_obj, key, default=None, conv=None):
if key not in cfg_obj or cfg_obj[key] is None:
return default
v = cfg_obj[key]
if conv is not None:
return conv(v)
return v
def _assign_range(rng, obj):... |
"""Ref
https://github.com/bamos/densenet.pytorch
"""
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
import torchvision.models as models
import torchvision.datasets as dset
import torchvision.transforms as transforms
from torchvision.u... |
<reponame>TongjiZhanglab/wwang_bioinfo_tools
#! /usr/bin/env python3
# Nov-1-2018
# MD5 auto check on server
import os, sys
import subprocess
import threading
from distutils.spawn import find_executable
def plotform_check():
operation_system = sys.platform
if operation_system == "darwin":
checksumC... |
<gh_stars>0
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from flatstar import draw
REQUIRED_INTENSITY_PRECISION = 1E-6
IMPLEMENTED_LD_LAWS = ["linear", "quadratic", "square-root", "log", "exp",
"sing", "claret"]
N_LAWS = len(IMPLEMENTED_LD_LAWS)
TEST_COEFFICIENTS = [np.ra... |
<reponame>garlico-in/electrum-grlc<filename>electrum_grlc/plugins/coldcard/basic_psbt.py
#
# basic_psbt.py - yet another PSBT parser/serializer but used only for test cases.
#
# - history: taken from coldcard-firmware/testing/psbt.py
# - trying to minimize electrum code in here, and generally, dependancies.
#
import io... |
"""
Stack-In-A-WSGI: stackinawsgi.admin.admin.StackInAWsgiSessionManager
"""
import datetime
import json
import unittest
import ddt
from stackinabox.services.service import StackInABoxService
from stackinabox.services.hello import HelloService
from stackinawsgi.admin.admin import StackInAWsgiAdmin
from stackinawsgi.... |
<filename>hippie.py
import sublime
import sublime_plugin
from collections import defaultdict
import re
VIEW_TOO_BIG = 1000000
WORD_PATTERN = re.compile(r'(\w{2,})', re.S) # Start from words of length 2
words_by_view = {}
words_global = set()
last_view = None
initial_primer = ""
matching = []
last_index = 0
history =... |
<gh_stars>1-10
#Author: <NAME>
#Descriptions: Interface class to varous data format formats (locations, rucio, s3,...)
#import sys
#import datetime
#import os
import json
class Templater():
def __init__(self):
self._template_configuration = None
self._config_path = None
self._eval_list = ... |
<gh_stars>0
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2017, UniFrac development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------... |
# TODO: Implement session state to control test and next button
# TODO: Show results in the plot
# TODO: Conditional coloring in the plot
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rcParams
from . import equity
rcParams["font.family"] = "monospace"
SUITS_COLORS = {"s": "k", "h": "r",... |
<reponame>kellyhirano/flp<filename>weather.py
#!/usr/bin/env python3
import configparser
import json
import time
import paho.mqtt.client as mqtt
import fourletterphat as flp
# Global for data storage
g_mqtt_data = {}
def on_connect(client, userdata, flags, rc):
"""The callback for when the client receives a CON... |
<filename>pyRdfa/options.py
# -*- coding: utf-8 -*-
"""
L{Options} class: collect the possible options that govern the parsing possibilities. The module also includes the L{ProcessorGraph} class that handles the processor graph, per RDFa 1.1 (i.e., the graph containing errors and warnings).
@summary: RDFa parser (dis... |
<reponame>e-koch/Phys-595<filename>project_code/Spec Fitting/post_proc_specfit.py
'''
Post-process spectral line fitting results
'''
import numpy as np
from pandas import read_csv, Series, concat
import shutil
def concat_csvs(file_list, output_name, save=True):
'''
Concatenate csv files.
'''
data =... |
import numpy
import os
from pylab import plot, show, bar
from scipy import stats
from sklearn import svm
from sklearn.datasets import make_multilabel_classification
from sklearn.multiclass import OneVsRestClassifier
from sklearn.model_selection import GridSearchCV
from sklearn.ensemble import RandomForestClassifier
f... |
###############################################################################
# Author: <NAME>
# Project: Multi-task Match Tensor: a Deep Relevance Model for Search
# Date Created: 7/29/2017
#
# File Description: This script contains code related to the sequence-to-sequence
# network.
#########################... |
"""
.. codeauthor:: <NAME> <<EMAIL>>
"""
import itertools
import pytest
from pathvalidate import ascii_symbols, replace_symbol, unprintable_ascii_chars, validate_symbol
from pathvalidate._symbol import validate_unprintable
from pathvalidate.error import ErrorReason, ValidationError
from ._common import alphanum_cha... |
<filename>GearBot/Util/Actions.py<gh_stars>10-100
from discord import Member
from Util import Translator, MessageUtils, Utils, Emoji
class ActionFailed(Exception):
def __init__(self, message) -> None:
super().__init__()
self.message = message
async def act(ctx, name, target, handler, allow_bot... |
<gh_stars>1-10
import random
# stolen from https://github.com/arizonatribe/word-generator
class Words:
words = {
"nouns": [
"aardvark",
"aardwolf",
"ability",
"abroad",
"abuse",
"accentor",
"access",
"accident",
"acco... |
<filename>Models_mnist.py
import torch
import torch.nn.functional as F
from MultiOctConv.model import MultiOctaveConv
"""
MNist classifier with their traditional convolution replaced for M-OctConv
input:
full: boolean that indicate if the fully conected layer should be added in to de model
"""
class M_OctConv_MNIS... |
<filename>meu_grafo_matriz_adjacencia_dir.py<gh_stars>0
from bibgrafo.grafo_matriz_adj_dir import GrafoMatrizAdjacenciaDirecionado
from bibgrafo.grafo_exceptions import *
from copy import deepcopy, copy
class MeuGrafo(GrafoMatrizAdjacenciaDirecionado):
def verticesAdjacentes(self, V=''):
'''
Provê... |
<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# -*- encoding: utf-8 -*-
#
# Copyright (c) 2020 <EMAIL>
#
# 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.o... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>.
Department of Aerodynamics
Faculty of Aerospace Engineering
TU Delft, Delft, Netherlands
"""
import sys
if './' not in sys.path: sys.path.append('./')
from root.config.main import *
from objects.CSCG._3d.master import MeshGenerator, SpaceInvoker, ... |
<filename>archivebox/index/__init__.py
__package__ = 'archivebox.index'
import os
import shutil
import json as pyjson
from pathlib import Path
from itertools import chain
from typing import List, Tuple, Dict, Optional, Iterable
from collections import OrderedDict
from contextlib import contextmanager
from urllib.pars... |
<reponame>mhndlsz/memodrop<filename>categories/tests.py
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.test import TestCase, Client
from django.urls import reverse
from braindump.models import CardPlacement
from cards.models import Card
from categories.mod... |
<reponame>Sensirion/python-i2c-sen5x<filename>sensirion_i2c_sen5x/response_types.py
# -*- coding: utf-8 -*-
# (c) Copyright 2022 Sensirion AG, Switzerland
import logging
log = logging.getLogger(__name__)
class Sen5xMassConcentration:
"""
Represents a SEN5x measurement response for the particulate matter mass... |
<filename>code/gym_envs/gym_envs/jaco_env/reaching.py
import os
import copy
from gym import spaces
import numpy as np
import pybullet as p
from .env import RobotEnv
from .env_description import ObservationShapes, ActionShapes, RewardFunctions
class ReachingEnv(RobotEnv):
def __init__(
self,
rando... |
# Copyright 2015 <NAME>
# 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 writin... |
# Pomito - Pomodoro timer in steroids
# A simple console UI plugin
import cmd
import logging
import click
from pomito.plugins import ui
# pylint: disable=invalid-name
logger = logging.getLogger("pomito.plugins.ui.console")
_POMODORO_SERVICE = None
def _get_pomodoro_service():
"""Gets pomodoro service."""
i... |
<filename>ui/CounterfactualInterface/CounterfactualInferfaceWorker.py
# Author: <NAME>
# this class handles to run the counterfactual generation
# it is needed because this process takes time enough to freeze the interface,
# so, this class is used to be instantiated in another thread
from .CounterfactualInterfaceEnu... |
<filename>Movement/config.py<gh_stars>1-10
'''
Copyright HiWonder
LewanSoul Bus Servo Communication Protocol
1.Summary
Using an asynchronous serial communication bus, theoretically, up to 253 robot Bus Servos can be
daisy chain connected into the bus, you can control them individually through the UART
asynchron... |
<filename>otdd/pytorch/functionals.py
################################################################################
############### COLLECTION OF FUNCTIONALS ON DATASETS ##########################
################################################################################
import numpy as np
import torch
class ... |
"""Tests the encoding of domain information into the embedding"""
# The tests are verbose, but they are not intended to read exhaustively
# anyway. When reading particular failing examples, verbosity is good.
# pylint:disable=too-many-lines
from pytest import approx
from infrastructure import InfrastructureNetwork
f... |
<reponame>raphiz/bsAbstimmungen
from . import utils
from datetime import datetime
import os
import re
import requests
import logging
from bs4 import BeautifulSoup
from ..exceptions import ParserException, AlreadyImportedException
logger = logging.getLogger(__name__)
def fetch(db, fromDate, toDate, directory='build/c... |
#!/usr/bin/env python
"""
Fraunhofer IML
Department Automation and Embedded Systems
Tabsize : 4
Charset : UTF-8
"""
__author__ = "<NAME>"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
from MARSEntity import MARSEntity
from NodeLaunchException import NodeLaunchException
import rospy... |
import math
import os
import random
import shutil
import pandas as pd
from Preprocessor import Preprocessor
from VSM import VSM
def build_package_index():
vista_code = "G:\Download\VistA-M-master\Packages"
index = {}
code_path = {}
packages = os.listdir(vista_code)
for pk in packages:
pk... |
<filename>galaxydb/statics.py
def bytes_needed(num):
i = 1
while True:
if num < 2**(8*i):
return i
i += 1
def zeros_needed_fmt(num):
num = 2**(8*num)
zeros = str(num)
return r"{:0"+str(len(zeros))+r"d}"
def max_int_bytes(b):
return 2**(8*b)
def prin... |
# Copyright 2019, <NAME>, mailto:<<EMAIL>>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... |
'''
Author: <NAME>
GitHub: https://github.com/josephlyu
The dash app and layout for the index page.
'''
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output
from layouts import layout_uk, la... |
import time
# the pounce language runtime
def run(pl, debug = False, test_value_stack = []):
global words
vs = []
while pl != None and len(pl) > 0:
next = pl[0];
pl = pl[1:]
if debug:
print('about to', vs, next)
time.sleep(0.3)
if isValue(nex... |
# -*- coding: utf-8 -*-
# pylint: disable=missing-docstring,unused-import,reimported
import pathlib
from unittest import mock # pylint: disable=no-name-in-module
import pytest # type: ignore
import scale_html_map_area_coords.scale_html_map_area_coords as do
def test_apply_scaling_ok_string():
assert do.apply_... |
<reponame>derezin/DPPy<filename>dppy/exotic_dpps_core.py
# coding: utf8
""" Core functions for
- Uniform spanning trees
* :func:`ust_sampler_wilson`
* :func:`ust_sampler_aldous_broder`:
- Descent procresses :class:`Descent`:
* :func:`uniform_permutation`
- :class:`PoissonizedPlancherel` measure
* ... |
from testing.test_interpreter import BaseTestInterpreter
import py
py.test.skip("hash module unavailable")
class TestArray(BaseTestInterpreter):
def test_md2(self):
output = self.run('''
echo hash("md2", "php");
''')
space = self.space
assert space.str_w(output[0]) == "0c4... |
<reponame>rezabfilTUM/EyeCandy<gh_stars>0
import os
import time
from Settings import Settings
from BrightnessManager import BrightnessManager
from Battery import Battery
class PowerSaver:
def __init__(self, args=None):
self.setup(args)
def setup(self, args=None):
'''Set up arguments to be us... |
<filename>store/http.py<gh_stars>0
import multiprocessing
import os
import sys
import time
import fooster.web
import fooster.web.file
import fooster.web.json
import fooster.web.page
from store import config, lock, storage
fooster.web.file.max_file_size = config.max_size
alias = '(?P<alias>[a-zA-Z0-9._-]+)'
namesp... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# cython: language_level=3
"""
Example using WrapBokeh
"""
import logging
logger = logging.getLogger("TMI.login")
from bokeh.layouts import row, layout, Spacer, widgetbox, column
from bokeh.models.widgets.inputs import TextInput, PasswordInput
from bokeh.models.widgets.butto... |
import discord, random, httpx
from discord.ext import commands
from lxml import html
class MmangaModule(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name='mmanga', aliases=['mavimanga'])
async def mSearch(self, ctx, *, mname):
mname = mname.replace(" ", "-")
... |
# -- coding: utf-8 --
# MIT License
#
# Copyright (c) 2019 <NAME>
#
# 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... |
<gh_stars>1000+
import sys
import OmniDB_app.include.OmniDatabase as OmniDatabase
import OmniDB_app.include.Spartacus.Utils as Utils
from django.contrib.auth.models import User
from OmniDB_app.models.main import *
from datetime import datetime
from django.utils.timezone import make_aware
import django.db.transaction... |
import platform
from application import log
from flask import Flask, request, send_file
from sipsimple.account import Account, BonjourAccount, AccountManager
from sipsimple.configuration import DuplicateIDError
from sipsimple.configuration.settings import SIPSimpleSettings
from sipsimple.core import Engine
from sipsi... |
import sys
import os
import json
import numpy as np
from datetime import datetime
from ctypes import POINTER, CDLL, c_void_p, c_int, cast, c_double, c_char_p
from copy import deepcopy
from .generate_c_code_explicit_ode import generate_c_code_explicit_ode
from .generate_c_code_implicit_ode import generate_c_code_impl... |
<gh_stars>0
#!/usr/bin/env python3
# encoding: utf-8
"""
ARC's main module.
To run ARC through its API, first make an instance of the ARC class, then call the .execute() method. For example::
arc0 = ARC(project='ArcDemo', arc_species_list=[spc0, spc1, spc2])
arc0.execute()
Where ``spc0``, ``spc1``, and ``spc2`` ... |
<gh_stars>10-100
import argparse
import torch
from util import str2bool
parser = argparse.ArgumentParser(description='UED')
# PPO Arguments.
parser.add_argument(
'--algo',
type=str,
default='ppo',
choices=['ppo', 'a2c', 'acktr', 'ucb', 'mixreg'],
help='Which RL algorithm to use')
parser.add_arg... |
from flask_jwt_extended import JWTManager
from flask_restful import Api
from flask import Flask, jsonify
from Endpoints import User, EdgeDevice, SensorDevice, Sensor, SensorData
from TableStorage.TableStorageConnection import AzureTableStorage
from flask_cors import CORS
import Settings.Salt as salt
app = Flask(__name... |
<gh_stars>0
#!/usr/bin/env python
import os
import sys
import glob
import shutil
import platform
import tempfile
import subprocess
ALL_PY_VERSIONS = ["3.5", "3.6", "3.7", "3.8"]
SKIP_PY_VERS = os.environ.get("SKIP_PY_VERS", "").split(",")
if 'PYPI_USERNAME' not in os.environ:
print("\n!!! Please set PYPI_USERN... |
'''reports details about a virtual boinc farm'''
# standard library modules
import argparse
import collections
#import contextlib
#from concurrent import futures
#import errno
import datetime
#import getpass
#import json
import logging
#import math
#import os
#import re
#import socket
#import shutil
#import signal
impo... |
<filename>bridges/data_src_dependent/osm.py
import math
from bridges.graph_adj_list import *
class OsmEdge:
"""
@brief Class that hold Open Street Map edges
Class that holds Open Street Map edges from https://openstreetmap.org
This object is generally not created by the user, to see how its
... |
import contextlib
import logging
import threading
import uuid
from concurrent.futures.thread import ThreadPoolExecutor
from io import BytesIO
from keeper.storage.storage import Storage
from keeper.storage.streams import WriteOnlyStream, ReadOnlyStream
logger = logging.getLogger(__name__)
class WriteCacheStorage(Sto... |
from PyQt5.QtWidgets import (
QApplication,
QWidget,
QHBoxLayout,
QVBoxLayout,
QDesktopWidget,
QPushButton,
QLabel,
QTabWidget,
QMenu, QAction, QTextEdit, QFileDialog, QListWidget, QListWidgetItem, QCheckBox)
from PyQt5.QtGui import QPixmap, QCursor
from PyQt5.QtCore import QSize, QT... |
<filename>dodo.py
#!/usr/bin/env python3
import os
import re
import pwd
from doit import get_var
from ruamel import yaml
from api.config import _update_config, CONFIG_YML, DOT_CONFIG_YML
from utils.format import fmt, pfmt
from utils.timestamp import utcnow, datetime2int
DIR = os.path.dirname(os.path.abspath(__fil... |
# -*- coding: utf-8 -*-
import unittest
from mock import Mock
import cloud4rpi
from cloud4rpi.errors import InvalidConfigError
from cloud4rpi.errors import UnexpectedVariableTypeError
from cloud4rpi.errors import UnexpectedVariableValueTypeError
class ApiClientMock(object):
def __init__(self):
def noop_o... |
# 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, software
# distributed under t... |
<reponame>KonstantinosAnd/emoFeatExtract
"""This is a test script for emoFeatExtract.py"""
"""In this script, after the feature extraction,
the K-folds cross-validation
technique is used, where K == 24 is the
number of different speakers on the RAVDESS
database. Currently we classificate the samples on binary Activatio... |
<filename>torque/commands/configure.py
import getpass
import logging
from docopt import DocoptExit
from torque.client import TorqueClient
from torque.commands.base import BaseCommand
from torque.constants import TorqueConfigKeys
from torque.exceptions import ConfigFileMissingError
from torque.parsers.global_input_par... |
import sys
import pandas as pd
import numpy as np
from sqlalchemy import create_engine
# How to process duplicates
keepDuplicatesStrategy = "first"
def load_data(messages_filepath, categories_filepath):
""" Load the data from the passed paths to csv files.
Args:
messages_filepath: Path to the messages csv... |
from os.path import dirname, realpath, join
from datetime import date
from tkinter import (Tk, Frame, Button, Label, Spinbox, font, PhotoImage)
CURRENT_DIR = dirname(realpath(__file__))
CALC_PNG = join(CURRENT_DIR, 'imgs', 'calc.png')
USER_PNG = join(CURRENT_DIR, 'imgs', 'user.png')
def get_formated_date():
curre... |
from FINE.component import Component, ComponentModeling
from FINE import utils
import warnings
import pyomo.environ as pyomo
import pandas as pd
class Transmission(Component):
"""
Doc
"""
def __init__(self, esM, name, commodity, losses=0, distances=None,
hasCapacityVariable=True, capa... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 31 09:43:04 2019
@author: NG7a8f3
"""
import random
#Diese Funktion nimmt einen Int und ein Rundungslevel
#Der Int wird als Kreuzer intepretiert.
#Es wird dann ein String zurück gegeben der die umwandlung in Dukaten Silber
#Heller und Kreuzer unter Berücksicht... |
import os
import shlex
import shutil
import subprocess
from typing import List, Dict
from xml.etree import ElementTree
class OutputParser:
def __init__(self, xml: str):
self.xml = xml
def get_addresses(self) -> List[Dict[str, str]]:
"""
Several things need to happen for an address to ... |
from fractions import Fraction
from functools import reduce
from itertools import chain
import logging
from math import gcd, copysign, floor, log, log2
from operator import add, mul
import random
import sys
import time
from mpyc.runtime import mpc
from mpyc.sectypes import SecureInteger
from mpyc.finfields... |
<reponame>MiWeiss/probability
# Copyright 2021 The TensorFlow Probability 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
#
# Unles... |
<reponame>zte-lhg/chromium_org
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# hostsutil.py: Start a TUI session of `Hosts Setup Utility`.
#
# Copyleft (C) 2014 - huhamhire <<EMAIL>>
# =====================================================================
# Licensed under the GNU General Public License, version 3. Yo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.