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
samli6479/bigdata
stream-processing.py
1
2559
# 1. read from kafka, kafka broker, kafka topic # 2. write back to kafka, kafka broker, new kafka topic import sys import atexit import logging import json import time from kafka import KafkaProducer from kafka.errors import KafkaError, KafkaTimeoutError from pyspark import SparkContext # how to talk to spark from py...
apache-2.0
8,905,566,711,919,112,000
26.826087
131
0.729191
false
3.293436
false
false
false
t123/ReadingTool.Python
lib/stringutil.py
1
4798
import re, time, datetime class StringUtil: @staticmethod def isEmpty(x): if x is None: return True x = x.strip() if len(x)==0: return True return False @staticmethod def isTrue(x): if x is None: ...
agpl-3.0
-973,658,565,560,457,300
28.9875
80
0.40892
false
5.104255
false
false
false
2027205T/tango_with_django
tango_with_django_project/rango/bing_search.py
1
2779
import json import urllib, urllib2 import keys # Add your BING_API_KEY BING_API_KEY = keys.BING_API_KEY def main(): # The main function should ask a user for a query (from the command line) query = raw_input("Please enter a search query: ") # and then issue the query to the BING API via the run_query method res...
mit
7,681,770,095,719,579,000
31.694118
79
0.660669
false
3.981375
false
false
false
vahndi/scitwi
scitwi/trends/trend.py
1
1155
from datetime import datetime from typing import List from scitwi.places.location import Location from scitwi.utils.strs import list_obj_string, obj_string class Trend(object): def __init__(self, trend_dict: dict, as_of: datetime, created_at: datetime, locations: List[Location]): self.as_of = as_of ...
mit
-5,805,980,990,255,305,000
32
107
0.624242
false
3.5
false
false
false
akmiller01/di-quick-vis
qv/core/models.py
1
1829
from django.db import models from redactor.fields import RedactorField from jsonfield import JSONField from django.core.urlresolvers import reverse from django.conf import settings from django.utils.text import slugify import datetime from os.path import basename, splitext class Dataset(models.Model): name = model...
gpl-2.0
-582,374,485,033,654,700
41.534884
85
0.648442
false
3.537718
false
false
false
EDITD/queue_util
queue_util/producer.py
1
2789
""" Allow the ability to connect and publish to a queue. """ import logging import time import kombu import six class Producer(object): def __init__(self, dest_queue_name, rabbitmq_host, rabbitmq_port=None, serializer=None, compression=None, userid=None, password=None): ...
mit
-2,356,338,687,290,004,000
35.220779
98
0.556472
false
4.399054
false
false
false
wolverineav/horizon
openstack_dashboard/dashboards/project/networks/ports/tables.py
1
3608
# Copyright 2012 NEC Corporation # # 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 ag...
apache-2.0
-4,700,138,844,131,522,000
36.195876
79
0.627494
false
4.067644
false
false
false
muneebalam/scrapenhl
scrapenhl/scrape_game.py
1
22209
import scrapenhl_globals import os.path def get_url(season, game): """ Returns the NHL API url to scrape. Parameters ----------- season : int The season of the game. 2007-08 would be 2007. game : int The game id. This can range from 20001 to 21230 for regular season, and 30111 ...
mit
3,533,887,664,172,274,000
36.706282
117
0.578639
false
3.499685
false
false
false
b3j0f/middleware
setup.py
1
3807
#!/usr/bin/env python # -*- coding: utf-8 -*- # -------------------------------------------------------------------- # The MIT License (MIT) # # Copyright (c) 2014 Jonathan Labéjof <jonathan.labejof@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and assoc...
mit
-2,162,318,671,613,996,300
36.303922
79
0.6523
false
4.03072
false
false
false
openstack/zaqar
zaqar/tests/unit/transport/wsgi/v1/test_home.py
1
2242
# Copyright (c) 2013 Rackspace, 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 w...
apache-2.0
6,833,967,138,894,138,000
38.333333
79
0.670384
false
3.858864
false
false
false
Incubaid/pyrakoon
pyrakoon/client/admin.py
1
1551
# This file is part of Pyrakoon, a distributed key-value store client. # # Copyright (C) 2013, 2014 Incubaid BVBA # # 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.or...
apache-2.0
-7,529,183,197,661,053,000
31.3125
74
0.724049
false
3.773723
false
false
false
KeyWeeUsr/plyer
plyer/platforms/android/proximity.py
1
2058
from jnius import autoclass from jnius import cast from jnius import java_method from jnius import PythonJavaClass from plyer.platforms.android import activity from plyer.facades import Proximity ActivityInfo = autoclass('android.content.pm.ActivityInfo') Context = autoclass('android.content.Context') Sensor = autocl...
mit
839,760,729,264,712,200
28.826087
76
0.672012
false
4.003891
false
false
false
EvilCult/moviecatcher
View/PlayerView.py
1
6852
#!/usr/bin/env python # -*- coding: utf-8 -*- import tkinter import urllib.request, urllib.error, urllib.parse import ssl import io import PIL.Image import PIL.ImageTk import tkinter.messagebox import time import webbrowser from selenium import webdriver from Lib import Tools class GUI : def __init__ (self, master)...
mit
-659,800,920,965,595,600
36.093023
184
0.666771
false
2.580906
false
false
false
miti0/mosquito
utils/postman.py
1
2056
import smtplib import configargparse from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from premailer import transform class Postman: """ Simple email/postman module ! Currently supported only for gmail """ arg_parser = configargparse.get_argument_parser() arg...
gpl-3.0
7,558,057,738,645,854,000
31.634921
127
0.601654
false
3.938697
false
false
false
weidenba/recovery_sort
helper/meta.py
1
1540
from common_helper_files import get_binary_from_file from hashlib import sha256 import os import time import logging import magic import sys def generate_uid(file_path): file_data = get_binary_from_file(file_path) if file_data == b'' or type(file_data) is not bytes: return "0_0" file_hash = sha256...
gpl-3.0
581,053,022,200,500,400
25.101695
93
0.611688
false
3.40708
false
false
false
geosolutions-it/geonode
geonode/security/models.py
1
19572
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2017 OSGeo # # 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 ...
gpl-3.0
5,339,928,737,404,739,000
42.785235
120
0.540773
false
4.561175
false
false
false
paulthulstrup/moose
modules/thermopower_diffusion/thermopower_geometry.py
1
8670
import os, subprocess, re, sys import numpy as np import matplotlib.pyplot as plt import pandas as pd # Modify mesh size for all , we set: # - T_fridge = 0.005 # - T_hot = 0.3 def writeMooseInput(mesh_n): Values = { 'mesh_name': mesh_n } # First part is reading the text file with...
lgpl-2.1
-392,985,355,593,617,200
36.695652
121
0.57451
false
2.823185
false
false
false
bzhou26/leetcode_sol
p20_Valid_Parentheses.py
1
1041
''' - Leetcode problem: 20 - Difficulty: Easy - Brief problem description: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed by the same type of brackets. Open brackets must be closed in t...
mit
-6,117,799,411,657,766,000
16.965517
118
0.558117
false
3.516892
false
false
false
ryanGT/sympy
sympy/polys/wrappers.py
1
2095
from polynomial import Poly def LexPoly(*args): """Returns a polynomial with lexicographic order of terms. """ return Poly(*args, **{ 'order' : 'lex' }) from algorithms import poly_div, poly_pdiv, poly_groebner, poly_lcm, poly_gcd, \ poly_half_gcdex, poly_gcdex, poly_sqf, poly_resultant, poly_subresultan...
bsd-3-clause
5,509,448,400,583,074,000
23.08046
80
0.528401
false
2.921897
false
false
false
openstack/python-designateclient
designateclient/v2/cli/service_statuses.py
1
2982
# Copyright 2016 Hewlett Packard Enterprise Development Company LP # # Author: Endre Karlson <endre.karlson@hp.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....
apache-2.0
-2,124,062,861,226,373,000
31.064516
78
0.65996
false
3.934037
false
false
false
google/earthengine-api
python/ee/_cloud_api_utils.py
1
26796
#!/usr/bin/env python """Earth Engine helper functions for working with the Cloud API. Many of the functions defined here are for mapping legacy calls in ee.data into their new Cloud API equivalents. This generally requires remapping call parameters and result values. """ from __future__ import absolute_import from _...
apache-2.0
-7,180,240,639,461,749,000
32.328358
80
0.652
false
3.83677
false
false
false
victorfsf/RecRecife
recmap/admin.py
1
2190
# -*- encoding: utf-8 -*- from django.contrib import admin from recmap.models import Endereco, Horario, Coleta, Setor, ColetaHorario, Feedback class EnderecoAdmin(admin.ModelAdmin): fieldsets = ( (u'Nome da Rua', {'fields': ('nome_bruto', 'nome_min', 'nome')}), (u'Bairro / Geolocalização', {'fie...
gpl-2.0
-719,037,859,188,247,000
28.863014
114
0.635613
false
2.840939
false
false
false
blitzmann/Pyfa
gui/builtinAdditionPanes/droneView.py
1
8775
# ============================================================================= # Copyright (C) 2010 Diego Duclos # # This file is part of pyfa. # # pyfa 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 ...
gpl-3.0
3,243,596,477,556,555,000
33.960159
107
0.587692
false
3.780698
false
false
false
codelv/enaml-native
src/enamlnative/android/android_toast.py
1
5004
""" Copyright (c) 2017, Jairus Martin. Distributed under the terms of the MIT License. The full license is in the file LICENSE, distributed with this software. Created on Sept 18, 2017 @author: jrm """ from atom.api import Typed, Bool, set_default from .bridge import JavaBridgeObject, JavaMethod, JavaStaticMethod f...
mit
-5,463,170,937,494,007,000
30.28125
79
0.540568
false
4.205042
false
false
false
demonchild2112/travis-test
grr/server/grr_response_server/databases/mem_events.py
1
2164
#!/usr/bin/env python """The in memory database methods for event handling.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import collections from grr_response_core.lib import rdfvalue from grr_response_core.lib import utils class InMemoryDBEventMix...
apache-2.0
-6,057,583,941,528,205,000
31.298507
78
0.649261
false
4.489627
false
false
false
thinkopensolutions/server-tools
users_ldap_populate/models/users_ldap.py
1
2682
# -*- coding: utf-8 -*- # © 2012 Therp BV (<http://therp.nl>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). import re from odoo import models, api, _ from odoo.exceptions import UserError import logging _logger = logging.getLogger(__name__) try: from ldap.filter import filter_format except...
agpl-3.0
-8,825,716,694,864,436,000
32.098765
79
0.556509
false
3.995529
false
false
false
kimus/django-blocks
blocks/migrations/0006_auto__chg_field_menu_slug.py
1
6647
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Menu.slug' db.alter_column(u'blocks_menu', 'slug', self.gf('blocks.fields.SlugURLField')(...
mit
4,874,328,548,890,864,000
70.483871
154
0.546863
false
3.579429
false
false
false
spirali/nukecon
src/base/structure.py
1
10222
import logging import os.path from base import paths from base import utils import xml.etree.ElementTree as xml import itertools import copy GAMMA_LIMITS = [ 30, 90, 150, 210, 270, 330, 9999 ] GAMMA_NAMES = [ "sp", "+sc", "+ac", "ap", "-ac", "-sc", "sp" ] DIRECTION_LIMITS = [ 45, 135, 225, 315 ] DIRECTION_...
bsd-3-clause
5,950,072,718,312,121,000
27.794366
86
0.553414
false
3.780325
false
false
false
rahulunair/nova
nova/conductor/tasks/live_migrate.py
1
27649
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
-4,334,092,726,895,962,600
48.110124
79
0.619914
false
4.579165
false
false
false
bgribble/mfp
mfp/test/test-dsp.py
1
1777
from unittest import TestCase from mfp.mfp_app import MFPApp from mfp.patch import Patch from mfp.scope import NaiveScope def setup(): MFPApp().setup() def mkproc(case, init_type, init_args=None): return MFPApp().create(init_type, init_args, case.patch, None, init_type) class DSPObjectTests (TestCase): ...
gpl-2.0
1,709,242,076,048,338,700
27.206349
77
0.546427
false
3.417308
true
false
false
project-icp/bee-pollinator-app
src/icp/icp/celery.py
1
3824
from __future__ import absolute_import import os import rollbar import logging from celery import Celery from celery._state import connect_on_app_finalize from celery.signals import task_failure from django.conf import settings @connect_on_app_finalize def add_unlock_chord_task_shim(app): """ Override nati...
apache-2.0
5,018,780,426,498,828,000
33.45045
79
0.613494
false
3.983333
false
false
false
h4ng3r/radare2
sys/meson.py
1
10237
"""Meson build for radare2""" import argparse import glob import logging import os import re import shutil import subprocess import sys BUILDDIR = 'build' BACKENDS = ['ninja', 'vs2015', 'vs2017'] PATH_FMT = {} MESON = None ROOT = None log = None def set_global_variables(): """[R_API] Set global variables""" ...
lgpl-3.0
-6,741,204,642,511,179,000
34.058219
91
0.601348
false
3.240582
false
false
false
IdanMann/SnapshotGenerator
snapgen.py
1
5427
from PIL import Image from resources import common import settings class SnapshotGenerator: def __init__(self, base_available_snapshot_image, skeleton, bid_image=None, base_unavailable_snapshot_image=None): # Initialize objects self.elements_skeleton = BaseElementsSkeleton(skeleto...
mit
-1,809,330,954,875,185,000
46.191304
118
0.657638
false
3.915584
false
false
false
distributed-system-analysis/pbench
lib/pbench/server/api/resources/query_apis/controllers_list.py
1
6159
from flask import jsonify from logging import Logger from typing import Any, AnyStr, Dict from pbench.server import PbenchServerConfig from pbench.server.api.resources.query_apis import ( ElasticBase, Schema, Parameter, ParamType, PostprocessError, ) class ControllersList(ElasticBase): """ ...
gpl-3.0
-8,051,723,155,547,731,000
38.480769
88
0.508686
false
4.838178
false
false
false
dg321123/cache
response_filter.py
1
1814
import json # This assumes that only list responses are split across pages. I don't like it, but # it gets me started quickly, punting the question about handling response formats to # the future. def coalesce_response(response, n): collection = [] for page in response: list_response = json.loads(page...
gpl-2.0
-4,825,386,514,783,277,000
28.754098
102
0.651599
false
4.013274
false
false
false
42cc/apiclient-kava
setup.py
1
1143
#!/usr/bin/env python # -*- coding: utf-8 -*- from os.path import join, dirname from setuptools import setup, find_packages def get_version(fname='kavahq/__init__.py'): with open(fname) as f: for line in f: if line.startswith('__version__'): return eval(line.split('=')[-1]) s...
gpl-2.0
6,429,455,022,025,177,000
31.657143
77
0.616798
false
3.723127
false
false
false
ric2b/Vivaldi-browser
chromium/tools/binary_size/diagnose_bloat.py
1
34013
#!/usr/bin/env python # Copyright 2017 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. """Tool for finding the cause of binary size bloat. See //tools/binary_size/README.md for example usage. Note: this tool will perform...
bsd-3-clause
-672,655,338,578,976,400
34.992593
80
0.62582
false
3.601927
false
false
false
MarkMolina/moneypenny-bot
bittrex_playground.py
1
24571
import StringIO import json import logging import random import urllib import urllib2 import time import math import re import requests # import requests_toolbelt.adapters.appengine # Use the App Engine Requests adapter. This makes sure that Requests uses # URLFetch. # requests_toolbelt.adapters.appengine.monkeypatch...
mit
-872,781,368,876,894,800
29.148466
263
0.503602
false
2.935954
false
false
false
AntonelliLab/seqcap_processor
bin/aTRAM-master/tests/lib/test_core_atram.py
1
5511
"""Testing functions in core_atram.""" # pylint: disable=too-many-arguments,unused-variable from os.path import join from unittest.mock import patch, MagicMock, call import tempfile import lib.core_atram as core_atram from lib.assemblers.base import BaseAssembler def set_up(): """Build a generic assembler.""" ...
mit
3,588,765,181,514,383,000
32
69
0.648521
false
3.059967
true
false
false
alivecor/tensorflow
tensorflow/python/ops/array_ops.py
1
82629
# 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,138,453,467,312,795,000
32.864344
105
0.631098
false
3.414986
false
false
false
lidavidm/mathics-heroku
venv/lib/python2.7/site-packages/sympy/functions/combinatorial/numbers.py
1
40953
""" This module implements some special functions that commonly appear in combinatorial contexts (e.g. in power series); in particular, sequences of rational numbers such as Bernoulli and Fibonacci numbers. Factorials, binomial coefficients and related functions are located in the separate 'factorials' module. """ fr...
gpl-3.0
-7,633,730,731,319,739,000
29.53915
103
0.497644
false
3.420732
false
false
false
semente/django-hashtags
hashtags/views.py
1
3967
# -*- coding: utf-8 -*- # # Copyright (c) 2010 Guilherme Gondim and contributors # # This file is part of Django Hashtags. # # Django Hashtags is free software under terms of the GNU Lesser # General Public License version 3 (LGPLv3) as published by the Free # Software Foundation. See the file README for copying condit...
lgpl-3.0
-5,713,242,525,883,983,000
37.144231
80
0.617595
false
4.171399
false
false
false
cheesechoi/Triton
cheese/test/cheese_getModelcheck.jle.jg.py
1
5145
from triton import * import smt2lib """ Address 0x400547 progress [+] Address <cmp argv[1][0] 0x41> {'SymVar_0': "0x50, 'P'"} {'SymVar_0': "0x60, '`'"} {'SymVar_0': "0x5a, 'Z'"} {'SymVar_0': "0x4a, 'J'"} {'SymVar_0': "0x42, 'B'"} {'SymVar_0': "0x62, 'b'"} {'SymVar_0': "0x6a, 'j'"} {'SymVar_0': "0x68, 'h'"} {'SymVar_0...
lgpl-3.0
5,614,911,014,887,900,000
31.563291
100
0.554325
false
2.913364
false
false
false
iulian787/spack
lib/spack/spack/test/config.py
2
33282
# 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) import os import collections import getpass import tempfile from six import StringIO from llnl.util.filesystem import tou...
lgpl-2.1
-8,205,310,399,040,983,000
30.787966
79
0.584881
false
3.534247
true
false
false
tkzeng/molecular-design-toolkit
moldesign/geom/monitor.py
1
3798
# Copyright 2016 Autodesk 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
-4,536,990,009,628,288,500
32.026087
100
0.633491
false
4.132753
false
false
false
INM-6/Python-Module-of-the-Week
session01_Decorators/test_printtime_cm.py
1
1210
#!/usr/bin/env python3 import time, re, io, sys import contextlib def test_we_can_import_module(): import printtime_cm def test_context_manager_exists(): import printtime_cm printtime_cm.printtime_cm def test_context_manager_can_be_used(): import printtime_cm with printtime_cm.printtime_cm(): ...
mit
7,859,297,349,880,794,000
24.208333
62
0.620661
false
3.361111
true
false
false
mozilla/peekaboo
peekaboo/main/tests/test_views.py
1
6973
# -*- coding: utf-8 -*- import os import datetime import json from nose.tools import eq_, ok_ from django.test import TestCase, Client from django.conf import settings from django.contrib.auth.models import User from funfactory.urlresolvers import reverse, split_path from peekaboo.main.models import Location, Visi...
mpl-2.0
3,321,931,372,646,653,000
32.681159
78
0.576736
false
3.954623
true
false
false
pombredanne/datanommer
datanommer.commands/setup.py
1
1930
# This file is a part of datanommer, a message sink for fedmsg. # Copyright (C) 2014, Red Hat, Inc. # # 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...
gpl-3.0
-8,626,820,665,828,198,000
32.275862
79
0.678238
false
3.614232
false
false
false
dkdfirefly/speaker_project
code/separateLeadStereo/separateLeadStereoParam.py
1
41756
#!/usr/bin/python # copyright (C) 2011 Jean-Louis Durrieu # # 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 ...
mit
3,770,763,837,554,159,600
40.138916
104
0.531349
false
3.613361
false
false
false
mmolero/pcloudpy
pcloudpy/core/filters/OrientedNormalEstimation.py
1
3575
""" Class that define oriented normal estimation method based on PCA Eigen method to fit plane and minimum spanning tree """ __all__ = ["OrientedNormalsEstimation"] import numpy as np from scipy.linalg import eigh from sklearn.neighbors import NearestNeighbors import networkx as nx from pcloudpy.core.filters.base...
bsd-3-clause
-1,820,266,291,135,787,500
28.8
133
0.582098
false
3.518701
false
false
false
iotile/coretools
transport_plugins/bled112/iotile_transport_bled112/broadcast_v2_dedupe.py
1
3901
"""This module is used to identify and filter out broadcast v2 broadcasts, which leads to significant performance increases. """ import time import struct import collections from typing import Dict from iotile.cloud.utilities import device_id_to_slug def packet_is_broadcast_v2(packet: bytearray) -> bool: """Simp...
gpl-3.0
-8,435,621,857,235,197,000
37.623762
118
0.655473
false
3.862376
false
false
false
topseer/django
dJangoAdmin/dJangoAdmin/urls.py
1
1593
""" locallibrary URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/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='h...
mit
-268,994,568,428,312,130
31.229167
81
0.689893
false
3.620455
false
false
false
runt18/nupic
src/nupic/support/exceptions.py
1
2930
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
-2,779,699,714,728,841,700
31.197802
92
0.601024
false
4.787582
false
false
false
monkpit/pyfocas
FanucImplementation/Fwlib32_h.py
1
13167
# -*- coding: utf-8 -*- """ Fwlib32_h.py This file contains ctypes structures to match the data structures found in the library header Fwlib32.h. All classes contain `_pack_ = 4`; this comes from Fwlib32.h: #pragma pack(push,4) Don't unit test these because it would basically be running tests against the ctypes ...
mit
8,969,923,093,926,644,000
28.925
111
0.540214
false
3.701715
false
false
false
Fe-Nik-S/Examples
python/patterns/behavioral/iterator.py
1
1040
# -*- coding: utf-8 -*- # --------------------------------------------------------------------- # # --------------------------------------------------------------------- # Copyright (C) 2017-2018 The --- Project # See LICENSE for details # --------------------------------------------------------------------- class Fi...
mit
-1,968,337,526,883,203,800
26.157895
74
0.443798
false
4.015564
false
false
false
phpnick/RegPy
tm.py
1
1210
""" FoSAPy - TM module Author: Niklas Rieken """ import time class TM(): """ M = (Q, Sigma, Gamma, delta, q_0, q_f, B) """ Q = [] Sigma = [] Gamma = [] delta = {} q_0 = None q_f = None B = None def __init__(self, Q, Sigma, Gamma, delta, q_0, q_f, B='B'): """ Constructor """ self.Q = Q self.Sigma = Si...
mit
822,664,330,862,086,500
18.836066
197
0.465289
false
2.033613
false
false
false
Forage/Gramps
gramps/gen/datehandler/_date_cs.py
1
8857
# -*- coding: utf-8 -*- # # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2004-2006 Donald N. Allingham # # 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 t...
gpl-2.0
3,832,893,781,411,460,000
31.42963
81
0.473961
false
3.108271
false
false
false
hobson/pug
docs/source/conf.py
1
11525
# -*- coding: utf-8 -*- # # PUG documentation build configuration file, created by # sphinx-quickstart on Sat Apr 11 17:46:58 2015. # # 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. # # All c...
mit
2,219,194,266,160,377,900
30.40327
80
0.706291
false
3.656409
true
false
false
CrawlScript/Tensorflow-AutoEncoder
tutorial_iris.py
1
3636
#coding = utf-8 from mpl_toolkits.mplot3d import Axes3D from autoencoder import AutoEncoder, DataIterator import codecs from random import shuffle from matplotlib import pyplot as plt import numpy as np class IrisDataSet(object): def get_label_id(self, label): if label in self.label_id_dict: r...
gpl-3.0
-1,081,317,834,420,715,400
37.273684
123
0.681793
false
3.14261
false
false
false
platformio/platformio
platformio/clients/account.py
1
9820
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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
-9,000,951,945,673,739,000
32.862069
86
0.563238
false
4.01636
false
false
false
KDNT/p2pool-worldcoin-old
p2pool/data.py
1
55789
from __future__ import division import hashlib import os import random import sys import time from twisted.python import log import p2pool from p2pool.bitcoin import data as bitcoin_data, script, sha256 from p2pool.util import math, forest, pack # hashlink hash_link_type = pack.ComposedType([ ('state', pack.Fi...
gpl-3.0
4,844,746,086,630,213,000
52.386603
346
0.613365
false
3.655898
false
false
false
andresmrm/rss2email
rss2email/__init__.py
1
1661
# Copyright (C) 2012-2013 W. Trevor King <wking@tremily.us> # # This file is part of rss2email. # # rss2email 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...
gpl-2.0
-7,075,809,744,930,004,000
30.339623
79
0.684527
false
3.139887
false
false
false
carborgar/metropol
metropol_abogados/views/ExpedientViews.py
1
3817
from django.shortcuts import render_to_response from django.template import RequestContext from django.shortcuts import get_object_or_404 from django.core.urlresolvers import reverse from django.contrib import messages from django.http import HttpResponseRedirect from django.contrib.auth.decorators import permission_re...
mit
-1,160,492,237,735,441,200
39.178947
143
0.700812
false
3.631779
false
false
false
ibamacsr/indicar-process
indicarprocess/tmsapi/views.py
2
1134
from rest_framework.generics import ListAPIView, RetrieveAPIView from catalogo.models import CatalogoLandsat, CatalogoRapidEye from .serializers import LandsatSerializer, RapidEyeSerializer class LandsatListAPI(ListAPIView): serializer_class = LandsatSerializer def get_queryset(self): bbox = self.re...
agpl-3.0
7,511,570,201,475,237,000
28.076923
90
0.710758
false
3.792642
false
false
false
pauloacmelo/papelex_winthor
9813_ui_examples.py
1
3575
# coding: utf-8 from base import * from PySide import QtGui, QtCore import requests import json import urllib2 class Routine9812(WinthorRoutine): def __init__(self, *args): # super(WinthorRoutine, self).__init__('TESTE') print(args) super(Routine9812, self).__init__(args[4] or 9812, u'Cálcu...
mit
4,274,113,163,035,480,000
35.010101
186
0.580084
false
3.264652
false
false
false
rht/zulip
zerver/lib/redis_utils.py
1
2543
from django.conf import settings from typing import Any, Dict, Optional from zerver.lib.utils import generate_random_token import re import redis import ujson # Redis accepts keys up to 512MB in size, but there's no reason for us to use such size, # so we want to stay limited to 1024 characters. MAX_KEY_LENGTH = 1024...
apache-2.0
-6,855,087,069,317,244,000
38.734375
99
0.681085
false
3.622507
false
false
false
kratzer/bsm
bsm.py
1
11076
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2013 Kai Kratzer, Stuttgart, Germany; all rights # reserved unless otherwise stated. # # 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; ...
gpl-3.0
-6,629,903,377,394,719,000
27.183206
100
0.624503
false
3.227273
false
false
false
ds-hwang/chromium-crosswalk
mojo/public/tools/manifest/manifest_collator.py
2
1537
#!/usr/bin/env python # 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. """ A collator for Mojo Application Manifests """ import argparse import json import shutil import sys import urlparse def ParseJSONF...
bsd-3-clause
8,324,561,153,217,035,000
26.446429
80
0.681848
false
4.076923
false
false
false
rahul003/mxnet
tests/python/unittest/test_sparse_ndarray.py
1
38575
# 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
-1,889,587,153,475,739,600
37.807847
112
0.589086
false
3.251433
true
false
false
madgik/exareme
Exareme-Docker/src/madisServer/MadisServer.py
1
2979
import tornado.web from tornado import gen from tornado.log import enable_pretty_logging from tornado.options import define, options import logging import os PROCESSES_PER_CPU = 2 WEB_SERVER_PORT=8888 define("port", default=WEB_SERVER_PORT, help="run on the given port", type=int) import MadisInstance from MadisInsta...
mit
-3,267,898,687,122,339,000
30.357895
108
0.699564
false
3.655215
false
false
false
mheap/ansible
lib/ansible/module_utils/basic.py
1
116232
# Copyright (c), Michael DeHaan <michael.dehaan@gmail.com>, 2012-2013 # Copyright (c), Toshio Kuratomi <tkuratomi@ansible.com> 2016 # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) from __future__ import absolute_import, division, print_function SIZE_RANGES = ...
gpl-3.0
449,926,905,707,652,200
38.615542
155
0.553841
false
4.173501
false
false
false
silverfield/pythonsessions
s12_chat/chat_client.py
1
3462
# --------------------------------------------------------------- # Imports # --------------------------------------------------------------- import sys import socket import select import time import os sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from s12_chat import chat_settings # ---------------...
mit
9,178,664,240,059,496,000
33.63
112
0.431831
false
4.917614
false
false
false
openstack/neutron-lib
neutron_lib/api/validators/availability_zone.py
1
1626
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
apache-2.0
-3,779,166,133,405,238,300
33.595745
69
0.725092
false
3.712329
false
false
false
ngageoint/scale
scale/metrics/models.py
1
49093
"""Defines the database models for various system metrics.""" from __future__ import unicode_literals import datetime import logging import sys import django.contrib.gis.db.models as models import django.utils.timezone as timezone from django.db import transaction from error.models import Error from job.models impor...
apache-2.0
2,971,459,741,209,194,500
56.151339
120
0.631719
false
4.218336
false
false
false
TheAlgorithms/Python
machine_learning/similarity_search.py
1
4778
""" Similarity Search : https://en.wikipedia.org/wiki/Similarity_search Similarity search is a search algorithm for finding the nearest vector from vectors, used in natural language processing. In this algorithm, it calculates distance with euclidean distance and returns a list containing two data for each vector: ...
mit
-4,778,309,454,849,145,000
33.128571
87
0.593554
false
3.597892
false
false
false
pfalcon/picotui
picotui/widgets.py
1
15228
from .basewidget import * from .editorext import * from .defs import * __all__ = ( "ACTION_OK", "ACTION_CANCEL", "ACTION_NEXT", "ACTION_PREV", "EditableWidget", "Dialog", "WLabel", "WFrame", "WButton", "WCheckbox", "WRadioButton", "WListBox", "WPopupList", "WDro...
mit
1,381,513,039,429,334,800
25.952212
102
0.517271
false
3.503106
false
false
false
allanliebold/data-structures
src/dll.py
1
2785
"""Implementation of Doubly-Linked list with a head and tail.""" from linked_list import LinkedList from linked_list import Node class Dll(object): """Doubly-Linked List class object.""" def __init__(self): """Doubly-linked list initialization. Composed of some attributes from linked-list, a...
mit
4,066,315,183,033,655,300
29.944444
74
0.547217
false
4.113737
false
false
false
nuagenetworks/vspk-python
vspk/v5_0/nulocation.py
1
13395
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # 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 copyrigh...
bsd-3-clause
-3,558,432,641,807,527,000
29.103371
453
0.582605
false
4.598352
false
false
false
albireox/marvin
python/marvin/utils/datamodel/dap/MPL6.py
1
22491
# !usr/bin/env python # -*- coding: utf-8 -*- # # Licensed under a 3-clause BSD license. # # @Author: Brian Cherinka # @Date: 2017-09-13 16:05:56 # @Last modified by: José Sánchez-Gallego (gallegoj@uw.edu) # @Last modified time: 2018-08-06 11:45:33 from __future__ import absolute_import, division, print_function fr...
bsd-3-clause
7,902,900,672,459,805,000
60.111413
98
0.516475
false
3.82401
false
false
false
Dutchj/pbtweeter
pbtweeter/twitter/tweets.py
1
2532
import config as cfg import random import speedrun from datetime import datetime from seconds import seconds_to_time def post_tweet(api, lb, cat, p, t): player_name = p twitter_handle = speedrun.get_twitter_handle(p) if twitter_handle is None: return if not twitter_handle == '': player...
gpl-2.0
7,368,153,244,888,053,000
37.363636
120
0.541074
false
3.531381
false
false
false
iSchool-Zambia/django-ischool-oppia
oppia/profile/forms.py
1
18863
# oppia/profile/forms.py import hashlib import urllib from django import forms from django.conf import settings from django.contrib.auth import (authenticate, login, views) from django.core.urlresolvers import reverse from django.core.validators import validate_email from django.contrib.auth.models import User from dj...
gpl-3.0
3,110,669,798,487,709,000
47.369231
164
0.483168
false
4.899481
false
false
false
Rav3nPL/p2pool-yac
p2pool/networks.py
1
1811
from p2pool.bitcoin import networks from p2pool.util import math # CHAIN_LENGTH = number of shares back client keeps # REAL_CHAIN_LENGTH = maximum number of shares back client uses to compute payout # REAL_CHAIN_LENGTH must always be <= CHAIN_LENGTH # REAL_CHAIN_LENGTH must be changed in sync with all other clients # ...
gpl-3.0
8,911,000,933,144,216,000
35.22
141
0.62286
false
3.008306
false
false
false
davidkeegan/dklrt
Time.py
1
2701
#!/usr/bin/python # Time and Date Utilities (dklrt). # (c) David Keegan 2011-08-06. import sys, re from time import * import datetime import Misc ModuleName = __name__ ReDateSep = '[-/]' ReDate = '\d{4}%s\d{1,2}%s\d{1,2}' % (ReDateSep, ReDateSep) RePeriod = '(\d+)([ymwdh])' DateFormat = '%Y-%m-%d' ReDateTimeSep = "[...
gpl-3.0
7,456,639,810,320,415,000
29.693182
66
0.630507
false
2.987832
false
false
false
awni/tensorflow
tensorflow/contrib/skflow/python/skflow/ops/dropout_ops.py
1
1561
"""Dropout operations and handling.""" # Copyright 2015-present The Scikit Flow 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/l...
apache-2.0
6,417,583,460,618,329,000
32.934783
77
0.667521
false
4.065104
false
false
false
ryanraaum/african-mtdna
popdata_sources/montano2013/process.py
1
1562
from oldowan.mtconvert import seq2sites, sites2seq, str2sites from string import translate import pandas as pd import numpy as np import sys sys.path.append('../../scripts') from utils import * ## load metadata metadata = pd.read_csv('metadata.csv', index_col=0) region = range2region(metadata.ix[0,'SeqRange']) with ...
cc0-1.0
-4,966,553,181,960,053,000
25.05
61
0.619718
false
2.799283
false
false
false
jeromecn/caravel_viz_full
caravel/dataframe.py
1
3190
""" Caravel wrapper around pandas.DataFrame. TODO(bkyryliuk): add support for the conventions like: *_dim or dim_* dimensions, *_ts, ts_*, ds_*, *_ds - datetime, etc. TODO(bkyryliuk): recognize integer encoded enums. """ from __future__ import absolute_import from __future__ import division from __fu...
apache-2.0
-5,963,044,960,317,949,000
27.482143
76
0.558621
false
4.007538
false
false
false
robertu94/autograder
autograder/discover/handin.py
1
4601
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This module is part of the Clemson ACM Auto Grader Copyright (c) 2016, Robert Underwood All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistribut...
bsd-2-clause
7,051,272,176,042,949,000
36.104839
96
0.690285
false
4.484405
false
false
false
universalcore/springboard
springboard/utils.py
1
6735
import os import re from functools import wraps from urlparse import urlparse import math from elasticutils import S from elasticgit.search import RepoHelper default_excluded_paths = ['/health/', '/api/notify/'] def is_excluded_path(path, excluded_paths): excl_paths = config_list(excluded_paths) + default_excl...
bsd-2-clause
7,822,912,496,108,433,000
30.325581
78
0.610987
false
4.081818
false
false
false
wbond/oscrypto
oscrypto/_openssl/_libcrypto_cffi.py
1
9503
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import re from .. import _backend_config from .._errors import pretty_message from .._ffi import get_library, register_ffi from ..errors import LibraryNotFoundError from cffi import FFI __all__ = [ 'is_libressl',...
mit
1,742,790,982,224,963,300
35.55
118
0.614964
false
2.85033
false
false
false
paris-ci/CloudBot
plugins/remind.py
1
5860
""" remind.py Allows users to add reminders for various tasks. Created By: - Pangea <https://github.com/PangeaCake> - Luke Rogers <https://github.com/lukeroge> License: GPL v3 """ from datetime import datetime import time import asyncio from sqlalchemy import Table, Column, String, DateTime, PrimaryKey...
gpl-3.0
2,699,591,006,697,351,000
32.107345
120
0.635836
false
3.603936
false
false
false
kovidgoyal/kitty
docs/installer.py
1
7947
#!/usr/bin/env python3 # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net> from __future__ import ( absolute_import, division, print_function, unicode_literals ) import atexit import json import os import platform import re import shlex import shutil import subprocess...
gpl-3.0
-6,564,165,642,314,307,000
30.915663
155
0.587014
false
3.517928
false
false
false
rudatalab/python-objectcube
api/api/__init__.py
1
1147
from flask import Flask, jsonify, render_template from flask_restful import Api from resource.concept import ConceptResource, ConceptResourceByID from resource.tag import TagResource, TagResourceByID, TagResourceByValue from resource.object import ObjectResource, ObjectResourceByID from resource.blob import BlobResour...
bsd-2-clause
-2,096,492,035,668,442,600
26.309524
73
0.744551
false
3.22191
false
false
false
Skolopedrion/Theria
src/animation/animation.py
1
1370
#!/usr/bin/env python3 # coding: utf-8 import os import glob import sfml as sf class Animation: """ An animated texture. """ def __init__(self, frames, interval=0): """ :param frames: Iterable of sf.Texture objects :param interval: Time between two frames (default: 0.0s) """ self.frames = frames s...
mit
-2,537,892,201,827,231,000
18.571429
71
0.656204
false
3.017621
false
false
false
gdanezis/rousseau-chain
rousseau-package/attic/chain.py
1
3538
# Make a hash chain with O(1) update and O(log(N)) proof of membership from hashlib import sha256 as H from struct import pack # Some constants # The initial value of any chain # https://en.wikipedia.org/wiki/Om initialH = H("Om").digest() def pointFingers(seqLen): """ Returns the indexes for a particular seque...
bsd-2-clause
8,261,124,379,964,596,000
27.079365
89
0.574901
false
4.128355
false
false
false
MeadowHillSoftware/Nativity-in-Bits
NiB.py
1
56126
# Nativity in Bits 0.1.5 # Copyright 2008, 2009 Meadow Hill Software # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be usefu...
gpl-3.0
-7,664,956,768,203,536,000
29.126677
350
0.642839
false
2.976244
false
false
false
guardicore/monkey
monkey/infection_monkey/model/host.py
1
1374
__author__ = "itamar" class VictimHost(object): def __init__(self, ip_addr, domain_name=""): self.ip_addr = ip_addr self.domain_name = str(domain_name) self.os = {} self.services = {} self.icmp = False self.monkey_exe = None self.default_tunnel = None ...
gpl-3.0
2,676,835,333,894,688,300
27.040816
55
0.524017
false
3.359413
false
false
false
cmr/automatafl
old_python_prototype/rl_learn.py
1
4730
import argparse, random import numpy as np from keras.models import Sequential from keras.layers import Dense, AlphaDropout, Dropout, Flatten from keras.optimizers import RMSprop, Adam from rl.agents.dqn import DQNAgent from rl.policy import BoltzmannQPolicy from rl.memory import SequentialMemory from model import G...
apache-2.0
-586,225,406,380,804,200
35.666667
157
0.625581
false
3.195946
false
false
false
jarshwah/optimising-django-queries
shop/shop/models.py
1
1521
from django.db import models from django.utils.functional import cached_property as buffered_property from django.utils import timezone class Category(models.Model): name = models.CharField(max_length=32) def __str__(self): return self.name class Feature(models.Model): name = models.CharField(m...
bsd-2-clause
446,022,595,812,349,600
25.684211
80
0.692308
false
3.992126
false
false
false
shikhir-arora/Giesela
musicbot/cleverbot.py
1
3577
""" CleverWrap.py Python wrapper for Cleverbot's API. http://www.cleverbot.com/api Copyright 2017 Andrew Edwards 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 witho...
mit
1,497,654,019,481,257,000
37.880435
460
0.621471
false
4.144844
false
false
false
sekikn/ambari
ambari-agent/src/main/python/ambari_agent/alerts/port_alert.py
2
7478
#!/usr/bin/env python """ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License")...
apache-2.0
-2,506,284,335,676,159,000
36.577889
108
0.664482
false
3.900887
true
false
false