repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
MarcCote/brainsearch | refs/heads/master | setup.py | 1 | # -- setup.py --
import numpy as np
from os.path import join as pjoin
from setuptools import setup
from Cython.Distutils import build_ext
from numpy.distutils.extension import Extension
# Define extensions
EXTS = []
for modulename, other_sources, language in (
('brainsearch.imagespeed', [], 'c'),
):
pyx_s... |
zdary/intellij-community | refs/heads/master | python/testData/resolve/multiFile/circularImport/x.py | 83 | import y
X = "X" |
AndrewGrossman/django | refs/heads/master | django/middleware/clickjacking.py | 87 | """
Clickjacking Protection Middleware.
This module provides a middleware that implements protection against a
malicious site loading resources from your site in a hidden frame.
"""
from django.conf import settings
class XFrameOptionsMiddleware(object):
"""
Middleware that sets the X-Frame-Options HTTP head... |
huran2014/huran.github.io | refs/heads/master | wot_gateway/usr/lib/python2.7/encodings/mac_farsi.py | 593 | """ Python Character Mapping Codec mac_farsi generated from 'MAPPINGS/VENDORS/APPLE/FARSI.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,err... |
Maccimo/intellij-community | refs/heads/master | python/testData/formatter/multilineIfConditionInParenthesesNestedExpressions_after.py | 44 | if (foo == 42 or
bar == 42 and
baz == 42):
pass
|
Stavitsky/neutron | refs/heads/master | neutron/db/migration/alembic_migrations/versions/6be312499f9_set_not_null_vlan_id_cisco.py | 15 | # Copyright 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
uwafsl/MissionPlanner | refs/heads/master | Lib/site-packages/numpy/doc/ufuncs.py | 94 | """
===================
Universal Functions
===================
Ufuncs are, generally speaking, mathematical functions or operations that are
applied element-by-element to the contents of an array. That is, the result
in each output array element only depends on the value in the corresponding
input array (or arrays) a... |
rwightman/pytorch-image-models | refs/heads/master | timm/models/vision_transformer_hybrid.py | 1 | """ Hybrid Vision Transformer (ViT) in PyTorch
A PyTorch implement of the Hybrid Vision Transformers as described in:
'An Image Is Worth 16 x 16 Words: Transformers for Image Recognition at Scale'
- https://arxiv.org/abs/2010.11929
`How to train your ViT? Data, Augmentation, and Regularization in Vision Transfor... |
StefanRijnhart/bank-statement-reconcile | refs/heads/8.0 | __unported__/account_statement_cancel_line/__openerp__.py | 14 | # -*- coding: utf-8 -*-
###############################################################################
# #
# Author: Leonardo Pistone #
# Copyright 2014 Camptocamp SA ... |
rnixx/kivy | refs/heads/master | examples/widgets/label_text_size.py | 21 |
'''
Label textsize
============
This example shows how the textsize and line_height property are used
to format label widget
'''
import kivy
kivy.require('1.0.7')
from kivy.app import App
from kivy.uix.label import Label
_long_text = ("""Lorem ipsum dolor sit amet, consectetur adipiscing elit. """
"""Phasellu... |
unb-libraries/phantomjs | refs/heads/master | src/breakpad/src/tools/gyp/tools/pretty_gyp.py | 148 | #!/usr/bin/env python
# Copyright (c) 2009 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.
# This file pretty-prints the contents of a GYP file.
import sys
import re
input = []
if len(sys.argv) > 1:
input_f... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/building/player/shared_player_garage_naboo_style_01.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/player/shared_player_garage_naboo_style_01.iff"
result.attribute_te... |
Jgarcia-IAS/Fidelizacion_odoo | refs/heads/master | openerp/addons/website_hr/__openerp__.py | 382 | {
'name': 'Team Page',
'category': 'Website',
'summary': 'Present Your Team',
'version': '1.0',
'description': """
Our Team Page
=============
""",
'author': 'OpenERP SA',
'depends': ['website', 'hr'],
'demo': [
'data/website_hr_demo.xml',
],
'data': [
'd... |
purduejun/webpymail | refs/heads/master | hlimap/__init__.py | 7 | # -*- coding: utf-8 -*-
# hlimap - High level IMAP library
# Copyright (C) 2008 Helder Guerreiro
## This file is part of hlimap.
##
## hlimap 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 ... |
marscher/bhmm | refs/heads/master | bhmm/util/config.py | 5 | """
Default configurations
"""
__author__ = 'noe'
import numpy as np
import logging
# compute kernel. Could be 'c' or 'python'
kernel = 'c'
# data type for floating-point operations. Use np.float32 or np.float64
dtype = np.float64
# print a lot of info?
verbose = False
def log_level():
if verbose:
r... |
adishjain/youtube-dl | refs/heads/master | youtube_dl/downloader/fragment.py | 77 | from __future__ import division, unicode_literals
import os
import time
from .common import FileDownloader
from .http import HttpFD
from ..utils import (
encodeFilename,
sanitize_open,
)
class HttpQuietDownloader(HttpFD):
def to_screen(self, *args, **kargs):
pass
class FragmentFD(FileDownloade... |
Guidobelix/pyload | refs/heads/stable | module/plugins/captcha/AdYouLike.py | 5 | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.misc import json
from module.plugins.internal.CaptchaService import CaptchaService
class AdYouLike(CaptchaService):
__name__ = "AdYouLike"
__type__ = "captcha"
__version__ = "0.10"
__status__ = "testing"
__description__ = """... |
oinopion/django | refs/heads/master | tests/i18n/patterns/urls/included.py | 452 | from django.conf.urls import url
from django.views.generic import TemplateView
view = TemplateView.as_view(template_name='dummy.html')
urlpatterns = [
url(r'^foo/$', view, name='not-prefixed-included-url'),
]
|
netgroup/floodlight | refs/heads/master | example/graphTopo.py | 148 | #!/usr/bin/python
import urllib2
import json
import sys
def simple_json_get(url):
return json.loads(urllib2.urlopen(url).read())
def shorten(s):
return s.replace('net.floodlightcontroller','n.f'
).replace('com.bigswitch','c.b')
def usage(s):
sys.stderr.write("Usage:\ngrahTopo.py hostname ... |
mspark93/VTK | refs/heads/master | Imaging/Core/Testing/Python/TestStencilWithImage.py | 20 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# A script to test the stencil filter by using one image
# to stencil another
# Image pipeline
reader1 = vtk.vtkBMPReader()
reader1.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/masonr... |
klothius/htc_magic_kernel_2635 | refs/heads/master | Documentation/networking/cxacru-cf.py | 14668 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... |
mtmiller/rlwrap | refs/heads/master | filters/censor_passwords.py | 2 | #!/usr/bin/env python3
"""
a demo for masking sensitive input in the history
Usage:
rlwrap -H history -f censor_passwords.py sqlplus scott@<hostname>:1521/ORCL
SQL > create user test identified by secret;
"""
import sys
import os
if 'RLWRAP_FILTERDIR' in os.environ:
sys.path.append(os.environ['RLWRAP_FILTERDI... |
TheCamusean/DLRCev3 | refs/heads/master | object_detection/nn_object_detection/utils.py | 1 | import numpy as np
import cv2
def flip_coords(bbox):
"""
Flips the bounding boxes
"""
return np.asarray((bbox[1], bbox[0], bbox[3], bbox[2]))
def sorting_key(element1):
bbox1=element1[0]
return bbox1[2]
def transform_coordinates(bbox, img_res):
bbox = np.asarray((box[1]*img_res[0], b... |
maxsocl/django | refs/heads/master | tests/admin_checks/models.py | 98 | """
Tests of ModelAdmin system checks logic.
"""
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Album(models.Model):
title = models.CharFie... |
JingZhou0404/flask | refs/heads/master | examples/blueprintexample/simple_page/simple_page.py | 183 | from flask import Blueprint, render_template, abort
from jinja2 import TemplateNotFound
simple_page = Blueprint('simple_page', __name__,
template_folder='templates')
@simple_page.route('/', defaults={'page': 'index'})
@simple_page.route('/<page>')
def show(page):
try:
return render... |
bcorbet/SickRage | refs/heads/master | lib/adba/__init__.py | 67 | #!/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... |
anntzer/numpy | refs/heads/master | numpy/f2py/capi_maps.py | 9 | #!/usr/bin/env python3
"""
Copyright 1999,2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
$Date: 2005/05/06 10:57:33 $
Pearu Peterso... |
Nmishin/updater | refs/heads/master | updater.py | 1 | #!/usr/bin/python
import json
import logging
import PyGithub
import argparse
from requests import ConnectionError
from logging.handlers import RotatingFileHandler
Org = "orgname"
# When we use GitHub API need use team_id instead team_name
Team_id = team_id # team id
Token = "Security token"
# Build connection
b = P... |
arifgursel/rauth | refs/heads/master | tests/test_session.py | 3 | # -*- coding: utf-8 -*-
'''
rauth.test_session
------------------
Test suite for rauth.session.
'''
from base import RauthTestCase
from rauth.session import OAuth1Session, OAuth2Session, OflySession
from mock import patch
import requests
import json
class RequestMixin(object):
def assert_ok(self,... |
tboyce021/home-assistant | refs/heads/dev | homeassistant/components/advantage_air/climate.py | 11 | """Climate platform for Advantage Air integration."""
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
FAN_AUTO,
FAN_HIGH,
FAN_LOW,
FAN_MEDIUM,
HVAC_MODE_COOL,
HVAC_MODE_DRY,
HVAC_MODE_FAN_ONLY,
HVAC_MODE_HEAT,
HVAC_MODE... |
averagehuman/python-dubbel | refs/heads/master | setup.py | 1 | # -*- coding: utf-8 -*-
import ez_setup
ez_setup.use_setuptools()
from setuptools import setup
import re
version_rx = r"^__version__ = '(.*)'$"
version_pattern = re.compile(version_rx)
fd = open('dubbel.py')
try:
for line in fd:
m = version_pattern.match(line)
if m:
break
else:
... |
Tejal011089/fbd_erpnext | refs/heads/develop | erpnext/patches/__init__.py | 37694 | from __future__ import unicode_literals
|
wkschwartz/django | refs/heads/stable/3.2.x | tests/template_tests/test_nodelist.py | 11 | from django.template import Context, Engine
from django.template.base import TextNode, VariableNode
from django.test import SimpleTestCase, ignore_warnings
from django.utils.deprecation import RemovedInDjango40Warning
class NodelistTest(SimpleTestCase):
@classmethod
def setUpClass(cls):
cls.engine = ... |
icdishb/scikit-learn | refs/heads/master | sklearn/preprocessing/_weights.py | 226 | import numpy as np
from ..utils.fixes import bincount
def _balance_weights(y):
"""Compute sample weights such that the class distribution of y becomes
balanced.
Parameters
----------
y : array-like
Labels for the samples.
Returns
-------
weights : array-like
The sa... |
plotly/plotly.py | refs/heads/master | packages/python/plotly/plotly/validators/scatter3d/error_z/_tracerefminus.py | 1 | import _plotly_utils.basevalidators
class TracerefminusValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="tracerefminus", parent_name="scatter3d.error_z", **kwargs
):
super(TracerefminusValidator, self).__init__(
plotly_name=plotly_name,
... |
pombredanne/pants | refs/heads/master | contrib/findbugs/tests/python/pants_test/__init__.py | 13048 | __import__('pkg_resources').declare_namespace(__name__)
|
GhostThrone/django | refs/heads/master | tests/from_db_value/models.py | 378 | import decimal
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Cash(decimal.Decimal):
currency = 'USD'
def __str__(self):
s = super(Cash, self).__str__(self)
return '%s %s' % (s, self.currency)
class CashField(models.DecimalField):
def _... |
Lawrence-Liu/scikit-learn | refs/heads/master | sklearn/ensemble/setup.py | 341 | import numpy
from numpy.distutils.misc_util import Configuration
def configuration(parent_package="", top_path=None):
config = Configuration("ensemble", parent_package, top_path)
config.add_extension("_gradient_boosting",
sources=["_gradient_boosting.c"],
incl... |
westinedu/wrgroups | refs/heads/master | django/conf/locale/mn/formats.py | 433 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'g:i:s A'
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =
... |
Priya663/PI-controller-in-ns-3 | refs/heads/master | src/core/examples/sample-simulator.py | 43 | # -*- Mode:Python; -*-
# /*
# * Copyright (c) 2010 INRIA
# *
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License version 2 as
# * published by the Free Software Foundation;
# *
# * This program is distributed in the hope that it will b... |
edxnercel/edx-platform | refs/heads/master | lms/djangoapps/courseware/tests/test_microsites.py | 42 | """
Tests related to the Microsites feature
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from nose.plugins.attrib import attr
from courseware.tests.helpers import LoginEnrollmentTestCase
from course_modes.models import CourseMode
from... |
kalkin/qubes-core-admin | refs/heads/master | qubes/qmemman/client.py | 1 | # pylint: skip-file
#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2010 Rafal Wojtczuk <rafal@invisiblethingslab.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; ei... |
obi-two/Rebelion | refs/heads/master | data/scripts/templates/object/static/structure/naboo/shared_poi_nboo_tent_small.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/structure/naboo/shared_poi_nboo_tent_small.iff"
result.attribute_templa... |
sometallgit/AutoUploader | refs/heads/master | Python27/Lib/site-packages/pip/_vendor/requests/packages/chardet/big5freq.py | 3132 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
tmpgit/intellij-community | refs/heads/master | python/testData/refactoring/extractmethod/DuplicateInClass.before.py | 75 |
class A:
def baz(self):
print<caret> 1
print 1
def bar(self):
print 1 |
nik-hil/fastai | refs/heads/master | deeplearning2/vgg16.py | 9 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
import warnings
from keras.models import Model
from keras.layers import Flatten, Dense, Input, Dropout
from keras.layers import Convolution2D, MaxPooling2D
from keras.engine.topology import get_source_inputs
from kera... |
Alexander-M-Waldman/local_currency_site | refs/heads/master | lib/python2.7/site-packages/django/contrib/gis/utils/layermapping.py | 335 | # LayerMapping -- A Django Model/OGR Layer Mapping Utility
"""
The LayerMapping class provides a way to map the contents of OGR
vector files (e.g. SHP files) to Geographic-enabled Django models.
For more information, please consult the GeoDjango documentation:
https://docs.djangoproject.com/en/dev/ref/contrib/gi... |
OpenPathView/batchPanoMaker | refs/heads/master | tests/unit/services/test_treat_rederbro_data.py | 1 | # coding: utf-8
# Copyright (C) 2017 Open Path View, Maison Du Libre
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# ... |
OpenVolunteeringPlatform/django-ovp-projects | refs/heads/master | ovp_projects/migrations/0028_auto_20170126_1648.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2017-01-26 16:48
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('ovp_projects', '0027_auto_20170113_1746'),
]
opera... |
waytai/django | refs/heads/master | tests/migrations/test_migrations_run_before/0002_second.py | 282 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("migrations", "0001_initial"),
]
operations = [
migrations.CreateModel(
"Book",
[
("... |
mrquim/repository.mrquim | refs/heads/master | script.module.youtube.dl/lib/youtube_dl/extractor/yinyuetai.py | 64 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import ExtractorError
class YinYueTaiIE(InfoExtractor):
IE_NAME = 'yinyuetai:video'
IE_DESC = '音悦Tai'
_VALID_URL = r'https?://v\.yinyuetai\.com/video(?:/h5)?/(?P<id>[0-9]+)'
_TESTS = [{
'url... |
kenshay/ImageScript | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/setuptools/lib2to3_ex.py | 418 | """
Customized Mixin2to3 support:
- adds support for converting doctests
This module raises an ImportError on Python 2.
"""
from distutils.util import Mixin2to3 as _Mixin2to3
from distutils import log
from lib2to3.refactor import RefactoringTool, get_fixers_from_package
import setuptools
class DistutilsRefactor... |
gic888/MIEN | refs/heads/master | optimizers/base.py | 1 |
## Copyright (C) 2005-2006 Graham I Cummins
## 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 d... |
VaibhavAgarwalVA/sympy | refs/heads/master | sympy/combinatorics/tests/test_permutations.py | 45 | from itertools import permutations
from sympy.core.compatibility import range
from sympy.combinatorics.permutations import (Permutation, _af_parity,
_af_rmul, _af_rmuln, Cycle)
from sympy.utilities.pytest import raises
rmul = Permutation.rmul
def test_Permutation():
# don't auto fill 0
raises(ValueError... |
moremorefor/Logpot | refs/heads/master | logpot/admin/file.py | 1 | #-*- coding: utf-8 -*-
from logpot.admin.base import AuthenticateView
from logpot.utils import ImageUtil
from flask import flash, redirect
from flask_admin import expose
from flask_admin.contrib.fileadmin import FileAdmin
from flask_admin.babel import gettext
import os
import os.path as op
from operator import itemg... |
RevelSystems/jsonzilla | refs/heads/master | jsonzilla/api.py | 1 | import random
from protocol import post
import requests
class JsonZilla:
def __init__(self, rpc_url, username, password):
self.service_url = rpc_url
self.username = username
self.password = password
self.session = requests.Session()
self.session.headers = {"Content-Type": "... |
kbrebanov/ansible | refs/heads/devel | test/integration/targets/module_utils/module_utils/service.py | 294 | sysv_is_enabled = 'sysv_is_enabled'
|
sinall/ShiPanE-Python-SDK | refs/heads/master | tests/strategyease_sdk/test_support.py | 1 | # -*- coding: utf-8 -*-
import unittest
from strategyease_sdk.support import Struct
class StructTest(unittest.TestCase):
def test_init(self):
config = Struct({"key": "value"})
self.assertEquals(config.key, "value")
|
khchine5/lino-welfare | refs/heads/master | lino_welfare/modlib/system/models.py | 1 | # -*- coding: UTF-8 -*-
# Copyright 2013-2018 Luc Saffre
# This file is part of Lino Welfare.
#
# Lino Welfare is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at y... |
ovnicraft/openerp-restaurant | refs/heads/master | membership/wizard/__init__.py | 432 | # -*- 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... |
iver333/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/filesystem_unittest.py | 115 | # vim: set fileencoding=utf-8 :
# 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, t... |
plotly/plotly.py | refs/heads/master | packages/python/plotly/plotly/validators/streamtube/colorbar/_showexponent.py | 1 | import _plotly_utils.basevalidators
class ShowexponentValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="showexponent", parent_name="streamtube.colorbar", **kwargs
):
super(ShowexponentValidator, self).__init__(
plotly_name=plotly_name,
... |
ahmed-mahran/hue | refs/heads/master | desktop/core/ext-py/Mako-0.8.1/test/test_ast.py | 36 | import unittest
from mako import ast, exceptions, pyparser, util, compat
from test import eq_, requires_python_2
exception_kwargs = {
'source': '',
'lineno': 0,
'pos': 0,
'filename': ''}
class AstParseTest(unittest.TestCase):
def test_locate_identifiers(self):
"""test the location of ide... |
llhe/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/dataframe/tensorflow_dataframe.py | 20 | # 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... |
adamcandy/qgis-plugins-meshing-initial | refs/heads/master | release/rasterise_polygons/plugin_upload.py | 10 | #!/usr/bin/env python
##########################################################################
#
# QGIS-meshing plugins.
#
# Copyright (C) 2012-2013 Imperial College London and others.
#
# Please see the AUTHORS file in the main source directory for a
# full list of copyright holders.
#
# Dr Adam S. Can... |
wreckage/django-happenings | refs/heads/master | happenings/__init__.py | 1 | __version__ = '0.3.3'
__url__ = 'https://github.com/wreckage/django-happenings'
|
codeaudit/gp-structure-search | refs/heads/master | experiments/26-Feb-test.py | 3 | # Testing list of kernels
Experiment(description='Testing list of kernels',
data_dir='../data/kfold_data/',
max_depth=2,
random_order=False,
k=1,
debug=False,
local_computation=False,
n_rand=1,
sd=4,
max_jobs=500,
... |
sx-ruan/BEESEM | refs/heads/master | toolbox/motif.py | 2 | # coding: utf-8
from systm import *
from codec import *
from scipy import stats
class RC(list):
def __init__(self, iterable):
super(RC, self).__init__(self.RC(seq) for seq in iterable)
@classmethod
def RC(cls, seq):
"""
:param seq: str
:return: str
"""
retu... |
killerbat00/opalescence | refs/heads/master | opalescence/__main__.py | 1 | # !/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Opalescence is a simple torrent client.
"""
import argparse
import logging
import sys
from pathlib import Path
from opalescence import __version__, __author__, __year__, get_app_config
from opalescence.ui import cli, tui
def configure_logging(log_level, app_config)... |
anentropic/django-oscar | refs/heads/master | src/oscar/apps/dashboard/users/tables.py | 24 | from django_tables2 import A, Column, LinkColumn, TemplateColumn
from oscar.core.loading import get_class
DashboardTable = get_class('dashboard.tables', 'DashboardTable')
class UserTable(DashboardTable):
check = TemplateColumn(
template_name='dashboard/users/user_row_checkbox.html',
verbose_name... |
quarkslab/nodescan | refs/heads/master | bindings/python/examples/http.py | 1 | import pyleeloo
import pynodescan
ips = pyleeloo.ip_list_intervals()
ips.add("127.0.0.1")
ips.add("173.194.34.14")
ports = pyleeloo.port_list_intervals()
ports.add(pyleeloo.port(80, pyleeloo.protocol.TCP))
targets = pynodescan.IPV4TargetSet(ips, ports)
engine = pynodescan.AsyncEngine(targets, 100, 1)
class Callabl... |
nvoron23/avos | refs/heads/master | horizon/test/tests/messages.py | 31 | # Copyright 2012 Nebula, 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 agree... |
johnbachman/belpy | refs/heads/master | indra/benchmarks/assembly_eval/combine4/run_combined.py | 3 | import os
import csv
import pickle
from indra.literature import id_lookup
from indra.sources import trips, reach, index_cards
from assembly_eval import have_file, run_assembly
if __name__ == '__main__':
pmc_ids = [s.strip() for s in open('pmcids.txt', 'rt').readlines()]
# Load the REACH reading output
wit... |
IbpTeam/node-nodegit | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py | 437 | # 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.
"""GYP backend that generates Eclipse CDT settings files.
This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML
files that can be importe... |
cristiana214/cristianachavez214-cristianachavez | refs/heads/master | python/gdata/src/gdata/tlslite/utils/Cryptlib_AES.py | 359 | """Cryptlib AES implementation."""
from cryptomath import *
from AES import *
if cryptlibpyLoaded:
def new(key, mode, IV):
return Cryptlib_AES(key, mode, IV)
class Cryptlib_AES(AES):
def __init__(self, key, mode, IV):
AES.__init__(self, key, mode, IV, "cryptlib")
sel... |
quamilek/django | refs/heads/master | django/conf/locale/gl/formats.py | 619 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FORMAT = '... |
bzero/networkx | refs/heads/master | examples/drawing/unix_email.py | 62 | #!/usr/bin/env python
"""
Create a directed graph, allowing multiple edges and self loops, from
a unix mailbox. The nodes are email addresses with links
that point from the sender to the recievers. The edge data
is a Python email.Message object which contains all of
the email message data.
This example shows the po... |
danbeam/catapult | refs/heads/master | third_party/graphy/graphy/backends/google_chart_api/pie_chart_test.py | 33 | #!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
openstack/nova | refs/heads/master | nova/api/openstack/compute/aggregates.py | 3 | # Copyright (c) 2012 Citrix Systems, 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 ... |
treehopper-electronics/treehopper-sdk | refs/heads/master | Python/treehopper/libraries/io/expander/__init__.py | 1 | from treehopper.libraries.io.expander.shift_register import ChainableShiftRegisterOutput
|
motoz/pellmonMQTT | refs/heads/master | pellmonMQTT.py | 1 | #! /usr/bin/python
# -*- coding: utf-8 -*-
"""
Copyright (C) 2013 Anders Nylund
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 opti... |
dkodnik/Ant | refs/heads/master | addons/account/report/account_general_journal.py | 60 | # -*- 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... |
mrfuxi/docker-py | refs/heads/master | tests/fake_api.py | 5 | # Copyright 2013 dotCloud 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 t... |
rockyzhang/zhangyanhit-python-for-android-mips | refs/heads/master | python3-alpha/python3-src/Tools/scripts/h2py.py | 46 | #! /usr/bin/env python3
# Read #define's and translate to Python code.
# Handle #include statements.
# Handle #define macros with one argument.
# Anything that isn't recognized or doesn't translate into valid
# Python is ignored.
# Without filename arguments, acts as a filter.
# If one or more filenames are given, ou... |
SummerCamp17/Gymkhana-Nominations | refs/heads/master | gymkhana/wsgi.py | 2 | """
WSGI config for gymkhana project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SET... |
hbp-sanncs/pynam | refs/heads/master | benchmark.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# PyNAM -- Python Neural Associative Memory Simulator and Evaluator
# Copyright (C) 2015 Andreas Stöckel
#
# 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 Sof... |
foodszhang/kbengine | refs/heads/master | kbe/src/lib/python/Lib/sqlite3/test/factory.py | 67 | #-*- coding: iso-8859-1 -*-
# pysqlite2/test/factory.py: tests for the various factories in pysqlite
#
# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liab... |
austinzheng/swift | refs/heads/master | utils/pass-pipeline/scripts/pipelines_build_script.py | 33 | #!/usr/bin/env python
import argparse
import os
import subprocess
import sys
import textwrap
# Append the src dir
sys.path.append(os.path.join(os.path.dirname(
os.path.dirname(os.path.abspath(__file__))), 'src'))
import passes # noqa (E402 module level import not at top of file)
# TODO: This should not be hard... |
Hellowlol/PyTunes | refs/heads/master | libs/mutagen/trueaudio.py | 16 | # True Audio support for Mutagen
# Copyright 2006 Joe Wreschnig
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
"""True Audio audio stream information and tags.
True Audio is a ... |
gsnbng/erpnext | refs/heads/develop | erpnext/selling/doctype/selling_settings/selling_settings.py | 29 | # Copyright (c) 2015, Frappe 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 frappe
import frappe.defaults
from frappe.utils import cint
from frappe.custom.doctype.propert... |
Vishruit/DDP_models | refs/heads/master | tf1/lib/python2.7/site-packages/pip/_vendor/requests/status_codes.py | 695 | # -*- coding: utf-8 -*-
from .structures import LookupDict
_codes = {
# Informational.
100: ('continue',),
101: ('switching_protocols',),
102: ('processing',),
103: ('checkpoint',),
122: ('uri_too_long', 'request_uri_too_long'),
200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'... |
kidscancode/gamedev | refs/heads/master | tutorials/examples/mask_demo.py | 1 | # quick demo to help explain masks and pixel perfect collisions
import pygame as pg
WIDTH = 480
HEIGHT = 480
FPS = 60
# define colors
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
MAGENTA = (255, 0, 255)
YELLOW = (255, 255, 0)
CYAN = (0, 255, 255)
# initialize pg ... |
anilmuthineni/tensorflow | refs/heads/master | tensorflow/contrib/compiler/jit.py | 11 | # 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... |
thinkopensolutions/geraldo | refs/heads/master | site/newsite/django_1_0/django/contrib/localflavor/es/es_regions.py | 544 | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
REGION_CHOICES = (
('AN', _('Andalusia')),
('AR', _('Aragon')),
('O', _('Principality of Asturias')),
('IB', _('Balearic Islands')),
('PV', _('Basque Country')),
('CN', _('Canary Islands')),
('S', _('Cantabria')... |
metrasynth/solar-flares | refs/heads/master | sf/lib/orderedattrdict.py | 1 | from collections import OrderedDict
class OrderedAttrDict(OrderedDict):
def __init__(self, default=None, **kwds):
self.__dict__['_default'] = default
super().__init__(**kwds)
def __getattr__(self, item):
try:
return self[item]
except KeyError:
raise At... |
patochectp/navitia | refs/heads/dev | source/tyr/migrations/versions/3131d5bf5570_add_full_sn_geometries_on_instances.py | 5 | """add full_sn_geometries on instances for managing geometries in ed2nav
Revision ID: 3131d5bf5570
Revises: 162b4fa5836a
Create Date: 2016-08-22 13:55:00.870197
"""
# revision identifiers, used by Alembic.
revision = '3131d5bf5570'
down_revision = '162b4fa5836a'
from alembic import op
import sqlalchemy as sa
def ... |
alexperovich/coreclr | refs/heads/master | src/ToolBox/SOS/tests/t_cmd_bpmd_module_function_iloffset.py | 43 | import lldb
import re
import testutils as test
# bpmd <module name> <managed function name> [<il offset>]
def runScenario(assembly, debugger, target):
process = target.GetProcess()
res = lldb.SBCommandReturnObject()
ci = debugger.GetCommandInterpreter()
# Run debugger, wait until libcoreclr is loade... |
jwren/intellij-community | refs/heads/master | python/testData/completion/entriesWithNoImportablePath/a.py | 36 | MyFo<caret> |
takeshineshiro/nova | refs/heads/master | nova/manager.py | 32 | # 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 ... |
Bullettoothtobi/articlecorrection | refs/heads/master | articles_dense.py | 1 | from __future__ import print_function
import os
import tarfile
import urllib
import zipfile
from collections import Counter
from keras.layers.recurrent import GRU, SimpleRNN
from keras.layers.wrappers import TimeDistributed
from keras.utils import np_utils
from keras.preprocessing.text import Tokenizer, one_hot
from ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.