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
shellphish/puppeteer
examples/ructf_2014_pwn200/doit.py
1
2635
import puppeteer as p import logging try: import standard_logging # pylint: disable=W0611 except ImportError: pass #logging.getLogger("puppeteer.connection").setLevel(logging.DEBUG) #logging.getLogger("puppeteer.manipulator").setLevel(logging.DEBUG) #logging.getLogger("puppeteer.vuln_decorators").setLevel(logg...
gpl-3.0
wkhtmltopdf/qtwebkit
Tools/BuildSlaveSupport/build.webkit.org-config/committer_auth_unittest.py
123
9892
#!/usr/bin/env python # # Copyright (C) 2011 Apple 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: # 1. Redistributions of source code must retain the above copyright # notice, this list...
gpl-2.0
SravanthiSinha/edx-platform
lms/djangoapps/instructor_task/tests/test_models.py
124
3540
""" Tests for instructor_task/models.py. """ from cStringIO import StringIO import mock import time from datetime import datetime from unittest import TestCase from instructor_task.models import LocalFSReportStore, S3ReportStore from instructor_task.tests.test_base import TestReportMixin from opaque_keys.edx.locator ...
agpl-3.0
outboxafrica/pimaa
PiMaa/sensors/lib/GrovePi/grove_barometer_sensors/high_accuracy_hp206c_barometer/high_accuracy_barometer_example.py
2
2138
#!/usr/bin/env python # # GrovePi Example for using the Grove - Barometer (High-Accuracy)(http://www.seeedstudio.com/depot/Grove-Barometer-HighAccuracy-p-1865.html # # The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi # # Have a que...
gpl-3.0
xguse/bokeh
examples/plotting/file/markers.py
45
1530
from numpy.random import random from bokeh.plotting import figure, show, output_file def mscatter(p, x, y, typestr): p.scatter(x, y, marker=typestr, line_color="#6666ee", fill_color="#ee6666", fill_alpha=0.5, size=12) def mtext(p, x, y, textstr): p.text(x, y, text=[textstr], text_color="...
bsd-3-clause
Gaia3D/QGIS
python/plugins/processing/algs/grass/ext/r_info.py
20
1212
# -*- coding: utf-8 -*- """ *************************************************************************** r_info.py --------------------- Date : December 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ******************************...
gpl-2.0
jpaasen/cos
framework/Window.py
1
5925
#from TypeExtensions import Ndarray from gfuncs import processArgs from mynumpy import pi, dot, cos, sin, exp #ones, complex, sin, linspace, exp, pi, dot, angle import mynumpy as np #from pylab import plot, subplot, xlabel, ylabel, grid, show, figure, ion, ioff class Window(np.Ndarray): def __new__(self, type='r...
mit
arista-eosplus/ansible
lib/ansible/modules/utilities/logic/assert.py
56
1766
#!/usr/bin/python # -*- coding: utf-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 Lice...
gpl-3.0
tudorian/eden
modules/unit_tests/s3/s3timeplot.py
5
66687
# -*- coding: utf-8 -*- # # Time Plot Unit Tests # # To run this script use: # python web2py.py -S eden -M -R applications/eden/modules/unit_tests/s3/s3timeplot.py # import datetime import random import unittest import dateutil.tz from gluon import * from s3.s3timeplot import * from s3.s3timeplot import tp_datetime fr...
mit
amghost/myblog
node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/filter.py
365
2071
# -*- coding: utf-8 -*- """ pygments.filter ~~~~~~~~~~~~~~~ Module that implements the default filter. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ def apply_filters(stream, filters, lexer=None): """ Use this method to app...
mit
CredoReference/edx-platform
lms/djangoapps/course_api/blocks/transformers/tests/test_navigation.py
13
5905
# pylint: disable=protected-access """ Tests for BlockNavigationTransformer. """ from unittest import TestCase import ddt from lms.djangoapps.course_api.blocks.transformers.block_depth import BlockDepthTransformer from lms.djangoapps.course_api.blocks.transformers.navigation import BlockNavigationTransformer from ope...
agpl-3.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/django/core/exceptions.py
57
5729
""" Global Django exception and warning classes. """ from django.utils import six from django.utils.encoding import force_text class FieldDoesNotExist(Exception): """The requested model field does not exist""" pass class DjangoRuntimeWarning(RuntimeWarning): pass class AppRegistryNotReady(Exception): ...
gpl-3.0
ChrisEby/M101P-MongoDbForDevelopers
Week 6/week6-lessonfiles/validate.py
6
4960
import base64 code="CmltcG9ydCBweW1vbmdvCmltcG9ydCByYW5kb20KaW1wb3J0IHJlCmltcG9ydCBzdHJpbmcKaW1wb3J0IHN5cwppbXBvcnQgZ2V0b3B0CmltcG9ydCBwcHJpbnQKCiMgQ29weXJpZ2h0IDIwMTIKIyAxMGdlbiwgSW5jLgojIEF1dGhvcjogQW5kcmV3IEVybGljaHNvbiAgIGFqZUAxMGdlbi5jb20KIwojIElmIHlvdSBhcmUgYSBzdHVkZW50IGFuZCByZWFkaW5nIHRoaXMgY29kZSwgdHVybiBiYWNr...
mit
masterdje/wibfi
conf.py
1
22684
# -*- coding: utf-8 -*- from __future__ import unicode_literals import time # Configuration, please edit # Data about this site BLOG_AUTHOR = "Dje" BLOG_TITLE = "Write it before forget it!" # This is the main URL for your site. It will be used # in a prominent link SITE_URL = "http://wibfi.virtua-peanuts.net/" # Thi...
gpl-3.0
grangier/django-11599
django/contrib/gis/gdal/__init__.py
14
2416
""" This module houses ctypes interfaces for GDAL objects. The following GDAL objects are supported: CoordTransform: Used for coordinate transformations from one spatial reference system to another. Driver: Wraps an OGR data source driver. DataSource: Wrapper for the OGR data source object, supports OGR-...
bsd-3-clause
mattclay/ansible
test/support/windows-integration/plugins/modules/win_reboot.py
53
4690
#!/usr/bin/python # -*- coding: utf-8 -*- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], 'supported_by': 'core'} DOCUMENTATION = r''' --- module: win_reb...
gpl-3.0
Skytorn86/mezzanine
mezzanine/template/loader_tags.py
28
6335
from __future__ import unicode_literals from future.builtins import map import os from django.template import Template, TemplateSyntaxError, TemplateDoesNotExist from django.template.loader_tags import ExtendsNode from mezzanine import template register = template.Library() class OverExtendsNode(ExtendsNode): ...
bsd-2-clause
codekaki/odoo
addons/account_cancel/__openerp__.py
124
1653
# -*- 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
IshankGulati/scikit-learn
sklearn/feature_selection/variance_threshold.py
123
2572
# Author: Lars Buitinck # License: 3-clause BSD import numpy as np from ..base import BaseEstimator from .base import SelectorMixin from ..utils import check_array from ..utils.sparsefuncs import mean_variance_axis from ..utils.validation import check_is_fitted class VarianceThreshold(BaseEstimator, SelectorMixin): ...
bsd-3-clause
xuanthuong/golfgame
models/work_history.py
1
2217
# -*- coding: utf-8 -*- # Description: work_history table # By Thuong.Tran # Date: 29 Aug 2017 from sqlalchemy import create_engine, Table, Column, MetaData, Integer, Text, DateTime, Float from sqlalchemy import select, and_ import datetime as dt class work_history(): def __init__(self, db_url): _engine = crea...
mit
pengli09/Paddle
python/paddle/v2/__init__.py
4
2228
# Copyright (c) 2016 PaddlePaddle 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 applic...
apache-2.0
eleonrk/SickRage
lib/unidecode/x1d6.py
248
3974
data = ( 's', # 0x00 't', # 0x01 'u', # 0x02 'v', # 0x03 'w', # 0x04 'x', # 0x05 'y', # 0x06 'z', # 0x07 'A', # 0x08 'B', # 0x09 'C', # 0x0a 'D', # 0x0b 'E', # 0x0c 'F', # 0x0d 'G', # 0x0e 'H', # 0x0f 'I', # 0x10 'J', # 0x11 'K', # 0x12 'L', # 0x13 'M', # 0...
gpl-3.0
HPPTECH/hpp_IOSTressTest
Resources/ssh/pexpect-3.2/tests/test_log.py
2
3706
#!/usr/bin/env python ''' PEXPECT LICENSE This license is approved by the OSI and FSF as GPL-compatible. http://opensource.org/licenses/isc-license.txt Copyright (c) 2012, Noah Spurrier <noah@noah.org> PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY PURPOSE WITH OR WIT...
mit
bruderstein/PythonScript
PythonLib/full/unittest/result.py
13
7443
"""Test result object""" import io import sys import traceback from . import util from functools import wraps __unittest = True def failfast(method): @wraps(method) def inner(self, *args, **kw): if getattr(self, 'failfast', False): self.stop() return method(self, *args, **kw) ...
gpl-2.0
sxhao/phantomjs
src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/message_listener.py
590
3354
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
mvaled/sentry
tests/sentry/api/endpoints/test_prompts_activity.py
3
3343
from __future__ import absolute_import from django.core.urlresolvers import reverse from sentry.testutils import APITestCase class PromptsActivityTest(APITestCase): def setUp(self): super(PromptsActivityTest, self).setUp() self.login_as(user=self.user) self.org = self.create_organization...
bsd-3-clause
alexax66/CM11_kernel_serranodsxx
scripts/gcc-wrapper.py
364
3936
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. 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 th...
gpl-2.0
airbnb/airflow
airflow/utils/trigger_rule.py
10
1722
# # 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...
apache-2.0
relekang/djangoproject.com
dashboard/tests.py
8
5519
# -*- coding: utf-8 -*- import codecs import json import os from unittest import mock import requests_mock from django.core import management from django.http import Http404 from django.test import RequestFactory, TestCase from django_hosts.resolvers import reverse from .models import ( GithubItemCountMetric, Met...
bsd-3-clause
ahmed-mahran/hue
apps/beeswax/src/beeswax/hive_site.py
25
5357
#!/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...
apache-2.0
rafaeltomesouza/frontend-class1
aula2/a9/linkedin/client/.gradle/nodejs/node-v7.5.0-darwin-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py
1524
22178
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import copy import gyp.input import optparse import os.path import re import shlex import sys import traceback from gyp.common import GypErr...
mit
qtproject/qt-creator
scripts/generateClangFormatChecksUI.py
3
9025
#!/usr/bin/env python ############################################################################ # # Copyright (C) 2019 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of Qt Creator. # # Commercial License Usage # Licensees holding valid commercial Qt licenses may use this file in # ...
gpl-3.0
russomi/gae-boilerplate-idp
boilerplate/external/babel/util.py
60
10781
# -*- coding: utf-8 -*- # # Copyright (C) 2007 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software cons...
lgpl-3.0
hmen89/odoo
openerp/report/render/rml2pdf/customfonts.py
119
3491
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 P. Christeas, Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2013 OpenERP SA. (http://www.openerp.com) # # This program is free so...
agpl-3.0
Yukinoshita47/Yuki-Chan-The-Auto-Pentest
Module/metagoofil/hachoir_parser/common/win32_lang_id.py
186
3901
""" Windows 2000 - List of Locale IDs and Language Groups Original data table: http://www.microsoft.com/globaldev/reference/win2k/setup/lcid.mspx """ LANGUAGE_ID = { 0x0436: u"Afrikaans", 0x041c: u"Albanian", 0x0401: u"Arabic Saudi Arabia", 0x0801: u"Arabic Iraq", 0x0c01: u"Arabic Egypt", 0x10...
mit
allmightyspiff/softlayer-python
SoftLayer/CLI/virt/placementgroup/__init__.py
3
1401
"""Manages Reserved Capacity.""" # :license: MIT, see LICENSE for more details. import importlib import os import click CONTEXT = {'help_option_names': ['-h', '--help'], 'max_content_width': 999} class PlacementGroupCommands(click.MultiCommand): """Loads module for placement group related commands. ...
mit
Ircam-Web/mezzanine-organization
organization/agenda/migrations/0033_dynamicmultimediaevent.py
1
1459
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2018-11-30 10:33 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import mezzanine.core.fields class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_co...
agpl-3.0
frishberg/django
tests/auth_tests/test_mixins.py
12
8509
from django.contrib.auth import models from django.contrib.auth.mixins import ( LoginRequiredMixin, PermissionRequiredMixin, UserPassesTestMixin, ) from django.contrib.auth.models import AnonymousUser from django.core.exceptions import PermissionDenied from django.http import HttpResponse from django.test import Re...
bsd-3-clause
sysalexis/kbengine
kbe/res/scripts/common/Lib/site-packages/pip/baseparser.py
329
8162
"""Base option parser setup""" import sys import optparse import os import textwrap from distutils.util import strtobool from pip.backwardcompat import ConfigParser, string_types from pip.locations import default_config_file from pip.util import get_terminal_size, get_prog from pip._vendor import pkg_resources clas...
lgpl-3.0
gbaty/pyside2
tests/util/processtimer.py
9
1211
#!/usr/bin/env python import time,os class TimeoutException(Exception): def __init__(self, msg): self.msg = msg def __str__(self): return repr(self.msg) class ProcessTimer(object): '''Timeout function for controlling a subprocess.Popen instance. Naive implementation using busy loop, see lat...
lgpl-2.1
masamichi/bite-project
deps/mrtaskman/server/mapreduce/lib/graphy/line_chart.py
77
4014
#!/usr/bin/env python # # 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 ...
apache-2.0
leeon/annotated-django
tests/admin_widgets/widgetadmin.py
68
1222
from django.contrib import admin from . import models class WidgetAdmin(admin.AdminSite): pass class CarAdmin(admin.ModelAdmin): list_display = ['make', 'model', 'owner'] list_editable = ['owner'] class CarTireAdmin(admin.ModelAdmin): def formfield_for_foreignkey(self, db_field, request, **kwargs...
bsd-3-clause
dkodnik/Ant
addons/sale_analytic_plans/__openerp__.py
119
1718
# -*- 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
ridfrustum/lettuce
tests/integration/lib/Django-1.2.5/django/contrib/localflavor/se/forms.py
311
5623
# -*- coding: utf-8 -*- """ Swedish specific Form helpers """ import re from django import forms from django.utils.translation import ugettext_lazy as _ from django.core.validators import EMPTY_VALUES from django.contrib.localflavor.se.utils import (id_number_checksum, validate_id_birthday, format_personal_id_numbe...
gpl-3.0
pacoqueen/unity-launcher-folders
unity_launcher_folders_lib/unity_launcher_foldersconfig.py
2
2222
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE # Copyright (C) 2014 Anton Sukhovatkin <laucnherfolders@exceptionfound.com> # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published ...
gpl-3.0
chendeben/shadowsocks5
shadowsocks/lru_cache.py
983
4290
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # 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 b...
apache-2.0
dims/nova
nova/tests/functional/api_sample_tests/test_personality.py
10
1590
# Copyright 2014 NEC Corporation. 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 ...
apache-2.0
EDUlib/xqueue
submission_queue/management/commands/retire_failed_submissions.py
2
2654
import logging from django.conf import settings from django.core.management.base import BaseCommand from submission_queue.consumer import post_failure_to_lms from submission_queue.models import Submission log = logging.getLogger(__name__) class Command(BaseCommand): help = """ Retire submissions tha...
agpl-3.0
JamieCressey/apt-s3
apts3/__init__.py
1
6562
# Copyright 2016 Jamie Cressey # # 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...
apache-2.0
vietch2612/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/test/finder.py
157
7256
# Copyright (C) 2012 Google, Inc. # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # n...
bsd-3-clause
tafia/servo
python/mozlog/mozlog/structured/handlers/base.py
46
3764
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from threading import Lock import codecs from ..structuredlog import log_levels class BaseHandler(object): """A b...
mpl-2.0
JimCircadian/ansible
lib/ansible/modules/network/slxos/slxos_interface.py
91
14500
#!/usr/bin/python # # (c) 2018 Extreme Networks 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 License, or # (at your option) any late...
gpl-3.0
cryptodechange/electrum-asiccoin
lib/mnemonic.py
16
17283
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 thomasv@gitorious # # 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...
gpl-3.0
spthaolt/socorro
socorro/external/fetch_app.py
5
3830
import json from functools import partial from configman import Namespace, class_converter from socorro.app.socorro_app import App, main #============================================================================== class FetchApp(App): #------------------------------------------------------------------------...
mpl-2.0
sYnfo/samba-1
buildtools/wafsamba/tru64cc.py
45
1947
# compiler definition for tru64/OSF1 cc compiler # based on suncc.py from waf import os, optparse import Utils, Options, Configure import ccroot, ar from Configure import conftest from compiler_cc import c_compiler c_compiler['osf1V'] = ['gcc', 'tru64cc'] @conftest def find_tru64cc(conf): v = conf.env cc =...
gpl-3.0
rowhit/h2o-2
py/testdir_single_jvm/test_exec2_enums_rand_cut2.py
9
15606
import unittest, random, sys, time, re, getpass sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_glm, h2o_util import h2o_print as h2p, h2o_gbm # details: # we want to seed a random dictionary for our enums # string.ascii_uppercase string.printable string.letters ...
apache-2.0
jjscarafia/odoo
addons/account/report/account_balance.py
183
6162
# -*- 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
andykimpe/chromium-test-npapi
tools/memory_inspector/memory_inspector/backends/android/dumpheap_native_parser.py
19
4334
# 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. """This parser turns the am dumpheap -n output into a |NativeHeap| object.""" import logging import re from memory_inspector.core import native_heap from m...
bsd-3-clause
sharaf84/digi
shared/themes/frontend/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/xcodeproj_file.py
505
118664
# 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. """Xcode project file generator. This module is both an Xcode project file generator and a documentation of the Xcode project file format. Knowledge of the proje...
bsd-3-clause
Winand/pandas
pandas/tests/io/formats/test_eng_formatting.py
22
8085
import numpy as np import pandas as pd from pandas import DataFrame from pandas.compat import u import pandas.io.formats.format as fmt from pandas.util import testing as tm class TestEngFormatter(object): def test_eng_float_formatter(self): df = DataFrame({'A': [1.41, 141., 14100, 1410000.]}) fm...
bsd-3-clause
GEMISIS/machine-learning
Kaggle/TensorFlow Speech Recognition Challenge/neural_network.py
1
15527
import os import tensorflow as tf import numpy as np from data import get_files from data import FEATURES from data import OUTPUTS from data import RESULT_MAP class DataPoint: length = 0 filenames = [] xs = [] ys = [] # Our expected inputs for training, testing, etc. class NNData: training = DataP...
mit
liefdiy/bite-project
server/models/compat/tester.py
17
3551
# Copyright 2010 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...
apache-2.0
Ensighten/Diamond
src/collectors/http/http.py
28
3120
# coding=utf-8 """ Collect statistics from a HTTP or HTTPS connexion #### Dependencies * urllib2 #### Usage Add the collector config as : enabled = True ttl_multiplier = 2 path_suffix = "" measure_collector_time = False byte_unit = byte, req_vhost = www.my_server.com req_url = https://www.my_server.com/, https://...
mit
Accelerite/cinder
cinder/api/v1/snapshot_metadata.py
56
6256
# Copyright 2011 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...
apache-2.0
Theer108/invenio
invenio/utils/plotextractor/converter.py
17
7984
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 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 option) any...
gpl-2.0
noam09/deluge-telegramer
telegramer/include/telegram/passport/credentials.py
1
17262
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2018 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by #...
gpl-3.0
ngsutils/ngsutils
ngsutils/gtf/add_xref.py
1
3246
#!/usr/bin/env python ## category General ## desc Appends name annotation from UCSC Xref file '''Adds gene name annotations to a GTF file (xref) This adds gene name annotations based upon the KnownGene annotations from the UCSC Genome Browser. Gene names will be taken from the kgXref table. This table must be download...
bsd-3-clause
liyitest/rr
openstack_dashboard/dashboards/project/routers/ports/forms.py
32
7792
# Copyright 2012, Nachi Ueno, NTT MCL, 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 applic...
apache-2.0
parksandwildlife/ibms
ibms_project/settings.py
1
5554
from dbca_utils.utils import env import dj_database_url import os from pathlib import Path import sys # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = str(Path(__file__).resolve().parents[1]) PROJECT_DIR = str(Path(__file__).resolve().parents[0]) # Add PROJECT_DIR to the system path. ...
apache-2.0
mahendra-r/edx-platform
lms/djangoapps/student_profile/test/test_views.py
113
3370
# -*- coding: utf-8 -*- """ Tests for student profile views. """ from django.conf import settings from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client import RequestFactory from util.testing import UrlResetMixin from student.tests.factories import UserFactory from stu...
agpl-3.0
fredrikeldh/gcc4-mapip2
libstdc++-v3/python/libstdcxx/v6/printers.py
81
31298
# Pretty-printers for libstc++. # Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. # 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 o...
gpl-2.0
Seegnify/Elasticcrawler
lib/curlheaders.py
1
1702
""" API to extract bits and pieces from CURL (command line utility) headers file. The headers can be obtained by calling: curl -D 'headers' 'url'. Currenlty supported formats are for protocols: HTTP, HTTPS. """ class Curlheaders: # response codes and headers container reponses = list() def __init__(self, heade...
bsd-3-clause
brockwhittaker/zulip
zerver/webhooks/wordpress/view.py
3
2178
# Webhooks for external integrations. from django.utils.translation import ugettext as _ from django.http import HttpRequest, HttpResponse from zerver.models import get_client, UserProfile from zerver.lib.actions import check_send_stream_message from zerver.lib.response import json_success, json_error from zerver.decor...
apache-2.0
alexteodor/odoo
addons/base_action_rule/tests/__init__.py
178
1129
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
nikste/tensorflow
tensorflow/python/kernel_tests/sparse_xent_op_test.py
103
13989
# 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...
apache-2.0
blondegeek/pymatgen
pymatgen/io/zeopp.py
2
18888
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import os import re from monty.io import zopen from monty.dev import requires from monty.tempfile import ScratchDir from pymatgen.core.structure import Structure, Molecule from pymatgen.core.lattice import L...
mit
raviii/ravii
items/fields.py
1
1881
from django.db.models.fields.files import ImageField, ImageFieldFile from PIL import Image import os def _add_thumb(s): """ Modifies a string (filename, URL) containing an image filename, to insert '.thumb' """ parts = s.split(".") parts.insert(-1, "thumb") if parts[-1].lower() not in ['jpe...
bsd-3-clause
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/fs/ftpfs.py
3
47623
""" fs.ftpfs ======== FTPFS is a filesystem for accessing an FTP server (uses ftplib in standard library) """ __all__ = ['FTPFS'] import sys import fs from fs.base import * from fs.errors import * from fs.path import pathsplit, abspath, dirname, recursepath, normpath, pathjoin, isbase from ftplib import FTP, err...
agpl-3.0
Kilhog/odoo
addons/account_check_writing/report/__init__.py
446
1066
# -*- 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
rdujardin/icforum
icforum/chat/api/permissions.py
1
1257
# Copyright 2016 Infinite Connection # # 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 w...
apache-2.0
ufal/lindat-kontext
lib/bgcalc/celery.py
2
1633
# Copyright (c) 2018 Charles University, Faculty of Arts, # Institute of the Czech National Corpus # Copyright (c) 2018 Tomas Machalek <tomas.machalek@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 publis...
gpl-2.0
fpsluozi/youtube-dl
youtube_dl/extractor/nerdist.py
128
2982
# encoding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( determine_ext, parse_iso8601, xpath_text, ) class NerdistIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?nerdist\.com/vepisode/(?P<id>[^/?#]+)' _TEST = { 'url': 'http://...
unlicense
utilite-computer/linux-kernel
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
3246
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
gpl-2.0
sam-tsai/django
tests/model_formsets/models.py
143
7751
from __future__ import unicode_literals import datetime import uuid from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Author(models.Model): name = models.CharField(max_length=100) class Meta: or...
bsd-3-clause
kr41/ggrc-core
src/ggrc/models/all_models.py
4
4391
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """All gGRC model classes grouped together for convenience.""" import sys from ggrc.models import inflector from ggrc.models.access_group import AccessGroup from ggrc.models.assessment import Assessment fr...
apache-2.0
Nu3001/external_chromium_org
tools/site_compare/commands/measure.py
189
1573
# Copyright (c) 2011 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. """Command for measuring how long pages take to load in a browser. Prerequisites: 1. The command_line package from tools/site_compare 2. Either the ...
bsd-3-clause
wreckJ/intellij-community
python/lib/Lib/site-packages/django/test/_doctest.py
167
100621
# This is a slightly modified version of the doctest.py that shipped with Python 2.4 # It incorporates changes that have been submitted to the Python ticket tracker # as ticket #1521051. These changes allow for a DoctestRunner and Doctest base # class to be specified when constructing a DoctestSuite. # Module doctest....
apache-2.0
oldmantaiter/inferno
inferno/bin/run.py
3
11375
import logging.config import os import shutil import sys import argparse import yaml from datetime import date from time import mktime from time import strptime from setproctitle import setproctitle from inferno.lib import __version__ from inferno.lib.disco_ext import get_disco_handle from inferno.lib.job import In...
mit
philanthropy-u/edx-platform
openedx/core/djangoapps/verified_track_content/tests/test_partition_scheme.py
2
8983
""" Tests for verified_track_content/partition_scheme.py. """ from datetime import datetime, timedelta import pytz from course_modes.models import CourseMode from student.models import CourseEnrollment from student.tests.factories import UserFactory from xmodule.modulestore.tests.django_utils import SharedModuleStore...
agpl-3.0
KimNorgaard/ansible-modules-extras
system/kernel_blacklist.py
153
3807
#!/usr/bin/python # encoding: utf-8 -*- # (c) 2013, Matthias Vogelgesang <matthias.vogelgesang@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either ve...
gpl-3.0
trec-kba/streamcorpus-pipeline
streamcorpus_pipeline/tests/test_language.py
1
1657
'''tests for langauge detection transform .. This software is released under an MIT/X11 open source license. Copyright 2012-2015 Diffeo, Inc. ''' from __future__ import absolute_import import os import pytest import streamcorpus_pipeline from streamcorpus_pipeline._clean_html import clean_html from streamcorpus_pip...
mit
rolapp/plugin.video.zattooHiQ
pytz/tzfile.py
129
4882
#!/usr/bin/env python ''' $Id: tzfile.py,v 1.8 2004/06/03 00:15:24 zenzen Exp $ ''' try: from cStringIO import StringIO except ImportError: from io import StringIO from datetime import datetime, timedelta from struct import unpack, calcsize from pytz.tzinfo import StaticTzInfo, DstTzInfo, memorized_ttinfo fro...
bsd-2-clause
biolab/orange
Orange/orng/orngABCN2.py
6
1113
""" This module implements argument based rule learning. The main learner class is ABCN2. The first few classes are some variants of ABCN2 with reasonable settings. """ from Orange.classification.rules import DefaultLearner from Orange.classification.rules import ABCN2 from Orange.classification.rules import ABCN2Or...
gpl-3.0
adamlwgriffiths/Pyglet
tools/wraptypes/ctypesparser.py
28
10431
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' from cparser import * ctypes_type_map = { # typename signed longs ('void', True, 0): 'None', ('int', True, 0): 'c_int', ('int', False, 0): 'c_uint', ('int', True, 1): 'c_long', ('int...
bsd-3-clause
PaddlePaddle/Paddle
cmake/copyfile.py
4
1469
# Copyright (c) 2018 PaddlePaddle 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 app...
apache-2.0
svagionitis/youtube-dl
youtube_dl/extractor/clipfish.py
17
1626
from __future__ import unicode_literals import re import time import xml.etree.ElementTree from .common import InfoExtractor from ..utils import ( ExtractorError, parse_duration, ) class ClipfishIE(InfoExtractor): IE_NAME = 'clipfish' _VALID_URL = r'^https?://(?:www\.)?clipfish\.de/.*?/video/(?P<id...
unlicense
lahosken/pants
tests/python/pants_test/task/test_scm_publish_mixin.py
12
4125
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import unittest imp...
apache-2.0
DIYWRJ/MissionPlanner
Scripts/example1.py
57
1491
# cs.???? = currentstate, any variable on the status tab in the planner can be used. # Script = options are # Script.Sleep(ms) # Script.ChangeParam(name,value) # Script.GetParam(name) # Script.ChangeMode(mode) - same as displayed in mode setup screen 'AUTO' # Script.WaitFor(string,timeout) # Script.SendRC(chan...
gpl-3.0
isoriss123/namebench
nb_third_party/dns/rdtypes/nsbase.py
248
2995
# 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
slaymaker1907/hearthbreaker
tests/agents/trade/attack_tests.py
9
9218
import unittest from hearthbreaker.cards import Wisp, WarGolem, BloodfenRaptor, GoldshireFootman, RiverCrocolisk, MagmaRager, \ ChillwindYeti, Voidwalker, AmaniBerserker, AbusiveSergeant, DarkIronDwarf, ShatteredSunCleric, ImpMaster, \ ElvenArcher, Shieldbearer, StormpikeCommando from hearthbreaker.cards.base i...
mit