text stringlengths 1 927k |
|---|
# -*- coding: utf8 -*-
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals
def f_score(evaluated_sentences, reference_sentences, weight=1.0):
"""
Computation of F-Score measure. It is computed as
F(E) = ( (W^2 + 1) * P(E) * R(E) ) / ( W^2 * P(E) + R(E)... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_li... |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
import scrapy
class ScrapyLearnItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
pass
class TdItem(scrapy.Item):
... |
from sqlalchemy import Column, Integer, String, Float, ForeignKey
from sqlalchemy.orm import relationship
from . import Base
class Keyword(Base):
__tablename__ = 'keywords'
id = Column(Integer, primary_key=True)
data = Column(String(), index=True)
score = Column(Float)
article_hash = Column(
... |
"""
Copyright (C) 2018-2021 Intel Corporation
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 i... |
from .__main__ import TestLineLen
from .__main__ import TestBadWords
from .__main__ import TestPhrases
from .__main__ import TestContractions
from .__main__ import TestCodeFormatter
from .__main__ import TestLeadingColon
from .__main__ import rplint
__version__ = "0.2.0" |
from __future__ import absolute_import, unicode_literals
import sys
import os
SITE_ID = 1
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'memory:',
'TEST_NAME': 'test_db:',
}
}
try:
import mysql # noqa
except Exception:
pass
else:
DATABASES = ... |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for
# full license information.
import sys
import iothub_service_client
from iothub_service_client import IoTHubDeviceMethod, IoTHubError
from iothub_service_client_args import get_iothub_opt, OptionE... |
# This source code is part of the Biotite package and is distributed
# under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
# information.
__name__ = "biotite.application.muscle"
__author__ = "Patrick Kunzmann"
__all__ = ["MuscleApp"]
import numbers
import warnings
from tempfile import NamedTemporaryF... |
import signal
import sys
import argparse
import importlib
import os
import logging
from ..entities.experiment import Experiment
"""
This script runs federated experiments
"""
assert os.getcwd().endswith("FIA"), "script should be started from home folder"
if __name__ == "__main__":
parser = argparse.Argumen... |
#!/usr/bin/env python
# Include parent folder in module resolution
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import time
import random
from multisock.crypter import Crypter
from multisock.channel import Channel
from serializabledata import SerializableObje... |
import logging
import traceback
import docker
import docker.errors
import statemachine.exceptions
from bgjobs.models import LOG_LEVEL_DEBUG
from django.conf import settings
from django.db import transaction
from django.utils import timezone
from projectroles.models import SODAR_CONSTANTS
from projectroles.plugins i... |
import sqlite3
print('month 2019',1)
b= |
import os
import time
class Cleanup:
"""The somewhat automated garbage collection system"""
def __init__(self):
self.max_age_minutes = 20
self.max_calls = 5
self.path = './output'
self.calls = 0
def clean(self):
if (self.calls < self.max_calls - 1):
s... |
#!/usr/bin/env python
"""
Unit tests for M2Crypto.BN.
Copyright (c) 2005 Open Source Applications Foundation. All rights reserved.
"""
import re
import warnings
from M2Crypto import BN, Rand
from tests import unittest
loops = 16
class BNTestCase(unittest.TestCase):
def test_rand(self):
# defaults
... |
import unittest
from main import intersection_of_chars
class TestIntersectionOfChars(unittest.TestCase):
def test_empty(self):
self.assertEqual(intersection_of_chars([]), set())
def test_one_string(self):
self.assertEqual(intersection_of_chars(['abc']), set(list('abc')))
def test_many_st... |
__author__ = 'Liliia'
import pytest
import json
import jsonpickle
import os.path
import importlib
from fixture.application import Application
from fixture.db import DbFixture
fixture = None
target = None
def load_config(file):
global target
if target is None:
config_file = os.path.join(os.path.dirnam... |
from collections import namedtuple
import queue
from collections import defaultdict
def dimensions(obj): #gets an iterable of tuples and returns the minimums and maximums and ranges
minim = tuple(min(obj,key = lambda x:x[i])[i] for i in range(len(obj[0])))
maxim = tuple(max(obj,key = lambda x:x[i])[i] for i in... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'src\start.ui'
#
# Created by: PyQt5 UI code generator 5.8.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_StartDialog(object):
def setupUi(self, StartDialog):
Start... |
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponse, HttpResponseRedirect
from django.views import View
from django.shortcuts import render
from django.urls import reverse
from django.contrib import messages
from suite.forms import ClubCreateForm
class ClubCreate(LoginRequir... |
import logging
from unittest import TestCase
from tests.utils.hvac_integration_test_case import HvacIntegrationTestCase
class TestWrapping(HvacIntegrationTestCase, TestCase):
TEST_AUTH_METHOD_TYPE = 'approle'
TEST_AUTH_METHOD_PATH = 'test-approle'
def setUp(self):
super(TestWrapping, self).setUp... |
import base64
import hmac
import time
import uuid
from django.conf import settings
from django.contrib.auth import authenticate
from django.core.exceptions import ImproperlyConfigured
from django.utils.translation import ugettext as _
from tastypie.http import HttpUnauthorized
try:
from hashlib import sha1
except... |
import web
import json
from doc_ret_node_enhancement_term_freq import rt
urls = (
'/search/(.*)', 'search_handler',
'/(.*)', 'static_handler'
)
server = web.application(urls, globals())
class search_handler:
def GET(self, query):
return json.dumps(rt(query))
class static_handl... |
import abc
from collections import namedtuple
from ctypes import POINTER, Structure, byref
from functools import reduce
from operator import mul
import numpy as np
import sympy
from sympy.core.assumptions import _assume_rules
from cached_property import cached_property
from cgen import Struct, Value
from devito.data ... |
import re
from glob import iglob
from os import path
from torchvision import transforms
import h5py
import numpy as np
import torch
from PIL import Image, ImageOps
from pose3d_utils.coords import homogeneous_to_cartesian, ensure_homogeneous
from torchvision.transforms import RandomCrop, RandomHorizontalFlip
from marg... |
import logging
import os
import time
import warnings
from datetime import date, datetime, timedelta
from io import StringIO
from typing import Dict, Iterable, List, Optional, Union
from urllib.parse import urljoin
import numpy as np
import pandas as pd
import requests
import tables
from pvoutput.consts import (
B... |
from django.contrib import admin
from offices.models import StateSenateOffice
class StateSenateOfficeAdmin(admin.ModelAdmin):
search_fields = ['title']
list_filter = ('state_ref',)
admin.site.register(StateSenateOffice, StateSenateOfficeAdmin) |
#!/usr/bin/env python3
import json
import time
from time import mktime
f=open("../../data/metaculus.json")
jsondata=json.load(f)
for page in jsondata:
for question in page["results"]:
if question["possibilities"]["type"]=="binary" and (question["resolution"]==1 or question["resolution"]==0):
try:
restime=... |
#!/usr/bin/python
# ------------- SETUP ------------------------------
input_data = open("sample.txt").read().split("\n\n")
input_template = input_data[0]
pair_insertions_raw = input_data[1].split("\n")
pair_insertions = []
for pair in pair_insertions_raw:
p = pair.split(" -> ")
pair_insertions.append(p)
#... |
"""
Project Name: PyGhostLid
Submit and retrieve pastes from GhostBin within your application! This library supports both ghostbin.com and any
self-hosted instances of ghostbin.
"""
__version_info__ = ('0', '2', '0')
__version__ = '.'.join(__version_info__)
__author__ = 'Marc-Alexandre Chan <laogeodritt@arenthil.net>... |
"""Module to implement a Configuration parser which enhances parsing functionality of configparser
Author(s):
Michael Skarlinski (michael.skarlinski@weightwatchers.com)
Carl Anderson (carl.anderson@weightwatchers.com)
"""
import re
import datetime
import jstyleson
import yaml
import json
from jinja2 import E... |
import json
from copy import deepcopy
from typing import Optional
import openai
from openai import api_requestor, util
from openai.openai_response import OpenAIResponse
from openai.util import ApiType
class OpenAIObject(dict):
api_base_override = None
def __init__(
self,
id=None,
api... |
# -*- coding: utf-8 -*-
FUEL_LITERS_PER_KM = 12
def main():
spent_time_in_hours = int(input())
average_speed_in_km_per_h = int(input())
necessary_fuel_liters = (spent_time_in_hours * average_speed_in_km_per_h) / FUEL_LITERS_PER_KM
print('%.3f' % necessary_fuel_liters)
if __name__ == '__main__':
... |
import numpy as np
import pygame
import cv2
from utils import pickle_load
from utils import pickle_save
class RawVisualizer:
def __init__(self, load_prefix):
"""
Display raw stream recorded by `KinectRecorder`.
Parameter
---------
load_prefix: Path to load data. Will load color stream from
... |
from .anti_alias import *
from .atropos import *
from .kmeans import *
from .functional_lung_segmentation import *
from .fuzzy_spatial_cmeans_segmentation import *
from .kelly_kapowski import *
from .joint_label_fusion import joint_label_fusion
from .joint_label_fusion import local_joint_label_fusion
from .label_geomet... |
import os
import string
from urllib.parse import urlparse
import uuid
import random
from docker.errors import APIError, NotFound
from escapism import escape
from remoteappmanager.docker.async_docker_client import AsyncDockerClient
from remoteappmanager.docker.container import Container
from remoteappmanager.docker.doc... |
from typing import List, Dict, Optional
from django.utils.translation import ugettext as _
from django.conf import settings
from django.contrib.auth import authenticate, get_backends
from django.urls import reverse
from django.http import HttpResponseRedirect, HttpResponse, HttpRequest
from django.shortcuts import red... |
def map_to_range(
old_min: float,
old_max: float,
new_min: float,
new_max: float,
value: float,
) -> float:
"""Maps a value from within one range of inputs to within a range of outputs."""
return ((value - old_min) / (old_max - old_min)) * (new_max - new_min) + new_min |
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
import cv2
import glob
import time
from tqdm import tqdm
from sklearn.svm import LinearSVC
from sklearn.preprocessing import StandardScaler
from skimage.feature import hog
from sklearn.externals im... |
#GPIO Test
from device import CyUSBSerial, CyGPIO
def main():
print("Starting...")
#below line will throw error if driver is not installed
lib = CyUSBSerial(lib="cyusbserial")
#Getting the connected Cy7c65215 device
dev = lib.find().next()
#GPIO Test
gpio = CyGPIO(dev)
gpio.set(5, 1... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
# Copyright 2017 The Forseti Security 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 ap... |
from flask import Flask, redirect, url_for, request, render_template
app = Flask(__name__)
@app.route('/success/<name>')
def success(name):
return 'welcome %s' % name
@app.route('/login', methods=['POST', 'GET'])
def login():
if request.method == 'POST':
user = request.form['nm']
return redire... |
"""Support for Big Ass Fans auto comfort."""
from __future__ import annotations
from typing import Any
from homeassistant import config_entries
from homeassistant.components.climate import (
ClimateEntity,
ClimateEntityFeature,
HVACAction,
HVACMode,
)
from homeassistant.const import ATTR_TEMPERATURE, ... |
import datetime
import json
import scriber
from scriber import error
from scriber.http_client import new_default_http_client
SCRIBER_URL = "https://scriber.io/api/"
PLATFORM = "Web"
SDK_VERSION = "scriberpy-{0}".format(scriber.__version__)
EVENT_TYPES = (
"app_start",
"app_background",
"app_foreground",
... |
#
# Copyright (c) 2021 Siddharth Chandrasekaran <sidcha.dev@gmail.com>
#
# SPDX-License-Identifier: Apache-2.0
#
from .control_panel import ControlPanel
from .peripheral_device import PeripheralDevice
from .key_store import KeyStore
from .constants import (
LibFlag, Command, CommandLEDColor, Event, CardFormat, C... |
import unittest
from domain import DataTable
class DataTableTest(unittest.TestCase):
def setUp(self):
self.table = DataTable('A')
def test_add_column(self):
self.assertEqual(0, len(self.table._columns))
self.table.add_column('Bid', 'bigint')
self.assertEqual(1, len(self.table.... |
import unittest
from app import create_app, db
from config.config import TestingConfig
class BaseConfig(unittest.TestCase):
def setUp(self):
self.app = create_app(config=TestingConfig)
self.app_context = self.app.app_context()
self.app_context.push()
def tearDown(self):
db.se... |
# ------------------------------------------------------------------------
# coding=utf-8
# ------------------------------------------------------------------------
from __future__ import absolute_import, unicode_literals
from functools import reduce
import json
import logging
from django.contrib.admin.views import ... |
from discord_webhook import DiscordWebhook
import tkinter as tk
import threading
import requests
import time
fenetre=tk.Tk()
fenetre.title('ANTI STREAMHACK')
fenetre.geometry("1000x700+0+0")
fenetre.resizable(False, False)
webhook_texte = tk.Label(fenetre, text = "LIEN DU WEBHOOK ICI : ")
webhook_texte.pack()
webhook... |
######################################################################
# Copyright (c)
# John Holland <john@zoner.org>
# All rights reserved.
#
# This software is licensed as described in the file LICENSE.txt, which
# you should have received as part of this distribution.
#
###########################################... |
"""
A recursive function adding commas to integers.
These functions show the why the choice of division at the recursive step matters.
Author: Walker M. White (wmw2)
Date: October 10, 2018
"""
import sys
# Allow us to go really deep
#sys.setrecursionlimit(999999999)
# COMMAFY FUNCTIONS
def commafy(s):
"""
... |
# Copyright 2013 Donald Stufft
#
# 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, so... |
import numpy as np
from scipy import fftpack, interpolate, signal
from sigflux import clip
def freq_logscale(data, ndim=1024, fs=400, down=30, smoothing_cutoff=1, hard_cutoff=200, log_low_cut=-2.32,
prenormalize=True, useEnvelope=True):
"""
This function returns a distorted versi... |
import sys
sys.path.append('.')
import app.models
def suite_setup():
app.models.destroy_db()
app.models.setup_db()
def suite_teardown():
app.models.destroy_db() |
from flask import Flask
from flask_graphql import GraphQLView
from schema import schema
app = Flask(__name__)
app.add_url_rule('/graphql', view_func=GraphQLView.as_view('graphql', schema=schema, graphiql=True)) |
#!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# 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... |
class TransmissiveBoundary:
def __call__(self, U_inside, U_inside_limit):
return U_inside.const(), U_inside_limit |
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... |
import csv
import pymongo
import numpy as np
import math
from collections import OrderedDict
from decimal import Decimal
from scipy.stats import fisher_exact
#################
### CONSTANTS ###
#################
DB_HOST = 'localhost'
DB_PORT = 27017
DB_NAME_GR = 'gr'
DB_NAME_EXAC = 'exac'
class MongoDB():
"... |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2021 Colin Curtain
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, mer... |
#!/usr/bin/python
'''
This program helps in doing the machine learning by running the ACs
in all possible combinations as per given in a list.
The result is stored in a csv file called config.csv
(using csv file is not a must. user can edit the code to use any other file as per his need)
Here we have use code from ht... |
import json
import socket
import time
import paho.mqtt.client as mqtt
import schedule
from apppath import ensure_existence
from draugr.python_utilities.business import busy_indicator
from draugr.writers import LogWriter, MockWriter, Writer
from heimdallr import PROJECT_APP_PATH, PROJECT_NAME
from heimdallr.configurat... |
#!/usr/bin/env python
"""
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
See the file 'LICENSE' for copying permission
"""
from plugins.generic.syntax import Syntax as GenericSyntax
class Syntax(GenericSyntax):
def __init__(self):
GenericSyntax.__init__(self)
@staticmethod
def es... |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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,
... |
from urllib.parse import parse_qs
from zeus import factories
from zeus.constants import GITHUB_AUTH_URI, GITHUB_TOKEN_URI, Permission
from zeus.models import Email, Identity, RepositoryAccess, User
def test_login(client):
resp = client.get("/auth/github")
assert resp.status_code == 302
location, querystr... |
import unittest
from passlock import User
from passlock import Credentials
import pyperclip
class TestClass(unittest.TestCase):
"""
This Test class defines test cases for the User class.
"""
def setUp(self):
"""
This method runs before each individual test methods runself.
"""
... |
#!/usr/bin/env python
import curses
import curses.textpad
import time
from plugin_utils import *
class TerminalFrontend:
'''
Text based curses terminal frontend for the bot.
'''
def __init__(self, stdscr=None):
'''
Initialize the frontend.
:param stdscr: The curses main window, if one exists.
'''
... |
# Copyright (c) 2016 Matthew Earl
#
# 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, distr... |
from django.apps import registry
from django.conf import settings
from django.urls import reverse
from . import settings as app_settings
def menu_items(request):
menu = build_menu(request)
return {
'openwisp_menu_items': menu,
'show_userlinks_block': getattr(
settings, 'OPENWISP_A... |
"""DistributedObject module: contains the DistributedObject class"""
from pandac.PandaModules import *
from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.distributed.DistributedObjectBase import DistributedObjectBase
from direct.showbase.PythonUtil import StackTrace
#from PyDatagram import PyD... |
#!/usr/bin/env python
# Build the project on AppVeyor.
import os
from subprocess import check_call
build = os.environ['BUILD']
config = os.environ['CONFIGURATION']
platform = os.environ['PLATFORM']
path = os.environ['PATH']
image = os.environ['APPVEYOR_BUILD_WORKER_IMAGE']
jobid = os.environ['APPVEYOR_JOB_ID']
shared... |
from django import forms
from django.utils import timezone, safestring
from mptt.forms import TreeNodeChoiceField
from .models import Currency, CurrencyConversion, Account, Budget
import re
class DateInput(forms.DateInput):
input_type = "date"
class ListTextWidget(forms.TextInput):
def __init__(self, dat... |
from __future__ import absolute_import, unicode_literals
from django.utils.translation import ugettext_lazy as _
from .base import Block
__all__ = ['StaticBlock']
class StaticBlock(Block):
"""
A block that just 'exists' and has no fields.
"""
def render_form(self, value, prefix='', errors=None):
... |
import logging as log
import pandas as pd
import numpy as np
from sklearn.preprocessing import scale
from sklearn.cross_validation import train_test_split
from indicators import ewma, rsi
DATA = [
{'currency': 'AUDUSDe', 'timeframe': 1440},
{'currency': 'EURGBPe', 'timeframe': 1440},
{'currency': 'EURJPYe... |
from rubicon.objc import objc_method, at
from travertino.size import at_least
from toga_cocoa.libs import (
NSBezelBorder,
NSOutlineView,
NSScrollView,
NSTableColumn,
NSTableViewUniformColumnAutoresizingStyle
)
from toga_cocoa.widgets.base import Widget
from toga_cocoa.widgets.internal.cells impor... |
# -*- coding: utf-8 -*-
'''
修改文件名为local_setting.py,然后作为本地开发配置
'''
from config.base_setting import *
DEBUG = True
SQLALCHEMY_ECHO = True
SQLALCHEMY_TRACK_MODIFICATIONS=False
#mysql://user:password@127.0.0.1/database?charset=utf8mb4
SQLALCHEMY_DATABASE_URI = 'mysql://root:@127.0.0.1/learn_master?charset=utf8mb4'
SQLALCHE... |
# encoding: utf-8
"""
bgp.py
Created by Thomas Mangin on 2014-06-22.
Copyright (c) 2014-2014 Exa Networks. All rights reserved.
"""
from exabgp.configuration.engine.registry import Raised
from exabgp.configuration.engine.section import Section
# =================================================================== bm... |
# Copyright (c) 2014-2021, Dr Alex Meakins, Raysect Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# ... |
"""
Performance Test: Throughput vs Various Pkt Size Test: VLAN MODE
pytest -m "throughput_vs_pkt and vlan"
"""
import os
import pytest
import allure
pytestmark = [pytest.mark.throughput_vs_pkt, pytest.mark.vlan, pytest.mark.wpa,
pytest.mark.usefixtures("setup_test_run")]
setup_params_general ... |
import os
from zeenode.load import load
window = "mode 90,19"
os.system(window)
load() |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@created: 12.02.20
@author: felix
""" |
# MIT License
#
# Copyright (c) 2020 Jonathan Zernik
#
# 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, mer... |
# Generated by Django 3.1.7 on 2021-04-09 03:12
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0010_ingredient'),
]
operations = [
migrations.RemoveField(
model_name='ingredient',
name='item',
),
... |
# MIT License
# Copyright (c) 2019 Sebastian Penhouet
# GitHub project: https://github.com/Spenhouet/tensorboard-aggregator
# ==============================================================================
"""Aggregates multiple tensorbaord runs"""
import ast
import argparse
import os
import re
from pathlib import Path... |
"""
Local settings
- Run in Debug mode
- Use console backend for emails
- Add Django Debug Toolbar
- Add django-extensions as app
"""
from .base import * # noqa
# DEBUG
# ------------------------------------------------------------------------------
DEBUG = env.bool('DJANGO_DEBUG', default=True)
TEMPLATES[0]['OPT... |
from output.models.ms_data.simple_type.st_e072_xsd.st_e072 import (
Doc,
Root,
)
__all__ = [
"Doc",
"Root",
] |
import importlib.util
import os
import numpy as np
from pykeops import bin_folder, build_type
from pykeops.common.compile_routines import compile_specific_fshape_scp_routine
from pykeops.common.utils import c_type, create_and_lock_build_folder
from pykeops.numpy import default_dtype
class LoadKeopsFshapeScp:
r"... |
import re
import spacy
import typer
from itertools import islice
from pathlib import Path
from datasets import load_dataset
def main(
lang: str,
oscar_dataset: str,
max_texts: int,
output_file: Path,
n_process: int = 8,
batch_size: int = 100,
):
if lang == "ko":
nlp = spacy.blank(
... |
"""
Number Field Ideals
AUTHORS:
- Steven Sivek (2005-05-16)
- William Stein (2007-09-06): vastly improved the doctesting
- William Stein and John Cremona (2007-01-28): new class
NumberFieldFractionalIdeal now used for all except the 0 ideal
- Radoslav Kirov and Alyson Deines (2010-06-22):
prime_to_S_part, is... |
from django.urls import path
from .views import *
app_name = "warriors_app"
urlpatterns = [
path('warriors/list/', WarriorListAPIView.as_view()),
path('warriors/prof/', ProfessionAPIView.as_view()),
path('warriors/skills/', SkillOfWarriorAPIView.as_view()),
path('skills/', SkillAPIView.as_view()),
... |
import json
import time
from bzt import AutomatedShutdown
from bzt.modules.aggregator import DataPoint, KPISet
from bzt.modules.passfail import PassFailStatus, DataCriterion, CriteriaProcessor
from tests import BZTestCase, random_datapoint, RESOURCES_DIR, ROOT_LOGGER
from tests.mocks import EngineEmul, ModuleMock
cl... |
#!/usr/bin/python3
from argparse import ArgumentParser
import subprocess
def main():
parser = ArgumentParser()
parser.add_argument('--version', required=True)
args = parser.parse_args()
version = args.version
_create_package(version)
def _create_package(version):
options = {
'depen... |
import datetime
import os
import yaml
# Project config.
project = "LXD"
author = "LXD contributors"
copyright = "2014-%s %s" % (datetime.date.today().year, author)
with open("../shared/version/flex.go") as fd:
version = fd.read().split("\n")[-2].split()[-1].strip("\"")
# Extensions.
extensions = [
"myst_pars... |
from ..base import BaseDCType
from .data import NamedScoreData
from .mixins import AllMixins
class NamedScore(AllMixins, BaseDCType):
_data_class = NamedScoreData |
from dbmodules.base import BaseDBServer
from dbmodules.user import UserTable
class Server():
@staticmethod
def base_tips(reason, tips_type='info', *args, **kwargs):
""" return response with code.
if you want to use custom code,you can use code parameters
"""
if 'info' == tips_... |
import sys
sys.path.append('..')
from dread.base import BaseResource
from dread.json import JSONDispatcher
from dread.auth import BasicAuth
from werkzeug.exceptions import NotFound
class User(BaseResource):
PROTECTED_ACTIONS = [
'create', 'update', 'delete'
]
def __init__(self):
self.us... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
"""
Unit tests for MicroService.py module
Author: Valentin Kuznetsov <vkuznet [AT] gmail [DOT] com>
"""
from __future__ import division, print_function
import unittest
import cherrypy
from WMCore_t.MicroService_t import TestConfig
from WMCore.MicroService.Service.RestApiHub import RestApiHub
from WMCore.MicroServic... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.