repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
spacecowboy/pysurvival-ann | test.py | 1 | 23550 | #!/usr/bin/env python
from __future__ import division, print_function
import numpy as np
def get_surv_uncensored(numweights, datasize=100, *args, **kwargs):
_inputs = np.random.uniform(size=(datasize, numweights))
# Normalize
_inputs -= np.mean(_inputs, axis=0)
_inputs /= np.std(_inputs, axis=0)
#_... | gpl-2.0 |
tqchen/tvm | tests/python/frontend/caffe2/test_forward.py | 4 | 7882 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
stefanweller/ansible-modules-extras | monitoring/librato_annotation.py | 138 | 5556 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (C) Seth Edwards, 2014
#
# 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 ... | gpl-3.0 |
tinchoss/Python_Android | python/src/Lib/email/mime/multipart.py | 480 | 1573 | # Copyright (C) 2002-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Base class for MIME multipart/* type messages."""
__all__ = ['MIMEMultipart']
from email.mime.base import MIMEBase
class MIMEMultipart(MIMEBase):
"""Base class for MIME multipart/* type messages."""... | apache-2.0 |
Hokutosei/kubernetes | build/json-extractor.py | 413 | 2111 | #!/usr/bin/env python
# Copyright 2014 The Kubernetes 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
#
# Unle... | apache-2.0 |
andela-brotich/CP2-bucket-list-api | app/mod_auth/models.py | 2 | 1060 | from flask_bcrypt import generate_password_hash, check_password_hash
from app import db, token_signer
class User(db.Model):
"""
Defines attributes for a user
"""
__tablename__ = 'Users'
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
username = db.Column(db.String(20), unique... | mit |
noba3/KoTos | addons/plugin.video.lovefilm_com/default.py | 2 | 10029 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib
import urllib2
import socket
import re
import sys
import xbmcplugin
import xbmcaddon
import xbmcgui
import subprocess
socket.setdefaulttimeout(30)
pluginhandle = int(sys.argv[1])
addonId = 'plugin.video.lovefilm_com'
addon = xbmcaddon.Addon(id=addonId)
translatio... | gpl-2.0 |
alexanderturner/ansible | lib/ansible/plugins/callback/__init__.py | 10 | 13953 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# 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) an... | gpl-3.0 |
lizardsystem/lizard-waterbalance | lizard_wbcomputation/mock_time_series_reader.py | 1 | 1643 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# pylint: disable=C0111
# The lizard_wbcomputation package implements the computational core of the
# lizard waterbalance Django app.
#
# Copyright (C) 2012 Nelen & Schuurmans
#
# This package is free software: you can redistribute it and/or modify it under
# the terms of the... | gpl-3.0 |
CSGreater-Developers/HMC-Grader | app/userViews/common/feedback.py | 2 | 1399 | # coding=utf-8
'''
This module handles the comments page
'''
#Import the app
from app import app
#Import needed flask functions
from flask import g, render_template, redirect, url_for, flash, jsonify, abort
from flask import request, after_this_request, send_file
from flask.ext.login import current_user, login_requi... | mit |
waneric/PyMapLib | src/gabbs/gui/DlgLayerStyle.py | 1 | 3714 | # -*- coding: utf-8 -*-
"""
Overlay.py - overlay file for geohub maps
======================================================================
AUTHOR: Wei Wan, Purdue University
EMAIL: rcac-help@purdue.edu
Copyright (c) 2016 Purdue University
See the file "license.terms" for information on usage and
redistribu... | mit |
fredrikhl/advanced-shell-history | python/advanced_shell_history/unix.py | 10 | 3742 | #!/usr/bin/python
#
# Copyright 2012 Carl Anderson
#
# 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 ... | apache-2.0 |
kerr-huang/SL4A | python/src/Lib/test/test_pickle.py | 58 | 1775 | import pickle
from cStringIO import StringIO
from test import test_support
from test.pickletester import AbstractPickleTests
from test.pickletester import AbstractPickleModuleTests
from test.pickletester import AbstractPersistentPicklerTests
class PickleTests(AbstractPickleTests, AbstractPickleModuleTests):
def... | apache-2.0 |
thomasmesnard/DeepMind-Teaching-Machines-to-Read-and-Comprehend | data.py | 1 | 6723 | import logging
import random
import numpy
import cPickle
from picklable_itertools import iter_
from fuel.datasets import Dataset
from fuel.streams import DataStream
from fuel.schemes import IterationScheme, ConstantScheme
from fuel.transformers import Batch, Mapping, SortMapping, Unpack, Padding, Transformer
import... | mit |
FireBladeNooT/Medusa_1_6 | lib/sqlalchemy/sql/selectable.py | 27 | 118995 | # sql/selectable.py
# Copyright (C) 2005-2016 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 :class:`.FromClause` class of SQL expression elements, representing
SQL tab... | gpl-3.0 |
KaranToor/MA450 | google-cloud-sdk/lib/third_party/dns/namedict.py | 248 | 2107 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
johnhw/sqlexperiment | explogger/report.py | 1 | 5305 | import time
import sqlite3
import json
# import cStringIO
import io
def pretty_json(x):
return (u"\n"+json.dumps(x, sort_keys=True, indent=4, separators=(',', ': '))+"\n").replace(u"\n", "\n ")
def string_report(cursor):
# c = cStringIO.StringIO()
# c = io.BytesIO()
c = io.StringIO()
mak... | mit |
tlakshman26/cinder-https-changes | cinder/tests/unit/backup/fake_swift_client.py | 34 | 4017 | # Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# 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/LICEN... | apache-2.0 |
herberthudson/pynance | pynance/opt/price.py | 2 | 7070 | """
.. Copyright (c) 2014, 2015 Marshall Farrier
license http://opensource.org/licenses/MIT
Options - price (:mod:`pynance.opt.price`)
==================================================
.. currentmodule:: pynance.opt.price
"""
from __future__ import absolute_import
import pandas as pd
from ._common import _getp... | mit |
reingart/gestionlibre.gui | languages/fr-fr.py | 16 | 3825 | # coding: utf8
{
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN',
'%Y-%m-%d': '%Y-%m-%d',
'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S',
'%s r... | agpl-3.0 |
CMLL/taiga-back | tests/integration/test_vote_userstories.py | 7 | 4331 | # Copyright (C) 2015 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2015 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2015 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2015 Anler Hernández <hello@anler.me>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
wesleybowman/karsten | turbine_array/UTide/plotTest.py | 1 | 2694 | import netCDF4 as nc
import matplotlib.pyplot as plt
import matplotlib.tri as Tri
import matplotlib.ticker as ticker
#from mpl_toolkits.basemap import Basemap
import numpy as np
import cPickle as pickle
import seaborn
import time
filename = '/home/wesley/github/aidan-projects/grid/dngrid_0001.nc'
data = nc.Dataset(fil... | mit |
cshallue/models | research/maskgan/model_utils/model_losses.py | 5 | 12962 | # 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 applicab... | apache-2.0 |
webmasterraj/GaSiProMo | flask/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py | 42 | 26953 | # postgresql/psycopg2.py
# Copyright (C) 2005-2015 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
"""
.. dialect:: postgresql+psycopg2
:name: psycopg2
:dbapi: psycopg2... | gpl-2.0 |
yuruofeifei/mxnet | python/mxnet/gluon/data/dataloader.py | 8 | 8412 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
xchenum/quantum-bug | quantum/openstack/common/rpc/common.py | 2 | 11592 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not... | apache-2.0 |
beni55/django | tests/generic_relations_regress/models.py | 99 | 5515 | from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.deletion import ProtectedError
from django.utils.encoding import python_2_unicode_compatible
__all__ = ('Link', 'Place... | bsd-3-clause |
aarpon/obit_microscopy_core_technology | core-plugins/microscopy/4/dss/drop-boxes/MicroscopyDropbox/MicroscopyCompositeDatasetConfig.py | 4 | 2252 | # -*- coding: utf-8 -*-
"""
Created on Feb 20, 2014
@author: Aaron Ponti
"""
from ch.systemsx.cisd.openbis.dss.etl.dto.api import SimpleImageContainerDataConfig
class MicroscopyCompositeDatasetConfig(SimpleImageContainerDataConfig):
"""Image data configuration class for composite image files."""
def creat... | apache-2.0 |
pawelmhm/scrapy | tests/test_exporters.py | 3 | 21598 | import re
import json
import marshal
import pickle
import tempfile
import unittest
from io import BytesIO
from datetime import datetime
from warnings import catch_warnings, filterwarnings
import lxml.etree
from itemadapter import ItemAdapter
from scrapy.item import Item, Field
from scrapy.utils.python import to_unico... | bsd-3-clause |
wangyou/XX-Net | code/default/python27/1.0/lib/win32/cryptography/hazmat/backends/openssl/dsa.py | 22 | 8353 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
from cryptography import utils
from cryptography.exceptions import Invali... | bsd-2-clause |
imtapps/django-imt-fork | django/db/models/manager.py | 104 | 9496 | import copy
from django.db import router
from django.db.models.query import QuerySet, EmptyQuerySet, insert_query, RawQuerySet
from django.db.models import signals
from django.db.models.fields import FieldDoesNotExist
def ensure_default_manager(sender, **kwargs):
"""
Ensures that a Model subclass contains a d... | bsd-3-clause |
artemsok/sockeye | sockeye/score.py | 1 | 7448 | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | apache-2.0 |
Mariaanisimova/pythonintask | INBa/2014/MOCHALOV_V_V/task_7_15.py | 2 | 1111 | # -*- coding: UTF-8 -*-
# Задача 7. Вариант 15.
#
# Разработайте систему начисления очков для задачи 6, в соответствии с которой игрок получал бы большее количество баллов за меньшее количество попыток.
# Mochalov V. V.
# 04.04.2016
import random
k=12
x=random.randint(1, 12)
while True:
y=input("Введ... | apache-2.0 |
CCI-MOC/nova | nova/tests/functional/wsgi/test_secgroup.py | 16 | 3531 | # Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# 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 ... | apache-2.0 |
madisonflaherty/Food | oldTests/test.py | 1 | 1136 | """
Test for POOPS. Basic Parcing practice.
"""
from html.parser import HTMLParser
from urllib import request
def openFile():
"""Simply takes testfile and makes it into one large string
Returns a list that represents all of the source html code of
a webpage.
"""
#with open( "TestPage.html") as myfile:
# data = ... | mit |
whn09/tensorflow | tensorflow/python/ops/batch_norm_benchmark.py | 76 | 10818 | # Copyright 2015 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... | apache-2.0 |
lmregus/Portfolio | python/design_patterns/env/lib/python3.7/site-packages/babel/localtime/_unix.py | 5 | 4801 | # -*- coding: utf-8 -*-
from __future__ import with_statement
import os
import re
import sys
import pytz
import subprocess
_systemconfig_tz = re.compile(r'^Time Zone: (.*)$', re.MULTILINE)
def _tz_from_env(tzenv):
if tzenv[0] == ':':
tzenv = tzenv[1:]
# TZ specifies a file
if os.path.exists(tzen... | mit |
AdrielVelazquez/Moto_XT1058 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
npe9/binutils-gdb | gdb/testsuite/gdb.python/py-events.py | 46 | 4480 | # Copyright (C) 2010-2015 Free Software Foundation, Inc.
# 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 version.
#
# This progr... | gpl-2.0 |
Stevearzh/pyIRCbot | function/jieba/posseg/__init__.py | 2 | 7209 | import re
import os
from . import viterbi
import jieba
import sys
import marshal
from functools import wraps
default_encoding = sys.getfilesystemencoding()
PROB_START_P = "prob_start.p"
PROB_TRANS_P = "prob_trans.p"
PROB_EMIT_P = "prob_emit.p"
CHAR_STATE_TAB_P = "char_state_tab.p"
def load_model(f_name, isJython=Tru... | mit |
cobbr/ObfuscatedEmpire | lib/stagers/osx/macro.py | 11 | 3670 | from lib.common import helpers
import re
class Stager:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'AppleScript',
'Author': ['@harmj0y'],
'Description': ('An OSX office macro.'),
'Comments': [
"http://stackoverflow.com/... | bsd-3-clause |
liangazhou/django-rdp | packages/Django-1.8.6/tests/migrations/test_loader.py | 7 | 13341 | from __future__ import unicode_literals
from unittest import skipIf
from django.db import connection, connections
from django.db.migrations.graph import NodeNotFoundError
from django.db.migrations.loader import AmbiguityError, MigrationLoader
from django.db.migrations.recorder import MigrationRecorder
from django.tes... | apache-2.0 |
jtg-gg/blink | LayoutTests/http/tests/websocket/protocol-test_wsh.py | 108 | 1907 | # Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use 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 the ... | bsd-3-clause |
aerophile/django | tests/serializers/models.py | 27 | 3142 | # -*- coding: utf-8 -*-
"""
Serialization
``django.core.serializers`` provides interfaces to converting Django
``QuerySet`` objects to and from "flat" data (i.e. strings).
"""
from __future__ import unicode_literals
from decimal import Decimal
from django.db import models
from django.utils import six
from django.uti... | bsd-3-clause |
MarcosCommunity/odoo | comunity_modules/tko_partner_multiple_phones/tko_partner_phones.py | 5 | 2618 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# ThinkOpen Solutions Brasil
# Copyright (C) Thinkopen Solutions <http://www.tkobr.com>.
#
# This... | agpl-3.0 |
EFord36/normalise | normalise/data/timezones.py | 1 | 9998 | # -*- coding: utf-8 -*-
timezone_dict = {
"ACDT": "Australian Central Daylight Time",
"ACST": "Australian Central Standard Time",
"ACWT": "Australian Central Western Time",
"ADT": "Atlantic Daylight Time",
"ACT": "Acre Time",
... | gpl-3.0 |
jtopjian/st2 | st2common/st2common/services/coordination.py | 2 | 1686 | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | apache-2.0 |
vaginessa/Windows-Exploit-Suggester | windows-exploit-suggester.py | 1 | 51784 | #!/usr/bin/env python
#
# Windows Exploit Suggester
# revision 2.3, 2014-01-26
#
# author: Sam Bertram, Gotham Digital Science
# contact: labs@gdssecurity.com,sbertram@gdssecurity.com,sammbertram@gmail.com
# blog post: "Introducing Windows Exploit Suggester", http://blog.gdssecurity.com/
#
# DESCRIPTION
#
# This tool... | gpl-3.0 |
TNT-Samuel/Coding-Projects | DNS Server/Source - Copy/Lib/site-packages/winpython/associate.py | 6 | 8668 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see winpython/__init__.py for details)
"""
Register a Python distribution
Created on Tue Aug 21 21:46:30 2012
"""
from __future__ import print_function
import sys
import os
import os.path as osp
import subpr... | gpl-3.0 |
sulantha2006/Processing_Pipeline | Test/MatchAV45andFDG/MatchAV45.py | 1 | 1932 | from datetime import datetime
import sys
sys.path.append('/home/sulantha/PycharmProjects/Processing_Pipeline')
from Utils.DbUtils import DbUtils
import glob
import itertools
import argparse
parser = argparse.ArgumentParser(description='Match FDG to AV45. ')
parser.add_argument('--csv', nargs=1, required=True,
... | apache-2.0 |
drpngx/tensorflow | tensorflow/contrib/boosted_trees/lib/learner/batch/categorical_split_handler_test.py | 8 | 18205 | # 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... | apache-2.0 |
valexandersaulys/airbnb_kaggle_contest | venv/lib/python3.4/site-packages/sklearn/linear_model/tests/test_passive_aggressive.py | 169 | 8809 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_array_almost_equal, assert_array_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_rais... | gpl-2.0 |
deployed/django | django/conf/locale/nb/formats.py | 197 | 1766 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATET... | bsd-3-clause |
opensignal/airflow | airflow/contrib/example_dags/example_qubole_operator.py | 5 | 4549 | from airflow import DAG
from airflow.operators import DummyOperator, PythonOperator, BranchPythonOperator
from airflow.contrib.operators import QuboleOperator
from datetime import datetime, timedelta
import filecmp
import random
seven_days_ago = datetime.combine(datetime.today() - timedelta(7),
... | apache-2.0 |
pombredanne/importmagic | importmagic/util.py | 2 | 2279 | import ast
import re
import sys
from ast import AST, iter_fields
from importmagic.six import text_type
CODING_COOKIE_RE = re.compile('(^\s*#.*)coding[:=]', re.M)
def parse_ast(source, filename=None):
"""Parse source into a Python AST, taking care of encoding."""
if isinstance(source, text_type) and sys.ver... | bsd-2-clause |
shibdib/Dramiel | src/twisted/mod/evewho.py | 5 | 2068 | #!/usr/bin/env python
from __future__ import print_function
import urllib
import re
import requests
import eveapi
import arrow
from collections import defaultdict
colours = defaultdict(str)
colours.update({
"NORMAL": u"\u000f",
"RED": u"\u000304",
"GREEN": u"\u000309",
"YELLOW": u"\u000308",
"ORANGE": u"\u00037"... | mit |
yeasy/tripled | setup.py | 1 | 1605 | #!/usr/bin/env python
"""Setuptools params"""
from setuptools import setup, find_packages
from os.path import join
# Get version number from source tree
import sys
sys.path.append('.')
from tripled.common.constants import VERSION
scripts = [join('bin', filename) for filename in ['tripled']]
modname = distname = '... | apache-2.0 |
mrgloom/essentia | src/examples/python/streaming_extractor/level.py | 10 | 4852 | # Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 (FSF), either version 3 of the ... | agpl-3.0 |
luogangyi/Ceilometer-oVirt | ceilometer/hardware/pollsters/network_aggregated.py | 11 | 1436 | # 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... | apache-2.0 |
dims/nova | nova/tests/unit/fake_block_device.py | 11 | 2184 | # Copyright 2013 Red Hat Inc.
# 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 ... | apache-2.0 |
google-research/electra | finetune/qa/squad_official_eval.py | 1 | 12022 | # coding=utf-8
# Copyright 2020 The Google Research 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 applicab... | apache-2.0 |
mtagle/airflow | tests/providers/amazon/aws/hooks/conftest.py | 11 | 1123 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
tensorflow/tensorflow | tensorflow/compiler/tests/extract_image_patches_op_test.py | 25 | 4754 | # Copyright 2018 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... | apache-2.0 |
CingHu/neutron-ustack | neutron/plugins/vmware/extensions/servicerouter.py | 19 | 1704 | # Copyright 2013 VMware, Inc. 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 a... | apache-2.0 |
NickPresta/sentry | src/sentry/migrations/0003_auto__add_field_message_group__del_field_groupedmessage_server_name.py | 14 | 4167 | # encoding: 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 field 'Message.group'
db.add_column('sentry_message', 'group', self.gf('django.db.models.fields.r... | bsd-3-clause |
gkhanna79/coreclr | src/ToolBox/SOS/tests/t_cmd_bpmd_module_function.py | 43 | 1287 | import lldb
import re
import testutils as test
# bpmd <module name> <managed function name>
def runScenario(assembly, debugger, target):
process = target.GetProcess()
res = lldb.SBCommandReturnObject()
ci = debugger.GetCommandInterpreter()
# Run debugger, wait until libcoreclr is loaded,
# set b... | mit |
samarthmed/emacs-config | .python-environments/default/lib/python2.7/site-packages/setuptools/tests/test_develop.py | 148 | 2816 | """develop tests
"""
import os
import shutil
import site
import sys
import tempfile
from setuptools.command.develop import develop
from setuptools.dist import Distribution
SETUP_PY = """\
from setuptools import setup
setup(name='foo',
packages=['foo'],
use_2to3=True,
)
"""
INIT_PY = """print "foo"
"""
clas... | gpl-2.0 |
Lyleo/OmniMarkupPreviewer | OmniMarkupLib/Renderers/libs/pygments/lexers/d.py | 72 | 9530 | # -*- coding: utf-8 -*-
"""
pygments.lexers.d
~~~~~~~~~~~~~~~~~
Lexers for D languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, words
from pygments.token import Text, Comment, Ke... | mit |
codificat/sos | sos/plugins/kdump.py | 5 | 1508 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but... | gpl-2.0 |
pombredanne/numba | numba/tests/usecases.py | 5 | 2270 | import math
import numpy as np
from numba import jit
def sum1d(s, e):
c = 0
for i in range(s, e):
c += i
return c
def sum2d(s, e):
c = 0
for i in range(s, e):
for j in range(s, e):
c += i * j
return c
def while_count(s, e):
i = s
c = 0
while i < e:
... | bsd-2-clause |
hermes-jr/npui | netprofile_xop/setup.py | 3 | 1938 | import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README_LOCAL = open(os.path.join(here, 'README.rst')).read()
README_GLOBAL = open(os.path.join(here, 'README-NP.rst')).read()
requires = [
'setuptools',
'netprofile_stashes >= 0.3'
]
setup(
name='netprofile_xo... | agpl-3.0 |
sgraham/nope | third_party/webdriver/pylib/selenium/webdriver/remote/utils.py | 37 | 3643 | # Copyright 2008-2009 WebDriver committers
# Copyright 2008-2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | bsd-3-clause |
campagnola/acq4 | acq4/pyqtgraph/util/cprint.py | 38 | 3028 | """
Cross-platform color text printing
Based on colorama (see pyqtgraph/util/colorama/README.txt)
"""
import sys, re
from .colorama.winterm import WinTerm, WinColor, WinStyle
from .colorama.win32 import windll
from ..python2_3 import basestring
_WIN = sys.platform.startswith('win')
if windll is not None:
winterm... | mit |
Antiun/stock-logistics-workflow | stock_no_negative/models/product_template.py | 12 | 1275 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2015 Vauxoo
# Author: Luis Torres, Osval Reyes
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# p... | agpl-3.0 |
SpandanKumarSahu/python-crush | tests/test_compare.py | 1 | 12503 | # -*- mode: python; coding: utf-8 -*-
#
# Copyright (C) 2017 <contact@redhat.com>
#
# Author: Loic Dachary <loic@dachary.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, either version 3 o... | gpl-3.0 |
mahak/cinder | cinder/tests/unit/volume/drivers/dell_emc/powerstore/test_volume_create_delete_extend.py | 2 | 7106 | # Copyright (c) 2020 Dell Inc. or its subsidiaries.
# 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 requi... | apache-2.0 |
TOCyna/tabelinha | flask/lib/python2.7/site-packages/sqlalchemy/sql/visitors.py | 21 | 9943 | # sql/visitors.py
# Copyright (C) 2005-2015 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
"""Visitor/traversal interface and library functions.
SQLAlchemy schema and express... | gpl-2.0 |
akloster/bokeh | bokeh/server/models/__init__.py | 29 | 1151 | from __future__ import absolute_import
from bokeh.exceptions import DataIntegrityException
class UnauthorizedException(Exception):
pass
class ServerModel(object):
idfield = None
typename = None
@classmethod
def modelkey(cls, objid):
return "model:%s:%s"% (cls.typename, objid)
def my... | bsd-3-clause |
jgao54/airflow | tests/contrib/sensors/test_emr_job_flow_sensor.py | 7 | 4514 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
mcnowinski/various-and-sundry | seo/bin/fixpoint.py | 1 | 6231 | import os
import glob
import math
import subprocess
import re
import sys
from decimal import Decimal
import datetime
import getpass
##gain access to local astropy module
#sys.path.append('/home/mcnowinski/astropy/lib/python2.7/site-packages/astropy-1.2.1-py2.7-linux-x86_64.egg')
from astropy.io import fits
from astropy... | mit |
ArabellaTech/ydcommon | ydcommon/management/commands/jshint.py | 1 | 2594 | import sys
from django.conf import settings
from django.core.management.base import BaseCommand
from ydcommon.settings import JSHINT_FILES_FIND
try:
import subprocess
import commands
except ImportError:
pass
class Command(BaseCommand):
help = 'Render JSHint'
def add_arguments(self, parser):
... | mit |
WING-NUS/WING-LDA | wang-kan/vocabulary.py | 1 | 1782 | #!/usr/bin/python
'''
Created on 10 Oct, 2013
@author: Aobo Wang
'''
class Vocabulary:
'''
Attrbutes:
docsList: A list of docs where each item is a list of words from a doc
wordList: The full list of unique words. The indexs of words are kept in word_idDict
word_idDict: The dictionary holds <word:id> ent... | mit |
dwillmer/numpy | numpy/core/__init__.py | 36 | 2999 | from __future__ import division, absolute_import, print_function
from .info import __doc__
from numpy.version import version as __version__
# disables OpenBLAS affinity setting of the main thread that limits
# python threads or processes to one core
import os
env_added = []
for envkey in ['OPENBLAS_MAIN_FREE', 'GOTOB... | bsd-3-clause |
ebukoz/thrive | erpnext/hr/doctype/salary_structure/test_salary_structure.py | 6 | 5971 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
import erpnext
from frappe.utils.make_random import get_random
from frappe.utils import nowdate, add_days, add_years, getdate, add_months
from er... | gpl-3.0 |
google-research/google-research | fisher_brc/critic.py | 1 | 3145 | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | apache-2.0 |
Ayub-Khan/edx-platform | cms/djangoapps/course_creators/views.py | 230 | 3176 | """
Methods for interacting programmatically with the user creator table.
"""
from course_creators.models import CourseCreator
from student.roles import CourseCreatorRole
from student import auth
def add_user_with_status_unrequested(user):
"""
Adds a user to the course creator table with status 'unrequested'.... | agpl-3.0 |
WillieMaddox/numpy | numpy/ma/tests/test_regression.py | 113 | 2470 | from __future__ import division, absolute_import, print_function
import warnings
import numpy as np
from numpy.testing import (assert_, TestCase, assert_array_equal,
assert_allclose, run_module_suite)
from numpy.compat import sixu
rlevel = 1
class TestRegression(TestCase):
def test_m... | bsd-3-clause |
40223112/w16test | static/Brython3.1.1-20150328-091302/Lib/pprint.py | 634 | 12757 | # Author: Fred L. Drake, Jr.
# fdrake@acm.org
#
# This is a simple little module I wrote to make life easier. I didn't
# see anything quite like it in the library, though I may have overlooked
# something. I wrote this when I was trying to read some heavily nested
# tuples with fairly non-desc... | agpl-3.0 |
JAOSP/aosp_platform_external_chromium_org | chrome/test/webdriver/test/test_paths.py | 42 | 3248 | # 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.
import os
import platform
import sys
import util
def GetTestDataPath(relative_path):
"""Returns the path to the given path under chromedriver's test... | bsd-3-clause |
Atos-FiwareOps/sla-dashboard | slagui/urls.py | 2 | 2355 | from django.conf.urls import patterns, url
from slagui import views
#handler403 = 'views.forbidden'
urlpatterns = patterns('',
# eg: /$slaroot/
#url(r'^$', views.index, name='index'),
#url(r'^(?P<is_provider>provider/)?agreements[/]$',
# views.agreements_summary, name='agreements_summary'),
url(r'^callbackIdm$', ... | apache-2.0 |
tensorflow/ranking | tensorflow_ranking/examples/tf_ranking_canned_dnn.py | 1 | 5534 | # Copyright 2021 The TensorFlow Ranking 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 ag... | apache-2.0 |
google-code/android-scripting | python/src/Demo/tkinter/matt/dialog-box.py | 47 | 2440 | from Tkinter import *
from Dialog import Dialog
# this shows how to create a new window with a button in it
# that can create new windows
class Test(Frame):
def printit(self):
print "hi"
def makeWindow(self):
"""Create a top-level dialog with some buttons.
This uses the Dialog class,... | apache-2.0 |
muslih/alfanous | src/alfanous-import/setup.py | 2 | 1237 | #!/usr/bin/env python2
#coding=utf-8
"""
TODO include the main database as a package data
"""
from setuptools import setup
setup(
name = "Qimport",
description = "Importing system for quranic indexes",
version = 0.1,
platforms = "ALL",
license = "AGPL",
packages = ["Qimport"],
install_requires = ["whoosh"... | agpl-3.0 |
kived/kivy | kivy/uix/settings.py | 9 | 42255 | '''
Settings
========
.. versionadded:: 1.0.7
This module provides a complete and extensible framework for adding a
Settings interface to your application. By default, the interface uses
a :class:`SettingsWithSpinner`, which consists of a
:class:`~kivy.uix.spinner.Spinner` (top) to switch between individual
settings ... | mit |
DailyActie/Surrogate-Model | 01-codes/scikit-learn-master/sklearn/covariance/graph_lasso_.py | 1 | 26429 | """GraphLasso: sparse inverse covariance estimation with an l1-penalized
estimator.
"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
# Copyright: INRIA
import collections
import operator
import sys
import time
import warnings
import numpy as np
from scipy import linalg
from .empir... | mit |
GuessWhoSamFoo/pandas | pandas/core/internals/blocks.py | 1 | 114866 | # -*- coding: utf-8 -*-
from datetime import date, datetime, timedelta
import functools
import inspect
import re
import warnings
import numpy as np
from pandas._libs import internals as libinternals, lib, tslib, tslibs
from pandas._libs.tslibs import Timedelta, conversion, is_null_datetimelike
import pandas.compat as... | bsd-3-clause |
mppmu/secdec | examples/triangle2L_split/integrate_triangle2L_split.py | 1 | 2168 | from __future__ import print_function
from pySecDec.integral_interface import IntegralLibrary
import sympy as sp
# load c++ library
triangle2L_split = IntegralLibrary('triangle2L_split/triangle2L_split_pylink.so')
# choose integrator
triangle2L_split.use_Divonne(epsrel=1e-5,epsabs=1e-5,maxeval=10**7,border=1e-8,flags... | gpl-3.0 |
simonwydooghe/ansible | test/integration/targets/azure_rm_keyvault/lookup_plugins/azure_service_principal_attribute.py | 84 | 3519 | # (c) 2018 Yunge Zhu, <yungez@microsoft.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
lookup: azure_service_principal_attribute
req... | gpl-3.0 |
ESSolutions/ESSArch_Core | ESSArch_Core/WorkflowEngine/migrations/0053_remove_processstep_waitforparams.py | 1 | 1262 | """
ESSArch is an open source archiving and digital preservation system
ESSArch
Copyright (C) 2005-2019 ES Solutions AB
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... | gpl-3.0 |
KellyChan/python-examples | python/pygame/painter/brush.py | 3 | 2630 | import os
BASE_DIR = os.path.dirname(__file__)
import math
import pygame
class Brush():
def __init__(self, screen):
self.screen = screen
self.color = (0, 0, 0)
self.size = 1
self.drawing = False
self.last_pos = None
self.space = 1
# style
# - True... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.