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 |
|---|---|---|---|---|---|
Kefkius/electrum-frc-server | src/storage.py | 1 | 18186 | import plyvel
import ast
import hashlib
import os
import sys
from processor import print_log, logger
from utils import bc_address_to_hash_160, hash_160_to_pubkey_address, hex_to_int, int_to_hex, Hash
global GENESIS_HASH
GENESIS_HASH = '000000005b1e3d23ecfd2dd4a6e1a35238aa0392c0a8528c40df52376d7efe2c'
"""
Patricia tr... | agpl-3.0 |
googlefonts/fontbakery-dashboard | containers/base/python/protocolbuffers/shared_pb2.py | 1 | 3395 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: shared.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_da... | apache-2.0 |
gitseagull/pox | pox/openflow/util.py | 24 | 1054 | # Copyright 2011,2012 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is d... | gpl-3.0 |
baidurom/repo | subcmds/forall.py | 7 | 8292 | #
# Copyright (C) 2008 The Android Open Source Project
#
# 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 la... | apache-2.0 |
rcoscali/external-chromium | chrome/common/extensions/docs/build/build.py | 65 | 8905 | #!/usr/bin/python
# Copyright (c) 2009 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.
"""Docbuilder for extension docs."""
import os
import os.path
import shutil
import sys
import time
import urllib
from subprocess impo... | bsd-3-clause |
DeltaEpsilon-HackFMI2/FMICalendar-REST | venv/lib/python2.7/site-packages/django/contrib/contenttypes/management.py | 96 | 2903 | from django.contrib.contenttypes.models import ContentType
from django.db import DEFAULT_DB_ALIAS, router
from django.db.models import get_apps, get_models, signals
from django.utils.encoding import smart_text
from django.utils import six
from django.utils.six.moves import input
def update_contenttypes(app, created_m... | mit |
lmorchard/django | tests/or_lookups/tests.py | 275 | 7624 | from __future__ import unicode_literals
from datetime import datetime
from operator import attrgetter
from django.db.models import Q
from django.test import TestCase
from .models import Article
class OrLookupsTests(TestCase):
def setUp(self):
self.a1 = Article.objects.create(
headline='Hel... | bsd-3-clause |
tornadozou/tensorflow | tensorflow/contrib/summary/summary_ops.py | 6 | 6245 | # 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 |
jdinuncio/ansible-modules-extras | network/haproxy.py | 23 | 13770 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Ravi Bhure <ravibhure@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 Lice... | gpl-3.0 |
enitihas/SAC-Website | venv/bin/venv/lib/python2.7/site-packages/pip/_vendor/distlib/index.py | 571 | 20976 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import hashlib
import logging
import os
import shutil
import subprocess
import tempfile
try:
from threading import Thread
except ImportErr... | apache-2.0 |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/networkx/generators/random_clustered.py | 42 | 4535 | # -*- coding: utf-8 -*-
"""Generate graphs with given degree and triangle sequence.
"""
# 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 random
import networkx as nx
__author_... | mit |
redcanari/canari3 | src/canari/maltego/transform.py | 1 | 5721 | import re
import sys
from canari.framework import classproperty
from canari.maltego.configuration import AuthenticationType
from canari.maltego.entities import Unknown
from canari.maltego.message import ValidationError, ElementType
__author__ = 'Nadeem Douba'
__copyright__ = 'Copyright 2015, Canari Project'
__credits... | gpl-3.0 |
campbe13/openhatch | vendor/packages/Django/django/contrib/gis/db/backends/oracle/operations.py | 98 | 12894 | """
This module contains the spatial lookup types, and the `get_geo_where_clause`
routine for Oracle Spatial.
Please note that WKT support is broken on the XE version, and thus
this backend will not work on such platforms. Specifically, XE lacks
support for an internal JVM, and Java libraries are required to use... | agpl-3.0 |
cjds/cron | lib/requests/packages/chardet/jpcntx.py | 1777 | 19348 | ######################## 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... | apache-2.0 |
ToFuProject/tofu | scripts/tofu_bash.py | 2 | 3731 | #!/usr/bin/env python
# Built-in
import sys
import os
import argparse
_HERE = os.path.abspath(os.path.dirname(__file__))
# import parser dict
sys.path.insert(1, _HERE)
from _dparser import _DPARSER
_ = sys.path.pop(1)
_TOFUPATH = os.path.dirname(_HERE)
_ENTRYPOINTS_PATH = os.path.join(_TOFUPATH, 'tofu', 'entrypoi... | mit |
shipci/boto | boto/sqs/queue.py | 15 | 17789 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | mit |
jnovinger/django | tests/admin_registration/tests.py | 266 | 4640 | from __future__ import unicode_literals
from django.contrib import admin
from django.contrib.admin.decorators import register
from django.contrib.admin.sites import site
from django.core.exceptions import ImproperlyConfigured
from django.test import SimpleTestCase
from .models import Location, Person, Place, Traveler... | bsd-3-clause |
Gadal/sympy | sympy/functions/__init__.py | 7 | 2725 | """A functions module, includes all the standard functions.
Combinatorial - factorial, fibonacci, harmonic, bernoulli...
Elementary - hyperbolic, trigonometric, exponential, floor and ceiling, sqrt...
Special - gamma, zeta,spherical harmonics...
"""
from sympy.functions.combinatorial.factorials import (factorial, fac... | bsd-3-clause |
pyshcoder/namebench | libnamebench/cli.py | 173 | 4760 | #!/usr/bin/env python
# Copyright 2009 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... | apache-2.0 |
freedesktop-unofficial-mirror/papyon | papyon/service/description/SchematizedStore/FindDocuments.py | 6 | 2597 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Johann Prieur <johann.prieur@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 2 of the License, or
# (at your option) an... | gpl-2.0 |
smartanthill/smartanthill2_0 | tests/test_litemq.py | 1 | 5559 | # Copyright (C) 2015 OLogN Technologies AG
#
# This source file 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY W... | gpl-2.0 |
ThomDietrich/miflora-mqtt-daemon | miflora-mqtt-daemon.py | 1 | 27645 | #!/usr/bin/env python3
import ssl
import sys
import re
import json
import os.path
import argparse
from time import time, sleep, localtime, strftime
from collections import OrderedDict
from colorama import init as colorama_init
from colorama import Fore, Back, Style
from configparser import ConfigParser
from unidecode ... | mit |
SaranyaKarthikeyan/boto | boto/gs/connection.py | 157 | 5478 | # Copyright 2010 Google Inc.
#
# 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, publish, dis-
# trib... | mit |
svanschalkwyk/datafari | debian7/zookeeper/src/contrib/huebrowser/zkui/src/zkui/utils.py | 114 | 1120 | # 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 |
psyonara/jabber-hal | plugins_all/youtube-helper.py | 1 | 2054 | from message_plugin import MessagePlugin
from urllib2 import urlopen, HTTPError
from urlparse import urlparse, parse_qs
import datetime
import re
import xml.etree.ElementTree as ET
class YoutubeHelper(MessagePlugin):
def get_video_id(self, url):
if url.find("youtube.com") > -1:
qps = parse_q... | mit |
EnterTheNameHere/codeblocks_enth | src/sdk/wxpropgrid/wxpython/spec.py | 16 | 5034 | #
# wxPropertyGrid project specifications
#
projname = 'propgrid'
longprojname = 'wxPropertyGrid'
branch = 'stable' # Must be either '', 'stable' or 'dev'
version = '1.4.16'
author = 'Jaakko Salli'
author_email = 'jmsalli@users.sourceforge.net'
homepage = 'http://wxpropgrid.sourceforge.net/'
# Set to True to pregene... | gpl-3.0 |
jittat/ku-eng-direct-admission | confirmation/migrations/0006_add_ptype_cache_to_admission_major_pref.py | 1 | 4120 | # 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 'AdmissionMajorPreference.ptype'
db.add_column('confirmation_admissionmajorpreference', 'pt... | agpl-3.0 |
kaplun/inspire-next | tests/unit/utils/test_utils_conferences.py | 4 | 5146 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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 ... | gpl-3.0 |
marratj/ansible | lib/ansible/plugins/connection/zone.py | 21 | 7937 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# and chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# and jail.py (c) 2013, Michael Scherer <misc@zarb.org>
# (c) 2015, Dagobert Michelsen <dam@baltic-online.de>
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
# Copyright (c... | gpl-3.0 |
jonyroda97/redbot-amigosprovaveis | lib/pip/_vendor/distlib/compat.py | 60 | 41404 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2017 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import absolute_import
import os
import re
import sys
try:
import ssl
except ImportError: # pragma: no cover
s... | gpl-3.0 |
mozilla/stoneridge | python/src/Mac/Modules/cg/cgscan.py | 34 | 2561 | # Scan an Apple header file, generating a Python file of generator calls.
import sys
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner_OSX
LONG = "CoreGraphics"
SHORT = "cg"
OBJECTS = ("CGContextRef",
)
# ADD object typenames here
def main():
inp... | mpl-2.0 |
BaconPancakes/valor | lib/youtube_dl/swfinterp.py | 69 | 31486 | from __future__ import unicode_literals
import collections
import io
import zlib
from .compat import (
compat_str,
compat_struct_unpack,
)
from .utils import (
ExtractorError,
)
def _extract_tags(file_contents):
if file_contents[1:3] != b'WS':
raise ExtractorError(
'Not an SWF fi... | gpl-3.0 |
SAM-IT-SA/odoo | openerp/report/print_xml.py | 338 | 11063 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
django-bmf/django-bmf | djangobmf/contrib/stock/migrations/0001_initial.py | 2 | 4084 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-24 09:01
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import djangobmf.fields
class Migration(migrations.Migration):
initial = True
dependenci... | bsd-3-clause |
40223125/w16btest1 | static/Brython3.1.1-20150328-091302/Lib/posix.py | 603 | 20904 | """This module provides access to operating system functionality that is
standardized by the C Standard and the POSIX standard (a thinly
disguised Unix interface). Refer to the library manual and
corresponding Unix manual entries for more information on calls."""
import datetime
from browser import window
def _rand... | agpl-3.0 |
openstack/heat | heat/tests/openstack/neutron/test_neutron_security_group_rule.py | 1 | 4046 | #
# 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
# ... | apache-2.0 |
jrowan/zulip | zerver/decorator.py | 1 | 33190 | from __future__ import absolute_import
from django.utils.translation import ugettext as _
from django.http import HttpResponseRedirect, HttpResponse
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.views.decorators.csrf import csrf_exempt
from django.http import QueryDict, HttpResponseNotAllowed, HttpRe... | apache-2.0 |
guanxin0206/dice_crawler | dice_spider_2/spider/json_parser.py | 1 | 1403 | #!/usr/bin/env python -t
# -*- coding: UTF-8 -*-
import requests
class JsonParser(object):
def __init__(self, json_cont=None, url=None):
if url is not None:
self.url = url
self.json_cont_dictionary = requests.get(url).json()
self.json_cont_dictionary = json_cont
def ... | bsd-2-clause |
cwmartin/rez | src/rez/vendor/sortedcontainers/__init__.py | 6 | 1603 | """Sorted Container Types: SortedList, SortedDict, SortedSet
SortedContainers is an Apache2 licensed containers library, written in
pure-Python, and fast as C-extensions.
Python's standard library is great until you need a sorted collections
type. Many will attest that you can get really far without one, but the mom... | lgpl-3.0 |
infobloxopen/infoblox-netmri | infoblox_netmri/api/broker/v2_7_0/device_support_bundle_broker.py | 17 | 76875 | from ..broker import Broker
class DeviceSupportBundleBroker(Broker):
controller = "device_support_bundles"
def index(self, **kwargs):
"""Lists the available device support bundles. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored. Of the various ways to query l... | apache-2.0 |
jjhelmus/scipy | scipy/_build_utils/tests/test_circular_imports.py | 9 | 1059 | from __future__ import division, absolute_import, print_function
import sys
import subprocess
from numpy.testing import run_module_suite
PUBLIC_SUBMODULES = [
'cluster',
'cluster.hierarchy',
'cluster.vq',
'constants',
'fftpack',
'fftpack.convolve',
'integrate',
'interpolate',
'io... | bsd-3-clause |
efortuna/AndroidSDKClone | ndk/prebuilt/linux-x86_64/lib/python2.7/distutils/file_util.py | 171 | 7795 | """distutils.file_util
Utility functions for operating on single files.
"""
__revision__ = "$Id$"
import os
from distutils.errors import DistutilsFileError
from distutils import log
# for generating verbose output in 'copy_file()'
_copy_action = {None: 'copying',
'hard': 'hard linking',
... | apache-2.0 |
40223134/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/compat.py | 603 | 3054 | """Python 2.x/3.x compatibility tools"""
import sys
__all__ = ['geterror', 'long_', 'xrange_', 'ord_', 'unichr_',
'unicode_', 'raw_input_', 'as_bytes', 'as_unicode']
def geterror ():
return sys.exc_info()[1]
try:
long_ = long
except NameError:
long_ = int
try:
xrange_ = xrange
except Nam... | gpl-3.0 |
AOSP-S4-KK/platform_external_chromium_org | tools/deep_memory_profiler/visualizer/app_unittest.py | 99 | 2830 | # 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.
# This file is expected to be used under another directory to use,
# so we disable checking import path of GAE tools from this directory.
# pylint: disable=F... | bsd-3-clause |
StackStorm/st2 | contrib/runners/python_runner/python_runner/python_action_wrapper.py | 3 | 14688 | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | apache-2.0 |
jymannob/Sick-Beard | bs4/tests/test_soup.py | 81 | 15577 | # -*- coding: utf-8 -*-
"""Tests of Beautiful Soup as a whole."""
import logging
import unittest
import sys
from bs4 import (
BeautifulSoup,
BeautifulStoneSoup,
)
from bs4.element import (
CharsetMetaAttributeValue,
ContentMetaAttributeValue,
SoupStrainer,
NamespacedAttribute,
)
import bs4.... | gpl-3.0 |
brandonchuang/linux-3.8.13 | 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 |
anotherline/anotherline-flask | app/auth/forms.py | 1 | 2618 | from flask.ext.wtf import Form
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import Required, Length, Email, Regexp, EqualTo
from wtforms import ValidationError
from ..models import User
class LoginForm(Form):
email = StringField('Email', validators=[Required(), Len... | gpl-3.0 |
rgevaert/pkg-graphite | lib/carbon/conf.py | 1 | 18524 | """Copyright 2009 Chris Davis
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
dist... | apache-2.0 |
jfitzgerald79/gis-1 | vectorize_polygon.py | 2 | 9658 | import pandas as pd
import numpy as np
import fiona
from shapely import geometry
from shapely import ops
from itertools import chain
from pyproj import Proj, transform
from scipy import spatial
from matplotlib import path
import os
from datetime import datetime
import sys
import pysal as ps
import numpy as np
from scip... | gpl-2.0 |
Sh4kE/ofm_helper | ofm_helper/common_settings.py | 2 | 4060 | """
Django settings for ofm_helper project.
Generated by 'django-admin startproject' using Django 1.9.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os... | agpl-3.0 |
alimanfoo/petlx | examples/bio.py | 1 | 1492 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
# fromtabix()
#############
import petl as etl
# activate bio extensions
import petlx.bio
table1 = etl.fromtabix('fixture/test.bed.gz',
region='Pf3D7_02_v3')
table1
table2 = etl.fromtabix('fixture/test.bed... | mit |
wanggang3333/scikit-learn | sklearn/tests/test_qda.py | 155 | 3481 | import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import ignore_war... | bsd-3-clause |
adviti/melange | thirdparty/google_appengine/google/appengine/_internal/django/core/validators.py | 23 | 6691 | import re
import urlparse
from google.appengine._internal.django.core.exceptions import ValidationError
from google.appengine._internal.django.utils.translation import ugettext_lazy as _
from google.appengine._internal.django.utils.encoding import smart_unicode
# These values, if given to validate(), will trigger the... | apache-2.0 |
ntt-sic/heat | contrib/docker/tests/fake_docker_client.py | 1 | 2698 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2013 Docker, 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.o... | apache-2.0 |
MrLoick/python-for-android | python-modules/twisted/twisted/mail/test/test_pop3client.py | 72 | 19951 | # -*- test-case-name: twisted.mail.test.test_pop3client -*-
# Copyright (c) 2001-2004 Divmod Inc.
# See LICENSE for details.
from zope.interface import directlyProvides
from twisted.mail.pop3 import AdvancedPOP3Client as POP3Client
from twisted.mail.pop3 import InsecureAuthenticationDisallowed
from twisted.mail.pop3 ... | apache-2.0 |
hpi-xnor/BMXNet | example/dec/dec.py | 24 | 7846 | # 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... | apache-2.0 |
ravello/ansible | lib/ansible/runner/action_plugins/template.py | 97 | 8326 | # (c) 2012, 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) any lat... | gpl-3.0 |
smolix/incubator-mxnet | example/gluon/super_resolution.py | 12 | 7612 | # 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... | apache-2.0 |
grapo/django-rest-framework-json-api | setup.py | 2 | 3042 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import os
import sys
from setuptools import setup
def read(*paths):
"""
Build a file path from paths and return the contents.
"""
with open(os.path.join(*paths), 'r') as f:
return f.read()
def get_version(package):
"""
Return ... | bsd-2-clause |
voxlol/scikit-learn | sklearn/covariance/tests/test_covariance.py | 142 | 11068 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_alm... | bsd-3-clause |
heeraj123/oh-mainline | vendor/packages/Django/tests/regressiontests/utils/decorators.py | 115 | 3920 | from django.http import HttpResponse
from django.template import Template, Context
from django.template.response import TemplateResponse
from django.test import TestCase, RequestFactory
from django.utils.decorators import decorator_from_middleware
class ProcessViewMiddleware(object):
def process_view(self, reques... | agpl-3.0 |
wlonk/python-semantic-release | setup.py | 2 | 1414 | import re
from setuptools import find_packages, setup
import sys
def _read_long_description():
try:
with open('readme.rst') as fd:
return fd.read()
except Exception:
return None
with open('semantic_release/__init__.py', 'r') as fd:
version = re.search(
r'^__version__\... | mit |
REGOVAR/Regovar | regovar/core/framework/common.py | 1 | 13849 | #!env/python3
# coding: utf-8
try:
import ipdb
except ImportError:
pass
import os
import hashlib
import datetime
import logging
import traceback
import uuid
import time
import asyncio
import subprocess
import re
import json
import requests
import concurrent.futures
from config import LOG_DIR, CACHE_DIR, CACH... | agpl-3.0 |
google-research/crest | util/scheduler.py | 1 | 6485 | # Copyright 2021 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
hunter007/django-rest-framework | tests/test_renderers.py | 8 | 16552 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
import re
from collections import MutableMapping, OrderedDict
from django.conf.urls import include, url
from django.core.cache import cache
from django.db import models
from django.test import TestCase
from django.utils import six
from django... | bsd-2-clause |
2viLUG/haldus | haldus/settings.py | 1 | 5376 | # Django settings for haldus project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'haldus', ... | agpl-3.0 |
benhowell/pycsw | pycsw/plugins/outputschemas/atom.py | 2 | 5821 | # -*- coding: iso-8859-15 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
#
# Copyright (c) 2015 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files... | mit |
hlt-mt/tensorflow | tensorflow/python/platform/default/_logging.py | 12 | 5893 | # 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 |
ralphbean/mongrel2 | examples/python/tests/mongrel2_org.py | 98 | 1671 | from mongrel2.config import *
main = Server(
uuid="2f62bd5-9e59-49cd-993c-3b6013c28f05",
access_log="/logs/access.log",
error_log="/logs/error.log",
chroot="./",
pid_file="/run/mongrel2.pid",
default_host="mongrel2.org",
name="main",
port=6767
)
test_directory = Dir(base='tests/',
... | bsd-3-clause |
tcezard/RADmapper | lib/command_runner/__init__.py | 1 | 2097 | import logging
from utils import utils_commands
from io import StringIO
TYPE_PRINT='print_out'
TYPE_RUN_LOCAL='run'
TYPE_RUN_SGE='sge'
RUNNER_TYPE=[TYPE_PRINT, TYPE_RUN_LOCAL]
class Command_runner():
def __init__(self, run_type=TYPE_PRINT):
if run_type in RUNNER_TYPE:
self.type_r=run_type
... | mit |
mviitanen/marsmod | mcp/temp-python/lib/python2.7/site-packages/pip/vcs/mercurial.py | 392 | 5820 | import os
import tempfile
import re
import sys
from pip.util import call_subprocess
from pip.util import display_path, rmtree
from pip.log import logger
from pip.vcs import vcs, VersionControl
from pip.download import path_to_url
from pip.backwardcompat import ConfigParser
class Mercurial(VersionControl):
name = ... | gpl-2.0 |
FlintHill/SUAS-Competition | env/lib/python2.7/site-packages/setuptools/archive_util.py | 95 | 6592 | """Utilities for extracting common archive formats"""
import zipfile
import tarfile
import os
import shutil
import posixpath
import contextlib
from distutils.errors import DistutilsError
from pkg_resources import ensure_directory
__all__ = [
"unpack_archive", "unpack_zipfile", "unpack_tarfile", "default_filter",... | mit |
w1ll1am23/home-assistant | homeassistant/components/kulersky/light.py | 3 | 6021 | """Kuler Sky light platform."""
from __future__ import annotations
from datetime import timedelta
import logging
from typing import Callable
import pykulersky
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_HS_COLOR,
ATTR_WHITE_VALUE,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPP... | apache-2.0 |
ktnyt/chainer | examples/pix2pix/facade_visualizer.py | 2 | 2567 | #!/usr/bin/env python
import os
from PIL import Image
import chainer
import chainer.cuda
from chainer import Variable
import numpy as np
def out_image(updater, enc, dec, rows, cols, seed, dst):
@chainer.training.make_extension()
def make_image(trainer):
np.random.seed(seed)
n_images = rows *... | mit |
TedaLIEz/sentry | src/sentry/queue/routers.py | 30 | 1106 | from __future__ import absolute_import
import itertools
from celery import current_app
COUNTER_TASKS = set([
'sentry.tasks.process_buffer.process_pending',
'sentry.tasks.process_buffer.process_incr',
])
TRIGGER_TASKS = set([
'sentry.tasks.post_process.post_process_group',
'sentry.tasks.post_process... | bsd-3-clause |
surajssd/kuma | kuma/users/tests/test_adapters.py | 13 | 4706 | from nose.plugins.attrib import attr
from nose.tools import eq_, ok_
from django.contrib import messages as django_messages
from django.test import RequestFactory
from allauth.exceptions import ImmediateHttpResponse
from allauth.socialaccount.models import SocialLogin, SocialAccount
from kuma.core.urlresolvers impor... | mpl-2.0 |
wire-rabbit/oarn-database | oarndb/tests/test_person_language_views.py | 2 | 18963 | # The OARN Relief Nursery Database
# Copyright (C) 2015 Oregon Association of Relief Nurseries
#
# 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... | agpl-3.0 |
PrinceNgattaiLam/Trafic | TraficLib/envInstallTF.py | 1 | 1188 | import os, sys, subprocess
def envIsInstalled():
currentPath = os.path.dirname(os.path.abspath(__file__))
if os.path.isdir(os.path.join(currentPath,"..","..", "miniconda2")):
return True
return False
def envInstall():
currentPath = os.path.dirname(os.path.abspath(__file__))
dir_install = o... | apache-2.0 |
sekikn/incubator-airflow | tests/cli/commands/test_cheat_sheet_command.py | 5 | 2948 | # 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... | apache-2.0 |
HuaweiSwitch/ansible | contrib/inventory/vbox.py | 117 | 3294 | #!/usr/bin/env 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 distr... | gpl-3.0 |
BizzCloud/PosBox | addons/hw_escpos/controllers/main.py | 1 | 14654 | # -*- coding: utf-8 -*-
import commands
import logging
import simplejson
import os
import os.path
import io
import base64
import openerp
import time
import random
import math
import md5
import openerp.addons.hw_proxy.controllers.main as hw_proxy
import pickle
import re
import subprocess
import traceback
try:
from... | agpl-3.0 |
zwChan/VATEC | ~/eb-virt/Lib/site-packages/pip/_vendor/html5lib/treewalkers/etree.py | 152 | 4597 | from __future__ import absolute_import, division, unicode_literals
try:
from collections import OrderedDict
except ImportError:
try:
from ordereddict import OrderedDict
except ImportError:
OrderedDict = dict
import re
from pip._vendor.six import text_type
from . import _base
from ..utils... | apache-2.0 |
gzorin/RSXGL | extsrc/mesa/src/mapi/glapi/gen/extension_helper.py | 46 | 8261 | #!/usr/bin/env python
# (C) Copyright IBM Corporation 2005
# All Rights Reserved.
#
# 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
# on the... | bsd-2-clause |
scarcry/snm-mezzanine | mezzanine/generic/models.py | 7 | 4945 |
from django.contrib.comments.models import Comment
from django.contrib.contenttypes.generic import GenericForeignKey
from django.db import models
from django.template.defaultfilters import truncatewords_html
from django.utils.translation import ugettext, ugettext_lazy as _
from mezzanine.generic.fields import RatingF... | bsd-2-clause |
hopeall/odoo | openerp/addons/__init__.py | 378 | 1537 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
Hitechverma/zamboni | mkt/commonplace/views.py | 4 | 6014 | import json
import os
from urlparse import urlparse
from django.conf import settings
from django.core.files.storage import default_storage as storage
from django.core.urlresolvers import resolve
from django.http import Http404
from django.shortcuts import render
from django.utils import translation
from django.views.d... | bsd-3-clause |
SlimRoms/android_external_chromium_org | tools/telemetry/telemetry/core/backends/chrome/inspector_page.py | 9 | 4492 | # 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 json
import logging
import sys
import time
from telemetry.core import util
class InspectorPage(object):
def __init__(self, inspector_backend, timeo... | bsd-3-clause |
ukncsc/viper | viper/modules/htmlparser.py | 4 | 7396 | # This file is part of Viper - https://github.com/viper-framework/viper
# See the file 'LICENSE' for copying permission.
import os
import re
import math
import string
import hashlib
from collections import Counter
from viper.common.abstracts import Module
from viper.core.session import __sessions__
try:
from bs4... | bsd-3-clause |
fedorpatlin/ansible | lib/ansible/modules/network/avi/avi_systemconfiguration.py | 28 | 6214 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 16.3.8
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | gpl-3.0 |
solashirai/edx-platform | lms/djangoapps/branding/models.py | 63 | 1687 | """
Model used by Video module for Branding configuration.
Includes:
BrandingInfoConfig: A ConfigurationModel for managing how Video Module will
use Branding.
"""
import json
from django.db.models import TextField
from django.core.exceptions import ValidationError
from config_models.models import Configura... | agpl-3.0 |
aot9/bashdb-gui | View.py | 1 | 4298 | #! /usr/bin/env python
from Tkinter import *
import tkFont
import ttk
from SourceCodeBox import SourceCodeBox
class View(Tk):
def __init__(self, Bl):
Tk.__init__(self)
self.title("bashdb-gui")
self.cur_line = None
self.curSrcFile = None
self.Bl =... | mit |
froyobin/ironic | ironic/tests/drivers/test_fake.py | 7 | 4500 | # coding=utf-8
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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/li... | apache-2.0 |
nlu90/heron | heronpy/connectors/mock/arraylooper.py | 5 | 1667 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# 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... | apache-2.0 |
spacy-io/spaCy | spacy/tokens/_dict_proxies.py | 1 | 1989 | from typing import Iterable, Tuple, Union, TYPE_CHECKING
import weakref
from collections import UserDict
import srsly
from .span_group import SpanGroup
if TYPE_CHECKING:
# This lets us add type hints for mypy etc. without causing circular imports
from .doc import Doc # noqa: F401
from .span import Span ... | mit |
SuperDARNCanada/pydmap | test_data.py | 2 | 100457 |
good_rawacf = {
'radar.revision.major' : 1,
'radar.revision.minor' : 17,
'origin.code' : 0,
'origin.time' : "Sat Apr 23 18:01:03 2016",
'origin.command' : "twofsound -fast -xcf 1 -nrang 100 -p7",
'cp' : 3503,
'stid' : 64,
'time.yr' : 2016,
'time.mo' : 4,
'time.dy' : 23,
't... | gpl-3.0 |
gspilio/nova | nova/tests/test_image_utils.py | 16 | 9498 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! 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.or... | apache-2.0 |
vjmac15/Lyilis | lib/discord/mixins.py | 19 | 1505 | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2016 Rapptz
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 u... | gpl-3.0 |
klmitch/nova | nova/api/openstack/compute/views/server_tags.py | 19 | 1156 | # Copyright 2016 Mirantis Inc
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | apache-2.0 |
bnaul/flinchbot | messageparse.py | 1 | 1227 | from bs4 import BeautifulSoup
from argparse import ArgumentParser
# these are pretty arbitrary, but by default we use 3-word chains so anything less isn't useful
MIN_CHARS = 8
MIN_WORDS = 3
# strip everything after these strings: e.g. links, quoted text
STRINGS_TO_FILTER = ['http:', 'Sent at ']
def get_sender(messag... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.