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
# Copyright 2013 Google Inc. All Rights Reserved. """Sets the password of the MySQL root user.""" from googlecloudsdk.calliope import base from googlecloudsdk.core import log from googlecloudsdk.core import remote_completion from googlecloudsdk.sql import util @base.ReleaseTracks(base.ReleaseTrack.GA) class SetRoot...
wemanuel/smry
smry/server-auth/ls/google-cloud-sdk/lib/googlecloudsdk/sql/tools/instances/set_root_password.py
Python
apache-2.0
4,026
0.002981
# -*- coding: utf-8 -*- # Copyright 2021 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 o...
googleapis/python-aiplatform
google/cloud/aiplatform/datasets/column_names_dataset.py
Python
apache-2.0
8,935
0.001231
from sklearn2sql_heroku.tests.classification import generic as class_gen class_gen.test_model("AdaBoostClassifier" , "iris" , "mysql")
antoinecarme/sklearn2sql_heroku
tests/classification/iris/ws_iris_AdaBoostClassifier_mysql_code_gen.py
Python
bsd-3-clause
137
0.014599
# Generated by Django 2.0.5 on 2018-05-07 09:24 from django.conf import settings import django.contrib.gis.db.models.fields from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import endpoints.models class Migration(migrations.Migration): dependencies = [ ...
aapris/IoT-Web-Experiments
iotendpoints/endpoints/migrations/0003_datalogger.py
Python
mit
1,762
0.003973
"""Package initialization.""" from .core import * from .main import main from .pandocattributes import PandocAttributes
tomduck/pandoc-xnos
pandocxnos/__init__.py
Python
gpl-3.0
121
0
# Copyright 2014 Donald Stufft # # 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, so...
dstufft/sessions
sessions/__init__.py
Python
apache-2.0
913
0.001095
import numpy as np print(np.__version__) # 1.19.4 a = np.array([[10.0, 10.1, 10.9], [-10.0, -10.1, -10.9]]) print(a) # [[ 10. 10.1 10.9] # [-10. -10.1 -10.9]] print(np.floor(a)) # [[ 10. 10. 10.] # [-10. -11. -11.]] print(np.floor(a).dtype) # float64 print(np.floor(a).astype(int)) # [[ 10 10 10] # [-10 ...
nkmk/python-snippets
notebook/numpy_floor_trunc_ceil.py
Python
mit
681
0
# third party from sqlalchemy import Column from sqlalchemy import JSON from sqlalchemy import String # relative from . import Base class Dataset(Base): __tablename__ = "dataset" id = Column(String(256), primary_key=True) name = Column(String(256)) manifest = Column(String(2048)) description = C...
OpenMined/PySyft
packages/syft/src/syft/core/node/common/node_table/dataset.py
Python
apache-2.0
435
0
#!/usr/bin/python3 # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "Lic...
airbnb/airflow
dev/send_email.py
Python
apache-2.0
10,284
0.001654
dimensions(8,8) wall((2,0),(2,4)) wall((2,4),(4,4)) wall((2,6),(6,6)) wall((6,6),(6,0)) wall((6,2),(4,2)) initialRobotLoc(1.0, 1.0)
Cynary/distro6.01
arch/6.01Soft/lib601-F13-4/soar/worlds/bigFrustrationWorld.py
Python
mit
133
0.120301
from mapofinnovation.tests import * class TestAdminfuncController(TestController): def test_index(self): response = self.app.get(url(controller='adminfunc', action='index')) # Test response...
AnanseGroup/map-of-innovation
mapofinnovation/tests/functional/test_adminfunc.py
Python
mit
215
0.004651
# amazon plugin by ine (2020) from util import hook from utilities import request from bs4 import BeautifulSoup import re def parse(html): soup = BeautifulSoup(html, 'lxml') container = soup.find(attrs={'data-component-type': 's-search-results'}) if container is None: return [] results = cont...
FrozenPigs/Taigabot
plugins/amazon.py
Python
gpl-3.0
2,394
0.000835
#!/usr/bin/env python """ RDF Graph Isomorphism Tester Author: Sean B. Palmer, inamidst.com Uses the pyrple algorithm Requirements: Python2.4+ http://inamidst.com/proj/rdf/ntriples.py Usage: ./rdfdiff.py <ntriplesP> <ntriplesQ> """ import sys, re, urllib import ntriples from ntriples import bNode ntriples.r_uri...
MjAbuz/watchdog
vendor/rdflib-2.4.0/test/rdfdiff.py
Python
agpl-3.0
2,002
0.025475
# Generated from TacticNotations.g by ANTLR 4.7.2 from antlr4 import * from io import StringIO from typing.io import TextIO import sys def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\f") buf.write("f\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4...
Zimmi48/coq
doc/tools/coqrst/notations/TacticNotationsLexer.py
Python
lgpl-2.1
3,961
0.004292
# vim:ts=4:sw=4:sts=4:et # -*- coding: utf-8 -*- """Additional auxiliary data types""" from itertools import islice __license__ = """\ Copyright (C) 2006-2012 Tamás Nepusz <ntamas@gmail.com> Pázmány Péter sétány 1/a, 1117 Budapest, Hungary This program is free software; you can redistribute it and/or modify it unde...
igraph/xdata-igraph
interfaces/python/igraph/datatypes.py
Python
gpl-2.0
28,500
0.001334
# Copyright 2009 by Tiago Antao <tiagoantao@gmail.com>. All rights reserved. # 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. """ This module allows to control GenePop through an easier interface. ...
BlogomaticProject/Blogomatic
opt/blog-o-matic/usr/lib/python/Bio/PopGen/GenePop/EasyController.py
Python
gpl-2.0
6,648
0.007822
from setuptools import setup, find_packages from codecs import open # To use a consistent encoding from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup(...
duyuan11/ford
setup.py
Python
gpl-3.0
2,137
0.015442
from fixtures import * import cim def test_mapping_type_guess_xp(): ''' test automatic detection of winxp repositories. ''' repodir = os.path.join(os.path.dirname(__file__), 'repos') xpdir = os.path.join(repodir, 'xp') repopath = os.path.join(xpdir, 'mapping-only') assert cim.CIM.guess_c...
fireeye/flare-wmi
python-cim/tests/test_mapping.py
Python
apache-2.0
7,662
0.001044
import unittest class TestGetRestartMode(unittest.TestCase): def test_get_restart_mode(self): # self.assertEqual(expected, get_restart_mode(restart_file)) assert True # TODO: implement your test here class TestAmpServerFactory(unittest.TestCase): def test___init__(self): # amp_server_f...
GhostshipSoftware/avaloria
src/tests/test_server_amp.py
Python
bsd-3-clause
5,448
0.008443
# -*- coding: utf-8 -*- # Copyright 2010-2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this...
leighpauls/k2cro4
third_party/mozc/chrome/chromeos/renderer/litify_proto_file.py
Python
bsd-3-clause
2,506
0.005188
import numpy as np import matplotlib.pyplot as plt import csv read1 = [] read2 = [] with open('train.csv',"rb") as csvfile: read = csv.reader(csvfile) read.next() for row in read : if len(row) <= 1 : #data preprocessing c continue read1.append(row[0]) read2.append(...
tranpthuan/blabla
Cybercore/task1_cybercore.py
Python
gpl-3.0
1,320
0.018939
class Rectangle: def __init__(self, x=0, y=0, width=0, height=0): self.x = x self.y = y self.width = width self.height = height def intersect(self, src): pass def union(self, src): pass
lovelysystems/pyjamas
pyjs/src/pyjs/lib/gdk.py
Python
apache-2.0
248
0
import csv import matplotlib import matplotlib.pyplot as plt import numpy as np UCSD = 'UCSD' BUCKETS = [0.1, 0.2, 1.0, 10.0, 60.0 ] # range(500, 3001, 500) #COLORS=['#90B0D4', '#90D492', '#D4B490', '#D490D2'] COLORS=['#8dd3c7','#bebada','#ffffb3','#fb8072','#80b1d3','#fdb462'] COLORS_E=['#8dd3c7','#bebada','#80b1d3'...
ucsd-progsys/ml2
paper/oopsla17-cameraready/plots.py
Python
bsd-3-clause
4,957
0.009482
# -*- coding: utf-8 -*- from setuptools import setup, find_packages long_desc = ''' This package contains the actdiag Sphinx extension. .. _Sphinx: http://sphinx.pocoo.org/ .. _actdiag: http://blockdiag.com/en/actdiag/ This extension enable you to insert activity diagrams in your Sphinx document. Following code is ...
bboalimoe/ndn-cache-policy
docs/sphinx-contrib/actdiag/setup.py
Python
gpl-3.0
1,692
0
# coding: utf-8 import os import celery import logging from django.apps import apps from django.conf import settings # http://celery.readthedocs.org/en/latest/django/first-steps-with-django.html # Attempt to determine the project name from the directory containing this file PROJECT_NAME = os.path.basename(os.path.di...
kobotoolbox/kobocat
onadata/celery.py
Python
bsd-2-clause
1,357
0
import itertools import warnings import numpy as np from numpy import (arange, array, dot, zeros, identity, conjugate, transpose, float32) import numpy.linalg as linalg from numpy.random import random from numpy.testing import (assert_equal, assert_almost_equal, assert_, ...
WarrenWeckesser/scipy
scipy/linalg/tests/test_basic.py
Python
bsd-3-clause
62,678
0.000032
# -*- coding: utf-8 -*- """ Django settings for LittleSportsBiscuit project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ from __future__ import absolute_import,...
maninmotion/LittleSportsBiscuit
config/settings/common.py
Python
bsd-3-clause
9,768
0.001126
sql = [ #-- Make the node_change table contain more information, and force a resync """DROP TABLE revision;""", """DROP TABLE node_change;""", """CREATE TABLE revision ( rev text PRIMARY KEY, time integer, author text, message text );""", """CREATE TABLE node_chan...
dokipen/trac
trac/upgrades/db10.py
Python
bsd-3-clause
697
0.010043
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import import os import unittest import tempfile from flypy import jit from flypy.cppgen import cppgen @jit('C[x, y]') class C(object): layout = [('a', 'x'), ('b', 'y')] @jit('C[x, y] -> x') def first(self): return...
flypy/flypy
flypy/cppgen/tests/test_cppgen.py
Python
bsd-2-clause
907
0.005513
# Copyright 2015 Philipp Pahl, Sven Schubert, Daniel Britzger # # 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...
PeachstoneIO/peachbox
tutorials/tutorial_movie_reviews/model/master.py
Python
apache-2.0
3,918
0.015314
import _plotly_utils.basevalidators class LocationsValidator(_plotly_utils.basevalidators.DataArrayValidator): def __init__( self, plotly_name="locations", parent_name="isosurface.slices.z", **kwargs ): super(LocationsValidator, self).__init__( plotly_name=plotly_name, ...
plotly/python-api
packages/python/plotly/plotly/validators/isosurface/slices/z/_locations.py
Python
mit
476
0.002101
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # Copyright (c) 2016 France-IOI, MIT license # # http://opensource.org/licenses/MIT # This little script resets the build folder and the cache database import os, shutil # Local imports import schema_db from config_default import CFG_BUILDSDIR, CFG_CACHEDIR from conf...
France-ioi/taskgrader
cache_reset.py
Python
mit
680
0.001471
#!/usr/bin/env python # manage.py # # Copyright (C) 2008-2018 Veselin Penev, https://bitdust.io # # This file (manage.py) is part of BitDust Software. # # BitDust 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 Fou...
vesellov/bitdust.devel
manage.py
Python
agpl-3.0
1,152
0
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- # Note that PyPy contains also a built-in module 'md5' which will hide # this one if compiled in. """A sample implementation of MD5 in pure Python. This is an implementation of the MD5 hash function, as specified by RFC 1321, in pure Python. It was implemented using...
sauloal/pycluster
pypy-1.9_64/lib_pypy/_md5.py
Python
mit
12,905
0.01511
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
jcmgray/autoray
autoray/_version.py
Python
apache-2.0
18,445
0
# coding=utf-8 import base64 import zlib import json from sqlalchemy import Column, ForeignKey, Integer, String import sqlalchemy from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker Base = declarat...
Voldemort93/python
detect_remotes.py
Python
gpl-2.0
13,069
0.004438
#!/usr/bin/env python3 # Copyright 2019 The Kapitan Authors # SPDX-FileCopyrightText: 2020 The Kapitan Authors <kapitan-admins@googlegroups.com> # # SPDX-License-Identifier: Apache-2.0 "Project description variables" PROJECT_NAME = "kapitan" VERSION = '0.29.4' DESCRIPTION = "Generic templated configuration managemen...
ademariag/kapitan
kapitan/version.py
Python
apache-2.0
504
0.003968
# 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 may ...
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_virtual_routers_operations.py
Python
mit
24,260
0.005029
#!/usr/bin/env python """ conference.py -- Udacity conference server-side Python App Engine API; uses Google Cloud Endpoints $Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $ created by wesc on 2014 apr 21 """ __author__ = 'wesc+api@google.com (Wesley Chun)' from datetime import datetime import ...
SteveWooding/fullstack-nanodegee-conference
Lesson_3/00_Conference_Central/conference.py
Python
gpl-3.0
4,120
0.004126
import uuid import re import cPickle import pprint from django.db import models from django.conf import settings from django.contrib.auth.models import AnonymousUser from django.db.models.signals import m2m_changed, pre_delete from django.dispatch import receiver class APITree(object): def __init__(self): ...
feifangit/dj-api-auth
djapiauth/models.py
Python
gpl-2.0
4,372
0.003202
#!/usr/bin/python2.6 # -*- coding: utf-8 -*- # This file is a part of Metagam project. # # Metagam 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. # #...
JoyTeam/metagam
mg/test/testorm-2.py
Python
gpl-3.0
1,140
0.004386
# Produces the list of links to XML feeds as extracted from input list of generic URLs. # This script expects to have the file path passed as the only input parameter import re import sys import urllib.request from urllib.parse import urljoin urls_file = sys.argv[1] with open(urls_file) as f: urls_lines...
martinrotter/rssguard
resources/scripts/scrapers/search-xml-feeds.py
Python
gpl-3.0
979
0.017365
# -*- encoding: utf-8 -*- ############################################################################### # Module Writen to OpenERP, Open Source Management Solution # Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>). # All Rights Reserved ############# Credits ########################################...
lombritz/odoo
addons/pos_delivery_restaurant/wizard/__init__.py
Python
agpl-3.0
1,334
0.001499
"""Counter.py Part of the AQuA Cesium Controller software package author=Martin Lichtman created=2013-10-19 modified>=2015-05-11 This file holds everything to model a National Instruments DAQmx counter. It communicated to LabView via the higher up LabView(Instrument) class. Saving of returned data is handled...
QuantumQuadrate/CsPyController
python/Counter.py
Python
lgpl-3.0
19,978
0.005056
# Module tests # Copyright (c) 2014, Jouni Malinen <j@w1.fi> # # This software may be distributed under the terms of the BSD license. # See README for more details. import os import time import hostapd def test_module_wpa_supplicant(dev, apdev, params): """wpa_supplicant module tests""" if "OK" not in dev[0]...
s0lst1c3/eaphammer
local/hostapd-eaphammer/tests/hwsim/test_module_tests.py
Python
gpl-3.0
889
0.00225
import winsound #Import winsound library for winsound.Beep() function import time #Import time library for time.sleep() function morse_code = { #Dictionary containing each letter and their respective morse code "a" : [0,1], "b" : [1,0,0,0], "c" : [1,0,1,0], "d" : [1,0,0], "e" : [0], "f" : [0,0,1,0], "g" : [1,1,0...
MorseDecoder/Morse-Code-Project
Input/User Input.py
Python
gpl-3.0
1,443
0.11088
# -*- coding: utf-8 -*- # # papyon - a python client library for Msn # # Copyright (C) 2009 Collabora Ltd. # # 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 #...
billiob/papyon
papyon/media/conference.py
Python
gpl-2.0
12,851
0.003735
# -*- coding: utf-8 -*- """ logbook ~~~~~~~ Simple logging library that aims to support desktop, command line and web applications alike. :copyright: (c) 2010 by Armin Ronacher, Georg Brandl. :license: BSD, see LICENSE for more details. """ import os from logbook.base import LogRecord, Logger...
agustinhenze/logbook.debian
logbook/__init__.py
Python
bsd-3-clause
1,683
0.000594
#coding: utf-8 from fabric.api import * def instalacion(): run('sudo git clone https://github.com/Sergiopopoulos/IV-perezmolinasergio') run('cd IV-perezmolinasergio && sudo pip install -r requirements.txt') def ejecucion(): run('cd IV-perezmolinasergio && nohup sudo -E gunicorn app.wsgi -b 0.0.0.0:80 &', pty=Fa...
Sergiopopoulos/IV-perezmolinasergio
iaas/fabfile.py
Python
gpl-3.0
330
0.027273
# Copyright 2017 AT&T Corporation. # 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 require...
vedujoshi/tempest
tempest/tests/lib/services/identity/v3/test_endpoint_groups_client.py
Python
apache-2.0
5,681
0
import re, inspect, textwrap, pydoc import sphinx from docscrape import NumpyDocString, FunctionDoc, ClassDoc class SphinxDocString(NumpyDocString): def __init__(self, docstring, config=None): config = {} if config is None else config self.use_plots = config.get('use_plots', False) NumpyDoc...
cigroup-ol/metaopt
docs/_extensions/numpy_ext/docscrape_sphinx.py
Python
bsd-3-clause
7,924
0.001641
# -*- coding: utf-8 -*- try: from unittest import mock except ImportError: import mock from guessing import i18n @mock.patch.dict('guessing.i18n.environ', LC_MESSAGES='he_IL') def test_lang_lc_message_he(): assert i18n.lang() == 'he' def test_lang_default(): with mock.patch.dict('guessing.i18n.envi...
eliadl/talks
20170613-mock/code/ggee/tests/test_i18n.py
Python
gpl-3.0
2,534
0.002815
# -*- encoding: 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 Licens...
odoo-arg/odoo_l10n_ar
l10n_ar_account_payment/tests/test_account_payment.py
Python
agpl-3.0
15,283
0.003075
# -*- coding: utf-8 -*- """ Catch-up TV & More Copyright (C) 2016 SylvainCecchetto This file is part of Catch-up TV & More. Catch-up TV & More 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 Foundat...
SylvainCecchetto/plugin.video.catchuptvandmore
plugin.video.catchuptvandmore/resources/lib/skeletons/cn_replay.py
Python
gpl-2.0
1,406
0.000711
#coding=utf-8 import string, random, time from django.http import Http404 from django.shortcuts import render_to_response from django.template import RequestContext from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User import os def upload(request): file_path='%s_' %(st...
ShanghaitechGeekPie/LBlogger
LBlogger/LBlogger/part_upload.py
Python
gpl-2.0
809
0.069221
# -*- coding: utf-8 -*- """ hmacHash.py Implemention of Request for Comments: 2104 HMAC: Keyed-Hashing for Message Authentication HMAC is a mechanism for message authentication using cryptographic hash functions. HMAC can be used with any iterative cryptographic hash function, e.g., MD5, SHA-1, i...
TheDSCPL/SSRE_2017-2018_group8
Projeto/Python/cryptopy/crypto/keyedHash/hmacHash.py
Python
mit
3,613
0.014669
#!/bin/python # -*- coding: utf-8 -*- # Fenrir TTY screen reader # By Chrys, Storm Dragon, and contributers. from fenrirscreenreader.core import debug class command(): def __init__(self): pass def initialize(self, environment): self.env = environment def shutdown(self): ...
chrys87/fenrir
src/fenrirscreenreader/commands/commands/quit_fenrir.py
Python
lgpl-3.0
552
0.016304
import numpy as np from nlpaug.augmenter.spectrogram import SpectrogramAugmenter from nlpaug.util import Action import nlpaug.model.spectrogram as nms class LoudnessAug(SpectrogramAugmenter): """ Augmenter that change loudness on mel spectrogram by random values. :param tuple zone: Default value is (0.2...
makcedward/nlpaug
nlpaug/augmenter/spectrogram/loudness.py
Python
mit
1,919
0.00938
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import models, fields, api class MrpRepair(...
esthermm/odoomrp-wip
mrp_repair_full_editable/models/mrp_repair.py
Python
agpl-3.0
755
0
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). """Generate Java targets from Thrift. See https://thrift.apache.org. """ from pants.backend.codegen.thrift.java.apache_thrift_java_gen import ApacheThriftJavaGen from pants.backend.codeg...
tdyas/pants
src/python/pants/backend/codegen/thrift/java/register.py
Python
apache-2.0
874
0.002288
class DataClassFileTests(): def test_functionName1_test_case_4(self): # Given: First test function line one obj = new aClass() expected = "Some result" parameter1 = False # When: First test function line two result = obj.functionName1(parameter1) ...
anconaesselmann/ClassesAndTests
classes_and_testsTest/DocumentationFromUnitTestsTestData/DataSet4_py_ClassFileTest.py
Python
mit
1,206
0.008292
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-04-17 09:46 from __future__ import unicode_literals from django.db import migrations, models import documents.models class Migration(migrations.Migration): dependencies = [ ('documents', '0002_auto_20160417_0749'), ] operations = [ ...
C4ptainCrunch/info-f-309
webview/documents/migrations/0003_auto_20160417_0946.py
Python
agpl-3.0
541
0.001848
""" 22. Using properties on models Use properties on models just like on any other Python object. """ from django.db import models class Person(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) def _get_full_name(self): return "%s %s" % (self...
mzdaniel/oh-mainline
vendor/packages/Django/tests/modeltests/properties/models.py
Python
agpl-3.0
567
0.001764
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Run Regression Test Suite This module calls down into individual test cases via subprocess. It will ...
ediston/energi
qa/pull-tester/rpc-tests.py
Python
mit
8,724
0.003324
#!/usr/bin/env python2.7 # -*- coding:utf-8 -*- # # Copyright (c) 2017 by Tsuyoshi Hamada. All rights reserved. # import os import logging as LG import random import commands import shelve import pickle import sys import hashlib import re as REGEXP # -- set encode for your terminal -- config_term_encode = 'euc-jp' # ...
thamada/tool-private
commi.py
Python
mit
5,969
0.005726
#!/usr/bin/python2 # -*- coding: utf-8 -*- """Convert markdown to zim wiki syntax. Stripped and modified from markdown2.py Syntax converted: type Markdown -> Zim ---------------------------------------------------- Heading1 # heading ===== heading ===== Head...
Xunius/evernote2zim
lib/markdown2zim.py
Python
gpl-3.0
43,705
0.004896
#!/usr/bin/env python """ Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://pythonhosted.org/setuptools/easy_install.html """ impo...
cortext/crawtextV2
~/venvs/crawler/lib/python2.7/site-packages/setuptools/command/easy_install.py
Python
mit
74,243
0.002667
from __future__ import absolute_import from sentry.grouping.component import GroupingComponent from sentry.grouping.strategies.base import strategy def _security_v1(reported_id, obj): return GroupingComponent( id=reported_id, values=[ GroupingComponent(id="salt", values=[reported_id])...
mvaled/sentry
src/sentry/grouping/strategies/security.py
Python
bsd-3-clause
1,936
0.002583
# 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 agreed to in writing, softw...
akash1808/oslo.log
oslo_log/fixture/__init__.py
Python
apache-2.0
665
0
# -*- coding: utf-8 -*- # # Whitespace Evaluation SofTware documentation build configuration file, created by # sphinx-quickstart on Wed Jul 9 13:12:12 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # au...
kate-harrison/west
documentation/conf.py
Python
gpl-2.0
9,688
0.008567
import re import six from six import BytesIO import gzip def gzip_decompress(data): if six.PY2: in_io = BytesIO() in_io.write(data.read()) in_io.seek(0) return BytesIO(gzip.GzipFile(fileobj=in_io, mode='rb').read()) else: return BytesIO(gzip.decompress(data.read())) ...
ayemos/osho
akagi/utils.py
Python
mit
414
0
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.render_map, name='render_map'), url(r'^getData/$', views.get_data, name='get_data'), url(r'^saveDroneData/$', views.save_drone_data, name='save_drone_data'), url(r'^saveBeaconData/$', views.save_beacon_data, name='sa...
bladekp/DroniadaDjangoDronekitAPP
app/maps/urls.py
Python
mit
339
0.00295
""" Testing for Support Vector Machine module (sklearn.svm) TODO: remove hard coded numerical results when possible """ import numpy as np import itertools from numpy.testing import assert_array_equal, assert_array_almost_equal from numpy.testing import assert_almost_equal from numpy.testing import assert_allclose fro...
jaidevd/scikit-learn
sklearn/svm/tests/test_svm.py
Python
bsd-3-clause
35,876
0.000167
#!usr/bin/python # -*- coding:utf-8 -*- from osv import osv,fields import time from datetime import datetime from dateutil import rrule class qingjia_calendar(osv.osv): _name='qingjia.calendar' _columns={ 'start_date':fields.datetime('start_date'), 'end_date':fields.datetime('end...
alangwansui/mtl_ordercenter
openerp/addons/001_qingjia/qingjia_calendar.py
Python
agpl-3.0
2,648
0.047205
from __future__ import (absolute_import, division, print_function, unicode_literals) import matplotlib as mpl import matplotlib.pyplot as plt from .theme import theme_base class theme_xkcd(theme_base): """ xkcd theme The theme internaly uses the settings from pyplot.xkcd(). ""...
yhat/ggplot
ggplot/themes/theme_xkcd.py
Python
bsd-2-clause
1,582
0.001264
from sage.misc.functional import symbolic_sum from sage.calculus import var def from_pattern_family_10j_1(j, variable=var('t')): """ This function allow to build a pair of functions (d, h) to build a Riordan array for the pattern family (10)**j1, for a given j. """ def make_sum(from_index): ...
massimo-nocentini/master-thesis
sympy/riordan_avoiding_patterns.py
Python
mit
2,308
0.009532
#!/usr/bin/python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "Lic...
ervinyang/tutorial_zookeeper
zookeeper-trunk/src/contrib/zkpython/src/test/get_set_test.py
Python
mit
8,748
0.00583
"""Functions to plot raw M/EEG data """ from __future__ import print_function # Authors: Eric Larson <larson.eric.d@gmail.com> # Jaakko Leppakangas <jaeilepp@student.jyu.fi> # # License: Simplified BSD import copy from functools import partial import numpy as np from ..externals.six import string_types fro...
wronk/mne-python
mne/viz/raw.py
Python
bsd-3-clause
33,845
0
#!/usr/bin/env python # encoding: utf-8 # author: www.n0tr00t.com import sys import glob import json import chardet import requests import urlparse import argparse import multiprocessing from common.color import * from common.output import * from collections import OrderedDict def check(plugin, passport, passport_t...
n0tr00t/Sreg
sreg.py
Python
mit
6,889
0.002177
import time import thread import pygame import input from menu.menuitems import create_menu_items from screenfactory import create_screen from server import interface from helpers import * os.chdir(os.path.dirname(os.path.realpath(__file__))) S = Settings() S.load() class Menu(object): def __init__(self, scree...
derblub/pixelpi
menu.py
Python
mit
6,460
0.002632
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 12, transform = "Anscombe", sigma = 0.0, exog_count = 20, ar_order = 0);
antoinecarme/pyaf
tests/artificial/transf_Anscombe/trend_MovingMedian/cycle_12/ar_/test_artificial_32_Anscombe_MovingMedian_12__20.py
Python
bsd-3-clause
266
0.086466
#------------------------------------------------------------------------------ # Copyright (c) 2013, Nucleic Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #-------------------------------------------------...
ContinuumIO/ashiba
enaml/enaml/qt/qt_color_dialog.py
Python
bsd-3-clause
5,551
0.001441
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080 # sudo sysctl -w net.ipv4.ip_forward=1 from libmproxy.protocol.http import decoded def response(context, flow): with decoded(flow.response): # automatically decode gzipped res...
xiilei/pytools
mitm-savecookies.py
Python
apache-2.0
702
0.011396
from collections import namedtuple import threading import queue from logging import getLogger import time import socket import os import textwrap import signal import importlib import pkgutil import re import sys import glob import functools from concurrent.futures import ThreadPoolExecutor from sauna import plugins,...
NicolasLM/sauna
sauna/__init__.py
Python
bsd-2-clause
15,099
0
import sys import tarfile import os import os.path from optparse import OptionParser import fixup_python_path from engage.engine.engage_file_layout import get_engine_layout_mgr from engage.engine.cmdline_script_utils import add_standard_cmdline_options, process_standard_options from engage.utils.log_setup import se...
quaddra/engage
python_pkg/engage/engine/create_distribution.py
Python
apache-2.0
4,538
0.003967
# # Model Comment # from sqlalchemy import Column, Integer, String, Boolean, Sequence from sqlalchemy import BigInteger, Date, DateTime, Float, Numeric from pow_comments.powlib import relation from pow_comments.sqldblib import Base #@relation.has_many("<plural_other_models>") @relation.is_tree() @relation.setup_schem...
pythononwheels/pow_clean
start/stuff/comment.py
Python
mit
1,289
0.013964
from django import forms from django.contrib.auth.models import User from harnas.userprofile.models import UserProfile class UserProfileEditForm(forms.ModelForm): class Meta: model = UserProfile fields = ('organization', 'personal_page', 'show_email', 'show_age') class UserFieldsForm(forms.Model...
harnasproject/harnas
harnas/userprofile/forms.py
Python
agpl-3.0
409
0
# -*- coding: utf-8 -*- # # This file is part of CERN Analysis Preservation Framework. # Copyright (C) 2016 CERN. # # CERN Analysis Preservation Framework 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...
tiborsimko/analysis-preservation.cern.ch
cap/modules/deposit/api.py
Python
gpl-2.0
22,465
0
# 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 ...
Azure/azure-sdk-for-python
sdk/applicationinsights/azure-applicationinsights/azure/applicationinsights/models/events_application_info_py3.py
Python
mit
917
0.002181
# 'Data Science from Scratch' Chapter 1 exampl # Create list of users userNames = ["Hero", "Dunn", "Sue", "Chi", "Thor", "Clive", "Hicks", "Devin", "Kate", "Klein"] users = [] for ind, name in enumerate( userNames ): users.append( {"id": ind, "name": name}) # Helper function to get id get_id = lambda userlist...
mattmcd/PyAnalysis
scripts/dsfs_chapter01.py
Python
apache-2.0
3,086
0.021063
#!/usr/bin/env python ''' NIK-HDREfexPro2.py Mod of ShellOut.py focused on getting Google NIK to work. ShellOut call an external program passing the active layer as a temp file. Tested only in Ubuntu 16.04 with Gimp 2.9.5 (git) with Nik Collection 1.2.11 Author: Erico Porto on top of the work of Rob Antonishen Benoi...
draekko-rand/nik_on_gimp
plug-ins/NIK-HDREfexPro2.py
Python
apache-2.0
4,466
0.016346
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
cg31/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/operator_pd_full_test.py
Python
apache-2.0
2,294
0.008718
import unittest from rx.observable import Observable from rx.testing import TestScheduler, ReactiveTest from rx.disposables import Disposable, SerialDisposable on_next = ReactiveTest.on_next on_completed = ReactiveTest.on_completed on_error = ReactiveTest.on_error subscribe = ReactiveTest.subscribe subscribed = React...
dbrattli/RxPY
tests/test_observable/test_windowwithcount.py
Python
apache-2.0
3,069
0.002607
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from numpy import zeros, concatenate, array, where, ndarray, sort, ones, all from opus_core.misc import unique from opus_core.choice_model import ChoiceModel from opus_core.samplers.constants import NO...
christianurich/VIBe2UrbanSim
3rdparty/opus/src/opus_core/hierarchical_choice_model.py
Python
gpl-2.0
12,765
0.010576
# -*- coding: utf-8 -*- # python-holidays # --------------- # A fast, efficient Python library for generating country, province and state # specific sets of holidays on the fly. It aims to make determining whether a # specific date is a holiday as fast and flexible as possible. # # Authors: dr-prodigy <maurizio....
ryanss/holidays.py
holidays/countries/mozambique.py
Python
mit
2,356
0
# -*- coding: utf-8 -*- """Get the pollen count for a UK postcode.""" import dave.module from bs4 import BeautifulSoup from requests import get from twisted.words.protocols.irc import assembleFormattedText, attributes as A import dave.config @dave.module.help("Syntax: pollen [first part of postcode]. Get the forecast...
w4/belle
dave/modules/pollen.py
Python
gpl-3.0
1,618
0.003708
## 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 ## ## https://www.apache.org/licenses/LICENSE-2.0 ## ## Unless required by applicable law or agreed to in ...
google-business-communications/bm-snippets-python
send-message-suggested-action-dial.py
Python
apache-2.0
3,227
0.007127
############################################################################## # # Copyright (c) 2001, 2002, 2009 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution...
mdworks2016/work_development
Python/05_FirstPython/Chapter9_WebApp/fppython_develop/lib/python3.7/site-packages/zope/interface/tests/test_registry.py
Python
apache-2.0
109,233
0.00162
# Copyright (c) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
axinging/chromium-crosswalk
third_party/WebKit/Tools/Scripts/webkitpy/common/system/systemhost_mock.py
Python
bsd-3-clause
3,090
0.000647
# Copyright (c) Mathias Kaerlev # See LICENSE for details. import os from chowdren.image import Image from chowdren.common import IDPool from chowdren.object import get_objects from chowdren.data import CodeData class ProjectManager(object): base_dir = None def __init__(self, directory = None): self....
matpow2/gamedev-old
chowdren/project.py
Python
bsd-2-clause
2,297
0.002177