repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
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
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
Diviyan-Kalainathan/causal-humans
Clustering/performance_evaluation.py
1
3279
''' Computing the misclassification error distance between to 2 k-means clustering according to Marina Meila, "The Uniqueness of a Good Optimum for K-Means", ICML 2006 Author : Diviyan Kalainathan Date : 20/06/2016 ''' import csv,numpy,itertools from sklearn import metrics def Clustering_performance_evaluation(mode,...
mit
552,402,320,679,528,060
33.526316
107
0.568771
false
willkg/pyrax-cmd
setup.py
1
1027
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys from setuptools import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() readme = open('README.rst').read() history = open('HISTORY.rst').read().replace('.. :changelog:', '') setup( name='pyrax-c...
bsd-3-clause
-4,639,629,143,681,459,000
23.452381
66
0.596884
false
genialis/resolwe
resolwe/flow/executors/docker/run.py
1
19322
""".. Ignore pydocstyle D400. .. autoclass:: resolwe.flow.executors.docker.run.FlowExecutor :members: """ # pylint: disable=logging-format-interpolation import asyncio import copy import functools import json import logging import os import random import string import tempfile import time from contextlib import s...
apache-2.0
6,463,769,656,858,724,000
38.594262
113
0.572663
false
Digital-Preservation-Finland/dpres-ipt
ipt/scripts/check_xml_schematron_features.py
1
1714
#!/usr/bin/python # -*- encoding:utf-8 -*- # vim:ft=python """Validate XML file using Schematron.""" from __future__ import print_function, unicode_literals import os import sys import optparse from file_scraper.schematron.schematron_scraper import SchematronScraper from ipt.utils import concat from ipt.six_utils i...
lgpl-3.0
9,059,798,237,095,664,000
26.206349
75
0.65811
false
makemob/UkiModbusManager
UkiArticulation.py
1
18114
#!/usr/bin/env python # -*- coding: utf_8 -*- """ Uki Articulation Chris Mock, 2017 Uki Articulation UI - Controls UkiModbusManager - Plays CSV scripts/sequences to control speed/accel Licensed under GNU General Public License v3.0, https://www.gnu.org/licenses/gpl-3.0.txt """ import threading import time ...
gpl-3.0
-7,555,098,107,644,283,000
48.766484
135
0.485978
false
steelcowboy/pyCourseManager
friday.py
1
3765
from datetime import datetime, timedelta import course_manager # from login_manager import LoginManager, login_manager, db import coursedb_manager from usage_resource import UsageResource from secret import sqlalchemy_url from login import ( PinResource, SignUpResource, AuthorizeResource, LogoutReso...
apache-2.0
1,852,214,547,275,188,000
26.888889
87
0.694821
false
tago-io/tago-python
tago/account/notifications.py
1
2226
import requests # Used to make HTTP requests import json # Used to parse JSON import os # Used to infer environment variables API_TAGO = os.environ.get('TAGO_API') or 'https://api.tago.io' REALTIME = os.environ.get('TAGO_REALTIME') or 'https://realtime.tago.io' class Notifications: def __init__(self, acc_token)...
mit
1,116,200,540,419,885,400
44.428571
180
0.721923
false
mtnsat/ics-release-dids
porta/account/account.py
1
1435
from ..with_request import WithRequest class Account(WithRequest): def __init__(self, url, session_id): self.base_url = url self.session_id=session_id def account_get_by_id(self, i_account): """Get account by id""" endpoint = "{0}".format('/rest/Account/get_account_info') ...
mit
-4,234,994,092,088,408,000
31.613636
66
0.52892
false
moyaproject/moya
moya/db.py
1
10394
from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import from sqlalchemy import create_engine, MetaData from sqlalchemy.orm import sessionmaker from sqlalchemy.orm import scoped_session from sqlalchemy.exc import ( DatabaseError, IntegrityError, O...
mit
8,660,788,423,971,836,000
29.040462
141
0.566577
false
langurmonkey/gaiasky
assets/scripts/showcases/camera-constant-turn.py
1
2066
# This Gaia Sky script showcases a constant camera turn # Created by Toni Sagrista from py4j.clientserver import ClientServer, JavaParameters, PythonParameters import time class CameraUpdateRunnable(object): def __init__(self, gs, rotation_rate): self.gs = gs self.rotation_rate = rotation_rate ...
mpl-2.0
-5,602,507,680,493,509,000
25.487179
125
0.673282
false
beluganos/beluganos
src/fabricflow/fibc/ofc/ofdpa2.py
1
3614
# -*- coding: utf-8 -*- # Copyright (C) 2017 Nippon Telegraph and Telephone Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
apache-2.0
5,274,588,383,089,223,000
20.771084
69
0.65523
false
pappasam/latexbuild
tests/test_utils.py
1
4066
import unittest import os from latexbuild.utils import ( random_str_uuid, random_name_filepath, list_filepathes_with_predicate, read_file, recursive_apply, ) PATH_FILE = os.path.abspath(__file__) PATH_TEST = os.path.dirname(PATH_FILE) class TestRandomStrUuid(unittest.Te...
mit
9,070,330,015,316,110,000
34.356522
76
0.590999
false
spoqa/dodotable
dodotable/schema.py
1
12038
# -*- coding: utf-8 -*- """:mod:`dodotable.schema` --- table schema ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ from __future__ import absolute_import import collections try: from collections.abc import MutableSequence except ImportError: from collections import MutableSequence import math from sqlalchem...
mit
7,330,063,789,316,485,000
26.038462
77
0.540185
false
ccxt/ccxt
examples/py/bypass-cloudflare.py
1
1389
# -*- coding: utf-8 -*- import cfscrape import os import sys root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(root + '/python') import ccxt # noqa: E402 def print_supported_exchanges(): print('Supported exchanges:') print(', '.join(ccxt.exchanges)) try:...
mit
-4,424,267,704,340,370,000
23.368421
105
0.577394
false
ojengwa/django-multitenants
tenant_schemas/utils.py
1
2758
from contextlib import contextmanager from django.conf import settings from django.db import connection try: from django.apps import apps get_model = apps.get_model except ImportError: from django.db.models.loading import get_model from django.core import mail @contextmanager def schema_context(schema_nam...
mit
-1,970,988,568,842,079,000
24.072727
97
0.660986
false
chukysoria/pyspotify-connect
tests/test_error.py
1
4528
from __future__ import unicode_literals import unittest import spotifyconnect from spotifyconnect import utils class ErrorTest(unittest.TestCase): def test_error_is_an_exception(self): error = spotifyconnect.Error(0) self.assertIsInstance(error, Exception) def test_maybe_raise(self): ...
apache-2.0
884,721,389,033,791,600
38.034483
78
0.703843
false
vfuse/nixstatsagent
nixstatsagent/nixstatsagent.py
2
24810
#!/usr/bin/env python # -*- coding: utf-8; tab-width: 4; indent-tabs: nil; -*- # by Al Nikolov <root@toor.fi.eu.org> from __future__ import print_function import bz2 import sys if sys.version_info >= (3,): try: from past.builtins import basestring except ImportError: basestring = str import ...
bsd-3-clause
4,973,914,409,906,243,000
35.864785
146
0.49742
false
popgengui/negui
agestrucne/pgvalidationdefs.py
1
5774
''' Description ''' from __future__ import print_function __filename__ = "pgvalidationdefs.py" __date__ = "20170326" __author__ = "Ted Cosart<ted.cosart@umontana.edu>" VERBOSE=False VERY_VERBOSE=False def validateNbAdjustment( s_adjustment, i_highest_cycle_number=1e20 ): ''' 2017_03_08. This def is created to handl...
agpl-3.0
3,903,065,343,897,432,600
28.917098
80
0.664011
false
mpaf/pywinauto-64bit
pywinauto/handleprops.py
1
12146
# GUI Application automation and testing library # Copyright (C) 2006 Mark Mc Mahon # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation; either version 2.1 # of the License, or (at your opti...
lgpl-2.1
-6,504,744,661,773,950,000
32.185792
82
0.571464
false
puiterwijk/product-definition-center
pdc/apps/compose/tests.py
1
99430
# -*- coding: utf-8 -*- # # Copyright (c) 2015 Red Hat # Licensed under The MIT License (MIT) # http://opensource.org/licenses/MIT # import json import mock from StringIO import StringIO from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client import Client from rest_framew...
mit
1,441,402,328,042,708,700
49.9375
125
0.578668
false
was4444/chromium.src
third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/flakytests_unittest.py
1
3178
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import flakytests from webkitpy.common.checkout.scm.scm_mock import MockSCM from webkitpy.layout_tests.layout_package import bot_test_expectations from webk...
bsd-3-clause
5,665,240,591,855,856,000
38.234568
113
0.614223
false
openstack/neutron-lib
neutron_lib/agent/extension.py
1
1809
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
1,100,415,168,997,778,700
39.2
79
0.679381
false
Daniel15/PathPicker
src/test.py
1
7076
# Copyright (c) 2015-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. # # @nolint import unitte...
bsd-3-clause
9,048,890,270,372,936,000
27.304
121
0.539994
false
dontnod/weblate
weblate/fonts/validators.py
1
1311
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2019 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # 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, eith...
gpl-3.0
6,577,466,489,244,068,000
33.421053
72
0.720948
false
jmartinm/invenio-records
invenio_records/config.py
1
1717
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any...
gpl-2.0
383,431,581,862,431,300
37.155556
78
0.728596
false
darencard/ContigAnnotator
ensembl_orthologs.py
1
2122
#!/usr/local/env python import optparse usage_line = """ A script to extract orthologous Ensembl IDs from a genome-of-interest using a list \ of Ensembl IDs already in hand. Input is a list of Ensembl IDs and a "database" file \ downloaded from Ensembl that has the query Ensembl IDs in one column and the target/subje...
gpl-2.0
6,088,053,830,567,926,000
43.229167
166
0.669651
false
pyblub/pyload
pyload/api/base.py
1
12584
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from types import MethodType from future import standard_library # from abc import ABCMeta, abstractmethod from future.builtins import object from pyload.core.datatype.base import DownloadState, DownloadStatus, Permission from pyload.c...
agpl-3.0
5,071,868,251,098,711,000
21.838475
79
0.607359
false
martindurant/starclassifier
ui/pysynphot/wavetable.py
1
2684
from __future__ import division """ This module handles the wavecat.dat table presently used by the synphot countrate task (and thus the ETC) to select an appropriate wavelength set for a given obsmode. """ import re import os import numpy as N import locations class Wavetable(object): """ Class to h...
mit
-1,998,349,719,848,117,800
31.974684
102
0.525335
false
CanonicalLtd/landscape-client
landscape/client/broker/tests/test_client.py
1
16179
import mock from twisted.internet import reactor from twisted.internet.defer import Deferred from landscape.lib.twisted_util import gather_results from landscape.client.tests.helpers import ( LandscapeTest, DEFAULT_ACCEPTED_TYPES) from landscape.client.broker.tests.helpers import BrokerClientHelper from lands...
gpl-2.0
7,469,548,300,860,606,000
36.625581
79
0.629829
false
mneagul/scape-cloud-toolkit
src/sct/cloudinit.py
1
9066
# -*- coding: utf-8 -*- """ Copyright 2014 Universitatea de Vest din Timișoara Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by appli...
apache-2.0
1,146,312,053,393,448,100
29.621622
151
0.61827
false
JJMC89/delsort
scripts/upload.py
1
3001
""" Usage: python scripts/upload.py SITE TARGET USERNAME SITE: enwiki or testwiki TARGET: the page on SITE where the script will be uploaded USERNAME: the account to make the edit under """ import datetime import getpass import os.path import re import sys from clint.textui import colored from clint.textui import pro...
mit
-6,782,603,428,927,825,000
31.978022
96
0.658447
false
Yubico/yubioath-desktop-dpkg
yubioath/cli/controller.py
1
3176
# Copyright (c) 2014 Yubico AB # 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 3 of the License, or # (at your option) any later version. # # This program...
gpl-3.0
2,109,234,010,021,809,700
36.809524
76
0.653652
false
bbiiggppiigg/NTHUOJ_web
install.py
1
2886
""" The MIT License (MIT) Copyright (c) 2014 NTHUOJ team 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, merge, ...
mit
-5,840,387,914,222,046,000
30.369565
78
0.711019
false
infobloxopen/infoblox-netmri
infoblox_netmri/api/remote/models/spm_history_interface_history_grid_remote.py
1
3640
from ..remote import RemoteModel class SpmHistoryInterfaceHistoryGridRemote(RemoteModel): """ This table lists the SPM interface history within the user specified period of time for a given interface. | ``id:`` The internal NetMRI identifier of the grid entry. | ``attribute type:`` number | ...
apache-2.0
-8,600,558,602,595,849,000
35.767677
157
0.600275
false
amiv-eth/amivapi
amivapi/tests/groups/test_permissions.py
1
2254
# -*- coding: utf-8 -*- # # license: AGPLv3, see LICENSE for details. In addition we strongly encourage # you to buy us beer if we meet and you like the software. """Tests for custom validation rules for groups. Since this hook will be added for all requests (the after auth hook) and this is tested for auth.p...
agpl-3.0
3,172,133,955,290,614,300
35.354839
78
0.628217
false
c3cashdesk/c6sh
src/postix/backoffice/checks.py
1
2378
from decimal import Decimal from django.utils.translation import ugettext as _ from postix.core.models import ( ListConstraintProduct, Product, WarningConstraintProduct, ) _check_registry = set() def register_check(fn): _check_registry.add(fn) return fn class CheckError(Exception): pass @regist...
agpl-3.0
86,373,377,420,104,510
26.976471
112
0.55635
false
XianliangJ/collections
Jellyfish/ripl/ripl/routing.py
1
14278
#!/usr/bin/env python '''@package routing Routing engine base class. @author Brandon Heller (brandonh@stanford.edu) ''' from copy import copy from random import choice from collections import deque import logging lg = logging.getLogger('ripl.routing') DEBUG = False lg.setLevel(logging.WARNING) if DEBUG: lg.set...
gpl-3.0
-424,992,199,045,397,060
33.909535
91
0.535719
false
darrencheng0817/AlgorithmLearning
Python/leetcode/ImplementStackUsingQueues.py
1
1871
''' Created on 1.12.2016 @author: Darren '''''' from leetcode.BinaryTreeMaximumPathSum import Solution Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. top() -- Get the top element. ...
mit
1,133,080,208,888,505,900
15.431193
192
0.575094
false
tylertian/Openstack
openstack F/glance/glance/store/scrubber.py
1
7036
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 OpenStack, LLC # 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/...
apache-2.0
-6,856,816,283,492,491,000
33.490196
78
0.592951
false
tboyce1/home-assistant
homeassistant/components/light/tplink.py
2
7236
""" Support for TPLink lights. For more details about this component, please refer to the documentation at https://home-assistant.io/components/light.tplink/ """ import logging import colorsys import time import voluptuous as vol from homeassistant.const import (CONF_HOST, CONF_NAME) from homeassistant.components.li...
apache-2.0
1,386,101,221,474,034,700
34.126214
79
0.614704
false
pseudonym117/Riot-Watcher
src/riotwatcher/Handlers/TypeCorrectorHandler.py
1
1562
from . import RequestHandler class TypeCorrectorHandler(RequestHandler): """ The TypeCorrector class is meant to correct any inconsistencies in the types of objects provided as query parameters. Currently this only involves changing boolean values into strings, as the API only accepts lower case ...
mit
8,863,373,832,344,485,000
35.325581
83
0.552497
false
eddiejessup/nex
tests/test_state.py
1
12435
import pytest from nex.constants.instructions import Instructions from nex.constants.commands import Commands from nex.constants.specials import Specials from nex.state import Mode, GlobalState from nex import box from nex.box_writer import write_to_dvi_file from nex.state import ExecuteCommandError from nex.utils imp...
mit
-7,880,691,049,410,203,000
33.256198
86
0.616003
false
ThunderGemios10/The-Super-Duper-Script-Editor-2
editor_form.py
1
98101
# -*- coding: utf-8 -*- ################################################################################ ### Copyright © 2012-2013 BlackDragonHunt ### ### This file is part of the Super Duper Script Editor. ### ### The Super Duper Script Editor is free software: you can redistribute it ### and/or modify it under the ...
gpl-3.0
-1,414,101,607,728,544,800
40.04437
195
0.566815
false
GNOME/meld
meld/accelerators.py
1
2091
from typing import Dict, Sequence, Union from gi.repository import Gtk VIEW_ACCELERATORS: Dict[str, Union[str, Sequence[str]]] = { 'app.quit': '<Primary>Q', 'view.find': '<Primary>F', 'view.find-next': ('<Primary>G', 'F3'), 'view.find-previous': ('<Primary><Shift>G', '<Shift>F3'), 'view.find-repl...
gpl-2.0
2,280,502,922,794,579,500
36.339286
68
0.604495
false
isandlaTech/cohorte-3rdparty
herald/src/main/python/herald/transports/xmpp/directory.py
1
3659
#!/usr/bin/python # -- Content-Encoding: UTF-8 -- """ Herald XMPP transport directory :author: Thomas Calmant :copyright: Copyright 2014, isandlaTech :license: Apache License 2.0 :version: 0.0.1 :status: Alpha .. Copyright 2014 isandlaTech Licensed under the Apache License, Version 2.0 (the "License"); ...
apache-2.0
-196,636,214,492,240,220
26.103704
80
0.586499
false
jantman/tuxtruck
networkmanager/TuxTruck_NetworkManager.py
1
2942
# TuxTruck_NetworkManager.py # # Time-stamp: "2009-08-26 08:59:30 jantman" # # +----------------------------------------------------------------------+ # | TuxTruck Project http://tuxtruck.jasonantman.com | # +----------------------------------------------------------------------+ # | Copyright (c) ...
gpl-3.0
4,532,818,929,343,650,300
45.698413
106
0.395309
false
dpshelio/sunpy
sunpy/net/helioviewer.py
1
18644
""" This module provides a wrapper around the Helioviewer API. """ import json import codecs import urllib from pathlib import Path from collections import OrderedDict import parfive from astropy.utils.decorators import lazyproperty import sunpy from sunpy.time import parse_time from sunpy.util.xml import xml_to_dic...
bsd-2-clause
-8,021,347,846,941,426,000
39.530435
130
0.57729
false
ls-cwi/heinz
script/makeHeinzRpcstMcDimacs.py
1
1116
#!/usr/bin/python import sys if len(sys.argv) != 5: sys.stderr.write("Usage: " + sys.argv[0] + " <instances> <full_output_dir> <timelimit_pbs> <timelimit_heinz>\n") sys.exit(1) lines = open(sys.argv[1]).readlines() n = len(lines) bins = n / 15 if n % 15 != 0: bins += 1 full_output_dir = sys.argv[2] timelim...
mit
-4,746,288,819,771,932,000
30
201
0.525986
false
googleads/dfp-playground
dfp_playground.py
1
1688
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
2,642,138,051,772,439,600
33.44898
78
0.742299
false
0ED/Toy
auto_sender/gmail.py
1
1234
#!/usr/bin/ python # -*- coding: utf-8 -*- import sys import smtplib from email import Encoders from email.MIMEText import MIMEText from email.MIMEBase import MIMEBase from email.MIMEMultipart import MIMEMultipart from email.Header import Header from email.Utils import formatdate class Gmail(object): def create_mess...
mit
1,113,345,427,749,023,500
31.473684
88
0.718801
false
kawu/tagger
utils/tei2linc/tei2linc.py
1
7737
import sys import os import shutil import argparse import tarfile import re from collections import defaultdict class Lexem: def __init__(self, ctag=None, base=None, msds=None): self.ctag = ctag self.base = base self.msds = msds if msds is not None else set() def add(self, msd): ...
bsd-3-clause
2,646,679,915,105,169,000
30.579592
78
0.516996
false
erikulven/flapmagick
camera.py
1
1925
""" Uses camera and takes images for documentation of motion """ import time from PIL import Image import urllib import StringIO import settings user = settings.cam_user pwd = settings.cam_pwd cam_url = settings.cam_url def fetch_snapshot_image(): im = StringIO.StringIO(urllib.urlopen(settings.cam_url).read()) ...
bsd-2-clause
-8,973,370,309,740,577,000
29.078125
74
0.604156
false
patrickm/chromium.src
tools/perf/measurements/thread_times.py
1
2083
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from measurements import timeline_controller from metrics import timeline from telemetry.page import page_measurement class ThreadTimes(page_measurement.Page...
bsd-3-clause
-1,464,746,998,573,629,700
38.301887
72
0.722516
false
MTG/dunya
jingju/models.py
1
5375
from django.db import models import data.models from jingju import managers class JingjuStyle(object): def get_style(self): return "jingju" def get_object_map(self, key): return { "performance": RecordingInstrumentalist, "release": Release, "artist": Artis...
agpl-3.0
-2,666,498,335,469,265,000
34.361842
120
0.685209
false
edsu/lochief
kochief/discovery/management/commands/index.py
1
4772
#! /usr/bin/python # -*- coding: utf8 -*- # Copyright 2009 Gabriel Sean Farrell # Copyright 2008 Mark A. Matienzo # # This file is part of Kochief. # # Kochief is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation,...
gpl-3.0
-521,989,871,261,624,260
35.427481
91
0.586756
false
xtiankisutsa/MARA_Framework
tools/qark/qark/modules/createSploit.py
1
2666
from __future__ import absolute_import '''Copyright 2015 LinkedIn Corp. 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...
lgpl-3.0
3,166,646,589,954,059,300
34.078947
179
0.668792
false
Alecardv/College-projects
Metodos Numericos 2012/trapecio.py
1
1308
import function from matplotlib.pyplot import * from pylab import * import numpy as np import math class Trapecio: def __init__(self, fun, xi, xf): self.fun = function.Function(fun,'x') self.a,self.b = xi,xf self.fig, self.ax = subplots() def relativeError(self): f = self.fun.getDerivate() Ea = ((self.b-...
gpl-3.0
1,179,837,174,657,071,400
28.727273
129
0.65367
false
CurrencyCloud/currencycloud-python
src/currencycloud/clients/reference.py
1
2780
'''This module provides a class for Reference calls to the CC API''' from currencycloud.http import Http from currencycloud.resources import BeneficiaryRequiredDetails, ConversionDates, Currency, SettlementAccount, PayerRequiredDetails, PaymentPurposeCode, BankDetails, PaymentFeeRule class Reference(Http): '''Th...
mit
8,175,697,936,148,620,000
50.5
179
0.690647
false
flake123p/ProjectH
Cpp_Platform2X/_toolchain/list_to_build_script.py
1
3345
#!/usr/bin/python # Usage: list_to_make_var.py <in-file1:mod list> <in-file2:OFS> <out-file1:build script> <out-file2:clean script> <OS> # argv: argv[0] argv[1] argv[2] argv[3] argv[4] argv[5] # # Include library # import os import sys def O...
gpl-3.0
1,168,732,192,291,529,700
26.875
126
0.611061
false
priestc/moneywagon
moneywagon/tx.py
1
10878
from moneywagon import ( get_unspent_outputs, CurrentPrice, get_optimal_fee, PushTx, get_onchain_exchange_rates ) from moneywagon.core import get_optimal_services, get_magic_bytes from bitcoin import mktx, sign, pubtoaddr, privtopub from .crypto_data import crypto_data from .currency_support import CurrencySupp...
mit
7,023,996,752,570,535,000
37.168421
124
0.581633
false
Teamxrtc/webrtc-streaming-node
third_party/webrtc/src/chromium/src/tools/checkperms/checkperms.py
1
13388
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Makes sure files have the right permissions. Some developers have broken SCM configurations that flip the executable permission...
mit
8,642,970,473,588,044,000
27.12605
80
0.664924
false
bdfoster/blumate
blumate/components/mongo.py
1
5577
""" A component which allows you to send data to an Influx database. For more details about this component, please refer to the documentation at https://home-assistant.io/components/influxdb/ """ import logging from blumate.helpers.entity import Entity import blumate.util as util from blumate import bootstrap from bl...
mit
-8,416,987,383,555,925,000
38.553191
122
0.564461
false
kapilgarg1996/gmc
gmc/conf/__init__.py
1
1489
import os import importlib from gmc.conf import global_settings ENVIRONMENT_VARIABLE = "GMC_SETTINGS_MODULE" class Settings: """ Module to load settings to configure gmc """ def __init__(self, *args, **kwargs): self.settings = None self.settings_module = None def __getattr__(self, ...
mit
8,042,181,820,768,355,000
29.408163
81
0.601746
false
doirisks/dori
models/10.1016:j.jacc.2013.11.013/config_gener_a.py
1
7083
# -*- coding: utf-8 -*- # a template for making config.json files for functions #import pprint #pp = pprint.PrettyPrinter(indent=4) config = {} # human and machine readable names for the model config['id'] = {} config['id']['DOI'] = '10.1016/j.jacc.2013.11.013' config['id']['papertitle'] = 'Factors Associated With M...
gpl-3.0
7,234,410,869,433,950,000
44.403846
855
0.659184
false
MSEMJEJME/Get-Dumped
renpy/defaultstore.py
1
10575
# 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
1,057,408,744,182,847,100
28.788732
109
0.692766
false
ihrwein/yarg
yarg/gui/listmodel.py
1
8053
from PyQt5 import QtCore class QObjectListModel(QtCore.QAbstractListModel): """ QObjectListModel provides a more powerful, but still easy to use, alternative to using QObjectList lists as models for QML views. As a QAbstractListModel, it has the ability to automatically notify the view of specific cha...
gpl-2.0
-3,779,364,264,348,425,700
36.635514
107
0.609711
false
jmartty/taller2server
tests/rest/Test_rest.py
1
25876
# -*- coding: utf-8 -*- import requests import unittest import json class TestRestApi(unittest.TestCase): def __init__(self, *args, **kwargs): super(TestRestApi, self).__init__(*args, **kwargs) self.__api_base_url = "http://localhost:5000" self.__user_url = "/usuario/" self.__ruser = "?r_user=" self.__toke...
gpl-2.0
-8,995,136,570,888,199,000
50.178218
238
0.618534
false
purism/pdak
dak/dakdb/update70.py
1
3429
#!/usr/bin/env python # coding=utf8 """ Add suite options for overrides and control-suite to DB @contact: Debian FTP Master <ftpmaster@debian.org> @copyright: 2011 Mark Hymers <mhy@debian.org> @license: GNU General Public License version 2 or later """ # This program is free software; you can redistribute it and/or ...
gpl-2.0
-1,284,880,315,698,919,400
47.295775
149
0.654418
false
emc-openstack/storops
storops/unity/resource/quota_config.py
1
3711
# coding=utf-8 # Copyright (c) 2015 EMC Corporation. # 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 # #...
apache-2.0
8,178,510,219,616,063,000
36.484848
78
0.656427
false
spyder-ide/spyder.line_profiler
spyder_line_profiler/widgets/lineprofiler.py
1
22093
# -*- coding: utf-8 -*- # # Copyright © 2011 Spyder Project Contributors # Licensed under the terms of the MIT License # (see LICENSE.txt for details) """ Line Profiler widget See the official documentation of line_profiler: http://pythonhosted.org/line_profiler/ """ # Standard library imports from __future__ import ...
mit
1,243,849,583,142,293,200
36.317568
92
0.567988
false
ryfeus/lambda-packs
Spacy/source2.7/spacy/tokens/printers.py
1
2687
# coding: utf8 from __future__ import unicode_literals from .doc import Doc from ..symbols import HEAD, TAG, DEP, ENT_IOB, ENT_TYPE def merge_ents(doc): """Helper: merge adjacent entities into single tokens; modifies the doc.""" for ent in doc.ents: ent.merge(ent.root.tag_, ent.text, ent.label_) ...
mit
3,038,236,058,106,726,400
35.310811
79
0.54224
false
pombredanne/django-url-filter
url_filter/backends/sqlalchemy.py
1
4251
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import itertools from sqlalchemy import func from sqlalchemy.orm import class_mapper from sqlalchemy.sql.expression import not_ from .base import BaseFilterBackend def lower(value): try: return value.lower()...
mit
-6,336,739,438,157,124,000
26.784314
72
0.597271
false
kreeger/etcetera
urls.py
1
1576
from django.conf.urls.defaults import * from django.contrib.auth.views import login, logout from django.contrib import admin from etcetera.settings import SITE_ROOT, DEBUG admin.autodiscover() # For master/general use. urlpatterns = patterns('', url(r'^admin/doc/', include('django.contrib.admindocs.urls')), ...
bsd-3-clause
-469,688,098,523,634,000
28.203704
111
0.673223
false
kaplun/ops
modules/bibupload/lib/bibupload.py
1
146505
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version ...
gpl-2.0
-7,043,113,552,886,814,000
48.031124
287
0.559182
false
javrasya/watchdog
run_tests.py
1
1034
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import unittest current_path = os.path.abspath(os.path.dirname(__file__)) tests_path = os.path.join(current_path, 'tests') sys.path[0:0] = [ current_path, tests_path, ] all_tests = [f[:-3] for f in os.listdir(tests_path) if f.start...
apache-2.0
3,825,927,468,567,544,000
23.046512
60
0.637331
false
gfarnadi/FairPSL
problems/performance_review/evaluation.py
1
4029
def calculate(counts,result): n1 = 0.0 n2 = 0.0 a = 0.0 c = 0.0 for f1,f2,d in counts: f1f2 = max(f1+f2-1,0) nf1f2 = max(-f1+f2,0) n1 += f1f2 n2 += nf1f2 if d[0]: a+= max(f1f2 - d[1],0) c+= max(nf1f2 - d[1],0) else: ...
mit
5,984,133,284,167,620,000
26.979167
79
0.439563
false
DXCanas/kolibri
kolibri/core/auth/migrations/0001_initial.py
1
8724
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2017-05-14 05:22 from __future__ import unicode_literals import uuid import django.core.validators import django.db.models.deletion import django.utils.timezone import morango.utils.uuids import mptt.fields from django.db import migrations from django.db import m...
mit
-3,918,830,347,761,980,400
50.621302
296
0.588835
false
sashs/Ropper
ropper/common/enum.py
1
7565
# coding=utf-8 # Copyright 2018 Sascha Schirra # # 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 di...
bsd-3-clause
6,618,701,261,692,716,000
29.504032
97
0.594316
false
mucximilian/gimpmaps
gimprenderer/draw_circle.py
1
1230
#!/usr/bin/env python # Draws a 150 px radius circle centered in an 800x600 px image # Adapted from a scheme script-fu contributed by Simon Budig from gimpfu import * def draw_circle(): width = 600 height = 600 image = pdb.gimp_image_new(width, height, RGB) layer = gimp.Layer(image, "layer", image.width, ...
gpl-2.0
1,101,271,776,541,197,400
20.982143
76
0.647967
false
beagles/neutron_hacking
neutron/services/vpn/service_drivers/__init__.py
1
3163
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013, Nachi Ueno, NTT I3, Inc. # 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-2.0
5,851,842,106,440,160,000
33.010753
78
0.631995
false
sierisimo/PySongGen
PySongGen.py
1
2115
#! /usr/bin/env python3 # Name: PySongGen # # Version: 0.0.1 # # Author: Sinuhe Jaime Valencia # # Author_email: sierisimo@gmail.com # # Description: # Main code for running instances of pysonggen from pysonggen import grammar from pysonggen.songgen import SongG gram = grammar.Grammar('./examples/example.mgram')...
gpl-2.0
5,985,681,783,417,540,000
20.804124
110
0.629787
false
rknightly/crawler-collage
collage_maker/collage_maker.py
1
6709
#!/usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------- # Author: delimitry # slightly edited by Ryan Knightly # ----------------------------------------------------------------------- import os import random from PIL import Image from optparse import O...
mit
-2,331,259,332,186,945,000
29.917051
79
0.538828
false
Elastica/kombu
kombu/transport/librabbitmq.py
1
5547
""" kombu.transport.librabbitmq =========================== `librabbitmq`_ transport. .. _`librabbitmq`: http://pypi.python.org/librabbitmq/ """ from __future__ import absolute_import, unicode_literals import os import socket import warnings import librabbitmq as amqp from librabbitmq import ChannelError, Connecti...
bsd-3-clause
-3,182,920,128,225,371,600
29.988827
75
0.600505
false
rainer85ah/VisionViewer
src/Builders/Histogram/HistogramBuilder.py
1
19510
# -*- coding: utf-8 -*- __author__ = 'Rainer Arencibia' import PyQt4 import numpy as np import cv2 from PyQt4.QtCore import QString from PyQt4.QtGui import QColor, QPen, QBrush from Histograms import Ui_Histograms """ The MIT License (MIT) Copyright (c) 2016 Rainer Arencibia Permission is hereby granted, free of c...
mit
8,540,447,499,718,498,000
42.535714
120
0.58632
false
takmid/inasafe
safe/impact_functions/volcanic/volcano_population_evacuation_polygon_hazard.py
1
7246
import numpy from safe.impact_functions.core import FunctionProvider from safe.impact_functions.core import get_hazard_layer, get_exposure_layer from safe.impact_functions.core import get_question from safe.storage.vector import Vector from safe.common.utilities import ugettext as _ from safe.common.tables import Table...
gpl-3.0
2,129,394,776,019,534,600
37.956989
77
0.532846
false
sixpearls/django-mediacracy
mediacracy/widgets.py
1
1103
#!/usr/bin/env python # -*- coding: utf-8 -*- from django import forms from django.core import urlresolvers from django.utils.safestring import mark_safe from django.template.loader import render_to_string from markitup.widgets import AdminMarkItUpWidget, MarkItUpWidget from django.conf import settings as site_setting...
bsd-2-clause
3,709,738,566,038,608,400
34.580645
110
0.672711
false
openstack/congress
congress/tests/datalog/test_builtin.py
1
56296
#! /usr/bin/python # # Copyright (c) 2014 IBM, Inc. 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 # # ...
apache-2.0
4,118,628,128,478,063,000
34.406289
78
0.460956
false
dmsovetov/dreemchest
Source/CLI/command_line/env.py
1
5399
################################################################################# # # The MIT License (MIT) # # Copyright (c) 2015 Dmitry Sovetov # # https://github.com/dmsovetov # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "...
mit
-1,461,173,353,538,070,500
33.394904
119
0.667346
false
cheral/orange3-text
orangecontrib/text/tests/test_pubmed.py
1
11899
import json import os import unittest from unittest.mock import patch import numpy as np from orangecontrib.text.pubmed import ( Pubmed, PUBMED_TEXT_FIELDS, _mesh_headings_to_class, _date_to_iso, _corpus_from_records, _records_to_corpus_entries ) class MockEntrezHandle: @staticmethod def clo...
bsd-2-clause
1,158,506,479,719,767,000
28.896985
77
0.5445
false
zhangxiaolins/python_base
essential/report/generators/conf.py
2
1404
# Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
apache-2.0
4,018,211,868,987,261,400
31.651163
78
0.722222
false
wordpress-mobile/WordPress-iOS
Scripts/localize.py
1
5499
#!/usr/bin/env python # -*- coding: utf-8 -*- # This program is free software. It comes without any warranty, to # the extent permitted by applicable law. You can redistribute it # and/or modify it under the terms of the Do What The Fuck You Want # To Public License, Version 2, as published by Sam Hocevar. See # http:...
gpl-2.0
3,877,940,906,966,676,000
33.791139
318
0.599418
false
cts-admin/cts
cts/members/management/commands/send_renewal_emails.py
1
1296
import datetime from django.conf import settings from django.core.management.base import BaseCommand from django.template.loader import render_to_string from ...models import CorporateMember from home.tasks import mail_task class Command(BaseCommand): def handle(self, *args, **options): thirty_days_fro...
gpl-3.0
1,292,665,148,696,779,800
40.806452
105
0.56713
false
kmike/django-admin-user-stats
admin_user_stats/base_modules.py
1
2779
# -*- coding: utf-8 -*- from datetime import timedelta from django.db.models import Count from django.utils.translation import ugettext_lazy as _ try: from django.utils.timezone import now except ImportError: from datetime import datetime now = datetime.now from qsstats import QuerySetStats from admin_tool...
mit
5,017,720,829,543,766,000
32.481928
160
0.617488
false
eirannejad/pyRevit
pyrevitlib/rpw/__revit.py
1
5945
""" The main rpw namespace and rpw.revit provide you with most of the imports will need. >>> from rpw import revit, db, ui >>> db.Element(SomeElement) >>> ui.Selection() >>> revit.doc >>> revit.uidoc.ActiveView Revit Namespaces are also available: >>> from rpw import DB, UI >>> DB.ElementId(00000) >>> UI.TaskDialog...
gpl-3.0
7,026,033,917,477,913,000
28.142157
90
0.601346
false
LAST-EBD/Consultas
RandomlyMovePolygons.py
1
5556
import fiona, shapely, logging, sys, os, random from shapely import affinity, speedups from shapely.geometry import mapping, shape, Polygon speedups.enable() logging.basicConfig(stream=sys.stderr, level=logging.INFO) class randomly_move(): '''Con esta clase se pretende el mover aleatoriamente una serie de ...
mit
1,503,735,368,378,538,500
37.324138
125
0.474622
false
wadester/wh_test_py
gdbm_test.py
1
1061
#!/usr/bin/env python # Module: gdbm_test.py # Purpose: gdbm test # Date: N/A # Notes: # 1) Reference: # https://docs.python.org/2/library/gdbm.html # import gdbm import random as r mydb="testdb.gdbm" rcnt=10 print "creating test db",mydb, "with ", rcnt, "records" db=gdbm.open(mydb, 'c') for x in range(0,...
gpl-2.0
1,135,733,845,140,344,400
15.578125
55
0.618285
false
DarthMaulware/EquationGroupLeaks
Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/py_compile.py
1
6128
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: py_compile.py """Routine to "compile" a .py file to a .pyc (or .pyo) file. This module has intimate knowledge of the format of .pyc files. """ impor...
unlicense
8,292,061,942,146,150,000
33.627119
84
0.598074
false
loveisbug/liveshow-sh
roll.py
1
1679
# -*- coding: utf-8 -*- import urllib from urllib.request import urlopen import html.parser as h from bs4 import BeautifulSoup import sys import time import io import re reg =re.compile(r'\d+') list = ['0', '10', '20'] for s in list: url = ('https://site.douban.com/maosh/widget/events/1441569/?start='+s) url...
mit
-884,590,390,812,692,500
41.947368
124
0.599632
false
dssg/wikienergy
disaggregator/build/pandas/pandas/tests/test_frame.py
1
552242
# -*- coding: utf-8 -*- from __future__ import print_function # pylint: disable-msg=W0612,E1101 from copy import deepcopy from datetime import datetime, timedelta, time import sys import operator import re import csv import nose import functools import itertools from itertools import product from distutils.version imp...
mit
-8,488,055,087,396,399,000
36.431438
155
0.523572
false
DIRACGrid/DIRAC
src/DIRAC/Core/Tornado/scripts/tornado_start_all.py
1
2483
#!/usr/bin/env python ######################################################################## # File : tornado-start-all # Author : Louis MARTIN ######################################################################## # Just run this script to start Tornado and all services # Use CS to change port from __future__ i...
gpl-3.0
-5,539,749,864,250,538,000
36.059701
108
0.699557
false