repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
laslabs/odoo
openerp/addons/base/ir/ir_qweb.py
3
71697
# -*- coding: utf-8 -*- import collections import copy import cStringIO import datetime import hashlib import json import itertools import logging import math import os import re import sys import textwrap import uuid from subprocess import Popen, PIPE from urlparse import urlparse import babel import babel.dates impo...
agpl-3.0
xyantelope/weixin_sogou
weixin_sogou.py
8
5775
from selenium import webdriver import selenium from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from bs4 import BeautifulSoup import requests import logging import re import time from urllib.parse import quote import random BASE_URL = 'http://weixin.sogou.com' UA = "Mozilla/5.0 (Windows ...
mit
isandlaTech/cohorte-demos
led/dump/led-demo-raspberry/cohorte/dist/cohorte-1.0.0-1.0.0-20141201.234602-19-python-distribution/repo/bundles/cohorte/composer/node/commander.py
4
10450
#!/usr/bin/env python # -- Content-Encoding: UTF-8 -- """ Node Commander; gives orders to isolate composers :author: Thomas Calmant :license: Apache Software License 2.0 :version: 3.0.0 .. Copyright 2014 isandlaTech Licensed under the Apache License, Version 2.0 (the "License"); you may not use this fil...
apache-2.0
Prindle19/google-maps-services-python
docs/conf.py
10
5814
# -*- coding: utf-8 -*- # # Maps API documentation build configuration file, created by # sphinx-quickstart on Tue Sep 2 13:42:20 2014. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
apache-2.0
shanest/quantifier-rnn-learning
analysis.py
1
12386
""" Copyright (C) 2017 Shane Steinert-Threlkeld 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 distributed in...
gpl-3.0
pschmitt/home-assistant
tests/test_config_entries.py
5
61224
"""Test the config manager.""" import asyncio from datetime import timedelta import pytest from homeassistant import config_entries, data_entry_flow, loader from homeassistant.core import callback from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.setup import async_setup_component from homea...
apache-2.0
ahmadiga/min_edx
lms/djangoapps/edxnotes/views.py
39
3828
""" Views related to EdxNotes. """ import json import logging from django.contrib.auth.decorators import login_required from django.http import HttpResponse, HttpResponseBadRequest, Http404 from django.conf import settings from django.core.urlresolvers import reverse from edxmako.shortcuts import render_to_response fro...
agpl-3.0
wechasing/tornado
tornado/websocket.py
57
40694
"""Implementation of the WebSocket protocol. `WebSockets <http://dev.w3.org/html5/websockets/>`_ allow for bidirectional communication between the browser and server. WebSockets are supported in the current versions of all major browsers, although older versions that do not support WebSockets are still in use (refer ...
apache-2.0
alexandregz/qualitybots
src/appengine/handlers/handle_result_details.py
26
8511
#!/usr/bin/python2.4 # # Copyright 2011 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...
apache-2.0
llhe/tensorflow
tensorflow/contrib/lookup/__init__.py
58
1739
# 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
dcroc16/skunk_works
google_appengine/lib/django-1.5/django/contrib/localflavor/es/forms.py
108
7737
# -*- coding: utf-8 -*- """ Spanish-specific Form helpers """ from __future__ import absolute_import, unicode_literals import re from django.contrib.localflavor.es.es_provinces import PROVINCE_CHOICES from django.contrib.localflavor.es.es_regions import REGION_CHOICES from django.core.validators import EMPTY_VALUES ...
mit
Alphadelta14/ansible
v1/ansible/runner/action_plugins/win_template.py
109
6605
# (c) 2012, Michael DeHaan <michael.dehaan@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 version 3 of the License, or # (at your option) any lat...
gpl-3.0
Yoctol/yoctol-keras-layer-zoo
test/masking/test_mask3D.py
1
3323
'''Mask2D testcase''' from unittest import TestCase import numpy as np from keras.models import Input, Model from keras.layers import Conv2D from yklz import MaskConv from test import TestBase3DClass class TestMask3DClass(TestBase3DClass, TestCase): def setUp(self): super(TestMask3DClass, self).setUp() ...
gpl-3.0
seem-sky/kbengine
kbe/src/lib/python/Lib/curses/textpad.py
155
7339
"""Simple textbox editing widget with Emacs-like keybindings.""" import curses import curses.ascii def rectangle(win, uly, ulx, lry, lrx): """Draw a rectangle with corners at the provided upper-left and lower-right coordinates. """ win.vline(uly+1, ulx, curses.ACS_VLINE, lry - uly - 1) win.hline(u...
lgpl-3.0
guorendong/iridium-browser-ubuntu
build/android/symbolize_test.py
110
5004
#!/usr/bin/env python # # 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. """Unittest for symbolize.py. This test uses test libraries generated by the Android g++ toolchain. Should things break you can rec...
bsd-3-clause
ProfessionalIT/professionalit-webiste
sdk/google_appengine/lib/django-1.5/django/contrib/auth/tokens.py
296
2631
from datetime import date from django.conf import settings from django.utils.http import int_to_base36, base36_to_int from django.utils.crypto import constant_time_compare, salted_hmac from django.utils import six class PasswordResetTokenGenerator(object): """ Strategy object used to generate and check tokens...
lgpl-3.0
jgmize/bedrock
bedrock/redirects/redirects.py
8
133640
from .util import gone, redirect redirectpatterns = ( # from org-urls-410.txt gone('^catalog/end-user/release$'), gone('^help-wanted\.html$'), gone('^projects/ui/accessibility/access-radar\.html$'), gone('^projects/ui/accessibility/header\.html$'), gone('^projects/ui/accessibility/unix/to-do\.h...
mpl-2.0
barachka/odoo
openerp/addons/base/ir/__init__.py
379
1444
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
dvcolgan/tomatoestogether
core/models.py
1
2515
from django.db import models from django.contrib.auth.models import AbstractBaseUser from timezone_field import TimeZoneField from django.contrib.auth.base_user import BaseUserManager from django.contrib.postgres.fields import ArrayField from datetime import date class UserManager(BaseUserManager): use_in_migrati...
mit
JoseALermaIII/python-tutorials
pythontutorials/Udacity/CS101/Lesson 10 - How to Solve Problems/Q31-Finish daysBetweenDates.py
1
2426
# Credit goes to Websten from forums # # Use Dave's suggestions to finish your daysBetweenDates # procedure. It will need to take into account leap years # in addition to the correct number of days in each month. def nextDay(year, month, day): """Increments year-month-day to the next day.""" if day < daysInMon...
mit
seanpue/ghalib.js
generate_parser_data.py
1
5449
# coding: utf-8 # In[1]: import sys,json sys.path.append('./graphparser') import graphparser as gp from networkx.readwrite import json_graph urdu_data_file = './graphparser/settings/urdu.yaml' devanagari_data_file = './graphparser/settings/devanagari.yaml' diacritics_data_file = './graphparser/settings/diacritics.y...
apache-2.0
spillai/procgraph
src/procgraph_signals/sync_test.py
1
3821
from procgraph import (Generator, Block, ModelExecutionError, register_model_spec) from procgraph.core.registrar import default_library from procgraph.testing.utils import PGTestCase examples = [ ("If coincident, output that", """ 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 """), ("Skip additional", "...
lgpl-3.0
NeCTAR-RC/neutron
neutron/plugins/openvswitch/agent/openflow/ovs_ofctl/ofswitch.py
12
2799
# Copyright (C) 2014,2015 VA Linux Systems Japan K.K. # Copyright (C) 2014,2015 YAMAMOTO Takashi <yamamoto at valinux co jp> # 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 t...
apache-2.0
Mr-F/dotmailer
tests/address_books/test_update.py
1
1563
import pytest from dotmailer.address_books import AddressBook from dotmailer.constants import constants def _confirm_address_book_valid(address_book): address_book_id = address_book.id assert address_book_id is not None return address_book_id @pytest.mark.notdemo @pytest.mark.parametrize('test_data', [ ...
mit
nwjs/chromium.src
tools/binary_size/libsupersize/function_signature.py
2
7725
# Copyright 2017 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. """Logic for parsing a function signatures. Much of this logic is duplicated at tools/binary_size/libsupersize/caspian/function_signature.cc.""" def _Find...
bsd-3-clause
roth1002/infer
infer/lib/capture/javac.py
2
1355
import os import subprocess import traceback import util import utils # this is module located in ../utils.py MODULE_NAME = __name__ MODULE_DESCRIPTION = '''Run analysis of code built with a command like: javac <options> <source files> Analysis examples: infer -- javac srcfile.java''' def gen_instance(*args): ...
bsd-3-clause
totalspectrum/binutils-propeller
gdb/python/lib/gdb/function/strfns.py
9
2684
# Useful gdb string convenience functions. # Copyright (C) 2012-2017 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 you...
gpl-2.0
brandond/ansible
lib/ansible/modules/network/fortios/fortios_vpn_ipsec_manualkey.py
21
10967
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, 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 Lic...
gpl-3.0
kaksmet/servo
tests/wpt/web-platform-tests/tools/wptserve/wptserve/constants.py
326
4616
import utils content_types = utils.invert_dict({"text/html": ["htm", "html"], "application/json": ["json"], "application/xhtml+xml": ["xht", "xhtm", "xhtml"], "application/xml": ["xml"], ...
mpl-2.0
sdcooke/django
tests/shortcuts/views.py
252
3531
import os.path from django.shortcuts import render, render_to_response from django.template import Context, RequestContext from django.utils._os import upath dirs = (os.path.join(os.path.dirname(upath(__file__)), 'other_templates'),) def render_to_response_view(request): return render_to_response('shortcuts/ren...
bsd-3-clause
coxm/djangocms-cascade
cmsplugin_cascade/sharable/forms.py
6
5758
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json from django import forms from django.forms import fields from django.db.models import get_model from django.core.exceptions import ValidationError, ObjectDoesNotExist from django.utils.html import format_html from django.utils.translation impor...
mit
WhittKinley/aima-python
submissions/aartiste/mygames.py
21
4819
from games import Game from math import nan, isnan from queue import PriorityQueue from copy import deepcopy from utils import isnumber from grading.util import print_table class GameState: def __init__(self, to_move, position, board, label=None): self.to_move = to_move self.position = position ...
mit
jimberlage/servo
tests/wpt/web-platform-tests/tools/runner/report.py
21
9614
# flake8: noqa from __future__ import print_function import argparse import json import sys from cgi import escape from collections import defaultdict import types def html_escape(item, escape_quote=False): if isinstance(item, types.StringTypes): rv = escape(item) if escape_quote: r...
mpl-2.0
ntj/fraktionstool
django/fraktionstool/admin.py
1
1537
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from fraktionstool.models import GremiumTyp, Gremium, VorhabenTyp from fraktionstool.models import Vorhaben, Nachricht, GremiumVorhaben from fraktionstool.models import GremiumUser from fraktion...
gpl-3.0
eloquence/unisubs
apps/videos/migrations/0027_auto__chg_field_action_user.py
5
15847
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Action.user' db.alter_column('videos_action', 'user_id', self.gf('django.db.models.f...
agpl-3.0
dseisun/tableau_admin
subscriptions/ListParamSub.py
1
1346
import datetime def previous_sat(): days_since_sat = (datetime.date.isoweekday(datetime.date.today()) + 1) % 7 most_recent_sat = datetime.date.today() - datetime.timedelta(days=days_since_sat) return most_recent_sat.strftime("%Y-%m-%d") def previous_day(): previous_day = datetime.date.today() - datetime.ti...
mit
RichDijk/eXe
exe/engine/lom/lomsubs.py
9
46177
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated Fri May 10 13:36:48 2013 by generateDS.py version 2.9a. # import sys import re import lom as supermod import inspect etree_ = None Verbose_import_ = False ( XMLParser_import_none, XMLParser_import_lxml, XMLParser_import_elementtree ) = range(3) ...
gpl-2.0
sebastic/QGIS
python/plugins/processing/algs/qgis/GeometryConvert.py
4
10025
# -*- coding: utf-8 -*- """ *************************************************************************** Gridify.py --------------------- Date : May 2010 Copyright : (C) 2010 by Michael Minn Email : pyqgis at michaelminn dot com *****************************...
gpl-2.0
EvanK/ansible
lib/ansible/modules/database/mssql/mssql_db.py
31
7002
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Vedit Firat Arig <firatarig@gmail.com> # Outline and parts are reused from Mark Theunissen's mysql_db module # 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_functi...
gpl-3.0
aberke/check-list
app/models/task.py
2
1549
#******************************************************************************** #-------------------------------------------------------------------------------- # # Significance Labs # Brooklyn, NYC # # Author: Alexandra Berke (aberke) # Written: Summer 2014 # # # Task Model # _id {ObjectId} # _room {ObjectId}...
mit
stacywsmith/ansible
contrib/inventory/vagrant.py
148
3972
#!/usr/bin/env python """ Vagrant external inventory script. Automatically finds the IP of the booted vagrant vm(s), and returns it under the host group 'vagrant' Example Vagrant configuration using this script: config.vm.provision :ansible do |ansible| ansible.playbook = "./provision/your_playbook.yml" ...
gpl-3.0
ElAutoestopista/AeneaBot
aenea/aenea.py
1
5991
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # """ Aenea - Service bot from ElAutoestopista Based on work "AstroobeerBot" from ResetReboot """ import logging import sys import random import os import re import requests from telegram.ext import Updater, CommandHandler, MessageHandler, Filters import sqlite3 # Env...
gpl-3.0
Tazer/readthedocs.org
readthedocs/projects/views/private.py
15
24422
"""Project views for authenticated users""" import logging import shutil from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.contrib import messages from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, HttpResponseNotA...
mit
bitalchemy/chris200x9coin
share/qt/make_spinner.py
4415
1035
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...
mit
Nitaco/ansible
lib/ansible/modules/system/seboolean.py
53
6879
#!/usr/bin/python # Copyright: (c) 2012, Stephen Fromm <sfromm@gmail.com> # 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', ...
gpl-3.0
xinwu/horizon
openstack_dashboard/settings.py
1
11974
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # 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...
apache-2.0
zhsso/ubunto-one
src/backends/filesync/data/tests/test_dao.py
6
70338
# Copyright 2008-2015 Canonical # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed...
agpl-3.0
gdub/django
tests/postgres_tests/fields.py
302
1087
""" Indirection layer for PostgreSQL-specific fields, so the tests don't fail when run with a backend other than PostgreSQL. """ from django.db import models try: from django.contrib.postgres.fields import ( ArrayField, BigIntegerRangeField, DateRangeField, DateTimeRangeField, FloatRangeField, HSto...
bsd-3-clause
paeschli/scons-builder
modules/llvm_check.py
1
17634
import os from builder.btools import RegisterCustomTest from builder.btools import AddConfigKey from builder.btools import runCommand from builder.bconfig import getAutoconfPrefix from builder.bconfig import Version import re import SCons.Scanner import SCons.Action def LLVM_CScanner(): cs = SCons.Scanner.Classic...
gpl-2.0
pjg101/SickRage
lib/hachoir_parser/misc/lnk.py
84
24810
""" Windows Shortcut (.lnk) parser. Documents: - The Windows Shortcut File Format (document version 1.0) Reverse-engineered by Jesse Hager http://www.i2s-lab.com/Papers/The_Windows_Shortcut_File_Format.pdf - Wine source code: http://source.winehq.org/source/include/shlobj.h (SHELL_LINK_DATA_FLAGS enum) http://...
gpl-3.0
luser/socorro
socorro/unittest/cron/jobs/test_bugzilla.py
2
13622
# 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/. import datetime import os from nose.tools import eq_, ok_ from dateutil import tz from crontabber.app import CronTabber ...
mpl-2.0
daavery/audacity
lib-src/lv2/lv2/lv2specgen/lv2docgen.py
33
4341
#!/usr/bin/env python # -*- coding: utf-8 -*- # # lv2docgen, a documentation generator for LV2 plugins # Copyright 2012 David Robillard <d@drobilla.net> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notic...
gpl-2.0
adam-iris/mailman
src/mailman/rules/max_size.py
2
1590
# Copyright (C) 2007-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 you...
gpl-3.0
janicduplessis/buck
scripts/diff_rulekeys.py
3
15008
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import argparse import codecs import collections import hashlib import os import re RULE_LINE_REGEX = re.compile(r'.*(\[[^\]+]\])*\s+RuleKey\s+(.*)') PATH_VALUE_REGEX = ...
apache-2.0
jriegel/FreeCAD
src/Mod/Complete/Init.py
35
1879
# FreeCAD init script of the Complete module # (c) 2001 Juergen Riegel #*************************************************************************** #* (c) Juergen Riegel (juergen.riegel@web.de) 2002 * #* * #* T...
lgpl-2.1
RO-ny9/python-for-android
python-modules/twisted/twisted/web/test/test_webclient.py
49
41561
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.web.client}. """ import os from errno import ENOSPC from urlparse import urlparse from twisted.trial import unittest from twisted.web import server, static, client, error, util, resource, http_headers from twis...
apache-2.0
thresholdsoftware/asylum
openerp/addons/l10n_ve/__openerp__.py
51
3057
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved ############################################################################## # Modu...
agpl-3.0
dati91/servo
tests/wpt/web-platform-tests/xhr/resources/access-control-basic-preflight-cache-invalidation.py
46
1772
def main(request, response): def fail(message): response.content = "FAIL " + request.method + ": " + str(message) def getState(token): server_state = request.server.stash.take(token) if not server_state: return "Uninitialized" return server_state def setState(st...
mpl-2.0
codepantry/django
tests/gis_tests/gdal_tests/test_raster.py
238
13865
""" gdalinfo tests/gis_tests/data/rasters/raster.tif: Driver: GTiff/GeoTIFF Files: tests/gis_tests/data/rasters/raster.tif Size is 163, 174 Coordinate System is: PROJCS["NAD83 / Florida GDL Albers", GEOGCS["NAD83", DATUM["North_American_Datum_1983", SPHEROID["GRS 1980",6378137,298.2572221010002...
bsd-3-clause
onitake/ansible
lib/ansible/modules/cloud/vmware/vmware_host_package_facts.py
47
4254
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com> # 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...
gpl-3.0
Ninjakow/TrueSkill
lib/werkzeug/http.py
75
35287
# -*- coding: utf-8 -*- """ werkzeug.http ~~~~~~~~~~~~~ Werkzeug comes with a bunch of utilities that help Werkzeug to deal with HTTP data. Most of the classes and functions provided by this module are used by the wrappers, but they are useful on their own, too, especially if the response and ...
gpl-3.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/pip-9.0.1-py2.7.egg/pip/utils/hashes.py
517
2866
from __future__ import absolute_import import hashlib from pip.exceptions import HashMismatch, HashMissing, InstallationError from pip.utils import read_chunks from pip._vendor.six import iteritems, iterkeys, itervalues # The recommended hash algo of the moment. Change this whenever the state of # the art changes; ...
gpl-3.0
windyuuy/opera
chromium/src/third_party/python_26/Lib/test/test_math.py
55
38805
# Python test set -- math module # XXXX Should not do tests around zero only from test.test_support import run_unittest, verbose import unittest import math import os import sys import random eps = 1E-05 NAN = float('nan') INF = float('inf') NINF = float('-inf') # locate file with test values if __name__ == '__main_...
bsd-3-clause
mrjacobagilbert/gnuradio
gnuradio-runtime/python/pmt/pmt_to_python.py
6
5334
# Copyright 2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # from . import pmt_python as pmt import numpy # SWIG isn't taking in the #define PMT_NIL; # getting the singleton locally. PMT_NIL = pmt.get_PMT_NIL() #define missing def pmt_to_tup...
gpl-3.0
eahneahn/free
lib/python2.7/site-packages/requests/packages/chardet/chardetect.py
743
1141
#!/usr/bin/env python """ Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. """ from ...
agpl-3.0
csdms/wmt-metadata
wmtmetadata/tests/test_build.py
1
1959
"""Unit tests for the build module.""" import os import pytest from wmtmetadata.build import BuildMetadata from . import data_dir sample_config_file = os.path.join(data_dir, 'wmt-config-siwenna.yaml') host = 'siwenna.colorado.edu' name = 'Hydrotrend' tmp_dir = '/tmp' def test_build_noargs(): with pytest.raises...
mit
lidiamcfreitas/FenixScheduleMaker
ScheduleMaker/brython/www/src/Lib/encodings/koi8_u.py
37
14069
""" Python Character Mapping Codec koi8_u generated from 'python-mappings/KOI8-U.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...
bsd-2-clause
vicky2135/lucious
oscar/lib/python2.7/site-packages/django/contrib/messages/storage/fallback.py
704
2172
from django.contrib.messages.storage.base import BaseStorage from django.contrib.messages.storage.cookie import CookieStorage from django.contrib.messages.storage.session import SessionStorage class FallbackStorage(BaseStorage): """ Tries to store all messages in the first backend, storing any unstored me...
bsd-3-clause
dsm054/pandas
pandas/tests/tslibs/test_conversion.py
7
2377
# -*- coding: utf-8 -*- import numpy as np import pytest import pandas.util.testing as tm from pandas import date_range from pandas._libs.tslib import iNaT from pandas._libs.tslibs import conversion, timezones def compare_utc_to_local(tz_didx, utc_didx): f = lambda x: conversion.tz_convert_single(x, 'UTC', tz_d...
bsd-3-clause
hsfzxjy/wisecitymbc
site_packages/rest_framework/throttling.py
2
7718
""" Provides various throttling policies. """ from __future__ import unicode_literals from django.core.cache import cache as default_cache from django.core.exceptions import ImproperlyConfigured from rest_framework.settings import api_settings import time class BaseThrottle(object): """ Rate throt...
gpl-2.0
jdfekete/progressivis
examples/test_mcscatterplot.py
1
2384
""" Test loading of nyc_taxis with dynamic queries. """ import time import pandas as pd import copy from progressivis.core import Scheduler, Every from progressivis.table import Table from progressivis.vis import MCScatterPlot from progressivis.io import CSVLoader #from progressivis.datasets import get_dataset from pro...
bsd-2-clause
netdude78/web2py_crypto_utility
Cryptography.py
1
4358
#!/usr/bin/env python # coding: utf8 #!/usr/bin/env python # # Copyright (c) 2014, Dave Stoll dave<dot>stoll<at>gmail<dot>com # 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 ...
bsd-2-clause
damiencalloway/djtut
mysite/env/lib/python2.7/site-packages/django/conf/locale/nl/formats.py
107
3085
# -*- 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 = 'j F Y' # '20 januari 2009' TIME_FORMAT = 'H:i' ...
mit
azunite/gyp_20150930
test/lib/TestWin.py
90
3168
# Copyright (c) 2014 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. """ TestWin.py: a collection of helpers for testing on Windows. """ import errno import os import re import sys import subprocess class Registry(object): def ...
bsd-3-clause
grhawk/ASE
tools/ase/utils/distance.py
6
1814
import numpy as np def distance(s1, s2, permute=True): """Get the distance between two structures s1 and s2. The distance is defined by the Frobenius norm of the spatial distance between all coordinates (see numpy.linalg.norm for the definition). permute: minimise the distance by 'permuting'...
gpl-2.0
geekboxzone/lollipop_external_chromium_org_tools_grit
grit/gather/chrome_scaled_image_unittest.py
25
5714
#!/usr/bin/env python # Copyright (c) 2012 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. '''Unit tests for ChromeScaledImage.''' import re import struct import unittest import zlib from grit import exception from grit...
bsd-2-clause
Outernet-Project/monitoring
client/monitor.py
1
11219
#!/usr/bin/python2 """ monitor.py: Monitor ONDD internal state and report to remote host Copyright 2014-2015, Outernet Inc. Some rights reserved. This software is free software licensed under the terms of GPLv3. See COPYING file that comes with the source code, or http://www.gnu.org/licenses/gpl.txt. """ import os...
gpl-3.0
webu/django-filer
tests/test_utils.py
2
1855
import os from zipfile import ZipFile from django.conf import settings from django.core.files import File as DjangoFile from django.test.testcases import TestCase from tests.helpers import create_image from filer.utils.loader import load_object from filer.utils.zip import unzip # Some target classes for the classl...
bsd-3-clause
bgalehouse/grr
parsers/fingerprint.py
10
15321
#!/usr/bin/env python # Copyright 2011 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...
apache-2.0
gregdek/ansible
lib/ansible/vars/hostvars.py
12
4444
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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 version 3 of the License, or # (at your option) an...
gpl-3.0
damiencalloway/djtut
mysite/env/lib/python2.7/site-packages/django/contrib/localflavor/hr/hr_choices.py
109
2799
# -*- coding: utf-8 -*- """ Sources: Croatian Counties: http://en.wikipedia.org/wiki/ISO_3166-2:HR Croatia doesn't have official abbreviations for counties. The ones provided are in common use. """ from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ HR_COUNTY_C...
mit
Molecular-Image-Recognition/Molecular-Image-Recognition
code/rmgpy/statmech/rotationTest.py
2
34247
#!/usr/bin/env python # encoding: utf-8 ################################################################################ # # RMG - Reaction Mechanism Generator # # Copyright (c) 2002-2017 Prof. William H. Green (whgreen@mit.edu), # Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) # # ...
mit
xuxiao19910803/edx-platform
lms/djangoapps/courseware/management/commands/dump_course_ids.py
144
1323
# pylint: disable=missing-docstring from optparse import make_option from textwrap import dedent from django.core.management.base import BaseCommand, CommandError from xmodule.modulestore.django import modulestore class Command(BaseCommand): """ Simple command to dump the course_ids available to the lms. ...
agpl-3.0
bjones1/enki
tests/test_core/test_open_file.py
3
2522
#!/usr/bin/env python3 import unittest import os.path import sys import os sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(__file__)), "..")) import base import enki.core.workspace from enki.core.core import core class Test(base.TestCase): def test_1(self): # Do not open same file twic...
gpl-2.0
ozburo/youtube-dl
devscripts/gh-pages/add-version.py
174
1170
#!/usr/bin/env python3 from __future__ import unicode_literals import json import sys import hashlib import os.path if len(sys.argv) <= 1: print('Specify the version number as parameter') sys.exit() version = sys.argv[1] with open('update/LATEST_VERSION', 'w') as f: f.write(version) versions_info = jso...
unlicense
baidu/Paddle
python/paddle/fluid/tests/test_detection.py
1
20005
# 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
sdopoku/flask-hello-world
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py
1093
8936
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_ide...
gpl-2.0
SanketDG/coala
coalib/core/FileBear.py
6
1227
from coalib.core.Bear import Bear from coalib.settings.FunctionMetadata import FunctionMetadata class FileBear(Bear): """ This bear base class parallelizes tasks for each file given. """ def __init__(self, section, file_dict): """ :param section: The section object where b...
agpl-3.0
bzbarsky/servo
tests/wpt/web-platform-tests/tools/pytest/testing/test_pdb.py
170
9594
import sys import _pytest._code def runpdb_and_get_report(testdir, source): p = testdir.makepyfile(source) result = testdir.runpytest_inprocess("--pdb", p) reports = result.reprec.getreports("pytest_runtest_logreport") assert len(reports) == 3, reports # setup/call/teardown return reports[1] cl...
mpl-2.0
rwakulszowa/servo
tests/wpt/web-platform-tests/tools/wptserve/wptserve/response.py
116
15903
from collections import OrderedDict from datetime import datetime, timedelta import Cookie import json import types import uuid import socket from .constants import response_codes from .logger import get_logger missing = object() class Response(object): """Object representing the response to a HTTP request ...
mpl-2.0
almeidapaulopt/erpnext
erpnext/utilities/product.py
1
4029
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cint, fmt_money, flt, nowdate, getdate from erpnext.accounts.doctype.pricing_rule.pricing_rule import get_pricin...
gpl-3.0
jasonliu119/PokemonGo-Bot
pokemongo_bot/api_wrapper.py
17
5561
import time import logging from pgoapi.exceptions import (ServerSideRequestThrottlingException, NotLoggedInException, ServerBusyOrOfflineException, NoPlayerPositionSetException, EmptySubrequestChainException, UnexpectedResponseException) from pgoapi.pgoapi import PGoApi, PGoApiRequest, RpcApi from pgoapi.p...
mit
flyfei/python-for-android
python3-alpha/python3-src/Lib/test/encoded_modules/__init__.py
179
1274
# -*- encoding: utf-8 -*- # This is a package that contains a number of modules that are used to # test import from the source files that have different encodings. # This file (the __init__ module of the package), is encoded in utf-8 # and contains a list of strings from various unicode planes that are # encoded diffe...
apache-2.0
moschlar/SAUCE
sauce/bin/compile.py
1
2492
#!/usr/bin/env python ''' This script can be used to compile user and lesson/group data from various sources in various formats into one single files with columns suitable for the use by add_users.py. You have, of course, to modify this file to suit your needs. ''' # ## SAUCE - System for AUtomated Code Evaluation ## ...
agpl-3.0
Teamxrtc/webrtc-streaming-node
third_party/webrtc/src/chromium/src/tools/perf/page_sets/top_10.py
12
3984
# 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. from telemetry.page import page as page_module from telemetry.page import shared_page_state from telemetry import story class SimplePage(page_module.Page): ...
mit
3v1n0/snapcraft
snapcraft/tests/plugins/test_autotools.py
2
13532
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016 Canonical Ltd # Copyright (C) 2016 Harald Sitter <sitter@kde.org> # # 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 by the Free Software ...
gpl-3.0
vitzli/recipeparser
parsetab.py
1
4222
# parsetab.py # This file is automatically generated. Do not edit. _tabversion = '3.2' _lr_method = 'LALR' _lr_signature = b'\xder>G\xe9\xa2IV\xbfk\xf3R"t\xb9\xeb' _lr_action_items = {'SEPARATOR':([1,3,4,5,6,7,8,9,],[10,11,12,13,14,15,16,17,]),'$end':([2,22,32,37,44,45,50,51,52,54,55,56,59,63,],[0,-11,-12,-6,-3...
mit
Flight/django-filer
filer/utils/recursive_dictionary.py
5
3361
# -*- coding: utf-8 -*- # https://gist.github.com/114831 # recursive_dictionary.py # Created 2009-05-20 by Jannis Andrija Schnitzer. # # Copyright (c) 2009 Jannis Andrija Schnitzer # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (...
bsd-3-clause
qqzwc/XX-Net
code/default/python27/1.0/lib/encodings/iso8859_11.py
593
12591
""" Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO8859/8859-11.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,errors...
bsd-2-clause
eicher31/compassion-switzerland
partner_compassion/models/mail_message.py
3
2753
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __manifest__.py...
agpl-3.0