repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
allancarlos123/Solfege | refs/heads/master | test.py | 2 | #!/usr/bin/python
# Solfege - free ear training software
# Copyright (C) 2007, 2008, 2011 Tom Cato Amundsen
# License is GPL, see file COPYING
from __future__ import absolute_import
import unittest
import sys
import os
import shutil
import atexit
# we need this hack because doctest messes with _
def f(s):
if type... |
chaen/DIRAC | refs/heads/integration | Core/DISET/private/MessageBroker.py | 8 | """ Here, we need some documentation...
"""
import threading
import select
import time
import socket
from DIRAC import gLogger, S_OK, S_ERROR
from DIRAC.Core.DISET.private.TransportPool import getGlobalTransportPool
from DIRAC.Core.Utilities.ThreadPool import getGlobalThreadPool
from DIRAC.Core.Utilities.ReturnValues... |
chrisndodge/edx-platform | refs/heads/master | cms/djangoapps/course_creators/views.py | 230 | """
Methods for interacting programmatically with the user creator table.
"""
from course_creators.models import CourseCreator
from student.roles import CourseCreatorRole
from student import auth
def add_user_with_status_unrequested(user):
"""
Adds a user to the course creator table with status 'unrequested'.... |
Apreche/Presentoh | refs/heads/master | utils/jinja2/constants.py | 220 | # -*- coding: utf-8 -*-
"""
jinja.constants
~~~~~~~~~~~~~~~
Various constants.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
#: list of lorem ipsum words used by the lipsum() helper function
LOREM_IPSUM_WORDS = u'''\
a ac accumsan ad adipiscing aenean a... |
MichaelAquilina/pytest | refs/heads/master | _pytest/setuponly.py | 28 | from __future__ import absolute_import, division, print_function
import pytest
import sys
def pytest_addoption(parser):
group = parser.getgroup("debugconfig")
group.addoption('--setuponly', '--setup-only', action="store_true",
help="only setup fixtures, do not execute tests.")
group.a... |
Huyuwei/tvm | refs/heads/master | python/tvm/autotvm/tuner/callback.py | 1 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
cornellradiology/ResearchKit | refs/heads/master | scripts/plist-to-strings.py | 31 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Ricardo Sánchez-Sáez. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above ... |
muntasirsyed/intellij-community | refs/heads/master | python/testData/quickFixes/PyAugmentAssignmentQuickFixTest/function_after.py | 83 | def retStr():
return ''
s1 = ''
s1 += retStr()
|
nicoboss/Floatmotion | refs/heads/master | pygame/tests/__init__.py | 33 | """Pygame unit test suite package
Exports function run()
A quick way to run the test suite package from the command line
is by importing the go submodule:
python -m "import pygame.tests" [<test options>]
Command line option --help displays a usage message. Available options
correspond to the pygame.tests.run argume... |
pombredanne/nxsc | refs/heads/master | src/filehipporepo.py | 1 | #-*- coding: utf-8 -*-
'''
File: filehipporepo.py
Author: Michał "NeoXant" Kolarczyk
License: GNU GPL version 3 (see LICENSE file)
FileHippoRepo class for NXSC.
Code passes PEP8 guidlines (pep8.py agreed with that)
'''
from urllib.parse import urljoin
from functools import partial
import hashlib
from datetime import... |
kxepal/couchdb-python | refs/heads/master | couchdb/tests/client.py | 3 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
from datetime import datetime
import os
import os.path
import shutil
import time
import tempfile
imp... |
tosolveit/scikit-learn | refs/heads/master | examples/linear_model/plot_logistic_path.py | 349 | #!/usr/bin/env python
"""
=================================
Path with L1- Logistic Regression
=================================
Computes path on IRIS dataset.
"""
print(__doc__)
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
from datetime import datetime
import numpy as np
import... |
leriomaggio/pycon_site | refs/heads/master | jobboard/views.py | 2 | # Create your views here.
from django.views.generic import ListView, DetailView
from .models import JobOffer
from django.shortcuts import HttpResponse
class JobList(ListView):
model = JobOffer
def get_context_data(self, **kwargs):
context = super(JobList, self).get_context_data(**kwargs)
retu... |
Johnzero/erp | refs/heads/fga | openerp/addons/pad_project/models/__init__.py | 441 | # -*- 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... |
dcroc16/skunk_works | refs/heads/master | google_appengine/lib/django-1.4/django/contrib/admin/forms.py | 88 | from django import forms
from django.contrib.auth import authenticate
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy, ugettext as _
ERROR_MESSAGE = ugettext_lazy("Please enter the correct username and password "
... |
watsonpy/watson-http | refs/heads/master | watson/http/sessions/file.py | 1 | # -*- coding: utf-8 -*-
import os
import pickle
from tempfile import gettempdir
from watson.common.contextmanagers import suppress
from watson.http.sessions.abc import StorageMixin
class Storage(StorageMixin):
"""A file based storage adapter for session data.
By default it will store data in the systems tem... |
levart/peliculas.lev | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py | 2687 | #!/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 msvs.py file. """
import gyp.generator.msvs as msvs
import unittest
import StringIO
class TestSequenceFunctions(uni... |
bsdlp/keyporium.com | refs/heads/master | publishconf.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
SITEURL = 'http://keyporium.com'
RELATIVE_URLS = False
... |
BT-rmartin/odoo | refs/heads/BT_2900 | openerp/addons/test_exceptions/__init__.py | 2074 | # -*- coding: utf-8 -*-
import models
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
braintreeps/moto | refs/heads/master | moto/cloudformation/responses.py | 2 | from __future__ import unicode_literals
import json
from six.moves.urllib.parse import urlparse
from moto.core.responses import BaseResponse
from moto.s3 import s3_backend
from .models import cloudformation_backends
from .exceptions import ValidationError
class CloudFormationResponse(BaseResponse):
@property
... |
BookOwl/nustack | refs/heads/master | nustack/__main__.py | 1 | #!python3
# Nustack main entry point
import nustack
from nustack import utils
import sys, imp, os, argparse
desc = "Nustack is a stack-oriented concatenative programming language with support\
for high-level modular programming and Python integration."
epilog = "For more information, please see https://github.com/Bo... |
valexandersaulys/airbnb_kaggle_contest | refs/heads/master | venv/lib/python3.4/site-packages/numpy/linalg/tests/test_build.py | 131 | from __future__ import division, absolute_import, print_function
from subprocess import PIPE, Popen
import sys
import re
from numpy.linalg import lapack_lite
from numpy.testing import TestCase, dec, run_module_suite
from numpy.compat import asbytes_nested
class FindDependenciesLdd(object):
def __init__(self):... |
kalebhartje/schoolboost | refs/heads/master | lms/envs/dev_mongo.py | 14 | """
This config file runs the dev environment, but with mongo as the datastore
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=W0401, W0614
from .dev import *
GITHUB_REPO_ROOT = ENV_ROOT / "data"
MODULESTORE = {
'def... |
kennethreitz/bpwatch | refs/heads/master | logplex/packages/requests/auth.py | 78 | # -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import re
import time
import hashlib
import logging
from base64 import b64encode
from .compat import urlparse, str
from .utils import parse_dict_header
log = logging.getLogger(__na... |
Godiyos/python-for-android | refs/heads/master | python-modules/twisted/twisted/conch/test/test_ssh.py | 49 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.ssh}.
"""
import struct
try:
import Crypto.Cipher.DES3
except ImportError:
Crypto = None
try:
import pyasn1
except ImportError:
pyasn1 = None
from twisted.conch.ssh import common, session... |
nurmd2/nurmd | refs/heads/master | addons/crm/res_config.py | 15 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import SUPERUSER_ID
from openerp.osv import fields, osv
class crm_configuration(osv.TransientModel):
_name = 'sale.config.settings'
_inherit = ['sale.config.settings', 'fetchmail.config.settings']
... |
knadir/Microblog | refs/heads/master | db_repository/versions/005_migration.py | 581 | from sqlalchemy import *
from migrate import *
from migrate.changeset import schema
pre_meta = MetaData()
post_meta = MetaData()
def upgrade(migrate_engine):
# Upgrade operations go here. Don't create your own engine; bind
# migrate_engine to your metadata
pre_meta.bind = migrate_engine
post_meta.bin... |
opensemanticsearch/open-semantic-etl | refs/heads/master | src/opensemanticetl/enhance_extract_email.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import re
import etl_plugin_core
#
# extract email addresses
#
class enhance_extract_email(object):
def process(self, parameters=None, data=None):
if parameters is None:
parameters = {}
if data is None:
data = {}
# collect... |
cjaymes/pyscap | refs/heads/master | src/scap/model/xnl_2_0/LastNameElement.py | 1 | # Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... |
syphyr/android_kernel_lge_awifi | refs/heads/cm-13.0 | tools/perf/scripts/python/netdev-times.py | 11271 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
OCA/l10n-romania | refs/heads/13.0 | l10n_ro_config/models/__init__.py | 1 | from . import res_partner
from . import res_company
from . import res_config_settings
from . import res_bank
|
alkemics/luigi | refs/heads/master | test/contrib/hdfs_test.py | 31 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... |
P2poolBrasil/p2pool-dilmacoin | refs/heads/master | p2pool/bitcoin/height_tracker.py | 227 | from twisted.internet import defer
from twisted.python import log
import p2pool
from p2pool.bitcoin import data as bitcoin_data
from p2pool.util import deferral, forest, jsonrpc, variable
class HeaderWrapper(object):
__slots__ = 'hash previous_hash'.split(' ')
@classmethod
def from_header(cls, header... |
i5o/openshot-sugar | refs/heads/master | ignacio/openshot/uploads/youtube/gdata/sample_util.py | 106 | #!/usr/bin/env python
#
# Copyright (C) 2009 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 ... |
gnieboer/tensorflow | refs/heads/master | tensorflow/contrib/hooks/python/__init__.py | 140 | # 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... |
ctherien/pysptools | refs/heads/master | pysptools/tests/test_dnoise.py | 1 | #
#------------------------------------------------------------------------------
# Copyright (c) 2013-2014, Christian Therien
#
# 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
#
# h... |
drexly/tonginBlobStore | refs/heads/master | lib/django/contrib/auth/signals.py | 865 | from django.dispatch import Signal
user_logged_in = Signal(providing_args=['request', 'user'])
user_login_failed = Signal(providing_args=['credentials'])
user_logged_out = Signal(providing_args=['request', 'user'])
|
roadmapper/ansible | refs/heads/devel | test/support/windows-integration/plugins/modules/win_copy.py | 71 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk>
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
astrobin/astrobin | refs/heads/master | common/services/mentions_service.py | 1 | import re
from annoying.functions import get_object_or_None
from django.contrib.auth.models import User
from notification.models import NoticeSetting
class MentionsService(object):
@staticmethod
def get_mentions(text):
# type: (unicode) -> list[unicode]
regex = r'\[url=.*?\/users\/(.*?)\/\]@.... |
tfroehlich82/erpnext | refs/heads/develop | erpnext/education/doctype/course/course.py | 35 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
class Course(Document):
def validate(self):
self.validate_assess... |
pythonalliance/uno2bot | refs/heads/master | errors.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Telegram bot to play UNO in group chats
# Copyright (c) 2016 Jannes Höke <uno@jhoeke.de>
#
# 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 Foundatio... |
gkoelln/youtube-dl | refs/heads/master | youtube_dl/extractor/gamespot.py | 10 | from __future__ import unicode_literals
import re
from .once import OnceIE
from ..compat import (
compat_urllib_parse_unquote,
)
from ..utils import (
unescapeHTML,
url_basename,
dict_get,
)
class GameSpotIE(OnceIE):
_VALID_URL = r'https?://(?:www\.)?gamespot\.com/(?:video|article)s/(?:[^/]+/\d+... |
AutorestCI/azure-sdk-for-python | refs/heads/master | azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_device_script_parameters.py | 3 | # 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 ... |
israeleriston/scientific-week | refs/heads/master | backend/venv/lib/python3.5/site-packages/pip/utils/filesystem.py | 831 | import os
import os.path
from pip.compat import get_path_uid
def check_path_owner(path):
# If we don't have a way to check the effective uid of this process, then
# we'll just assume that we own the directory.
if not hasattr(os, "geteuid"):
return True
previous = None
while path != previ... |
olologin/scikit-learn | refs/heads/master | benchmarks/bench_sparsify.py | 323 | """
Benchmark SGD prediction time with dense/sparse coefficients.
Invoke with
-----------
$ kernprof.py -l sparsity_benchmark.py
$ python -m line_profiler sparsity_benchmark.py.lprof
Typical output
--------------
input data sparsity: 0.050000
true coef sparsity: 0.000100
test data sparsity: 0.027400
model sparsity:... |
amolenaar/gaphas | refs/heads/master | gaphas/tool/rubberband.py | 1 | from typing import Collection
from gi.repository import Gtk
from gaphas.item import Item
from gaphas.types import CairoContext
class RubberbandState:
def __init__(self) -> None:
self.reset()
def reset(self) -> None:
self.x0 = self.y0 = self.x1 = self.y1 = 0
class RubberbandPainter:
""... |
shivam1111/odoo | refs/heads/8.0 | openerp/report/printscreen/ps_list.py | 381 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
antoinecarme/pyaf | refs/heads/master | tests/artificial/transf_RelativeDifference/trend_MovingMedian/cycle_0/ar_12/test_artificial_32_RelativeDifference_MovingMedian_0_12_20.py | 1 | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 0, transform = "RelativeDifference", sigma = 0.0, exog_count = 20, ar_order = 12); |
guru-digital/CouchPotatoServer | refs/heads/master | couchpotato/core/media/movie/providers/userscript/filmcentrum.py | 81 | from couchpotato.core.media._base.providers.userscript.base import UserscriptBase
autoload = 'FilmCentrum'
class FilmCentrum(UserscriptBase):
includes = ['*://filmcentrum.nl/films/*']
|
Graghav/surabi | refs/heads/master | ADMIN/venv/lib/python2.7/site-packages/eve/tests/io/__init__.py | 14224 | # -*- coding: utf-8 -*-
|
rghe/ansible | refs/heads/devel | test/integration/targets/module_utils/module_utils/spam8/ham/__init__.py | 298 | eggs = 'spam8:eggs'
|
aurarad/auroracoin | refs/heads/stable | test/functional/feature_dbcrash.py | 1 | #!/usr/bin/env python3
# Copyright (c) 2017-2019 The Bitcoin Core developers
# Copyright (c) 2014-2019 The DigiByte Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test recovery from a crash during chainstate wri... |
EarthSystemCoG/COG | refs/heads/master | cog/plugins/esgf/permissionDAO.py | 2 | '''
Class to manage Permission objects in the ESGF database.
@author: Luca Cinquini
'''
from sqlalchemy.orm.exc import NoResultFound
from cog.plugins.esgf.objects import ESGFGroup, ESGFRole, ESGFUser, ESGFPermission, ROLE_USER
from django.core.exceptions import ObjectDoesNotExist
class PermissionDAO(object):
... |
devopservices/ansible | refs/heads/devel | plugins/inventory/vbox.py | 111 | #!/usr/bin/env python
# This file is part of Ansible,
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distr... |
anthgur/servo | refs/heads/master | tests/wpt/web-platform-tests/css/tools/apiclient/test.py | 52 | #!/usr/bin/env python
# coding=utf-8
#
# Copyright © 2013 Hewlett-Packard Development Company, L.P.
#
# This work is distributed under the W3C® Software License [1]
# in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR P... |
nwjs/chromium.src | refs/heads/nw45-log | third_party/blink/tools/blinkpy/common/net/web_test_results_unittest.py | 1 | # Copyright (c) 2010, Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... |
synthomat/pealbot | refs/heads/nps | plugins/admin.py | 1 | # coding: utf-8
"""
Copyright (c) 2012
Anton Zering <synth@lostprofile.de>
Julian Held <nemesis@creative-heads.org>
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/licen... |
chrisfranzen/django | refs/heads/master | django/db/backends/postgresql_psycopg2/base.py | 3 | """
PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
import logging
import sys
from django.db import utils
from django.db.backends import *
from django.db.backends.signals import connection_created
from django.db.backends.postgresql_psycopg2.operations import Database... |
mikedingjan/wagtail | refs/heads/master | wagtail/images/migrations/0020_add-verbose-name.py | 21 | # Generated by Django 2.0.3 on 2018-03-17 17:29
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wagtailimages', '0019_delete_filter'),
]
operations = [
migrations.AlterModelOptions(
name='image',
options={'verbose_name':... |
wangshunzi/Python_code | refs/heads/master | 01-Python基础阶段代码/02-Python常用数据类型操作/Python常用数据类型操作-列表.py | 1 |
#_*_ encoding:utf-8 _*_
# ------------------------------列表的定义方式1-----------------------------------
# names = ["zhangsan", "lisi", "wanger"]
# names = [1, True, 3, "sz"]
# names = []
# items = ["a", "b", "c"]
# # names = [1, 2, 3, "sz", True, items]
# names = [1, 2, 3, 'sz', True, ['a', 'b', 'c']]
#
# print(names, t... |
morevnaproject/scripts | refs/heads/master | blender/io_import_lipSync_Importer.py | 1 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... |
smartczm/python-learn | refs/heads/master | Old-day01-10/s13-day9/day9/homework/ftpserver/lib/__init__.py | 89 | #!/usr/bin/env python3.5
# -*- coding: utf-8 -*-
# Author: ChenLiang |
blmorris/micropython | refs/heads/master | tests/basics/lambda1.py | 119 | # lambda
f = lambda x, y: x + 3 * y
print(f(3, 5))
|
dcowden/cadquery-freecad-module | refs/heads/master | CadQuery/Libs/pygments/formatters/__init__.py | 34 | # -*- coding: utf-8 -*-
"""
pygments.formatters
~~~~~~~~~~~~~~~~~~~
Pygments formatters.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import sys
import types
import fnmatch
from os.path import basename
from pygments.form... |
nyalldawson/QGIS | refs/heads/master | python/plugins/processing/algs/qgis/RegularPoints.py | 15 | # -*- coding: utf-8 -*-
"""
***************************************************************************
RegularPoints.py
---------------------
Date : September 2014
Copyright : (C) 2014 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*********... |
bmaluenda/switch | refs/heads/master | examples/3zone_toy_stochastic_PySP/PySPInputGenerator.py | 1 | # Copyright 2016 The Switch Authors. All rights reserved.
# Licensed under the Apache License, Version 2, which is in the LICENSE file.
"""
Generate .dat files required by the PySP pyomo module, either for use with the
runef or runph commands. This script serves only as a specific example in
order to learn how the ru... |
janairacs/tekton | refs/heads/master | backend/appengine/routes/recado/__init__.py | 7 | __author__ = 'janairacs'
|
fidomason/kbengine | refs/heads/master | kbe/src/lib/python/Lib/lib2to3/tests/test_parser.py | 65 | """Test suite for 2to3's parser and grammar files.
This is the place to add tests for changes to 2to3's grammar, such as those
merging the grammars for Python 2 and 3. In addition to specific tests for
parts of the grammar we've changed, we also make sure we can parse the
test_grammar.py files from both Python 2 and P... |
pramasoul/micropython | refs/heads/master | tools/insert-usb-ids.py | 15 | # Reads the USB VID and PID from the file specified by sys.argv[1] and then
# inserts those values into the template file specified by sys.argv[2],
# printing the result to stdout
from __future__ import print_function
import sys
import re
import string
needed_keys = ("USB_PID_CDC_MSC", "USB_PID_CDC_HID", "USB_PID_CD... |
elysium001/zamboni | refs/heads/master | mkt/websites/models.py | 8 | # -*- coding: utf-8 -*-
import operator
import os.path
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from django.dispatch import receiver
from django_extensions.db.fields.json import JSONField
import mkt
from lib.utils import static_url
from mkt.api.fields... |
yanheven/ceilometer | refs/heads/master | ceilometer/storage/pymongo_base.py | 2 | #
# Copyright Ericsson AB 2013. All rights reserved
#
# Authors: Ildiko Vancsa <ildiko.vancsa@ericsson.com>
# Balazs Gibizer <balazs.gibizer@ericsson.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 co... |
ReganBell/QReview | refs/heads/master | build/lib/networkx/generators/community.py | 11 | import itertools
import math
import random
import networkx as nx
# Copyright(C) 2011 by
# Ben Edwards <bedwards@cs.unm.edu>
# Aric Hagberg <hagberg@lanl.gov>
# All rights reserved.
# BSD license.
__author__ = """\n""".join(['Ben Edwards (bedwards@cs.unm.edu)',
'Aric Hagberg (h... |
jneves/OctoPrint | refs/heads/master | src/octoprint/plugins/softwareupdate/updaters/python_updater.py | 35 | # coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
def can_perform_update(targ... |
beni55/networkx | refs/heads/master | networkx/algorithms/flow/capacityscaling.py | 9 | # -*- coding: utf-8 -*-
"""
Capacity scaling minimum cost flow algorithm.
"""
__author__ = """ysitu <ysitu@users.noreply.github.com>"""
# Copyright (C) 2014 ysitu <ysitu@users.noreply.github.com>
# All rights reserved.
# BSD license.
__all__ = ['capacity_scaling']
from itertools import chain
from math import log
imp... |
ErinCall/sync-engine | refs/heads/master | inbox/models/calendar.py | 3 | from datetime import datetime
from sqlalchemy import (Column, String, Text, Boolean,
UniqueConstraint, ForeignKey, DateTime)
from sqlalchemy.orm import relationship, backref
from inbox.models.base import MailSyncBase
from inbox.models.namespace import Namespace
from inbox.models.mixins import... |
jaredly/pyjamas | refs/heads/master | examples/showcase/compile.py | 5 | #!/usr/bin/env python
""" compile.py
Build the pyjamas-showcase web application.
We firstly scan through all the demo modules, pulling out the module
docstrings and the source code, and adding this information to the
demoInfo.py module. We then call Pyjamas to compile the application, and
finall... |
valiantljk/graph-partition | refs/heads/master | readwrite/edgelist.py | 3 | """
**********
Edge Lists
**********
Read and write NetworkX graphs as edge lists.
The multi-line adjacency list format is useful for graphs with nodes
that can be meaningfully represented as strings. With the edgelist
format simple edge data can be stored but node or graph data is not.
There is no way of representin... |
nanditav/15712-TensorFlow | refs/heads/master | tensorflow/python/training/sync_replicas_optimizer_test.py | 10 | # 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... |
cjaymes/pyscap | refs/heads/master | src/scap/model/xccdf_1_1/MessageType.py | 1 | # Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... |
pxquim/pelican-plugins | refs/heads/master | gist_directive/__init__.py | 59 | from gist_directive import *
|
kevinkindom/chrome_depto_tools | refs/heads/master | third_party/oauth2client/appengine.py | 154 | # Copyright (C) 2010 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 or agreed to in writ... |
tensorflow/gan | refs/heads/master | tensorflow_gan/python/tpu/__init__.py | 1 | # coding=utf-8
# Copyright 2020 The TensorFlow GAN 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 applicabl... |
PythonCHB/di_refcount | refs/heads/master | test_di.py | 1 | #!/usr/bin/vn python
"""
some really simple test code
mostly to assure you that it compiled
"""
from di import di, ref_by_id
def test_di_1():
obj = {'a': 'b', 1: 2}
obj_id = id(obj)
assert di(obj_id) == obj
def test_ref_by_id_1():
obj = ['a', 'list', 'of', 'stuff']
obj_id = id(obj)
asser... |
masschallenge/django-accelerator | refs/heads/development | accelerator/models/judge_feedback_component.py | 1 | # MIT License
# Copyright (c) 2017 MassChallenge, Inc.
from __future__ import unicode_literals
import swapper
from accelerator_abstract.models.base_judge_feedback_component import (
BaseJudgeFeedbackComponent
)
class JudgeFeedbackComponent(BaseJudgeFeedbackComponent):
class Meta(BaseJudgeFeedbackComponent.... |
voltaicsca/deluge | refs/heads/master | deluge/ui/console/modes/popup.py | 6 | # -*- coding: utf-8 -*-
#
# popup.py
#
# Copyright (C) 2011 Nick Lanham <nick@afternight.org>
#
# Deluge is free software.
#
# You may 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... |
breandan/java-algebra-system | refs/heads/master | examples/solv_locres_ore_iter.py | 1 | #
# jruby examples for jas.
# $Id$
#
from java.lang import System
from jas import SolvableRing, SolvPolyRing, PolyRing, RingElem
from jas import QQ, startLog, SLR
# Ore extension solvable polynomial example, roots
pcz = PolyRing(QQ(),"x,y,z");
#is automatic: [one,x,y,z] = pcz.gens();
zrelations = [z, y, y * z + x... |
vmindru/ansible | refs/heads/devel | lib/ansible/modules/cloud/google/gcp_compute_instance_group_facts.py | 9 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... |
MarcosCommunity/odoo | refs/heads/marcos-8.0 | comunity_modules/product_margin/wizard/__init__.py | 444 | # -*- 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... |
xxzh1982/listery | refs/heads/master | listery/context_processors.py | 1 | from django.conf import settings
def listery_info(request):
return {'LISTERY_TITLE': settings.LISTERY_TITLE if hasattr (settings, 'LISTERY_TITLE') else 'Listery' } |
shinsterneck/pdns | refs/heads/feature-geosql-backend | regression-tests.recursor-dnssec/recursortests.py | 2 | #!/usr/bin/env python2
from __future__ import print_function
import errno
import shutil
import os
import socket
import struct
import subprocess
import sys
import time
import unittest
import dns
import dns.message
from eqdnsmessage import AssertEqualDNSMessageMixin
def have_ipv6():
"""
Try to make an IPv6 so... |
chriscz/django-webpack-helper | refs/heads/master | webpack_helper/management/commands/npm_install.py | 1 | from . import *
from django.core.exceptions import ImproperlyConfigured
from subprocess import call, CalledProcessError
class Command(ParsingBaseCommand):
help = 'A wrapper for running npm install on a django app. Any arguments that are '\
'not captured by the command is passed unaltered to npm'
de... |
mugizico/smappPy | refs/heads/master | smappPy/get_tweets.py | 1 | """
Functions for getting tweets from Twitter (via REST API), file, and database
@auth dpb and yns
@date 2/17/2015
"""
import logging
from bson.json_util import loads
from tweepy import Cursor, TweepError
from json_util import ConcatJSONDecoder
def _check_limit(limit):
"""Checks a 'limit' param. If not an int, w... |
h2020-westlife-eu/VRE | refs/heads/master | api/migrations/0015_wlwebdavprovider.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0014_syncoperation_ongoing'),
]
operations = [
migrations.CreateModel(
name='WLWebdavProvider',
... |
kipohl/ncanda-data-integration | refs/heads/master | scripts/redcap/scoring/aeq/__init__.py | 2 | #!/usr/bin/env python
##
## See COPYING file distributed along with the ncanda-data-integration package
## for the copyright and license terms
##
import re
import pandas
import RwrapperNew
#
# Variables from surveys needed for AEQ
#
# LimeSurvey field names
lime_fields = [ "AEQ_sec1 [aeq1]", "AEQ_sec1 [aeq2]", ... |
bionikspoon/cache_requests | refs/heads/develop | setup.py | 1 | #!/usr/bin/env python
# coding=utf-8
"""The full documentation is at https://cache_requests.readthedocs.org."""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(s... |
pdellaert/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/aws_waf_web_acl.py | 6 | #!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
module: aws... |
Shephexd/MachineLearning | refs/heads/master | tensorflow/linear_regression/gradient.py | 1 | import tensorflow as tf
import matplotlib.pyplot as plt
X = [1., 2., 3.]
Y = [1., 2., 3.]
m = n_samples = len(X)
#set model weigths
W = tf.placeholder(tf.float32)
hypothesis = tf.mul(X,W)
cost = tf.reduce_sum(tf.pow(hypothesis-Y, 2))/(m)
init = tf.initialize_all_variables()
W_val = []
cost_val = []
sess = tf.Ses... |
BronzeCrab/ud_fullstack_p4 | refs/heads/master | settings.py | 1 | #!/usr/bin/env python
"""settings.py
Udacity conference server-side Python App Engine app user settings
$Id$
created/forked from conference.py by wesc on 2014 may 24
"""
# Replace the following lines with client IDs obtained from the APIs
# Console or Cloud Console.
WEB_CLIENT_ID = '163972224113-gk2kbq9moh1rjt5mp... |
jbking/demo-appengine-django-golang | refs/heads/master | myproject/django/contrib/gis/tests/geo3d/models.py | 222 | from django.contrib.gis.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class City3D(models.Model):
name = models.CharField(max_length=30)
point = models.PointField(dim=3)
objects = models.GeoManager()
def __str__(self):
return self.n... |
AMObox/teammaniac | refs/heads/master | plugin.video.specto/resources/lib/sources/directdl_tv.py | 20 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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 l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.