text
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
231
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
score
float64
0
0.34
# -*- mode: python; coding: utf-8; -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals class KeyValueSerializer(object): def __init__(self, event, inline=()): self.event = event self.inline = inli...
oxyum/python-tlogger
tlogger/serializers.py
Python
mit
668
0
import shopify from test.test_helper import TestCase class EventTest(TestCase): def test_prefix_uses_resource(self): prefix = shopify.Event._prefix(options={"resource": "orders", "resource_id": 42}) self.assertEqual("https://this-is-my-test-show.myshopify.com/admin/api/unstable/orders/42", prefix)...
Shopify/shopify_python_api
test/event_test.py
Python
mit
509
0.005894
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.chat.TTSCWhiteListTerminal from otp.speedchat.SCTerminal import SCTerminal from otp.otpbase.OTPLocalizer import SpeedChatStaticText SCStaticTextMsgEvent = 'SCStaticTextMsg' class TTSCWhiteListTerminal(SCTerminal): def __init__(self, textId...
DedMemez/ODS-August-2017
chat/TTSCWhiteListTerminal.py
Python
apache-2.0
874
0.006865
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_dressed_rebel_brigadier_general_sullustan_male.iff" result.att...
anhstudios/swganh
data/scripts/templates/object/mobile/shared_dressed_rebel_brigadier_general_sullustan_male.py
Python
mit
475
0.046316
""" 9012 : 괄호 URL : https://www.acmicpc.net/problem/9012 Input : 6 (())()) (((()())() (()())((())) ((()()(()))(((())))() ()()()()(()()())() (()((())()( Output : NO NO YES NO YES NO """ N = int(input(...
0x1306e6d/Baekjoon
baekjoon/9012.py
Python
gpl-2.0
694
0
import configparser parser = configparser.SafeConfigParser() parser.add_section('bug_tracker') parser.set('bug_tracker', 'url', 'http://localhost:8080/bugs') parser.set('bug_tracker', 'username', 'dhellmann') parser.set('bug_tracker', 'password', 'secret') for section in parser.sections(): print(section) for...
jasonwee/asus-rt-n14uhp-mrtg
src/lesson_application_building_blocks/configparser_populate.py
Python
apache-2.0
408
0
import unittest from .. import views class TestViews(unittest.TestCase): def setUp(self): pass def test_nothing(self): views
meltmedia/bouncer
bouncer/tests/test_views.py
Python
mit
153
0
# -*- coding: utf-8 -*- from __future__ import unicode_literals import sys from intelmq.lib import utils from intelmq.lib.bot import Bot from intelmq.lib.message import Event class MalwareGroupIPsParserBot(Bot): def process(self): report = self.receive_message() if not report: self....
sch3m4/intelmq
intelmq/bots/parsers/malwaregroup/parser_ips.py
Python
agpl-3.0
1,460
0.000685
# -*- 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...
hivam/l10n_co_doctor
report/doctor_disability_half.py
Python
agpl-3.0
3,267
0.027565
#!/usr/bin/env python from __future__ import print_function import os import json import configparser import codecs import sys from contextlib import contextmanager from datetime import datetime from sqlalchemy import and_, create_engine, Column, Integer, String, DateTime, func from sqlalchemy.ext.declarati...
awest1339/multiscanner
storage/sql_driver.py
Python
mpl-2.0
11,174
0.002148
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/isis_neighbor_attribute/neighbors/__init__.py
Python
apache-2.0
14,460
0.001037
""" Support for RESTful binary sensors. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/binary_sensor.rest/ """ import logging from homeassistant.components.binary_sensor import BinarySensorDevice from homeassistant.components.sensor.rest import RestData...
aoakeson/home-assistant
homeassistant/components/binary_sensor/rest.py
Python
mit
2,159
0
# Copyright 2013 Allen Institute # This file is part of dipde # dipde 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. # # dipde is dis...
nicain/dipde_dev
setup.py
Python
gpl-3.0
2,931
0.005459
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googleapis/python-compute
google/cloud/compute_v1/services/region_notification_endpoints/pagers.py
Python
apache-2.0
3,203
0.000937
__author__ = 'Per'
Per-Starke/Visualizer
src/__init__.py
Python
apache-2.0
19
0
#!/usr/bin/env python import TransferErrors as TE import cPickle as pickle with open('stuck.pkl','rb') as pklfile: stuck = pickle.load(pklfile) TE.makeBasicTable(stuck,TE.workdir+'html/table.html',TE.webdir+'table.html') TE.makeCSV(stuck,TE.webdir+'data.csv') for basis in [-6,-5,-4,-3,-1,1,2]: TE.makeJson(stuck...
sidnarayanan/TransferErrors
bin/write.py
Python
mit
382
0.044503
""" Certificate generation module. """ from OpenSSL import crypto TYPE_RSA = crypto.TYPE_RSA TYPE_DSA = crypto.TYPE_DSA def createKeyPair(type, bits): """ Create a public/private key pair. Arguments: type - Key type, must be one of TYPE_RSA and TYPE_DSA bits - Number of bits to use in the...
dhain/greennet
examples/certs/certgen.py
Python
mit
2,547
0.002356
from threading import Thread import pickle import time from pymouse import PyMouse # from evdev import InputDevice, ecodes, UInput from evdev import UInput, ecodes class History(Thread): def __init__(self): Thread.__init__(self) self.n = 0 self.st = True # Stop self.sl = False...
andredalton/bcc
2014/MAC0242/miniep6/history.py
Python
apache-2.0
2,750
0.005091
# -*- coding: utf-8 -*- # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from . import test_account_payment_transfer_reconcile_batch
acsone/bank-payment
account_payment_transfer_reconcile_batch/tests/__init__.py
Python
agpl-3.0
150
0
class PlotEnum(): point = 'POINT', line = 'LINE', bar = 'BAR'
Castronova/EMIT
gui/controller/enums.py
Python
gpl-2.0
73
0.013699
# Copyright (c) 2008 testtools developers. See LICENSE for details. """Test results and related things.""" __metaclass__ = type __all__ = [ 'ExtendedToOriginalDecorator', 'MultiTestResult', 'TestResult', 'ThreadsafeForwardingResult', ] import datetime import sys import unittest from testtools.co...
lauria/Samba4
lib/testtools/testtools/testresult/real.py
Python
gpl-3.0
23,481
0.000596
from django.conf.urls import patterns, url from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns from .provider import FacebookProvider from . import views urlpatterns = default_urlpatterns(FacebookProvider) urlpatterns += patterns('', url('^facebook/login/token/$', views.login_by_token, ...
tejesh95/Zubio.in
zubio/allauth/socialaccount/providers/facebook/urls.py
Python
mit
435
0.004598
import re from decimal import Decimal import sys import struct from rdbtools.parser import RdbCallback, RdbParser ESCAPE = re.compile(ur'[\x00-\x1f\\"\b\f\n\r\t\u2028\u2029]') ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])') HAS_UTF8 = re.compile(r'[\x80-\xff]') ESCAPE_DCT = { '\\': '\\\\', '"': '\\"', '\b': ...
idning/redis-rdb-tools
rdbtools/callbacks.py
Python
mit
7,595
0.007637
# # Copyright (C) 2012-2014 Red Hat, Inc. # # Licensed under the GNU Lesser General Public License Version 2.1 # # This library 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 th...
yavor-atanasov/hawkey
tests/python/tests/test_query.py
Python
lgpl-2.1
11,221
0.000446
# 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...
nikste/tensorflow
tensorflow/contrib/framework/python/ops/variables.py
Python
apache-2.0
27,377
0.005698
import numpy as np class LinfinityRegression: def __init__(self, iterations, learning_rate, regularization_strength): self.iterations = iterations self.learning_rate = learning_rate self.regularization_strength = regularization_strength @staticmethod def soft_thresholding_operator...
aosingh/Regularization
LinfinityRegularization/LinfinityRegularizer.py
Python
mit
2,373
0.006321
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/loot/loot_schematic/shared_park_bench_schematic.iff" result.attribu...
anhstudios/swganh
data/scripts/templates/object/tangible/loot/loot_schematic/shared_park_bench_schematic.py
Python
mit
479
0.045929
# 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 ctypes import sizeof, windll, addressof, create_unicode_buffer from ctypes.wintypes import DWORD, HANDLE PROCESS_T...
vladikoff/fxa-mochitest
tests/venv/lib/python2.7/site-packages/mozprocess/wpk.py
Python
mpl-2.0
2,115
0.000946
#!/usr/bin/env python # -*- coding: utf-8 -*- # # elementaryplus-installer.py elementary+ Installer/Configurator # # Copyright (C) 2015 Stefan Ric (cybre) # # 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 ...
mank319/elementaryPlus
scripts/elementaryplus-installer.py
Python
gpl-3.0
19,933
0.002057
# coding=utf-8 from ._commandbase import RadianceCommand from ..datatype import RadiancePath import os class Epw2wea(RadianceCommand): """epw2wea transforms an EnergyPlus weather data (.epw) file into the DAYSIM weather file format, for use with the RADIANCE gendaymtx program. Attributes: ep...
ladybug-analysis-tools/honeybee
honeybee_plus/radiance/command/epw2wea.py
Python
gpl-3.0
2,274
0
from Timeline.Server.Constants import TIMELINE_LOGGER from twisted.internet.defer import Deferred, inlineCallbacks, returnValue from twistar.dbobject import DBObject from twistar.registry import Registry from collections import deque import logging, time, json class Penguin(DBObject): HASONE = ['avatar', 'curren...
Times-0/Timeline
Timeline/Database/DB.py
Python
gpl-3.0
8,784
0.008311
from abc import ABCMeta, abstractmethod import json import os try: import redis except ImportError: pass from .config import Config def get_cache(cache, config=None): if isinstance(cache, str): if cache == 'JsonCache': return JsonCache() elif cache == 'RedisCache': ...
Grungnie/microsoftbotframework
microsoftbotframework/cache.py
Python
mit
3,321
0.000602
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2017-02-17 10:06 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('basicviz', '0049_auto_20170216_2228'), ...
sdrogers/ms2ldaviz
ms2ldaviz/decomposition/migrations/0001_initial.py
Python
mit
4,500
0.004222
# -*- coding: utf-8 -*- import django from django.contrib.auth.models import User from django.test import TestCase, Client # compat thing! if django.VERSION[:2] < (1, 10): from django.core.urlresolvers import reverse else: from django.urls import reverse class FilerUtilsTests(TestCase): def setUp(self): ...
rouxcode/django-filer-addons
filer_addons/tests/test_utils.py
Python
mit
793
0
# -*- coding: utf-8 -*- # -------------------------------------------------------------------- # The MIT License (MIT) # # Copyright (c) 2016 Jonathan Labéjof <jonathan.labejof@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation fi...
b3j0f/schema
b3j0f/schema/base.py
Python
mit
9,410
0.000106
import os from ..helper import freq_to_mel from ..praat import PraatAnalysisFunction class PraatMfccFunction(PraatAnalysisFunction): def __init__(self, praat_path=None, window_length=0.025, time_step=0.01, max_frequency=7800, num_coefficients=13): script_dir = os.path.dirname(os.path.ab...
mmcauliffe/python-acoustic-similarity
conch/analysis/mfcc/praat.py
Python
mit
586
0.005119
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
AutorestCI/azure-sdk-for-python
azure-mgmt-datalake-store/azure/mgmt/datalake/store/models/operation_list_result.py
Python
mit
1,314
0
# -*- coding: 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): # Adding model 'RssFeed' db.create_table(u'rsssync_rssfeed', ( (u'id', self.gf('django.db.models...
ebrelsford/django-rsssync
rsssync/migrations/0001_initial.py
Python
bsd-3-clause
2,776
0.008285
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import io import re from os.path import join, dirname from setuptools import setup, find_packages RE_MD_CODE_BLOCK = re.compile(r'```(?P<language>\w+)?\n(?P<lines>.*?)```', re.S) RE_SELF_LINK = re.compile(r'\[(.*?)\]\[\]') RE_LINK_...
opendatateam/docker-udata
samples/theme/my-theme/setup.py
Python
mit
3,719
0.002151
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import unittest from openerp.tools.translate import quote, unquote, xml_translate class TranslationToolsTestCase(unittest.TestCase): def test_quote_unquote(self): def test_string(str): quoted =...
minhphung171093/GreenERP
openerp/addons/base/tests/test_translate.py
Python
gpl-3.0
6,065
0.003462
# (c) 2013-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2015 Toshio Kuratomi <tkuratomi@ansible.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...
attakei/ansible
lib/ansible/executor/module_common.py
Python
gpl-3.0
8,252
0.003393
#!/usr/bin/python # LICENSE: GPL2 # (c) 2013 Tom Schouten <tom@getbeep.com> # (c) 2014, Kamil Wartanowicz <k.wartanowicz@gmail.com> import logging import os import threading import time import usb import plac import sim_shell import sim_ctrl_2g import sim_ctrl_3g import sim_reader import sim_card from util import t...
kamwar/simLAB
sim/sim_router.py
Python
gpl-2.0
28,870
0.004434
# 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...
AndreasMadsen/tensorflow
tensorflow/python/layers/core.py
Python
apache-2.0
12,263
0.002609
#!/usr/bin/env python # -*- coding: utf-8 -*- # Part of the PsychoPy library # Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2022 Open Science Tools Ltd. # Distributed under the terms of the GNU General Public License (GPL). """Idea: Run or debug an experiment script using exactly the same code, i.e., for both tes...
psychopy/psychopy
psychopy/hardware/emulator.py
Python
gpl-3.0
12,656
0.000237
# This file is part of Headphones. # # Headphones 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. # # Headphones is distributed i...
maxkoryukov/headphones
headphones/versioncheck.py
Python
gpl-3.0
9,322
0.002145
# Copyright 2014 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
yuewko/neutron
neutron/db/migration/alembic_migrations/versions/19180cf98af6_nsx_gw_devices.py
Python
apache-2.0
3,023
0.000992
# 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...
benoitsteiner/tensorflow-opencl
tensorflow/contrib/eager/python/datasets.py
Python
apache-2.0
3,562
0.006176
#################################### # Sample Receiver Script # [Usage] # python receiver.py # python receiver.py > data.csv # [Data Format] # id,time,x,y,z # [Exaple] # 1,118.533,-0.398,-0.199,-0.978 #################################### import sys import os import math import time import SocketServer ...
shivekkhurana/learning
python/scripts/user_input/receiver.py
Python
mit
590
0.018644
''' Servants is of primary interest to Python component developers. The module names should sufficiently described their intended uses. ''' __revision__ = "$Id: __init__.py,v 1.4 2005/02/25 23:42:32 dfugate Exp $"
ACS-Community/ACS
LGPL/CommonSoftware/acspy/src/Acspy/Servants/__init__.py
Python
lgpl-2.1
214
0
#!/usr/bin/env python strings=['hey','guys','i','am','a','string'] parameter_list=[[strings]] def features_string_char (strings): from shogun import StringCharFeatures, RAWBYTE from numpy import array #create string features f=StringCharFeatures(strings, RAWBYTE) #and output several stats #print("max string l...
lambday/shogun
examples/undocumented/python/features_string_char.py
Python
bsd-3-clause
792
0.050505
# Copyright (C) 2006, Thomas Hamelryck (thamelry@binf.ku.dk) # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Wrappers for PSEA, a program for secondary structure assignment. See this citation for...
BlogomaticProject/Blogomatic
opt/blog-o-matic/usr/lib/python/Bio/PDB/PSEA.py
Python
gpl-2.0
2,747
0.014197
# This file is part of Indico. # Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
eliasdesousa/indico
indico/modules/networks/fields.py
Python
gpl-3.0
2,522
0.001586
import argparse import hashlib import json import csv import os MAESTRO_INDEX_PATH = '../mirdata/indexes/maestro_index.json' def md5(file_path): """Get md5 hash of a file. Parameters ---------- file_path: str File path. Returns ------- md5_hash: str md5 hash of data in ...
mir-dataset-loaders/mirdata
scripts/legacy/make_maestro_index.py
Python
bsd-3-clause
1,799
0.001112
import simplejson as json import xmltodict import requests import os import re import sys import base64 from urlparse import urlparse from os.path import splitext, basename from BeautifulSoup import BeautifulSoup nb_token = os.environ.get('NB_TOKEN') site_slug = os.environ.get('SITE_SLUG') api_url = "https://" + site_...
thmcmahon/wp2nb
wp2nb.py
Python
mit
6,200
0.000645
################################################################################ ### Copyright © 2012-2013 BlackDragonHunt ### ### This file is part of the Super Duper Script Editor. ### ### The Super Duper Script Editor is free software: you can redistribute it ### and/or modify it under the terms of the GNU Genera...
ThunderGemios10/The-Super-Duper-Script-Editor
script_analytics.py
Python
gpl-3.0
11,293
0.027477
""" Django settings for {{ project_name }} project. """ import os import re MAIN_APPLICATION_PATH = os.path.dirname( os.path.dirname(os.path.abspath(__file__)) ) # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(MAIN_APPLICATION_PATH) # Quick-start development s...
wolfstein9119/django-skel
project_name/settings/common.py
Python
bsd-2-clause
3,448
0.00116
def powers_of_two(limit): value = 1 while value < limit: yield value value += value # Use the generator for i in powers_of_two(70): print(i) # Explore the mechanism g = powers_of_two(100) assert str(type(powers_of_two)) == "<class 'function'>" assert str(type(g)) == "<class 'generator'>" a...
rtoal/ple
python/powers_of_two.py
Python
mit
409
0.002445
""" Oracle database backend for Django. Requires cx_Oracle: http://cx-oracle.sourceforge.net/ """ from __future__ import unicode_literals import decimal import re import sys import warnings def _setup_environment(environ): import platform # Cygwin requires some special voodoo to set the environment variables...
atruberg/django-custom
django/db/backends/oracle/base.py
Python
bsd-3-clause
39,830
0.001456
""" Import prescribing data from CSV files into SQLite """ from collections import namedtuple import csv from itertools import groupby import logging import os import sqlite3 import gzip import heapq from matrixstore.matrix_ops import sparse_matrix, finalise_matrix from matrixstore.serializer import serialize_compress...
ebmdatalab/openprescribing
openprescribing/matrixstore/build/import_prescribing.py
Python
mit
7,057
0.00085
#!/usr/bin/env python # -*- coding: utf-8 -*- from contextable import Contextable class Terms(Contextable): """ An address in the invoice """ def __init__(self, days, string): self.days = days self.string = string def context(self): return { 'terms': { '...
lambdal/envois
envois/terms.py
Python
mit
396
0.005051
from django.db import models from django.db.models import Q class FriendshipManager(models.Manager): """ Provides an interface to friends """ def friends_for_user(self, user): """ Returns friends for specific user """ friends = [] qs = self.filter(Q(from_user=...
chrisfranklin/dinnertime
friends/managers.py
Python
gpl-3.0
2,411
0.001659
# Copyright 2012 Dan Smith <dsmith@danplanet.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 # (at your option) any later version. # # This program is ...
mach327/chirp_fork
chirp/drivers/thuv1f.py
Python
gpl-3.0
14,900
0
from django.test import TestCase from django.core.exceptions import FieldError from models import User, Poll, Choice class ReverseLookupTests(TestCase): def setUp(self): john = User.objects.create(name="John Doe") jim = User.objects.create(name="Jim Bo") first_poll = Poll.objects.create( ...
mzdaniel/oh-mainline
vendor/packages/Django/tests/modeltests/reverse_lookup/tests.py
Python
agpl-3.0
1,645
0.001216
#!/usr/bin/env python # update-dependencies-bad.py - Fails on bad.swift -*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LI...
gottesmm/swift
test/Driver/Dependencies/Inputs/update-dependencies-bad.py
Python
apache-2.0
1,560
0
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('myhpom', '0012_auto_20180718_1140'), ] operations = [ migrations.AlterModelOptions( name='staterequirement', ...
ResearchSoftwareInstitute/MyHPOM
myhpom/migrations/0013_auto_20180720_0942.py
Python
bsd-3-clause
643
0
############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # 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 with...
sampathweb/game-server
pybot_game_autobahn.py
Python
mit
5,481
0.000182
# Copyright (c) 2001, Stanford University # All rights reserved. # # See the file LICENSE.txt for information on redistributing this software. # This script generates the packer.c file from the gl_header.parsed file. import sys, string, re import apiutil def WriteData( offset, arg_type, arg_name, is_swapped ): ...
dezelin/vbox-haiku
src/VBox/GuestHost/OpenGL/packer/packer.py
Python
gpl-2.0
8,980
0.010245
# -*- 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...
diogocs1/comps
web/addons/mrp_byproduct/__init__.py
Python
apache-2.0
1,074
0.001862
"""Python interface to GenoLogics LIMS via its REST API. LIMS interface. Per Kraulis, Science for Life Laboratory, Stockholm, Sweden. Copyright (C) 2012 Per Kraulis """ __all__ = ['Lab', 'Researcher', 'Project', 'Sample', 'Containertype', 'Container', 'Processtype', 'Process', 'Artifact', 'Lims...
SciLifeLab/genologics
genologics/lims.py
Python
mit
29,765
0.001478
# -*- coding: utf-8 -*- import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FileStoreTo(SimpleHoster): __name__ = "FileStoreTo" __type__ = "hoster" __version__ = "0.07" __status__ = "testing" __pattern__ = r'http://(?:www\.)?filestore\.to/\?d=(?P...
fzimmermann89/pyload
module/plugins/hoster/FileStoreTo.py
Python
gpl-3.0
1,290
0.013953
############################################################################### # Name: fileutil.py # # Purpose: File Management Utilities. # # Author: Cody Precord <cprecord@editra.org> # ...
iut-ibk/P8-WSC-GUI
3dparty/Editra/src/ebmlib/fileutil.py
Python
gpl-2.0
12,224
0.003027
# -*- coding: utf-8 -*- """ Created on 11 Apr 2014 @author: Kimon Tsitsikas Copyright © 2013-2016 Kimon Tsitsikas and Éric Piel, Delmic This file is part of Odemis. Odemis is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free...
ktsitsikas/odemis
src/odemis/acq/align/autofocus.py
Python
gpl-2.0
23,236
0.001679
# -*- 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...
jeffery9/mixprint_addons
project_long_term/wizard/project_compute_phases.py
Python
agpl-3.0
3,262
0.003372
#!/usr/bin/env python3 # Copyright (c) 2014-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Helpful routines for regression testing.""" from base64 import b64encode from binascii import hexlify,...
cevap/ion
test/functional/test_framework/util.py
Python
mit
22,607
0.004336
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without...
harshilasu/GraphicMelon
y/google-cloud-sdk/platform/gsutil/third_party/boto/boto/beanstalk/layer1.py
Python
gpl-3.0
56,243
0.000338
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.base.exchange import Exchange # ----------------------------------------------------------------------------- try: basestri...
ccxt/ccxt
python/ccxt/coinbasepro.py
Python
mit
53,861
0.00104
from django.template import Library from django.utils.functional import Promise import json register = Library() @register.filter def json_dumps(json_object): if isinstance(json_object, Promise): json_object = dict(json_object) return json.dumps(json_object) @register.filter def json_dumps_pretty(js...
DylanMcCall/stuartmccall.ca
common/templatetags/json_tools.py
Python
mit
482
0.004149
# Copyright (c) 2014, The Boovix authors that are listed # in the AUTHORS file. All rights reserved. Use of this # source code is governed by the BSD 3-clause license that # can be found in the LICENSE file. """ Function annotations in Python 3: http://legacy.python.org/dev/peps/pep-3107/ Type checking in Python 3: *...
cztomczak/boovix
boovix1/utils/static_types.py
Python
bsd-3-clause
868
0
# -*- coding: utf-8 -*- REPO_BACKENDS = {} REPO_TYPES = [] class RepositoryTypeNotAvailable(Exception): pass try: from brigitte.backends import libgit REPO_BACKENDS['git'] = libgit.Repo REPO_TYPES.append(('git', 'GIT')) except ImportError: from brigitte.backends import git REPO_BACKENDS['git...
stephrdev/brigitte
brigitte/backends/__init__.py
Python
bsd-3-clause
680
0.001471
# -*- coding: utf-8 -*- # # documentation build configuration file, created by # sphinx-quickstart on Sat Sep 27 13:23:22 2008-2009. # # This file is execfile()d with the current directory set to its # containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleab...
dmsimard/ansible
docs/docsite/sphinx_conf/2.10_conf.py
Python
gpl-3.0
10,553
0.001516
""" WSGI config for twitter-tools project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO...
jparicka/twitter-tools
twitter-tools/wsgi.py
Python
mit
403
0
# Copyright 2008-2013 Nokia Siemens Networks Oyj # # 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...
ktan2020/legacy-automation
win/Lib/site-packages/robot/result/xmlelementhandlers.py
Python
mit
6,002
0.000167
#!/usr/bin/env python # ~*~ encoding: utf-8 ~*~ """ This file is part of SOCSIM. SOCSIM 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...
peterrenshaw/socsim
socsim/misc/extract.py
Python
gpl-3.0
2,087
0.004792
#!/usr/bin/python # Copyright (C) 2014 Alex Nitz, Andrew Miller, Tito Dal Canton # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any late...
tjma12/pycbc
pycbc/psd/__init__.py
Python
gpl-3.0
26,178
0.00275
try: from account.decorators import login_required except ImportError: from django.contrib.auth.decorators import login_required # noqa try: from account.mixins import LoginRequiredMixin except ImportError: from django.contrib.auth.mixins import LoginRequiredMixin # noqa
pinax/pinax-forums
pinax/forums/compat.py
Python
mit
292
0
#! /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. import itertools import json import os.path import re import sys from json_parse import OrderedDict # This file is a peer to jso...
patrickm/chromium.src
tools/json_schema_compiler/idl_schema.py
Python
bsd-3-clause
16,913
0.008159
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import import unittest from pykit.parsing import cirparser from pykit.ir import verify, interp source = """ #include <pykit_ir.h> Int32 myglobal = 10; float simple(float x) { return x * x; } Int32 loop() { Int32 i, sum = 0; ...
flypy/pykit
pykit/ir/tests/test_interp.py
Python
bsd-3-clause
1,210
0.001653
""" Trabalho T2 da disciplina Teoria dos Grafos, ministrada em 2014/02 'All Hail Gabe Newell' Alunos: Daniel Nobusada 344443 Thales Eduardo Adair Menato 407976 Jorge Augusto Bernardo 407844 """ import networkx as nx import numpy as...
UFSCar-CS-011/graph-theory-2012-2
tasks/task2/t2-random-walks.py
Python
mit
6,342
0.001577
# Copyright 2014 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...
changsimon/trove
trove/tests/int_tests.py
Python
apache-2.0
3,057
0
# 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. from __future__ import print_function import sys import os from gpu_tests import gpu_integration_test test_harness_script = r""" function VerifyHardware...
scheib/chromium
content/test/gpu/gpu_tests/hardware_accelerated_feature_integration_test.py
Python
bsd-3-clause
2,830
0.007067
from django.db import models class AssetField(models.ForeignKey): description = 'A file asset' def __init__(self, **kwargs): kwargs.setdefault('blank', True) kwargs.setdefault('null', True) kwargs.setdefault('default', None) # Normally, Django creates a backwards relationship...
AlmostBetterNetwork/podmaster-host
assets/fields.py
Python
apache-2.0
1,224
0.000817
import htmlPy import os import json from naoqi import ALProxy from pptx import Presentation import time import math #linked class with front end class PepperApp(htmlPy.Object): #GUI callable functions need to be in a class, inherited from htmlPy.Object and binded to the GUI def __init__(self, app): super(PepperApp...
wladiarce/PepperPresenter
Presenter app (computer side)/back_end/BackEnd.py
Python
mit
11,402
0.029205
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright 2002-2018, Neo4j # # 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 req...
technige/cypy
test/test_encoding.py
Python
apache-2.0
8,939
0.000224
# This is a sample configuration file for an ISAPI filter and extension # written in Python. # # Please see README.txt in this directory, and specifically the # information about the "loader" DLL - installing this sample will create # "_redirector_with_filter.dll" in the current directory. The readme explains # this. ...
sserrot/champion_relationships
venv/Lib/site-packages/isapi/samples/redirector_with_filter.py
Python
mit
6,630
0.006184
############################################################################## # # Copyright (C) 2018 Compassion CH (http://www.compassion.ch) # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __manifest__.py # #########################################################################...
CompassionCH/compassion-switzerland
muskathlon/forms/order_material_form.py
Python
agpl-3.0
6,229
0.002087
################################################################################# # # Copyright (c) 2013 Genome Research Ltd. # # Author: Irina Colgiu <ic4@sanger.ac.uk> # # 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 ...
wtsi-hgi/serapis
serapis/controller/logic/serapis_models.py
Python
agpl-3.0
13,059
0.008423
''' TODO (29.05.2012): 1) show 1x, 2x, 3x threshold (as line) 2) auto scale in y axis? (calc and save min & max values of buffer) 3) draw y axis? 4) 'max_nbr_buffers_transmitted' must be 1 and 'framesize' must be 512 otherwise we get in trouble in RT mode. 5) set 'SHIFT_VIEW' in update() and dequeue in 'do_draw'?...
StimOMatic/StimOMatic
python/OpenGLPlotting/pomp/apps/deprecated/01.06.2012/pCtrlLFP_old.py
Python
bsd-2-clause
41,129
0.011598
# -*- coding: utf-8 -*- import urllib from oauth2 import Consumer from webob import Request, Response from wsgioauth import calls from wsgioauth.provider import Application, Storage from wsgioauth.utils import CALLS from wsgioauth.provider import Storage, Token ROUTES = { u'getConsumers': calls.getCons...
karacos/karacos-wsgi
lib/wsgioauth/mock.py
Python
lgpl-3.0
2,042
0.003918
import uuid import xbmc import xbmcaddon settings = {} addon = xbmcaddon.Addon() settings['debug'] = addon.getSetting('debug') == "true" settings['powersave_minutes'] = int(addon.getSetting('powersave_minutes')) settings['version'] = addon.getAddonInfo('version') settings['uuid'] = ...
devshans/script.service.hdmipowersave
resources/lib/settings.py
Python
mit
415
0.009639
syscall_table = {} syscall_table[202]="accept" syscall_table[242]="accept4" syscall_table[1033]="access" syscall_table[89]="acct" syscall_table[217]="add_key" syscall_table[171]="adjtimex" syscall_table[1059]="alarm" syscall_table[1075]="bdflush" syscall_table[200]="bind" syscall_table[214]="brk" syscall_table[90]="cap...
alexpark07/ARMSCGen
shellcodes/arm64/syscall.py
Python
gpl-2.0
9,178
0.032905