code
stringlengths
3
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
3
1.05M
import os import re import sys from numpy.distutils.fcompiler import FCompiler from numpy.distutils.exec_command import exec_command, find_executable from numpy.distutils.misc_util import make_temp_file from distutils import log compilers = ['IBMFCompiler'] class IBMFCompiler(FCompiler): compiler_type = 'ibm' ...
chadnetzer/numpy-gaurdro
numpy/distutils/fcompiler/ibm.py
Python
bsd-3-clause
3,350
# -*- 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-datacatalog
samples/generated_samples/datacatalog_v1_generated_policy_tag_manager_list_policy_tags_sync.py
Python
apache-2.0
1,525
from django.apps import AppConfig class DistrochooserConfig(AppConfig): name = 'distrochooser'
distrochooser/distrochooser
backend/distrochooser/apps.py
Python
mpl-2.0
106
# Create your views here. from django.template import RequestContext, loader from models import Artist, Song from django.shortcuts import render, redirect from forms import SongForm from django.http import HttpResponse from justAnalyze import analyze def index(request): song_list = Song.objects.all() context ...
stuntman723/rap-analyzer
lyrics/views.py
Python
mit
1,428
from pandac.PandaModules import VBase4 CCNormal = 0 CCNoChat = 1 CCNonPlayer = 2 CCSuit = 3 CCToonBuilding = 4 CCSuitBuilding = 5 CCHouseBuilding = 6 CCSpeedChat = 7 CCFreeChat = 8 CHAT = 0 SPEEDCHAT = 1 CHAT_BALLOON = 0 THOUGHT_BALLOON = 1 cardModel = None arrowModel = None chatBalloon3dModel = None chatBalloon3d...
Spiderlover/Toontown
toontown/nametag/NametagGlobals.py
Python
mit
9,207
import os import platform from twisted.internet import defer from .. import data, helper from p2pool.util import math, pack, jsonrpc @defer.inlineCallbacks def get_subsidy(bitcoind, target): res = yield bitcoind.rpc_getblock(target) defer.returnValue(res) P2P_PREFIX='e4e8e9e5'.decode('hex') P2P_PORT=19946 A...
ptcrypto/p2pool-adaptive
p2pool/bitcoin/networks/novacoin.py
Python
gpl-3.0
1,282
# coding: utf-8 """:mod:`clien.api` --- CLIEN API Implementation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ import os import pickle from datetime import datetime import requests from bs4 import BeautifulSoup from clien.constants import CLIENM_URL, CLIENM_URI from clien.constants import REGEXP from clien.de...
ssut/pyclien
clien/api.py
Python
mit
6,452
# 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 writing, software # d...
afaheem88/tempest_neutron
tempest/api/telemetry/test_telemetry_notification_api.py
Python
apache-2.0
2,636
# Copyright (c) 2013 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...
bigswitch/neutron
neutron/scheduler/l3_agent_scheduler.py
Python
apache-2.0
19,726
"""Utilities for the neural network modules """ # Author: Issam H. Laradji <issam.laradji@gmail.com> # License: BSD 3 clause import numpy as np from ..utils.fixes import expit as logistic_sigmoid def identity(X): """Simply return the input array. Parameters ---------- X : {array-like, sparse matri...
waterponey/scikit-learn
sklearn/neural_network/_base.py
Python
bsd-3-clause
6,856
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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 appl...
our-city-app/oca-backend
src/rogerthat/restapi/payment.py
Python
apache-2.0
2,705
# 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/. # Future Modules: from __future__ import annotations # Built-in Modules: import logging import time from typing import...
nstockton/mapperproxy-mume
mapper/sockets/fakesocket.py
Python
mpl-2.0
1,817
from PyQt5.QtDesigner import *
ales-erjavec/anyqt
AnyQt/_backport/QtDesigner.py
Python
gpl-3.0
30
# Enter your code here. Read input from STDIN. Print output to STDOUT import cmath z = complex(raw_input()) print abs(z) print cmath.phase(z)
ugaliguy/HackerRank
Python/Math/polar-coordinates.py
Python
mit
148
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'BarPlot.ui' # # Created: Fri Apr 22 14:30:11 2011 # by: PyQt4 UI code generator 4.6.2 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_BarPlotDialog(object): def setupUi(self, BarPl...
dparks1134/STAMP
stamp/plugins/multiGroups/plots/configGUI/BarPlotUI.py
Python
gpl-3.0
10,651
#!/usr/bin/env python # coding: utf-8 from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from youtube_dl.utils import get_filesystem_encoding from youtube_dl.compat import ( compat_...
atomic83/youtube-dl
test/test_compat.py
Python
unlicense
4,089
import traceback import inspect import neo from neo.io.baseio import BaseIO from .. import SpykeException def load_from_file(path): """ Load IO plugins from a Python file. Inserts the loaded plugins into the neo.iolist. :param str path: The path to the file to search for IO plugins. """ f = open...
rproepp/spykeutils
spykeutils/plugin/io_plugin.py
Python
bsd-3-clause
1,301
# -*- coding: utf-8 -*- # Resource object code # # Created: Wed Mar 20 11:16:13 2013 # by: The Resource Compiler for PyQt (Qt v4.8.4) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = "\ \x00\x00\x14\x1d\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x...
Distrotech/PyQt-x11
examples/animation/easing/easing_rc2.py
Python
gpl-2.0
22,193
from django.core.management import call_command from django.test import TestCase from frontend.models import Chemical from frontend.models import Presentation from frontend.models import Product from frontend.models import Section from mock import patch @patch('frontend.management.commands.generate_presentation_repl...
annapowellsmith/openpresc
openprescribing/frontend/tests/commands/test_generate_presentation_replacements.py
Python
mit
4,653
# -*- coding: utf-8 -*- import random import itertools from cfme.common import SummaryMixin, Taggable from cfme.fixtures import pytest_selenium as sel from cfme.web_ui import toolbar as tb, paginator, match_location,\ PagedTable, CheckboxTable from cfme.containers.provider import details_page, Labelable,\ Cont...
jteehan/cfme_tests
cfme/containers/project.py
Python
gpl-2.0
2,934
import sys from raspberrypi_py.utils import Led def play(times=None, frequency=None): led = Led() print('Start session') kwargs = {} if times: kwargs['times'] = times if frequency: kwargs['frequency'] = frequency led.pulse(**kwargs) if __name__ == '__main__': try: ...
andreipradan/raspberrypi-py
examples/pulse_gpio1.py
Python
mit
513
''' Copyright 2014 Travel Modelling Group, Department of Civil Engineering, University of Toronto This file is part of the TMG Toolbox. The TMG Toolbox 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 Fou...
TravelModellingGroup/TMGToolbox
TMGToolbox/src/assignment/road/tolled/Toll_Based_Road_Assignment.py
Python
gpl-3.0
42,864
import logging import boto3 import io from slovar import slovar from prf import fs log = logging.getLogger(__name__) def includeme(config): Settings = slovar(config.registry.settings) S3.setup(Settings) class S3(fs.FS): def __init__(self, ds, create=False): path = ds.ns.split('/') bucke...
vahana/prf
prf/s3.py
Python
mit
954
from django.conf.urls import include, url from sapl.sessao.views import (AdicionarVariasMateriasExpediente, AdicionarVariasMateriasOrdemDia, BancadaCrud, CargoBancadaCrud, ExpedienteMateriaCrud, ExpedienteView, JustificativaAu...
interlegis/sapl
sapl/sessao/urls.py
Python
gpl-3.0
11,025
# -*- coding: utf-8 -*- from PyQt5.QtWidgets import QDialog from PyQt5.QtWidgets import QVBoxLayout from PyQt5.QtCore import Qt #from PyQt5.QtCore import pyqtSignal from PyQt5.QtQuickWidgets import QQuickWidget from ninja_ide.gui.ide import IDE from ninja_ide.tools import ui_tools class SplitOrientation(QDialog): ...
Salmista-94/Ninja_3.0_PyQt5
ninja_ide/gui/main_panel/helpers/split_orientation.py
Python
gpl-3.0
1,346
# Copyright 2015 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 logging import re import time from devil.android import device_errors from pylib import flag_changer from pylib.base import base_test_result from pyl...
Teamxrtc/webrtc-streaming-node
third_party/webrtc/src/chromium/src/build/android/pylib/local/device/local_device_instrumentation_test_run.py
Python
mit
6,414
# encoding:utf-8 from django.shortcuts import render_to_response from django.template.context import RequestContext from apps.company.models import Company, Comment from django.shortcuts import get_object_or_404 from utils.page import paginator_objects def index(request): return render_to_response('index.html', {...
openslack/openslack-web
openslack/apps/company/views.py
Python
apache-2.0
1,072
from sympy.core.basic import C, S, sympify from sympy.core.function import Function ############################################################################### ############################# SQUARE ROOT FUNCTION ############################ ###########################################################################...
mattpap/sympy-polys
sympy/functions/elementary/miscellaneous.py
Python
bsd-3-clause
1,392
class Hero: ''' a hero who is allegic to apples ''' def __init__(self, name): ''' whateever we want ''' self.name=name self.health=100 def eat(self, food): if(food=='apple'): self.health-=100 elif(food=='ham'): self.heal...
timothysnider/learning_python
classes.py
Python
mit
410
import json from datetime import datetime from werkzeug.local import LocalProxy from .packable import Packable class JSONEncoder(json.JSONEncoder): """ Handles the following cases: - encode datetime as ISO 8601 format - automatically decode bytes using utf-8 - handles Packable objects like User...
cllu/Flask-RESTify
flask_restify/jsons.py
Python
bsd-3-clause
1,280
import xml.etree.cElementTree from os import environ, unlink, symlink import time class Timezones: def __init__(self): self.timezones = [] self.readTimezonesFromFile() def readTimezonesFromFile(self): try: root = xml.etree.cElementTree.parse('/etc/timezone.xml').getroot() for zone in root.findall("zone...
digidudeofdw/enigma2
lib/python/Components/Timezones.py
Python
gpl-2.0
1,278
#################################################################### #==================================================================# # -------------- SPILP CONFIG OPTIONS -------------- # #==================================================================# ########################################...
jack51706/spilp
spilpconfig.py
Python
gpl-3.0
7,615
from binary_tree_prototype import BinaryTreeNode # @include class BinarySearchTree: def __init__(self): self._root = None # @exclude def empty(self): return self._root is None # @include def insert(self, key): if self.empty(): self._root = BinaryTreeNode(key)...
meisamhe/GPLshared
Programming/MPI โ€” AMath 483 583, Spring 2013 1.0 documentation_files/insertion_deletion_bst.py
Python
gpl-3.0
3,515
from navi.components.component import Component __author__ = 'paoolo' class LowPassFilter(Component): """ Used to low pass. """ def __init__(self): super(LowPassFilter, self).__init__(enable=True) self._old_left = 0.0 self._old_right = 0.0 self._alpha = 0.3 def...
dev-navi/navi-python-main
src/navi/components/other/low_pass_filter.py
Python
unlicense
871
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Open PIM Daemon (C) 2008 by Soeren Apel <abraxa@dar-clan.de> (C) 2008 Openmoko, Inc. (C) 2009 Michael 'Mickey' Lauer <mlauer@vanille-media.de> (C) 2009 Sebastian Krzyszkowiak <seba.dos1@gmail.com> (C) 2009 Tom "TAsn" Hacohen <tom@stosb.com> GPLv2 or later Tasks Domain...
freesmartphone/framework
framework/subsystems/opimd/pimd_tasks.py
Python
gpl-2.0
10,762
from django.shortcuts import render from django.http import HttpResponse import urllib2 import os import time import pyforcealign import shutil import json from utilities import format_access P2FA_DIR = "/Users/venkatesh-sivaraman/p2fa/model" # Create your views here. def index(request): return format_access(HttpRes...
pmitros/edx-speech-tools
Django/richreview_htk/force_alignment/views.py
Python
agpl-3.0
1,865
#!/usr/bin/python # # Copyright 2008 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...
kdlucas/pyrering
lib/mock_reporter.py
Python
apache-2.0
1,003
# # Copyright 2016 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
seecloud/spamostack
spamostack/keeper.py
Python
apache-2.0
7,063
import pytest import os import distutils.spawn import numpy as np from astropy import units as u from astropy import log from ..core import parse_outfile,pyradex,Radex exepath = 'Radex/bin/radex' #if os.path.isfile(exepath) and os.access(exepath, os.X_OK): # exepath = exepath if distutils.spawn.find_executable('ra...
keflavich/pyradex
pyradex/tests/test_radex.py
Python
bsd-3-clause
9,086
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2019-06-24 23:35 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_depende...
sio2project/oioioi
oioioi/problems/migrations/0019_algorithmtagproposal_difficultyproposal.py
Python
gpl-3.0
1,893
# 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...
Laucoonte/cpmx
object_detection/utils/ops.py
Python
mit
27,473
import threading import statsd # we reuse django_statsd's get_connection so that we automatically use the same django settings from django_statsd import utils from django.conf import settings local = threading.local() scope = None if not hasattr(local, 'solarpermit_statsd'): local.solarpermit = {} scope ...
solarpermit/solarpermit
website/utils/temporal_stats.py
Python
bsd-3-clause
1,208
# coding=utf-8 from app.main.models.Despesa import Despesa_dao from app import Produto_dao class Despesa_service(object): def salvar(self, despesa): despesa.salvar() return {'mensagem': 'Compra cadastrado com sucesso'} def listar(self, id): return Despesa_dao.listar(id) @staticme...
amandapersampa/MicroGerencia
app/main/service/Despesa_service.py
Python
mit
382
def check_grid(grid): for g in grid: for i in range(len(g)-1): if g[i] == g[i+1]: return False for i in range(len(grid)-1): for j in range(len(grid[i])): if grid[i][j] == grid[i+1][j]: return False return True if __name__ == '__main_...
edwardzhu/checkio-solution
EmpireOfCode/common/Crystalite Farms/crystalGrid.py
Python
mit
1,098
# -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 ## ## Copyright (C) 2012 Async Open Source <http://www.async.com.br> ## All rights reserved ## ## This program 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 F...
tiagocardosos/stoq
stoqlib/gui/dialogs/labeldialog.py
Python
gpl-2.0
3,204
from setuptools import setup setup( name='jinja-layout', version='0.2', url='http://github.com/frascoweb/jinja-layout', license='MIT', author='Maxime Bouroumeau-Fuseau', author_email='maxime.bouroumeau@gmail.com', description='Extended layout system for Jinja2', py_modules=['jinja_layo...
frascoweb/jinja-layout
setup.py
Python
mit
381
# Software selection spoke classes # # Copyright (C) 2011-2013 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is...
cs2c-zhangchao/nkwin1.0-anaconda
pyanaconda/ui/gui/spokes/software.py
Python
gpl-2.0
16,589
#!/usr/bin/env python # encoding: utf-8 import os import os.path import tempfile import simplejson from optparse import OptionParser command = "curl -X POST --form xpath=%s --form designs=@%s --form xmldata=@%s.xml %s > %s" def get_report(files, url): main_report = files[0] if len(files) > 1: files...
mportela/pyjasper_client_sample
client.py
Python
mpl-2.0
1,544
#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools, set a...
ibis-inria/wellFARE
ez_setup.py
Python
lgpl-3.0
8,540
#!/usr/bin/env python #-*- coding: iso-8859-1 -*- # Copyright (c) 2006-2010 Tampere University of Technology # # 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 ...
tema-mbt/tema-tg
TemaLib/tema/eini/mdm2svg.py
Python
mit
5,662
#! /usr/bin/python # The contents of this file are subject to the Common Public Attribution # License Version 1.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://code.reddit.com/LICENSE. The License is based on the Mozilla Public # Li...
h2oloopan/easymerge
EasyMerge/tests/reddit/scripts/log_q.py
Python
mit
7,958
ad = 1. # this statement will be ignored at the codegen x = ad is None
ratnania/pyccel
tests/warnings/codegen/is.py
Python
mit
72
# -*- coding: utf-8 -*- # Get elemenatry features from COW-DOM. import os.path import sys import glob import re from lxml import etree as ET # add a lists of "communication verbs" here: COGNITION_VERBS = set([u'wissen', u'kennen', u'glauben', u'vermuten', u'ahnen', u'annehmen', u'zweifel...
rsling/cow
src/corex/corex_additional.py
Python
bsd-2-clause
8,632
#!/usr/bin/env python __author__ = 'catalyst256' __copyright__ = 'Copyright 2014, Honeymalt Project' __credits__ = [] __license__ = 'GPL' __version__ = '0.1' __maintainer__ = 'catalyst256' __email__ = 'catalyst256@gmail.com' __status__ = 'Development' __all__ = [ 'kipposensor', 'kipposearchdate', 'kippos...
SneakersInc/HoneyMalt
src/HoneyMalt/transforms/__init__.py
Python
apache-2.0
452
import os import unittest import sys sys.path.append("src/crabblerweb") import crabblerweb class Crabblerweb_Root(unittest.TestCase): def test_root(self): self.app = crabblerweb.app.test_client() out = self.app.get('/') assert '200 OK' in out.status # assert 'charset=utf-8...
siwells/crabbler-web
test/crabblerwebtest/crabblerwebtest.py
Python
gpl-3.0
742
#detector.py class Detection(object): pt1 = (0, 0) pt2 = (0, 0) cls = None score = 0.0 def __init__(self, pt1, pt2, cls, score): self.pt1 = (int(pt1[0]), int(pt1[1])) self.pt2 = (int(pt2[0]), int(pt2[1])) self.cls = cls self.score = score class Detector(object): ...
bbcdli/xuexi
yingyong/detector_py_app/inference/detector.py
Python
apache-2.0
444
from django.db.models.base import ModelBase from django.core.exceptions import ImproperlyConfigured class ModelNotActionable(ImproperlyConfigured): """ Raised when a Model not in ``ACTSTREAM_ACTION_MODELS`` setting is used in an Action. """ def __str__(self): model = self.args[0] ...
Eksmo/django-activity-stream
actstream/exceptions.py
Python
bsd-3-clause
1,319
#!/usr/bin/env python # 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 ...
googleads/google-ads-python
examples/advanced_operations/add_display_upload_ad.py
Python
apache-2.0
7,053
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2013, 2014, 2015 # Author(s): # Joonas Karjalainen <joonas.karjalainen@fmi.fi> # Panu Lahtinen <panu.lahtinen@fmi.fi> # Martin Raspaud <martin.raspaud@smhi.se> # This program is free software: you can redistribute it and/or modify # it under the te...
TAlonglong/trollduction-test
bin/trollstalker2.py
Python
gpl-3.0
8,171
#!/usr/bin/python import xgboost as xgb import csv import numpy as np from six.moves import cPickle as pickle # read in data dataset = 'dataset/' train_data_filename = dataset + 'final_train_data.pickle' train_label_filename = dataset + 'final_train_labels.pickle' test_data_filename = dataset + 'final_test_data.pickle...
NCLAB2016/DF_STEALL_ELECTRIC
start.py
Python
gpl-3.0
4,612
import enum from uuid import uuid4, UUID from datetime import date, datetime, timedelta from asyncpgsa import connection from sqlalchemy import Table, Column, MetaData, Sequence, types from sqlalchemy.dialects.postgresql import UUID as PG_UUID metadata = MetaData() class MyEnum(enum.Enum): ITEM_1 = 'item_1' ...
CanopyTax/asyncpgsa
tests/test_defaults.py
Python
apache-2.0
5,137
import fcntl import os import pty import struct import sys import termios import textwrap try: import unittest2 as unittest except ImportError: import unittest try: from twisted.internet import reactor from twisted.internet.defer import Deferred from twisted.internet.protocol import ProcessProtoco...
aktorion/bpython
bpython/test/test_crashers.py
Python
mit
3,969
#!/usr/bin/env python """ Many thanks to Brian Rosner <oebfare.com> for letting me include this code in Test Utils. """ import os import sys from optparse import OptionParser from django.conf import settings from django.core.management import call_command def main(): """ The entry point for the script. This scr...
frac/django-test-utils
test_utils/bin/django_test_runner.py
Python
mit
2,670
""" <Program Name> hosts_text.py <Started> July 2013 <Author> Savvas Savvides <ssavvide@purdue.edu> <Purpose> Generate the text needed by /etc/hosts to block websites. Read a set of websites from a text file and generate the text to add to the /etc/hosts file in order to block a website. For a website: ...
pombredanne/small-utils
hosts-text-generator/hosts_text_generator.py
Python
gpl-2.0
3,839
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import datetime import re from elasticsearch_dsl import Search, F, Q from elasticsearch.exceptions import NotFoundError ...
rhelmer/socorro-lib
socorro/external/es/supersearch.py
Python
mpl-2.0
15,207
import os import os.path from conf import * import cPickle as pickle from wsd.database import MySQLDatabase import pandas as pn import MySQLdb def pickle_redirects_ids(): db = MySQLDatabase(DATABASE_HOST, DATABASE_USER, DATABASE_PASSWORD, DATABASE_NAME) db_work_view = db.get_work_view() redirects_list_id...
trovdimi/wikilinks
redirects_candidates.py
Python
mit
1,947
""" Verify that the hash computing logic for ValueObject's values can't crash us. """ from __future__ import print_function import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class ValueMD5CrashTestCase(TestBase): mydir = TestBase.comp...
apple/swift-lldb
packages/Python/lldbsuite/test/functionalities/value_md5_crash/TestValueMD5Crash.py
Python
apache-2.0
1,697
#! /usr/bin/env python # -*- mode: python; indent-tabs-mode: nil; -*- # vim:expandtab:shiftwidth=2:tabstop=2:smarttab: # # Copyright (C) 2010,2011 Patrick Crews # # 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 Soft...
vladistan/percona-pam-plugin
test/dbqp/lib/server_mgmt/server.py
Python
gpl-2.0
15,377
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-07-10 12:06 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('django_project', '0014_auto_20160710_1200'), ] operations = [ migrations.Rem...
kunalsharma05/django-project
django_project/migrations/0015_auto_20160710_1206.py
Python
bsd-3-clause
638
import unittest from pyxt.tests.utils import SystemBusTestable from pyxt.serial import * class SerialPortTests(unittest.TestCase): def setUp(self): self.ser = SerialAdapter(0x3F8, 4) self.bus = SystemBusTestable() self.bus.install_device(None, self.ser) def test_addre...
astamp/PyXT
pyxt/tests/test_serial.py
Python
gpl-2.0
668
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('tests', '0003_auto_20140905_0634'), ] operations = [ migrations.DeleteModel( name='SearchTestOldConfig', ...
dresiu/wagtail
wagtail/tests/migrations/0004_auto_20141008_0420.py
Python
bsd-3-clause
417
# Copyright 2018-2020 by Christopher C. Little. # This file is part of Abydos. # # Abydos 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 versio...
chrislit/abydos
abydos/distance/_upholt.py
Python
gpl-3.0
4,479
#!/usr/bin/env python # -*- coding:utf-8 -*- #Author:xp #blog_url: http://blog.csdn.net/wuxingpu5/article/details/71209731 l=[1,2,10,30,40,33,22,99,31] l.sort() print(l) def search(find_num,seq): if len(seq) == 0: print('seq not exists') return mid_index=len(seq)//2 mid_num=seq[mid_index] ...
5StevenWu/Coursepy
L05/recursion_2.py
Python
apache-2.0
566
#!/usr/bin/python from setuptools import setup setup( name='pscheduler', version='0.1.1', description='pScheduler functions', url='http://www.perfsonar.net', author='The perfSONAR Development Team', author_email='perfsonar-developer@perfsonar.net', license='Apache 2.0', packages=[ ...
mfeit-internet2/pscheduler-dev
python-pscheduler/pscheduler/setup.py
Python
apache-2.0
920
from django.shortcuts import get_object_or_404, render from .models import Server def index(request): ''' Display a list of any and all servers in the Minecrunch network ''' servers = Server.objects.all() return render(request, 'servers/servers.html', {'servers': servers}) def server(request, ...
Jonpro03/Minecrunch_Web
src/servers/views.py
Python
mit
539
import numpy as np import argparse from matrix import * from multiprocessing.pool import ThreadPool from ctypes import c_char_p import multiprocessing as mp import sys import time import math import string def parse_args(): ''' Parses arguments. ''' parser = argparse.ArgumentParser(description="Produce...
OswinGuai/GenerateAdjacency
generate_adjacency_matrix.py
Python
apache-2.0
5,023
from .base import get from . import elections
cathydeng/openelections-core
openelex/api/__init__.py
Python
mit
46
# This script creates figure with uniformity of coverage import argparse import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt import numpy as np import statistics as stat enLang={'Coverage':'Coverage','MedAmplCov':'Median \nAmplicon Coverage', 'AmplNum':'Amplicon Number','VarCoef':'Coeffici...
aakechin/BRCA-analyzer
drawUniformityFigure.py
Python
gpl-3.0
3,546
# 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 the hope that it will be useful, # bu...
Hao-Liu/avocado
avocado/core/parser.py
Python
gpl-2.0
3,587
try: from django.utils import timezone as datetime except ImportError: from datetime import datetime from django.contrib.auth.models import Group from django.db import models from django.db.models.signals import post_save, post_delete, m2m_changed from waffle.compat import AUTH_USER_MODEL, cache from waffle.u...
festicket/django-waffle
waffle/models.py
Python
bsd-3-clause
6,784
__author__ = 'Denis Mikhalkin' class ResultObj(object): def __init__(self, result = None): self._result = result self._failureCallback = None self._successCallback = None def success(self, callback): if self._result == True: callback() elif self._result is N...
denismo/DevOpsGears
engine/async.py
Python
gpl-3.0
1,084
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com thumbor@googlegroups.com from thumbor.handlers import BaseHandler class HealthcheckHandler(...
okor/thumbor
thumbor/handlers/healthcheck.py
Python
mit
450
from thunder.utils.params import Params from nose.tools import assert_true from numpy import array, array_equal class TestParams: def test_paramsMethods(self): param1 = {'name': 'p1', 'value': array([1, 2, 3])} param2 = {'name': 'p2', 'value': array([4, 5, ...
oliverhuangchao/thunder
test/test_params.py
Python
apache-2.0
765
from datetime import datetime import pytz from django.conf import settings from django.contrib.auth.models import User from django.contrib.sites.models import Site from dogood.tests.base import DoGoodTestCase from dogood.models import Blog, Post from dogood.forms import PostForm class ViewTestCase(DoGoodTestCase):...
MidwestCommunications/django-dogood
dogood/tests/views.py
Python
mit
6,480
from time import sleep import flask from dash import Dash, Input, Output, dcc, html import dash.testing.wait as wait from dash_test_components import WidthComponent from tests.assets.todo_app import todo_app def test_dvui001_disable_props_check_config(dash_duo): app = Dash(__name__) app.layout = html.Div( ...
plotly/dash
tests/integration/devtools/test_devtools_ui.py
Python
mit
8,121
''' Copyright (c) 2013, Kenneth Langga (klangga@gmail.com) All rights reserved. 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 any later version. This program is...
phil-lidar1-fmc/hec-automation
dss_handler/dss_handler.py
Python
gpl-3.0
6,239
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Justin Santa Barbara # # 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/LICEN...
NoBodyCam/TftpPxeBootBareMetal
nova/tests/test_utils.py
Python
apache-2.0
30,107
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
nsnam/ns-3-dev-git
src/network/bindings/modulegen__gcc_ILP32.py
Python
gpl-2.0
787,692
import datetime import pytz from django.core.urlresolvers import reverse from mock import patch from nose.plugins.attrib import attr from courseware.access import has_access from courseware.tests.helpers import CourseAccessTestMixin, LoginEnrollmentTestCase from courseware.tests.factories import ( BetaTesterFacto...
waheedahmed/edx-platform
lms/djangoapps/courseware/tests/test_view_authentication.py
Python
agpl-3.0
17,100
# tests.test_utils.test_types # Tests for type checking utilities and validation # # Author: Benjamin Bengfort <bbengfort@districtdatalabs.com> # Created: Fri May 19 10:58:32 2017 -0700 # # ID: test_types.py [79cd8cf] benjamin@bengfort.com $ """ Tests for type checking utilities and validation. Generally if there ...
pdamodaran/yellowbrick
tests/test_utils/test_types.py
Python
apache-2.0
17,761
# -*- 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 'RedirectRule' db.create_table(u'redirects_redirectrule', ( (u'id', self.gf('djan...
66eli77/fle-home
fle_site/apps/redirects/migrations/0001_initial.py
Python
mit
6,699
#!/usr/bin/python2 from distutils.core import setup setup(name='pySnipps', version='0.6', description='A snippet tool written in python', author='Manuel Herrmann', author_email='pysnipps@icetruck.de', url='http://pysnipps.icetruck.de/', scripts = ["pySnipps"], packages=["pySnipp...
0x17de/pySnipps
setup.py
Python
gpl-2.0
464
# 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...
panmari/tensorflow
tensorflow/python/training/training_ops.py
Python
apache-2.0
6,325
# Copyright (c) 2015-2016, the authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) import numpy as np from GPy.core import SparseGP, Model, Param from GPy.core.parameterization.transformations import Logexp from paramz.transformations import __fixed__ from GPy import likelihoods fro...
zhenwendai/DeepGP
deepgp/layers/layers.py
Python
bsd-3-clause
21,780
import datetime as dt from typing import List, Dict import logging import json import dateutil.parser from urllib.parse import urlparse import subprocess from server import base_dir from server.cache import cache from server.platforms.provider import ContentProvider, MC_DATE_FORMAT class WebGoogleProvider(ContentPro...
mitmedialab/MediaCloud-Web-Tools
server/platforms/web_google.py
Python
apache-2.0
2,235
"""Nearest Neighbors graph functions""" # Author: Jake Vanderplas <vanderplas@astro.washington.edu> # # License: BSD 3 clause (C) INRIA, University of Amsterdam from .base import KNeighborsMixin, RadiusNeighborsMixin from .unsupervised import NearestNeighbors def kneighbors_graph(X, n_neighbors, mode='connectivity'...
JT5D/scikit-learn
sklearn/neighbors/graph.py
Python
bsd-3-clause
2,847
# -*- coding: utf-8 -*- """ Created on Tue Jul 15 20:19:50 2014 Lists the serial ports available on the computer (Windows). @author: Xabi """ import sys from PyQt4 import QtGui from PyQt4.QtCore import * from PyQt4.QtGui import * #sys.path.append("C:\\Documents and Settings\\Sensores\\Mis documentos\\Dropbox\\PFG\\g...
bgamecho/arduino2android
Assets/Python/serial_ports.py
Python
apache-2.0
3,634
# coding: utf-8 default_app_config = 'django_feedback_api.apps.DjangoFeedbackApiConfig'
k0st1an/django-feedback-api
django_feedback_api/__init__.py
Python
apache-2.0
89
import decimal import unittest import pid class TestPID(unittest.TestCase): def test_pid_created(self): xpid = pid.PID(decimal.Decimal("50"), decimal.Decimal("50")) assert xpid.model[-1] == decimal.Decimal("50") def test_pid_update(self): xpid = pid.PID(decimal.Decimal("50"), decimal...
cjduncana/PID-Controller
pid/tests/test-pid.py
Python
gpl-2.0
1,037
# -*- coding: utf-8 -*- # 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 __future__ import absolute_import import releng_treestatus app = releng_treestatus.creat...
garbas/mozilla-releng-services
src/releng_treestatus/releng_treestatus/flask.py
Python
mpl-2.0
328