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 |
|---|---|---|---|---|---|
tavaresdong/courses-notes | ucb_cs61A/lab/lab05/tests/height_depth.py | 3 | 1037 | test = {
'name': 'Tree Height & Depth',
'points': 0,
'suites': [
{
'cases': [
{
'answer': '3',
'choices': [
'2',
'3',
'4',
'5'
],
'hidden': False,
'locked': False,
'question': r"""
... | mit |
StuntsPT/Structure_threader | setup.py | 1 | 3703 | #!/usr/bin/python3
# Copyright 2016-2021 Francisco Pina Martins <f.pinamartins@gmail.com>
# This file is part of structure_threader.
# structure_threader 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... | gpl-3.0 |
jeenalee/servo | tests/wpt/css-tests/css-fonts-3_dev/html/support/fonts/makegsubfonts.py | 1616 | 14125 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
blindroot/django | tests/proxy_models/tests.py | 12 | 16067 | from __future__ import unicode_literals
from django.contrib import admin
from django.contrib.auth.models import User as AuthUser
from django.contrib.contenttypes.models import ContentType
from django.core import checks, management
from django.db import DEFAULT_DB_ALIAS, models
from django.db.models import signals
from... | bsd-3-clause |
refeed/coala-bears | bears/verilog/VerilogLintBear.py | 16 | 1660 | from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.DistributionRequirement import (
DistributionRequirement)
@linter(executable='verilator',
output_format='regex',
use_stderr=True,
output_regex=r'\%(?:(?P<severity>Error|Warning.*?).*?):'
... | agpl-3.0 |
Tosh007/DnD5_CharCreator | acces.py | 1 | 2053 |
def initializeTables(ui):
from ValueTable import ValueTable
from ChoiceTable import ActiveChoiceTable, StateTable,ActiveMultiChoiceTable
from ProficiencyTable import ProficiencyTable
from ConfigTable import ConfigTable
from ModifierTable import ModifierTable
global UI,Value,Modifier,Config,Prof... | gpl-3.0 |
zbyte64/django-hyperadmin | hyperadmin/resources/storages/endpoints.py | 1 | 2971 | from hyperadmin.links import LinkPrototype, Link
from hyperadmin.resources.endpoints import ResourceEndpoint
from hyperadmin.resources.crud.endpoints import ListEndpoint as BaseListEndpoint, CreateEndpoint, DetailEndpoint, DeleteEndpoint
class BoundFile(object):
def __init__(self, storage, name):
self.sto... | bsd-3-clause |
jerodestapa/jerodestapa.github.io | vendor/cache/ruby/2.0.0/gems/pygments.rb-0.6.3/vendor/pygments-main/pygments/lexers/compiled.py | 28 | 222015 | # -*- coding: utf-8 -*-
"""
pygments.lexers.compiled
~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for compiled languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from string import Template
from pygments.lexer import Lexer, Rege... | mit |
robhudson/django | django/contrib/gis/utils/srs.py | 450 | 3123 | from django.contrib.gis.gdal import SpatialReference
from django.db import DEFAULT_DB_ALIAS, connections
def add_srs_entry(srs, auth_name='EPSG', auth_srid=None, ref_sys_name=None,
database=None):
"""
This function takes a GDAL SpatialReference system and adds its information
to the `spa... | bsd-3-clause |
CSC301H-Fall2013/JuakStore | site-packages/tests/regressiontests/generic_relations_regress/tests.py | 89 | 2975 | from django.db.models import Q
from django.test import TestCase
from .models import (Address, Place, Restaurant, Link, CharLink, TextLink,
Person, Contact, Note, Organization, OddRelation1, OddRelation2)
class GenericRelationTests(TestCase):
def test_inherited_models_content_type(self):
"""
... | mit |
jamestwebber/scipy | scipy/io/arff/arffread.py | 1 | 26519 | # Last Change: Mon Aug 20 08:00 PM 2007 J
from __future__ import division, print_function, absolute_import
import re
import datetime
from collections import OrderedDict
import numpy as np
from scipy._lib.six import next
import csv
import ctypes
"""A module to read arff files."""
__all__ = ['MetaData', 'loadarff', ... | bsd-3-clause |
np/alot | alot/helper.py | 1 | 15145 | # -*- coding: utf-8 -*-
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
from datetime import timedelta
from datetime import datetime
from collections import deque
import subprocess
im... | gpl-3.0 |
KaranToor/MA450 | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/third_party/apis/dns/v1beta1/dns_v1beta1_client.py | 6 | 11760 | """Generated client library for dns version v1beta1."""
# NOTE: This file is autogenerated and should not be edited by hand.
from apitools.base.py import base_api
from googlecloudsdk.third_party.apis.dns.v1beta1 import dns_v1beta1_messages as messages
class DnsV1beta1(base_api.BaseApiClient):
"""Generated client li... | apache-2.0 |
nathanbjenx/cairis | cairis/gui/AssetEnvironmentPanel.py | 1 | 7194 | # 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... | apache-2.0 |
rizumu/django | tests/gis_tests/gdal_tests/test_raster.py | 238 | 13865 | """
gdalinfo tests/gis_tests/data/rasters/raster.tif:
Driver: GTiff/GeoTIFF
Files: tests/gis_tests/data/rasters/raster.tif
Size is 163, 174
Coordinate System is:
PROJCS["NAD83 / Florida GDL Albers",
GEOGCS["NAD83",
DATUM["North_American_Datum_1983",
SPHEROID["GRS 1980",6378137,298.2572221010002... | bsd-3-clause |
apache/incubator-airflow | airflow/serialization/enums.py | 7 | 1441 | #
# 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... | apache-2.0 |
Azure/azure-sdk-for-python | sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_net_app_resource_operations.py | 1 | 12004 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
CristianBB/SickRage | lib/github/PullRequestPart.py | 74 | 3771 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
himleyb85/django | tests/template_tests/syntax_tests/test_filter_syntax.py | 139 | 9295 | # coding: utf-8
from __future__ import unicode_literals
from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import SomeClass, SomeOtherException, UTF8Class, setup
class FilterSyntaxTests(SimpleTestCase):
@setup({'filter-syntax01': '{{ var|upper }}'})
def test... | bsd-3-clause |
sunshineDrizzle/FreeROI | froi/widgets/binaryerosiondialog.py | 2 | 5165 |
__author__ = 'zhouguangfu, chenxiayu'
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import numpy as np
from scipy.ndimage import morphology
from froi.algorithm.meshtool import binary_shrink
clas... | bsd-3-clause |
savoirfairelinux/OpenUpgrade | addons/hr_gamification/wizard/grant_badge.py | 180 | 2524 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
odoousers2014/odoo | addons/point_of_sale/report/__init__.py | 8 | 1171 | # -*- 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 |
FreekingDean/home-assistant | homeassistant/helpers/event_decorators.py | 12 | 2483 | """Event Decorators for custom components."""
import functools
# pylint: disable=unused-import
from typing import Optional # NOQA
from homeassistant.core import HomeAssistant # NOQA
from homeassistant.helpers import event
HASS = None # type: Optional[HomeAssistant]
def track_state_change(entity_ids, from_state=... | mit |
DingSoung/linux-3.0.1 | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
thnee/ansible | lib/ansible/modules/clustering/k8s/k8s_info.py | 28 | 5024 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, Will Thames <@willthames>
# 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 |
andersk/zulip | scripts/lib/node_cache.py | 3 | 3632 | import hashlib
import json
import os
import shutil
import subprocess
from typing import Dict, List, Optional
from scripts.lib.zulip_tools import run
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
ZULIP_SRV_PATH = "/srv"
NODE_MODULES_CACHE_PATH = os.path.join(ZULIP_SRV_PATH,... | apache-2.0 |
rhololkeolke/apo-website | src/werkzeug/testsuite/http.py | 66 | 16213 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.http
~~~~~~~~~~~~~~~~~~~~~~~
HTTP parsing utilities.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from datetime import datetime
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug... | bsd-3-clause |
snyderr/robotframework | src/robot/libraries/Dialogs.py | 2 | 4541 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | apache-2.0 |
kaushik94/pymc | pymc/theanof.py | 4 | 2024 | from .vartypes import typefilter, continuous_types
from theano import theano, tensor as t
from theano.gof.graph import inputs
from .memoize import memoize
__all__ = ['gradient', 'hessian', 'hessian_diag', 'inputvars', 'cont_inputs']
def inputvars(a):
"""
Get the inputs into a theano variables
Parameters
... | apache-2.0 |
juanyaw/python | cpython/Lib/test/test_pathlib.py | 6 | 83908 | import collections
import io
import os
import errno
import pathlib
import pickle
import socket
import stat
import tempfile
import unittest
from test import support
TESTFN = support.TESTFN
try:
import grp, pwd
except ImportError:
grp = pwd = None
class _BaseFlavourTest(object):
def _check_parse_parts(se... | bsd-3-clause |
bdh1011/wau | venv/lib/python2.7/site-packages/pip/commands/completion.py | 435 | 1991 | from __future__ import absolute_import
import sys
from pip.basecommand import Command
BASE_COMPLETION = """
# pip %(shell)s completion start%(script)s# pip %(shell)s completion end
"""
COMPLETION_SCRIPTS = {
'bash': """
_pip_completion()
{
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\
CO... | mit |
nandhp/youtube-dl | youtube_dl/extractor/izlesene.py | 117 | 4307 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
from ..utils import (
determine_ext,
float_or_none,
get_element_by_id,
int_or_none,
parse_iso8601,
str_to_int,
)
class IzleseneIE(InfoExtractor... | unlicense |
liorvh/golismero | thirdparty_libs/django/db/models/deletion.py | 106 | 13744 | from functools import wraps
from operator import attrgetter
from django.db import connections, transaction, IntegrityError
from django.db.models import signals, sql
from django.utils.datastructures import SortedDict
from django.utils import six
class ProtectedError(IntegrityError):
def __init__(self, msg, protec... | gpl-2.0 |
prefetchnta/questlab | bin/python/Lib/encodings/mac_farsi.py | 272 | 15170 | """ Python Character Mapping Codec mac_farsi generated from 'MAPPINGS/VENDORS/APPLE/FARSI.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,err... | lgpl-2.1 |
xbmc/atv2 | xbmc/lib/libPython/Python/Mac/Modules/drag/dragsupport.py | 39 | 9501 | # This script generates a Python interface for an Apple Macintosh Manager.
# It uses the "bgen" package to generate C code.
# The function specifications are generated by scanning the mamager's header file,
# using the "scantools" package (customized for this particular manager).
import string
# Declarations that cha... | gpl-2.0 |
zhoffice/minos | supervisor/supervisor/medusa/test/test_lb.py | 5 | 4790 | # -*- Mode: Python -*-
# Get a lower bound for Medusa performance with a simple async
# client/server benchmark built on the async lib. The idea is to test
# all the underlying machinery [select, asyncore, asynchat, etc...] in
# a context where there is virtually no processing of the data.
import socket
import selec... | apache-2.0 |
peap/django-debug-toolbar | tests/test_integration.py | 2 | 7240 | # coding: utf-8
from __future__ import absolute_import, unicode_literals
import os
import unittest
from xml.etree import ElementTree as ET
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.test import RequestFactory, TestCase
from django.test.utils import override_settings
from deb... | bsd-3-clause |
ldong/vim_youcompleteme | python/ycm/completers/python/jedi_completer.py | 1 | 5233 | #!/usr/bin/env python
#
# Copyright (C) 2011, 2012 Stephen Sugden <me@stephensugden.com>
# Google Inc.
# Stanislav Golovanov <stgolovanov@gmail.com>
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe is free software: you can redistribute it and/or modify
# it... | gpl-3.0 |
alexey4petrov/pythonFlu | Foam/functionObjects/__init__.py | 1 | 5259 | ## pythonFlu - Python wrapping for OpenFOAM C++ API
## Copyright (C) 2010- Alexey Petrov
## Copyright (C) 2009-2010 Pebble Bed Modular Reactor (Pty) Limited (PBMR)
##
## 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 F... | gpl-3.0 |
estately/sensu-community-plugins | plugins/openstack/nova/nova-server-state-metrics.py | 47 | 1646 | #!/usr/bin/env python
# #RED
from argparse import ArgumentParser
import socket
import time
from novaclient.v3 import Client
DEFAULT_SCHEME = '{}.nova.states'.format(socket.gethostname())
def output_metric(name, value):
print '{}\t{}\t{}'.format(name, value, int(time.time()))
def main():
parser = ArgumentPa... | mit |
frankvdp/django | tests/admin_changelist/models.py | 76 | 2971 | import uuid
from django.db import models
class Event(models.Model):
# Oracle can have problems with a column named "date"
date = models.DateField(db_column="event_date")
class Parent(models.Model):
name = models.CharField(max_length=128)
class Child(models.Model):
parent = models.ForeignKey(Paren... | bsd-3-clause |
uahic/nest-simulator | pynest/nest/tests/test_parrot_neuron.py | 18 | 9989 | # -*- coding: utf-8 -*-
#
# test_parrot_neuron.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 Lice... | gpl-2.0 |
simotek/tanko-bot | src/test-serial.py | 1 | 3379 | # RobotMain - Simon Lees simon@simotek.net
# Copyright (C) 2015 Simon Lees
#
# 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 your option) any l... | lgpl-2.1 |
michaelhenry/codebehind | codebehind/serializers.py | 1 | 1072 | from django.contrib.auth.models import User, Group
from rest_framework import exceptions
from rest_framework import serializers
from . models import UserSecret
class UserSerializer(serializers.ModelSerializer):
secret = serializers.SerializerMethodField('get_secret_key')
class Meta:
model = User
fields = (... | mit |
JeongJunSik/TizenRT | external/iotivity/iotivity_1.2-rel/extlibs/gtest/gtest-1.7.0/test/gtest_shuffle_test.py | 3023 | 12549 | #!/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 of... | apache-2.0 |
pdebuyl/numpy | numpy/fft/helper.py | 7 | 6205 | """
Discrete Fourier Transforms - helper.py
"""
from numpy.compat import integer_types
from numpy.core import integer, empty, arange, asarray, roll
from numpy.core.overrides import array_function_dispatch, set_module
# Created by Pearu Peterson, September 2002
__all__ = ['fftshift', 'ifftshift', 'fftfreq', 'rfftfreq... | bsd-3-clause |
SnabbCo/neutron | neutron/plugins/nuage/nuage_models.py | 1 | 3136 | # Copyright 2014 Alcatel-Lucent USA 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 r... | apache-2.0 |
grivon/yabusame-qemu-dpt | scripts/tracetool/backend/simple.py | 55 | 1385 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Simple built-in backend.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnoczi"
__em... | gpl-2.0 |
mistercrunch/airflow | tests/providers/amazon/aws/operators/test_glacier.py | 10 | 1594 | #
# 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... | apache-2.0 |
pgoeser/gnuradio | gr-wxgui/src/python/gui.py | 16 | 4585 | #
# Copyright 2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version.
#... | gpl-3.0 |
shakamunyi/neutron | neutron/tests/functional/agent/linux/simple_daemon.py | 48 | 1789 | # Copyright 2014 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 required by applicable law or agre... | apache-2.0 |
t794104/ansible | lib/ansible/modules/network/fortios/fortios_firewall_ssh_local_key.py | 24 | 8385 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, 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 Lic... | gpl-3.0 |
stanley-cheung/grpc | src/python/grpcio_channelz/grpc_channelz/v1/channelz.py | 10 | 2419 | # Copyright 2018 The gRPC Authors
#
# 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 writ... | apache-2.0 |
marcoarruda/MissionPlanner | Lib/chunk.py | 65 | 5539 | """Simple class to read IFF chunks.
An IFF chunk (used in formats such as AIFF, TIFF, RMFF (RealMedia File
Format)) has the following structure:
+----------------+
| ID (4 bytes) |
+----------------+
| size (4 bytes) |
+----------------+
| data |
| ... |
+----------------+
The ID... | gpl-3.0 |
roadmapper/ansible | test/units/modules/network/f5/test_bigip_profile_analytics.py | 22 | 3514 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
rjurney/Agile_Data_Code_2 | ch02/pyspark_mongodb.py | 1 | 2096 | # This code sample is meant to be executed line-by-line in a
# pyspark session.
#
# Prior to launching pyspark, run the following line in the
# shell where pyspark will be launched.
#
# export PYSPARK_DRIVER_PYTHON=ipython
#
# The pyspark launch command needs to have additional command line
# arguments passed to ensu... | mit |
Dhivyap/ansible | lib/ansible/modules/network/nxos/nxos_bfd_global.py | 18 | 9548 | #!/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 |
Eaglemania/ASS | pyglet/text/formats/structured.py | 39 | 8965 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | gpl-2.0 |
Universal-Model-Converter/UMC3.0a | data/Python/x86/Lib/site-packages/OpenGL/raw/GL/ARB/draw_buffers_blend.py | 1 | 1932 | '''OpenGL extension ARB.draw_buffers_blend
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_ARB_draw_buffers_blend'
_DEPRECATED = False
glBlend... | mit |
colab/colab | colab/utils/tests/test_conf.py | 1 | 4536 | import sys
import os
from django.test import TestCase, override_settings, Client
from django.conf import settings
from ..conf import (DatabaseUndefined, validate_database,
InaccessibleSettings, _load_py_file, load_py_settings,
load_colab_apps, load_widgets_settings)
from mock ... | gpl-2.0 |
Cog-Creators/Red-DiscordBot | redbot/core/checks.py | 4 | 1998 | import warnings
from typing import Awaitable, TYPE_CHECKING, Dict
import discord
from .commands import (
bot_has_permissions,
bot_in_a_guild,
has_permissions,
is_owner,
guildowner,
guildowner_or_permissions,
admin,
admin_or_permissions,
mod,
mod_or_permissions,
)
from .utils.mo... | gpl-3.0 |
qitianchan/flaskbb | flaskbb/utils/populate.py | 9 | 10091 | # -*- coding: utf-8 -*-
"""
flaskbb.utils.populate
~~~~~~~~~~~~~~~~~~~~
A module that makes creating data more easily
:copyright: (c) 2014 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
from flaskbb.management.models import Setting, SettingsGroup
from flaskbb.user.models imp... | bsd-3-clause |
voc/voctomix | voctocore/lib/videomix.py | 1 | 16530 | #!/usr/bin/env python3
import logging
from configparser import NoOptionError
from enum import Enum, unique
import gi
gi.require_version('GstController', '1.0')
from gi.repository import Gst
from lib.config import Config
from vocto.transitions import Composites, Transitions, Frame, fade_alpha
from lib.scene import Scen... | mit |
aherlihy/mongo-python-driver | bson/json_util.py | 2 | 25013 | # Copyright 2009-2015 MongoDB, 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 writin... | apache-2.0 |
kekivelez/DjangoSkeleton | tcshealth/users/serializers.py | 1 | 3528 | from django.utils.encoding import smart_str
from django.contrib.auth.hashers import make_password
from rest_framework import serializers
from .models import User
class UserSerializer(serializers.ModelSerializer):
"""
Serializers used for User objects.
"""
created_at = serializers.DateTimeField(read_... | gpl-2.0 |
xiangel/hue | desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Hash/test_RIPEMD.py | 116 | 2685 | # -*- coding: utf-8 -*-
#
# SelfTest/Hash/test_RIPEMD.py: Self-test for the RIPEMD-160 hash function
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent t... | apache-2.0 |
jampekka/openhilma | infer_hilma_schema.py | 1 | 2219 | #!/usr/bin/env python3
from pathlib import Path
import argh
import xml.etree.ElementTree as ET
import json
import sys
import itertools
def always_applies_for(eliter, predicate):
seen_tags = set()
not_matching = set()
for el in eliter:
seen_tags.add(el.tag)
if not predicate(el):
not_matching.add(el.tag)
r... | agpl-3.0 |
nathania/pysal | pysal/contrib/network/lincs.py | 15 | 13081 | #!/usr/bin/env python
"""
A library for computing local indicators of network-constrained clusters
Author:
Myunghwa Hwang mhwang4@gmail.com
"""
import unittest
import numpy as np
import scipy.stats as stats
import geodanet.network as pynet
import pysal, copy
import time
def unconditional_sim(event, base, s):
"... | bsd-3-clause |
MotorolaMobilityLLC/external-chromium_org | chrome/common/extensions/docs/server2/chained_compiled_file_system.py | 31 | 3233 | # 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.
from compiled_file_system import CompiledFileSystem
from file_system import FileNotFoundError
class ChainedCompiledFileSystem(object):
''' A CompiledFileS... | bsd-3-clause |
ShySec/scrimmage-scoreboard | web2py/applications/admin/languages/cs.py | 12 | 23108 | # -*- coding: utf-8 -*-
{
'!langcode!': 'cs-cz',
'!langname!': 'čeština',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': 'Kolonka "Upravit" je nepovinný výraz, například "pole1=\'nováhodnota\'". Výsledky databázového JOINu nemůžete mazat ani upravovat... | gpl-2.0 |
knxd/pKNyX | pyknyx/examples/3_weather/weather/fb/sun.py | 2 | 7957 | # -*- coding: utf-8 -*-
""" Python KNX framework
License
=======
- B{PyKNyX} (U{https://github.com/knxd/pyknyx}) is Copyright:
- © 2016-2017 Matthias Urlichs
- PyKNyX is a fork of pKNyX
- © 2013-2015 Frédéric Mantegazza
This program is free software; you can redistribute it and/or modify
it under the terms ... | gpl-3.0 |
RonaldinhoL/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 |
spinellic/Mission-Planner | Lib/textwrap.py | 53 | 17265 | """Text wrapping and filling.
"""
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <gward@python.net>
__revision__ = "$Id$"
import string, re
# Do the right thing with boolean values for all known Python versions
# (so this module c... | gpl-3.0 |
alexpotter1/Neutron_msm8974_hammerhead | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
hep-gc/cloudscheduler | unit_tests/test_group_list.py | 1 | 1322 | from unit_test_common import execute_csv2_request, initialize_csv2_request, ut_id, sanity_requests
from sys import argv
# lno: GV - error code identifier.
def main(gvar):
if not gvar:
gvar = {}
if len(argv) > 1:
initialize_csv2_request(gvar, selections=argv[1])
else:
... | apache-2.0 |
shahbazn/neutron | neutron/extensions/l3.py | 25 | 10193 | # Copyright 2012 VMware, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | apache-2.0 |
geosolutions-it/geonode | geonode/upload/tests/test_upload_preprocessing.py | 4 | 4101 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2018 OSGeo
#
# 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 ... | gpl-3.0 |
boris-p/ladybug | src/Ladybug_Open STAT File.py | 1 | 1988 | # Open Weather data file
#
# Ladybug: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari
#
# This file is part of Ladybug.
#
# Copyright (c) 2013-2015, Mostapha Sadeghipour Roudsari <Sadeghipour@gmail.com>
# Ladybug is free software; you can redistribute it and/or modify
# it under t... | gpl-3.0 |
lichuan261/wuand | XX-Net/python27/1.0/lib/noarch/sortedcontainers/sortedlistwithkey.py | 10 | 41145 | # -*- coding: utf-8 -*-
#
# Sorted list implementation.
from __future__ import print_function
from sys import hexversion
from .sortedlist import recursive_repr
from bisect import bisect_left, bisect_right, insort
from itertools import chain, repeat, starmap
from collections import MutableSequence
from operator import... | gpl-2.0 |
Maspear/odoo | addons/email_template/__openerp__.py | 260 | 3068 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it ... | agpl-3.0 |
m039/Void | third-party/void-boost/tools/build/src/tools/symlink.py | 26 | 3959 | # Status: ported.
# Base revision: 64488.
# Copyright 2003 Dave Abrahams
# Copyright 2002, 2003 Rene Rivera
# Copyright 2002, 2003, 2004, 2005 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Defines the "sym... | mit |
valexandersaulys/airbnb_kaggle_contest | venv/lib/python3.4/site-packages/numpy/core/_methods.py | 103 | 4308 | """
Array methods which are called by both the C-code for the method
and the Python code for the NumPy-namespace function
"""
from __future__ import division, absolute_import, print_function
import warnings
from numpy.core import multiarray as mu
from numpy.core import umath as um
from numpy.core.numeric import asan... | gpl-2.0 |
TheTypoMaster/Fujitsu-Siemens-ESPRIMO-Mobile-V5535 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 1891 | 3300 | # Core.py - Python extension for perf script, core functions
#
# 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.
from collections import defaultdict
def aut... | gpl-2.0 |
gsehub/edx-platform | lms/djangoapps/verify_student/tests/fake_software_secure.py | 13 | 1684 | """
Fake Software Secure page for use in acceptance tests.
"""
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.views.generic.base import View
from edxmako.shortcuts import render... | agpl-3.0 |
HardlyHaki/crits | crits/samples/handlers.py | 2 | 57539 | import copy
import json
import logging
import os
import pprint
import subprocess
import tempfile, shutil
import time
from bson.objectid import ObjectId
from django.conf import settings
from django.core.mail import send_mail
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.s... | mit |
Venturi/oldcms | env/lib/python2.7/site-packages/django/db/models/loading.py | 81 | 1229 | import warnings
from django.apps import apps
from django.utils.deprecation import RemovedInDjango19Warning
warnings.warn(
"The utilities in django.db.models.loading are deprecated "
"in favor of the new application loading system.",
RemovedInDjango19Warning, stacklevel=2)
__all__ = ('get_apps', 'get_app'... | apache-2.0 |
zrhans/pythonanywhere | .virtualenvs/django19/lib/python3.4/site-packages/pandas/tests/test_compat.py | 9 | 2357 | # -*- coding: utf-8 -*-
"""
Testing that functions from compat work as expected
"""
from pandas.compat import (
range, zip, map, filter,
lrange, lzip, lmap, lfilter,
builtins
)
import unittest
import nose
import pandas.util.testing as tm
class TestBuiltinIterators(tm.TestCase):
def check_result(self, ... | apache-2.0 |
henaras/sahara | sahara/plugins/vanilla/v1_2_1/scaling.py | 9 | 3515 | # Copyright (c) 2013 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 writ... | apache-2.0 |
jpzm/bw | comboboxes.py | 1 | 2554 | # vim: set fileencoding=utf-8 :
# Copyright (C) 2008 Joao Paulo de Souza Medeiros
#
# Author(s): Joao Paulo de Souza Medeiros <ignotus21@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundat... | gpl-2.0 |
jrgm/blog | packer/packer.py | 7 | 7732 | #!/usr/bin/python
# The MIT License (MIT)
#
# Copyright (c) 2012-2013 Teemu Ikonen
#
# 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 rig... | mit |
chetan51/nupic | nupic/regions/ImageSensorFilters/Tracking.py | 15 | 11231 | # ----------------------------------------------------------------------
# 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... | gpl-3.0 |
ortylp/scipy | scipy/linalg/decomp_lu.py | 117 | 5796 | """LU decomposition functions."""
from __future__ import division, print_function, absolute_import
from warnings import warn
from numpy import asarray, asarray_chkfinite
# Local imports
from .misc import _datacopied
from .lapack import get_lapack_funcs
from .flinalg import get_flinalg_funcs
__all__ = ['lu', 'lu_so... | bsd-3-clause |
CamelBackNotation/CarnotKE | jyhton/lib-python/2.7/compiler/syntax.py | 369 | 1444 | """Check for errs in the AST.
The Python parser does not catch all syntax errors. Others, like
assignments with invalid targets, are caught in the code generation
phase.
The compiler package catches some errors in the transformer module.
But it seems clearer to write checkers that use the AST to detect
errors.
"""
... | apache-2.0 |
animekita/selvbetjening | selvbetjening/core/mailcenter/models.py | 1 | 6200 | import logging
import re
import markdown
from django.conf import settings
from django.db import models
from django.template import Template, Context, loader
import sys
from selvbetjening.core.mail import send_mail
logger = logging.getLogger('selvbetjening.email')
class EmailSpecification(models.Model):
BODY_FO... | mit |
goddardl/cortex | test/IECore/EXRImageWriter.py | 7 | 8551 | ##########################################################################
#
# Copyright (c) 2010, Image Engine Design 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:
#
# * Redistribu... | bsd-3-clause |
abircse06/youtube-dl | test/helper.py | 29 | 8457 | from __future__ import unicode_literals
import errno
import io
import hashlib
import json
import os.path
import re
import types
import sys
import youtube_dl.extractor
from youtube_dl import YoutubeDL
from youtube_dl.utils import (
compat_str,
preferredencoding,
write_string,
)
def get_params(override=No... | unlicense |
Daniex/horizon | openstack_dashboard/dashboards/project/routers/tables.py | 11 | 8788 | # Copyright 2012, Nachi Ueno, NTT MCL, 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 applic... | apache-2.0 |
pedro2d10/SickRage-FR | lib/hachoir_core/field/fake_array.py | 95 | 2294 | import itertools
from hachoir_core.field import MissingField
class FakeArray:
"""
Simulate an array for GenericFieldSet.array(): fielset.array("item")[0] is
equivalent to fielset.array("item[0]").
It's possible to iterate over the items using::
for element in fieldset.array("item"):
... | gpl-3.0 |
chris-wood/python-mingus | mingus/core/progressions.py | 10 | 15752 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# mingus - Music theory Python package, progressions module.
# Copyright (C) 2008-2009, Bart Spaans
#
# 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 Softwar... | gpl-3.0 |
cognitiveclass/edx-platform | common/djangoapps/track/tests/test_contexts.py | 114 | 2108 | # pylint: disable=missing-docstring
import ddt
from unittest import TestCase
from track import contexts
@ddt.ddt
class TestContexts(TestCase):
COURSE_ID = 'test/course_name/course_run'
SPLIT_COURSE_ID = 'course-v1:test+course_name+course_run'
ORG_ID = 'test'
@ddt.data(
(COURSE_ID, ''),
... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.