repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
gentlemans/gentlemanly_engine | deps/freetype2/src/tools/docmaker/sources.py | 45 | 13294 | #
# sources.py
#
# Convert source code comments to multi-line blocks (library file).
#
# Copyright 2002-2016 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
# modified, and distributed under the terms of the FreeType project
# license, LICENSE.TXT. By continuing to use,... | mit |
carlosbeatortega/sociedades | web/node/node_modules/npm/node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/MSVSVersion.py | 42 | 9442 | # Copyright (c) 2011 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.
"""Handle version information related to Visual Stuio."""
import errno
import os
import re
import subprocess
import sys
class VisualStudioVersion(obje... | mit |
goldeneye-source/ges-python | lib/multiprocessing/spawn.py | 91 | 8847 | #
# Code used to start processes when using the spawn or forkserver
# start methods.
#
# multiprocessing/spawn.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
import os
import pickle
import sys
import runpy
import types
from . import get_start_method, set_start_method
from... | gpl-3.0 |
windj007/bulbs | bulbs/neo4jserver/tests/client_tests.py | 3 | 3431 | from uuid import uuid1
import unittest
from bulbs.config import Config
from bulbs.utils import json
from bulbs.neo4jserver import Neo4jClient, NEO4J_URI
from bulbs.tests.client_tests import ClientTestCase
from bulbs.tests.client_index_tests import ClientIndexTestCase
from bulbs.factory import Factory
from bulbs.elemen... | bsd-3-clause |
ChromiumWebApps/chromium | third_party/pexpect/FSM.py | 171 | 14248 | #!/usr/bin/env python
"""This module implements a Finite State Machine (FSM). In addition to state
this FSM also maintains a user defined "memory". So this FSM can be used as a
Push-down Automata (PDA) since a PDA is a FSM + memory.
The following describes how the FSM works, but you will probably also need to
see the... | bsd-3-clause |
hyperized/ansible-modules-core | cloud/amazon/route53.py | 5 | 21343 | #!/usr/bin/python
# 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... | gpl-3.0 |
gurneyalex/OpenUpgrade | addons/board/board.py | 65 | 6715 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
XiaosongWei/crosswalk-test-suite | webapi/tct-csp-w3c-tests/csp-py/csp_connect-src_none.py | 25 | 3170 | def main(request, response):
response.headers.set(
"Content-Security-Policy",
"connect-src 'none'; script-src 'self' 'unsafe-inline'")
response.headers.set(
"X-Content-Security-Policy",
"connect-src 'none'; script-src 'self' 'unsafe-inline'")
response.headers.set(
"X-... | bsd-3-clause |
BlackPole/bp-enigma2 | lib/python/Tools/ASCIItranslit.py | 84 | 4273 | # -*- coding:utf-8 -*-
ASCIItranslit = { \
0x0022: "''", \
0x002A: "_", \
0x002F: "_", \
0x003A: "_", \
0x003C: "_", \
0x003D: "_", \
0x003E: "_", \
0x003F: "_", \
0x005C: "_", \
0x007C: "_", \
0x007F: "", \
0x00A0: "_", \
0x00A1: "!", \
0x00A2: "c", \
0x00A3: "lb", \
0x00A4: "", \
0x00A5: "yen", \
0x00A6: "I", \
0x00... | gpl-2.0 |
liorvh/infernal-twin | build/reportlab/src/rl_addons/rl_accel/tests/t4.py | 14 | 1875 | from reportlab.pdfbase.pdfmetrics import getFont, registerFont
from reportlab.pdfbase.ttfonts import TTFont
import time
from sys import getrefcount
registerFont(TTFont("Vera", "Vera.ttf"))
font = getFont('Vera')
_py_stringWidth = font._py_stringWidth
stringWidth = font.stringWidth
#assert stringWidth!=_py_stringWidth
#... | gpl-3.0 |
foursquare/pants | src/python/pants/java/nailgun_executor.py | 1 | 12211 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import hashlib
import logging
import os
import re
import select
import threading
import t... | apache-2.0 |
toofar/qutebrowser | tests/unit/utils/usertypes/test_question.py | 4 | 2892 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 |
ctrlaltdel/neutrinator | vendor/openstack/clustering/v1/event.py | 1 | 2015 | # 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 unde... | gpl-3.0 |
zvolsky/codex | languages/zh-cn.py | 142 | 10465 | # coding: utf8
{
'!langcode!': 'zh-cn',
'!langname!': '中文',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" 应为选择表达式, 格式如 "field1=\'value\'". 但是对 JOIN 的结果不可以使用 update 或者 delete"',
'%s %%{row} deleted': '已删除 %s 笔',
'%s %%{row} updated': '已更新 %s... | agpl-3.0 |
iABC2XYZ/abc | StockPredict/TensorflowGPUPredictFinal.py | 2 | 10474 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 11 12:17:54 2017
@author: A
"""
import tensorflow as tf # Version 1.0 or 0.12
import numpy as np
import matplotlib.pyplot as plt
import os
plt.close('all')
inSeq=20
outSeq=20
batchSize = 50
ioputDim=2
hiddenDim =30
numIterLearning = ... | gpl-3.0 |
40223137/2015abc | static/Brython3.1.1-20150328-091302/Lib/pydoc.py | 637 | 102017 | #!/usr/bin/env python3
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
Run "pydoc <name>" to show documentation ... | gpl-3.0 |
fivejjs/pyspider | pyspider/database/sqlalchemy/projectdb.py | 51 | 4255 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<roy@binux.me>
# http://binux.me
# Created on 2014-12-04 23:25:10
import six
import time
from sqlalchemy import create_engine, MetaData, Table, Column, String, Float, Text
from sqlalchemy.engine.url... | apache-2.0 |
unpingco/csvkit | csvkit/convert/js.py | 20 | 1763 | #!/usr/bin/env python
try:
from collections import OrderedDict
import json
except ImportError:
from ordereddict import OrderedDict
import simplejson as json
import itertools
import six
from csvkit import CSVKitWriter
def parse_object(obj, path=''):
"""
Recursively parse JSON objects and a di... | mit |
huson2012/psutil | psutil/_pslinux.py | 21 | 43124 | #!/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 base64
import errno
import os
import re
import socket
... | bsd-3-clause |
valkjsaaa/sl4a | python/src/Lib/ctypes/test/test_stringptr.py | 66 | 2504 | import unittest
from ctypes import *
import _ctypes_test
lib = CDLL(_ctypes_test.__file__)
class StringPtrTestCase(unittest.TestCase):
def test__POINTER_c_char(self):
class X(Structure):
_fields_ = [("str", POINTER(c_char))]
x = X()
# NULL pointer access
self.assertR... | apache-2.0 |
LindaLinsefors/Lorentz-transformator | LorentzTransformer.py | 1 | 27684 | #! /usr/bin/env python
##########################################################
import pygame
pygame.init() # I don't know what it does or if it is needed for this program
import pygame.freetype
pygame.freetype.init() # makes font work
import tkinter # tkinter is only used to choose files when loading and saving... | gpl-3.0 |
CENDARI/editorsnotes | editorsnotes/main/migrations/0072_auto__chg_field_notesection_content.py | 1 | 16564 | # 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):
# Changing field 'NoteSection.content'
db.alter_column('main_notesection', 'content', self.gf('editorsnote... | agpl-3.0 |
rembo10/headphones | lib/requests/packages/chardet/gb2312freq.py | 3132 | 36011 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
qtekfun/htcDesire820Kernel | external/chromium_org/chrome/common/extensions/docs/server2/app_yaml_helper_test.py | 43 | 6153 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from app_yaml_helper import AppYamlHelper
from extensions_paths import SERVER2
from host_file_system_provider import H... | gpl-2.0 |
openearth/PyWPS | tests/processes/returner.py | 2 | 1394 | from pywps.Process import WPSProcess
class Process(WPSProcess):
def __init__(self):
##
# Process initialization
WPSProcess.__init__(self,
identifier = "returner",
title="Return process",
abstract="""This is demonstration ... | gpl-2.0 |
shsingh/ansible | lib/ansible/module_utils/network/vyos/facts/firewall_global/firewall_global.py | 2 | 12985 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The vyos firewall_global fact class
It is in this file the configuration is collected from the device
for a given resource, parsed, and the facts tree is populated
based ... | gpl-3.0 |
eayunstack/neutron | neutron/tests/unit/agent/test_agent_extensions_manager.py | 3 | 1626 | # 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 |
numairmansur/RoBO | robo/util/mc_part.py | 3 | 1782 | import numpy as np
import logging
logger = logging.getLogger(__name__)
def joint_pmin(m, V, Nf):
"""
Computes the probability of every given point to be the minimum
by sampling function and count how often each point has the
smallest function value.
Parameters
----------
M: np.ndarray(N,... | bsd-3-clause |
Batterfii/django | django/contrib/gis/gdal/feature.py | 439 | 4153 | from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import GDALException, OGRIndexError
from django.contrib.gis.gdal.field import Field
from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType
from django.contrib.gis.gdal.prototypes import ds as capi, geom as geom_api
fro... | bsd-3-clause |
dgillis/scrapy | scrapy/spidermiddlewares/offsite.py | 85 | 2120 | """
Offsite Spider Middleware
See documentation in docs/topics/spider-middleware.rst
"""
import re
import logging
from scrapy import signals
from scrapy.http import Request
from scrapy.utils.httpobj import urlparse_cached
logger = logging.getLogger(__name__)
class OffsiteMiddleware(object):
def __init__(self... | bsd-3-clause |
neale/CS-program | 434-MachineLearning/final_project/linearClassifier/sklearn/manifold/locally_linear.py | 37 | 25852 | """Locally Linear Embedding"""
# Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr>
# Jake Vanderplas -- <vanderplas@astro.washington.edu>
# License: BSD 3 clause (C) INRIA 2011
import numpy as np
from scipy.linalg import eigh, svd, qr, solve
from scipy.sparse import eye, csr_matrix
from ..base import B... | unlicense |
trishnaguha/ansible | docs/docsite/_extensions/pygments_lexer.py | 4 | 23487 | # -*- coding: utf-8 -*-
# pylint: disable=no-self-argument
#
# Copyright 2006-2017 by the Pygments team, see AUTHORS at
# https://bitbucket.org/birkenfeld/pygments-main/raw/7941677dc77d4f2bf0bbd6140ade85a9454b8b80/AUTHORS
# Copyright by Kirill Simonov (original author of YAML lexer).
# Copyright by Norman Richards (ori... | gpl-3.0 |
dydek/django | tests/proxy_model_inheritance/tests.py | 89 | 2089 | from __future__ import absolute_import, unicode_literals
import os
from django.core.management import call_command
from django.test import TestCase, TransactionTestCase
from django.test.utils import extend_sys_path
from django.utils._os import upath
from .models import (
ConcreteModel, ConcreteModelSubclass, Con... | bsd-3-clause |
alinbalutoiu/tempest | tempest/api/orchestration/stacks/test_neutron_resources.py | 9 | 8941 | # 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 |
frankbp/robotframework-selenium2library | src/Selenium2Library/__init__.py | 31 | 6631 | import os
from keywords import *
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
execfile(os.path.join(THIS_DIR, 'version.py'))
__version__ = VERSION
class Selenium2Library(
_LoggingKeywords,
_RunOnFailureKeywords,
_BrowserManagementKeywords,
_ElementKeywords,
_TableElementKeywords,
... | apache-2.0 |
rjschof/gem5 | ext/ply/test/yacc_unused.py | 174 | 1669 | # -----------------------------------------------------------------------------
# yacc_unused.py
#
# A grammar with an unused rule
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex import tok... | bsd-3-clause |
gencer/sentry | src/sentry/plugins/base/bindings.py | 1 | 1075 | from __future__ import absolute_import, print_function
import six
from sentry.plugins import providers
class ProviderManager(object):
type = None
def __init__(self):
self._items = {}
def __iter__(self):
return iter(self._items)
def add(self, item, id):
if self.type and not... | bsd-3-clause |
Learningtribes/edx-platform | common/test/acceptance/tests/studio/test_studio_textbooks.py | 8 | 3445 | """
Acceptance tests for Studio related to the textbooks.
"""
from common.test.acceptance.tests.studio.base_studio_test import StudioCourseTest
from ...pages.studio.textbook_upload import TextbookUploadPage
from ...pages.lms.textbook_view import TextbookViewPage
from ...tests.helpers import disable_animations
from nose... | agpl-3.0 |
andrei4ka/fuel-web-redhat | fuel_agent_ci/fuel_agent_ci/objects/http.py | 6 | 1483 | # Copyright 2014 Mirantis, 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 |
ity/pants | tests/python/pants_test/backend/jvm/tasks/test_ivy_utils.py | 4 | 27425 | # coding=utf-8
# Copyright 2014 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 json
import o... | apache-2.0 |
turbomanage/training-data-analyst | courses/machine_learning/deepdive2/structured/solutions/serving/application/lib/pyasn1_modules/rfc8360.py | 13 | 1075 | #
# This file is part of pyasn1-modules software.
#
# Created by Russ Housley.
#
# Copyright (c) 2019, Vigil Security, LLC
# License: http://snmplabs.com/pyasn1/license.html
#
# Resource Public Key Infrastructure (RPKI) Validation Reconsidered
#
# ASN.1 source from:
# https://www.rfc-editor.org/rfc/rfc8360.txt
# https:... | apache-2.0 |
timduru/platform-external-chromium_org | third_party/closure_linter/closure_linter/gjslint.py | 135 | 7991 | #!/usr/bin/env python
# python2.6 for command-line runs using p4lib. pylint: disable-msg=C6301
#
# Copyright 2007 The Closure Linter 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 co... | bsd-3-clause |
xiangel/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/yaml3/error.py | 294 | 2533 |
__all__ = ['Mark', 'YAMLError', 'MarkedYAMLError']
class Mark:
def __init__(self, name, index, line, column, buffer, pointer):
self.name = name
self.index = index
self.line = line
self.column = column
self.buffer = buffer
self.pointer = pointer
def get_snippet... | apache-2.0 |
vadimtk/chrome4sdp | tools/run-bisect-manual-test.py | 9 | 6350 | #!/usr/bin/env python
# Copyright 2013 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.
"""Run Manual Test Bisect Tool
An example usage:
tools/run-bisect-manual-test.py -g 201281 -b 201290
On Linux platform, follow the in... | bsd-3-clause |
tedlaz/pyted | sms/requests/packages/chardet/langhebrewmodel.py | 2763 | 11318 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Simon Montagu
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved... | gpl-3.0 |
SOKP/external_chromium_org | chrome/common/extensions/docs/server2/api_categorizer_test.py | 87 | 2474 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from api_categorizer import APICategorizer
from compiled_file_system import CompiledFileSystem
from extensions_paths im... | bsd-3-clause |
uni2u/neutron | neutron/tests/unit/ml2/drivers/mech_sriov/test_mech_sriov_nic_switch.py | 12 | 10260 | # Copyright 2014 Mellanox Technologies, 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 applicable law or agreed t... | apache-2.0 |
crossroadchurch/paul | openlp/plugins/media/__init__.py | 1 | 1818 | # -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... | gpl-2.0 |
mspark93/VTK | ThirdParty/Twisted/twisted/runner/inetdtap.py | 49 | 5273 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""
Twisted inetd TAP support
Maintainer: Andrew Bennetts
Future Plans: more configurability.
"""
import os, pwd, grp, socket
from twisted.runner import inetd, inetdconf
from twisted.python import log, usage
from twisted.internet.protocol ... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.