repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
vinhlh/bite-project | refs/heads/master | deps/gdata-python-client/src/gdata/contentforshopping/client.py | 29 | #!/usr/bin/python
#
# Copyright (C) 2010-2011 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... |
saurabh6790/medapp | refs/heads/master | hr/doctype/job_applicant/job_applicant.py | 30 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import webnotes
from utilities.transaction_base import TransactionBase
from webnotes.utils import ... |
eddyb/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/py/testing/path/test_svnauth.py | 163 | import py
import svntestbase
from py.path import SvnAuth
import time
import sys
svnbin = py.path.local.sysfind('svn')
def make_repo_auth(repo, userdata):
""" write config to repo
user information in userdata is used for auth
userdata has user names as keys, and a tuple (password, readwrite) as
... |
kiwicopple/MyMDb | refs/heads/master | venv/Lib/site-packages/sphinx/util/texescape.py | 11 | # -*- coding: utf-8 -*-
"""
sphinx.util.texescape
~~~~~~~~~~~~~~~~~~~~~
TeX escaping helper.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
tex_replacements = [
# map TeX special chars
(u'$', ur'\$'),
(u'%', ur'\%'),
(u... |
rcos/Observatory | refs/heads/master | observatory/dashboard/migrations/0004_set_mentor.py | 1 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# Note: Don't use "from appname.models import ModelName".
# Use orm.... |
koltegirish/Arduino | refs/heads/esp8266 | arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/poolmanager.py | 168 | # urllib3/poolmanager.py
# Copyright 2008-2012 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 logging
from ._collections import RecentlyUsedContainer
from .connectionpool import... |
neilswainston/development-py | refs/heads/master | synbiochemdev/__init__.py | 8 | '''
synbiochem (c) University of Manchester 2015
synbiochem is licensed under the MIT License.
To view a copy of this license, visit <http://opensource.org/licenses/MIT/>.
@author: neilswainston
'''
|
switchkiller/ProjDjanko | refs/heads/master | lib/python2.7/posixpath.py | 4 | /usr/lib/python2.7/posixpath.py |
balajikris/autorest | refs/heads/master | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/models/availability_set_update_parameters.py | 16 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
bubakazouba/Robinhood-for-Google-Finance | refs/heads/master | Robinhood.py | 1 |
import getpass
import json
import requests
import urllib
import sys
try:
from urllib.request import urlretrieve #py3
except ImportError:
from urllib import urlretrieve # py2
class Robinhood:
endpoints = {
"login": "https://api.robinhood.com/api-token-auth/",
"investment_pr... |
Parcks/core | refs/heads/master | src/domain/post_install/shell/shell_command_runnable_factory.py | 1 | """
Scriptable Packages Installer - Parcks
Copyright (C) 2017 JValck - Setarit
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.... |
aleksandra-tarkowska/django | refs/heads/master | tests/utils_tests/test_module/__init__.py | 439 | class SiteMock(object):
_registry = {}
site = SiteMock()
|
osamak/student-portal | refs/heads/master | clubs/admin.py | 2 | # -*- coding: utf-8 -*-
from django import forms
from django.contrib import admin
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from clubs.models import Club, Team, College
from core.models import StudentClubYear
class ClubFilter(admin.SimpleListFilter):
title ... |
cricketclubucd/davisdragons | refs/heads/master | platform-tools/systrace/catapult/telemetry/third_party/modulegraph/modulegraph_tests/testdata/syspath/mypkg/__init__.py | 26 | """ fake package """
|
DStauffman/dstauffman2 | refs/heads/master | dstauffman2/games/pentago/utils.py | 1 | r"""
Utils module file for the "pentago" game. It defines the generic utility functions.
Notes
-----
#. Written by David C. Stauffer in January 2016.
"""
#%% Imports
import doctest
import logging
import os
import unittest
import numpy as np
from dstauffman import modd
from dstauffman2 import get_root_dir as dcs_r... |
elijah513/django | refs/heads/master | django/contrib/webdesign/__init__.py | 264 | import warnings
from django.utils.deprecation import RemovedInDjango110Warning
default_app_config = 'django.contrib.webdesign.apps.WebDesignConfig'
warnings.warn(
"django.contrib.webdesign will be removed in Django 1.10. The "
"{% lorem %} tag is now included in the built-in tags.",
RemovedInDjango110Wa... |
gylian/sickrage | refs/heads/master | lib/adba/aniDBtvDBmaper.py | 24 | #!/usr/bin/env python
#
# This file is part of aDBa.
#
# aDBa 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.
#
# aDBa is distributed i... |
LinDA-tools/LindaWorkbench | refs/heads/master | linda/query_designer/views.py | 1 | from datetime import datetime
import json
import urllib
from django.http import Http404, HttpResponse, JsonResponse
from django.shortcuts import render, get_object_or_404
from django.utils.http import urlquote
import requests
from linda_app.models import DatasourceDescription, VocabularyProperty, Query, get_configurati... |
Elucidation/ChessboardDetect | refs/heads/master | generateMLDataset.py | 1 | # coding=utf-8
import PIL.Image
import matplotlib.image as mpimg
import scipy.ndimage
import cv2 # For Sobel etc
import glob
import numpy as np
import matplotlib.pyplot as plt
import os
np.set_printoptions(suppress=True, linewidth=200) # Better printing of arrays
# Load pt_dataset.txt and generate the windowed tiles f... |
Kefkius/electrum-frc | refs/heads/master | lib/msqr.py | 59 | # from http://eli.thegreenplace.net/2009/03/07/computing-modular-square-roots-in-python/
def modular_sqrt(a, p):
""" Find a quadratic residue (mod p) of 'a'. p
must be an odd prime.
Solve the congruence of the form:
x^2 = a (mod p)
And returns x. Note that p - x is also a root.
0 is returned ... |
amenonsen/ansible | refs/heads/devel | lib/ansible/cli/adhoc.py | 29 | # Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright: (c) 2018, Ansible Project
# 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
from ansible import constants as ... |
cedar101/quepy-ko | refs/heads/master | quepy/__init__.py | 10 | # coding: utf-8
# Copyright (c) 2012, Machinalis S.R.L.
# This file is part of quepy and is distributed under the Modified BSD License.
# You should have received a copy of license in the LICENSE file.
#
# Authors: Rafael Carrascosa <rcarrascosa@machinalis.com>
# Gonzalo Garcia Berrotaran <ggarcia@machinalis.... |
dweinstein/mitmproxy | refs/heads/master | libmproxy/web/app.py | 12 | import os.path
import re
import tornado.web
import tornado.websocket
import logging
import json
from .. import version, filt
class APIError(tornado.web.HTTPError):
pass
class RequestHandler(tornado.web.RequestHandler):
def set_default_headers(self):
super(RequestHandler, self).set_default_headers()
... |
code-ape/pyspec | refs/heads/master | pyspec/importer.py | 1 | import inspect
import imp
import sys, os
def pyspec_import(target_name):
stack = inspect.stack()
frames = [frame_obj[0] for frame_obj in stack]
last_frame = frames[1]
abs_path_name = os.path.abspath('..')
sys.path.append(abs_path_name)
path_name = "../" + target_name + ".py"
temp = imp.fin... |
metaml/nupic | refs/heads/master | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_pdf.py | 69 | # -*- coding: iso-8859-1 -*-
"""
A PDF matplotlib backend (not yet complete)
Author: Jouni K Seppänen <jks@iki.fi>
"""
from __future__ import division
import os
import re
import sys
import time
import warnings
import zlib
import numpy as npy
from cStringIO import StringIO
from datetime import datetime
from math impo... |
kingctan/oppia | refs/heads/master | core/storage/feedback/gae_models_test.py | 6 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
vladmm/intellij-community | refs/heads/master | python/testData/formatter/alignDictLiteralOnValue.py | 79 | {
"a": 1,
"bbb": [
2
],
"bbbbb": 3
}
|
unkyulee/elastic-cms | refs/heads/master | src/task/modules/FSIDX.py | 1 | import os
import pwd
import time
from datetime import datetime
import xml.etree.ElementTree as ET
from sqlalchemy import create_engine
from sqlalchemy.sql import text
def run(p):
AllGood = True
# Read Query and parse parameters
root = ET.fromstring(p["action"]["query"])
SQL_CONNECTION = root.find("SQL_... |
rogerhil/thegamesdb | refs/heads/master | setup.py | 1 | import os
from setuptools import setup, find_packages
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except(IOError, ImportError):
long_description = open('README.md').read()
local_file = lambda f: open(os.path.join(os.path.dirname(__file__), f)).read()
if __name__ == '__mai... |
jbenden/ansible | refs/heads/devel | lib/ansible/parsing/dataloader.py | 14 | # (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... |
tlakshman26/cinder-https-changes | refs/heads/master | cinder/ssh_utils.py | 22 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# Copyright 2014 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use th... |
VigTech/Vigtech-Services | refs/heads/master | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/exceptions.py | 487 |
## Base Exceptions
class HTTPError(Exception):
"Base exception used by this module."
pass
class HTTPWarning(Warning):
"Base warning used by this module."
pass
class PoolError(HTTPError):
"Base exception for errors caused within a pool."
def __init__(self, pool, message):
self.pool ... |
anorfleet/turntable | refs/heads/master | test/lib/python2.7/site-packages/scipy/sparse/linalg/eigen/arpack/__init__.py | 159 | """
Eigenvalue solver using iterative methods.
Find k eigenvectors and eigenvalues of a matrix A using the
Arnoldi/Lanczos iterative methods from ARPACK [1]_,[2]_.
These methods are most useful for large sparse matrices.
- eigs(A,k)
- eigsh(A,k)
References
----------
.. [1] ARPACK Software, http://www.caam.rice... |
pleaseproject/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/distutils/tests/test_dist.py | 47 | """Tests for distutils.dist."""
import os
import io
import sys
import unittest
import warnings
import textwrap
from distutils.dist import Distribution, fix_help_options
from distutils.cmd import Command
from test.support import TESTFN, captured_stdout, run_unittest
from distutils.tests import support
class test_dis... |
nghia-huynh/gem5-stable | refs/heads/master | src/dev/arm/AbstractNVM.py | 41 | # Copyright (c) 2013-2015 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functiona... |
jeremyosborne/python | refs/heads/master | third_party/docopt/dopt.py | 1 | '''
Usage: oparse.py [options]
Options:
-h, --help show this help message and exit
-f FILE, --file=FILE write report to FILE [default: report.txt]
-q, --quiet don't print status messages to stdout [default: False]
-l LINES, --lines=LINES
how many lines to add to th... |
e3krisztian/bead | refs/heads/master | bead_cli/web/__init__.py | 12133432 | |
tobegit3hub/keystone_docker | refs/heads/master | keystone/policy/backends/__init__.py | 12133432 | |
philanthropy-u/edx-platform | refs/heads/master | common/test/acceptance/pages/lms/video/__init__.py | 12133432 | |
hynnet/openwrt-mt7620 | refs/heads/master | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/threading.py | 31 | """Thread module emulating a subset of Java's threading model."""
import sys as _sys
try:
import thread
except ImportError:
del _sys.modules[__name__]
raise
import warnings
from time import time as _time, sleep as _sleep
from traceback import format_exc as _format_exc
# Note regarding PEP 8 compliant a... |
brenthuisman/phd_tools | refs/heads/master | analysis.poisontest.py | 1 | #!/usr/bin/env python
import dump, numpy as np,plot,sys,glob2 as glob,matplotlib.pyplot as plt
rootn='ipnl-patient-spot-auger.root'
#rootn='iba-patient-spot-auger.root'
filelist = glob.glob("./**/ipnl-patient-spot-auger.root")
data=[]
x=[]
for ffilen in filelist:
print 'opening',ffilen
for key,val in dump.thist2np... |
zimeon/iiif | refs/heads/main | iiif_static.py | 1 | #!/usr/bin/env python
"""iiif_static: Generate static images implementing the IIIF Image API level 0.
Copyright 2014--2018 Simeon Warner
"""
import logging
import optparse
import sys
import os.path
from iiif import __version__
from iiif.error import IIIFError
from iiif.static import IIIFStatic, IIIFStaticError
def... |
nkgilley/home-assistant | refs/heads/dev | homeassistant/components/mpchc/__init__.py | 36 | """The mpchc component."""
|
alephu5/Soundbyte | refs/heads/master | environment/lib/python3.3/site-packages/IPython/nbconvert/writers/files.py | 7 | """
Contains writer for writing nbconvert output to filesystem.
"""
#-----------------------------------------------------------------------------
#Copyright (c) 2013, the IPython Development Team.
#
#Distributed under the terms of the Modified BSD License.
#
#The full license is in the file COPYING.txt, distributed wi... |
gardster/omim | refs/heads/master | tools/python/stylesheet/convert_styles.py | 53 | import sys
lns = open(sys.argv[1]).readlines()
lns = [l.strip("\n") for l in lns]
newlns = []
isCaption = False
captionLns = []
leadSpaces = ""
i = 0
for l in lns:
if not isCaption:
i = l.find(" caption ")
if i != -1:
isCaption = True
captionLns = []
leadSpac... |
open-power-ref-design/opsmgr | refs/heads/master | horizon/test/integration_tests/pages/operational_management/__init__.py | 12133432 | |
ocwc/ocwc-data | refs/heads/master | search/data/management/__init__.py | 12133432 | |
svenstaro/ansible | refs/heads/devel | test/integration/targets/module_utils/module_utils/a/b/c/d/e/__init__.py | 12133432 | |
dreamapplehappy/myblog | refs/heads/master | node_modules/grunt-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/MSVSVersion.py | 486 | # Copyright (c) 2013 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.
"""Handle version information related to Visual Stuio."""
import errno
import os
import re
import subprocess
import sys
import gyp
import glob
class VisualStudi... |
ibrahima/kernel_i9300 | refs/heads/master | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... |
explosion/spaCy | refs/heads/master | spacy/lang/ca/tokenizer_exceptions.py | 1 | from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ...symbols import ORTH, NORM
from ...util import update_exc
_exc = {}
for exc_data in [
{ORTH: "aprox.", NORM: "aproximadament"},
{ORTH: "pàg.", NORM: "pàgina"},
{ORTH: "p.ex.", NORM: "per exemple"},
{ORTH: "gen.", NORM: "gener"},
{ORTH: "fe... |
Dziolas/invenio | refs/heads/scoap3 | modules/bibauthorid/lib/bibauthorid_string_utils.py | 25 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2011 CERN.
##
## Invenio 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) a... |
GetStream/django_twitter | refs/heads/master | stream_twitter/migrations/0001_squashed_0002_auto_20170929_1307.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-05 09:33
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import stream_django.activity
class Migration(migrations.Migration):
replaces = [('stream_tw... |
Just-D/chromium-1 | refs/heads/master | ppapi/generators/idl_diff.py | 180 | #!/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 glob
import os
import subprocess
import sys
from idl_option import GetOption, Option, ParseOptions
from idl_outfile import ... |
rqelibari/sirup | refs/heads/master | tasks.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
tasks.py
Part of sirup project
(c) 2017 Copyright Rezart Qelibari <rqelibari@users.noreply.github.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 obta... |
gilbert-yuan/gooderp_addons | refs/heads/master | warehouse/tests/test_inventory.py | 5 | # -*- coding: utf-8 -*-
from odoo.tests.common import TransactionCase
from odoo.exceptions import UserError
class TestInventory(TransactionCase):
def setUp(self):
super(TestInventory, self).setUp()
self.env.ref('core.goods_category_1').account_id = self.env.ref(
'finance.account_goods... |
s2hc-johan/plugins | refs/heads/master | v6/spell_check/spell_check.py | 4 | # -*- coding: utf-8 -*-
# Copyright © 2014 Puneeth Chaganti
# 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, mo... |
loretoparisi/nupic | refs/heads/master | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_tkagg.py | 69 | # Todd Miller jmiller@stsci.edu
from __future__ import division
import os, sys, math
import Tkinter as Tk, FileDialog
import tkagg # Paint image to Tk photo blitter extension
from backend_agg import FigureCanvasAgg
import os.path
import matplotlib
from matplotlib.cbook import is_string_like
from ... |
p0cisk/Quantum-GIS | refs/heads/master | python/ext-libs/nose2/tests/functional/test_loadtests_plugin.py | 12 | from nose2.tests._common import FunctionalTestCase
class TestLoadTestsPlugin(FunctionalTestCase):
def test_simple(self):
proc = self.runIn(
'scenario/load_tests',
'-v',
'--plugin=nose2.plugins.loader.loadtests')
self.assertTestRunOutputMatches(proc, stderr='Ran... |
jupitercoin/jupitercoin-v1.1--diff-update- | refs/heads/master | qa/rpc-tests/getchaintips.py | 6 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the getchaintips API. We introduce a network split, work
# on chains of different lengths, and joi... |
nvoron23/statsmodels | refs/heads/master | statsmodels/examples/ex_grangercausality.py | 33 | # -*- coding: utf-8 -*-
"""
Created on Sat Jul 06 15:44:57 2013
Author: Josef Perktold
"""
from __future__ import print_function
from statsmodels.compat.python import iteritems
import numpy as np
from numpy.testing import assert_almost_equal
from statsmodels.datasets import macrodata
import statsmodels.tsa.stattool... |
randy-waterhouse/bitcoin | refs/heads/master | test/functional/combine_logs.py | 14 | #!/usr/bin/env python3
"""Combine logs from multiple bitcoin nodes as well as the test_framework log.
This streams the combined log output to stdout. Use combine_logs.py > outputfile
to write to an outputfile."""
import argparse
from collections import defaultdict, namedtuple
import heapq
import itertools
import os
i... |
DailyActie/Surrogate-Model | refs/heads/master | 01-codes/OpenMDAO-Framework-dev/contrib/m4/examples/mid_fidelity_example.py | 1 | """
Simple M4 variable fidelity example.
Runs a DOE on a MidFidelity component instance.
Note that the MidFidelity component performs its correction calculations
on the first execution, then on subsequent executions the corrected result
is directly calculated.
"""
from m4.doe import DOE
from m4.dummy_components impor... |
termie/pupa | refs/heads/master | nova/context.py | 1 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
smallyear/linuxLearn | refs/heads/master | salt/salt/states/win_system.py | 1 | # -*- coding: utf-8 -*-
'''
Management of Windows system information
========================================
.. versionadded:: 2014.1.0
This state is used to manage system information such as the computer name and
description.
.. code-block:: yaml
ERIK-WORKSTATION:
system.computer_name: []
This is E... |
BenTheElder/test-infra | refs/heads/master | gubernator/github/admin.py | 22 | # Copyright 2016 The Kubernetes 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 applicable law or agreed to ... |
anaran/olympia | refs/heads/master | apps/addons/search.py | 6 | import logging
from operator import attrgetter
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
import pyes.exceptions as pyes
import amo
import amo.search
from addons.models import Persona
from amo.utils import create_es_index_if_missing
from bandwagon.models import Collection
... |
bl4ck5un/fanz.io | refs/heads/master | blogging/models.py | 1 | from django.db import models
# Create your models here.
class Tag(models.Model):
text = models.CharField(max_length=50)
def __str__(self):
return self.text
class Article(models.Model):
title = models.CharField(max_length=200)
slug = models.SlugField(default='-')
content = models.TextFie... |
tcalmant/ipopo | refs/heads/v1 | samples/rsa/__init__.py | 12133432 | |
struys/pip-faster | refs/heads/master | tests/unit/__init__.py | 12133432 | |
romykundal/meanjs-multiuploader | refs/heads/master | node_modules/nodemon/travis_after_all.py | 23 | import os
import sys
import json
import time
import logging
try:
from functools import reduce
except ImportError:
pass
try:
import urllib.request as urllib2
except ImportError:
import urllib2
log = logging.getLogger("travis.leader")
log.addHandler(logging.StreamHandler())
log.setLevel(logging.INFO)
... |
PAIR-code/lit | refs/heads/main | lit_nlp/examples/models/pretrained_lms.py | 1 | # Lint as: python3
"""Wrapper for HuggingFace models in LIT.
Includes BERT masked LM, GPT-2, and T5.
This wrapper loads a model into memory and implements the a number of helper
functions to predict a batch of examples and extract information such as
hidden states and attention.
"""
import re
from typing import Dict,... |
jpaton/xen-4.1-LJX1 | refs/heads/master | tools/python/xen/xend/server/SrvRoot.py | 49 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... |
Fireblend/chromium-crosswalk | refs/heads/master | media/tools/layout_tests/layouttest_analyzer_helpers.py | 120 | # 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.
"""Helper functions for the layout test analyzer."""
from datetime import datetime
from email.mime.multipart import MIMEMultipart
from email.mime.text i... |
rahushen/ansible | refs/heads/devel | lib/ansible/modules/cloud/vultr/vr_startup_script.py | 39 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, René Moser <mail@renemoser.net>
# 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':... |
talonchandler/dipsim | refs/heads/master | notes/2017-10-10-voxel-reconstruction/figures/assemble.py | 1 | import matplotlib.pyplot as plt
import numpy as np
from dipsim import util
# Choose files
name_head = '/Users/Talon/Dropbox/20170725_Bob_Actin_results/Cell1_LSimaging_registerred/SPIM'
names = ['A_reg_P1.tif', 'A_reg_P2.tif', 'A_reg_P3.tif', 'A_reg_P4.tif',
'B_reg_P1.tif', 'B_reg_P2.tif', 'B_reg_P3.tif', 'B_r... |
MooglyGuy/mame | refs/heads/master | 3rdparty/catch/scripts/approvalTests.py | 38 | #!/usr/bin/env python
from __future__ import print_function
import os
import sys
import subprocess
import re
import difflib
import scriptCommon
from scriptCommon import catchPath
rootPath = os.path.join(catchPath, 'projects/SelfTest/Baselines')
filelocParser = re.compile(r'''
.*/
(.+\.[ch]pp) # filename... |
cortesi/mitmproxy | refs/heads/master | examples/simple/add_header.py | 6 | from mitmproxy import http
def response(flow: http.HTTPFlow) -> None:
flow.response.headers["newheader"] = "foo"
|
mationic/pyload | refs/heads/stable | module/plugins/hoster/UlozTo.py | 6 | # -*- coding: utf-8 -*-
import re
import time
from module.common.json_layer import json_loads
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
def convert_decimal_prefix(m):
#: Decimal prefixes used in filesize and traffic
return ("%%.%df" % {'k': 3, 'M': 6, 'G': 9}[m.group(2)] ... |
pramasoul/micropython | refs/heads/master | tests/basics/gen_yield_from_ducktype.py | 107 | class MyGen:
def __init__(self):
self.v = 0
def __iter__(self):
return self
def __next__(self):
self.v += 1
if self.v > 5:
raise StopIteration
return self.v
def gen():
yield from MyGen()
def gen2():
yield from gen()
print(list(gen()))
print(l... |
arun6582/django | refs/heads/master | tests/basic/tests.py | 22 | import threading
from datetime import datetime, timedelta
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.db import DEFAULT_DB_ALIAS, DatabaseError, connections
from django.db.models.manager import BaseManager
from django.db.models.query import EmptyQuerySet, QuerySet
from dj... |
laperry1/android_external_chromium_org | refs/heads/cm-12.1 | third_party/pexpect/pxssh.py | 171 | """This class extends pexpect.spawn to specialize setting up SSH connections.
This adds methods for login, logout, and expecting the shell prompt.
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
http://opensource.org/licenses/isc-license.txt
Copyright (c) 2012, Noah Spu... |
Zanzibar82/plugin.video.vvvvid | refs/heads/master | resources/lib/utils/keyfactory.py | 208 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""Factory functions for asymmetric cryptography.
@sort: generateRSAKey, parsePEMKey, parseAsPublicKey
"""
from .compat import *
from .rsakey import RSAKey
from .python_rsakey import Python_RSAKey
from tlslite.utils impo... |
jbassen/edx-platform | refs/heads/master | pavelib/paver_tests/__init__.py | 12133432 | |
zofuthan/edx-platform | refs/heads/master | cms/djangoapps/xblock_config/migrations/__init__.py | 12133432 | |
adrian-the-git/mezzanine | refs/heads/master | mezzanine/generic/templatetags/__init__.py | 12133432 | |
veltzer/pycmdtools | refs/heads/master | pycmdtools/__init__.py | 12133432 | |
midma101/m0du1ar | refs/heads/master | .venv/lib/python2.7/site-packages/pkg_resources/_vendor/__init__.py | 12133432 | |
MQQiang/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_unittest.py | 197 | import unittest.test
from test import support
def test_main():
# used by regrtest
support.run_unittest(unittest.test.suite())
support.reap_children()
def load_tests(*_):
# used by unittest
return unittest.test.suite()
if __name__ == "__main__":
test_main()
|
frouty/odoo_oph | refs/heads/dev_70 | addons/claim_from_delivery/__openerp__.py | 172 | ##############################################################################
#
# 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 GNU Affero General Public L... |
AOSPA-L/android_external_skia | refs/heads/lollipop-mr1 | bench/check_bench_regressions.py | 160 | '''
Created on May 16, 2011
@author: bungeman
'''
import bench_util
import getopt
import httplib
import itertools
import json
import os
import re
import sys
import urllib
import urllib2
import xml.sax.saxutils
# Maximum expected number of characters we expect in an svn revision.
MAX_SVN_REV_LENGTH = 5
# Indices for ... |
avoinsystems/odoo | refs/heads/8.0 | addons/sale_journal/__init__.py | 443 | # -*- 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... |
rosmo/ansible | refs/heads/devel | lib/ansible/modules/network/aci/mso_schema_site_anp_epg.py | 18 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_ve... |
ckane/crits | refs/heads/master | crits/core/audit.py | 23 | import datetime
from mongoengine import Document, StringField, ObjectIdField
from django.conf import settings
from crits.core.crits_mongoengine import CritsDocument, CritsSchemaDocument
from crits.core.fields import CritsDateTimeField
class AuditLog(CritsDocument, CritsSchemaDocument, Document):
"""
Audit L... |
ejegg/FractalEditorSite | refs/heads/master | fractaleditor/urls.py | 1 | from django.conf.urls import include, url
import django.views.static
import fractaleditor.views
import fractals.views
import os.path
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
project_root = os.path.dirname(os.path.dirname(__file__))
urlpatterns = [
... |
bzbarsky/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/_pytest/assertion/__init__.py | 176 | """
support for presenting detailed information in failing assertions.
"""
import py
import os
import sys
from _pytest.monkeypatch import monkeypatch
from _pytest.assertion import util
def pytest_addoption(parser):
group = parser.getgroup("debugconfig")
group.addoption('--assert',
action="... |
tumbl3w33d/ansible | refs/heads/devel | test/units/modules/storage/netapp/test_na_ontap_vscan_on_demand_task.py | 43 | ''' unit tests for Ansible module: na_ontap_vscan_on_demand_task '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch, Mock
from ansible.module_utils import basic
from ansible.module_utils._text import to_bytes
import ansible.module_... |
felipetomm/POX-Django | refs/heads/master | pox/topology/topology.py | 41 | # Copyright 2011 James McCauley
#
# 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 writi... |
osm-fr/osmose-backend | refs/heads/master | osmose_config.py | 3 | #-*- coding: utf-8 -*-
###########################################################################
## ##
## Copyrights Etienne Chové <chove@crans.org> 2009 ##
## ... |
josejamilena/virtualagc | refs/heads/trunk | Tools/pagecounter.py | 10 | #!/usr/bin/env python
# Copyright 2010 Jim lawton <jim dot lawton at gmail dot com>
#
# This file is part of yaAGC.
#
# yaAGC 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, o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.