src stringlengths 721 1.04M |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on March 3, 2014
@author: Chunwei Yan @ PKU
@mail: yanchunwei@outlook.com
'''
from __future__ import division
import sys
import theano
import math
import numpy
from theano import scalar as T
import cPickle as pickle
import argparse
sys.path.append('../..')
fro... |
#!usr/bin/python
__author__="Jose Diaz - email: jozz.18x@gmail.com"
__date__ ="$04/03/2015 05:55:19 AM$"
from homepage import Homepage
from tkinter import *
from tkinter import ttk
from PIL import Image, ImageTk
from urllib.request import urlopen # Interaccion con la web
from urllib.error import HTTPError,U... |
#!/usr/bin/env python3
# Copyright (c) 2019-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Test Taproot softfork (BIPs 340-342)
from test_framework.blocktools import (
create_coinbase,
c... |
# -*- coding: utf-8 -*-
# Copyright 2010, 2012-2014 Richard Dymond (rjdymond@gmail.com)
#
# This file is part of Pyskool.
#
# Pyskool 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 Li... |
from django.conf.urls import url
#from . import views
from scrum.views.portfolioView import *
from scrum.views.portfolioView import PortfolioListbyStatus, PortfolioList, PortfolioDetails, PortfolioCreate, PortfolioUpdate, PortfolioDelete
from scrum.views.releaseView import ReleaseList, ReleaseCreate, ReleaseDetails, Re... |
# Logistic Regression
from matplotlib import use
use('TkAgg')
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import minimize
import pandas as pd
from ml import mapFeature, plotData, plotDecisionBoundary
from matplotlib.pyplot import show
from costFunctionReg import costFunctionReg
from gradie... |
from celery.schedules import crontab
from celery.task import periodic_task
import datetime
from casexml.apps.stock.models import StockTransaction
from corehq.apps.commtrack.models import SupplyPointCase, StockState
from corehq.apps.locations.dbaccessors import get_users_by_location_id
from corehq.apps.locations.models ... |
# -*- coding: utf-8 -*-
import json
from unittest import mock
from django.urls import reverse
from pyquery import PyQuery as pq
from olympia import amo
from olympia.access.models import Group, GroupUser
from olympia.amo.tests import TestCase, user_factory
from olympia.files.models import File
from olympia.users.mod... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Low-level objects providing an abstraction for the objects involved in the calculation.
"""
from __future__ import unicode_literals, division, print_function
import collections
import abc
import six
import ... |
import sys
import math
from itertools import chain, combinations
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def __repr__(self):
return "P:({}, {})".format(self.x, self.y)
def __str__(self):
return "P:({}, {})".format(self.x, self.y)
#def powerSet(soFar, rest):
# """
# soFar, rest ... |
import os
from sqlalchemy import create_engine, MetaData
from sqlalchemy.orm import scoped_session, sessionmaker
metadata = MetaData()
def get_sa_db_uri(driver='', username='', password='', host='', port='', database=''):
"""get SQLAlchemy DB URI: driver://username:password@host:port/database"""
assert driv... |
#!/usr/bin/env python
import logging
import os
import shlex
import subprocess
import tempfile
from insights.core.marshalling import Marshaller
from insights.util import subproc, fs
try:
import insights.contrib.magic as magic
except Exception:
raise ImportError("You need to install the 'file' RPM.")
else:
... |
"""
The Tornado Framework
By Ali Pesaranghader
University of Ottawa, Ontario, Canada
E-mail: apesaran -at- uottawa -dot- ca / alipsgh -at- gmail -dot- com
"""
import math
import operator
from classifier.classifier import SuperClassifier
from dictionary.tornado_dictionary import *
def calculate_euclide... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'multCompCorrection.ui'
#
# Created: Sat Apr 16 13:41:52 2011
# by: PyQt4 UI code generator 4.6.2
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_MultCompCorrectionDialog(object):
d... |
# -*- coding: utf-8 -*-
__author__ = 'sandlbn'
from .models import Performance
from .models import PerformanceFrontPage
from .models import PerformanceGenre
from .models import PerformanceTime
from .models import PerformanceDonor
from theatre_news.models import News
from .forms import PerformanceForm
from .forms import... |
import pathlib
import abc
import chardet
from django.utils.timezone import get_default_timezone_name, now
def decode_from_filesystem(path):
"""
Decode a given Path object to unicode by detecting its encoding
:param path: The Path object to decode
:type path: pathlib.Path
:return: Tuple of the str... |
# Copyright 2014 Michael Rice <michael@michaelrice.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
# -*- coding: utf-8 -*-
# sabapp - Simple Address Book Application
# Copyright (C) 2008 Helder Guerreiro
# This file is part of sabapp.
#
# sabapp 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 versi... |
# Django settings for hcrendu project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'... |
import os
from os.path import sep, join, exists
from collections import namedtuple
from subprocess import Popen, PIPE
import shutil
import re
import sys
from tools.targets import TARGET_MAP
from tools.export.exporters import Exporter, TargetNotSupportedException
import json
from tools.export.cmsis import DeviceCMSIS
f... |
#!/usr/bin/env python
from nose.tools import *
import networkx
from networkx import *
from networkx.generators.degree_seq import *
from networkx.algorithms.isomorphism.isomorph import graph_could_be_isomorphic
from networkx.utils import uniform_sequence,powerlaw_sequence
"""Generators - Degree Sequence
---------------... |
from asyncio import Queue
from uuid import uuid4
import pytest
from photonpump import messages as msg, exceptions
from photonpump import messages_pb2 as proto
from photonpump.conversations import ReadAllEvents
@pytest.mark.asyncio
async def test_read_all_request():
output = Queue()
convo = ReadAllEvents(m... |
import requests
from config import config
from multiprocessing.pool import ThreadPool
from util.printer import printer
from util.content import parse_robots_txt,parse_res
import urllib3
urllib3.disable_warnings()
requests.packages.urllib3.disable_warnings()
class Spider:
WEB_ROOT=config.WEB_ROOT
def wor... |
# Copyright (C) 2010 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# 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
# ... |
# Copyright 2014 Diamond Light Source 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 t... |
''' Models for representing top-level plot objects.
'''
from __future__ import absolute_import
from six import string_types
from ..core.enums import Location
from ..core.properties import Auto, Bool, Dict, Either, Enum, Include, Instance, Int, List, Override, String
from ..core.property_mixins import LineProps, Fill... |
# -*- coding: utf-8 -*-
#
# Copyright © 2011 Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
"""
Line Profiler widget
See the official documentation of line_profiler:
http://pythonhosted.org/line_profiler/
"""
# Standard library imports
from __future__ import ... |
import json
import sys
import requests
import logging
from requests.packages.urllib3.util import Retry
import robot
from robot.api import logger
from robot.libraries.BuiltIn import BuiltIn
from RequestsLibrary.compat import httplib, urlencode, PY3
try:
from requests_ntlm import HttpNtlmAuth
except ImportError:
... |
# -*- coding: utf-8 -*-
import os
import tempfile
SECRET_KEY = "x"
INSTALLED_APPS = (
# django
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.messages',
'django.contrib.sessions',
'django.contrib.staticfiles',
# shuup themes
'shuup.th... |
"""Tracking for bluetooth devices."""
import asyncio
import logging
from typing import List, Set, Tuple, Optional
# pylint: disable=import-error
import bluetooth
from bt_proximity import BluetoothRSSI
import voluptuous as vol
from homeassistant.components.device_tracker import PLATFORM_SCHEMA
from homeassistant.compo... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 CERN.
#
# Invenio 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... |
#!/usr/bin/env python
#
# Copyright (C) 2014
# Brian Caswell <bmc@lungetech.com>
# Narf Industries <info@narfindustries.com>
#
# 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 res... |
class CastLibraryTable: #------------------------------
def __init__(self, castlibs):
self.by_nr = {}
self.by_assoc_id = {}
for cl in castlibs:
self.by_nr[cl.nr] = cl
if cl.assoc_id>0:
self.by_assoc_id[cl.assoc_id] = cl
def iter_by_nr(self):
... |
#!/usr/bin/env python
# This is an example script to upload data (images, text, metadata) to
# google cloud storage and datastore (for general data)
# Preparation of Pubmed Open Access Data
ftp_base = "ftp://ftp.ncbi.nlm.nih.gov/pub/pmc"
file_list = "ftp://ftp.ncbi.nlm.nih.gov/pub/pmc/oa_file_list.txt"
from glob im... |
import pytest
import arrow
from dateutil import tz
from dateutil.rrule import rrulestr
from datetime import timedelta
from inbox.models.event import Event, RecurringEvent, RecurringEventOverride
from inbox.models.when import Date, Time, DateSpan, TimeSpan
from inbox.events.remote_sync import handle_event_updates
from i... |
import re
import socket
from itertools import count, chain
from collections import Counter
from datetime import datetime
import redis
import django
from django.db.models import Avg
from django.shortcuts import render
from django.contrib import messages
from django.urls import reverse
from django.core.cache import cac... |
# -*- coding: utf-8 -*-
#
# Octosend Documentation documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 23 18:25:47 2015.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerate... |
# coding: utf-8
# Copyright (C) 2010 Arthur Furlan <afurlan@afurlan.org>
# Copyright (c) 2013 Sascha J�ngling <sjuengling@gmail.com>
#
# 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 ver... |
# python
# This file is generated by a program (mib2py). Any edits will be lost.
from pycopia.aid import Enum
import pycopia.SMI.Basetypes
Range = pycopia.SMI.Basetypes.Range
Ranges = pycopia.SMI.Basetypes.Ranges
from pycopia.SMI.Objects import ColumnObject, MacroObject, NotificationObject, RowObject, ScalarObject, N... |
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.shortcuts import render, get_object_or_404
from django.utils.timezone import now
from seuranta.models import Competition
@login_required
def own_competitions(request):
user = request.user
... |
# Copyright (c) 2019 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
import argparse
import os
from west import log
from west.commands import WestCommand
# Relative to the folder where this script lives
COMPLETION_REL_PATH = 'completion/west-completion'
class Completion(WestCommand):
def __ini... |
# coding=utf-8
from django.db import connection
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.contrib.sites.models import Site
class Command(BaseCommand):
args = '<id_or_name>'
help = 'Fix any broken article urls due to wrong root site id'
def h... |
"""Utilities for input validation"""
# Authors: Olivier Grisel
# Gael Varoquaux
# Andreas Mueller
# Lars Buitinck
# Alexandre Gramfort
# Nicolas Tresegnie
# License: BSD 3 clause
import warnings
import numbers
import numpy as np
import scipy.sparse as sp
from ..externals ... |
# ~*~ coding: utf-8 ~*~
"""Module that defines a Marshmallow field for Peewee's foreign keys."""
from marshmallow import fields
from .mixin import FleakerFieldMixin
class ForeignKeyField(fields.Integer, FleakerFieldMixin):
"""Marshmallow field that can be used with Peewee's foreign key setup.
Turns a field... |
# Copyright 2014 eNovance
#
# 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, so... |
# -*- coding: utf-8 -*-
'''
The REST-API of Feeder
'''
from feeder import app
from .database import db
from .models import (Feed, FeedItem, UserFeed, UserDeletion,
get_user, get_feed, get_userfeed)
#from flask_oauthlib.client import OAuth
from flask.ext.restful import (Resource, Api, reqparse, fie... |
# noinspection PyPackageRequirements
import wx
import gui.utils.color as colorUtils
import gui.utils.draw as drawUtils
from gui.utils.helpers_wxPython import HandleCtrlBackspace
SearchButton, EVT_SEARCH_BTN = wx.lib.newevent.NewEvent()
CancelButton, EVT_CANCEL_BTN = wx.lib.newevent.NewEvent()
TextEnter, EVT_TEXT_ENTER... |
"""Code for the B{0store} command-line interface."""
# Copyright (C) 2009, Thomas Leonard
# See the README file for details, or visit http://0install.net.
from zeroinstall import _
import sys, os
from zeroinstall.zerostore.manifest import verify, get_algorithm, copy_tree_with_verify
from zeroinstall import zerostore,... |
#!/usr/bin/python
#-*-encoding:utf-8-*-
#author: asher
#date: 20160429 on train D909
# this scripts useed for add server ip to webvirtmgr
# if not , each server must add by website,it's too slow, and very not interesting.
# use this , it's make you feel very happy
import sqlite3
try:
conn = sqlite3.connect('../... |
# set command to set global variables
from lib.utils import *
def _help():
usage = '''
Usage: set [options] (var) [value]
[options]:
-h Print this help.
-del (var) Delete variable
(var) if defined.
where (var) is a valid
global variable
if [value] is not given,
current v... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of Linshare api.
#
# LinShare api 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... |
# BEGIN_COPYRIGHT
#
# Copyright (C) 2017 Open Microscopy Environment:
# - University of Dundee
# - CRS4
#
# 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/... |
"""
quality control for MRS data
"""
import os
import os.path as op
import nibabel as nib
import numpy as np
import nipype.pipeline.engine as pe
from nipype.interfaces import fsl
def motioncheck(ref_file, end_file, out_path=None, thres=5.0):
"""
Checks motion between structural scans of the same modality.
... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import ast
import re
from markupsafe import Markup
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError, UserError
from odoo.tools import remove_accents, is_html_empty
# see rfc5322 sect... |
"""
IfElse introduces lazy evaluation in Theano (coupled with the CVM/VM
linkers). It resembles the if clause of any programming language, that
has a `then` and `else` branch, and executes either one or the other
according to the condition provided.
This op differs from the already existent `switch` op, that evaluates... |
import argparse
import hashlib
import json
import os
import csv
RWC_CLASSICAL_INDEX_PATH = "../mirdata/datasets/indexes/rwc_classical_index.json"
def md5(file_path):
"""Get md5 hash of a file.
Parameters
----------
file_path: str
File path.
Returns
-------
md5_hash: str
... |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ...worksheet import Worksheet
class TestExtractFilterTokens(unittest.TestCase):
"""
... |
from flask import Flask, render_template, request, redirect, session, flash
from mysqlconnection import MySQLConnector
app = Flask(__name__)
app.secret_key = 'secretsquirrel'
mysql = MySQLConnector(app, 'friendsdb')
@app.route('/')
def index():
showQuery = 'SELECT * FROM friends'
friends = mysql.query_d... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
'''
Copyright (c) 2012 Alexander Abbott
This file is part of the Cheshire Cyber Defense Scoring Engine (henceforth
referred to as Cheshire).
Cheshire 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 Sof... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Write a program to display the peom The Road Not Taken by Robert Frost.
Two roads diverged in a yellow wood,
And sorry I could not travel both
And be one traveler, long I stood
And looked down one as far as I could
To where it bent in the undergrowth;
Then took the ... |
# coding=utf-8
'''
Created on 30.4.2013
Updated on 26.8.2013
Potku is a graphical user interface for analyzation and
visualization of measurement data collected from a ToF-ERD
telescope. For physics calculations Potku uses external
analyzation components.
Copyright (C) Jarkko Aalto, Timo Konu, Samuli Kärkkäinen, ... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from ..extern import six
from ..extern.six.moves import zip
import warnings
import weakref
import re
from copy import deepcopy
import numpy as n... |
# Copyright 2016 Mycroft AI, Inc.
#
# This file is part of Mycroft Core.
#
# Mycroft Core 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 versio... |
from distutils.core import setup
from distutils.command.install_data import install_data
from distutils.command.install import INSTALL_SCHEMES
import os
import sys
class osx_install_data(install_data):
# On MacOS, the platform-specific lib dir is /System/Library/Framework/Python/.../
# which is wrong. Python 2... |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... |
import unittest
from challenge import FileReader, Listing, Product, MatchSearch
import challenge
import json
class TestChallengeFindProductByListing(unittest.TestCase):
def listings(self,listings_json):
listings = []
for l in listings_json:
listings.append(Listing.create(l))
return listings... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
import base64
import unittest
from odoo.tests.common import BaseCase
from odoo.tools.mimetypes import guess_mimetype
PNG = b'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVQI12P4//8/AAX+Av7czFnnAAAAAElFTkSuQmCC'
GIF = b"R0lGODdhAQABAIAAAP///////ywAAAAAAQABAAACAkQBADs="
BMP = b"""Qk1+AAAAAAAAAHoAAABsAAAAAQAAAAE... |
"""
This module is a functional test of the game_server and game_client
interactions. a game server is spun up in a seperate process space and bound
to localhost on port 5000. The game client is then used to interact with
the game server.
"""
import unittest
from multiprocessing.process import Process
from clueless.... |
#!/usr/bin/env python3
import argparse
import os
import subprocess
import sys
if False:
from typing import Set
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ZULIP_PATH)
from scripts.lib.node_cache import generate_sha1sum_node_modules
from scripts.lib.zul... |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should h... |
"""
Django settings for superlists project.
Generated by 'django-admin startproject' using Django 1.8.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build p... |
import json
from django.conf import settings
from django.core.cache import cache
from nose.tools import eq_
from pyquery import PyQuery as pq
from kitsune.customercare.replies import REPLIES_DOCUMENT_SLUG
from kitsune.sumo.tests import TestCase
from kitsune.sumo.urlresolvers import reverse
from kitsune.wiki.tests im... |
# sqlalchemy/inspect.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""The inspection module provides the :func:`_sa.inspect` function,
which deli... |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2014 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.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, eithe... |
# Copyright 2007,2008,2009,2011 Everyblock LLC, OpenPlans, and contributors
#
# This file is part of ebdata
#
# ebdata 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,... |
"""
fs.rpcfs
========
This module provides the class 'RPCFS' to access a remote FS object over
XML-RPC. You probably want to use this in conjunction with the 'RPCFSServer'
class from the :mod:`~fs.expose.xmlrpc` module.
"""
import xmlrpclib
import socket
import base64
from fs.base import *
from fs.errors import *
... |
# Profile controller for viewing a friend's profile
from masterapp.lib.base import *
from masterapp.lib.amazon import *
from masterapp.lib.profile import Profile
from masterapp.lib.fbauth import ensure_fb_session
from masterapp.lib.snippets import get_session_user
from masterapp.model import User, Session, Spotlight, ... |
# Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
#
# 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, m... |
#! /usr/bin/env python
#
# Copyright (c) 2008-2010 University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
# GENI Public License
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without rest... |
import argparse
import logging
import os
import subprocess
import time
import yaml
from StringIO import StringIO
import teuthology
from . import orchestra
import orchestra.remote
from .orchestra import run
from .config import FakeNamespace
from .lock import list_locks
from .lock import unlock_one
from .lock import fin... |
# The Admin4 Project
# (c) 2013-2014 Andreas Pflug
#
# Licensed under the Apache License,
# see LICENSE.TXT for conditions of usage
from _objects import SchemaObject
from _pgsql import pgQuery
from wh import xlt, YesNo
import logger
class Function(SchemaObject):
typename=xlt("Function")
shortname=xlt("Function... |
from graph_tool.all import *
from sets import Set
import random
from geopy import geocoders, distance
from decimal import *
def randomize(iterable, bufsize=1000):
''' generator that randomizes an iterable. space: O(bufsize). time: O(n+bufsize). '''
buf = [None] * bufsize
for x in iterable:
i = random.r... |
# Copyright 2016, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... |
"""
Compute statistics about a consumed sequence of messages.
"""
from chirp.common import http_console_server
from chirp.common import timestamp
from chirp.stream import message
class _ConnectionInfo(object):
MAX_NUM_ERRORS = 25
connection_id = None
start_timestamp_ms = None
last_timestamp_ms ... |
from django import forms
from .models import ExtendedUser
from allauth.account.forms import UserForm, PasswordField, SetPasswordField
from allauth.account import app_settings
from allauth.account.adapter import get_adapter
from allauth.account.models import EmailAddress
from allauth.account.utils import filter_users_b... |
# Django settings for blackout project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME':... |
#!/usr/bin/env python
# Copyright 2013 AlchemyAPI
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
"""
Python Markdown
A Python implementation of John Gruber's Markdown.
Documentation: https://python-markdown.github.io/
GitHub: https://github.com/Python-Markdown/markdown/
PyPI: https://pypi.org/project/Markdown/
Started by Manfred Stienstra (http://www.dwerg.net/).
Maintained for a few years by Yuri Takhteyev (ht... |
from symbol.builder import FasterRcnn as Detector
from models.dcn.builder import DCNResNetC4 as Backbone
from symbol.builder import Neck
from symbol.builder import RpnHead
from symbol.builder import RoiAlign as RoiExtractor
from symbol.builder import BboxC5V1Head as BboxHead
from mxnext.complicate import normalizer_fac... |
from urlparse import urljoin
import xml.etree.ElementTree as ET
from django.conf import settings
from django.core.urlresolvers import reverse
from django.template import Template, Context
from django.utils import timezone
from django.utils.text import slugify
PARAMETERS = ".//properties/hudson.model.ParametersDefini... |
# patchbomb.py - sending Mercurial changesets as patch emails
#
# Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''command to send changesets as (a series of) patch ... |
import os, StringIO
import numpy
import xmlstore.xmlstore
import xmlplot.common
class LinkedFileVariableStore(xmlplot.common.VariableStore,xmlstore.datatypes.DataFileEx):
# XML store-derived class for storing (cached) metadata of a data file,
# such as coordinate ranges.
# This is implemented as XML sto... |
# Copyright 2020 kubeflow.org.
#
# 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,... |
import base64
import hashlib
import os
import random
import re
import time
import uuid
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
from rhumba import RhumbaPlugin
from twisted.internet import defer, reactor
from twisted.enterpris... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import copy
import re
from importlib import import_module
from django import forms
from django.utils import six
from django.utils.decorators import classonlymethod
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translatio... |
# Copyright 2017 The TensorFlow 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 applica... |
import unittest
import asyncio
import sys
import os
import re
import io
from molotov.util import multiprocessing
from molotov.sharedconsole import SharedConsole
from molotov.tests.support import dedicatedloop, catch_output
OUTPUT = """\
one
two
3
TypeError\\("unsupported operand type(.*)?
TypeError\\("unsupported op... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.