repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
nathangeffen/django-pubman
refs/heads/master
pubman/sitemap.py
1
'''Creates sitemap for Story, Translation and Article models. ''' from django.contrib.sitemaps import Sitemap from models import Article, Story, Translation class ArticleSitemap(Sitemap): changefreq = "monthly" priority = 0.5 def items(self): return Article.objects.filter(Article.permission_to_vi...
rbenjamin/namebench
refs/heads/master
nb_third_party/dns/rdtypes/ANY/DLV.py
248
# Copyright (C) 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND...
tamsky/ansible-upstream
refs/heads/devel
lib/ansible/plugins/action/debug.py
8
# Copyright 2012, Dag Wieers <dag@wieers.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later versi...
nervenXC/topical_word_embeddings
refs/heads/master
TWE-2/gensim/corpora/malletcorpus.py
85
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Corpus in Mallet format of List-Of-Words. """ from __future__ import with_statement import logging from gensim import utils from gensim.corpora import LowCorpus logger = logging.getLogger...
aaronxsu/raster-foundry
refs/heads/develop
app-lambda/rflambda/landsat8/create_scene.py
2
import functools import json import logging import os import re from typing import Any, Dict, List, Tuple import uuid import boto3 # type: ignore from rflambda.fields import ( FilterFields, Footprints ) from rflambda.landsat8.new_landsat8_event import NewLandsat8Event logger = logging.getLogger(__name__) s3...
overtherain/scriptfile
refs/heads/master
software/googleAppEngine/lib/django_1_2/tests/regressiontests/views/tests/generic/date_based.py
99
# coding: utf-8 from django.test import TestCase from datetime import datetime, date from datetime import timedelta from regressiontests.views.models import Article, Author, DateArticle class ObjectDetailTest(TestCase): fixtures = ['testdata.json'] def setUp(self): # Correct the date for the current ar...
HiroIshikawa/21playground
refs/heads/master
visualizer/_app_boilerplate/venv/lib/python3.5/site-packages/jinja2/defaults.py
336
# -*- coding: utf-8 -*- """ jinja2.defaults ~~~~~~~~~~~~~~~ Jinja default filters and tags. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from jinja2._compat import range_type from jinja2.utils import generate_lorem_ipsum, Cycler, Joiner # defaults for ...
marhar/mavlink
refs/heads/master
cmake/arkcmake/updateArkcmake.py
49
#!/usr/bin/python # Author: Lenna X. Peterson (github.com/lennax) # Based on bash script by James Goppert (github.com/jgoppert) # # script used to update cmake modules from git repo, can't make this # a submodule otherwise it won't know how to interpret the CMakeLists.txt # # # # # # subprocess# # # # # # # # # # # # #...
Vvucinic/Wander
refs/heads/master
venv_2_7/lib/python2.7/site-packages/pandas/sparse/array.py
9
""" SparseArray data structure """ from __future__ import division # pylint: disable=E1101,E1103,W0231 from numpy import nan, ndarray import numpy as np from pandas.core.base import PandasObject import pandas.core.common as com from pandas import compat, lib from pandas.compat import range from pandas._sparse impor...
sahildua2305/eden
refs/heads/master
controllers/delphi.py
4
# coding: utf8 """ Delphi Decision Maker - Controllers """ module = request.controller resourcename = request.function if not settings.has_module(module): raise HTTP(404, body="Module disabled: %s" % module) # ============================================================================= def index(): """...
mfalesni/cfme_tests
refs/heads/master
cfme/tests/physical_infrastructure/ui/test_physical_server_details.py
2
# -*- coding: utf-8 -*- import pytest from cfme.utils.appliance.implementations.ui import navigate_to from cfme.physical.provider.lenovo import LenovoProvider pytestmark = [pytest.mark.tier(3), pytest.mark.provider([LenovoProvider], scope="module")] @pytest.fixture(scope="module") def physical_server(appliance, pro...
abilian/abilian-core
refs/heads/master
src/abilian/web/preferences/tests/test_user_preferences.py
1
"""""" import imghdr from pathlib import Path from flask import request, url_for from flask_login import login_user from abilian.core.models.subjects import create_root_user from abilian.web.preferences.user import UserPreferencesForm AVATAR_COLORMAP = Path(__file__).parent / "avatar-colormap.png" def test_form_ph...
nojhan/weboob-devel
refs/heads/master
modules/cappedtv/__init__.py
7
# -*- coding: utf-8 -*- from .module import CappedModule __all__ = ['CappedModule']
uname/bleproxy
refs/heads/master
PC/BleProxyDesk/net/TcpClient.py
1
#-*- coding: utf-8 -*- from log import logger from SigObject import sigObject import struct import signals import socket import select import threading class TcpClient(threading.Thread): def __init__(self, ip=None, port=None): threading.Thread.__init__(self) self.stopflag = False self....
eugena/django
refs/heads/master
tests/auth_tests/models/with_foreign_key.py
197
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, Group from django.db import models class Email(models.Model): email = models.EmailField(verbose_name='email address', max_length=255, unique=True) class Meta: app_label = 'auth' class CustomUserWithFKManager(BaseUserManager):...
stelligent/ansible-modules-extras
refs/heads/devel
cloud/vmware/vmware_migrate_vmk.py
45
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.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 Li...
xxd3vin/spp-sdk
refs/heads/master
opt/Python27/Lib/lib2to3/pgen2/conv.py
72
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Convert graminit.[ch] spit out by pgen to Python code. Pgen is the Python parser generator. It is useful to quickly create a parser from a grammar file in Python's grammar notation. But I don't wa...
gxx/lettuce
refs/heads/master
tests/integration/lib/Django-1.2.5/django/conf/locale/ml/formats.py
105
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # DATE_FORMAT = 'N j, Y' TIME_FORMAT = 'P' DATETIME_FORMAT = 'N j, Y, P' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT = 'F j' SHORT_DATE_FORMAT = 'm/d/Y' SHORT_DATETIME_FORMAT = 'm/d/Y P' FIRST_DAY_OF_WEEK = 0 # Sunday DAT...
semonte/intellij-community
refs/heads/master
python/testData/optimizeImports/joinFromImportsIgnoresStarImports.after.py
35
from module import * from module import _hidden2, _hidden1 print(_hidden1, _hidden2)
pepeportela/edx-platform
refs/heads/master
lms/djangoapps/course_api/permissions.py
85
""" Course API Authorization functions """ from student.roles import GlobalStaff def can_view_courses_for_username(requesting_user, target_username): """ Determine whether `requesting_user` has permission to view courses available to the user identified by `target_username`. Arguments: reque...
IanLewis/django-lifestream
refs/heads/master
tests.py
2
import os import sys import django APP_MODULE = 'lifestream' def main(): """ Standalone django model test with a 'memory-only-django-installation'. You can play with a django model without a complete django app installation. http://www.djangosnippets.org/snippets/1044/ """ os.environ["DJANGO_S...
hanicker/odoo
refs/heads/8.0
addons/website_event_sale/models/__init__.py
428
import product import website import sale_order
bartekjagiello/inteygrate_flaskapp
refs/heads/master
yowsup/layers/protocol_acks/protocolentities/ack.py
70
from yowsup.structs import ProtocolEntity, ProtocolTreeNode class AckProtocolEntity(ProtocolEntity): ''' <ack class="{{receipt | message | ?}}" id="{{message_id}}"> </ack> ''' def __init__(self, _id, _class): super(AckProtocolEntity, self).__init__("ack") self._id = _id sel...
napkindrawing/ansible
refs/heads/devel
lib/ansible/plugins/action/dellos9_config.py
113
# # Copyright 2015 Peter Sprygada <psprygada@ansible.com> # # Copyright (c) 2017 Dell Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the L...
NeuroVault/NeuroVault
refs/heads/master
neurovault/apps/users/views.py
4
import datetime from django.conf import settings from django.http.response import (HttpResponseRedirect, HttpResponseForbidden, Http404) from django.utils.crypto import get_random_string from django.shortcuts import render, get_object_or_404, render_to_response from django.contrib.aut...
xuzha/elasticsearch
refs/heads/master
dev-tools/prepare_release_update_documentation.py
269
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
woobe/h2o
refs/heads/master
py/testdir_multi_jvm/test_rf_hhp_2a_fvec.py
1
import unittest, time, sys sys.path.extend(['.','..','py']) import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i, h2o_exec, h2o_rf class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): localhost = h2o.decide_if_localhost() ...
hainm/dask
refs/heads/master
pframe/categories.py
4
import pandas as pd """ Strip and re-apply category information --------------------------------------- Categoricals are great for storage as long as we don't repeatedly store the categories themselves many thousands of times. Lets collect category information once, strip it from all of the shards, store, then re-ap...
jnovinger/django
refs/heads/master
django/contrib/auth/tests/custom_user.py
463
from django.contrib.auth.models import ( AbstractBaseUser, AbstractUser, BaseUserManager, Group, Permission, PermissionsMixin, UserManager, ) from django.db import models # The custom User uses email as the unique identifier, and requires # that every user provide a date of birth. This lets us test # changes ...
admcrae/tensorflow
refs/heads/master
tensorflow/contrib/framework/python/ops/variables_test.py
62
# 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...
lnls-sirius/dev-packages
refs/heads/master
siriuspy/siriuspy/ramp/reconst_factory.py
1
"""Reconstruction factories.""" from copy import deepcopy as _dcopy import numpy as _np from scipy.optimize import least_squares from ..epics import PV as _PV from ..search import PSSearch as _PSSearch, LLTimeSearch as _LLTimeSearch, \ MASearch as _MASearch from .ramp import BoosterRamp as _BORamp from .conn impo...
freedomtan/tensorflow
refs/heads/master
tensorflow/python/training/device_setter.py
22
# 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...
loopCM/chromium
refs/heads/trunk
tools/omahaproxy.py
164
#!/usr/bin/env python # Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Chrome Version Tool Scrapes Chrome channel information and prints out the requested nugget of information. """ import json imp...
Jaiz909/youtube-dl
refs/heads/master
youtube_dl/extractor/tass.py
166
# encoding: utf-8 from __future__ import unicode_literals import json from .common import InfoExtractor from ..utils import ( js_to_json, qualities, ) class TassIE(InfoExtractor): _VALID_URL = r'https?://(?:tass\.ru|itar-tass\.com)/[^/]+/(?P<id>\d+)' _TESTS = [ { 'url': 'http://t...
MattsFleaMarket/python-for-android
refs/heads/master
python-modules/twisted/twisted/python/test/test_syslog.py
60
# Copyright (c) 2009 Twisted Matrix Laboratories. # See LICENSE for details. from twisted.trial.unittest import TestCase from twisted.python.failure import Failure try: import syslog as stdsyslog except ImportError: stdsyslog = None else: from twisted.python import syslog class SyslogObserverTests(Test...
FFMG/myoddweb.piger
refs/heads/master
monitor/api/python/Python-3.7.2/Tools/scripts/fixps.py
112
#!/usr/bin/env python3 # Fix Python script(s) to reference the interpreter via /usr/bin/env python. # Warning: this overwrites the file without making a backup. import sys import re def main(): for filename in sys.argv[1:]: try: f = open(filename, 'r') except IOError as msg: ...
iivic/BoiseStateX
refs/heads/master
lms/djangoapps/instructor/views/legacy.py
33
""" Instructor Views """ ## NOTE: This is the code for the legacy instructor dashboard ## We are no longer supporting this file or accepting changes into it. # pylint: disable=line-too-long, missing-docstring from contextlib import contextmanager import csv import json import logging import os import re import requests...
nikolay-fedotov/networking-cisco
refs/heads/master
networking_cisco/plugins/ml2/drivers/cisco/nexus/nexus_network_driver.py
1
# Copyright 2013 OpenStack Foundation # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
Hybrid-Cloud/badam
refs/heads/master
patches_tool/aws_patch/aws_deps/libcloud/dns/drivers/rackspace.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 ...
armab/st2
refs/heads/master
st2api/tests/unit/controllers/v1/test_triggers.py
13
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
4eek/edx-platform
refs/heads/master
lms/djangoapps/certificates/views/badges.py
85
""" Certificate views for open badges. """ from django.shortcuts import redirect, get_object_or_404 from opaque_keys.edx.locator import CourseLocator from util.views import ensure_valid_course_key from eventtracking import tracker from certificates.models import BadgeAssertion @ensure_valid_course_key def track_shar...
wllmtrng/ggplot
refs/heads/master
tests/test_geom_with_data.py
13
from __future__ import (absolute_import, division, print_function, unicode_literals) from ggplot import * gg = ggplot(mtcars, aes("wt", "mpg")) + geom_point() g2 = gg + geom_text(aes(label="name"), data=mtcars[mtcars.cyl == 6]) g2.draw() #print(g2)
mscuthbert/abjad
refs/heads/master
abjad/tools/schemetools/test/test_schemetools_Scheme_format_scheme_value.py
2
# -*- encoding: utf-8 -*- from abjad import * def test_schemetools_Scheme_format_scheme_value_01(): assert schemetools.Scheme.format_scheme_value(1) == '1' assert schemetools.Scheme.format_scheme_value(True) == '#t' assert schemetools.Scheme.format_scheme_value(False) == '#f' assert schemetools.Schem...
EricMuller/mywebmarks-backend
refs/heads/master
requirements/twisted/Twisted-17.1.0/src/twisted/mail/test/test_mail.py
9
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for large portions of L{twisted.mail}. """ import os import errno import shutil import pickle import StringIO import email.message import email.parser import tempfile import signal import time from hashlib import md5 from zope.interfac...
dllatas/deepLearning
refs/heads/master
uppmax/cifar10_multi_gpu_train.py
3
# 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...
jabez1314/youtube-dl
refs/heads/master
youtube_dl/extractor/planetaplay.py
113
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ExtractorError class PlanetaPlayIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?planetaplay\.com/\?sng=(?P<id>[0-9]+)' _API_URL = 'http://planetaplay.com/action/playlist/?sng={0:}' ...
AnzenSolutions/ASWCP-Daemon
refs/heads/master
client.py
1
#!/usr/bin/env python """ Only import what we absolutely need first. """ from base64 import b64encode as encode,b64decode as decode import sys import os import hashlib # We want to use SHA-3 hashes but if we're not running Python >= 3.4, have to import the lib too if sys.version_info < (3,4): import sha3 try: ...
SummerCamp17/Gymkhana-Nominations
refs/heads/master
nomi/migrations/0001_initial.py
2
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-05-22 18:48 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migratio...
dfalt974/SickRage
refs/heads/master
lib/future/moves/urllib/robotparser.py
83
from __future__ import absolute_import from future.utils import PY3 if PY3: from urllib.robotparser import * else: __future_module__ = True from robotparser import *
mozilla/captain
refs/heads/master
vendor/lib/python/django/contrib/gis/tests/layermap/models.py
230
from django.contrib.gis.db import models class State(models.Model): name = models.CharField(max_length=20) objects = models.GeoManager() class County(models.Model): name = models.CharField(max_length=25) state = models.ForeignKey(State) mpoly = models.MultiPolygonField(srid=4269) # Multipolygon in...
hbenaouich/Learning-Python
refs/heads/master
Learning-Python3-The-Hard-Way/24-More Practice/ex24.py
1
print("Let's practice eveything.") print('You\'d need to know \' bout escapes with \\ that do:') print('\n newlines and \t tabs.') poem = """ \t The lovely world with magic so firmly planted cannot discern \n the needs of love nor comprehend passion from intuition and requires an explanation \n\t\twhere there is none....
facelessuser/Pywin32
refs/heads/master
lib/x64/win32/lib/sspi.py
4
""" Helper classes for SSPI authentication via the win32security module. SSPI authentication involves a token-exchange "dance", the exact details of which depends on the authentication provider used. There are also a number of complex flags and constants that need to be used - in most cases, there are reasonabl...
hmcmooc/muddx-platform
refs/heads/master
common/lib/xmodule/xmodule/fields.py
33
import time import logging import re from xblock.fields import Field import datetime import dateutil.parser from pytz import UTC log = logging.getLogger(__name__) class Date(Field): ''' Date fields know how to parse and produce json (iso) compatible formats. Converts to tz aware datetimes. ''' # Se...
jatraug/Dataclass
refs/heads/master
Module5/assignment4.py
3
import numpy as np import pandas as pd from sklearn import preprocessing import matplotlib.pyplot as plt import matplotlib # # TODO: Parameters to play around with PLOT_TYPE_TEXT = False # If you'd like to see indices PLOT_VECTORS = True # If you'd like to see your original features in P.C.-Space matplotl...
BeyondTheClouds/nova
refs/heads/disco/mitaka
nova/objects/block_device.py
6
# Copyright 2013 Red Hat 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 ag...
maxim-s-barabash/ZebraTrace
refs/heads/master
src/zebratrace/geom/dom.py
1
# Copyright 2018 Maxim.S.Barabash <maxim.s.barabash@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
xbfool/hackerrank_xbfool
refs/heads/master
src/algorithms/combinatorics/minimum_draws.py
1
times = input() for i in range(times): a = input() print a + 1
Nick-Hall/gramps
refs/heads/master
gramps/gen/db/generic.py
4
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2015-2016 Gramps Development Team # Copyright (C) 2016 Nick Hall # # 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...
arijeetmkh/hephaestus
refs/heads/master
hephaestus/exceptions.py
1
from __future__ import absolute_import, division, print_function, unicode_literals class TransportError(Exception): pass class TransportFileNotFound(OSError): pass class TransportNotFound(TransportError): pass class TransportLoadError(TransportError): pass class TransportRequirementError(Trans...
nielsvanoch/django
refs/heads/master
django/db/backends/sqlite3/base.py
9
""" SQLite3 backend for django. Works with either the pysqlite2 module or the sqlite3 module in the standard library. """ from __future__ import unicode_literals import datetime import decimal import re import uuid import warnings from django.conf import settings from django.db import utils from django.db.backends i...
eddyb/servo
refs/heads/master
tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/serve-with-content-type.py
161
import os def main(request, response): directory = os.path.dirname(__file__) try: file_name = request.GET.first("fn") content_type = request.GET.first("ct") with open(os.path.join(directory, file_name), "rb") as fh: content = fh.read() response.headers.set("Content...
pataquets/namecoin-core
refs/heads/master
contrib/linearize/linearize-hashes.py
47
#!/usr/bin/env python3 # # linearize-hashes.py: List blocks in a linear, no-fork version of the chain. # # Copyright (c) 2013-2019 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 http.client imp...
greyhwndz/rethinkdb
refs/heads/next
external/v8_3.30.33.16/build/gyp/pylib/gyp/generator/xcode_test.py
2479
#!/usr/bin/env python # 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. """ Unit tests for the xcode.py file. """ import gyp.generator.xcode as xcode import unittest import sys class TestEscapeXcodeDefine(unit...
nexusriot/cinder
refs/heads/master
cinder/tests/unit/test_quota.py
3
# 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 compliance with the License. You may obtain # a...
ariakerstein/twitterFlaskClone
refs/heads/master
project/lib/python2.7/site-packages/werkzeug/contrib/profiler.py
362
# -*- coding: utf-8 -*- """ werkzeug.contrib.profiler ~~~~~~~~~~~~~~~~~~~~~~~~~ This module provides a simple WSGI profiler middleware for finding bottlenecks in web application. It uses the :mod:`profile` or :mod:`cProfile` module to do the profiling and writes the stats to the stream provide...
mapr/hue
refs/heads/hue-3.9.0-mapr
desktop/libs/librdbms/src/librdbms/server/dbms.py
25
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
lumig242/Hue-Integration-with-CDAP
refs/heads/pull3
desktop/core/ext-py/Django-1.6.10/django/db/backends/postgresql_psycopg2/base.py
47
""" PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ import sys from django.db.backends import * from django.db.backends.postgresql_psycopg2.operations import DatabaseOperations from django.db.backends.postgresql_psycopg2.client import DatabaseClient from django.db.b...
mollstam/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/django/test/utils.py
82
import logging import re import sys import time import warnings from contextlib import contextmanager from functools import wraps from unittest import skipIf, skipUnless from xml.dom.minidom import Node, parseString from django.apps import apps from django.conf import UserSettingsHolder, settings from django.core impo...
benoitsteiner/tensorflow
refs/heads/master
tensorflow/contrib/tfprof/python/tools/tfprof/tfprof_logger_test.py
46
# 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...
idano/home
refs/heads/master
lib/ansible/runner/lookup_plugins/password.py
7
# (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com> # (c) 2013, Javier Candeira <javier@candeira.com> # (c) 2013, Maykel Moya <mmoya@speedyrails.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...
apoelstra/bitcoin
refs/heads/master
test/functional/mempool_resurrect.py
25
#!/usr/bin/env python3 # Copyright (c) 2014-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test resurrection of mined transactions when the blockchain is re-organized.""" from test_framework.bl...
stepanov-valentin/lpschedule
refs/heads/dev
schedule/models.py
2
# -*- coding: utf-8 -*- """App models.""" from schedule.core import db from sqlalchemy.ext.declarative import declared_attr class Base(object): @declared_attr def __tablename__(self): return self.__name__.lower() class Lesson(Base, db.Model): lesson_id = db.Column(db.Integer, primary_key=True) ...
kayson-hansen/Project-Euler
refs/heads/master
Python/022_names_scores.py
1
from time import time from sys import argv script, filename = argv alphabet = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ") for x in range(1, 27): alphabet[x-1] = (alphabet[x-1], x) opened = open(filename) listed = opened.read().split(",") for i in range(0, len(listed)): listed[i] = listed[i][1:-1] sort = ...
amitdo/ocropy
refs/heads/master
OLD/distance.py
15
################################################################ ### Native code neural network with backpropagation training. ################################################################ from __future__ import with_statement __all__ = "MLP".split() from numpy import * from pylab import * from scipy import * fro...
dbrnz/PythonQtCopy
refs/heads/master
examples/NicePyConsole/pygments/styles/colorful.py
135
# -*- coding: utf-8 -*- """ pygments.styles.colorful ~~~~~~~~~~~~~~~~~~~~~~~~ A colorful style, inspired by CodeRay. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, ...
salazardetroya/libmesh
refs/heads/master
doc/statistics/cloc_libmesh.py
1
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np import math # Import stuff for working with dates from datetime import datetime from matplotlib.dates import date2num # git checkout `git rev-list -n 1 --before="$my_date" master` # cloc.pl src/*/*.C include/*/*.h data = [ # 2003 - All data fro...
longmen21/edx-platform
refs/heads/master
lms/djangoapps/notifier_api/serializers.py
61
from django.contrib.auth.models import User from django.http import Http404 from rest_framework import serializers from openedx.core.djangoapps.course_groups.cohorts import is_course_cohorted from notification_prefs import NOTIFICATION_PREF_KEY from lang_pref import LANGUAGE_KEY class NotifierUserSerializer(serializ...
pysb/pysb
refs/heads/master
pysb/tools/sensitivity_analysis.py
4
import os from itertools import product import matplotlib.pyplot as plt from matplotlib import gridspec import numpy as np from pysb.bng import generate_equations import pysb.simulator.base from pysb.logging import get_logger import warnings class PairwiseSensitivity(object): """ Pairwise sensitivity analysis of ...
billygoo/dev-365
refs/heads/master
python/flask/minitwit/venv/Lib/site-packages/jinja2/bccache.py
256
# -*- coding: utf-8 -*- """ jinja2.bccache ~~~~~~~~~~~~~~ This module implements the bytecode cache system Jinja is optionally using. This is useful if you have very complex template situations and the compiliation of all those templates slow down your application too much. Situations whe...
andyclymer/ControlBoard
refs/heads/master
lib/modules/BreakfastSerial/examples/led.py
3
#! /usr/bin/env python """ This is an example that demonstrates how to blink an led using BreakfastSerial. It assumes you have an led wired up to pin 13. """ from BreakfastSerial import Led, Arduino board = Arduino() led = Led(board, 13) led.blink(200) # Run an interactive shell so you can play (not required) impor...
ndparker/tdi
refs/heads/master
tests/nosed/unit/test_graph.py
1
# -*- coding: ascii -*- r""" :Copyright: Copyright 2014 - 2015 Andr\xe9 Malo or his licensors, as applicable :License: 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....
kaplun/Invenio-OpenAIRE
refs/heads/OpenAIRE
modules/websubmit/lib/websubmit_templates.py
2
## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 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 ...
mikewiebe-ansible/ansible
refs/heads/devel
lib/ansible/modules/files/archive.py
5
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Ben Doherty <bendohmv@gmail.com> # Sponsored by Oomph, Inc. http://www.oomphinc.com # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_impor...
allotria/intellij-community
refs/heads/master
python/testData/refactoring/rename/renameParameterWithDecorator_after.py
10
from functools import wraps def d(x): def dec(f): @wraps(f) def wrapper(*args, **kwargs): print(f'x = {x}') return f(*args, **kwargs) return wrapper return dec class C: foo = 0 @d(foo) # 2. This is renamed either but it shouldn't def f(self, bar)...
Xls1994/Tensorflow-Turitors
refs/heads/master
09-Utils/tf_read_file.py
1
# -*- coding: utf-8 -*- ''' author:yangyl ''' import tensorflow as tf import os writer =tf.python_io.TFRecordWriter("train.record") fileName ='./data/test.csv' with open(fileName,'r')as f: for line in f: array =line.split(",") data =[int (x)for x in array[:-2]] label =[int(x)for x in array...
mandeepdhami/horizon
refs/heads/master
openstack_dashboard/dashboards/project/stacks/resource_types/tables.py
59
# 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 the...
jac2130/BayesGame
refs/heads/master
foundations-of-python-network-programming/python2/18/rpyc_client.py
1
#!/usr/bin/env python # Foundations of Python Network Programming - Chapter 18 - rpyc_client.py # RPyC client import rpyc def noisy(string): print 'Noisy:', repr(string) proxy = rpyc.connect('localhost', 18861, config={'allow_public_attrs': True}) fileobj = open('testfile.txt') linecount = proxy.root.line_counte...
zangzhe/douban-review-api-testing
refs/heads/master
douban_client/api/guess.py
1
# -*- coding: utf-8 -*- from .base import DoubanAPIBase, DEFAULT_START, DEFAULT_COUNT class Guess(DoubanAPIBase): def __repr__(self): return '<DoubanAPI Guess>'
Srisai85/numpy
refs/heads/master
numpy/distutils/fcompiler/none.py
229
from __future__ import division, absolute_import, print_function from numpy.distutils.fcompiler import FCompiler compilers = ['NoneFCompiler'] class NoneFCompiler(FCompiler): compiler_type = 'none' description = 'Fake Fortran compiler' executables = {'compiler_f77': None, 'compiler_f...
m-soori/pjsip-blf
refs/heads/master
tests/pjsua/scripts-media-playrec/100_resample_lf_11_8.py
59
# $Id: 100_resample_lf_11_8.py 2052 2008-06-25 18:18:32Z nanang $ # from inc_cfg import * # simple test test_param = TestParam( "Resample (large filter) 11 KHZ to 8 KHZ", [ InstanceParam("endpt", "--null-audio --quality 10 --clock-rate 8000 --play-file wavs/input.11.wav --rec-file wavs/tmp.8.wav") ] )
alesdotio/Spirit
refs/heads/master
spirit/core/management/commands/spiritmakelocales.py
5
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os from django.core.management.base import BaseCommand, CommandError from django.core.management import call_command from django.conf import settings from ... import utils class Command(BaseCommand): help = 'Creates or updates .po files and...
mdanielwork/intellij-community
refs/heads/master
python/testData/editing/firstParamMetaNew.after.py
83
class A(type): def __new__(typ):
Unity-Technologies/ml-agents
refs/heads/exp-diverse-behavior
ml-agents-envs/mlagents_envs/registry/binary_utils.py
1
import urllib.request import tempfile import os import uuid import shutil import glob import yaml import hashlib from zipfile import ZipFile from sys import platform from typing import Tuple, Optional, Dict, Any from mlagents_envs.logging_util import get_logger logger = get_logger(__name__) # The default logical bl...
askeing/servo
refs/heads/master
tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/ogles/process-ogles2-tests.py
170
#!/usr/bin/python """generates tests from OpenGL ES 2.0 .run/.test files.""" import os import os.path import sys import re import json import shutil from optparse import OptionParser from xml.dom.minidom import parse if sys.version < '2.6': print 'Wrong Python Version !!!: Need >= 2.6' sys.exit(1) # each shad...
dhruvg/luigi
refs/heads/master
luigi/webhdfs.py
38
# -*- 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...
Srisai85/scikit-learn
refs/heads/master
sklearn/__check_build/setup.py
333
# Author: Virgile Fritsch <virgile.fritsch@inria.fr> # License: BSD 3 clause import numpy def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('__check_build', parent_package, top_path) config.add_extension('_check_build', ...
c0hen/django-venv
refs/heads/master
lib/python3.4/site-packages/pip/_vendor/requests/exceptions.py
362
# -*- coding: utf-8 -*- """ requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. """ from .packages.urllib3.exceptions import HTTPError as BaseHTTPError class RequestException(IOError): """There was an ambiguous exception that occurred while handling your request. ...
Lekanich/intellij-community
refs/heads/master
python/testData/mover/comment_afterDown.py
83
for item in lst: c = 1 #comment <caret> a = 1 b = 1
oesteban/fmriprep
refs/heads/master
fmriprep/__main__.py
3
from .cli.run import main if __name__ == '__main__': import sys from . import __name__ as module # `python -m <module>` typically displays the command as __main__.py if '__main__.py' in sys.argv[0]: sys.argv[0] = '%s -m %s' % (sys.executable, module) main()
glennlive/gnuradio-wg-grc
refs/heads/master
gr-blocks/python/blocks/qa_tag_gate.py
39
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # ...