text stringlengths 1 927k |
|---|
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: José Sánchez-Gallego (gallegoj@uw.edu)
# @Date: 2020-08-17
# @Filename: sky.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
# IAU-defined sky coordinate systems and transformations.
import ctypes
import numpy
from . import sofa... |
from __future__ import print_function, division
from itertools import combinations
from sympy.core import Basic
from sympy.combinatorics.graycode import GrayCode
from sympy.core.compatibility import range
class Subset(Basic):
"""
Represents a basic subset object.
We generate subsets using essentially t... |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use ... |
from __future__ import print_function
from OneLib.Time.ETA import Timer
import time
tm = Timer(10)
tm.start()
for i in range(10):
time.sleep(1)
print(tm.eta()) |
import coroutine
def f(x):
print(12)
coroutine.sleep(x)
print(34)
if __name__ == '__main__':
coro = coroutine.Coroutine(target=f, args=(2,))
coro.start()
print(56)
coro.join() |
from django.urls import path, include
from rest_framework.urlpatterns import format_suffix_patterns
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from users import views
from django.conf import settings
from django.conf.urls.static import static
from users.views import Profile... |
class Factor(object):
def __init__(self, factorType, variables, measurement):
"""
Initialize the factor object
factorType - the factor type (e.g. Pose3Pose3)
variables - a list of the variables affected by the factor
measurement - the distribution describing the measurement
... |
import logging
import torch
import torch.nn as nn
import torch.utils.checkpoint as cp
from ....utils.misc import rgetattr, rhasattr
from .resnet import ResNet
from mmcv.cnn import constant_init, kaiming_init
from mmcv.runner import load_checkpoint
from ....ops.trajectory_conv_package.traj_conv import TrajConv
from ... |
import os
def write_maxcut_file(filename):
with open(os.path.join("data", filename)) as f:
lines = f.readlines()
with open(os.path.join("maxcut", filename), mode='w') as f:
f.write(lines[0])
for line in lines[1::]:
u, v = map(int, line.split())
f.write("{} {} 1\... |
from typing import Tuple, FrozenSet
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
import pysmt.typing as types
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
# ===================================================================
#
# Copyright (c) 2015, Legrandin <helderijs@gmail.com>
# 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. Redistributio... |
import torch
from dataclasses import dataclass, field
from typing import List
from torch import nn
from torch.utils.data import DataLoader
from torch.nn.utils.rnn import pad_sequence
import csv
from nltk.corpus import stopwords
import random
from tqdm import tqdm
@dataclass
class Instance:
label : int
text :... |
#! /usr/bin/env python
"""Test script for the binhex C module
Uses the mechanism of the python binhex module
Based on an original test by Roger E. Masse.
"""
import binhex
import os
import unittest
from test import test_support
class BinHexTestCase(unittest.TestCase):
def setUp(self):
self.fname1 ... |
# Copyright 2014 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
import cherrypy
import threading
import time
import requests
import datetime
import json
class MessagePuller(object):
def pullMessages(self):
data='{"thingName":"TestRemoteThing","action":"pullMessages"}'
response = requests.post("http://localhost:8080/EdgeGateway/", data=data, headers = service_he... |
"""
Views and functions for serving static files. These are only to be used
during development, and SHOULD NOT be used in a production setting.
"""
import mimetypes
import posixpath
from pathlib import Path
from django.http import FileResponse, Http404, HttpResponse, HttpResponseNotModified
from django.template import... |
import click
from flask import g
import fastText
from .server import app
@click.command()
@click.argument('model', type=click.Path(exists=True))
def cli(model):
app.config["FT_SERVER_MODEL_PATH"] = model
app.run(host=app.config["HOST"], port=app.config["PORT"], debug=app.config["DEBUG"])
cli() |
from rpython.rtyper.lltypesystem import lltype, rffi
from rpython.rlib import clibffi
from rpython.rlib import libffi
from rpython.rlib import jit
from rpython.rlib.rgc import must_be_light_finalizer
from rpython.rlib.rarithmetic import r_uint, r_ulonglong, intmask
from pypy.interpreter.baseobjspace import W_Root
from ... |
from JJE_Standings.models import YahooStanding
def get_overclaim_teams(team_list):
team_standings = YahooStanding.objects.filter(current_standings=True).filter(yahoo_team_id__in=team_list)
if len(team_standings) == 0:
return []
max_rank = max([t.rank for t in team_standings])
overclaim_teams =... |
import unittest
import chrono
from datetime import datetime
class LittleEndianFormatTest(unittest.TestCase):
def setUp(self):
pass
def test_little_endian(self):
results = chrono.parse('Test : 24 March 2013')
self.assertEqual(len(results), 1)
result = results[0]
se... |
'''
FILE: BaseHandler.py
PURPOSE: Defines the base for rendering HTML files
MODIFIED: 6 March 2014
AUTHOR: Mathee Sivananthan
'''
# IMPORT STATEMENTS
import webapp2
import jinja2
import urllib2
import logging
import time
import json
import os
import sys
import re
from xml.dom import minidom
from string import l... |
from django import forms
from django.utils.translation import ugettext_lazy as _
from aldryn_apphooks_config.utils import setup_config
from app_data import AppDataForm
from parler.forms import TranslatableModelForm
from sortedm2m.forms import SortedMultipleChoiceField
from .models import Category, QuestionListPlugin,... |
# -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/Composition
Release: R5
Version: 4.5.0
Build ID: 0d95498
Last updated: 2021-04-03T00:34:11.075+00:00
"""
from pydantic.validators import bytes_validator # noqa: F401
from fhir.resources import fhirtypes # noqa: F401
from fhir.resources impor... |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for depot tools.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmit ... |
"""Train the inception-v3 model on Solar Panel Identification dataset."""
from datetime import datetime
import os.path
import time
import sys
import numpy as np
import tensorflow as tf
import skimage
import skimage.io
import skimage.transform
import random
import pickle
from collections import deque
from inception i... |
# coding=utf-8
import iyzipay
options = {
'api_key': iyzipay.api_key,
'secret_key': iyzipay.secret_key,
'base_url': iyzipay.base_url
}
request = {
'locale': 'tr',
'conversationId': 1234,
'name': 'Premium Monthly',
'price': 500,
'currencyCode': 'USD',
'paymentInterval': 'MONTHLY',
... |
# coding: utf-8
# Copyright 2013 The Font Bakery 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 re... |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
from codecs import open
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
# get the dependencies and installs
with ... |
# ----------------------------------------------------------------
# Copyright 2019 Cisco Systems
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... |
from __future__ import division
import numpy as np
import pytest
from numpy.testing import assert_almost_equal
from mla.metrics.base import check_data, validate_input
from mla.metrics.metrics import get_metric
def test_data_validation():
with pytest.raises(ValueError):
check_data([], 1)
with pytest... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# invenio-dm-tugraz is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Mappings for Elasticsearch 7.x."""
from __future__ import absolute_import, print_function |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.mail.tap}.
"""
from twisted.trial.unittest import TestCase
from twisted.python.usage import UsageError
from twisted.mail import protocols
from twisted.mail.tap import Options, makeService
from twisted.python.filepath impo... |
# Natural Language Toolkit: Semantic Interpretation
#
# Author: Ewan Klein <ewan@inf.ed.ac.uk>
#
# Copyright (C) 2001-2012 NLTK Project
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
Utility functions for batch-processing sentences: parsing and
extraction of the semantic representation of... |
import FWCore.ParameterSet.Config as cms
from Configuration.Generator.Pythia8CommonSettings_cfi import *
from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import *
generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter",
pythiaHepMCVerbosity = cms.untracked.bool(False),
... |
# coding: utf-8
# # Dogs-vs-cats classification with CNNs
#
# In this notebook, we'll train a convolutional neural network (CNN,
# ConvNet) to classify images of dogs from images of cats using
# TensorFlow 2.0 / Keras. This notebook is largely based on the blog
# post [Building powerful image classification models us... |
# -*- coding: utf-8 -*-
import json
import os
import re
from tqdm import tqdm
from mercenaries import MERCENARIES
from hearthstone.mercenaryxml import load
import requests
dbfData = {}
def loadjson():
# file_list = requests.get("https://api.hearthstonejson.com/v1/").text
# ver_list = list(map(int, re.finda... |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... |
import src.inheritance_pkg.sub as sub # works PyC, FAILS vsc in sub.py
print("running from sibling of target code, ala https://github.com/valhuber/fab-quickstart")
my_sub = sub.Sub() |
# -*- coding: utf-8 -*-
""" Testing the Dynamic DynamoDB scaling methods """
import unittest
from dynamic_dynamodb.core.table import scale_reader
class TestScaleReader(unittest.TestCase):
""" Test the scale reader method """
def __init__(self):
self.value = {0: 0, 0.25: 5, 0.5: 10, 1: 20, 2: 50, 5: ... |
import numpy as np
from grove.alpha.jordan_gradient.gradient_utils import binary_to_real, \
measurements_to_bf
def test_binary_to_real():
for sign in [1, -1]:
decimal_rep = sign * 0.345703125
binary_rep = str(sign * 0.010110001)
decimal_convert = binary_to_real(binary_rep)
a... |
from unittest.mock import MagicMock, patch
from static_markdown.server import main
def test_main_regular_call():
with patch("argparse.ArgumentParser.parse_args") as argument_mock:
argument_mock.return_value = MagicMock(version=False, root=".", port=9999)
with patch("http.server.HTTPServer.serve_f... |
"""
Indicators of Neighborhood Change
"""
from collections import defaultdict
import numpy as np
def _labels_to_neighborhoods(labels):
"""Convert a list of labels to neighborhoods dictionary
Arguments
---------
labels: list of neighborhood labels
Returns
-------
neighborhoods: dictionary
... |
import dash
from dash.dependencies import Input, Output
from dash import dash_table
from dash import dcc
from dash import html
import pandas as pd
# Import data into pandas
df = pd.read_csv("data.csv")
df["Condition"] = df["Condition Category"]
df = df.drop(["Condition Category", "Missed Prices", "Index", "SKU"], axis... |
# -*- coding: utf-8 -*-
"""
An implementation of the policyValueNet in Tensorflow
Tested in Tensorflow 1.4 and 1.5
@author: Xiang Zhong
"""
import numpy as np
import tensorflow as tf
class PolicyValueNet():
def __init__(self, model_file=None):
self.model_file = model_file
self.loss_weight = [1.0... |
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# uobjnew Summarize object allocations in high-level languages.
# For Linux, uses BCC, eBPF.
#
# USAGE: uobjnew [-h] [-T TOP] [-v] {c,java,ruby,tcl} pid [interval]
#
# Copyright 2016 Sasha Goldshtein
# Licensed under the Apache License, Version ... |
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('books/', views.BookListView.as_view(), name='books'),
] |
import numpy as np
from multiagent.core import World, Agent, Landmark
from multiagent import BaseScenario
class Scenario(BaseScenario):
def make_world(self):
world = World()
# set any world properties first
world.dim_c = 2
num_agents = 2
num_adversaries = 1
num_landm... |
class Solution:
# @param {integer[]} nums
# @return {integer[][]}
def subsetsWithDup(self, nums):
res = [[]]
nums.sort()
for num in nums:
temp = []
for ans in res:
l = ans + [num]
if l not in res:
temp.ap... |
__version__ = '0.8.0'
def get_version():
return __version__ |
"""
Tools for sending, receiving and handling OSC messages.
"""
from .captures import Capture, CaptureEntry
from .messages import OscBundle, OscMessage
from .protocols import (
AsyncOscProtocol,
HealthCheck,
OscCallback,
OscProtocol,
ThreadedOscProtocol,
)
from .utils import find_free_port
__all__... |
"""
This file offers the methods to automatically retrieve the graph tech-routers-rf.
The graph is automatically retrieved from the NetworkRepository repository.
References
---------------------
Please cite the following if you use the data:
```bib
@inproceedings{nr,
title = {The Network Data Repository with I... |
#encoding:utf-8
"""
下面的文件将会从csv文件中读取读取短信与电话记录,
你将在以后的课程中了解更多有关读取文件的知识。
"""
import csv
with open('texts.csv', 'r') as f:
reader = csv.reader(f)
texts = list(reader)
with open('calls.csv', 'r') as f:
reader = csv.reader(f)
calls = list(reader)
"""
任务3:
(080)是班加罗尔的固定电话区号。
固定电话号码包含括号,
所以班加罗尔地区的电话号码的格式为(0... |
"""
word deletion Transformation
============================================
"""
from .transformation import Transformation
class WordDeletion(Transformation):
"""An abstract class that takes a sentence and transforms it by deleting a
single word.
letters_to_insert (string): letters allowed for insert... |
import os
import nose
import shutil
import yaml
import unittest
from rockAtlas import database, cl_utils
from rockAtlas.utKit import utKit
from fundamentals import tools
su = tools(
arguments={"settingsFile": None},
docString=__doc__,
logLevel="DEBUG",
options_first=False,
projectName="rockAtlas"
... |
from mat.utils.utils import Issue
class Issue(Issue):
TITLE = 'Secret Codes Search Check'
DESCRIPTION = 'Looks for secret codes in the application'
ID = 'secret-codes'
ISSUE_TITLE = 'Application Has Secret Codes'
FINDINGS = 'The Team found the following secret codes associated w... |
from __future__ import absolute_import
import copy
import os
import logging
from typing import (Any, Callable, Dict, List, MutableMapping, MutableSequence,
Optional, Set, Tuple, Union)
from typing_extensions import Text, Type, TYPE_CHECKING # pylint: disable=unused-import
# move to a regular typi... |
# -*- coding: utf-8 -*-
import json
import os
import requests
import time
import unittest
from botocore.exceptions import ClientError
from localstack import config
from localstack.utils import testutil
from localstack.config import external_service_url
from localstack.constants import TEST_AWS_ACCOUNT_ID
from localsta... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""Overview:
Downscale images & cells for altas mapping
Usage:
MergeBrain.py images PARAM_FILE [-p NUM_CPUS] [--exec <path>]
MergeBrain.py cells PARAM_FILE
MergeBrain.py full PARAM_FILE [-p NUM_CPUS] [--exec <path>]
Options:
-h --help Show this screen.
-... |
import numpy as np
from xnmt.settings import settings
import xnmt
from xnmt import batchers, expression_seqs
from xnmt.models import base as models
from xnmt.persistence import serializable_init, Serializable
if xnmt.backend_dynet:
import dynet as dy
##### A class for retrieval databases
# This file contains datab... |
def problema2():
#Definir variable y otros
print("ingrese sus datos:")
bonoObtenidoJMCT=0.0
#Datos de Entrada
salarioMinimoJMCT=float(input("Ingrese el salario:"))
puntuacionObtenidaJMCT=float(input("Ingrese la puntuación:"))
#Proceso
if puntuacionObtenidaJMCT<=100 and puntuacionObtenidaJMCT>=50:
bo... |
import io
import nbformat as nbf
import os
from typer import run
from shutil import copyfile
class JupyterOps:
def extract_code(self, ipynb_name):
ipynb_path = os.path.join(os.getcwd(), ipynb_name)
save_file_path = 'extras'
if os.path.exists(save_file_path):
os.remove(save_file_path)
with io... |
import main.iaas.iaas as iaas
iaas.db.create_all()
d=[]
d.append(iaas.DatabaseEngine('mysql+pymysql','MySQL'))
d.append(iaas.DatabaseEngine('postgresql','PostgreSQL'))
d.append(iaas.Group('all_users','All Users'))
d.append(iaas.Group('superusers','Superuser'))
d.append(iaas.Group('it_user','IT'))
d.append(iaas.Gr... |
import tensorflow as tf
tf.reset_default_graph()
from keras.applications.vgg19 import VGG19
import os
from tensorflow.python.keras.preprocessing import image as kp_image
from keras.models import Model
from keras.layers import Dense, BatchNormalization,Dropout,concatenate
from keras import backend as K
from keras.... |
from PyQt5.QtWidgets import qApp, QMainWindow
from save import SaveMenuAction, SaveMenuActionHandler
from status_widget import StatusWidget
class Ui(object):
def __init__(self, plugin):
plugin.logger.debug('Initating the plugin UI')
# we need to find the ida main window in order to add
#... |
from hypno import inject_py
import sys
import shutil
from pathlib import Path
class Injector:
def __init__(self,pid,code_path):
self.pid=pid
self.code=code_path
def __pre_run(self):
pass
def __check_env(self):
pass
def do_inject(self):
inject_code="""import sys;sy... |
import os
from unipath import Path
from decouple import config
import dj_database_url
PROJECT_DIR = Path(__file__).parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
SECRET_KEY = config('SECRET_KEY')
# SECURITY WARNING: don'... |
import os
from conans import ConanFile, CMake, tools
required_conan_version = ">=1.36.0"
class HeatshrinkConan(ConanFile):
name = "heatshrink"
license = "ISC"
url = "https://github.com/conan-io/conan-center-index"
description = "data compression library for embedded/real-time systems"
topics = ("... |
import asyncio
import aiofiles
import configargparse
import datetime
async def fetch_chat_messages(chat_url, receive_port, history_filename):
while True:
try:
reader, _ = await asyncio.open_connection(chat_url, receive_port,)
encoded_message = await reader.readline()
no... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the -alertnotify option."""
import os
import time
from test_framework.test_framework import Huntc... |
import speech_recognition as sr
import pyaudio
r=sr.Recognizer()
#Microphone(device_index=i, sample_rate=48000)
with sr.Microphone( sample_rate=48000) as source:
print("Say Something!")
audio=r.listen(source)
print("Time over")
try:
print("text: "+r.recognize_google(audio))
except:
print("Erro... |
"""
This module contains the lexer.
The Lexer is the second stage of the lexical analysis. It uses its first stage,
the Scanner, to get its characters one by one. The scanner keeps track of line
and column numbering. The Lexer produces Tokens from the characters returned by
the Scanner.
"""
from __future__ import anno... |
import datetime
from django.utils import timezone
from django.test import TestCase
from .models import Question
from django.urls import reverse
class QuestionModelTests(TestCase):
def test_was_published_recently_with_future_question(self):
"""
was_published_recently() returns False for questions ... |
"""Per-prefix data, mapping each prefix to a dict of locale:name.
Auto-generated file, do not edit by hand.
"""
from phonenumbers.util import u
# Copyright (C) 2011-2020 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with... |
import pickle
import warnings
import itertools
import numpy as np
import matplotlib.pyplot as plt
warnings.filterwarnings("ignore")
plt.style.use('fivethirtyeight')
import pandas as pd
import statsmodels.api as sm
import matplotlib
import mysql.connector
import os
import sys
matplotlib.rcParams['axes.labelsize'] = 14
... |
"""
BASIL GUI for Oxford ASL - Calibration options
Copyright (C) 2020 University of Oxford
"""
from .widgets import TabPage
class DistCorrTab(TabPage):
"""
Tab page containing distortion correction options
"""
# Distortion correction choices
FIELDMAP, CALIB_IMAGE = 0, 1
DISTCORR_CHOICES = ["... |
from BeautifulSoup import BeautifulStoneSoup
from django.core.management.base import NoArgsCommand
#from rtc.mobile.models import CommitteeMeeting
import datetime, time
import memcache
import urllib2
class Command(NoArgsCommand):
def handle_noargs(self, **options):
def flush_cache():
... |
''' A simple profiler for logging '''
import logging
import time
class Profiler(object):
def __init__(self, name, logger=None, level=logging.INFO):
self.name = name
self.logger = logger
self.level = level
def step(self, name):
""" Returns the duration and stepname since last s... |
# Data pipeline
from configs.lane_detection.common.datasets.culane_seg import dataset
from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.se... |
import xlwt
with open('city.txt', 'r', encoding='utf-8') as f:
data = f.read()
_city = eval(data)
city = list()
for i in range(1, 4):
info = _city[str(i)]
city.append(i)
city.append(info)
row = len(city)//len(_city)
def horz_left(x, y, data):
algnt = xlwt.Alignment()
... |
# 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, software
# distributed under the Li... |
#!/usr/bin/env python
#
# Copyright 2019 DFKI GmbH.
#
# 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, merg... |
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CosiCommit(p.MessageType):
MESSAGE_WIRE_TYPE = 71
def _... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-06-27 13:27
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('OverApp', '0007_auto_20160619_0651'),
]
operations = [
migrations.AddField(
... |
from unittest import TestCase
from maki.color import Color
class ColorTest(TestCase):
def test_is_light(self):
self.assertTrue(Color.from_hex("#ffffff").is_light)
self.assertTrue(Color.from_hex("#fff").is_light)
self.assertFalse(Color.from_hex("#000").is_light)
def test_invalid_hex(s... |
# -*- coding: utf-8 -*-
#
# Error tracker flasks plugins default value
#
# :copyright: 2019 Sonu Kumar
# :license: BSD-3-Clause
#
# Whether notification should be send or not
APP_ERROR_SEND_NOTIFICATION = False
# List of email recipients, these users would be send an email
APP_ERROR_RECIPIENT_EMAIL = None
# E... |
import numpy as np
import matplotlib.pyplot as plt
import os
# List separate experiments in separate folder
# data_folders_for_separate_experiments = ['tenth_set']
data_folders_for_separate_experiments = ['seventh_set', 'eighth_set', 'ninth_set', 'tenth_set']
# For all experiments, extract the cell names
CellNames = ... |
def check(cmd, mf):
m = mf.findNode('zmq')
if m is None or m.filename is None:
return None
# PyZMQ is a package that contains
# a shared library. This recipe
# is mostly a workaround for a bug
# in py2app: it copies the dylib into
# the site-packages zipfile and builds
# a non-f... |
from django.shortcuts import render, get_object_or_404
from .models import Person
# Create your views here.
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world. You're at Computation History project.")
def person(request, person_id):
person_obj = get_object_or_404(P... |
# Definition for singly-linked list.
from lib_singly_nodelist import ListNode, create_node_list
class Solution:
def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode:
new_head = ListNode()
ptr = new_head
carry = 0
while l1 and l2:
s = l1.val + l2.val + carry
... |
# Copyright (c) 2015 Presslabs 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 law or agreed to in writ... |
from __future__ import absolute_import, print_function, division
import sys
import time
import os
from logger import write
from image_names import image2template_directory, find_matching_images, \
template_directory_number2image
from run_job import run_job
from dxtbx.serialize import xds
from dxtbx.datablock imp... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Lucas Miguel S Ponce"
__email__ = "lucasmsp@gmail.com"
from .geo_lib.geo_within import geo_within_stage_1, geo_within_stage_2
from .geo_lib.read_shapefile import read_shapefile_stage_1, \
read_shapefile_stage_2, read_shapefile_all
from .geo_lib.geo_oper... |
#!/usr/bin/env python
#
# Use the raw transactions API to spend EZPAYs received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a eazypayzad or eaz... |
# Copyright (c) ZenML GmbH 2022. 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:
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
# zeropi.py
#
# This file is part of scqubits.
#
# Copyright (c) 2019, Jens Koch and Peter Groszkowski
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
##################################################... |
"""
===================
Isotonic Regression
===================
An illustration of the isotonic regression on generated data (non-linear
monotonic trend with homoscedastic uniform noise).
The isotonic regression algorithm finds a non-decreasing approximation of a
function while minimizing the mean squared error on th... |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.