repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
KaranToor/MA450 | google-cloud-sdk/.install/.backup/lib/surface/compute/config_ssh.py | 2 | 10843 | # 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 ag... | apache-2.0 |
akatsoulas/mozillians | mozillians/users/migrations/0026_auto_20171016_0340.py | 3 | 31823 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0025_auto_20171011_0859'),
]
operations = [
migrations.AlterField(
model_name='language',
n... | bsd-3-clause |
adamjmcgrath/glancydesign | src/django-nonrel/tests/regressiontests/model_fields/tests.py | 50 | 13789 | import datetime
from decimal import Decimal
from django import test
from django import forms
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models.fields.files import FieldFile
from django.utils import unittest
from models import Foo, Bar, Whiz, BigD, BigS, Image, BigIn... | bsd-3-clause |
googleapis/python-channel | google/cloud/channel_v1/services/cloud_channel_service/transports/base.py | 1 | 22245 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
mogoweb/webkit_for_android5.1 | skia_old/tools/test_rendering.py | 67 | 4116 | '''
Compares the rendererings of serialized SkPictures to expected result.
Copyright 2012 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
'''
# common Python modules
import os
import optparse
import sys
import shutil
import tempfile
USAGE_STRING = 'Usage:... | apache-2.0 |
yongshengwang/hue | desktop/core/ext-py/pycrypto-2.6.1/build/lib.linux-x86_64-2.7/Crypto/Hash/MD2.py | 124 | 2734 | # -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... | apache-2.0 |
nocarryr/plotly-system-stats | plotly_system_stats/plotting/plot_config.py | 1 | 1381 | import plotly.tools as pl_tools
from plotly_system_stats.config import config
def build_config():
d = {}
d = dict(
all_stream_ids=[],
streams={},
figures={},
plots={},
)
config.set('plotly', d)
if config.get('plotly') is None:
build_config()
class... | gpl-2.0 |
heyavery/lopenr | venv/lib/python2.7/site-packages/django/contrib/postgres/fields/ranges.py | 124 | 5609 | import json
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange, Range
from django.contrib.postgres import forms, lookups
from django.db import models
from django.utils import six
from .utils import AttributeSetter
__all__ = [
'RangeField', 'IntegerRangeField', 'BigIntegerRangeField',
'Floa... | mit |
djfan/wifind | pipeline/v1.0/etl.py | 1 | 4488 | import csv
import configparser
import logging
from builtins import range
from carto.auth import APIKeyAuthClient
from carto.sql import SQLClient
from carto.sql import BatchSQLClient
logger = logging.getLogger('carto-etl')
config = configparser.RawConfigParser()
config.read("etl.conf")
CARTO_BASE_URL = config.get('... | mit |
adamginsburg/APEX_CMZ_H2CO | plot_codes/tmap_figure.py | 2 | 12670 | import pylab as pl
import numpy as np
import aplpy
import os
import copy
from astropy import log
from paths import h2copath, figurepath
import paths
import matplotlib
from scipy import stats as ss
from astropy.io import fits
matplotlib.rc_file(paths.pcpath('pubfiguresrc'))
pl.ioff()
# Close these figures so we can rem... | bsd-3-clause |
philipz/PyCV-time | experiments/augmented_reality/AR_realtime.py | 3 | 1947 | """
usage: >>>python AR_realtime.py
This program tries to detect chessboard from camera image
and draw axis in real-time
In case the camera matrix file "camera_parameters.npz" does not exist,
run calibration example to generate one
"""
import cv2
import numpy as np
import glob
from time import sleep
# Load previousl... | mit |
hehongliang/tensorflow | tensorflow/python/util/all_util.py | 128 | 4709 | # 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 |
asiersarasua/QGIS | python/plugins/db_manager/db_plugins/postgis/plugins/__init__.py | 68 | 1507 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | gpl-2.0 |
drammock/mne-python | mne/viz/backends/_abstract.py | 4 | 24939 | """ABCs."""
# Authors: Guillaume Favelier <guillaume.favelier@gmail.com
# Eric Larson <larson.eric.d@gmail.com>
#
# License: Simplified BSD
from abc import ABC, abstractmethod, abstractclassmethod
from contextlib import nullcontext
import warnings
from ..utils import tight_layout
class _AbstractRenderer(A... | bsd-3-clause |
yhoshino11/pytest_example | .tox/py27/lib/python2.7/site-packages/pip/_vendor/requests/models.py | 151 | 28156 | # -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import collections
import datetime
from io import BytesIO, UnsupportedOperation
from .hooks import default_hooks
from .structures import CaseInsensitiveDict
from .auth import HTTPBasicAuth
... | mit |
jhg/django | django/contrib/contenttypes/fields.py | 73 | 22873 | from __future__ import unicode_literals
from collections import defaultdict
from django.contrib.contenttypes.models import ContentType
from django.core import checks
from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist
from django.db import DEFAULT_DB_ALIAS, connection, models, router, transaction... | bsd-3-clause |
jmaurice/letsencrypt | letsencrypt/tests/cli_test.py | 14 | 6711 | """Tests for letsencrypt.cli."""
import itertools
import os
import shutil
import traceback
import tempfile
import unittest
import mock
from letsencrypt import account
from letsencrypt import configuration
from letsencrypt import errors
class CLITest(unittest.TestCase):
"""Tests for different commands."""
d... | apache-2.0 |
minhphung171093/OpenERP_V8 | openerp/addons/stock/wizard/stock_move.py | 242 | 4332 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
lexus24/w16b_test | static/Brython3.1.1-20150328-091302/Lib/xml/etree/ElementInclude.py | 784 | 5146 | #
# ElementTree
# $Id: ElementInclude.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xinclude support for element trees
#
# history:
# 2003-08-15 fl created
# 2003-11-14 fl fixed default loader
#
# Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware... | agpl-3.0 |
evilhero/mylar | mylar/importer.py | 1 | 80815 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of Mylar.
#
# Mylar 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 vers... | gpl-3.0 |
undoware/neutron-drive | google_appengine/google/appengine/ext/datastore_admin/remote_api_put_stub.py | 5 | 9290 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | bsd-3-clause |
senttech/OctoPrint | src/octoprint/util/jinja.py | 5 | 6458 | # coding=utf-8
from __future__ import absolute_import, division, print_function
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License"
import logging
import os
try:
from os import... | agpl-3.0 |
jhrozek/samba-ldb-mdb | buildtools/wafsamba/samba_bundled.py | 19 | 8528 | # functions to support bundled libraries
from Configure import conf
import sys, Logs
from samba_utils import *
def PRIVATE_NAME(bld, name, private_extension, private_library):
'''possibly rename a library to include a bundled extension'''
if not private_library:
return name
# we now use the same... | gpl-3.0 |
HonzaKral/django | tests/gis_tests/geo3d/tests.py | 19 | 17482 | from __future__ import unicode_literals
import os
import re
from unittest import skipUnless
from django.contrib.gis.db.models import Extent3D, Union
from django.contrib.gis.db.models.functions import (
AsGeoJSON, AsKML, Length, Perimeter, Scale, Translate,
)
from django.contrib.gis.gdal import HAS_GDAL
from djang... | bsd-3-clause |
wolverineav/horizon | openstack_dashboard/dashboards/project/stacks/sro.py | 92 | 1632 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
arista-eosplus/ansible | test/units/plugins/lookup/test_lastpass.py | 153 | 6918 | # (c)2016 Andrew Zenk <azenk@umn.edu>
#
# 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 |
Fedik/gramps | gramps/plugins/view/mediaview.py | 4 | 19422 | # Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2001-2006 Donald N. Allingham
# Copyright (C) 2008 Gary Burton
# Copyright (C) 2010 Nick Hall
# Copyright (C) 2011 Tim G L Lyons
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU G... | gpl-2.0 |
wattlebird/pystruct | pystruct/models/chain_crf.py | 5 | 2922 | import numpy as np
from .graph_crf import GraphCRF
def make_chain_edges(x):
# this can be optimized sooooo much!
inds = np.arange(x.shape[0])
edges = np.concatenate([inds[:-1, np.newaxis], inds[1:, np.newaxis]],
axis=1)
return edges
class ChainCRF(GraphCRF):
"""Linear... | bsd-2-clause |
joshmoore/zeroc-ice | py/test/Ice/info/Client.py | 1 | 1142 | #!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... | gpl-2.0 |
martynovp/edx-platform | lms/djangoapps/lti_provider/tests/test_views.py | 46 | 6912 | """
Tests for the LTI provider views
"""
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.client import RequestFactory
from mock import patch, MagicMock
from courseware.testutils import RenderXBlockTestMixin
from lti_provider import views, models
from lti_provider.signatu... | agpl-3.0 |
google/ehr-predictions | ehr_prediction_modeling/utils/label_utils.py | 1 | 2694 | # coding=utf-8
# Copyright 2020 Google Health Research.
#
# 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 |
heromod/migrid | state/sss_home/MiG-SSS/mig_xsss.py | 1 | 1992 | #!/usr/bin/env python
import os
import time
MiG_DIR = "~/MiG-SSS"
G_XSCREENSAVER_COMMAND = "/usr/X11R6/bin/xscreensaver-command -watch"
G_GPIDFILE = "/tmp/mig_xsss_job.gpid"
# Returns Group ID of running job
def getRunningGPID( param_sGPIDFile ):
iGPID = -1
if ( os.path.isfile( param_sGPIDFile ) ):
input = o... | gpl-2.0 |
soscoin-project/Soscoin | qa/rpc-tests/bip9-softforks.py | 37 | 10009 | #!/usr/bin/env python3
# Copyright (c) 2015 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 test_framework.blockstore import BlockStore
from test_framework.test_framework import ComparisonTestFrame... | mit |
bxshi/gem5 | ext/ply/test/yacc_nop.py | 174 | 1548 | # -----------------------------------------------------------------------------
# yacc_nop.py
#
# Possible grammar rule defined without p_ prefix
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from cal... | bsd-3-clause |
Weihonghao/ECM | Vpy34/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/estimators/regression_test.py | 27 | 1728 | # 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... | agpl-3.0 |
RPGroup-PBoC/gist_pboc_2017 | code/inclass/phase_portrait_in_class.py | 1 | 1286 | # Duhhhh
import numpy as np
import matplotlib.pyplot as plt
import seaborn
plt.close('all')
# Define the parameters
r = 20 # the production rate
gamma = 1 / 30 # the degradation rate
k = 200 # in units of concentration
max_R = 1000 # maximum number of R1 and R2
R1 = np.linspace(0, max_R, 500)
R2 = np.linspace(0, m... | mit |
hachreak/zenodo | tests/unit/default/test_zenodo.py | 9 | 1167 | # -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# Copyright (C) 2015 CERN.
#
# Zenodo 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 v... | gpl-2.0 |
frederikhermans/pyfftw-arm | pyfftw/interfaces/__init__.py | 3 | 9789 | #!/usr/bin/env python
'''The :mod:`pyfftw.interfaces` package provides interfaces to :mod:`pyfftw`
that implement the API of other, more commonly used FFT libraries;
specifically :mod:`numpy.fft` and :mod:`scipy.fftpack`. The
intention is to satisfy two clear use cases:
1. Simple, clean and well established interface... | bsd-3-clause |
rmbq/caf_msm-3.10 | tools/perf/tests/attr.py | 3174 | 9441 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | gpl-2.0 |
MoisesTedeschi/python | Scripts-Python/Modulos-Diversos/deteccao-de-faces-com-python-e-opencv/Lib/site-packages/pip/_vendor/html5lib/__init__.py | 56 | 1162 | """
HTML parsing library based on the `WHATWG HTML specification
<https://whatwg.org/html>`_. The parser is designed to be compatible with
existing HTML found in the wild and implements well-defined error recovery that
is largely compatible with modern desktop web browsers.
Example usage::
from pip._vendor import... | gpl-3.0 |
louyihua/edx-platform | cms/djangoapps/contentstore/management/commands/edit_course_tabs.py | 209 | 4121 | ###
### Script for editing the course's tabs
###
#
# Run it this way:
# ./manage.py cms --settings dev edit_course_tabs --course Stanford/CS99/2013_spring
#
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from .prompt import query_yes_no
from courseware.courses imp... | agpl-3.0 |
NINAnor/QGIS | python/plugins/processing/gui/AlgorithmExecutor.py | 11 | 3827 | # -*- coding: utf-8 -*-
"""
***************************************************************************
AlgorithmExecutor.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*********************... | gpl-2.0 |
HwisooSo/gemV-update | src/arch/x86/isa/insts/x87/control/save_and_restore_x87_environment.py | 25 | 3595 | # Copyright (c) 2013 Andreas Sandberg
# 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 fol... | bsd-3-clause |
jlcarmic/producthunt_simulator | venv/lib/python2.7/site-packages/scipy/weave/tests/test_scxx_sequence.py | 91 | 13199 | """ Test refcounting and behavior of SCXX.
"""
from __future__ import absolute_import, print_function
import time
import sys
from numpy.testing import (TestCase, assert_, assert_raises,
run_module_suite)
from scipy.weave import inline_tools
from weave_test_utils import debug_print, dec
... | mit |
wchan/tensorflow | tensorflow/python/summary/impl/gcs_file_loader_test.py | 13 | 2679 | # 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 |
freedesktop-unofficial-mirror/gstreamer__sdk__cerbero | cerbero/config.py | 3 | 20429 | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | lgpl-2.1 |
blindroot/django | tests/pagination/tests.py | 15 | 13588 | from __future__ import unicode_literals
import unittest
from datetime import datetime
from django.core.paginator import (
EmptyPage, InvalidPage, PageNotAnInteger, Paginator,
)
from django.test import TestCase
from django.utils import six
from .custom import ValidAdjacentNumsPaginator
from .models import Article... | bsd-3-clause |
ppmt/Crust | flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py | 156 | 9311 | from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError, InsecurePlatformWarning
SSLContext = None
HAS_SNI = False
create_default_context = None
import errno
import ssl
import warnings
try: # Test for SSL features
from ssl import wrap_socket, CERT_NONE, ... | gpl-2.0 |
beswarm/django-allauth | allauth/socialaccount/providers/odnoklassniki/views.py | 62 | 2285 | import requests
from hashlib import md5
from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter,
OAuth2LoginView,
OAuth2CallbackView)
from .provider import OdnoklassnikiProvider
USER_FI... | mit |
brien-crean/recipe-book2 | node_modules/protractor/node_modules/jasmine/node_modules/jasmine-core/setup.py | 191 | 1983 | from setuptools import setup, find_packages, os
import json
with open('package.json') as packageFile:
version = json.load(packageFile)['version']
setup(
name="jasmine-core",
version=version,
url="http://pivotal.github.io/jasmine/",
author="Pivotal Labs",
author_email="jasmine-js@googlegroups.com... | mit |
drawks/ansible | test/units/modules/source_control/test_bitbucket_access_key.py | 37 | 13671 | from ansible.module_utils.source_control.bitbucket import BitbucketHelper
from ansible.modules.source_control.bitbucket import bitbucket_access_key
from units.compat import unittest
from units.compat.mock import patch
from units.modules.utils import AnsibleFailJson, AnsibleExitJson, ModuleTestCase, set_module_args
cl... | gpl-3.0 |
lincolnloop/django-jsonit | jsonit/encoder.py | 1 | 2054 | import datetime
import json
from django.conf import settings
from django.contrib.messages.storage.base import Message
from django.utils.functional import Promise
from django.utils import six
def encode_message(message):
return {'class': message.tags, 'message': message.message}
class JsonitEncoder(json.JSONEnc... | bsd-3-clause |
PsychoTV/PsychoTeam.repository | plugin.video.specto/resources/lib/libraries/f4mproxy/F4mProxy.py | 56 | 16609 | """
XBMCLocalProxy 0.1
Copyright 2011 Torben Gerkensmeyer
Modified for F4M format by Shani
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 ... | gpl-2.0 |
adamjmcgrath/glancydesign | src/django-nonrel/django/views/generic/list_detail.py | 229 | 5577 | from django.template import loader, RequestContext
from django.http import Http404, HttpResponse
from django.core.xheaders import populate_xheaders
from django.core.paginator import Paginator, InvalidPage
from django.core.exceptions import ObjectDoesNotExist
import warnings
warnings.warn(
'Function-based generic v... | bsd-3-clause |
pselle/calibre | src/odf/grammar.py | 92 | 200191 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2010 Søren Roug, European Environment Agency
#
# 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 (at you... | gpl-3.0 |
Prakhash/security-tools | external/django-DefectDojo-1.2.1/tests/dependency_check_unit_tests.py | 4 | 16953 | import sys
sys.path.append('..')
from dojo.tools.dependencycheck.parser import DependencyCheckParser
from defusedxml import ElementTree
from dojo.models import Finding
from dojo.models import Test
import unittest
import csv
import StringIO
class TestFile(object):
def read(self):
return self.content
d... | apache-2.0 |
Mlieou/lXXtcode | leetcode/python/ex_631.py | 3 | 1437 | class Excel(object):
def __init__(self, H, W):
"""
:type H: int
:type W: str
"""
self.table = [[{'v': 0, 'sum': None} for _ in range(ord(W) - 64)] for __ in range(H)]
def set(self, r, c, v):
"""
:type r: int
:type c: str
:type v: int
... | mit |
stplaydog/OPTKIT | scripts/process_data_pattern.py | 1 | 3246 | #
# Copy right YMSys, 2015,2016 Zhaoming Yin
#
# @brief 1) This script do some sanity check of the data, and remove the
# corrupted data;
# 2) This script separate difffernt crime types.
#
# MODIFIED (MM/DD/YY)
# stplaydog 08/24/16 - Stats calculation
# stplaydog 08/06/16 - Additio... | gpl-3.0 |
OpenMined/PySyft | packages/grid/apps/worker/src/main/routes/data_centric/datasets/routes.py | 2 | 3707 | # stdlib
from json import dumps
from json import loads
# third party
from flask import Response
from flask import request
from main.core.task_handler import route_logic
from main.core.task_handler import task_handler
from syft.core.node.common.service.repr_service import ReprMessage
from syft.grid.messages.dataset_mes... | apache-2.0 |
FrontSide/Sizun | sizun/controllers/inspectors/inspection.py | 1 | 5266 |
"""
Sizun
MIT License
(C) 2015 David Rieger
"""
from abc import ABCMeta
from enum import IntEnum, unique
from sizun.controllers.aghandler import AGHandler
from sizun.controllers.pmdhandler import PMDHandler
from sizun.controllers.syntaxhandler import SyntaxHandler
from sizun.controllers.linegrabber import LineGrabber... | mit |
Smarsh/django | django/contrib/gis/tests/test_geoip.py | 30 | 4253 | import os, unittest
from django.db import settings
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.utils import GeoIP, GeoIPException
# Note: Requires use of both the GeoIP country and city datasets.
# The GEOIP_DATA path should be the only setting set (the directory
# should contain links or ... | bsd-3-clause |
zhanqxun/cv_fish | pythonwin/pywin/framework/editor/frame.py | 5 | 3175 | # frame.py - The MDI frame window for an editor.
import pywin.framework.window
import win32ui
import win32con
import afxres
import ModuleBrowser
class EditorFrame(pywin.framework.window.MDIChildWnd):
def OnCreateClient(self, cp, context):
# Create the default view as specified by the template ... | apache-2.0 |
willingc/oh-mainline | vendor/packages/requests/requests/__init__.py | 412 | 1861 | # -*- coding: utf-8 -*-
# __
# /__) _ _ _ _ _/ _
# / ( (- (/ (/ (- _) / _)
# /
"""
requests HTTP library
~~~~~~~~~~~~~~~~~~~~~
Requests is an HTTP library, written in Python, for human beings. Basic GET
usage:
>>> import requests
>>> r = requests.get('https://www.python.org')
>>> ... | agpl-3.0 |
franekp/ankidict | ankidict/thirdparty/bdb.py | 144 | 21714 | """Debugger basics"""
import fnmatch
import sys
import os
import types
__all__ = ["BdbQuit","Bdb","Breakpoint"]
class BdbQuit(Exception):
"""Exception to give up completely"""
class Bdb:
"""Generic Python debugger base class.
This class takes care of details of the trace facility;
a derived class... | agpl-3.0 |
sagar30051991/ozsmart-erp | erpnext/accounts/report/budget_variance_report/budget_variance_report.py | 63 | 4771 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, msgprint
from frappe.utils import flt
from frappe.utils import formatdate
import time
from erpnext.accounts.utils im... | agpl-3.0 |
arnavd96/Cinemiezer | myvenv/lib/python3.4/site-packages/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py | 35 | 8389 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749.grant_types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from __future__ import unicode_literals, absolute_import
import json
import logging
from .base import GrantTypeBase
from .. import errors
from ..request_validator import RequestValidator
log = logging.getLogger(_... | mit |
solidsnack/deimos | deimos/cmd.py | 5 | 3013 | import logging
import os
import pipes
import subprocess
import sys
import deimos.logger
from deimos.err import *
from deimos._struct import _Struct
class Run(_Struct):
def __init__(self, log=None, data=False, in_sh=True,
close_stdin=True, log_stderr=True,
start_leve... | apache-2.0 |
jellis18/emcee3 | emcee3/model.py | 1 | 1839 | # -*- coding: utf-8 -*-
from __future__ import division, print_function
__all__ = ["Model"]
import numpy as np
from .state import State
class Model(object):
def __init__(self, lnlikefn=None, lnpriorfn=None, args=tuple()):
if lnpriorfn is None:
lnpriorfn = _default_lnprior_function
... | mit |
dknlght/dkodi | src/script.module.urlresolver/lib/urlresolver/plugins/__generic_resolver__.py | 1 | 2035 | """
Plugin for URLResolver
Copyright (C) 2016 script.module.urlresolver
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) a... | gpl-2.0 |
jordigh/mercurial-crew | mercurial/hgweb/server.py | 2 | 11858 | # hgweb/server.py - The standalone hg web server.
#
# Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net>
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import os, sys,... | gpl-2.0 |
geosohh/AnimeTorr | animetorr/shared/db.py | 1 | 18589 | # -*- coding: utf-8 -*-
"""
Anything related to the DB.
Includes the classes for Anime and Config.
"""
__author__ = 'Sohhla'
import re
import sqlite3
from log import LoggerManager
import constant
from strings import escape_unicode
class DBManager():
"""
Controls access to the SQLite DB.
DB is located at... | gpl-2.0 |
SamboyKirk/tenshi | tools/version_info_helpers.py | 11 | 2111 | # Licensed to Pioneers in Engineering under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Pioneers in Engineering licenses
# this file to you under the Apache License, Version 2.0 (the
# "License"); you may no... | apache-2.0 |
robobrobro/ballin-octo-shame | lib/Python-3.4.3/Lib/distutils/file_util.py | 80 | 8148 | """distutils.file_util
Utility functions for operating on single files.
"""
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',
'sym': 'symbo... | mit |
paolodedios/tensorflow | tensorflow/python/data/kernel_tests/from_tensor_slices_test.py | 6 | 14135 | # 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 |
timonwong/OmniMarkupPreviewer | OmniMarkupLib/Renderers/libs/pygments/lexers/matlab.py | 72 | 29146 | # -*- coding: utf-8 -*-
"""
pygments.lexers.matlab
~~~~~~~~~~~~~~~~~~~~~~
Lexers for Matlab and related languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, bygroups, word... | mit |
egraba/vbox_openbsd | VirtualBox-5.0.0/src/libs/xpcom18a4/python/server/loader.py | 13 | 10226 | # ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (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.mozilla.org/MPL/
#
# Softwa... | mit |
sgerhart/ansible | lib/ansible/module_utils/infinibox.py | 135 | 3673 | # -*- coding: utf-8 -*-
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own lic... | mit |
mgagne/nova | nova/tests/unit/virt/libvirt/fakelibvirt.py | 1 | 34902 | # Copyright 2010 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 |
impredicative/gcam | src/__main__.py | 1 | 54173 | #!/usr/bin/env python3
# GPFS Current Activity Monitor
# Run with -h to print help and allowable arguments.
# See params.py for more customizations.
import argparse, collections, curses, datetime, functools, inspect
import itertools, locale, logging, signal, subprocess, sys, threading, time
# Local imports
import co... | agpl-3.0 |
sestrella/ansible | lib/ansible/modules/cloud/azure/azure_rm_devtestlabschedule_info.py | 20 | 6599 | #!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski, (@zikalino)
#
# 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',
... | gpl-3.0 |
BurtBiel/azure-cli | src/command_modules/azure-cli-network/azure/cli/command_modules/network/mgmt_nsg/lib/models/dependency.py | 6 | 1737 | #---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------... | mit |
Azure/azure-sdk-for-python | sdk/signalr/azure-mgmt-signalr/tests/test_cli_mgmt_signalr.py | 1 | 4604 | # 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.
#----------------------------------------------------------------------... | mit |
JonathanHuot/.emacs.d | elpa/elpy-1.12.0/elpy/tests/test_refactor.py | 26 | 20870 | import unittest
import tempfile
import shutil
import os
import mock
import sys
from elpy import refactor
from textwrap import dedent
class RefactorTestCase(unittest.TestCase):
def setUp(self):
self.project_root = tempfile.mkdtemp(prefix="test-refactor-root")
self.addCleanup(shutil.rmtree, self.pr... | gpl-2.0 |
baroquebobcat/pants | contrib/node/tests/python/pants_test/contrib/node/tasks/test_node_bundle_integration.py | 1 | 5851 | # coding=utf-8
# Copyright 2015 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 os
from conte... | apache-2.0 |
dharmabumstead/ansible | contrib/inventory/nova.py | 109 | 7029 | #!/usr/bin/env python
# (c) 2012, Marco Vito Moscaritolo <marco@agavee.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
# ... | gpl-3.0 |
bpgc-cte/python2017 | Week 7/django/lib/python3.6/encodings/mac_centeuro.py | 257 | 14102 | """ Python Character Mapping Codec mac_centeuro generated from 'MAPPINGS/VENDORS/APPLE/CENTEURO.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,inp... | mit |
darkleons/odoo | addons/hr_holidays/wizard/hr_holidays_summary_employees.py | 337 | 2152 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
talha81/TACTIC-DEV | src/tactic/ui/container/resizable_table_wdg.py | 6 | 9539 | ############################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written perm... | epl-1.0 |
mhue/scikit-learn | sklearn/cross_decomposition/tests/test_pls.py | 215 | 11427 | import numpy as np
from sklearn.utils.testing import (assert_array_almost_equal,
assert_array_equal, assert_true, assert_raise_message)
from sklearn.datasets import load_linnerud
from sklearn.cross_decomposition import pls_
from nose.tools import assert_equal
def test_pls():
d =... | bsd-3-clause |
valdecdev/odoo | addons/mass_mailing/wizard/mail_compose_message.py | 47 | 3245 | # -*- coding: utf-8 -*-
from openerp.osv import osv, fields
class MailComposeMessage(osv.TransientModel):
"""Add concept of mass mailing campaign to the mail.compose.message wizard
"""
_inherit = 'mail.compose.message'
_columns = {
'mass_mailing_campaign_id': fields.many2one(
'mai... | agpl-3.0 |
stefanw/django-cms | cms/south_migrations/0037_auto__del_pagemoderator__del_field_globalpagepermission_can_moderate__.py | 48 | 17126 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label... | bsd-3-clause |
sdcooke/django | django/core/files/images.py | 429 | 2428 | """
Utility functions for handling images.
Requires Pillow as you might imagine.
"""
import struct
import zlib
from django.core.files import File
class ImageFile(File):
"""
A mixin for use alongside django.core.files.base.File, which provides
additional features for dealing with images.
"""
def ... | bsd-3-clause |
rp-/honstats | provider.py | 1 | 10448 | """
This file is part of honstats.
honstats 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.
honstats is distributed in the hope that it wil... | gpl-3.0 |
OshynSong/scikit-learn | examples/model_selection/grid_search_digits.py | 227 | 2665 | """
============================================================
Parameter estimation using grid search with cross-validation
============================================================
This examples shows how a classifier is optimized by cross-validation,
which is done using the :class:`sklearn.grid_search.GridSearc... | bsd-3-clause |
rishig/zulip | zerver/webhooks/deskdotcom/view.py | 2 | 1066 | # Webhooks for external integrations.
from django.http import HttpRequest, HttpResponse
from zerver.decorator import authenticated_rest_api_view
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success
from zerver.lib.webhooks.common import check_send_webhook_message
from... | apache-2.0 |
cortext/crawtextV2 | ~/venvs/crawler/lib/python2.7/site-packages/nltk/parse/api.py | 17 | 5155 | # Natural Language Toolkit: Parser API
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
#
import itertools
from nltk.internals import overridden
clas... | mit |
sysalexis/kbengine | kbe/res/scripts/common/Lib/test/test_asyncio/test_selector_events.py | 60 | 63695 | """Tests for selector_events.py"""
import errno
import gc
import pprint
import socket
import sys
import unittest
from unittest import mock
try:
import ssl
except ImportError:
ssl = None
import asyncio
from asyncio import selectors
from asyncio import test_utils
from asyncio.selector_events import BaseSelector... | lgpl-3.0 |
ValyrianTech/BitcoinSpellbook-v0.3 | darwin/genome.py | 1 | 2090 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from darwin.chromosome import Chromosome
import hashlib
import binascii
import simplejson
class Genome(object):
def __init__(self):
self.chromosomes = {}
self.fitness = None
# def add_chromosome(self, chromosome):
# if not isinstance(chr... | gpl-3.0 |
Dandandan/wikiprogramming | jsrepl/build/extern/python/unclosured/lib/python2.7/os2emxpath.py | 192 | 4603 | # Module 'os2emxpath' -- common operations on OS/2 pathnames
"""Common pathname manipulations, OS/2 EMX version.
Instead of importing this module directly, import os and refer to this
module as os.path.
"""
import os
import stat
from genericpath import *
from ntpath import (expanduser, expandvars, isabs, islink, spli... | mit |
jadielam/object-detection-tensorflow | lib/datasets/pascal3d.py | 5 | 30657 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
import xml.dom.minidom as minidom
import os
import PIL
import numpy as... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.