repo_name
stringlengths
5
100
path
stringlengths
4
299
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1.03M
license
stringclasses
15 values
hash
int64
-9,223,351,895,964,839,000
9,223,297,778B
line_mean
float64
3.17
100
line_max
int64
7
1k
alpha_frac
float64
0.25
0.98
autogenerated
bool
1 class
lindakukolich/sensor_data_exploration
sensor_data_exploration/data_collection/beacon_buoy_addData.py
1
4451
#! /usr/bin/env python # 15.January.2014 Liz Brooks # script to add SensorData values to the database # from Beacon Buoys # (run with -h to see full usage message) # as new sensors are added, add them to the list of sensors (keys) in main. import sys import argparse import urllib2 from datetime import datetime,tzinfo...
mit
3,915,266,116,321,284,600
33.503876
122
0.600764
false
gangadhar-kadam/mic-erpnext
accounts/page/accounts_browser/accounts_browser.py
5
1909
from __future__ import unicode_literals import webnotes import webnotes.defaults from webnotes.utils import flt from accounts.utils import get_balance_on @webnotes.whitelist() def get_companies(): """get a list of companies based on permission""" # check if match permission exists res = webnotes.conn.sql("""selec...
agpl-3.0
-8,040,449,826,540,733,000
31.355932
106
0.65846
false
liukaijv/XlsxWriter
xlsxwriter/test/workbook/test_workbook01.py
8
1641
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # import unittest from ...compatibility import StringIO from ..helperfunctions import _xml_to_list from ...workbook import Workbook class TestAssem...
bsd-2-clause
-1,727,182,614,204,291,000
32.489796
170
0.551493
false
drpngx/tensorflow
tensorflow/python/training/adagrad_test.py
11
13233
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
9,010,061,881,076,805,000
42.104235
80
0.617471
false
codekansas/liveqa2017
liveqa/vertical/indexing.py
1
6517
from unidecode import unidecode from whoosh.analysis import StemmingAnalyzer from whoosh.index import create_in, open_dir, exists_in from whoosh.writing import AsyncWriter from whoosh.fields import * from whoosh.qparser import QueryParser, MultifieldParser, syntax import os.path import logging BASE = os.path.dirname...
gpl-3.0
2,524,822,915,073,584,000
30.790244
79
0.552095
false
RPGOne/Skynet
imbalanced-learn-master/imblearn/under_sampling/tests/test_nearmiss_2.py
1
6280
"""Test the module nearmiss.""" from __future__ import print_function import os import numpy as np from numpy.testing import assert_raises from numpy.testing import assert_equal from numpy.testing import assert_array_equal from numpy.testing import assert_warns from sklearn.datasets import make_classification from s...
bsd-3-clause
2,205,732,359,631,018,200
29.485437
75
0.652389
false
gooddata/openstack-nova
nova/ipv6/account_identifier.py
12
1904
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
apache-2.0
2,200,847,843,023,396,900
33.618182
78
0.684874
false
vrutkovs/beehive
beehive/formatter/reproducer.py
1
5536
# -*- coding: utf-8 -*- from beehive.formatter.base import Formatter import inspect import re import types import os try: import importlib except ImportError: pass class ReproducerFormatter(Formatter): name = "reproducer" description = "Script creating formatter" def __init__(self, stream_open...
bsd-2-clause
2,825,924,656,878,789,600
33.6
98
0.563945
false
dvliman/jaikuengine
.google_appengine/lib/django-1.2/tests/modeltests/unmanaged_models/tests.py
43
2187
from django.test import TestCase from django.db import connection from models import Unmanaged1, Unmanaged2, Managed1 from models import A01, A02, B01, B02, C01, C02 class SimpleTests(TestCase): def test_simple(self): """ The main test here is that the all the models can be created without ...
apache-2.0
-5,822,228,236,947,279,000
36.706897
94
0.629172
false
akuks/pretix
src/tests/base/test_i18n.py
3
3926
from django.test import TestCase from django.utils import translation from django.utils.timezone import now from pretix.base.i18n import LazyI18nString from pretix.base.models import Event, ItemCategory, Organizer class I18nStringTest(TestCase): """ This test case tests the LazyI18nString class """ ...
apache-2.0
-6,858,432,299,231,836,000
30.408
73
0.534641
false
thaumos/ansible
lib/ansible/module_utils/docker/common.py
8
39414
# # Copyright 2016 Red Hat | Ansible # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ...
gpl-3.0
-8,445,795,930,743,039,000
39.136456
156
0.55323
false
devendermishrajio/nova
nova/objects/instance_group.py
1
10292
# Copyright (c) 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
-7,126,459,705,232,050,000
39.046693
79
0.610668
false
vipjml/python-driver
tests/integration/standard/test_connection.py
2
13526
# Copyright 2013-2016 DataStax, 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 writi...
apache-2.0
6,823,360,571,779,303,000
33.156566
129
0.605353
false
zaqwes8811/matlab_ext
measurement/mc-assistant/projects/py_hw_models/shift_correction_model.py
1
5592
#-*- coding: utf-8 -*- """ Convention : cu - conventional unit - условная единица - шаг """ import sys import math # Other import convertors_simple_data_types.xintyy_type_convertors as tc import convertors_simple_data_types.float32_convertors as f32conv from py_dbg_toolkit.doColoredConsole import co import u...
apache-2.0
-3,052,068,157,021,306,400
28.527273
106
0.574713
false
MSeifert04/numpy
numpy/distutils/fcompiler/compaq.py
4
4109
#http://www.compaq.com/fortran/docs/ from __future__ import division, absolute_import, print_function import os import sys from numpy.distutils.fcompiler import FCompiler from numpy.distutils.compat import get_exception from distutils.errors import DistutilsPlatformError compilers = ['CompaqFCompiler'] if os.name !...
bsd-3-clause
-509,323,686,165,539,700
31.611111
82
0.55926
false
cfelton/rhea
examples/boards/de0nano/converters/de0nano_converters.py
1
4159
""" This example uses the A/D converter and the accelerometer. The example retrieves the samples from the converters and ... """ from __future__ import division import myhdl from myhdl import (Signal, intbv, always_comb, always_seq, always, TristateSignal, concat, instances) from rhea.system impo...
mit
-4,251,928,756,813,380,000
28.920863
72
0.620101
false
enjaz/enjaz
newhpc/views.py
2
14753
# -*- coding: utf-8 -*- from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.shortcuts import get_object_or_404 from django.views.decorators import csrf from django.http import JsonResponse from django.shortcuts import render from core import decorat...
agpl-3.0
-8,234,721,806,613,222,000
37.023196
246
0.664204
false
58daojia-dba/mysqlbinlog_flashback
pymysqlreplication/column.py
1
3452
# -*- coding: utf-8 -*- import struct from .constants import FIELD_TYPE class Column(object): """Definition of a column """ def __init__(self, *args, **kwargs): if len(args) == 3: self.__parse_column_definition(*args) else: self.__dict__.update(kwargs) def _...
apache-2.0
-3,951,002,800,386,004,000
37.355556
88
0.554751
false
IwraStudios/NoSSL
sslstrip2-master/build/lib.linux-i686-2.7/sslstrip/ServerConnection.py
10
6461
# Copyright (c) 2004-2009 Moxie Marlinspike # # 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 program is distri...
gpl-3.0
-7,475,276,025,798,142,000
36.346821
110
0.609658
false
nachandr/cfme_tests
cfme/tests/automate/test_common_methods.py
2
15900
"""This module contains tests that test the universally applicable canned methods in Automate.""" from datetime import date from datetime import timedelta from textwrap import dedent import fauxfactory import pytest from widgetastic.utils import partial_match from widgetastic_patternfly import CandidateNotFound from ...
gpl-2.0
-4,176,466,714,598,073,300
35.054422
100
0.641006
false
googleinterns/stampify
extraction/content_extractors/embedded_instagram_post_extractor.py
1
1491
"""This script checks whether DOM has embedded instagram post tag or not and creates and returns the EInstagramPost object""" from urllib.parse import urlparse import bs4 from data_models.embedded_instagram_post import EInstagramPost from extraction.content_extractors.interface_content_extractor import \ IConten...
apache-2.0
-1,494,846,459,844,300,800
36.275
75
0.589537
false
google/grr
grr/client/grr_response_client/gcs_test.py
1
7459
#!/usr/bin/env python import io import time from unittest import mock from absl.testing import absltest import portpicker from requests import exceptions import responses from grr_response_client import gcs from grr.test_lib import gcs_test_lib class UploadSessionTest(absltest.TestCase): def testOpenIncorrectURL...
apache-2.0
7,925,162,750,375,830,000
30.209205
78
0.70787
false
CLVsol/odoo_addons
clv_insured_mng/role/__init__.py
5
1423
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
agpl-3.0
442,853,416,153,108,030
70.15
80
0.406887
false
clayg/swift
swift/common/exceptions.py
6
5464
# Copyright (c) 2010-2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
5,727,988,254,764,160,000
18.941606
79
0.644949
false
mchome/drcom-generic
drcom_d_config.py
1
1705
# -*- coding: utf-8 -*- """ Created on Wed Dec 03 23:45:49 2014 @author: latyas """ from binascii import hexlify import re def hexed(s): ret = '' for i in s: ret += '\\x' + hex(ord(i))[2:].rjust(2, '0') return ret filename = '998' f = open(filename, 'rb') text = f.read() offset = re.search('\xf0...
agpl-3.0
-2,382,771,327,867,114,000
38.651163
125
0.629912
false
hmcmooc/muddx-platform
lms/djangoapps/bulk_email/tests/test_models.py
3
5892
""" Unit tests for bulk-email-related models. """ from django.test import TestCase from django.core.management import call_command from django.conf import settings from student.tests.factories import UserFactory from mock import patch from bulk_email.models import CourseEmail, SEND_TO_STAFF, CourseEmailTemplate, Cou...
agpl-3.0
-1,810,809,775,772,614,400
38.810811
98
0.668534
false
miselin/grpc
src/python/grpcio/grpc/framework/face/interfaces.py
2
23418
# Copyright 2015, 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 f...
bsd-3-clause
6,527,837,977,558,582,000
35.936909
82
0.718507
false
brchiu/tensorflow
tensorflow/python/training/input_test.py
2
94178
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
1,367,426,583,450,489,900
39.769697
80
0.622927
false
richard-chen-1985/shadowsocks
shadowsocks/tcprelay.py
2
28752
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2015 clowwindy # # 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...
mit
1,526,666,457,885,069,600
39.552891
79
0.53805
false
allenai/deep_qa
tests/training/multi_gpu_test.py
2
1929
# pylint: disable=no-self-use,invalid-name from copy import deepcopy import keras.backend as K from deep_qa.common.params import Params from deep_qa.models.text_classification import ClassificationModel from deep_qa.testing.test_case import DeepQaTestCase class TestMultiGpu(DeepQaTestCase): def setUp(self): ...
apache-2.0
-7,753,536,033,354,599,000
36.096154
102
0.667185
false
elysium001/zamboni
mkt/fireplace/serializers.py
7
3426
from django.template.defaultfilters import filesizeformat from rest_framework import serializers from mkt.webapps.serializers import SimpleAppSerializer, SimpleESAppSerializer from mkt.websites.serializers import ESWebsiteSerializer, WebsiteSerializer class BaseFireplaceAppSerializer(object): def get_icons(self...
bsd-3-clause
-7,606,160,218,187,882,000
37.066667
79
0.639229
false
veger/ansible
lib/ansible/executor/play_iterator.py
9
27180
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
-2,962,201,180,798,236,000
46.768014
149
0.563355
false
wadetb/tinynumpy
docs/ext/docscrape_sphinx.py
9
7751
import re import inspect import textwrap import pydoc import sphinx from docscrape import NumpyDocString, FunctionDoc, ClassDoc class SphinxDocString(NumpyDocString): def __init__(self, docstring, config={}): self.use_plots = config.get('use_plots', False) NumpyDocString.__init__(self, docstring,...
mit
-3,323,854,367,741,622,000
31.567227
78
0.475164
false
NCBI-Hackathons/Structural_Variant_Comparison
py/make_gvf_and_bedgraph.py
1
4465
#!/bin/bash # Authors: Yan Kai, Jeffery Hsu # GRCh38 import sys,re,os from optparse import OptionParser import pandas as pd import HTSeq def inner_outer_pref(line, suffix): ''' Preferences outer + suffix -> suffix -> inner + suffix ''' prefix = ['inner_', '', 'outer_'] test = [i + suffix for i in...
cc0-1.0
483,102,440,489,157,400
33.346154
166
0.576484
false
molobrakos/home-assistant
homeassistant/components/tahoma/scene.py
7
1181
"""Support for Tahoma scenes.""" import logging from homeassistant.components.scene import Scene from . import DOMAIN as TAHOMA_DOMAIN _LOGGER = logging.getLogger(__name__) def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Tahoma scenes.""" controller = hass.data[TAHOMA_DOM...
apache-2.0
-8,298,200,972,585,649,000
27.804878
68
0.656224
false
spcui/tp-qemu
qemu/tests/rv_video.py
5
2415
""" rv_video.py - Starts video player Video is played in a loop, usually kill_app test should be called later to close totem. Requires: binaries Xorg, totem, gnome-session Test starts video player """ import logging import os from virttest import utils_misc, remote def launch_totem(guest_session, params):...
gpl-2.0
3,130,335,405,542,363,000
27.411765
68
0.615321
false
loisaidasam/gensim
gensim/test/simspeed2.py
14
6388
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ USAGE: %(program)s CORPUS_DENSE.mm CORPUS_SPARSE.mm [NUMDOCS] Run speed test of similarity queries. Only use the first NUMDOCS d...
lgpl-2.1
-3,182,038,977,800,247,000
44.304965
123
0.615842
false
wkrzemien/DIRAC
DataManagementSystem/scripts/dirac-dms-change-replica-status.py
4
1594
#! /usr/bin/env python ######################################################################## # $HeadURL$ ######################################################################## from __future__ import print_function __RCSID__ = "$Id$" from DIRAC import exit as DIRACExit from DIRAC.Core.Base import Scrip...
gpl-3.0
2,460,868,614,277,936,600
26.016949
87
0.61857
false
TaylorOshan/pysal
pysal/network/network.py
5
42024
from collections import defaultdict, OrderedDict import math import os import cPickle import copy import numpy as np import pysal as ps from pysal.weights.util import get_ids from analysis import NetworkG, NetworkK, NetworkF import util __all__ = ["Network", "PointPattern", "NetworkG", "NetworkK", "NetworkF"] clas...
bsd-3-clause
1,811,475,940,539,009,500
34.225482
102
0.519608
false
edx-solutions/edx-platform
openedx/core/djangoapps/zendesk_proxy/tests/test_v0_views.py
4
3905
"""Tests for zendesk_proxy views.""" from copy import deepcopy import json import ddt from django.urls import reverse from django.test.utils import override_settings from mock import MagicMock, patch import six from six.moves import range from openedx.core.djangoapps.zendesk_proxy.v0.views import ZENDESK_REQUESTS_P...
agpl-3.0
-3,823,738,162,767,136,300
35.839623
119
0.544686
false
michaelhowden/eden
modules/s3/s3codecs/pdf.py
4
56741
# -*- coding: utf-8 -*- """ S3 Adobe PDF codec @copyright: 2011-15 (c) Sahana Software Foundation @license: MIT 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 ...
mit
-3,412,044,667,830,531,600
38.348821
123
0.482649
false
McDermott-Group/LabRAD
LabRAD/TestScripts/fpgaTest/conf.py
1
1676
import os if __file__ in [f for f in os.listdir('.') if os.path.isfile(f)]: # This is executed when the script is loaded by the labradnode. SCRIPT_PATH = os.path.dirname(os.getcwd()) else: # This is executed if the script is started by clicking or # from a command line. SCRIPT_PATH = os.path.dirname...
gpl-2.0
-6,430,066,248,594,097,000
37.113636
104
0.711217
false
PGower/PNS
pns_web/endpoint/views.py
1
4796
from endpoint.models import Mapping, Fullname from django.shortcuts import render, get_object_or_404 from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.exceptions import APIException from rest_framework import viewsets from endpoint.serializers import MappingSeri...
gpl-2.0
6,975,290,168,174,774,000
34.007299
125
0.617389
false
clarinsi/csmtiser
setup.py
1
1140
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='csmtiser', version='0.0.1', pac...
lgpl-3.0
3,668,026,125,777,071,600
32.529412
88
0.642982
false
DimStar77/osc
osc/core.py
1
290542
# Copyright (C) 2006 Novell Inc. All rights reserved. # This program is free software; it may be used, copied, modified # and distributed under the terms of the GNU General Public Licence, # either version 2, or version 3 (at your option). from __future__ import print_function __version__ = '0.159git' # __store_ver...
gpl-2.0
-316,398,223,788,239,000
37.421317
364
0.551383
false
jcmgray/autoray
tests/test_autocompile.py
1
2460
import pytest from autoray import do, autojit, infer_backend, to_numpy from .test_autoray import BACKENDS, gen_rand from numpy.testing import assert_allclose BACKENDS = [ p for p in BACKENDS if p.values[0] in ("jax", "torch", "tensorflow") ] def modified_gram_schmidt(X): Q = [] for j in range(0, X.sha...
apache-2.0
5,361,797,290,353,655,000
26.333333
78
0.576016
false
send2zhao/boilerplate
flack/events.py
2
2062
from flask import g, session from . import db, socketio, celery from .models import User, Message from .auth import verify_token def push_model(model): """Push the model to all connected Socket.IO clients.""" socketio.emit('updated_model', {'class': model.__class__.__name__, ...
mit
6,596,085,107,764,467,000
28.457143
78
0.621242
false
rdeits/director
src/python/ddapp/affordanceurdf.py
6
2352
from ddapp import transformUtils from ddapp import affordanceitems from urdf_parser_py import urdf def geometryFromAffordance(aff): if isinstance(aff, affordanceitems.SphereAffordanceItem): radius = aff.getProperty('Radius') return urdf.Sphere(radius=radius) if isinstance(aff, affordanceitem...
bsd-3-clause
7,587,478,557,699,453,000
33.588235
102
0.741922
false
mibanescu/pulp
client_admin/test/unit/test_admin_exception_handler.py
15
5327
import mock from pulp.bindings import exceptions as bindings_exceptions from pulp.client.admin.exception_handler import AdminExceptionHandler from pulp.client.extensions import exceptions from pulp.client.extensions.core import TAG_FAILURE, TAG_PARAGRAPH from pulp.common import auth_utils from pulp.devel.unit import b...
gpl-2.0
-7,532,193,940,021,664,000
37.601449
95
0.689131
false
bretttegart/treadmill
tests/services/cgroup_service_test.py
1
6817
"""Unit test for cgroup_service - Treadmill cgroup service. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os import tempfile import unittest import select import shutil # Disable W0611: Unused import imp...
apache-2.0
7,435,463,282,362,125,000
33.256281
78
0.603638
false
GaloisInc/hacrypto
src/Tools/FigureOfMerit/FigureOfMerit/BlockCiphers/Scenario2/SelectedCipher.py
1
18374
# # University of Luxembourg # Laboratory of Algorithmics, Cryptology and Security (LACS) # # FigureOfMerit (FOM) # # Copyright (C) 2015 University of Luxembourg # # Written in 2015 by Daniel Dinu <dumitru-daniel.dinu@uni.lu> # # This file is part of FigureOfMerit. # # This program is free software: you can redistribut...
bsd-3-clause
-5,239,676,012,041,426,000
40.664399
106
0.525852
false
douglaskastle/mezzanine
mezzanine/accounts/__init__.py
34
3211
""" Provides features for non-staff user accounts, such as login, signup with optional email verification, password reset, and integration with user profiles models defined by the ``AUTH_PROFILE_MODULE`` setting. Some utility functions for probing the profile model are included below. """ from __future__ import unicode...
bsd-2-clause
2,782,236,874,298,456,000
34.677778
78
0.655559
false
DinoCow/airflow
tests/api_connexion/test_parameters.py
7
4550
# 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 # "License"); you may not u...
apache-2.0
8,364,605,682,604,583,000
35.99187
97
0.689451
false
eXcomm/cjdns
contrib/python/cjdnsadminmaker.py
6
3533
#!/usr/bin/env python import json import os import sys import subprocess # possibly search for running cjdroute processes and check the same folder as they're in # and/or running find on the home folder ## Wanted: Everyone's favorite place to store their shit. conflocations = ["/etc/cjdroute.conf", os.getenv("H...
gpl-3.0
4,681,896,428,260,077,000
32.971154
109
0.57062
false
gaberger/napalm-brocade-fastiron
napalm_brocade_fastiron/fastiron.py
1
4284
# Copyright 2017 Brocade Communications. All rights reserved. # # The contents of this file are 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 # # ...
apache-2.0
2,448,725,534,546,563,000
33.837398
113
0.568861
false
nkmk/python-snippets
notebook/pandas_read_excel.py
1
2434
import pandas as pd print(pd.__version__) # 1.2.2 df = pd.read_excel('data/src/sample.xlsx', index_col=0) print(df) # A B C # one 11 12 13 # two 21 22 23 # three 31 32 33 print(type(df)) # <class 'pandas.core.frame.DataFrame'> df_sheet_index = pd.read_excel('data/src/sample.xlsx', sheet_nam...
mit
1,928,512,420,426,944,000
22.862745
93
0.595316
false
sdiehl/numpush
setup.py
1
3346
import os import shutil import numpy as np from os.path import join as pjoin from distutils.core import setup, Command from distutils.extension import Extension from Cython.Distutils import build_ext extensions = [ Extension( "numpush.posix_io.iothread", ["numpush/posix_io/iothread.pyx"], ...
mit
-6,841,776,423,473,508,000
27.598291
79
0.532576
false
cdecker/bitcoin
test/functional/wallet_watchonly.py
21
4426
#!/usr/bin/env python3 # Copyright (c) 2018-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test createwallet arguments. """ from test_framework.test_framework import BitcoinTestFramework from t...
mit
-5,429,415,796,840,428,000
40.754717
126
0.678943
false
neilhan/python_cv_learning
10-back_projection/run_me.py
1
1472
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Testing split image? I don't remember what I was doing this for. """ from __future__ import absolute_import, division, \ print_function, unicode_literals import sys import cv2 cv2.namedWindow('WorkAroundTheCoreDump') cv2.destroyWindow('WorkAroundTheCoreDump') impo...
bsd-3-clause
5,574,213,392,175,967,000
24.37931
81
0.617527
false
jelugbo/tundex
lms/djangoapps/django_comment_client/base/tests.py
6
41997
import logging import json from django.test.client import Client, RequestFactory from django.test.utils import override_settings from django.contrib.auth.models import User from django.core.management import call_command from django.core.urlresolvers import reverse from mock import patch, ANY, Mock from nose.tools imp...
agpl-3.0
164,405,407,159,866,430
39.188517
153
0.579589
false
TiedNets/TiedNets
tsv_col_adder.py
1
1976
import csv from itertools import izip # works for tsv files, make sure the two input files have the same number of lines def add_cols_from_file(main_fpath, add_fpath, output_fpath): with open(main_fpath, 'r') as main_file, open(add_fpath, 'r') as add_file, open(output_fpath, 'w') as out_file: main_reader ...
gpl-3.0
-3,607,733,378,828,287,500
46.047619
115
0.643725
false
JulienMcJay/eclock
windows/Python27/Lib/site-packages/pywin32-218-py2.7-win32.egg/test/test_win32trace.py
17
11259
import unittest import win32trace import threading import time import os import sys if __name__=='__main__': this_file = sys.argv[0] else: this_file = __file__ def CheckNoOtherReaders(): win32trace.write("Hi") time.sleep(0.05) if win32trace.read() != "Hi": # Reset everything so following t...
gpl-2.0
3,742,841,848,567,057,400
31.729651
81
0.602984
false
alex/sentry
sentry/migrations/0036_auto__chg_field_option_value__chg_field_projectoption_value.py
7
15105
# encoding: 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): # Changing field 'Option.value' db.alter_column('sentry_option', 'value', self.gf('django.db.models.fields...
bsd-3-clause
8,498,152,610,313,789,000
76.860825
182
0.547368
false
krzyste/ud032
Lesson_2_Data_in_More_Complex_Formats/18-Using_Beautiful_Soup/html_soup.py
1
1546
#!/usr/bin/env python # -*- coding: utf-8 -*- # Please note that the function 'make_request' is provided for your reference only. # You will not be able to to actually use it from within the Udacity web UI # All your changes should be in the 'extract_data' function from bs4 import BeautifulSoup import requests import ...
agpl-3.0
-8,655,408,168,734,604,000
29.333333
83
0.575679
false
MrPablozOne/Bakalarka_Kaira
gui/paths.py
6
1111
# # Copyright (C) 2010 Stanislav Bohm # # This file is part of Kaira. # # Kaira 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, version 3 of the License, or # (at your option) any later versi...
gpl-3.0
7,730,314,161,531,714,000
33.71875
73
0.70387
false
lucioveloso/lambda-toolkit
lambda_toolkit/modules/receiver.py
1
2977
#!/usr/bin/env python import json import os import sys import signal from lambda_toolkit.modules.utils import Utils from lambda_toolkit.modules.lambdacontext import LambdaContext def signal_handler(signal, frame): sys.exit(0) signal.signal(signal.SIGINT, signal_handler) class Receiver: def __init__(self, c...
apache-2.0
-2,534,512,834,870,983,000
40.347222
124
0.535438
false
camilonova/sentry
src/sentry/options/manager.py
1
4737
""" sentry.options.manager ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, print_function import logging from django.conf import settings from django.utils import timezone from ...
bsd-3-clause
267,538,300,001,631,040
29.75974
83
0.608613
false
faddai/newfies-dialer
setup.py
1
4242
#!/usr/bin/python # -*- coding: utf-8 -*- # # Newfies-Dialer License # http://www.newfies-dialer.org # # 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/. # # Copyright (C) ...
mpl-2.0
1,359,346,065,259,868,700
31.136364
78
0.603725
false
jrocketfingers/sanic
tests/test_requests.py
1
7745
from json import loads as json_loads, dumps as json_dumps from urllib.parse import urlparse import os import ssl import pytest from sanic import Sanic from sanic.exceptions import ServerError from sanic.response import json, text from sanic.testing import HOST, PORT # ----------------------------------------------...
mit
-1,173,841,029,777,326
24.989933
80
0.58825
false
willprice/arduino-sphere-project
scripts/example_direction_finder/temboo/Library/Amazon/EC2/DeleteVolume.py
5
4141
# -*- coding: utf-8 -*- ############################################################################### # # DeleteVolume # Deletes a volume using a volume id that you specify. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may...
gpl-2.0
9,148,499,344,192,354,000
39.598039
230
0.674475
false
richrr/scripts
python/plot-network-graph-june-22-backup.py
1
15903
import networkx as nx import numpy as np import matplotlib.pyplot as plt from utils import * import brewer2mpl import re import os import sys import operator from time import localtime, strftime import argparse import os.path from subprocess import Popen, PIPE from collections import defaultdict import math #python...
gpl-3.0
4,652,235,010,529,054,000
50.3
727
0.661385
false
hefen1/chromium
tools/telemetry/telemetry/web_perf/metrics/layout_unittest.py
12
1062
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from telemetry.results import page_test_results from telemetry.page import page from telemetry.web_perf.metrics import layout from collectio...
bsd-3-clause
7,360,149,525,825,876,000
36.928571
72
0.700565
false
sylvanelite/universalSmashSystem
menu/css.py
2
12608
import settingsManager import spriteManager import os import imp import pygame import battle import sys import stages.true_arena as stage import engine.cpuPlayer as cpuPlayer import engine.abstractFighter as abstractFighter import sss import musicManager class CSSScreen(): def __init__(self,_rules=No...
gpl-3.0
9,053,441,308,917,273,000
38.546624
137
0.523477
false
wolfhesse/exercises-in-programming-style
28-actors/tf-28.py
17
4126
#!/usr/bin/env python import sys, re, operator, string from threading import Thread from Queue import Queue class ActiveWFObject(Thread): def __init__(self): Thread.__init__(self) self.name = str(type(self)) self.queue = Queue() self._stop = False self.start() def run(...
mit
524,502,154,708,970,500
29.338235
101
0.578042
false
Dhivyap/ansible
lib/ansible/modules/network/cloudengine/ce_facts.py
11
11503
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
-7,538,972,090,280,520,000
26.785024
99
0.613057
false
vickenty/pygccjit
gccjit/__init__.py
2
2299
# Copyright 2014 Simon Feltman <s.feltman@gmail.com> # Copyright 2015 David Malcolm <dmalcolm@redhat.com> # Copyright 2015 Red Hat, Inc. # # This 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, eit...
gpl-3.0
6,381,630,307,275,011,000
33.313433
71
0.510657
false
gaining/Resetter
Resetter/usr/lib/resetter/EasyRepo.py
1
12076
#!/usr/bin/env python # -*- coding: utf-8 -*- import apt import lsb_release import subprocess import sys import textwrap from PyQt5 import QtCore, QtGui from aptsources import sourceslist import urllib.request from bs4 import BeautifulSoup from AptProgress import UIAcquireProgress from PackageView import AppView from...
gpl-3.0
1,778,202,608,526,870,300
41.822695
119
0.596472
false
Bismarrck/tensorflow
tensorflow/python/kernel_tests/control_flow_ops_py_test.py
1
151440
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-332,232,264,619,329,100
35.87363
112
0.617802
false
telefonicaid/fiware-IoTAgent-Cplusplus
third_party/mosquitto-1.4.4/test/lib/03-publish-c2b-qos1-timeout.py
7
2881
#!/usr/bin/env python # Test whether a client sends a correct PUBLISH to a topic with QoS 1 and responds to a delay. # The client should connect to port 1888 with keepalive=60, clean session set, # and client id publish-qos1-test # The test will send a CONNACK message to the client with rc=0. Upon receiving # the CON...
agpl-3.0
-3,187,448,714,301,827,600
33.710843
129
0.706005
false
HaydenFaulkner/phd
tensorflow_code/external_libraries/draw-kvfrans/main.py
1
9552
import tensorflow as tf import numpy as np from ops import * from utils import * import input_data # from scipy.misc import imsave as ims class Draw(): def __init__(self): self.mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) self.n_samples = self.mnist.train.num_examples se...
mit
-2,412,362,508,978,403,000
44.923077
178
0.588463
false
alexanderlaw/blivet
blivet/tasks/fswritelabel.py
4
3327
# fswritelabel.py # Filesystem label writing classes. # # Copyright (C) 2015 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. # T...
gpl-2.0
-8,105,825,313,170,470,000
27.681034
85
0.680794
false
mariobp/piscix
Piscix/settings.py
2
11496
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Django settings for Piscix project. Generated by 'django-admin startproject' using Django 1.10.2. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangopro...
mit
-1,835,587,032,274,588,700
29.56117
91
0.485249
false
apache/libcloud
libcloud/backup/drivers/gce.py
31
16808
# 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 "License"); you may not us...
apache-2.0
3,948,166,087,562,766,000
34.16318
79
0.590612
false
Bforartists/scons
scons-local/SCons/Tool/tex.py
3
40181
"""SCons.Tool.tex Tool-specific initialization for TeX. Generates .dvi files from .tex files There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2014 The SCons Foundation # # Permission ...
mit
-993,091,141,330,779,500
39.50504
282
0.608546
false
uclouvain/OSIS-Louvain
base/tests/business/test_learning_unit_edition.py
1
63175
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
agpl-3.0
-4,031,647,468,622,149,600
52.628183
120
0.684601
false
ffee21/jpdanta
sandbox/sandbox3.py
1
1769
import datetime import requests import pymysql.cursors def getconn(): PASSPHRASE_FILE = './sandbox/.passphrase' PASSPHRASE = '' with open(PASSPHRASE_FILE) as f: PASSPHRASE = f.read() connection = pymysql.connect(host='localhost',user='user',password=PASSPHRASE,db='jpdanta') return connec...
apache-2.0
6,508,561,294,485,118,000
30.607143
119
0.645562
false
chrisnorman7/mmc2
connection.py
1
1423
"""MMC2 connection objects.""" from twisted.protocols.basic import LineReceiver from twisted.conch.telnet import TelnetProtocol from twisted.internet.protocol import ClientFactory import logging, command_parser, application logger = logging.getLogger('Connection') class MyClientFactory(ClientFactory): def...
mpl-2.0
2,702,768,374,433,925,600
27.040816
77
0.711876
false
CG-F16-7-Rutgers/steersuite-rutgers
steerstats/steersuite/AxisAlignedBox.py
8
1603
class AxisAlignedBox(object): def __init__(self, xmin, xmax, ymin, ymax, zmin, zmax): self._xmin=xmin self._xmax=xmax self._ymin=ymin self._ymax=ymax self._zmin=zmin self._zmax=zmax def get_xmin(self): return self._xmin def get_xmax(self): ...
gpl-3.0
2,618,379,122,339,298,300
26.655172
69
0.576419
false
OSSESAC/odoopubarquiluz
extra-addons/l10n_co_toponyms/__openerp__.py
8
1623
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012 Gabriel Henao. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
agpl-3.0
-328,470,862,157,085,950
31.46
78
0.583487
false
disqus/mule
mule/runners/xml.py
1
7409
# -*- coding: utf-8 -*- from __future__ import absolute_import """unittest-xml-reporting is a PyUnit-based TestRunner that can export test results to XML files that can be consumed by a wide range of tools, such as build systems, IDEs and Continuous Integration servers. This module provides the XMLTestRunner class, ...
apache-2.0
-2,458,362,929,389,439,000
39.271739
98
0.623296
false
HyperloopTeam/FullOpenMDAO
lib/python2.7/site-packages/pycycle-0.1-py2.7.egg/pycycle/start.py
3
1501
from openmdao.main.api import Component from openmdao.lib.datatypes.api import Float, VarTree from pycycle.flowstation import FlowStation, FlowStationVar from pycycle.cycle_component import CycleComponent class FlowStart(CycleComponent): """Flow initialization""" W = Float(1, iotype="in", desc="mass flow ...
gpl-2.0
-4,872,653,714,009,063,000
30.270833
100
0.650233
false
camilonova/django
tests/view_tests/tests/test_debug.py
12
45828
import importlib import inspect import os import re import sys import tempfile from io import StringIO from django.conf.urls import url from django.core import mail from django.core.files.uploadedfile import SimpleUploadedFile from django.db import DatabaseError, connection from django.template import TemplateDoesNotE...
bsd-3-clause
-7,065,527,192,650,510,000
41.75
117
0.616501
false
xodus7/tensorflow
tensorflow/compiler/xla/python/xla_client_test.py
6
57359
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-1,995,081,424,407,314,200
37.470154
80
0.625028
false
mahak/nova
nova/tests/functional/api_sample_tests/test_flavor_extraspecs.py
4
2640
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
apache-2.0
5,747,813,114,677,206,000
37.26087
78
0.598864
false
manazhao/tf_recsys
tensorflow/contrib/seq2seq/__init__.py
15
2363
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
5,054,603,284,321,872,000
33.246377
80
0.723233
false
ehealthafrica-ci/formhub
odk_logger/migrations/0015_auto__add_field_xform_is_crowd_form.py
7
7432
# encoding: 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 field 'XForm.is_crowd_form' db.add_column('odk_logger_xform', 'is_crowd_form', self.gf('django.db...
bsd-2-clause
-5,078,787,693,243,298,000
70.461538
182
0.549381
false
synsun/robotframework
src/robot/utils/dotdict.py
3
1574
# Copyright 2008-2015 Nokia Solutions and Networks # # 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 l...
apache-2.0
4,890,827,775,549,104,000
29.862745
78
0.629606
false
renatahodovan/fuzzinator
tests/call/common_call.py
2
1286
# Copyright (c) 2016 Renata Hodovan, Akos Kiss. # # Licensed under the BSD 3-Clause License # <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>. # This file may not be copied, modified, or distributed except # according to those terms. import os blinesep = str.encode(os.linesep) resources_dir = os.path.j...
bsd-3-clause
-8,797,606,947,158,945,000
22.814815
102
0.656299
false
qnu/qfs
benchmarks/mstress/mstress_plan.py
5
6319
#!/usr/bin/env python # $Id$ # # Author: Thilee Subramaniam # # Copyright 2012 Quantcast Corp. # # 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 ...
apache-2.0
-6,966,773,101,635,962,000
36.390533
115
0.614021
false
arivarton/workhours
stamp/edit.py
1
1477
import sys import re __all__ = ['edit_workday', 'edit_customer', 'edit_project', 'edit_invoice'] def edit_workday(args): workday = args.db.get('Workday', args.id) if args.comment: workday.comment = args.comment if args.customer: workday.customer = args.cust...
gpl-3.0
-1,168,086,392,038,541,600
24.465517
77
0.578876
false