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 |
|---|---|---|---|---|---|
Mariaanisimova/pythonintask | INBa/2015/Sarocvashin_M/task_12_23.py | 1 | 4811 | #Задача 12. Вариант 28.
#1-50. Разработайте игру "Крестики-нолики". (см. М.Доусон Программируем на Python гл. 6).
#Сароквашин Максим
#29.05.2016
X="X"
O="O"
EMPTY=" "
TIE="Ничья"
NUM_SQUARES=9
def display_instruct():
print('''
Добро пожаловать на ринг грандиознейших интеллектуальных состязаний всех времён.
Твой м... | apache-2.0 |
madafoo/cjdns | node_build/dependencies/libuv/build/gyp/test/defines/gyptest-define-override.py | 239 | 1476 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that a default gyp define can be overridden.
"""
import os
import TestGyp
test = TestGyp.TestGyp()
# CMake loudly warns abou... | gpl-3.0 |
umanium/trafficmon | id/trafficmon/TrafficMain.py | 1 | 4091 | import os
import cv2
import numpy as np
import time
from backgroundsubtraction.KMeans import KMeans
from objectblob.ObjectBlobDetection import ObjectBlobDetection
from pixelcleaning.MorphologicalCleaning import MorphologicalCleaning
__author__ = 'Luqman'
def morphological(image):
cleaning_model = Morphologica... | mit |
slightperturbation/Cobalt | ext/emsdk_portable/clang/tag-e1.34.1/src/test/CodeGen/SystemZ/Large/branch-range-04.py | 9 | 3694 | # Test 64-bit COMPARE AND BRANCH in cases where the sheer number of
# instructions causes some branches to be out of range.
# RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s
# Construct:
#
# before0:
# conditional branch to after0
# ...
# beforeN:
# conditional branch to after0
# main:
# 0xffcc by... | apache-2.0 |
jvasilakes/ML_Programs | naive_bayes.py | 1 | 4044 | #! /usr/bin/python2
from __future__ import division
import numpy as np
from sys import exit
from collections import OrderedDict
# ------Training data-------------
# Politics
xP = [
[1, 0, 1, 1, 1, 0, 1, 1],
[0, 0, 0, 1, 0, 0, 1, 1],
[1, 0, 0, 1, 1, 0, 1, 0],
[0, 1, 0, 0, 1, 1, 0, 1],
[0, 0,... | unlicense |
achang97/YouTunes | lib/python2.7/site-packages/pyasn1_modules/rfc3281.py | 12 | 9860 | # coding: utf-8
#
# This file is part of pyasn1-modules software.
#
# Created by Stanisław Pitucha with asn1ate tool.
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
# An Internet Attribute Certificate Profile for Authorization
#
# ASN.1 source from:
# http://w... | mit |
bzhou26/leetcode_sol | p384_Shuffle_an_Array.py | 1 | 1759 | '''
- Leetcode problem: 384
- Difficulty: Medium
- Brief problem description:
Shuffle a set of numbers without duplicates.
Example:
// Init an array with set 1, 2, and 3.
int[] nums = {1,2,3};
Solution solution = new Solution(nums);
// Shuffle the array [1,2,3] and return its result. Any permutation of [1,2,3] mu... | mit |
lucywyman/slides-ii | v/lib/python2.7/site-packages/jinja2/__init__.py | 303 | 2326 | # -*- coding: utf-8 -*-
"""
jinja2
~~~~~~
Jinja2 is a template engine written in pure Python. It provides a
Django inspired non-XML syntax but supports inline expressions and
an optional sandboxed environment.
Nutshell
--------
Here a small example of a Jinja2 template::
{% ... | apache-2.0 |
Azure/azure-sdk-for-python | sdk/applicationinsights/azure-applicationinsights/azure/applicationinsights/models/events_trace_result.py | 1 | 3361 | # 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 |
837468220/python-for-android | python3-alpha/python3-src/Lib/ctypes/test/test_varsize_struct.py | 277 | 1842 | from ctypes import *
import unittest
class VarSizeTest(unittest.TestCase):
def test_resize(self):
class X(Structure):
_fields_ = [("item", c_int),
("array", c_int * 1)]
self.assertEqual(sizeof(X), sizeof(c_int) * 2)
x = X()
x.item = 42
x.... | apache-2.0 |
Oi-Android/android_kernel_xiaomi_ferrari | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
hassanabidpk/django | django/utils/jslex.py | 251 | 7779 | """JsLex: a lexer for Javascript"""
# Originally from https://bitbucket.org/ned/jslex
from __future__ import unicode_literals
import re
class Tok(object):
"""
A specification for a token class.
"""
num = 0
def __init__(self, name, regex, next=None):
self.id = Tok.num
Tok.num += 1... | bsd-3-clause |
WaveBlocks/WaveBlocksND | WaveBlocksND/HagedornBasisEvaluationPsi.py | 1 | 6904 | """The WaveBlocks Project
The basic common algorithms for evaluation Hagedorn basis functions
of the new kind.
@author: R. Bourquin
@copyright: Copyright (C) 2016 R. Bourquin
@license: Modified BSD License
"""
from numpy import complexfloating, dot, vstack, zeros, identity, diag, real
from numpy.linalg import eigh
f... | bsd-3-clause |
Bysmyyr/chromium-crosswalk | tools/telemetry/third_party/gsutilz/third_party/httplib2/python3/httplib2/__init__.py | 29 | 56301 |
"""
httplib2
A caching http interface that supports ETags and gzip
to conserve bandwidth.
Requires Python 3.0 or later
Changelog:
2009-05-28, Pilgrim: ported to Python 3
2007-08-18, Rick: Modified so it's able to use a socks proxy if needed.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Co... | bsd-3-clause |
flopp/GpxTrackPoster | gpxtrackposter/calendar_drawer.py | 1 | 5500 | """Draw a calendar poster."""
# Copyright 2016-2021 Florian Pigorsch & Contributors. All rights reserved.
#
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file.
import calendar
import datetime
import svgwrite # type: ignore
from gpxtrackposter import utils
from gpxtr... | mit |
allotria/intellij-community | python/testData/inspections/PyProtocolInspection/incompatibleProtocolSubclass.py | 19 | 1597 | from typing import Protocol
class MyProtocol(Protocol):
attr: int
def func(self, p: int) -> str:
pass
class MyClass1(MyProtocol):
def __init__(self, attr: int) -> None:
self.attr = attr
def <warning descr="Type of 'func' is incompatible with 'MyProtocol'">func</warning>(self, p: st... | apache-2.0 |
shaistaansari/django | tests/utils_tests/test_text.py | 243 | 9471 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django.test import SimpleTestCase
from django.utils import six, text
from django.utils.encoding import force_text
from django.utils.functional import lazy
from django.utils.translation import override
lazystr = lazy(force_text, six.text... | bsd-3-clause |
Microvellum/Fluid-Designer | win64-vc/2.78/Python/bin/2.78/scripts/freestyle/styles/blueprint_ellipses.py | 6 | 1864 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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.
#
# This program is distrib... | gpl-3.0 |
tmxdyf/CouchPotatoServer | libs/apscheduler/triggers/cron/fields.py | 115 | 3058 | """
Fields represent CronTrigger options which map to :class:`~datetime.datetime`
fields.
"""
from calendar import monthrange
from apscheduler.triggers.cron.expressions import *
__all__ = ('MIN_VALUES', 'MAX_VALUES', 'DEFAULT_VALUES', 'BaseField',
'WeekField', 'DayOfMonthField', 'DayOfWeekField')
MIN_VA... | gpl-3.0 |
netcon-source/OpenClimateGIS | src/openclimategis/util/raw_sql.py | 7 | 1311 | import os
from django.db import connection
def execute(sql):
cursor = connection.cursor()
try:
cursor.execute(sql)
rows = cursor.fetchall()
finally:
cursor.close()
return(rows)
def get_dataset(archive_id,variable_name,scenario_code,time_range,cm_code):
sql = """
with
clima... | bsd-3-clause |
Cuuuurzel/KiPyCalc | sympy/diffgeom/tests/test_function_diffgeom_book.py | 27 | 5286 | from sympy.diffgeom.rn import R2, R2_p, R2_r, R3_r
from sympy.diffgeom import (intcurve_series, intcurve_diffequ, Differential,
WedgeProduct)
from sympy.core import symbols, Function, Derivative
from sympy.simplify import trigsimp, simplify
from sympy.functions import sqrt, atan2, sin, cos
from sympy.matrices i... | mit |
2014/qqweibo | tests/test_pyqqweibo.py | 4 | 27266 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# FileName : test_pyqqweibo.py
# Author : Feather.et.ELF <fledna@qq.com>
# Created : Wed Jun 08 10:20:57 2011 by Feather.et.ELF
# Copyright : Feather Workshop (c) 2011
# Description : testcast
# Time-stamp: <2011-06-09 22:18:47 andelf>
from __future__ i... | mit |
shizeeg/pyicqt | tools/migrate.py | 1 | 5978 | #!/usr/bin/env python
#
# Spool Migration Script
#
# This script takes two arguments. The first is either "dump" or "restore".
# The second argument will be a file that your xdb will be dumped to, in the
# case of a "dump", or restored from, in the case of a "restore". The
# spool config used will be what is in confi... | gpl-2.0 |
jmartinezchaine/OpenERP | openerp/pychart/afm/Courier_BoldOblique.py | 15 | 1518 | # -*- coding: utf-8 -*-
# AFM font Courier-BoldOblique (path: /usr/share/fonts/afms/adobe/pcrbo8a.afm).
# Derived from Ghostscript distribution.
# Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code.
import dir
dir.afm["Courier-BoldOblique"] = (500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500,... | agpl-3.0 |
jonathanslenders/asyncssh | examples/simple_keyed_server.py | 2 | 1973 | #!/usr/bin/env python3.4
#
# Copyright (c) 2013-2015 by Ron Frederick <ronf@timeheart.net>.
# All rights reserved.
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License v1.0 which accompanies this
# distribution and is available at:
#
# http://www.eclipse... | epl-1.0 |
OmnInfinity/volatility | volatility/plugins/volshell.py | 44 | 19585 | # Volatility
# Copyright (C) 2008-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 o... | gpl-2.0 |
gergap/binutils-gdb | gdb/python/lib/gdb/prompt.py | 124 | 4210 | # Extended prompt utilities.
# Copyright (C) 2011-2014 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any ... | gpl-2.0 |
trezorg/django | tests/regressiontests/admin_ordering/tests.py | 50 | 2558 | from django.test import TestCase
from django.contrib.admin.options import ModelAdmin
from models import Band, Song, SongInlineDefaultOrdering, SongInlineNewOrdering
class TestAdminOrdering(TestCase):
"""
Let's make sure that ModelAdmin.queryset uses the ordering we define in
ModelAdmin rather that orderin... | bsd-3-clause |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/matplotlib/backends/backend_qt4agg.py | 10 | 2177 | """
Render to qt from agg
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os # not used
import sys
import ctypes
import warnings
import matplotlib
from matplotlib.figure import Figure
from .backend_qt5agg import FigureCanvasQTAggBa... | gpl-3.0 |
welikecloud/bigtop | bigtop-packages/src/charm/spark/layer-spark/tests/02-smoke-test.py | 2 | 1647 | #!/usr/bin/env python3
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Lic... | apache-2.0 |
crazyyoung01/vv | vn.how/tick2trade/vn.trader_t2t/riskManager/rmEngine.py | 12 | 7884 | # encoding: UTF-8
'''
本文件中实现了风控引擎,用于提供一系列常用的风控功能:
1. 委托流控(单位时间内最大允许发出的委托数量)
2. 总成交限制(每日总成交数量限制)
3. 单笔委托的委托数量控制
'''
import json
import os
import platform
from eventEngine import *
from vtConstant import *
from vtGateway import VtLogData
########################################################################
class ... | mit |
fpy171/django | setup.py | 195 | 3257 | import os
import sys
from distutils.sysconfig import get_python_lib
from setuptools import find_packages, setup
# Warn if we are installing over top of an existing installation. This can
# cause issues where files that were deleted from a more recent Django are
# still present in site-packages. See #18115.
overlay_wa... | bsd-3-clause |
imsplitbit/nova | nova/api/openstack/compute/plugins/v3/used_limits.py | 12 | 3299 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | apache-2.0 |
outbig/DAFGA | v1.0/dafga_refDB.py | 1 | 5933 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
# Author: Yongkyu Kim, PhD
Max Planck Institute for terrestrial microbiology
#
# Date: 2014-04-02
# Version: 1.0
#
# Try 'dafga_refDB.py -h' for more information and See manual
#
# Purpose:
# Bugs: Please report to https://github.com/outbig/DAFGA/is... | gpl-3.0 |
smartfile/django-1.4 | tests/regressiontests/urlpatterns_reverse/urls.py | 3 | 3864 | from __future__ import absolute_import
from django.conf.urls import patterns, url, include
from .views import empty_view, empty_view_partial, empty_view_wrapped, absolute_kwargs_view
other_patterns = patterns('',
url(r'non_path_include/$', empty_view, name='non_path_include'),
url(r'nested_path/$', 'regress... | bsd-3-clause |
4bic/censusreporter | census/urls.py | 2 | 6657 | from django.conf import settings
from django.conf.urls import url, patterns, include
from django.contrib import admin
from django.core.urlresolvers import reverse_lazy
from django.http import HttpResponse
from django.views.decorators.cache import cache_page
from django.views.generic.base import TemplateView, RedirectVi... | mit |
rwl/openpowersystem | rdflib/sparql/bison/Query.py | 1 | 3614 | from rdflib.sparql.bison.GraphPattern import GraphPattern
class Query(object):
"""
Query ::= Prolog ( SelectQuery | ConstructQuery | DescribeQuery | AskQuery )
See: http://www.w3.org/TR/rdf-sparql-query/#rQuery
"""
def __init__(self,prolog,query):
self.prolog = prolog
self.query = q... | agpl-3.0 |
ioana-delaney/spark | examples/src/main/python/ml/vector_indexer_example.py | 123 | 1685 | #
# 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 us... | apache-2.0 |
treetrnk/Tuxemon | tests/interactive/test_combat.py | 6 | 2183 | """
from combat.py
"""
if __name__ == "__main__":
print("Runs as standalone")
from core.components import config
class Game(object):
def __init__(self):
# set up pygame
pygame.init()
# read the configuration file
self.config = config.Config()
... | gpl-3.0 |
songmonit/CTTMSONLINE | addons/l10n_fr/l10n_fr.py | 336 | 2089 | # -*- 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 |
nesdis/djongo | tests/django_tests/tests/v22/tests/model_fields/test_integerfield.py | 44 | 7324 | import unittest
from django.core import validators
from django.core.exceptions import ValidationError
from django.db import IntegrityError, connection, models
from django.test import SimpleTestCase, TestCase
from .models import (
BigIntegerModel, IntegerModel, PositiveIntegerModel,
PositiveSmallIntegerModel, ... | agpl-3.0 |
abdullah2891/remo | vendor-local/lib/python/docutils/languages/ru.py | 20 | 3265 | # $Id: ru.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: Roman Suzi <rnd@onego.ru>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated for each... | bsd-3-clause |
jolevq/odoopub | addons/l10n_lu/__init__.py | 376 | 1054 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
zepheira/rdf-to-ejson | lib/rdf_to_ejson.py | 1 | 5385 | import simplejson
import httplib2
import rdflib
import hashlib
import sys, os
__version__ = "0.2"
_RDF_TYPE = u"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
_RDFS_LABEL = "label" # "http://www.w3.org/2000/01/rdf-schema#label"
_SKOS_PREFLABEL = "prefLabel" # "http://www.w3.org/2004/02/skos/core#prefLabel"
# Conve... | apache-2.0 |
mcgachey/edx-platform | lms/djangoapps/course_api/blocks/transformers/tests/test_block_counts.py | 32 | 2042 | """
Tests for BlockCountsTransformer.
"""
# pylint: disable=protected-access
from openedx.core.lib.block_cache.block_structure_factory import BlockStructureFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import SampleCourseFactory
from ..block_co... | agpl-3.0 |
thefinn93/CouchPotatoServer | libs/flask/blueprints.py | 50 | 14240 | # -*- coding: utf-8 -*-
"""
flask.blueprints
~~~~~~~~~~~~~~~~
Blueprints are the recommended way to implement larger or more
pluggable applications in Flask 0.7 and later.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from functools import update_wrap... | gpl-3.0 |
ndtrung81/lammps | python/lammps/data.py | 2 | 3145 | # ----------------------------------------------------------------------
# LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
# http://lammps.sandia.gov, Sandia National Laboratories
# Steve Plimpton, sjplimp@sandia.gov
#
# Copyright (2003) Sandia Corporation. Under the terms of Contract
# DE... | gpl-2.0 |
Darredevil/RIOT | dist/tools/pyterm/testbeds/testbeds.py | 100 | 7138 | #!/usr/bin/python2
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Philipp Rosenkranz <philipp.rosenkranz@fu-berlin.de>
#
# 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... | lgpl-2.1 |
aimas/TuniErp-8.0 | addons/hr_attendance/wizard/__init__.py | 375 | 1073 | # -*- 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 |
jtopjian/st2 | st2common/st2common/util/casts.py | 7 | 1854 | # -*- coding: utf-8 -*-
# Licensed to the StackStorm, Inc ('StackStorm') 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 "Licen... | apache-2.0 |
phalax4/CarnotKE | jyhton/lib-python/2.7/unittest/main.py | 115 | 9083 | """Unittest main program"""
import sys
import os
import types
from . import loader, runner
from .signals import installHandler
__unittest = True
FAILFAST = " -f, --failfast Stop on first failure\n"
CATCHBREAK = " -c, --catch Catch control-C and display results\n"
BUFFEROUTPUT = " -b, --buffer Bu... | apache-2.0 |
Acidburn0zzz/servo | tests/wpt/web-platform-tests/tools/third_party/pytest/testing/logging/test_fixture.py | 30 | 3581 | # -*- coding: utf-8 -*-
import logging
import pytest
logger = logging.getLogger(__name__)
sublogger = logging.getLogger(__name__ + ".baz")
def test_fixture_help(testdir):
result = testdir.runpytest("--fixtures")
result.stdout.fnmatch_lines(["*caplog*"])
def test_change_level(caplog):
caplog.set_level(... | mpl-2.0 |
realms-team/basestation-fw | libs/smartmeshsdk-REL-1.3.0.1/libs/VManagerSDK/vmanager/models/service_info.py | 3 | 7269 | # coding: utf-8
"""
Copyright 2015 SmartBear Software
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... | bsd-3-clause |
FirstDraftGIS/firstdraft | projfd/apifd/serializers.py | 1 | 3304 | from appfd.models import Basemap, Feature, Order, Place, Test
from drf_queryfields import QueryFieldsMixin
from rest_framework.serializers import HiddenField, IntegerField, NullBooleanField, CharField, ChoiceField, URLField
from rest_framework.serializers import HyperlinkedModelSerializer, ModelSerializer, Serializer, ... | apache-2.0 |
yoer/hue | desktop/core/ext-py/lxml/src/lxml/html/diff.py | 41 | 30375 | import difflib
from lxml import etree
from lxml.html import fragment_fromstring
import cgi
import re
__all__ = ['html_annotate', 'htmldiff']
try:
_unicode = unicode
except NameError:
# Python 3
_unicode = str
try:
basestring = __builtins__["basestring"]
except (KeyError, NameError):
# Python 3
... | apache-2.0 |
scripnichenko/nova | nova/tests/unit/compute/monitors/cpu/test_virt_driver.py | 16 | 2868 | # Copyright 2013 Intel Corporation
# 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 require... | apache-2.0 |
christianurich/VIBe2UrbanSim | 3rdparty/opus/src/urbansim/household/is_young.py | 2 | 2051 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.variables.variable import Variable
from variable_functions import my_attribute_label
class is_young(Variable):
"""Is the head of the household young. """
age_of_head =... | gpl-2.0 |
AndreaOrru/Yugen | key.py | 1 | 1945 | """Representation of keypresses."""
import curses
from curses import ascii
from curses.ascii import isprint
class Key:
"""Class representing a combination of key presses.
Attributes:
keys: Dictionary that maps key names to codes.
"""
keys = {k[4:]: eval('curses.'+k) for k in dir(curses) if ... | bsd-2-clause |
sneharavi12/DeepLearningFinals | pymunk-pymunk-4.0.0/examples/breakout.py | 5 | 6024 | """Very simple breakout clone. A circle shape serves as the paddle, then
breakable bricks constructed of Poly-shapes.
The code showcases several pymunk concepts such as elasitcity, impulses,
constant object speed, joints, collision handlers and post step callbacks.
"""
__version__ = "$Id:$"
__docformat__ = "reStru... | mit |
fumitoh/modelx | modelx/tests/core/space/test_space_reload.py | 1 | 1096 | import sys
import os.path
import modelx as mx
import modelx.tests.testdata
import pytest
import pathlib
datadir = pathlib.Path(os.path.dirname(mx.tests.testdata.__file__))
@pytest.fixture
def reloadtest(tmp_path):
with open(tmp_path / "__init__.py", "w") as f:
f.write("")
sys.path.insert(0, str(tmp... | gpl-3.0 |
hynnet/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/python2.7/distutils/dist.py | 175 | 50049 | """distutils.dist
Provides the Distribution class, which represents the module distribution
being built/installed/distributed.
"""
__revision__ = "$Id$"
import sys, os, re
from email import message_from_file
try:
import warnings
except ImportError:
warnings = None
from distutils.errors import (DistutilsOpt... | gpl-2.0 |
vetal4444/python-goose | tests/extractors/title.py | 13 | 1268 | # -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... | apache-2.0 |
munyirik/python | cpython/Lib/distutils/tests/test_install.py | 12 | 8346 | """Tests for distutils.command.install."""
import os
import sys
import unittest
import site
from test.support import captured_stdout, run_unittest
from distutils import sysconfig
from distutils.command.install import install
from distutils.command import install as install_module
from distutils.command.build_ext imp... | bsd-3-clause |
astaff/ansible | test/units/parsing/test_data_loader.py | 64 | 3283 | # (c) 2012-2014, 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) an... | gpl-3.0 |
tsrnnash/bg8-cdw11 | static/plugin/liquid_tags/gram.py | 271 | 3656 | """
Instagram Image Tag
-------------------
By `Tom Spalding <https://github.com/digitalvapor>`_
You can see a working example at `antivapor.net/instagram-tag.html <http://antivapor.net/instagram-tag.html>`_.
Based on `Liquid Image Tag <https://github.com/getpelican/pelican-plugins/blob/master/liquid_tags/img.py>`_ ... | agpl-3.0 |
BAMitUp/Fantasy-Football-Shuffler | ENV/lib/python2.7/site-packages/pip/_vendor/lockfile/pidlockfile.py | 536 | 6090 | # -*- coding: utf-8 -*-
# pidlockfile.py
#
# Copyright © 2008–2009 Ben Finney <ben+python@benfinney.id.au>
#
# This is free software: you may copy, modify, and/or distribute this work
# under the terms of the Python Software Foundation License, version 2 or
# later as published by the Python Software Foundation.
# No ... | gpl-3.0 |
1013553207/django | tests/template_tests/filter_tests/test_linenumbers.py | 331 | 1992 | from django.template.defaultfilters import linenumbers
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class LinenumbersTests(SimpleTestCase):
"""
The contents of "linenumbers" is escaped according to the current
autoescape setting.
"""
... | bsd-3-clause |
mjafin/bcbio-nextgen | bcbio/distributed/multitasks.py | 1 | 7491 | """Multiprocessing ready entry points for sample analysis.
"""
from bcbio import heterogeneity, hla, structural, utils, chipseq, upload
from bcbio.bam import callable
from bcbio.srna import sample as srna
from bcbio.srna import group as seqcluster
from bcbio.chipseq import peaks
from bcbio.cwl import create as cwl_crea... | mit |
josn-jys/git-repo | subcmds/grep.py | 48 | 7883 | #
# Copyright (C) 2009 The Android Open Source Project
#
# 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 |
akretion/knowledge | document_page/__openerp__.py | 2 | 1751 | # -*- 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 |
mlafeldt/google-python-class | basic/list2.py | 87 | 2160 | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Additional basic list exercises
# D. Given a list of numbers, return a list where
# al... | apache-2.0 |
semonte/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/utils/ogrinfo.py | 389 | 1973 | """
This module includes some utility functions for inspecting the layout
of a GDAL data source -- the functionality is analogous to the output
produced by the `ogrinfo` utility.
"""
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.gdal.geometries import GEO_CLASSES
def ogrinfo(data_source, num_... | apache-2.0 |
calvingit21/h2o-2 | py/testdir_multi_jvm/test_exec2_dkv.py | 9 | 2706 | import unittest, random, sys, time, os
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_exec as h2e
def write_syn_dataset(csvPathname, rowCount, SEED):
# 8 random generatators, 1 per column
r1 = random.Random(SEED)
r2 = random.Random(SEED)
r3 = ran... | apache-2.0 |
jimberlage/servo | tests/jquery/run_jquery.py | 215 | 9582 | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import re
import subprocess
import sys
import BaseHTTPServer
import SimpleHTTPServer
im... | mpl-2.0 |
epam-mooc/edx-platform | lms/djangoapps/courseware/tests/test_access.py | 16 | 9896 | import courseware.access as access
import datetime
import mock
from mock import Mock
from django.test import TestCase
from django.test.utils import override_settings
from courseware.tests.factories import UserFactory, StaffFactory, InstructorFactory
from student.tests.factories import AnonymousUserFactory, CourseEnr... | agpl-3.0 |
WickedShell/ardupilot | mk/VRBRAIN/Tools/genmsg/test/test_genmsg_command_line.py | 51 | 1974 | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, 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 ... | gpl-3.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/elan/Backup Pools/Video_only_Test_Run/4_Video.py | 2 | 24087 | from ImageScripter import *
from elan import *
from pytank.Core.SystemFunctions import Say
def Check_If_Blue_Screen_Exists():
Say("Checking if Blue Screen Exists")
x = 0
for i in range(2):
if Android.bluescreenlarge.Exists() == True:
Say("BlueScreen exists")
... | gpl-3.0 |
Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/pyshared/twisted/internet/_sslverify.py | 20 | 24219 | # -*- test-case-name: twisted.test.test_sslverify -*-
# Copyright (c) 2005 Divmod, Inc.
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
# Copyright (c) 2005-2008 Twisted Matrix Laboratories.
import itertools
from OpenSSL import SSL, crypto
from twisted.python import reflect, util
from twisted.... | gpl-3.0 |
bitjammer/swift | utils/swift_build_support/swift_build_support/products/ninja.py | 31 | 2042 | # swift_build_support/products/ninja.py -------------------------*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.tx... | apache-2.0 |
isabernardes/Heriga | Herigaenv/lib/python2.7/site-packages/django/http/cookie.py | 460 | 4390 | from __future__ import unicode_literals
import sys
from django.utils import six
from django.utils.encoding import force_str
from django.utils.six.moves import http_cookies
# Some versions of Python 2.7 and later won't need this encoding bug fix:
_cookie_encodes_correctly = http_cookies.SimpleCookie().value_encode(';... | mit |
soundcloud/selenium | py/selenium/webdriver/firefox/firefox_profile.py | 5 | 14665 | #!/usr/bin/python
#
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... | apache-2.0 |
Gustry/QGIS | tests/src/python/test_qgsserver_wms_getmap_size_server.py | 18 | 2093 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsServer MaxHeight and MaxWidth Override Options.
From build dir, run: ctest -R PyQgsServerWMSGetMapSizeServer -V
.. note:: This test needs env vars to be set before the server is
configured for the first time, for this
reason it cannot run as a test... | gpl-2.0 |
edisonlz/fruit | web_project/base/site-packages/pygments/styles/native.py | 75 | 1938 | # -*- coding: utf-8 -*-
"""
pygments.styles.native
~~~~~~~~~~~~~~~~~~~~~~
pygments version of my "native" vim theme.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, ... | apache-2.0 |
jmankoff/data | Assignments/jmankoff-explore/lib/flask/exthook.py | 783 | 5087 | # -*- coding: utf-8 -*-
"""
flask.exthook
~~~~~~~~~~~~~
Redirect imports for extensions. This module basically makes it possible
for us to transition from flaskext.foo to flask_foo without having to
force all extensions to upgrade at the same time.
When a user does ``from flask.ext.foo import... | gpl-3.0 |
terranodo/eventkit-cloud | eventkit_cloud/tasks/migrations/0006_auto_20200803_1037.py | 1 | 3279 | # Generated by Django 2.2.5 on 2020-08-03 10:37
import django.core.files.storage
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import uuid
class Migration(migrations.Migration):
dependencies = [
('jobs', '0002_dataprovider_attribute_class'),
... | bsd-3-clause |
ctiao/platform-external-skia | tools/find_bad_images_in_skps.py | 172 | 7405 | #!/usr/bin/env python
# Copyright 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.
"""
This script will take as an argument either a list of skp files or a
set of directories that contains skp files. It will then test each
skp... | bsd-3-clause |
cdepman/falcon_api | site-packages/psycopg2cffi/_impl/connection.py | 1 | 28889 | from __future__ import unicode_literals
import threading
import weakref
from functools import wraps
import six
from psycopg2cffi._impl import consts
from psycopg2cffi._impl import encodings as _enc
from psycopg2cffi._impl import exceptions
from psycopg2cffi._impl.libpq import libpq, ffi
from psycopg2cffi._impl import... | mit |
jupyter/dockerspawner | tests/test_systemuserspawner.py | 1 | 1246 | """Tests for SwarmSpawner"""
from getpass import getuser
import pytest
from jupyterhub.tests.mocking import public_url
from jupyterhub.tests.test_api import add_user
from jupyterhub.tests.test_api import api_request
from jupyterhub.utils import url_path_join
from tornado.httpclient import AsyncHTTPClient
from dockers... | bsd-3-clause |
aferr/TimingCompartments | src/dev/Platform.py | 20 | 1801 | # Copyright (c) 2005-2007 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
guptaarchit/nacsniff | main.py | 1 | 9500 | import wx
import sys
from capture import *
import netifaces
import wx.lib.buttons
from sniffer_socket import *
from help_window import *
from scanner import *
class ListCtrlLeft(wx.Frame):
def __init__(self, parent, id):
wx.Frame.__init__(self, None, wx.ID_ANY, 'wxBitmapButton', size=(300, 350))
sel... | gpl-2.0 |
idem2lyon/persomov | libs/enzyme/fourcc.py | 163 | 31535 | # -*- coding: utf-8 -*-
# enzyme - Video metadata parser
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
# Copyright 2003-2006 Dirk Meyer <dischi@freevo.org>
#
# This file is part of enzyme.
#
# enzyme is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public Lice... | gpl-3.0 |
morph027/ansible-modules-extras | network/asa/asa_config.py | 22 | 11915 | #!/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 distribut... | gpl-3.0 |
paukenba/youtube-dl | youtube_dl/extractor/newstube.py | 113 | 3537 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import ExtractorError
class NewstubeIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?newstube\.ru/media/(?P<id>.+)'
_TEST = {
'url': 'http://www.newstube.ru/media/telekanal-cnn-pere... | unlicense |
orekyuu/intellij-community | python/lib/Lib/site-packages/django/db/models/query.py | 71 | 53653 | """
The main QuerySet implementation. This provides the public API for the ORM.
"""
from itertools import izip
from django.db import connections, router, transaction, IntegrityError
from django.db.models.aggregates import Aggregate
from django.db.models.fields import DateField
from django.db.models.query_utils import... | apache-2.0 |
sv-dev1/odoo | addons/analytic_user_function/__openerp__.py | 260 | 2015 | # -*- 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 |
lfranchi/zulip | zerver/management/commands/rename_stream.py | 115 | 1189 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zerver.lib.actions import do_rename_stream
from zerver.models import Realm, get_realm
import sys
class Command(BaseCommand):
help = """Change the stream name for a realm."""
def add_arguments(self, parser):
... | apache-2.0 |
LukeM12/samba | lib/subunit/python/subunit/tests/test_progress_model.py | 83 | 3902 | #
# subunit: extensions to Python unittest to get test results from subprocesses.
# Copyright (C) 2009 Robert Collins <robertc@robertcollins.net>
#
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
# license at the users choice. A copy of both licenses are available in the
# project sour... | gpl-3.0 |
sigmavirus24/pip | pip/_vendor/distlib/scripts.py | 333 | 15224 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2015 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from io import BytesIO
import logging
import os
import re
import struct
import sys
from .compat import sysconfig, detect_encoding, ZipFi... | mit |
StrellaGroup/erpnext | erpnext/utilities/product.py | 9 | 4817 | # 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.utils import cint, fmt_money, flt, nowdate, getdate
from erpnext.accounts.doctype.pricing_rule.pricing_rule import get_pricin... | gpl-3.0 |
rkoschmitzky/coconodz | etc/maya/applib.py | 1 | 4161 | import pymel.core as pmc
def get_attribute_tree(node):
""" traverses attributes on given node and gets dict in form the attribute tree widget expects
Args:
node: PyNode
Returns: dict
"""
parents = {}
for attr in node.listAttr():
if not attr.isChild() and not attr.isMulti():... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.