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 |
|---|---|---|---|---|---|
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/operations/_virtual_network_gateways_operations.py | 1 | 103438 | # 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 may ... | mit |
mseroczynski/platformio | platformio/ide/projectgenerator.py | 4 | 4287 | # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
import json
import os
import re
from os.path import abspath, basename, expanduser, isdir, join, relpath
import bottle
from platformio import util
class ProjectGenerator(object):
def __init__(self, project_dir, ide, board=None):
... | mit |
chrisdroid/nexmon | utilities/wireshark/tools/dftestlib/util.py | 31 | 1618 | # Copyright (c) 2013 by Gilbert Ramirez <gram@alumni.rice.edu>
#
# 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.
#
# Th... | gpl-3.0 |
ArnossArnossi/django | django/contrib/staticfiles/management/commands/runserver.py | 216 | 1360 | from django.conf import settings
from django.contrib.staticfiles.handlers import StaticFilesHandler
from django.core.management.commands.runserver import \
Command as RunserverCommand
class Command(RunserverCommand):
help = "Starts a lightweight Web server for development and also serves static files."
d... | bsd-3-clause |
Sumith1896/sympy | sympy/series/tests/test_demidovich.py | 116 | 4679 | from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, \
pi, asin, together, root
# Numbers listed with the tests refer to problem numbers in the book
# "Anti-demidovich, problemas resueltos, Ed. URSS"
x = Symbol("x")
def test_leadterm():
assert (3 + 2*x**(log(3)/log(2) - 1)).leadterm... | bsd-3-clause |
cragusa/cocoma | bin/Logger.py | 1 | 5704 | #!/usr/bin/env python
#Copyright 2012-2013 SAP 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 applicab... | apache-2.0 |
gabelula/b-counted | .google_appengine/lib/django/django/utils/tzinfo.py | 34 | 1455 | "Implementation of tzinfo classes for use with datetime.datetime."
import time
from datetime import timedelta, tzinfo
class FixedOffset(tzinfo):
"Fixed offset in minutes east from UTC."
def __init__(self, offset):
self.__offset = timedelta(minutes=offset)
self.__name = "%+03d%02d" % (offset //... | apache-2.0 |
MattDevo/edk2 | AppPkg/Applications/Python/Python-2.7.2/Lib/_abcoll.py | 56 | 15273 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
DON'T USE THIS MODULE DIRECTLY! The classes here should be imported
via collections; they are defined here only to alleviate certain
boots... | bsd-2-clause |
ifduyue/sentry | src/social_auth/south_migrations/0002_auto__add_unique_nonce_timestamp_salt_server_url__add_unique_associati.py | 5 | 7052 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.conf import settings
from social_auth.utils import custom_user_frozen_models
USER_MODEL = settings.AUTH_USER_MODEL
UID_LENGTH = getattr(settings, 'SOCIAL_AUTH_UID_LENGTH', 255... | bsd-3-clause |
DEVSENSE/PTVS | Python/Tests/TestData/VirtualEnv/env/Lib/encodings/iso2022_kr.py | 816 | 1053 | #
# iso2022_kr.py: Python Unicode Codec for ISO2022_KR
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_kr')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncod... | apache-2.0 |
isc-projects/forge | tests/dhcpv4/ddns/test_ddns_no_tsig_request.py | 1 | 41287 | """DDNS without TSIG"""
# pylint: disable=invalid-name,line-too-long
import pytest
import misc
import srv_control
import srv_msg
@pytest.mark.v4
@pytest.mark.ddns
@pytest.mark.notsig
@pytest.mark.forward_reverse_add
def test_ddns4_notsig_forw_and_rev_add_success_Sflag():
misc.test_setup()
srv_control.conf... | isc |
HiroIshikawa/21playground | flask-rethink/env/lib/python3.5/site-packages/flask/testsuite/config.py | 556 | 11820 | # -*- coding: utf-8 -*-
"""
flask.testsuite.config
~~~~~~~~~~~~~~~~~~~~~~
Configuration and instances.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import flask
import pkgutil
import unittest
from contextlib import contextmanager
fr... | mit |
willthames/ansible | lib/ansible/plugins/action/service.py | 31 | 3427 | # (c) 2015, Ansible Inc,
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is di... | gpl-3.0 |
ASCrookes/django | django/contrib/gis/db/backends/mysql/schema.py | 448 | 3048 | import logging
from django.contrib.gis.db.models.fields import GeometryField
from django.db.backends.mysql.schema import DatabaseSchemaEditor
from django.db.utils import OperationalError
logger = logging.getLogger('django.contrib.gis')
class MySQLGISSchemaEditor(DatabaseSchemaEditor):
sql_add_spatial_index = 'C... | bsd-3-clause |
qedsoftware/commcare-hq | corehq/apps/settings/tests/test_utils.py | 1 | 1321 | import os
from django.test import SimpleTestCase
from corehq.apps.settings.utils import get_temp_file
class GetTempFileTests(SimpleTestCase):
def test_file_closed(self):
"""
Check that an error is not raised if the file is closed by the caller
"""
try:
with get_temp_fi... | bsd-3-clause |
LooseTerrifyingSpaceMonkey/DecMeg2014 | src/benchmark_pooling.py | 1 | 3692 | """DecMeg2014 example code.
Simple prediction of the class labels of the test set by:
- pooling all the triaining trials of all subjects in one dataset.
- Extracting the MEG data in the first 500ms from when the
stimulus starts.
- Using a linear classifier (logistic regression).
"""
import numpy as np
from sklearn.... | gpl-2.0 |
anirudhvenkats/clowdflows | workflows/migrations/0026_auto__del_field_workflow_author.py | 6 | 15263 | # 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):
# Deleting field 'Workflow.author'
db.delete_column('workflows_workflow', 'author')
def backwards(se... | gpl-3.0 |
mixman/djangodev | django/contrib/gis/gdal/envelope.py | 94 | 7041 | """
The GDAL/OGR library uses an Envelope structure to hold the bounding
box information for a geometry. The envelope (bounding box) contains
two pairs of coordinates, one for the lower left coordinate and one
for the upper right coordinate:
+----------o Upper right; (max_x, max_y)
... | bsd-3-clause |
hilaskis/UAV_MissionPlanner | Lib/site-packages/numpy/polynomial/polyutils.py | 79 | 11109 | """
Utililty objects for the polynomial modules.
This module provides: error and warning objects; a polynomial base class;
and some routines used in both the `polynomial` and `chebyshev` modules.
Error objects
-------------
- `PolyError` -- base class for this sub-package's errors.
- `PolyDomainError` -- raised when ... | gpl-2.0 |
denisff/python-for-android | python-modules/zope/zope/interface/tests/test_interface.py | 50 | 16077 | ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# TH... | apache-2.0 |
karolciba/playground | markov/baumwelch.py | 1 | 4027 | import numpy as np
# functions and classes go here
def fb_alg(A_mat, O_mat, observ):
# set up
k = observ.size
(n,m) = O_mat.shape
prob_mat = np.zeros( (n,k) )
fw = np.zeros( (n,k+1) )
bw = np.zeros( (n,k+1) )
# forward part
fw[:, 0] = 1.0/n
for obs_ind in xrange(k):
f_row_vec... | unlicense |
jsgf/xen | tools/python/xen/xend/server/vfbif.py | 43 | 3171 | from xen.xend.server.DevController import DevController
from xen.xend.XendLogging import log
from xen.xend.XendError import VmError
import xen.xend
import os
CONFIG_ENTRIES = ['type', 'vncdisplay', 'vnclisten', 'vncpasswd', 'vncunused',
'display', 'xauthority', 'keymap', 'vnc', 'sdl', 'uuid',
... | gpl-2.0 |
LeartS/odoo | addons/google_calendar/__openerp__.py | 31 | 1633 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
iotile/coretools | transport_plugins/awsiot/iotile_transport_awsiot/device_adapter.py | 1 | 21488 | import os
import binascii
import base64
import datetime
import logging
import queue
import uuid
from iotile.core.exceptions import IOTileException, ArgumentError, HardwareError
from iotile.core.hw.transport.adapter import DeviceAdapter
from iotile.core.hw.reports.parser import IOTileReportParser
from iotile.core.dev.re... | gpl-3.0 |
cgstudiomap/cgstudiomap | main/parts/odoo/addons/edi/__openerp__.py | 312 | 1911 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
Nowheresly/odoo | addons/point_of_sale/wizard/__init__.py | 382 | 1200 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
hbrunn/OpenUpgrade | addons/hr_holidays/__init__.py | 442 | 1094 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
ptmr3/GalaxyNote2_Kernel | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # 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, sys
sys.path.append(os.env... | gpl-2.0 |
MartinHjelmare/home-assistant | homeassistant/components/simplisafe/alarm_control_panel.py | 6 | 4446 | """Support for SimpliSafe alarm control panels."""
import logging
import re
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.const import (
CONF_CODE, STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME,
STATE_ALARM_DISARMED)
from homeassistant.core import callback
from homeassistant.... | apache-2.0 |
domenicosolazzo/practice-django | venv/lib/python2.7/site-packages/django/contrib/messages/storage/base.py | 113 | 6286 | from __future__ import unicode_literals
from django.conf import settings
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.contrib.messages import constants, utils
LEVEL_TAGS = utils.get_level_tags()
@python_2_unicode_compatible
class Message(object):
"""
Represents an a... | mit |
campbe13/openhatch | vendor/packages/celery/celery/tests/test_backends/test_base.py | 18 | 10279 | from __future__ import absolute_import
from __future__ import with_statement
import sys
import types
from mock import Mock
from nose import SkipTest
from celery.utils import serialization
from celery.utils.serialization import subclass_exception
from celery.utils.serialization import \
find_nearest_pickleabl... | agpl-3.0 |
benschmaus/catapult | third_party/gsutil/third_party/boto/tests/integration/route53/test_zone.py | 100 | 7729 | # Copyright (c) 2011 Blue Pines Technologies LLC, Brad Carleton
# www.bluepines.org
# Copyright (c) 2012 42 Lines Inc., Jim Browne
#
# 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 re... | bsd-3-clause |
schef/schef.github.io | source/14/mc-14-04-whf-pid.py | 1 | 2581 | #!/usr/bin/python
# Written by Stjepan Horvat
# ( zvanstefan@gmail.com )
# by the exercises from David Lucal Burge - Perfect Pitch Ear Traning Supercourse
# Thanks to Wojciech M. Zabolotny ( wzab@ise.pw.edu.pl ) for snd-virmidi example
# ( wzab@ise.pw.edu.pl )
import random
import sys
sys.path.append("/home/schef/gith... | mit |
kushalbhola/MyStuff | Practice/PythonApplication/env/Lib/site-packages/pandas/tests/io/parser/test_comment.py | 2 | 3819 | """
Tests that comments are properly handled during parsing
for all of the parsers defined in parsers.py
"""
from io import StringIO
import numpy as np
import pytest
from pandas import DataFrame
import pandas.util.testing as tm
@pytest.mark.parametrize("na_values", [None, ["NaN"]])
def test_comment(all_parsers, na_... | apache-2.0 |
pnedunuri/scikit-learn | examples/applications/plot_model_complexity_influence.py | 323 | 6372 | """
==========================
Model Complexity Influence
==========================
Demonstrate how model complexity influences both prediction accuracy and
computational performance.
The dataset is the Boston Housing dataset (resp. 20 Newsgroups) for
regression (resp. classification).
For each class of models we m... | bsd-3-clause |
shushen/ansible | test/units/TestPlayVarsFiles.py | 10 | 12328 | #!/usr/bin/env python
import os
import shutil
from tempfile import mkstemp
from tempfile import mkdtemp
from ansible.playbook.play import Play
import ansible
import unittest
from nose.plugins.skip import SkipTest
class FakeCallBacks(object):
def __init__(self):
pass
def on_vars_prompt(self):
... | gpl-3.0 |
palladius/gcloud | packages/gsutil/gslib/addlhelp/anon.py | 51 | 2114 | # Copyright 2012 Google 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 applicable law or a... | gpl-3.0 |
ppanczyk/ansible | lib/ansible/modules/network/aci/aci_taboo_contract.py | 22 | 4081 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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': '1.1',
'status': ['preview'],
... | gpl-3.0 |
steveb/tablib | tablib/packages/xlwt3/Utils.py | 46 | 6663 | # pyXLWriter: A library for generating Excel Spreadsheets
# Copyright (c) 2004 Evgeny Filatov <fufff@users.sourceforge.net>
# Copyright (c) 2002-2004 John McNamara (Perl Spreadsheet::WriteExcel)
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General ... | mit |
Zephor5/zspider | zspider/crawler.py | 1 | 5759 | # coding=utf-8
import json
import logging
from queue import Queue
from pooled_pika import PooledConn
from scrapy.crawler import CrawlerProcess
from scrapy.settings import Settings
from scrapy.utils.log import log_scrapy_info
from scrapy.utils.ossignal import install_shutdown_handlers
from twisted.internet import defer... | mit |
andymckay/zamboni | mkt/inapp/views.py | 1 | 3169 | import json
from django.db import transaction
from django.shortcuts import get_object_or_404
from rest_framework.permissions import AllowAny
from rest_framework.viewsets import ModelViewSet
import commonware.log
from mkt.api.authentication import (RestAnonymousAuthentication,
Rest... | bsd-3-clause |
datenbetrieb/odoo | openerp/report/render/html2html/html2html.py | 443 | 4238 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
betoesquivel/fil2014 | build/django/django/template/smartif.py | 239 | 6269 | """
Parser and utilities for the smart 'if' tag
"""
# Using a simple top down parser, as described here:
# http://effbot.org/zone/simple-top-down-parsing.htm.
# 'led' = left denotation
# 'nud' = null denotation
# 'bp' = binding power (left = lbp, right = rbp)
class TokenBase(object):
"""
Base class for ope... | mit |
do-mpc/do-mpc | documentation/source/release_overview.py | 1 | 1138 | import requests
import os
def get_overview():
# Use Github Rest API to get releases:
release_dict = requests.get('https://api.github.com/repos/do-mpc/do-mpc/releases').json()
text = ''
text += '# Release notes'
text += '\n'
text += 'This content is autogenereated from our Github [release n... | lgpl-3.0 |
hieukypc/ERP | openerp/addons/website_portal/controllers/main.py | 3 | 4201 | # -*- coding: utf-8 -*-
from openerp import http
from openerp.http import request
from openerp import tools
from openerp.tools.translate import _
class website_account(http.Controller):
@http.route(['/my', '/my/home'], type='http', auth="public", website=True)
def account(self, **kw):
partner = reques... | gpl-3.0 |
ess/dd-agent | tests/checks/mock/test_mesos_slave.py | 45 | 1565 | # stdlib
import json
# 3p
from mock import patch
from nose.plugins.attrib import attr
# project
from checks import AgentCheck
from tests.checks.common import AgentCheckTest, Fixtures, get_check_class
def _mocked_get_state(*args, **kwargs):
state = json.loads(Fixtures.read_file('state.json'))
return state
de... | bsd-3-clause |
sauloal/cufflinksviewer | venvwin/Lib/encodings/raw_unicode_escape.py | 103 | 1253 | """ Python 'raw-unicode-escape' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to me... | mit |
andrewleech/WeasyPrint | weasyprint/layout/min_max.py | 5 | 1773 | # coding: utf8
"""
weasyprint.layout.min_max
-------------------------
:copyright: Copyright 2011-2014 Simon Sapin and contributors, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import division, unicode_literals
import functools
def handle_min_max_width(function):
""... | bsd-3-clause |
PetterS/easy-IP | examples/run_nurses.py | 1 | 1028 | #!/usr/bin/env python3
from glob import glob
import os
# Set this to the location of NSPLib.
nsplib = r"C:\Users\Petter\Dropbox\Datasets\NSPLib"
def run_solver(data_set, case):
case_file = os.path.join(nsplib, "Cases", str(case) + ".gen")
log_file = data_set + "." + str(case) + ".output.log"
files = glob(os.path... | bsd-2-clause |
silentfuzzle/calibre | src/calibre/gui2/store/stores/ebooksgratuits_plugin.py | 22 | 1107 |
# -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function)
store_version = 1 # Needed for dynamic plugin loading
__license__ = 'GPL 3'
__copyright__ = '2012, Florent FAYOLLE <florent.fayolle69@gmail.com>'
__docformat__ = 'restructuredtext en'
from calibre.gui2.store.... | gpl-3.0 |
mxOBS/deb-pkg_trusty_chromium-browser | native_client/src/trusted/validator_ragel/proof_tools.py | 1 | 15125 | # Copyright (c) 2014 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tools and utilities for creating proofs about tries."""
import itertools
import multiprocessing
import optparse
import spec
import trie
import ... | bsd-3-clause |
maestrano/odoo | addons/account_analytic_analysis/res_config.py | 426 | 1408 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
yurac/python-docx | docx/opc/pkgwriter.py | 18 | 4524 | # encoding: utf-8
"""
Provides a low-level, write-only API to a serialized Open Packaging
Convention (OPC) package, essentially an implementation of OpcPackage.save()
"""
from __future__ import absolute_import
from .constants import CONTENT_TYPE as CT
from .oxml import CT_Types, serialize_part_xml
from .packuri impo... | mit |
ikool/metact06 | lib/werkzeug/utils.py | 145 | 22826 | # -*- coding: utf-8 -*-
"""
werkzeug.utils
~~~~~~~~~~~~~~
This module implements various utilities for WSGI applications. Most of
them are used by the request and response wrappers but especially for
middleware development it makes sense to use them without the wrappers.
:copyright: (c) 2014 ... | apache-2.0 |
NicoSantangelo/sublime-gulp | status_bar.py | 1 | 1362 | import sublime
is_sublime_text_3 = int(sublime.version()) >= 3000
if is_sublime_text_3:
from .settings import Settings
from .caches import ProcessCache
from .timeout import defer_sync
else:
from settings import Settings
from caches import ProcessCache
from timeout import defer_sync
class Sta... | mit |
wfxiang08/changes | changes/api/jobstep_details.py | 2 | 6870 | from __future__ import absolute_import
from datetime import datetime
from flask import current_app
from flask_restful.reqparse import RequestParser
from sqlalchemy.orm import joinedload
from changes.api.base import APIView
from changes.api.validators.datetime import ISODatetime
from changes.config import db
from chan... | apache-2.0 |
alikins/subscription-manager | src/subscription_manager/installedproductslib.py | 3 | 1634 | #
# Copyright (c) 2011 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the im... | gpl-2.0 |
mrtequino/JSW | nodejs/asincronia1/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py | 60 | 65994 | # 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.
"""
This module contains classes that help to emulate xcodebuild behavior on top of
other build systems, such as make and ninja.
"""
import copy
import gyp.common... | apache-2.0 |
liu-jc/reinforcement-learning | lib/plotting.py | 4 | 3457 | import matplotlib
import numpy as np
import pandas as pd
from collections import namedtuple
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
EpisodeStats = namedtuple("Stats",["episode_lengths", "episode_rewards"])
def plot_cost_to_go_mountain_car(env, estimator, num_tiles=20):
x = np.... | mit |
backtou/longlab | gr-uhd/apps/hf_explorer/hfx.py | 11 | 34239 | #!/usr/bin/env python
# generated by wxGlade 0.4 on Tue Mar 14 10:16:06 2006
#
# Copyright 2006,2011 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 S... | gpl-3.0 |
alaunay/bigtop | bigtop-packages/src/charm/giraph/layer-giraph/tests/01-basic-deployment.py | 7 | 1194 | #!/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 "Lic... | apache-2.0 |
qma/pants | tests/python/pants_test/backend/python/tasks/test_python_repl.py | 3 | 6237 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import sys... | apache-2.0 |
gangadharkadam/vlinkfrappe | frappe/build.py | 12 | 5396 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
from frappe.utils.minify import JavascriptMinify
"""
Build the `public` folders and setup languages
"""
import os, frappe, json, shutil, re
# from cssmin import cssmin
app_pat... | mit |
materialsproject/pymatgen | pymatgen/apps/battery/tests/test_insertion_battery.py | 5 | 7072 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import json
import os
import unittest
from monty.json import MontyDecoder, MontyEncoder
from pymatgen.apps.battery.insertion_battery import InsertionElectrode, InsertionVoltagePair
from pymatgen.entries.comp... | mit |
r-mart/scikit-learn | sklearn/feature_extraction/text.py | 110 | 50157 | # -*- coding: utf-8 -*-
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Lars Buitinck <L.J.Buitinck@uva.nl>
# Robert Layton <robertlayton@gmail.com>
# Jochen Wersdörfer <jochen@wersdoerfer.de>
# Roman Sinayev <roman.sinayev@gma... | bsd-3-clause |
jkonecki/autorest | AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyByte/autorestswaggerbatbyteservice/models/error.py | 50 | 1295 | # 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 ... | mit |
markovg/nest-simulator | pynest/nest/tests/test_errors.py | 18 | 2194 | # -*- coding: utf-8 -*-
#
# test_errors.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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... | gpl-2.0 |
duramato/SickRage | lib/hachoir_core/field/integer.py | 73 | 1848 | """
Integer field classes:
- UInt8, UInt16, UInt24, UInt32, UInt64: unsigned integer of 8, 16, 32, 64 bits ;
- Int8, Int16, Int24, Int32, Int64: signed integer of 8, 16, 32, 64 bits.
"""
from hachoir_core.field import Bits, FieldError
class GenericInteger(Bits):
"""
Generic integer class used to generate othe... | gpl-3.0 |
fedora-conary/rbuild | plugins/buildpackages.py | 1 | 4531 | #
# Copyright (c) SAS Institute 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 w... | apache-2.0 |
KeepSafe/aiohttp | examples/legacy/crawl.py | 5 | 3129 | #!/usr/bin/env python3
import asyncio
import logging
import re
import signal
import sys
import urllib.parse
import aiohttp
class Crawler:
def __init__(self, rooturl, loop, maxtasks=100):
self.rooturl = rooturl
self.loop = loop
self.todo = set()
self.busy = set()
self.don... | apache-2.0 |
nicholasbs/zulip | zerver/management/commands/gravatar_to_user_avatar.py | 124 | 2043 | from __future__ import absolute_import
import requests
from zerver.models import get_user_profile_by_email, UserProfile
from zerver.lib.avatar import gravatar_hash
from zerver.lib.upload import upload_avatar_image
from django.core.management.base import BaseCommand, CommandError
from django.core.files.uploadedfile imp... | apache-2.0 |
Autodesk/molecular-design-toolkit | moldesign/helpers/qmmm.py | 1 | 3277 | # Copyright 2016 Autodesk 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 writing... | apache-2.0 |
masierra/ardupilot | mk/PX4/Tools/genmsg/scripts/genmsg_check_deps.py | 216 | 2999 | #!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2014, Open Source Robotics Foundation, 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:
#
# * Redistribut... | gpl-3.0 |
gifford-lab/bcbio-nextgen | bcbio/ngsalign/hisat2.py | 3 | 3097 | import os
from bcbio.utils import file_exists
import bcbio.pipeline.datadict as dd
from bcbio.distributed.transaction import file_transaction
from bcbio.pipeline import config_utils
from bcbio.ngsalign import postalign
from bcbio.provenance import do
def align(fastq_file, pair_file, ref_file, names, align_dir, data):
... | mit |
kpcyrd/cjdns | node_build/dependencies/libuv/build/gyp/test/generator-output/gyptest-depth.py | 232 | 1561 | #!/usr/bin/env python
# Copyright 2014 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 building a project hierarchy created when the --generator-output=
and --depth= options is used to put the build configuration files... | gpl-3.0 |
yasoob/youtube-dl-GUI | youtube_dl/extractor/voicerepublic.py | 11 | 2302 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
determine_ext,
int_or_none,
urljoin,
)
class VoiceRepublicIE(InfoExtractor):
_VALID_URL = r'https?://voicerepublic\.com/(?:talks|embed)/(?P<id>[0-9a-z-]+... | mit |
USGSDenverPychron/pychron | pychron/hardware/fusions/fusions_motor_configurer.py | 1 | 1639 | # ===============================================================================
# Copyright 2011 Jake Ross
#
# 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/licens... | apache-2.0 |
marratj/ansible | lib/ansible/plugins/callback/context_demo.py | 25 | 1791 | # (C) 2012, Michael DeHaan, <michael.dehaan@gmail.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 = '''
callback: context_demo
type... | gpl-3.0 |
bccp/nbodykit | nbodykit/source/catalog/subvolumes.py | 1 | 2079 | from nbodykit.base.catalog import CatalogSource
from pmesh.domain import GridND
from nbodykit.utils import split_size_3d
import numpy
class SubVolumesCatalog(CatalogSource):
""" A catalog that distributes the particles spatially into subvolumes per
MPI rank.
Attributes
----------
d... | gpl-3.0 |
DANS-KNAW/dariah-contribute | dariah_static_data/migrations/0003_auto__del_field_country_iso3166_2__del_field_country_uri__add_field_co.py | 1 | 4571 | # -*- coding: utf-8 -*-
"""
DARIAH Contribute - DARIAH-EU Contribute: edit your DARIAH contributions.
Copyright 2014 Data Archiving and Networked Services
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... | apache-2.0 |
gorjuce/odoo | addons/website_mail/__openerp__.py | 379 | 1623 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
lacrazyboy/scrapy | scrapy/utils/benchserver.py | 130 | 1312 | import random
from six.moves.urllib.parse import urlencode
from twisted.web.server import Site
from twisted.web.resource import Resource
from twisted.internet import reactor
class Root(Resource):
isLeaf = True
def getChild(self, name, request):
return self
def render(self, request):
tot... | bsd-3-clause |
cylc/cylc | tests/unit/main_loop/main_loop.py | 2 | 6730 | import asyncio
from collections import deque
from functools import partial
import logging
from time import sleep
import pytest
from cylc.flow import CYLC_LOG
from cylc.flow.exceptions import CylcError
from cylc.flow.main_loop import (
CoroTypes,
MainLoopPluginException,
_wrapper,
get_runners,
load... | gpl-3.0 |
rwillmer/django | django/db/backends/postgresql_psycopg2/schema.py | 84 | 3891 | import psycopg2
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_alter_column_type = "ALTER COLUMN %(column)s TYPE %(type)s USING %(column)s::%(type)s"
sql_create_sequence = "CREATE SEQUENCE %(sequence)s"
sql_delete_sequence =... | bsd-3-clause |
mcardillo55/django | django/http/request.py | 50 | 19501 | from __future__ import unicode_literals
import copy
import re
import sys
from io import BytesIO
from itertools import chain
from django.conf import settings
from django.core import signing
from django.core.exceptions import DisallowedHost, ImproperlyConfigured
from django.core.files import uploadhandler
from django.h... | bsd-3-clause |
ifuding/Kaggle | ADDC/Code/BarisKanber.py | 3 | 14070 | """
A non-blending lightGBM model that incorporates portions and ideas from various public kernels
This kernel gives LB: 0.977 when the parameter 'debug' below is set to 0 but this implementation requires a machine with ~32 GB of memory
"""
import pandas as pd
import time
import numpy as np
from sklearn.cross_validati... | apache-2.0 |
DmitryADP/diff_qc750 | external/webkit/Tools/Scripts/webkitpy/tool/steps/applypatch.py | 15 | 2139 | # Copyright (C) 2010 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 th... | gpl-2.0 |
alirizakeles/zato | code/zato-web-admin/src/zato/admin/static/brython/_brython/Lib/select.py | 9 | 9708 | """
borrowed from jython
https://bitbucket.org/jython/jython/raw/28a66ba038620292520470a0bb4dc9bb8ac2e403/Lib/select.py
"""
#import java.nio.channels.SelectableChannel
#import java.nio.channels.SelectionKey
#import java.nio.channels.Selector
#from java.nio.channels.SelectionKey import OP_ACCEPT, OP_CONNECT, OP... | gpl-3.0 |
praneethkumarpidugu/matchmaking | lib/python2.7/site-packages/cryptography/hazmat/backends/commoncrypto/hashes.py | 61 | 2040 | # 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 Unsupp... | mit |
da1z/intellij-community | python/lib/Lib/site-packages/django/contrib/contenttypes/management.py | 315 | 2458 | from django.contrib.contenttypes.models import ContentType
from django.db.models import get_apps, get_models, signals
from django.utils.encoding import smart_unicode
def update_contenttypes(app, created_models, verbosity=2, **kwargs):
"""
Creates content types for models in the given app, removing any model
... | apache-2.0 |
koniiiik/django | tests/generic_views/views.py | 61 | 8443 | from __future__ import unicode_literals
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
from django.urls import reverse, reverse_lazy
from django.utils.decorators import method_decorator
from django.views import generic
from .forms import AuthorForm, ContactForm
f... | bsd-3-clause |
sudheesh001/oh-mainline | vendor/packages/mechanize/test/test_pickle.py | 22 | 1042 | import cPickle
import cStringIO as StringIO
import pickle
import mechanize
import mechanize._response
import mechanize._testcase
def pickle_and_unpickle(obj, implementation):
return implementation.loads(implementation.dumps(obj))
def test_pickling(obj, check=lambda unpickled: None):
check(pickle_and_unpick... | agpl-3.0 |
Nicop06/ansible | contrib/inventory/abiquo.py | 117 | 8834 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
External inventory script for Abiquo
====================================
Shamelessly copied from an existing inventory script.
This script generates an inventory that Ansible can understand by making API requests to Abiquo API
Requires some python libraries, ensure ... | gpl-3.0 |
evansd/django | tests/httpwrappers/tests.py | 29 | 30359 | import copy
import json
import os
import pickle
import unittest
import uuid
from django.core.exceptions import DisallowedRedirect
from django.core.serializers.json import DjangoJSONEncoder
from django.core.signals import request_finished
from django.db import close_old_connections
from django.http import (
BadHead... | bsd-3-clause |
Lujeni/ansible | lib/ansible/modules/storage/netapp/na_elementsw_snapshot.py | 52 | 13120 | #!/usr/bin/python
# (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or
# https://www.gnu.org/licenses/gpl-3.0.txt)
'''
Element OS Software Snapshot Manager
'''
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
eptmp3/Sick-Beard | lib/hachoir_parser/image/wmf.py | 90 | 23796 | """
Hachoir parser of Microsoft Windows Metafile (WMF) file format.
Documentation:
- Microsoft Windows Metafile; also known as: WMF,
Enhanced Metafile, EMF, APM
http://wvware.sourceforge.net/caolan/ora-wmf.html
- libwmf source code:
- include/libwmf/defs.h: enums
- src/player/meta.h: arguments parser... | gpl-3.0 |
GNOME/pygobject | tests/test_cairo.py | 1 | 11911 | # -*- Mode: Python; py-indent-offset: 4 -*-
# vim: tabstop=4 shiftwidth=4 expandtab
import unittest
import pytest
import gi
try:
gi.require_foreign('cairo')
import cairo
has_cairo = True
except ImportError:
has_cairo = False
has_region = has_cairo and hasattr(cairo, "Region")
try:
from gi.repos... | lgpl-2.1 |
hojel/calibre | src/calibre/ebooks/docx/cleanup.py | 11 | 6742 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
import os
NBSP = '\xa0'
def mergeable(previous, current):
if previous.... | gpl-3.0 |
2013Commons/HUE-SHARK | desktop/core/ext-py/django-extensions-0.5/build/lib.linux-i686-2.7/django_extensions/management/commands/sqldiff.py | 7 | 29796 | """
sqldiff.py - Prints the (approximated) difference between models and database
TODO:
- better support for relations
- better support for constraints (mainly postgresql?)
- support for table spaces with postgresql
- when a table is not managed (meta.managed==False) then only do a one-way
sqldiff ? show differ... | apache-2.0 |
huchoi/edx-platform | cms/djangoapps/contentstore/management/commands/clone_course.py | 13 | 2005 | """
Script for cloning a course
"""
from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.django import modulestore
from student.roles import CourseInstructorRole, CourseStaffRole
from opaque_keys.edx.keys import CourseKey
from opaque_keys import InvalidKeyError
from opaque_keys.edx... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.