content stringlengths 5 1.05M |
|---|
"""
Definition of Fluid, IncompressibleFlow as well as fluid-related functions.
"""
from phi import math, field
from phi.field import GeometryMask, AngularVelocity, Grid, divergence, CenteredGrid, spatial_gradient, where, HardGeometryMask
from phi.geom import union
from ._boundaries import Domain
def make_incompress... |
from SlowRecorder import SlowRecorder
import sys
if __name__ == "__main__":
app = SlowRecorder()
app.startApp()
sys.exit(app.app.exec_()) |
#!/usr/bin/env python
import ansible
from ansible.parsing.dataloader import DataLoader
from ansible.vars.manager import VariableManager
from ansible.inventory.manager import InventoryManager
from ansible.module_utils.common.collections import ImmutableDict
from ansible.playbook.play import Play
from ansible.executor.t... |
"""Scrape the first ten pages of stackoverflow jobs for python jobs.
- The job title
- The company name
- The location
- The date posted (in whatever date format makes the most sense to you)
- The link to the actual job posting
"""
from bs4 import BeautifulSoup as bs
from datetime import datetime
import os
import requ... |
import tensorflow as tf
import time
import numpy as np
import mdl_data
import sys
GPUNUM = sys.argv[1]
FILEPATH = sys.argv[2]
with tf.device('/gpu:' + GPUNUM):
#Source reference: https://github.com/aymericdamien/TensorFlow-Examples.git/input_data.py
def dense_to_one_hot(labels_dense, num_classes=10):
... |
import random
all_words = []
with open(r'words.txt', 'r') as f:
for line in f:
for word in line.split():
all_words.append(word)
def get_word():
word = random.choice(all_words)
return word.lower()
def play(word):
word_to_complete = "_" * l... |
'''
#The auxiliary function that will return the larger number to main()
def maxx(a,b):
if a>b:
return a
elif b>a:
return b
elif b==a:
return a
#The main() function, which requests two values as an input, and with the maxx() function prints the larger value
def main():
... |
import socket
import os
import sys
import json
from blackfire.exceptions import *
import _blackfire_profiler as _bfext
from collections import defaultdict
from blackfire.utils import urlparse, get_logger, IS_PY3, parse_qsl, read_blackfireyml_content, \
replace_bad_chars, get_time, unquote, UC, unicode_or_bytes
log... |
from plenum.common.config_util import getConfig
from plenum.common.event_bus import InternalBus
from plenum.common.messages.internal_messages import VoteForViewChange
from plenum.common.timer import TimerService, RepeatingTimer
from plenum.server.suspicion_codes import Suspicions
from stp_core.common.log import getlogg... |
from matplotlib import pyplot as plt
import numpy as np
from scipy import stats
from IPython.core.pylabtools import figsize
def main():
# create the observed data
# sample size of data we observe, try varying this
# (keep it less than 100 ;)
N = 15
# the true parameters, but of course we do not... |
import time as t
import datetime as dt
import winsound as ws
#import playsound as ps
#ps.playsound(r"C:\\Users\\paava\\Desktop\\New folder\\sd.mp3")
def counter(T, remindBuffer):
remindBuffer = remindBuffer * 60
actTime = T
while T > 0:
if T % remindBuffer == 0 or round(T/actTim... |
import pandas as pd
data = pd.read_csv('grades.csv')
data["Total"]= (0.25*data["Final"]+0.75*data["MidTerm"])
print(data)
data.to_csv("new-grades.csv")
|
from pymongo import MongoClient
from pymongo import ReadPreference
from biokbase.service.Client import Client as ServiceClient
import json as _json
import os
import mysql.connector as mysql
import requests
import time
import math
from datetime import date
from datetime import datetime
#import pprint
#pp = pprint.Prett... |
from django.apps import AppConfig
class RentalPropertyConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'rental_property'
verbose_name = 'My Rental Property'
|
"""
Classes for GP models with Stan, using a given distance matrix.
"""
from argparse import Namespace
import time
import copy
import numpy as np
from scipy.spatial.distance import cdist
from bo.pp.pp_core import DiscPP
import bo.pp.stan.gp_distmat as gpstan
import bo.pp.stan.gp_distmat_fixedsig as gpstan_fixedsig
fr... |
class Solution(object):
def canCross(self, stones):
"""
:type stones: List[int]
:rtype: bool
"""
if stones[0] != 0 or stones[1] != 1:
return False
return self.canCrossHelper(1, 1, stones[-1], set(stones), {})
def canCrossHelper(self, curStone, lastJ... |
from os.path import join, dirname, realpath
from setuptools import setup
import sys
assert sys.version_info.major == 3 and sys.version_info.minor >= 6, \
"Require Python 3.7 or greater."
setup(
name='adaeq',
py_modules=['adaeq'],
version='0.0.3',
install_requires=[
'numpy',
'joblib... |
# coding=utf-8
########################################################################################
### Do not forget to adjust the following variables to your own plugin.
# The plugin's identifier, has to be unique
plugin_identifier = "remote_timelapse"
# The plugin's python package, should be "octoprint_<plugi... |
"""Policies"""
import logging
import numpy as np
log = logging.getLogger(__name__)
class PolicyQ1():
"""Custom policy when making decision based on neural network."""
def __init__(self, tau=1., clip=(-500., 500.)):
self.tau = tau
self.clip = clip
def select_action(self, q_values):
... |
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('LICENSE') as lic_file:
license_text = lic_file.read()
setup(
name="Termux-API",
version="0.0.1",
description="Python script to provide access to term... |
from pathlib import Path
import librosa
import imageio
import numpy as np
from natsort import natsorted
from .misc import DataType, EXTENSIONS
def split_spectrogram(spec, chunk_size, truncate=True, axis=1):
"""
Split a numpy array along the chosen axis into fixed-length chunks
Args:
spec (np.nd... |
# AugMix: A Simple Data Processing Method to Improve Robustness and Uncertainty
# https://github.com/google-research/augmix
import numpy as np
from PIL import Image, ImageOps, ImageEnhance
import numpy as np
from PIL import Image
IMAGE_SIZE = None
def int_parameter(level, maxval):
return int(level * maxval / 10)... |
#!/usr/bin/env python
"""Storage Report for Python"""
# import pyhesity wrapper module
from pyhesity import *
from datetime import datetime
import codecs
# command line arguments
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--vip', type=str, required=True)
parser.add_argument('-u', '-... |
import argparse
import logging
from twitchio import Message
from src.bot.RoundsQueue import RoundsQueue, Round
from src.bot.TeamData import TeamData
from src.bot.botstates.BotState import BotState
from src.bot.commandhandlers import trivia, number_game
class ArgumentParser(argparse.ArgumentParser):
def error(self... |
import datetime
import pytest
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from rest_framework import status
from rest_framework_gis.fields import GeoJsonDict
from traffic_control.models import AdditionalSignContentReal, AdditionalSignReal
from .factories import (
add_ad... |
from django.contrib import admin
from .models import Test, Question, Choice
# Register your models here.
class ChoiceInline(admin.TabularInline):
model = Choice
extra = 0
class QuestionAdmin(admin.ModelAdmin):
inlines = [ChoiceInline]
admin.site.register(Test)
admin.site.register(Question, QuestionAdmin)
adm... |
#coding:utf-8
#
# id: bugs.core_1315
# title: Data type unknown
# decription:
# tracker_id: CORE-1315
# min_versions: []
# versions: 2.1
# qmid: bugs.core_1315
import pytest
from firebird.qa import db_factory, isql_act, Action
# version: 2.1
# resources: None
substitutions_1 = []
i... |
"""
Creates the initial galaxy database schema using the settings defined in
config/galaxy.ini.
This script is also wrapped by create_db.sh.
.. note: pass '-c /location/to/your_config.ini' for non-standard ini file
locations.
.. note: if no database_connection is set in galaxy.ini, the default, sqlite
database will ... |
import tensorflow as tf
from edflow.iterators.model_iterator import PyHookedModelIterator
class TFHookedModelIterator(PyHookedModelIterator):
def make_feeds(self, batch):
feeds = {
pl: batch[name] for name, pl in self.model.inputs.items() if name in batch
}
return feeds
de... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import collections
import os
import pytest
from bustard.template import Template
current_dir = os.path.dirname(os.path.abspath(__file__))
template_dir = os.path.join(current_dir, 'templates')
def ... |
# -*- coding: utf-8 -*-
import json
from datetime import datetime
import logging
from pathlib import Path
import click
import pandas as pd
from .. import paths
class AustralianHousingLoader:
def __init__(self, sdmx_json):
self.sdmx_json = sdmx_json
def header(self):
obs_codes = self.sdmx_jso... |
#!flask/bin/python
from sbr_ui import app
app.run()
|
#! /usr/bin/python3
# External deps
import os, sys
# Internal deps
os.chdir(sys.path[0])
sys.path.append("..")
import df_common as dfc
########################################################################################################################
# HELPERS
###################################################... |
from ._base_optimizer import _BaseOptimizer
import numpy as np
class SGD(_BaseOptimizer):
def __init__(self, learning_rate=1e-4, reg=1e-3):
super().__init__(learning_rate, reg)
def update(self, model):
'''
Update model weights based on gradients
:param model: The model to be upd... |
# coding: utf8
"""
weasyprint.text
---------------
Interface with Pango to decide where to do line breaks and to draw text.
:copyright: Copyright 2011-2014 Simon Sapin and contributors, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import division
# XXX No unicode_lite... |
# -*- coding: utf-8 -*-
# Implementation of Densely Connected Convolutional Networks (CVPR 2017)
# https://arxiv.org/abs/1608.06993
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
import os
class DenseCompositionFunction(nn.Module):
def __... |
import json
from config.api2_0_config import *
from config.amqp import *
from on_http_api2_0 import ApiApi as Api
from on_http_api2_0 import rest
from modules.logger import Log
from modules.amqp import AMQPWorker
from datetime import datetime
from proboscis.asserts import assert_equal
from proboscis.asserts import asse... |
import logging
import logging.config
import os
import shutil
from functools import wraps
from pathlib import Path
from typing import Optional
import yaml
from autoconf.directory_config import RecursiveConfig, PriorConfigWrapper, AbstractConfig, family
from autoconf.json_prior.config import JSONPriorConfig
... |
#!/usr/bin/env python
#
# Metricinga - A gevent-based performance data forwarder for Nagios/Icinga
#
# Author: Jeff Goldschrafe <jeff@holyhandgrenade.org>
from argparse import ArgumentParser
import atexit
import cPickle as pickle
import os
import logging
import logging.handlers
from pprint import pformat, pprint
impor... |
from __future__ import division
import cvxopt
import numpy as np
from pylab import *
import math
# from cvxpy import numpy as my_numpy
from cvxpy import *
# Taken from CVX website http://cvxr.com/cvx/examples/
# Example: Compute and display the Chebyshev center of a 2D polyhedron
# Ported from cvx matlab to cvxpy b... |
#!/usr/bin/env python3
import argparse
import numpy as np
import csv
import matplotlib.pyplot as plt
def read_data(filename):
header = []
entries = []
with open(filename) as csvfile:
reader = csv.reader(csvfile, delimiter=',', quotechar='"')
for row in reader:
if row[0][0] ==... |
from rest_framework.serializers import ModelSerializer
from rest_framework import serializers
from recruiting.models import KeySkill, Resume, Vacancy, Respond
from accounts.api.v1.serializers import CompanySerializer, ApplicantSerializer
class CreateResumeSerializer(ModelSerializer):
class Meta:
model = ... |
#!/usr/bin/env python
import rospy
import pyaudio
import numpy as np
import wave
from cordial_msgs.msg import Sound
from std_msgs.msg import String
class WavFilePublisher:
def __init__(self):
rospy.init_node('wav_player', anonymous=True)
self._wav_header_length = rospy.get_param(
'... |
import serial
import time
import string
import pynmea2
def location():
while True:
port="/dev/ttyAMA0"
ser=serial.Serial(port, baudrate=9600, timeout=0.5)
dataout = pynmea2.NMEAStreamReader()
newdata=ser.readline()
if newdata[0:6] == "$GPRMC":
newmsg=pynmea2.parse(newdata)
lat=newmsg.latitude
lng=... |
#------------------------------------------------------------------------------
# Import necessary modules
#------------------------------------------------------------------------------
verbose = True
# Standard modules
import os
import time
import sys
import json
import psycopg2
# Related major packages
... |
import os
import click
from sentinelsat import SentinelAPI
@click.command()
@click.argument('image_id')
@click.argument('out_path')
@click.option('--username', '-U', required=True, type=str, default=None,
help="Copernicus SciHub username to use for authenticating download.")
@click.option('--password', '... |
import sys, os
os.environ["PATH"] = os.path.dirname(sys.executable) + os.pathsep + os.environ["PATH"]
import click
import pandas as pd
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from collections import defaultdict
from sklearn.neighbors.kde import KernelDensity
from sklea... |
"""
链家二手房数据抓取
"""
import requests
from lxml import etree
import time
import random
from fake_useragent import UserAgent
import pymongo
class LianJiaSpider:
def __init__(self):
self.url = 'https://lf.lianjia.com/ershoufang/pg{}/'
# 3个对象
self.conn = pymongo.MongoClient('localhos... |
import rt
def factorial(n):
result = 1
for i in range(1, n + 1):
if i % 10 == 0:
rt.pause()
print("i = %d" % i)
result *= i
return result
def handler(event, context):
return factorial(event["n"])
|
"""Tests for the awair component."""
|
"""COMMAND : .join , .pay , .work , .push , .aag , .climb, .ohh, .suckit, .lovestory, .bf"""
import asyncio
import random
from telethon.tl.types import ChannelParticipantsAdmins
from userbot import LOGS
from darkbot.utils import admin_cmd, sudo_cmd, edit_or_reply
from userbot.cmdhelp import CmdHelp
@bot.on(admin_cmd... |
"""archetypal OpaqueMaterial."""
import collections
import numpy as np
from sigfig import round
from validator_collection import validators
from archetypal.template.materials.material_base import MaterialBase
from archetypal.utils import log
class NoMassMaterial(MaterialBase):
"""Use this component to create a... |
from django.contrib import admin
from . import models
@admin.register(models.FacebookID)
class FacebookIDAdmin(admin.ModelAdmin):
list_display = ('fb_id', 'user')
readonly_fields = ('fb_id', 'user', 'create') |
'''Performs the predictor step for the continuation power flow
'''
from numpy import r_, array, angle, zeros, linalg, exp
from scipy.sparse import hstack, vstack
from scipy.sparse.linalg import spsolve
from pypower.dSbus_dV import dSbus_dV
from pypower.cpf_p_jac import cpf_p_jac
def cpf_predictor(V, lam, Ybus, Sxf... |
import numpy as np
from psyneulink.core.components.functions.transferfunctions import Logistic
from psyneulink.core.components.mechanisms.processing.transfermechanism import TransferMechanism
from psyneulink.core.components.process import Process
from psyneulink.core.components.projections.pathway.mappingprojection im... |
import itertools
from os import makedirs
def maybe_create_folder(folder):
makedirs(folder, exist_ok=True)
def progressive_filename_generator(pattern="file_{}.ext"):
for i in itertools.count():
yield pattern.format(i)
|
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# aspi <-> web app json
from rest_framework import serializers
from django.contrib.auth.models import User
from.models import Medico
class MedicoSerializer(serializers.ModelSerializer):
class Meta:
model = Medico
fields = '__all__'
extra_kwargs = {'password':{'write_only': True}}
def c... |
from ._marker import Marker
|
import json
import re
import uuid
from urllib2 import (
HTTPError,
URLError,
)
import requests
from pylons import app_globals as g
from r2.lib import amqp
from r2.lib.db import tdb_cassandra
from r2.lib.media import MediaEmbed, Scraper, get_media_embed, _OEmbedScraper
from r2.lib.utils import sanitize_url, ... |
from helpers.alex import *
date = datetime.date.today().strftime('%Y-%m-%d')
state = 'UT'
def fetch(url, **kwargs):
if 'date' not in kwargs.keys() or kwargs['date']==False:
kwargs['date'] = date
if 'state' not in kwargs.keys() or kwargs['state']==False:
kwargs['state'] = state
return(fetch... |
#!/usr/bin/env python2.7
# license removed for brevity
import rospy
import tf2_ros
from geometry_msgs.msg import TransformStamped
from rospy_helpers import unpack_ROS_xform
class FrameListener:
def __init__(self, refreshRate=300):
""" Listens to a particular transform and reports it periodically """
... |
# -*- coding: utf-8 -*-
u"""GitHub Login
GitHub is written Github and github (no underscore or dash) for ease of use.
:copyright: Copyright (c) 2016-2019 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
... |
from abc import ABC, abstractmethod
import logging
import threading
from typing import List, Optional, TypeVar
from justbackoff import Backoff
from xaynet_sdk import xaynet_sdk
# rust participant logging
xaynet_sdk.init_logging()
# python participant logging
LOG = logging.getLogger("participant")
TrainingResult = T... |
"""
Simple http server, that returns data in json.
Executes get data for sensors in the background.
Endpoints:
http://0.0.0.0:5000/data
http://0.0.0.0:5000/data/{mac}
Requires:
asyncio - Python 3.5
aiohttp - pip install aiohttp
"""
from aiohttp import web
from ruuvitag_sensor.ruuvi_rx import RuuviTa... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#配置scrapyd的URI:scrapyd_list = [{},{}..] 如:scrapyd_list = [ 'http://192.168.68.128:6800']
SCRAPYD_LIST = [ 'http://192.168.68.128:6800']
SCRAPYD_PROJECT_NAME = 'tbSpider'
SCRAPYD_SPIDER_NAME = 'tbSpider'
#配置redis的地址,unique = True 格式:redis://[:password]@localhost:6379/db
R... |
import bisect
import numpy as np
class CombinedScheduler:
def __init__(self, schedulers=None):
self.schedulers = []
if schedulers is not None:
for scheduler in schedulers:
if scheduler is None:
continue
elif hasattr(scheduler, 'sched... |
import numpy as np
def read_params():
principal = input('enter principal: ')
rate = input('enter rate (as decimal): ')
payment = input('enter payment: ')
period = input('enter period (in months): ')
print(principal, rate, payment, period)
return principal, rate, payment, period
def calculate_p... |
"""
This reference script has been taken from rq-dashboard with some modifications
"""
import importlib
import logging
import os
import sys
from urllib.parse import quote as urlquote, urlunparse
from redis.connection import (URL_QUERY_ARGUMENT_PARSERS,
UnixDomainSocketConnection,
... |
# =======================================================================================================================================
# VNU-HCM, University of Science
# Department Computer Science, Faculty of Information Technology
# Authors: Nhut-Nam Le (Tich Phan Suy Rong)
# © 2020
import unittest
"""
Return th... |
from tools.machine_learning import getAccuracy, preprocess_data, sliding_window
from sklearn.model_selection import train_test_split
from sklearn.multiclass import OneVsRestClassifier
from sklearn.metrics import classification_report
from sklearn.model_selection import GridSearchCV
from sklearn.preprocessing import Sta... |
# -*- coding: utf-8 -*-
'''
Created on 2016-10-20
@author: hustcc
'''
from app.wraps.login_wrap import login_required
from app import app, v
from app.utils import ResponseUtil, RequestUtil, AuthUtil
from app.database.model import Collaborator, User
# get server list
@app.route('/api/collaborator/list', methods=['GET... |
from django.forms import forms, ModelForm, TextInput, Textarea, Select, CharField, PasswordInput, NumberInput
from django.contrib.auth.password_validation import validate_password
from eadmin.models import User
from . models import DeliveryStaff
class NewStaffForm(ModelForm):
class Meta:
model = DeliveryS... |
"""
File transfer protocol used to send and receive files using FTP server.
Use credentials to provide access to the FTP client
Note: Do not use root username & password for security reasons
Create a seperate user and provide access to a home directory of the user
Use login id and password of the user created
cwd her... |
from output.models.nist_data.atomic.date.schema_instance.nistschema_sv_iv_atomic_date_pattern_1_xsd.nistschema_sv_iv_atomic_date_pattern_1 import NistschemaSvIvAtomicDatePattern1
__all__ = [
"NistschemaSvIvAtomicDatePattern1",
]
|
"""
Bot API
Author: Irfan Chahyadi
Source: github.com/irfanchahyadi/Odong2Bot
"""
import requests, json, time, urllib, os, dotenv
from datetime import datetime
from src.bot_message import KEYBOARD
dotenv.load_dotenv()
class botAPI():
def __init__(self):
token = os.getenv('TOKEN')
self.base_url = 'https://api.t... |
# file openpyxl/tests/test_iter.py
# Copyright (c) 2010-2011 openpyxl
#
# 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
# ... |
/home/runner/.cache/pip/pool/62/f8/1b/da37f497a4b80b6ad701b8dba5445817aca352009dc034ab9e989903c5 |
from bs4 import BeautifulSoup
class LeadersScrapper:
def scrap(self, html):
soup = BeautifulSoup(html, features="html.parser")
title = soup.find("h1").text
date = soup.find("div",{"class":"infos"}).text
data = [ arti.text for arti in soup.find("div", {"class":"article_body"}).f... |
import fnmatch
import botocore
COPY_METHODS = {"copy", "copy_object", "copy_upload_part"}
LIST_METHODS = {"list_objects", "list_objects_v2", "list_object_version"}
def _route_bucket_and_key(api_params, config, map):
for profile in config:
mapping = config[profile]
if "Bucket" in api_params:
... |
import foo as f
# print(foo)
# NameError: name 'foo' is not defined
print(f)
# <module 'foo' from '/home/treedbox/treedbox/dev/python/python.1.0.0/python/module/import/as/foo.py'>
print(f.foo())
# Foo text from module foo
# None
# None is because the return is a print() inside another print()
f.bar()
# Foo text fro... |
from abc import ABC, abstractmethod
class AbstractSolver(ABC):
"""
Abstract solver for different problems in calculus of variation.
"""
@abstractmethod
def _general_solution(self):
"""
Find general solution.
"""
self.general_solution = None
@abstractmethod
... |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
from typing import Dict, Mapping
class OverrideDefinition(dict):
"""Definition of a overridable field of a component job."""
def ... |
from django.db import models
from wagtail.admin.edit_handlers import FieldPanel, StreamFieldPanel
from wagtail.core import blocks
from wagtail.core.models import Page
from wagtail.core.fields import RichTextField, StreamField
from wagtail.images.blocks import ImageChooserBlock
class ImagePanelBlock(blocks.StructBlock... |
from enum import Enum
class Order(Enum):
Asc = "asc"
Desc = "desc"
|
# Constantes usadas en el juego
class Constants:
# Colors
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
BLUE = (12, 153, 204)
# Screen dimensions
DISPLAY_WIDTH = 1500
DISPLAY_HEIGHT = 900
SPEED = 40
# Images
FROG_IMAGE = "game_engine/sprites/ranita_resized.png"
ROCK_IMAGE = "ga... |
"""
Problem Statement:
- Implement a function findKthMax(root,k) which will take a BST and any number
“k” as an input and return kth maximum number from that tree.
Output:
- Returns kth maximum value from the given tree
Sample Input:
bst = {
6 -> 4,9
4 -> 2,5
9 -> 8,12
12 -> 10,... |
from player import *
ann = Player('Ann', 2, 4)
bob = Player('Bob', 3, 5)
print(ann)
print(bob)
ann.randomize_hand()
print(ann)
bob.randomize_hand()
print(bob) |
import json
import os
import errno
import sys
from time import monotonic
from pprint import pprint
import shutil
import urllib.request
import multiprocessing
import re
# from tqdm import tqdm
from queue import SimpleQueue
from collections import defaultdict
from itertools import chain
from functools import partial
... |
# -*- coding: utf8 -*-
TP_SERVER_VER = "3.1.0"
|
# coding=utf-8
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------
from .resource import Resource
class StorageAccount(Resource):
"""The storage account.
Variables are only populated by the server, and will... |
from vit.formatter.parent import Parent
class ParentLong(Parent):
pass
|
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-10-18 00:13
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import forum.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.... |
# -*- coding: utf-8 -*-
"""
vsphere_activate_vm will activate a VM in a Nuage environment, it can use both split activation or metadata.
--- Author ---
Philippe Dellaert <philippe.dellaert@nuagenetworks.net>
--- Version history ---
2017-03-26 - 1.0
2020-07-06 - 1.1 - Migrate to v6 API
--- Usage ---
run 'python vsphe... |
import numpy as np
def _iterate(arrays, cur_depth, iterators, n):
"""
dfs algorithm for returning the next iterator value
Args:
arrays: A list of 1-D arrays
cur_depth: the depth of the dfs tree in current call
iterators: a list of iterators
n: number of arrays
Returns:
new i... |
# sunrise_alarm.py
# Written for the Electronics Starter Kit for the Raspberry Pi by MonkMakes.com with help from Henry Budden (@pi_tutor)
from Tkinter import *
import RPi.GPIO as GPIO
import time, math
GPIO.cleanup()
# Configure the Pi to use the BCM (Broadcom) pin names, rather than the pin positions
GPIO.setmode(G... |
from abc import ABC
import torch
from multiprocessing import Process, Manager
from tqdm import tqdm
from typing import List, Dict, Any
import os
from his_evaluators.metrics import TYPES_QUALITIES
from .base import PairedMetricRunner, UnpairedMetricRunner, Evaluator
from ..utils.io import mkdir
class MotionImitation... |
x=input('Olá, poderia me dizer seu nome?').strip()
n1= x.split()
print('Prazer em te conhecer!')
print(f'Seu primeiro nome é {n1[0]}!')
print(f'Seu ultimo nome é {n1[-1]}!')
|
#!/bin/env/python
# From: https://stackoverflow.com/a/33012308
# Runs coveralls if Travis CI is detected
import os
from subprocess import call
if __name__ == '__main__':
if 'TRAVIS' in os.environ:
rc = call('coveralls')
raise SystemExit(rc)
else:
print("Travis was not detected -> Skip... |
import os
import logging
from tempfile import TemporaryFile
from enverus_direct_access import (
DirectAccessV2,
DADatasetException,
DAQueryException,
DAAuthException,
)
from tests.utils import set_token
set_token()
LOG_LEVEL = logging.DEBUG
if os.environ.get("GITHUB_SHA"):
LOG_LEVEL = logging.ER... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.