repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
lammps/lammps
tools/coding_standard/homepage.py
4
4711
#!/usr/bin/env python3 # Utility for detecting incorrect LAMMPS homepage URLs # # Written by Richard Berger (Temple University) import os import sys import glob import re import yaml import argparse import shutil DEFAULT_CONFIG = """ recursive: true include: - cmake/** - doc - doc/src/** - python -...
gpl-2.0
dgary50/eovsa
fem_attn_calib.py
1
16015
# !/usr/bin/env python # Hacked from Jim's dump_tsys_ext.py (pipeline:test_svn/python/, version 2016_may_25) # 2016-08-01 BC: added rd_fem_attn() to read the FEM attenuation records fron the stateframe # added cal_fem_gain() to convert FEM attenuation records to gain change, # ...
gpl-2.0
veekun/pokedex
pokedex/struct/_pokemon_struct.py
1
19585
# encoding: utf8 u"""Defines a construct `pokemon_struct`, containing the structure of a single Pokémon saved within a game -- often seen as a .pkm file. This is the same format sent back and forth over the GTS. """ import datetime from construct import (Adapter, BitField, BitStruct, Buffered, ...
mit
brython-dev/brython
www/src/Lib/test/test_tuple.py
6
19307
from test import support, seq_tests import unittest import gc import pickle # For tuple hashes, we normally only run a test to ensure that we get # the same results across platforms in a handful of cases. If that's # so, there's no real point to running more. Set RUN_ALL_HASH_TESTS to # run more anyway. That's usu...
bsd-3-clause
makerbot/ReplicatorG
skein_engines/skeinforge-47/skeinforge_application/skeinforge_plugins/analyze_plugins/analyze_utilities/tableau.py
4
35109
""" Tableau has a couple of base classes for analyze viewers. """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ from fabmetheus_utilities import archi...
gpl-2.0
charleswhchan/compose
compose/cli/utils.py
8
1953
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import os import platform import ssl import subprocess from docker import version as docker_py_version from six.moves import input from .. import __version__ def yesno(prompt, default=None): """ P...
apache-2.0
willharris/django-allauth
allauth/account/decorators.py
24
1632
from django.contrib.auth.decorators import login_required from django.contrib.auth import REDIRECT_FIELD_NAME from django.shortcuts import render from .models import EmailAddress from .utils import send_email_confirmation def verified_email_required(function=None, login_url=None, ...
mit
virtUOS/mooc.ip
tests/selenium_webdriver/selenium-webdriver-test-quick/htmlblock.py
2
2556
# -*- coding: iso-8859-15 -*- from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException import unittest, time, re import mysuite class HtmlBloc...
gpl-2.0
k0pernicus/giwyn
giwyn/lib/scan.py
1
1414
import os import giwyn.lib.settings.settings from os.path import expanduser from giwyn.lib.config.config import open_config_file from giwyn.lib.config.config import add_new_path from giwyn.lib.config.config import close_config_file def scan(): """ Function to scan the directory from the home dir, or the repo...
gpl-3.0
analogdevicesinc/gnuradio
gr-analog/python/analog/qa_phase_modulator.py
47
1742
#!/usr/bin/env python # # Copyright 2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your optio...
gpl-3.0
fernandoacorreia/DjangoWAWSLogging
DjangoWAWSLogging/env/Lib/site-packages/django/contrib/localflavor/nl/forms.py
87
2859
""" NL-specific Form helpers """ from __future__ import absolute_import import re from django.contrib.localflavor.nl.nl_provinces import PROVINCE_CHOICES from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, Select from django.utils.encoding i...
mit
specdb/uvqs
uvqs/fuv.py
1
7340
""" Module to ingest SDSS III (aka BOSS) data products """ from __future__ import print_function, absolute_import, division, unicode_literals import numpy as np import os, json import pdb from astropy.table import Table, Column, vstack from astropy.time import Time from astropy.io import fits from linetools import ...
bsd-3-clause
insomnia-lab/libreant
libreantdb/test/test_validate.py
4
1167
from nose.tools import eq_, raises, assert_raises from libreantdb import api validate_book = api.validate_book collectStrings = api.collectStrings @raises(ValueError) def test_invalid_book(): '''Book without language''' validate_book(dict(title='Un libro')) def test_long_language(): '''Book with langu...
agpl-3.0
tedi3231/openerp
build/lib/openerp/addons/mrp/wizard/change_production_qty.py
54
5095
# -*- 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
YeelerG/scrapy
scrapy/spidermiddlewares/depth.py
88
2051
""" Depth Spider Middleware See documentation in docs/topics/spider-middleware.rst """ import logging from scrapy.http import Request logger = logging.getLogger(__name__) class DepthMiddleware(object): def __init__(self, maxdepth, stats=None, verbose_stats=False, prio=1): self.maxdepth = maxdepth ...
bsd-3-clause
illicitonion/givabit
lib/sdks/google_appengine_1.7.1/google_appengine/lib/django_1_2/tests/modeltests/raw_query/tests.py
39
9056
from datetime import date from django.conf import settings from django.db import connection from django.db.models.sql.query import InvalidQuery from django.test import TestCase from models import Author, Book, Coffee, Reviewer, FriendlyAuthor class RawQueryTests(TestCase): fixtures = ['raw_query_books.json'] ...
apache-2.0
dongxingshui/virt-manager
virtManager/addhardware.py
1
67436
# # Copyright (C) 2006-2007, 2012-2015 Red Hat, Inc. # Copyright (C) 2006 Hugh O. Brock <hbrock@redhat.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 of the License, or ...
gpl-2.0
gale320/binwalk
setup.py
17
6735
#!/usr/bin/env python import os import sys import shutil import tempfile import subprocess from distutils.core import setup, Command from distutils.dir_util import remove_tree MODULE_NAME = "binwalk" # Python2/3 compliance try: raw_input except NameError: raw_input = input # cd into the src directory, no mat...
mit
bfontaine/alfred-pp
unidecode/x0cf.py
253
4713
data = ( 'ke', # 0x00 'keg', # 0x01 'kegg', # 0x02 'kegs', # 0x03 'ken', # 0x04 'kenj', # 0x05 'kenh', # 0x06 'ked', # 0x07 'kel', # 0x08 'kelg', # 0x09 'kelm', # 0x0a 'kelb', # 0x0b 'kels', # 0x0c 'kelt', # 0x0d 'kelp', # 0x0e 'kelh', # 0x0f 'kem', # 0x10 'keb', # ...
mit
Amechi101/concepteur-market-app
venv/lib/python2.7/site-packages/django/contrib/gis/shortcuts.py
234
1126
import zipfile from io import BytesIO from django.conf import settings from django.http import HttpResponse from django.template import loader def compress_kml(kml): "Returns compressed KMZ from the given KML string." kmz = BytesIO() zf = zipfile.ZipFile(kmz, 'a', zipfile.ZIP_DEFLATED) zf.writestr('do...
mit
wisdark/Empire
lib/modules/powershell/privesc/ask.py
10
4377
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Invoke-Ask', 'Author': ['Jack64'], 'Description': ("Leverages Start-Process' -Verb runAs opti...
bsd-3-clause
yank555-lu/N3-KK-Sourcedrops
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
boomsbloom/dtm-fmri
DTM/for_gensim/lib/python2.7/site-packages/requests/packages/urllib3/util/selectors.py
86
18836
# Backport of selectors.py from Python 3.5+ to support Python < 3.4 # Also has the behavior specified in PEP 475 which is to retry syscalls # in the case of an EINTR error. This module is required because selectors34 # does not follow this behavior and instead returns that no dile descriptor # events have occurred rath...
mit
swiftstack/swift
swift/common/bufferedhttp.py
2
12433
# Copyright (c) 2010-2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
pleaseproject/python-for-android
python3-alpha/python3-src/Lib/idlelib/dynOptionMenuWidget.py
67
1308
""" OptionMenu widget modified to allow dynamic menu reconfiguration and setting of highlightthickness """ from tkinter import OptionMenu from tkinter import _setit import copy class DynOptionMenu(OptionMenu): """ unlike OptionMenu, our kwargs can include highlightthickness """ def __init__(self, maste...
apache-2.0
pim89/youtube-dl
youtube_dl/extractor/abcnews.py
11
5017
# coding: utf-8 from __future__ import unicode_literals import calendar import re import time from .amp import AMPIE from .common import InfoExtractor from ..compat import compat_urlparse class AbcNewsVideoIE(AMPIE): IE_NAME = 'abcnews:video' _VALID_URL = r'https?://abcnews\.go\.com/[^/]+/video/(?P<display_...
unlicense
STRML/OpenBazaar
node/setup_db.py
3
5484
import os from pysqlcipher import dbapi2 _PASSPHRASE = 'passphrase' # TODO: Use indexes. # TODO: Maybe it makes sense to put tags on a different table _SCHEMA = ( ( 'markets', ( 'id INTEGER PRIMARY KEY AUTOINCREMENT', 'key TEXT', 'value TEXT', 'las...
mit
fast90/youtube-dl
youtube_dl/extractor/rudo.py
8
1580
# coding: utf-8 from __future__ import unicode_literals import re from .jwplatform import JWPlatformBaseIE from ..utils import ( js_to_json, get_element_by_class, unified_strdate, ) class RudoIE(JWPlatformBaseIE): _VALID_URL = r'https?://rudo\.video/vod/(?P<id>[0-9a-zA-Z]+)' _TEST = { '...
unlicense
Djaler/ZloyBot
modules/forward.py
1
1187
from telegram.ext import Filters, MessageHandler, CommandHandler from utils import get_username_or_name class Forward: def __init__(self, chat_id, admin_id): self._chat_id = chat_id self._admin_id = admin_id def add_handlers(self, add_handler): add_handler(MessageHandler(Filters....
mit
googleapis/proto-breaking-change-detector
src/cli/detect.py
1
4234
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
apache-2.0
stvstnfrd/edx-platform
openedx/core/djangoapps/schedules/management/commands/tests/test_send_course_update.py
1
5047
""" Tests for send_course_update management command. """ from unittest import skipUnless import ddt from django.conf import settings from django.core import mail from edx_ace.utils.date import serialize from mock import patch from six.moves import range from openedx.core.djangoapps.schedules import resolvers, tasks...
agpl-3.0
saydulk/newfies-dialer
newfies/appointment/models/alarms.py
5
8178
# -*- coding: utf-8 -*- from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils.timezone import now from appointment.constants import ALARM_METHOD, ALARM_STATUS, ALARM_RESULT, \ ALARMREQUEST_STATUS from appointment.models.events import Event from survey.models import S...
mpl-2.0
maurofaccenda/ansible
lib/ansible/modules/web_infrastructure/taiga_issue.py
41
11513
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Alejandro Guirao <lekumberri@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 ...
gpl-3.0
jmgc/myhdl-numeric
scripts/benchmark/test_findmax.py
3
1797
from __future__ import absolute_import from myhdl import * from glibc_random import glibc_random def max2(z, a, b): @always_comb def logic(): if a > b: z.next = a else: z.next = b return logic def maxn(z, a): L = len(a) assert L assert L % 2 == 0 ...
lgpl-2.1
cshallue/models
research/im2txt/im2txt/run_inference.py
5
3091
# 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
MarquisLP/Sidewalk-Champion
lib/game_states/stage_select_state.py
1
37606
"""This module handles the Stage Select Screen and all of its various components. Module Constants: BORDER_WIDTH (int): The thickness, in pixels, of the borders of the stage preview as well as each stage thumbnail. NUM_OF_THUMBS (int): The number of Stage Thumbnails shown on the screen at once....
unlicense
stylianos-kampakis/scikit-learn
examples/covariance/plot_outlier_detection.py
235
3891
""" ========================================== Outlier detection with several methods. ========================================== When the amount of contamination is known, this example illustrates two different ways of performing :ref:`outlier_detection`: - based on a robust estimator of covariance, which is assumin...
bsd-3-clause
moniqx4/bite-project
deps/gdata-python-client/samples/apps/multidomain_quick_start_example.py
22
13180
#!/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
Salat-Cx65/python-for-android
python3-alpha/python3-src/Lib/test/test_binascii.py
57
8992
"""Test the binascii C module.""" from test import support import unittest import binascii import array # Note: "*_hex" functions are aliases for "(un)hexlify" b2a_functions = ['b2a_base64', 'b2a_hex', 'b2a_hqx', 'b2a_qp', 'b2a_uu', 'hexlify', 'rlecode_hqx'] a2b_functions = ['a2b_base64', 'a2b_hex', ...
apache-2.0
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/setuptools-0.6c11/setuptools/command/bdist_wininst.py
325
2283
from distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst import os, sys class bdist_wininst(_bdist_wininst): _good_upload = _bad_upload = None def create_exe(self, arcname, fullname, bitmap=None): _bdist_wininst.create_exe(self, arcname, fullname, bitmap) installer_name = se...
bsd-3-clause
shsingh/ansible
lib/ansible/modules/network/meraki/meraki_firewalled_services.py
6
8188
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2019, Kevin Breit (@kbreit) <kevin.breit@kevinbreit.net> # 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 = { ...
gpl-3.0
dkillick/iris
lib/iris/tests/test_concatenate.py
5
36145
# (C) British Crown Copyright 2013 - 2017, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
lgpl-3.0
mavit/ansible
lib/ansible/plugins/lookup/flattened.py
101
2821
# (c) 2013, Serge van Ginderachter <serge@vanginderachter.be> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ lookup: flattened aut...
gpl-3.0
hn8841182/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/difflib.py
737
82544
#! /usr/bin/env python3 """ Module difflib -- helpers for computing deltas between objects. Function get_close_matches(word, possibilities, n=3, cutoff=0.6): Use SequenceMatcher to return list of the best "good enough" matches. Function context_diff(a, b): For two lists of strings, return a delta in context ...
gpl-3.0
jhseu/tensorflow
tensorflow/python/feature_column/feature_column.py
3
126158
# 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
xpansa/pmis
purchase_request_to_rfq/wizard/__init__.py
7
1026
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Eficent (<http://www.eficent.com/>) # <contact@eficent.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero ...
agpl-3.0
hfutsuchao/Python2.6
详情页隐藏电话统计分析/详情页改版分析.py
2
28599
# coding: gbk import os,MySQLdb,time t= time.time() dateNow = time.strftime('%Y-%m-%d',time.localtime(time.time())) data = open('C:\\Users\\suchao\\Desktop\\phone_20121108\\fufei_zhongjie_short_20121108.log').readlines() data2 = open('C:\\Users\\suchao\\Desktop\\phone_20121108\\mianfei_geren_short_20121108.log').r...
gpl-2.0
arank/mxnet
example/fcn-xs/fcn_xs.py
15
2987
# pylint: skip-file import sys, os import argparse import mxnet as mx import numpy as np import logging import symbol_fcnxs import init_fcnxs from data import FileIter from solver import Solver logger = logging.getLogger() logger.setLevel(logging.INFO) ctx = mx.gpu(0) def main(): fcnxs = symbol_fcnxs.get_fcn32s_s...
apache-2.0
unindented/streamcode
client/static/jsrepl/extern/python/unclosured/lib/python2.7/encodings/cp1254.py
593
13758
""" Python Character Mapping Codec cp1254 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.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,in...
mit
ojengwa/odoo
openerp/report/render/rml2pdf/customfonts.py
261
3493
# -*- 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
ltilve/ChromiumGStreamerBackend
tools/telemetry/telemetry/value/histogram_unittest.py
3
3013
# 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. import os import unittest from telemetry import story from telemetry import page as page_module from telemetry import value from telemetry.value import histo...
bsd-3-clause
MostafaGazar/tensorflow
tensorflow/python/kernel_tests/sparse_tensor_dense_matmul_grad_test.py
20
2885
# 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
atulc007/sublime-github
lib/requests/packages/urllib3/filepost.py
9
3144
# urllib3/filepost.py # Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import codecs import mimetypes from uuid import uuid4 try: from io import BytesIO except ...
mit
myang321/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
SlimRoms/android_external_chromium_org
chrome/common/extensions/docs/server2/gcs_file_system.py
58
4714
# 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 third_party.cloudstorage import cloudstorage_api from third_party.cloudstorage import common from third_party.cloudstorage import errors from docs_serv...
bsd-3-clause
cedi4155476/QGIS
python/plugins/db_manager/dlg_table_properties.py
12
11445
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS Date : Oct 13, 2011 copyright : (C) 2011 by Giuseppe Sucameli email : brush.tyler@...
gpl-2.0
supersven/intellij-community
python/lib/Lib/site-packages/django/contrib/admin/validation.py
78
19043
from django.core.exceptions import ImproperlyConfigured from django.db import models from django.db.models.fields import FieldDoesNotExist from django.forms.models import (BaseModelForm, BaseModelFormSet, fields_for_model, _get_foreign_key) from django.contrib.admin.util import get_fields_from_path, NotRelationFiel...
apache-2.0
educloudalliance/eca-auth-data
authdata/tests/test_admin.py
1
2031
# -*- coding: utf-8 -*- # The MIT License (MIT) # # Copyright (c) 2014-2015 Haltu Oy, http://haltu.fi # # 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 withou...
mit
weolar/miniblink49
third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/builders.py
6
5428
# Copyright (C) 2011 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 conditions and the ...
apache-2.0
sparkslabs/kamaelia_
Code/Python/Kamaelia/Kamaelia/Apps/SocialBookmarks/URLGetter.py
3
5299
#! /usr/bin/python ''' Basic URL requesting component. Gets passed a list in the format: [url,username,password] where username and password are optional Returns a list in the format: ["OK",data] or ["Error", "Error string"] Set up for GET and POST requests TODO: Build in the facility to handle a second urllib connecti...
apache-2.0
rgeleta/odoo
addons/delivery/__init__.py
376
1103
# -*- 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
sophpie/forumphp2014
vendor/doctrine/orm/docs/en/_exts/configurationblock.py
2577
3506
#Copyright (c) 2010 Fabien Potencier # #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 #to use, copy, modify, merge, publish, distrib...
bsd-3-clause
Sapphirine/SemanticCategIRT
src/tools.py
1
5812
# https://github.com/alexalemi/segmentation/blob/master/code/tools.py """ A set of useful tools for handling the text segmentation tasks. """ import numpy as np from itertools import chain, tee, izip # from nltk.corpus import stopwords from nltk.stem import PorterStemmer # stopword_set = set() # initialize a set of th...
mit
qingqing01/models
fluid/image_classification/caffe2fluid/kaffe/custom_layers/permute.py
3
1112
""" A custom layer for 'Permute' which is equivalent to transpose in paddle """ from .register import register def permute_shape(input_shape, order): """ calculate the output shape of this layer using input shapes Args: @input_shape (list of numbers): input shape Returns: @output_shape ...
apache-2.0
leppa/home-assistant
homeassistant/components/mqtt/light/schema_json.py
5
17759
""" Support for MQTT JSON lights. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/light.mqtt_json/ """ import json import logging import voluptuous as vol from homeassistant.components import mqtt from homeassistant.components.light import ( ATTR_BR...
apache-2.0
eestay/edx-platform
common/test/acceptance/pages/lms/dashboard.py
6
6685
# -*- coding: utf-8 -*- """ Student dashboard page. """ from bok_choy.page_object import PageObject from bok_choy.promise import EmptyPromise from . import BASE_URL class DashboardPage(PageObject): """ Student dashboard, where the student can view courses she/he has registered for. """ def __init...
agpl-3.0
numenta/nupic.research
projects/imagenet/experiments/custom_super.py
3
6867
# Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2020, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software you can redistribute it and/or modify # it under...
agpl-3.0
hkawasaki/kawasaki-aio8-1
cms/envs/dev_with_worker.py
148
1153
""" This config file follows the dev enviroment, but adds the requirement of a celery worker running in the background to process celery tasks. The worker can be executed using: django_admin.py celery worker """ # We intentionally define lots of variables that aren't used, and # want to import all variables from bas...
agpl-3.0
tntnatbry/tensorflow
tensorflow/python/debug/cli/stepper_cli_test.py
47
19722
# 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
elric/virtaal-debian-snapshots
virtaal/plugins/tm/models/remotetm.py
2
3420
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2008-2011 Zuza Software Foundation # # This file is part of Virtaal. # # 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 ...
gpl-2.0
dlitz/paramiko
paramiko/file.py
36
18087
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (a...
lgpl-2.1
AlmostBetterNetwork/podmaster-host
notifications/migrations/0001_initial.py
3
1338
# -*- coding: utf-8 -*- from __future__ import absolute_import # Generated by Django 1.10.2 on 2016-11-20 17:55 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('...
apache-2.0
kaplun/ops
modules/elmsubmit/lib/elmsubmit_field_validation.py
39
2909
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2004, 2005, 2006, 2007, 2008, 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 t...
gpl-2.0
caseyrygt/osf.io
scripts/tests/test_retract_registrations.py
39
3189
# -*- coding: utf-8 -*- from datetime import datetime, timedelta from nose.tools import * # noqa from tests.base import OsfTestCase from tests.factories import RegistrationFactory from tests.factories import UserFactory from scripts.retract_registrations import main class TestRetractRegistrations(OsfTestCase): ...
apache-2.0
sumedhasingla/VTK
Interaction/Style/Testing/Python/TestInteractorStyleTerrain.py
10
2568
#!/usr/bin/env python import vtk import vtk.test.Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() Scale = 5 lut = vtk.vtkLookupTable() lut.SetHueRange(0.6, 0) lut.SetSaturationRange(1.0, 0) lut.SetValueRange(0.5, 1.0) demModel = vtk.vtkDEMReader() demModel.SetFileName(VTK_DATA_ROOT +...
bsd-3-clause
tofumatt/quotes
apps/chats/views.py
1
2205
from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import get_object_or_404, render, render_to_response from django.template import RequestContext from django.utils.translation import ugettext as _ from django.views.decorators.cache import cache_page from django.views.decorators.vary impor...
mit
bdero/edx-platform
common/djangoapps/terrain/stubs/lti.py
24
12435
""" Stub implementation of LTI Provider. What is supported: ------------------ 1.) This LTI Provider can service only one Tool Consumer at the same time. It is not possible to have this LTI multiple times on a single page in LMS. """ from uuid import uuid4 import textwrap import urllib import re from oauthlib.oauth...
agpl-3.0
adrianpaesani/odoo-argentina
l10n_ar_invoice_sale/sale.py
2
8163
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import models, api, fields import ope...
agpl-3.0
damiansoriano/odoo
addons/report_webkit/__openerp__.py
26
4030
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # All Right Reserved # # Author : Nicolas Bessi (Camptocamp) # # WARNING: This program as such is intended to be used by professional # programmers who ...
agpl-3.0
robjtede/toKillAMotherboard
python/parse.py
1
1466
import sys def parse(fn): sim = {} with open(fn, "r") as input: data = input.read().split("\n")[:-1] # params sim['rowsInArea'] = int(data[0].split(" ")[0]) sim['columnsInArea'] = int(data[0].split(" ")[1]) sim['numDrones'] = int(data[0].split(" ")[2]) sim['deadline'] = int(data[0]...
gpl-3.0
KamalAwasthi/FullContact
myvenv/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/sbcsgroupprober.py
2936
3291
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
apache-2.0
botswana-harvard/edc-middleman
edc_middleman/admin.py/middleman_transaction_admin.py
1
1163
from django.contrib import admin from ..actions import ( reset_outgoing_transaction_middle_as_consumed, reset_outgoing_transaction_middle_as_not_consumed, reset_outgoing_transaction_server_as_consumed, reset_outgoing_transaction_server_as_not_consumed) from ..models import MiddleManTransaction class ...
gpl-2.0
palmtree5/Red-DiscordBot
redbot/core/commands/help.py
3
33806
# Warning: The implementation below touches several private attributes. # While this implementation will be updated, and public interfaces maintained, # derived classes should not assume these private attributes are version safe, # and use the provided HelpSettings class for these settings. # This is a full replacemen...
gpl-3.0
priyawadhwa/runtimes-common
appengine/runtime_builders/template_builder.py
2
5588
#!/usr/bin/python # Copyright 2017 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 app...
apache-2.0
normanmaurer/autobahntestsuite-maven-plugin
src/main/resources/twisted/names/dns.py
5
58463
# -*- test-case-name: twisted.names.test.test_dns -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ DNS protocol implementation. Future Plans: - Get rid of some toplevels, maybe. """ from __future__ import division, absolute_import __all__ = [ 'IEncodable', 'IRecord', 'A',...
apache-2.0
hainm/numpy
numpy/lib/format.py
75
28243
""" Define a simple format for saving numpy arrays to disk with the full information about them. The ``.npy`` format is the standard binary file format in NumPy for persisting a *single* arbitrary NumPy array on disk. The format stores all of the shape and dtype information necessary to reconstruct the array correctly...
bsd-3-clause
imageboards/Orphereus
Orphereus/oldmodel/meta.py
2
1878
################################################################################ # Copyright (C) 2009 Johan Liebert, Mantycore, Hedger, Rusanon # # < anoma.team@gmail.com ; http://orphereus.anoma.ch > # # ...
gpl-2.0
holmes/intellij-community
python/lib/Lib/_MozillaCookieJar.py
152
5821
"""Mozilla / Netscape cookie loading / saving.""" import re, time from cookielib import (_warn_unhandled_exception, FileCookieJar, LoadError, Cookie, MISSING_FILENAME_TEXT) class MozillaCookieJar(FileCookieJar): """ WARNING: you may want to backup your browser's cookies file if you us...
apache-2.0
joelagnel/trappy
tests/test_results.py
3
4949
# Copyright 2015-2017 ARM Limited # # 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
nirmeshk/oh-mainline
vendor/packages/celery/celery/tests/test_worker/test_worker_autoscale.py
18
4212
from __future__ import absolute_import import logging from time import time from mock import Mock, patch from celery.concurrency.base import BasePool from celery.worker import state from celery.worker import autoscale from celery.tests.utils import unittest, sleepdeprived logger = logging.getLogger("celery.tests.a...
agpl-3.0
chrsrds/scikit-learn
sklearn/ensemble/tests/test_weight_boosting.py
1
18861
"""Testing for the boost module (sklearn.ensemble.boost).""" import numpy as np import pytest from sklearn.utils.testing import assert_array_equal, assert_array_less from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_raises, assert_raises_regexp from sklearn.base imp...
bsd-3-clause
tzewangdorje/SIPserv
Twisted-13.1.0/twisted/web/_auth/basic.py
66
1635
# -*- test-case-name: twisted.web.test.test_httpauth -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ HTTP BASIC authentication. @see: U{http://tools.ietf.org/html/rfc1945} @see: U{http://tools.ietf.org/html/rfc2616} @see: U{http://tools.ietf.org/html/rfc2617} """ import binascii from...
gpl-3.0
Javiercerna/MissionPlanner
Lib/encodings/palmos.py
96
3019
""" Python Character Mapping Codec for PalmOS 3.5. Written by Sjoerd Mullender (sjoerd@acm.org); based on iso8859_15.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def d...
gpl-3.0
leighpauls/k2cro4
base/android/jni_generator/jni_generator.py
1
36377
#!/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. """Extracts native methods from a Java file and generates the JNI bindings. If you change this, please run and update the tests."""...
bsd-3-clause
undoware/neutron-drive
neutron-drive/oauth2client/crypt.py
45
6564
#!/usr/bin/python2.4 # -*- coding: utf-8 -*- # # Copyright (C) 2011 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 ...
bsd-3-clause
UrbanRiskSlumRedevelopment/Maya
node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py
327
132617
# 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 ntpath import os import posixpath import re import subprocess import sys import gyp.common import gyp.easy_xml as easy_xml import gyp.generator...
mit
luoshao23/ML_algorithm
Deep_Learning/CNN/cnn_text_classification/cnn_text_model.py
1
3086
import numpy as np import tensorflow as tf class TextCNN(object): def __init__(self, sequence_len, num_classes, vocab_size, embedding_size, filter_sizes, num_filters, l2_reg_lambda=0.0): self.input_x = tf.placeholder( tf.int32, [None, sequence_len], name='input_x') self.input_y = tf.p...
mit
gnachman/iTerm2
tools/ply/ply-3.4/test/testyacc.py
62
14872
# testyacc.py import unittest try: import StringIO except ImportError: import io as StringIO import sys import os import warnings sys.path.insert(0,"..") sys.tracebacklimit = 0 import ply.yacc import imp def make_pymodule_path(filename): path = os.path.dirname(filename) file = os.path.basename(file...
gpl-2.0
kvar/ansible
lib/ansible/modules/network/fortios/fortios_log_fortianalyzer_filter.py
14
14223
#!/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
SublimeText/ColdFusion
cflib.py
2
1612
import sublime, sublime_plugin, json from urllib import urlopen CFLIBCATS = r"http://www.cflib.org/api/api.cfc?method=getlibraries&returnformat=json" CFLIBUDFS = r"http://www.cflib.org/api/api.cfc?method=getudfs&returnformat=json&libraryid=" CFLIBUDF = r"http://www.cflib.org/api/api.cfc?method=getudf&returnFormat=json...
mit