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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
firemark/yellowjuice | agendas/fields.py | 1 | 2677 | from django_fsm.db.fields import FSMField
from django_fsm.db.fields.fsmfield import FSMFieldDescriptor
class ManyTransitions(AttributeError):
"""Raised when AutoFSMField has too many transitions to choose from"""
class NoTransitions(AttributeError):
"""Raised when AutoFSMField can't find any matching transi... | mit | 7,141,344,924,485,705,000 | 37.797101 | 76 | 0.599552 | false | 4.424793 | false | false | false |
miRTop/mirtop | mirtop/mirna/realign.py | 1 | 16215 | import re
from Bio import pairwise2
from Bio.Seq import Seq
from collections import defaultdict
from mirtop.mirna.mintplates import convert
import mirtop.libs.logger as mylog
logger = mylog.getLogger(__name__)
class hits:
""""Class with alignment information."""
def __init__(self):
self.sequence = ... | mit | 9,130,203,486,596,986,000 | 27.102253 | 103 | 0.528215 | false | 3.349515 | false | false | false |
sjsafranek/facebook-automation | tasks/chatbot.py | 1 | 2537 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import time
import random
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from selenium.common.exceptions import NoSuchEle... | mit | -1,548,958,517,483,133,000 | 38.640625 | 90 | 0.677572 | false | 3.61396 | false | false | false |
lsk112233/Clone-test-repo | pydotorg/tests/test_context_processors.py | 1 | 1060 | from pydotorg import context_processors
from django.test import TestCase
class MockRequest(object):
def __init__(self, path):
self.path = path
super().__init__()
class TemplateProcessorsTestCase(TestCase):
def test_url_name(self):
mock_request = MockRequest(path='/inner/')
se... | apache-2.0 | -5,823,509,013,598,643,000 | 39.769231 | 132 | 0.671698 | false | 3.785714 | false | false | false |
ddico/odoo | addons/fleet_account/models/fleet_vehicle.py | 1 | 1028 | # -*- coding:utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, _
from odoo.exceptions import AccessError
class FleetVehicle(models.Model):
_inherit = 'fleet.vehicle'
analytic_account_id = fields.Many2one('account.analytic.account', string='... | agpl-3.0 | 8,035,818,478,859,247,000 | 45.727273 | 129 | 0.668288 | false | 3.953846 | false | false | false |
crypotex/online-collab-tool-ds | client/texteditor.py | 1 | 4402 | # Code for line numbers
# https://stackoverflow.com/questions/40386194/create-text-area-textedit-with-line-number-in-pyqt-5
from PyQt4.Qt import Qt
from PyQt4.QtCore import QRect
from PyQt4.QtCore import QSize
from PyQt4.QtCore import SIGNAL
from PyQt4.QtGui import QColor
from PyQt4.QtGui import QPainter
from PyQt4.Qt... | gpl-3.0 | -947,174,211,032,361,600 | 35.380165 | 103 | 0.62199 | false | 3.801382 | false | false | false |
drxos/kuiqblog | weblog/feeds.py | 1 | 1906 | # -*- coding: utf-8 -*-
#=============================================================================
#
# File : feeds.py
# Author : Hodonou SOUNTON
# Team : drxos, kiah, fall, geolov, sadj
# Site : http://reysh.com ... | bsd-3-clause | -7,900,081,311,667,535,000 | 24.756757 | 90 | 0.321785 | false | 5.755287 | false | false | false |
brbsix/craigslist-rental-market | craigslist.py | 1 | 8933 | # -*- coding: utf-8 -*-
"""Display Craigslist rental market statistics"""
# standard imports
import argparse
import os
import re
import statistics
import sys
import time
from concurrent.futures import ThreadPoolExecutor
from datetime import timedelta
from textwrap import dedent
# external imports
import appdirs
impo... | gpl-3.0 | 4,327,947,110,201,205,000 | 28.003247 | 79 | 0.552446 | false | 4.193897 | false | false | false |
sapariduo/paques-python-client | pypaques/client.py | 1 | 13150 | import requests
import ujson
import sseclient
import pprint
import pandas as pd
from pypaques import constants
from pypaques import exceptions
import pypaques.logging
MAX_ATTEMPTS = constants.DEFAULT_MAX_ATTEMPTS
logger = pypaques.logging.get_logger(__name__)
class ClientSession(object):
def __in... | mit | -8,122,178,452,876,287,000 | 28.728972 | 158 | 0.528593 | false | 4.354305 | false | false | false |
epeios-q37/epeios | tools/xdhq/examples/PYH/Stars/main.py | 1 | 4624 | """
MIT License
Copyright (c) 2018 Claude SIMON (https://q37.info/s/rmnmqd49)
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, ... | agpl-3.0 | 8,758,412,643,059,817,000 | 22.835052 | 78 | 0.657656 | false | 3.044108 | false | false | false |
twosigma/beaker-notebook | beakerx/beakerx/plot/plotitem_treemap.py | 1 | 4997 | # Copyright 2017 TWO SIGMA OPEN SOURCE, 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 agree... | apache-2.0 | -420,852,213,869,561,540 | 29.47561 | 95 | 0.581149 | false | 4.065907 | false | false | false |
mvpossum/deep-learning | tp3/red_poco_densa.py | 1 | 1800 | import base
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Convolution2D, MaxPooling2D
# number of convolutional filters to use
nb_filters = 32
# size of pooling area for max pooling
pool_size = (2, 2)
# convolution kernel size
kernel_size = (3... | mit | -8,275,960,840,934,833,000 | 38.130435 | 102 | 0.653333 | false | 3.345725 | true | false | false |
mach327/chirp_fork | chirp/drivers/uv5x3.py | 1 | 41092 | # Copyright 2016:
# * Jim Unroe KC9HI, <rock.unroe@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 2 of the License, or
# (at your option) any later version.
#
# This... | gpl-3.0 | 767,524,949,048,044,800 | 33.186356 | 79 | 0.51117 | false | 3.605194 | false | false | false |
jorgeacf/dockerfiles | infrastructure/docker-discovery/scripts/docker-events-consul.py | 1 | 5109 | #!/usr/bin/env python
import docker
import json
import consul
import logging
import requests
logging.basicConfig(filename='/var/log/docker-events/docker-events-consul.log',
level=logging.INFO,
format=' [%(levelname)s] %(asctime)s (%(threadName)-10s) %(message)s')
# Configuration
consul_host... | gpl-3.0 | -1,099,538,414,397,790,100 | 28.028409 | 126 | 0.677628 | false | 3.203135 | false | false | false |
laurent-george/weboob | modules/feedly/pages.py | 1 | 3421 | # -*- coding: utf-8 -*-
# Copyright(C) 2014 Bezleputh
#
# This file is part of weboob.
#
# weboob 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, either version 3 of the License, or
# (at your opt... | agpl-3.0 | 3,204,423,926,380,267,000 | 36.184783 | 114 | 0.618825 | false | 4.101918 | false | false | false |
xahgmah/edx-proctoring | edx_proctoring/urls.py | 1 | 3405 | """
URL mappings for edX Proctoring Server.
"""
from edx_proctoring import views, callbacks
from django.conf import settings
from django.conf.urls import patterns, url, include
urlpatterns = patterns( # pylint: disable=invalid-name
'',
url(
r'edx_proctoring/v1/proctored_exam/exam$',
views.Pro... | agpl-3.0 | -6,081,810,677,813,164,000 | 37.258427 | 107 | 0.655507 | false | 3.129596 | false | false | false |
malerv/gardakan | linkUs/chatUs/Util_DB.py | 1 | 4474 | '''
Created on Mar 22, 2014
@author: Vincent
'''
import json
import math
from pprint import pprint
from chatUs.models import Event, City
from utils.geo import getLatFromStrPoint, getLonFromStrPoint, getDistanceBetween, getLatLonFromAddr
#from utils import geo
from operator import itemgetter
def AddEvents(events... | apache-2.0 | 3,024,666,193,990,116,400 | 25.163743 | 101 | 0.505811 | false | 3.994643 | false | false | false |
mganeva/mantid | Framework/PythonInterface/plugins/algorithms/VelocityCrossCorrelations.py | 1 | 13182 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
# pylint: disable=too-many-branches,too-many-... | gpl-3.0 | 4,460,710,676,816,140,300 | 38.467066 | 128 | 0.555682 | false | 3.769517 | true | false | false |
hackersql/sq1map | LFI-Tools/fimap/src/xgoogle/browser.py | 1 | 4440 | #!/usr/bin/python
#
# Peteris Krumins (peter@catonmat.net)
# http://www.catonmat.net -- good coders code, great reuse
#
# http://www.catonmat.net/blog/python-library-for-google-search/
#
# Code is licensed under MIT license.
#
import random
import socket
import urllib
import urllib2
import httplib
BROWSERS = (
... | gpl-3.0 | -6,238,051,982,505,985,000 | 42.106796 | 143 | 0.598423 | false | 2.965932 | false | false | false |
pjh/vm-analyze | util/sum_mapsfile_vm.py | 1 | 3783 | #! /usr/bin/env python3.3
# Virtual memory analysis scripts.
# Developed 2012-2014 by Peter Hornyack, pjh@cs.washington.edu
# Copyright (c) 2012-2014 Peter Hornyack and University of Washington
from analyze.argparsers import sum_vm_parser
from util.pjh_utils import *
from trace.vm_common import *
from trace.vm_regex i... | bsd-3-clause | 6,533,837,879,533,139,000 | 23.25 | 78 | 0.62305 | false | 2.896631 | false | false | false |
wellcometrust/platform-api | scripts/fix_rfc_headers.py | 1 | 1387 | #!/usr/bin/env python
# -*- encoding: utf-8
import datetime as dt
import os
from travistooling import git, ROOT
def get_rfc_readmes(repo):
rfcs_dir = os.path.join(repo, "docs", "rfcs")
for root, _, filenames in os.walk(rfcs_dir):
for f in filenames:
if f == "README.md":
y... | mit | 6,156,556,586,004,763,000 | 32.02381 | 87 | 0.554434 | false | 3.484925 | false | false | false |
CENDARI/editorsnotes | editorsnotes/main/migrations/0084_auto__add_notereferencens__add_citationns__add_textns__del_field_notes.py | 1 | 24744 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'NoteReferenceNS'
db.create_table(u'main_notereferencens', (
(u'notesection_ptr',... | agpl-3.0 | 5,658,008,061,293,859,000 | 76.570533 | 187 | 0.564824 | false | 3.646331 | false | false | false |
hamishmb/wxfixboot | Tests/GetDevInfo/GetDevInfoTestFunctions.py | 1 | 2019 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# GetDevInfo test data for WxFixBoot Version 2.0.3
# This file is part of WxFixBoot.
# Copyright (C) 2013-2018 Hamish McIntyre-Bhatty
# WxFixBoot is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3 or,
# ... | gpl-3.0 | -4,676,029,883,413,151,000 | 37.09434 | 154 | 0.692917 | false | 3.795113 | false | false | false |
loanzen/quickbooks-py | quickbook3/auth.py | 1 | 5538 | # -*- coding: utf-8 -*-
"""
quickbook3.auth
~~~~~~~~~~~~~
This module contains a quickbook authentication service that implements the
OAuth 1.0/a auth flow using rauth.OAuth1Service
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ impor... | isc | 1,212,802,782,150,883,600 | 36.167785 | 82 | 0.620982 | false | 4.705183 | false | false | false |
nwlunatic/appium-autoregister | autoregister.py | 1 | 4393 | # coding: utf-8
import argparse
import logging
import tempfile
import signal
import time
from string import Template
from android import android_devices
from utils import get_free_port
from appium import AppiumNode
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger("autoregister")
class StopAutoregi... | mit | -3,429,279,307,745,229,000 | 32.792308 | 98 | 0.57751 | false | 4.187798 | true | false | false |
googleapis/googleapis-gen | google/cloud/datacatalog/v1/datacatalog-v1-py/google/cloud/datacatalog_v1/services/data_catalog/pagers.py | 1 | 20723 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 | -6,673,689,353,818,422,000 | 39.793307 | 95 | 0.644308 | false | 4.571586 | false | false | false |
musicbrainz/picard | picard/formats/ac3.py | 1 | 2099 | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2019-2020 Philipp Wolfer
#
# 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 ... | gpl-2.0 | 4,782,624,851,934,831,000 | 31.292308 | 80 | 0.653645 | false | 3.761649 | true | false | false |
ianmiell/gogs_shutit | docker_gogs.py | 1 | 2771 |
# Created from dockerfile: https://github.com/gogits/gogs/raw/master/docker/blocks/docker_gogs/Dockerfile
# Maintainer:
from shutit_module import ShutItModule
class docker_gogs(ShutItModule):
def is_installed(self, shutit):
return False
def build(self, shutit):
shutit.install('build-essential ca... | mit | 3,871,880,662,713,908,700 | 33.209877 | 182 | 0.693973 | false | 2.476318 | false | false | false |
GliderGeek/PySoar | show_downloads.py | 1 | 2707 | import requests
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
api_url = 'https://api.github.com/repos/GliderGeek/PySoar/releases'
pysoar_releases = [] # List[{'name': <release_tag_name>, 'windows': 0, 'mac': 0, 'linux': 0}]
for release in requests.get(api_url).json():
pysoar_release = {'... | gpl-3.0 | -4,694,414,182,856,509,000 | 33.265823 | 97 | 0.634651 | false | 3.618984 | false | false | false |
bospetersen/h2o-3 | h2o-py/tests/testdir_algos/gbm/pyunit_offset_bernoulli_carsGBM.py | 1 | 1877 | import sys
sys.path.insert(1, "../../../")
import h2o, tests
def offset_bernoulli_cars(ip,port):
# Connect to a pre-existing cluster
cars = h2o.upload_file(h2o.locate("smalldata/junit/cars_20mpg.csv"))
cars = cars[cars["economy_20mpg"].isna() == 0]
cars["economy_20mpg"] = cars["economy_20mpg"].as... | apache-2.0 | -821,851,989,483,718,100 | 49.72973 | 121 | 0.615876 | false | 2.801493 | false | false | false |
tensorflow/tfx | tfx/orchestration/portable/cache_utils_test.py | 1 | 11730 | # Copyright 2020 Google 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 | -1,340,563,954,559,667,500 | 44.289575 | 79 | 0.675959 | false | 3.881535 | true | false | false |
OSU-CS-325/Project_One_MSS | divide-and-conquer/alg3.py | 1 | 2645 | #!/usr/bin/python3
#--------------------------------------------------------------------
# Function: enumer_d_and_c
# Description: Computes the maximum sub-array and the associated sum using a div# ide and conquer algorithm
# Receives: values - list of integers
# Returns: maximum sub-array sum, and maximum sub-arra... | mit | 5,739,618,053,313,904,000 | 33.350649 | 110 | 0.634405 | false | 3.995468 | false | false | false |
mozilla/captain | captain/projects/migrations/0005_auto__add_scheduledcommand__chg_field_commandlog_user.py | 1 | 7026 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ScheduledCommand'
db.create_table(u'projects_scheduledcommand', (
(u'id', self.g... | mpl-2.0 | -3,620,563,519,525,825,000 | 65.92381 | 187 | 0.572303 | false | 3.72337 | false | false | false |
mvaled/sentry | src/sentry/utils/rust.py | 1 | 6436 | from __future__ import absolute_import
import re
import six
from sentry_sdk.hub import Hub
from sentry_sdk.integrations import Integration
from sentry_sdk.scope import add_global_event_processor
from sentry.utils.safe import get_path
SYSTEM_FRAMES = [
"std::",
"core::",
"alloc::",
"backtrace::",
... | bsd-3-clause | -6,565,131,968,590,305,000 | 24.641434 | 95 | 0.586234 | false | 3.456498 | false | false | false |
NaturalHistoryMuseum/inselect | inselect/gui/about.py | 1 | 4671 | # -*- coding: utf8 -*-
"""About box
"""
import platform
import humanize
import psutil
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (QDialog, QLabel, QPushButton, QSizePolicy,
QVBoxLayout)
from inselect.gui.utils import HTML_LINK_TEMPLATE
#... | bsd-3-clause | -452,157,225,880,659,200 | 29.723684 | 91 | 0.631263 | false | 3.747994 | false | false | false |
gralog/gralog | doc/python-examples/DomSet_z3.py | 1 | 1647 | #!/usr/bin/env python3
from time import time
from z3 import *
from Gralog import *
def gencon(g, k):
ids = [v.getId() for v in g.getVertices()]
D = [Bool('D%i' % i) for i in ids ]
s = Solver()
# the sum of D[i]'s set on True is at most k
s.add(PbLe([(Bool('D%i' % i),1) for i in ids], k))
#... | gpl-3.0 | 9,170,620,583,816,255,000 | 26 | 104 | 0.571949 | false | 2.951613 | false | false | false |
GoogleCloudPlatform/python-docs-samples | functions/http/main.py | 1 | 4916 | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 | 4,623,477,829,326,588,000 | 32.216216 | 74 | 0.667006 | false | 3.837627 | false | false | false |
pyrapt/rapt | rapt/transformers/sql/sql_translator.py | 1 | 8668 | from rapt.treebrd.attributes import AttributeList
from ...treebrd.node import Operator
from ..base_translator import BaseTranslator
class SQLQuery:
"""
Structure defining the building blocks of a SQL query.
"""
def __init__(self, select_block, from_block, where_block=''):
self.prefix = ''
... | mit | -2,205,867,267,950,047,000 | 32.863281 | 82 | 0.597485 | false | 4.110005 | false | false | false |
uemurax/japanese-theme | src/japanese_theme_base.py | 1 | 1062 | # japanese_theme_base.py --- Traditional colors of Japan
def parse_csv(s):
result = dict()
def modifier(x):
if x[0] == "#":
return x[1:]
else:
return result[x]
ls = s.splitlines()
for l in ls:
ss = l.split(",")
result[ss[0]] = modifier(ss[1])
... | gpl-3.0 | -3,382,390,153,934,730,000 | 21.125 | 68 | 0.515066 | false | 3.09621 | false | false | false |
frostburn/frostsynth | frostsynth/instrument.py | 1 | 6569 | from math import *
from cmath import exp as cexp
from frostsynth import *
from frostsynth.waveform import *
from frostsynth.filters import *
from frostsynth.envelope import *
from frostsynth.noise import *
from frostsynth.series import *
from frostsynth.additive import *
from frostsynth.analysis import *
from frostsyn... | mit | 8,455,630,412,688,366,000 | 36.752874 | 221 | 0.572538 | false | 2.624451 | false | false | false |
mediafactory/tryton_client_desktop | tryton/plugins/__init__.py | 1 | 1280 | #This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
from tryton import common
import os
import sys
import imp
import gettext
_ = gettext.gettext
PLUGINS_PATH = os.path.dirname(__file__)
if not os.path.isdir(PLUGINS_PATH):
# ... | gpl-3.0 | -2,535,099,035,009,619,000 | 28.767442 | 72 | 0.636719 | false | 3.72093 | false | false | false |
gkc1000/pyscf | pyscf/nao/m_vxc_pack.py | 1 | 2427 | # Copyright 2014-2018 The PySCF Developers. 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 appl... | apache-2.0 | 8,718,507,868,467,595,000 | 38.786885 | 95 | 0.691389 | false | 2.764237 | false | false | false |
spulec/moto | tests/test_managedblockchain/test_managedblockchain_members.py | 1 | 25308 | from __future__ import unicode_literals
import boto3
import pytest
import sure # noqa
from botocore.exceptions import ClientError, ParamValidationError
from moto import mock_managedblockchain
from . import helpers
@mock_managedblockchain
def test_create_another_member():
conn = boto3.client("managedblockchain"... | apache-2.0 | -6,209,329,723,786,380,000 | 33.668493 | 102 | 0.666825 | false | 4.018419 | true | false | false |
Nickiler531/NEGRAV_implemetation | test/NEGRAV.py | 1 | 5049 | """
This file contains all the NEGRAV functions. for all kind of devices
(Base station BS, Mobile node MN and Stationary node SN)
"""
import json
"""List of keys in each cmd type. this is used to verify"""
ADD_REQUEST_keys = ["source_ip"]
ADD_RESPONSE_keys = ["assign_ip"]
NODE_REPORT_keys = ["node_ip","type","senso... | gpl-3.0 | 2,636,109,977,826,802,700 | 21.44 | 118 | 0.666667 | false | 2.695675 | false | false | false |
drdaeman/python-engineio | engineio/socket.py | 1 | 6029 | import time
import six
from . import packet
from . import payload
class Socket(object):
"""An Engine.IO socket."""
upgrade_protocols = ['websocket']
def __init__(self, server, sid):
self.server = server
self.sid = sid
self.queue = self.server.async.Queue()
self.last_ping ... | mit | 6,240,505,308,236,768,000 | 35.319277 | 79 | 0.52828 | false | 4.423331 | false | false | false |
sam-m888/gramps | gramps/plugins/webreport/narrativeweb.py | 1 | 107527 | # -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007 Johan Gonqvist <johan.gronqvist@gmail.com>
# Copyright (C) 2007-2009 Gary Burton <gary.burton@zen.co.uk>
# Copyright (C) 2007-2009 Stephane Charet... | gpl-2.0 | -5,569,714,030,383,178,000 | 41.68162 | 80 | 0.54517 | false | 4.27597 | false | false | false |
imk1/IMKTFBindingCode | associateRegionsToActiveInactive.py | 1 | 25624 | import sys
import pybedtools as bt
import os
from deeplearning.mergedPeaksSummitAndMakeContinuousMat import show_value
import numpy as np
from scipy.cluster.hierarchy import linkage, cut_tree, leaves_list
import random
from scipy.spatial.distance import pdist, squareform
from sklearn.cluster import MiniBatchKMeans, KMe... | mit | 8,858,014,630,913,631,000 | 48.658915 | 144 | 0.725804 | false | 3.321753 | false | false | false |
maxzheng/workspace-tools | workspace/config.py | 1 | 3738 | """
# Default config. Change these in your personal ~/.config/workspace.cfg ::
###########################################################################################################
# Define product groups to take action upon (such as wst checkout, develop, or bump)
#########################################... | mit | -4,352,977,779,775,263,000 | 40.076923 | 109 | 0.470572 | false | 5.417391 | true | false | false |
red-hood/calendarserver | twistedcaldav/method/report_calendar_query.py | 1 | 12641 | ##
# Copyright (c) 2006-2015 Apple 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 l... | apache-2.0 | 2,790,910,986,654,881,000 | 41.419463 | 168 | 0.629064 | false | 4.583394 | false | false | false |
pra85/calibre | src/calibre/gui2/actions/choose_library.py | 1 | 22448 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os, posixpath
from functools import partial
from PyQt4.Qt import (QMenu, Qt, QInputDialog, QToolButton, QDialog,
... | gpl-3.0 | 8,768,948,087,209,069,000 | 39.082143 | 95 | 0.576361 | false | 3.917961 | false | false | false |
anselmobd/fo2 | src/produto/views/modelo.py | 1 | 2664 | from pprint import pprint
from django.shortcuts import render
from django.urls import reverse
from django.views import View
from fo2.connections import db_cursor_so
import produto.forms as forms
import produto.queries as queries
class Modelo(View):
Form_class = forms.ModeloForm
template_name = 'produto/mod... | mit | 209,733,289,085,301,660 | 32.544304 | 76 | 0.496226 | false | 3.862974 | false | false | false |
horazont/xmpp-crowd | foomodules/GitLog.py | 1 | 4966 | import logging
import foomodules.Base as Base
logger = logging.getLogger(__name__)
xmlns = "http://hub.sotecware.net/xmpp/git-post-update"
class GitLog(Base.XMPPObject):
REPOSITORY_NODE = "{{{0}}}repository".format(xmlns)
REF_NODE = "{{{0}}}ref".format(xmlns)
def __init__(self, pubsub_node, pubsub_host=... | mit | -4,868,787,229,812,666,000 | 34.219858 | 90 | 0.533226 | false | 4.014551 | false | false | false |
NeuralProsthesisLab/unlock | unlock/state/grid_state.py | 1 | 7766 | # Copyright (c) James Percent, Byron Galbraith and Unlock contributors.
# All rights reserved.
# 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 notic... | bsd-3-clause | -5,923,176,940,753,363,000 | 37.636816 | 95 | 0.625805 | false | 4.197838 | false | false | false |
Hejtman/ultraGarden | server/records/__init__.py | 1 | 1678 | import os
import shutil
from datetime import datetime
class Records:
"""
* Collects and store sensors data + current garden state.
* sensors data log + current garden state
* web server
* light version of sensor data history
* current garden state (TODO)
* next planne... | gpl-2.0 | -7,572,185,141,768,332,000 | 34.702128 | 101 | 0.556615 | false | 4.12285 | false | false | false |
olivierdalang/stdm | ui/gpx_table_2.py | 1 | 11099 | from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from qgis.gui import *
from collections import OrderedDict
from ..data import (non_spatial_table_columns)
from ui_gpx_table_widget import Ui_Dialog
from gpx_add_attribute_info import GPXAttributeInfoDialog
class GpxTableWidgetDialog(QDial... | gpl-2.0 | 6,437,636,686,031,435,000 | 41.362595 | 114 | 0.54158 | false | 4.061105 | false | false | false |
fossfreedom/cb_dev | coverart_album_search.py | 1 | 10182 | # -*- Mode: python; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; -*-
# Copyright (C) 2012 - fossfreedom
# Copyright (C) 2012 - Agustin Carrasco
## adapted from artsearch plugin - Copyright (C) 2012 Jonathan Matthew
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of t... | gpl-3.0 | 5,161,668,812,515,354,000 | 33.989691 | 151 | 0.577981 | false | 3.833584 | false | false | false |
oasis-open/cti-python-stix2 | stix2/markings/object_markings.py | 1 | 3711 | """Functions for working with STIX2 object markings."""
from stix2 import exceptions
from stix2.markings import utils
from stix2.versioning import new_version
def get_markings(obj):
"""
Get all object level markings from the given SDO or SRO object.
Args:
obj: A SDO or SRO object.
Returns:
... | bsd-3-clause | -6,206,751,969,965,441,000 | 27.328244 | 89 | 0.664241 | false | 3.825773 | false | false | false |
MohamedAshiqrh/PeARS | web/mkQueryPage.py | 1 | 2565 | ###################################################################
# ./mkQueryPage starts a web server to take and process user search
###################################################################
import findBestPears
import scorePages
import textblob_aptagger
from textblob import TextBlob
from textblob impor... | mit | 3,196,531,093,565,723,600 | 26 | 143 | 0.551657 | false | 3.582402 | false | false | false |
psiq/gdsfactory | pp/components/spiral.py | 1 | 1982 | from typing import Callable, Optional, Tuple
import picwriter.components as pc
from pp.port import auto_rename_ports
from pp.components.waveguide_template import wg_strip
from pp.picwriter2component import picwriter2component
import pp
from pp.component import Component
@pp.autoname
def spiral(
width: float = 50... | mit | -7,995,304,855,288,928,000 | 29.030303 | 166 | 0.638749 | false | 3.228013 | false | false | false |
gisce/bankbarcode | spec/input_spec.py | 1 | 1453 | from sys import maxint
from expects import expect, be_true, raise_error
from random import randint
from bankbarcode.bankbarcode import BankBarcode
with description('Check input values'):
with context('Length value checker'):
with before.all:
self.name = 'foo'
self.description = 'b... | agpl-3.0 | -7,092,842,957,733,231,000 | 38.27027 | 117 | 0.63042 | false | 4.175287 | false | false | false |
Hawk94/coin_tracker | main/coins/migrations/0002_auto_20170605_2008.py | 1 | 2269 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-05 20:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('coins', '0001_initial'),
]
operations = [
migrations.RemoveField(
... | mit | 8,880,600,099,945,423,000 | 26.337349 | 82 | 0.499339 | false | 4.380309 | false | false | false |
Britefury/batchup | batchup/tests/test_image_utils.py | 1 | 1283 | import pytest
import numpy as np
def test_ImageArrayUInt8ToFloat32():
from batchup.image.utils import ImageArrayUInt8ToFloat32
x = np.array([[0, 127, 255], [30, 60, 90]], dtype=np.uint8)
xf32 = x.astype(np.float32) * np.float32(1.0 / 255.0)
assert x.shape == (2, 3)
x_wrapped = ImageArrayUInt8To... | mit | 6,547,089,829,300,439,000 | 28.159091 | 77 | 0.614186 | false | 3.323834 | false | false | false |
latticelabs/Mitty | mitty/plugins/variants/uniform_insertions.py | 1 | 3734 | """This insertion generator generates insertions with uniformly distributed lengths"""
import numpy as np
import mitty.lib
import mitty.lib.util as mutil
from mitty.plugins.variants import scale_probability_and_validate
import logging
logger = logging.getLogger(__name__)
__example_param_text = """
{
"p": 0.0001, ... | gpl-2.0 | -8,856,958,376,644,894,000 | 40.043956 | 185 | 0.647027 | false | 2.935535 | false | false | false |
newmediamedicine/indivo_ui_server_1_0 | apps/problems/views.py | 1 | 8433 | """
Views for the Indivo Problems app
Ben Adida
ben.adida@childrens.harvard.edu
"""
from utils import *
import uuid
from django.utils import simplejson
def start_auth(request):
"""
begin the oAuth protocol with the server
expects either a record_id or carenet_id parameter,
now that we are caren... | lgpl-3.0 | 3,303,174,357,326,146,000 | 40.541872 | 311 | 0.65635 | false | 3.63962 | false | false | false |
Impactstory/oadoi | views.py | 1 | 26297 | from flask import make_response
from flask import request
from flask import redirect
from flask import abort
from flask import render_template
from flask import jsonify
from flask import g
from flask import url_for
from flask import Response
from openpyxl import Workbook
from sqlalchemy.orm import raiseload
import jso... | mit | -1,315,782,158,868,577,800 | 33.922975 | 175 | 0.638552 | false | 3.469261 | false | false | false |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_route_filters_operations.py | 1 | 29901 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit | -6,969,568,733,622,137,000 | 48.669435 | 193 | 0.643156 | false | 4.317834 | true | false | false |
kikusu/chainer | examples/imagenet/nin.py | 1 | 1222 | import math
import chainer
import chainer.functions as F
import chainer.links as L
class NIN(chainer.Chain):
"""Network-in-Network example model."""
insize = 227
def __init__(self):
w = math.sqrt(2) # MSRA scaling
super(NIN, self).__init__(
mlpconv1=L.MLPConvolution2D(
... | mit | 2,300,730,518,787,944,000 | 32.027027 | 74 | 0.553191 | false | 2.888889 | false | false | false |
dotunolafunmiloye/elasticsearch-test-data | es_test_data.py | 1 | 8790 | import json
import time
import logging
import random
import string
import uuid
import numpy
import tornado.gen
import tornado.httpclient
import tornado.options
async_http_client = tornado.httpclient.AsyncHTTPClient()
id_counter = 0
batch_upload_took = []
upload_data_count = 0
def delete_index(idx_name):
try:
... | mit | 7,845,467,106,784,763,000 | 36.404255 | 153 | 0.640387 | false | 3.440313 | false | false | false |
ricpol/quickreport | quickreport/chinook_demo/param_defaults.py | 1 | 2798 | # -*- coding: utf8 -*-
"""Quickreport - param_defaults.py
Funzioni per bounds default "dinamici" da assegnare ai parametri.
Le funzioni definite in questo modulo restituiscono valori di default, bounds o
entrambi per i parametri dei report, e possono essere usate in aggiunta a
quelle "standard" messe a disposizion... | isc | -1,047,888,653,044,299,800 | 34.884615 | 87 | 0.68406 | false | 3.532828 | false | false | false |
brainwane/zulip | tools/setup/emoji/emoji_names.py | 1 | 95373 | from typing import Any, Dict
EMOJI_NAME_MAPS: Dict[str, Dict[str, Any]] = {
# seems like best emoji for happy
'1f600': {'canonical_name': 'grinning', 'aliases': ['happy']},
'1f603': {'canonical_name': 'smiley', 'aliases': []},
# the google emoji for this is not great, so made People/9 'smile' and
#... | apache-2.0 | -8,121,091,866,322,726,000 | 61.376063 | 141 | 0.597035 | false | 3.053304 | false | false | false |
nasa/39A | spaceapps/awards/views.py | 1 | 1442 | from time import strftime
import csv
from django.views.generic.base import TemplateView, View
from django.views.generic.list import ListView
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
from braces.views import (
LoginRequiredMixin,
PermissionRequiredMixin,
Su... | apache-2.0 | -8,304,314,703,462,641,000 | 35.05 | 82 | 0.71706 | false | 3.824934 | false | false | false |
elliottd/satyrid | optimizers.py | 1 | 6564 | import theano
import theano.tensor as tensor
import numpy
def itemlist(tparams):
return [vv for kk, vv in tparams.iteritems()]
"""
General Optimizer Structure: (adadelta, adam, rmsprop, sgd)
Parameters
----------
lr : theano shared variable
learning rate, currently only necessaary for sgd
tparam... | bsd-3-clause | -3,923,763,695,229,996,000 | 42.470199 | 159 | 0.61624 | false | 2.796762 | false | false | false |
michellemorales/OpenMM | kaldi/egs/wsj/s5/steps/cleanup/internal/get_non_scored_words.py | 1 | 4074 | #!/usr/bin/env python
# Copyright 2016 Vimal Manohar
# 2016 Johns Hopkins University (author: Daniel Povey)
# Apache 2.0
from __future__ import print_function
import argparse
import logging
import operator
import os
import sys
from collections import defaultdict
logger = logging.getLogger(__name__)
lo... | gpl-2.0 | -3,480,654,471,699,107,000 | 36.722222 | 88 | 0.623957 | false | 3.618117 | false | false | false |
pw31/GGchem | tools/Plot_benchmark2.py | 1 | 11646 | import matplotlib.pyplot as plt
import numpy as np
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
from matplotlib.backends.backend_pdf import PdfPages
plt.rcParams['axes.linewidth'] = 2
pp = PdfPages('ggchem.pdf')
single_figures = 0
file = 'Static_Conc.dat'
data = open(file)
dummy = data.readl... | gpl-3.0 | 5,553,572,950,559,216,000 | 37.949833 | 419 | 0.56586 | false | 2.325015 | false | false | false |
UCL-INGI/INGInious | inginious/frontend/plugins/auth/github_auth.py | 1 | 2665 | # -*- coding: utf-8 -*-
#
# This file is part of INGInious. See the LICENSE and the COPYRIGHTS files for
# more information about the licensing of this file.
""" Github auth plugin """
import json
import os
import flask
from requests_oauthlib import OAuth2Session
from inginious.frontend.user_manager import AuthMeth... | agpl-3.0 | 5,534,347,541,333,534,000 | 34.533333 | 142 | 0.640901 | false | 3.670799 | false | false | false |
dougalsutherland/cyflann | setup.py | 1 | 3208 | from copy import deepcopy
import os
import sys
import versioneer
if sys.version_info[0] < 3:
import __builtin__ as builtins
else:
import builtins
try:
import numpy
except ImportError as e:
raise ImportError("cyflann requires numpy to be installed:\n{}".format(e))
# Don't do this in the setup() req... | bsd-3-clause | -7,571,885,759,158,432,000 | 30.145631 | 79 | 0.65586 | false | 3.874396 | false | false | false |
revisitors/revisit-test-util | test.py | 1 | 1357 | import sys
import requests
import json
import base64
import cStringIO
content = {
"content": {
},
"meta": {
"audio": {
"type": False,
"data": False
}
}
}
content_type = 'data:image/%s;base64,'
headers = {
'Content-Type' : 'application/js... | mit | -5,358,386,531,871,542,000 | 21.262295 | 87 | 0.572587 | false | 3.293689 | false | false | false |
ghostwords/chameleon-crawler | crawler/crawler_manager.py | 1 | 3122 | #!/usr/bin/env python3
# chameleon-crawler
#
# Copyright 2016 ghostwords.
#
# 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/.
from multiprocessing import Process, Queue
... | mpl-2.0 | 4,457,935,372,110,097,000 | 28.17757 | 79 | 0.539398 | false | 4.03881 | false | false | false |
reclaro/apimes | apimes/resources/message.py | 1 | 1080 | import logging
from flask import request
from flask_restful import Resource
from apimes import utils
LOG = logging.getLogger(__name__)
class Message(Resource):
def __init__(self):
self.driver = utils.get_driver()
def post(self, topic):
if not utils.is_valid_name(topic):
msg = ... | apache-2.0 | -3,638,701,288,812,612,000 | 29.857143 | 74 | 0.609259 | false | 4.285714 | false | false | false |
marqsm/LED-bot | LEDBot/slackRequestHandler.py | 1 | 1667 | from slackclient import SlackClient
import os,sys,time,logging,re
class slackRequestHandler(object):
def __init__(self,token=""):
self.token = token
self.client = None
self.last_ping = 0
self.id = None
self.name = None
self.selector = None
self.callback = None
def connect(self):
self.slack_client = ... | mit | -5,374,865,911,533,211,000 | 23.15942 | 77 | 0.635273 | false | 2.825424 | false | false | false |
wrenchzc/photomanager | photomanager/utils/geoutils.py | 1 | 1537 | from geopy.exc import GeopyError
import re
from geopy.geocoders import Nominatim
from geopy import units
_geo_locator = Nominatim(user_agent="photomanager")
def gps_info_to_degress(value):
pattern = '(.*?)\|\[(\d+).*?(\d+).*?(\d+)\/(\d+)'
match = re.match(pattern, value)
if match:
letter, radians,... | mit | -6,582,560,741,955,914,000 | 31.020833 | 98 | 0.630449 | false | 3.469526 | false | false | false |
BorgERP/borg-erp-6of3 | verticals/garage61/acy_workorder_analytic/sale.py | 1 | 1596 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010 Acysos S.L. (http://acysos.com) All Rights Reserved.
# Ignacio Ibeas <ignacio@acysos.com>
# $Id$
#
# This program i... | agpl-3.0 | -4,097,408,785,020,631,600 | 37.95122 | 98 | 0.593985 | false | 4.081841 | false | false | false |
plepe/pgmapcss | pgmapcss/types/tag_value.py | 1 | 1027 | from .default import default
class tag_value(default):
def compile(self, prop):
if prop['value_type'] == 'string':
return repr(prop['value'])
# TODO: first priority should name "name:" + LANG
if prop['value'] == 'auto' and \
(prop['key'] == 'text' or prop['key'][-5:... | agpl-3.0 | 7,533,795,500,117,634,000 | 38.5 | 77 | 0.485881 | false | 4.091633 | false | false | false |
dellstorage/storagecenter-flocker-driver | setup.py | 1 | 1487 | # Copyright 2015 Dell 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 agree... | apache-2.0 | 1,012,017,443,480,533,400 | 34.404762 | 91 | 0.683927 | false | 3.783715 | false | false | false |
tamasgal/km3pipe | scripts/monitoring/monitor_k40.py | 1 | 3011 | #!/usr/bin/env python
# vim: ts=4 sw=4 et
from itertools import combinations
import os
import numpy as np
import km3pipe as kp
from km3modules.plot import plot_dom_parameters
from km3modules.fit import fit_delta_ts
import km3pipe.style
km3pipe.style.use('km3pipe')
PLOTS_PATH = 'www/plots'
cal = kp.calib.Calibratio... | mit | -1,689,378,630,790,484,500 | 25.646018 | 71 | 0.519097 | false | 3.276387 | false | false | false |
Vinniekun/Chickenzilla | src/StartScreen.py | 1 | 4555 | import pygame
from pygame.rect import Rect
try:
import pygame_sdl2
pygame_sdl2.import_as_pygame()
except ImportError:
pass
from DebugInfo import DebugInfo
from engine import Point, Scene, GameObject
from engine.Animation import Animation
from engine.TileMap import TileMap
from engine import Physics
from ra... | gpl-3.0 | -8,640,368,125,795,165,000 | 31.542857 | 106 | 0.614929 | false | 3.241993 | false | false | false |
bx/bootloader_instrumentation_suite | fiddle_extra/find_write_loops.py | 1 | 10557 | #!/usr/bin/env python
import fiddle.staticanalysis
import fiddle.r2_keeper as r2
import sys
from fiddle.staticanalysis import LongWriteInfo
class LongWriteInfoOld():
#@classmethod
#def from_start_end(cls, elf, start, end, thumb):
# # get basic block
# return cls(elf, branch_ins["offset"], thumb... | mit | 444,992,294,248,292,100 | 40.238281 | 133 | 0.476272 | false | 2.943949 | false | false | false |
RuiNascimento/krepo | script.module.lambdascrapers/lib/lambdascrapers/sources_placenta/en_placenta-1.7.8/hd.py | 1 | 5881 | # -*- coding: UTF-8 -*-
#######################################################################
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# @Daddy_Blamo wrote this file. As long as you retain this notice you
# can do whatever you want wi... | gpl-2.0 | 7,586,674,883,336,068,000 | 41.615942 | 135 | 0.444992 | false | 4.061464 | false | false | false |
googleapis/googleapis-gen | google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/resources/types/language_constant.py | 1 | 2024 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 | 2,671,841,931,889,833,000 | 25.986667 | 74 | 0.602273 | false | 4.048 | false | false | false |
danux/django-holding-page | holding_page/subscribers/urls.py | 1 | 1095 | # -*- coding: utf-8 -*-
"""
URLs for the subscriber module.
"""
from django.conf.urls import patterns, url
from django.views.generic import TemplateView
urlpatterns = patterns(
'',
url(r'^thank-you/$', TemplateView.as_view(template_name="subscriber/thank_you.html"), name="thank_you"),
url(
r'^succe... | mit | 5,168,316,500,933,196,000 | 32.181818 | 108 | 0.632877 | false | 3.201754 | false | false | false |
nadgowdas/cargo | cli/voyage.py | 1 | 3883 | # Copyright 2013, 2015 IBM Corp.
#
#Copyright IBM Corporation 2015.
#LICENSE: Apache License 2.0 http://opensource.org/licenses/Apache-2.0
import json
import requests
from string import Template
import pdb
import sys
LIST_CONTAINER_URL = Template("http://$SERVER/cargo")
OPERATE_CONTAINER_URL = Template("http://$SERV... | apache-2.0 | 6,893,417,918,064,508,000 | 40.752688 | 107 | 0.596961 | false | 4.019669 | false | false | false |
bridadan/yotta | yotta/debug.py | 1 | 1073 | # Copyright 2014 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
import os
import logging
# validate, , validate things, internal
from .lib import validate
# CMakeGen, , generate build files, internal
from .lib import cmakegen
def addOpt... | apache-2.0 | -3,636,055,192,901,050,400 | 22.326087 | 74 | 0.670084 | false | 4.064394 | false | false | false |
EuropeanSocialInnovationDatabase/ESID-main | TextMining/WNPreprocess.py | 1 | 2062 | # encoding=utf8
import sys
from nltk.corpus import wordnet as wn
from os import listdir
from os.path import isfile, join,isdir
from nltk.stem import WordNetLemmatizer
import nltk
import os
#reload(sys)
sys.setdefaultencoding('utf8')
wordnet_lemmatizer = WordNetLemmatizer()
print(wordnet_lemmatizer.lemmatize('dogs'))
... | gpl-3.0 | 2,942,558,037,294,421,500 | 32.274194 | 80 | 0.658099 | false | 3.105422 | false | false | false |
ucamhal/jsonlogging | jsonlogging/tests/test_jsonlogging.py | 1 | 2050 | """
Integration tests for the jsonlogging package.
"""
import json
import logging
import unittest
import StringIO
from mock import MagicMock
import jsonlogging
class TestJsonLogging(unittest.TestCase):
def test_logged_messages_are_formatted_as_json(self):
"""
Test a full run through the stack f... | bsd-2-clause | -4,845,210,318,457,754,000 | 34.344828 | 78 | 0.63561 | false | 4.437229 | true | false | false |
kcah27/HnTool | HnTool/modules/vsftpd.py | 1 | 4351 | # -*- coding: utf-8 -*-
#
# HnTool rules - vsftpd
# Copyright (C) 2010 Hugo Doria <mail@hugodoria.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; either version 2 of the License, or... | gpl-2.0 | -4,342,028,875,868,697,000 | 38.926606 | 102 | 0.601931 | false | 4.100848 | false | false | false |
cikelengfeng/HTTPIDL | Sources/Compiler/antlr4/error/ErrorStrategy.py | 5 | 29501 | #
# Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
# Use of this file is governed by the BSD 3-clause license that
# can be found in the LICENSE.txt file in the project root.
#
from antlr4.IntervalSet import IntervalSet
from antlr4.Token import Token
from antlr4.atn.ATNState import ATNState
from antlr... | mit | -87,118,571,931,944,080 | 41.693198 | 130 | 0.656927 | false | 4.069103 | false | false | false |
kkmonlee/Project-Euler-Solutions | Python/p320.py | 1 | 2722 |
import sys
class facTable():
def get(self, sieve_range):
table = [{} for _ in range(sieve_range + 1)]
for i in range(2, sieve_range + 1):
if not table[i]:
for j in range(i, sieve_range + 1, i):
table[j][i] = 1
prime_power = i ** 2
... | gpl-3.0 | -2,264,685,926,050,541,000 | 28.923077 | 88 | 0.483835 | false | 3.754483 | false | false | false |
teamfruit/defend_against_fruit | defend_against_fruit/daf_fruit_dist/daf_fruit_dist/build/build_retention.py | 1 | 2063 | class BuildRetention(object):
def __init__(self,
count=None,
delete_build_artifacts=None,
build_numbers_not_to_be_discarded=None):
super(BuildRetention, self).__init__()
self._count = count
self._delete_build_artifacts = delete_build_artif... | apache-2.0 | -2,323,271,531,586,386,000 | 27.652778 | 69 | 0.552593 | false | 4.029297 | false | false | false |
CloudBoltSoftware/cloudbolt-forge | blueprints/aws_load_balancers/sync.py | 1 | 1682 | """
Discover AWS load balancer.
"""
import boto3
from botocore.client import ClientError
from common.methods import set_progress
from resourcehandlers.aws.models import AWSHandler
RESOURCE_IDENTIFIER = 'load_balancer_name'
def discover_resources(**kwargs):
discovered_load_balancers = []
for handler in AWSHa... | apache-2.0 | 6,621,734,854,139,572,000 | 39.047619 | 82 | 0.541617 | false | 5.066265 | false | false | false |
DeathPoison/tinker-cnc | tinkerforge/ip_connection.py | 1 | 37156 | # -*- coding: utf-8 -*-
# Copyright (C) 2012-2013 Matthias Bolte <matthias@tinkerforge.com>
# Copyright (C) 2011-2012 Olaf Lüke <olaf@tinkerforge.com>
#
# Redistribution and use in source and binary forms of this file,
# with or without modification, are permitted.
from threading import Thread, Lock, Semaphore
# curr... | mit | 25,715,877,760,613,596 | 35.462218 | 114 | 0.57139 | false | 4.478664 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.