text stringlengths 17 737k |
|---|
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.views.generic.simple import direct_to_template
import django.contrib.auth as auth
from linked_accounts.models import LinkedAccount
from linked_accounts.utils import get_profile
from l... |
"""
====================
How pyAFQ uses BIDS
====================
The pyAFQ API relies heavily on the
`Brain Imaging Data Standard (BIDS) <https://bids-specification.readthedocs.io/en/stable/>`_. This means that the software assumes that its inputs are organized
according to the BIDS spec and its outputs conform where... |
from rest_framework import status
from rest_framework.response import Response
from kanban.models import *
from kanban.serializers import *
from django.http import Http404
# find which serializer to use
def serializer_of(Class):
serializer_tuples = [
(Board,BoardSerializer),
(Lane,LaneSerializer),... |
# -*- coding: utf-8 -*-
import regex
import phonenumbers
def all_caps_text(s, site):
s = regex.sub("<[^>]*>", "", s) # remove HTML tags
s = regex.sub("&\w+;", "", s) # remove HTML entities
if len(s) <= 150 and regex.compile(ur"SQL|\b(ERROR|PHP|QUERY|ANDROID|CASE|SELECT|HAVING|COUNT|GROUP|ORDER BY|IN... |
from pyparsing import *
import lang
ParserElement.setDefaultWhitespaceChars(" \t\r\f")
ParserElement.enablePackrat()
doc_next = None
doc_prev_component = None
doc_root_component = None
def component(com):
global doc_next, doc_prev_component, doc_root_component
if not doc_root_component:
doc_root_component = doc... |
from autofocus import AFSample, AFSampleHashMissing
#AutoFocusAPI.api_key = "<my API key>"
###############################
# Searching for a single hash #
###############################
hash = "7f38fd3e55a4139d788a4475ab0a5d83bf7686a37ef5e54a65364a0d781b523c"
try:
sample = AFSample.get(hash)
print "Pulled s... |
"""
Support for interfacing to the Logitech SqueezeBox API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.squeezebox/
"""
import logging
import asyncio
import urllib.parse
import json
import aiohttp
import async_timeout
import voluptuous a... |
import os
import re
from collections import Mapping, Sequence
from six import string_types
from .base import Base
from .exc import SettingsFileNotFoundError
from .types import LocalSetting
from .util import NO_DEFAULT
class Loader(Base):
def __init__(self, file_name=None, section=None, extender=None):
... |
# -*- coding: utf-8 -*-
"""Public section, including homepage and signup."""
from flask import (Blueprint, request, render_template, flash, url_for,
redirect, session, current_app, jsonify)
from flask_login import login_required, current_user
from dribdat.user.models import User, Event, Project
fro... |
# -*- coding: utf-8 -*-
""" License
Copyright (C) 2013 YunoHost
This program 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 l... |
#!/usr/bin/env python3
# Copyright (C) 2017 Max Rosin
#
# This program 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.
#
# Thi... |
import numpy as np
import pyther as pt
class Flash_TP(object):
"""
Flash_TP is a Class for to calculate the flash with a temperature T and
pressure P for a specified composition zi. In this case, the algorithm
used, is a combination between the ideal flash with Ki(T,P) without
dependence of the co... |
from __future__ import print_function
from __future__ import unicode_literals
from collections import OrderedDict
import calendar
import io
import itertools
import socket
import threading
from contextlib import contextmanager
from ftplib import FTP
from ftplib import error_perm
from ftplib import error_temp
from six... |
from unittest import mock
from unittest.mock import MagicMock, Mock
from PyQt5 import QtCore
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QMessageBox, QApplication
import pytest
from pesel2pbn.main import Pesel2PBNWindow
WYGENEROWANY_PESEL = '00891702980' # http://www.bogus.ovh.org/generatory... |
#encoding: utf-8
from django.http import HttpResponse
from django.shortcuts import render_to_response
from pykhufu import PyDystopia
from subprocess import Popen,PIPE
try:
import cmemcache as memcache
except:
import memcache
import cjson
import hashlib
import os
def hello(request):
menus = [
"备孕",... |
"""
The MIT License (MIT)
Copyright (c) 2013 Niko Skrypnik
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge... |
#!/usr/bin/env python3
#
# tm.py
# by alemedeiros <alexandre.n.medeiros _at_ gmail.com>
"""
A simple turing machine simulator for ECS631U - Computability module on QMUL.
Input file defininiton on the file input-format.md
"""
import csv
import sys
VERB = False
class TuringMachine(object):
""" Turing Machine ... |
"""
Formula One Bar Graph 1950-2016
author: Shoji Moto
github: https://github.com/PianoBin
website: http://pianobin.us.to/
license: MIT
Please feel free to use and modify this, but keep the above information. Thanks!
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as anim
from matpl... |
""" User interface code for the animation renderer.
Author: Alastair Hughes
"""
# Local imports.
from display import preview, render
from animate import gen_render_frame
from models import Model, Values
from constants import MAX_FPS, MIN_FPS, MAX_TEXT_HEIGHT, MIN_TEXT_HEIGHT
import transforms
# Tkinter imports
impo... |
#Copyright (c) 2007, Media Modifications Ltd.
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, pub... |
import json
import urllib2
import os
from string import Template
from decimal import Decimal
# database stuff
from sqlalchemy.exc import DBAPIError
from sqlalchemy import or_
from climasng.models import *
from climasng.parsing.prosemaker import ProseMaker
class DocAssembler(object):
def __init__(self, doc_data... |
#!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2016-2017 CNRS
# 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 limita... |
from bs4 import BeautifulSoup
import httplib2
import unicodedata
import utils
portfolio_dict = {
"a16z": "http://a16z.com/portfolio/venture-growth/",
"Khosla": "http://www.khoslaventures.com/portfolio",
"Accel": "http://www.accel.com/companies/",
"Sequoia": "https://www.sequoiacap.com/companies/",
... |
# -*- coding: utf-8 -*-
#
# Author: François Rossigneux <francois.rossigneux@inria.fr>
#
# 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
#
# Unles... |
# OAuth app keys
DROPBOX_KEY = 'changeme'
DROPBOX_SECRET = 'changeme'
DROPBOX_AUTH_CSRF_TOKEN = 'dropbox-auth-csrf-token'
|
from django.contrib import messages
from django.contrib.sites.shortcuts import get_current_site
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http import HttpResponseRedirect, Http404
from django.utils import timezone
from django.views.generic import TemplateView, View
from br... |
# -*- coding: utf-8 -*-
# Author: Simon Bussy <simon.bussy@gmail.com>
import numpy as np
from datetime import datetime
from QNEM.history import History
from time import time
from scipy.optimize import fmin_l_bfgs_b
from lifelines.utils import concordance_index as c_index_score
class Learner:
"""The base class fo... |
import os
import json
import uuid
import shutil
import asyncio
import hashlib
from waterbutler.core import utils
from waterbutler.core import signing
from waterbutler.core import streams
from waterbutler.core import provider
from waterbutler.core import exceptions
from waterbutler.core.path import WaterButlerPath
fro... |
import os
import json
import uuid
import shutil
import asyncio
import hashlib
from waterbutler.core import utils
from waterbutler.core import signing
from waterbutler.core import streams
from waterbutler.core import provider
from waterbutler.core import exceptions
from waterbutler.core.path import WaterButlerPath
fro... |
#requires https://pypi.python.org/pypi/websocket-client/
import websocket
import sys
import threading
import json,os,sys,getpass,time
from findspam import FindSpam
from ChatExchange.chatexchange.client import *
import HTMLParser
import random
from bayesian.classify import Classify
from bayesian.learn import Learn
impor... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Article'
db.create_table('wiki_article', (
('id', self.gf('django.db.models.fiel... |
#****************************************************************************
# Copyright (C) 2005-2010 Brian Granger <ellisonbg@gmail.com> and
# Barry Wark <bwark@u.washington.edu> and
# Beat Rupp <beatrupp@gmail.com
# Distributed under the terms of the BSD License. ... |
"""Example Plugin for EasyEngine."""
from cement.core.controller import CementBaseController, expose
from cement.core import handler, hook
from ee.core.variables import EEVariables
from ee.core.aptget import EEAptGet
from ee.core.download import EEDownload
from ee.core.shellexec import EEShellExec
from ee.core.fileuti... |
from .base import FlotillaOutput
class Number(FlotillaOutput):
"""
Number
"""
module = "number"
brightness = 40
digits = [0, 0, 0, 0, ]
colon = False
apostrophe = False
number = None
hours = None
minutes = None
seconds = None
NUM_DOT = 1
NUM_MID = 2
... |
import datetime
import pytest
import dateutil.tz
from jacquard.constraints import Constraints, ConstraintContext
from jacquard.directory.base import UserEntry
UTC = dateutil.tz.tzutc()
CONTEXT = ConstraintContext(era_start_date=datetime.datetime(
2017,
1,
1,
tzinfo=UTC,
))
NAMED_OLD_USER = UserEntr... |
# Time: O(n^(c+2)), n is length of string, c is count of "++"
# Space: O(c * n), recursion would be called at most c in depth.
# Besides, it costs n space for modifying string at each depth.
class Solution(object):
def canWin(self, s):
"""
:type s: str
:rtype: bool
... |
import os
# os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
# os.environ["CUDA_VISIBLE_DEVICES"] = "1"
from src.python.consts import *
from src.python.preprocess import *
from src.python.geneontology import *
from src.python.baselines import *
from pymongo import MongoClient
from tqdm import tqdm
import tensorflo... |
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Pavel Korshunov <pavel.korshunov@idiap.ch>
# Mon 18 Aug 23:12:22 CEST 2015
#
# Copyright (C) 2012-2015 Idiap Research Institute, Martigny, Switzerland
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General... |
__version__ = '0.16.0.dev675'
|
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""
fiberassign.assign
=====================
Functions and classes for computing and writing fiber assignment.
"""
from __future__ import absolute_import, division, print_function
import os
import re
import numpy as np
import ... |
from Bio import SeqIO
import math
import sys
import os.path
import cPickle
import zlib
from SWSeqRecord import SWSeqRecord
from Bio.Seq import Seq
from atk import Window
class Indexer:
sliceDistance = 100000.0
wSize = {}
dataset = {}
stepFactor = 0.1
slideStep = 1.0
tupleSet = {}
wind... |
# -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa 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... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
from sqlalchemy import Column, ForeignKey, CheckConstraint, \
PrimaryKeyConstraint, ... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.agile
~~~~~~~~~~~~~~~~~~~~~
Lexers for agile languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, \
Le... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.agile
~~~~~~~~~~~~~~~~~~~~~
Lexers for agile languages.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, \
Le... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.agile
~~~~~~~~~~~~~~~~~~~~~
Lexers for agile languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, \
Le... |
# Copyright (C) 2009, 2010, Luke Kenneth Casson Leighton <lkcl@lkcl.net>
# Copyright (C) 2010, Sujan Shakya <suzan.shakya@gmail.com>
import os
import sys
import time
import shutil
from pyjs import linker
from pyjs import translator
if translator.name == 'proto':
required_modules = [
'pyjslib', 'sys', 'imp... |
#!/usr/bin/python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Handle version information related to Visual Stuio."""
import os
import re
import subprocess
import sys
class VisualStudioVersion:
"""In... |
from pynYNAB.Entity import Entity, undef, on_budget_dict, AccountTypes
from pynYNAB.schema.Fields import EntityField, AmountField, DateField, AccountTypeField, EntityListField, DatesField, \
PropertyField
class Transaction(Entity):
accepted=EntityField(True)
amount=AmountField()
cash_amount=AmountFiel... |
#coding: utf-8
import tornado.web
from sqlalchemy import and_
from sqlalchemy.orm.exc import NoResultFound
from pyprint.handler import BaseHandler
from pyprint.models import Post
from pyprint.utils import posts_markdown
from pyprint.constants import DIARY
class ListDiariesHandler(BaseHandler):
def get(self):
... |
import os
import re
import yaml
import uuid
from time import strftime, strptime
from spatialist.raster import Raster, Dtype
from spatialist.ancillary import union
from .ancillary import parse_datasetname
class Dataset(object):
def __init__(self, filename, units='DN'):
if isinstance(filename, list... |
"""
tests the pysat meta object and code
"""
import netCDF4
import numpy as np
import os
import pandas as pds
import pytest
import pysat
import pysat.instruments.pysat_testing
import pysat.tests.test_utils
class TestBasics():
def setup(self):
"""Runs before every method to create a clean testing setup.""... |
import os
# Displays to user what they want to do
def display_menu():
option = 0
while option != 3:
print "Welcome to the To-Do App"
print "1. Enter an entry"
print "2. Show calendar"
print "3. Exit"
option = int(raw_input("Pick an item: "))
pick_option(option)... |
"""Sub-classes for vtk.vtkPolyData."""
import logging
import os
import numpy as np
import vtk
from vtk import (VTK_HEXAHEDRON, VTK_PYRAMID, VTK_QUAD,
VTK_QUADRATIC_HEXAHEDRON, VTK_QUADRATIC_PYRAMID,
VTK_QUADRATIC_QUAD, VTK_QUADRATIC_TETRA,
VTK_QUADRATIC_TRIANGLE, VTK_... |
'''
====================================================================
Copyright (c) 2003-2017 Barry A Scott. All rights reserved.
This software is licensed as described in the file LICENSE.txt,
which you should have received as part of this distribution.
======================================================... |
#!/usr/bin/env python
import socket
import sys
import yaml
from boto3.session import Session
def genhosts(elbip, sysdomain, outfile=sys.stdout):
SYS_PREFIXES = [
'console',
'uaa',
'apps',
'login',
'api',
'loggregator']
print >>outfile, "#"*16, "Generated for /e... |
from pathlib import Path
import pickle
from weibo.weibo import Weibo
DATA_FILE = 'data.pickle'
# TOPIC = '100808cd96538eeddd4fe8f836ebcc74674201'
if Path(DATA_FILE).exists():
data = pickle.load(open(DATA_FILE, 'rb'))
for l in data:
print(l)
print(data['topic_posts'][3983031792070626])
else:
exit(... |
#!/usr/bin/env python3
# script to download and unpack imdb data files
import argparse
import boto3
import gzip
import os
parser = argparse.ArgumentParser(description='IMDB data updater script')
parser.add_argument('--do-get', dest='do_get', action='store_true')
args = parser.parse_args()
if args.do_get:
print("ch... |
#!/usr/local/bin/python
import re
import sh
import sys
import os
#####################
# Comment functions #
#####################
def find_substring(substring, string):
indices = []
index = -1 # Begin at -1 so index + 1 is 0
while True:
# Find next index of substring, by starting search from ind... |
from itertools import izip_longest, chain
import logging
from django.core.urlresolvers import reverse, NoReverseMatch
from django.core.files.uploadedfile import UploadedFile
from . import filestorage
logger = logging.getLogger(__name__)
class FileUpload(object):
"""
A wrapper to send to the django widget wh... |
__version__ = '0.1.0'
|
from __future__ import absolute_import
from git.repo import Repo
from kenja.detection.extract_method import detect_extract_method
import argparse
def format_for_umldiff(package_prefix, a_commit, b_commit, org_commit, a_package, b_package, c, m, method, sim):
target_method_info = [package_prefix]
if a_package:
... |
import sys
from PyQt5.QtCore import QSize, Qt
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import *
from CurseAPI import CurseAPI
from MultiMC import MultiMC, MultiMCInstance
from functools import partial
from Utils import clearLayout, confirmBox, directoryBox
from pickle import UnpicklingError
from PackBrowser... |
# -*- coding: UTF8 -*-
"""winshell - convenience functions to access Windows shell functionality
Certain aspects of the Windows user interface are grouped by
Microsoft as Shell functions. These include the Desktop, shortcut
icons, special folders (such as My Documents) and a few other things.
These are mostly availab... |
import numpy as np
import scipy.io as io
import pickle
import argparse
import sys
sys.path.append('../Code/')
import SAILmods
import SAILnet
parser = argparse.ArgumentParser()
parser.add_argument('--scaled', dest='scaled', action='store_true')
parser.add_argument('--not-scaled', dest='scaled', action='store_false')
p... |
# pylint: disable=C0103
# pylint: disable=C0111
# pylint: disable=C0301
import argparse
import json
import sys
import os
import threading
import logging
import time
import curses
from shutil import rmtree
from shutil import move
from shutil import copyfile
from getpass import getpass
from time import sleep
from uuid ... |
import os
import subprocess
import ConfigParser
import argparse
import pprint
import logging
from fabric.api import *
from fabric.utils import *
from fabric.contrib.console import confirm
from fabric.contrib.files import *
from fabric.colors import *
from fsevents import Observer
from fsevents import Stream
import g... |
# TODO: weird name to avoid init issues with state.py::State.
import sublime
import sublime_plugin
import re
import logging
from Vintageous import local_logger
from Vintageous.state import _init_vintageous
from Vintageous.state import State
from Vintageous.vi import inputs
# from Vintageous.vi import motions
from Vin... |
from jinja2 import Template
import yaml
def yaml_to_md(layer_name):
out.write('## ' + layer_name + '\n\n')
data = yaml.load(inp)
layer = data['layers'][layer_name]
attributes = layer['attributes']
# values of layer attribute "type" (not to be confused with an attribute's type)
type_values =... |
import math
from maya import cmds
from maya import OpenMaya
from maya import OpenMayaUI
def worldToScreen(fnCamera=None,
objectPoint=None,
activeView=None):
'''
:param fnCamera(OpenMaya.MFnCamera): Active Camera function set.
:param objectPoint(OpenMaya.MPoin... |
__author__ = 'Mael Beuget, Pierre Monnin & Thibaut Smith'
from BaseHandler import *
import logging
from XMLAnalyser import XMLAnalyser
from google.appengine.api import memcache
class StudentsListHandler(BaseHandler):
def __init__(self, request=None, response=None):
self.initialize(request, response)
... |
from __future__ import division
from colour import Color
red = Color(rgb=(230/255, 124/255, 115/255))
yellow = Color(rgb=(1, 214/255, 102/255))
green = Color(rgb=(87/255, 187/255, 138/255))
ry = red.range_to(yellow, 12)
yg = yellow.range_to(green, 12)
gradient = [red.hex] + [x.hex for x in ry] + [yellow.hex] + \
... |
import asyncio
import concurrent
import logging
import os
import threading
import traceback
import json
import uuid
from shlex import quote as shq
import jinja2
import aiohttp_jinja2
from aiohttp import web
import cerberus
import kubernetes as kube
import requests
import uvloop
import prometheus_client as pc
from prom... |
#!/usr/bin/env python
# Copyright 2016 The Johns Hopkins University Applied Physics Laboratory
#
# 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... |
#!/usr/bin/python
from __future__ import print_function
import argparse
import logging.handlers
log = logging.getLogger("rfm_ecomanager_logger")
import time
import os
import sighandler
from nanode import Nanode
from manager import Manager
def setup_argparser():
# Process command line _args
parser = argparse.A... |
"""Download handlers for http and https schemes"""
import ipaddress
import logging
import re
import warnings
from contextlib import suppress
from io import BytesIO
from time import time
from urllib.parse import urldefrag
from twisted.internet import defer, protocol, ssl
from twisted.internet.endpoints import TCP4Clie... |
########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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... |
#!/usr/bin/env python
##
## Author(s):
## - Cedric GESTES <gestes@aldebaran-robotics.com>
##
## Copyright (C) 2010 Aldebaran Robotics
##
import sys
import re
import os
funcregex = re.compile('\s*function\s*\((\S*?)[\s\)]+.*')
nameregex = re.compile('# \\\\(\S*?):(\S*?)\s+(.*)')
def addAsciiDocLine(line, doclines):
... |
import datetime
import urllib
from django.contrib import auth
from django.core.exceptions import ImproperlyConfigured
from django.db import models, DEFAULT_DB_ALIAS
from django.db.models.manager import EmptyManager
from django.contrib.contenttypes.models import ContentType
from django.utils.encoding import smart_str
f... |
import os
import sys
from lxml import etree
from lxml.builder import E
'''
1) Check sample-apps project structure
2) Parse excludes from pom.xml of sample apps project
3) For every sample-app project
4.1) For every sample-app sub project
4.1.1) Check assembly folder
4.1.2) Find corresponding info in the projects.xml
... |
import os
import vtkAll as vtk
from ddapp import botpy
import math
import numpy as np
from ddapp import transformUtils
from ddapp import lcmUtils
from ddapp.timercallback import TimerCallback
from ddapp import objectmodel as om
from ddapp import visualization as vis
from ddapp import applogic as app
from ddapp.debugVi... |
# Copyright 2022 The Scenic Authors.
#
# 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 w... |
# A time saving utility file set to run against _ALL_ sklearn classifers
# If the data set is large it may run into memory issues as all final models are stored in memory.
from sklearn.utils.testing import all_estimators
from sklearn.ensemble import AdaBoostClassifier, RandomForestClassifier, ExtraTreesClassifier, Gra... |
# Copyright 2021 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
from typing import List, Callable, Tuple, Dict, Iterable, Iterator, Union, Any, IO
from typing import Optional, TYPE_CHECKING
from pathlib import Path
from timeit import default_timer as timer
from thinc.api import Optimizer, Config, constant, fix_random_seed, set_gpu_allocator
import random
import wasabi
import sys
f... |
# vim:ts=4:sts=4:sw=4:expandtab
from datetime import datetime
from django.db import models
import inspect
from satori.ars.model import *
from satori.core.export.type_helpers import DefineException, ArsDeferredStructure, python_to_ars_type
from satori.core.export.pc import AccessDenied
ArgumentNotFound = Define... |
"""
Syndication feed generation library -- used for generating RSS, etc.
Sample usage:
>>> feed = feedgenerator.Rss201rev2Feed(
... title=u"Poynter E-Media Tidbits",
... link=u"http://www.poynter.org/column.asp?id=31",
... description=u"A group weblog by the sharpest minds in online media/journalism/publi... |
from itertools import chain
from PyQt4.QtGui import QLayout
from PyQt4.QtCore import Qt
from Orange.data import Table
from Orange.regression.linear import (
LassoRegressionLearner, LinearModel, LinearRegressionLearner,
RidgeRegressionLearner)
from Orange.preprocess.preprocess import Preprocess
from Orange.widg... |
from __future__ import (
absolute_import, division, print_function, unicode_literals)
""" Multicast DNS Service Discovery for Python, v0.14-wmcbrine
Copyright 2003 Paul Scott-Murphy, 2014 William McBrine
This module provides a framework for the use of DNS Service Discovery
using IP multicast.
Thi... |
"""
interface
---------
"""
from collections import defaultdict
from operator import attrgetter, itemgetter
from textwrap import dedent
from weakref import WeakKeyDictionary
from .compat import raise_from, with_metaclass
from .default import default, warn_if_defaults_use_non_interface_members
from .formatting import b... |
VERSION = (1, 2, 4, 'DEV')
# Dynamically calculate the version based on VERSION tuple
if len(VERSION) > 2 and VERSION[2] is not None:
if isinstance(VERSION[2], int):
str_version = "%s.%s.%s" % VERSION[:3]
else:
str_version = "%s.%s_%s" % VERSION[:3]
else:
str_version = "%s.%s" % VERSION[:2... |
# xpyBuild - eXtensible Python-based Build System
#
# This class is responsible for working out what tasks need to run, and for
# scheduling them
#
# Copyright (c) 2013 - 2017 Software AG, Darmstadt, Germany and/or its licensors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use ... |
from datetime import timedelta, datetime
from django.conf import settings
from django.test.client import Client
from .base import BaseStaticSiteRenderer
__all__ = ('S3StaticSiteRenderer', )
def _get_cf():
from boto.cloudfront import CloudFrontConnection
return CloudFrontConnection(
aws_access_key_id=... |
"""
the product context captures environment and configuration settings
that are specific to each product, e.g. each product requires a different
database configuration.
Use the context only for very specific stuff that NEEDS to
be configured on a product basis.
The context is loaded from a file in json format.
"""... |
import sys
import os
import shutil
import re
import subprocess
import collections
import tempfile
import difflib
class AssemblyLine:
'''
An abstract representation of an assembly instruction
'''
def __init__(self, assembly_line):
'''
assembly_line - a line in an assembly instruction
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... |
from copy import deepcopy
from datetime import datetime
from mangrove.datastore.database import DataObject
from mangrove.datastore.documents import SurveyResponseDocument, DataRecordDocument
from mangrove.datastore.entity import DataRecord
from mangrove.utils.types import is_string, sequence_to_str, is_sequence, is_em... |
"""Random Forest classifier using R's randomForest library.
RPy2 is used to interface with R."""
import readline # hopefully fix libreadline error
import rpy2.robjects as ro
from rpy2.robjects import pandas2ri
import pandas.rpy.common as com
import pandas as pd
from generic_classifier import GenericClassifier
import s... |
# TmServer - TissueMAPS server application.
# Copyright (C) 2016 Markus D. Herrmann, University of Zurich and Robin Hafen
#
# This program 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... |
#!/bin/python
# -*- coding: utf-8 -*-
###############################################
#Dresscode : class : uppercase
# function : begins with a capital
# variable : words separated by capital
# object : words separated by underscore
from functionObjectVCF_creator import *
import re
impo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.