repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
daonb/django-notification
setup.py
1
1041
from distutils.core import setup setup( name='django-notification', version=__import__('notification').__version__, description='Many sites need to notify users when certain events have occurred and to allow configurable options as to how those notifications are to be received. The project aims to provide ...
mit
3,924,761,397,491,651,600
39.038462
241
0.659942
false
4.689189
false
false
false
zetaops/SpiffWorkflow
SpiffWorkflow/bpmn/parser/task_parsers.py
1
9377
# -*- coding: utf-8 -*- from __future__ import division # Copyright (C) 2012 Matthew Hampton # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at ...
lgpl-3.0
-2,078,421,531,639,438,000
38.23431
125
0.647649
false
4.287609
false
false
false
jarod-w/ocsetup
ocsetup/ocsetup_ui_constants.py
1
2271
#!/usr/bin/env python # encoding=utf-8 # Copyright (C) 2012 Sunus Lee, CT # # 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 versi...
gpl-2.0
-3,508,203,991,537,941,500
30.541667
79
0.737561
false
2.817618
false
false
false
hvanderlaan/ikea-smartlight
tradfri-groups.py
1
2536
#!/usr/bin/env python # file : tradfri-groups.py # purpose : controlling status from the Ikea tradfri smart groups # # author : harald van der laan # date : 2017/11/01 # version : v1.2.0 # # changelog : # - v1.2.0 update for gateway 1.1.15 issues (harald) # - v1...
gpl-3.0
6,765,534,810,563,812,000
32.368421
98
0.605678
false
3.507607
false
false
false
tanderegg/ansible-modules-core
cloud/amazon/iam.py
1
29461
#!/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 distributed...
gpl-3.0
2,938,177,219,696,797,000
39.028533
213
0.572859
false
4.068075
false
false
false
MJuddBooth/pandas
pandas/tests/series/test_operators.py
1
25957
# coding=utf-8 # pylint: disable-msg=E1101,W0612 from datetime import datetime, timedelta import operator import numpy as np import pytest import pandas.compat as compat from pandas.compat import range import pandas as pd from pandas import ( Categorical, DataFrame, Index, Series, bdate_range, date_range, isna)...
bsd-3-clause
242,884,756,809,424,640
33.334656
80
0.534461
false
3.526287
true
false
false
Fl0rianFischer/sme_odoo
addons/website_slides/models/slides.py
2
26185
# -*- coding: utf-8 -*- import datetime import io import json from PIL import Image import re from urllib import urlencode import urllib2 from urlparse import urlparse from openerp import api, fields, models, SUPERUSER_ID, _ from openerp.tools import image from openerp.exceptions import Warning from openerp.addons.we...
gpl-3.0
-5,301,546,923,757,541,000
48.686907
189
0.611342
false
3.87524
true
false
false
matham/moa
moa/tests/test_state_recovery.py
1
4371
import unittest class RecoveryTestCase(unittest.TestCase): path = '' def setUp(self): import os from os import path self.path = path.join(path.abspath(path.dirname(__file__)), 'mrec_temp') if not os.path.exists(self.path): os.mkdir(s...
mit
6,859,785,622,317,480,000
36.358974
79
0.610387
false
3.579853
true
false
false
centralniak/railworks-dispatcher
setup.py
1
1417
#!/usr/bin/env python import os from setuptools import setup CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Intended Audience :: End Users/Desktop', 'License :: OSI Approved :: MIT License', 'Operating System :: Microsoft :: Windows', 'Programming Language :: Python', 'Topic :: Games/Ent...
mit
4,140,694,050,081,376,000
29.804348
101
0.66549
false
3.605598
false
false
false
helicontech/zoo
Zoocmd/core/env_manager.py
1
1125
# -*- coding: utf-8 -*- class EnvManager(object): """ Коллекция переменных окружения. """ def __init__(self): # внутренне коллекция self.vars = dict() def expandvars(self, path: str): """ Заменяет переменные окружения в пути на значения. """ resul...
apache-2.0
-4,402,580,731,429,686,300
21.642857
62
0.514737
false
2.683616
false
false
false
macbre/index-digest
indexdigest/database.py
1
11378
""" Database connector wrapper """ import logging import re from collections import OrderedDict, defaultdict from warnings import filterwarnings import MySQLdb from MySQLdb.cursors import DictCursor from MySQLdb._exceptions import OperationalError, ProgrammingError from indexdigest.schema import Column, Index from in...
mit
-5,335,004,131,898,290,000
29.021108
100
0.563983
false
4.079598
false
false
false
leiferikb/bitpop
build/scripts/slave/recipes/codesearch.py
1
1506
# 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. DEPS = [ 'chromium', 'gclient', 'gsutil', 'path', 'properties', 'python', 'step', ] def GenSteps(api): tarball_name = api.properties.get('ta...
gpl-3.0
8,138,538,737,411,672,000
27.961538
74
0.638778
false
3.399549
false
false
false
Insoleet/aiohttp
aiohttp/wsgi.py
1
6627
"""wsgi server. TODO: * proxy protocol * x-forward security * wsgi file support (os.sendfile) """ import asyncio import inspect import io import os import sys from urllib.parse import urlsplit import aiohttp from aiohttp import server, hdrs __all__ = ('WSGIServerHttpProtocol',) class WSGIServerHttpProtocol(...
apache-2.0
-1,170,978,584,572,801,500
29.539171
78
0.577033
false
4.095797
false
false
false
triflesoft/django-application-talos
applications/talos_rest/validators.py
1
3005
# This method validates mobile phone # using Django's built in RegexpValidator # And raises serializers.ValidationError if some # error occurs from talos_rest import constants from re import compile email_regex = compile(r'^[^@]+@[^@]+\.[^@]+$') def validate_phone(phone, validate_uniqueness=False): from django....
bsd-3-clause
7,669,992,987,828,616,000
33.54023
126
0.657903
false
4.808
false
false
false
iulian787/spack
var/spack/repos/builtin/packages/py-pyopencl/package.py
2
1331
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyPyopencl(PythonPackage): """Python wrapper for OpenCL.""" homepage = "https://docu...
lgpl-2.1
-5,569,500,365,171,931,000
37.028571
98
0.636364
false
2.91886
false
false
false
studiobytestorm/YDM
ylister.py
1
2450
# coding: utf-8 # In[2]: # Name: youParse.py # Version: 1.3 # Author: pantuts # Description: Parse URLs in Youtube User's Playlist (Video Playlist not Favorites) # Use python3 and later # Agreement: You can use, modify, or redistribute this tool under # the terms of GNU General Public License (GPLv3). # This tool is...
gpl-2.0
5,190,535,159,306,234,000
22.786408
93
0.530612
false
3.257979
false
false
false
toway/towaymeetups
mba/views/infomations.py
1
2008
#!/usr/bin/python # coding: utf-8 from datetime import datetime import deform import colander import jinja2 from deform import ValidationFailure from deform.widget import CheckedPasswordWidget from pyramid.view import view_config from pyramid.httpexceptions import HTTPForbidden from pyramid.httpexceptions import HTTP...
gpl-3.0
851,975,616,576,866,200
24.1
85
0.729084
false
3.281046
true
false
false
gusdan/django-elasticache
django_elasticache/cluster_utils.py
1
2219
""" utils for discovery cluster """ from distutils.version import StrictVersion from django.utils.encoding import smart_text import re from telnetlib import Telnet class WrongProtocolData(ValueError): """ Exception for raising when we get something unexpected in telnet protocol """ def __init__(se...
mit
8,953,881,322,708,368,000
27.818182
76
0.55881
false
3.679934
false
false
false
minghuascode/pyj
library/pyjamas/HTTPRequest.browser.py
1
2667
class HTTPRequest(object): def doCreateXmlHTTPRequest(self): if JS("""typeof $wnd.XMLHttpRequest != 'undefined'"""): # IE7+, Mozilla, Safari, ... res = JS("""new XMLHttpRequest()""") return res return None def asyncImpl(self, method, user, pwd, url, postData,...
apache-2.0
5,295,085,839,185,521,000
36.041667
93
0.511436
false
4.590361
false
false
false
ufal/neuralmonkey
neuralmonkey/decoders/ctc_decoder.py
1
5403
from typing import Dict import tensorflow as tf from typeguard import check_argument_types from neuralmonkey.dataset import Dataset from neuralmonkey.decorators import tensor from neuralmonkey.model.feedable import FeedDict from neuralmonkey.model.parameterized import InitializerSpecs from neuralmonkey.model.model_pa...
bsd-3-clause
5,719,258,912,911,822,000
34.084416
79
0.609291
false
3.932314
false
false
false
sahiljain/catapult
dashboard/dashboard/pinpoint/handlers/isolated.py
1
3009
# Copyright 2016 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. """Service for tracking .isolateds and looking them up by builder and commit. An .isolated file is a way to describe the dependencies of a specific build. ...
bsd-3-clause
-7,993,889,154,747,204,000
32.808989
82
0.696909
false
3.98543
false
false
false
drepetto/chiplotle
chiplotle/documentation/scripts/compile_api.py
1
2458
#!/usr/bin/env python def compile_plotters(): from chiplotle import plotters content = 'Chiplotle Known Plotters\n' content += '========================\n\n' ## get classes in plotters... for cls in dir(plotters): if not cls.startswith('__'): content += '.. autoclass:: chiplo...
gpl-3.0
891,172,439,412,085,600
24.873684
75
0.548413
false
3.641481
false
false
false
pulp/devel
scripts/checkout.py
1
2899
#!/usr/bin/env python3 import argparse import os import subprocess import sys import requests import yaml # Make a Python 3 virtualenv and install requests and PyYAML # pyvenv pulp_checkout # source pulp_checkout/bin/activate # pip install requests PyYAML # # Run the script using the Python3 interpreter # ...
gpl-2.0
-8,274,774,061,209,647,000
34.353659
150
0.646775
false
3.596774
false
false
false
fhcrc/ampliconnoise
anoisetools/test/scripts/test_split.py
1
1320
import unittest from anoisetools.scripts import split def _line_iterator(s): return iter(s.splitlines()) class ReadBarcodeTestCase(unittest.TestCase): def test_basic(self): s = "Barcode1,ACGTGA,ACGT" i = _line_iterator(s) actual = split.load_barcodes(i) self.assertEqual(1, le...
gpl-3.0
6,850,267,133,278,299,000
29.697674
61
0.610606
false
3.393316
true
false
false
mpascu/universal-data-logger
universaldatalogger/settings.py
1
3474
""" Django settings for universaldatalogger project. Generated by 'django-admin startproject' using Django 1.11.3. 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/ ""...
gpl-3.0
-4,638,098,541,751,851,000
24.740741
91
0.675302
false
3.480962
false
false
false
mozilla/inventory
core/search/views.py
1
5906
from django.shortcuts import render from django.http import HttpResponse, Http404 from django.db.utils import DatabaseError from django.core.exceptions import ValidationError from mozdns.utils import get_zones from core.search.compiler.django_compile import compile_to_django from core.search.compiler.django_compile i...
bsd-3-clause
-7,082,705,490,358,729,000
31.994413
79
0.601422
false
3.921647
false
false
false
azgs/hazards-viewer
python/zonal_stats.py
1
3850
import gdal class GDALCalculateArea: """ Problem: How do we compute zonal stats from a raster given only a bounding box from geoserver? Geoserver Bounding Box = [LEFT,BOTTOM,RIGHT,TOP] So, corner coordinates = A:(LEFT,TOP) B:(LEFT,BOTTOM) C:(RIGHT,BOTTOM) D:(RIGHT,TOP) * ------------------------> * ...
mit
5,799,255,570,391,207,000
29.085938
63
0.660779
false
2.907855
false
false
false
YannChemin/wxGIPE
proc_modis_stateqa.py
1
19388
############################################################################### # $Id$ # # Project: Sub1 project of IRRI # Purpose: State Quality Assessment extraction from MODIS09A (500m) # Author: Yann Chemin, <yann.chemin@gmail.com> # ##############################################################################...
unlicense
2,442,333,516,317,674,000
29.436421
232
0.669589
false
2.69203
false
false
false
mariofix/ad-login
adlogin.py
1
1088
#!/usr/bin/python # Mario Hernandez # github.com/mariofix # Licences under GPL v3 # # For use with nginx # uwsgi -s /tmp/ad-login.sock -w adlogin:app --enable-threads --chmod-socket=666 # import bender from flask import Flask, request, jsonify app = Flask(__name__) @app.route("/auth", methods=["GET", "POST"]) def aut...
gpl-3.0
-2,111,995,277,812,121,300
30.085714
93
0.596507
false
3.389408
false
false
false
snoopycrimecop/snoopycrimecop
test/integration/Sandbox.py
1
5143
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 University of Dundee & Open Microscopy Environment # All Rights Reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundat...
gpl-2.0
2,442,089,335,320,077,000
31.345912
76
0.572429
false
4.072051
false
false
false
varikin/dali
dali/gallery/tests/admin.py
1
9324
from django.contrib.auth.models import User, Permission from django.core.exceptions import ValidationError from django.core.files.uploadedfile import SimpleUploadedFile from django.http import HttpRequest, QueryDict from django.test import TestCase from django.test.client import Client from dali.gallery.admin.forms imp...
apache-2.0
-3,810,525,009,990,027,300
41.575342
113
0.656371
false
3.588915
true
false
false
googleapis/googleapis-gen
google/cloud/bigquery/v2/bigquery-v2-py/google/cloud/bigquery_v2/services/model_service/transports/grpc_asyncio.py
1
15036
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
2,729,069,836,911,825,000
43.75
87
0.606278
false
4.72533
false
false
false
CroissanceCommune/autonomie
autonomie/tests/forms/tasks/test_invoice.py
1
10550
# -*- coding: utf-8 -*- # * Authors: # * TJEBBES Gaston <g.t@majerti.fr> # * Arezki Feth <f.a@majerti.fr>; # * Miotte Julien <j.m@majerti.fr>; import colander import pytest import datetime from autonomie.forms.tasks.invoice import ( get_add_edit_invoice_schema, get_add_edit_cancelinvoice_schem...
gpl-3.0
-1,022,901,219,711,277,700
25.971867
79
0.51849
false
3.673285
true
false
false
greginvm/grslicer
grslicer/path_optimization.py
1
5150
import numpy as np from quadtree import Quadtree from grslicer.util.np import get_aabb, to_ndarray, euclidean_dist_square, closest_point_on_edge POINT_AABB = to_ndarray([[-10, -10], [10, 10]]) def follow(paths, get_start_func, closed=True): """ Iterate through paths as they follow by closeness. Yields the ...
mit
-392,566,794,474,796,000
31.802548
105
0.585825
false
3.454058
false
false
false
budgie333/tingbot-weather_clock
weather.tingapp/main.py
1
14915
import tingbot from tingbot import * import urllib2 import json import time import datetime from collections import deque temperature_str = "n/a" description_str = "" icon_str = "icons/na.png" screen_index = 0 max_screens = 3 # can increase to 4 if log screen is enabled forecast_list = [] update_time_str = "" default...
mit
-8,466,071,929,580,032,000
31.353579
319
0.606705
false
3.45015
false
false
false
agati/chimera
src/chimera/controllers/xephem.py
1
3142
from chimera.core.chimeraobject import ChimeraObject from chimera.util.position import Position import os import time from select import select class XEphem (ChimeraObject): __config__ = {"telescope": "/Telescope/0", "fifo_dir": "/usr/local/share/xephem/fifos"} def __init__(self): ...
gpl-2.0
1,466,909,973,336,224,300
29.803922
76
0.526098
false
3.81774
false
false
false
dplepage/jugular
jugular/jugular.py
1
7730
from collections import namedtuple Injection = namedtuple("Injection", ("token")) def Inject(*args): def wrap(token): inj = getattr(token, '_injections', []) for arg in args: if not isinstance(arg, Injection): arg = Injection(arg) inj.append(arg) tok...
bsd-2-clause
-3,286,143,294,172,708,000
34.953488
91
0.63467
false
4.432339
false
false
false
Azure/azure-sdk-for-python
sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_files_operations.py
1
26692
# 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 ...
mit
-1,518,122,571,669,457,400
45.992958
218
0.6321
false
4.232123
true
false
false
Azure/azure-sdk-for-python
sdk/graphrbac/azure-graphrbac/azure/graphrbac/models/group_get_member_groups_parameters_py3.py
1
1627
# 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
-4,880,007,092,351,924,000
38.682927
101
0.640443
false
4.74344
false
false
false
htmue/python-autocheck
autocheck/colorizer.py
1
2367
# -*- coding:utf-8 -*- # Created by Hans-Thomas on 2011-05-29. #============================================================================= # colorizer.py --- Colours #============================================================================= from __future__ import absolute_import, unicode_literals import os.pa...
unlicense
2,774,248,385,566,842,400
28.962025
78
0.525137
false
4.375231
false
false
false
pytorch/fairseq
examples/simultaneous_translation/utils/latency.py
1
14758
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import torch class LatencyMetric(object): @staticmethod def length_from_padding_mask(padding_mask, batch_first: bool = False): ...
mit
5,185,030,656,978,680,000
31.722838
88
0.553056
false
3.574231
false
false
false
rohithb/threeSixtyOne
fromRakr/PredictorFuncs.py
1
7692
from predictor.models import DepWords from feedReader.mongoFunctions import Mongo from bs4 import BeautifulSoup from nltk.corpus import stopwords from nltk.stem.wordnet import WordNetLemmatizer from math import ceil, sqrt import logging # Get an instance of a logger logger = logging.getLogger(__name__) class Predict...
mit
1,391,004,545,458,817,800
37.189055
94
0.501498
false
4.30213
false
false
false
kevin8909/xjerp
openerp/addons/Rainsoft_Xiangjie/report/rainsoft_saleout_report.py
1
1739
# -*- coding:utf-8 -*- from report import report_sxw from tools.translate import _ import rml_parse import time class rainsoft_saleout_report(rml_parse.rml_parse): def __init__(self,cr,uid,name,context): super(rainsoft_saleout_report, self).__init__(cr, uid, name, context) self.localcontext.update({ ...
agpl-3.0
1,540,376,732,320,393,200
33.78
91
0.645773
false
3.034904
false
false
false
sebdah/markdown-docs
markdowndocs/web_server.py
1
1682
# -*- coding: utf-8 -*- """ Embedded web server implementation APACHE LICENSE 2.0 Copyright 2013 Sebastian Dahlgren 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/license...
apache-2.0
-3,753,776,392,870,531,000
32
79
0.682521
false
4.194514
false
false
false
Lucterios2/core
lucterios/CORE/editors.py
1
7742
# -*- coding: utf-8 -*- ''' Describe database model for Django @author: Laurent GAY @organization: sd-libre.fr @contact: info@sd-libre.fr @copyright: 2015 sd-libre.fr @license: This file is part of Lucterios. Lucterios is free software: you can redistribute it and/or modify it under the terms of the GNU General Publi...
gpl-3.0
6,148,376,695,377,183,000
41.076087
166
0.64389
false
3.645009
false
false
false
houssine78/addons
website_event_attendance/models/event.py
1
1085
# -*- coding: utf-8 -*- from openerp import _, api, fields, models import random from urlparse import urljoin class EventEvent(models.Model): _inherit = 'event.event' token = fields.Char(string="Token", readonly=True) event_attendance_url = fields.Char(string="Event attendance url", r...
agpl-3.0
-5,036,463,516,516,101,000
31.96875
85
0.619355
false
4.078947
false
false
false
flavors/countries
countries/management/commands/loadcountries.py
1
1691
from django.core.management import call_command from ... import models from ...fields import get_one_to_many_fields, get_self_reference_fields from ._base import DumperBaseCommand class Command(DumperBaseCommand): help = 'Load data' def handle(self, **options): self.verbosity = options['verbosity'] ...
mit
2,416,379,053,813,985,300
32.156863
74
0.594323
false
3.941725
false
false
false
kawamon/hue
desktop/libs/kafka/src/kafka/kafka_api.py
1
3371
#!/usr/bin/env python # -- coding: utf-8 -- # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (th...
apache-2.0
-8,102,835,474,430,322,000
24.345865
95
0.681104
false
3.720751
false
false
false
ssarangi/numba
numba/testing.py
1
1529
from __future__ import print_function, division, absolute_import import sys import functools from numba import config def allow_interpreter_mode(fn): """Temporarily re-enable intepreter mode """ @functools.wraps(fn) def _core(*args, **kws): config.COMPATIBILITY_MODE = True try: ...
bsd-2-clause
2,334,689,474,276,244,500
23.66129
65
0.621321
false
4.200549
true
false
false
gibil5/openhealth
models/marketing/patient_line.py
1
6758
# -*- coding: utf-8 -*- """ Patient Line - Used by Marketing Only Data model. No functions. Created: 16 May 2018 Last up: 29 mar 2021 """ from openerp import models, fields, api from openerp.addons.openhealth.models.patient import pat_vars #from openerp.addons.openhealth.models.libs import eval_vars...
agpl-3.0
-8,251,336,293,806,691,000
14.627315
133
0.529403
false
2.916199
false
false
false
adelina-t/nova
nova/virt/libvirt/volume.py
1
68636
# Copyright 2011 OpenStack Foundation # (c) Copyright 2013 Hewlett-Packard Development Company, L.P. # 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 # # ...
apache-2.0
-3,676,450,116,032,374,300
42.167296
79
0.554753
false
4.219599
true
false
false
miurahr/pinax-teams
pinax/teams/views.py
1
10627
import json from django.http import Http404, HttpResponse, HttpResponseRedirect, HttpResponseForbidden from django.shortcuts import render, redirect, get_object_or_404 from django.template import RequestContext from django.template.loader import render_to_string from django.views.decorators.http import require_POST fr...
mit
-2,445,942,896,833,156,000
30.722388
95
0.633951
false
3.889824
false
false
false
Arkapravo/morse-0.6
src/morse/actuators/steer_force.py
1
2152
import logging; logger = logging.getLogger("morse." + __name__) import bge import morse.core.actuator class SteerForceActuatorClass(morse.core.actuator.MorseActuatorClass): """ Motion controller using engine force and steer angle speeds This class will read engine force and steer angle (steer, force) as i...
bsd-3-clause
-2,409,979,239,668,718,600
41.196078
75
0.64777
false
3.666099
false
false
false
benjamincongdon/CrowdShout
src/TwitchClient.py
1
1317
import json import os import urllib2 def IsChannelOnline(channelName): url ="https://api.twitch.tv/kraken/streams/" + channelName try: contents = urllib2.urlopen(url) except: print "Error: Failed to get status of \"" + channelName + "\"" return False contents = json.load(content...
mit
1,192,647,015,215,459,600
30.380952
113
0.627942
false
3.943114
false
false
false
zestrada/nova-cs498cc
nova/tests/compute/test_host_api.py
1
14791
# Copyright (c) 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
-834,515,088,002,063,600
42.122449
78
0.540126
false
4.044572
true
false
false
goors/flask-microblog
models/Post.py
1
1248
from models import db import time from User import User tags = db.Table('PostTag', db.Column('Tag', db.Integer, db.ForeignKey('Tag.Id')), db.Column('Post', db.Integer, db.ForeignKey('Post.Id')) ) class Post(db.Model): __tablename__ = 'Post' Id = db.Column(db.Integer, primary_...
apache-2.0
-8,783,952,425,001,518,000
29.439024
87
0.609776
false
3.363881
false
false
false
QinMing/RPC-based_Twitter_Service
src/client/cl.py
1
1976
#!/usr/bin/env python import sys sys.path.append('gen-py') from cse124 import Twitter from cse124.ttypes import * from thrift import Thrift from thrift.transport import TSocket from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol try: transport = TSocket.TSocket('localhost', 9090) ...
bsd-2-clause
3,937,180,857,933,238,300
25.702703
56
0.730769
false
3.349153
false
false
false
muk-it/muk_web
muk_web_client_refresh/models/base.py
1
2734
################################################################################### # # Copyright (c) 2017-2019 MuK IT GmbH. # # This file is part of MuK Web Refresh # (see https://mukit.at). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero ...
lgpl-3.0
-6,982,652,058,987,150,000
41.71875
93
0.589247
false
4.721934
false
false
false
toslunar/chainerrl
chainerrl/misc/prioritized.py
1
12456
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() # NOQA import collections import numpy as np from chainerrl.misc.r...
mit
5,337,231,613,446,384,000
28.516588
79
0.531952
false
3.711561
false
false
false
pchristos/amqp-middleware
tests/test.py
1
3654
import unittest import pika import json import time import requests import threading import amqpconsumer.components.agent class AMQPTest(unittest.TestCase): def setUp(self): reg = requests.post('http://localhost/api/v1/insights/register', data=json.dumps({'name': 'Unit Teste...
apache-2.0
119,440,002,291,704,400
26.066667
79
0.484127
false
4.180778
true
false
false
decvalts/cartopy
lib/cartopy/examples/un_flag.py
1
7466
""" UN Flag ------- A demonstration of the power of Matplotlib combined with cartopy's Azimuthal Equidistant projection to reproduce the UN flag. """ import cartopy.crs as ccrs import cartopy.feature as cfeature import matplotlib.pyplot as plt from matplotlib.patches import PathPatch import matplotlib.path import mat...
gpl-3.0
-3,271,768,500,589,883,400
45.6625
77
0.541522
false
2.650337
false
false
false
VIRL-Open/virl-utils
ports.py
1
2841
#!/usr/bin/env python # # vim: tabstop=4 noexpandtab shiftwidth=4 softtabstop=0 # # Show all ports of all VM instances for # all users and topologies. # Like the console port and the VNC port # # v0.3 18-Feb-2017 # adjusted to Mitaka # v0.2 02-Dec-2015 # adapted to Kilo release # v0.1 24-Nov-2014 # initial release # # ...
isc
8,876,054,256,444,263,000
33.228916
85
0.57339
false
3.793057
false
false
false
NoBodyCam/TftpPxeBootBareMetal
nova/db/sqlalchemy/api.py
1
180163
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (t...
apache-2.0
-2,355,571,704,509,729,000
32.941786
79
0.586264
false
4.216509
false
false
false
titainium/goldmap
segmentwords/segmentWords.py
1
3142
#!/usr/bin/env python """ some configureation parameters list here. Titainium Deng knifewolf@126.com """ import asyncio import os import re import sys from pyArango import connection import jieba import uvloop from config import JIEBA_LOGGER class BaseCutter: """ A word segment class base on jieba librar...
gpl-3.0
6,911,273,856,929,496,000
27.878505
121
0.538038
false
3.409492
false
false
false
Newsboy-VA/Newsboy-Core
client/user_io/text_io.py
1
2047
#!/usr/bin/env python3 import collections import curses import logging try: from .base_io import BaseIO except SystemError: from base_io import BaseIO class TextIO(BaseIO): ''' An interface with the user via a terminal ''' def __init__(self): super().__init__() self.stdscr = curses.i...
gpl-3.0
859,501,667,479,397,000
22.528736
69
0.508061
false
3.826168
false
false
false
DarthMaulware/EquationGroupLeaks
Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/os.py
1
24614
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: os.py r"""OS routines for Mac, NT, or Posix depending on what system we're on. This exports: - all functions from posix, nt, os2, or ce, e.g. unli...
unlicense
-4,292,814,936,018,871,300
31.092568
156
0.582717
false
4.103017
false
false
false
chromium/chromium
components/module_installer/android/module_desc_java.py
6
3310
#!/usr/bin/env python # # Copyright 2019 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. """Writes Java module descriptor to srcjar file.""" import argparse import os import sys import zipfile sys.path.append( os.path...
bsd-3-clause
-5,560,688,175,210,369,000
31.772277
80
0.621148
false
3.857809
false
false
false
henare/parlparse
wrans-2014/parse.py
1
14143
#!/usr/bin/env python # # UK Parliament Written Answers are now in a new database-driven website. This # site has a nice search, and RSS feeds, but for now we still need a bit of # scraping to fetch the data. Ever so slightly simpler than the past, though! import argparse import datetime import json import os import r...
agpl-3.0
-104,417,759,261,230,430
37.224324
188
0.603267
false
3.376223
false
false
false
google-research/python-graphs
python_graphs/control_flow_graphviz_test.py
1
1438
# Copyright (C) 2021 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
7,260,058,033,423,199,000
34.073171
80
0.734353
false
3.568238
true
false
false
Distrotech/qtjsbackend
src/3rdparty/v8/tools/test-wrapper-gypbuild.py
1
10738
#!/usr/bin/env python # # Copyright 2012 the V8 project authors. 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 # noti...
gpl-3.0
-550,229,066,310,682,300
39.067164
102
0.624884
false
4.081338
true
false
false
rmallermartins/graphun
src/python/main.py
1
1088
import sys sys.path.append("Structures/") sys.path.append("Algorithms/") from sys import argv from bfs import Bfs from bf import Bf from fw import Fw from scc import Scc from dk import Dk from graph import Graph def main(): G = Graph() G.buildGraph(argv[2]) if argv[1] == 'bfs': s = G.getInitVe...
mit
-3,409,868,393,373,458,000
19.528302
50
0.47886
false
3.108571
false
false
false
chunweiyuan/xarray
xarray/coding/variables.py
1
10849
"""Coders for individual Variable objects.""" from typing import Any import warnings from functools import partial import numpy as np import pandas as pd from ..core import dtypes, duck_array_ops, indexing from ..core.pycompat import dask_array_type from ..core.variable import Variable class SerializationWarning(Ru...
apache-2.0
-5,412,761,502,272,440,000
37.066667
79
0.620241
false
4.163085
false
false
false
seehuhn/py-jvplot
jvplot/param.py
1
7154
# param.py - default parameters for the jvplot package # Copyright (C) 2014 Jochen Voss <voss@seehuhn.de> # # 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 # ...
gpl-3.0
2,827,255,526,208,211,500
45.75817
122
0.599105
false
3.47619
false
false
false
Vauxoo/stock-logistics-warehouse
stock_cycle_count/reports/report_stock_location_accuracy.py
1
1289
# Copyright 2017 Eficent Business and IT Consulting Services S.L. # (http://www.eficent.com) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import api, models class LocationAccuracyReport(models.AbstractModel): _name = "report.stock_location_accuracy" _description = "Locati...
agpl-3.0
6,055,364,514,302,601,000
32.921053
77
0.596587
false
3.682857
false
false
false
Azure/azure-sdk-for-python
sdk/search/azure-mgmt-search/azure/mgmt/search/models/_search_management_client_enums.py
1
7042
# 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 ...
mit
6,232,084,900,551,837,000
43.853503
105
0.710026
false
4.371198
false
false
false
likit/gimme
src/utils/find_MXE.py
1
7910
'''The script identifies mutually exclusive exons from a BED file. Output is written in GFF format suitable for differential exon usage analysis using MISO. ''' import sys import csv import networkx as nx from bx.intervals import IntervalTree class Exon(object): def __init__(self, chrom, start, end, transcript...
gpl-3.0
1,385,375,321,500,569,300
34.3125
79
0.48445
false
3.545495
false
false
false
mbohlool/client-python
kubernetes/client/models/v1_group_version_for_discovery.py
1
4487
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
apache-2.0
-8,085,997,802,482,238,000
27.762821
136
0.573211
false
4.460239
false
false
false
corochann/chainerex
examples/sklearn_wrapper/mnist_classification/train_mnist.py
1
5271
#!/usr/bin/env python """ Originally from https://github.com/chainer/chainer/blob/master/examples/mnist/train_mnist.py But SklearnWrapperClassifier is used instead of L.Classifier """ from __future__ import print_function import os import sys try: import matplotlib matplotlib.use('Agg') except ImportError:...
mit
-4,928,916,235,757,543,000
35.604167
79
0.639158
false
3.91314
false
false
false
michaellaier/pymor
src/pymor/operators/cg.py
1
28361
# -*- coding: utf-8 -*- # This file is part of the pyMOR project (http://www.pymor.org). # Copyright Holders: Rene Milk, Stephan Rave, Felix Schindler # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) # # Contributors: lucas-ca <lucascamp@web.de> """ This module provides some operators for ...
bsd-2-clause
-5,337,526,238,773,474,000
42.280916
119
0.611838
false
3.669773
false
false
false
google-research/falken
service/common/generate_protos.py
1
4766
# 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
-8,586,384,013,007,797,000
33.788321
84
0.698279
false
3.629855
false
false
false
tordable/XlsxReports
table.py
1
1515
"""A table which holds the data of the report.""" __author__ = 'jt@javiertordable.com' __copyright__ = "Copyright (C) 2014 Javier Tordable" class Table(object): """A table which holds the data of the report. The table has a series of rows and columns, the columns have to be defined on construction and the row...
apache-2.0
7,262,745,502,388,254,000
25.12069
79
0.640924
false
3.466819
false
false
false
hanwenyan/ud858
Lesson_2/000_Hello_Endpoints/helloworld_api.py
1
1854
"""Hello World API implemented using Google Cloud Endpoints. Contains declarations of endpoint, endpoint methods, as well as the ProtoRPC message class and container required for endpoint method definition. """ import endpoints from protorpc import messages from protorpc import message_types from protorpc import remot...
gpl-3.0
4,659,189,719,289,631,000
29.9
65
0.683387
false
4.065789
false
false
false
torepublic/torepublic
torshammer/torshammer.py
1
7620
#!/usr/bin/python # this assumes you have the socks.py (http://phiral.net/socks.py) # and terminal.py (http://phiral.net/terminal.py) in the # same directory and that you have tor running locally # on port 9050. run with 128 to 256 threads to be effective. # kills apache 1.X with ~128, apache 2.X / IIS with ~256 # n...
gpl-2.0
-9,130,051,862,714,684,000
37.484848
135
0.551312
false
3.097561
false
false
false
c00w/bitHopper
bitHopper/Tracking/__init__.py
1
1777
from getwork_store import Getwork_Store from bitHopper.util import * import Tracking import bitHopper.LongPoll_Listener import json, logging __store = False def __patch(): global __store if not __store: __store = Getwork_Store() def headers(headers, server): """ Deals with headers fro...
mit
940,368,637,148,643,600
24.028169
63
0.615644
false
3.780851
false
false
false
FundedByMe/django-uc
uc/uc.py
1
2620
from __future__ import print_function from django.conf import settings from suds.client import Client from suds.plugin import MessagePlugin import sys def get_client(product_code): url = "https://www.uc.se/UCSoapWeb/services/ucOrders2" client = Client(url + "?wsdl", plugins=[VersionPlugin(product_code)]) ...
mit
8,922,698,252,316,484,000
33.933333
116
0.683588
false
3.80814
false
false
false
buzzsurfr/lbm
ltm/structures.py
1
2224
class VirtualServerType: RESOURCE_TYPE_POOL = 0 RESOURCE_TYPE_IP_FORWARDING = 1 RESOURCE_TYPE_L2_FORWARDING = 2 RESOURCE_TYPE_REJECT = 3 RESOURCE_TYPE_FAST_L4 = 4 RESOURCE_TYPE_FAST_HTTP = 5 RESOURCE_TYPE_STATELESS = 6 RESOURCE_TYPES = ( 'Standard', 'Forwarding (IP)', 'Forwarding (Layer 2)', 'Reject',...
mit
7,843,954,073,265,745,000
22.166667
54
0.689748
false
2.715507
false
false
false
smart-classic/smart_ui_server
admin_ui/views.py
1
4638
from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpResponseForbidden, HttpRequest from django.core.exceptions import * from django.core.urlresolvers import reverse from django.conf import settings import urllib import urlparse from smart_ui_server import utils from smart_ui_server.ui.views import...
apache-2.0
-2,683,072,347,359,787,000
30.127517
128
0.661492
false
3.728296
false
false
false
rapidpro/casepro
casepro/backend/rapidpro.py
1
14828
from typing import Tuple from dash.utils import chunks, is_dict_equal from dash.utils.sync import BaseSyncer, SyncOutcome, sync_local_to_changes, sync_local_to_set from django.utils.timezone import now from casepro.contacts.models import Contact, Field, Group from casepro.msgs.models import Label, Message, Outgoing ...
bsd-3-clause
8,467,466,680,998,822,000
34.389021
119
0.615187
false
3.82362
false
false
false
pascalc/machine_poetry
db/corpus/syllable.py
1
3648
#!/usr/bin/python # -*- coding: utf-8 -*- """ Lingua::EN::Syllable::syllable() estimates the number of syllables in the word passed to it. Note that it isn't entirely accurate... it fails (by one syllable) for about 10-15% of my /usr/dict/words. The only way to get a 100% accurate count is to do a dictionary look...
mit
8,567,287,578,994,754,000
31
77
0.652686
false
3.065546
false
false
false
ryanfobel/microdrop
microdrop/core_plugins/zmq_hub_plugin/__init__.py
1
3782
""" Copyright 2015 Christian Fobel This file is part of zmq_hub_plugin. zmq_hub_plugin 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. dmf...
gpl-3.0
-8,469,342,942,459,653,000
34.018519
80
0.64331
false
4.418224
false
false
false
lmcinnes/umap
setup.py
1
2238
from setuptools import setup def readme(): try: with open("README.rst", encoding="UTF-8") as readme_file: return readme_file.read() except TypeError: # Python 2.7 doesn't support encoding argument in builtin open import io with io.open("README.rst", encoding="UTF-8...
bsd-3-clause
3,011,616,037,234,713,600
29.243243
83
0.542449
false
3.858621
false
false
false
risicle/docoskin
docoskin/warping.py
1
6097
from __future__ import absolute_import from collections import namedtuple from itertools import compress import logging import cv2 import numpy from docoskin import defaults from docoskin.dummythreadpoolexecutor import DummyThreadPoolExecutor from docoskin.exceptions import DocoskinInvalidArgumentCombinationError, D...
gpl-3.0
8,729,212,491,408,042,000
39.919463
125
0.685911
false
3.951393
false
false
false
meteoswiss-mdr/monti-pytroll
scripts/input_cosmo_cronjob.py
1
15477
from __future__ import division from __future__ import print_function def input(in_msg): import inspect in_msg.input_file = inspect.getfile(inspect.currentframe()) print("*** read input from ", in_msg.input_file) in_msg.sat = "cosmo" in_msg.instrument = "cosmo" in_msg.sat_nr="1" in_msg....
lgpl-3.0
366,920,272,479,687,500
41.872576
125
0.591911
false
2.720513
false
false
false
tatsy/bssrdf-estimate
tests/test_vector3d.py
1
2531
# -*- coding: utf-8 -*- import math try: import unittest2 as unittest except: import unittest from bssrdf_estimate.tools import Vector3D class Vector3DTest(unittest.TestCase): def test_instance(self): v = Vector3D() self.assertEqual(v.x, 0.0) self.assertEqual(v.y, 0.0) se...
mit
-6,291,049,207,758,887,000
25.925532
57
0.526274
false
2.827933
true
false
false
ToonTownInfiniteRepo/ToontownInfinite
toontown/racing/DistributedGag.py
1
3931
from pandac.PandaModules import * from direct.distributed import DistributedObject from direct.interval.ProjectileInterval import * from direct.interval.IntervalGlobal import * from direct.distributed.ClockDelta import * from toontown.racing.DistributedVehicle import DistributedVehicle from DroppedGag import * class D...
mit
2,637,562,723,853,928,400
36.438095
138
0.624777
false
3.491119
false
false
false
drewvolz/BonApp-Widget
scripts/getData.py
1
2655
#!/usr/bin/env python3 import string, os, time, json, re, unicodedata, html.parser, requests # Bon appetit cafe hours api url url = "http://legacy.cafebonappetit.com/api/2/cafes" # How many cafeterias you want to parse (in order) totalCafes = 2393 # What our file should be named fileName = "data.json" # Parser to cl...
mit
-2,921,243,020,524,299,000
24.04717
69
0.67533
false
2.983146
false
false
false
joanvila/aioredlock
aioredlock/sentinel.py
1
4483
import re import ssl import urllib.parse import aioredis.sentinel class SentinelConfigError(Exception): ''' Exception raised if Configuration is not valid when instantiating a Sentinel object. ''' class Sentinel: def __init__(self, connection, master=None, password=None, db=None, ssl_context=N...
mit
-8,227,899,662,681,304,000
37.982609
101
0.574392
false
4.395098
true
false
false
Gnarlywhale/wallstweet
RawCodeToolkit/plotBot.py
1
2846
''' wallstweet, February 9th, 2014 Data mining twitter with style. Copyright 2014 Riley Dawson, Kent Rasmussen, Chadwyck Goulet 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.apa...
apache-2.0
5,430,046,170,541,993,000
31.340909
266
0.706254
false
3.245154
false
false
false
JayVora-SerpentCS/e-commerce
website_sale_product_brand/controllers/main.py
1
1937
# -*- coding: utf-8 -*- # © 2016 Serpent Consulting Services Pvt. Ltd. (http://www.serpentcs.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import http from openerp.http import request from openerp.addons.website_sale.controllers.main import QueryURL, website_sale class WebsiteSale...
agpl-3.0
-7,482,239,585,660,215,000
38.510204
79
0.538223
false
4.093023
false
false
false
AnkitBarik/inermodz
mode.py
1
2269
#!/usr/bin/env python3 # -*- coding: iso-8859-15 -*- import numpy as np import matplotlib.pyplot as plt from .velocity import * from .sigma import * from .grid import * from .libzhang import _find_rad, _find_phi from .plotlib import * class inerMod: def __init__(self,nr=33,nphi=256,ntheta=128,m=0,l=None,N=0,n=1,...
gpl-3.0
7,541,567,142,709,182,000
26.011905
112
0.528427
false
2.875792
false
false
false