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 |
|---|---|---|---|---|---|
FescueFungiShare/hydroshare | hs_core/views/discovery_json_view.py | 1 | 3195 | import json
from django.http import HttpResponse
from haystack.generic_views import FacetedSearchView
from hs_core.discovery_form import DiscoveryForm
# View class for generating JSON data format from Haystack
# returned JSON objects array is used for building the map view
class DiscoveryJsonView(FacetedSearchView):
... | bsd-3-clause |
keisuke-umezawa/chainer | chainer/links/caffe/protobuf3/caffe_pb2.py | 21 | 242354 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: caffe.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _mes... | mit |
dushu1203/chromium.src | chrome/common/extensions/docs/server2/jsc_view_test.py | 22 | 15249 | #!/usr/bin/env python
# Copyright 2014 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 json
import os
import unittest
from jsc_view import GetEventByNameFromEvents
from api_schema_graph import APISchemaGraph
from a... | bsd-3-clause |
google/lkml-gerrit-bridge | src/message.py | 1 | 2859 | # Copyright 2019 Google LLC
#
# 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 |
hgl888/chromium-crosswalk | chrome/common/extensions/docs/server2/app_yaml_helper_test.py | 53 | 6154 | #!/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
from app_yaml_helper import AppYamlHelper
from extensions_paths import SERVER2
from host_file_system_provider import H... | bsd-3-clause |
tchernomax/ansible | lib/ansible/modules/cloud/openstack/os_group.py | 34 | 4758 | #!/usr/bin/python
# Copyright (c) 2016 IBM
# 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',
'status': ['preview'],
... | gpl-3.0 |
MattsFleaMarket/python-for-android | python3-alpha/python3-src/Lib/lib2to3/fixes/fix_map.py | 170 | 3058 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that changes map(F, ...) into list(map(F, ...)) unless there
exists a 'from future_builtins import map' statement in the top-level
namespace.
As a special case, map(None, X) is changed into list(X). (This is
... | apache-2.0 |
skoczen/correlationbot | tests/test_post.py | 1 | 1928 | from bot_tests import BotTests
class ValidPostTests(BotTests):
def test_two_column_works(self):
resp = self.app.post_json('/', {
"data": [
[1,2,3,4,6,7,8,9],
[2,4,6,8,10,12,13,15],
]
})
self.assertEqual(resp.status_int, 200)
... | mit |
HelllGuest/sprout_kernel | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
liberation/django-elasticsearch | test_project/test_app/models.py | 6 | 4045 | from datetime import datetime
from django.db import models
from django.contrib.auth.models import User
from django_elasticsearch.models import EsIndexable
from django_elasticsearch.serializers import EsJsonSerializer
class TestSerializer(EsJsonSerializer):
# Note: i want this field to be null instead of u''
... | mit |
hale36/SRTV | lib/sqlalchemy/testing/plugin/plugin_base.py | 76 | 14817 | # plugin/plugin_base.py
# Copyright (C) 2005-2014 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
"""Testing extensions.
this module is designed to work as a testing-framework-a... | gpl-3.0 |
alistairlow/tensorflow | tensorflow/examples/tutorials/mnist/input_data.py | 165 | 1107 | # 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 |
jonatanblue/flask | scripts/flaskext_compat.py | 153 | 5038 | # -*- coding: utf-8 -*-
"""
flaskext_compat
~~~~~~~~~~~~~~~
Implements the ``flask.ext`` virtual package for versions of Flask
older than 0.7. This module is a noop if Flask 0.8 was detected.
Usage::
import flaskext_compat
flaskext_compat.activate()
from flask.ext import ... | bsd-3-clause |
SirAnthony/marvin-xmpp | plugins/urlhead.py | 1 | 1360 | # -*- coding: utf-8 -*-
import lxml.html
import re
from functions import goUrl
class UrlHead:
_marvinModule = True
public = ['urlhead']
def urlhead():
None
def _urlhead(self,message):
if 'http://' or 'https://' in message.text:
try:
foo = re.findall(r'... | mit |
kalaspuff/tomodachi | tomodachi/discovery/dummy_registry.py | 1 | 1160 | import logging
from typing import Any, Dict
# An example discovery class which would could be extended to register which
# the started service' HTTP endpoints are.
class DummyRegistry(object):
http_endpoints: Dict = {}
@classmethod
async def add_http_endpoint(cls, service: Any, host: str, port: int, meth... | mit |
davidwtbuxton/search | search/tests/test_ql.py | 3 | 3162 | import datetime
import unittest
from search.ql import Query, Q, GeoQueryArguments
from search.fields import TextField, GeoField, DateField
from search.indexes import DocumentModel
class FakeDocument(DocumentModel):
foo = TextField()
bar = DateField()
class FakeGeoDocument(DocumentModel):
my_loc = GeoFi... | mit |
mdrio/pydoop | test/backward_compatibility/test_task_context.py | 3 | 1995 | # BEGIN_COPYRIGHT
#
# Copyright 2009-2015 CRS4.
#
# 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 ... | apache-2.0 |
joshblum/django-with-audit | django/contrib/gis/geos/point.py | 403 | 4253 | from ctypes import c_uint
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos import prototypes as capi
class Point(GEOSGeometry):
_minlength = 2
_maxlength = 3
def __init__(self, x, y=None, z=None, srid=None):
... | bsd-3-clause |
mmetak/streamlink | docs/ext_argparse.py | 1 | 4619 | """Convert a argparse parser to option directives.
Inspired by sphinxcontrib.autoprogram but with a few differences:
- Instead of relying on private argparse structures uses hooking
to extract information from a argparse parser.
- Contains some simple pre-processing on the help messages to make
the Sphinx versio... | bsd-2-clause |
deepakantony/sms-tools | software/transformations_interface/harmonicTransformations_function.py | 20 | 5398 | block=False# function call to the transformation functions of relevance for the hpsModel
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import get_window
import sys, os
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../models/'))
sys.path.append(os.path.join(os.path.di... | agpl-3.0 |
CoolProp/CoolProp | dev/Tickets/524.py | 2 | 1561 | import CoolProp
from CoolProp.CoolProp import PropsSI
from CoolProp.CoolProp import set_reference_state
print("CoolProp version %s" % CoolProp.__version__)
print("CoolProp revision %s" % CoolProp.__gitrevision__)
REF = 'R134a'
T0 = 273.15
RefState = 'IIR'
set_reference_state(REF, RefState)
print(REF, RefState)
print... | mit |
sbalde/edx-platform | lms/envs/aws_migrate.py | 288 | 1256 | """
A Django settings file for use on AWS while running
database migrations, since we don't want to normally run the
LMS with enough privileges to modify the database schema.
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=... | agpl-3.0 |
automatthias/aubio | waflib/Tools/flex.py | 314 | 1057 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import waflib.TaskGen,os,re
def decide_ext(self,node):
if'cxx'in self.features:
return['.lex.cc']
return['.lex.c']
def flexfun(tsk):
env=tsk.env
bld=tsk.generator.bld
w... | gpl-3.0 |
wkeyword/pip | tests/functional/test_uninstall.py | 17 | 13733 | from __future__ import with_statement
import textwrap
import os
import sys
import pytest
from os.path import join, normpath
from tempfile import mkdtemp
from mock import patch
from tests.lib import assert_all_changes, pyversion
from tests.lib.local_repos import local_repo, local_checkout
from pip.utils import rmtree
... | mit |
hlange/LogSoCR | .waf/waflib/Tools/xlcxx.py | 1 | 1468 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2016 (ita)
# Ralf Habacker, 2006 (rh)
# Yinon Ehrlich, 2009
# Michael Kuhn, 2009
from waflib.Tools import ccroot, ar
from waflib.Configure import conf
@conf
def find_xlcxx(conf):
"""
Detects the Aix C++ compiler
"""
cxx = conf.find_program(['xlc++_r', 'x... | agpl-3.0 |
mysteryjeans/doorsale-demo | doorstep/accounts/models.py | 2 | 5736 | from __future__ import unicode_literals
from datetime import timedelta
from django.db import models
from django.contrib.auth import get_user_model
from django.utils import timezone
from django.core.exceptions import ValidationError
from django.contrib.auth.models import AbstractUser as _AbstractUser, UserManager as _... | gpl-2.0 |
Protocol-X/plugin.video.funimationnow | resources/lib/modules/trakt.py | 1 | 8240 | # -*- coding: utf-8 -*-
'''
Funimation|Now Add-on
Copyright (C) 2016 Funimation|Now
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 yo... | gpl-3.0 |
ivano666/tensorflow | tensorflow/contrib/util/__init__.py | 5 | 1447 | # Copyright 2015 Google 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 applicable law or a... | apache-2.0 |
chauhanmohit/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/w3c/test_importer.py | 115 | 20224 | #!/usr/bin/env python
# Copyright (C) 2013 Adobe Systems Incorporated. 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 n... | bsd-3-clause |
dondieselkopf/amgcl | examples/make_poisson.py | 1 | 2435 | #!/usr/bin/python
import numpy as np
from scipy.sparse import csr_matrix
def numba_jit_if_available():
try:
from numba import jit
return jit
except ImportError:
return lambda f: f
#----------------------------------------------------------------------------
# Assemble matrix for Poiss... | mit |
KokareIITP/django | tests/auth_tests/test_basic.py | 328 | 4643 | from __future__ import unicode_literals
from django.apps import apps
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser, User
from django.contrib.auth.tests.custom_user import CustomUser
from django.core.exceptions import ImproperlyConfigured
from django.dispatch import... | bsd-3-clause |
weblabdeusto/weblabdeusto | server/launch/sample_balanced2_concurrent_experiments/main_machine/lab_and_experiment/experiment19/server_config.py | 968 | 1526 | #!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
weblab_xilinx_experiment_xilinx_device = 'FPGA'
weblab_xilinx_experiment_port_number = 1
# This should be something like this:
# import os as _os
# xilinx_home = _os.getenv('XILINX_HOME')
# if xilinx_home == None:
# if _os.name == 'nt':
# xilinx_home = r'C:... | bsd-2-clause |
wasn-lab/visual-positioning | cpp/scons/scons-local-2.0.0.final.0/SCons/SConf.py | 34 | 39052 | """SCons.SConf
Autoconf-like configuration support.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal i... | apache-2.0 |
aaron-goshine/electron | script/upload-windows-pdb.py | 156 | 1174 | #!/usr/bin/env python
import os
import glob
import sys
from lib.config import s3_config
from lib.util import atom_gyp, execute, rm_rf, safe_mkdir, s3put
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
SYMBOLS_DIR = 'dist\\symbols'
DOWNLOAD_DIR = 'vendor\\brightray\\vendor\\download\\libchr... | mit |
joelddiaz/openshift-tools | ansible/roles/lib_openshift_3.2/build/src/oadm_manage_node.py | 9 | 6045 | # pylint: skip-file
class ManageNodeException(Exception):
''' manage-node exception class '''
pass
class ManageNodeConfig(OpenShiftCLIConfig):
''' ManageNodeConfig is a DTO for the manage-node command.'''
def __init__(self, kubeconfig, node_options):
super(ManageNodeConfig, self).__init__(None... | apache-2.0 |
ibmsoe/tensorflow | tensorflow/contrib/input_pipeline/python/ops/input_pipeline_ops.py | 49 | 4117 | # 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 |
bayolau/seqan | apps/ngs_roi/tool_shed/rois.py | 18 | 1820 | #!/usr/bin/env python
class RoiRecord(object):
"""Represent one record in a ROI file."""
def __init__(self, ref, start_pos, end_pos, region_name, region_length,
strand, max_count, data, points):
"""Initialize RoiRecord."""
self.ref = ref
self.start_pos = start_pos
... | bsd-3-clause |
TaskEvolution/Task-Coach-Evolution | taskcoach/taskcoachlib/i18n/po2dict.py | 1 | 2930 | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
"""Generate python dictionaries catalog from textual translation description.
This program converts a textual Uniforum-style message catalog (.po file) into
a python dictionary
Based on msgfmt.py by Martin v. Löwis <loewis@informatik.hu-berlin.de>
"""
import sys... | gpl-3.0 |
SamplesAndDemos/division42pos1 | src/division42pos/division42pos/main/models.py | 1 | 1269 | import uuid
from django.db import models
from django.contrib.auth.models import User
STATE_CODE_CHOICES = (
('AL','Alabama'),
('AK','Alaska'),
('CO','Colorado'),
('CT','Connecticut'),
('DE','Delaware'),
('FL','Florida'),
('GA','Georgia'),
('LA','Lousiana'),
('MA','Massachusetts'),
('ME','Maine'),
('MI','Mic... | mit |
dcrosta/ansible | lib/ansible/playbook/block.py | 30 | 13215 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
aimas/TuniErp-8.0 | addons/account/account_cash_statement.py | 283 | 15868 | # encoding: utf-8
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 PC Solutions (<http://pcsol.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# i... | agpl-3.0 |
zhaochl/python-utils | verify_code/Imaging-1.1.7/build/lib.linux-x86_64-2.7/ImtImagePlugin.py | 40 | 2203 | #
# The Python Imaging Library.
# $Id$
#
# IM Tools support for PIL
#
# history:
# 1996-05-27 fl Created (read 8-bit images only)
# 2001-02-17 fl Use 're' instead of 'regex' (Python 2.1) (0.2)
#
# Copyright (c) Secret Labs AB 1997-2001.
# Copyright (c) Fredrik Lundh 1996-2001.
#
# See the README file for informatio... | apache-2.0 |
darkryder/django | tests/admin_views/models.py | 4 | 25377 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import os
import tempfile
import uuid
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from d... | bsd-3-clause |
Versent/ansible-modules-core | cloud/amazon/ec2_eip.py | 1 | 9973 | #!/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 distributed... | gpl-3.0 |
nitzmahone/ansible | test/units/modules/network/f5/test_bigip_smtp.py | 21 | 5016 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
Pintor95/django-jukebox | includes/json.py | 3 | 1337 | """
This file contains everything needed to send and receive JSON requests.
"""
from django.utils.functional import Promise
from django.utils import simplejson
class JSMessage(object):
"""
The JSMessages class is used to pass JSON messages to client JavaScripts.
Use this as a vessel for JSON stuff instead ... | gpl-3.0 |
mistercrunch/airflow | airflow/providers/amazon/aws/operators/glacier.py | 6 | 1894 | #
# 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 |
scholer/cadnano2.5 | cadnano/extras/__init__.py | 2 | 1253 | # The MIT License
#
# Copyright (c) 2011 Wyss Institute at Harvard University
#
# 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
# ... | mit |
sumedhasingla/VTK | Filters/Hybrid/Testing/Python/TestGreedyTerrainDecimation.py | 20 | 1948 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
lut = vtk.vtkLookupTable()
lut.SetHueRange(0.6, 0)
lut.SetSaturationRange(1.0, 0)
lut.SetValueRange(0.5, 1.0)
# Read the data: a height field results
demReader = vtk.vtkDEMReader()
d... | bsd-3-clause |
serensoner/CouchPotatoServer | libs/gntp/cli.py | 122 | 4143 | # Copyright: 2013 Paul Traylor
# These sources are released under the terms of the MIT license: see LICENSE
import logging
import os
import sys
from optparse import OptionParser, OptionGroup
from gntp.notifier import GrowlNotifier
from gntp.shim import RawConfigParser
from gntp.version import __version__
DEFAULT_CON... | gpl-3.0 |
benfinke/ns_python | build/lib/nssrc/com/citrix/netscaler/nitro/resource/config/cs/csvserver_filterpolicy_binding.py | 3 | 14851 | #
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 |
jhgoebbert/cvl-fabric-launcher | pyinstaller-2.1/tests/basic/test_module__file__attribute.py | 14 | 1175 | #-----------------------------------------------------------------------------
# Copyright (c) 2013, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this softwa... | gpl-3.0 |
Sumith1896/sympy | sympy/combinatorics/tensor_can.py | 4 | 40951 | from __future__ import print_function, division
from sympy.core.compatibility import range
from sympy.combinatorics.permutations import Permutation, _af_rmul, \
_af_invert, _af_new
from sympy.combinatorics.perm_groups import PermutationGroup, _orbit, \
_orbit_transversal
from sympy.combinatorics.util import _d... | bsd-3-clause |
danny200309/anaconda | anaconda_lib/linting/anaconda_mccabe.py | 9 | 1577 | # -*- coding: utf8 -*-
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
"""
Anaconda McCabe
"""
import ast
from .mccabe import McCabeChecker
class AnacondaMcCabe(object):
"""Wrapper object around McCabe python script
"""
ch... | gpl-3.0 |
linjk/mysql-5.6 | xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/bug606981_test.py | 19 | 5429 | #! /usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; -*-
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
#
# Copyright (C) 2011 Patrick Crews
#
#
# 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-2.0 |
sfam/home-assistant | homeassistant/components/device_tracker/demo.py | 9 | 1257 | """
homeassistant.components.device_tracker.demo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demo platform for the device tracker.
device_tracker:
platform: demo
"""
import random
from homeassistant.components.device_tracker import DOMAIN
def setup_scanner(hass, config, see):
""" Set up a demo tracker. """
... | mit |
OpenSTC-Eleger/stc-achats | account.py | 1 | 6485 | # -*- coding: utf-8 -*-
##############################################################################
# Copyright (C) 2012 SICLIC http://siclic.fr
#
# 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 Fr... | agpl-3.0 |
pinax/pinax-announcements | setup.py | 2 | 3593 | from setuptools import find_packages, setup
VERSION = "4.0.0"
LONG_DESCRIPTION = """
.. image:: http://pinaxproject.com/pinax-design/patches/pinax-announcements.svg
:target: https://pypi.python.org/pypi/pinax-announcements/
===================
Pinax Announcements
===================
.. image:: https://img.shield... | mit |
danmergens/mi-instrument | mi/core/driver_scheduler.py | 5 | 15720 | #!/usr/bin/env python
"""
@package mi.core.driver_scheduler Event Scheduler used in drivers
@file mi/core/driver_scheduler.py
@author Bill French
@brief Provides task/event scheduling for drivers
uses the PolledScheduler and provides a common, simplified interface
for instrument and platform drivers.
The scheduler is... | bsd-2-clause |
blaze33/django | django/conf/locale/ko/formats.py | 107 | 2105 | # -*- 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 = 'Y년 n월 j일'
TIME_FORMAT = 'A g:i:s'... | bsd-3-clause |
Jacobichou/electron | script/cpplint.py | 153 | 1850 | #!/usr/bin/env python
import fnmatch
import os
import sys
from lib.util import execute
IGNORE_FILES = [
os.path.join('atom', 'app', 'atom_main.cc'),
os.path.join('atom', 'browser', 'mac', 'atom_application.h'),
os.path.join('atom', 'browser', 'mac', 'atom_application_delegate.h'),
os.path.join('atom', 'brows... | mit |
yati-sagade/RyDyrect | django/contrib/auth/tests/forms.py | 97 | 9436 | from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm, PasswordChangeForm, SetPasswordForm, UserChangeForm, PasswordResetForm
from django.db import connection
from django.test import TestCase
from django.utils import unittest
class UserCreationFormTest... | bsd-3-clause |
sbellem/django-rest-framework | rest_framework/utils/humanize_datetime.py | 144 | 1285 | """
Helper functions that convert strftime formats into more readable representations.
"""
from rest_framework import ISO_8601
def datetime_formats(formats):
format = ', '.join(formats).replace(
ISO_8601,
'YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM|-HH:MM|Z]'
)
return humanize_strptime(format)
... | bsd-2-clause |
bohlian/erpnext | erpnext/controllers/status_updater.py | 22 | 14617 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, comma_or, nowdate, getdate
from frappe import _
from frappe.model.document import Document
def validate_sta... | gpl-3.0 |
LukeC92/iris | lib/iris/tests/integration/plot/test_netcdftime.py | 3 | 2243 | # (C) British Crown Copyright 2016 - 2017, Met Office
#
# This file is part of Iris.
#
# Iris 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 3 of the License, or
# (at your option) any l... | lgpl-3.0 |
Yannig/ansible | lib/ansible/modules/inventory/add_host.py | 16 | 2112 | # -*- mode: python -*-
#
# Copyright: Ansible Team
# 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',
'status': ['stablein... | gpl-3.0 |
hefen1/chromium | chrome/test/data/nacl/gdb_rsp.py | 99 | 2431 | # Copyright (c) 2012 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.
# This file is based on gdb_rsp.py file from NaCl repository.
import re
import socket
import time
def RspChecksum(data):
checksum = 0
for char in ... | bsd-3-clause |
Akasurde/bodhi | bodhi/services/overrides.py | 1 | 8799 | # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# bu... | gpl-2.0 |
MattRijk/django-ecomsite | lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/utf8prober.py | 2919 | 2652 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | cc0-1.0 |
phdowling/scikit-learn | sklearn/utils/tests/test_linear_assignment.py | 421 | 1349 | # Author: Brian M. Clapper, G Varoquaux
# License: BSD
import numpy as np
# XXX we should be testing the public API here
from sklearn.utils.linear_assignment_ import _hungarian
def test_hungarian():
matrices = [
# Square
([[400, 150, 400],
[400, 450, 600],
[300, 225, 300]],
... | bsd-3-clause |
lekum/ansible-modules-extras | packaging/os/opkg.py | 114 | 5208 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Patrick Pelletier <pp.pelletier@gmail.com>
# Based on pacman (Afterburn) and pkgin (Shaun Zinck) modules
#
# This module 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 Softwa... | gpl-3.0 |
damien-dg/horizon | openstack_dashboard/dashboards/project/stacks/mappings.py | 12 | 15003 | # 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
# distributed under th... | apache-2.0 |
putcn/Paddle | tools/aws_benchmarking/client/cluster_launcher.py | 7 | 12777 | # Copyright (c) 2018 PaddlePaddle 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 app... | apache-2.0 |
siddhartha-chandra/i_cake_python | 20.py | 1 | 1719 | # You want to be able to access the largest element in a stack.
# You've already implemented this Stack class:
class Stack:
# initialize an empty list
def __init__(self):
self.items = []
# push a new item to the last index
def push(self, item):
self.items.append(item)
# remove th... | gpl-3.0 |
kellinm/anaconda | pyanaconda/ui/gui/xkl_wrapper.py | 3 | 15362 | #
# Copyright (C) 2012-2014 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 distributed in the hope that it wi... | gpl-2.0 |
broferek/ansible | lib/ansible/modules/notification/bearychat.py | 52 | 5908 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Jiangge Zhang <tonyseek@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | gpl-3.0 |
uwdata/termite-data-server | web2py/gluon/languages.py | 9 | 35572 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
| Plural subsystem is created by Vladyslav Kozlovskyy (Ukraine) <dbdevelop@gmail.com>
Translation sys... | bsd-3-clause |
dmoliveira/networkx | networkx/algorithms/operators/unary.py | 30 | 1747 | """Unary operations on graphs"""
# Copyright (C) 2004-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
__author__ = """\n""".join(['Aric Hagberg <aric.hagberg@gmail.com>',
... | bsd-3-clause |
norayr/unisubs | apps/videos/migrations/0039_auto__add_field_subtitleversion_is_forked__add_field_subtitlelanguage_.py | 5 | 20292 | # encoding: 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 'SubtitleVersion.is_forked'
db.add_column('videos_subtitleversion', 'is_forked', self.g... | agpl-3.0 |
dischinator/pyload | module/plugins/hooks/SkipRev.py | 4 | 3016 | # -*- coding: utf-8 -*-
import re
from module.PyFile import PyFile
from module.plugins.internal.Addon import Addon
class SkipRev(Addon):
__name__ = "SkipRev"
__type__ = "hook"
__version__ = "0.37"
__status__ = "testing"
__config__ = [("activated", "bool" , "Activated" ... | gpl-3.0 |
fentas/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/cmake.py | 123 | 7236 | # Copyright (C) 2012 Intel 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
stackforge/cloudbase-init | cloudbaseinit/tests/metadata/services/test_nocloudservice.py | 1 | 9767 | # Copyright 2020 Cloudbase Solutions Srl
#
# 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 |
zenmoto/splunk-ref-pas-code | spikes/googledrive_addon/bin/splunklib/searchcommands/decorators.py | 5 | 10708 | # Copyright 2011-2014 Splunk, 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 wri... | apache-2.0 |
cgroll/j_r_docker | launcher/windows/python/Lib/filecmp.py | 110 | 9588 | """Utilities for comparing files and directories.
Classes:
dircmp
Functions:
cmp(f1, f2, shallow=1) -> int
cmpfiles(a, b, common) -> ([], [], [])
"""
import os
import stat
from itertools import ifilter, ifilterfalse, imap, izip
__all__ = ["cmp","dircmp","cmpfiles"]
_cache = {}
BUFSIZE=8*1024
def cmp(... | mit |
kenglishhi/gae-django-sandbox | django/contrib/sessions/backends/base.py | 90 | 9240 | import base64
import os
import random
import sys
import time
from datetime import datetime, timedelta
try:
import cPickle as pickle
except ImportError:
import pickle
from django.conf import settings
from django.core.exceptions import SuspiciousOperation
from django.utils.hashcompat import md5_constructor
# Us... | apache-2.0 |
LeeYiFang/Carkinos | src/probes/views.py | 1 | 122212 | from django.shortcuts import render,render_to_response
from django.http import HttpResponse, Http404,JsonResponse
from django.views.decorators.http import require_GET
from .models import Dataset, CellLine, ProbeID, Sample, Platform, Clinical_Dataset,Clinical_sample,Gene
from django.template import RequestContext
from d... | mit |
chaosk/trinitee | trinitee/wiki/views.py | 1 | 6179 | from datetime import datetime
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404, redirect
from django.contrib import messages
from django.http import Http404, HttpResponseForbidden
from django.template.response import TemplateResponse
from reversion import revision
from reversi... | bsd-3-clause |
elahejalalpour/ELRyu | ryu/services/protocols/bgp/operator/commands/set.py | 51 | 2182 | import logging
from ryu.services.protocols.bgp.operator.command import Command
from ryu.services.protocols.bgp.operator.command import CommandsResponse
from ryu.services.protocols.bgp.operator.command import STATUS_OK
from ryu.services.protocols.bgp.operator.command import STATUS_ERROR
from ryu.services.protocols.bgp.... | apache-2.0 |
yencarnacion/jaikuengine | .google_appengine/lib/cherrypy/cherrypy/tutorial/tut10_http_errors.py | 36 | 2826 | """
Tutorial: HTTP errors
HTTPError is used to return an error response to the client.
CherryPy has lots of options regarding how such errors are
logged, displayed, and formatted.
"""
import os
localDir = os.path.dirname(__file__)
curpath = os.path.normpath(os.path.join(os.getcwd(), localDir))
import cherrypy
cl... | apache-2.0 |
olapaola/olapaola-android-scripting | python/src/Tools/freeze/winmakemakefile.py | 39 | 4824 | import sys, os
# Template used then the program is a GUI program
WINMAINTEMPLATE = """
#include <windows.h>
int WINAPI WinMain(
HINSTANCE hInstance, // handle to current instance
HINSTANCE hPrevInstance, // handle to previous instance
LPSTR lpCmdLine, // pointer to command line
int nCmd... | apache-2.0 |
insomnia-lab/calibre | src/calibre/ebooks/metadata/lrx.py | 10 | 2432 | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'
'''
Read metadata from LRX files
'''
import struct
from zlib import decompress
from lxml import etree
from calibre.ebooks.metadata import MetaInformation, string_to_authors
... | gpl-3.0 |
JohnGriffiths/nipype | nipype/utils/onetime.py | 16 | 2548 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Descriptor support for NIPY.
Utilities to support special Python descriptors [1,2], in particular the use of
a useful pattern for properties we call 'one time properties'. These are
object attributes w... | bsd-3-clause |
carlos-ferras/Sequence-ToolKit | view/dialogs/about/ui_credits.py | 1 | 4861 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/krl1to5/Work/FULL/Sequence-ToolKit/2016/resources/ui/dialogs/about/credits.ui'
#
# Created by: PyQt5 UI code generator 5.5.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui... | gpl-3.0 |
chrislit/abydos | abydos/distance/_rogot_goldberg.py | 1 | 4654 | # Copyright 2018-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos 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 versio... | gpl-3.0 |
ngaranko/bak | bak/projects/management/commands/backup.py | 1 | 1064 | from django.core.management.base import BaseCommand
from django.core.management.base import CommandError
from bak.projects.models import Project
from bak.actions.dump_db import dump_database
from bak.actions.dump_directory import rsync_directory
from bak.actions.exceptions import ActionError
class Command(BaseCommand... | gpl-2.0 |
KiChjang/servo | tests/wpt/web-platform-tests/fetch/api/resources/redirect.py | 7 | 2869 | import time
from six.moves.urllib.parse import urlencode, urlparse
from wptserve.utils import isomorphic_decode, isomorphic_encode
def main(request, response):
stashed_data = {b'count': 0, b'preflight': b"0"}
status = 302
headers = [(b"Content-Type", b"text/plain"),
(b"Cache-Control", b"no... | mpl-2.0 |
sumitsourabh/opencog | opencog/python/pln/rules/context_rules_old.py | 32 | 2706 | from opencog.atomspace import types, TruthValue
import formulas
from pln.rule import Rule
# Todo:
# It may be better to use SubsetLinks instead of ContextLinks, or at
# least implicitly convert them.
# (Context C x).tv = (Subset C x).tv
# (Context C: Subset x y).tv = (Subset (x AND C) (y AND C))
# DeductionRule prod... | agpl-3.0 |
LighthouseUK/koalacore | koalacore/config.py | 1 | 2449 | """
This configuration parser takes a platform argument and uses that for the sections of the config file
i.e. Production, Development, Testing
All you need to do is use the corresponding get methods for the data you need. The platform is automatically used
where applicable.
"""
from __future__ import absolute_import
... | lgpl-3.0 |
arante/pyloc | microblog/flask/lib/python3.5/site-packages/pip/commands/uninstall.py | 798 | 2884 | from __future__ import absolute_import
import pip
from pip.wheel import WheelCache
from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.basecommand import Command
from pip.exceptions import InstallationError
class UninstallCommand(Command):
"""
Uninstall packages.
pip is a... | gpl-3.0 |
isandlaTech/cohorte-demos | led/dump/led-demo-raspberry/cohorte/dist/cohorte-1.0.0-1.0.0-20141201.234602-19-python-distribution/repo/sleekxmpp/features/feature_session/session.py | 12 | 1398 | """
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2011 Nathanael C. Fritz
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
import logging
from sleekxmpp.stanza import Iq, StreamFeatures
from sleekxmpp.xmlstream import register_stanza_plugin
from sleekxmpp.plugins im... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.