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
fhaoquan/kbengine
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/colorama/initialise.py
484
1297
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. import atexit import sys from .ansitowin32 import AnsiToWin32 orig_stdout = sys.stdout orig_stderr = sys.stderr wrapped_stdout = sys.stdout wrapped_stderr = sys.stderr atexit_done = False def reset_all(): AnsiToWin32(orig_stdout).rese...
lgpl-3.0
-1,061,914,376,574,508,400
22.160714
74
0.682344
false
tlksio/tlksio
env/lib/python3.4/site-packages/future/backports/http/cookies.py
78
21569
#### # Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu> # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software # and its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in all # copies and that bot...
mit
6,132,335,348,694,966,000
35.128978
83
0.537855
false
NicovincX2/Python-3.5
Algorithmique/Algorithme/Algorithme de tri/Tri par fusion (Merge sort)/merge_sort2.py
1
1238
# -*- coding: utf-8 -*- import os """ Merge Sort ---------- Uses divide and conquer to recursively divide and sort the list Time Complexity: O(n log n) Space Complexity: O(n) Auxiliary Stable: Yes Psuedo Code: CLRS. Introduction to Algorithms. 3rd ed. """ def merge(left, right): """ ...
gpl-3.0
6,477,456,300,950,877,000
22.807692
77
0.578352
false
esteinig/netviewP
program/linux/0.7/netview.py
1
28716
#!/usr/bin/env python # NetView P v.0.7 - Linux # Dependencies: PLINK # Eike Steinig # Zenger Lab, JCU # https://github.com/esteinig/netview import os import time import shutil import argparse import subprocess import numpy as np import multiprocessing as mp import scipy.sparse.csgraph as csg import scipy.spatial.dist...
gpl-2.0
-8,660,771,599,461,947,000
37.339119
128
0.494289
false
tjsavage/rototutor_djangononrel
django/views/decorators/http.py
94
6854
""" Decorators for views based on HTTP headers. """ try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.4 fallback. from calendar import timegm from datetime import timedelta from email.Utils import formatdate from django.utils.decorators import decorato...
bsd-3-clause
534,464,960,833,654,500
40.792683
94
0.579807
false
styxit/HTPC-Manager
libs/cherrypy/lib/profiler.py
88
6501
"""Profiler tools for CherryPy. CherryPy users ============== You can profile any of your pages as follows:: from cherrypy.lib import profiler class Root: p = profile.Profiler("/path/to/profile/dir") def index(self): self.p.run(self._index) index.exposed = Tr...
mit
-1,568,778,102,988,461,000
30.254808
86
0.566836
false
citizen-stig/pyjtt
pyjtt/gui.py
1
26426
from datetime import timedelta, datetime import queue from urllib import error from functools import partial import logging from PyQt5 import QtWidgets, QtCore, QtGui from pyjtt import base_classes, core, utils, workers from pyjtt.widgets import login_window, main_window, worklog_window __author__ = "Nikolay Golub (...
gpl-3.0
1,113,766,152,275,129,200
42.179739
117
0.577386
false
wilebeast/FireFox-OS
B2G/gecko/testing/marionette/client/marionette/keys.py
39
2581
# copyright 2008-2009 WebDriver committers # Copyright 2008-2009 Google Inc. # # Licensed under the Apache License Version 2.0 = uthe "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http //www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
1,984,119,709,985,171,700
29.72619
73
0.497094
false
AsgerPetersen/QGIS
python/ext-libs/future/future/types/newint.py
68
13233
""" Backport of Python 3's int, based on Py2's long. They are very similar. The most notable difference is: - representation: trailing L in Python 2 removed in Python 3 """ from __future__ import division import struct import collections from future.types.newbytes import newbytes from future.types.newobject import ...
gpl-2.0
-1,535,891,629,633,054,200
33.915567
83
0.555354
false
deepakantony/sms-tools
workspace_2014/A1/A1Part2.py
1
1706
import sys import os sys.path.append('../../software/models/') from utilFunctions import wavread import scipy.io.wavfile import numpy as np """ A1-Part-2: Basic operations with audio Write a function that reads an audio file and returns the minimum and the maximum values of the audio samples in that file. The in...
agpl-3.0
544,899,556,947,686,400
30.592593
107
0.66354
false
Perferom/android_external_chromium_org
tools/telemetry/telemetry/page/actions/click_element.py
24
1955
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import re from telemetry.core import util from telemetry.core import exceptions from telemetry.page.actions import page_action def _EscapeSelector(sele...
bsd-3-clause
8,046,395,705,215,553,000
37.333333
78
0.603581
false
google/gazoo-device
gazoo_device/base_classes/nrf_connect_sdk_device.py
1
3562
# 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 or agreed to in writing, ...
apache-2.0
279,542,965,239,907,520
37.301075
80
0.713644
false
chauhanhardik/populo_2
lms/djangoapps/certificates/views/xqueue.py
51
9592
""" Views used by XQueue certificate generation. """ import json import logging from django.contrib.auth.models import User from django.http import HttpResponse, Http404, HttpResponseForbidden from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST import dogstats_wra...
agpl-3.0
-7,741,334,253,804,567,000
40.344828
119
0.649395
false
Sendoushi/servo
python/tidy/servo_tidy_tests/test_tidy.py
1
4818
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
mpl-2.0
8,169,688,531,214,048,000
50.255319
118
0.677044
false
isohybrid/dotfile
vim/bundle/git:--github.com-klen-python-mode/pylibs/logilab/common/hg.py
24
4819
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as publ...
bsd-2-clause
-1,581,579,529,626,119,000
36.069231
84
0.671924
false
Ghostboy-287/okadminfinder3
okadminfinder.py
1
18022
#!/usr/bin/env python3 # -*- coding: utf-8 -*- try: # Change main dir to this (need for Pentest Box) import os os.path.abspath(__file__) from Classes import (Credits, OKadminFinderClass, MessengerClass) import argparse from colorama import Fore,...
apache-2.0
-3,955,812,871,415,940,600
40.204176
249
0.574131
false
Ashaba/rms
rmslocalenv/lib/python2.7/site-packages/django/core/validators.py
32
15447
from __future__ import unicode_literals import re from django.core.exceptions import ValidationError from django.utils import six from django.utils.deconstruct import deconstructible from django.utils.encoding import force_text from django.utils.functional import SimpleLazyObject from django.utils.ipv6 import is_vali...
mit
1,907,372,870,932,067,000
35.431604
110
0.576876
false
cevaris/pants
src/python/pants/util/dirutil.py
2
12074
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import atexit import...
apache-2.0
-729,997,821,765,972,100
31.111702
105
0.694467
false
pamfilos/invenio
modules/webaccess/lib/external_authentication_cern.py
25
7730
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio 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 ## Licens...
gpl-2.0
3,194,954,465,997,453,300
38.438776
77
0.620052
false
yceruto/django
django/conf/locale/nn/formats.py
197
1810
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATET...
bsd-3-clause
6,004,164,397,182,179,000
41.093023
81
0.518232
false
cuongthai/cuongthai-s-blog
django/contrib/localflavor/is_/is_postalcodes.py
438
4913
# -*- coding: utf-8 -*- IS_POSTALCODES = ( ('101', u'101 Reykjavík'), ('103', u'103 Reykjavík'), ('104', u'104 Reykjavík'), ('105', u'105 Reykjavík'), ('107', u'107 Reykjavík'), ('108', u'108 Reykjavík'), ('109', u'109 Reykjavík'), ('110', u'110 Reykjavík'), ('111', u'111 Reykjavík'...
bsd-3-clause
3,147,154,549,418,787,000
30.291391
43
0.526772
false
dikyarga/modularitea
src/opt/pymodularitea/build/lib/modularitea/atom_.py
2
2290
#! /usr/bin/python3 import sys import json import os import subprocess import apt import apt_pkg import apt.progress.text import apt.progress.base from urllib.request import urlretrieve from gi.repository import Gtk # harus diganti saat rilis PREFIX = '/home/mnirfan/Projects/modularitea/' # executable apt APT_PATH =...
mit
4,819,656,001,834,287,000
30.805556
118
0.59738
false
hogasa/normalizador-amba
setup.py
1
1202
# coding: UTF-8 # !/usr/bin/env python from __future__ import absolute_import try: from setuptools import setup except ImportError: from distutils.core import setup import usig_normalizador_amba with open('README.rst', 'r') as f: readme = f.read() setup( name=usig_normalizador_amba.__title__, ver...
mit
-3,852,349,586,385,594,000
32.388889
71
0.66223
false
sahana/Turkey
modules/s3db/msg.py
7
91452
# -*- coding: utf-8 -*- """ Sahana Eden Messaging Model @copyright: 2009-2015 (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 wit...
mit
3,975,984,755,078,849,500
38.065357
141
0.39132
false
pbrunet/pythran
pythran/tests/euler/euler41.py
5
2648
#runas solve() #unittest.skip recursive generator #pythran export solve() ''' From O'Reilly's Python Cookbook ''' def _combinators(_handle, items, n): if n==0: yield [] return for i, item in enumerate(items): this_one = [ item ] for cc in _combinators(_handle, _handle(items, i),...
bsd-3-clause
-8,785,246,697,957,157,000
34.306667
169
0.578172
false
kimegitee/deep-learning
language-translation/helper.py
156
2683
import os import pickle import copy import numpy as np CODES = {'<PAD>': 0, '<EOS>': 1, '<UNK>': 2, '<GO>': 3 } def load_data(path): """ Load Dataset from File """ input_file = os.path.join(path) with open(input_file, 'r', encoding='utf-8') as f: return f.read() def preprocess_and_save...
mit
1,242,465,723,144,632,300
26.10101
110
0.619083
false
arborh/tensorflow
tensorflow/python/keras/layers/recurrent_v2.py
3
67355
# Copyright 2019 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
-345,247,064,942,733,800
41.22884
80
0.673491
false
jyemin/mongo-orchestration
mongo_orchestration/server.py
2
3856
#!/usr/bin/python # coding=utf-8 import argparse import atexit import json import os import sys from bson import SON from mongo_orchestration.daemon import Daemon work_dir = os.environ.get('MONGO_ORCHESTRATION_HOME', os.getcwd()) pid_file = os.path.join(work_dir, 'server.pid') log_file = os.path.join(work_dir, 'ser...
apache-2.0
-6,099,446,149,884,777,000
31.403361
80
0.600882
false
bkonkle/django-baseviews
docs/conf.py
1
7253
# -*- coding: utf-8 -*- # # django-baseviews documentation build configuration file, created by # sphinx-quickstart on Mon Sep 20 23:11:20 2010. # # 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 # autogenerated file...
bsd-3-clause
4,828,034,647,517,863,000
31.819005
80
0.710878
false
mckinseyacademy/xblock-diagnosticfeedback
diagnostic_feedback/settings.py
1
2183
""" Django settings for the diagnostic_feedback project. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ # Build paths inside the project like this: os.path.join(B...
agpl-3.0
258,266,205,708,342,000
24.383721
109
0.727439
false
Jonekee/chromium.src
third_party/typ/typ/tests/host_test.py
35
6924
# Copyright 2014 Dirk Pranke. 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...
bsd-3-clause
-7,173,890,577,515,944,000
31.055556
79
0.552282
false
jsalva/djember
djember/djember/wsgi.py
1
1562
""" WSGI config for djember project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` ...
mit
-2,124,135,949,309,067,500
41.216216
79
0.790653
false
hsaputra/tensorflow
tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py
8
31357
# 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...
apache-2.0
1,085,858,733,784,202,100
34.272216
100
0.621711
false
wooga/airflow
airflow/contrib/hooks/sagemaker_hook.py
5
1267
# # 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...
apache-2.0
4,703,539,936,200,637,000
39.870968
92
0.769534
false
nicolasnoble/grpc
src/python/grpcio_tests/tests/unit/resources.py
18
3134
# Copyright 2015 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
1,291,651,143,327,955,200
26.734513
86
0.688896
false
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/plugins/action/dellos9.py
2
4467
# # (c) 2016 Red Hat Inc. # # Copyright (c) 2017 Dell Inc. # # 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...
bsd-3-clause
-5,616,734,023,157,949,000
37.179487
118
0.631296
false
numenta/nupic
src/nupic/algorithms/anomaly.py
11
7246
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014-2016, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditions apply: # # Thi...
agpl-3.0
3,528,903,610,818,598,000
35.781726
80
0.668369
false
digitvaran/digitvaran
attendance_proxy/functions.py
1
2810
from pyvirtualdisplay import Display from selenium.webdriver.support.ui import Select from selenium import webdriver from bs4 import BeautifulSoup keys=webdriver.common.keys.Keys def scroll_element_into_view(driver, element): """Scroll element into view""" y = element.location['y'] driver.execute_script('...
gpl-2.0
2,765,622,309,203,710,000
35.973684
88
0.641637
false
stupidnetizen/selenium
py/test/selenium/webdriver/common/element_attribute_tests.py
65
12160
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
-8,184,304,937,675,146,000
44.037037
95
0.697533
false
analysiscenter/dataset
batchflow/opensets/imagenette.py
1
5401
""" Contains Imagenette and Imagewoof datasets """ import os from os.path import dirname, basename import tempfile import logging import urllib.request import tarfile from io import BytesIO import PIL import tqdm import numpy as np from sklearn.preprocessing import LabelEncoder from . import ImagesOpenset logger =...
apache-2.0
-7,745,015,146,335,727,000
35.993151
120
0.653953
false
NOAA-ORR-ERD/gridded
gridded/tests/test_pysgrid/test_read_netcdf.py
1
2349
""" Created on Apr 7, 2015 @author: ayan """ from __future__ import absolute_import, division, print_function from gridded.pysgrid.read_netcdf import NetCDFDataset, find_grid_topology_var from .write_nc_test_files import roms_sgrid, wrf_sgrid """ Test NetCDF Dataset With Nodes. """ def test_finding_node_variab...
unlicense
-8,662,411,757,824,139,000
25.393258
93
0.682418
false
oostende/openblachole
lib/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py
2
9282
# -*- coding: iso-8859-1 -*- from time import time from boxbranding import getImageVersion from enigma import eConsoleAppContainer from Components.Console import Console from Components.PackageInfo import PackageInfoHandler from Components.Language import language from Components.Sources.List import List from Compone...
gpl-2.0
9,076,517,023,536,219,000
32.032028
112
0.709976
false
chokribr/inveniotest
modules/bibformat/lib/elements/bfe_arxiv_link.py
16
1791
## This file is part of Invenio. ## Copyright (C) 2014 CERN. ## ## Invenio 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. ## ## Inv...
gpl-2.0
-7,594,499,643,616,463,000
37.106383
107
0.65885
false
v-iam/azure-sdk-for-python
azure-batch/azure/batch/models/pool_exists_options.py
3
3078
# 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 ...
mit
-1,059,149,277,400,428,500
49.459016
191
0.692008
false
sunqm/pyscf
pyscf/cc/test/test_eom_rccsd.py
2
38148
#!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
apache-2.0
-1,438,094,716,631,269,600
42.49829
103
0.635551
false
SalesforceFoundation/CumulusCI
cumulusci/tasks/salesforce/Deploy.py
1
5848
import pathlib from typing import Optional from cumulusci.core.exceptions import TaskOptionsError from cumulusci.core.utils import process_bool_arg, process_list_arg from cumulusci.salesforce_api.metadata import ApiDeploy from cumulusci.salesforce_api.package_zip import MetadataPackageZipBuilder from cumulusci.tasks.s...
bsd-3-clause
7,568,247,671,420,256,000
42
295
0.623974
false
mapr/sahara
sahara/cli/sahara_api.py
2
1907
#!/usr/bin/env python # Copyright (c) 2013 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 l...
apache-2.0
-4,414,494,718,589,859,000
29.758065
79
0.653907
false
KredekPth/Kurs_django
website/urls.py
1
1151
"""website URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-ba...
mit
-894,687,756,153,320,200
30.972222
79
0.70808
false
lukeiwanski/tensorflow-opencl
tensorflow/python/training/localhost_cluster_performance_test.py
50
5457
# 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...
apache-2.0
-1,453,139,576,450,623,500
37.160839
80
0.685358
false
aisthesis/opttrack
opttrack/lib/ui/edit_handlers.py
1
10897
""" Copyright (c) 2015 Marshall Farrier license http://opensource.org/licenses/MIT lib/ui/handlers.py Handlers for edit menu """ from bson.codec_options import CodecOptions import datetime as dt from functools import partial import json from pymongo.errors import BulkWriteError from ..dbschema import SPREADS from ...
mit
-8,519,835,176,942,805,000
37.101399
112
0.604295
false
loljoho-old/ainu
pyaib/config.py
2
3302
#!/usr/bin/env python # # Copyright 2013 Facebook # # 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
-1,704,519,960,631,884,300
39.268293
79
0.596002
false
gogoair/foremast
tests/iam/test_iam_create.py
1
4229
# Foremast - Pipeline Tooling # # Copyright 2018 Gogo, 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...
apache-2.0
-288,686,835,792,163,000
40.058252
111
0.698274
false
tiagochiavericosta/edx-platform
lms/djangoapps/courseware/features/conditional.py
102
4723
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name from lettuce import world, steps from nose.tools import assert_in, assert_true # pylint: disable=no-name-in-module from common import i_am_registered_for_the_course, visit_scenario_item from problems_setup import add_problem_to_course, answer...
agpl-3.0
-8,969,362,897,015,649,000
36.188976
121
0.580563
false
krother/maze_run
03_semantic_errors/generate_maze.py
4
1783
# Code for chapter 03 - Semantic Errors import random XMAX, YMAX = 19, 16 def create_grid_string(dots, xsize, ysize): """ Creates a grid of size (xx, yy) with the given positions of dots. """ grid = "" for y in range(ysize): for x in range(xsize): grid += "." if (x, y) i...
mit
1,133,574,211,846,108,000
25.61194
77
0.564218
false
joone/chromium-crosswalk
tools/idl_parser/idl_ppapi_lexer.py
81
2012
#!/usr/bin/env python # Copyright (c) 2013 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. """ Lexer for PPAPI IDL The lexer uses the PLY library to build a tokenizer which understands both WebIDL and Pepper tokens. WebI...
bsd-3-clause
4,323,442,579,873,215,000
27.338028
79
0.631213
false
xiaoyuanW/gem5
src/arch/x86/isa/insts/x87/arithmetic/multiplication.py
50
2165
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
7,158,616,306,420,596,000
50.547619
72
0.79261
false
lmacken/moksha
moksha/apps/feeds/moksha/widgets/feeds/widgets.py
1
6186
# This file is part of Moksha. # Copyright (C) 2008-2010 Red Hat, 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 b...
apache-2.0
4,191,645,701,805,204,000
33.558659
161
0.597963
false
TheMOOCAgency/edx-platform
common/test/acceptance/pages/lms/dashboard_search.py
16
1161
""" Dashboard search """ from bok_choy.page_object import PageObject from common.test.acceptance.pages.lms import BASE_URL class DashboardSearchPage(PageObject): """ Dashboard page featuring a search form """ search_bar_selector = '#dashboard-search-bar' url = "{base}/dashboard".format(base=BASE...
agpl-3.0
264,171,878,198,171,460
28.025
84
0.626184
false
cntnboys/cmput410-project
venv/lib/python2.7/site-packages/pip/vcs/git.py
85
7833
from __future__ import absolute_import import logging import tempfile import os.path from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._vendor.six.moves.urllib import request as urllib_request from pip.utils import call_subprocess from pip.utils import display_path, rmtree from pip.vcs import v...
apache-2.0
-1,805,559,619,973,677,300
35.432558
79
0.540661
false
cloudbees/changelog-client-python
ccp/client.py
1
2319
# -*- coding: utf-8 -*- """ ccp.client ~~~~~~~~~~~~ This module implements the Changelog API. :license: MIT, see LICENSE for more details. """ import sys import requests import json from time import time import logging from pkg_resources import get_distribution API_HOST = "localhost" API_PORT = 5000 SEVERITY = di...
mit
-6,225,465,319,889,502,000
29.116883
108
0.573954
false
vathpela/blivet
blivet/dbus/constants.py
3
1732
# # Copyright (C) 2016 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 distributed in the hope that it will be...
gpl-2.0
-8,685,556,750,671,148,000
48.485714
77
0.753464
false
DevangS/CoralNet
annotations/forms.py
1
15430
from decimal import Decimal from exceptions import ValueError from itertools import chain from django.core.exceptions import ValidationError, MultipleObjectsReturned from django.core.urlresolvers import reverse from django.forms import Form from django.forms.fields import BooleanField, CharField, DecimalField, IntegerF...
bsd-2-clause
934,371,892,639,162,500
39.605263
246
0.597343
false
zero323/spark
python/pyspark/streaming/util.py
23
5614
# # 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
6,300,155,341,521,932,000
33.654321
99
0.635732
false
childsish/lhc-python
lhc/binf/genomic_coordinate/genomic_position.py
1
2868
from functools import total_ordering from lhc.order import natural_key class ChromosomeIdentifier: def __init__(self, chromosome: str): self.chromosome = chromosome self.parts = tuple(natural_key(chromosome)) def __str__(self): return self.chromosome def __hash__(self): r...
gpl-2.0
5,886,648,146,083,312,000
32.348837
123
0.620293
false
pychess/pychess
lib/pychess/perspectives/games/historyPanel.py
2
9491
from gi.repository import Gtk, Gdk from pychess.System import conf from pychess.System.prefix import addDataPrefix from pychess.Utils.const import BLACK from pychess.Utils.Move import toSAN, toFAN from pychess.widgets.Background import hexcol __title__ = _("Move History") __active__ = True __icon__ = addDataPrefix("g...
gpl-3.0
1,804,832,003,922,913,500
39.733906
139
0.614793
false
knowsis/django
django/contrib/gis/geoip/base.py
110
11124
import os import re from ctypes import c_char_p from django.core.validators import ipv4_re from django.contrib.gis.geoip.libgeoip import GEOIP_SETTINGS from django.contrib.gis.geoip.prototypes import ( GeoIPRecord, GeoIPTag, GeoIP_open, GeoIP_delete, GeoIP_database_info, GeoIP_lib_version, GeoIP_record_by_addr...
bsd-3-clause
-3,224,828,810,477,883,000
40.977358
117
0.619651
false
Moriadry/tensorflow
tensorflow/contrib/keras/api/keras/applications/vgg16/__init__.py
57
1133
# 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...
apache-2.0
5,789,129,735,680,012,000
40.962963
87
0.733451
false
Zord13appdesa/python-for-android
python3-alpha/extra_modules/bs4/builder/_lxml.py
46
5603
__all__ = [ 'LXMLTreeBuilderForXML', 'LXMLTreeBuilder', ] import collections from lxml import etree from bs4.element import Comment, Doctype, NamespacedAttribute from bs4.builder import ( FAST, HTML, HTMLTreeBuilder, PERMISSIVE, TreeBuilder, XML) from bs4.dammit import UnicodeDammit...
apache-2.0
-2,784,184,247,092,684,000
34.238994
85
0.5995
false
spartonia/django-oscar
src/oscar/management/commands/oscar_cleanup_alerts.py
19
1703
import logging from datetime import timedelta from optparse import make_option from django.core.management.base import BaseCommand from django.utils.timezone import now from oscar.core.loading import get_model ProductAlert = get_model('customer', 'ProductAlert') logger = logging.getLogger(__name__) class Command(...
bsd-3-clause
2,916,294,830,248,982,000
32.392157
70
0.625367
false
saurabh6790/frappe
frappe/integrations/doctype/paypal_settings/paypal_settings.py
2
14226
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies and contributors # For license information, please see license.txt """ # Integrating PayPal ### 1. Validate Currency Support Example: from frappe.integrations.utils import get_payment_gateway_controller controller = get_payment_gateway_controller(...
mit
3,247,480,312,913,399,300
32.394366
280
0.709476
false
archf/ansible
lib/ansible/modules/utilities/logic/fail.py
113
1256
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2012 Dag Wieers <dag@wieers.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
-6,484,379,459,868,797,000
28.209302
92
0.675159
false
udacity/ggplot
ggplot/geoms/geom_tile.py
12
3695
from __future__ import (absolute_import, division, print_function, unicode_literals) import pandas as pd import numpy as np from .geom import geom from matplotlib.patches import Rectangle import matplotlib.colors as colors import matplotlib.colorbar as colorbar class geom_tile(geom): DEFAU...
bsd-2-clause
-2,008,258,174,221,249,000
36.323232
123
0.554804
false
GNOME/hamster-applet
src/hamster/widgets/dayline.py
3
13606
# -*- coding: utf-8 -*- # Copyright (C) 2007-2010 Toms Bauģis <toms.baugis at gmail.com> # This file is part of Project Hamster. # Project Hamster 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 vers...
gpl-3.0
-6,967,603,906,493,004,000
35.28
170
0.585079
false
disconnect3d/pwndbg
pwndbg/argv.py
4
1102
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import gdb import pwndbg.abi import pwndbg.arch import pwndbg.events import pwndbg.memory import pwndbg.regs #: Total numb...
mit
-6,471,511,038,802,853,000
16.21875
43
0.632486
false
havard024/prego
venv/lib/python2.7/site-packages/unidecode/x077.py
252
4675
data = ( 'Ming ', # 0x00 'Sheng ', # 0x01 'Shi ', # 0x02 'Yun ', # 0x03 'Mian ', # 0x04 'Pan ', # 0x05 'Fang ', # 0x06 'Miao ', # 0x07 'Dan ', # 0x08 'Mei ', # 0x09 'Mao ', # 0x0a 'Kan ', # 0x0b 'Xian ', # 0x0c 'Ou ', # 0x0d 'Shi ', # 0x0e 'Yang ', # 0x0f 'Zheng ', # 0...
mit
-3,310,225,686,182,014,500
17.120155
19
0.395508
false
pokowaka/atreus-firmware
tmk/tmk_core/tool/mbed/mbed-sdk/workspace_tools/host_tests/host_tests_plugins/module_reset_mps2.py
30
2470
""" mbed SDK Copyright (c) 2011-2013 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
gpl-3.0
-5,524,557,315,269,828,000
32.378378
77
0.649798
false
eayunstack/horizon
openstack_dashboard/dashboards/project/instances/tables.py
12
40417
# Copyright 2012 Nebula, 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 agree...
apache-2.0
6,753,523,071,900,708,000
36.8791
79
0.583294
false
franziz/arcrawler
lib/saver/blog.py
1
1508
from curtsies import fmtstr from ..monitor import Monitor import pymongo import bson.json_util import re import arrow class BlogSaver: def __init__(self, **kwargs): self.db_address = kwargs.get("db_address", "mongo:27017") self.db_name = kwargs.get("db_name", "news_crawler") def save(self, article=None): ...
gpl-3.0
7,308,676,910,511,782,000
31.804348
88
0.678382
false
crdoconnor/olympia
lib/crypto/tasks.py
8
14127
import json import logging import os import shutil import zipfile from django.conf import settings from django.db.models import Q from lxml import etree import amo from addons.models import AddonUser from amo.celery import task from lib.crypto.packaged import sign_file from versions.compare import version_int from v...
bsd-3-clause
8,288,049,690,740,593,000
44.424437
79
0.623133
false
adamreese/kubernetes
examples/selenium/selenium-test.py
497
1089
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
-2,963,044,788,351,869,000
32
78
0.757576
false
aYukiSekiguchi/ACCESS-Chromium
native_client_sdk/src/build_tools/make_nacl_tools.py
8
7703
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Build NaCl tools (e.g. sel_ldr and ncval) at a given revision.""" import build_utils import optparse import os import shutil im...
bsd-3-clause
-1,514,196,384,868,327,400
35.164319
80
0.586135
false
tempbottle/Nuitka
nuitka/nodes/IndicatorMixins.py
2
2961
# Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
apache-2.0
-4,623,096,870,129,396,000
29.525773
84
0.68997
false
UDST/choicemodels
tests/test_mnl_new.py
1
3024
""" These are tests for the refactored choicemodels MNL codebase. """ import numpy as np import pandas as pd import pytest from pandas.testing import assert_frame_equal from patsy import dmatrix from choicemodels import MultinomialLogit from choicemodels.tools import MergedChoiceTable @pytest.fixture def obs(): ...
bsd-3-clause
5,432,414,888,511,859,000
28.656863
95
0.660714
false
patricksnape/menpo
menpo/image/base.py
2
131364
from typing import Iterable, Optional from warnings import warn import PIL.Image as PILImage import numpy as np from menpo.base import MenpoDeprecationWarning, Vectorizable, copy_landmarks_and_path from menpo.landmark import Landmarkable from menpo.shape import PointCloud, bounding_box from menpo.transform import ( ...
bsd-3-clause
-1,439,328,775,769,666,800
36.922633
92
0.561554
false
dulems/hue
desktop/core/ext-py/Django-1.6.10/django/utils/translation/trans_real.py
74
25651
"""Translation helper functions.""" from __future__ import unicode_literals import locale import os import re import sys import gettext as gettext_module from threading import local import warnings from django.utils.importlib import import_module from django.utils.datastructures import SortedDict from django.utils.en...
apache-2.0
-7,030,854,863,451,336,000
36.889217
143
0.574481
false
kakunbsc/bb
lib/bb/fetch/cvs.py
5
6216
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Fetch' implementations Classes for obtaining upstream sources for the BitBake build tools. """ # Copyright (C) 2003, 2004 Chris Larson # # This program is free software; you can redistribute it and/or modify # it u...
gpl-2.0
8,950,717,551,416,659,000
33.153846
142
0.558398
false
VagrantApe/flaskMicroblog
venv/lib/python2.7/site-packages/whoosh/filedb/gae.py
96
4872
""" This module contains EXPERIMENTAL support for storing a Whoosh index's files in the Google App Engine blobstore. This will use a lot of RAM since all files are loaded into RAM, but it potentially useful as a workaround for the lack of file storage in Google App Engine. Use at your own risk, but please report any p...
bsd-3-clause
2,522,428,695,051,861,000
28.707317
79
0.639573
false
lzjever/django-guardian
docs/conf.py
24
7168
# -*- coding: utf-8 -*- # # django-guardian documentation build configuration file, created by # sphinx-quickstart on Thu Feb 18 23:18:28 2010. # # 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 # autogenerated file....
bsd-2-clause
-5,557,439,905,654,191,000
31.730594
80
0.712054
false
akuster/yali
yali/gui/ScrAdmin.py
1
6936
# -*- coding: utf-8 -*- # # Copyright (C) 2005-2010 TUBITAK/UEKAE # # 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. # # ...
gpl-2.0
-4,895,290,230,190,705,000
33.507463
113
0.594867
false
zacernst/python_cypher
test/test.py
1
1583
import unittest import networkx as nx from python_cypher import python_cypher class TestPythonCypher(unittest.TestCase): def test_upper(self): """Test we can parse a CREATE... RETURN query.""" g = nx.MultiDiGraph() query = 'CREATE (n:SOMECLASS) RETURN n' test_parser = python_cyphe...
gpl-2.0
-4,198,008,791,595,853,000
33.413043
72
0.603285
false
asmodehn/pyros
tests/test_pyros/test_ros_ctx_server.py
2
1788
from __future__ import absolute_import, division, print_function import time import pytest from pyros.client import PyrosClient from pyros.server.ctx_server import pyros_ctx pyros_interfaces_ros = pytest.importorskip("pyros_interfaces_ros") # , minversion="0.4") # TODO : make version avialable in pyros_interfaces_...
bsd-3-clause
-6,060,597,706,406,792,000
34.76
146
0.6717
false
zhxwmessi/or-tools
examples/python/production.py
34
2848
# Copyright 2011 Hakan Kjellerstrand hakank@bonetmail.com # # 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
-1,847,814,104,413,617,400
25.37037
109
0.633778
false
p4datasystems/CarnotKE
jyhton/lib-python/2.7/encodings/base64_codec.py
528
2338
""" Python 'base64_codec' Codec - base64 content transfer encoding Unlike most of the other codecs which target Unicode, this codec will return Python string objects for both encode and decode. Written by Marc-Andre Lemburg (mal@lemburg.com). """ import codecs, base64 ### Codec APIs def base64_encode(i...
apache-2.0
-457,190,082,534,055,940
28.594937
68
0.6929
false
weimingtom/python-for-android
python-modules/twisted/twisted/internet/test/test_endpoints.py
49
41233
# Copyright (c) 2007-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Test the C{I...Endpoint} implementations that wrap the L{IReactorTCP}, L{IReactorSSL}, and L{IReactorUNIX} interfaces found in L{twisted.internet.endpoints}. """ from errno import EPERM from zope.interface import implements from twi...
apache-2.0
1,290,376,326,436,893,200
32.604727
79
0.617952
false
AdrianHuang/rt-thread
bsp/lpc5410x/rtconfig.py
28
2379
import os # toolchains options ARCH='arm' CPU='cortex-m4' CROSS_TOOL='gcc' BOARD_NAME = 'lpc5410x' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' EXEC_PATH = r'D:/Program Files/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin' elif CROSS_TOOL == 'keil': ...
gpl-2.0
-7,112,340,075,738,830,000
26.344828
169
0.543926
false
NL66278/OCB
addons/sales_team/res_config.py
366
1922
# -*- coding: utf-8 -*- from openerp.osv import fields, osv class sales_team_configuration(osv.TransientModel): _name = 'sale.config.settings' _inherit = ['sale.config.settings'] def set_group_multi_salesteams(self, cr, uid, ids, context=None): """ This method is automatically called by res_conf...
agpl-3.0
4,786,376,412,312,037,000
45.878049
103
0.613944
false
chrislit/abydos
tests/distance/test_distance_lcsuffix.py
1
3807
# Copyright 2019-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...
gpl-3.0
-7,795,928,867,170,334,000
40.380435
79
0.637773
false
njase/numpy
numpy/polynomial/hermite.py
10
57840
""" Objects for dealing with Hermite series. This module provides a number of objects (mostly functions) useful for dealing with Hermite series, including a `Hermite` class that encapsulates the usual arithmetic operations. (General information on how this module represents and works with such polynomials is in the d...
bsd-3-clause
1,825,702,599,222,114,300
30.197411
79
0.593862
false
RamonGuiuGou/l10n-spain
l10n_es_payment_order/wizard/csb58.py
13
15269
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2006 ACYSOS S.L. (http://acysos.com) All Rights Reserved. # Pedro Tarrafeta <pedro@acysos.com> # Ignacio I...
agpl-3.0
3,992,297,514,030,500,400
42.116147
79
0.524442
false
robotican/ric
ric_board/scripts/RiCConfigurator/BAL/Devices/launchFile.py
1
3040
__author__ = 'tom' from PyQt4.QtGui import * from BAL.Interface.DeviceFrame import LAUNCH, EX_DEV, DeviceFrame from lxml.etree import Element, SubElement, XML import rospkg class RosLaunch(DeviceFrame): def __init__(self, frame, data): DeviceFrame.__init__(self, EX_DEV, frame, data) self._pkg = ''...
bsd-3-clause
6,118,794,795,914,775,000
32.043478
124
0.569737
false