text stringlengths 2 999k |
|---|
# -*- coding: iso-8859-15 -*-
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from .latex import *
from .misc import errwarn
def pdflatex_emoji(m):
space1 = m.group(1)
space2 = m.group(3)
name = m.group(2)
if not os.path.isdir(latexfigdir):
... |
from typing import TextIO, List, Optional
from .common_types import Sequence
def load(fp: TextIO) -> List[Sequence]:
sequences: List[Sequence] = []
header: Optional[str] = None
curseq: bytearray = bytearray()
for line in fp:
if line.startswith('>'):
if header and curseq:
... |
# qubit number=5
# total number=52
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as ... |
# See LICENSE for licensing information.
#
# Copyright (c) 2016-2019 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
import debug
import utils
from tech import GDS, ... |
#
# Copyright (c) 2019, 2020 by Delphix. All rights reserved.
#
import json
import os
import yaml
from dlpx.virtualization._internal import const, exceptions
from dlpx.virtualization._internal.commands import build
from dlpx.virtualization._internal.plugin_importer import PluginImporter
import mock
import pytest
@... |
"""
Preprocessing
Haystack includes a suite of tools to extract text from different file types, normalize white space
and split text into smaller pieces to optimize retrieval.
These data preprocessing steps can have a big impact on the systems performance and effective handling of data is key to getting the most out o... |
try:
from . import BASE, SESSION
except ImportError:
raise AttributeError
from sqlalchemy import BigInteger, Column, Numeric, String, UnicodeText
class Welcome(BASE):
__tablename__ = "codwelcome"
chat_id = Column(String(14), primary_key=True)
previous_welcome = Column(BigInteger)
... |
# Original author: Yann Henon
# Adapted from https://github.com/yhenon/pytorch-retinanet/blob/master/retinanet/coco_eval.py
# Modified by jsk1107
from pycocotools.cocoeval import COCOeval
import json
import torch
def evaluate_coco(dataset, model, json_path, threshold=0.05):
model.eval()
with torch.no_gr... |
import urllib
import re
from bs4 import BeautifulSoup
url = raw_input("Enter the URL ")
ht= urllib.urlopen(url)
html_page = ht.read()
email_pattern=re.compile(r'\b[\w.-]+?@\w+?\.\w+?\b')
for match in re.findall(email_pattern,html_page ):
print match
|
import _plotly_utils.basevalidators
class ShowlegendValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="showlegend", parent_name="cone", **kwargs):
super(ShowlegendValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... |
import pytest
from d3rlpy.algos.crr import CRR
from tests import performance_test
from .algo_test import algo_tester, algo_update_tester, algo_pendulum_tester
@pytest.mark.parametrize("observation_shape", [(100,), (4, 84, 84)])
@pytest.mark.parametrize("action_size", [2])
@pytest.mark.parametrize("q_func_factory", [... |
#!/usr/bin/env python
# Jonas Schnelli, 2013
# make sure the UNCoin-Qt.app contains the right plist (including the right version)
# fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267)
from string import Template
from datetime import date
bitcoinDir = "./";
inFi... |
# -*- coding: utf-8 -*-
"""
Pinotate core module
"""
__author__ = 'Galarius'
__copyright__ = 'Copyright 2020, Galarius'
from .highlight import Highlight
import sqlite3
import shutil
import json
import sys
import os
class IBooksDispatcher(object):
"""
Class to perform operations on iBooks database
"""
... |
from typing import Optional, List
from pydantic import UUID4, BaseModel
class HTTPError(BaseModel):
detail: str
# Auth Model
class UserAuthBase(BaseModel):
username: str
email: Optional[str] = None
fullname: Optional[str] = None
disabled: Optional[bool] = None
class UserAuthInDB(UserAuthBase)... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
https://github.com/cgloeckner/pyvtt/
Copyright (c) 2020-2021 Christian Glöckner
License: MIT (see LICENSE for details)
"""
import os, pathlib, tempfile, zipfile, json
from bottle import FileUpload
from pony.orm import db_session
from PIL import Image
import orm
from... |
import os, sys, logging
import warnings
from webob.exc import HTTPNotFound
log = logging.getLogger(__name__)
import tg
from tg import request_local
from tg.i18n import _get_translator
from tg.request_local import Request, Response
try: #pragma: no cover
import pylons
has_pylons = True
except:
has_pylons ... |
from django.db import models
class SubscriberCount(models.Model):
path = models.CharField(max_length=128)
count = models.IntegerField()
created = models.DateTimeField(auto_now_add=True)
user_agent = models.CharField(max_length=256, db_index=True)
class Meta:
index_together = [
... |
from wagtail import hooks
class HookResponseMixin:
"""
A mixin for class-based views to support hooks like `before_edit_page`, which are triggered
during execution of some operation and can return a response to halt that operation.
"""
def run_hook(self, hook_name, *args, **kwargs):
"""
... |
import os
import torch
import numpy as np
from datetime import datetime
import time
import pandas as pd
from typing import Iterable, Callable, Dict, Tuple
class AverageMeter(object):
"""
Computes and stores the average and current value
Attributes
----------
val : float
Stores the average ... |
import cagen
import re
import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.osgunittest as osgunittest
import osgtest.library.condor as condor
import osgtest.library.service as service
class TestStartCondorCE(osgunittest.OSGTestCase):
# Tests 01-02 are needed to reconfi... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG),
# acting on behalf of its Max Planck Institute for Intelligent Systems and the
# Max Planck Institute for Biological Cybernetics. All rights reserved.
#
# Max-Planck-Gesellschaft zur Förderung der Wissens... |
from datetime import datetime
import calendar
prefix_url = 'https://oscar.gatech.edu/pls/bprod/bwckschd.p_disp_detail_sched?term_in=202102&crn_in='
table_labels = {'seats_capacity': 0, 'seats_actual': 1, 'seats_remaining': 2, \
'waitlist_capacity': 3, 'waitlist_actual': 4, 'waitlist_remaining': 5, 't... |
#-*- coding: utf-8 -*-
"""
file: decompile_dictionary.py
Description: creates a dictionary file from a serialized dictionary.
A dictionary file is a file where every entry is on one line. There are
two kinds of dictionaries: token and multiword. A token dictionary will
apply itself on single tokens. A multiwo... |
from django import forms
from django.contrib import admin
from django.contrib.contenttypes import generic
from bible import Verse, RangeError # python-bible
from models import Scripture
class ScriptureForm(forms.ModelForm):
class Meta:
model = Scripture
def clean(self):
# Checking to see if... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
#copied from pendulum
def hidden_init(layer):
fan_in = layer.weight.data.size()[0]
lim = 1. / np.sqrt(fan_in)
return (-lim, lim)
class Actor(nn.Module):
"""Actor (Policy) Model."""
def __init__(self, state_siz... |
"""
transmission.py - Transmission component for the vehicle example problem.
"""
# This openMDAO component contains a simple transmission model
# Transmission is a 5-speed manual.
# pylint: disable-msg=E0611,F0401
from openmdao.main.api import Component, convert_units
from openmdao.main.datatypes.api import Floa... |
#!/usr/bin/env python
#
# File Name : bleu.py
#
# Description : Wrapper for BLEU scorer.
#
# Creation Date : 06-01-2015
# Last Modified : Thu 19 Mar 2015 09:13:28 PM PDT
# Authors : Hao Fang <hfang@uw.edu> and Tsung-Yi Lin <tl483@cornell.edu>
from bleu.bleu_scorer import BleuScorer
class Bleu:
def __init__(self... |
import os,shutil, pyzipper
from datetime import datetime
## gatting time object
now = datetime.now()
# dd/mm/YY H:M:S
dt_string = now.strftime("%m%d%y")
## function to compress file
def compressFile(folder_name):
zip_file_location = f"./{dt_string}.zip"
zipPW = "latenight"
to_zip = list()
with pyzippe... |
""" @package gen_dist
<pre>
Usage:
gen_dist.py stage [<component>]
gen_dist.py version <major> <minor> <patch> [--postfix=<str>]
Options:
-h --help Show this screen.
--postfix=<str> The postfix part of the version string, e.g. 'a' in 'v1.0.1a'
</pre>
"""
impor... |
import os, sys, time
import numpy as np
from astropy.io import fits
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib.colorbar import Colorbar
from matplotlib.patches import Ellipse
from astropy.visualization import (AsinhStretch, ImageNormalize)
from d... |
import ctypes as ct
from .lib import SMLM
import numpy as np
import numpy.ctypeslib as ctl
from .context import Context
#CDLL_EXPORT sCMOS_CalibrationTransform* sCMOS_Calib_Create(int w, int h,
#const float* offset, const float* gain, const float *variance, Context* ctx);
#CDLL_EXPORT GainOffsetTransform* GainOffsetC... |
# Copyright 2014 Cloudbase Solutions Srl
#
# 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 numpy as np
a = np.array([1, 2, 3, 4, 5])
np.sum(a ** 2)
|
import torch
import torch.nn as nn
import torch.nn.functional as F
# 将图片的3通道提升维度
class DoubleConv(nn.Module):
"""(convolution => [BN] => ReLU) * 2"""
def __init__(self, in_channels, out_channels, mid_channels=None):
super().__init__()
if not mid_channels:
mid_channels = out_channels... |
# -*- coding: utf-8 -*-
# Copyright 2014 Metaswitch Networks
#
# 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 applicab... |
from flask import Response
from calculators.bridge import theoretical_bridge
def bridgeRequestHandler(option: str, value: int):
if not value or not option:
return Response("No options or value given!", 400)
bridge = theoretical_bridge(option, value)
response_dict = {"bridge": [round(num, 1) for n... |
#
# 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 m... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayPlatformUseridGetModel import AlipayPlatformUseridGetModel
class AlipayPlatformUseridGetRequest(object):
de... |
# -*- coding: utf-8 -*-
import os
from trac.core import TracError
from trac.test import EnvironmentStub, Mock
from trac.web.auth import BasicAuthentication, LoginModule
from trac.web.href import Href
from Cookie import SimpleCookie as Cookie
import unittest
class LoginModuleTestCase(unittest.TestCase):
def se... |
# Copyright (C) 2015-2021 Regents of the University of California
#
# 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 app... |
# Copyright 2019 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
import pandas as pd
from rwrap import base, stats, DESeq2
# read data
df_cts = pd.read_csv("count_data.csv", index_col=0)
df_coldata = pd.read_csv("col_data.csv", index_col=0)
# do DEA
dds = DESeq2.DESeqDataSetFromMatrix(
countData=df_cts, colData=df_coldata, design=stats.as_formula("~ condition")
)
dds = DESe... |
# Modified source code from https://github.com/Aksh77/Bio-Scraper/blob/master/UniProt-Scraper/scraper.py
import os
import re
import sys
import csv
import pandas as pd
import pprint
import time
import urllib
from urllib.request import urlopen
from bs4 import BeautifulSoup
#display list
def display_list(arr):
return... |
import sys
from zeys.api.detector import Detector
class Runner:
def __init__(self):
pass;
def run(self):
detector = Detector()
stream = detector.run()
for output in stream:
print(str(output))
sys.stdout.flush()
def main():
runner = Runner()
runner.run()
|
from ncssl_api_client.config.api.api_client_production_config import ApiProductionClientConfig
from ncssl_api_client.config.crypto.crypto_config import CryptoConfig
from ncssl_api_client.config.api.api_client_sandbox_config import ApiSandboxClientConfig
from ncssl_api_client.config.api.api_command_config import ApiComm... |
import os
import tempfile
import pandas as pd
from SSFile import SSFile
class StataFile(SSFile):
def read_input_to_pandas(self, columnList=[], indexCol="Sample"):
if self.isGzipped:
tempFile = super()._gunzip_to_temp_file()
if len(columnList)>0:
df=pd.read_stata(... |
# -*- coding: utf-8 -*-
"""Functions for calculating the properties of a standard atmosphere at
a given altitude."""
import numpy as np
# Define physics parameters (in SI units):
G = 9.80665 # Acceleration due to gravity.
ATM_GAS_CONSTANT = 287.05 # Specific gas constant for dry air.
ATM_DENSITY = 1.2250 # Atmosph... |
import torch
import blobfile as bf
from typing import Tuple, Union, Callable
import torchvision.transforms as Tr
from torch.utils.data import Dataset
import ddpmMed.data.transforms as t
from ddpmMed.utils.data import imread, brats_labels
class SegmentationDataset(Dataset):
"""
A dataset object for semantic se... |
# Copyright 2016-2020 Blue Marble Analytics 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 law or ag... |
"""A test that publishes NumPy arrays.
Uses REQ/REP (on PUB/SUB socket + 1) to synchronize
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2010 Brian Granger
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, dis... |
# Copyright (C) 2019-2022 Intel Corporation
#
# SPDX-License-Identifier: MIT
from __future__ import annotations
from glob import iglob
from typing import Any, Callable, Dict, Iterator, List, Optional
import os
import os.path as osp
from attr import attrs, field
import attr
import numpy as np
from datumaro.component... |
#!/usr/bin/env python
# Copyright (c) 2020 Vipin Sharma. All Rights Reserved.
# SPDX-License-Identifier: BSD-2 License
# The full license information can be found in LICENSE.txt
# in the root directory of this project.
'''
A simple ORM for interacting with SQLite database.
'''
import logging
import os
import sqlite3
... |
import math
import uuid
from django.db import models
import directory.models as directory_models
class Application(models.Model):
"""
Модель rest приложений для безопасного доступа по ключам
"""
PLACES_FRACTION = 'fraction'
PLACES_APP = 'app'
PLACES_BOTH_MIN = 'both-min'
PLACES_BOTH_MAX... |
# Copyright 2019 Google LLC. 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 applicable law or a... |
from django.db.models.functions import Cast
from django.db.models.aggregates import Sum
from django.db.models.fields import IntegerField
from django.shortcuts import redirect, render
from . import models, forms
from django.contrib.auth.decorators import login_required
from django.db.models import Count
from django.db.m... |
print(17 / 3) # выведет 5.66666666667
print(17 // 3) # выведет 5
print(17 % 3) # выведет 2
# округление в cторону нуля
print(int(1.7)) # 1
print(int(-1.7)) # -1
# округление вверх
import math
x = math.ceil(4.2)
y = math.ceil(4.8)
print(x)
print(y)
# округление вниз
x = math.floor(4.2)
y = math.floor(4.8)
print(... |
import copy
with open("input.txt") as file:
lines = file.read().split("\n")
foods = []
for line in lines:
ingredients = line.split(" (")[0].split(" ")
known_allergens = line[line.find("(contains ") + len("(contains "):-1].split(", ")
foods.append({
"ingredients": set(in... |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/root/ros_catkin_ws/src/ros_comm/message_filters/include".split(';') if "/root/ros_catkin_ws/src/ros_comm/message_filters/include" != "" else []
PROJECT_CATKIN_DEPENDS = "roscpp;xmlrpcpp;rosconsole".re... |
print('\033[1;31;46mOlá, mundo!\033[m')
print('\033[7;40mOlá, mundo!\033[m')
|
# Copyright 2021 Research Institute of Systems Planning, 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 applica... |
class Solution:
def missingNumber(self, nums: List[int]) -> int:
res = 0
for _ in range(len(nums) + 1):
res += _
return res - sum(nums)
|
import unittest, time, sys, random
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd,h2o_hosts, h2o_browse as h2b, h2o_import as h2i, h2o_hosts, h2o_jobs, h2o_gbm
DELETE_KEYS = True
# FIX need to get exec workin
DO_CLASSIFICATION = False
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_san... |
# we split each data into three part and perform experiments on every test programs selection since the result of
# different programs varies dramatically, we fix the separation to ensure result consistency.
def get_dataset_seperation(train_file):
if "klee" in train_file:
f1 = ['split', 'cp', 'base64', 'fmt... |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017-2018 The Fecal E.coli developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test fecald with different proxy configuration.
... |
from flask import Flask, render_template, redirect, url_for,request, flash
from flask_bootstrap import Bootstrap
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import InputRequired, Email, Length
from flask_sqlalchemy import SQLAlchemy
f... |
"""
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... |
'''
Created on Nov 14, 2018
@author: nilson.nieto
'''
from datetime import *
import time
initTime = time.perf_counter()
listdates=[]
d1 = date(2016,8,12)
d2 = date(2017,4,12)
d3 = date(2018,7,12)
d4 = date(2005,8,12)
listdates.append(d1)
listdates.append(d2)
listdates.append(d3)
listdates.append(d4)
listdat... |
import random
# User Weapon Variables
B = "Brushing"
F = "Floss"
D = "Dental Wash"
L = "Low-Sugar Diet"
M = "Medicine (Probiotics)"
User_Weapons = [B, F, D, L, M]
chosen_UW = ""
# User Attack Variables
P = "Plaque"
G = "Gum Disease"
T = "Tooth Sensitivity"
S = "Stained Teeth"
U = "Unpleasant Breath"
... |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..preprocess import AutoTcorrelate
def test_AutoTcorrelate_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
eta2=dict(argstr='-eta2',
),
... |
import datetime
import glob
import math
import os
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import geopandas as gpd
from shapely.geometry import box
import networkx as nx
from shapely.geometry import Point
import imageio
pd.options.mode.chained_assignment = None # default='warn'
path = "... |
#!/usr/bin/env python3
# Copyright (C) Alibaba Group Holding Limited.
""" Timer class. """
from time import perf_counter
from typing import Optional
class Timer:
"""
A timer which computes the time elapsed since the start/reset of the timer.
"""
def __init__(self) -> None:
s... |
import requests
from .image import Image, image_from_location_url
from .errors import InvalidImageError, ServerError
import io
class Client:
"""
A Graphique client.
"""
def __init__(self, hostname, port):
self._hostname = hostname
self._port = port
def submit_image(self, image_c... |
import datetime
import logging
from numbers import Number
from typing import Any, Dict, List, Optional, Union
import great_expectations.exceptions as ge_exceptions
from great_expectations.checkpoint.util import get_substituted_validation_dict
from great_expectations.core import RunIdentifier
from great_expectations.co... |
import os
import sys
import json
import shutil
import pystache
from knightos.config import Config
from knightos.repository import ensure_package
def _find_root():
path = os.getcwd()
while True:
if ".knightos" in os.listdir(path):
if not os.path.isdir(os.path.join(path, ".knightos")):
... |
import inspect
import os.path
import django
import SocketServer
import sys
from django.conf import settings
from django.views.debug import linebreak_iter
from django.utils.html import escape
from django.utils.safestring import mark_safe
# Figure out some paths
django_path = os.path.realpath(os.path.dirname(django.__f... |
#!/usr/bin/python
import os
import time
import urllib2
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--database')
parser.add_argument('--query')
parser.add_argument('--outfile')
parser.add_argument('--jobid')
args = parser.parse_args()
# Fake work that sleeps for the length of the job id (fo... |
import json
import requests
class Tenant(object):
pass
class BusinessGroup(Tenant):
def __init__(self):
pass
@staticmethod
def get_businessgroups(session, tenant=None):
pass
class Reservation(BusinessGroup):
@classmethod
def get_fromid(cls, session, id):
pass
... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
#!/usr/bin/env python
# Copyright (c) 2019 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
This module provides the key configuration parameters for a scenario based on OpenSCENARIO
"""
import logging
import os
import xml.et... |
from connector.download.plugin.bing import smykowski
def test_register_listener():
def callback(message):
pass
smykowski.register_listener("random_topic", callback)
assert(callback in smykowski.listeners_for_topic("random_topic"))
def test_callback():
_called = []
def callback(message)... |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
# coding: utf-8
"""
Contacts
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v3
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from hubs... |
'''
Author: Emilio Morales (mil.mor.mor@gmail.com)
Mar 2022
'''
import argparse
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # Disable tensorflow debugging logs
import time
import tensorflow as tf
import tensorflow_text as text
from model import GPT
from utils import *
from hparams import hparams
AUTOTUN... |
# Generated by Django 2.2.7 on 2020-02-06 02:02
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permission... |
import os, json, logging
import shared
from tools.shared import execute
def calculate(temp_files, in_temp, stdout, stderr):
# Check if we need to include some libraries that we compile. (We implement libc ourselves in js, but
# compile a malloc implementation and stdlibc++.)
def read_symbols(path, exclude=None)... |
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
from math import floor
n = int(readline())
print(floor((n - 1) / 2))
|
import torch
import pyredner.transform as transform
import redner
import math
import pyredner
from typing import Tuple, Optional, List
class Camera:
"""
Redner supports four types of cameras\: perspective, orthographic, fisheye, and panorama.
The camera takes a look at transform or a cam_to_world m... |
# Generated by Django 2.0.8 on 2018-10-19 10:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('donations', '0002_donation_profile'),
]
operations = [
migrations.AddField(
model_name='donationlevel',
name='color'... |
# -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
from datetime import datetime
import os
from random import randint
import signal
from ssl import SSLError
import sys
import time
import traceback
from gunicorn import six
from gunicorn import... |
import fcntl
import time
def get_lock(state):
result = False
file = open('lock', 'r+')
fcntl.flock(file.fileno(), fcntl.LOCK_EX)
Lock = file.readline()
if Lock=='True':
print('other mig in progress !!!')
if state == True and Lock == 'False':
print('acquire lock {} at {}'.format... |
#!/usr/bin/python3
# coding=utf-8
# pylint: disable=I0011,E0401,W0702,W0703,R0902
# Copyright 2019 getcarrier.io
#
# 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.... |
#!/usr/bin/env python3
"""Home Assistant setup script."""
import os
from setuptools import setup, find_packages
from homeassistant.const import __version__
PROJECT_NAME = 'Home Assistant'
PROJECT_PACKAGE_NAME = 'homeassistant'
PROJECT_LICENSE = 'Apache License 2.0'
PROJECT_AUTHOR = 'The Home Assistant Authors'
PROJEC... |
from vars import *
csvFile = CSV_FOLDER + "attiny-output_wave.csv"
resolution = 1 # Nur jeden n-ten wert verwenden
x = np.genfromtxt(csvFile, delimiter=",", skip_header=8, usecols=1) /1000000 # Zeit Konversion von Nanosekunden zu Sekunden
y = np.ge... |
import boto3
import json
from storage.memcached import memcached_operator
def handler(event, context):
function_name = "lambda_core"
# dataset setting
dataset_name = 'higgs'
data_bucket = "higgs-10"
dataset_type = "dense_libsvm" # dense_libsvm or sparse_libsvm
n_features = 3... |
# Copyright (c) 2013-2015, Rethink Robotics
# 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,
# this list of conditio... |
import boto3
import json
import random
import uuid
import time
def get_utc_timestamp(seconds=None):
return time.strftime('%Y-%m-%dT%H:%M:%S.00Z', time.gmtime(seconds))
class AlexaResponse:
def __init__(self, **kwargs):
self.context_properties = []
self.payload_endpoints = []
# ... |
from __future__ import print_function
import argparse
import json
import logging
import os
import sys
from collections import namedtuple
import time
import pbcommand
from .core import get_default_argparser_with_base_opts
from pbcommand.common_options import add_base_options, add_common_options
from pbcommand.models ... |
def square(n):
"""Returns the square of a number."""
squared = n ** 2
print "%d squared is %d." % (n, squared)
return squared
# Call the square function on line 10! Make sure to
# include the number 10 between the parentheses.
square(10)
|
#!/usr/bin/env python
# Copyright 2016 Google Inc. 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 ... |
from __future__ import absolute_import, division, print_function
import ispyb.model.pdb
import mock
import pytest
def test_pdb_values_are_immutable():
P = ispyb.model.pdb.PDB()
with pytest.raises(AttributeError):
P.name = "test"
with pytest.raises(AttributeError):
P.rawfile = "test"
w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.