text stringlengths 957 885k |
|---|
# Copyright (c) 2020 Cisco and/or its affiliates.
# This software is licensed to you under the terms of the Cisco Sample
# Code License, Version 1.1 (the "License"). You may obtain a copy of the
# License at
# https://developer.cisco.com/docs/licenses
# All use of the material herein must be in accord... |
import testing.parity
import unittest
import json
import urllib.request
import time
import os
class TestParity(unittest.TestCase):
def test_basic(self):
try:
# start postgresql server
parity = testing.parity.ParityServer(network_id=42)
self.assertIsNotNone(parity)
... |
<reponame>bching/oppia
# coding: utf-8
#
# Copyright 2016 The Oppia 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/LICEN... |
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.test import TestCase
from django.contrib.auth.models import Permission
from django.core import mail
from mapentity.factories import SuperUserFactory, UserFactory
from geotrek.common.tests import CommonTest, Translatio... |
# Lint as: python2, python3
# Copyright 2018 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
#
... |
<reponame>fossabot/SeeO-K<filename>src/weather.py
import requests
import gtts
from bs4 import BeautifulSoup
import re
"""
네이버 날씨 크롤링을 통해, 현재 위치의 날씨와 오전, 오후 강수확률을 갖고와 TTS를 생성해준다.
그리고 강수확률이 50% 이상인지 아닌지를 판단하여, 우산을 챙겨야하는지 아닌지 여부를 판단하고 TTS를 생성해준다.
@author : 이도원
@version 1.0.0
"""
def weather():
"""
:return now_te... |
"""
Copyright (c) 2016, 2017 - o2r project
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 ... |
# -*- coding: UTF-8 -*-
# *****************************************************************************
# Copyright (C) 2006-2020 <NAME>. <<EMAIL>>
# Copyright (C) 2020 <NAME>. <<EMAIL>>
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of ... |
"""Base Integration for Cortex XSOAR - Unit Tests file
Pytest Unit Tests: all funcion names must start with "test_"
More details: https://xsoar.pan.dev/docs/integrations/unit-testing
You must add at least a Unit Test function for every XSOAR command
you are implementing with your integration
"""
import json
import ... |
import math
import matplotlib.pyplot as plt
import numpy as np
import random
import time
from collections import defaultdict
from euclid import Circle, Point2, Vector2, LineSegment2
from itertools import combinations
from . import svg
class GameObject(object):
def __init__(self, position, speed, obj_type, radiu... |
from py4j.java_gateway import JavaGateway, JavaObject, GatewayParameters
from py4j.java_gateway import java_import, get_field
'''
Usage:
from sagas.bots.hanlp_procs import Hanlp, hanlp, hanlp_c
'''
class Hanlp(object):
def __init__(self):
host="localhost"
port=2333
callback_port=2334
... |
# Copyright 2011 Viewfinder Inc. All Rights Reserved.
"""Tests for Job class.
"""
__author__ = '<EMAIL> (<NAME>)'
import time
from viewfinder.backend.base import constants
from viewfinder.backend.base.dotdict import DotDict
from viewfinder.backend.db.job import Job
from viewfinder.backend.db.lock import Lock
from v... |
from nlcontrol.systems.controllers import ControllerBase
from sympy.tensor.array import Array
from simupy.systems.symbolic import MemorylessSystem
class PID(ControllerBase):
"""
PID(inputs=w)
PID(ksi0, chi0, psi0, inputs=inputs)
A nonlinear PID controller can be created using the PID class. This clas... |
<reponame>ardovm/wxGlade
"""
@copyright: 2019-2020 <NAME>
@license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY
"""
from testsupport_new import WXGladeGUITest
import common, clipboard
import unittest, wx, time
class TestEditing(WXGladeGUITest):
"Test for e.g. cut/paste; to be extended..."
... |
"""
This was only used to copy quotes from streamlabs.
Don't use this!
import asyncio
import random
from twitchAPI.twitch import Twitch
from twitchio.ext import commands
from twitchio.message import Message
from config.config_loader import FiZoneBotConfig
from google_sheet import GoogleSheet
# Used to copy quotes ma... |
<filename>meirlop/motif_enrichment.py
from timeit import default_timer as timer
import datetime
import logging
from tqdm import tqdm
import pandas as pd
import numpy as np
import statsmodels.api as smapi
import statsmodels.formula.api as sm
from statsmodels.stats.multitest import multipletests as mt
from sklearn.me... |
<filename>noggin/security/ipa.py
from cryptography.fernet import Fernet
from requests import RequestException
import python_freeipa
from python_freeipa.client_legacy import ClientLegacy as IPAClient
from python_freeipa.exceptions import (
ValidationError,
BadRequest,
FreeIPAError,
PWChangeInvalidPasswor... |
import asyncio
from datetime import datetime
from io import BytesIO
from telethon import events
from telethon.errors import BadRequestError
from telethon.tl.functions.channels import EditBannedRequest
from telethon.tl.types import Channel
import userbot.modules.sql_helper.gban_sql as gban_sql
from userbot i... |
<gh_stars>10-100
# -*- coding: utf-8 -*-
###
# (C) Copyright [2020] Hewlett Packard Enterprise Development LP
#
# 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/licen... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import socket as sock
import tkinter as tk
from datetime import datetime
DATE = datetime.now().strftime('%H:%M - %d/%m/%Y')
SEGOE = 'Segoe 11'
class App(tk.Frame):
def __init__(self, master = None):
super().__init__(master)
self.create_labels()
... |
import numpy
from convenience import reduce_h, find_pcts_multi
from deuces.deuces import Deck, Card
from itertools import combinations, product
import random
all52 = Deck.GetFullDeck()
all_hole_explicit = []
for h in combinations(all52, 2):
all_hole_explicit += [list(h)]
deck_choose_2 = len(all_hole_explicit)
asse... |
<reponame>cjgalvin/deepchem
"""Test normalization of input."""
import numpy as np
import deepchem as dc
from deepchem.metrics import to_one_hot
from deepchem.metrics import from_one_hot
from deepchem.metrics import threshold_predictions
from deepchem.metrics import handle_classification_mode
from deepchem.metrics imp... |
<reponame>johnche/troll-simulator
import scripts.config as conf
import numpy as np
from scripts.tools import generate_sections
from bokeh.palettes import Category20_16
from bokeh.layouts import column, row, WidgetBox
from bokeh.models.widgets import CheckboxGroup, RadioButtonGroup, PreText, Paragraph
from bokeh.models ... |
# Copyright 2016 Hewlett Packard Enterprise Development LP
#
# 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... |
import os
import unittest
from unittest import mock
import click
from click.testing import CliRunner
import aioflask
import aioflask.cli
from .utils import async_test
class TestCli(unittest.TestCase):
@async_test
async def test_command_with_appcontext(self):
app = aioflask.Flask('testapp')
@a... |
<gh_stars>10-100
import numpy as np
import torch as th
from torchvision import utils
from utils.helper_functions import *
import utils.visualization as visualization
import utils.filename_templates as TEMPLATES
import utils.helper_functions as helper
import utils.logger as logger
from utils import image_utils
... |
<gh_stars>10-100
import numpy as np
import tensorflow as tf
from ..agent import Agent
from ..registry import register
from .utils import copy_variables_op
from ...utils.logger import log_scalar
from ...models.registry import get_model
from .utils import normalize, one_hot
from .advantage_estimator.registry import get_a... |
<gh_stars>1-10
import pprint as pp
from learning.NetStrucLner import *
from shannon_info_theory.DataEntropy import *
class MB_BasedLner(NetStrucLner):
"""
MB_BasedLner (Markov Blanket Based Learner) is an abstract class for
learning the structure of a bnet by first finding the markov blanket of
each ... |
"""
The evaluation module for VA-JCR/VA-JCM models. Only works in Python >= 3.5.
Some code is forked from https://github.com/ECHO960/PKU-MMD/blob/master/evaluate.py related to the paper:
<NAME>, <NAME>, <NAME>, <NAME>, and <NAME>, "PKU-MMD: A large scale benchmark for continuous multi-modal human
action unders... |
import tensorflow as tf
import tensorflow.contrib as tc
import numpy as np
from baselines.common.minout import minout
from tensorflow.python.framework import ops
class Model(object):
def __init__(self, name):
self.name = name
@property
def vars(self):
return tf.get_collection(tf.GraphKeys.... |
<filename>storops_test/unity/resource/test_pool.py<gh_stars>10-100
# coding=utf-8
# Copyright (c) 2015 EMC Corporation.
# 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 Li... |
<filename>supplementary_lessons/A_Group/KSEOP/1018_customer_func.py<gh_stars>0
import pymysql as my
class DBMgr:
def __init__(self):
self.initDB()
def initDB(self):
self.conn = my.connect(
host = 'localhost',
user='root',
pass... |
<reponame>Beracah-Group/docker-microservices<filename>services/denting/src/api/v1/denting.py
# import modules, models and configs
from datetime import datetime, timedelta
import re
import jwt
from flask import jsonify, request, abort
# jsonify converts objects to JSON strings
# abort method either accepts an error cod... |
<gh_stars>1000+
# Copyright 2020 Makani Technologies 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 ... |
<reponame>chccc1994/Paddle2ONNX
# 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/LICENS... |
# Copyright 2020 InterDigital Communications, 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 dataclasses import dataclass
from abc import ABC, abstractmethod
from schema import Schema
from typing import Dict, Any, Type, List, Sequence, Optional, Union
import numpy as np
import json
"""
Methods for loadings the various open 3D AV datasets into a common format for use throughout this repo
This is setup f... |
CHAR_DICT = {32: ' ', 33: '!', 34: '"', 35: '#', 36: '$', 37: '%', 38: '&', 39: "'", 40: '(', 41: ')', 42: '*', 43: '+',
44: ',', 45: '-', 46: '.', 47: '/', 48: '0', 49: '1', 50: '2', 51: '3', 52: '4', 53: '5', 54: '6', 55: '7',
56: '8', 57: '9', 58: ':', 59: ';', 60: '<', 61: '=', 62: '>', 63... |
from datetime import timedelta
import ipaddress
import time
import voluptuous as vol
from homeassistant.core import HomeAssistant
from homeassistant.config_entries import ConfigEntry
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.discovery import async_load_platform
from homeassistant... |
<reponame>RULCSoft/cloudroast
"""
Copyright 2018 Rackspace
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 agree... |
import os
import time
import config
import numpy as np
from PIL import Image
import tensorflow as tf
from dataReader import Reader
from model.yolo3_model import yolo
from collections import defaultdict
from yolo_predict import yolo_predictor
from utils import draw_box, load_weights, letterbox_image, voc_ap
# 指定使用GPU的I... |
<gh_stars>0
__author__ = 'artanis'
import os
import sys
import tables
import cv2
import numpy as N
from math import floor, ceil, log
from scipy.ndimage.morphology import distance_transform_edt
from BaseStructuredForests import BaseStructuredForests
from RandomForests import RandomForests
from RobustPCA import robust_p... |
<gh_stars>0
import re
from requests import Session
from xml.etree import ElementTree as ET
class SfdcSession(Session):
_DEFAULT_API_VERSION = "37.0"
_LOGIN_URL = "https://{instance}.salesforce.com"
_SOAP_API_BASE_URI = "/services/Soap/c/{version}"
_XML_NAMESPACES = {
'soapenv': 'http://schema... |
#!/usr/bin/python
#
# File: qrmaker.py
# Author: <NAME>
# Email: <EMAIL>
# Date: 29 Mar 2016
#----------------------------------------------------------------------------
# Install notes:
# > sudo apt-get install python-dev
# > sudo pip install reportlab
#-----------------------------------------------------... |
from smartcard.System import readers
r = readers()[0]
c = r.createConnection()
c.connect()
def hexy(l):
# return ':'.join([f'{x:x}' for x in l])
return ' '.join([f'{x:02X}' for x in l])
print(f"ATR = '{hexy(c.getATR())}'")
# CLA, INS, P1, P2, Lc
NIST_RID = [0xA0, 0x00, 0x00, 0x03, 0x08]
NIST_PIX_PIV_APP ... |
<gh_stars>1-10
#!/usr/bin/env python3
#
# Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
import argparse
import functools
import json
import os
import re
impo... |
<reponame>poloclub/RECAST
from pathlib import Path
from flask import Flask, request, jsonify
from flask_cors import CORS
import string
import collections
import re
from nltk.corpus import stopwords
import nltk
import os
from typing import Tuple, List
from functools import partial
import numpy as np
import pandas as p... |
<reponame>vis-submissions/vis-short-2019_1027
# Powered by Python 2.7
# To cancel the modifications performed by the script
# on the current graph, click on the undo button.
# Some useful keyboard shortcuts:
# * Ctrl + D: comment selected lines.
# * Ctrl + Shift + D: uncomment selected lines.
# * Ctrl + I: indent... |
<reponame>James2250/SMW-MusicNamer<filename>ConvertMusic.py<gh_stars>0
import shutil
import time
import os.path
import sys
from zipfile import ZipFile
SampleFolderName = ""
TxtFileWorkingOn = ""
ZipFileName = ""
ListOfTxtFilePaths = [] #text files per zip folder
ListOfTxtFileNames = []
ListOfBrrFile... |
import importlib
import time
import pandas as pd
import data.dataPrep as dataPrep
import data.dataTransform as dataTransform
from utils.loggingUtils import custom_logger, shutdown_logger
from utils.modelUtils import *
from validation.eval import Evaluator
LOG_FREQ_PERCENT = 0.25
DEFAULT_MODEL_CONFIG = "experiment_co... |
#import matplotlib
#matplotlib.use('Agg')
#import matplotlib.pyplot as plt
#import matplotlib.cm as CM
import os
import numpy as np
from skimage import io;
import glob;
import cv2 ;
import sys;
#from scipy.misc import imresize
#from scipy.ndimage.filters import convolve
from skimage.measure import label
from skima... |
<reponame>pksenpai/Durer<gh_stars>1-10
from torchvision import models, transforms
import torch
from PIL import Image
import torch.nn as nn
import streamlit as st
image_size = 64
batch_size = 32
stats = (0.5, 0.5, 0.5), (0.5, 0.5, 0.5)
latent_size = 150
def denorm(img_tensors):
return img_tensors * stats[1][0] ... |
""" Testing DKI """
from __future__ import division, print_function, absolute_import
import numpy as np
import random
import dipy.reconst.dki as dki
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_almost_equal)
from nose.tools import assert_raises
from dipy.... |
<reponame>plezmo/python-sdk-examples
# Copyright (c) 2019 Gunakar Pvt Ltd
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted (subject to the limitations in the disclaimer
# below) provided that the following conditions are met:
# * Redistribu... |
from django.shortcuts import render
from .forms import CommentForm
from django.shortcuts import get_object_or_404, redirect, render
import requests
from main.models import Book, Comment
import json
from django.views.generic.detail import DetailView
from django.contrib.auth.decorators import login_required
import csv
... |
<filename>Lib/site-packages/elementpath/xpath1_parser.py
#
# Copyright (c), 2018-2020, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensour... |
# Copyright (c) 2017 Civic Knowledge. This file is licensed under the terms of the
# Revised BSD License, included in this distribution as LICENSE
"""
CLI program for storing packages to Data.World
"""
# flake8: noqa
import json
import mimetypes
import sys
from os import getcwd
from os.path import basename, join
fr... |
from MetadataManagerCore.file.WatchDogFileHandler import WatchDogFileHandler
from MetadataManagerCore.file.FileHandlerManager import FileHandlerManager
from MetadataManagerCore.file.FileSystemWatchDog import FileSystemWatchDog
from MetadataManagerCore.file.WatchDog import WatchDog
from typing import List
from MetadataM... |
# coding: utf-8
"""
cloudFPGA Resource Manager API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 0.8
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_i... |
<reponame>gabriellasroman/ceph-medic<filename>ceph_medic/tests/remote/test_functions.py
import os
from ceph_medic.remote import functions
def make_test_file(filename, contents=None):
contents = contents or "foo"
with open(filename, 'w') as f:
f.write(contents)
def make_test_tree(path, contents=None... |
## \file serialiser.py
from pathlib import Path
from collections import defaultdict
import indigox as ix
import os
__all__ = ["SaveITPFile", "SavePDBFile", "SaveIXDFile", "SaveRTPFile"]
# Correction required to convert GROMOS improper units to GROMACS improper units
improper_correction = 1. / (0.0174532925 * 0.017453... |
<filename>Ag/BarChartRace.py
from manimlib import *
import scipy.stats as ss
import colorsys
def get_coords_from_csvdata(file_name):
import csv
coords = []
with open(f'{file_name}.csv', 'r', encoding='UTF-8') as csvFile:
reader = csv.reader(csvFile)
for row in reader:
co... |
from Common import BS
from MapData import MapDataElement
from PyQt5.QtCore import qDebug
def parseBS(s: str):
if not "{{Routemap" in s:
return parseBSOld(s)
i = 0
buf = ""
row = []
def app(x):
x = x.strip()
row.append(x)
return ''
rows = []
s = s.replace('... |
<gh_stars>1-10
"""
Settings and configuration for django_pds.
this file is re-created from django.conf.__init__.py file
main reason of this settings to lazy load all the configuration
from either django_pds.core.settings file or to load
settings for django_pds defined in django project settings
"""
import importlib
... |
#!/usr/bin/env python
# ############################################################################ #
# NetJobs - a network job synchronizer. #
# #
# Author: <NAME> (<EMAIL>) ... |
<filename>src/wavcheck/test_timecode.py
# SPDX-FileCopyrightText: 2022 Barndollar Music, Ltd.
#
# SPDX-License-Identifier: Apache-2.0
import unittest
from .timecode import FrameRate, Timecode, parse_framerate_within, parse_timecode_str, tc_to_wall_secs, wall_secs_to_durstr, wall_secs_to_fractional_frame_idx, wall_sec... |
<filename>zwutils/dlso.py
'''
dict list set object utils
'''
import collections
class ZWObject(object):
pass
def dict2obj(kv):
kv = kv or {}
# o = type('', (), {})()
o = ZWObject()
for key, val in kv.items():
setattr(o, key, val)
return o
def obj2dict(o):
# o = o or type('', (), {... |
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
import seaborn as sns
from scipy.stats import norm
from sklearn.model_selection import train_test_split
# Set seeds
the_meaning_of_life = 42
np.random.seed(the_meaning_of_life)
tf.set_random_seed(the_meaning_of_life)
# Create a toy dataset
def... |
<reponame>GarimaVishvakarma/intel-chroma
from chroma_core.services.syslog.parser import admin_client_eviction_handler, client_connection_handler, server_security_flavor_handler, client_eviction_handler
from chroma_core.models.event import ClientConnectEvent
from tests.unit.chroma_core.helpers import synthetic_host
from... |
<gh_stars>1000+
"""SSD model builder
Utilities for building network layers are also provided
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from tensorflow.keras.layers import Activation, Dense, Input
from tensor... |
<reponame>DanIulian/minigrid_rl
# AndreiN, 2019
# parts from https://github.com/lcswillems/torch-rl
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions.categorical import Categorical
import torch_rl
from typing import Optional, Tuple
from models.utils import ... |
<filename>energy_demand/energy_model.py
"""Energy Model
==============
The main function executing all the submodels of the energy demand model
"""
import uuid
import numpy as np
from energy_demand.geography import region
from energy_demand.geography import WeatherRegion
import energy_demand.rs_model as rs_model
impor... |
import numpy as np
class FeudalAgent:
NUM_TOP_ACTIONS = 5
NUM_BOTTOM_ACTIONS = 4
def __init__(self, size, agents_per_level, make_policy, alpha, gamma):
self.size = size
self.hierarchy = []
self.cells_per_agent = []
for level_idx, num_agents in enumerate(reversed(agents_... |
<reponame>jjwatts/gigantum-client<gh_stars>0
# Copyright (c) 2017 FlashX, LLC
#
# 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
# ... |
<reponame>Xilinx/roast-xilinx<filename>roast/component/bif/generate.py<gh_stars>1-10
#
# Copyright (c) 2020 Xilinx, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
import os
import re
import logging
from collections import namedtuple
from roast.xexpect import Xexpect
from roast.component.basebuild import Ba... |
<gh_stars>0
from tkinter import *
import random
from main import *
from mpClasses import *
def init(data):
data.scored = False
data.flatImage = PhotoImage(file="./images/ball03.png")
data.stripedImage = PhotoImage(file="./images/ball11.png")
data.setTurn = True
data.winner = None
data.player1 = Player("None")
... |
#!/usr/bin/env python3
import random
import click
from config import db, log
from model import PeriodicScript, PendingTweet, Config, ResponseScript
from script import compile_script, process_mention
from support import get_twitter_api
@click.command()
@click.option('--debug', '-d', is_flag=True, help='Debug mode. ... |
<filename>indra/pysb_assembler.py
from pysb import Model, Monomer, Parameter
from pysb.core import SelfExporter
from bel import bel_api
from biopax import biopax_api
from trips import trips_api
SelfExporter.do_export = False
class BaseAgentSet(object):
"""A container for a set of BaseAgents. Wraps a dict of BaseA... |
<gh_stars>1-10
import queue
import select
import socket
import threading
import uuid
from messages import *
class Game:
def __init__(self):
self.game_started = False
self.player_amount = 0
def start_game(self):
self.game_started = True
logging.info("-------------------------... |
# Copyright 2016 SAS Project 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 requ... |
<reponame>robert-haas/mevis
import os
import mevis as mv
import shared
def test_entrypoint():
exit_status = os.system('mevis -h')
assert exit_status == 0
exit_status = os.system('mevis -nonsense')
assert exit_status != 0
def test_convert_and_plot(tmpdir):
atomspace = shared.load_moses_atomspac... |
from __future__ import division
import os
from ctypes import *
from itertools import count
from openslide import lowlevel
print(os.getcwd())
_dirname_ = os.path.dirname(os.path.abspath(__file__))
_lib = cdll.LoadLibrary(f'{_dirname_}/lib/libkfbslide.so')
class KFBSlideError(Exception):
"""docstring for KFBSlid... |
#
# Autogenerated by Thrift Compiler (0.14.1)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.TRecursive impo... |
<reponame>ecmwf/metview-docs
"""
ODB - TEMP Wind
"""
# (C) Copyright 2017- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities
# gra... |
<reponame>dmtvanzanten/ezdxf<filename>tests/test_09_cython_acceleration/test_906_acc_bspline.py
# Copyright (c) 2021, <NAME>
# License: MIT License
import pytest
pytest.importorskip('ezdxf.acc.bspline')
from ezdxf.math._bspline import Basis as PyBasis, Evaluator as PyEvaluator
from ezdxf.acc.bspline import Basis a... |
# encoding: utf-8
# module Tekla.Structures.Model calls itself Model
# from Tekla.Structures.Model,Version=2017.0.0.0,Culture=neutral,PublicKeyToken=2f04dbe497b71114
# by generator 1.145
# no doc
# no imports
# no functions
# classes
class Object(object):
# no doc
Identifier=property(lambda self: object... |
# input - output from sh int addr
# output - list of words containing ip/prefix
from robot.api import logger
def Find_IPV4_In_Text(text):
ipv4 = []
for word in text.split():
if (word.count('.') == 3) and (word.count('/') == 1):
ipv4.append(word)
return ipv4
def Find_IPV6_In_Text(text)... |
#!/usr/bin/python3
import xml.etree.ElementTree as ET
from datetime import datetime
class LocationTable():
"""docstring for LocationTable."""
def __init__(self, tijd=datetime.now(), meetpunten=[]):#TODO datetime
super(LocationTable, self).__init__()
self.tijd_laatste_config_wijziging = tijd
... |
<gh_stars>100-1000
import os
from StockAnalysisSystem.core.Utility.common import *
from StockAnalysisSystem.core.Utility.TagsLib import *
from StockAnalysisSystem.core.Utility.df_utility import *
from StockAnalysisSystem.core.Utility.time_utility import *
from StockAnalysisSystem.core.Utility.WaitingWindow import *
fr... |
__author__ = 'mnowotka'
#-----------------------------------------------------------------------------------------------------------------------
from chembl_beaker.beaker import app
from bottle import request
from chembl_beaker.beaker.core_apps.conversions.impl import _ctab2smiles, _smiles2ctab, _inchi2ctab, _ctab2sm... |
import re
"""
Automatic utility for generating raylib function headers. Simply put
raylib.h in the working directory of this script and execute.
Tested with raylib version 3.7.0
"""
C_TO_ZIG = {
"bool": "bool",
"char": "u8",
"double": "f64",
"float": "f32",
"int": "c_int",
"long": "c_long",
... |
<gh_stars>1-10
"""
Definition of the `fiftyone` command-line interface (CLI).
| Copyright 2017-2020, Voxel51, Inc.
| `voxel51.com <https://voxel51.com/>`_
|
"""
import argparse
from collections import defaultdict
import io
import json
import os
import subprocess
import sys
import time
import argcomplete
from tabulate... |
#!/usr/bin/env python3
#
# Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
#
# A script to kill hanging process. The tool will return non-zero if any
# proc... |
import math
from configs import Config
def default_configs(name, batch_size=4, image_size=512):
h = Config()
h.dtype = "float32"
# backbone
h.model = dict(model=name,
convolution="conv2d",
dropblock=None,
# dropblock=dict(keep_p... |
# coding: utf-8
"""
蓝鲸用户管理 API
蓝鲸用户管理后台服务 API # noqa: E501
OpenAPI spec version: v2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from bkuser_sdk.ap... |
import unittest
import numpy as np
import tensorflow as tf
from kgcnn.layers.gather import GatherNodes
class TestTopKLayerDisjoint(unittest.TestCase):
n1 = [[[1.0], [6.0], [1.0], [6.0], [1.0], [1.0], [6.0], [6.0]],
[[6.0], [1.0], [1.0], [1.0], [7.0], [1.0], [6.0], [8.0], [6.0], [1.0], [6.0], [7.0], [... |
<filename>experimentum/Experiments/Experiment.py
# -*- coding: utf-8 -*-
"""Run experiments and save the results for future analysations.
Writing Experiments
-------------------
Experiments are created in the `experiments` directory and they must adhere to
the following naming convention: `{NAME}Experiment.py`.
All E... |
<reponame>lilinghell/devops
from django.db import models
from django.utils.translation import ugettext_lazy as _
from applications.models import Application
from projects.models import Project
from common.mixin import BaseModelMixin
from common.models import Attachment
class FeatureImpactDesign(BaseModelMixin):
... |
<reponame>georgia-tech-db/Eva
# coding=utf-8
# Copyright 2018-2020 EVA
#
# 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 b... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import defaultdict
import numpy as np
def find_smallest_positive(alist):
# find first positive value
minpos = -1
for x in alist:
if x > 0:
minpos = x
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.