content stringlengths 0 894k | type stringclasses 2
values |
|---|---|
n, l = map(int, input().split())
list = [str(input()) for i in range(n)]
list.sort()
s = ''.join(list)
print(s)
| python |
"""pymodpde.py: a symbolic module that generates the modified equation for time-dependent partial differential equation
based on the used finite difference scheme."""
__author__ = "Mokbel Karam , James C. Sutherland, and Tony Saad"
__copyright__ = "Copyright (c) 2019, Mokbel Karam"
__credits__ = ["University of Utah ... | python |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-06-28 14:57
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('goods2', '0026_auto_20180625_1833'),
]
operations = [
migrations.AddField(
... | python |
# Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | python |
#!/usr/bin/env python
"""
This is a silly mapper to demonstrate some errors.
"""
import sys
import numpy as np # To use numpy add -cmdenv PATH={PATH} to your Hadoop Job
for line in sys.stdin:
msg = ("a message") # missing a parenthesis here
print 1/1 # dividing by zero is a no-go | python |
import unittest
from bubble_sort import bubble_sort
class TestBubbleSort(unittest.TestCase):
def test_short_sort(self):
"""
Tests that a short list of integers has been sorted
successfully
"""
list = [4, 6, 9, 3, 5, 2, 6]
final = [2, 3, 4, 5, 6, 6, 9]
self.a... | python |
# MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# 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,... | python |
import threading
import time
class BankAccount():
def __init__(self):
self.amount = 0
def withdraw(self):
if self.amount >= 100:
print('Withdrawing 100')
self.amount -= 100
def credit(self):
if self.amount < 0:
print('Negative amount !!!!!')... | python |
# coding=utf-8
# This file is automatically generated based on the English CLDR file.
# Do not edit manually.
from django.utils.translation import ugettext_lazy as _
METAZONE_MAPPING_FROM_TZ = {
"Africa/Abidjan": "GMT",
"Africa/Accra": "GMT",
"Africa/Addis_Ababa": "Africa_Eastern",
"Africa/Algiers": "... | python |
import pandas as pd
import numpy as np
calendar = pd.read_csv('calendar.csv', index_col='date', parse_dates=True)
train_validation = pd.read_csv('sales_train_validation.csv')
train_evaluation = pd.read_csv('sales_train_evaluation.csv')
test_validation = pd.read_csv('sales_test_validation.csv')
test_evaluation = pd.rea... | python |
BASE_URL = 'https://api.pagar.me/1/balance'
| python |
import babeltrace
import statistics
def format_event(event):
op = event.get('op', '-')
return "{0}: {1}: tid={2}, op={3}".format(event.cycles, event.name.ljust(30), event['pthread_id'], op)
# Count the number of occurrences of each key
class Count:
def __init__(self, event_filter, key_func):
self.... | python |
"""
Copyright BOOSTRY Co., Ltd.
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 distr... | python |
from django.contrib import admin
from .models import UserState, ActivityState, ActivitySessionState
admin.site.register(UserState, list_display=["user", "data"])
admin.site.register(ActivityState, list_display=["activity_key", "activity_class_path", "user", "data"])
admin.site.register(ActivitySessionState, list_di... | python |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os, datetime, jwt, uuid
from flask import Flask, jsonify, request
from flask_cors import CORS
from werkzeug.security import generate_password_hash, check_password_hash
from functools import wraps
from model import db, ma
from model import User, Tournee, PDI, UserSc... | python |
import sys
from termcolor import cprint
from pyfiglet import figlet_format
cprint(figlet_format('missile!', font='starwars'),
'yellow', 'on_red', attrs=['bold'])
| python |
"""
Tests for pdfmerger.
"""
import unittest
import src.pdfmerger.pdfmerger as pdfmerger
class StripTitleTest(unittest.TestCase):
""" Basic test cases """
def test_basic(self):
""" check that the function works for a basic case """
result = pdfmerger.strip_title("Interesting title (123) ... | python |
# Copyright 2020 Samsung Electronics Co., Ltd.
#
# 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... | python |
from rest_framework import permissions
class IsOwnerOrReadOnly(permissions.BasePermission):
"""
Custom permission to only allow owners of an object to edit it.
"""
# This is currently overriden in the settings.py with a default
def has_object_permission(self, request, view, obj):
"""
... | python |
n, k, q = map(
int,
input().strip().split(' ')
)
array = [
int(a_temp)
for a_temp
in input().strip().split(' ')
]
def rotate_right_n(arr, k):
array_length = len(arr)
result = [None] * array_length
for i, item in enumerate(arr):
new_position = (i + k) % array_length
re... | python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import copy
from django.test import TestCase
from django.http import request
from django.template import Context
from django.conf import settings
from django.core import mail
from django.utils.translation import gettext_lazy as _
from mail_helper import utils
class Te... | python |
import tensorflow as tf
import sys
def test1():
with tf.name_scope('123'):
with tf.name_scope('456'):
with tf.variable_scope('789'):
a = tf.Variable(1,name='a')
print a.name
b = tf.get_variable('b',1)
print b.name
def test2():
with tf.name_scope('1... | python |
from marshmallow import Schema
from marshmallow_sqlalchemy import SQLAlchemyAutoSchema
from ICECREAM.http import HTTPError
def validate_data(serializer: Schema, data: {}):
validation_errors = serializer.validate(data)
if validation_errors:
raise HTTPError(403, validation_errors)
return True
| python |
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
'''
Universe manager
----------------
It knows everything about market and smartly handle user input
:copyright (c) 2014 Xavier Bruhiere
:license: Apache 2.0, see LICENSE for more details.
'''
import os
import random
import pytz
import dateutil.parser
import yaml
... | python |
"""
The top-panel in the frame of the gym-idsgame environment
"""
from gym_idsgame.envs.rendering.util.render_util import batch_label
from gym_idsgame.envs.constants import constants
from gym_idsgame.envs.dao.idsgame_config import IdsGameConfig
from gym_idsgame.envs.dao.game_state import GameState
class GamePanel:
... | python |
from itertools import product
import torch
from torch._C import Size
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
from . import unsqueeze_as
from .decorators import NoGrad
@torch.jit.script
def gray2JET(x, thresh=0.5):
# type: (Tensor, float) -> Tensor
"""
- x: [..., H,... | python |
#!/usr/bin/python
## Binary Analysis Tool
## Copyright 2010-2013 Armijn Hemel for Tjaldur Software Governance Solutions
## Licensed under Apache 2.0, see LICENSE file for details
import sys, os, string, re
from optparse import OptionParser
import sqlite3
from bat import extractor
## TODO: replace by generic code fro... | python |
from autograd.blocks.block import SimpleBlock
import numpy as np
class sin(SimpleBlock):
"""
vectorized sinus function on vectors
"""
def data_fn(self, args):
new_data = np.sin(args.data)
return(new_data)
def gradient_fn(self, args):
grad = np.cos(args.data)
retur... | python |
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("Promotions"),
"items": [
{
"type": "doctype",
"name": "Advertisement"
},
{
"type": "doctype",
"name": "Affiliates"
},
{
"type": "doctype",
"name"... | python |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
"""
Encoder that fuses the textual and image features to create the condition
input to the RNN
"""
import torch.nn as nn
class ConditionEncoder(nn.Module):
def __init__(self, cfg):
super(ConditionEncoder, self)._... | python |
"""Webcam Spatio-Temporal Action Detection Demo.
Some codes are based on https://github.com/facebookresearch/SlowFast
"""
import argparse
import atexit
import copy
import logging
import queue
import threading
import time
from abc import ABCMeta, abstractmethod
import cv2
import mmcv
import numpy as np
import torch
f... | python |
from pyscf import grad
def gen_grad_scanner(method):
from pyscf import scf, cc
if isinstance(method, scf.hf.SCF) and hasattr(method, 'nuc_grad_method'):
return method.nuc_grad_method().as_scanner()
elif isinstance(method, cc.ccsd.CCSD):
return grad.ccsd.as_scanner(method)
else:
... | python |
"""
Write a Python program to add two objects if both objects are an integer type.
"""
class Addition:
def __init__(self,x,y):
self.x = x
self.y = y
def __add__(self,other):
return Addition(self.x+other.x, self.y+other.y)
first = Addition(5,7)
second = Addition(3,6)
result = first + sec... | python |
# Exercise 5.31
# Author: Noah Waterfield Price
import numpy as np
import matplotlib.pyplot as plt
import operator
from scitools.std import movie
def animate_series(fk, N, tmax, n, exact, exactname):
t = np.linspace(0, tmax, n)
s = np.zeros(len(t))
counter = 1
for k in range(0, N + 1):
s = S(... | python |
__author__ = 'Fabian Isensee'
import numpy as np
import lasagne
import os
import sys
import fnmatch
import matplotlib.pyplot as plt
sys.path.append("../../modelzoo/")
from Unet import *
import theano.tensor as T
import theano
import cPickle
from time import sleep
from generators import batch_generator, threaded_generat... | python |
#! /usr/bin/python
# -*- coding: utf-8 -*-
import time
import tensorflow as tf
import tensorlayer as tl
from keras import backend as K
from keras.layers import *
from tensorlayer.layers import *
X_train, y_train, X_val, y_val, X_test, y_test = \
tl.files.load_mnist_dataset(shape=(-1, 784))
sess = tf.... | python |
# -*- coding: utf-8 -*-
from odoo import api, fields, models, _
from odoo.exceptions import AccessError, ValidationError
import odoo.addons.decimal_precision as dp
class product_product(models.Model):
_name = 'product.template'
_inherit = 'product.template'
_description= 'Productos'
c_cl... | python |
import json
import pytest
from flask import url_for
def test_add_test_route(client):
h = {"Content-Type": "application/json"}
d = {"test_type": "aaa"}
res = client.post(url_for("test.test"), data=json.dumps(d), headers=h)
assert res.status_code == 201
h = {"Content-Type": "application/json"}
... | python |
from conans import ConanFile, CMake, tools
class ClsjConan(ConanFile):
name = "clsj"
version = "0.1"
license = "MIT"
url = "https://github.com/malwoden/clsj-conan"
description = "clsj is a toy package for testing c++, swig, java and conan togther"
settings = "os", "compiler", "build_type", "ar... | python |
"""
Copyright (c) 2019 Cisco and/or its affiliates.
This software is licensed to you under the terms of the Cisco Sample
Code License, Version 1.1 (the "License"). You may obtain a copy of the
License at
https://developer.cisco.com/docs/licenses
All use of the material herein must be in accordance with t... | python |
from .__imports import *
from sqlalchemy.orm import Session
from models.user_model import User
class UserInfoController(Controller):
__view__ = "user_info"
__title__ = "%USER%"
def __init__(self, session: Session, user_id: int):
super(UserInfoController, self).__init__()
self.css("user_i... | python |
#!/usr/bin/env python
"""
Unit tests for SLIG algorithm Class
-
"""
from dataclasses import asdict, astuple
from functools import reduce
from typing import List, Tuple
from unittest import TestCase
from numpy import mean
from pprint import pprint
from slig.datastructs import Interval, Region, RegionSet
from slig ... | python |
# -*- coding: utf-8 -*-
'''
modified from
https://www.github.com/kyubyong/dc_tts
'''
from __future__ import print_function, division
from hyperparams import Hyperparams as hp
import numpy as np
import tensorflow as tf
import librosa
import copy
import matplotlib
matplotlib.use('pdf')
import matplotlib.pyplot as plt
fr... | python |
import collections
N, Q = map(int, input().split())
# ab=[list(map(int,input().split())) for _ in range(N-1)]
graph = [[] for _ in range(N + 1)]
for i in range(N - 1):
a, b = map(int, input().split())
graph[a].append(b)
graph[b].append(a)
dist = [-1] * (N + 1)
dist[0] = 0
dist[1] = 0
d = collections.de... | python |
from bioblend.galaxy.tools.inputs import (
conditional,
dataset,
inputs,
repeat,
)
def test_conditional():
# Build up example inputs for random_lines1
as_dict = inputs().set(
"num_lines", 5
).set(
"input", dataset("encoded1")
).set(
"seed_source", conditional().... | python |
# -*- coding: utf-8
# hi
from configparser import ConfigParser
from selenium.webdriver.chrome.options import Options
from argparse import ArgumentParser
from func import *
from time import strftime, localtime
import warnings
import sys
warnings.filterwarnings('ignore')
def sys_path(browser):
path = f'./{browser}... | python |
# USAGE
# python object_detector.py --prototxt MobileNetSSD_deploy.prototxt --model MobileNetSSD_deploy.caffemodel
# --montageW 2
# --montageH 2
# import the necessary packages
from imutils import build_montages
from datetime import datetime
import cv2 as cv
import time
import imutils
from imutils.video import VideoSt... | python |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-01-03 18:14
from __future__ import unicode_literals
from django.db import migrations
def toggle_existing_declarations(apps, schema_editor):
Declaration = apps.get_model('core.Declaration')
Declaration.objects.update(to_link=True)
class Migration... | python |
import abc
import asyncpg
class AbstractDatabase:
@abc.abstractmethod
async def get_connection(self):
"""A coroutine that returns a connection to database."""
@abc.abstractmethod
async def call_connection_coroutine(
self, coroutine_name, sql_query, *args, connection=None,
... | python |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@authors: Mihnea S. Teodorescu & Moe Assaf, University of Groningen
"""
#### Libraries
# Third-party libraries
import numpy as np
#### Class declaration
class Network(object):
def __init__(self, sizes):
# sizes = number of neurons per layer [input, hidden... | python |
#!/usr/bin/env python3
# coding=utf8
import os
import time
import colorsys
import threading
import _thread
from sys import exit, argv
try:
from PIL import Image, ImageDraw, ImageFont
except ImportError:
exit('Lemon requires the pillow module\nInstall with: sudo pip3 install pillow')
try:
import unicornha... | python |
# Copyright (c) 2020 Cisco Systems, Inc. All rights reserved.
"""
pydme.options
~~~~~~~~~~~~~~~~~~~
This module contains helpers to construct REST API options for PyDME.
"""
class ApiOptions(dict):
"""Dict like data structure capturing REST API options."""
def __and__(self, other):
return ApiOption... | python |
class Solution:
def canWin(self, s: str) -> bool:
for i in range(len(s)-1):
if s[i:i+2] == '++':
temp = s[:i]+'--'+s[i+2:]
if not self.canWin(temp):
return True
return False
| python |
"""
Accounts
--------
Models
~~~~~~
.. automodule:: accounts.models
:members:
Views
~~~~~
.. automodule:: accounts.views
:members:
:show-inheritance:
Forms
~~~~~
.. automodule:: accounts.forms
:members:
Admin
~~~~~
.. automodule:: accounts.admin
:members:
"""
| python |
import pytest
from eth_utils import (
to_bytes,
)
from web3._utils.empty import (
empty,
)
from web3.exceptions import (
ValidationError,
)
def test_transacting_with_contract_no_arguments(w3, math_contract, transact, call):
initial_value = call(contract=math_contract,
contra... | python |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
pi_cam_interface.py
This script is intended to provide a
simple interface to a raspberry pi camera
"""
################################
#LOAD LIBRARIES
################################
import os
from picamera import PiCamera
################################
#USER INP... | python |
import os
import sys
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), "weber", "__version__.py")) as version_file:
exec(version_file.read()) # pylint: disable=W0122
_INSTALL_REQUIRES = [
'click>=4.0',
'emport',
'Flask',
'Logbook',
'Jinja2',
'py'... | python |
class Importer(object):
def fetch(self):
raise NotImplementedError() # pragma: no cover
| python |
from django.conf import settings
from django.contrib.auth.models import User
from avatar import AVATAR_DEFAULT_URL
def get_default_avatar_url():
base_url = getattr(settings, 'STATIC_URL', None)
if not base_url:
base_url = getattr(settings, 'MEDIA_URL', '')
# We'll be nice and make sure there are ... | python |
__all__ = ['collections', 'core', 'solving', 'threading', 'web']
| python |
r'''
FX is a toolkit for developers to use to transform ``nn.Module``
instances. FX consists of three main components: a **symbolic tracer,**
an **intermediate representation**, and **Python code generation**. A
demonstration of these components in action:
::
import torch
# Simple module for demonstr... | python |
# -*- coding: utf-8 -*-
from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(
name='python_sudeste',
version='0.1.8',
url='https://github.com/samukasmk/python-sudeste-module',
license='Apache2',
author='Samuel Sampaio',
author_email='samuka... | 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"); you may not u... | python |
from __future__ import print_function
from neatsociety.ctrnn import CTNeuron, Neuron, Network
# TODO: These tests are just smoke tests to make sure nothing has become badly broken. Expand
# to include more detailed tests of actual functionality.
def test_basic():
# create two output neurons (they won't receive ... | python |
import artm
import numpy as np
import pandas as pd
import functools
import operator
from collections import OrderedDict
def weigh_average(gamma, x, axis):
'''
Calculates average of x with weights gamma.
'''
if isinstance(axis, int):
nom = np.sum(gamma * x, axis=axis)
denom = np.sum(ga... | python |
#!/usr/bin/env python3
# Copyright (c) 2021 Peter Kwan
#
# 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, ... | python |
# -*- coding: utf-8 -*-
import scrapy
from tangspiderframe.items import TangspiderframeItem
class TextVietnamVidictContentSpider(scrapy.Spider):
name = 'text_vietnam_vdict_content'
allowed_domains = ['www.vdict.co']
start_urls = ['http://www.vdict.co/index.php?word=hello&dict=en_vi']
def parse(self, ... | python |
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#
# 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 us... | python |
from copy import copy
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
import brewer2mpl as b2mpl
from tqdm import tqdm
import seaborn.apionly as sns
from .FS_colorLUT import get_lut
from seaborn.utils import set_hls_values
def electrode_grid(gridx=16, gridy=16, elects_to_plot=None, anatomy... | python |
from ievv_auth.project.develop.common_settings import *
# Disable migrations when running tests
class DisableMigrations(object):
def __contains__(self, item):
return True
def __getitem__(self, item):
import django
if django.VERSION[0:3] > (1, 11, 0):
return None
re... | python |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from django.urls import reverse
from kolibri.core.auth.constants.user_kinds import ANONYMOUS
from kolibri.core.auth.constants.user_kinds import LEARNER
from kolibri.core.content.hooks import ContentNod... | python |
from celery import Task
from .domain_utils import get_domain
class DomainTask(Task):
abstract = True
def apply_async(self, args=None, kwargs=None, **rest):
self._include_request_context(kwargs)
return super(DomainTask, self).apply_async(args, kwargs, **rest)
def apply(self, args=None, kwa... | python |
import requests
import lxml
from bs4 import BeautifulSoup
import threading
import urljoin
import hashlib
import sys
from lxml import etree
import urllib3
import re
from bs4 import BeautifulSoup
from distutils.filelist import findall
requests.packages.urllib3.disable_warnings()
#//*[@id="wrap_all"]/div[2]/div... | python |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys,os
sys.path.append(os.getcwd() + '/../')
from lnasr.hmm import HMM
import numpy as np
n = 2 # 状态集:H, C
m = 3 # 观测集:1, 2, 3
A = np.array([
[0.6, 0.4],
[0.5, 0.5]], dtype=np.float)
B = np.array([
[0.2, 0.4, 0.4],
[0.5, 0.4, 0.1]], dtype=np.f... | python |
import numpy as np # importing numpy module
# taking endpoints from the user as point_1, point_2 & point_3
point_1 = list(map(float,input().split()))
point_2 = list(map(float,input().split()))
point_3 = list(map(float,input().split()))
arr = np.array([point_1,point_2,point_3])
volume = abs(np.lina... | python |
# Generated by Django 2.0.1 on 2018-04-19 17:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('experiences', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='ormexperience',
name='saves_count',... | python |
def test_to_internal_camera_state_to_camera_state_modified():
from zivid import CameraState
from zivid._camera_state_converter import to_camera_state, to_internal_camera_state
modified_camera_state = CameraState(connected=True)
converted_camera_state = to_camera_state(
to_internal_camera_state... | python |
# -*- coding: utf-8 -*-
"""loss.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/13lQiLDH3_PD0nJgzZCNKsj3bbXYRJ65u
"""
import matplotlib
import numpy as np
import pandas as pd
import torch
import torchvision
import torch.nn as nn
import torch.nn.... | python |
from sqlalchemy import Column, Integer, BigInteger, Float, String, ForeignKey, Table
from sqlalchemy.orm import relationship, backref
from vwsfriend.model.base import Base
from vwsfriend.model.datetime_decorator import DatetimeDecorator
trip_tag_association_table = Table('trip_tag', Base.metadata,
... | python |
from __future__ import print_function
from __future__ import absolute_import
from sandbox.rocky.tf.core.parameterized import Parameterized
import sandbox.rocky.tf.core.layers as L
import itertools
class LayersPowered(Parameterized):
def __init__(self, output_layers, input_layers=None):
self._output_layer... | python |
#!/pxrpythonsubst
#
# Copyright 2020 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... | python |
#optunaが最適化する関数
def objective(trial):
global layer_depth
global first_hidden_dim
global second_hidden_dim
global third_hidden_dim
global latent_dim
global beta
global kappa
global batch_size
global learning_rate
#leaky_reluの時に使用する
global leaky_alpha
#ドロップアウトを用いる場合
glo... | python |
#!/usr/bin/env python
from __future__ import print_function
import os
from flask.ext.script import Manager, Server
from notifications_delivery.app import create_app
from notifications_delivery.processor.sqs_processor import process_all_queues
application = create_app()
manager = Manager(application)
port = int(os.... | python |
# Generated by Django 3.0.8 on 2020-07-04 21:37
import uuid
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency... | python |
from __future__ import division
import numpy as np
import scipy
import scipy.stats
import scipy.fftpack
import scipy.optimize
import logging
import stingray.lightcurve as lightcurve
import stingray.utils as utils
from stingray.gti import bin_intervals_from_gtis, check_gtis
from stingray.utils import simon
from stingra... | python |
__________________________________________________________________________________________________
sample 60 ms submission
class Solution:
def groupThePeople(self, groupSizes: List[int]) -> List[List[int]]:
count = collections.defaultdict(list)
for i, size in enumerate(groupSizes):
count... | python |
"""Client Interface
================
This provides direct access the Pelion Device Management API.
.. warning::
It is not recommended that this is used directly, instead please use this class from an SDK instance
(:mod:`mbed_cloud.sdk.sdk`).
.. code-block:: python
from mbed_cloud import SDK
pelion_d... | python |
"""Configuration of pytest."""
from urllib.parse import urljoin
import pytest
# pylint: disable=redefined-outer-name
@pytest.fixture
def rule_match_all(server_rule_factory, server_rule_prototype):
"""Registered rule that matches every request."""
rule = server_rule_prototype.create_new(rule_type="MATCHALL",... | python |
# -*- coding: utf-8 -*-
DESC = "ckafka-2019-08-19"
INFO = {
"DescribeRoute": {
"params": [
{
"name": "InstanceId",
"desc": "Unique instance ID"
}
],
"desc": "This API is used to view route information."
},
"DescribeGroupInfo": {
"params": [
{
"name": "Inst... | python |
import unittest
import os
import sys
class ContextMock(object):
project = {"type": "Project", "id": 375, "name": "dev1"}
class BaseClass(unittest.TestCase):
@classmethod
def setUpClass(cls):
if os.getenv("TK_FRAMEWORK_CONSULADOUTILS") not in sys.path:
sys.path.insert(0, os.getenv("TK... | python |
#!python
# Test that substitution does NOT happen in strings. In current
# preprocess.py it *does* (hence this test is currently expected to
# fail). However, the long term goal is to understand languages' string
# tokens and skip them for substitution.
if __name__ == '__main__':
foo = 1
# The V-A-R should _n... | python |
from pylab import *
import matplotlib.dates as mdates
import os, sys, datetime, string
import numpy as np
from netCDF4 import Dataset
import time
import numpy.ma as ma
import calclight
from subprocess import call
import mpl_util
import pandas as pd
import calculateLightUnderIce
import prettyplotlib as ppl
import brewe... | python |
from dynamic_graph.sot.torque_control.main import *
from dynamic_graph.sot.torque_control.utils.sot_utils import smoothly_set_signal, stop_sot
from dynamic_graph import plug
import numpy as np
robot.timeStep = 0.0015
robot = main_v3(robot, startSoT=1, go_half_sitting=1)
robot.torque_ctrl.KpTorque.value = 30 * (0.0, )
... | python |
#!/usr/bin/env python
# -*- coding: utf-8 -*
"""UdPyBlog Tests"""
from webtest import TestApp
import unittest
from main import app
from google.appengine.ext import testbed
from google.appengine.api import memcache, apiproxy_stub_map, datastore_file_stub
from google.appengine.api.app_identity import app_identity_stub
... | python |
# BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed i... | python |
from django.db import models
PASSWORD_LENGTH = 200
NAME_LENGTH = 150
POSITION_LENGTH = 300
TYPE_LENGTH = 200
# Create your models here.
class users(models.Model):
Authority_Choices = (('LEVEL0', 'Admin'), ('LEVEL1', 'ChiefManager'), ('LEVEL2', 'Manager'), ('LEVEL3', 'User'))
username = models.CharField(max_l... | python |
from django.conf import settings
EXPOSE_MODEL_TO_ADMIN = getattr(settings, 'SITEPREFS_EXPOSE_MODEL_TO_ADMIN', False)
"""Toggles internal preferences model showing up in the Admin."""
DISABLE_AUTODISCOVER = getattr(settings, 'SITEPREFS_DISABLE_AUTODISCOVER', False)
"""Disables preferences autodiscovery on Django apps... | python |
import os, time, json, shutil
from numpy import array
from TFIDF import TFIDF
from Initial import Initial
from Mymodel import Mymodel
from SaveLog import SaveLog
from ContentParser import ContentParser
from bert_serving.client import BertClient
from bert_serving.server import BertServer
from bert_serving.serve... | python |
from api import API, FolioFn
from objects import Note, Loan, FolioLoan
from analytic import NotesAnalytic, LoansAnalytic
__doc__ = """ Created-by: Peerakit Champ Somsuk
- api
- analytic
- note, loan
""" | python |
#!/usr/bin/env python
# coding: utf-8
"""
Analyze for which timeframes what data is available. This turns out to be a mojor problem in teh DWD data because days
without any readings are not listed in the produkt_*.txt files and it varis a lot what data was recorded (or is being
made available for each day. Similar is ... | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.