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
# -*- coding: utf-8 -*- """ tomorrow night eighties --------------------- Port of the Tomorrow Night Eighties colour scheme https://github.com/chriskempson/tomorrow-theme """ from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, Text, \ Number, Operator, Generic, Whit...
thergames/thergames.github.io
lib/tomorrow-pygments/styles/tomorrownighteighties.py
Python
mit
5,525
0.000362
# -*- coding: utf-8 -*- """Tests for the eventstreams module.""" # # (C) Pywikibot team, 2017 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, unicode_literals from types import FunctionType from tests import mock from pywikibot.comms.eventstreams import EventStreams from...
magul/pywikibot-core
tests/eventstreams_tests.py
Python
mit
8,303
0
# 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, ...
googleads/google-ads-python
google/ads/googleads/interceptors/metadata_interceptor.py
Python
apache-2.0
5,368
0.000186
from .message_media_downloadable import DownloadableMediaMessageProtocolEntity from yowsup.layers.protocol_messages.protocolentities.attributes.attributes_image import ImageAttributes from yowsup.layers.protocol_messages.protocolentities.attributes.attributes_message_meta import MessageMetaAttributes from yowsup.layers...
tgalal/yowsup
yowsup/layers/protocol_media/protocolentities/message_media_downloadable_image.py
Python
gpl-3.0
1,903
0.003153
#!/usr/bin/env python """pin generates SPKI pin hashes from X.509 PEM files.""" __author__ = "Moxie Marlinspike" __email__ = "moxie@thoughtcrime.org" __license__= """ Copyright (c) 2011 Moxie Marlinspike <moxie@thoughtcrime.org> This program is free software; you can redistribute it and/or modify it under the terms ...
softctrl/AndroidPinning
tools/pin-b64.py
Python
gpl-3.0
1,590
0.00566
import contextlib import pytest import logging from distutils.version import LooseVersion from .service import service_available_predicate from ..clients import marathon from ..matcher import assert_that, eventually, has_len logger = logging.getLogger(__name__) marathon_1_3 = pytest.mark.skipif('marathon_version_l...
mesosphere/marathon
tests/shakedown/shakedown/dcos/marathon.py
Python
apache-2.0
4,526
0.001989
from django.contrib import admin from parliament.committees.models import * class CommitteeAdmin(admin.ModelAdmin): list_display = ('short_name', 'slug', 'latest_session', 'display') list_filter = ('sessions', 'display') class CommitteeInSessionAdmin(admin.ModelAdmin): list_display = ('committee', 'acron...
litui/openparliament
parliament/committees/admin.py
Python
agpl-3.0
1,334
0.008246
"""Grabber for collecting data""" import urllib2 from random import sample from veliberator.settings import PROXY_SERVERS class Grabber(object): """Url encapsultation for making request throught HTTP""" page = None data = None def __init__(self, url, proxies=PROXY_SERVERS): """Init the grabb...
Fantomas42/veliberator
veliberator/grabber.py
Python
bsd-3-clause
1,041
0.000961
import os import unittest from lexpy.dawg import DAWG from lexpy.utils import build_dawg_from_file from lexpy.exceptions import InvalidWildCardExpressionError HERE = os.path.dirname(__file__) large_dataset = os.path.join(HERE, 'data/ridyhew_master.txt') small_dataset = os.path.join(HERE, 'data/TWL06.txt') class Te...
aosingh/lexpy
lexpy/tests/test_dawg.py
Python
gpl-3.0
12,133
0.004616
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) _CSP = "font-src " + url1 response.headers.set("Content-Security-Policy", _CSP) response....
kaixinjxq/web-testing-service
wts/tests/csp/csp_font-src_cross-origin_allowed-manual.py
Python
bsd-3-clause
2,615
0.000765
from __future__ import with_statement import logging import types import urllib import sys import weakref import UserList import newrelic.api.application import newrelic.api.object_wrapper import newrelic.api.transaction import newrelic.api.web_transaction import newrelic.api.function_trace import newrelic.api.error_...
galaxy-team/website
newrelic/hooks/framework_twisted.py
Python
agpl-3.0
20,328
0.002312
from setuptools import setup, find_packages readme_file = 'README.rst' setup( name='datafilters', version='0.3.3', packages=find_packages('.'), package_data = {'': [ 'locale/*/LC_MESSAGES/django.po', 'locale/*/LC_MESSAGES/django.mo', ]}, # Metadata author='Nikolay Zakharov...
freevoid/django-datafilters
setup.py
Python
mit
1,032
0.006783
from django import forms from timer.models import Timer, Location class TimerForm(forms.ModelForm): location = forms.ModelChoiceField(Location.objects.none()) class Meta: model = Timer
nikdoof/limetime
app/timer/forms.py
Python
bsd-3-clause
204
0.004902
# -*- Mode:Python; -*- # /* # * Copyright (c) 2010 INRIA # * # * This program 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 Software Foundation; # * # * This program is distributed in the hope that it will b...
nsnam/ns-3-dev-git
src/core/examples/sample-simulator.py
Python
gpl-2.0
2,886
0.011781
""" httpdatehelper ============== :Module: pyfileserver.httpdatehelper :Author: Ho Chun Wei, fuzzybr80(at)gmail.com :Project: PyFileServer, http://pyfilesync.berlios.de/ :Copyright: Lesser GNU Public License, see LICENSE file attached with package HTTP dates helper - an assorted library of helpful date funct...
cwho/pyfileserver
PyFileServer/pyfileserver/httpdatehelper.py
Python
lgpl-2.1
2,135
0.020141
import sys from pathlib import Path from analysis.PluginBase import AnalysisBasePlugin from plugins.mime_blacklists import MIME_BLACKLIST_COMPRESSED try: from ..internal.string_eval import eval_strings except ImportError: sys.path.append(str(Path(__file__).parent.parent / 'internal')) from string_eval imp...
fkie-cad/FACT_core
src/plugins/analysis/string_evaluation/code/string_eval.py
Python
gpl-3.0
1,282
0.0039
"""Command for running unit tests for the module from setup.py""" from distutils.cmd import Command from unittest import TextTestRunner, TestLoader import offtheshelf.tests class TestCommand(Command): """Command for running unit tests for the module from setup.py""" user_options = [] def initialize_op...
dotpy/offtheshelf
offtheshelf/tests/cmd.py
Python
bsd-3-clause
527
0
# -*- coding: utf-8 -*- """ test ~~~~ Flask-CORS is a simple extension to Flask allowing you to support cross origin resource sharing (CORS) using a simple decorator. :copyright: (c) 2014 by Cory Dolphin. :license: MIT, see LICENSE for more details. """ from tests.base_test import FlaskCorsTes...
hoyjustin/ScopusAdapter
CorsTests/test_app_extension.py
Python
mit
9,998
0.0001
#!/usr/bin/python # Copyright (C) 2010, 2012 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 lis...
cs-au-dk/Artemis
WebKit/Tools/Scripts/webkitpy/layout_tests/views/printing_unittest.py
Python
gpl-3.0
21,671
0.001061
"""ThreatConnect TI Email""" # standard library from typing import TYPE_CHECKING # first-party from tcex.api.tc.v2.threat_intelligence.mappings.group.group import Group if TYPE_CHECKING: # first-party from tcex.api.tc.v2.threat_intelligence.threat_intelligence import ThreatIntelligence class Tactic(Group): ...
ThreatConnect-Inc/tcex
tcex/api/tc/v2/threat_intelligence/mappings/group/group_types/tactic.py
Python
apache-2.0
841
0.003567
# -*- coding: utf-8 -*- # Copyright (c) 2016 Aladom SAS & Hosting Dvpt SAS from .base import * # noqa
Aladom/django-mailing
mailing/models/__init__.py
Python
mit
103
0
# Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
KaranToor/MA450
google-cloud-sdk/lib/googlecloudsdk/calliope/__init__.py
Python
apache-2.0
623
0
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django from account.views import ChangePasswordView, SignupView, LoginView from django.conf.urls import include, url from django.contrib import admin from example_thirdparty.forms import SignupFormWithCaptcha urlpatterns = [ url(r'^admin/', in...
hovel/pybbm
test/example_thirdparty/example_thirdparty/urls.py
Python
bsd-2-clause
911
0.001098
import nengo import numpy as np import redis import struct r = redis.StrictRedis('127.0.0.1') model = nengo.Network() with model: def receive_spikes(t): msg = r.get('spikes') v = np.zeros(10) if len(msg) > 0: ii = struct.unpack('%dI' % (len(msg)/4), msg) v[[ii]] =...
tcstewar/testing_notebooks
show_remote_spikes/sink.py
Python
gpl-2.0
399
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # pylint: disable=unused-import # pylint: disable=redefined-builtin # # Pryvate documentation build configuration file, created by # sphinx-quickstart on Sat Feb 21 11:31:08 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note...
Dinoshauer/pryvate
docs/source/conf.py
Python
mit
8,998
0.004779
import re from streamlink.compat import urlparse from streamlink.plugin import Plugin from streamlink.plugin.api import http, validate from streamlink.stream import HLSStream, RTMPStream CHINFO_URL = "http://www.filmon.com/ajax/getChannelInfo" SWF_URL = "http://www.filmon.com/tv/modules/FilmOnTV/files/flashapp/filmon...
ethanhlc/streamlink
src/streamlink/plugins/filmon.py
Python
bsd-2-clause
4,570
0.001751
from feat.common.serialization import base from feat.common import defer from feat.database import client, document, common as dcommon, emu, migration from feat.test import common class Inside(document.VersionedFormatable): type_name = 'dummy' version = 2 document.field("field", None) document.field...
f3at/feat
src/feat/test/test_database_client.py
Python
gpl-2.0
2,476
0.000808
import uuid import ddt import httpretty from django.conf import settings from django.http.response import HttpResponse from django.test import RequestFactory from edx_django_utils.cache import TieredCache from mock import patch from oscar.core.loading import get_class from oscar.test.factories import BasketFactory, ...
eduNEXT/edunext-ecommerce
ecommerce/enterprise/tests/test_utils.py
Python
agpl-3.0
16,925
0.003604
#! /usr/bin/env python """ Extract mean parameter estimates from ROI """ import os import sys import re import os.path as op from textwrap import dedent import argparse from subprocess import call from scipy import stats import scipy as sp import numpy as np import pandas as pd import nibabel as nib import lyman fro...
sgagnon/lyman-tools
roi/extract_copes.py
Python
bsd-2-clause
9,264
0.005289
#!/usr/bin/python # -*- coding: utf-8 -*- # 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 progra...
0vercl0k/rp
src/third_party/beaengine/tests/0f383d.py
Python
mit
4,045
0.001236
"""Beautiful Soup Elixir and Tonic "The Screen-Scraper's Friend" http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup parses a (possibly invalid) XML or HTML document into a tree representation. It provides methods and Pythonic idioms that make it easy to navigate, search, and modify the tree. A well-formed X...
Arthaey/anki
thirdparty/BeautifulSoup.py
Python
agpl-3.0
79,554
0.006247
from cmd3.shell import command from cmd3.console import Console import os import sys class clear: # # CLEAR # def activate_clear(self): """activates the clear command""" pass @command def do_clear(self, arg, arguments): """ Usage: clear ...
cloudmesh/cmd3
cmd3/plugins/clear.py
Python
apache-2.0
1,563
0.003199
# encoding: latin-1 # PyWin32 Internet Explorer Toolbar # # written by Leonard Ritter (paniq@gmx.net) # and Robert Förtsch (info@robert-foertsch.com) """ This sample implements a simple IE Toolbar COM server supporting Windows XP styles and access to the IWebBrowser2 interface. It also demonstrates how to hijack th...
leighpauls/k2cro4
third_party/python_26/Lib/site-packages/win32com/demos/ietoolbar.py
Python
bsd-3-clause
10,756
0.009483
# Copyright (c) 2008-2009 Pedro Matiello <pmatiello@gmail.com> # Salim Fadhley <sal@stodge.org> # # 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...
sebastienhupin/qxrad
qooxdoo/tool/pylib/graph/algorithms/heuristics/__init__.py
Python
lgpl-3.0
1,517
0.000659
import enum class StateEnum(enum.IntEnum): queued = 10 running = 20 identical = 30 different = 40 error = 50 timeout = 60
lamby/trydiffoscope
trydiffoscope/compare/enums.py
Python
agpl-3.0
170
0.041176
from biicode.common.exception import (NotInStoreException, NotFoundException, InvalidNameException, ForbiddenException, AuthenticationException) from biicode.server.authorize import Security from biicode.server.model.user import User from biico...
bowlofstew/bii-server
user/user_service.py
Python
mit
12,755
0.001568
# -*- encoding: utf-8 -*- ############################################################################## # # external_adapter_sale_order # Copyright (c) 2013 Codeback Software S.L. (http://codeback.es) # @author: Miguel García <miguel@codeback.es> # @author: Javier Fuentes <javier@codeback.es> # # Th...
codeback/openerp-cbk_external_adapter
sale_order.py
Python
agpl-3.0
7,807
0.009098
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.fsl.utils import SigLoss def test_SigLoss_inputs(): input_map = dict(args=dict(argstr='%s', ), echo_time=dict(argstr='--te=%f', ), environ=dict(nohash=True, usedefault=True, ...
Leoniela/nipype
nipype/interfaces/fsl/tests/test_auto_SigLoss.py
Python
bsd-3-clause
1,163
0.022356
# Lint as: python3 # Copyright 2020 DeepMind Technologies Limited. 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 # # U...
deepmind/dm_alchemy
dm_alchemy/types/helpers.py
Python
apache-2.0
4,418
0.009959
from numpy import * from numpy.random import randint from scipy import * import matplotlib.pyplot as plt import neuroTools as tech from matplotlib import rcParams, text #--------------------------------------Plotting Options-------------------------------------------- params = {'backend': 'ps', 'axes.labels...
mac389/brainpy
examples/a_2.py
Python
gpl-3.0
2,546
0.021995
# coding=utf-8 from __future__ import unicode_literals from random import randint from .. import Provider as AddressProvider class Provider(AddressProvider): address_formats = ['{{street_address}}, {{city}}, {{postcode}}'] building_number_formats = ['#', '##', '###'] city_formats = ['{{city_prefix}} {{f...
vicky2135/lucious
oscar/lib/python2.7/site-packages/faker/providers/address/uk_UA/__init__.py
Python
bsd-3-clause
5,601
0
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
polyaxon/polyaxon
hypertune/hypertune/search_managers/random_search/manager.py
Python
apache-2.0
2,436
0.000821
#!/usr/bin/env python ''' Copyright (C) 2007 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 distributed in t...
piksels-and-lines-orchestra/inkscape
share/extensions/extrude.py
Python
gpl-2.0
3,989
0.003008
''' django admin pages for courseware model ''' from student.models import UserProfile, UserTestGroup, CourseEnrollmentAllowed from student.models import CourseEnrollment, Registration, PendingNameChange, CourseAccessRole, CourseAccessRoleAdmin, School from ratelimitbackend import admin admin.site.register(UserProfil...
nicky-ji/edx-nicky
common/djangoapps/student/admin.py
Python
agpl-3.0
609
0.003284
#!/usr/bin/env python # Copyright (C) 2016 The ANGLE Project Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
endlessm/chromium-browser
third_party/angle/third_party/vulkan-validation-layers/src/build-gn/generate_vulkan_layers_json.py
Python
bsd-3-clause
4,768
0.001049
# This file is part of django-popularity. # # django-popularity: A generic view- and popularity tracking pluggable for Django. # Copyright (C) 2008-2010 Mathijs de Bruin # # 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 ...
carschar/django-popularity
popularity/models.py
Python
agpl-3.0
22,870
0.002973
# -*- coding: utf-8 -*- ############################################################################### # # UpdateBike # Updates an existing bike action. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file exc...
jordanemedlock/psychtruths
temboo/core/Library/Facebook/Actions/Fitness/Bikes/UpdateBike.py
Python
apache-2.0
4,899
0.005307
# -*- coding: utf-8 -*- # Copyright 2013 Google Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to u...
catapult-project/catapult
third_party/gsutil/gslib/tests/test_parallelism_framework.py
Python
bsd-3-clause
33,777
0.007727
# -*- coding: utf-8 -*- """ This is the Windows backend for keyboard events, and is implemented by invoking the Win32 API through the ctypes module. This is error prone and can introduce very unpythonic failure modes, such as segfaults and low level memory leaks. But it is also dependency-free, very performant well doc...
glitchassassin/keyboard
keyboard/_winkeyboard.py
Python
mit
20,607
0.003009
# Copyright (c) 2020 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 appli...
luotao1/Paddle
python/paddle/distributed/fleet/runtime/the_one_ps.py
Python
apache-2.0
57,329
0.000994
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('presentation', '0009_role_user_userprojectrole'), ] operations = [ migrations.RenameModel( old_name='User', ...
lesglaneurs/lesglaneurs
presentation/migrations/0010_auto_20160505_1432.py
Python
gpl-3.0
636
0
# -*- coding: utf-8 -*- """ flask.testsuite.subclassing ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Test that certain behavior of flask can be customized by subclasses. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest from logging import Str...
zwChan/VATEC
~/eb-virt/Lib/site-packages/flask/testsuite/subclassing.py
Python
apache-2.0
1,214
0
from selenium import webdriver from model.application import Application import pytest @pytest.fixture(scope="module") def app(request): driver = webdriver.Firefox() driver.implicitly_wait(10) request.addfinalizer(driver.quit) return Application(driver)
VolodyaEsk/selenium-python-vkhatianovskyi
php4dvd/selenium_fixture.py
Python
apache-2.0
272
0
# -*- coding: utf-8 -*- # Copyright (c) 2010-2017 Tuukka Turto # # 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,...
tuturto/pyherc
src/pyherc/data/magic/spell.py
Python
mit
3,082
0.000973
from ..broker import Broker class IfPerfHourlyBroker(Broker): controller = "if_perf_hourlies" def index(self, **kwargs): """Lists the available if perf hourlies. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored. Of the various ways to query lists, using this me...
infobloxopen/infoblox-netmri
infoblox_netmri/api/broker/v3_8_0/if_perf_hourly_broker.py
Python
apache-2.0
73,070
0.002012
# Copyright (C) 2021 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php from typing import TYPE_CHECKING from PyQt5.QtWidgets import (QCheckBox, QLabel, QVBoxLayout, QGridLayout, QWidget, ...
GroestlCoin/electrum-grs
electrum_grs/gui/qt/rbf_dialog.py
Python
gpl-3.0
7,458
0.000805
import sys import re import time import datetime import typesense import typesense.exceptions from unidecode import unidecode import psycopg2 import config from mapping.utils import log BATCH_SIZE = 5000 COLLECTION_NAME_PREFIX = 'mbid_mapping_' def prepare_string(text): return unidecode(re.sub(" +", " ", re.s...
metabrainz/listenbrainz-server
listenbrainz/mbid_mapping/mapping/typesense_index.py
Python
gpl-2.0
4,028
0.002483
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
DeepThoughtTeam/tensorflow
tensorflow/python/kernel_tests/edit_distance_op_test.py
Python
apache-2.0
6,429
0.002489
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------- # Portello membership system # Copyright (C) 2014 Klubb Alfa Romeo Norge # # 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 # t...
KlubbAlfaRomeoNorge/members
model.py
Python
gpl-2.0
9,213
0.001737
from optparse import OptionParser import os,sys from oldowan.mitotype.matcher import HVRMatcher from oldowan.mitotype.prevalidate import prevalidate_submission def run_command(): """Perform automated human mtDNA haplotype identification.""" # Set up the options parser usage = "usage: %prog [options] sequ...
ryanraaum/oldowan.mitotype
oldowan/mitotype/commandline.py
Python
mit
3,160
0.001582
# The content of this file was generated using the Python profile of libCellML 0.2.0. from enum import Enum from math import * __version__ = "0.3.0" LIBCELLML_VERSION = "0.2.0" STATE_COUNT = 1 VARIABLE_COUNT = 2 class VariableType(Enum): VARIABLE_OF_INTEGRATION = 1 STATE = 2 CONSTANT = 3 COMPUTED_...
nickerso/libcellml
tests/resources/generator/dependent_eqns/model.py
Python
apache-2.0
1,256
0.003981
from mozbadges.views.generic.detail import HybridDetailView from mozbadges.views.generic.list import HybridListView from models import Team class TeamDetailView(HybridDetailView): model = Team pk_url_kwarg = 'team' context_object_name = 'team' template_name = 'teams/detail.html' class TeamListView(H...
mozilla/mozilla-badges
mozbadges/site/teams/views.py
Python
bsd-3-clause
501
0.001996
import sys from collections import OrderedDict def get_identifiers(obj): """ Given a BeautifulSoup object, find all of the annotations of type "is" (rather than e.g. "isDerivedFrom", or "isHomologTo") """ identifiers = set() if not obj.find("annotation"): return identifiers for a...
jamesscottbrown/sbml-diff
sbml_diff/miriam.py
Python
bsd-3-clause
4,701
0.002978
from flask import (Blueprint, request, session, g, render_template, url_for, redirect, jsonify) from werkzeug.contrib.cache import SimpleCache from flask.ext.oauthlib.client import OAuth, OAuthException bp = Blueprint('user', __name__) oauth = OAuth() github = oauth.remote_app( 'github', app_...
flask-kr/githubarium
githubarium/user.py
Python
mit
2,165
0
from __future__ import annotations import procrunner import pytest import xia2.Test.regression @pytest.mark.parametrize("pipeline", ["dials", "3dii"]) def test_xia2(pipeline, regression_test, dials_data, tmpdir, ccp4): master_h5 = dials_data("vmxi_thaumatin") / "image_15799_master.h5:1:20" command_line = [ ...
xia2/xia2
tests/regression/test_vmxi_thaumatin.py
Python
bsd-3-clause
808
0
from conceptdb.metadata import Dataset import conceptdb from conceptdb.assertion import Sentence conceptdb.connect_to_mongodb('test') def test_sentence(): dataset = Dataset.create(language='en', name='/data/test') #create test sentence with dataset sentence1 = Sentence.make('/data/test', "This is a ...
commonsense/conceptdb
conceptdb/test/test_sentence.py
Python
gpl-2.0
1,640
0.010976
# Copyright (c) 2017 Microsoft Corporation. # # 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, publis...
domin1101/malmo-challenge
ai_challenge/pig_chase/environment.py
Python
mit
11,366
0.001672
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-08-16 00:39 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('user', '0009_auto_20160816_0720'), ] operations = [ migrations.AlterField( ...
internship2016/sovolo
app/user/migrations/0010_auto_20160816_0939.py
Python
mit
1,662
0.000728
import os import sys import time import pygame import socket import fcntl import struct import serial import RPi.GPIO as GPIO time_stamp_prev=0 def main(): GPIO.setmode(GPIO.BCM) GPIO.setup(22, GPIO.IN, pull_up_down=GPIO.PUD_UP) loop_forever = True prev_input = 1 while True: in...
tlevis/Pepino
user-interface/python-scripts/port-test.py
Python
mit
682
0.019062
# -*- coding: utf-8 -*- ############################################################################## # # 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 L...
odoo-arg/odoo_l10n_ar
l10n_ar_account_check_sale/wizard/__init__.py
Python
agpl-3.0
964
0
"""example_project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') ...
Pierre-Sassoulas/django-survey
example_project/example_project/urls.py
Python
agpl-3.0
1,020
0.00098
callback_classes = [ ['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::Ptr<ns3::Packet>', 'unsigned char', 'unsigned int', 'ns3::Ipv4Address', 'ns3::Ipv4Address', 'unsigned char', 'unsigned char', 'bool', 'ns3::...
pgarridounican/ns-3.20-NC
src/network-coding/bindings/callbacks_list.py
Python
gpl-2.0
2,905
0.005852
# Copyright (c) 2012 OpenStack, 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 agreed to in wr...
citrix-openstack-build/swift
test/unit/common/middleware/test_list_endpoints.py
Python
apache-2.0
8,008
0
import os from kaldi_io import kaldi_io import numpy as np def gen_feats_file(data_feats,ids,feat_filename): """ This function goes through the contents of a Kaldi script file (.scp) and selects the lines that match each element in ids and then stores this subset in feat_filename. This could be used to...
nicanorgarcia/kaldi-ivectors-for-python
kaldi_ivector.py
Python
apache-2.0
4,538
0.015866
# coding: utf-8 # # Copyright 2018 The Oppia 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 requi...
brianrodri/oppia
core/controllers/recent_commits_test.py
Python
apache-2.0
6,058
0
#!/usr/bin/python # -*- coding: utf-8 -*- ################################################################################ # # RMG - Reaction Mechanism Generator # # Copyright (c) 2002-2010 Prof. William H. Green (whgreen@mit.edu) and the # RMG Team (rmg_dev@mit.edu) # # Permission is hereby granted, free of c...
pierrelb/RMG-Py
rmgpy/reduction/rates.py
Python
mit
6,711
0.006705
source_suffix = '.rst' master_doc = 'index' project = 'gltools' copyright = '2012, Runar Tenfjord' extensions = ['sphinx.ext.autodoc'] autodoc_docstring_signature = True autodoc_member_order = 'groupwise' html_style = 'default.css' htmlhelp_basename = 'gltoolsdoc'
tenko/gltools
gltools/@docs/conf.py
Python
gpl-2.0
267
0.007491
"""Unit test for treadmill.appcfg.configure. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os import shutil import sys import tempfile import unittest import mock import treadmill from treadmill.appcfg...
Morgan-Stanley/treadmill
lib/python/treadmill/tests/appcfg/configure_test.py
Python
apache-2.0
7,613
0
#utils from struct import pack from struct import unpack def timestamp_compare(x, y): if x[1]>y[1]: return 1 elif x[1]==y[1]: return 0 else: # x[1]<y[1] return -1 def reverse_timestamp(x, y): return y[1]-x[1] class Note(object): def note_on(self, note_num, velocity, recom...
avsaj/rtpmidi
rtpmidi/engines/midi/recovery_journal_chapters.py
Python
gpl-3.0
27,204
0.008969
class Solution: def countRangeSum(self, nums: List[int], lower: int, upper: int) -> int: presum = [0] * (1 + len(nums)) for i in range(len(nums)): presum[i + 1] = presum[i] + nums[i] temp = [0] * (1 + len(nums)) def mergeSort(start, end): count = 0 ...
jiadaizhao/LeetCode
0301-0400/0327-Count of Range Sum/0327-Count of Range Sum.py
Python
mit
1,404
0.003561
# 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. # ---------------------------------------------------------------------...
Azure/azure-sdk-for-python
sdk/purview/azure-purview-administration/azure/purview/administration/_version.py
Python
mit
347
0
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. default_app_config = __name__ + ".apps.AppConfig"
suutari/shoop
shuup/importer/__init__.py
Python
agpl-3.0
304
0
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-01-24 23:50 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0001_initial'), ] operations = [ migrations.AlterModelOptions( ...
paulopinda/eventex
eventex/core/migrations/0002_auto_20160124_2350.py
Python
gpl-2.0
1,299
0.000771
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations def forward(apps, schema_editor): Binary = apps.get_model('packages', 'Binary') Binary.objects.filter(generated_binaries__isnull=True).delete() class Migration(migrations.Migration): dependencies = [ ...
lamby/buildinfo.debian.net
bidb/packages/migrations/0002_drop-orphaned-binary-instances.py
Python
agpl-3.0
424
0.004717
''' conda create -n py2711xr python=2.7 conda config --add channels conda-forge source activate py2711xr conda install xarray dask netCDF4 bottleneck conda update --all ''' import netCDF4,re from netCDF4 import Dataset def get(filename): nc = Dataset(filename,'r') print nc.date, '\n', nc.description,'\n' ...
wolfiex/RopaJL
treecluster/ncdata.py
Python
mit
1,008
0.021825
# Copyright (c) 2015, Anthony Schmieder # Use of this source code is governed by the 2-clause BSD license that # can be found in the LICENSE.txt file. """Loads and manages art assets""" import pyglet import os _ASSET_PATHS = ["res"] _ASSET_FILE_NAMES = [ "black_key_down.png", "black_key_up.png", "white_ke...
aschmied/keyzer
ui/assetmanager.py
Python
bsd-2-clause
1,180
0.000847
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
jkyeung/XlsxWriter
xlsxwriter/test/comparison/test_chart_bar10.py
Python
bsd-2-clause
1,580
0.000633
#!/usr/bin/env python3 import sys import re import mpmath as mp mp.dps=250 mp.mp.dps = 250 if len(sys.argv) != 2: print("Usage: format_CIAAW.py ciaawfile") quit(1) path = sys.argv[1] atomre = re.compile(r'^(\d+) +(\w\w*) +(\w+) +\[?(\d+)\]?\*? +(.*) *$') isore = re.compile(r'^(\d+)\*? +(\[?\d.*.*\]?) *$'...
pulsar-chem/Pulsar-Core
scripts/data/format_CIAAW.py
Python
bsd-3-clause
2,449
0.0147
# # Copyright (c) 2001 - 2015 The SCons Foundation # # 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...
stefanklug/mapnik
scons/scons-local-2.3.6/SCons/Options/PackageOption.py
Python
lgpl-2.1
1,995
0.001504
#!/usr/bin/python # This research is supported by the European Union Seventh Framework Programme (FP7/2007-2013), project ASPIRE (Advanced Software Protection: Integration, Research, and Exploitation), under grant agreement no. 609734; on-line at https://aspire-fp7.eu/. */ # The development of portions of the code co...
diablo-rewriter/diablo
obfuscation/diversity_engine/iterative_diablo/function_classification_evaluation.py
Python
gpl-2.0
5,609
0.029952
from libpcapy import pcap import signal import argparse import sys import threading counter = 0 def handler(signum, frame): print('Signal handler called with signal ', signum, counter) sys.exit(0) def callback(pkthdr, data, user_data): global counter counter += 1 print('%d.%d(%d/%d) '%(pkthdr.ts....
public0821/libpcapy
libpcapy/tcpdump.py
Python
apache-2.0
1,512
0.009259
''' HMMPowerSupplyMap ''' from Products.DataCollector.plugins.CollectorPlugin import ( SnmpPlugin, GetTableMap, GetMap ) from DeviceDefine import HMMSTATUS, HMMPRESENCE, HMMPOWERMODE, HMMLOCATION class HMMPowerSupplyMap(SnmpPlugin): ''' HMMPowerSupplyMap ''' relname = 'hmmpowerSup...
Wuguanping/Server_Manage_Plugin
Zenoss_Plugin/ZenPacks/community/HuaweiServer/modeler/plugins/community/snmp/HMMPowerSupplyMap.py
Python
apache-2.0
4,621
0.000216
#!/usr/bin/python3 from sympy import * from sympy.utilities.codegen import codegen import argparse import numpy as np import matplotlib as mp import matplotlib.pyplot as plt from matplotlib import cm, colors from mpl_toolkits.mplot3d import Axes3D # A simple script that invokes Sympy to implement a Newton-Gauss least-...
Aghosh993/QuadcopterCodebase
targets/f3discovery/calibration/imucal.py
Python
gpl-3.0
6,676
0.033853
""" The feed is an assembly of items of different content types. For ease of querying, each different content type is housed in the FeedItem model, which also houses metadata indicating the conditions under which it should be included. So a feed is actually just a listing of FeedItem instances that match the user's reg...
ingenioustechie/zamboni
mkt/feed/models.py
Python
bsd-3-clause
17,621
0.000057
from openslides.agenda.models import Item from openslides.topics.models import Topic from openslides.utils.test import TestCase class TestItemManager(TestCase): def test_get_root_and_children_db_queries(self): """ Test that get_root_and_children needs only one db query. """ for i i...
emanuelschuetze/OpenSlides
tests/integration/agenda/test_models.py
Python
mit
473
0
########## import web import hmac from time import strftime from datetime import datetime from hashlib import sha256 from lib.utils import db from lib.utils import render from lib.utils import etherpad from lib.validate import valid_user, valid_pw, make_salt ########## class FrontPage: def GET(self): r...
lauhuiyik/same-page
src/handlers/front.py
Python
mit
1,011
0.011869
#!/usr/bin/python # -*- coding: utf-8 -*- import cgi import sqlite3, re, string, codecs, os def cercaurbano(cNominativo): c = sqlite3.connect('./data/catasto.db') cur = c.cursor() cSele = "select distinct (id_i.foglio || '-' || id_i.numero ||'-'|| id_i.subalterno), \ '<a href=\"http://nominatim.openstreetmap.o...
marcobra/opencatamap
cgi-bin/genera_html_su_urbano.py
Python
gpl-3.0
3,614
0.015495
#!/usr/bin/env python # Copyright (c) 2010-2016, Daniel S. Standage and CONTRIBUTORS # # The AEGeAn Toolkit is distributed under the ISC License. See # the 'LICENSE' file in the AEGeAn source code distribution or # online at https://github.com/standage/AEGeAn/blob/master/LICENSE. from __future__ import print_function...
standage/AEGeAn
data/scripts/version.py
Python
isc
1,633
0.002449
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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':...
Jorge-Rodriguez/ansible
lib/ansible/modules/network/panos/panos_security_rule.py
Python
gpl-3.0
19,861
0.001762
from django import forms, template from django.forms.formsets import all_valid from django.forms.models import modelform_factory, inlineformset_factory from django.forms.models import BaseInlineFormSet from django.contrib.contenttypes.models import ContentType from django.contrib.admin import widgets from django.contri...
Shrews/PyGerrit
webapp/django/contrib/admin/options.py
Python
apache-2.0
34,944
0.005094