repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
druuu/django | django/contrib/gis/gdal/geometries.py | 337 | 24056 | """
The OGRGeometry is a wrapper for using the OGR Geometry class
(see http://www.gdal.org/ogr/classOGRGeometry.html). OGRGeometry
may be instantiated when reading geometries from OGR Data Sources
(e.g. SHP files), or when given OGC WKT (a string).
While the 'full' API is not present yet, the API is "pythonic" u... | bsd-3-clause |
insertnamehere1/maraschino | lib/flask/templating.py | 19 | 4417 | # -*- coding: utf-8 -*-
"""
flask.templating
~~~~~~~~~~~~~~~~
Implements the bridge to Jinja2.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import posixpath
from jinja2 import BaseLoader, Environment as BaseEnvironment, \
TemplateNotFound
from .glo... | mit |
hwu25/AppPkg | Applications/Python/Python-2.7.2/Tools/scripts/ifdef.py | 10 | 3829 | #! /usr/bin/env python
# Selectively preprocess #ifdef / #ifndef statements.
# Usage:
# ifdef [-Dname] ... [-Uname] ... [file] ...
#
# This scans the file(s), looking for #ifdef and #ifndef preprocessor
# commands that test for one of the names mentioned in the -D and -U
# options. On standard output it write... | bsd-2-clause |
kimshinelove/naver-npm | node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | 1407 | 47697 | # 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.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
import sys
fr... | artistic-2.0 |
geoadmin/mapproxy | mapproxy/test/system/test_watermark.py | 5 | 3475 | # This file is part of the MapProxy project.
# Copyright (C) 2011 Omniscale <http://omniscale.de>
#
# 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 |
kr41/ggrc-core | src/ggrc_workflows/migrations/versions/20150714220605_3605dca868e4_add_slug_to_task_group_task.py | 7 | 1213 | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""add slug to task group task
Revision ID: 3605dca868e4
Revises: 1431e7094e26
Create Date: 2015-07-14 22:06:05.063945
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by ... | apache-2.0 |
ubuntustudio-kernel/ubuntu-raring-lowlatency | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
missionpinball/mpf-examples | tests/test_TutorialStep16.py | 1 | 6127 | from mpfmc.tests.MpfIntegrationTestCase import MpfIntegrationTestCase
class TestTutorialStep16(MpfIntegrationTestCase):
def getConfigFile(self):
return 'config.yaml'
def getMachinePath(self):
return self.get_abs_path('tutorial_step_16')
def get_platform(self):
return 'smart_virt... | mit |
ahmedaljazzar/edx-platform | lms/djangoapps/survey/tests/test_signals.py | 11 | 1876 | """
Test signal handlers for the survey app
"""
from openedx.core.djangoapps.user_api.accounts.tests.retirement_helpers import fake_completed_retirement
from student.tests.factories import UserFactory
from survey.models import SurveyAnswer
from survey.tests.factories import SurveyAnswerFactory
from xmodule.modulestore... | agpl-3.0 |
goldeneye-source/ges-python | lib/test/test_urllib2net.py | 7 | 12602 | import unittest
from test import support
from test.test_urllib2 import sanepathname2url
import os
import socket
import urllib.error
import urllib.request
import sys
try:
import ssl
except ImportError:
ssl = None
support.requires("network")
TIMEOUT = 60 # seconds
def _retry_thrice(func, exc, *args, **kwarg... | gpl-3.0 |
dimagol/trex-core | scripts/external_libs/scapy-2.3.1/python3/scapy/layers/dns.py | 3 | 24849 | ## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""
DNS: Domain Name System.
"""
import socket,struct
from scapy.packet import *
from scapy.fields import *
from scapy.... | apache-2.0 |
NeCTAR-RC/ceilometer | ceilometer/tests/hardware/inspector/test_snmp.py | 4 | 9033 | # -*- encoding: utf-8 -*-
#
# Copyright © 2013 Intel Corp
#
# Authors: Lianhao Lu <lianhao.lu@intel.com>
#
# 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/license... | apache-2.0 |
mozilla/kitsune | kitsune/messages/tasks.py | 1 | 2038 | import logging
from django.conf import settings
from django.contrib.sites.models import Site
from django.urls import reverse
from django.utils.translation import ugettext as _
from celery import task
from kitsune.messages.models import InboxMessage
from kitsune.sumo.email_utils import make_mail, safe_translation, se... | bsd-3-clause |
wikilinks/nel | nel/process/tag.py | 1 | 6517 | #!/usr/bin/env python
import os
import sys
import re
import string
from itertools import izip
from time import time
from bisect import bisect_left
from subprocess import Popen, PIPE
from cStringIO import StringIO
import spacy
from .process import Process
from ..model import recognition
from ..doc import Mention, Cha... | mit |
pthaike/keras | keras/datasets/imdb.py | 37 | 1855 | from __future__ import absolute_import
import six.moves.cPickle
import gzip
from .data_utils import get_file
import random
from six.moves import zip
import numpy as np
def load_data(path="imdb.pkl", nb_words=None, skip_top=0, maxlen=None, test_split=0.2, seed=113,
start_char=1, oov_char=2, index_from=3)... | mit |
MrNuggles/HeyBoet-Telegram-Bot | temboo/Library/Google/Plus/Domains/Media/Insert.py | 5 | 6021 | # -*- coding: utf-8 -*-
###############################################################################
#
# Insert
# Adds a new media item to an album.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file exce... | gpl-3.0 |
beblount/Steer-Clear-Backend-Web | env/Lib/site-packages/sqlalchemy/util/topological.py | 60 | 2794 | # util/topological.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Topological sorting algorithms."""
from ..exc import CircularDependencyError... | mit |
rubbish/oh-my-zsh | plugins/git-prompt/gitstatus.py | 343 | 2372 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from subprocess import Popen, PIPE
import re
# change those symbols to whatever you prefer
symbols = {
'ahead of': '↑',
'behind': '↓',
'staged': '♦',
'changed': '‣',
'untracked': '…',
'clean': '⚡',
'unmerged': '≠',
'sha1': ':'
}
output, err... | mit |
ProvidencePlan/Profiles | communityprofiles/maps/forms.py | 2 | 3018 | from django import forms
from maps.models import ShapeFile
from django.core.exceptions import ValidationError
from django.db.models.fields.files import FieldFile
from maps.utils import *
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.geos import GEOSGeometry, MultiPolygon
class ShapeFileForm(fo... | mit |
ml-lab/pylearn2 | pylearn2/datasets/tests/test_cifar10.py | 3 | 3549 | import unittest
import numpy as np
from pylearn2.datasets.cifar10 import CIFAR10
from pylearn2.space import Conv2DSpace
from pylearn2.testing.skip import skip_if_no_data
class TestCIFAR10(unittest.TestCase):
def setUp(self):
skip_if_no_data()
self.test = CIFAR10(which_set='test')
def test_top... | bsd-3-clause |
CloudServer/nova | nova/api/openstack/compute/contrib/flavor_disabled.py | 79 | 2223 | # Copyright 2012 Nebula, 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... | apache-2.0 |
Jeff-Tian/mybnb | Python27/Tools/Scripts/ndiff.py | 12 | 3942 | #! /usr/bin/env python
# Module ndiff version 1.7.0
# Released to the public domain 08-Dec-2000,
# by Tim Peters (tim.one@home.com).
# Provided as-is; use at your own risk; no warranty; no promises; enjoy!
# ndiff.py is now simply a front-end to the difflib.ndiff() function.
# Originally, it contained the d... | apache-2.0 |
Sarah-Alsinan/muypicky | lib/python3.6/site-packages/django/contrib/contenttypes/management/__init__.py | 60 | 4919 | from django.apps import apps as global_apps
from django.db import DEFAULT_DB_ALIAS, migrations, router, transaction
from django.db.utils import IntegrityError
from django.utils import six
class RenameContentType(migrations.RunPython):
def __init__(self, app_label, old_model, new_model):
self.app_label = a... | mit |
anestv/pa | test/external/requests/packages/urllib3/request.py | 83 | 5557 | try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from .filepost import encode_multipart_formdata
__all__ = ['RequestMethods']
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen` method, such
as :class:`~urllib3.... | artistic-2.0 |
michallula/marathon-proxy-manager | src/marathon_proxy_manager/nginx.py | 1 | 6399 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Lingaro
import os
import subprocess
from marathon import MarathonClient
from jinja2 import Environment, ChoiceLoader, FileSystemLoader, PackageLoader
class MarathonProxyManagerCommand(object):
DEFAULT_TEMPLATE_LOADER = PackageLoader(u'maratho... | mit |
barachka/odoo | addons/portal/portal.py | 386 | 1361 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
bsipocz/astroML | doc/conf.py | 2 | 7960 | # -*- coding: utf-8 -*-
#
# astroML documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 6 15:37:12 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | bsd-2-clause |
opencloudinfra/orchestrator | venv/Lib/site-packages/django/conf/locale/ka/formats.py | 504 | 2180 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'l, j F, Y'
TIME_FORMAT = 'h:i a'
... | gpl-3.0 |
arskom/spyne | spyne/test/protocol/test_yaml.py | 2 | 1914 | #!/usr/bin/env python
#
# spyne - Copyright (C) Spyne contributors.
#
# 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 later ve... | lgpl-2.1 |
cs-shadow/phabricator-tools | py/abd/abdt_classicnaming.py | 4 | 6547 | """Branch naming conventions for 'arcyd-review/description/base' style."""
# =============================================================================
# CONTENTS
# -----------------------------------------------------------------------------
# abdt_classicnaming
#
# Public Classes:
# Naming
# .make_tracker_bra... | apache-2.0 |
connorimes/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/testdata/handlers/sub/plain_wsh.py | 499 | 1789 | # 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 conditions and the f... | mpl-2.0 |
GarySparrow/mFlaskWeb | venv/Lib/site-packages/coverage/backunittest.py | 95 | 1515 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Implementations of unittest features from the future."""
# Use unittest2 if it's available, otherwise unittest. This gives us
# back-ported features for 2.6.
t... | mit |
poiesisconsulting/openerp-restaurant | document/test_cindex.py | 444 | 1553 | #!/usr/bin/python
import sys
import os
import glob
import time
import logging
from optparse import OptionParser
logging.basicConfig(level=logging.DEBUG)
parser = OptionParser()
parser.add_option("-q", "--quiet",
action="store_false", dest="verbose", default=True,
help="don't prin... | agpl-3.0 |
z3ntu/razer-drivers | examples/custom_starlight.py | 1 | 2320 | from collections import defaultdict
import colorsys
import random
import time
import threading
from razer.client import DeviceManager
from razer.client import constants as razer_constants
# Create a DeviceManager. This is used to get specific devices
device_manager = DeviceManager()
print("Found {} Razer devices".f... | gpl-2.0 |
nazeehshoura/crawler | env/lib/python2.7/site-packages/django/contrib/gis/db/models/manager.py | 83 | 3548 | from django.db.models.manager import Manager
from django.contrib.gis.db.models.query import GeoQuerySet
class GeoManager(Manager):
"Overrides Manager to return Geographic QuerySets."
# This manager should be used for queries on related fields
# so that geometry columns on Oracle and MySQL are selected
... | mit |
xuxiao19910803/edx-platform | common/test/acceptance/pages/studio/course_page.py | 172 | 1522 | """
Base class for pages specific to a course in Studio.
"""
import os
from opaque_keys.edx.locator import CourseLocator
from bok_choy.page_object import PageObject
from . import BASE_URL
class CoursePage(PageObject):
"""
Abstract base class for page objects specific to a course in Studio.
"""
# Ove... | agpl-3.0 |
infoelliex/odoo-saas-tools | saas_client/models/res_user.py | 6 | 3354 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010, 2014 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | lgpl-3.0 |
MarkuNauma2/Markus | py/openage/convert/stringresource.py | 46 | 1211 | from collections import defaultdict
from . import dataformat
from .util import dbg
class StringResource(dataformat.Exportable):
name_struct = "string_resource"
name_struct_file = "string_resource"
struct_description = "string id/language to text mapping, extracted from language.dll file."
dat... | gpl-3.0 |
jejimenez/django | tests/backends/models.py | 223 | 3397 | from __future__ import unicode_literals
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class S... | bsd-3-clause |
blbarker/spark-tk | regression-tests/sparktkregtests/testcases/models/kmeans_test.py | 10 | 11430 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 |
DirectXMan12/nova-hacking | nova/db/sqlalchemy/types.py | 12 | 1853 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
# 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.apach... | apache-2.0 |
coderb0t/CouchPotatoServer | libs/rsa/varblock.py | 216 | 4360 | # -*- coding: utf-8 -*-
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | gpl-3.0 |
monokal/qb | qb.py | 1 | 8376 | #!/usr/bin/env python3
""" A command-line client to manage qb environments. """
import argparse
import logging.handlers
import sys
from client.config import Config
from container.container import Container
from machine.machine import Machine
__author__ = "Daniel Middleton"
__email__ = "d@monokal.io"
__status__ = "P... | gpl-3.0 |
hcsturix74/django | tests/template_tests/templatetags/inclusion.py | 174 | 8479 | import operator
from django.template import Engine, Library
from django.utils import six
engine = Engine(app_dirs=True)
register = Library()
@register.inclusion_tag('inclusion.html')
def inclusion_no_params():
"""Expected inclusion_no_params __doc__"""
return {"result": "inclusion_no_params - Expected resul... | bsd-3-clause |
rodrigoasmacedo/PySPED | tests/testutils.py | 9 | 2472 | # -*- coding: utf-8 -*-
import fnmatch
import os
import pysped
def list_recursively(directory, pattern):
"""Returns files recursively from directory matching pattern
:param directory: directory to list
:param pattern: glob mattern to match
"""
matches = []
for root, dirnames, filenames in os.... | lgpl-2.1 |
Pablo126/SSBW | Tarea3/tarea3/lib/python3.5/site-packages/setuptools/command/build_clib.py | 314 | 4484 | import distutils.command.build_clib as orig
from distutils.errors import DistutilsSetupError
from distutils import log
from setuptools.dep_util import newer_pairwise_group
class build_clib(orig.build_clib):
"""
Override the default build_clib behaviour to do the following:
1. Implement a rudimentary time... | gpl-3.0 |
stackforge/watcher | watcher/decision_engine/goal/goals.py | 2 | 6789 | # -*- encoding: utf-8 -*-
# Copyright (c) 2016 b<>com
#
# 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 a... | apache-2.0 |
matrixise/odoo | addons/base_gengo/__init__.py | 377 | 1122 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Openerp sa (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | agpl-3.0 |
apaku/pygmailarchive | setup.py | 1 | 1214 | import os
from setuptools import setup
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(os.path.join(os.pat... | bsd-2-clause |
arm-hpc/allinea_json_analysis | PR_JSON_Scripts/pr_json_common.py | 1 | 3809 | #!/usr/bin/env python
# Copyright 2015-2017 ARM Limited
#
# 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... | apache-2.0 |
miptliot/edx-platform | common/lib/calc/calc/functions.py | 279 | 1521 | """
Provide the mathematical functions that numpy doesn't.
Specifically, the secant/cosecant/cotangents and their inverses and
hyperbolic counterparts
"""
import numpy
# Normal Trig
def sec(arg):
"""
Secant
"""
return 1 / numpy.cos(arg)
def csc(arg):
"""
Cosecant
"""
return 1 / nump... | agpl-3.0 |
raildo/python-keystoneclient | python-keystoneclient-0.4.1.7.gdca1d42/keystoneclient/v2_0/roles.py | 13 | 3136 | # Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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/... | apache-2.0 |
DARKPOP/external_chromium_org_third_party_skia | platform_tools/android/gyp_gen/tool_makefile_writer.py | 17 | 3228 | #!/usr/bin/python
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Code for generating Android.mk for a tool."""
import android_framework_gyp
import gypd_parser
import makefile_writer
import os
import vars_dict_lib
def write_to... | bsd-3-clause |
koolspin/rosetta | filters/logger_sink.py | 1 | 3694 | import binascii
from graph.filter_base import FilterBase, FilterState, FilterType
from graph.pad_template import PadTemplate
from graph.pad_capabilities import PadCapabilities
from graph.input_pin import InputPin
from graph.output_pin import OutputPin
class LoggerSink(FilterBase):
"""
A logger sink filter.
... | mit |
execuc/LCInterlocking | lasercut/hingesproperties.py | 1 | 6521 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2016 execuc *
# * ... | lgpl-2.1 |
Juniper/nova | nova/tests/unit/objects/test_migration_context.py | 6 | 4720 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
k3nnyfr/s2a_fr-nsis | s2a/Python/Lib/gzip.py | 57 | 18694 | """Functions that read and write gzipped files.
The user of the file doesn't have to worry about the compression,
but random access is not allowed."""
# based on Andrew Kuchling's minigzip.py distributed with the zlib module
import struct, sys, time, os
import zlib
import io
import __builtin__
__all__ = ["GzipFile"... | gpl-3.0 |
noironetworks/nova | nova/tests/unit/fake_policy.py | 30 | 17674 | # Copyright (c) 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-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 |
gangadhar-kadam/nassimapp | patches/december_2012/stock_entry_cleanup.py | 30 | 2060 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import webnotes
def execute():
# removed following fields
webnotes.reload_doc("stock", "doctype", "stock_entry")
custom_fields()
deprecate_process()
webnotes.delete_doc("doctype", "san... | agpl-3.0 |
CxyYuan/luyoutec_lanyou5_2 | node_modules/pangyp/gyp/pylib/gyp/win_tool.py | 395 | 12634 | #!/usr/bin/env python
# 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.
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
import os
impor... | mit |
alexmandujano/django | tests/i18n/tests.py | 42 | 70928 | # -*- encoding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import datetime
import decimal
import os
import pickle
from threading import local
from django.conf import settings
from django.core.management.utils import find_command
from django.template import Template, Context
from django.templat... | bsd-3-clause |
trunca/enigma2 | lib/python/Components/Converter/genre.py | 72 | 4163 | #
# Genre types taken from DVB standards documentation
#
# some broadcaster do define other types so this list
# may grow or be replaced..
#
maintype = [ _("Reserved"),
_("Movie/Drama"),
_("News Current Affairs"),
_("Show Games show"),
_("Sports"),
_("Children/Youth"),
_("Music/Ballet/Dance"),
_("Arts/Cul... | gpl-2.0 |
dwaynebailey/translate | translate/storage/factory.py | 2 | 8230 | # -*- coding: utf-8 -*-
#
# Copyright 2006-2010 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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
# ... | gpl-2.0 |
spartonia/django-oscar | src/oscar/apps/dashboard/pages/app.py | 49 | 1113 | from django.conf.urls import url
from oscar.core.application import Application
from oscar.core.loading import get_class
class FlatPageManagementApplication(Application):
name = None
default_permissions = ['is_staff', ]
list_view = get_class('dashboard.pages.views', 'PageListView')
create_view = get... | bsd-3-clause |
scattering/ipeek | server/sans/data.py | 1 | 5336 | #!/usr/bin/env python
import struct
import sys
import vaxutils
import numpy
import math
def readNCNRData(inputfile):
f = open(inputfile, 'rb')
data = f.read()
f.close()
#filename
dat = struct.unpack('<21s',data[2:23])
filename = dat[0].replace(' ','')
#metadata
metadata = {}
... | unlicense |
jjmiranda/edx-platform | lms/djangoapps/instructor/services.py | 15 | 4813 | """
Implementation of "Instructor" service
"""
import logging
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey, UsageKey
from commerce.signals import create_zendesk_ticket
from courseware.models import StudentModule
from instructor.views.tools import get_student_from_identifier
from ... | agpl-3.0 |
vmax-feihu/hue | desktop/core/ext-py/pysaml2-2.4.0/src/xmldsig/__init__.py | 32 | 63554 | #!/usr/bin/env python
#
# Generated Mon May 2 14:23:33 2011 by parse_xsd.py version 0.4.
#
import saml2
from saml2 import SamlBase
NAMESPACE = 'http://www.w3.org/2000/09/xmldsig#'
ENCODING_BASE64 = 'http://www.w3.org/2000/09/xmldsig#base64'
# digest and signature algorithms (not implemented = commented out)
DIGES... | apache-2.0 |
chauhanmohit/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py | 117 | 39195 | # Copyright (c) 2011 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple Inc. All rights reserved.
# Copyright (c) 2010 Research In Motion Limited. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are... | bsd-3-clause |
palaniyappanBala/sulley | sulley/__init__.py | 6 | 29146 | import sulley.blocks
import sulley.instrumentation
import sulley.legos
import sulley.pedrpc
import sulley.primitives
import sulley.sex
import sulley.sessions
import sulley.utils
BIG_ENDIAN = ">"
LITTLE_ENDIAN = "<"
##################################################################################... | gpl-2.0 |
PersonalGenomesOrg/open-humans-data-processing | sources/go_viral.py | 2 | 2529 | """
Create data files from a user's GoViral data.
Copyright (C) 2016 PersonalGenomes.org
This software is shared under the "MIT License" license (aka "Expat License"),
see LICENSE.TXT for full license text.
"""
import json
import os
import requests
from base_source import BaseSource
GO_VIRAL_DATA_URL = 'https://w... | mit |
quantopian/serializable-traitlets | straitlets/ext/tests/test_click.py | 1 | 4991 | import re
from textwrap import dedent
import click
from click.testing import CliRunner
import pytest
from straitlets import (
Serializable,
StrictSerializable,
Bool,
Unicode,
Integer,
)
from straitlets.ext.click import (
JsonConfigFile,
YamlConfigFile,
)
from straitlets.test_utils import a... | apache-2.0 |
kailIII/geraldo | site/newsite/django_1_0/django/utils/text.py | 12 | 8731 | import re
from django.conf import settings
from django.utils.encoding import force_unicode
from django.utils.functional import allow_lazy
from django.utils.translation import ugettext_lazy
from htmlentitydefs import name2codepoint
# Capitalizes the first letter of a string.
capfirst = lambda x: x and force_unicode(x)[... | lgpl-3.0 |
hackers-terabit/portage | pym/portage/manifest.py | 1 | 24994 | # Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import unicode_literals
import errno
import io
import logging
import re
import stat
import sys
import warnings
import portage
portage.proxy.lazyimport.lazyimport(globals(),
'portage.checksum:ha... | gpl-2.0 |
PythonNut/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/performance/concatenation.py | 451 | 1145 | from __future__ import absolute_import, division, unicode_literals
def f1():
x = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
y = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
z = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
x += y + z
def f2():
x = "ABCDEFGHIJKLMNOP... | mpl-2.0 |
indictranstech/erpnext | erpnext/healthcare/setup.py | 6 | 16695 | from __future__ import unicode_literals
import frappe
from frappe import _
from erpnext.setup.utils import insert_record
def setup_healthcare():
if frappe.db.exists('Medical Department', 'Cardiology'):
# already setup
return
create_medical_departments()
create_antibiotics()
create_test_uom()
create_duration(... | agpl-3.0 |
SlimRemix/android_external_chromium_org | chrome/common/extensions/docs/server2/api_list_data_source_test.py | 78 | 8013 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import json
from api_list_data_source import APIListDataSource
from api_models import ContentScriptAPI
from extensions... | bsd-3-clause |
arjoly/scikit-learn | doc/sphinxext/github_link.py | 314 | 2661 | from operator import attrgetter
import inspect
import subprocess
import os
import sys
from functools import partial
REVISION_CMD = 'git rev-parse --short HEAD'
def _get_git_revision():
try:
revision = subprocess.check_output(REVISION_CMD.split()).strip()
except subprocess.CalledProcessError:
... | bsd-3-clause |
akretion/odoo | odoo/cli/deploy.py | 26 | 3620 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import os
import requests
import sys
import tempfile
import zipfile
from . import Command
class Deploy(Command):
"""Deploy a module on an Odoo instance"""
def __init__(self):
super(Deploy, self).__init_... | agpl-3.0 |
dbbhattacharya/kitsune | kitsune/wiki/migrations/0003_add_afrikaans.py | 4 | 15018 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"""Create the Afrikaans Locale."""
orm.Locale.objects.create(locale='af')
def backwards(self, orm):
... | bsd-3-clause |
AnotherIvan/calibre | src/calibre/utils/ipc/server.py | 11 | 12195 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import sys, os, cPickle, time, tempfile, errno
from math import ceil
from threading ... | gpl-3.0 |
ol-loginov/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 |
sharbison3/python-docs-samples | bigquery/api/streaming.py | 5 | 3152 | #!/usr/bin/env python
# Copyright 2015, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
pmquang/python-anyconfig | anyconfig/backend/tests/json.py | 1 | 1856 | #
# Copyright (C) 2012 - 2015 Satoru SATOH <ssato @ redhat.com>
# License: MIT
#
# pylint: disable=missing-docstring
import os.path
import unittest
import anyconfig.backend.json as TT
import anyconfig.tests.common
from anyconfig.tests.common import dicts_equal
CNF_0_S = """{
"a": 0,
"b": "bbb",
"sect0": {
... | mit |
damaggu/SAMRI | samri/plotting/aggregate.py | 1 | 4664 | import matplotlib.pyplot as plt
import pandas as pd
import seaborn.apionly as sns
from os import path
from matplotlib import rcParams
EXTRA_COLORSET = ["#797979","#000000","#505050","#FFFFFF","#B0B0B0",]
def registration_qc(df,
cmap="Set3",
extra=False,
extra_cmap=EXTRA_COLORSET,
group={"sub":"Subject"},
repeat=... | gpl-3.0 |
sport-monkey/GYP | test/generator-output/gyptest-rules.py | 198 | 1768 | #!/usr/bin/env python
# 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.
"""
Verifies --generator-output= behavior when using rules.
"""
import TestGyp
# Android doesn't support --generator-output.
test = TestGy... | bsd-3-clause |
evgchz/scikit-learn | examples/ensemble/plot_gradient_boosting_regularization.py | 355 | 2843 | """
================================
Gradient Boosting regularization
================================
Illustration of the effect of different regularization strategies
for Gradient Boosting. The example is taken from Hastie et al 2009.
The loss function used is binomial deviance. Regularization via
shrinkage (``lear... | bsd-3-clause |
qwertyjune/BethSaidaBible | venv/lib/python2.7/site-packages/django/contrib/gis/geos/geometry.py | 54 | 25297 | """
This module contains the 'base' GEOSGeometry object -- all GEOS Geometries
inherit from this object.
"""
from __future__ import unicode_literals
# Python, ctypes and types dependencies.
from ctypes import addressof, byref, c_double
from django.contrib.gis import memoryview
# super-class for mutable list behavio... | gpl-3.0 |
SmartPeople/zulip | zerver/management/commands/delete_old_unclaimed_attachments.py | 46 | 1892 | from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from argparse import ArgumentParser
from django.core.management.base import BaseCommand
from zerver.lib.actions import do_delete_old_unclaimed_attachments
from zerver.models import Attachment, get_old_unclaimed_attach... | apache-2.0 |
svagionitis/youtube-dl | youtube_dl/extractor/mpora.py | 12 | 2006 | from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..utils import int_or_none
class MporaIE(InfoExtractor):
_VALID_URL = r'^https?://(www\.)?mpora\.(?:com|de)/videos/(?P<id>[^?#/]+)'
IE_NAME = 'MPORA'
_TEST = {
'url': 'http://mpora.de/videos/AAd... | unlicense |
dzan/xenOnArm | tools/xm-test/lib/XmTestLib/Console.py | 37 | 9322 | #!/usr/bin/python
"""
XmConsole.py - Interact with a xen console, getting return codes and
output from commands executed there.
Copyright (C) International Business Machines Corp., 2005
Author: Dan Smith <danms@us.ibm.com>
This program is free software; you can redistribute it and/or modify
it un... | gpl-2.0 |
rhinstaller/anaconda | pyanaconda/modules/security/__main__.py | 5 | 1150 | #
# Security DBus service launcher.
#
# Copyright (C) 2020 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is dist... | gpl-2.0 |
neraliu/tainted-phantomjs | src/breakpad/src/tools/gyp/test/generator-output/gyptest-actions.py | 151 | 1953 | #!/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 --generator-output= behavior when using actions.
"""
import TestGyp
test = TestGyp.TestGyp()
# All the generated files shoul... | bsd-3-clause |
zasdfgbnm/tensorflow | tensorflow/contrib/boosted_trees/estimator_batch/custom_export_strategy_test.py | 47 | 9513 | # 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 |
MrNuggles/HeyBoet-Telegram-Bot | temboo/Library/InfluenceExplorer/EntityOverview.py | 5 | 3664 | # -*- coding: utf-8 -*-
###############################################################################
#
# EntityOverview
# Returns general information about a particular politician, individual, or organization with a given entity id.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed unde... | gpl-3.0 |
nathania/data-science-from-scratch | code/gradient_descent.py | 53 | 5895 | from __future__ import division
from collections import Counter
from linear_algebra import distance, vector_subtract, scalar_multiply
import math, random
def sum_of_squares(v):
"""computes the sum of squared elements in v"""
return sum(v_i ** 2 for v_i in v)
def difference_quotient(f, x, h):
return (f(x +... | unlicense |
deanhiller/databus | webapp/play1.3.x/python/Lib/encodings/cp1258.py | 93 | 13927 | """ Python Character Mapping Codec cp1258 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1258.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 d... | mpl-2.0 |
K-Constantine/Amaraki | core/deps/gyp/test/msvs/filters/gyptest-filters-2008.py | 166 | 1599 | #!/usr/bin/env python
# Copyright (c) 2014 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 extra filters are pruned correctly for Visual Studio 2008.
"""
import re
import TestGyp
def strip_ws(str):
return r... | mit |
abusse/cinder | cinder/tests/test_fusionio_ioControl.py | 3 | 41319 | # Copyright (c) 2014 Fusion-io, 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 requi... | apache-2.0 |
phaethon/scapy | kamene/contrib/eigrp.py | 1 | 16003 | #!/usr/bin/env python
# kamene.contrib.description = EIGRP
# kamene.contrib.status = loads
"""
EIGRP Scapy Extension
~~~~~~~~~~~~~~~~~~~~~
:version: 2009-08-13
:copyright: 2009 by Jochen Bartl
:e-mail: lobo@c3a.de / jochen.bartl@gmail.com
:license: GPL v2
This program is free ... | gpl-2.0 |
Charlotte-Morgan/inasafe | safe/datastore/test/test_geopackage.py | 6 | 5376 | # coding=utf-8
"""
InaSAFE Disaster risk assessment tool by AusAid - **Clipper test suite.**
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.