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
tensorflow/tpu
models/official/detection/utils/config_utils.py
1
2218
# Copyright 2020 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
-6,733,611,204,582,500,000
30.239437
80
0.670875
false
3.797945
false
false
false
WillsB3/glue
glue/formats/jsonformat.py
1
2704
import os import json import codecs from base import BaseJSONFormat class JSONFormat(BaseJSONFormat): extension = 'json' build_per_ratio = True @classmethod def populate_argument_parser(cls, parser): group = parser.add_argument_group("JSON format options") group.add_argument("--jso...
bsd-3-clause
3,899,344,654,583,642,000
41.920635
112
0.366864
false
5.716702
false
false
false
LennonChin/Django-Practices
MxShop/apps/utils/alipay.py
1
6122
# _*_ coding: utf-8 _*_ __author__ = 'LennonChin' __date__ = '2017/10/23 21:37' # pip install pycryptodome __author__ = 'bobby' from datetime import datetime from Crypto.PublicKey import RSA from Crypto.Signature import PKCS1_v1_5 from Crypto.Hash import SHA256 from base64 import b64encode, b64decode from...
apache-2.0
472,593,492,612,720,300
36.454545
699
0.607264
false
2.880779
false
false
false
edermartioli/ExoplanetLight
src/spectrum.py
1
2235
# -*- coding: utf-8 -*- """ Created on Nov 25 2016 @author: Eder Martioli Laboratorio Nacional de Astrofisica, Brazil spectrum.py is a library of classes and functions to handle spectral data. """ import numpy as np from scipy import constants ########## SPECTRUM CLASS ############ class ...
mit
5,748,290,067,744,352,000
26.256098
120
0.499329
false
4.019784
false
false
false
dpgaspar/Flask-AppBuilder
examples/quickactions/config.py
1
1945
import os from flask_appbuilder.security.manager import ( AUTH_OID, AUTH_REMOTE_USER, AUTH_DB, AUTH_LDAP, AUTH_OAUTH, ) basedir = os.path.abspath(os.path.dirname(__file__)) CSRF_ENABLED = True SECRET_KEY = "\2\1thisismyscretkey\1\2\e\y\y\h" OPENID_PROVIDERS = [ {"name": "Yahoo", "url": "https...
bsd-3-clause
-8,113,568,028,232,835,000
28.923077
82
0.594859
false
2.649864
false
false
false
chipaca/snapcraft
snapcraft/project/_project_options.py
1
12984
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016-2019 Canonical Ltd # # 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 ...
gpl-3.0
-6,421,764,754,426,104,000
32.900783
88
0.59658
false
3.788737
false
false
false
eroicaleo/LearningPython
interview/leet/146_LRU_Cache.py
1
2568
#!/usr/bin/env python class LRUCache: class Node: def __init__(self, key, val): self.val, self.key = val, key self.prev = None self.next = None def __init__(self, capacity): """ :type capacity: int """ self.capacity = capacity ...
mit
2,415,132,396,107,739,600
27.21978
92
0.503505
false
3.396825
false
false
false
martinsch/vigra
vigranumpy/lib/pyqt/imagewindow.py
1
23939
####################################################################### # # Copyright 2009-2010 by Ullrich Koethe # # This file is part of the VIGRA computer vision library. # The VIGRA Website is # http://hci.iwr.uni-heidelberg.de/vigra/ # Please direct questions, bug reports, and contributions...
mit
4,147,204,187,256,811,500
37.799028
97
0.588329
false
3.981207
false
false
false
GSA/PricesPaidAPI
SolrLodr.py
1
4723
#!/usr/local/bin/python import solr import sys, traceback # This file is for (for example) Apache with mod_wsgi. import sys, os # import sys # sys.path.insert(0, '../configuration/') # The purpose of this file is to take the standard # datafiles and load them into SOLR in such a way that they # will be searchable....
unlicense
4,258,783,536,388,830,700
34.246269
119
0.712683
false
3.652746
false
false
false
ntoll/code-dojo
adventure/week3/team3/adventure.py
1
6088
from cmd import Cmd import re DIRECTIONS = 'N', 'E', 'S', 'W' NORTH, EAST, SOUTH, WEST = DIRECTIONS class Player(object): def __init__(self, location, name='Player'): assert isinstance(location, Location) self.location = location self.name = name class Location(object): ...
mit
1,014,150,448,326,991,400
29.813472
113
0.508377
false
4.272281
false
false
false
amanzi/ats-dev
tools/meshing_ats/meshing_ats/meshing_ats.py
1
34933
"""Extrudes a 2D mesh to generate an ExodusII 3D mesh. Works with and assumes all polyhedra cells (and polygon faces). To see usage, run: ------------------------------------------------------------ python meshing_ats.py -h Example distributed with this source, to run: --------------------------------------------...
bsd-3-clause
6,506,556,784,610,115,000
36.724622
166
0.507972
false
3.681421
false
false
false
pecryptfs/pecryptfs
pecryptfs/cmd_genfile.py
1
2753
#!/usr/bin/env python3 # pecryptfs - Portable Userspace eCryptfs # Copyright (C) 2015 Ingo Ruhnke <grumbel@gmail.com> # # 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 L...
gpl-3.0
4,288,613,616,355,062,000
36.712329
98
0.656375
false
3.792011
false
false
false
ptphp/PyLib
src/fangte/fetch/fetch58_bak.py
1
29601
# -*- coding: utf-8 -*- import time import datetime import random import cookielib import urllib import urllib2 from urlparse import urlparse from config import * from common import * from BeautifulSoup import BeautifulSoup class BaseCrawl(object): #房源类型 1 出售 2 出租 3 求购 4 求租 flag = None isStoped = False ...
apache-2.0
-6,180,525,446,337,366,000
38.575967
172
0.475727
false
3.201453
false
false
false
AntaresConsulting/odoo-marble
product_marble/models/stock.py
1
25218
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
gpl-2.0
-4,009,658,643,104,912,400
41.884354
164
0.560398
false
3.363927
false
false
false
CiscoSystems/dashboard-quantum-beta
django-openstack/django_openstack/api.py
1
19242
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Fourth Paradigm Development, Inc. # # Licensed under the Apache License, Version 2.0 (the "Licen...
apache-2.0
248,219,022,108,928,350
31.94863
79
0.653934
false
3.922936
false
false
false
leotrs/decu
test/notsosimple_project/src/script.py
1
1196
""" testscript.py ------------- This is a test script for decu. """ from decu import Script, experiment, figure, run_parallel import numpy as np import matplotlib.pyplot as plt class TestScript(Script): @experiment(data_param='data') def exp(self, data, param, param2): """Compute x**param for each...
mit
5,614,853,097,660,750,000
26.813953
73
0.594482
false
3.624242
false
false
false
rackerlabs/qonos
qonos/openstack/common/eventlet_backdoor.py
1
4764
# Copyright (c) 2012 OpenStack Foundation. # Administrator of the National Aeronautics and Space Administration. # 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 a...
apache-2.0
620,482,699,583,324,400
31.855172
78
0.645466
false
3.768987
false
false
false
BinMatrix/camshift_ros
scripts/camshift_node.py
1
9812
#!/usr/bin/env python ''' Camshift node ================ This is a ros node that shows mean-shift based tracking You select a color objects such as your face and it tracks it. This subscrib from "/image" topic for reading image, and publish the information of target to "/TargetPositionSize" or "/roi" topic. The posit...
gpl-3.0
-7,288,317,239,279,681,000
35.073529
110
0.528027
false
3.249007
false
false
false
rafallo/p2c
torrent/torrent.py
1
10334
# -*- coding: utf-8 -*- import hashlib import libtorrent as lt import logging from threading import Timer, Event import os import time from p2c.exceptions import SessionNotBindedException, TorrentHasNotMetadataYet import settings from torrent.movie import Movie SOURCE_TYPES = ("MAGNET", "TORRENT") logger = logging.ge...
mit
2,340,498,763,809,516,500
35.259649
111
0.561641
false
4.171982
false
false
false
dhaitz/CalibFW
plotting/modules/plot_sandbox.py
1
75936
# -*- coding: utf-8 -*- """ plotting sanbox module for merlin. This module is to be used for testing or development work. """ import plotbase import copy import plot1d import getroot import math import plotresponse import plotfractions import plot2d import plot_tagging import fit import os def recogen_a...
gpl-2.0
1,261,465,762,515,416,000
40.024311
257
0.540758
false
3.169679
false
false
false
baccenfutter/cpassdb
cpassdb/protocols/client.py
1
19784
"""cpassdb - Client Protocol Classes""" __author__ = "Brian Wiborg <baccenfutter@c-base.org>" __license__ = "GNU/GPLv2" import os import sys import json import base64 import commands from twisted.internet import reactor from twisted.protocols.basic import LineReceiver class ClientProtocol(LineReceiver): """Abstr...
gpl-2.0
-7,313,434,773,447,821,000
31.863787
102
0.591336
false
4.556426
false
false
false
nonapod/gzinflatekiller
gzinflatekiller.py
1
3114
#!/bin/env python #:############################################ #: GZINFLATEKILLER #: by Les Cordell #: #: Hunt through files containing a base64 #: GZInflate Command #: #: Written on 07/08/2013 #: last modified @ 07/08/2013 #:############################################ import sys, os, re #: Extensions constant, th...
mit
-5,594,238,935,680,430,000
28.942308
118
0.659923
false
3.395856
false
false
false
L1NT/django-training-log
log/models.py
1
5458
from django.db import models # Create your models here. class Sport(models.Model): """ don't use models.choices because we want the list to be transactional data example list: [ 'bike', 'run', 'swim', 'measurements', 'yoga', 'weights', # for multi-sp...
gpl-2.0
1,526,296,373,929,901,000
35.878378
109
0.662147
false
3.47422
false
false
false
chaosk/trinitee
trinitee/forums/migrations/0001_initial.py
1
14851
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Category' db.create_table('forums_category', ( ('id', self.gf('django.db.model...
bsd-3-clause
-7,617,905,021,076,581,000
64.422907
182
0.570265
false
3.634606
false
false
false
pgroudas/pants
src/python/pants/backend/jvm/tasks/jvm_compile/jvm_compile_strategy.py
1
8647
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from abc i...
apache-2.0
-8,624,641,274,634,726,000
36.925439
99
0.686481
false
4.141284
false
false
false
ruhan/django-silk-mongoengine
silk/profiling/profiler.py
1
6695
import inspect import logging import time import traceback from django.conf import settings from django.utils import timezone import six from silk.collector import DataCollector from silk.config import SilkyConfig from silk.models import _time_taken Logger = logging.getLogger('silk') # noinspection PyPep8Naming c...
mit
-1,680,985,588,628,297,200
35.391304
124
0.542644
false
4.579343
false
false
false
sandz-in/twilio_trello
twilio_sms_handler/views.py
1
1174
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.http import HttpResponse from django.views.decorators.http import require_POST from twilio.twiml.messaging_response import MessagingResponse # Create your views here. from twilio_sms_handler.TrelloQuery import TrelloQuery from twilio_trello.tw...
mit
3,368,238,826,495,782,000
29.102564
71
0.683986
false
3.463127
false
false
false
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractKeztranslationsWordpressCom.py
1
1210
def extractKeztranslationsWordpressCom(item): ''' Parser for 'keztranslations.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('FOD', 'Quickly Wear the Face of the Devil', ...
bsd-3-clause
-7,868,676,419,566,919,000
36.78125
104
0.620861
false
3.212766
false
false
false
dvida/UWO-PA-Python-Course
Lecture 3/L3_lecture.py
1
5075
from __future__ import print_function ### READING FILES file_name = 'data.txt' # Reading in and parsing file contents data_list = [] with open(file_name) as f: # SKip the header (the first line) next(f) for line in f: # Remove newline char line = line.replace('\n', ...
mit
-3,814,201,120,210,156,500
17.909804
91
0.575369
false
3.199874
false
false
false
terna/SLAPP3
6 objectSwarmObserverAgents_AESOP_turtleLib_NetworkX/$$slapp$$/txtxFunctions.py
1
1888
import os def executeFormula(fIn, fOu, nrow, n, s): # v=0 #init. not required; it can interfere with the try/except structure pos = s.find("v") if pos == -1: print("missing 'v' in formula, row", nrow, "\nexecution stopped in error") fIn.close() fOu.close() os...
cc0-1.0
2,214,278,890,246,831,600
21.211765
77
0.417373
false
3.238422
false
false
false
attdona/NAIS
pynais/msg.py
1
2142
import struct import pynais as ns class Profile: def __init__(self, uid=None, pwd=None): self.uid = uid self.pwd = pwd def __str__(self): return "Profile uid: [%s], pwd: [%s]" % (self.uid, self.pwd) def set_protobuf(self, obj): obj.uid = self.uid obj.pwd = self...
gpl-3.0
-5,864,915,119,413,480,000
25.775
78
0.548086
false
3.725217
false
false
false
liuslevis/handwrite_dataset_generator
3_gen_digit_data_label.py
1
2918
import os import shutil DEBUG = False img_suffix = ['.jpeg','.jpg','.png','.tiff'] def gen_img_unique_file_name(count,total): assert(count<=total) name = '' for i in range(len(str(total)) - len(str(count))): name+='0' offset = str(count) name+=offset return name def copy_img_file(s...
mit
667,820,483,972,718,700
29.726316
102
0.536326
false
3.567237
false
false
false
nrz/ylikuutio
external/bullet3/examples/pybullet/gym/pybullet_envs/minitaur/envs/env_randomizers/minitaur_alternating_legs_env_randomizer.py
2
2810
"""Randomize the minitaur_gym_alternating_leg_env when reset() is called. The randomization include swing_offset, extension_offset of all legs that mimics bent legs, desired_pitch from user input, battery voltage and motor damping. """ import os, inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(in...
agpl-3.0
-7,600,583,277,604,451,000
45.065574
86
0.666904
false
3.39372
false
false
false
dreaming-dog/kaldi-long-audio-alignment
scripts/classes/entry_manager.py
1
2096
# Copyright 2017 Speech Lab, EE Dept., IITM (Author: Srinivas Venkattaramanujam) from entry import Entry class EntryManager: __statuses__ = ['PENDING','DONE'] def __init__(self): self.entries=[] def add_entry(self,entry): # Problem: # add new entries to the existing list such that: # 1) the start and end ...
apache-2.0
-5,431,410,990,582,398,000
42.666667
169
0.694179
false
3.114413
false
false
false
hirochachacha/apython
bpython/completion/completers/import_completer.py
1
9006
# The MIT License # # Copyright (c) 2009-2011 Andreas Stuehrk # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, mo...
mit
6,365,923,528,338,857,000
31.989011
89
0.563957
false
4.406067
false
false
false
julzhk/codekata
instant_runoff_voting.py
1
1947
from collections import defaultdict, Counter def runoff(voters): """ a function that calculates an election winner from a list of voter selections using an Instant Runoff Voting algorithm. https://en.wikipedia.org/wiki/Instant-runoff_voting Each voter selects several candidates in order of preference. ...
mit
-6,354,312,978,943,293,000
42.266667
113
0.659476
false
3.427817
false
false
false
factorlibre/carrier-delivery
delivery_carrier_ups/model/ups_config.py
1
2330
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2015 FactorLibre (http://www.factorlibre.com) # Hugo Santos <hugo.santos@factorlibre.com> # # This program is free software: you can redistribute it and/o...
agpl-3.0
545,612,102,985,848,500
34.30303
78
0.566953
false
3.982906
false
false
false
wenhuchen/ETHZ-Bootstrapped-Captioning
visual-concepts/coco/PythonAPI/pycocotools/coco.py
1
16953
__author__ = 'tylin' __version__ = '2.0' # Interface for accessing the Microsoft COCO dataset. # Microsoft COCO is a large image dataset designed for object detection, # segmentation, and caption generation. pycocotools is a Python API that # assists in loading, parsing and visualizing the annotations in COCO. # Pleas...
bsd-3-clause
-9,197,075,660,975,878,000
42.358056
128
0.54775
false
3.730854
false
false
false
blackball/an-test6
net/migrations/0004_update_calibrations.py
1
22054
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models from astrometry.net.settings import * from astrometry.util.util import Tan import math import os class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods ...
gpl-2.0
-8,568,439,465,542,566,000
73.255892
203
0.540446
false
3.638673
false
false
false
MSEMJEJME/Get-Dumped
renpy/statements.py
1
3307
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights to use, copy, modify, m...
gpl-2.0
-8,841,751,182,915,426,000
32.07
138
0.643786
false
4.087763
false
false
false
RayRuizhiLiao/ITK_4D
Modules/ThirdParty/pygccxml/src/pygccxml/parser/etree_scanner.py
1
2166
# Copyright 2014-2016 Insight Software Consortium. # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. # See http://www.boost.org/LICENSE_1_0.txt import warnings from . import scanner # keep py2exe happy import xml.etree.ElementTree import xml.etree.cElement...
apache-2.0
-8,333,672,104,491,799,000
28.507042
78
0.591874
false
3.854093
false
false
false
dnlcrl/PyFunt
tools/cythonize.py
1
6618
#!/usr/bin/env python """ cythonize SOURCE: https://github.com/scipy/scipy/blob/master/setup.py Cythonize pyx files into C files as needed. Usage: cythonize [root_dir] Default [root_dir] is 'pyfunt'. Checks pyx files to see if they have been changed relative to their corresponding C files. If they have, then runs...
mit
-7,944,039,619,602,638,000
29.219178
97
0.599577
false
3.711722
false
false
false
deepmind/interval-bound-propagation
interval_bound_propagation/src/simplex_bounds.py
1
7609
# coding=utf-8 # Copyright 2019 The Interval Bound Propagation Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
apache-2.0
3,811,566,715,278,191,600
38.020513
79
0.655539
false
3.770565
false
false
false
sigurdga/nidarholm
organization/templatetags/grouplistings.py
1
2466
from django import template from django.contrib.auth.models import Group from organization.models import GroupCategory, Role import re register = template.Library() def roles_for_user_in_group(user, group): return Role.objects.filter(membership__user=user, membership__group=group) def phone_number_format(number...
agpl-3.0
-7,402,660,224,905,612,000
41.517241
125
0.539335
false
3.401379
false
false
false
lorensen/VTKExamples
src/Python/GeometricObjects/Polygon.py
1
1535
#!/usr/bin/env python import vtk def main(): colors = vtk.vtkNamedColors() # Setup four points points = vtk.vtkPoints() points.InsertNextPoint(0.0, 0.0, 0.0) points.InsertNextPoint(1.0, 0.0, 0.0) points.InsertNextPoint(1.0, 1.0, 0.0) points.InsertNextPoint(0.0, 1.0, 0.0) # Create the...
apache-2.0
-4,295,740,643,100,989,000
26.909091
61
0.695765
false
3.449438
false
false
false
angelicadly/prog-script
tekton-master/backend/appengine/routes/rotas/rest.py
1
1044
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from gaebusiness.business import CommandExecutionException from tekton.gae.middleware.json_middleware import JsonResponse from rota_app import facade def index(): cmd = facade.list_rotas_cmd() rota_list = cmd() short_form=fac...
mit
-1,036,920,398,554,202,000
27.216216
67
0.704981
false
3.144578
false
false
false
akshayka/edxclassify
edxclassify/classifiers/feature_generation.py
1
3989
from edxclassify.feature_spec import FEATURE_COLUMNS from edxclassify.classifiers.word_lists import * from edxclassify.data_cleaners.dc_util import compress_likert import re import nltk from nltk.tokenize import sent_tokenize, word_tokenize def to_int(value, aux=None): if value == '': return 0 return i...
gpl-2.0
2,360,410,365,754,236,000
28.992481
78
0.591376
false
3.659633
false
false
false
srmagura/goodnight-lead
gl_site/statistics/views.py
1
6287
# View imports from django.http import JsonResponse, HttpResponse from django.shortcuts import render from gl_site.custom_auth import login_required # Forms from gl_site.statistics.statistics_form import statistics_request_form, statistics_download_form # Data from .data_generation import format_graph_data, format_f...
gpl-3.0
-8,336,534,110,600,097,000
30.435
126
0.606171
false
4.474733
false
false
false
adamfast/faadata
faadata/aircraft/parser.py
1
3304
import datetime class AircraftManufacturerCode(object): def __init__(self, record): self.code = record[:7].strip() self.manufacturer = record[8:38].strip() self.model = record[39:59].strip() self.aircraft_type = record[60].strip() self.engine_type = record[62].strip() ...
bsd-3-clause
-8,092,445,956,844,940,000
43.648649
102
0.592918
false
3.448852
false
false
false
Aravinthu/odoo
odoo/fields.py
1
104967
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. """ High-level objects for fields. """ from collections import OrderedDict, defaultdict from datetime import date, datetime from functools import partial from operator import attrgetter import itertools import logging ...
agpl-3.0
8,913,938,050,853,976,000
41.087811
126
0.585813
false
4.358009
false
false
false
RyadElssalihine/RyadElssalihine
user_manager/views.py
1
1508
# Create your views here. from rest_framework import status from rest_framework.decorators import api_view from rest_framework.response import Response from models import Profile,Application,Tab,Page,Footer from serializer import ProfileSerializer,TabSerializer,FooterSerializer from django.shortcuts import render from ...
gpl-2.0
-4,443,966,142,931,526,700
27.45283
71
0.772546
false
3.896641
false
false
false
mareknetusil/twist
cbc/twist/kinematics.py
1
4324
__author__ = "Harish Narayanan" __copyright__ = "Copyright (C) 2009 Simula Research Laboratory and %s" % __author__ __license__ = "GNU GPL Version 3 or any later version" from dolfin import * #from cbc.twist.coordinate_system import CartesianSystem # Renaming grad to Grad because it looks nicer in the reference # co...
gpl-3.0
1,692,405,160,494,801,000
26.896774
83
0.639685
false
2.88459
true
false
false
snarfed/webmention-tools
bin/demo.py
1
1241
#!/usr/bin/env python # -*- coding: utf-8 -*- from webmentiontools.urlinfo import UrlInfo from webmentiontools.webmentionio import WebmentionIO # If you have an access token from webmention.io, # set it here. Some calls require it. webmention_io_token = None wio = WebmentionIO(webmention_io_token) # Get all links...
mit
8,639,230,686,331,052,000
33.472222
72
0.617244
false
3.428177
false
false
false
XiaochenCui/algorithm_submit
app/auth/views.py
1
5804
from flask import render_template, redirect, request, url_for, flash from flask.ext.login import login_user, logout_user, login_required, \ current_user from . import auth from .. import db from ..models import User from ..email import send_email from .forms import LoginForm, RegistrationForm, ChangePasswordForm, \...
mit
5,879,881,981,366,820,000
32.95092
78
0.630105
false
3.413942
false
false
false
kangwonlee/ECA
lab_07_linear_algebra/gauss_jordan.py
1
1766
# -*- coding: utf8 -*- from pprint import pprint import linear_algebra as la def gauss_jordan(A): # 행렬의 크기 n_row = len(A) n_column = len(A[0]) # 단위 행렬과의 Augmented Matrix 를 만듦 AI = [] for i_row in xrange(n_row): AI_row = [0.0] * (n_column * 2) for j_column in xrange(n_column):...
apache-2.0
1,296,910,529,811,983,000
23.666667
72
0.514742
false
2.296192
false
false
false
Chris7/django-djangui
djangui/models/mixins.py
1
1697
from __future__ import absolute_import __author__ = 'chris' from django.forms.models import model_to_dict import six class UpdateScriptsMixin(object): def save(self, **kwargs): super(UpdateScriptsMixin, self).save(**kwargs) from ..backend.utils import load_scripts load_scripts() class Dja...
gpl-3.0
4,384,404,271,976,613,400
27.3
104
0.602829
false
3.77951
false
false
false
manaris/jythonMusic
15. simpleCircleInstrument.py
1
2279
# simpleCircleInstrument.py # # Demonstrates how to use mouse and keyboard events to build a simple # drawing musical instrument. # from gui import * from music import * from math import sqrt ### initialize variables ###################### minPitch = C1 # instrument pitch range maxPitch = C8 # create display d ...
gpl-3.0
2,095,986,917,681,406,200
31.571429
70
0.660816
false
3.628981
false
false
false
intelligent-agent/redeem
tests/gcode/test_M83.py
1
1638
from __future__ import absolute_import from .MockPrinter import MockPrinter from redeem.Path import Path class M83_Tests(MockPrinter): def test_gcodes_M83_from_absolute(self): """ set state as it should be after a G90, all axes absolute """ self.printer.axes_absolute = ["X", "Y", "Z", "E", "H", "A", "B", "...
gpl-3.0
4,424,008,043,799,721,000
44.5
90
0.639194
false
3.005505
false
false
false
jayvdb/travis_log_fetch
tests/test_github.py
1
1132
"""Test Github resolution.""" from __future__ import absolute_import, unicode_literals from travis_log_fetch.config import ( _get_github, get_options, ) from travis_log_fetch.get import ( get_forks, ) import pytest # Note 'foo' is a real Github user, but they do not # have repos bar or baz class TestFor...
mit
-6,854,272,443,919,678,000
27.3
68
0.621025
false
3.559748
true
false
false
jacobajit/ion
intranet/apps/events/views.py
1
11092
# -*- coding: utf-8 -*- import datetime import logging import bleach from django import http from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core import exceptions from django.shortcuts import get_object_or_404, redirect, render from .forms import AdminEvent...
gpl-2.0
-4,660,954,090,174,681,000
33.554517
152
0.627209
false
3.883754
false
false
false
TheVirtualLtd/bda.plone.shop
src/bda/plone/shop/vocabularies.py
1
6162
# -*- coding: utf-8 -*- from bda.plone.checkout.vocabularies import country_vocabulary from bda.plone.checkout.vocabularies import gender_vocabulary from bda.plone.payment import Payments from bda.plone.shipping import Shippings from bda.plone.shop import message_factory as _ from bda.plone.shop.utils import get_shop_a...
bsd-3-clause
-2,564,873,223,783,599,600
34.011364
77
0.697339
false
3.535284
false
false
false
elaske/mufund
tests.py
1
3839
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: Evan Laske # @Date: 2014-03-01 21:45:31 # @Last Modified by: Evan Laske # @Last Modified time: 2015-09-15 23:51:12 import urllib import urllib2 from bs4 import BeautifulSoup import html5lib import re from StockQuote import StockQuote from MutualFundData impo...
gpl-3.0
6,559,670,225,888,140,000
32.684211
110
0.636624
false
3.502737
true
false
false
Foldblade/EORS
Mypackage/back_to_yesterday.py
1
3091
# encoding:utf-8 ''' ———————————————————————————————— back_to_yesterday.py 对备份文件的回档,所谓‘回到昨天’功能。 实现原理:删除源文件。解压备份的zip,自动覆盖。 ———————————————————————————————— ''' import os import zipfile import shutil import time def back_to_yesterday(): where_script = os.path.split(os.path.realpath(__file__))[0] # print(where_...
gpl-3.0
-882,281,870,340,508,500
35.5
97
0.595705
false
2.798964
false
false
false
XiMuYouZi/PythonDemo
Crawler/Zhihu/zhihuuser/spiders/zhihu_user.py
1
4440
# -*- coding: utf-8 -*- # 爬取知乎全站的用户信息 import json from scrapy import Spider, Request from Crawler.Zhihu.zhihuuser.items import UserItem class ZhihuSpider(Spider): #忽略301,302重定向请求 # handle_httpstatus_list = [301, 302] name = "zhihu_user" allowed_domains = ["www.zhihu.com"] user_url = 'https://...
mit
4,831,802,806,455,866,000
46.88764
808
0.666823
false
3.152367
false
false
false
sgzwiz/brython
tests/console.py
1
2190
import sys import time import random #this sucks.. cannot find dis since "root" path is blah/test #we might need to create a variable we pass via the brython function # to state what the root path is. # For now, we'll hardcode a relative path. :( sys.path.append("../Lib") import dis _rand=random.random() editor=...
bsd-3-clause
-4,744,852,278,866,266,000
19.660377
68
0.630594
false
3.254086
false
false
false
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/ratelimitbackend/backends.py
1
2730
import logging import warnings from datetime import datetime, timedelta from django.contrib.auth.backends import ModelBackend from django.core.cache import cache from .exceptions import RateLimitException logger = logging.getLogger('ratelimitbackend') class RateLimitMixin(object): """ A mixin to enable ra...
agpl-3.0
6,461,471,023,397,237,000
29.674157
79
0.563736
false
4.299213
false
false
false
joetsoi/moonstone
python/main.py
1
1239
from collections import namedtuple from struct import unpack, unpack_from Segment = namedtuple('Segment', 'offset length') ViewportDimension = namedtuple('ViewportDimension', 'right left') class MainExe(object): def __init__(self, file_path): data_segment = Segment(0x138a0, 0xf460) with open(fil...
agpl-3.0
326,647,625,653,657,340
27.813953
69
0.51816
false
3.529915
false
false
false
teoliphant/scipy
scipy/ndimage/filters.py
2
40010
# Copyright (C) 2003-2005 Peter J. Verveer # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following d...
bsd-3-clause
-4,108,254,230,189,439,500
34.004374
79
0.597751
false
3.896192
false
false
false
vaniakosmos/memes-reposter
apps/imgur/migrations/0001_initial.py
1
1605
# Generated by Django 2.0.3 on 2018-06-30 17:27 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='ImgurConfig', fields=[ ...
mit
-4,660,612,646,727,245,000
38.146341
194
0.560748
false
4.533898
false
false
false
dsweet04/rekall
rekall-core/rekall/plugins/windows/heap_analysis.py
1
16866
# Rekall Memory Forensics # Copyright 2014 Google Inc. 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 Foundation; either version 2 of the License, or (at # your option) any later ver...
gpl-2.0
5,344,717,608,450,970,000
37.594966
104
0.563441
false
4.506011
false
false
false
google/makani
gs/monitor2/apps/plugins/indicators/servo.py
1
17733
# Copyright 2020 Makani Technologies 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...
apache-2.0
5,210,630,127,275,359,000
35.189796
79
0.646366
false
3.526148
false
false
false
barak/autograd
examples/fluidsim/wing.py
1
6136
from __future__ import absolute_import from __future__ import print_function import autograd.numpy as np from autograd import value_and_grad from scipy.optimize import minimize import matplotlib.pyplot as plt import os from builtins import range rows, cols = 40, 60 # Fluid simulation code based on # "Real-Time Flui...
mit
7,440,294,014,902,484,000
36.414634
100
0.608703
false
2.987342
false
false
false
MarvinTeichmann/KittiBox
tests/test_anno_load.py
1
14271
from __future__ import absolute_import from __future__ import division from __future__ import print_function import itertools import json import logging import os import sys import random from random import shuffle import numpy as np import scipy as scp import scipy.misc sys.path.insert(1, '../incl') from scipy.mis...
mit
-198,509,635,553,043,260
31.434091
78
0.529676
false
3.366596
false
false
false
baayso/learn-python3
basic/the_list.py
1
1216
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # list是一种有序的集合,可以随时添加和删除其中的元素 classmates = ['Michael', 'Bob', 'Tracy'] print(classmates) print(len(classmates)) print(classmates[0]) print(classmates[1]) print(classmates[2]) print(classmates[-1]) print(classmates[-2]) print(classmates[-3]) print() # 追加元素到末尾 classmates....
apache-2.0
-2,483,030,746,383,875,600
12.71831
48
0.676591
false
1.723894
false
true
false
studenteternal/SoftLayer
get_list.py
1
1502
#!/usr/bin/python import yaml import SoftLayer from pprint import pprint credsFile = open("softcreds.yaml",'r') creds = yaml.load(credsFile) #print creds['username'] #print creds['api_key'] client = SoftLayer.Client(username=(creds['username']), api_key=(creds['api_key'])) n = 1 count = 1 kill_file = open("kill-...
mit
-2,538,125,823,673,107,500
28.45098
154
0.661784
false
2.839319
false
false
false
beia/beialand
projects/CitisimWebApp/app/src/users.py
1
2358
#!flask/bin/python from flask_bcrypt import Bcrypt from flask_login import UserMixin from main import login_manager from main import mydb import MySQLdb @login_manager.user_loader def load_user(user_id): user = User() return user.getUserByID(int(user_id)) class User(UserMixin): id = None username = No...
gpl-3.0
5,566,151,524,797,660,000
29.623377
165
0.621713
false
3.778846
false
false
false
gitterHQ/ansible
v2/ansible/playbook/attribute.py
1
1053
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
8,832,590,789,999,572,000
30.909091
70
0.720798
false
4.003802
false
false
false
abusesa/idiokit
idiokit/xmpp/jid.py
1
6351
# Module for XMPP JID processing as defined in on RFC 3920 # (http://www.ietf.org/rfc/rfc3920.txt) And RFC 3454 # (http://www.ietf.org/rfc/rfc3454.txt). # # This module was originally written using both the above RFCs and the # xmppstringprep module of the pyxmpp package # (http://pyxmpp.jajcus.net/) as well as the # t...
mit
-8,818,032,369,330,515,000
27.608108
85
0.634861
false
3.374601
false
false
false
moustakas/impy
teaching/siena_class_roster.py
1
3362
import requests #import BeautifulSoup from bs4 import BeautifulSoup import HTMLParser from HTMLParser import HTMLParser import sys import os # Open the file. r = open(sys.argv[1]) if not os.path.isdir('Detail_Class_List_files'): os.rename('Detail Class List_files', 'Detail_Class_List_files') # Try to parse the ...
gpl-2.0
-457,119,040,262,636,200
29.844037
113
0.467281
false
4.1
false
false
false
vitan/hue
desktop/libs/hadoop/src/hadoop/cluster.py
1
7247
#!/usr/bin/env python # 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 (the # "License"); you ma...
apache-2.0
5,338,848,230,225,687,000
25.840741
132
0.673796
false
3.397562
true
false
false
facebookexperimental/eden
eden/integration/snapshot/verify.py
1
9902
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. # pyre-strict import abc import os import stat as stat_mod import typing from pathlib import Path from typing import Dict, Itera...
gpl-2.0
-8,863,614,257,235,671,000
34.113475
86
0.608261
false
3.893826
false
false
false
codelv/enaml-native
src/enamlnative/widgets/popup_window.py
1
4574
""" 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 Mar 17, 2018 @author: jrm """ from atom.api import ( Typed, ForwardTyped, Str, Float, Coerced, Bool, Enum, observe, ) from enaml.core.declar...
mit
-8,627,291,073,902,098,000
27.234568
79
0.593791
false
4.40231
false
false
false
gst/alignak
alignak/macroresolver.py
2
23875
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors # # This file is part of Alignak. # # Alignak is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, eit...
agpl-3.0
-6,827,662,738,583,955,000
35.442748
100
0.556054
false
4.076161
false
false
false
vitormazzi/django-jython
doj/backends/zxjdbc/oracle/query.py
1
6130
""" Custom Query class for Oracle. Derived from: django.db.models.sql.query.Query """ import datetime from django.db.backends import util # Cache. Maps default query class to new Oracle query class. _classes = {} def query_class(QueryClass, Database): """ Returns a custom django.db.models.sql.query.Query su...
bsd-3-clause
7,167,331,611,330,312,000
44.073529
125
0.558564
false
4.490842
false
false
false
simplegeo/sqlalchemy
lib/sqlalchemy/dialects/mssql/base.py
1
48621
# mssql.py """Support for the Microsoft SQL Server database. Connecting ---------- See the individual driver sections below for details on connecting. Auto Increment Behavior ----------------------- ``IDENTITY`` columns are supported by using SQLAlchemy ``schema.Sequence()`` objects. In other words:: Table('t...
mit
-1,975,082,025,182,092,500
34.962278
80
0.55947
false
4.218376
false
false
false
pmuller/ipkg
ipkg/versions.py
1
1177
import __builtin__ # because we override sorted in this module import pkg_resources def compare(a, b): if a < b: return -1 elif a == b: return 0 else: # a > b return 1 def extract(item): if isinstance(item, dict): version = item['version'] revision = item['...
mit
-3,061,816,019,314,012,000
24.042553
72
0.620221
false
4.188612
false
false
false
pmdp/GIW
mongodb-1/consultas.py
1
10427
# -*- coding: utf-8 -*- from bottle import run, get, request, template from pymongo import MongoClient from os import linesep mongoclient = MongoClient() db = mongoclient.giw #Columnas para las tablas de los ejercicios 2, 3, 4, 5 y 7 all_table_data = ['Nombre de usuario', 'e-mail', 'Página web', 'Tarjeta de crédito'...
gpl-3.0
4,137,989,952,177,386,000
37.779851
177
0.592322
false
3.424382
false
false
false
tuxfux-hlp-notes/python-batches
archieves/Batch-63/12-Logging/seventh.py
1
2105
#!/usr/bin/python # logging.basicConfig? # logging.Formatter? # man data or time.strftime(). # https://docs.python.org/2/library/subprocess.html # cronjob or scheduler # import logging.handlers for rest all handlers. from subprocess import Popen,PIPE from logging.handlers import SysLogHandler import logging #logging....
gpl-3.0
4,377,696,708,954,028,500
32.951613
87
0.705463
false
3.496678
false
false
false
KristianJensen/cameo
cameo/network_analysis/networkx_based.py
1
3295
# Copyright 2015 Novo Nordisk Foundation Center for Biosustainability, DTU. # # 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 requi...
apache-2.0
-9,001,907,852,848,431,000
31.303922
122
0.640061
false
4.364238
false
false
false
chand3040/cloud_that
lms/djangoapps/shoppingcart/processors/PayPal.py
1
21754
""" Implementation the PayPal processor. To enable this implementation, add the following to lms.auth.json: CC_PROCESSOR_NAME = "PayPal" CC_PROCESSOR = { "PayPal": { "PURCHASE_ENDPOINT": "sandbox or live url of paypal", "CLIENT_ID": "<paypal client_id>", "CLIENT_SEC...
agpl-3.0
322,017,873,674,394,940
42.077228
125
0.623472
false
4.254645
true
false
false
gimler/techism2
techism2/ical/views.py
1
3450
#!/usr/local/bin/python # -*- coding: utf-8 -*- from django.http import HttpResponse from django.core.urlresolvers import reverse from techism2 import service from datetime import datetime, timedelta import icalendar import time def ical(request): ninety_days = datetime.utcnow() + timedelta(days=90) event_lis...
apache-2.0
7,792,382,559,504,474,000
43.217949
115
0.627428
false
3.577801
false
false
false
infobip/infobip-api-python-client
infobip/api/model/nc/notify/NumberContextResponse.py
1
1285
# -*- coding: utf-8 -*- """This is a generated class and is not intended for modification! """ from datetime import datetime from infobip.util.models import DefaultObject, serializable from infobip.api.model.nc.notify.NumberContextResponseDetails import NumberContextResponseDetails class NumberContextResponse(Defau...
apache-2.0
2,975,082,414,965,617,700
25.791667
97
0.637354
false
4.131833
false
false
false
glenc/sp.py
src/sp/utils.py
1
3239
# Set up References import clr clr.AddReference("System") clr.AddReference("Microsoft.SharePoint") from System import Uri from Microsoft.SharePoint import * from Microsoft.SharePoint.Administration import SPWebApplication # Enumeration # These are simple enumeration methods for walking over various SharePoint # objec...
bsd-3-clause
7,495,485,383,914,679,000
20.885135
82
0.710096
false
3.15692
false
false
false
dukhlov/oslo.messaging
oslo_messaging/_drivers/zmq_driver/server/consumers/zmq_router_consumer.py
1
3834
# Copyright 2015 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
3,290,392,908,728,405,500
37.727273
78
0.6265
false
3.968944
false
false
false
stormi/tsunami
src/primaires/objet/commandes/remplir/__init__.py
1
4652
# -*-coding:Utf-8 -* # Copyright (c) 2010 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # l...
bsd-3-clause
-5,609,864,221,507,276,000
41.981481
79
0.615252
false
3.595662
false
false
false
SVilgelm/CloudFerry
cloudferry/lib/base/action/is_end_iter.py
1
1174
# Copyright (c) 2014 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the License); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, so...
apache-2.0
8,738,482,862,329,376,000
32.542857
70
0.682283
false
3.799353
false
false
false
punchagan/zulip
zerver/webhooks/pagerduty/view.py
1
7008
# Webhooks for external integrations. from typing import Any, Dict, Sequence from django.http import HttpRequest, HttpResponse from zerver.decorator import webhook_view from zerver.lib.exceptions import UnsupportedWebhookEventType from zerver.lib.request import REQ, has_request_variables from zerver.lib.response impo...
apache-2.0
2,138,208,620,822,185,200
34.21608
100
0.661244
false
3.604938
false
false
false
peterkuma/tjrapid
ob/views.py
1
1560
# -*- coding: utf-8 -*- from django.shortcuts import render from django.template import RequestContext from django.utils import translation from django.shortcuts import get_object_or_404 from django.http import Http404, HttpResponseRedirect from main.models import * from ob.models import * def events(request, categ...
mit
-8,542,457,093,815,724,000
25.896552
69
0.730128
false
3.203285
false
false
false
rlbabyuk/integration_tests
cfme/scripting/ipyshell.py
1
1483
# -*- coding: utf-8 -*- import sys from . import quickstart from IPython.terminal.interactiveshell import TerminalInteractiveShell IMPORTS = [ 'from utils import conf', 'from fixtures.pytest_store import store', 'from utils.appliance.implementations.ui import navigate_to', 'from utils import providers...
gpl-2.0
-2,106,811,254,778,584,000
37.025641
97
0.675657
false
3.872063
false
false
false
google-research/google-research
enas_lm/src/tpu/data_utils.py
1
3091
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
5,911,740,309,309,060,000
36.240964
79
0.664833
false
3.250263
false
false
false