src stringlengths 721 1.04M |
|---|
#!/usr/bin/env python
"""A module with API handlers related to the timeline colllection."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from typing import Optional
from typing import Text
from grr_response_core.lib.rdfvalues import structs as rdf_str... |
from django.apps import AppConfig
from django.db.models import signals
class SlurmConfig(AppConfig):
name = 'waldur_slurm'
verbose_name = 'SLURM'
service_name = 'SLURM'
def ready(self):
from waldur_core.quotas.fields import QuotaField, CounterQuotaField
from waldur_core.structure impo... |
#!/usr/bin/env python
#
# Microsoft Azure Linux Agent setup.py
#
# Copyright 2013 Microsoft 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/... |
"""Functions to make 3D plots with M/EEG data
"""
from __future__ import print_function
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# ... |
from django.test.utils import override_settings
from django.test import TestCase
import os
from casexml.apps.case.mock import CaseBlock
from casexml.apps.phone.tests.utils import synclog_from_restore_payload
from couchforms.util import post_xform_to_couch
from casexml.apps.case.models import CommCareCase
from casexml.a... |
"""
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from datetime import datetime
import pytest
from byceps.services.newsletter.models import (
SubscriptionUpdate as DbSubscriptionUpdate,
)
from byceps.services.newsletter import command_service
from byceps.services... |
import functools
import mmcv
import torch.nn.functional as F
def reduce_loss(loss, reduction):
"""Reduce loss as specified.
Args:
loss (Tensor): Elementwise loss tensor.
reduction (str): Options are "none", "mean" and "sum".
Return:
Tensor: Reduced loss tensor.
"""
reduc... |
# #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://etetoolkit.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the... |
import matplotlib as mpl
mpl.use('Agg')
import numpy
from pyearth import Earth
from matplotlib import pyplot
#=========================================================================
# V-Function Example
#=========================================================================
# Create some fake data
numpy.random.se... |
# -*- coding: utf-8 -*-
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2018 The Electrum developers
#
# 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,
# includi... |
#! /usr/bin/env python3
import config
config.import_libs()
import unittest
import socket
import json
from rest import GET, POST, PUT, DELETE
class TestTypesListDetail(unittest.TestCase):
"""
Create a session for testing.
"""
def setUp(self):
req = POST(config.ui_host, config.ui_port, "/auth")
req.body(confi... |
#!/usr/bin/env python
# ******************************************************************************
# Copyright 2014-2018 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
... |
from ._gridbasedbase import HBGenericGridBasedAnalysisRecipe
from ..postprocess.annualresults import LoadAnnualsResults
from ..parameters.rfluxmtx import RfluxmtxParameters
from ..command.rfluxmtx import Rfluxmtx
from ..command.epw2wea import Epw2wea
from ..command.gendaymtx import Gendaymtx
from ..command.rmtxop impor... |
class AbstractPolicy(object):
def __init__(self):
self.name = self.__class__.__name__
self.description = None
self.reference = None
self.level = None
def listen_node_types(self):
""" Listening node type.
is_valid will be called when a linter visit the listening ... |
# Copyright 2015 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software 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 of conditions and t... |
# -*- coding: utf-8 -*-
"""
__________________________________________________________________________
Copyright (C) 2016-2021 OpenNFT.org
"""
import os
import pyqtgraph as pg
LOG_LEVEL = 'DEBUG'
ROOT_PATH = os.path.abspath(os.path.dirname(__file__))
UI_PATH = os.path.join(ROOT_PATH, 'ui')
PLUGIN_PATH = os.path.... |
# ##### 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 ... |
# -*- coding: utf-8 -*-
import os
from tornado.escape import json_encode, json_decode, url_escape
from websocket import create_connection
from notebook.utils import url_path_join
from notebook.gateway.managers import GatewayClient
def run_cells(kernel_id, cid, cells):
print(f"running {cid} on {kernel_id}")
gw... |
import re
from . import Event, get_timestamp
# input/output
output_exp = re.compile(
r'(\d{4}-\d{2}-\d{2} |)(\d{2}:\d{2}:\d{2}) \[([A-Z]+)\] (?:%s)?(.*)' % '|'.join((re.escape(x) for x in (
'[Minecraft] ',
'[Minecraft-Server] '
))))
class ServerInput(Event):
"""Send data to the server's s... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016-2018 Kevin Deldycke <kevin@deldycke.com>
# and contributors.
# All Rights Reserved.
#
# 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 F... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of Ansible
#
# Ansible 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 3 of the License, or
# (at your option) any later version.
... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 Cloud.com, Inc
# Copyright (c) 2012 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
#
# ... |
"""
Algorithms for solving Parametric Risch Differential Equations.
The methods used for solving Parametric Risch Differential Equations parallel
those for solving Risch Differential Equations. See the outline in the
docstring of rde.py for more information.
The Parametric Risch Differential Equation problem is, giv... |
# -*- coding: utf-8 -*-
# © 2009 Camptocamp
# © 2014 Daniel Dico
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from .currency_getter_interface import CurrencyGetterInterface
from openerp import _
from openerp.exceptions import except_orm
import logging
_logger = logging.getLogger(__name__)
class ... |
# Copyright 2012 OpenStack Foundation
# Copyright 2013 IBM Corp
# 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/LICE... |
#-- GAUDI jobOptions generated on Fri Jul 24 16:54:59 2015
#-- Contains event types :
#-- 11134040 - 16 files - 276695 events - 80.09 GBytes
#-- Extra information about the data processing phases:
#-- Processing Pass Step-124834
#-- StepId : 124834
#-- StepName : Reco14a for MC
#-- ApplicationName : Bru... |
__author__ = 'bromix'
import time
import urlparse
import requests
from ...youtube.youtube_exceptions import LoginException
from ...kodion import Context
from __config__ import api, youtube_tv, keys_changed
context = Context()
class LoginClient(object):
api_keys_changed = keys_changed
CONFIGS = {
'y... |
# Copyright 2016 The Eyra 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 applicable la... |
#-*- encoding: utf-8 -*-
"""
API Python Correios - Rastreamento de Encomendas
Copyright (C) 2012 Leandro T. de Souza <leandrotoledo@member.fsf.org>
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, ei... |
# coding: utf-8
from __future__ import unicode_literals
import os
import sys
import sphinx_rtd_theme
import ariadne
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath t... |
#!/usr/bin/env python2.7
#
# Copyright 2018 Google 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 la... |
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Software where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
# L... |
# -*- coding: utf8 -*-
"""
.. module:: burpui.plugins
:platform: Unix
:synopsis: Burp-UI plugins module.
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
"""
from pluginbase import PluginBase
class PluginManager(object):
"""The :class:`burpui.plugins.PluginManager` class is a plugin manager.
:param... |
# 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 t... |
from graphics import GraphicsController
from graphics import Colour
from core import GameController
from core import Input
from java.util import Random
#internal variables. Please do not use them; they can change name and function at any time.
sys_gameController = GameController()
sys_inputController = Input()
s... |
import argparse
import cvxpy
from projection_methods.oracles.nonneg import NonNeg
from projection_methods.oracles.soc import SOC
from projection_methods.oracles.zeros import Zeros
from projection_methods.problems.problem_factory import random_cone_program
from projection_methods.problems.utils import check_path, save_... |
# TODO: Test case for EM algorithm.
# TODO: Derivatives from the EM algorithm can't actually be used to compute the Hessian for the normal approx.
# Post-2.0-release:
# TODO: Think about what to do about int-valued stochastics.
# TODO: Allow constraints if fmin_l_bfgs_b is used.
__docformat__='reStructuredText'
__a... |
"""
Classes::
ReadData -- A collection of functions to collect extracted VASP/QE data
into a json file.
"""
import json
from copy import deepcopy
from ast import literal_eval
from collections import defaultdict
class ReadData(object):
"""
A collection of functions to collect extracted VASP/QE data
... |
import hmac
from django.conf import settings
from django.http import HttpResponse
from .. import metrics
def unauthed_response():
content = "<html><title>Forbidden</title><body>You are not authorized to view this page.</body></html>"
response = HttpResponse(content, content_type="text/html")
response["W... |
# 140. Word Break II QuestionEditorial Solution My Submissions
# Total Accepted: 68516
# Total Submissions: 321390
# Difficulty: Hard
# Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.
#
# Return all such possible sentences.
#
# For... |
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Utility workflows
^^^^^^^^^^^^^^^^^
.. autofunction:: init_bold_reference_wf
.. autofunction:: init_enhance_and_skullstrip_bold_wf
.. autofunction:: init_skullstrip_bold_wf
"""... |
'''
The tests in this package are to ensure the proper resultant dtypes of
set operations.
'''
import itertools as it
import numpy as np
import pytest
from pandas.core.dtypes.common import is_dtype_equal
import pandas as pd
from pandas import Int64Index, RangeIndex
from pandas.tests.indexes.conftest import indices_l... |
#!/usr/bin/env python3
import json
import sys
import time
from subprocess import PIPE, Popen
FEELIMIT = [0.0001, 1, 2, 3, 4, 5, 6, 7, 8, 10,
12, 14, 17, 20, 25, 30, 40, 50, 60, 70, 80, 100,
120, 140, 170, 200, 250, 300, 400, 500, 600, 700, 800, 1000,
1200, 1400, 1700, 2000, 2500, 30... |
import tensorflow as tf
from .ops import conv2d
from base import Model
class TDNN(Model):
"""Time-delayed Nueral Network (cf. http://arxiv.org/abs/1508.06615v4)
"""
def __init__(self, input_, embed_dim=650,
feature_maps=[50, 100, 150, 200, 200, 200, 200],
kernels=[1,2,3,4,5,6,7], c... |
import csv
import simplejson
from nupic.data.file_record_stream import FileRecordStream
from htmresearch.frameworks.classification.classification_network import (
configureNetwork, classifyNextRecord, setNetworkLearningMode)
_NUM_CATEGORIES = 2
_NUM_RECORDS = 4730
_DATA_DIR = "backup"
_DEVICE = "neurosky"
_METRIC =... |
#!/usr/bin/env python
from collections import Mapping, Sequence
try:
from collections import OrderedDict
except ImportError: #pragma: no cover
from ordereddict import OrderedDict
import six
from agate.exceptions import ColumnDoesNotExistError
from agate.utils import memoize
class ColumnMapping(Mapping):
... |
"""
# The NASA93 Data Set
Standard header:
"""
from __future__ import division,print_function
import sys
sys.dont_write_bytecode = True
from lib import *
"""
Data:
Possible Splits= ["variance", "centroid", "median"]
"""
def nasa93(weighFeature = False, split = "variance"):
vl=1;l=2;n=3;h=4;vh=5;xh=6;_=0
return ... |
# -*- coding: utf-8 -*-
# -*- Channel Novelas HD Gratis -*-
# -*- Created for Alfa-addon -*-
# -*- By the Alfa Develop Group -*-
import re
from channelselector import get_thumb
from core import httptools
from core import scrapertools
from core import servertools
from core.item import Item
from platformcode ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import date, timedelta
import sys
import pandas as pd
import codecs
from .jwislib import JWIS
sys_encoding = sys.stdout.encoding
try:
input = raw_input
except NameError:
pass
def ask_date():
print("Beginning date")
d_start_year = int(input... |
import re
import argparse
"""
This script sanitize the raw data experted from "Timing.app",
it adds the proper double quotes around the "Path" attribute,
and it removes unwanted double quotes inside the "Path" attribute,
that may yield an unwanted escape of the field.
--- TODO ---
speedup:
as for now I'm iterating twi... |
# -*- coding: utf-8 -*-
__author__="rasmadeus"
__date__ ="$14.10.2014 20:00:10$"
class EqurePoint:
def __init__(self, x, y, value):
self._x = x
self._y = y
self._value = value
def x(self):
return self._x
def y(self):
return self._y
... |
#!/usr/bin/python
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# Copyright (C) 2013 <Zane Swafford> <zane@zaneswafford.com>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtai... |
#!/usr/bin/env python3
"""
a simple scraper for http://sloganmaker.com/sloganmaker.php
"""
import sys
from urllib.parse import urlencode
import requests
from lib.scraper import bsoup as bs
BASE = 'http://sloganmaker.com/sloganmaker.php?'
def get_slogan(word, times=1):
assert 1 <= times <= 10 # be nice w... |
import sys
import tb as traceback
from browser import console, document, window, html, DOMNode
from browser.widgets.dialog import Dialog
_credits = """ Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
for supporting Python development. See www.python.org for more information."""
_cop... |
# -*- coding: utf-8 -*-
from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo
class UptoboxCom(XFSHoster):
__name__ = "UptoboxCom"
__type__ = "hoster"
__version__ = "0.24"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?(uptobox|uptostream)\.com/\w{12}'
__c... |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 3 of the License,... |
#!/usr/bin/env python3
#
# Copyright (c) 2019 Roberto Riggio
#
# 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 applicabl... |
# this is a script to retrieve and process text-only data for classification
# This process includes four main tasks
# 1) getting raw tweets
# 2) apply labels (this step can be conducted at any time)
# 2) filtering those tweets (e.g., according to CMU POS tagger)
# 3) deriving a set of features (a.k.a. wo... |
##
# Copyright 2013-2016 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... |
# constrained double pendulum
# import all we need for solving the problem
from pytrajectory import ControlSystem
import numpy as np
import sympy as sp
from sympy import cos, sin, Matrix
from numpy import pi
# to define a callable function that returns the vectorfield
# we first solve the motion equations of form Mx... |
import cherrypy
class UserAPIController(object):
exposed = True
def __init__(self, identity, assignment):
self.identity = identity
self.assignment = assignment
def index(self):
return "User api Index"
@cherrypy.tools.json_out()
@cherrypy.tools.json_in()
@cherrypy.to... |
#!/usr/bin/python
# ----------------------------------------------------------------------------
# cocos "jscompile" plugin
#
# Copyright 2013 (C) Intel
#
# License: MIT
# ----------------------------------------------------------------------------
'''
"jscompile" plugin for cocos command line tool
'''
__docformat__ =... |
import state
from twisted.python import log
class Team(object):
def __init__(self, num, network, name):
self.num = num
self.network = network
self.name = name # this will be the school for us
self.state = state.State(self.num)
def contains(self, ip):
netocts = self.netw... |
# -*- coding: utf-8 -*-
#================================================
#
# Dummy Scene for the Top-View Example (please execute topview_example.py)
#
# Copyright (C) 2010 Wil Alvarez <wil.alejandro@gmail.com>
#
#===================================================
import pygame
import random
from ngine import sce... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
from spack.operating_systems.mac_os import macos_version
import llnl.util.tty as tty
import itertools
... |
import tensorflow as tf
# define the cnn model
def init_model(input_shape, n_classes):
with tf.name_scope("InputScope") as scope:
cnn_input = tf.placeholder(
dtype=tf.float32, shape=(None,) + input_shape + (1,), name="input"
)
# base convolutional layers
y_true = tf.placeholder... |
#!/usr/bin/env python
# Copyright NumFOCUS
#
# 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.txt
#
# Unless required by applicable law or ... |
#!/usr/bin/env python3
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)) + '/..')
import yogi
import unittest
import json
from test_terminals import AsyncCall
from proto import yogi_000009cd_pb2
from proto import yogi_0000... |
"""
This module contains functions related with probability and complements the
usual numpy or scipy tools.
"""
import numpy as np
def compute_conditional_probs(probs, marginal_vars):
"""Function which computes the conditional probability from the joint
probability. We have to inform about the dependant var... |
"""
New implementation of DisplayBlockMesh using PyQT4
"""
from PyFoam.RunDictionary.ParsedBlockMeshDict import ParsedBlockMeshDict
from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile
from PyFoam.Applications.PyFoamApplicationQt4 import PyFoamApplicationQt4
from PyFoam.Error import error,warning
f... |
import zstackwoodpecker.test_state as ts_header
import os
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template5", checking_point=8, path_list=[
[TestAction.create_vm, 'vm1', ],
[TestAction.create_volume, 'volume1', 'flag=scsi'],
[TestAction.attach_volume, 'vm1', 'volume1'],
... |
#
# Weather update client
# Connects SUB socket to tcp://localhost:5556
# Collects weather updates and finds avg temp in zipcode
#
import sys
import zmq
import time
# Socket to talk to server
context = zmq.Context()
socket = context.socket(zmq.SUB)
print("Collecting updates from weather server…")
socket.conne... |
# -*- coding: utf-8 -*-
__author__ = 'glow'
import unittest
from six.moves.urllib_parse import quote
from rwslib.rws_requests.biostats_gateway import check_dataset_format, DATASET_FORMATS, \
dataset_format_to_extension, CVMetaDataRequest, FormDataRequest, MetaDataRequest, \
ProjectMetaDataRequest, ViewMetaDat... |
# 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.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use thi... |
import os, sys
import pika
import json
import time
import traceback
from peewee import *
# DEBUG = int(os.environ.get('DEBUG'))
MQTT_HOST = os.environ.get('MQTT_HOST')
MQTT_USER = os.environ.get('MQTT_USER')
MQTT_PASSWORD = os.environ.get('MQTT_PASSWORD')
import sys
import signal
def handler(signum, frame):
sys... |
"""
=================
Lorentzian Fitter
=================
"""
import numpy
from numpy.ma import median
from numpy import pi
from pyspeckit.mpfit import mpfit
from . import fitter
class LorentzianFitter(fitter.SimpleFitter):
def __init__(self,multisingle='multi'):
self.npars = 3
self.npeaks = 1
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of web2py Web Framework (Copyrighted, 2007-2009).
Developed by Massimo Di Pierro <mdipierro@cs.depaul.edu> and
Robin B <robi123@gmail.com>.
License: GPL v2
"""
__all__ = ['MEMDB', 'Field']
import re
import sys
import os
import types
import datetime
... |
"""An ice card."""
from csrv.model import actions
from csrv.model import events
from csrv.model import game_object
from csrv.model import modifiers
from csrv.model import parameters
from csrv.model.cards import card_base
from csrv.model import timing_phases
from csrv.model.cards import card_info
class Ice(card_base.... |
#! /usr/bin/env python
import pygame
from pygame.locals import *
from sys import exit
from random import randrange
pygame.init()
pygame.font.init()
pygame.mixer.pre_init(44100, 32, 2, 4096)
font_name = pygame.font.get_default_font()
game_font = pygame.font.SysFont(font_name, 72)
screen = pygame.display.set_mode((956... |
# """
# B splines
#
#
# somewhere we should reuse coeffs here... so that a next fit looks if is has the same number of knots, and if yes, uses the previous fit as starting value.
#
# """
#
# import sys
#
# from pycs.gen import *
#
# import numpy as np
# import math
# import matplotlib.pyplot as plt
# import scipy... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pycurl
import StringIO
import random
class Tools :
def __init__ (self) :
pass
def getPage (self, url, requestHeader = []) :
resultFormate = StringIO.StringIO()
fakeIp = self.fakeIp()
requestHeader.append('CLIENT-IP:' + fakeIp)
requestHeader.append('X... |
# coding=gbk
#-------------------------------------------------------------------------------
# Name: Chalearn LAP sample
# Purpose: Provide easy access to Chalearn LAP challenge data samples
#
# Author: Xavier Baro
#
# Created: 21/01/2014
# Copyright: (c) Xavier Baro 2014
# Licence: <your lic... |
# This is a generic linear classifier that implements SGD - Stochastic Gradient
# Descent (actually its mini-batch generalization).
#
# It has to be derived from by classes that provide a 'loss' member function,
# to implement different classifiers.
# See http://cs231n.github.io/classification/ for background.
import n... |
import nltk
import unicodedata
import regex as re
import sys
import abc
import logging
import os
import cPickle as pickle
from pkg_resources import resource_filename
from bs4 import BeautifulSoup
from itertools import islice
from functools import partial
from nltk.corpus import stopwords
from nltk.stem import wordnet, ... |
#!/usr/bin/env python
#
# Copyright (c), 2016-2020, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/licenses/MIT.
#
# @author Da... |
#---------- Forematters---------------------------------------------
import numpy as np
#-------------------------------------------------------------------
def loglay_fit(up, yp, ypthresL, ypthresH):
'''
Curve fit for velocity profiles in the log-law layer of a wall-bounded shear flow
u+ = a*log(y+) + b (... |
#
# Copyright (c) 2002, 2003, 2004, 2005, 2006 Art Haas
#
# Copyright (c) 2010 Matteo Boscolo
#
# This file is part of PythonCAD.
#
# PythonCAD 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 ... |
# This file is part of TRS (http://math.kompiler.org)
#
# TRS is free software: you can redistribute it and/or modify it under the
# terms of the GNU Affero General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.
#
# TRS is distrib... |
from z3 import *
from consts import METRICS_MAXIMIZE, METRICS_MINIMIZE
FeatureIndexMap = {}
FeatureVariable = []
FeatureIndexMap['web_portal'] = 0
web_portal = Bool('web_portal')
FeatureVariable.append(web_portal)
FeatureIndexMap['web_portal'] = 1
web_portal = Bool('web_portal')
FeatureVariable.append(we... |
# -*- coding: utf-8 -*-
'''
zen Add-on
Copyright (C) 2016 zen
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 3 of the License, or
(at your option) any later v... |
#!/usr/bin/env python
# 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.
"""Makes sure files have the right permissions.
Some developers have broken SCM configurations that flip the executable
permission... |
"""Build and upload script to make UE4 client and server builds available on S3.
"""
import sys
import os
import threading
import time
import json
from datetime import datetime
import mimetypes
import argparse
import re
import getpass
import operator
from dateutil.parser import parse
from tabulate import tabulate
impo... |
# coding=utf8
from django.views.generic import ListView, DetailView, CreateView
from django.db.models import Q
from django.http import JsonResponse, HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.shortcuts import render
from pure_pagination.mixins import PaginationMixin
from django.contri... |
import os
from sys import stdout, stderr
from contextlib import contextmanager
from django.db.models import get_apps
from django.utils import simplejson as sj
from django.core import serializers
from django.conf import settings
from django.utils.itercompat import product
from .middleware import LocalStoreMiddleware
... |
import datetime, json
import requests
from .core import CallObject
from . import str2bool
class Artist(object):
def __init__(self, artist):
if type(artist) is not dict:
raise TypeError("Type of 'artist' must be 'dict'.")
self.id = int(artist['id'])
self.nameSurname = artist['... |
from chickenfoot import Chickenfoot
import socket
class TestChickenfootClient():
def setUp(self):
TCP_IP = '192.168.0.6'
TCP_PORT = 5005
self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.s.connect((TCP_IP, TCP_PORT))
def tearDown(self):
self.s.close()
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 David Arroyo Menéndez
# Author: David Arroyo Menéndez <davidam@gnu.org>
# Maintainer: David Arroyo Menéndez <davidam@gnu.org>
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... |
# -*- coding: utf-8 -*-
# --------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2016 Jonathan Labéjof <jonathan.labejof@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation fi... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... |
from corehq.fluff.calculators.case import CasePropertyFilter
import fluff
from couchforms.models import XFormInstance
from fluff.filters import ORFilter, ANDFilter, CustomFilter
from casexml.apps.case.models import CommCareCase
from corehq.fluff.calculators.xform import FormPropertyFilter
from custom.intrahealth import... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.