repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
pexip/os-django-auth-ldap | django_auth_ldap/backend.py | 2 | 29666 | # Copyright (c) 2009, Peter Sagerson
# 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-2-clause |
poojavade/Genomics_Docker | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/ipython-2.2.0-py2.7.egg/IPython/testing/iptestcontroller.py | 7 | 21202 | # -*- coding: utf-8 -*-
"""IPython Test Process Controller
This module runs one or more subprocesses which will actually run the IPython
test suite.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2009-2011 The IPython Development Team
#
# Distributed under the t... | apache-2.0 |
mindcandy/thrift | test/py/TestClient.py | 36 | 8786 | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | apache-2.0 |
graingert/aiohttp_session | setup.py | 2 | 1582 | import codecs
from setuptools import setup, find_packages
import os
import re
with codecs.open(os.path.join(os.path.abspath(os.path.dirname(
__file__)), 'aiohttp_session', '__init__.py'), 'r', 'latin1') as fp:
try:
version = re.findall(r"^__version__ = '([^']+)'$", fp.read(), re.M)[0]
except I... | apache-2.0 |
effigies/mne-python | mne/minimum_norm/tests/test_psf_ctf.py | 1 | 3160 |
import os.path as op
import mne
from mne.datasets import testing
from mne import read_forward_solution, pick_types_forward
from mne.minimum_norm import (read_inverse_operator,
point_spread_function, cross_talk_function)
from nose.tools import assert_true
data_path = op.join(testing.data... | bsd-3-clause |
CopeX/odoo | openerp/addons/test_inherits/tests/test_inherits.py | 266 | 1066 | # -*- coding: utf-8 -*-
from openerp.tests import common
class test_inherits(common.TransactionCase):
def test_create_3_levels_inherits(self):
""" Check that we can create an inherits on 3 levels """
pallet = self.env['test.pallet'].create({
'name': 'B',
'field_in_box': 'b... | agpl-3.0 |
dulems/hue | desktop/core/ext-py/pytidylib-0.2.1/setup.py | 38 | 3296 | # Copyright 2009 Jason Stitt
#
# 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, publish, distribute... | apache-2.0 |
ischeinfeld/py_nlp | tests_deprecated/test.py | 1 | 1056 | """Tests examples of the parameters q and e"""
from preprocessing import import_wsj, replace_rarities
from parameters import sx_counts, uvs_counts, uv_counts, s_counts, q, e
sentences = import_wsj("train")
#print(sentences[0])
new_sentences = replace_rarities(sentences)
#print(new_sentences[0])
sx_counts = sx_count... | mit |
petewarden/tensorflow | third_party/gpus/compress_find_rocm_config.py | 10 | 1172 | # Copyright 2020 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 |
Alwnikrotikz/marinemap | example_projects/mm3demo/settings.py | 3 | 1113 | # Django settings for oregon project.
from lingcod.common.default_settings import *
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'demo',
'USER': 'postgres',
}
}
TIME_ZONE = 'America/Vancou... | bsd-3-clause |
maelnor/nova | nova/conductor/tasks/live_migrate.py | 14 | 8059 | # 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
# d... | apache-2.0 |
rifotu/ipv6_trials | gpsd/gpsd_src/gpscap.py | 1 | 8725 | """
gpscap - GPS/AIS capability dictionary class.
This file is Copyright (c) 2010 by the GPSD project
BSD terms apply: see the file COPYING in the distribution root for details.
"""
import ConfigParser
class GPSDictionary(ConfigParser.RawConfigParser):
def __init__(self, *files):
"Initialize the capabili... | mit |
zuck/prometeo-erp | core/filebrowser/signals.py | 3 | 1772 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This file is part of the prometeo project.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option... | lgpl-3.0 |
sander76/home-assistant | homeassistant/components/philips_js/__init__.py | 3 | 5069 | """The Philips TV integration."""
from __future__ import annotations
import asyncio
from datetime import timedelta
import logging
from typing import Any, Callable
from haphilipsjs import ConnectionFailure, PhilipsTV
from homeassistant.components.automation import AutomationActionType
from homeassistant.config_entrie... | apache-2.0 |
omni5cience/django-inlineformfield | .tox/py27/lib/python2.7/site-packages/django/contrib/admindocs/views.py | 9 | 15550 | from importlib import import_module
import inspect
import os
import re
import warnings
from django import template
from django.apps import apps
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.views.decorators import staff_member_required
from django.db import models
from dja... | mit |
achang97/YouTunes | lib/python2.7/site-packages/youtube_dl/extractor/nowness.py | 54 | 6024 | # coding: utf-8
from __future__ import unicode_literals
from .brightcove import (
BrightcoveLegacyIE,
BrightcoveNewIE,
)
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
sanitized_Request,
)
class NownessBaseIE(InfoExtractor):
def _extract_ur... | mit |
yiwen-luo/LeetCode | Python/word-ladder.py | 1 | 1785 | # Time: O(n * d), n is length of string, d is size of dictionary
# Space: O(d)
#
# Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:
#
# Only one letter can be changed at a time
# Each intermediate word must exist in the dictionary
# F... | mit |
cewood/ansible-modules-core | cloud/docker/docker_login.py | 39 | 9349 | #!/usr/bin/python
#
# (c) 2016 Olaf Kilian <olaf.kilian@symanex.com>
# Chris Houseknecht, <house@redhat.com>
# James Tanner, <jtanner@redhat.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 ... | gpl-3.0 |
ARPASMR/IRIS_lombardia | html/GXM-0.1/tools/BeautifulSoup.py | 307 | 69566 | """Beautiful Soup
Elixir and Tonic
"The Screen-Scraper's Friend"
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup parses a (possibly invalid) XML or HTML document into a
tree representation. It provides methods and Pythonic idioms that make
it easy to navigate, search, and modify the tree.
A well-formed X... | gpl-3.0 |
arantebillywilson/python-snippets | py2/htp/ch10/fig10_09.py | 2 | 1896 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# fig10_09.py
# Radiobuttons demonstration.
#
# Author: Billy Wilson Arante
# Created: 2016/10/17 EDT (America/New York)
#
# Attribution: Python How to Program, 1st Ed. by Deitel & Deitel
from Tkinter import *
class RadioFont(Frame):
"""An area of text with Radiobutt... | mit |
sfagmenos/ker | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
ntduong/ML | Twitter-Analysis/top_ten.py | 1 | 1032 | '''
Created on May 6, 2013
@author: Administrator
'''
import json
import sys
from collections import defaultdict
def parseTweets(tweet_file='tweets.txt'):
parsed_tweets = []
with open(tweet_file, 'r') as fin:
for line in fin:
tweet = json.loads(line)
if 'text' in tweet:
... | mit |
kursitet/edx-ora2 | openassessment/xblock/test/test_message.py | 7 | 29377 | # -*- coding: utf-8 -*-
"""
Tests for message handlers in Open Assessment XBlock.
"""
import copy
import mock
import pytz
import datetime as dt
from openassessment.xblock.openassessmentblock import OpenAssessmentBlock
from .base import XBlockHandlerTestCase, scenario
class TestMessageRender(XBlockHandlerTestCase):... | agpl-3.0 |
BT-rmartin/odoo | addons/hr_payroll/__init__.py | 433 | 1137 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it ... | agpl-3.0 |
xpoft/babel | babel/messages/tests/mofile.py | 2 | 3421 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists... | bsd-3-clause |
epssy/hue | desktop/core/src/desktop/migrations/0011_auto__chg_field_document2_uuid.py | 35 | 8668 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Document2.uuid'
db.alter_column(u'desktop_document2', ... | apache-2.0 |
dhoffman34/django | django/contrib/sessions/middleware.py | 44 | 2589 | from importlib import import_module
import time
from django.conf import settings
from django.utils.cache import patch_vary_headers
from django.utils.http import cookie_date
class SessionMiddleware(object):
def __init__(self):
engine = import_module(settings.SESSION_ENGINE)
self.SessionStore = eng... | bsd-3-clause |
mbauskar/phrerp | erpnext/support/doctype/support_email_settings/support_email_settings.py | 36 | 1438 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cint
from frappe.model.document import Document
from frappe.utils... | agpl-3.0 |
Reuben-Thorpe/Code.Eval | code.eval/01-hard/as_quick_as_a_flash/as.quick.as.a.flash.py | 1 | 1235 | # Reuben Thorpe (2016), CodeEval [As Quick As A Flash v1.0]
from sys import argv
def swap(seq, x, y):
seq[x], seq[y] = seq[y], seq[x]
def q_sort_pivots(seq, begin, end):
"""
Code Evals implimentation of the quick sort algorithm, returns the
number of pivots enacted during a complete sort.
... | gpl-3.0 |
migueldsw/TL-DA-TF | NETWORKS/vgg.py | 1 | 10291 | # from tflearn examples: https://github.com/tflearn/tflearn/blob/master/examples/images/vgg_network.py
""" Very Deep Convolutional Networks for Large-Scale Visual Recognition.
Applying VGG 11 and 16-layers convolutional network to MNIST and SVHN
Dataset classification task. 28x28x3 shape
References:
Very Deep Conv... | apache-2.0 |
pprett/scikit-learn | sklearn/neural_network/rbm.py | 46 | 12291 | """Restricted Boltzmann Machine
"""
# Authors: Yann N. Dauphin <dauphiya@iro.umontreal.ca>
# Vlad Niculae
# Gabriel Synnaeve
# Lars Buitinck
# License: BSD 3 clause
import time
import numpy as np
import scipy.sparse as sp
from ..base import BaseEstimator
from ..base import TransformerMixi... | bsd-3-clause |
danny88br/cjdns | node_build/dependencies/libuv/build/gyp/test/cflags/gyptest-cflags.py | 120 | 2628 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""
Verifies build of an executable with C++ define specified by a gyp define, and
the use of the environment during regeneration when the g... | gpl-3.0 |
nburn42/tensorflow | tensorflow/contrib/autograph/pyct/inspect_utils.py | 17 | 5497 | # 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 |
fnordahl/nova | nova/openstack/common/policy.py | 32 | 31030 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2012 OpenStack Foundation.
# 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... | apache-2.0 |
andeplane/lammps | tools/i-pi/ipi/inputs/ensembles.py | 41 | 8167 | """Deals with creating the ensembles class.
Copyright (C) 2013, Joshua More and Michele Ceriotti
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) ... | gpl-2.0 |
ghber/My-Django-Nonrel | django/test/simple.py | 150 | 15012 | import unittest as real_unittest
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models import get_app, get_apps
from django.test import _doctest as doctest
from django.test.utils import setup_test_environment, teardown_test_environment
from django.test.testcases ... | bsd-3-clause |
151706061/ITK | Examples/DataRepresentation/Image/ImageToArray.py | 32 | 1257 | #==========================================================================
#
# Copyright Insight Software Consortium
#
# 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... | apache-2.0 |
AlphaX2/FotoShareN9 | 0.9.7/fotoshare_deb/opt/FotoShareN9/simplejson/tests/test_namedtuple.py | 69 | 3956 | import unittest
import simplejson as json
from StringIO import StringIO
try:
from collections import namedtuple
except ImportError:
class Value(tuple):
def __new__(cls, *args):
return tuple.__new__(cls, args)
def _asdict(self):
return {'value': self[0]}
class Point(... | gpl-3.0 |
pablocastro/elasticsearch | dev-tools/smoke_test_rc.py | 49 | 12477 | # Licensed to Elasticsearch under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except... | apache-2.0 |
benjello/openfisca-france-indirect-taxation | openfisca_france_indirect_taxation/tests/test_legislations.py | 4 | 4237 | # -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <contact@openfisca.fr>
#
# Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of OpenFisca.
#
# OpenFisca is free software; you can redistribute it and/or modify... | agpl-3.0 |
fchu/hadoop-0.20.205 | share/hadoop/contrib/hod/hodlib/Common/logger.py | 182 | 28370 | #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 use thi... | apache-2.0 |
redmanatee/field-promotion | py/rest_handler.py | 2 | 8273 | import webapp2
from models import Game
from models import User
from google.appengine.ext import ndb
import logging
import json
from datetime import datetime
from google.appengine.api import users
from google.appengine.api import namespace_manager
from collections import defaultdict
import math
import datetime
class St... | mit |
mt2d2/servo | tests/wpt/css-tests/tools/html5lib/html5lib/tests/test_tokenizer.py | 420 | 6544 | from __future__ import absolute_import, division, unicode_literals
import json
import warnings
import re
from .support import get_data_files
from html5lib.tokenizer import HTMLTokenizer
from html5lib import constants
class TokenizerTestParser(object):
def __init__(self, initialState, lastStartTag=None):
... | mpl-2.0 |
yavalvas/yav_com | build/matplotlib/lib/mpl_examples/widgets/slider_demo.py | 13 | 1179 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider, Button, RadioButtons
fig, ax = plt.subplots()
plt.subplots_adjust(left=0.25, bottom=0.25)
t = np.arange(0.0, 1.0, 0.001)
a0 = 5
f0 = 3
s = a0*np.sin(2*np.pi*f0*t)
l, = plt.plot(t,s, lw=2, color='red')
plt.axis([0, 1, -10, 10])
a... | mit |
jeremiah-c-leary/vhdl-style-guide | vsg/tests/generate/test_rule_001.py | 1 | 1243 |
import os
import unittest
from vsg.rules import generate
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_001_test_input.vhd'))
dIndentMap = utils.read_indent_file()
lExpected = []
lExpected.append('')... | gpl-3.0 |
Ayub-Khan/edx-platform | common/lib/capa/capa/capa_problem.py | 54 | 36321 | #
# File: capa/capa_problem.py
#
# Nomenclature:
#
# A capa Problem is a collection of text and capa Response questions.
# Each Response may have one or more Input entry fields.
# The capa problem may include a solution.
#
"""
Main module which shows problems (of "capa" type).
This is used by capa_module.
"""
from ... | agpl-3.0 |
SimonSapin/servo | tests/wpt/web-platform-tests/tools/third_party/pytest/src/_pytest/pastebin.py | 34 | 3631 | """ submit failure or test session information to a pastebin service. """
from __future__ import absolute_import, division, print_function
import pytest
import six
import sys
import tempfile
def pytest_addoption(parser):
group = parser.getgroup("terminal reporting")
group._addoption(
"--pastebin",
... | mpl-2.0 |
GoSecure/gophish-cli | modules/report.py | 1 | 25755 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Reporting class to gather information from the campaign
@author: Martin Dubé
@organization: Gosecure inc.
@license: MIT License
@contact: mdube@gosecure.ca
Copyright (c) 2018, Gosecure
All rights reserved.
Permission is hereby granted, free of charge, to any person... | mit |
heliopython/heliopy | doc/source/conf.py | 1 | 11504 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# heliopy documentation build configuration file, created by
# sphinx-quickstart
#
# 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
# autogenerated file.
#
# All c... | gpl-3.0 |
BackupGGCode/python-for-android | python3-alpha/python3-src/Lib/idlelib/HyperParser.py | 89 | 10310 | """
HyperParser
===========
This module defines the HyperParser class, which provides advanced parsing
abilities for the ParenMatch and other extensions.
The HyperParser uses PyParser. PyParser is intended mostly to give information
on the proper indentation of code. HyperParser gives some information on the
structure ... | apache-2.0 |
rcosnita/fantastico | fantastico/mvc/tests/itest_model_facade.py | 1 | 10388 | '''
Copyright 2013 Cosnita Radu Viorel
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, publish, distribu... | mit |
dbaxa/django | tests/gis_tests/gis_migrations/test_operations.py | 284 | 7957 | from __future__ import unicode_literals
from django.contrib.gis.db.models import fields
from django.core.exceptions import ImproperlyConfigured
from django.db import connection, migrations, models
from django.db.migrations.migration import Migration
from django.db.migrations.state import ProjectState
from django.test ... | bsd-3-clause |
bastibl/gnuradio | gr-digital/python/digital/constellation_map_generator.py | 7 | 2083 | #!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... | gpl-3.0 |
AmeriCanAndroid/kernel-android-msm-2.6.35 | tools/perf/scripts/python/syscall-counts-by-pid.py | 944 | 1744 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(... | gpl-2.0 |
t3dev/odoo | addons/mrp/__manifest__.py | 5 | 1731 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Manufacturing',
'version': '2.0',
'website': 'https://www.odoo.com/page/manufacturing',
'category': 'Manufacturing/Manufacturing',
'sequence': 16,
'summary': 'Manufacturing Orders & BO... | gpl-3.0 |
idea4bsd/idea4bsd | python/helpers/pycharm/_jb_utils.py | 15 | 1220 | __author__ = 'Ilya.Kazakevich'
import sys
class VersionAgnosticUtils(object):
"""
"six" emulator: this class fabrics appropriate tool to use regardless python version.
Use it to write code that works both on py2 and py3. # TODO: Use Six instead
"""
@staticmethod
def __new__(cls, *more):
... | apache-2.0 |
tfwillems/STRValidator | pedigree_analysis.py | 1 | 23183 | import matplotlib as mpl
mpl.use('Agg')
import collections
import sys
import numpy
import matplotlib.pyplot as plt
import vcf
from matplotlib.backends.backend_pdf import PdfPages
from fractions import Fraction
class TRIO:
def __init__(self, child, mother, father):
self.child = child
self.mother =... | gpl-3.0 |
camptocamp/ngo-addons-backport | addons/base_import/test_models.py | 97 | 2366 | from openerp.osv import orm, fields
def name(n): return 'base_import.tests.models.%s' % n
class char(orm.Model):
_name = name('char')
_columns = {
'value': fields.char('unknown', size=None)
}
class char_required(orm.Model):
_name = name('char.required')
_columns = {
'value': fie... | agpl-3.0 |
j-griffith/cinder | cinder/tests/unit/volume/drivers/dell_emc/vnx/test_replication.py | 4 | 4014 | # Copyright (c) 2017 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 |
nichung/wwwflaskBlogrevA | env/lib/python2.7/site-packages/werkzeug/contrib/securecookie.py | 254 | 12206 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.securecookie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module implements a cookie that is not alterable from the client
because it adds a checksum the server checks for. You can use it as
session replacement if all you have is a user id or something to mark
... | mit |
pathompongoo/ThGovJobApp | env/lib/python2.7/site-packages/pip/commands/install.py | 187 | 14659 | from __future__ import absolute_import
import logging
import operator
import os
import tempfile
import shutil
import warnings
try:
import wheel
except ImportError:
wheel = None
from pip.req import RequirementSet
from pip.basecommand import RequirementCommand
from pip.locations import virtualenv_no_global, dis... | gpl-3.0 |
DTOcean/dtocean-core | tests/test_data_definitions_xgrid2d.py | 1 | 4013 | import pytest
import numpy as np
import matplotlib.pyplot as plt
from aneris.control.factory import InterfaceFactory
from dtocean_core.core import (AutoFileInput,
AutoFileOutput,
AutoPlot,
Core)
from dtocean_core.data import ... | gpl-3.0 |
saurabh6790/medsynaptic-app | patches/june_2013/p05_remove_unused_doctypes.py | 30 | 1916 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import webnotes
def execute():
doctypes = [
"Announcement",
"Authorization Rules",
"Blog Subscriber",
"Books",
"Call Log",
"Call Log Details",
"Campaign Expense",
"Communication L... | agpl-3.0 |
nicocardiel/pyemir | emirdrp/processing/wavecal/get_islitlet.py | 3 | 1590 | #
# Copyright 2019 Universidad Complutense de Madrid
#
# This file is part of PyEmir
#
# PyEmir 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 ... | gpl-3.0 |
largelymfs/topical_word_embeddings | TWE-3/gensim/interfaces.py | 33 | 10470 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
This module contains basic interfaces used throughout the whole gensim package.
The interfaces are realized as abstract base classe... | mit |
shengwangXX/deeplearning | pytorch/mnist_dist.py | 1 | 4858 | from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variable
import torch.nn.parallel
import torch.distributed as dist
import torch.utils.data.distribu... | apache-2.0 |
Baumelbi/IntroPython2016 | students/alextruo/session2/series.py | 3 | 1664 | #define the function here with n as the value
print("Give me a number:")
n = int(input())
def fibonacci(n):
"""(must be indented) this is an example doc string compute the nth Fibonacci number"""
if n < 0:
return None
elif n == 0:
return 0
if n == 1:
return 1
return fibonacc... | unlicense |
inverthermit/pacman_ai | reinforcement/graphicsCrawlerDisplay.py | 6 | 11027 | # graphicsCrawlerDisplay.py
# -------------------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link t... | mit |
MyAOSP/external_chromium_org | ppapi/generators/idl_log.py | 137 | 1271 | # 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.
""" Error and information logging for IDL """
import sys
class IDLLog(object):
"""Captures and routes logging output.
Caputres logging output and... | bsd-3-clause |
0x0mar/king-phisher | king_phisher/client/client_rpc.py | 1 | 5357 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/client/client_rpc.py
#
# 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... | bsd-3-clause |
sxjscience/tvm | rust/tvm-graph-rt/tests/test_tvm_basic/src/build_test_lib.py | 5 | 1356 | #!/usr/bin/env python3
# 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
# "L... | apache-2.0 |
Pluto-tv/chromium-crosswalk | chromecast/tools/build/chromecast_repack_locales.py | 24 | 4485 | #!/usr/bin/env python
# Copyright 2014 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.
"""Helper script to repack paks for a list of locales.
Gyp doesn't have any built-in looping capability, so this just provides a way t... | bsd-3-clause |
crepererum/analysis-preservation.cern.ch | invenio_data/base/bundles.py | 1 | 1116 | # -*- coding: utf-8 -*-
#
# This file is part of CERN Analysis Preservation Framework.
# Copyright (C) 2014, 2015 CERN.
#
# CERN Analysis Preservation Framework 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; ... | gpl-2.0 |
ctb/pygr | pygr/nlmsa_utils.py | 1 | 17639 | import classutil, logger
import os, types
class NLMSASeqList(list):
def __init__(self, nlmsaSeqDict):
list.__init__(self)
self.nlmsaSeqDict = nlmsaSeqDict
def __getitem__(self, nlmsaID):
'return NLMSASequence for a given nlmsa_id'
try:
return list.__getitem__(self,n... | bsd-3-clause |
ebber/noteCreationServer | flask/lib/python3.5/site-packages/pip/wheel.py | 187 | 30186 | """
Support for installing and building the "wheel" binary package format.
"""
from __future__ import absolute_import
import compileall
import csv
import errno
import functools
import hashlib
import logging
import os
import os.path
import re
import shutil
import stat
import sys
import tempfile
import warnings
from ba... | gpl-2.0 |
tommy-u/chaco | examples/demo/advanced/asynchronous_updates.py | 1 | 8087 | """
Perform expensive calculations based on user interactions while keeping the GUI
responsive. This makes use of asynchronous programming tools in the encore
package.
Move the slider to blur the image. Note the slider stays responsive even though
the blurring may lag the slider. Uncheck "Asynchronous" and note that t... | bsd-3-clause |
simudream/django-rest-framework | tests/utils.py | 84 | 2061 | from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import NoReverseMatch
class UsingURLPatterns(object):
"""
Isolates URL patterns used during testing on the test class itself.
For example:
class MyTestCase(UsingURLPatterns, TestCase):
urlpatterns = [
... | bsd-2-clause |
FundacionZamoraTeran/Genios | sugargame/event.py | 2 | 9092 | from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GObject
import pygame
import pygame.event
class _MockEvent(object):
def __init__(self, keyval):
self.keyval = keyval
class Translator(object):
key_trans = {
'Alt_L': pygame.K_LALT,
'Alt_R': pygame.K_... | mit |
gdub/django | tests/prefetch_related/test_uuid.py | 291 | 4347 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Flea, House, Person, Pet, Room
class UUIDPrefetchRelated(TestCase):
def test_prefetch_related_from_uuid_model(self):
Pet.objects.create(name='Fifi').people.add(
Person.objects.create(name='Ellen'),
... | bsd-3-clause |
psyhofreak/ft-engine | mysql-test/suite/tokudb/t/change_column_int_key.py | 56 | 1671 | #!/usr/bin/env python
import sys
def gen_test(types):
for a in range(len(types)):
for b in range(len(types)):
if a < b:
print
print "CREATE TABLE t (a %s, PRIMARY KEY(a));" % (types[a])
print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/"
... | gpl-2.0 |
tonk/ansible | lib/ansible/modules/system/setup.py | 7 | 8274 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# 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
ANSIBLE_METADATA = {'metadata_version': '... | gpl-3.0 |
n1889/gitinspector | gitinspector/clone.py | 48 | 1473 | # coding: utf-8
#
# Copyright © 2014 Ejwa Software. All rights reserved.
#
# This file is part of gitinspector.
#
# gitinspector 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,... | gpl-3.0 |
radicalbit/ambari | ambari-server/src/test/python/stacks/2.0.6/HDFS/test_alert_checkpoint_time.py | 3 | 3594 | #!/usr/bin/env python
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License")... | apache-2.0 |
pilou-/ansible | test/units/parsing/utils/test_addresses.py | 62 | 3762 | # -*- coding: utf-8 -*-
import unittest
from ansible.parsing.utils.addresses import parse_address
class TestParseAddress(unittest.TestCase):
tests = {
# IPv4 addresses
'192.0.2.3': ['192.0.2.3', None],
'192.0.2.3:23': ['192.0.2.3', 23],
# IPv6 addresses
'::': ['::', Non... | gpl-3.0 |
hdd/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Scanner/RC.py | 61 | 2068 | """SCons.Scanner.RC
This module implements the depenency scanner for RC (Interface
Definition Language) files.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and ... | apache-2.0 |
KenV99/script.service.kodi.callbacks | default.py | 3 | 5603 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 KenV99
#
# 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) a... | gpl-3.0 |
aajtodd/zipline | tests/risk/answer_key.py | 39 | 11989 | #
# Copyright 2014 Quantopian, 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 required by applicable law or agreed to in wr... | apache-2.0 |
ideasiii/ControllerPlatform | Controller-WheelPies/extLibs/mongo-cxx-driver/src/third_party/gtest-1.7.0/test/gtest_env_var_test.py | 2408 | 3487 | #!/usr/bin/env python
#
# Copyright 2008, 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... | gpl-3.0 |
sdague/home-assistant | homeassistant/components/freebox/switch.py | 12 | 2386 | """Support for Freebox Delta, Revolution and Mini 4K."""
import logging
from typing import Dict
from aiofreepybox.exceptions import InsufficientPermissionsError
from homeassistant.components.switch import SwitchEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAs... | apache-2.0 |
georgtroska/root | interpreter/llvm/src/tools/clang/bindings/python/examples/cindex/cindex-includes.py | 110 | 1644 | #!/usr/bin/env python
#===- cindex-includes.py - cindex/Python Inclusion Graph -----*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===---------------------------------------... | lgpl-2.1 |
jdemonasterio/Bayes-for-Hackers | ExamplesFromChapters/Chapter3/ClusteringWithGaussians.py | 90 | 1034 | import numpy as np
import pymc as pm
data = np.loadtxt("../../Chapter3_MCMC/data/mixture_data.csv", delimiter=",")
p = pm.Uniform("p", 0, 1)
assignment = pm.Categorical("assignment", [p, 1 - p], size=data.shape[0])
taus = 1.0 / pm.Uniform("stds", 0, 100, size=2) ** 2 # notice the size!
centers = pm.Normal("cent... | mit |
akshayka/projection-methods | projection_methods/projectables/polyhedron.py | 1 | 2281 | from projection_methods.projectables.halfspace import Halfspace
from projection_methods.projectables.hyperplane import Hyperplane
from projection_methods.projectables.projectable import Projectable
class Polyhedron(Projectable):
"""A projectable polyhedron
Defines a polyhedron via a set of hyperplanes and ha... | gpl-3.0 |
ekalosak/boto | tests/integration/cloudsearch/test_layers.py | 130 | 2742 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the right... | mit |
Pikecillo/genna | external/4Suite-XML-1.0.2/Ft/Xml/XPath/ParsedRelativeLocationPath.py | 1 | 1412 | ########################################################################
# $Header: /var/local/cvsroot/4Suite/Ft/Xml/XPath/ParsedRelativeLocationPath.py,v 1.4 2005/02/09 11:10:54 mbrown Exp $
"""
A parsed token that represents a relative location path in the parsed result tree.
Copyright 2005 Fourthought, Inc. (... | gpl-2.0 |
thp44/delphin_6_automation | data_process/2d_1d/archieve/temperature.py | 1 | 18075 | __author__ = "Christian Kongsgaard"
__license__ = 'MIT'
# -------------------------------------------------------------------------------------------------------------------- #
# IMPORTS
# Modules
import matplotlib.pyplot as plt
import numpy as np
import os
import datetime
import matplotlib.dates as mdates
import pan... | mit |
marcoitur/Freecad_test | src/Mod/TemplatePyMod/Texture.py | 58 | 1835 | # (c) 2012 Werner Mayer LGPL
import FreeCAD, FreeCADGui
from FreeCAD import Base
from pivy import coin
class Texture:
def __init__(self, obj, source):
"Add some custom properties to our box feature"
obj.addProperty("App::PropertyLink","Source","Texture", "Link to the shape").Source = source
obj.Proxy... | lgpl-2.1 |
weechat/weechat.org | weechat/news/views.py | 1 | 3923 | #
# Copyright (C) 2003-2021 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of WeeChat.org.
#
# WeeChat.org 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
#... | gpl-3.0 |
hzy001/ansible | v1/ansible/runner/lookup_plugins/together.py | 174 | 2135 | # (c) 2013, Bradley Young <young.bradley@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) any later... | gpl-3.0 |
BiaDarkia/scikit-learn | examples/semi_supervised/plot_label_propagation_digits_active_learning.py | 33 | 4174 | """
========================================
Label Propagation digits active learning
========================================
Demonstrates an active learning technique to learn handwritten digits
using label propagation.
We start by training a label propagation model with only 10 labeled points,
then we select the t... | bsd-3-clause |
Petr-Kovalev/nupic-win32 | py/regions/ImageSensorExplorers/RepetitiveSweep.py | 2 | 6558 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.