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
zqqf16/clipboard
clipboard/handler.py
1
1304
#!/usr/bin/env python # -*- coding: utf-8 -*- import tornado.web from model import Entry from datetime import datetime import json class IndexHandler(tornado.web.RequestHandler): def get(self): entries = [e for e in Entry.select().order_by(Entry.date.desc())] self.render('clipboard.html', entries=...
mit
-7,280,940,398,504,245,000
27.347826
83
0.60046
false
3.694051
false
false
false
yeeking/snakestep
scripts/clock.py
1
2213
import time import thread import threading # really basic implementation of a busy waiting clock class Clock(): def __init__(self): self.bpm(120) # listeners stores things that listen for clock ticks self._listeners = [] # when did we last tick? self._last_tick = time.time()...
mit
5,506,961,174,629,579,000
28.905405
68
0.525983
false
3.815517
false
false
false
wavewave/madgraph-auto-model
modelrepo/heftNLO/write_param_card.py
1
6811
__date__ = "02 Aug 2012" __author__ = 'olivier.mattelaer@uclouvain.be' from function_library import * class ParamCardWriter(object): header = \ """######################################################################\n""" + \ """## PARAM_CARD AUTOMATICALY GENERATED BY THE UFO #####################...
bsd-2-clause
6,206,704,422,216,953,000
36.629834
93
0.466745
false
4.01592
false
false
false
lavish205/olympia
src/olympia/amo/celery.py
1
6347
"""Loads and instantiates Celery, registers our tasks, and performs any other necessary Celery-related setup. Also provides Celery-related utility methods, in particular exposing a shortcut to the @task decorator.""" from __future__ import absolute_import import datetime from django.conf import settings from django.c...
bsd-3-clause
-9,087,680,736,191,423,000
33.308108
79
0.648968
false
3.807439
false
false
false
multiplechoice/workplace
jobs/spiders/tvinna.py
1
1467
import dateutil.parser import scrapy import scrapy.spiders from jobs.common import clean_html from jobs.items import JobsItem class TvinnaSpider(scrapy.spiders.XMLFeedSpider): name = "tvinna" start_urls = ["http://www.tvinna.is/feed/?post_type=job_listing"] itertag = "item" namespaces = [ ("a...
apache-2.0
836,780,782,285,987,300
35.675
74
0.608044
false
3.395833
false
false
false
g3rd/django-akamai-storage
akamai_storage/forms/models.py
1
1830
from django.forms.models import BaseModelForm, ErrorList, model_to_dict class AkamaiBaseModelForm(BaseModelForm): def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=ErrorList, label_suffix=None, empty_permitted=False, instance=None)...
mit
-6,193,288,522,580,875,000
49.833333
92
0.603279
false
4.452555
false
false
false
foolcage/fooltrader
fooltrader/spiders/america/sp500_spider.py
1
3418
# -*- coding: utf-8 -*- import pandas as pd import scrapy from scrapy import Request from scrapy import Selector from scrapy import signals from fooltrader.contract.files_contract import get_kdata_path from fooltrader.utils.utils import index_df_with_time, to_time_str, to_float class Sp500Spider(scrapy.Spider): ...
mit
-1,803,275,329,661,801,200
37.840909
107
0.547689
false
3.582809
false
false
false
Azure/azure-sdk-for-python
sdk/core/azure-core/tests/testserver_tests/test_rest_http_request.py
1
11042
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. # -------------------------------------------------------------...
mit
-4,604,077,631,568,320,000
35.140984
131
0.621394
false
3.709862
true
false
false
flennerhag/mlens
mlens/ensemble/tests/test_a_sklearn.py
1
7958
""" Test Scikit-learn """ import numpy as np from mlens.ensemble import SuperLearner, Subsemble, BlendEnsemble, TemporalEnsemble from mlens.testing.dummy import return_pickled try: from sklearn.utils.estimator_checks import check_estimator from sklearn.linear_model import Lasso, LinearRegression from sklear...
mit
-4,493,878,293,141,852,000
29.258555
83
0.573637
false
3.513466
true
false
false
sadanandb/pmt
src/tactic/ui/container/pop_window_wdg.py
1
40581
############################################################ # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without writt...
epl-1.0
-6,829,569,407,633,964,000
35.060274
119
0.520638
false
3.19762
false
false
false
gwct/grampa
docs/scripts/generators/about_generator.py
1
17272
############################################################ # For GRAMPA site, 12.19 # This generates the file "about.html" ############################################################ import sys, os sys.path.append('..') import lib.read_chunks as RC ###################### # HTML template ###################### htm...
gpl-3.0
-4,442,646,838,849,395,700
64.181132
196
0.688861
false
3.246006
false
false
false
frouty/odoo_oph
addons/account/account_invoice.py
1
96788
# -*- 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...
agpl-3.0
12,661,014,359,507,784
52.474033
307
0.560245
false
3.871675
false
false
false
Svalorzen/AI-Toolbox
.ycm_extra_conf.py
1
4719
# This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either...
gpl-3.0
-5,098,795,547,491,970,000
34.216418
80
0.712015
false
3.641204
false
false
false
minrk/sympy
sympy/polys/polyclasses.py
1
46239
"""OO layer for several polynomial representations. """ from sympy.core.compatibility import cmp class GenericPoly(object): """Base class for low-level polynomial representations. """ def ground_to_ring(f): """Make the ground domain a ring. """ return f.set_domain(f.dom.get_ring()) def g...
bsd-3-clause
-899,980,643,077,124,200
28.583493
105
0.50239
false
3.187797
false
false
false
paveldedik/thesis
models/models.py
1
30072
# -*- coding: utf-8 -*- """ Evaluation Models ================= """ from __future__ import division from copy import copy from itertools import izip from collections import defaultdict import numpy as np import pandas as pd import tools __all__ = ( 'DummyPriorModel', 'EloModel', 'EloResponseTime', ...
mit
3,786,921,495,421,080,000
30.098242
78
0.614758
false
3.918176
false
false
false
jarnoln/cvdb
viewcv/cv.py
1
4641
import logging import weasyprint from django.core.exceptions import PermissionDenied from django.urls import reverse, reverse_lazy from django.views.generic import DetailView, ListView, RedirectView from django.views.generic.edit import UpdateView, DeleteView from django.http import Http404, HttpResponse from django.co...
mit
-3,008,300,420,551,048,000
33.634328
99
0.613876
false
3.83871
false
false
false
51x/IP_Blocker-Flask_Iptables
flask_iptables.py
1
1578
#!/usr/bin/python # -*- coding: utf-8 -*- # Block using iptables through Flask import subprocess # Run iptables from IPy import IP # Valide IP import re # Make sure to validate from flask import Flask # Run Flask from flask import request # For url arguments app = Flask(__name__) # wget "127.0.0.1:9000/block?ip=8.8....
gpl-3.0
1,360,077,447,781,619,500
28.222222
128
0.569075
false
3.246914
false
false
false
mahabs/nitro
nssrc/com/citrix/netscaler/nitro/resource/config/ssl/sslglobal_sslpolicy_binding.py
1
12604
# # Copyright (c) 2008-2015 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
-3,906,446,395,814,470,000
36.736527
430
0.730482
false
3.754543
false
false
false
numirias/firefed
firefed/feature/bookmarks.py
1
2683
from attr import attrib, attrs from firefed.feature import Feature, formatter from firefed.output import csv_writer, good, out from firefed.util import moz_to_unix_timestamp DIRECTORY_TYPE = 2 @attrs class Bookmark: id = attrib() parent = attrib() type = attrib() title = attrib() guid = attrib...
mit
7,441,449,831,997,626,000
28.483516
81
0.51025
false
3.794908
false
false
false
DongjunLee/kino-bot
kino/utils/state.py
1
2110
# -*- coding: utf-8 -*- import arrow from .arrow import ArrowUtil from .data_handler import DataHandler class State(object): FLOW = "flow" MEMORY = "memory" ACTION = "action" SLEEP = "sleep" REST = "rest" def __init__(self): self.data_handler = DataHandler() self.fname = "s...
mit
4,102,606,326,711,703,000
26.763158
87
0.575355
false
3.386838
false
false
false
ray-project/ray
rllib/agents/es/es_torch_policy.py
1
5277
# Code in this file is adapted from: # https://github.com/openai/evolution-strategies-starter. import gym import numpy as np import tree # pip install dm_tree import ray from ray.rllib.models import ModelCatalog from ray.rllib.policy.policy_template import build_policy_class from ray.rllib.policy.sample_batch import...
apache-2.0
94,148,031,799,769,420
37.518248
78
0.614554
false
3.888725
true
false
false
Orav/kbengine
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/packages/urllib3/request.py
1
5949
# urllib3/request.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php try: from urllib.parse import urlencode except ImportError: from urllib import...
lgpl-3.0
-7,818,495,000,782,802,000
40.191489
81
0.598084
false
4.69164
false
false
false
mbiciunas/nix
src/cli_config/script/script_rename.py
1
2028
# NixConfig # Copyright (c) 2017 Mark Biciunas. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is d...
gpl-3.0
-5,188,311,129,422,364,000
31.190476
91
0.675542
false
4.342612
false
false
false
arkharin/OpenCool
scr/logic/components/separator_flow/theoretical.py
1
3301
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. """ Define the Separator Flow component. """ from scr.logic.components.component import Component as Cmp from scr.logic....
mpl-2.0
-5,360,974,496,690,660,000
38.309524
125
0.65465
false
2.853068
false
false
false
timothycrosley/pies
pies/overrides.py
1
8179
"""pies/overrides.py. Overrides Python syntax to conform to the Python3 version as much as possible using a '*' import Copyright (C) 2013 Timothy Edmund Crosley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal ...
mit
6,420,396,422,063,561,000
31.328063
116
0.59396
false
4.293438
false
false
false
amanharitsh123/zulip
zerver/tornado/socket.py
1
13905
from typing import Any, Dict, Mapping, Optional, Text, Union from django.conf import settings from django.utils.timezone import now as timezone_now from django.utils.translation import ugettext as _ from django.contrib.sessions.models import Session as djSession try: from django.middleware.csrf import _compare_sa...
apache-2.0
-7,408,919,245,389,131,000
43.283439
115
0.577778
false
4.044503
false
false
false
betrisey/home-assistant
tests/test_util/aiohttp.py
1
3248
"""Aiohttp test utils.""" import asyncio from contextlib import contextmanager import functools import json as _json from unittest import mock class AiohttpClientMocker: """Mock Aiohttp client requests.""" def __init__(self): """Initialize the request mocker.""" self._mocks = [] self....
mit
5,491,227,388,798,299,000
27.743363
75
0.564963
false
4.455418
false
false
false
OCA/margin-analysis
sale_order_margin_percent/tests/test_margin_percent.py
1
1456
# Copyright 2019 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl from odoo.tests import SavepointCase class TestSaleMarginPercent(SavepointCase): def setUp(self): super().setUp() self.SaleOrder = self.env['sale.order'] self.product_uom_id = self.ref('uom.pr...
agpl-3.0
-5,844,371,091,095,846,000
34.512195
64
0.524725
false
3.667506
false
false
false
tatsuhirosatou/JMdictDB
python/lib/jmxml.py
1
40347
####################################################################### # This file is part of JMdictDB. # Copyright (c) 2006-2012 Stuart McGraw # # JMdictDB 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-2.0
-779,504,099,350,805,900
43.681063
98
0.534934
false
3.714851
false
false
false
ctogle/make_places
mp/make_places/blueprints.py
1
6334
#import make_places.scenegraph as sg import make_places.fundamental as fu import make_places.walls as wa #import make_places.primitives as pr import mp_utils as mpu import mp_bboxes as mpbb import mp_vector as cv #from make_places.stairs import ramp #from make_places.stairs import shaft #from make_places.floors import...
gpl-2.0
-4,426,654,233,850,615,000
26.419913
78
0.578623
false
3.121735
false
false
false
mesheven/pyOCD
pyocd/debug/breakpoints/manager.py
1
6475
""" mbed CMSIS-DAP debugger Copyright (c) 2015-2017 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable ...
apache-2.0
-6,488,740,294,680,375,000
34
96
0.586873
false
4.163987
false
false
false
jeremiahyan/odoo
addons/survey/tests/test_survey_flow.py
1
5648
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.addons.survey.tests import common from odoo.tests import tagged from odoo.tests.common import HttpCase @tagged('-at_install', 'post_install', 'functional') class TestSurveyFlow(common.TestSurveyCommon, HttpCa...
gpl-3.0
752,808,867,488,364,400
46.066667
145
0.581445
false
3.933148
true
false
false
pombredanne/pyp2rpm
pyp2rpm/name_convertor.py
1
7808
import logging import re try: import dnf except ImportError: dnf = None from pyp2rpm import settings from pyp2rpm import utils from pyp2rpm.logger import LoggerWriter logger = logging.getLogger(__name__) class NameConvertor(object): def __init__(self, distro): self.distro = distro self...
mit
7,444,019,662,291,841,000
37.845771
99
0.60105
false
4.105152
false
false
false
rfinnie/unladen
unladen/httpd/handlers/status.py
1
1333
#!/usr/bin/env python # Unladen # Copyright (C) 2014 Ryan Finnie # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # ...
gpl-2.0
3,672,747,148,127,936,500
31.512195
73
0.684921
false
3.932153
false
false
false
giruenf/GRIPy
app/app_utils.py
1
29345
import re import os import json import importlib import timeit import inspect import collections from enum import Enum from pathlib import Path import numpy as np from matplotlib.cm import cmap_d import wx import app import fileio from classes.om.base.manager import ObjectManager from app import log ...
apache-2.0
-2,007,023,896,810,117,400
34.727159
103
0.527926
false
3.190021
false
false
false
grouan/udata
udata/api/fields.py
1
2440
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from dateutil.parser import parse from flask import request, url_for from flask.ext.restplus.fields import * log = logging.getLogger(__name__) class ISODateTime(String): __schema_format__ = 'date-time' def format(self, value)...
agpl-3.0
1,874,636,427,373,957,000
28.047619
78
0.607377
false
3.935484
false
false
false
optiv-labs/talus_client
talus_client/cmds/__init__.py
1
11800
#!/usr/bin/env python # encoding: utf-8 import argparse import arrow import cmd import datetime import glob import json import inspect import os import re import readline import shlex import sys import textwrap import types import talus_client.api import talus_client.errors as errors import talus_client.utils as util...
mit
4,405,679,507,563,071,000
26.699531
118
0.648559
false
2.965569
false
false
false
cristian99garcia/laybrinth-activity
labyrinthactivity.py
1
39566
#!/usr/bin/python # coding=UTF-8 # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the...
gpl-2.0
-8,125,047,139,919,657,000
36.151174
123
0.580397
false
3.60839
false
false
false
wkschwartz/django
django/utils/http.py
1
17700
import base64 import calendar import datetime import re import unicodedata import warnings from binascii import Error as BinasciiError from email.utils import formatdate from urllib.parse import ( ParseResult, SplitResult, _coerce_args, _splitnetloc, _splitparams, quote, quote_plus, scheme_chars, unquote, unquo...
bsd-3-clause
-1,610,993,750,533,662,700
34.329341
108
0.621356
false
3.815477
false
false
false
Ignalion/bookshelf
app/endpoints/booksauthors.py
1
5914
""" Here are defined all book related views as below: BookList AuthorList AddEditBook AddEditAuthor """ from flask import ( render_template, request, redirect, url_for, views, ) from flask_login import login_required, current_user from app.lib.abstract import BookAbstraction, Auth...
gpl-2.0
2,764,888,172,949,385,000
32.794286
79
0.521644
false
4.31364
false
false
false
mitodl/open-discussions
sites/migrations/0001_add_authenticated_site.py
1
2689
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2018-02-09 19:37 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name="Authenticat...
bsd-3-clause
-8,328,817,798,779,035,000
35.337838
155
0.410933
false
5.378
false
false
false
kevgliss/historical
historical/s3/poller.py
1
3444
""" .. module: historical.s3.poller :platform: Unix :copyright: (c) 2017 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. author:: Mike Grima <mgrima@netflix.com> """ import os import uuid import logging import boto3 from botocore.exceptions import ClientError from ...
apache-2.0
8,197,142,188,748,092,000
35.638298
117
0.664634
false
4.032787
false
false
false
rsmmr/hilti
doc/scripts/hlt.py
1
5732
# -*- coding: utf-8 -*- """X The Hlt domain for Sphinx. """ def setup(Sphinx): Sphinx.add_domain(HltDomain) from sphinx import addnodes from sphinx.domains import Domain, ObjType from sphinx.locale import l_, _ from sphinx.directives import ObjectDescription from sphinx.roles import XRefRole from sphinx.util....
bsd-3-clause
-4,610,790,904,439,784,000
32.325581
82
0.532798
false
3.7885
false
false
false
salimfadhley/jenkinsapi
jenkinsapi_tests/unittests/test_requester.py
2
12127
from __future__ import print_function import pytest import requests from jenkinsapi.jenkins import Requester from jenkinsapi.custom_exceptions import JenkinsAPIException from mock import patch def test_no_parameters_uses_default_values(): req = Requester() assert isinstance(req, Requester) assert req.user...
mit
-207,026,566,923,361,760
28.151442
82
0.61829
false
3.689382
true
false
false
facelessuser/subclrschm
setup.py
1
2691
#!/usr/bin/env python # -*- coding: utf-8 -*- """Setup package.""" from setuptools import setup, find_packages import os import imp import traceback def get_version(): """Get version and version_info without importing the entire module.""" devstatus = { 'alpha': '3 - Alpha', 'beta': '4 - Beta...
mit
-6,795,916,051,965,609,000
29.931034
86
0.621702
false
3.646341
false
false
false
Reality9/spiderfoot
modules/sfp_whois.py
1
2855
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------- # Name: sfp_whois # Purpose: SpiderFoot plug-in for searching Whois servers for domain names # and netblocks identified. # # Author: Steve Micallef <steve@binarypool.com> # #...
gpl-2.0
-5,858,934,050,261,415,000
30.078652
98
0.544658
false
3.998599
false
false
false
lago-project/lago-ost-plugin
ovirtlago/utils.py
1
2164
# # Copyright 2014-2017 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 2 of the License, or # (at your option) any later version. # # This program is distributed ...
gpl-2.0
-7,402,835,338,542,384,000
27.853333
79
0.634473
false
4.161538
false
false
false
mikar/60-days-of-python
gui/filebrowser/fileops.py
1
24240
# -*- coding: utf-8 -*- from operator import itemgetter from unicodedata import normalize import fnmatch import logging import os import re import string import helpers log = logging.getLogger("fileops") class FileOps(object): def __init__(self, casemode=0, countpos=0, dirsonly=False, exclude="", ...
mit
6,557,784,114,560,238,000
29.221945
82
0.573768
false
4.068827
false
false
false
agendaTCC/AgendaTCC
tccweb/apps/usuarios/admin.py
1
2272
# -*- coding: utf-8 -*- from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.utils.translation import ugettext_lazy as _ from models import _User, CSVUsuario from forms import _UserChangeForm,_UserCreationForm def deactivate(modeladmin, request, queryset): queryset.update(i...
gpl-2.0
-1,889,795,591,340,552,000
40.218182
160
0.588884
false
3.493066
false
false
false
datamade/represent-boundaries
boundaries/tests/test_boundary.py
1
5043
# coding: utf-8 from __future__ import unicode_literals import datetime from django.test import TestCase from django.contrib.gis.gdal import OGRGeometry from django.contrib.gis.geos import Point, GEOSGeometry from boundaries.models import BoundarySet, Boundary, Geometry class BoundaryTestCase(TestCase): maxDiff...
mit
-7,161,883,801,366,320,000
35.280576
133
0.493555
false
3.641155
true
false
false
vladimir-ipatov/ganeti
lib/ssh.py
1
10583
# # # Copyright (C) 2006, 2007, 2010, 2011 Google 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 2 of the License, or # (at your option) any later version. # # This progr...
gpl-2.0
2,119,428,609,877,526,000
30.218289
79
0.651422
false
3.7555
false
false
false
alphagov/backdrop
tests/read/test_validators.py
1
3336
import unittest from hamcrest import * from backdrop.read.validation import ParameterMustBeOneOfTheseValidator, MondayValidator, FirstOfMonthValidator, ParamDependencyValidator # TODO: looked around and couldn't see any other validator tests class TestValidators(unittest.TestCase): def test_value_must_be_one_of...
mit
-7,594,048,280,196,841,000
32.029703
137
0.536871
false
4.058394
true
false
false
woutdenolf/spectrocrunch
spectrocrunch/visualization/tests/test_scene.py
1
2667
# -*- coding: utf-8 -*- import unittest import matplotlib.pyplot as plt import numpy as np from .. import scene from ...patch.pint import ureg class test_scene(unittest.TestCase): def test_images(self): n0, n1 = 5, 10 img = np.arange(n0 * n1).reshape(n0, n1) unit0 = ureg.mm uni...
mit
1,212,141,342,712,263,000
24.893204
86
0.522685
false
2.861588
true
false
false
gurneyalex/odoo
addons/website_hr_recruitment/models/hr_recruitment.py
8
2050
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from werkzeug import urls from odoo import api, fields, models from odoo.tools.translate import html_translate class RecruitmentSource(models.Model): _inherit = 'hr.recruitment.source' url = fields.Char(compu...
agpl-3.0
-3,908,755,139,462,205,000
35.607143
171
0.639024
false
3.634752
false
false
false
khertan/Wleux
make.py
1
3091
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2011 Benoît HERVIER <khertan@khertan.net> # Licenced under GPLv3 ## 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; version 3 only. #...
gpl-3.0
-7,431,925,628,490,577,000
33.322222
134
0.663969
false
3.110775
false
false
false
matrixorz/ut_ali
ut_engine/evaluate/evaluator.py
1
1366
#!/usr/bin/python #-*- coding: utf-8 -*- import sys from collections import defaultdict as ddict def load_test(path): test = ddict(list) with file(path) as f: for line in f: elements = line.strip().split(',') if elements[2] != '1': continue uid = int(elements[0]) ...
mit
-1,154,984,135,064,513,000
26.32
72
0.544656
false
3.06278
true
false
false
dib-lab/kevlar
kevlar/cli/dist.py
1
2230
#!/usr/bin/env python # # ----------------------------------------------------------------------------- # Copyright (c) 2016 The Regents of the University of California # # This file is part of kevlar (http://github.com/dib-lab/kevlar) and is # licensed under the MIT license: see LICENSE. # ----------------------------...
mit
883,916,755,266,280,200
52.095238
79
0.527354
false
4.272031
false
false
false
rocktavious/DevToolsLib
DTL/api/daemon.py
1
6655
# Taken and modified from: # http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ import threading import Queue import atexit import os import signal import sys import time import logging import logging.handlers from DTL.api import loggingUtils if (hasattr(os, "devnull")): DEVNULL = os.de...
mit
3,978,645,494,672,254,500
29.392694
92
0.433509
false
4.676739
false
false
false
louisrli/grabrc-client
client/util.py
1
2688
""" Utility functions for output, executing commands, and downloading files. """ # 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...
gpl-3.0
7,016,417,344,108,169,000
26.428571
100
0.667783
false
3.617766
false
false
false
kmichalak/rosie
test/test_create_git_branch.py
1
4104
import os import shutil import git from rosie.plugins import CreateGitBranch from test.test_base import ( GitRepoTestCase, JenkinsJobMock ) class CreateGitBranchTest(GitRepoTestCase): def setUp(self): self.repo_dir = os.path.join(os.getcwd(), 'test/tmp') self.jenkins_job = JenkinsJobMock...
apache-2.0
-5,072,018,693,773,136,000
28.956204
74
0.552144
false
3.996105
true
false
false
TaskEvolution/Task-Coach-Evolution
taskcoach/taskcoachlib/gui/iphone.py
1
2653
''' Task Coach - Your friendly task manager Copyright (C) 2004-2013 Task Coach developers <developers@taskcoach.org> Task Coach is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or ...
gpl-3.0
-6,450,007,675,775,254,000
33.454545
95
0.6683
false
3.674515
false
false
false
thinkopensolutions/tkobr-addons
tko_account_payment_method_journal_entry_selection/account_invoice.py
1
1727
from openerp import models, fields, api class account_invoice(models.Model): _inherit = 'account.invoice' @api.one @api.depends( 'move_id.line_ids' ) def _get_receivable_lines(self): if self.move_id: data_lines = [x for x in self.move_id.line_ids if ( x...
agpl-3.0
4,093,489,694,293,593,000
38.25
106
0.573827
false
3.812362
false
false
false
tambu-j/signals
python/candlestick.py
1
1780
# __all__ = ['candlestick_trades'] import numpy as np import ctypes import os def _getpath(): #return r"/Users/tim/Library/Caches/clion10/cmake/generated/c57b29e0/c57b29e0/Debug/" return r"/Users/tim/dev/signals/build" def _load_candlestick_lib(): return np.ctypeslib.load_library("libsignals", _getpath...
apache-2.0
-4,548,263,752,612,800,000
40.418605
89
0.473596
false
4.278846
false
false
false
PnEcrins/GeoNature
contrib/module_example/backend/blueprint.py
1
1374
from flask import Blueprint, current_app, session from geonature.utils.utilssqlalchemy import json_resp from geonature.utils.env import get_id_module # import des fonctions utiles depuis le sous-module d'authentification from geonature.core.gn_permissions import decorators as permissions from geonature.core.gn_permis...
bsd-2-clause
-7,252,899,591,470,316,000
33.1
75
0.716801
false
2.91863
false
false
false
alexanderfefelov/nav
python/nav/web/devicehistory/urls.py
1
1840
# # Copyright (C) 2008-2009 UNINETT AS # # This file is part of Network Administration Visualized (NAV). # # NAV is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License version 2 as published by the Free # Software Foundation. # # This program is distributed in the...
gpl-2.0
2,219,473,031,298,057,200
40.818182
79
0.668478
false
3.991323
false
false
false
2ndy/RaspIM
usr/share/python-support/python-soappy/SOAPpy/wstools/c14n.py
1
21235
"""Compatibility module, imported by ZSI if you don't have PyXML 0.7. No copyright violations -- we're only using parts of PyXML that we wrote. """ _copyright = '''ZSI: Zolera Soap Infrastructure. Copyright 2001, Zolera Systems, Inc. All Rights Reserved. Copyright 2002-2003, Rich Salz. All Rights Reserved. Permis...
gpl-2.0
-1,016,785,352,330,602,400
38.691589
138
0.547116
false
4.086011
false
false
false
egbertbouman/tribler-g
Tribler/Core/ProxyService/ProxyDownloader.py
1
23379
# Written by John Hoffman, George Milescu # see LICENSE.txt for license information import sys from random import randint from urlparse import urlparse from httplib import HTTPConnection import urllib import time from threading import Thread,currentThread,Lock from traceback import print_exc, print_stack from collecti...
lgpl-2.1
-7,412,642,661,146,545,000
35.759434
163
0.582831
false
4.337477
false
false
false
wdv4758h/ZipPy
lib-python/3/test/test_types.py
1
22083
# Python test set -- part 6, built-in types from test.support import run_unittest, run_with_locale, impl_detail import unittest import sys import locale class TypesTests(unittest.TestCase): def test_truth_values(self): if None: self.fail('None is true instead of false') if 0: self.fail('0 is true...
bsd-3-clause
7,613,874,855,356,535,000
37.272097
94
0.502332
false
3.207407
true
false
false
espenak/enkel
enkel/exml/formgen.py
1
4443
# This file is part of the Enkel web programming library. # # Copyright (C) 2007 Espen Angell Kristiansen (espen@wsgi.net) # # 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...
gpl-2.0
-2,090,161,680,316,545,300
25.446429
81
0.674994
false
3.072614
false
false
false
rossella/neutron
quantum/openstack/common/jsonutils.py
1
5314
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may #...
apache-2.0
3,052,417,602,733,729,300
34.905405
78
0.625894
false
4.522553
false
false
false
adybbroe/atrain_match
atrain_match/reshaped_files_scr/plot_ctth_boxplots_mlvl2_temperature_pressure_height.py
1
16002
"""Read all matched data and make some plotting """ import os import re from glob import glob import numpy as np from matchobject_io import (readCaliopImagerMatchObj, CalipsoImagerTrackObject) from plot_kuipers_on_area_util import (PerformancePlottingObject, ...
gpl-3.0
-7,393,755,009,320,824,000
55.946619
453
0.624734
false
2.607463
false
false
false
duythanhphan/qt-creator
tests/system/shared/project_explorer.py
1
15291
############################################################################# ## ## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ## Contact: http://www.qt-project.org/legal ## ## This file is part of Qt Creator. ## ## Commercial License Usage ## Licensees holding valid commercial Qt licenses may use this f...
lgpl-2.1
179,521,143,003,143,680
54.402174
142
0.683539
false
3.996602
true
false
false
ecederstrand/exchangelib
exchangelib/services/get_user_configuration.py
1
1729
from .common import EWSAccountService from ..properties import UserConfiguration from ..util import create_element, set_xml_value ID = 'Id' DICTIONARY = 'Dictionary' XML_DATA = 'XmlData' BINARY_DATA = 'BinaryData' ALL = 'All' PROPERTIES_CHOICES = {ID, DICTIONARY, XML_DATA, BINARY_DATA, ALL} class GetUserConfiguratio...
bsd-2-clause
-5,405,332,260,484,910,000
41.170732
115
0.712551
false
4.106888
true
false
false
mghweb/sublime-miva-ide
mvt-toggle-comment.py
1
7319
import sublime, sublime_plugin def advance_to_first_non_white_space_on_line(view, pt): while True: c = view.substr(pt) if c == " " or c == "\t": pt += 1 else: break return pt def has_non_white_space_on_line(view, pt): while True: c = view.substr(pt) if c == " " or c == "\t": pt += 1 else: ...
mit
-864,045,968,172,918,800
30.416309
89
0.679328
false
3.106537
false
false
false
PnMercantour/autorisations_circulation
auth_circu/routes/export.py
1
5388
import unicodedata from io import BytesIO from datetime import datetime import flask_excel import weasyprint from flask import request, send_file, g, make_response, jsonify from secretary import Renderer from werkzeug.exceptions import BadRequest, abort from sqlalchemy.orm.exc import NoResultFound from pypnusers...
gpl-3.0
7,626,577,335,625,211,000
30.652941
80
0.606207
false
3.549472
false
false
false
voicesauce/opensauce-python
opensauce/helpers.py
1
3298
"""Helper functions for OpenSauce """ # Licensed under Apache v2 (see LICENSE) from __future__ import division import math import fileinput import numpy as np from scipy.io import wavfile def wavread(fn): """Read in a 16-bit integer PCM WAV file for processing Args: fn - filename of WAV file [st...
apache-2.0
-4,575,236,972,586,572,300
28.711712
111
0.661007
false
3.612267
false
false
false
gtesei/fast-furious
competitions/tgs-salt-identification-challenge/solutions/9_place/models/inplace_abn/bn.py
1
3567
import torch from queue import Queue from .functions import * from .abn import ABN class InPlaceABN(ABN): """InPlace Activated Batch Normalization""" def forward(self, x): exponential_average_factor = 0.0 if self.training and self.track_running_stats: self.num_batches_tracked +...
mit
2,949,862,532,384,423,000
38.633333
107
0.596299
false
4.266746
false
false
false
zielmicha/satori
satori.web/satori/web/utils/xmlparams.py
1
1156
from satori.client.common import want_import want_import(globals(), '*') from datetime import datetime from xml.dom import minidom from django import forms from satori.web.utils import forms as satoriforms from satori.tools.params import * class ParamsForm(forms.Form): fieldtypes = { OaTypeTex...
mit
6,455,497,379,610,604,000
37.566667
73
0.583045
false
4.070423
false
false
false
sallyom/atomic
Atomic/verify.py
1
11302
from . import util from . import Atomic import os from docker.errors import NotFound from operator import itemgetter class Verify(Atomic): DEBUG = False def verify(self): """ Primary def for atomic verify :return: None """ def fix_layers(layers): """ ...
lgpl-2.1
7,556,177,246,161,963,000
39.508961
112
0.500442
false
4.407956
true
false
false
hmtai6/universe_NeonRace-v0
DQN_breakout/DQN.py
1
9601
import argparse import logging import sys import gc import cv2 import matplotlib.pyplot as plt import gym import universe # register the universe environments from universe import wrappers from collections import deque from skimage.color import rgb2gray from skimage.transform import resize import numpy as np import t...
mit
-7,813,668,082,382,251,000
35.371212
144
0.611915
false
3.51685
false
false
false
zenr/ippy
segmentation/shanbhag.py
1
1545
import numpy as np import scipy.misc def shanbhag(imgdata) : """Returns a binary segmentation threshold using the Shanbhag algorithm given imgdata as a grayscale image of type numpy.ndarray """ # get normalized histogram hist, bins = np.histogram(imgdata,range(0,257),density=True) # calculate ...
gpl-3.0
4,705,636,846,058,423,000
28.711538
75
0.586408
false
3.380744
false
false
false
codebox/star-charts
coord_calc.py
1
4668
# -*- coding: utf-8 -*- from math import sin, cos, degrees, radians, pi class CoordCalc: def __init__(self, star_data_list, area, diagram_size): self.star_data_list = star_data_list self.area = area self.center_ra_angle = self._ra_to_angle((area.ra_min + area.ra_max)/2) if area.ra...
mit
-2,826,641,857,710,505,000
35.732283
117
0.572347
false
2.954402
false
false
false
bolidozor/RTbolidozor
handlers/__init__.py
1
2316
#!/usr/bin/env python # -*- coding: utf-8 -*- import MySQLdb as mdb import pymysql.cursors import os import tornado from requests_oauthlib import OAuth2Session import smtplib #from email.MIMEMultipart import MIMEMultipart #from email.MIMEBase import MIMEBase #from email.MIMEText import MIMEText #from email.Utils impo...
gpl-3.0
-5,035,603,752,302,982,000
26.903614
163
0.617444
false
3.840796
false
false
false
TatsuyaOGth/PepperScripts
LittlePerformance/module/_tmp/random_move.py
1
1596
import time import math import random from naoqi import ALProxy #IP = '127.0.0.1' #port = 49951 IP = '192.168.3.9' port = 9559 motion_proxy = ALProxy('ALMotion',IP,port) part = 'Body' time.sleep(3.0) for i in range(200): motion_proxy.setStiffnesses(part, 1.0) body_names = motion_proxy.getBodyNames(part) if i...
cc0-1.0
-5,709,509,332,995,824,000
20.863014
81
0.703634
false
2.751724
false
false
false
terna/SLAPP3
6 objectSwarmObserverAgents_AESOP_turtleLib_NetworkX/start.py
1
4599
# start 6 objectSwarmObserverAgentsAESOP.py # 'project' is by default both the name of the application and of the subfolder # that contains its code; the subfolder is supposed to be placed within the # SLAPP tree # the folder can can be placed outside the SLAPP tree if we place a file # project.txt in the folder "6 ...
cc0-1.0
-7,428,399,567,447,264,000
33.320896
89
0.599043
false
4.215399
false
false
false
darkopevec/kivy
kivy/uix/widget.py
1
46002
''' Widget class ============ The :class:`Widget` class is the base class required for creating Widgets. This widget class was designed with a couple of principles in mind: * *Event Driven* Widget interaction is built on top of events that occur. If a property changes, the widget can respond to the change in the...
mit
-6,705,151,984,013,767,000
33.797277
80
0.61193
false
4.103657
false
false
false
ryfeus/lambda-packs
Spacy/source2.7/thinc/neural/_classes/batchnorm.py
1
3359
from .model import Model from ... import describe def _init_to_one(W, ops): W.fill(1.) def _run_child_hooks(model, X, y=None): for hook in model.child.on_data_hooks: hook(model.child, X, y) @describe.on_data(_run_child_hooks) @describe.attributes( G=describe.Weights("Scaling vector", la...
mit
-4,046,856,294,922,201,000
31.298077
75
0.54808
false
2.983126
false
false
false
Tatsh/tccutil
tccutil.py
1
7732
#!/usr/bin/env python import argparse import sqlite3 import sys import os import hashlib from platform import mac_ver from distutils.version import StrictVersion as version ############################## ######## VARIABLES ########### # Utility Name util_name = os.path.basename(sys.argv[0]) # Utility Version util_v...
gpl-2.0
-660,460,857,305,158,800
25.29932
127
0.622866
false
3.657521
false
false
false
ziel980/website
app/__init__.py
1
2897
from flask_sqlalchemy import SQLAlchemy from flask_bootstrap import Bootstrap from .navigation import * import os from werkzeug.middleware.proxy_fix import ProxyFix db = SQLAlchemy() nav = MyNavigation() module_setup_functions = [] def create_app(config, disable_login=False): # Flask from flask import Flask ...
mit
3,497,567,861,086,679,000
30.835165
118
0.677943
false
3.832011
false
false
false
seribits/seriauth
seriauth/api/v1/superusers/views.py
1
3886
# -*- encoding: utf-8 -*- from flask import make_response, request from flask_restful import Api, Resource from .. import blueprint_superusers from ...lib.encrypt import encrypt_sha512 from ...lib.errors import error_410, error_422, error_500 from ...lib.regex_validators import validate_password from .models import Su...
gpl-3.0
7,559,758,148,637,709,000
32.119658
74
0.547355
false
4.230349
false
false
false
IamJeffG/geopandas
geopandas/io/tests/test_io.py
1
1794
from __future__ import absolute_import import fiona from geopandas import read_postgis, read_file from geopandas.tests.util import download_nybb, connect, create_db, \ PANDAS_NEW_SQL_API, unittest, validate_boro_df class TestIO(unittest.TestCase): def setUp(self): nybb_filename, nybb_zip_path = dow...
bsd-3-clause
5,256,483,910,449,221,000
31.035714
69
0.552954
false
3.559524
true
false
false
fosfataza/protwis
ligand/models.py
1
14776
from django.db import models from django.utils.text import slugify from django.db import IntegrityError from common.models import WebResource from common.models import WebLink from common.tools import fetch_from_web_api from urllib.request import urlopen, quote import json import yaml import logging class Ligand(mod...
apache-2.0
-3,696,227,186,216,180,700
41.338109
211
0.623782
false
3.748351
false
false
false
florianfesti/boxes
boxes/generators/folder.py
1
1599
#!/usr/bin/env python3 # Copyright (C) 2013-2014 Florian Festi # # 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....
gpl-3.0
2,576,006,453,972,368,400
31.632653
73
0.623515
false
3.43133
false
false
false
jkyeung/XlsxWriter
xlsxwriter/test/comparison/test_chart_stock01.py
1
2175
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
-961,379,040,412,736,800
29.208333
79
0.511724
false
3.441456
true
false
false
antoinevg/survival
ontology/human.py
1
1096
#import sys #import cairo #import math import rsvg from random import random # for myfn import widgets #from widgets.texteditor import TextEditor #from core.mathlib import MathLib #from core.world import TheWorld from ontology.movingthing import MovingThing SIZE = 0.05 # scaling constant class Human(MovingThing):...
gpl-2.0
1,649,486,439,531,439,600
17.896552
50
0.614051
false
3.010989
false
false
false
pombredanne/DjangoRestMultipleModels
drf_multiple_model/mixins.py
1
6074
from rest_framework.response import Response class MultipleModelMixin(object): """ Create a list of objects from multiple models/serializers. Mixin is expecting the view will have a queryList variable, which is a list/tuple of queryset/serailizer pairs, like as below: queryList = [ (...
mit
1,078,349,059,939,249,000
31.137566
99
0.594666
false
4.536221
false
false
false
openstack/watcher-dashboard
watcher_dashboard/content/goals/views.py
1
4470
# Copyright (c) 2016 b<>com # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
apache-2.0
-7,534,486,794,679,372,000
33.651163
76
0.623714
false
4.197183
false
false
false
vortex-ape/scikit-learn
sklearn/kernel_approximation.py
4
23032
""" The :mod:`sklearn.kernel_approximation` module implements several approximate kernel feature maps base on Fourier transforms. """ # Author: Andreas Mueller <amueller@ais.uni-bonn.de> # # License: BSD 3 clause import warnings import numpy as np import scipy.sparse as sp from scipy.linalg import svd from .base im...
bsd-3-clause
5,673,052,215,641,753,000
35.675159
78
0.598862
false
3.947892
false
false
false
CitrineInformatics/python-citrination-client
citrination_client/models/design/constraints/elemental_inclusion.py
1
1357
from citrination_client.models.design.constraints.base import BaseConstraint from citrination_client.base.errors import CitrinationClientError class ElementalInclusionConstraint(BaseConstraint): """ Constraint class which allows the assertion that a set of elements is included in the candidate composition...
apache-2.0
-7,337,785,072,410,175,000
34.736842
145
0.627856
false
4.493377
false
false
false
mozilla/firefox-flicks
vendor-local/lib/python/celery/app/builtins.py
1
12278
# -*- coding: utf-8 -*- """ celery.app.builtins ~~~~~~~~~~~~~~~~~~~ Built-in tasks that are always available in all app instances. E.g. chord, group and xmap. """ from __future__ import absolute_import from __future__ import with_statement from collections import deque from itertools import starmap ...
bsd-3-clause
-1,646,172,077,825,770,000
35.325444
79
0.558153
false
4.28402
false
false
false