content stringlengths 5 1.05M |
|---|
import math
import datetime
import pyximport; pyximport.install()
from mgf_filter.cython.mat import pow
def calculate_Resolution_based_MZ(mz):
"""
based on MZ calculates resolution
provided by a LR
"""
return math.pow(10, 5.847 + math.log10(mz) * (-0.546))
def calculate_Delta_based_MZ(mz, numSig... |
from configparser import ConfigParser
from importlib import import_module
from os import listdir
from sys import path
from plugins.plugin import Plugin
class Calculator(object):
@staticmethod
def __get_plugins():
config_parser = ConfigParser()
config_parser.read('properties.ini')
plug... |
#load libs
from wx.lib.embeddedimage import PyEmbeddedImage
#----------------------------------------------------------------------
AppIcon16 = PyEmbeddedImage(
b'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC6klEQVR42pWTXUySURjH/3wo'
b'OBCQj7JNAxUJDJmseRGaN165hWbl0r5cLe3D1WWbm5deue6aX5mZMz+aF25h88obKrbmjEa... |
import sys
import requests
if __name__ == '__main__':
payload = {'access_key': '45a70dc23344db4c80691df95b90f8df'}
response = requests.get(
'http://api.exchangeratesapi.io/v1/latest',
params=payload
)
if response.status_code != 200:
sys.stderr.write(f"Error: Response: {respons... |
import argparse
import os
import numpy as np
from glob import glob
from PIL import Image
from tqdm import tqdm
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Convert png images to single .npy file')
parser.add_argument('--png_dir', type=str,
default='../ntire2021/data/sou... |
class Sample():
"""
A sample for a song, composed of slices (parts).
"""
def __init__(self, slices, song, size, index):
self.slices = slices
self.song = song
self.size = size
self.index = index
class Slice():
"""
A sample of the smallest size, used to construct
... |
# -*- coding: utf-8 -*-
# code for console Encoding difference. Dont' mind on it
import sys
import imp
import random
imp.reload(sys)
try:
sys.setdefaultencoding('UTF8')
except Exception as E:
pass
try:
import unittest2 as unittest
except ImportError:
import unittest
from datetime import datetime
from ... |
# Copyright 2016 OpenStack 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 ... |
"""
:author: Nicolas Strike
:date: Mid 2019
"""
from src.Panel import Panel
from src.VariableGroup import VariableGroup
class VariableGroupIceMP(VariableGroup):
"""
"""
def __init__(self, case, clubb_datasets=None, sam_benchmark_dataset=None, sam_datasets=None, coamps_benchmark_dataset=None,
... |
import sys
def test(did_pass):
""" Print the result of a test. """
linenum = sys._getframe(1).f_lineno # Get the caller's line number.
if did_pass:
msg = "Test at line {0} ok.".format(linenum)
else:
msg = ("Test at line {0} FAILED.".format(linenum))
print(msg)
def num_digits(n)... |
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException
import unittest, time, ... |
# This file was generated automatically by generate_protocols.py
from nintendo.nex import common, streams
import logging
logger = logging.getLogger(__name__)
class NintendoNotificationType:
LOGOUT = 10
PRESENCE_CHANGE = 24
UNFRIENDED = 26
FRIENDED = 30
STATUS_CHANGE = 33
class NotificationEvent(common.Struc... |
from django.shortcuts import render
from django.views.generic.base import View
from django.conf import settings
class HelpView(View):
def get(self, request):
return render(request, 'student_app/help.html', {'email': settings.DEFAULT_FROM_EMAIL})
|
"""
_ _ _ __
| | __ _| |__/ |/ \.
| |__/ _` | '_ \ | () |
|____\__,_|_.__/_|\__/
Este archivo es 'guia', ustedes tienen que ver la manera de convertir
este algoritmo en un formato compatible con MapReduce: una funcion map y
una funcion reduce.
NOTA: Esta es una manera muy ineficien... |
def append_all_custom_variants(base_function, custom_boolean_testers, custom_failure_raisers, dest_list):
"""
Utility method used by the tests
:param base_function:
:param custom_boolean_testers:
:param custom_failure_raisers:
:param dest_list:
:return:
"""
if 'custom_boolean' in ba... |
from django.urls import path,include
from . import views
urlpatterns = [
path('',views.homepage,name='home'),
path('colleges/',views.college_list,name='colleges'),
path('college/<str:pk>/',views.college_branch,name='college_branch'),
path('college/<str:pk1>/<str:pk2>',views.college_branch_student,name='cbs'),
] |
# utils functions
import numpy as np
import random
import os
from time import time
import pickle
import pdb
import json
import torch
import logging
def setup_seed(seed):
'''
seed: the input random seed
'''
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
np.random.seed(seed)
random... |
# ! BE AWARE !
# Module section for Library Management System (LMS)
# Don't change anything if not known what is going to do.
class Library:
# Instances
library_instances = []
# some pre-defined books in this Library for future use
# library_catalog = {
# "Adventure": "Chander Pahar",
# ... |
import pygame
class Assasin():
def __init__(self,ai_settings, screen):
"""Initialize the Assasin and set its starting position."""
self.screen = screen
self.ai_settings = ai_settings
# Load the Assasin image and get its rect.
self.image = pygame.image.load('image/warrior_mo... |
"""
Original NGSI data example can be found from here:
https://github.com/Fiware/dataModels/blob/master/specs/Environment/AirQualityObserved/doc/spec.md#key-value-pairs-example
Below is reduced and modified version, e.g. PM values added.
See also https://github.com/Fiware/dataModels/issues/292
{
'pm25min': 0.3, 'pm2... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, CETI and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import datetime
class Device(Document):
def autoname(self):... |
'''
非同步聽牌機實驗程式
SKCOM.dll 已知狀況:
1. SKCenterLib_Login() 只能在 main thread 執行
2. SKCenterLib_Login() 執行第二次時, 會回傳錯誤 2003, 表示已登入
3. signal.signal() 只能在 main thread 執行
4. SKQuoteLib_EnterMonitor() 可以在 child thread 執行
5. SKQuoteLib_EnterMonitor() 失敗後執行第二次時, skcom.dll 需要 2.13.29.0 才有作用
6. SKQuoteLib_EnterMonitor() 成功後執... |
from scene import Scene
import objects
import euclid
from camera import Camera
import time
import sys
if __name__=="__main__":
#import rpdb2; rpdb2.start_embedded_debugger('1234')
# do raycaster things
objectlist = [objects.CollidableSphere(position=euclid.Point3(10.,-5.,5.), radius=3.,
... |
from .dataset import *
from .transforms import *
|
# coding=utf-8
from mock import patch, call, MagicMock
from django.conf import settings
from django.test import TestCase
from algoliasearch_django import AlgoliaIndex
from algoliasearch_django import algolia_engine
from algoliasearch_django.models import AlgoliaIndexError
from .models import User, Website, Example
... |
import flask
import simplejson as json
import api
import server
API_RESPONSE_HEADER = {
'Content-Type': 'application/json'
}
def assign_routes(app):
@app.route('/api/stock/<string:stock_symbol>', methods=['GET'])
def get_stock_realtime(stock_symbol):
try:
stock_data = api.get_stock_... |
# -*- coding: utf-8 -*-
###############################################################################
#
# ListYourIssues
# Lists all issues associated with the provided access token.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
... |
import numpy as np
from scipy import spatial
from datetime import datetime
import pandas as pd
import os
import copy
max_doc_len = 500
glove_embeddings = {}
embeds_file = open('glove/glove.840B.300d.txt', 'r')
for line in embeds_file:
try:
splitLines = line.split()
word = splitLines[0]
vec... |
from ..config import MENU_WIDTH
from ..transform import translate
tooltip = 'Delete Stockpile'
inactive_icon_clip = (192, 16, 16, 16)
active_icon_clip = (192, 32, 16, 16)
_block_origin = None
def start_on_tile(pos, stage, player_team):
# Delete the chosen stockpile
for stock in player_team.stockpiles:
... |
import numpy as np
from sklearn.metrics import confusion_matrix, classification_report
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis, QuadraticDiscriminantAnalysis
from pprint import pprint
from scipy.spatial import ConvexHull
import csv
import pickle
PI = 3.14159265358979323846264338327950288... |
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class RRocr(RPackage):
"""Visualizing the Performance of Scoring Classifiers.
ROC g... |
# -*- coding: UTF-8 -*-
def ensure_iterable(v):
if hasattr(v, '__iter__'):
return v
else:
return [v]
|
from django.db import models
# Create your models here
class Tweet(models.Model):
created = models.DateTimeField(auto_now_add=True)
title = models.CharField(max_length=100, blank=True, default='')
tweet = models.TextField(default='')
class Meta:
ordering = ('created',)
|
#!/usr/bin/env python
import queue
import subprocess
from threading import Thread
class SubprocSession(object):
""" An interactive session with a specificed subprocess.
Input may be passed to, and feedback received from, the suborocess.
To close the session, call SubproceSession.close().
"""
... |
# -*- coding: utf-8 -*-
import glob
import os
import six
import pytest
from html_text import (extract_text, parse_html, cleaned_selector,
etree_to_text, cleaner, selector_to_text, NEWLINE_TAGS,
DOUBLE_NEWLINE_TAGS)
ROOT = os.path.dirname(os.path.abspath(__file__))
@py... |
# Copyright (c) 2020
# [This program is licensed under the "MIT License"]
# Please see the file LICENSE in the source
# distribution of this software for license terms.
import pygame as pg
from os import path
from random import uniform, choice, random
import pytweening as tween
from src.sprites.mob import Mob
vec = ... |
# Setup #
import preprocessing
# import multiprocessing
# import re
import requests
import pandas as pd
# import json
import ftfy
# import argparse
from lxml import html # , etree
from dateutil.parser import parse as dateParse
import csv
import os
import time
import sys
import importlib
from selenium import webdrive... |
import numpy as np
from scipy.stats import norm
from .base import TimeSeries
class GaussianModel(TimeSeries):
"""
Class defines a collection of dynamic trajectories with a gaussian model fit to them.
Attributes:
norm (scipy.stats.norm) - gaussian fit to dynamic trajectories
bandwidth ... |
import matplotlib.pylab as plt
import numpy as np
import pandas as pd
import awrams.utils.datetools as dt
from awrams.utils.metatypes import ObjectDict,New
from .stats import build_stats_df,standard_percentiles
from .utils import valid_only,infer_freq,resample_to_months_df,resample_to_years_df
from .model import Sele... |
import pytest
import redis
import requests
from fastapi import status
from fastapi.encoders import jsonable_encoder
from app import celerytasks, schemas
class TestCeleryTasks:
@pytest.mark.ext
def test_update_rates__integration_test(self, mocker):
mocker.patch("app.celerytasks._update_cache")
... |
import numpy as np
from numpy.random import randint, randn, choice, random
import viznet
from scipy.sparse.csgraph import minimum_spanning_tree
def logo1():
with viznet.DynamicShow(figsize=(4,4), filename='_logo1.png') as ds:
n1 = viznet.NodeBrush('tn.dia', color='#CC3333') >> (0, 0)
n2 = viznet.Nod... |
from random import shuffle
def get_team_color(team_colors, click_colors):
team_colors = list(map(lambda x: x.upper(), team_colors.split(" / ")))
shuffle(team_colors)
for c in team_colors:
if c in click_colors:
return c.lower()
return False
|
import re
import time
from selenium.webdriver.common.by import By
from helpers import auditchecker
from view_models import sidebar as sidebar_constants, keys_and_certificates_table as keyscertificates_constants, \
popups, log_constants, messages
from view_models.keys_and_certificates_table import DETAILS_BTN_ID
... |
# coding: utf8
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.popup import Popup
from kivy.properties import StringProperty
from popups import StudentPopupLayout
from datetime import datetime
class BehaviourContent(FloatLayout):
name = StringProperty('Comportement')
active_student = StringProperty... |
from payu.schedulers.pbs import PBS
from payu.schedulers.slurm import Slurm
from payu.schedulers.scheduler import Scheduler
index = {
'pbs': PBS,
'slurm': Slurm,
}
|
import unittest
from database import *
class TestCategoryCollection(unittest.TestCase):
def test_get_all_unique_registered_categories(self):
registered_categories = get_all_unique_registered_categories()
registered_categories = sorted(registered_categories)
expected_registed_categories = [
["Cell Phones & ... |
from datetime import date
atual = date.today().year
ano = int(input('Digite o ano do nascimento: '))
idade = atual - ano
print('O atleta tem {} anos.'.format(idade))
if idade <= 9:
print('Categoria Mirim')
elif idade <=14:
print('Categoria Infantil')
elif idade <=19:
print('Categoria Junior')
elif idade <=2... |
# ---------------------------------------------------------------------
# Zyxel.ZyNOS.get_copper_tdr_diag
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
#... |
# Создание и запуск приложения, программирование интерфейса экранов и действий на них
#Hello world
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.textinput import TextInput
from kivy.uix.screenmanager import Sc... |
# Generated by Django 2.1.5 on 2019-02-07 11:53
from django.db import migrations
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('core', '0010_researcherpage_disciplines'),
]
operations = [
migrations.AddField(
model_name='researcherpage',... |
import argparse
from model.VGG import *
from model.Decoder import *
from model.Transform import *
import os
from PIL import Image
from os.path import basename
from os.path import splitext
from torchvision import transforms
from torchvision.utils import save_image
def test_transform():
transform_list = []
trans... |
from typing import (
TYPE_CHECKING,
Tuple,
)
import pymunk
from pymunk import (
Arbiter,
Vec2d,
)
from k_road.constants import Constants
from k_road.entity.entity_category import EntityCategory
from k_road.entity.vehicle.vehicle import Vehicle
from k_road.util import *
if TYPE_CHECKING:
from k_ro... |
import re
import logging
import httplib
import view_base
from models import rt_proxy
LOG = logging.getLogger('ryu.gui')
class RtAddrDel(view_base.ViewBase):
def __init__(self, host, port, dpid, address_id, status=None):
super(RtAddrDel, self).__init__()
self.host = host
self.port = port
... |
from django.apps import AppConfig
class ManualConfig(AppConfig):
name = 'manual'
def ready(self):
pass
|
# ServoBlaster.py
# ================
# ServoBlaster class initializes the servoblaster API installed on our system.
# The class is initialized by identifying the number of servos used, and each
# servo has an ID they are associated with. For now we are working with two
# servos so the id's will be: 'P1-7' & '(to be ... |
from settings import DEBUG
class UserForumRoleRouter(object):
def db_for_read(self, model, **hints):
if DEBUG:
if model.__name__ == 'Forum' \
or model.__name__ == 'User' \
or model.__name__ == 'Role'\
or model.__name__ == 'UserInfo' \
... |
import logging
import getpass
from socket import gethostname
import json
class JSONFormatter(logging.Formatter):
def format(self, record):
data = record.__dict__.copy()
if record.args:
msg = record.msg % record.args
else:
msg = record.msg
data.update(
... |
"""
软件架构
View:界面逻辑,例如:负责输入输出
Model:数据的抽象,例如:学生类型(姓名,年龄,成绩...)
Controller:核心业务逻辑,例如:存储,编号
"""
class View:
def __init__(self):
self.controller = Controller()
def func01(self):
self.controller.func02()
class Controller:
def func02(self):
print("func02执行了"... |
import torch
import numpy as np
import unittest
try:
import affogato
WITH_AFF = True
except ImportError:
WITH_AFF = False
class TestArand(unittest.TestCase):
def build_input(self):
affinity_image = np.array([[0, 0, 1, 0, 0],
[0, 0, 1, 0, 0],
... |
#!/usr/bin/env python
# Copyright 2011 Leonidas Poulopoulos (GRNET S.A - NOC)
#
# 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 require... |
from oeis import A001221
def test_A001221():
assert A001221(1, 6) == [0, 1, 1, 1, 1, 2]
|
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis <michael.aivazis@para-sim.com>
# (c) 1998-2022 all rights reserved
# publish the base implementation so users can extend
from .Factory import Factory as factory
# factories
from .Copy import Copy as cp
from .Mkdir import Mkdir as mkdir
# end of file
|
'''
file: GitHubAPI.py
brief: Defines a wrapper class for the GitHub RESTful API. Handles all HTTPS
requests and exception handling of those requests.
https://github.com/AlexanderJDupree/GithubNetwork
'''
import os
import requests
GITHUB_API = "https://api.github.com/"
USER = os.environ['GITHUB_USER'] if 'GI... |
PRODUCT_TYPES = (
"cash_carry",
"digital_content",
"digital_goods",
"digital_physical",
"gift_card",
"physical_goods",
"renew_subs",
"shareware",
"service",
)
class Order:
order_id: str
sales_tax: int
product_type: str
def __init__(self, order_id: str, sales_tax: i... |
#!/usr/bin/env python
import sys
import time
import functools
from fuse import FUSE
from passthroughfs import Passthrough
def report(fn):
@functools.wraps(fn)
def wrap(*params,**kwargs):
fc = "%s(%s)" % (fn.__name__, ', '.join(
[a.__repr__() for a in params] +
["%s = %s" % (a,... |
from typing import Any
from typing import Dict
import apysc as ap
from apysc._callable import callable_util
def test_get_func_default_vals() -> None:
def _test_func(a: int, b: int = 100, c: str = 'Hello!') -> None:
...
default_vals: Dict[str, Any] = callable_util.get_func_default_vals(
... |
"""Plots module."""
import numpy as np
import plotly.express as px
import plotly.graph_objects as go
import os
import pandas as pd
|
"""
MixUp
Source: https://github.com/hysts/pytorch_image_classification/tree/master/augmentations
"""
import numpy as np
import torch
import torch.nn as nn
def mixup(data, targets, alpha): #, n_classes):
indices = torch.randperm(data.size(0))
shuffled_data = data[indices]
shuffled_targets = targets[indi... |
"""High level package initialization to make classes and functions within the package visible to the user.
:author: Chris R. Vernon
:email: chris.vernon@pnnl.gov
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
"""
from im3agents.farmers import FarmerOne
__all__ = ['FarmerOne']
|
import random
cards = {"1": "1" ,"2": "2", "3": "3", "4": "4", "5": "5", "6": "6", "7": "7",
"8": "8", "9": "9", "J": "10", "Q": "10", "K": "10", "A": "11"}
def getcard():
kart, value = random.choice(list(cards.items()))
del cards[kart]
return kart, value
def as_mi(n):
if n == 11:
r... |
from pathlib import Path
from appyter.ext.asyncio.run_in_executor import run_in_executor
def assert_mounted(path: Path):
assert path.is_mount()
async_assert_mounted = run_in_executor(assert_mounted)
def assert_unmounted(path: Path):
assert not path.is_mount()
async_assert_unmounted = run_in_executor(assert_unmou... |
__author__ = 'felix.shaw@tgac.ac.uk - 20/01/2016'
import sys
from bson.errors import InvalidId
from api.utils import get_return_template, extract_to_template, finish_request
from dal.copo_da import Person
from web.apps.web_copo.lookup.lookup import API_ERRORS
def get(request, id):
"""
Method to handle a req... |
import tensorflow as tf
import numpy as np
from models.blocks.resnet_block import ResnetBlock
from tensorflow.keras.layers import Activation, Input
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import Concatenate
from tensorflow.keras.layers import Reshape
from tensorflow.keras.models import... |
#!/usr/bin/env python3
import pulp
def main():
model = pulp.LpProblem("Resource allocation monitoring with cost optimisation", pulp.LpMinimize)
if __name__ == "__main__":
main()
|
from src.util import make_directory
from src.download_data import download_data
from src.preprocess import preprocess_data
import pandas as pd
import argparse
def request(source, name, file, variables, set_positive_longitude):
cities_info = pd.read_csv(file)
name = f'{file.split(".")[0]}/{name}'
make_dir... |
# Calculate the gcd using the euclidean algorithm
# Accepts either 2 numbers, or 1 list
# By using a list, the gcd of multiple numbers can be calculated
def gcd(a,b = None):
if b != None:
if a % b == 0:
return b
else:
return gcd( b, a % b)
else:
for i in range(len... |
"""Library for controlling an Apple TV."""
import asyncio
import logging
import concurrent
from ipaddress import ip_address
from threading import Lock
from zeroconf import ServiceBrowser, Zeroconf
from aiohttp import ClientSession
from . import (conf, exceptions)
from .airplay import player
from .airplay.api import ... |
import cv2
# Load the cascade
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
# Read the input image
img = cv2.imread('group_face.jpg')
# Convert into grayscale
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# Detect faces
faces = face_cascade.detectMultiScale(gray, 1.3, 5)
... |
import unittest
from tests.TestSupport.Utilities import RedirectStreams
import EXOSIMS.StarCatalog
from EXOSIMS.StarCatalog.GaiaCat1 import GaiaCat1
from EXOSIMS.util.get_module import get_module
import os, sys
import pkgutil
from io import StringIO
import astropy.units as u
from EXOSIMS.util.get_dirs import get_downlo... |
from app.models import User
from unittest import mock
class TestLogin:
def test_should_access_login_return_status_200(self, client):
response = client.get('/login', follow_redirects=True)
assert 200 == response.status_code
def test_should_login_return_field_required_when_not_inform_email(sel... |
#!/usr/bin/env python
"""The setup script."""
from setuptools import setup, find_packages
exec(open("fishsound_finder/_version.py").read())
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
# automatically captured ... |
# -*- coding:utf-8 -*-
from app import db
ROLE_USER = 0
ROLE_ADMIN = 1
class User(db.Model):
id = db.Column(db.Integer, primary_key = True)
nickname = db.Column(db.String(64), index = True, unique = True)
email = db.Column(db.String(120), index = True, unique = True)
role = db.Column(db.SmallInteger,... |
#!/usr/bin/python
import numpy as np
import helpfunctions as hlp
import math
class inner:
"""Class whose constructor generates a particle system to be used
for nested SMC procedure on the row space.
Constructor
Parameters
----------
y : 1-D array_like
Measurements.
N : int... |
from sklearn.utils.estimator_checks import check_estimator
from automllib.under_sampling import ModifiedRandomUnderSampler
def test_modified_random_under_sampler() -> None:
check_estimator(ModifiedRandomUnderSampler)
|
import adv_test
from adv import *
def module():
return Irfan
class Irfan(Adv):
pass
if __name__ == '__main__':
conf = {}
conf['acl'] = """
`rotation
"""
conf['rotation_init'] = """
c4fs c4fs c1
"""
conf['rotation'] = """
S1 C4FS C4FS C1- S1 C2- S2 C4FS C5- S3 ... |
"""
File: bouncing_ball.py
Name: Isabelle
-------------------------
The file shows how to start bouncing by mouse clicking
and the process of bouncing
"""
from campy.graphics.gobjects import GOval
from campy.graphics.gwindow import GWindow
from campy.gui.events.timer import pause
from campy.gui.events.mouse... |
import app.views.password_resets.urls
|
#
# Copyright 2021 Ocean Protocol Foundation
# SPDX-License-Identifier: Apache-2.0
#
class ConfigSections:
"""
This class contains values for:
1. `OCEANBD`
2. `RESOURCES`
"""
OCEANBD = "oceandb"
RESOURCES = "resources"
class BaseURLs:
"""
This class contains values for:
... |
# Copyright 2017 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
#
# Unless required by applica... |
""" Userbot module for having some fun with people. """
import asyncio
import random
import re
import time
from collections import deque
import requests
from telethon.tl.functions.users import GetFullUserRequest
from telethon.tl.types import MessageEntityMentionName
from userbot import ALIVE_NAME
from userbot imp... |
"""
MIT License
Copyright (c) 2021 mooncell07
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, modify, merge, publish, di... |
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
import os
import sys
import unittest
import shutil
# temporary solution for relative imports in case TDC is not installed
# if TDC is installed, no need to use the following line
sys.path.append(os.path.abspath(os.path.joi... |
##############################
# Name: compass.py
# Author: Patrick Conlon
# Date: 07/24/2017
# Description:
# Simple script that just obtains the data from the compass chipset.
##############################
from microbit import *
###
# Function : calibrateCompass
# Description : clear and calibrate the compass on th... |
#!/usr/bin/env python
'''
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")... |
"""
(c) Copyright JC 2018-2020 All Rights Reserved
-----------------------------------------------------------------------------
File Name :
Description :
Author : JC
Email : lsdvincent@gmail.com
GiitHub : https://github.com/lsdlab
--------------------------------------------------... |
import csv
import time
from typing import Dict
from tqdm import tqdm
from transformers import (
AutoModelForSeq2SeqLM,
AutoTokenizer,
TrainingArguments,
Trainer,
)
import data_operations
from crypto_news_dataset import CryptoNewsDataset
import torch
import os
from metrics import calculate_rouge, calcul... |
class Vehiculo:
def __init__(self, marca, modelo):
self.marca = marca
self.modelo = modelo
self.enMarcha = False
self.acelera = False
self.frena = False
def arrancar(self):
self.enMarcha = True
def acelerar(self):
self.acelera = True
def frenar... |
match = 1
mismatch = -1
openGap = -10
gapExtension = -1
def first_gap_position(s):
for i in range(len(s)):
if s[i] == '-':
return i
return len(s)
def pairwise_alignment(s1, s2):
# s1[i] is aligned to s2[j]
a = [[0 for x in range(len(s1)+1)] for y in range(len(s2)+1)]
# s1[i... |
# Extrapolate trainingsdata from data foundation and apply to relevant members
class Trainings:
# Extrapolate trainings data from data foundation
def Get_Data(self, data, training_sheet, gren_sheet, _style_sheet):
print(f'Processing Training Fee Data for:')
multi_gren_clubs = {'Status': Fals... |
# This file is automatically generated during the generation of setup.py
# Copyright 2020, canaro
author = 'Jason Dsouza <jasmcaus@gmail.com>'
version = '1.0.8'
full_version = '1.0.8'
release = True
contributors = ['Jason Dsouza <jasmcaus@gmail.com>']
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.