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 |
|---|---|---|---|---|---|
tanium/TaniumOsquery | tools/all_converter.py | 1 | 3086 | import re
import sys
import urllib
from xml.sax.saxutils import escape as xmlescape
QRY_TEMPL="""<query>#!/bin/bash
/usr/bin/osqueryi --csv "select * from %s" | /usr/bin/tail -n +2</query>"""
QRY_TEMPL_DWN="""<query>#!/bin/bash
/usr/local/bin/osqueryi --csv "select * from %s" | /usr/bin/tail -n +2</query>"""
QRY_TEM... | mit |
dcroc16/skunk_works | google_appengine/lib/django-1.4/django/contrib/gis/gdal/prototypes/geom.py | 91 | 4762 | from ctypes import c_char_p, c_double, c_int, c_void_p, POINTER
from django.contrib.gis.gdal.envelope import OGREnvelope
from django.contrib.gis.gdal.libgdal import lgdal, GEOJSON
from django.contrib.gis.gdal.prototypes.errcheck import check_bool, check_envelope
from django.contrib.gis.gdal.prototypes.generation import... | mit |
mm112287/2015cda_g8 | static/Brython3.1.1-20150328-091302/Lib/multiprocessing/dummy/__init__.py | 693 | 4380 | #
# Support for the API of the multiprocessing package using threads
#
# multiprocessing/dummy/__init__.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
... | gpl-3.0 |
ZhangXinNan/tensorflow | tensorflow/contrib/learn/python/learn/trainable.py | 24 | 3584 | # 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 |
farxinu/appinventor-sources | appinventor/misc/splashscreen/splashmanager.py | 60 | 6587 | #!/usr/bin/env python
#
# Simple tool for managing the Splash Screen in MIT App Inventor using
# the Remote API Service
#
# @author Jeffrey I. Schiller <jis@mit.edu>
import os
import sys
import getpass
from getopt import getopt, GetoptError
os.environ['SERVER_SOFTWARE'] = 'MIT SplashScreen Manager 1.0' # Googlism
d... | apache-2.0 |
SebasSBM/django | django/template/defaultfilters.py | 224 | 28536 | """Default variable filters."""
from __future__ import unicode_literals
import random as random_module
import re
import warnings
from decimal import ROUND_HALF_UP, Context, Decimal, InvalidOperation
from functools import wraps
from pprint import pformat
from django.conf import settings
from django.utils import format... | bsd-3-clause |
TripleDogDare/RadioWCSpy | backend/env/lib/python2.7/site-packages/paste/lint.py | 14 | 14999 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
# Also licenced under the Apache License, 2.0: http://opensource.org/licenses/apache2.0.php
# Licensed to PSF under a Contributor Agreement
"""
Middlew... | mit |
kevincwebb/conceptum | conceptum/exam/migrations/0011_auto__del_multiplechoicequestion__del_freeresponsequestion__add_questi.py | 1 | 13999 | # -*- 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):
# Deleting model 'MultipleChoiceQuestion'
db.delete_table(u'exam_multiple... | bsd-3-clause |
whereismyjetpack/ansible | lib/ansible/utils/vars.py | 8 | 5132 | # (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 |
jumping/Diamond | src/collectors/dseopscenter/test/testdseopscenter.py | 31 | 1852 | #!/usr/bin/python
# coding=utf-8
##########################################################################
from test import CollectorTestCase
from test import get_collector_config
from mock import Mock
from mock import patch
from diamond.collector import Collector
from dseopscenter import DseOpsCenterCollector
###... | mit |
wzbozon/scikit-learn | sklearn/feature_selection/tests/test_from_model.py | 244 | 1593 | import numpy as np
import scipy.sparse as sp
from nose.tools import assert_raises, assert_true
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_greater
from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
from sklearn.linear_model import SGD... | bsd-3-clause |
orion-42/numerics-physics-stuff | solar_system.py | 1 | 2094 | import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
from scipy.constants import gravitational_constant as G
# newtonian dynamics of an n body system
def rhs(y, t, *masses):
num_planets = len(masses)
y = y.reshape((num_planets, 2, 3))
ans = y.copy()
for i in range(num_p... | mit |
garethr/appengine-bugs | tests/admin_tests.py | 4 | 2792 | #!/usr/bin/env python
import sys
import os
import unittest
from webtest import TestApp, AppError
from google.appengine.api import urlfetch, mail_stub, apiproxy_stub_map, urlfetch_stub, user_service_stub, datastore_file_stub
from google.appengine.api.memcache import memcache_stub
from google.appengine.api.urlfetch imp... | mit |
akash1808/nova_test_latest | plugins/xenserver/networking/etc/xensource/scripts/novalib.py | 118 | 1264 | #!/usr/bin/env python
# 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-... | apache-2.0 |
ninoxcello/mscs710-project | Python/Python36-32/Tools/scripts/ptags.py | 15 | 1227 | #! /usr/bin/env python3
# ptags
#
# Create a tags file for Python programs, usable with vi.
# Tagged are:
# - functions (even inside other defs or classes)
# - classes
# - filenames
# Warns about files it cannot open.
# No warnings about duplicate tags.
import sys, re, os
tags = [] # Modified global variable!
de... | mit |
marekjm/pake | tests/networktransactions.py | 1 | 4396 | #!/usr/bin/env python3
"""Some tests are duplicated here and in systemtransactions.py
This is because some transactions can be told to act locally *or*
connect to the network.
"""
import unittest
import pake
from tests import helpers, conf
# Test flags
VERBOSE = conf.VERBOSE
SERVER_ENABLED_TESTS = conf.SERVER_E... | gpl-3.0 |
KitKatXperience/platform_external_chromium_org | tools/perf/metrics/histogram_util.py | 23 | 1928 | # 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
def SubtractHistogram(histogram_json, start_histogram_json):
"""Subtracts a previous histogram from a histogram. Both parameters... | bsd-3-clause |
MartynShaw/audacity | lib-src/lv2/sord/waflib/Tools/xlcxx.py | 330 | 1222 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib.Tools import ccroot,ar
from waflib.Configure import conf
@conf
def find_xlcxx(conf):
cxx=conf.find_program(['xlc++_r','xlc++'],var='CXX')
cxx=conf.cmd_to_list(cx... | gpl-2.0 |
csdms/wmt-exe | wmtexe/cmd/slave.py | 1 | 2266 | """Initiate and monitor a task slave for a WMT simulation."""
from __future__ import print_function
import os
import sys
import argparse
from ..slave import Slave
from ..env import WmtEnvironment
class EnsureHttps(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
impo... | mit |
jhawkesworth/ansible | lib/ansible/plugins/terminal/iosxr.py | 36 | 1895 | #
# (c) 2016 Red Hat Inc.
#
# 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 d... | gpl-3.0 |
JianyuWang/nova | nova/scheduler/filters/__init__.py | 120 | 1601 | # Copyright (c) 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 ... | apache-2.0 |
adam111316/SickGear | lib/configobj/__init__.py | 5 | 88196 | # configobj.py
# A config file reader/writer that supports nested sections in config files.
# Copyright (C) 2005-2014:
# (name) : (email)
# Michael Foord: fuzzyman AT voidspace DOT org DOT uk
# Nicola Larosa: nico AT tekNico DOT net
# Rob Dennis: rdennis AT gmail DOT com
# Eli Courtwright: eli AT courtwright DOT org
#... | gpl-3.0 |
pdellaert/ansible | test/units/modules/network/fortios/test_fortios_firewall_central_snat_map.py | 21 | 9415 | # Copyright 2019 Fortinet, Inc.
#
# 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... | gpl-3.0 |
nico401/Penelope | Penelope/tests.py | 1 | 4892 | from django.test import TestCase
from django.contrib.auth.models import User
from Penelope.models import *
username = 'username'
studentusername = 'studentusername'
teacherusername = 'teacherusername'
password = 'password'
coursename = 'coursename'
coursedescription = 'coursedescription'
courseyears = '2012 - 2013'
... | unlicense |
pilou-/ansible | test/units/plugins/connection/test_psrp.py | 26 | 8324 | # -*- coding: utf-8 -*-
# (c) 2018, Jordan Borean <jborean@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import pytest
import sys
from io i... | gpl-3.0 |
ibelem/crosswalk-test-suite | apptools/apptools-android-tests/apptools/manifest_xwalk_permissions.py | 14 | 5140 | #!/usr/bin/env python
#
# Copyright (c) 2016 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | bsd-3-clause |
aragos/tichu-tournament | python/reportlab/graphics/samples/stacked_column.py | 42 | 4238 | #Autogenerated by ReportLab guiedit do not edit
from reportlab.graphics.charts.legends import Legend
from reportlab.graphics.charts.barcharts import VerticalBarChart
from reportlab.graphics.shapes import Drawing, _DrawingEditorMixin, String
from reportlab.graphics.charts.textlabels import Label
from reportlab.graphics.... | mit |
danakj/chromium | native_client_sdk/src/build_tools/tests/parse_dsc_test.py | 31 | 2508 | #!/usr/bin/env python
# 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.
import copy
import datetime
import os
import posixpath
import subprocess
import sys
import unittest
SCRIPT_DIR = os.path.dirname(o... | bsd-3-clause |
Nexenta/cinder | cinder/volume/drivers/datera.py | 5 | 45685 | # Copyright 2016 Datera
# 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 applic... | apache-2.0 |
EzyInsights/log4mongo-python | log4mongo/test/test_handlers.py | 1 | 6198 | from log4mongo.handlers import MongoHandler
from pymongo.errors import PyMongoError
from StringIO import StringIO
import unittest
import logging
import sys
class TestMongoHandler(unittest.TestCase):
host_name = 'localhost'
database_name = 'log4mongo_test'
collection_name = 'logs_test'
def setUp(self):... | bsd-3-clause |
FlorianLudwig/odoo | addons/auth_openid/__init__.py | 443 | 1090 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
NathanBWaters/website | node_modules/node-gyp/gyp/pylib/gyp/common_test.py | 2542 | 1970 | #!/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.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... | mit |
lache/RacingKingLee | monitor/engine.win64/2.74/python/lib/logging/handlers.py | 63 | 55810 | # Copyright 2001-2013 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... | mit |
asadziach/tensorflow | tensorflow/python/training/training_ops.py | 131 | 1046 | # 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 |
tshrinivasan/wiki_women_edit_stats | samskrit/update_json.py | 1 | 3942 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib2
import urllib
import json
import time
import os
#rootPath = os.getcwd() + "/wikiWomensStats/"
#dataPath = rootPath + 'data.json'
fullDataPath = 'data.json'
headers = { 'User-Agent' : 'Womens edit a thon India' }
cmtitle = "वर्गः:महिला-लेखाभियानम् २०१५"
apiUr... | gpl-2.0 |
hainm/scikit-learn | sklearn/utils/multiclass.py | 83 | 12343 |
# Author: Arnaud Joly, Joel Nothman, Hamzeh Alsalhi
#
# License: BSD 3 clause
"""
Multi-class / multi-label utility function
==========================================
"""
from __future__ import division
from collections import Sequence
from itertools import chain
from scipy.sparse import issparse
from scipy.sparse.... | bsd-3-clause |
andreas-schwab/osc | tests/test_package_status.py | 15 | 3061 | import osc.core
import osc.oscerr
import os
from common import OscTestCase
FIXTURES_DIR = os.path.join(os.getcwd(), 'project_package_status_fixtures')
def suite():
import unittest
return unittest.makeSuite(TestPackageStatus)
class TestPackageStatus(OscTestCase):
def _get_fixtures_dir(self):
retur... | gpl-2.0 |
Schwenger/House-Of-Tweets | backend/twitter.py | 2 | 19320 | #!/usr/bin/env python3
from typing import List
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
import tweepy
import mylog
import threading
# If a crashing bug in tweepy happens,
# after how many seconds shall we try again?
RESPAWN_PERIOD = 15
# List of all keys that are allowed to actual... | gpl-3.0 |
ramcn/demo3 | venv/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/timeout.py | 1004 | 9544 | # The default socket timeout, used by httplib to indicate that no timeout was
# specified by the user
from socket import _GLOBAL_DEFAULT_TIMEOUT
import time
from ..exceptions import TimeoutStateError
# A sentinel value to indicate that no timeout was specified by the user in
# urllib3
_Default = object()
def current... | mit |
andela-kndungu/py-mysql2pgsql | mysql2pgsql/lib/mysql_reader.py | 9 | 9445 | from __future__ import with_statement, absolute_import
import re
from contextlib import closing
import MySQLdb
import MySQLdb.cursors
re_column_length = re.compile(r'\((\d+)\)')
re_column_precision = re.compile(r'\((\d+),(\d+)\)')
re_key_1 = re.compile(r'CONSTRAINT `(\w+)` FOREIGN KEY \(`(\w+)`\) REFERENCES `(\w+)`... | mit |
axinging/chromium-crosswalk | third_party/cython/src/Cython/Compiler/CodeGeneration.py | 99 | 1097 | from Cython.Compiler.Visitor import VisitorTransform
from Cython.Compiler.Nodes import StatListNode
class ExtractPxdCode(VisitorTransform):
"""
Finds nodes in a pxd file that should generate code, and
returns them in a StatListNode.
The result is a tuple (StatListNode, ModuleScope), i.e.
everythin... | bsd-3-clause |
armandino/pie | urwid/display_common.py | 3 | 29083 | #!/usr/bin/python
# Urwid common display code
# Copyright (C) 2004-2011 Ian Ward
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or ... | apache-2.0 |
ruchee/vimrc | vimfiles/bundle/vim-python/submodules/pylint/pylint/extensions/comparetozero.py | 1 | 2593 | # Copyright (c) 2016 Alexander Todorov <atodorov@otb.bg>
# Copyright (c) 2017-2018, 2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2019, 2021 Pierre Sassoulas <pierre.sassoulas@gmail.com>
# Copyright (c) 2020 hippo91 <guillaume.peillex@gmail.com>
# Copyright (c) 2020 Anthony Sottile <asottile@umich.edu>
# Co... | mit |
huggingface/transformers | src/transformers/models/dpr/modeling_tf_dpr.py | 2 | 37860 | # coding=utf-8
# Copyright 2018 DPR Authors, The Hugging Face Team.
#
# 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 |
benjaminjkraft/django | tests/http_utils/tests.py | 304 | 2247 | from __future__ import unicode_literals
import gzip
import io
from django.http import HttpRequest, HttpResponse, StreamingHttpResponse
from django.http.utils import conditional_content_removal
from django.test import SimpleTestCase
# based on Python 3.3's gzip.compress
def gzip_compress(data):
buf = io.BytesIO(... | bsd-3-clause |
Bashar/django | django/template/loader.py | 69 | 7620 | # Wrapper for loading templates from storage of some sort (e.g. filesystem, database).
#
# This uses the TEMPLATE_LOADERS setting, which is a list of loaders to use.
# Each loader is expected to have this interface:
#
# callable(name, dirs=[])
#
# name is the template name.
# dirs is an optional list of directories ... | bsd-3-clause |
nju520/youtube-dl | youtube_dl/extractor/heise.py | 176 | 2864 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
parse_iso8601,
)
class HeiseIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://(?:www\.)?heise\.de/video/artikel/
.+?(?P<id>[0-9]+)\.html(?:$|[?#]... | unlicense |
squadran2003/PYTHON-DIRECTORY-WATCHER | lib/python3.5/site-packages/pip/wheel.py | 187 | 30186 | """
Support for installing and building the "wheel" binary package format.
"""
from __future__ import absolute_import
import compileall
import csv
import errno
import functools
import hashlib
import logging
import os
import os.path
import re
import shutil
import stat
import sys
import tempfile
import warnings
from ba... | mit |
zdary/intellij-community | python/helpers/pydev/_pydev_bundle/pydev_imports.py | 26 | 1445 | from _pydevd_bundle.pydevd_constants import USE_LIB_COPY, izip
try:
try:
if USE_LIB_COPY:
from _pydev_imps._pydev_saved_modules import xmlrpclib
else:
import xmlrpclib
except ImportError:
import xmlrpc.client as xmlrpclib
except ImportError:
from _pydev_imps... | apache-2.0 |
marissazhou/django | tests/generic_views/models.py | 382 | 1631 | from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import QuerySet
from django.db.models.manager import BaseManager
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Artist(models.Model):
name = models.CharField(max_length... | bsd-3-clause |
vadimtk/chrome4sdp | chrome/common/extensions/docs/server2/instance_servlet.py | 36 | 3741 | # 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.
from branch_utility import BranchUtility
from commit_tracker import CommitTracker
from compiled_file_system import CompiledFileSystem
from environment import... | bsd-3-clause |
wuby986/Sixty-4Stroke-kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | 4653 | 3596 | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... | gpl-2.0 |
ShaningSoul/pi-qmc | python/piworld/DensityView.py | 2 | 6360 | #-*- coding: utf-8 -*-
import math,scipy,numpy,tables,pylab
from scipy.fftpack import *
from scipy.optimize import leastsq
import tables, pitools
from pitools import Unit
from EstimatorView import *
class DensityView(EstimatorView):
def __init__(self, estimatorNode, data, parent=None):
EstimatorView.__init__(s... | gpl-2.0 |
sigmavirus24/glance | glance/tests/functional/store_utils.py | 5 | 2724 | # Copyright 2011 OpenStack Foundation
# Copyright 2012 Red Hat, Inc
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/... | apache-2.0 |
pauloschilling/sentry | src/sentry/api/endpoints/team_details.py | 1 | 3071 | from __future__ import absolute_import
import logging
from rest_framework import serializers, status
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.team import TeamEndpoint
from sentry.api.decorators import sudo_required
from sentry.api.serializers import se... | bsd-3-clause |
chloerh/avocado-vt | virttest/libvirt_xml/devices/hostdev.py | 5 | 8926 | """
hostdev device support class(es)
http://libvirt.org/formatdomain.html#elementsHostDev
"""
from virttest.libvirt_xml.devices import base
from virttest.libvirt_xml import accessors
class Hostdev(base.TypedDeviceBase):
__slots__ = ('type', 'mode', 'managed', 'sgio', 'rawio',
'source', 'boot_or... | gpl-2.0 |
erikr/howtostoreiosdata | howtostoreiosdata/settings/base.py | 1 | 3929 | # Django settings for howtostoreiosdata project.
import os
from django.core.exceptions import ImproperlyConfigured
from unipath import Path
PROJECT_DIR = Path(__file__).ancestor(3)
DEBUG = False
TEMPLATE_DEBUG = False
ADMINS = (
('name', 'email'),
)
MANAGERS = ADMINS
TIME_ZONE = 'UTC'
LANGUAGE_CODE = 'nl-NL'
U... | mit |
CourseTalk/edx-platform | lms/djangoapps/instructor/views/api_urls.py | 21 | 7805 | """
Instructor API endpoint urls.
"""
from django.conf.urls import patterns, url
urlpatterns = patterns(
'',
url(r'^students_update_enrollment$',
'instructor.views.api.students_update_enrollment', name="students_update_enrollment"),
url(r'^register_and_enroll_students$',
'instructor.views... | agpl-3.0 |
tensorflow/tensorflow | tensorflow/python/eager/execute.py | 6 | 11697 | # 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 |
adalke/rdkit | rdkit/sping/WX/pidWX.py | 4 | 12695 | # pidWX.py
# base on piddleWX.py -- a wxPython backend for PIDDLE
# Copyright (c) 2000 Paul & Kevin Jacobs
#
# 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, or (at your ... | bsd-3-clause |
kagayakidan/scikit-learn | sklearn/cluster/tests/test_mean_shift.py | 150 | 3651 | """
Testing for mean shift clustering methods
"""
import numpy as np
import warnings
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import asser... | bsd-3-clause |
foufou55/Sick-Beard | lib/guessit/transfo/split_path_components.py | 150 | 1292 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2012 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
timsnyder/bokeh | tests/integration/widgets/tables/test_copy_paste.py | 1 | 5071 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | bsd-3-clause |
Lyrositor/moul-scripts | Python/system/sre_compile.py | 156 | 16427 | #
# Secret Labs' Regular Expression Engine
#
# convert template to internal format
#
# Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
import _sre, sys
import sre_parse
from sre_constants impo... | gpl-3.0 |
Liyier/learning_log | env/Lib/shutil.py | 15 | 39863 | """Utility functions for copying and archiving files and directory trees.
XXX The functions here don't copy the resource fork or other metadata on Mac.
"""
import os
import sys
import stat
import fnmatch
import collections
import errno
import tarfile
try:
import bz2
del bz2
_BZ2_SUPPORTED = True
except ... | mit |
Tatsh/youtube-dl | youtube_dl/extractor/bigflix.py | 28 | 2334 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_b64decode,
compat_urllib_parse_unquote,
)
class BigflixIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?bigflix\.com/.+/(?P<id>[0-9]+)'
_TESTS = [{
# 2 format... | unlicense |
Ohm-Coin/Ohm | contrib/bitrpc/bitrpc.py | 2348 | 7835 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
else:
access = Ser... | mit |
elssar/calibre | src/calibre/gui2/actions/embed.py | 8 | 5073 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
from functools import partial
from PyQt5.Qt import QTimer, QProgressDialog,... | gpl-3.0 |
arnavd96/Cinemiezer | myvenv/lib/python3.4/site-packages/numpy/distutils/lib2def.py | 193 | 3512 | from __future__ import division, absolute_import, print_function
import re
import sys
import os
import subprocess
__doc__ = """This module generates a DEF file from the symbols in
an MSVC-compiled DLL import library. It correctly discriminates between
data and functions. The data is collected from the output of the... | mit |
Antiun/purchase-workflow | framework_agreement/model/portfolio.py | 20 | 1978 | # Author: Leonardo Pistone
# Copyright 2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any la... | agpl-3.0 |
Suor/flaws | tests/test_scopes.py | 1 | 2611 | import ast
import textwrap
from flaws.asttools import get_body_ast
from flaws.scopes import fill_scopes
def test_refer():
@_debug_scope
def tree():
x = 1
def f():
return x
assert _dump(tree.scope) == {
'names': ['f', 'x'],
'children': [{
'name': 'F... | bsd-2-clause |
nwjs/chromium.src | third_party/blink/web_tests/http/tests/websocket/zero-length-text_wsh.py | 3 | 1213 | from mod_pywebsocket import common
from mod_pywebsocket import stream
def web_socket_do_extra_handshake(request):
pass
def web_socket_transfer_data(request):
payload1 = 'This first text should be received.'
payload2 = 'This second text '
payload3 = 'should be received, too.'
# send ''
reque... | bsd-3-clause |
google-research/google-research | graph_compression/compression_lib/simhash_compression_op.py | 1 | 51594 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 |
ionrock/designate | designate/cmd/api.py | 6 | 1342 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Author: Kiall Mac Innes <kiall@hp.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/L... | apache-2.0 |
aglitke/vdsm | tests/lvmTests.py | 3 | 1409 | #
# Copyright 2012 Red Hat, Inc.
#
# 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 th... | gpl-2.0 |
azogue/pyoutlet | pyoutlet/__main__.py | 1 | 1415 | # -*- coding: utf-8 -*-
"""
Minimal controler for 433Mhz RF Wireless Power Outlets
FROM: http://timleland.com/wireless-power-outlets/
https://github.com/timleland/rfoutlet
"""
import argparse
from pyoutlet import Switcher
def _args_parser():
"""
Argument parser
"""
p = argparse.ArgumentPar... | mit |
abantam/pmtud | .waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Task.py | 148 | 18375 | #! /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 os,shutil,re,tempfile
from waflib import Utils,Logs,Errors
NOT_RUN=0
MISSING=1
CRASHED=2
EXCEPTION=3
SKIPPED=8
SUCCESS=9
ASK_LATER=-1
SKIP_ME=-2
RUN_ME=-3
COMPILE_TEMPL... | gpl-2.0 |
albertomurillo/ansible | lib/ansible/modules/cloud/azure/azure_rm_azurefirewall.py | 2 | 24662 | #!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski, (@zikalino), Jurijs Fadejevs (@needgithubid)
#
# 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_vers... | gpl-3.0 |
GeekTrainer/Flask | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/pip/_vendor/requests/packages/urllib3/fields.py | 294 | 5976 | # urllib3/fields.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import email.utils
import mimetypes
from .packages import six
def guess_content_type(filename... | apache-2.0 |
batxes/4Cin | SHH_WT_models/SHH_WT_models_final_output_0.1_-0.1_11000/SHH_WT_models30093.py | 2 | 17562 | import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | gpl-3.0 |
Th3BFG/newsletter | nlservice/models.py | 1 | 1089 | import datetime
from nlservice import db
from flask import jsonify
class Subscriber(db.Model):
id = db.Column(db.Integer, primary_key = True)
email = db.Column(db.String(120), index = True, unique = True)
datesubbed = db.Column(db.String(12), index = True, unique = False)
# Add a user to the database
@staticmeth... | mit |
garrettcap/Bulletproof-Backup | wx/lib/floatbar.py | 9 | 10748 | #----------------------------------------------------------------------------
# Name: floatbar.py
# Purpose: Contains floating toolbar class
#
# Author: Bryn Keller
#
# Created: 10/4/99
#----------------------------------------------------------------------------
# 12/02/2003 - Jeff Grimmett (gr... | gpl-2.0 |
ckirby/django | django/db/backends/mysql/base.py | 323 | 15548 | """
MySQL database backend for Django.
Requires mysqlclient: https://pypi.python.org/pypi/mysqlclient/
MySQLdb is supported for Python 2 only: http://sourceforge.net/projects/mysql-python
"""
from __future__ import unicode_literals
import datetime
import re
import sys
import warnings
from django.conf import settings... | bsd-3-clause |
guorendong/iridium-browser-ubuntu | tools/telemetry/telemetry/internal/actions/media_action.py | 32 | 1744 | # 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.
"""Common media action functions."""
import logging
import os
from telemetry.core import util
from telemetry.internal.actions import page_action
class Me... | bsd-3-clause |
yfried/ansible | lib/ansible/modules/cloud/google/gcp_backend_service.py | 18 | 12605 | #!/usr/bin/python
# Copyright 2017 Google 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
airbnb/airflow | tests/providers/google/cloud/operators/test_compute_system.py | 11 | 2421 | #
# 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 |
agustinhenze/webassets.debian | tests/test_loaders.py | 3 | 9136 | from __future__ import with_statement
import sys
from nose.tools import assert_raises, assert_true
import textwrap
from webassets.env import Environment
from webassets.filter import Filter, get_filter
from webassets.utils import StringIO
from webassets.bundle import Bundle
from webassets.loaders import PythonLoader, YA... | bsd-2-clause |
zerobatu/edx-platform | lms/djangoapps/ccx/tests/test_tasks.py | 23 | 4756 | """
Tests for celery tasks defined in tasks module
"""
from mock_django import mock_signal_receiver
from ccx.tests.factories import ( # pylint: disable=import-error
CcxFactory,
)
from student.roles import CourseCcxCoachRole # pylint: disable=import-error
from student.tests.factories import ( # pylint: disable=... | agpl-3.0 |
wemanuel/smry | server-auth/ls/google-cloud-sdk/lib/google/apputils/resources.py | 25 | 2122 | #!/usr/bin/env python
# Copyright 2010 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 |
lmazuel/ansible | lib/ansible/plugins/terminal/eos.py | 64 | 2882 | #
# (c) 2016 Red Hat Inc.
#
# 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 d... | gpl-3.0 |
juanprietob/ExtractMSLesion | py/sgd_fit_ms_wm.py | 1 | 5045 | from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
import tarfile
from IPython.display import display, Image
from scipy import ndimage
from sklearn import neighbors, linear_model
from six.moves.urllib.request import urlretrieve
from six.moves import cPickle as ... | apache-2.0 |
andreivasiliu2211/mraa | tests/mock/gpio_checks_edge.py | 21 | 2240 | #!/usr/bin/env python
# Author: Alex Tereschenko <alext.mkrs@gmail.com>
# Copyright (c) 2016 Alex Tereschenko <alext.mkrs@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... | mit |
dgouldin/myspaceid-python-sdk | src/openid/dh.py | 168 | 1608 | from openid import cryptutil
from openid import oidutil
def strxor(x, y):
if len(x) != len(y):
raise ValueError('Inputs to strxor must have the same length')
xor = lambda (a, b): chr(ord(a) ^ ord(b))
return "".join(map(xor, zip(x, y)))
class DiffieHellman(object):
DEFAULT_MOD = 15517289818147... | apache-2.0 |
saddingtonbaynes/rez | src/rez/vendor/unittest2/result.py | 9 | 6155 | """Test result object"""
import sys
import traceback
import unittest
from StringIO import StringIO
from rez.vendor.unittest2 import util
from rez.vendor.unittest2.compatibility import wraps
__unittest = True
def failfast(method):
@wraps(method)
def inner(self, *args, **kw):
if getattr(self, 'failfa... | gpl-3.0 |
urlist/devcharm | devcharm/settings.py | 1 | 5705 | """
Django settings for devcharm project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
i... | gpl-3.0 |
takeshineshiro/django | tests/m2m_through_regress/models.py | 273 | 2771 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# Forward declared intermediate model
@python_2_unicode_compatible
class Membership(models.Model):
person = models.ForeignKey('Person', mo... | bsd-3-clause |
patcon/open-cabinet | venv/lib/python2.7/site-packages/django/core/handlers/wsgi.py | 339 | 9181 | from __future__ import unicode_literals
import cgi
import codecs
import logging
import sys
from io import BytesIO
from threading import Lock
from django import http
from django.conf import settings
from django.core import signals
from django.core.handlers import base
from django.core.urlresolvers import set_script_pr... | mit |
AgostonSzepessy/servo | tests/wpt/web-platform-tests/tools/pytest/doc/en/genapi.py | 203 | 1131 | import textwrap
import inspect
class Writer:
def __init__(self, clsname):
self.clsname = clsname
def __enter__(self):
self.file = open("%s.api" % self.clsname, "w")
return self
def __exit__(self, *args):
self.file.close()
print "wrote", self.file.name
def line... | mpl-2.0 |
frreiss/tensorflow-fred | tensorflow/lite/testing/op_tests/ceil.py | 17 | 1945 | # Copyright 2019 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 |
NWine/trading-with-python | lib/cboe.py | 76 | 4433 | # -*- coding: utf-8 -*-
"""
toolset working with cboe data
@author: Jev Kuznetsov
Licence: BSD
"""
from datetime import datetime, date
import urllib2
from pandas import DataFrame, Index
from pandas.core import datetools
import numpy as np
import pandas as pd
def monthCode(month):
"""
perfo... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.