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 |
|---|---|---|---|---|---|
gtko/Sick-Beard | lib/requests/packages/urllib3/packages/ordered_dict.py | 1093 | 8936 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_ide... | gpl-3.0 |
jfrederickson/sibyl | cmds/note.py | 2 | 4639 | # -*- coding: utf-8 -*-
#
# Sibyl: A modular Python chat bot framework
# Copyright (c) 2015-2017 Joshua Haas <jahschwa.com>
#
# This file is part of Sibyl.
#
# Sibyl 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 Foundat... | gpl-3.0 |
DavidAndreev/indico | indico/modules/news/views.py | 1 | 1384 | # This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | gpl-3.0 |
yunqu/PYNQ | pynq/tests/util.py | 4 | 2399 | # Copyright (c) 2016, Xilinx, 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of ... | bsd-3-clause |
ferabra/edx-platform | common/test/acceptance/tests/lms/test_lms_user_preview.py | 59 | 15999 | # -*- coding: utf-8 -*-
"""
Tests the "preview" selector in the LMS that allows changing between Staff, Student, and Content Groups.
"""
from ..helpers import UniqueCourseTest, create_user_partition_json
from ...pages.studio.auto_auth import AutoAuthPage
from ...pages.lms.courseware import CoursewarePage
from ...pages... | agpl-3.0 |
ogrisel/scipy | scipy/fftpack/__init__.py | 13 | 2959 | """
==================================================
Discrete Fourier transforms (:mod:`scipy.fftpack`)
==================================================
Fast Fourier Transforms (FFTs)
==============================
.. autosummary::
:toctree: generated/
fft - Fast (discrete) Fourier Transform (FFT)
ifft ... | bsd-3-clause |
ibinti/intellij-community | python/helpers/pydev/_pydev_imps/_pydev_SimpleXMLRPCServer.py | 76 | 21765 | #Just a copy of the version in python 2.5 to be used if it's not available in jython 2.1
"""Simple XML-RPC Server.
This module can be used to create simple XML-RPC servers
by creating a server and either installing functions, a
class instance, or by extending the SimpleXMLRPCServer
class.
It can also be used to hand... | apache-2.0 |
gojira/tensorflow | tensorflow/contrib/image/python/kernel_tests/distort_image_ops_test.py | 31 | 12532 | # 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 |
tyler6389/android_kernel_samsung_baffinlte | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# 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.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
anryko/ansible | test/units/module_utils/facts/network/test_iscsi_get_initiator.py | 68 | 2396 | # -*- coding: utf-8 -*-
# Copyright (c) 2019 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
from ansible.module_utils.facts.network import iscsi
from units.compat.mock im... | gpl-3.0 |
molpopgen/pyseq | docs/conf.py | 2 | 9974 | # -*- coding: utf-8 -*-
#
# pylibseq documentation build configuration file, created by
# sphinx-quickstart on Mon Oct 19 19:11:29 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | gpl-2.0 |
osmie/osm-irish-townlands | irish_townlands/views.py | 2 | 40005 | """Views."""
from __future__ import division
import re
from datetime import timedelta, datetime, date
import math
import json
import urllib
from itertools import groupby
from collections import defaultdict
from django.http import Http404, HttpResponse
from django.shortcuts import render_to_response, redirect
from djan... | gpl-3.0 |
srluge/SickRage | lib/unidecode/x0ad.py | 253 | 4766 | data = (
'gwan', # 0x00
'gwanj', # 0x01
'gwanh', # 0x02
'gwad', # 0x03
'gwal', # 0x04
'gwalg', # 0x05
'gwalm', # 0x06
'gwalb', # 0x07
'gwals', # 0x08
'gwalt', # 0x09
'gwalp', # 0x0a
'gwalh', # 0x0b
'gwam', # 0x0c
'gwab', # 0x0d
'gwabs', # 0x0e
'gwas', # 0x0f
'gwass', #... | gpl-3.0 |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_routes_operations.py | 1 | 20983 | # 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 |
anbangleo/NlsdeWeb | api/api/routes/problem.py | 7 | 3493 | from flask import Flask, request, session, send_from_directory, render_template
from flask import Blueprint
import api
from api.common import WebSuccess, WebError
from api.annotations import api_wrapper, require_login, require_teacher, require_admin, check_csrf
from api.annotations import block_before_competition, blo... | mit |
BhaskarNewase/NodeApp | node_modules/node-gyp/gyp/pylib/gyp/common.py | 1292 | 20063 | # 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.
from __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing d... | mit |
christopherpoole/CADMesh | cmake/generateSingleHeader.py | 1 | 4672 |
import os
import subprocess
from glob import glob
from pathlib import Path
def readFile(filepath):
try:
with open(filepath) as f:
lines = f.readlines()
except:
return []
return lines
def readFiles(filepaths):
names = map(lambda p: Path(p).stem, filepaths)
... | mit |
apavlo/h-store | third_party/python/boto/cloudfront/signers.py | 49 | 2088 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | gpl-3.0 |
kennethreitz/pipenv | pipenv/patched/notpip/_internal/commands/__init__.py | 1 | 4020 | """
Package containing all pip commands
"""
# The following comment should be removed at some point in the future.
# mypy: disallow-untyped-defs=False
from __future__ import absolute_import
import importlib
from collections import OrderedDict, namedtuple
from pipenv.patched.notpip._internal.utils.typing import MYPY... | mit |
trondhindenes/ansible | contrib/inventory/collins.py | 27 | 17972 | #!/usr/bin/env python
"""
Collins external inventory script
=================================
Ansible has a feature where instead of reading from /etc/ansible/hosts
as a text file, it can query external programs to obtain the list
of hosts, groups the hosts are in, and even variables to assign to each host.
Collins ... | gpl-3.0 |
maxrothman/aws-alfred-workflow | venv/lib/python2.7/site-packages/docutils/writers/docutils_xml.py | 108 | 6981 | # $Id: docutils_xml.py 7497 2012-08-16 15:17:29Z milde $
# Author: David Goodger, Paul Tremblay, Guenter Milde
# Maintainer: docutils-develop@lists.sourceforge.net
# Copyright: This module has been placed in the public domain.
"""
Simple document tree Writer, writes Docutils XML according to
http://docutils.sourceforg... | mit |
jerwin28/Final-Project | tailbone/files/__init__.py | 34 | 3427 | # Copyright 2013 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... | apache-2.0 |
silly-wacky-3-town-toon/SOURCE-COD | toontown/toontowngui/ToontownLoadingBlocker.py | 6 | 8039 | from direct.directnotify import DirectNotifyGlobal
from direct.gui.DirectGui import *
from pandac.PandaModules import TextNode
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
from toontown.toontowngui import TTDialog
from otp.otpgui.OTPDialog import *
from direct.interval.LerpInt... | apache-2.0 |
broadinstitute/PyGithub | github/CommitStatus.py | 25 | 4733 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
danieljabailey/FreeCAD | src/Mod/PartDesign/fcgear/fcgeardialog.py | 44 | 2582 | # (c) 2014 David Douard <david.douard@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (LGPL)
# as published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.... | lgpl-2.1 |
mahak/ansible | test/support/integration/plugins/modules/postgresql_set.py | 47 | 13648 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru>
# 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 = {... | gpl-3.0 |
brian-rose/climlab | climlab/tests/test_emanuel_convection.py | 1 | 6379 | from __future__ import division
import numpy as np
import climlab
from climlab.convection import emanuel_convection
from climlab.tests.xarray_test import to_xarray
import pytest
# These test data are based on direct single-column tests of the CONVECT43c.f
# fortran source code. We are just checking to see if we get... | mit |
nhr/openshift-ansible | roles/lib_openshift/library/oc_process.py | 1 | 55775 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | apache-2.0 |
naresh21/synergetics-edx-platform | cms/djangoapps/contentstore/views/tests/test_programs.py | 11 | 6384 | """Tests covering the Programs listing on the Studio home."""
import json
from django.conf import settings
from django.core.urlresolvers import reverse
import httpretty
import mock
from edx_oauth2_provider.tests.factories import ClientFactory
from provider.constants import CONFIDENTIAL
from openedx.core.djangoapps.pr... | agpl-3.0 |
antofik/Wartech | WartechLogic/map/views.py | 1 | 3743 | # coding=utf-8
from django.db import transaction
from django.http import HttpResponse
import json
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.db.models import Q
from models import *
from random import randint
from PIL import Image
def JsonResponse(request, da... | mit |
manisandro/QGIS | tests/src/python/test_qgsgraduatedsymbolrenderer.py | 8 | 18189 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsGraduatedSymbolRenderer
.. note:: 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 vers... | gpl-2.0 |
DirtyUnicorns/android_external_chromium_org | tools/memory_inspector/memory_inspector/data/file_storage.py | 54 | 6131 | # 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.
"""This module handles file-backed storage of the core classes.
The storage is logically organized as follows:
Storage -> N Archives -> 1 Symbol index
... | bsd-3-clause |
yencarnacion/jaikuengine | .google_appengine/google/appengine/api/search/stub/tokens.py | 11 | 3103 | #!/usr/bin/env python
#
# Copyright 2007 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 required by applicable law o... | apache-2.0 |
rishibarve/incubator-airflow | airflow/utils/asciiart.py | 67 | 2298 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
aral/isvat | django/contrib/gis/sitemaps/kml.py | 482 | 2481 | from django.core import urlresolvers
from django.contrib.sitemaps import Sitemap
from django.contrib.gis.db.models.fields import GeometryField
from django.db import models
class KMLSitemap(Sitemap):
"""
A minimal hook to produce KML sitemaps.
"""
geo_format = 'kml'
def __init__(self, locations=Non... | mit |
KaranToor/MA450 | google-cloud-sdk/lib/third_party/pyasn1_modules/pem.py | 127 | 1893 | import base64, sys
stSpam, stHam, stDump = 0, 1, 2
# The markers parameters is in form ('start1', 'stop1'), ('start2', 'stop2')...
# Return is (marker-index, substrate)
def readPemBlocksFromFile(fileObj, *markers):
startMarkers = dict(map(lambda x: (x[1],x[0]),
enumerate(map(lambda x: ... | apache-2.0 |
treetrnk/Tuxemon | tuxemon/core/components/event/actions/create_npc.py | 2 | 2720 | # -*- coding: utf-8 -*-
#
# Tuxemon
# Copyright (c) 2014-2017 William Edwards <shadowapex@gmail.com>,
# Benjamin Bean <superman2k5@gmail.com>
#
# This file is part of Tuxemon
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public L... | gpl-3.0 |
don-github/edx-platform | common/djangoapps/util/tests/test_submit_feedback.py | 126 | 16598 | """Tests for the Zendesk"""
from django.contrib.auth.models import AnonymousUser
from django.http import Http404
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from student.tests.factories import UserFactory
from util import views
from zen... | agpl-3.0 |
ojengwa/talk | venv/lib/python2.7/site-packages/django/contrib/gis/geos/polygon.py | 75 | 6827 | from ctypes import c_uint, byref
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.libgeos import get_pointer_arr, GEOM_PTR
from django.contrib.gis.geos.linestring import LinearRing
from django.contrib.gis.geos import prototypes as capi
from django.utils import six
from django.utils... | mit |
ksrajkumar/openerp-6.1 | openerp/addons/base/module/report/__init__.py | 463 | 1089 | # -*- 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 |
openstack/nova | nova/tests/unit/policies/test_tenant_networks.py | 3 | 3690 | # 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 |
jcoady9/python-for-android | python3-alpha/python3-src/Tools/pynche/PyncheWidget.py | 113 | 10615 | """Main Pynche (Pythonically Natural Color and Hue Editor) widget.
This window provides the basic decorations, primarily including the menubar.
It is used to bring up other windows.
"""
import sys
import os
from tkinter import *
from tkinter import messagebox, filedialog
import ColorDB
# Milliseconds between interru... | apache-2.0 |
koparasy/gemfi | src/arch/x86/bios/IntelMP.py | 48 | 9677 | # Copyright (c) 2008 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
rschiang/shedskin | examples/circle.py | 6 | 2589 | import sys
print sys.version
import math
def setup(width, height):
global SCREEN_WIDTH_2, SCREEN_HEIGHT_2
SCREEN_WIDTH_2 = width / 2
SCREEN_HEIGHT_2 = height / 2
def sqr_distance(x0, y0, x1, y1):
dx = x1 - x0
dy = y1 - y0
return dx*dx + dy*dy
class Circle(object):
def _... | gpl-3.0 |
mrquim/repository.mrquim | script.module.youtube.dl/lib/youtube_dl/extractor/vesti.py | 71 | 4383 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import ExtractorError
from .rutv import RUTVIE
class VestiIE(InfoExtractor):
IE_DESC = 'Вести.Ru'
_VALID_URL = r'https?://(?:.+?\.)?vesti\.ru/(?P<id>.+)'
_TESTS = [
{
'ur... | gpl-2.0 |
Ca1ne/Enoch | scripts/build-all.py | 1250 | 9474 | #! /usr/bin/env python
# Copyright (c) 2009-2011, Code Aurora Forum. 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
# n... | gpl-2.0 |
koalalorenzo/python-digitalocean | digitalocean/tests/test_load_balancer.py | 1 | 18560 | import json
import unittest
import responses
import digitalocean
from .BaseTest import BaseTest
class TestLoadBalancer(BaseTest):
def setUp(self):
super(TestLoadBalancer, self).setUp()
self.lb_id = '4de7ac8b-495b-4884-9a69-1050c6793cd6'
self.vpc_uuid = "c33931f2-a26a-4e61-b85c-4e95a2ec43... | lgpl-3.0 |
nekulin/arangodb | 3rdParty/V8-4.3.61/build/gyp_environment.py | 25 | 1668 | # Copyright 2015 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Sets up various automatic gyp environment variables. These are used by
gyp_v8 and landmines.py which run at different stages of runhooks. To
make sure ... | apache-2.0 |
liangazhou/django-rdp | packages/PyDev/plugins/org.python.pydev.jython_4.4.0.201510052309/Lib/email/Header.py | 255 | 22243 | # Copyright (C) 2002-2006 Python Software Foundation
# Author: Ben Gertzfield, Barry Warsaw
# Contact: email-sig@python.org
"""Header encoding and decoding functionality."""
__all__ = [
'Header',
'decode_header',
'make_header',
]
import re
import binascii
import email.quoprimime
import email.base64m... | apache-2.0 |
xuguozhi/fast-rcnn | tools/reval.py | 50 | 2749 | #!/usr/bin/env python
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Reval = re-eval. Re-evaluate saved detections... | mit |
aviarypl/mozilla-l10n-addons-server | src/olympia/addons/tests/test_decorators.py | 2 | 5258 | from django import http
import mock
from six.moves.urllib_parse import quote
from olympia.addons import decorators as dec
from olympia.addons.models import Addon
from olympia.amo.tests import TestCase, addon_factory
class TestAddonView(TestCase):
def setUp(self):
super(TestAddonView, self).setUp()
... | bsd-3-clause |
sriki18/scipy | scipy/signal/_max_len_seq.py | 41 | 4942 | # Author: Eric Larson
# 2014
"""Tools for MLS generation"""
import numpy as np
from ._max_len_seq_inner import _max_len_seq_inner
__all__ = ['max_len_seq']
# These are definitions of linear shift register taps for use in max_len_seq()
_mls_taps = {2: [1], 3: [2], 4: [3], 5: [3], 6: [5], 7: [6], 8: [7, 6, 1],
... | bsd-3-clause |
ak-67/ZeroNet | src/Db/Db.py | 1 | 12059 | import sqlite3
import json
import time
import logging
import re
import os
import gevent
from DbCursor import DbCursor
opened_dbs = []
# Close idle databases to save some memory
def dbCleanup():
while 1:
time.sleep(60 * 5)
for db in opened_dbs[:]:
if time.time() - db.last_query_time >... | gpl-2.0 |
OpenSourcePolicyCenter/taxdata | puf_stage1/factors_finalprep.py | 1 | 3867 | """
Transform Stage_I_factors.csv (written by the stage1.py script) and
benefit_growth_rates.csv into growfactors.csv (used by Tax-Calculator).
"""
import numpy as np
import pandas as pd
import os
# pylint: disable=invalid-name
CUR_PATH = os.path.abspath(os.path.dirname(__file__))
first_benefit_year = 2014
inben_file... | mit |
hbhdytf/mac | test/probe/test_reconstructor_revert.py | 14 | 14812 | #!/usr/bin/python -u
# Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 ap... | apache-2.0 |
Tim1928/DBK-3.0_4.1 | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
MatthieuDartiailh/pyvisa-sim | pyvisa-sim/parser.py | 1 | 8388 | # -*- coding: utf-8 -*-
"""
pyvisa-sim.parser
~~~~~~~~~~~~~~~~~
Parser function
:copyright: 2014 by PyVISA-sim Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
import os
from io import open, StringIO
from contextlib import closing
from traceback import forma... | mit |
watchdogpolska/poradnia.siecobywatelska.pl | poradnia/users/models.py | 3 | 7990 | import re
from django.contrib.auth.models import AbstractUser, UserManager
from django.db import models
from django.db.models import Case, Count, F, Func, IntegerField, Q, When
from django.db.models.query import QuerySet
from django.utils.datetime_safe import datetime
from django.utils.translation import ugettext_lazy... | bsd-3-clause |
IOKP-kitkat/kernel_asus_flo | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
nielsvanoch/django | django/db/backends/postgresql_psycopg2/introspection.py | 14 | 9414 | from __future__ import unicode_literals
from django.db.backends import BaseDatabaseIntrospection, FieldInfo, TableInfo
from django.utils.encoding import force_text
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Maps type codes to Django Field types.
data_types_reverse = {
16: 'BooleanField... | bsd-3-clause |
wholeGenomeSequencingAnalysisPipeline/BacPipe | cutadapt-1.12/cutadapt/qualtrim.py | 2 | 1766 | # coding: utf-8
"""
Quality trimming.
"""
from __future__ import print_function, division, absolute_import
import sys
if sys.version > '3':
xrange = range
def quality_trim_index(qualities, cutoff, base=33):
"""
Find the position at which to trim a low-quality end from a nucleotide sequence.
Qualities are assum... | gpl-3.0 |
CyanogenMod/lge-kernel-e400 | scripts/gcc-wrapper.py | 41 | 3803 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Code Aurora Forum. 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 ... | gpl-2.0 |
teichopsia-/take_brake | lib/python2.7/site-packages/pip/_vendor/requests/exceptions.py | 895 | 2517 | # -*- coding: utf-8 -*-
"""
requests.exceptions
~~~~~~~~~~~~~~~~~~~
This module contains the set of Requests' exceptions.
"""
from .packages.urllib3.exceptions import HTTPError as BaseHTTPError
class RequestException(IOError):
"""There was an ambiguous exception that occurred while handling your
request.""... | mpl-2.0 |
Medium/phantomjs-1 | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/xvfbdriver.py | 117 | 5503 | # 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 the ... | bsd-3-clause |
CodingCat/mxnet | tests/python/gpu/test_operator_gpu.py | 1 | 86764 | # 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 |
soldag/home-assistant | homeassistant/components/arduino/switch.py | 14 | 2280 | """Support for switching Arduino pins on and off."""
import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
from . import DOMAIN
CONF_PINS = "pins"
CONF_TYPE = "digital"
CONF_NEG... | apache-2.0 |
doungni/selenium | py/selenium/webdriver/support/select.py | 67 | 8536 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
163gal/Time-Line | timelinelib/wxgui/components/propertyeditors/baseeditor.py | 2 | 1279 | # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Rickard Lindberg, Roger Lindberg
#
# This file is part of Timeline.
#
# Timeline 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 th... | gpl-3.0 |
sloanyang/raspberrry2v8 | deps/v8/tools/testrunner/server/daemon.py | 123 | 3753 | #!/usr/bin/env python
# This code has been written by Sander Marechal and published at:
# http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
# where the author has placed it in the public domain (see comment #6 at
# http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/#c6... | gpl-2.0 |
nhenezi/kuma | vendor/packages/sqlalchemy/test/engine/test_execute.py | 7 | 18653 | from sqlalchemy.test.testing import eq_, assert_raises
import re
from sqlalchemy.interfaces import ConnectionProxy
from sqlalchemy import MetaData, Integer, String, INT, VARCHAR, func, \
bindparam, select
from sqlalchemy.test.schema import Table, Column
import sqlalchemy as tsa
from sqlalchemy.test import TestBase,... | mpl-2.0 |
gonzafirewall/kivy | kivy/vector.py | 44 | 10228 | '''Vector
======
The :class:`Vector` represents a 2D vector (x, y).
Our implementation is built on top of a Python list.
An example of constructing a Vector::
>>> # Construct a point at 82,34
>>> v = Vector(82, 34)
>>> v[0]
82
>>> v.x
82
>>> v[1]
34
>>> v.y
34
>>> # Cons... | mit |
npadgen/read-a-script | utils.py | 1 | 1176 | from enum import Enum
import jouvence.document
class ElementType(Enum):
ACTION = jouvence.document.TYPE_ACTION
CENTERED_ACTION = jouvence.document.TYPE_CENTEREDACTION
CHARACTER = jouvence.document.TYPE_CHARACTER
DIALOG = jouvence.document.TYPE_DIALOG
PARENTHETICAL = jouvence.document.TYPE_PARENT... | bsd-3-clause |
madsbuch/GridDispenser | dispenserrun/printrun/printrun/stltool.py | 3 | 8608 | # This file is part of the Printrun suite.
#
# Printrun 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.
#
# Printrun is distributed in ... | gpl-2.0 |
Bitl/RBXLegacy-src | Cut/RBXLegacyDiscordBot/lib/youtube_dl/extractor/xtube.py | 22 | 5972 | from __future__ import unicode_literals
import itertools
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
js_to_json,
orderedSet,
parse_duration,
sanitized_Request,
str_to_int,
)
class XTubeIE(InfoExtractor):
_VALID_URL = r'''(?x)
(?:... | gpl-3.0 |
aminert/scikit-learn | sklearn/cross_validation.py | 96 | 58309 | """
The :mod:`sklearn.cross_validation` module includes utilities for cross-
validation and performance evaluation.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>,
# Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
from... | bsd-3-clause |
wazeerzulfikar/scikit-learn | sklearn/linear_model/tests/test_base.py | 33 | 17862 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from scipy import linalg
from itertools import product
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils... | bsd-3-clause |
ngageoint/scale | scale/job/test/messages/test_uncancel_jobs.py | 1 | 7505 | from __future__ import unicode_literals
import datetime
import django
from django.utils.timezone import now
from django.test import TransactionTestCase
from job.messages.uncancel_jobs import UncancelJobs
from job.models import Job
from job.test import utils as job_test_utils
from recipe.test import utils as recipe_t... | apache-2.0 |
zulip/django | tests/utils_tests/test_baseconv.py | 326 | 1787 | from unittest import TestCase
from django.utils.baseconv import (
BaseConverter, base2, base16, base36, base56, base62, base64,
)
from django.utils.six.moves import range
class TestBaseConv(TestCase):
def test_baseconv(self):
nums = [-10 ** 10, 10 ** 10] + list(range(-100, 100))
for converte... | bsd-3-clause |
tntnatbry/tensorflow | tensorflow/contrib/learn/python/learn/ops/seq2seq_ops_test.py | 33 | 4346 | # Copyright 2016 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 |
EvanK/ansible | lib/ansible/plugins/filter/ipaddr.py | 25 | 32356 | # (c) 2014, Maciej Delmanowski <drybjed@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 |
merelinguist/ludolatin | config.py | 3 | 3271 | import os
database_username = os.getenv('DATABASE_USERNAME', 'root')
database_password = os.getenv('DATABASE_PASSWORD', '')
class Config(object):
SITE_NAME = "LudoLatin"
SECRET_KEY = os.getenv('SECRET_KEY') or 'secret key, just for testing'
# SQLAlchemy settings
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
... | mit |
ryfeus/lambda-packs | Shapely_numpy/source/packaging/requirements.py | 140 | 4271 | # 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
import string
import re
from pyparsing import stringStart, stringEnd, ori... | mit |
nerginer/GrovePi | Software/Python/grove_moisture_sensor.py | 7 | 2296 | #!/usr/bin/env python
#
# GrovePi Example for using the Grove Moisture Sensor (http://www.seeedstudio.com/wiki/Grove_-_Moisture_sensor)
#
# The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi
#
# Have a question about this example? A... | mit |
pferreir/indico | indico/util/json.py | 4 | 1603 | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from collections import UserDict
from datetime import date, datetime
from speaklater import _LazyString
... | mit |
Jchase2/py-pubsubhubbub-subscriber | fffp.py | 1 | 2310 | #!/usr/local/bin/python
# Copyright 2015 JChase II
#
# 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 program is... | gpl-2.0 |
patrick246/tdesktop | Telegram/SourceFiles/mtproto/generate.py | 1 | 45625 | '''
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop 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... | gpl-3.0 |
akiss77/servo | tests/wpt/harness/wptrunner/update/state.py | 196 | 4417 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import cPickle as pickle
here = os.path.abspath(os.path.split(__file__)[0])
class State(object):
filenam... | mpl-2.0 |
nomadcube/scikit-learn | examples/mixture/plot_gmm_pdf.py | 284 | 1528 | """
=============================================
Density Estimation for a mixture of Gaussians
=============================================
Plot the density estimation of a mixture of two Gaussians. Data is
generated from two Gaussians with different centers and covariance
matrices.
"""
import numpy as np
import ma... | bsd-3-clause |
webmedic/booker | src/atom/auth.py | 297 | 1199 | #!/usr/bin/env python
#
# Copyright (C) 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 required by... | mit |
fdupoux/ansible-modules-core | files/acl.py | 58 | 10136 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#
... | gpl-3.0 |
smmribeiro/intellij-community | python/helpers/pydev/_pydevd_bundle/pydevd_traceproperty.py | 13 | 3736 | '''For debug purpose we are replacing actual builtin property by the debug property
'''
from _pydevd_bundle.pydevd_comm import get_global_debugger
from _pydevd_bundle.pydevd_constants import DebugInfoHolder, IS_PY2
import pydevd_tracing
import traceback
#================================================================... | apache-2.0 |
yomolify/cs-webserver | node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py | 1558 | 4945 | # Copyright (c) 2011 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.
import re
import os
def XmlToString(content, encoding='utf-8', pretty=False):
""" Writes the XML content to disk, touching the file only if it has changed.
... | mit |
2014cdag2/w17x1 | static/Brython3.1.1-20150328-091302/Lib/optparse.py | 728 | 60616 | """A powerful, extensible, and easy-to-use option parser.
By Greg Ward <gward@python.net>
Originally distributed as Optik.
For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).
Simple usage example:
from optparse import OptionParser
pa... | agpl-3.0 |
zheka/nacl-gdb | gdb/python/lib/gdb/types.py | 23 | 3302 | # Type utilities.
# Copyright (C) 2010-2012 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 versi... | gpl-2.0 |
misisnik/ExternalInterface | ENV/Lib/encodings/shift_jisx0213.py | 816 | 1059 | #
# shift_jisx0213.py: Python Unicode Codec for SHIFT_JISX0213
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('shift_jisx0213')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEnc... | mit |
chen0040/pyalgs | pyalgs/algorithms/graphs/directed_cycle.py | 1 | 1475 | from pyalgs.data_structures.commons.stack import Stack
from pyalgs.data_structures.graphs.graph import DirectedEdgeWeightedGraph, Digraph
class DirectedCycle(object):
marked = None
onStack = None
cycle = None
edgeTo = None
def __init__(self, G):
if isinstance(G, DirectedEdgeWeightedGraph... | bsd-3-clause |
Pakoach/Sick-Beard | cherrypy/process/wspbus.py | 45 | 14462 | """An implementation of the Web Site Process Bus.
This module is completely standalone, depending only on the stdlib.
Web Site Process Bus
--------------------
A Bus object is used to contain and manage site-wide behavior:
daemonization, HTTP server start/stop, process reload, signal handling,
drop privileges, PID f... | gpl-3.0 |
moovweb/open-tritium | clibs/src/libxml2/python/tests/build.py | 87 | 1542 | #!/usr/bin/python -u
import libxml2
import sys
# Memory debug specific
libxml2.debugMemory(1)
doc = libxml2.newDoc("1.0")
comment = doc.newDocComment("This is a generated document")
doc.addChild(comment)
pi = libxml2.newPI("test", "PI content")
doc.addChild(pi)
root = doc.newChild(None, "doc", None)
ns = root.newNs("... | mpl-2.0 |
jcstill/P4wnP1 | hidtools/hidsrv9.py | 6 | 10097 | #!/usr/bin/python
# This file is part of P4wnP1.
#
# Copyright (c) 2017, Marcus Mengs.
#
# P4wnP1 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 ... | gpl-3.0 |
motion2015/edx-platform | lms/djangoapps/shoppingcart/tests/test_microsites.py | 101 | 7876 | """
Tests for Microsite Dashboard with Shopping Cart History
"""
import mock
from django.core.urlresolvers import reverse
from mock import patch
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from shoppingcart.models import (
O... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.