repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
Syrcon/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_util.py | 449 | 7538 | #!/usr/bin/env python
#
# Copyright 2011, 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... | mpl-2.0 |
sankhesh/VTK | Filters/Modeling/Testing/Python/Hyper.py | 9 | 5170 | #!/usr/bin/env python
import os
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Create the RenderWindow, Renderer and interactive renderer
#
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.SetMultiSamples(0)
renWin.AddRenderer(ren1)
ire... | bsd-3-clause |
sss-freshbyte/blog | node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py | 1361 | 45045 | # 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.
r"""Code to validate and convert settings of the Microsoft build tools.
This file contains code to validate and convert settings of the Microsoft
build tools. Th... | mit |
vinegret/youtube-dl | youtube_dl/extractor/vyborymos.py | 73 | 2031 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
class VyboryMosIE(InfoExtractor):
_VALID_URL = r'https?://vybory\.mos\.ru/(?:#precinct/|account/channels\?.*?\bstation_id=)(?P<id>\d+)'
_TESTS = [{
'url': 'http://vybory.mos.ru/#p... | unlicense |
jelugbo/ddi | common/djangoapps/course_groups/tests/test_cohorts.py | 12 | 19917 | import django.test
from django.contrib.auth.models import User
from django.conf import settings
from django.http import Http404
from django.test.utils import override_settings
from mock import call, patch
from student.models import CourseEnrollment
from student.tests.factories import UserFactory
from course_groups.mo... | agpl-3.0 |
widdowquinn/KGML | KGML_parser.py | 1 | 7550 | # (c) The James Hutton Institute 2013
# Author: Leighton Pritchard
#
# Contact:
# leighton.pritchard@hutton.ac.uk
#
# Leighton Pritchard,
# Information and Computing Sciences,
# James Hutton Institute,
# Errol Road,
# Invergowrie,
# Dundee,
# DD6 9LH,
# Scotland,
# UK
#
# The MIT License
#
# Copyright (c) 2010-2014 Th... | mit |
eegroopm/pyLATTICE | gui/pyLATTICE.py | 1 | 74321 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
pyLATTICE is...
"""
from __future__ import division #necessary for python2
from __future__ import unicode_literals
# define authorship information
__authors__ = ['Evan Groopman', 'Thomas Bernatowicz']
__author__ = ','.join(__authors__)
__credits__... | gpl-2.0 |
rsjohnco/rez | src/rez/packages_.py | 1 | 19212 | from rez.package_repository import package_repository_manager
from rez.package_resources_ import PackageFamilyResource, PackageResource, \
VariantResource, package_family_schema, package_schema, variant_schema, \
package_release_keys
from rez.package_serialise import dump_package_data
from rez.utils.data_utils ... | gpl-3.0 |
Shaswat27/scipy | scipy/optimize/tests/test__differential_evolution.py | 1 | 17376 | """
Unit tests for the differential global minimization algorithm.
"""
from scipy.optimize import _differentialevolution
from scipy.optimize._differentialevolution import DifferentialEvolutionSolver
from scipy.optimize import differential_evolution
import numpy as np
from scipy.optimize import rosen
from numpy.testing ... | bsd-3-clause |
GheRivero/ansible | lib/ansible/parsing/splitter.py | 49 | 10682 | # (c) 2014 James Cammarata, <jcammarata@ansible.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 late... | gpl-3.0 |
seeminglee/pyglet64 | experimental/console.py | 29 | 3991 | #!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import code
import sys
import traceback
import pyglet.event
import pyglet.text
from pyglet.window import key
from pyglet.gl import *
class Console(object):
def __init__(self, width, height, globals=None, locals=None):
... | bsd-3-clause |
javier-ruiz-b/docker-rasppi-images | raspberry-google-home/env/lib/python3.7/site-packages/rsa/__init__.py | 1 | 1542 | # Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | apache-2.0 |
BitWriters/Zenith_project | zango/lib/python3.5/site-packages/django/core/mail/__init__.py | 230 | 4701 | """
Tools for sending email.
"""
from __future__ import unicode_literals
from django.conf import settings
from django.utils.module_loading import import_string
# Imported for backwards compatibility, and for the sake
# of a cleaner namespace. These symbols used to be in
# django/core/mail.py before the introduction o... | mit |
infoxchange/lettuce | tests/integration/lib/Django-1.3/django/template/__init__.py | 561 | 3247 | """
This is the Django template system.
How it works:
The Lexer.tokenize() function converts a template string (i.e., a string containing
markup with custom template tags) to tokens, which can be either plain text
(TOKEN_TEXT), variables (TOKEN_VAR) or block statements (TOKEN_BLOCK).
The Parser() class takes a list ... | gpl-3.0 |
sdphome/UHF_Reader | rfs/rootfs/usr/lib/python2.7/encodings/mac_iceland.py | 593 | 13754 | """ Python Character Mapping Codec mac_iceland generated from 'MAPPINGS/VENDORS/APPLE/ICELAND.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input... | gpl-3.0 |
ZhangXinNan/tensorflow | tensorflow/contrib/signal/python/ops/spectral_ops.py | 27 | 12618 | # 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 |
najmacherrad/master_thesis | Waltz/plotcomparaisons_waltz.py | 1 | 7577 | # Waltz
# Compare results between wild type and mutant
# coding=utf-8
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import csv
from scipy import stats
from pylab import plot, show, savefig, xlim, figure, \
hold, ylim, legend, boxplot, setp, axes
import pylab
from numpy import *... | mit |
kurtrwall/wagtail | wagtail/utils/deprecation.py | 2 | 1995 | from __future__ import absolute_import, unicode_literals
import warnings
class RemovedInWagtail17Warning(DeprecationWarning):
pass
removed_in_next_version_warning = RemovedInWagtail17Warning
class RemovedInWagtail18Warning(PendingDeprecationWarning):
pass
class ThisShouldBeAList(list):
"""
Some... | bsd-3-clause |
paulballesty/zxcvbn | data-scripts/count_wiktionary.py | 16 | 2670 | #!/usr/bin/python
import os
import sys
import codecs
import operator
from unidecode import unidecode
def usage():
return '''
This script extracts words and counts from a 2006 wiktionary word frequency study over American
television and movies. To use, first visit the study and download, as .html files, all 26 of... | mit |
LighthouseHPC/lighthouse | src/Dlighthouse/lighthouse/views/lapack_sylvester.py | 2 | 8761 | import string, types, sys, os, StringIO, re, shlex, json, zipfile
from collections import OrderedDict
from itertools import chain
from django.contrib.auth.decorators import login_required
from django.core.servers.basehttp import FileWrapper
from django.http import HttpResponse, HttpResponseNotFound
from django.shortcut... | mit |
deadlyraptor/reels | spreadchimp.py | 1 | 2493 | import os
import csv
import xlrd
# Assumes the directory with the workbook is relative to the script's location.
directory = 'workbooks/'
file = os.listdir(directory)[0]
workbook = (f'{directory}/{file}')
# Preps the workbook that contains the information desired.
wb = xlrd.open_workbook(workbook)
sh = wb.sheet_by_i... | mit |
satishgoda/bokeh | examples/plotting/file/unemployment.py | 46 | 1846 | from collections import OrderedDict
import numpy as np
from bokeh.plotting import ColumnDataSource, figure, show, output_file
from bokeh.models import HoverTool
from bokeh.sampledata.unemployment1948 import data
# Read in the data with pandas. Convert the year column to string
data['Year'] = [str(x) for x in data['Y... | bsd-3-clause |
birryree/servo | components/script/dom/bindings/codegen/parser/tests/test_conditional_dictionary_member.py | 120 | 3162 | def WebIDLTest(parser, harness):
parser.parse("""
dictionary Dict {
any foo;
[ChromeOnly] any bar;
};
""")
results = parser.finish()
harness.check(len(results), 1, "Should have a dictionary")
members = results[0].members;
harness.check(len(members), 2, "Should have tw... | mpl-2.0 |
firebitsbr/raspberry_pwn | src/pentest/voiper/fuzzer/fuzzers.py | 8 | 10273 | '''
This file is part of VoIPER.
VoIPER 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.
VoIPER is distributed in the hope that it will be u... | gpl-3.0 |
bakkou-badri/dataminingproject | env/lib/python2.7/site-packages/numpy/polynomial/polynomial.py | 14 | 47103 | """
Objects for dealing with polynomials.
This module provides a number of objects (mostly functions) useful for
dealing with polynomials, including a `Polynomial` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with polynomial objects is in
the do... | gpl-2.0 |
ville-k/tensorflow | tensorflow/contrib/stateless/python/kernel_tests/stateless_random_ops_test.py | 54 | 3287 | # Copyright 2015 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 |
tony810430/flink | flink-end-to-end-tests/flink-python-test/python/python_job.py | 2 | 3480 | ################################################################################
# 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... | apache-2.0 |
lu18887/perhapsgeekblog | perhapsgeek/zinnia/xmlrpc/__init__.py | 14 | 1235 | """XML-RPC methods for Zinnia"""
ZINNIA_XMLRPC_PINGBACK = [
('zinnia.xmlrpc.pingback.pingback_ping',
'pingback.ping'),
('zinnia.xmlrpc.pingback.pingback_extensions_get_pingbacks',
'pingback.extensions.getPingbacks')]
ZINNIA_XMLRPC_METAWEBLOG = [
('zinnia.xmlrpc.metaweblog.get_users_blogs',
... | mit |
zhiyanfoo/crunch-shake | crunch-shake/utils.py | 2 | 1649 | import json
import re
from collections import namedtuple
import string
# INPUT OUTPUT
def file_to_list(path):
with open(path, 'r') as inputFile:
return inputFile.readlines()
def json_file_to_dict(path):
with open(path, 'r') as jsonFile:
return json.load(jsonFile)
def to_json(x, path):
wi... | mit |
huijunwu/heron | heron/instance/src/python/instance/st_heron_instance.py | 5 | 17184 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# 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... | apache-2.0 |
skulbrane/googletest | test/gtest_env_var_test.py | 2408 | 3487 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
mancoast/CPythonPyc_test | cpython/253_test_dummy_thread.py | 70 | 7192 | """Generic thread tests.
Meant to be used by dummy_thread and thread. To allow for different modules
to be used, test_main() can be called with the module to use as the thread
implementation as its sole argument.
"""
import dummy_thread as _thread
import time
import Queue
import random
import unittest
from test impo... | gpl-3.0 |
liam-middlebrook/yaml-cpp.new-api | test/gmock-1.7.0/gtest/test/gtest_throw_on_failure_test.py | 2917 | 5766 | #!/usr/bin/env python
#
# Copyright 2009, 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... | mit |
acuzzio/GridQuantumPropagator | src/quantumpropagator/TDPropagator.py | 1 | 30840 | ''' this is the module for the hamiltonian '''
import numpy as np
import os
import pickle
import datetime
from quantumpropagator import (printDict, printDictKeys, loadInputYAML, bring_input_to_AU,
warning, labTranformA, gaussian2, makeJustAnother2DgraphComplex,
fromHartreetoCmMin1, makeJustAnother2Dg... | gpl-3.0 |
yamt/neutron | quantum/plugins/cisco/tests/unit/test_database.py | 1 | 25556 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011, Cisco Systems, 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-... | apache-2.0 |
clangen/projectM-musikcube | src/WinLibs/freetype-2.3.5/src/tools/glnames.py | 16 | 103307 | #!/usr/bin/env python
#
#
# FreeType 2 glyph name builder
#
# Copyright 1996-2000, 2003, 2005, 2007 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# 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. ... | lgpl-2.1 |
lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_hop.py | 1 | 2114 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
nhmc/xastropy | xastropy/obs/x_getsdssimg.py | 1 | 4285 | #;+
#; NAME:
#; x_getsdssimg
#; Version 1.1
#;
#; PURPOSE:
#; Returns an Image by querying the SDSS website
#; Will use DSS2-red as a backup
#;
#; CALLING SEQUENCE:
#;
#; INPUTS:
#;
#; RETURNS:
#;
#; OUTPUTS:
#;
#; OPTIONAL KEYWORDS:
#;
#; OPTIONAL OUTPUTS:
#;
#; COMMENTS:
#;
#; EXAMPLES:
#;
#; PROCEDURES/... | bsd-3-clause |
sanguinariojoe/FreeCAD | src/Mod/Draft/draftfunctions/mirror.py | 9 | 4578 | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2020 Carlo Pavan <carlopav@gmail.com> *
# * Co... | lgpl-2.1 |
GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/edw/multistream_multiprofile_driver.py | 1 | 2591 | """Driver for running multiple profiles concurrently against a cluster.
The list of profiles are passed via flag each of which are defined in the
profile_details module.
"""
__author__ = 'p3rf@google.com'
import json
import logging
from multiprocessing import Process
from multiprocessing import Queue
import time
fr... | apache-2.0 |
RiccardoPecora/MP | Lib/encodings/cp775.py | 93 | 35429 | """ Python Character Mapping Codec cp775 generated from 'VENDORS/MICSFT/PC/CP775.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,e... | gpl-3.0 |
StephaneP/volatility | volatility/plugins/mac/arp.py | 58 | 1398 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 ... | gpl-2.0 |
nicolashainaux/mathmaker | tests/00_libs/test_anglessets.py | 1 | 5684 | # -*- coding: utf-8 -*-
# Mathmaker creates automatically maths exercises sheets
# with their answers
# Copyright 2006-2017 Nicolas Hainaux <nh.techn@gmail.com>
# This file is part of Mathmaker.
# Mathmaker is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License... | gpl-3.0 |
dvliman/jaikuengine | .google_appengine/lib/cherrypy/cherrypy/scaffold/__init__.py | 80 | 1859 | """<MyProject>, a CherryPy application.
Use this as a base for creating new CherryPy applications. When you want
to make a new app, copy and paste this folder to some other location
(maybe site-packages) and rename it to the name of your project,
then tweak as desired.
Even before any tweaking, this should serve a fe... | apache-2.0 |
davechallis/gensim | gensim/models/ldamulticore.py | 9 | 12566 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Jan Zikes, Radim Rehurek
# Copyright (C) 2014 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Latent Dirichlet Allocation (LDA) in Python, using all CPU cores to parallelize and
speed up model t... | lgpl-2.1 |
vgupta6/Project-2 | modules/tests/inv/helper.py | 2 | 16414 | __all__ = ["send",
"track_send_item",
"send_shipment",
"receive",
"track_recv_item",
"recv_shipment",
"recv_sent_shipment",
"send_rec",
"send_get_id",
"send_get_ref",
"recv_rec",
"recv_get_id",
... | mit |
Pike/elmo | apps/shipping/forms.py | 2 | 1261 | # 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/.
from __future__ import absolute_import
from __future__ import unicode_literals
from django import forms
from shipping.mo... | mpl-2.0 |
Creworker/FreeCAD | src/Mod/OpenSCAD/colorcodeshapes.py | 29 | 4659 | #***************************************************************************
#* *
#* Copyright (c) 2012 Sebastian Hoogen <github@sebastianhoogen.de> *
#* *
#* This pr... | lgpl-2.1 |
Sw4T/Warband-Development | mb_warband_module_system_1166/Module_system 1.166/module_game_menus.py | 1 | 622820 | from compiler import *
####################################################################################################################
# (menu-id, menu-flags, menu_text, mesh-name, [<operations>], [<options>]),
#
# Each game menu is a tuple that contains the following fields:
#
# 1) Game-menu id (string): u... | mit |
cboling/SDNdbg | docs/old-stuff/pydzcvr/doc/neutron/plugins/ml2/drivers/arista/arista_l3_driver.py | 4 | 20045 | # Copyright 2014 Arista Networks, 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 requ... | apache-2.0 |
jamiecaesar/SecureCRT | templates/single_device_template.py | 3 | 2754 | # $language = "python"
# $interface = "1.0"
import os
import sys
import logging
# Add script directory to the PYTHONPATH so we can import our modules (only if run from SecureCRT)
if 'crt' in globals():
script_dir, script_name = os.path.split(crt.ScriptFullName)
if script_dir not in sys.path:
sys.path.... | apache-2.0 |
collects/VTK | Examples/Infovis/Python/hierarchical_graph.py | 17 | 2136 | from vtk import *
source = vtkRandomGraphSource()
source.SetNumberOfVertices(200)
source.SetEdgeProbability(0.01)
source.SetUseEdgeProbability(True)
source.SetStartWithTree(True)
source.IncludeEdgeWeightsOn()
source.AllowParallelEdgesOn()
# Connect to the vtkVertexDegree filter.
degree_filter = vtkVertexDegree()
degr... | bsd-3-clause |
cstavr/synnefo | snf-pithos-backend/pithos/backends/lib/sqlite/groups.py | 1 | 3735 | # Copyright (C) 2010-2014 GRNET S.A.
#
# 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 distributed i... | gpl-3.0 |
ProgVal/Limnoria-test | test/test_plugins.py | 9 | 1717 | ###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2008, James McCoy
# 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 copyr... | bsd-3-clause |
Distrotech/libxml2 | python/tests/reader3.py | 35 | 4153 | #!/usr/bin/python -u
#
# this tests the entities substitutions with the XmlTextReader interface
#
import sys
import libxml2
try:
import StringIO
str_io = StringIO.StringIO
except:
import io
str_io = io.StringIO
docstr="""<?xml version='1.0'?>
<!DOCTYPE doc [
<!ENTITY tst "<p>test</p>">
]>
<doc>&tst;</d... | gpl-3.0 |
onitake/ansible | lib/ansible/modules/network/f5/bigip_gtm_monitor_tcp.py | 4 | 24848 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks 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',
... | gpl-3.0 |
datsfosure/ansible | examples/scripts/yaml_to_ini.py | 175 | 7609 | # (c) 2012, Michael DeHaan <michael.dehaan@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 lat... | gpl-3.0 |
Tanmay28/coala | coalib/tests/output/JSONEncoderTest.py | 1 | 2819 | import sys
import json
import unittest
from datetime import datetime
sys.path.insert(0, ".")
from coalib.output.JSONEncoder import JSONEncoder
class TestClass1(object):
def __init__(self):
self.a = 0
class TestClass2(object):
def __init__(self):
self.a = 0
self.b = TestClass1()
cl... | agpl-3.0 |
parkbyte/electrumparkbyte | plugins/trezor/clientbase.py | 7 | 8778 | import time
from electrum.i18n import _
from electrum.util import PrintError, UserCancelled
from electrum.wallet import BIP44_Wallet
class GuiMixin(object):
# Requires: self.proto, self.device
messages = {
3: _("Confirm the transaction output on your %s device"),
4: _("Confirm internal entro... | mit |
Backflipz/plugin.video.excubed | resources/lib/requests/packages/chardet/langbulgarianmodel.py | 2965 | 12784 | ######################## 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-2.0 |
fabioz/pep8 | testsuite/E26.py | 14 | 1225 | #: E261:1:5
pass # an inline comment
#: E262:1:12
x = x + 1 #Increment x
#: E262:1:12
x = x + 1 # Increment x
#: E262:1:12
x = y + 1 #: Increment x
#: E265:1:1
#Block comment
a = 1
#: E265:2:1
m = 42
#! This is important
mx = 42 - 42
#: E266:3:5 E266:6:5
def how_it_feel(r):
### This is a variable ###
a = ... | mit |
fhaoquan/kbengine | kbe/src/lib/python/Lib/lib2to3/fixes/fix_callable.py | 161 | 1151 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for callable().
This converts callable(obj) into isinstance(obj, collections.Callable), adding a
collections import if needed."""
# Local imports
from lib2to3 import fixer_base
from lib2to3.fixer_util import ... | lgpl-3.0 |
pipsiscool/audacity | lib-src/lv2/lv2/plugins/eg02-midigate.lv2/waflib/Tools/compiler_fc.py | 287 | 1846 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys,imp,types
from waflib import Utils,Configure,Options,Logs,Errors
from waflib.Tools import fc
fc_compiler={'win32':['gfortran','ifort'],'darwin':['gfortran','g95'... | mit |
nexgenta/apt | test/pre-upload-check.py | 2 | 5809 | #!/usr/bin/python
import sys
import os
import glob
import os.path
from subprocess import call, PIPE
import unittest
stdout = os.open("/dev/null",0) #sys.stdout
stderr = os.open("/dev/null",0) # sys.stderr
apt_args = [] # ["-o","Debug::pkgAcquire::Auth=true"]
class testAuthentication(unittest.TestCase):
"""
... | gpl-2.0 |
openstack-infra/reviewstats | reviewstats/cmd/openapproved.py | 1 | 3204 | # Copyright (C) 2011 - Soren Hansen
# Copyright (C) 2013 - Red Hat, 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 requir... | apache-2.0 |
dparlevliet/zelenka-report-storage | server-db/twisted/web/_auth/basic.py | 66 | 1635 | # -*- test-case-name: twisted.web.test.test_httpauth -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
HTTP BASIC authentication.
@see: U{http://tools.ietf.org/html/rfc1945}
@see: U{http://tools.ietf.org/html/rfc2616}
@see: U{http://tools.ietf.org/html/rfc2617}
"""
import binascii
from... | lgpl-3.0 |
marscher/PyEMMA | pyemma/plots/__init__.py | 1 | 1704 |
# This file is part of PyEMMA.
#
# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER)
#
# PyEMMA 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 vers... | lgpl-3.0 |
LogicalKnight/pywinauto | pywinauto/__init__.py | 14 | 1225 | # GUI Application automation and testing library
# Copyright (C) 2006 Mark Mc Mahon
#
# 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... | lgpl-2.1 |
craigem/MyAdventures | csvBuild.py | 1 | 1286 | # csvBuild from Adventure 6.
# import required modules
import mcpi.minecraft as minecraft
import mcpi.block as block
# connect to minecraft
mc = minecraft.Minecraft.create()
# define some constants
GAP = block.AIR.id
WALL = block.GOLD_BLOCK.id
FLOOR = block.GRASS.id
# Open the file containing maze data
FILENAME = "... | gpl-3.0 |
Elbagoury/odoo | addons/sale_margin/__init__.py | 441 | 1042 | ##############################################################################
#
# 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 GNU Affero General Public L... | agpl-3.0 |
Elbagoury/odoo | addons/website_report/report.py | 257 | 2124 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-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 |
presidentielcoin/presidentielcoin | qa/rpc-tests/test_framework/blockstore.py | 1 | 5425 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Presidentielcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# BlockStore: a helper class that keeps a map of blocks and implements
# helper funct... | mit |
jakesyl/pychess | lib/pychess/Players/PyChessFICS.py | 20 | 17313 | from __future__ import print_function
import email.Utils
from gi.repository import Gtk
import math
import pychess
import random
import signal
import subprocess
from threading import Thread
from pychess.compat import urlopen, urlencode
from pychess.Players.PyChess import PyChess
from pychess.System.prefix import addDa... | gpl-3.0 |
jasonwzhy/django | django/contrib/admindocs/tests/test_fields.py | 638 | 1172 | from __future__ import unicode_literals
import unittest
from django.contrib.admindocs import views
from django.db import models
from django.db.models import fields
from django.utils.translation import ugettext as _
class CustomField(models.Field):
description = "A custom field type"
class DescriptionLackingFi... | bsd-3-clause |
mrry/tensorflow | tensorflow/python/kernel_tests/slice_op_test.py | 18 | 10265 | # Copyright 2015 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 |
andmos/ansible | lib/ansible/modules/clustering/consul.py | 23 | 19949 | #!/usr/bin/python
#
# (c) 2015, Steve Gargan <steve.gargan@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'... | gpl-3.0 |
davidfraser/sqlalchemy | test/ext/test_mutable.py | 21 | 18754 | from sqlalchemy import Integer, ForeignKey, String
from sqlalchemy.types import PickleType, TypeDecorator, VARCHAR
from sqlalchemy.orm import mapper, Session, composite
from sqlalchemy.orm.mapper import Mapper
from sqlalchemy.orm.instrumentation import ClassManager
from sqlalchemy.testing.schema import Table, Column
fr... | mit |
ChristineLaMuse/mozillians | vendor-local/lib/python/celery/tests/test_worker/__init__.py | 12 | 33416 | from __future__ import absolute_import
from __future__ import with_statement
import socket
import sys
from collections import deque
from datetime import datetime, timedelta
from Queue import Empty
from kombu.transport.base import Message
from kombu.connection import BrokerConnection
from mock import Mock, patch
from... | bsd-3-clause |
bloopletech/Comix | src/thumbnail.py | 2 | 6430 | """thumbnail.py - Thumbnail module for Comix implementing (most of) the
freedesktop.org "standard" at http://jens.triq.net/thumbnail-spec/
Only normal size (i.e. 128x128 px) thumbnails are supported.
"""
import os
from urllib import pathname2url, url2pathname
try: # The md5 module is deprecated as of Python 2.5, repl... | gpl-2.0 |
alexsh/Telegram | TMessagesProj/jni/boringssl/third_party/googletest/test/googletest-uninitialized-test.py | 95 | 2474 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | gpl-2.0 |
v1teka/yo | vendor/psy/psysh/test/tools/gen_unvis_fixtures.py | 536 | 3120 | #! /usr/bin/env python3
import sys
from os.path import abspath, expanduser, dirname, join
from itertools import chain
import json
import argparse
from vis import vis, unvis, VIS_WHITE
__dir__ = dirname(abspath(__file__))
OUTPUT_FILE = join(__dir__, '..', 'fixtures', 'unvis_fixtures.json')
# Add custom fixtures her... | gpl-3.0 |
tyler-abbot/psid_py | setup.py | 1 | 2486 | """A setup module for psidPy
Based on the pypa sample project.
A tool to download data and build psid panels based on psidR by Florian Oswald.
See:
https://github.com/floswald/psidR
https://github.com/tyler-abbot/psidPy
"""
from setuptools import setup, find_packages
from codecs import open
from os import path
her... | mit |
victorbriz/omim | 3party/freetype/src/tools/docmaker/utils.py | 153 | 3513 | #
# utils.py
#
# Auxiliary functions for the `docmaker' tool (library file).
#
# Copyright 2002-2015 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, modify,... | apache-2.0 |
nick-thompson/servo | tests/wpt/web-platform-tests/conformance-checkers/tools/ins-del-datetime.py | 141 | 8457 | # -*- coding: utf-8 -*-
import os
ccdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
template = """<!DOCTYPE html>
<meta charset=utf-8>
"""
errors = {
"date-year-0000": "0000-12-09",
"date-month-00": "2002-00-15",
"date-month-13": "2002-13-15",
"date-0005-02-29": "0005-02-29",
"date... | mpl-2.0 |
Sheikh-Aman/Stupid-Simple | Owl/owl.py | 1 | 3536 | import urllib2
import json
# Copyright 2016, Aman Alam
#
# 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 la... | apache-2.0 |
squarefactor/sorl | sorl/thumbnail/tests/templatetags.py | 2 | 10486 | import os
from django.conf import settings
from django.template import Template, Context, TemplateSyntaxError
from sorl.thumbnail.tests.classes import BaseTest, RELATIVE_PIC_NAME
class ThumbnailTagTest(BaseTest):
def render_template(self, source):
context = Context({
'source': RELATIVE_PIC_NAM... | bsd-3-clause |
ibinti/intellij-community | python/lib/Lib/site-packages/django/utils/daemonize.py | 452 | 1907 | import os
import sys
if os.name == 'posix':
def become_daemon(our_home_dir='.', out_log='/dev/null',
err_log='/dev/null', umask=022):
"Robustly turn into a UNIX daemon, running in our_home_dir."
# First fork
try:
if os.fork() > 0:
sys.exit(0... | apache-2.0 |
minghuascode/pyj | library/pyjamas/ui/DropHandler.py | 9 | 3204 | # Copyright (C) 2010 Jim Washington
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | apache-2.0 |
edeposit/edeposit.amqp.harvester | src/edeposit/amqp/harvester/tests/unittests/test_autoparser.py | 1 | 4415 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# Imports =====================================================================
import pytest
import dhtmlparser
import harvester.edeposit_autoparser as autoparser
# Variables ========================================================... | mit |
zerotk/reraiseit | setup.py | 1 | 1574 | #!/bin/env python
from setuptools import setup
setup(
name='zerotk.reraiseit',
use_scm_version=True,
author='Alexandre Andrade',
author_email='kaniabi@gmail.com',
url='https://github.com/zerotk/reraiseit',
description='Reraise exceptions.',
long_description='''A function to re-raise exc... | lgpl-3.0 |
rhyolight/nupic | examples/tm/hello_tm.py | 10 | 6174 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
florian-dacosta/OCB | openerp/addons/test_convert/tests/test_convert.py | 382 | 2303 | import collections
import unittest2
from lxml import etree as ET
from lxml.builder import E
from openerp.tests import common
from openerp.tools.convert import _eval_xml
Field = E.field
Value = E.value
class TestEvalXML(common.TransactionCase):
def eval_xml(self, node, obj=None, idref=None):
return _eval_... | agpl-3.0 |
battlehorse/rhizosphere | appengine/src/py/handlers/showcase/googlecode.py | 1 | 9970 | #!/usr/bin/env python
#
# Copyright 2010 The Rhizosphere 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
#
# U... | apache-2.0 |
algorhythms/LintCode | Interleaving Positive and Negative Numbers.py | 1 | 1350 | """
Given an array with positive and negative integers. Re-range it to interleaving with positive and negative integers.
Have you met this question in a real interview? Yes
Example
Given [-1, -2, -3, 4, 5, 6], after re-range, it will be [-1, 5, -2, 4, -3, 6] or any other reasonable answer.
Note
You are not necessary ... | apache-2.0 |
barbuza/django | django/contrib/gis/db/backends/mysql/introspection.py | 700 | 1771 | from MySQLdb.constants import FIELD_TYPE
from django.contrib.gis.gdal import OGRGeomType
from django.db.backends.mysql.introspection import DatabaseIntrospection
class MySQLIntrospection(DatabaseIntrospection):
# Updating the data_types_reverse dictionary with the appropriate
# type for Geometry fields.
... | bsd-3-clause |
UK992/servo | etc/wpt-summarize.py | 4 | 1754 | #!/usr/bin/env python
# Copyright 2019 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/l... | mpl-2.0 |
fichter/grpc | src/python/grpcio/grpc/framework/base/null.py | 39 | 2106 | # Copyright 2015, 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 f... | bsd-3-clause |
Gjacquenot/PyRayTracer | raytracer/raytrace-receiver2.py | 1 | 38736 | # -*- coding: utf-8 -*-
"""
@author: Jaap Verheggen, Guillaume Jacquenot
"""
from __future__ import division
import vtk
import numpy as np
import vtk.util.numpy_support as ns
import raytracer as ray
cosd = lambda angle: np.cos(angle / 180 * np.pi)
sind = lambda angle: np.sin(angle / 180 * np.pi)
tand = lambda angle:... | mit |
charlescearl/VirtualMesos | third_party/boto-2.0b2/boto/gs/connection.py | 5 | 2004 | # Copyright 2010 Google Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# trib... | apache-2.0 |
feigames/Odoo | addons/marketing_campaign/report/campaign_analysis.py | 379 | 5310 | # -*- 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.