repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
harisbal/pandas | pandas/core/tools/datetimes.py | 4 | 30680 | from functools import partial
from datetime import datetime, time
from collections import MutableMapping
import numpy as np
from pandas._libs import tslib, tslibs
from pandas._libs.tslibs.strptime import array_strptime
from pandas._libs.tslibs import parsing, conversion, Timestamp
from pandas._libs.tslibs.parsing imp... | bsd-3-clause |
efortuna/AndroidSDKClone | ndk/prebuilt/linux-x86_64/lib/python2.7/encodings/iso2022_kr.py | 816 | 1053 | #
# iso2022_kr.py: Python Unicode Codec for ISO2022_KR
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_kr')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncod... | apache-2.0 |
Danielhiversen/home-assistant | homeassistant/components/light/mysensors.py | 5 | 8122 | """
Support for MySensors lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.mysensors/
"""
from homeassistant.components import mysensors
from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_HS_COLOR, ATTR_WHITE_VALUE, DOMAIN... | mit |
aaron-goshine/electron | script/lib/config.py | 14 | 1517 | #!/usr/bin/env python
import errno
import os
import platform
import sys
BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \
'http://github-janky-artifacts.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '04523758cda2a96d2454f9056fb1fb9a1c1f95f1'
PLATFORM = {
'cygwin': 'win32',
'darwin': ... | mit |
wujuguang/wrapt | src/decorators.py | 19 | 20139 | """This module implements decorators for implementing other decorators
as well as some commonly used decorators.
"""
import sys
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
if PY3:
string_types = str,
import builtins
exec_ = getattr(builtins, "exec")
del builtins
else:
string_... | bsd-2-clause |
iglpdc/nipype | nipype/interfaces/mrtrix3/tests/test_auto_Tractography.py | 10 | 3260 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..tracking import Tractography
def test_Tractography_inputs():
input_map = dict(act_file=dict(argstr='-act %s',
),
algorithm=dict(argstr='-algorithm %s',
usedefault=True,
),
angle=dict(argstr='-angl... | bsd-3-clause |
GitAngel/django | tests/template_tests/test_library.py | 413 | 3753 | from django.template import Library
from django.template.base import Node
from django.test import TestCase
class FilterRegistrationTests(TestCase):
def setUp(self):
self.library = Library()
def test_filter(self):
@self.library.filter
def func():
return ''
self.ass... | bsd-3-clause |
richardcs/ansible | lib/ansible/modules/net_tools/nios/nios_network.py | 14 | 7756 | #!/usr/bin/python
# Copyright (c) 2018 Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview... | gpl-3.0 |
TeamEOS/kernel_htc_flounder | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
TeodorMihai/codecombat | scripts/analytics/mixpanelGetEvent.py | 97 | 7517 | # Get mixpanel event data via export API
# Useful for debugging Mixpanel data weirdness
targetLevels = ['dungeons-of-kithgard', 'the-raised-sword', 'endangered-burl']
targetLevels = ['dungeons-of-kithgard']
eventFunnel = ['Started Level', 'Saw Victory']
# eventFunnel = ['Saw Victory']
# eventFunnel = ['Started Level']... | mit |
ryano144/intellij-community | python/lib/Lib/modjy/modjy_response.py | 109 | 4424 | ###
#
# Copyright Alan Kennedy.
#
# You may contact the copyright holder at this uri:
#
# http://www.xhaus.com/contact/modjy
#
# The licence under which this code is released is the Apache License v2.0.
#
# The terms and conditions of this license are listed in a file contained
# in the distribution that also cont... | apache-2.0 |
MattAllmendinger/coala | tests/bearlib/languages/documentation/DocstyleDefinitionTest.py | 22 | 2695 | import unittest
from coalib.bearlib.languages.documentation.DocstyleDefinition import (
DocstyleDefinition)
class DocstyleDefinitionTest(unittest.TestCase):
def test_fail_instantation(self):
with self.assertRaises(ValueError):
DocstyleDefinition("PYTHON", "doxyGEN", (("##", "#"),))
... | agpl-3.0 |
40223145c2g18/c2g18 | w2/static/Brython2.0.0-20140209-164925/Lib/signal.py | 743 | 1646 | """This module provides mechanisms to use signal handlers in Python.
Functions:
alarm() -- cause SIGALRM after a specified time [Unix only]
setitimer() -- cause a signal (described below) after a specified
float time and the timer may restart then [Unix only]
getitimer() -- get current value of timer [... | gpl-2.0 |
ioggstream/python-course | ansible-101/notebooks/exercise-05/inventory-docker-solution.py | 1 | 1376 | #!/usr/bin/env python
# List our containers. Note: this only works with docker-compose containers.
from __future__ import print_function
from collections import defaultdict
import json
#
# Manage different docker libraries
#
try:
from docker import Client
except ImportError:
from docker import APIClient as C... | agpl-3.0 |
AlexOugh/horizon | horizon/base.py | 3 | 37049 | # 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... | apache-2.0 |
joone/chromium-crosswalk | chrome/common/extensions/docs/server2/caching_rietveld_patcher.py | 121 | 4228 | # Copyright 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.
from datetime import datetime, timedelta
from file_system import FileNotFoundError
from future import Future
from patcher import Patcher
_VERSION_CACHE_MAXA... | bsd-3-clause |
pacav69/namebench | nb_third_party/dns/rdtypes/IN/NAPTR.py | 248 | 4889 | # Copyright (C) 2003-2007, 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 ... | apache-2.0 |
googleapis/googleapis-gen | google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/common/types/ad_type_infos.py | 1 | 46175 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
mapzen/tilequeue | tilequeue/wof.py | 1 | 46004 | from __future__ import absolute_import
from collections import namedtuple
from contextlib import closing
from cStringIO import StringIO
from datetime import datetime
from edtf import parse_edtf
from operator import attrgetter
from psycopg2.extras import register_hstore
from shapely import geos
from tilequeue.tile impor... | mit |
lra/boto | tests/integration/elasticache/test_layer1.py | 113 | 2728 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
Tala/bybop | src/interactive.py | 1 | 1944 | #!/usr/bin/env python
import sys
try:
import readline
except ImportError:
import pyreadline as readline
import os
import code
import rlcompleter
lib_path = os.path.abspath(os.path.join('..', 'src'))
sys.path.append(lib_path)
lib_path = os.path.abspath(os.path.join('..', '..', 'ARSDKBuildUtils', 'Utils', 'Py... | bsd-3-clause |
samabhi/pstHealth | venv/lib/python2.7/site-packages/django/db/models/sql/query.py | 7 | 93187 | """
Create SQL statements for QuerySets.
The code in here encapsulates all of the SQL construction so that QuerySets
themselves do not have to (and could be backed by things other than SQL
databases). The abstraction barrier only works one way: this module has to know
all about the internals of models in order to get ... | mit |
laslabs/connector-telephony | asterisk_click2dial_crm/__openerp__.py | 8 | 1784 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Asterisk click2dial CRM module for OpenERP
# Copyright (c) 2012-2014 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: y... | agpl-3.0 |
bealdav/OCB | addons/stock/partner.py | 375 | 1766 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
status-im/status-react | test/appium/tests/atomic/account_management/test_profile.py | 1 | 71527 | import re
from tests import marks, bootnode_address, mailserver_address, test_dapp_url, test_dapp_name, mailserver_ams, \
mailserver_gc, mailserver_hk, used_fleet, common_password
from tests.base_test_case import SingleDeviceTestCase, MultipleDeviceTestCase
from tests.users import transaction_senders, basic_user, ... | mpl-2.0 |
ttthy1/2017sejongAI | week14/Mnist.py | 1 | 2273 | # Lab 7 Learning rate and Evaluation
import tensorflow as tf
import random
import matplotlib.pyplot as plt
tf.set_random_seed(777) # for reproducibility
from tensorflow.examples.tutorials.mnist import input_data
# Check out https://www.tensorflow.org/get_started/mnist/beginners for
# more information about the mnist d... | gpl-3.0 |
Kongsea/tensorflow | tensorflow/examples/tutorials/layers/cnn_mnist.py | 43 | 5711 | # 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 appl... | apache-2.0 |
JDongian/LangGrind | src/parse_raw.py | 1 | 1957 | """Parse human data into JSON"""
import string
def parse_file(filename="../data/RAW.txt"):
"""Parse human readable file into JSON."""
entries = []
with open(filename) as f_in:
next_line = f_in.readline()
data = {}
state = "section"
while next_line:
if state == "... | gpl-3.0 |
aidan-/ansible-modules-extras | network/exoscale/exo_dns_record.py | 31 | 12145 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
slevenhagen/odoo-npg | openerp/addons/base/ir/ir_default.py | 342 | 1883 | # -*- 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... | agpl-3.0 |
jaidevd/scikit-learn | sklearn/externals/joblib/testing.py | 23 | 3042 | """
Helper for testing.
"""
import sys
import warnings
import os.path
import re
import subprocess
import threading
from sklearn.externals.joblib._compat import PY3_OR_LATER
def warnings_to_stdout():
""" Redirect all warnings to stdout.
"""
showwarning_orig = warnings.showwarning
def showwarning(msg... | bsd-3-clause |
jxzhxch/androguard | androguard/core/bytecodes/arm.py | 48 | 2306 | # Radare !
from r2 import r_bin
from r2 import r_asm
from r2 import r_anal
from r2 import r_core
from miasm.arch.arm_arch import arm_mn
from miasm.core.bin_stream import bin_stream
from miasm.core import asmbloc
class ARM2 :
def __init__(self) :
b = r_bin.RBin ()
b.load("./apks/exploits/617efb2... | apache-2.0 |
axinging/chromium-crosswalk | third_party/WebKit/Source/bindings/scripts/idl_compiler.py | 16 | 8497 | #!/usr/bin/python
# Copyright (C) 2013 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 c... | bsd-3-clause |
prateeksan/python-design-patterns | structural/adapter.py | 1 | 3485 | """ The Adapter Pattern
Notes:
If the interface of an object does not match the interface required by the
client code, this pattern recommends using an 'adapter' that can create a proxy
interface. It is particularly useful in homogenizing interfaces of
non-homogenous objects.
The following example represents a use ... | mit |
3dfxsoftware/cbss-addons | account_aged_partner_balance_report/report/account_aged_partner_balance_report.py | 1 | 10928 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Addons modules by CLEARCORP S.A.
# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
#
# This program is free software: you can redistribute... | gpl-2.0 |
pombredanne/rekall | rekall-core/rekall/plugins/windows/procdump_test.py | 4 | 1746 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@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 2... | gpl-2.0 |
nosuchtim/VizBench | src/jsonrpc/jsonrpc.py | 1 | 1044 | # Utility to send JSON RPC messages
# Avoid the requests module to reduce installation hassles
import urllib
import urllib2
import json
import sys
verbose = False
def dorpc(port,meth,params):
url = 'http://127.0.0.1:%d/api' % (port)
id = '12345'
data = '{ "jsonrpc": "2.0", "method": "'+meth+'", "params": '+params... | mit |
pombreda/ruffus | ruffus/test/test_tutorial7.py | 1 | 6147 | #!/usr/bin/env python
from __future__ import print_function
NUMBER_OF_RANDOMS = 10000
CHUNK_SIZE = 1000
working_dir = "temp_tutorial7/"
import os
import sys
# add grandparent to search path for testing
grandparent_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
sys.path.insert(0, grand... | mit |
azheng51714/PYLearning | scrapy_project/ELEProject/ELEProject/middlewares.py | 1 | 1884 | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class EleprojectSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scrap... | mit |
abhitopia/tensorflow | tensorflow/contrib/keras/python/keras/optimizers_test.py | 9 | 3995 | # 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... | apache-2.0 |
krafczyk/spack | var/spack/repos/builtin/packages/py-poster/package.py | 5 | 1592 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
bow/bioconda-recipes | recipes/biopet-seqstat/biopet-seqstat.py | 44 | 3365 | #!/usr/bin/env python
#
# Wrapper script for starting the biopet-seqstat JAR package
#
# This script is written for use with the Conda package manager and is copied
# from the peptide-shaker wrapper. Only the parameters are changed.
# (https://github.com/bioconda/bioconda-recipes/blob/master/recipes/peptide-shaker/pept... | mit |
sborenst/openshift-ansible | inventory/openstack/hosts/nova.py | 20 | 6730 | #!/usr/bin/env python2
# pylint: skip-file
# (c) 2012, Marco Vito Moscaritolo <marco@agavee.com>
#
# This file is part of Ansible,
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | apache-2.0 |
dani-esquinazi-integra/apv | pdfview/scripts/pjpp.py | 111 | 7409 | #!/usr/bin/env pypy
import os, sys, logging, re
import argparse
import fnmatch
configurations = {'lite', 'pro'}
package_dirs = {
'lite': ('src/cx/hell/android/pdfview',),
'pro': ('src/cx/hell/android/pdfviewpro',)
}
file_replaces = {
'lite': (
'cx.hell.android.pdfview.',
'"cx.hell.an... | gpl-3.0 |
davidyezsetz/kuma | vendor/packages/Werkzeug/tests/test_parsing.py | 6 | 8212 | # -*- coding: utf-8 -*-
from nose.tools import assert_raises
from os.path import join, dirname, abspath
from cStringIO import StringIO
from werkzeug import Client, Request, Response
from werkzeug.exceptions import RequestEntityTooLarge
@Request.application
def form_data_consumer(request):
result_object = request.... | mpl-2.0 |
campbe13/openhatch | vendor/packages/twisted/twisted/conch/client/options.py | 17 | 4244 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
#
from twisted.conch.ssh.transport import SSHClientTransport, SSHCiphers
from twisted.python import usage
import sys
class ConchOptions(usage.Options):
optParameters = [['user', 'l', None, 'Log in using this user name.'],
... | agpl-3.0 |
h4wldev/Frest | app/routes/api/v1/users/user.py | 1 | 6676 | # # -*- coding: utf-8 -*-
import re
import datetime
from flask import request
from flask_api import status
from flask_restful import Resource
from sqlalchemy.exc import IntegrityError
from werkzeug.security import generate_password_hash
from app import db, token_auth
from app.models.user_model import UserModel, get_u... | mit |
ging/vcc | public/javascripts/fckeditor/editor/filemanager/connectors/py/fckcommands.py | 93 | 6491 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | agpl-3.0 |
KaranToor/MA450 | google-cloud-sdk/.install/.backup/lib/surface/functions/deploy.py | 2 | 16199 | # 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 ag... | apache-2.0 |
MauHernandez/cyclope | demo/cyclope_project/locale/dbgettext/articles/article/regiones-y-esquemas/text.py | 2 | 6090 | # -*- coding: utf-8 -*-
gettext("""Es aquí donde utilizaremos las vistas asociadas que describimos en el punto anterior. Podemos decidir, por ejemplo, que en la región lateral izquierda se muestre una lista jerarquizada de las categorías pertenecientes a una colección, en la región superior se muestre un menú de navega... | gpl-3.0 |
neumerance/deploy | .venv/lib/python2.7/site-packages/babel/localedata.py | 136 | 6247 | # -*- coding: utf-8 -*-
"""
babel.localedata
~~~~~~~~~~~~~~~~
Low-level locale data access.
:note: The `Locale` class, which uses this module under the hood, provides a
more convenient interface for accessing the locale data.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, s... | apache-2.0 |
chunjispring/environment | vim_setting/ftplugin/python/pyflakes/pyflakes/test/test_script.py | 44 | 5335 |
"""
Tests for L{pyflakes.scripts.pyflakes}.
"""
import sys
from StringIO import StringIO
from twisted.python.filepath import FilePath
from twisted.trial.unittest import TestCase
from pyflakes.scripts.pyflakes import checkPath
def withStderrTo(stderr, f):
"""
Call C{f} with C{sys.stderr} redirected to C{std... | gpl-2.0 |
lacrazyboy/scrapy | tests/test_utils_log.py | 140 | 3417 | # -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import logging
import unittest
from testfixtures import LogCapture
from twisted.python.failure import Failure
from scrapy.utils.log import (failure_to_exc_info, TopLevelFormatter,
LogCounterHandler, StreamLogger)
fr... | bsd-3-clause |
yury-s/v8-inspector | Source/chrome/tools/telemetry/telemetry/unittest_util/run_chromeos_tests.py | 9 | 1946 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
from telemetry.core import util
from telemetry.unittest_util import run_tests
def RunTestsForChromeOS(browser_type, unit_tests, pe... | bsd-3-clause |
nolanliou/tensorflow | tensorflow/contrib/distributions/python/ops/mvn_tril.py | 17 | 7524 | # 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... | apache-2.0 |
hkchenhongyi/django | tests/auth_tests/models/custom_permissions.py | 295 | 1433 | """
The CustomPermissionsUser users email as the identifier, but uses the normal
Django permissions model. This allows us to check that the PermissionsMixin
includes everything that is needed to interact with the ModelBackend.
"""
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.con... | bsd-3-clause |
jmartinm/inspire-next | inspire/modules/workflows/views/holdingpen_edit.py | 2 | 4664 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2015 CERN.
#
# INSPIRE 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... | gpl-2.0 |
Nikola-K/django_reddit | users/models.py | 1 | 1565 | from hashlib import md5
import mistune
from django.contrib.auth.models import User
from django.db import models
class RedditUser(models.Model):
user = models.OneToOneField(User)
first_name = models.CharField(max_length=35, null=True, default=None,
blank=True)
last_name =... | apache-2.0 |
taaviteska/django | django/db/migrations/migration.py | 24 | 8092 | from django.db.transaction import atomic
from .exceptions import IrreversibleError
class Migration:
"""
The base class for all migrations.
Migration files will import this from django.db.migrations.Migration
and subclass it as a class called Migration. It will have one or more
of the following a... | bsd-3-clause |
selentd/pythontools | pytools/src/oldsrc/addindex.py | 1 | 2335 |
import datetime
import pymongo
from pymongo.mongo_client import MongoClient
import indexdata
def getIndexEntry( indexData ):
return indexData.getDictionary()
def getIndexDateEntry( indexData ):
return { "date": datetime.datetime(indexData.date.year,
indexData.date.mon... | apache-2.0 |
idwanglu2010/git-repo | subcmds/cherry_pick.py | 48 | 3349 | #
# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | apache-2.0 |
cfjhallgren/shogun | examples/undocumented/python/transfer_multitask_l12_logistic_regression.py | 6 | 1397 | #!/usr/bin/env python
from numpy import array,hstack
from numpy.random import seed, rand
from tools.load import LoadMatrix
lm=LoadMatrix()
traindat = lm.load_numbers('../data/fm_train_real.dat')
testdat = lm.load_numbers('../data/fm_test_real.dat')
label_traindat = lm.load_labels('../data/label_train_twoclass.dat')
p... | gpl-3.0 |
qqzwc/XX-Net | code/default/python27/1.0/lib/encodings/cp874.py | 593 | 12851 | """ Python Character Mapping Codec cp874 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP874.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,inpu... | bsd-2-clause |
mdsafwan/Deal-My-Stuff | Lib/site-packages/django/templatetags/static.py | 250 | 4055 | from django import template
from django.utils.encoding import iri_to_uri
from django.utils.six.moves.urllib.parse import urljoin
register = template.Library()
class PrefixNode(template.Node):
def __repr__(self):
return "<PrefixNode for %r>" % self.name
def __init__(self, varname=None, name=None):
... | apache-2.0 |
aldian/tensorflow | tensorflow/contrib/boosted_trees/python/kernel_tests/training_ops_test.py | 13 | 52856 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
samgoon/devstack | tools/cpu_map_update.py | 6 | 3563 | #!/usr/bin/env python
#
# 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, softwa... | apache-2.0 |
rubenvereecken/pokemongo-api | POGOProtos/Data/Gym/GymMembership_pb2.py | 10 | 3305 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Data/Gym/GymMembership.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf i... | mit |
oew1v07/scikit-image | skimage/morphology/tests/test_binary.py | 33 | 5898 | import numpy as np
from numpy import testing
from skimage import data, color
from skimage.util import img_as_bool
from skimage.morphology import binary, grey, selem
from scipy import ndimage as ndi
img = color.rgb2gray(data.astronaut())
bw_img = img > 100
def test_non_square_image():
strel = selem.square(3)
... | bsd-3-clause |
Rezzie/Batcher | generators/g_randomchoice.py | 1 | 2268 | #!/usr/bin/env python
# Copyright (c) 2011, The University of York
# All rights reserved.
# Author(s):
# James Arnold <jarnie@gmail.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of sourc... | bsd-3-clause |
Beeblio/django | django/contrib/auth/tests/test_tokens.py | 117 | 2635 | from datetime import date, timedelta
import sys
import unittest
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.test import TestCase
@skipIfCustomUs... | bsd-3-clause |
openvenues/address_normalizer | address_normalizer/deduping/near_duplicates.py | 1 | 6806 | import geohash
import logging
import operator
from functools import partial
from itertools import chain, product, combinations, imap
from address_normalizer.deduping.duplicates import *
from address_normalizer.deduping.storage.base import *
from address_normalizer.text.gazetteers import *
from address_normalizer.t... | mit |
magicrub/MissionPlanner | Lib/encodings/iso8859_8.py | 93 | 11599 | """ Python Character Mapping Codec iso8859_8 generated from 'MAPPINGS/ISO8859/8859-8.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,i... | gpl-3.0 |
jart/tensorflow | tensorflow/contrib/keras/api/keras/applications/__init__.py | 87 | 1807 | # 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... | apache-2.0 |
miyanishi2/caffe-rpc | caffe_extractor.py | 1 | 1439 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'miyanishi'
import caffe
import numpy as np
class CaffeExtractor():
def __init__(self, caffe_root=None, feature_layers=["fc6"], gpu=True):
self.feature_layers = feature_layers
MODEL_FILE = caffe_root + 'examples/imagenet/imagenet_deploy.... | bsd-2-clause |
Donkyhotay/MoonPy | twisted/internet/posixbase.py | 1 | 14121 | # -*- test-case-name: twisted.test.test_internet -*-
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Posix reactor base class
"""
import warnings
import socket
import errno
import os
from zope.interface import implements, classImplements
from twisted.python.compat import set
fr... | gpl-3.0 |
unfoldingWord-dev/uwadmin | uwadmin/migrations/0005_auto_20150524_1534.py | 1 | 1202 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('uwadmin', '0004_auto_20150318_0034'),
]
operations = [
migrations.AddField(
model_name='publishrequest',
... | mit |
leezu/mxnet | python/mxnet/gluon/__init__.py | 7 | 1132 | # 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... | apache-2.0 |
cpcloud/bokeh | examples/glyphs/dateaxis.py | 2 | 1590 | from __future__ import print_function
from numpy import pi, arange, sin
import numpy as np
import time
from bokeh.browserlib import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.glyphs import Circle
from bokeh.objects import (Plot, DataRange1d, LinearAxis, DatetimeAxis,
... | bsd-3-clause |
zoyahav/incubator-airflow | tests/contrib/operators/test_spark_submit_operator.py | 10 | 5302 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
CristianBB/SickRage | lib/adba/aniDBAbstracter.py | 26 | 10437 | #!/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... | gpl-3.0 |
praveenaki/zulip | zerver/management/commands/process_queue.py | 120 | 1460 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from django.core.management import CommandError
from django.conf import settings
from zerver.worker.queue_processors import get_worker
import sys
import signal
import logging
class Command(BaseCommand):
def add_arguments(se... | apache-2.0 |
kpayson64/grpc | tools/run_tests/artifacts/artifact_targets.py | 1 | 14711 | #!/usr/bin/env python
# Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
marcuschia/ShaniXBMCWork | plugin.video.shahidmbcnet/default.py | 6 | 81313 | # -*- coding: utf-8 -*-
import xbmc, xbmcgui, xbmcplugin
import urllib2,urllib,cgi, re
import HTMLParser
import xbmcaddon
import json
import traceback
import os
import sys
import cookielib
from BeautifulSoup import BeautifulStoneSoup, BeautifulSoup, BeautifulSOAP, Tag,NavigableString
try:
from lxmlERRRORRRR import et... | gpl-2.0 |
FlaPer87/django-nonrel | django/core/cache/backends/base.py | 20 | 3810 | "Base Cache class."
from django.core.exceptions import ImproperlyConfigured
class InvalidCacheBackendError(ImproperlyConfigured):
pass
class BaseCache(object):
def __init__(self, params):
timeout = params.get('timeout', 300)
try:
timeout = int(timeout)
except (ValueError, ... | bsd-3-clause |
drinkssu/YourVoiceAlarmBackend | lib/werkzeug/contrib/lint.py | 318 | 12282 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.lint
~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 0.5
This module provides a middleware that performs sanity checks of the WSGI
application. It checks that :pep:`333` is properly implemented and warns
on some common HTTP errors such as non-empty respons... | apache-2.0 |
IQSS/miniverse | miniverse/settings/local_with_routing.py | 1 | 6078 | """
Settings template for running two databases:
- Existing Dataverse databases (we only read it)
- Second database for Django core apps + Miniverse apps
Please read through and change the settings where noted
"""
from __future__ import absolute_import
import sys
from os import makedirs, environ
from os.path i... | mit |
caiminf/freenos | site_scons/ext2.py | 11 | 1950 | #
# Copyright (C) 2009 Niek Linnenbank
#
# 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.
#
# This program is distribute... | gpl-3.0 |
trungnt13/scikit-learn | sklearn/feature_selection/__init__.py | 244 | 1088 | """
The :mod:`sklearn.feature_selection` module implements feature selection
algorithms. It currently includes univariate filter selection methods and the
recursive feature elimination algorithm.
"""
from .univariate_selection import chi2
from .univariate_selection import f_classif
from .univariate_selection import f_... | bsd-3-clause |
RadioFreeAsia/RDacity | lib-src/lv2/lv2/plugins/eg-midigate.lv2/waflib/Tools/compiler_cxx.py | 343 | 1762 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys,imp,types
from waflib.Tools import ccroot
from waflib import Utils,Configure
from waflib.Logs import debug
cxx_compiler={'win32':['msvc','g++'],'cygwin':['g++'],... | gpl-2.0 |
Ryanglambert/pybrain | pybrain/rl/environments/environment.py | 31 | 1584 | __author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.utilities import abstractMethod
class Environment(object):
""" The general interface for whatever we would like to model, learn about,
predict, or simply interact in. We can perform actions, and access
(partial) observations.
"""
# the... | bsd-3-clause |
mythos234/SimplKernel-LL-G925F | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
lihui7115/ChromiumGStreamerBackend | tools/compile_test/compile_test.py | 159 | 1781 | #!/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.
"""
Tries to compile given code, produces different output depending on success.
This is similar to checks done by ./configure scr... | bsd-3-clause |
tinloaf/home-assistant | tests/components/light/test_init.py | 5 | 17230 | """The tests for the Light component."""
# pylint: disable=protected-access
import unittest
import unittest.mock as mock
import os
from io import StringIO
import pytest
from homeassistant import core, loader
from homeassistant.exceptions import Unauthorized
from homeassistant.setup import setup_component, async_setup... | apache-2.0 |
Absimpl/Abstream | kivytest_version2_12_windows/kivy/factory.py | 55 | 5771 | '''
Factory object
==============
The factory can be used to automatically register any class or module
and instantiate classes from it anywhere in your project. It is an
implementation of the
`Factory Pattern <http://en.wikipedia.org/wiki/Factory_pattern>`_.
The class list and available modules are automatically gen... | mit |
sanluca/py-acqua | setup.py | 1 | 1902 | # -*- coding: iso-8859-15 -*-
#Copyright (C) 2005, 2008 Py-Acqua
#http://www.pyacqua.net
#email: info@pyacqua.net
#
#
#Py-Acqua 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 t... | gpl-2.0 |
ptoraskar/django | tests/pagination/tests.py | 266 | 13459 | from __future__ import unicode_literals
import unittest
from datetime import datetime
from django.core.paginator import (
EmptyPage, InvalidPage, PageNotAnInteger, Paginator,
)
from django.test import TestCase
from django.utils import six
from .custom import ValidAdjacentNumsPaginator
from .models import Article... | bsd-3-clause |
bhermansyah/DRR-datacenter | scripts/misc-boedy1996/glofas_refactor.py | 1 | 6276 | import os, sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE","geonode.settings")
import csv
from django.db import connection, connections
from django.conf import settings
from geodb.models import Glofasintegrated, AfgBasinLvl4GlofasPoint
from netCDF4 import Dataset, num2date
import numpy as np
from django.contrib.g... | gpl-3.0 |
zaccoz/odoo | addons/delivery/__openerp__.py | 224 | 1905 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
deavid/bjsonrpc | bjsonrpc/main.py | 1 | 2824 | """
bjson/main.py
Copyright (c) 2010 David Martinez Marti
All rights reserved.
Licensed under 3-clause BSD License.
See LICENSE.txt for the full license text.
"""
import socket
import bjsonrpc.server
import bjsonrpc.connection
import bjsonrpc.handlers
__all__ = [
"createserver",
"... | bsd-3-clause |
testalt/electrum-dvc | gui/text.py | 1 | 17436 | import curses, datetime, locale
from decimal import Decimal
_ = lambda x:x
#from i18n import _
from electrum_dvc.util import format_satoshis, set_verbosity
from electrum_dvc.bitcoin import is_valid
from electrum_dvc import Wallet, WalletStorage
import tty, sys
class ElectrumGui:
def __init__(self, config, netw... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.