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 |
|---|---|---|---|---|---|
zvolsky/glassclear | languages/ru.py | 157 | 8945 | # coding: utf8
{
'!langcode!': 'ru',
'!langname!': 'Русский',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Изменить" - необязательное выражение вида "field1=\'новое значение\'". Результаты операции JOIN нельзя изменить или удалить.',
'%d days ago'... | agpl-3.0 |
RandallDW/Aruba_plugin | plugins/org.python.pydev/pysrc/_pydevd_bundle/pydevd_referrers.py | 1 | 8832 | from _pydevd_bundle.pydevd_constants import dict_contains
import sys
from _pydevd_bundle import pydevd_xml
from os.path import basename
import traceback
try:
from urllib import quote, quote_plus, unquote, unquote_plus
except:
from urllib.parse import quote, quote_plus, unquote, unquote_plus #@Reimport @Unresol... | epl-1.0 |
guker/fbthrift | thrift/lib/py/protocol/TBinaryProtocol.py | 11 | 7690 | #
# 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 |
normtown/SickRage | lib/unidecode/x1d4.py | 248 | 3839 | data = (
'A', # 0x00
'B', # 0x01
'C', # 0x02
'D', # 0x03
'E', # 0x04
'F', # 0x05
'G', # 0x06
'H', # 0x07
'I', # 0x08
'J', # 0x09
'K', # 0x0a
'L', # 0x0b
'M', # 0x0c
'N', # 0x0d
'O', # 0x0e
'P', # 0x0f
'Q', # 0x10
'R', # 0x11
'S', # 0x12
'T', # 0x13
'U', # 0... | gpl-3.0 |
robclark/chromium | ppapi/generators/idl_propertynode.py | 13 | 5464 | #!/usr/bin/env python
# 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.
""" Hierarchical property system for IDL AST """
import re
import sys
from idl_log import ErrOut, InfoOut, WarnOut
from idl_option... | bsd-3-clause |
vivekramamoorthy/tcpdump | doc/conf.py | 3 | 10475 | # -*- coding: utf-8 -*-
#
# Tcpdump library documentation build configuration file.
#
# 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 configuration values have a default; values that ... | apache-2.0 |
adamcaudill/yawast | yawast/external/spinner.py | 1 | 1596 | # From: https://stackoverflow.com/a/39504463
# License: Creative Commons Attribution-Share Alike
# Copyright: Victor Moyseenko
import sys
import threading
import time
class Spinner:
running = False
busy = False
delay = 0.1
@staticmethod
def spinning_cursor():
while 1:
for cur... | mit |
BackupTheBerlios/pyhttpd-svn | core/baseHTTPRequestHandler.py | 1 | 11117 | # -*- coding: utf-8 -*-
##################################################################
# pyHTTPd
# $Id$
# (c) 2006 by Tim Taubert
##################################################################
import os, sys, socket, time, mimetools
from mimetypes import MimeTypes
from baseConfig import pConfig
import baseRo... | gpl-2.0 |
szaydel/psutil | psutil/_pslinux.py | 1 | 40630 | #!/usr/bin/env python
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Linux platform implementation."""
from __future__ import division
import os
import errno
import socket
import struct
import sys... | bsd-3-clause |
Pear0/binutils-gdb | gdb/python/lib/gdb/xmethod.py | 9 | 11077 | # Python side of the support for xmethods.
# Copyright (C) 2013-2017 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 you... | gpl-2.0 |
NMGRL/pychron | pychron/entry/tasks/importer_panes.py | 3 | 4782 | # ===============================================================================
# Copyright 2013 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 |
sarutobi/flowofkindness | rynda/core/mixins.py | 3 | 2565 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.views.generic.base import TemplateResponseMixin
from django.views.generic.edit import FormMixin, ProcessFormView
class PaginatorMixin(object):
""" Paginator line mixin. Best use with list-based mixins """
def paginator(self, num_pages, pag... | mit |
Rdbaker/Mealbound | ceraon/utils.py | 1 | 4801 | # -*- coding: utf-8 -*-
"""Helper utilities and decorators."""
from datetime import timedelta as td
from datetime import tzinfo
from threading import Thread
import requests
from flask import Blueprint, current_app, flash, request
def get_fb_access_token():
"""Get an access token from facebook for graph API calls... | bsd-3-clause |
vFense/vFenseAgent-nix | agent/deps/mac/Python-2.7.5/lib/python2.7/test/profilee.py | 398 | 3041 | """
Input for test_profile.py and test_cprofile.py.
IMPORTANT: This stuff is touchy. If you modify anything above the
test class you'll have to regenerate the stats by running the two
test files.
*ALL* NUMBERS in the expected output are relevant. If you change
the formatting of pstats, please don't just regenerate t... | lgpl-3.0 |
dvliman/jaikuengine | .google_appengine/lib/django-1.4/tests/modeltests/aggregation/models.py | 139 | 1181 | # coding: utf-8
from django.db import models
class Author(models.Model):
name = models.CharField(max_length=100)
age = models.IntegerField()
friends = models.ManyToManyField('self', blank=True)
def __unicode__(self):
return self.name
class Publisher(models.Model):
name = models.CharField... | apache-2.0 |
ActiveState/code | recipes/Python/577336_Fast_reentrant_optimistic_lock_implemented/recipe-577336.py | 1 | 4351 | from cpython cimport pythread
from cpython.exc cimport PyErr_NoMemory
cdef class FastRLock:
"""Fast, re-entrant locking.
Under uncongested conditions, the lock is never acquired but only
counted. Only when a second thread comes in and notices that the
lock is needed, it acquires the lock and notifies... | mit |
duyetdev/openerp-6.1.1 | openerp/addons/marketing/__openerp__.py | 9 | 1744 | # -*- 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 |
ntuecon/server | pyenv/Lib/site-packages/pbr/tests/test_setup.py | 10 | 19413 | # Copyright (c) 2011 OpenStack Foundation
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http:/... | bsd-3-clause |
Melecio/face-detection | neural_network.py | 1 | 4860 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import argparse
from os import listdir
from os.path import isfile, join
from random import shuffle
from pybrain.datasets import ClassificationDataSet
from pybrain.tools.shortcuts import buildNetwork
from pybrain.supervised.trainers i... | bsd-3-clause |
jcoady9/python-for-android | python3-alpha/python3-src/Lib/test/test_copyreg.py | 173 | 4217 | import copyreg
import unittest
from test import support
from test.pickletester import ExtensionSaver
class C:
pass
class WithoutSlots(object):
pass
class WithWeakref(object):
__slots__ = ('__weakref__',)
class WithPrivate(object):
__slots__ = ('__spam',)
class WithSingleString(object):
__slot... | apache-2.0 |
manjunaths/tensorflow | tensorflow/contrib/linalg/python/kernel_tests/linear_operator_udvh_update_test.py | 5 | 9004 | # 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 |
rodrigofaccioli/drugdesign | virtualscreening/vina/spark/hydrogen_bond_crud.py | 1 | 4480 | from pyspark.sql import SQLContext, Row
from vina_utils import get_ligand_from_receptor_ligand_model
"""
Creates data frame of residue list
sqlCtx - spark SQL context
residue_listRDD - RDD for creating data frame. It had been created by load_file_select_hydrogen_bond function
"""
def create_df_residue_list(sqlCtx,... | apache-2.0 |
marcore/edx-platform | common/djangoapps/third_party_auth/strategy.py | 45 | 2184 | """
A custom Strategy for python-social-auth that allows us to fetch configuration from
ConfigurationModels rather than django.settings
"""
from .models import OAuth2ProviderConfig
from .pipeline import AUTH_ENTRY_CUSTOM
from social.backends.oauth import OAuthAuth
from social.strategies.django_strategy import DjangoStr... | agpl-3.0 |
maxamillion/anaconda | pyanaconda/bootloader.py | 1 | 89455 | # bootloader.py
# Anaconda's bootloader configuration module.
#
# Copyright (C) 2011 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later versi... | gpl-2.0 |
benediktkr/lokun-record | record/sec.py | 1 | 2077 | from random import randint
def compare1toN(str1, strl):
return any([compare(str1, a) for a in strl])
def compare(str1, str2):
return compare_const2(str1, str2)
def compare_const2(str1, str2):
if len(str1) != len(str2):
return False
result = 0
for x, y in zip(str1, str2):
result |... | agpl-3.0 |
dcrosta/mongo-disco | app/job.py | 1 | 2372 | #!/usr/bin/env python
# encoding: utf-8
'''
File: DiscoJob.py
Author: NYU ITP team
Description: Disco Job Wrapper
'''
from disco.core import Job, result_iterator
from disco.worker.classic.worker import Params
from disco.worker.classic.modutil import locate_modules,find_modules
from mongodb_io import mongodb_output_str... | apache-2.0 |
classicboyir/BuildingMachineLearningSystemsWithPython | ch09/01_fft_based_classifier.py | 24 | 3740 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
import numpy as np
from collections import defaultdict
from sklearn.metrics import precision_recall_cu... | mit |
davidalbertonogueira/TurboParser | semeval2015_data/scripts/augment_with_companion_data.py | 6 | 2153 | import sys
import pdb
keep_document_names = True
has_sense = True # True for SemEval 2015, False for SemEval 2014.
trim_first_line = True # True for SemEval 2015, False for SemEval 2014.
filepath = sys.argv[1]
if len(sys.argv) > 2:
filepath_companion = sys.argv[2]
else:
filepath_companion = ''
f = open(filep... | lgpl-3.0 |
ropable/resource_tracking | tracking/migrations/0004_auto_20200102_0914.py | 1 | 1126 | # Generated by Django 2.1.11 on 2020-01-02 01:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tracking', '0003_auto_20190308_1114'),
]
operations = [
migrations.AlterField(
model_name='device',
name='symbol',
... | bsd-3-clause |
40223245/123 | static/Brython3.1.1-20150328-091302/Lib/unittest/mock.py | 739 | 71473 | # mock.py
# Test tools for mocking and patching.
# Maintained by Michael Foord
# Backport for other versions of Python available from
# http://pypi.python.org/pypi/mock
__all__ = (
'Mock',
'MagicMock',
'patch',
'sentinel',
'DEFAULT',
'ANY',
'call',
'create_autospec',
'FILTER_DIR',
... | gpl-3.0 |
tdsimao/tt | django/contrib/gis/gdal/driver.py | 411 | 2411 | # prerequisites imports
from ctypes import c_void_p
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import OGRException
from django.contrib.gis.gdal.prototypes import ds as capi
# For more information, see the OGR C API source code:
# http://www.gdal.org/ogr/ogr__api_8h.html
#
# ... | gpl-2.0 |
40423136/2017springcd_hw | plugin/liquid_tags/spotify.py | 313 | 1304 | """
Spotify Tag
---------
This implements a Liquid-style spotify tag for Pelican,
based on the jekyll / octopress youtube tag [1]_
Syntax
------
{% spotify id %}
Example
-------
{% spotify 1HNZcRFlIKwHAJD3LxvX4d %}
Output
------
<iframe
src='https://embed.spotify.com/?uri=spotify:track:1HNZcRFlIKwHAJD3LxvX4d'
... | agpl-3.0 |
tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/distutils/command/bdist.py | 228 | 5596 | """distutils.command.bdist
Implements the Distutils 'bdist' command (create a built [binary]
distribution)."""
__revision__ = "$Id$"
import os
from distutils.util import get_platform
from distutils.core import Command
from distutils.errors import DistutilsPlatformError, DistutilsOptionError
def show_formats():
... | bsd-3-clause |
elsigh/browserscope | third_party/uaparser/user_agent_parser.py | 3 | 12414 | #!/usr/bin/python2.5
#
# Copyright 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 applicable law... | apache-2.0 |
NathanW2/QGIS | tests/src/python/test_qgsfieldformatters.py | 1 | 13493 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for field formatters.
.. 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 version.
"""
... | gpl-2.0 |
flacjacket/sympy | sympy/core/tests/test_expr.py | 1 | 48018 | from __future__ import division
from sympy import (Add, Basic, S, Symbol, Wild, Float, Integer, Rational, I,
sin, cos, tan, exp, log, nan, oo, sqrt, symbols, Integral, sympify,
WildFunction, Poly, Function, Derivative, Number, pi, NumberSymbol, zoo,
Piecewise, Mul, Pow, nsimplify, ratsimp, trigsimp, rads... | bsd-3-clause |
praekelt/vumi-go | go/apps/tests/view_helpers.py | 1 | 2691 | from django.core.urlresolvers import reverse
from zope.interface import implements
from vumi.tests.helpers import generate_proxies, IHelper
from go.base import utils as base_utils
from go.base.tests.helpers import DjangoVumiApiHelper
from go.vumitools.tests.helpers import GoMessageHelper
from .helpers import Applica... | bsd-3-clause |
ProfessionalIT/maxigenios-website | sdk/google_appengine/lib/grizzled/grizzled/test/net/ftp/TestFTPListParse.py | 19 | 5678 | #!/usr/bin/python2.4
# $Id: 30ba7ab5303adb95edaa7bc695c6afaa26fda210 $
"""
Tester.
"""
# ---------------------------------------------------------------------------
# Imports
# ---------------------------------------------------------------------------
import time
import google3
from grizzled.net.ftp.parse import *... | mit |
popazerty/enigma2-obh | lib/python/Components/ServiceEventTracker.py | 124 | 4175 | InfoBarCount = 0
class InfoBarBase:
onInfoBarOpened = [ ]
onInfoBarClosed = [ ]
@staticmethod
def connectInfoBarOpened(fnc):
if not fnc in InfoBarBase.onInfoBarOpened:
InfoBarBase.onInfoBarOpened.append(fnc)
@staticmethod
def disconnectInfoBarOpened(fnc):
if fnc in InfoBarBase.onInfoBarOpened:
InfoB... | gpl-2.0 |
michaelaye/vispy | vispy/visuals/text/_sdf.py | 13 | 10545 | # -*- coding: utf-8 -*-
"""
Jump flooding algoritm for EDT using GLSL code:
Author: Stefan Gustavson (stefan.gustavson@gmail.com)
2010-08-24. This code is in the public domain.
Adapted to `vispy` by Eric Larson <larson.eric.d@gmail.com>.
"""
import numpy as np
from os import path as op
from ...gloo import (Program, F... | bsd-3-clause |
jjscarafia/odoo | addons/website_membership/models/product.py | 338 | 1264 | # -*- 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 |
beaker-project/beaker | Client/src/bkr/client/command.py | 1 | 13879 | # -*- coding: utf-8 -*-
# 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.
import optparse
import os
import sys
from optp... | gpl-2.0 |
yyu168/linux | tools/testing/selftests/tc-testing/tdc.py | 40 | 12519 | #!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0
"""
tdc.py - Linux tc (Traffic Control) unit test driver
Copyright (C) 2017 Lucas Bates <lucasb@mojatatu.com>
"""
import re
import os
import sys
import argparse
import json
import subprocess
from collections import OrderedDict
from string import Template
fro... | gpl-2.0 |
reneenoble/datacats | datacats/environment.py | 2 | 38413 | # Copyright 2014-2015 Boxkite Inc.
# This file is part of the DataCats package and is released under
# the terms of the GNU Affero General Public License version 3.0.
# See LICENSE.txt or http://www.fsf.org/licensing/licenses/agpl-3.0.html
from os.path import isdir, exists, join
from os import makedirs, remove, envir... | agpl-3.0 |
andmos/ansible | lib/ansible/module_utils/cloudstack.py | 7 | 24184 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, René Moser <mail@renemoser.net>
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import os
import sys
import time
import traceb... | gpl-3.0 |
KMK-ONLINE/ansible | lib/ansible/module_utils/lxd.py | 6 | 6082 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Hiroaki Nakamura <hnakamur@gmail.com>
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# ... | gpl-3.0 |
dmordom/nipype | nipype/interfaces/slicer/registration/tests/test_auto_FiducialRegistration.py | 5 | 1366 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.slicer.registration.specialized import FiducialRegistration
def test_FiducialRegistration_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
... | bsd-3-clause |
mbauskar/alec_frappe5_erpnext | erpnext/buying/doctype/supplier_quotation/supplier_quotation.py | 59 | 2532 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.mapper import get_mapped_doc
from erpnext.controllers.buying_controller import BuyingController
form_grid_templates = ... | agpl-3.0 |
bruderstein/PythonScript | PythonLib/full/distutils/core.py | 55 | 8876 | """distutils.core
The only module that needs to be imported to use the Distutils; provides
the 'setup' function (which is to be called from the setup script). Also
indirectly provides the Distribution and Command classes, although they are
really defined in distutils.dist and distutils.cmd.
"""
import os
import sys
... | gpl-2.0 |
cpacia/OpenBazaar-Server | keys/keychain.py | 6 | 2191 | __author__ = 'chris'
import bitcointools
import nacl.signing
import nacl.encoding
import threading
from keys.guid import GUID
class KeyChain(object):
def __init__(self, database, callback=None, heartbeat_server=None):
self.db = database
guid_keys = self.db.keys.get_key("guid")
if guid_key... | mit |
Azulinho/ansible | lib/ansible/module_utils/ovirt.py | 7 | 25775 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, 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) ... | gpl-3.0 |
mozilla/verbatim | vendor/lib/python/raven/contrib/pylons/__init__.py | 5 | 1073 | """
raven.contrib.pylons
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from raven.middleware import Sentry as Middleware
from raven.base import Client
def list_from_setting(config, setting):
value = config.get(set... | gpl-2.0 |
ctruchi/deluge-webui2 | deluge/ui/gtkui/files_tab.py | 6 | 35308 | #
# files_tab.py
#
# Copyright (C) 2008 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may 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 ver... | gpl-3.0 |
palominodb/tableizer | tableizer/ttt_gui/rrd.py | 1 | 5968 | # rrd.py
# Copyright (C) 2009-2013 PalominoDB, Inc.
#
# You may contact the maintainers at eng@palominodb.com.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License... | gpl-2.0 |
nkhuyu/SFrame | oss_src/unity/python/sframe/cython/python_printer_callback.py | 9 | 1141 | '''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
'''
import sys
try:
import IPython
from IPython.core.interactiveshell import InteractiveShell
have_ipython = True
except ImportError:
... | bsd-3-clause |
harlowja/networkx | networkx/algorithms/link_prediction.py | 40 | 16527 | """
Link prediction algorithms.
"""
from __future__ import division
import math
import networkx as nx
from networkx.utils.decorators import *
__all__ = ['resource_allocation_index',
'jaccard_coefficient',
'adamic_adar_index',
'preferential_attachment',
'cn_soundarajan_hop... | bsd-3-clause |
cdrooom/odoo | addons/crm/wizard/crm_merge_opportunities.py | 8 | 4442 | ##############################################################################
#
# 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 Affero General Public L... | agpl-3.0 |
grembo/buildbot | master/buildbot/test/unit/test_changes_mail.py | 10 | 4302 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
pleaseproject/python-for-android | python3-alpha/python3-src/Lib/distutils/command/build_ext.py | 46 | 32370 | """distutils.command.build_ext
Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP)."""
import sys, os, re
from distutils.core import Command
from distutils.errors import *
from distutils.sysconfig import customize_com... | apache-2.0 |
Korkki/django | django/contrib/messages/storage/cookie.py | 471 | 6545 | import json
from django.conf import settings
from django.contrib.messages.storage.base import BaseStorage, Message
from django.http import SimpleCookie
from django.utils import six
from django.utils.crypto import constant_time_compare, salted_hmac
from django.utils.safestring import SafeData, mark_safe
class Message... | bsd-3-clause |
florian-wagner/gimli | python/pygimli/gui/vtk/wxVTKRenderWindowInteractor.py | 1 | 24830 | # -*- coding: utf-8 -*-
"""
A VTK RenderWindowInteractor widget for wxPython.
Find wxPython info at http://wxPython.org
Created by Prabhu Ramachandran, April 2002
Based on wxVTKRenderWindow.py
Fixes and updates by Charl P. Botha 2003-2008
Updated to new wx namespace and some cleaning up by Andrea Gavana,
December 2... | gpl-3.0 |
felipsmartins/namebench | nb_third_party/dns/dnssec.py | 215 | 2144 | # Copyright (C) 2003-2007, 2009 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS... | apache-2.0 |
klipstein/dojango | dojango/data/modelstore/utils.py | 13 | 3281 | from django.utils.datastructures import SortedDict
from django.db.models import get_model
from fields import StoreField
from exceptions import StoreException
def get_object_from_identifier(identifier, valid=None):
""" Helper function to resolve an item identifier
into a model instance.
Raises Stor... | bsd-3-clause |
ddd332/presto | presto-docs/target/sphinx/reportlab/pdfbase/pdfdoc.py | 9 | 83521 | #Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/pdfbase/pdfdoc.py
__version__=''' $Id: pdfdoc.py 3795 2010-09-30 15:52:16Z rgbecker $ '''
__doc__="""
The module pdfdoc.py handles the 'outer structure... | apache-2.0 |
zxwing/ansible | lib/ansible/runner/lookup_plugins/pipe.py | 162 | 1951 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.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 lat... | gpl-3.0 |
bfontaine/web-pp | pp/unidecode/x09f.py | 252 | 4509 | data = (
'Cu ', # 0x00
'Qu ', # 0x01
'Chao ', # 0x02
'Wa ', # 0x03
'Zhu ', # 0x04
'Zhi ', # 0x05
'Mang ', # 0x06
'Ao ', # 0x07
'Bie ', # 0x08
'Tuo ', # 0x09
'Bi ', # 0x0a
'Yuan ', # 0x0b
'Chao ', # 0x0c
'Tuo ', # 0x0d
'Ding ', # 0x0e
'Mi ', # 0x0f
'Nai ', # 0x10
'Ding ... | mit |
chiefspace/udemy-rest-api | udemy_rest_api_section5/env/lib/python3.4/site-packages/pip/vcs/git.py | 473 | 7898 | import tempfile
import re
import os.path
from pip.util import call_subprocess
from pip.util import display_path, rmtree
from pip.vcs import vcs, VersionControl
from pip.log import logger
from pip.backwardcompat import url2pathname, urlparse
urlsplit = urlparse.urlsplit
urlunsplit = urlparse.urlunsplit
class Git(Versi... | gpl-2.0 |
spencerlyon2/pygments | pygments/lexers/_clbuiltins.py | 2 | 14050 | # -*- coding: utf-8 -*-
"""
pygments.lexers._clbuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~
ANSI Common Lisp builtins.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
BUILTIN_FUNCTIONS = set(( # 638 functions
'<', '<=', '=', '>', '>=', '-... | bsd-2-clause |
OS2World/APP-INTERNET-torpak_2 | Lib/plat-os2emx/IN.py | 77 | 1875 | # Generated by h2py from f:/emx/include/netinet/in.h
# Included from sys/param.h
PAGE_SIZE = 0x1000
HZ = 100
MAXNAMLEN = 260
MAXPATHLEN = 260
def htonl(X): return _swapl(X)
def ntohl(X): return _swapl(X)
def htons(X): return _swaps(X)
def ntohs(X): return _swaps(X)
IPPROTO_IP = 0
IPPROTO_ICMP = 1
IPPROTO_IGMP = 2
... | mit |
ArneBab/pypyjs | website/demo/home/rfk/repos/pypy/lib-python/2.7/test/test_frozen.py | 133 | 1236 | # Test the frozen module defined in frozen.c.
from test.test_support import captured_stdout, run_unittest
import unittest
import sys
class FrozenTests(unittest.TestCase):
def test_frozen(self):
with captured_stdout() as stdout:
try:
import __hello__
except ImportEr... | mit |
philanthropy-u/edx-platform | cms/envs/test_static_optimized.py | 3 | 2039 | """
Settings used when generating static assets for use in tests.
For example, Bok Choy uses two different settings files:
1. test_static_optimized is used when invoking collectstatic
2. bok_choy is used when running CMS and LMS
Note: it isn't possible to have a single settings file, because Django doesn't
support bo... | agpl-3.0 |
yongshengwang/hue | build/env/lib/python2.7/site-packages/Paste-2.0.1-py2.7.egg/paste/session.py | 50 | 11554 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
Creates a session object in your WSGI environment.
Use like:
..code-block:: Python
environ['paste.session.factory']()
This will return a d... | apache-2.0 |
roadmapper/ansible | lib/ansible/modules/cloud/openstack/os_keystone_endpoint.py | 19 | 6363 | #!/usr/bin/python
# Copyright: (c) 2017, VEXXHOST, Inc.
# 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': ['pr... | gpl-3.0 |
gvb/odoo | addons/project_issue/__init__.py | 433 | 1131 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
DCGenomics/NCBI_August_Hackathon_Push_Button_Genomics_Solution | vcf_filter_v0.1.py | 3 | 4688 | ######## Purpose of this script is to filter the vcf file using SNPEff according to user input #########
### Helpful documentation ###
## http://snpeff.sourceforge.net/SnpSift.html
#import modules
import os, sys
import subprocess
#Collect input as variables
i=0
file_prefix=sys.argv[1]
filter_arguments=[]
for arg in... | cc0-1.0 |
saydulk/horizon | openstack_dashboard/test/integration_tests/config.py | 26 | 3298 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | apache-2.0 |
fangxingli/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf/presentation.py | 96 | 2714 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# This library 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 2.1 of the License, or (at you... | apache-2.0 |
Lab603/PicEncyclopedias | jni-build/jni-build/jni/include/tensorflow/contrib/learn/__init__.py | 8 | 1912 | # 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... | mit |
asnorkin/sentiment_analysis | site/lib/python2.7/site-packages/sklearn/neighbors/tests/test_dist_metrics.py | 36 | 6957 | import itertools
import pickle
import numpy as np
from numpy.testing import assert_array_almost_equal
import scipy
from scipy.spatial.distance import cdist
from sklearn.neighbors.dist_metrics import DistanceMetric
from sklearn.neighbors import BallTree
from sklearn.utils.testing import SkipTest, assert_raises_regex
... | mit |
lanbing510/GTDWeb | django/conf/locale/mk/formats.py | 112 | 1742 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i'
DATETI... | gpl-2.0 |
jhonatajh/mtasa-blue | vendor/google-breakpad/src/tools/gyp/pylib/gyp/generator/make.py | 124 | 89654 | # Copyright (c) 2013 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.
# Notes:
#
# This is all roughly based on the Makefile system used by the Linux
# kernel, but is a non-recursive make -- we put the entire dependency
# graph in fr... | gpl-3.0 |
endlessm/chromium-browser | tools/style_variable_generator/css_generator.py | 1 | 2204 | # Copyright 2019 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.
from base_generator import Color, Modes, BaseGenerator
class CSSStyleGenerator(BaseGenerator):
'''Generator for CSS Variables'''
def Render(self):... | bsd-3-clause |
kongseokhwan/kulcloud-iitp-neutron | neutron/plugins/brocade/vlanbm.py | 14 | 1916 | # Copyright 2013 Brocade Communications System, 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
#
#... | apache-2.0 |
mmerce/python | bigml/tests/create_forecast_steps.py | 1 | 1792 | # -*- coding: utf-8 -*-
#
# Copyright 2017-2020 BigML
#
# 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... | apache-2.0 |
gpoesia/servo | tests/wpt/css-tests/tools/html5lib/html5lib/serializer/htmlserializer.py | 423 | 12897 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
import gettext
_ = gettext.gettext
try:
from functools import reduce
except ImportError:
pass
from ..constants import voidElements, booleanAttributes, spaceCharacters
from ..constants import rcdataElements, entities,... | mpl-2.0 |
xbianonpi/xbian-package-development | content/usr/local/lib/python2.7/dist-packages/pip/index.py | 18 | 27606 | """Routines related to PyPI, indexes"""
import sys
import os
import re
import gzip
import mimetypes
try:
import threading
except ImportError:
import dummy_threading as threading
import posixpath
import pkg_resources
import random
import socket
import string
import zlib
from pip.log import logger
from pip.util ... | gpl-2.0 |
terrycojones/dark-matter | dark/mutations.py | 1 | 16454 | import os
from collections import defaultdict
import numpy as np
try:
import matplotlib
if not os.environ.get('DISPLAY'):
# Use non-interactive Agg backend
matplotlib.use('Agg')
import matplotlib.pyplot as plt
except ImportError:
import platform
if platform.python_implementation() =... | mit |
rampage644/impala-cut | thirdparty/hive-0.10.0-cdh4.5.0/lib/py/fb303/FacebookService.py | 54 | 57351 | #
# Autogenerated by Thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
from thrift.Thrift import *
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
try:
from thrift.protocol import fastbinary
exce... | apache-2.0 |
FNCS/ns-3.26 | wutils.py | 64 | 8869 | import os
import os.path
import re
import sys
import subprocess
import shlex
# WAF modules
from waflib import Options, Utils, Logs, TaskGen, Build, Context
from waflib.Errors import WafError
# these are set from the main wscript file
APPNAME=None
VERSION=None
bld=None
def get_command_template(env, arguments=()):
... | gpl-2.0 |
bregman-arie/ansible | lib/ansible/module_utils/facts/hardware/dragonfly.py | 232 | 1090 | # 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 distributed in the hope that ... | gpl-3.0 |
nati/fun | cube.py | 1 | 4119 | import copy
import math
import re
import subprocess
import sys
import time
ret = subprocess.check_output(["resize"])
m = re.match("COLUMNS=(\d+);\nLINES=(\d+);", ret)
WIDTH = int(m.group(1))
HEIGHT = int(m.group(2))
SCALE = 7
X = 0
Y = 1
Z = 2
POINTS = [
[-1, -1, 1],
[-1, 1, 1],
[1, 1, 1],
[1, -1, 1... | apache-2.0 |
nuclear-wizard/moose | test/tests/time_integrators/scalar/run.py | 12 | 4487 | #!/usr/bin/env python3
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgp... | lgpl-2.1 |
mpvismer/pyqtgraph | pyqtgraph/graphicsItems/GraphicsWidget.py | 52 | 2151 | from ..Qt import QtGui, QtCore
from ..GraphicsScene import GraphicsScene
from .GraphicsItem import GraphicsItem
__all__ = ['GraphicsWidget']
class GraphicsWidget(GraphicsItem, QtGui.QGraphicsWidget):
_qtBaseClass = QtGui.QGraphicsWidget
def __init__(self, *args, **kargs):
"""
**Bases:**... | mit |
wavelets/chainer | chainer/cudnn/cudnn.py | 4 | 3454 | """Common routines to use CuDNN."""
import atexit
import ctypes
import os
import numpy
from chainer import cuda
import libcudnn
enabled = int(os.environ.get('CHAINER_CUDNN', '1')) != 0
available = True
def get_ptr(x):
return ctypes.c_void_p(x.ptr)
class Auto(object):
"""Object to be destroyed automatic... | mit |
benracine/opencomparison | apps/package/repos/sourceforge.py | 4 | 2752 | import re
from urllib import urlopen
try:
import simplejson as json
except ImportError:
import json
from .base_handler import BaseHandler
API_TARGET = "https://sourceforge.net/api"
class SourceforgeError(Exception):
"""An error occurred when making a request to the Sourceforge API"""
class SourceforgeH... | mit |
pombredanne/django-avocado | avocado/modeltree.py | 1 | 22222 | import inspect
from django.db import models
from django.db.models import Q
from django.core.exceptions import ImproperlyConfigured
from avocado.conf import settings
__all__ = ('ModelTree',)
DEFAULT_MODELTREE_ALIAS = 'default'
class ModelTreeNode(object):
def __init__(self, model, parent=None, rel_type=None, re... | bsd-3-clause |
bryan-lunt/execnet | doc/example/taskserver.py | 2 | 1281 |
import execnet
group = execnet.Group()
for i in range(4): # 4 CPUs
group.makegateway()
def process_item(channel):
# task processor, sits on each CPU
import time
import random
channel.send("ready")
for x in channel:
if x is None: # we can shutdown
break
# sleep ... | mit |
wkentaro/chainer | tests/chainer_tests/dataset_tests/tabular_tests/test_join.py | 5 | 3492 | import unittest
import numpy as np
import six
import chainer
from chainer import testing
from chainer_tests.dataset_tests.tabular_tests import dummy_dataset
def _filter_params(params):
for param in params:
key_size = 0
key_size += 3 if param['mode_a'] else 1
key_size += 2 if param['mode_... | mit |
ohio813/pyflag | src/plugins/Flash/ExportCommands.py | 7 | 3391 | """ These commands allow us to create reports from pyflash """
import pyflag.pyflagsh as pyflagsh
import pyflag.conf
config=pyflag.conf.ConfObject()
import pyflag.Registry as Registry
import pyflag.TEXTUI as TEXTUI
class export(pyflagsh.command):
""" Export a custom report """
long_opts = ['filter=']
... | gpl-2.0 |
gaiaresources/biosys | biosys/apps/main/tests/api/test_observation.py | 2 | 78736 | import datetime
import io
import json
import re
from os import path
from django.contrib.gis.geos import Point
from django.urls import reverse
from django.utils import timezone
from openpyxl import load_workbook
from rest_framework import status
from main import constants
from main.models import Site, Dataset, Record
... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.