repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
Kshitij-Jain/android_kernel_cyanogen_msm8916 | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... | gpl-2.0 |
saeki-masaki/glance | glance/tests/unit/test_cache_middleware.py | 5 | 31757 | # Copyright 2012 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
ericmckean/syzygy | third_party/numpy/files/numpy/linalg/__init__.py | 40 | 2178 | """
Core Linear Algebra Tools
=========================
=============== ==========================================================
Linear algebra basics
==========================================================================
norm Vector or matrix norm
inv Inverse of a square matrix
solve ... | apache-2.0 |
lupyuen/RaspberryPiImage | home/pi/GrovePi/Software/Python/others/temboo/Library/Dropbox/FilesAndMetadata/SearchFilesAndFolders.py | 5 | 5633 | # -*- coding: utf-8 -*-
###############################################################################
#
# SearchFilesAndFolders
# Allows you to search Dropbox for files or folders by a keyword search.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0... | apache-2.0 |
moto-timo/ironpython3 | Src/StdLib/Lib/shlex.py | 14 | 11548 | """A lexical analyzer class for simple shell-like syntaxes."""
# Module and documentation by Eric S. Raymond, 21 Dec 1998
# Input stacking and error message cleanup added by ESR, March 2000
# push_source() and pop_source() made explicit by ESR, January 2001.
# Posix compliance, split(), string arguments, and
# iterato... | apache-2.0 |
krafczyk/spack | var/spack/repos/builtin/packages/man-db/package.py | 5 | 2434 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
rryan/sana.mds | src/mds/core/models/notification.py | 2 | 1311 | """
Notifications for the Sana data engine.
:Authors: Sana dev team
:Version: 2.0
"""
import cjson
from django.db import models
from mds.api.utils import make_uuid
class Notification(models.Model):
""" A message to be sent """
class Meta:
app_label = "core"
uuid = models.SlugField(max_le... | bsd-3-clause |
MaxTyutyunnikov/lino | lino/projects/events/settings.py | 1 | 1850 | # -*- coding: UTF-8 -*-
## Copyright 2013 Luc Saffre
## This file is part of the Lino project.
## Lino 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 o... | gpl-3.0 |
ljhljh235/AutoRest | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/RequiredOptional/auto_rest_required_optional_test_service/models/__init__.py | 16 | 1179 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
unioslo/cerebrum | contrib/migrate/import_email_addresses.py | 1 | 9084 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2003 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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 th... | gpl-2.0 |
liaorubei/depot_tools | third_party/logilab/astroid/modutils.py | 56 | 23274 | # copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of astroid.
#
# astroid 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 F... | bsd-3-clause |
Antergos/auta | antbs/database/package.py | 2 | 23304 | # -*- coding: utf-8 -*-
#
# package.py
#
# Copyright © 2013-2017 Antergos
#
# This file is part of The Antergos Build Server, (AntBS).
#
# AntBS is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3... | gpl-3.0 |
normanmaurer/autobahntestsuite-maven-plugin | src/main/resources/werkzeug/contrib/cache.py | 306 | 23519 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.cache
~~~~~~~~~~~~~~~~~~~~~~
The main problem with dynamic Web sites is, well, they're dynamic. Each
time a user requests a page, the webserver executes a lot of code, queries
the database, renders templates until the visitor gets the page he sees.
... | apache-2.0 |
xguse/ete | ete_dev/treeview/OLD_qt4render.py | 1 | 45590 | import math
import types
import copy
from PyQt4 import QtCore, QtGui, QtSvg
from PyQt4.QtGui import QPrinter
from qt4gui import _PropertiesDialog, _NodeActions
import layouts
class _TextFaceItem(QtGui.QGraphicsSimpleTextItem, _NodeActions):
""" Manage faces on Scene"""
def __init__(self, face, node, *args)... | gpl-3.0 |
dwt/BayesianNetworks | solver.py | 1 | 9258 | #!/usr/bin/env python
# coding: utf-8
from pyexpect import expect
import itertools
from operator import attrgetter
from fluent import *
def assert_almost_sums_to_one(probabilities):
epsilon = .00000001
assert abs(1 - sum(probabilities)) < epsilon, 'Probability tables need to sum to (almost) 1'
class Refe... | mit |
LLNL/spack | lib/spack/llnl/util/filesystem.py | 2 | 53938 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import collections
import errno
import hashlib
import glob
import grp
import itertools
import numbers
import os
import pwd... | lgpl-2.1 |
p0psicles/SickRage | tests/test_lib.py | 3 | 9665 | # coding=UTF-8
# Author: Dennis Lutter <lad1337@gmail.com>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 ver... | gpl-3.0 |
hastexo/edx-platform | lms/djangoapps/courseware/migrations/0002_coursedynamicupgradedeadlineconfiguration_dynamicupgradedeadlineconfiguration.py | 5 | 2265 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
import django.db.models.deletion
import openedx.core.djangoapps.xmodule_django.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dep... | agpl-3.0 |
Mrs-X/Darknet | test/functional/p2p_disconnect_ban.py | 3 | 5304 | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test node disconnect and ban behavior"""
import time
from test_framework.test_framework import PivxTes... | mit |
sauloal/cnidaria | scripts/venv/lib/python2.7/site-packages/cogent/core/tree.py | 1 | 85847 | #!/usr/bin/env python
"""Classes for storing and manipulating a phylogenetic tree.
These trees can be either strictly binary, or have polytomies
(multiple children to a parent node).
Trees consist of Nodes (or branches) that connect two nodes. The Tree can
be created only from a newick formatted string read either fr... | mit |
tranvanluan2/M-Tree | py/mtree/__init__.py | 2 | 15978 | from collections import namedtuple
import functions
from heap_queue import HeapQueue
_INFINITY = float("inf")
_ItemWithDistances = namedtuple('_ItemWithDistances', 'item, distance, min_distance')
class _RootNodeReplacement(Exception):
def __init__(self, new_root):
super(_RootNodeReplacement, self).__init__(ne... | mit |
wrouesnel/ansible | lib/ansible/module_utils/cloudscale.py | 70 | 2876 | # -*- coding: utf-8 -*-
#
# (c) 2017, Gaudenz Steinlin <gaudenz.steinlin@cloudscale.ch>
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import json
from ansible.module_util... | gpl-3.0 |
alexandrucoman/vbox-neutron-agent | neutron/db/l3_db.py | 2 | 65619 | # Copyright 2012 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | apache-2.0 |
jmehnle/ansible | lib/ansible/compat/__init__.py | 241 | 1087 | # (c) 2014, Toshio Kuratomi <tkuratomi@ansible.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) any later... | gpl-3.0 |
jplusplus/dystopia-tracker | app/core/migrations/0009_auto__add_field_category_color.py | 1 | 5883 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'Category.color'
db.add_column(u'core_category', 'color',
... | lgpl-3.0 |
huongttlan/statsmodels | statsmodels/sandbox/distributions/multivariate.py | 33 | 4909 | '''Multivariate Distribution
Probability of a multivariate t distribution
Now also mvstnormcdf has tests against R mvtnorm
Still need non-central t, extra options, and convenience function for
location, scale version.
Author: Josef Perktold
License: BSD (3-clause)
Reference:
Genz and Bretz for formula
'''
from __... | bsd-3-clause |
denys-duchier/sorl-thumbnail-py3 | sorl/thumbnail/engines/base.py | 1 | 4334 | #coding=utf-8
from sorl.thumbnail.conf import settings
from sorl.thumbnail.helpers import toint
from sorl.thumbnail.parsers import parse_crop
class EngineBase(object):
"""
ABC for Thumbnail engines, methods are static
"""
def create(self, image, geometry, options):
"""
Processing condu... | bsd-3-clause |
mariusbaumann/pyload | module/lib/thrift/TSerialization.py | 74 | 1344 | #
# 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 u... | gpl-3.0 |
arifgursel/pyglet | pyglet/libs/x11/cursorfont.py | 46 | 3236 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | bsd-3-clause |
gcarothers/acidfree | setup.py | 1 | 3462 | from setuptools import setup, find_packages
import codecs
import os
import re
here = os.path.abspath(os.path.dirname(__file__))
# Read the version number from a source file.
# Why read it, and not import?
# see https://groups.google.com/d/topic/pypa-dev/0PkjVpcxTzQ/discussion
def find_version(*file_paths):
# Open... | apache-2.0 |
calfonso/ansible | lib/ansible/modules/system/pamd.py | 22 | 23925 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Kenneth D. Evensen <kevensen@redhat.com>
# 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': ... | gpl-3.0 |
damiansoriano/odoo | addons/product_visible_discount/product_visible_discount.py | 12 | 4423 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
Immortalin/python-for-android | python3-alpha/python3-src/Tools/pybench/Instances.py | 92 | 1388 | from pybench import Test
class CreateInstances(Test):
version = 2.0
operations = 3 + 7 + 4
rounds = 80000
def test(self):
class c:
pass
class d:
def __init__(self,a,b,c):
self.a = a
self.b = b
self.c = c
... | apache-2.0 |
M4sse/chromium.src | chrome/test/chromedriver/embed_version_in_cpp.py | 31 | 1400 | #!/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.
"""Embeds Chrome user data files in C++ code."""
import optparse
import os
import re
import sys
import chrome_paths
import cpp_source... | bsd-3-clause |
sunwise123/shenzhouStm32Rtt | tools/buildbot.py | 39 | 1200 | import os
import sys
def usage():
print '%s all -- build all bsp' % os.path.basename(sys.argv[0])
print '%s clean -- clean all bsp' % os.path.basename(sys.argv[0])
print '%s project -- update all prject files' % os.path.basename(sys.argv[0])
BSP_ROOT = '../bsp'
if len(sys.argv) != 2:
usage()
sys.e... | gpl-2.0 |
Bysmyyr/chromium-crosswalk | media/tools/layout_tests/trend_graph.py | 174 | 3309 | # 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.
"""A module for manipulating trend graph with analyzer result history."""
import os
import layouttest_analyzer_helpers
DEFAULT_TREND_GRAPH_PATH = os.p... | bsd-3-clause |
bmess/scrapy | scrapy/spiders/crawl.py | 56 | 3521 | """
This modules implements the CrawlSpider which is the recommended spider to use
for scraping typical web sites that requires crawling pages.
See documentation in docs/topics/spiders.rst
"""
import copy
from scrapy.http import Request, HtmlResponse
from scrapy.utils.spider import iterate_spider_output
from scrapy.... | bsd-3-clause |
calfonso/ansible | lib/ansible/modules/network/cloudengine/ce_vxlan_tunnel.py | 39 | 31157 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
TrentFranks/ssNMR-Topspin-Python | modules/fmpTS2p1.py | 1 | 5665 | """
FMP pulse sequence conventions
W.T.Franks FMP Berlin
"""
import TopCmds, sys
pulDict = {\
#Hard Pulses
'aC' :'PL 1' ,'pC90' :'P 1' ,'pC180' :'P 2' ,\
'aH' :'PL 2' ,'pH90' :'P 3' ,'pH180' :'P 4' ,\
'aN' :'PL 21' ,'pN90' :'P 21' ,'pN180' :'P 22' ,\
'aD' :'PL 32... | mit |
hassanibi/erpnext | erpnext/projects/doctype/task/task.py | 16 | 6348 | # 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, json
from frappe.utils import getdate, date_diff, add_days, cstr
from frappe import _
from frappe.model.document import Document
class... | gpl-3.0 |
QuickSander/CouchPotatoServer | libs/tmdb3/cache_file.py | 34 | 13291 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------
# Name: cache_file.py
# Python Library
# Author: Raymond Wagner
# Purpose: Persistant file-backed cache using /tmp/ to share data
# using flock or msvcrt.locking to allow safe concurrent
# access.
#-----------------------
import s... | gpl-3.0 |
bowang/tensorflow | tensorflow/contrib/distributions/python/ops/deterministic.py | 64 | 13215 | # 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 |
rjsproxy/wagtail | wagtail/wagtailimages/rich_text.py | 23 | 1547 | from wagtail.wagtailimages.models import get_image_model
from wagtail.wagtailimages.formats import get_image_format
class ImageEmbedHandler(object):
"""
ImageEmbedHandler will be invoked whenever we encounter an element in HTML content
with an attribute of data-embedtype="image". The resulting element in ... | bsd-3-clause |
DNFcode/edx-platform | common/djangoapps/student/migrations/0037_auto__add_courseregistrationcode.py | 114 | 14263 | # -*- 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 model 'CourseRegistrationCode'
db.create_table('student_courseregistrationcode', (
('id... | agpl-3.0 |
chipx86/reviewboard | reviewboard/webapi/resources/default_reviewer.py | 2 | 14037 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from djblets.util.decorators import augment_method_from
from djblets.webapi.decorators import (webapi_login_required,
webapi_response_errors,
... | mit |
liresearchgroup/uvspecgen | uvspec/logfile.py | 1 | 3403 | # Generate UV-Vis spectra from electronic structure TDHF/TDDFT output files.
# Copyright (C) 2014 Li Research Group (University of Washington)
#
# 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 |
goldsborough/.emacs | .emacs.d/.python-environments/default/lib/python3.5/encodings/palmos.py | 219 | 13519 | """ Python Character Mapping Codec for PalmOS 3.5.
Written by Sjoerd Mullender (sjoerd@acm.org); based on iso8859_15.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,i... | mit |
Pafcholini/emotion_beta_511_no_updates | tools/perf/util/setup.py | 2079 | 1438 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
RobertoMalatesta/phantomjs | src/qt/qtwebkit/Tools/QueueStatusServer/config/logging.py | 122 | 1582 | # Copyright (C) 2013 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 ... | bsd-3-clause |
nevion/cldemosaic | kernels.py | 1 | 3631 | #The MIT License (MIT)
#
#Copyright (c) 2015 Jason Newton <nevion@gmail.com>
#
#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 us... | mit |
laurentgo/pants | pants-plugins/tests/python/internal_backend_test/sitegen/test_sitegen.py | 16 | 7864 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import json
import u... | apache-2.0 |
datawire/qpid-proton | examples/python/reactor/hello-world.py | 4 | 1554 | #!/usr/bin/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
# "Lice... | apache-2.0 |
hidekb/espressopp | testsuite/AdResS/FreeEnergyCompensation/test_FreeEnergyCompensation.py | 5 | 6885 | #!/usr/bin/env python2
#
# Copyright (C) 2013-2017(H)
# Max Planck Institute for Polymer Research
#
# This file is part of ESPResSo++.
#
# ESPResSo++ 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 |
acuriel/nahuatilli | contracts/urls.py | 1 | 3303 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^/create$', views.ContractCreateView.as_view(), name='create'),
url(r'^/add/preamble$', views.PreambleAddView.as_view(), name='add_preamble'),
url(r'^/add/clause$', views.ContractCreateView.as_view(), name='add_clause'),
url(r... | gpl-3.0 |
faizalpribadi/electron | script/update-external-binaries.py | 124 | 1682 | #!/usr/bin/env python
import errno
import sys
import os
from lib.config import get_target_arch
from lib.util import safe_mkdir, rm_rf, extract_zip, tempdir, download
VERSION = 'v0.7.0'
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
FRAMEWORKS_URL = 'http://github.com/atom/atom-shell-frame... | mit |
mcgachey/edx-platform | lms/djangoapps/course_api/blocks/transformers/blocks_api.py | 32 | 2397 | """
Blocks API Transformer
"""
from openedx.core.lib.block_cache.transformer import BlockStructureTransformer
from .block_counts import BlockCountsTransformer
from .block_depth import BlockDepthTransformer
from .navigation import BlockNavigationTransformer
from .student_view import StudentViewTransformer
class Blocks... | agpl-3.0 |
CG3002/Hardware-Bootloader-Timer | reg.py | 1 | 1129 | import time
import serial
ser = serial.Serial(port=29, baudrate=9600, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_TWO, timeout=1)
ser.isOpen()
connected=False
cash_reg = []
my_dict = []
reg = ['@r3', '@r1', '@r2', '@r4']
flag = 1
start_rec = 0
wrong_id = 0
start_count = 0
barcode... | mit |
subailong/kubernetes | hack/lookup_pull.py | 368 | 1319 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
willmcgugan/rich | rich/box.py | 1 | 9014 | import sys
from typing import TYPE_CHECKING, Iterable, List
if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal # pragma: no cover
from ._loop import loop_last
if TYPE_CHECKING:
from rich.console import ConsoleOptions
class Box:
"""Defines charact... | mit |
hexxcointakeover/hexxcoin | contrib/linearize/linearize-hashes.py | 214 | 3037 | #!/usr/bin/python
#
# linearize-hashes.py: List blocks in a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import pr... | mit |
karteek/simplekv | simplekv/memory/redisstore.py | 2 | 1824 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from io import BytesIO
from .. import KeyValueStore, TimeToLiveMixin, NOT_SET, FOREVER
import re
class RedisStore(TimeToLiveMixin, KeyValueStore):
"""Uses a redis-database as the backend.
:param redis: An instance of :py:class:`redis.StrictRedis`.
"""
d... | mit |
xijunlee/leetcode | 547.py | 1 | 1294 | #!/usr/bin/env python
# coding=utf-8
class Solution(object):
hash = []
def findCircleNum(self, M):
"""
:type M: List[List[int]]
:rtype: int
"""
N = len(M)
self.hash = [0 for i in range(N)]
h_count = 1
for i in range(N):
if not self.ha... | mit |
OpenCode/purchase-workflow | purchase_discount/models/stock_move.py | 15 | 1305 | # -*- encoding: utf-8 -*-
##############################################################################
#
# 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... | agpl-3.0 |
marcusmueller/gnuradio | gnuradio-runtime/python/gnuradio/ctrlport/RPCConnectionThrift.py | 3 | 10855 | #!/usr/bin/env python
#
# Copyright 2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# ... | gpl-3.0 |
zfil/ansible | test/units/vars/test_variable_manager.py | 70 | 5534 | # (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 |
zahodi/ansible | lib/ansible/plugins/test/core.py | 46 | 4440 | # (c) 2012, Jeroen Hoekx <jeroen@hoekx.be>
#
# 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.... | gpl-3.0 |
senthil10/scilifelab | tests/utils/test_slurm.py | 4 | 1824 | """Test the utils/slurm.py functionality
"""
import subprocess
import unittest
from mock import Mock
import scilifelab.utils.slurm as sq
from scilifelab.pm.ext.ext_distributed import convert_to_drmaa_time
class TestSlurm(unittest.TestCase):
def test__get_slurm_jobid(self):
"""Extract the jobid f... | mit |
thekingofkings/focusread | libs/dns/zone.py | 9 | 40026 | # Copyright (C) 2003-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 "... | mit |
xkcd1253/SocialNetworkforTwo | flask/lib/python2.7/site-packages/migrate/versioning/shell.py | 69 | 6460 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The migrate command-line tool."""
import sys
import inspect
import logging
from optparse import OptionParser, BadOptionError
from migrate import exceptions
from migrate.versioning import api
from migrate.versioning.config import *
from migrate.versioning.util import a... | gpl-2.0 |
hyperized/ansible | lib/ansible/module_utils/facts/network/darwin.py | 128 | 2011 | # 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 in the hope that ... | gpl-3.0 |
CoolCloud/taiga-back | taiga/feedback/apps.py | 21 | 1263 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# 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 F... | agpl-3.0 |
tmthydvnprt/compfipy | compfipy/models.py | 1 | 3612 | """
models.py
Various Stochastic models of the "market" that provide "fake" asset prices to test on.
"""
import math
import datetime
import pandas as pd
import numpy as np
from compfipy import market
# Common conversion functions used across all models
# ------------------------------------------------------------... | mit |
Kiiv/CouchPotatoServer | libs/requests/packages/charade/langcyrillicmodel.py | 2762 | 17725 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | gpl-3.0 |
gale320/newfies-dialer | newfies/callcenter/constants.py | 3 | 1376 | #
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2014 Star2Billing S.L.
#
# The Initia... | mpl-2.0 |
sunfish-prj/Platform-docs | docs/conf.py | 1 | 5207 | # -*- coding: utf-8 -*-
#
# SUNFISH Platform Documentation documentation build configuration file, created by
# sphinx-quickstart on Thu May 25 10:40:42 2017.
#
# 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
# au... | gpl-3.0 |
jasonbot/django | tests/test_client_regress/views.py | 143 | 5161 | import json
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.serializers.json import DjangoJSONEncoder
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.shortcuts import render_to_response
from django.template import RequestC... | bsd-3-clause |
overtherain/scriptfile | software/googleAppEngine/lib/jinja2/setup.py | 20 | 3257 | # -*- coding: utf-8 -*-
"""
Jinja2
~~~~~~
Jinja2 is a template engine written in pure Python. It provides a
`Django`_ inspired non-XML syntax but supports inline expressions and
an optional `sandboxed`_ environment.
Nutshell
--------
Here a small example of a Jinja template::
{% extends 'base.html' %}
{% b... | mit |
kochbeck/icsisumm | icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk/corpus/reader/bracket_parse.py | 9 | 4538 | # Natural Language Toolkit: Penn Treebank Reader
#
# Copyright (C) 2001-2008 University of Pennsylvania
# Author: Steven Bird <sb@ldc.upenn.edu>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
from nltk.corpus.reader.util import *
from nltk... | gpl-3.0 |
yanheven/console | openstack_dashboard/openstack/common/notifier/rpc_notifier.py | 19 | 1746 | # 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.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
HiroIshikawa/21playground | thumblelog/myproject/lib/python3.5/site-packages/wheel/test/test_tagopt.py | 236 | 3550 | """
Tests for the bdist_wheel tag options (--python-tag and --universal)
"""
import sys
import shutil
import pytest
import py.path
import tempfile
import subprocess
SETUP_PY = """\
from setuptools import setup
setup(
name="Test",
version="1.0",
author_email="author@example.com",
py_modules=["test"],
... | mit |
olivierdalang/QGIS | python/plugins/processing/algs/grass7/ext/r_li_mpa.py | 45 | 1287 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_mpa.py
-----------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
************************************... | gpl-2.0 |
sudosurootdev/kernel_lge_msm8974 | tools/perf/scripts/python/net_dropmonitor.py | 4235 | 1554 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
CarlSorensen/lilypond-standards | python/auxiliar/buildlib.py | 9 | 2865 | #!@PYTHON@
import subprocess
import re
import sys
verbose = False
def read_pipe (command):
child = subprocess.Popen (command,
stdout = subprocess.PIPE,
stderr = subprocess.PIPE,
shell = True)
(output, error) = child.com... | gpl-3.0 |
fviard/s3cmd | S3/Crypto.py | 2 | 11269 | # -*- coding: utf-8 -*-
## Amazon S3 manager
## Author: Michal Ludvig <michal@logix.cz>
## http://www.logix.cz/michal
## License: GPL Version 2
## Copyright: TGRMN Software and contributors
from __future__ import absolute_import
import sys
import hmac
try:
from base64 import encodebytes as encodestring
e... | gpl-2.0 |
40223108/-2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/datetime.py | 628 | 75044 | """Concrete date/time and related types.
See http://www.iana.org/time-zones/repository/tz-link.html for
time zone and DST data sources.
"""
import time as _time
import math as _math
def _cmp(x, y):
return 0 if x == y else 1 if x > y else -1
MINYEAR = 1
MAXYEAR = 9999
_MAXORDINAL = 3652059 # date.max.toordinal()... | gpl-3.0 |
udayinfy/openerp-7.0 | sale_order_line/sale.py | 4 | 4650 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010-2013 Elico Corp. All Rights Reserved.
# Jon Chow <jon.chow@elico-corp.com>
#
# This program is free software: you can redistribute it and/... | agpl-3.0 |
cuckoobox/cuckoo | cuckoo/web/controllers/analysis/control/routes.py | 1 | 1273 | # Copyright (C) 2017-2018 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file "docs/LICENSE" for copying permission.
from django.http import Http404, HttpResponseRedirect
from cuckoo.common.config import config
from cuckoo.core.database import Database
from cuckoo.we... | mit |
Miserlou/Anomos | Anomos/launchmanycore.py | 1 | 9499 | #!/usr/bin/env python
# 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 version.
#
# This program is distributed in the hope that ... | gpl-3.0 |
tom-f-oconnell/multi_tracker | nodes/roi_finder.py | 1 | 31087 | #!/usr/bin/env python
import os
from subprocess import Popen
import Queue
import glob
import pickle
import copy
import sys
import rospy
import roslaunch
# latest versions of ROS (from source, particularly) should have a method in
# here for getting topic names, so we wouldn't need to use rosgraph import
# rostopic
im... | mit |
pearsonlab/nipype | nipype/interfaces/semtools/diffusion/tractography/fiberprocess.py | 10 | 5827 | # -*- coding: utf8 -*-
"""Autogenerated file - DO NOT EDIT
If you spot a bug, please report it on the mailing list and/or change the generator."""
import os
from ....base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine,
TraitedSpec, File, Directory, traits, isdefined,
... | bsd-3-clause |
p0linka/AA_hmw | hmw_3/fox.py | 1 | 1482 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#Polina Morozova 16.11.2014
import sqlite3
import sys
import re
import datetime
def unescape(line):
line = line.replace(""", "\"")
line = line.replace("'", "'")
line = line.replace("&", "&")
line = line.replace("<", "<")
line = line.replace(">", ... | mit |
puttarajubr/commcare-hq | corehq/apps/receiverwrapper/repeater_generators.py | 1 | 1916 | import json
from casexml.apps.case.xform import cases_referenced_by_xform
from corehq.apps.receiverwrapper.models import FormRepeater, CaseRepeater, ShortFormRepeater, \
AppStructureRepeater, RegisterGenerator
from casexml.apps.case.xml import V2
from dimagi.utils.parsing import json_format_datetime
class Base... | bsd-3-clause |
OS2World/APP-INTERNET-torpak_2 | Lib/imputil.py | 3 | 25394 | """
Import utilities
Exported classes:
ImportManager Manage the import process
Importer Base class for replacing standard import functions
BuiltinImporter Emulate the import mechanism for builtin and frozen modules
DynLoadSuffixImporter
"""
# note: avoid importing non-builtin modules
import... | mit |
acshi/osf.io | addons/osfstorage/routes.py | 18 | 3385 | # encoding: utf-8
from framework.routing import Rule, json_renderer
from addons.osfstorage import views
api_routes = {
'prefix': '/api/v1',
'rules': [
Rule(
[
'/project/<pid>/osfstorage/',
'/project/<pid>/node/<nid>/osfstorage/',
'/proje... | apache-2.0 |
suneeshtr/persona | node_modules/l/node_modules/hook.io/node_modules/npm/node_modules/node-gyp/gyp/test/win/gyptest-cl-warning-level.py | 344 | 1394 | #!/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.
"""
Make sure warning level is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp(for... | gpl-2.0 |
brain-research/data-linter | example_pb2.py | 1 | 4651 | # Copyright 2017 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 |
lino-framework/lino | lino/sandbox/bcss/SSDNReply.py | 3 | 113672 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated Mon Oct 03 15:32:12 2011 by generateDS.py version 2.6a.
#
import sys
import getopt
import re as re_
etree_ = None
Verbose_import_ = False
(XMLParser_import_none, XMLParser_import_lxml,
XMLParser_import_elementtree
) = range(3)
XMLParser_import_library ... | bsd-2-clause |
walterreade/scikit-learn | sklearn/tests/test_grid_search.py | 68 | 28856 | """
Testing for grid search module (sklearn.grid_search)
"""
from collections import Iterable, Sized
from sklearn.externals.six.moves import cStringIO as StringIO
from sklearn.externals.six.moves import xrange
from itertools import chain, product
import pickle
import warnings
import sys
import numpy as np
import sci... | bsd-3-clause |
Esri/solutions-geoprocessing-toolbox | utils/test/distance_to_assets_tests/DistanceToAssetsTestSuite.py | 2 | 2103 | #------------------------------------------------------------------------------
# Copyright 2015 Esri
# 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/LICENS... | apache-2.0 |
Yrthgze/prueba-sourcetree2 | Lyndon1994/0023/flask-demo.py | 2 | 2235 | import os
import logging
logging.basicConfig(level=logging.INFO)
import sqlite3
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash
import time
app = Flask(__name__)
class Config(object):
DEBUG = True
USERNAME='admin'
PASSWORD='1234'
DATABASE='/tmp/f... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.