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 |
|---|---|---|---|---|---|
jjlee3/openthread | tools/harness-automation/cases/leader_5_1_1.py | 16 | 1875 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... | bsd-3-clause |
potsmaster/cinder | cinder/tests/unit/test_infortrend_common.py | 18 | 77180 | # Copyright (c) 2015 Infortrend Technology, 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
#
# ... | apache-2.0 |
slorg1/heroku-buildpack-python | vendor/pip-pop/pip/_vendor/progress/helpers.py | 404 | 2894 | # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE A... | mit |
40223148/2015cda_g5 | static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/base.py | 603 | 4652 | #!/usr/bin/env python
## https://bitbucket.org/pygame/pygame/raw/2383b8ab0e2273bc83c545ab9c18fee1f3459c64/pygame/base.py
'''Pygame core routines
Contains the core routines that are used by the rest of the
pygame modules. Its routines are merged directly into the pygame
namespace. This mainly includes the auto-initia... | gpl-3.0 |
nmrao/robotframework | src/robot/libdoc.py | 17 | 8412 | #!/usr/bin/env python
# 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 r... | apache-2.0 |
Leoniela/nipype | nipype/interfaces/spm/tests/test_auto_Normalize.py | 9 | 2347 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.spm.preprocess import Normalize
def test_Normalize_inputs():
input_map = dict(DCT_period_cutoff=dict(field='eoptions.cutoff',
),
affine_regularization_type=dict(field='eoptions.regtype',
... | bsd-3-clause |
kyleabeauchamp/EnsemblePaper | code/model_building/fit_model.py | 1 | 1807 | import numpy as np
from fitensemble import belt, ensemble_fitter
import experiment_loader
import sys
import ALA3
belt.ne.set_num_threads(1)
def run(ff, prior, regularization_strength, bootstrap_index_list):
pymc_filename = ALA3.data_directory + "/models/model_%s_%s_reg-%.1f-BB%d.h5" % (ff, prior, regularization_st... | gpl-3.0 |
harshaneelhg/scikit-learn | examples/cluster/plot_lena_compress.py | 271 | 2229 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Vector Quantization Example
=========================================================
The classic image processing example, Lena, an 8-bit grayscale
bit-depth, 512 x 512 sized image, is used here to illustrate
how ... | bsd-3-clause |
dancingdan/tensorflow | tensorflow/python/autograph/utils/context_managers.py | 64 | 1708 | # 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 |
sangwook236/general-development-and-testing | sw_dev/python/rnd/test/language_processing/opennmt_py_test.py | 2 | 77277 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# REF [site] >>
# http://opennmt.net/
# https://github.com/OpenNMT/OpenNMT-py
import argparse, time
import torch
import torchtext
import onmt
import onmt.translate
import onmt.utils.parse
def save_model(model_filepath, model, generator):
#torch.save(model.state_dict(), ... | gpl-2.0 |
erkike/daw | angular/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py | 960 | 45344 | # 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.
# Notes:
#
# This generates makefiles suitable for inclusion into the Android build system
# via an Android.mk file. It is based on make.py, the standard makefile
... | mit |
xtr4nge/FruityProxy | plugins/plugin.py | 1 | 1262 | #!/usr/bin/env python
# Copyright (C) 2015-2016 xtr4nge [_AT_] 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 Foundation, either version 3 of the License, or
# (at your option) any later versi... | lgpl-3.0 |
achals/servo | tests/wpt/css-tests/css21_dev/xhtml1print/reference/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 |
byterom/android_external_chromium_org | third_party/protobuf/python/google/protobuf/internal/type_checkers.py | 527 | 12163 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
Luffin/powerline | powerline/renderers/vim.py | 32 | 5785 | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import sys
import vim
from powerline.bindings.vim import vim_get_func, vim_getoption, environ, current_tabpage, get_vim_encoding
from powerline.renderer import Renderer
from powerline.colorscheme import... | mit |
2014c2g2/teamwork | exts/w2/static/Brython2.0.0-20140209-164925/Lib/browser/indexed_db.py | 100 | 2966 | class EventListener:
def __init__(self, events=[]):
self._events=events
def append(self, event):
self._events.append(event)
def fire(self, e):
for _event in self._events:
_event(e)
class IndexedDB:
def __init__(self):
if not __BRYTHON__.has_indexedDB:
raise NotImple... | gpl-2.0 |
phlax/translate | translate/convert/po2prop.py | 3 | 11398 | # -*- coding: utf-8 -*-
#
# Copyright 2002-2006 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 |
mordred-descriptor/mordred | mordred/_util.py | 1 | 2230 | from __future__ import print_function
import os
import sys
import numpy as np
def parse_enum(enum, v):
if isinstance(v, enum):
return v
else:
return enum[v]
def atoms_to_numpy(f, mol, dtype="float"):
return np.fromiter((f(a) for a in mol.GetAtoms()), dtype, mol.GetNumAtoms())
def con... | bsd-3-clause |
thinkopensolutions/geraldo | site/newsite/django_1_0/django/utils/datastructures.py | 10 | 13100 | class MergeDict(object):
"""
A simple class for creating new "virtual" dictionaries that actually look
up values in more than one dictionary, passed in the constructor.
If a key appears in more than one of the given dictionaries, only the
first occurrence will be used.
"""
def __init__(self... | lgpl-3.0 |
mixturemodel-flow/tensorflow | tensorflow/tools/compatibility/ast_edits.py | 47 | 18961 | # Copyright 2016 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 |
bcoca/ansible | test/units/galaxy/test_collection_install.py | 15 | 43234 | # -*- coding: utf-8 -*-
# Copyright: (c) 2019, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import copy
import json
import os
import py... | gpl-3.0 |
pleaseproject/python-for-android | python-modules/twisted/twisted/internet/_signals.py | 57 | 6075 | # -*- test-case-name: twisted.test.test_process,twisted.internet.test.test_process -*-
# Copyright (c) 2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This module provides a uniform interface to the several mechanisms which are
possibly available for dealing with signals.
This module is used to integ... | apache-2.0 |
Akasurde/ansible | test/support/integration/plugins/module_utils/docker/swarm.py | 61 | 10842 | # (c) 2019 Piotr Wojciechowski (@wojciechowskipiotr) <piotr@it-playground.pl>
# (c) Thierry Bouvet (@tbouvet)
# 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 json
from time impo... | gpl-3.0 |
shakamunyi/nova | nova/tests/functional/v3/test_fping.py | 19 | 1663 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... | apache-2.0 |
mozilla/zamboni | sites/stage/settings.py | 4 | 9237 | from mkt.settings import * # noqa
import logging
import environ
environ.Env.read_env(env_file='/etc/zamboni/settings.env')
env = environ.Env()
ENV = env('ENV')
DOMAIN = env('DOMAIN')
SITE_URL = 'https://{0}'.format(DOMAIN)
CRONJOB_LOCK_PREFIX = DOMAIN
BROWSERID_AUDIENCES = [SITE_URL]
STATIC_URL = env('STATIC_URL')... | bsd-3-clause |
OnRampOrg/onramp | modules/FWC/bin/onramp_run.py | 2 | 1220 | #!/usr/bin/env python
#
# Curriculum Module Run Script
# - Run once per run of the module by a user
# - Run inside job submission. So in an allocation.
# - onramp_run_params.cfg file is available in current working directory
#
import os
import sys
from subprocess import call
from configobj import ConfigObj
#
# Read t... | bsd-3-clause |
dlazz/ansible | lib/ansible/modules/network/panos/panos_cert_gen_ssh.py | 61 | 6225 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | gpl-3.0 |
daphne-yu/aubio | python.old/aubio/task/cut.py | 13 | 1576 | from task import task
from aubio.aubioclass import *
class taskcut(task):
def __init__(self,input,slicetimes,params=None,output=None):
""" open the input file and initialize arguments
parameters should be set *before* calling this method.
"""
from os.path import basename,splitext
task.__init__(self,input,o... | gpl-3.0 |
derekjchow/models | research/morph_net/op_regularizers/conv_group_lasso_regularizer_test.py | 2 | 3639 | # Copyright 2018 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 applicab... | apache-2.0 |
SerpentCS/odoo | addons/website_report/controllers/main.py | 243 | 1460 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
mrhubbs/merge_csv | work.py | 1 | 2511 | """
10-20-15
"""
import tempfile
import csv
def load_csv_as_dict(csv_path):
"""
Loads a CSV into a dictionary.
"""
with open(csv_path, 'rb') as csvfile:
reader = csv.reader(csvfile, delimiter=',')
header_row = reader.next()
dat = [[] for _ in header_row]
row_len = len... | gpl-2.0 |
Jenselme/AutobahnPython | examples/twisted/wamp/rpc/arguments/backend.py | 2 | 2587 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | mit |
cnbeining/videospeeder | videospeeder.py | 2 | 8729 | #!/usr/bin/env python
#coding:utf-8
# Author: Beining --<ACICFG>
# Contact: http://www.cnbeining.com/ |https://github.com/cnbeining/videospeeder
# Purpose: Acceletate video to bypass Letvcloud's transcode.
# Created: 08/28/2014
# LICENSE: GNU v2
import sys
import os
import os, sys, subprocess, shlex, re
from subpro... | gpl-2.0 |
2mny/mylar | mylar/torrent/clients/utorrent.py | 2 | 2494 | import os
from libs.utorrent.client import UTorrentClient
# Only compatible with uTorrent 3.0+
class TorrentClient(object):
def __init__(self):
self.conn = None
def connect(self, host, username, password):
if self.conn is not None:
return self.conn
if not host:
... | gpl-3.0 |
gnowgi/gnowsys-studio | objectapp/spam_checker/backends/all_is_spam.py | 3 | 2624 | # Copyright (c) 2011, 2012 Free Software Foundation
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later vers... | agpl-3.0 |
louietsai/python-for-android | python3-alpha/python3-src/Lib/test/test_docxmlrpc.py | 54 | 7827 | from xmlrpc.server import DocXMLRPCServer
import http.client
import sys
from test import support
threading = support.import_module('threading')
import time
import socket
import unittest
PORT = None
def make_request_and_skipIf(condition, reason):
# If we skip the test, we have to make a request because the
# t... | apache-2.0 |
vabue/RatticWeb | cred/migrations/0009_auto__del_field_cred_category.py | 7 | 5872 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Cred.category'
db.delete_column('cred_cred', 'category_id')
def backwards(self, orm)... | gpl-2.0 |
waprin/google-cloud-python | gcloud/streaming/test_util.py | 8 | 1660 | import unittest2
class Test_calculate_wait_for_retry(unittest2.TestCase):
def _callFUT(self, *args, **kw):
from gcloud.streaming.util import calculate_wait_for_retry
return calculate_wait_for_retry(*args, **kw)
def test_w_negative_jitter_lt_max_wait(self):
import random
from ... | apache-2.0 |
SGCreations/Flask | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/setuptools/tests/test_easy_install.py | 73 | 13214 | """Easy install Tests
"""
import sys
import os
import shutil
import tempfile
import unittest
import site
import contextlib
import textwrap
import tarfile
import logging
import distutils.core
from setuptools.compat import StringIO, BytesIO, next, urlparse
from setuptools.sandbox import run_setup, SandboxViolation
from ... | apache-2.0 |
Scalr/pecha | scalrctl/commands/farm.py | 2 | 6362 | __author__ = 'Dmitriy Korsakov'
__doc__ = 'Farm management'
import json
import copy
from scalrctl import commands
from scalrctl import click
from scalrctl import request, settings
class FarmTerminate(commands.SimplifiedAction):
epilog = "Example: scalr-ctl farms terminate --farmId <ID> --force"
post_temp... | apache-2.0 |
romeubertho/USP-IntroPython | django/learning_log/learning_log/learning_log/settings.py | 1 | 3158 | """
Django settings for learning_log project.
Generated by 'django-admin startproject' using Django 1.11.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
impo... | mit |
zulip/django | tests/delete_regress/tests.py | 182 | 13415 | from __future__ import unicode_literals
import datetime
from django.conf import settings
from django.db import DEFAULT_DB_ALIAS, models, transaction
from django.db.utils import ConnectionHandler
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from .models import (
Award, AwardNote, Boo... | bsd-3-clause |
ericpre/hyperspy | hyperspy/tests/samfire/test_samfire.py | 2 | 18637 | # -*- coding: utf-8 -*-
# Copyright 2007-2021 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | gpl-3.0 |
spr/album-sound-check | mutagen/ogg.py | 2 | 17715 | # Copyright 2006 Joe Wreschnig <piman@sacredchao.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# $Id: ogg.py 3975 2007-01-13 21:51:17Z piman $
"""Read and write Ogg bitstre... | gpl-2.0 |
elthariel/dff | api/gui/dialog/applymodule.py | 1 | 12581 | # DFF -- An Open Source Digital Forensics Framework
# Copyright (C) 2009-2010 ArxSys
# This program is free software, distributed under the terms of
# the GNU General Public License Version 2. See the LICENSE file
# at the top of the source tree.
#
# See http://www.digital-forensic.org for more information about this... | gpl-2.0 |
jmarsik/mopidy | mopidy/http/handlers.py | 1 | 7595 | from __future__ import absolute_import, unicode_literals
import functools
import logging
import os
import socket
import tornado.escape
import tornado.ioloop
import tornado.web
import tornado.websocket
import mopidy
from mopidy import core, models
from mopidy.internal import encoding, jsonrpc
logger = logging.getLo... | apache-2.0 |
tannoa2/RackHD | test/tests/rackhd20/test_rackhd20_api_tags.py | 13 | 2375 | '''
Copyright 2016, EMC, Inc.
Author(s):
George Paulos
'''
import fit_path # NOQA: unused import
import os
import sys
import subprocess
import fit_common
# Local methods
MON_NODES = fit_common.node_select()
# Select test group here using @attr
from nose.plugins.attrib import attr
@attr(all=True, regression=True, ... | apache-2.0 |
EdLogan18/logan-repository | plugin.video.igorlista/mechanize/_html.py | 132 | 20888 | """HTML handling.
Copyright 2003-2006 John J. Lee <jjl@pobox.com>
This code is free software; you can redistribute it and/or modify it under
the terms of the BSD or ZPL 2.1 licenses (see the file COPYING.txt
included with the distribution).
"""
import codecs
import copy
import htmlentitydefs
import re
import _sgml... | gpl-2.0 |
PoornimaNayak/autotest-client-tests | linux-tools/perl_IO_Socket_SSL/perl_IO_Socket_SSL.py | 4 | 1280 | #!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class perl_IO_Socket_SSL(test.test):
"""
Autotest module for testing basic functionality
of perl_IO_Socket_SSL
@author Athira Rajeev <atrajeev@in.ibm.com> ... | gpl-2.0 |
HackerTool/vivisect | vstruct/defs/windows/win_5_1_i386/ntoskrnl.py | 7 | 243293 | # Version: 5.1
# Architecture: i386
import vstruct
from vstruct.primitives import *
POLICY_AUDIT_EVENT_TYPE = v_enum()
POLICY_AUDIT_EVENT_TYPE.AuditCategorySystem = 0
POLICY_AUDIT_EVENT_TYPE.AuditCategoryLogon = 1
POLICY_AUDIT_EVENT_TYPE.AuditCategoryObjectAccess = 2
POLICY_AUDIT_EVENT_TYPE.AuditCategoryPrivilegeUse =... | apache-2.0 |
lukeiwanski/tensorflow-opencl | tensorflow/contrib/session_bundle/example/export_half_plus_two.py | 44 | 6027 | # Copyright 2016 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 |
sephii/django-cms | cms/cms_plugins.py | 46 | 4350 | # -*- coding: utf-8 -*-
from cms.models import CMSPlugin, Placeholder
from cms.models.aliaspluginmodel import AliasPluginModel
from cms.models.placeholderpluginmodel import PlaceholderReference
from cms.plugin_base import CMSPluginBase, PluginMenuItem
from cms.plugin_pool import plugin_pool
from cms.plugin_rendering im... | bsd-3-clause |
ayumilong/rethinkdb | external/v8_3.30.33.16/build/gyp/test/intermediate_dir/gyptest-intermediate-dir.py | 243 | 1398 | #!/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 that targets have independent INTERMEDIATE_DIRs.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('test.gyp', chdir=... | agpl-3.0 |
sbesson/openmicroscopy | components/tools/OmeroWeb/test/integration/test_history.py | 3 | 3141 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 University of Dundee & Open Microscopy Environment.
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Founda... | gpl-2.0 |
michhar/flask-webapp-aml | env1/Lib/site-packages/pip/_vendor/cachecontrol/serialize.py | 152 | 6305 | import base64
import io
import json
import zlib
from pip._vendor.requests.structures import CaseInsensitiveDict
from .compat import HTTPResponse, pickle, text_type
def _b64_encode_bytes(b):
return base64.b64encode(b).decode("ascii")
def _b64_encode_str(s):
return _b64_encode_bytes(s.encode("utf8"))
def ... | mit |
JosmanPS/scikit-learn | examples/cluster/plot_dict_face_patches.py | 337 | 2747 | """
Online learning of a dictionary of parts of faces
==================================================
This example uses a large dataset of faces to learn a set of 20 x 20
images patches that constitute faces.
From the programming standpoint, it is interesting because it shows how
to use the online API of the sciki... | bsd-3-clause |
Lautitia/newfies-dialer | newfies/dialer_campaign/migrations/0003_auto__add_field_campaign_agent_script__add_field_campaign_lead_disposi.py | 9 | 17201 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Campaign.agent_script'
db.add_column(u'dialer_campaign', 'agent_script',
... | mpl-2.0 |
sergiomb2/gdesklets | display/TargetBonoboControl.py | 2 | 1349 | from DisplayTarget import DisplayTarget
from utils.datatypes import *
import gtk
#
# Class for a target that embeds Bonobo controls.
#
class TargetBonoboControl(DisplayTarget):
def __init__(self, name, parent):
# the control; you can load a control only once
self.__control = None
self.... | gpl-2.0 |
alrusdi/lettuce | tests/integration/lib/Django-1.3/django/contrib/gis/gdal/tests/test_envelope.py | 332 | 3742 | from django.contrib.gis.gdal import Envelope, OGRException
from django.utils import unittest
class TestPoint(object):
def __init__(self, x, y):
self.x = x
self.y = y
class EnvelopeTest(unittest.TestCase):
def setUp(self):
self.e = Envelope(0, 0, 5, 5)
def test01_init(self):
... | gpl-3.0 |
GrandmasterK/XScheduler | venv/lib/python2.7/site-packages/rsa/pkcs1.py | 75 | 13170 | # -*- 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... | mit |
higgintop/hca_code_project | node_modules/grunt-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/win_tool.py | 379 | 11640 | #!/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 |
joariasl/odoo | addons/account_check_writing/report/check_print.py | 320 | 2943 | # -*- 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 |
anantb/confer | server/settings.py | 1 | 5344 | # Django settings for confer project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'confer', # Or path to database fil... | mit |
nmercier/linux-cross-gcc | linux/lib/python2.7/encodings/cp855.py | 593 | 34106 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP855.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... | bsd-3-clause |
J861449197/edx-platform | common/test/acceptance/pages/studio/pagination.py | 165 | 2099 | """
Mixin to include for Paginated container pages
"""
from selenium.webdriver.common.keys import Keys
class PaginatedMixin(object):
"""
Mixin class used for paginated page tests.
"""
def nav_disabled(self, position, arrows=('next', 'previous')):
"""
Verifies that pagination nav is dis... | agpl-3.0 |
SergeyPirogov/selene | selene/conditions.py | 1 | 9603 | from abc import ABCMeta, abstractmethod
import operator
from future.utils import with_metaclass, lmap
from selene.abctypes.conditions import IEntityCondition
from selene.abctypes.webdriver import IWebDriver
from selene.abctypes.webelement import IWebElement
from selene.exceptions import ConditionMismatchException
c... | mit |
unindented/streamcode | client/static/jsrepl/extern/python/unclosured/lib/python2.7/mutex.py | 243 | 1877 | """Mutual exclusion -- for use with module sched
A mutex has two pieces of state -- a 'locked' bit and a queue.
When the mutex is not locked, the queue is empty.
Otherwise, the queue contains 0 or more (function, argument) pairs
representing functions (or methods) waiting to acquire the lock.
When the mutex is unlocke... | mit |
anaruse/chainer | tests/chainer_tests/functions_tests/math_tests/test_sparse_matmul.py | 2 | 10645 | import unittest
import numpy
import chainer
from chainer import cuda
import chainer.functions as F
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer import utils
from chainer.utils import type_check
_scipy_available = True
try:
from scipy import sparse ... | mit |
apark263/tensorflow | tensorflow/contrib/optimizer_v2/checkpointable_utils_test.py | 2 | 33567 | # 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 |
reingart/pyafipws | wslpg.py | 1 | 216526 | #!/usr/bin/python
# -*- coding: utf8 -*-
# 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, or (at your option) any later
# version.
#
# This program is distributed in the hope th... | gpl-3.0 |
sadaf2605/django | django/contrib/messages/api.py | 71 | 3105 | from django.contrib.messages import constants
from django.contrib.messages.storage import default_storage
from django.http import HttpRequest
__all__ = (
'add_message', 'get_messages',
'get_level', 'set_level',
'debug', 'info', 'success', 'warning', 'error',
'MessageFailure',
)
class MessageFailure(E... | bsd-3-clause |
smorante/continuous-goal-directed-actions | demonstration-feature-selection/src/alternatives/main_dtw_mds_norm.py | 2 | 3731 | # -*- coding: utf-8 -*-
"""
Author: Santiago Morante
Robotics Lab. Universidad Carlos III de Madrid
"""
########################## DTW ####################################
import libmddtw
import matplotlib.pyplot as plt
from dtw import dtw
########################## MDS ####################################
impo... | mit |
brunosantos/Bsan-kodi-repo | plugin.video.kodi/dns/rdtypes/ANY/RRSIG.py | 15 | 5774 | # Copyright (C) 2004-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | gpl-2.0 |
stargaser/astropy | astropy/coordinates/tests/accuracy/test_altaz_icrs.py | 4 | 8535 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Accuracy tests for AltAz to ICRS coordinate transformations.
We use "known good" examples computed with other coordinate libraries.
Note that we use very low precision asserts because some people run tests on 32-bit
machines and we want the tests to p... | bsd-3-clause |
jfarrell/thrift | test/py/SerializationTest.py | 21 | 17161 | #!/usr/bin/env python
#
# 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
# "L... | apache-2.0 |
jonls/lpd-monitor | btcon.py | 1 | 16600 |
import socket
import struct
import random
import hashlib
import errno
from gi.repository import GLib
from gi.repository import GObject
from bencode import bencode, bdecode, bdecode_all
class Bitfield(object):
def __init__(self, size, data=None):
if size < 0:
raise ValueError('Bitfield size ... | mit |
brandond/ansible | lib/ansible/modules/windows/win_uri.py | 13 | 6899 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Corwin Brown <corwin@corwinbrown.com>
# Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
akozumpl/yum | docs/sphinxdocs/rstgenerator.py | 2 | 7752 | #! /usr/bin/python
import sys, re, os
def generateFile(input_directory, file_name, output_directory,
package_heirarchy=None, module_name=None):
"""Generate a rst file telling sphinx to just generate documentation
for the public interface automatically. Output will be written to
*file_nam... | gpl-2.0 |
cholokei/android_kernel_samsung_milletwifikx | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
Livefyre/mongo-connector | mongo_connector/doc_managers/solr_doc_manager.py | 7 | 11191 | # Copyright 2013-2014 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 |
culots/kernel_lge_madai | 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 |
ehirt/odoo | addons/email_template/__init__.py | 381 | 1144 | # -*- 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 |
mrtnrdl/.macdots | scripts/bin/platform-tools/systrace/catapult/dependency_manager/dependency_manager/cloud_storage_info_unittest.py | 4 | 10473 | # Copyright 2015 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 os
import stat
import unittest
import mock
from pyfakefs import fake_filesystem_unittest
from py_utils import cloud_storage
from dependency_manager ... | unlicense |
truongdq/chainer | tests/cupy_tests/test_ndarray_get.py | 5 | 1384 | import unittest
import cupy
from cupy import cuda
from cupy import testing
import numpy
from numpy import testing as np_testing
@testing.gpu
class TestArrayGet(unittest.TestCase):
_multiprocess_can_split_ = True
def setUp(self):
self.stream = cuda.Stream()
def check_get(self, f, stream):
... | mit |
muntasirsyed/intellij-community | python/lib/Lib/distutils/command/install.py | 92 | 23567 | """distutils.command.install
Implements the Distutils 'install' command."""
from distutils import log
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: install.py 43363 2006-03-27 21:55:21Z phillip.eby $"
import sys, os, string
from types import *
from distutils.core import Command
from... | apache-2.0 |
BehavioralInsightsTeam/edx-platform | lms/djangoapps/static_template_view/urls.py | 15 | 2320 | """
URLs for static_template_view app
"""
from django.conf import settings
from django.conf.urls import url
from static_template_view import views
urlpatterns = [
# Semi-static views (these need to be rendered and have the login bar, but don't change)
url(r'^404$', views.render, {'template': '404.html'}, nam... | agpl-3.0 |
KshitijKarthick/tvecs | tvecs/visualization/server.py | 1 | 12380 | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""CherryPy Server to provide recommendations of semantic similarity."""
import os
import json
import codecs
import cherrypy
import argparse
import configparser
from gensim.models import Word2Vec
from nltk.tokenize import word_tokenize
from jinja2 import Environment, Fi... | mit |
rdipietro/tensorflow | tensorflow/python/summary/event_accumulator_test.py | 3 | 30392 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
bonitadecker77/python-for-android | python3-alpha/extra_modules/gdata/notebook/data.py | 125 | 1426 | #!/usr/bin/python
#
# Copyright (C) 2009 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 ... | apache-2.0 |
albertz/music-player | mac/pyobjc-framework-Cocoa/PyObjCTest/test_nsimage.py | 3 | 9049 | from PyObjCTools.TestSupport import *
import AppKit
from AppKit import *
try:
unicode
except NameError:
unicode = str
class TestNSImageHelper (NSObject):
def image_didLoadRepresentation_withStatus_(self, i, r, s): pass
def image_didLoadPartOfRepresentation_withValidRows_(self, i, r, c): pass
class Te... | bsd-2-clause |
xuyuhan/depot_tools | third_party/logilab/common/sphinx_ext.py | 117 | 3329 | # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... | bsd-3-clause |
mer-hybris/android_kernel_lge_hammerhead | scripts/gcc-wrapper.py | 1276 | 3382 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. 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 th... | gpl-2.0 |
hazelcast/hazelcast-python-client | tests/unit/discovery/hazelcast_cloud_discovery_test.py | 1 | 5900 | import ssl
import os
import threading
from hazelcast.six.moves import BaseHTTPServer
from hazelcast import six
from unittest import TestCase
from hazelcast.core import Address
from hazelcast.errors import HazelcastCertificationError
from hazelcast.discovery import HazelcastCloudDiscovery
from hazelcast.client import H... | apache-2.0 |
renzoolivares/android_kernel_htc_monarudo | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
40223234/40223234 | static/Brython3.1.1-20150328-091302/Lib/posixpath.py | 722 | 14212 | """Common operations on Posix pathnames.
Instead of importing this module directly, import os and refer to
this module as os.path. The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Mac, Windows),
os.path provides the same operations in a manner specific to that
platform, and is a... | gpl-3.0 |
tensorflow/tensorflow | tensorflow/python/keras/initializers/initializers_v1.py | 6 | 4404 | # Copyright 2020 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 |
mic4ael/indico | indico/core/db/sqlalchemy/searchable_titles.py | 1 | 1794 | # This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from sqlalchemy.ext.declarative import declared_attr
from indico... | mit |
kubeflow/kfserving | python/kfserving/test/test_v1alpha2_tensorflow_spec.py | 1 | 1476 | # Copyright 2020 kubeflow.org.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | apache-2.0 |
wavycloud/pyboto3 | pyboto3/glue.py | 1 | 692979 | '''
The MIT License (MIT)
Copyright (c) 2016 WavyCloud
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, p... | mit |
AlbertoPeon/invenio | modules/webaccess/lib/external_authentication_cern_unit_tests.py | 5 | 2815 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2010, 2011, 2013 CERN.
##
## Invenio 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
## Licens... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.