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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ali/bandcamp-dl | bandcamp-dl/Bandcamp.py | 1 | 2915 | from bs4 import BeautifulSoup
import requests
import jsobj
class Bandcamp:
def parse(self, url):
try:
r = requests.get(url)
except requests.exceptions.MissingSchema:
return None
if r.status_code is not 200:
return None
self.soup = BeautifulSo... | unlicense | 6,864,020,420,458,705,000 | 27.578431 | 88 | 0.553688 | false | 3.928571 | false | false | false |
uber/pyro | pyro/ops/einsum/__init__.py | 1 | 1486 | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import opt_einsum
from pyro.util import ignore_jit_warnings
_PATH_CACHE = {}
def contract_expression(equation, *shapes, **kwargs):
"""
Wrapper around :func:`opt_einsum.contract_expression` that optionally uses
Pyro'... | apache-2.0 | 1,018,638,470,633,825,300 | 29.326531 | 78 | 0.666891 | false | 3.849741 | false | false | false |
lingthio/signinghub_api | example_app/example_app.py | 1 | 6258 | import json
from flask import Flask, request, current_app, render_template, redirect, url_for
from signinghub_api import SigningHubAPI
# Create a web application with Flask
app = Flask(__name__)
# Copy local_settings.py from local_settings_example.py
# Edit local_settings.py to reflect your CLIENT_ID and CLIENT_SECRE... | mit | 5,125,447,170,131,130,000 | 39.901961 | 130 | 0.642378 | false | 4.040026 | true | false | false |
SeiryuZ/magnet | magnet/apps/users/forms.py | 1 | 2327 | from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from django import forms
from django.utils.translation import ugettext_lazy as _
from .models import User
class UserCreationForm(forms.ModelForm):
"""A form for creating new users. Includes all the required
fields, plus a repea... | mit | 884,519,156,442,182,800 | 37.783333 | 90 | 0.643747 | false | 3.930743 | false | false | false |
tencrance/cool-config | python_tricks/factory_method.py | 1 | 3265 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2017/11/15 14:57
# @Author : Zhiwei Yang
# @File : factory_method.py.py
"""
工厂方法集中的在一个地方创建对象,使对象的跟踪变得更容易。
工厂方法模式可以帮助我们将产品的实现从使用中解耦。如果增加产品或者改变产品的实现,Creator 并不会收到影响。
使用工厂方法模式的另一个优点是在系统中加入新产品时,无须修改抽象工厂和抽象产品提供的接口,无须修改客户端,
也无须修改其他的具体工厂和具体产品,而只要添加一个具体工厂和具体产品就可以... | mit | 6,386,572,594,155,726,000 | 22.918919 | 57 | 0.629755 | false | 2.144588 | false | false | false |
bat-serjo/vivisect | envi/radixtree.py | 3 | 2027 | '''
simple/fast python impl of a couple radix/prefix trees.
'''
import threading
class RadixIntTree:
'''
An integer indexed suffix tree.
'''
def __init__(self, bits=32):
# each node is [ left, right, answers ]
self.precount = 0
self.bitwidth = bits
self.treelock = thre... | apache-2.0 | -5,749,332,831,248,389,000 | 26.391892 | 76 | 0.517514 | false | 4.021825 | false | false | false |
gregoil/rotest | tests/core/test_shell.py | 1 | 5847 | """Test Rotest's TestCase class behavior."""
# pylint: disable=missing-docstring,unused-argument,protected-access
# pylint: disable=no-member,no-self-use,too-many-public-methods,invalid-name
from __future__ import absolute_import
from rotest.core import request, BlockInput
from rotest.management.models.ut_resources im... | mit | -8,135,696,172,237,661,000 | 35.773585 | 79 | 0.654524 | false | 4.286657 | true | false | false |
sergpolly/GlycoMadness | SILAC_stage1b_pull_proteins_NCBI.py | 1 | 5077 | import os
import sys
from Bio import Seq
from Bio import SeqIO
from Bio import SeqRecord
import pandas as pd
import numpy as np
import ms_module as ms
import re
############################
from Bio import Entrez
from Bio import SeqIO
from StringIO import StringIO
import time
from urllib2 import HTTPError # for Python... | mit | 4,538,599,466,040,063,500 | 31.33758 | 130 | 0.656096 | false | 3.446707 | false | false | false |
li-yuntao/SiliconLives | PytorchModels/softmax.py | 1 | 2699 | # encoding: utf-8
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
class Softmax(nn.Module):
def __init__(self, num_labels, feature_dim):
super(Softmax, self).__init__()
self.linear = nn.Linear(feature_dim, num_labels... | gpl-3.0 | -8,706,232,006,862,907,000 | 31.518072 | 77 | 0.636532 | false | 3.259662 | false | false | false |
aptivate/django-notification | notification/models.py | 1 | 15623 | import datetime
try:
import cPickle as pickle
except ImportError:
import pickle
from django.db import models
from django.db.models.query import QuerySet
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.mail import send_mail
from django.core.urlresolvers... | mit | 8,039,311,497,318,216,000 | 32.597849 | 114 | 0.640594 | false | 4.192968 | false | false | false |
laslabs/vertical-medical | sale_medical_prescription/tests/test_medical_sale_wizard.py | 1 | 7593 | # -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License GPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
import mock
from . import wizard_test_setup
NEXT_SALE = 'odoo.addons.sale_medical_prescription.wizards.' \
'medical_sale_wizard.MedicalSaleWizard._get_next_sale_wizard'
class TestMed... | agpl-3.0 | -1,537,561,629,924,999,200 | 35.330144 | 78 | 0.546424 | false | 3.593469 | true | false | false |
jsspencer/toy_fci | lattice_propogation.py | 1 | 3133 | #!/usr/bin/env python
'''
lattice_propogation
===================
Script which uses the FCIQMC algorithm without annihilation to propogate
positive and negative psips using Hamiltonians defined in both Hartree product
and Slater determinant bases for two spinless fermions on a `4\\times4` lattice
with periodic boundar... | bsd-3-clause | -6,894,005,543,195,005,000 | 36.297619 | 105 | 0.621449 | false | 3.05957 | false | false | false |
skosukhin/spack | var/spack/repos/builtin/packages/font-adobe-utopia-100dpi/package.py | 1 | 2145 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | 6,558,359,492,020,549,000 | 39.471698 | 96 | 0.661538 | false | 3.763158 | false | false | false |
asifhj/Python_SOAP_OSSJ_SAP_Fusion_Kafka_Spark_HBase | srKbLink.py | 1 | 7686 | __author__ = 'asifj'
import requests
from pymongo import MongoClient
import json
import csv
import traceback
import logging
from tabulate import tabulate
logging.basicConfig(
format='%(asctime)s.%(msecs)s:%(name)s:%(thread)d:%(levelname)s:%(process)d:%(message)s',
level=logging.DEBUG
)
class HBa... | apache-2.0 | -7,725,995,754,706,033,000 | 45.73913 | 152 | 0.47606 | false | 4.284281 | false | false | false |
strogo/djpcms | tests/regression/autocomplete/tests.py | 1 | 1443 | from djpcms.test import TestCase
from djpcms.views import appsite, appview
from regression.autocomplete.models import Strategy
# RULE 1 import forms from djpcms
from djpcms import forms
class TestForm(forms.Form):
strategy = forms.ModelChoiceField(Strategy.objects.all())
class TestFormMulti(forms.Form)... | bsd-3-clause | 4,268,121,878,232,398,300 | 31.818182 | 73 | 0.688843 | false | 4.158501 | true | false | false |
yhoogstrate/dr-disco | setup.py | 1 | 1885 | #!/usr/bin/env python
# *- coding: utf-8 -*-
# vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 textwidth=79:
"""
Installer of Dr. Disco
[License: GNU General Public License v3 (GPLv3)]
This file is part of Dr. Disco.
FuMa is free software: you can redistribute it and/or modify
it under the terms of the G... | gpl-3.0 | -3,885,011,239,471,985,000 | 33.907407 | 110 | 0.677984 | false | 3.993644 | false | false | false |
maas/maas | src/provisioningserver/import_images/cleanup.py | 1 | 1824 | # Copyright 2014-2016 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Clean up old snapshot directories."""
import os
import shutil
def list_old_snapshots(storage):
"""List of snapshot directories that are no longer in use."""
cur... | agpl-3.0 | -8,726,739,808,957,960,000 | 29.4 | 79 | 0.663377 | false | 3.973856 | false | false | false |
Signiant/maestro-core | maestro/tools/path.py | 1 | 3383 | import os, platform, re, shutil
def get_tree_size(path = '.'):
"""
get_tree_size will return the total size of a directory tree
"""
if not os.path.exists(path):
raise OSError("Path " + str(path) + " does not exist!")
total_size = 0
for dirpath, dirnames, filenames in os.walk(str(path))... | mit | -5,302,980,098,306,267,000 | 33.876289 | 212 | 0.606562 | false | 3.758889 | false | false | false |
takeshixx/webfixy | libfixy/deobfuscation.py | 1 | 1230 | import demjson
values = {
'uff000b': 'policy',
'sfe0009': 'skin',
's1': 'user',
's2': 'manualURL',
's11': 'arch',
's15': 'boardname',
's16': 'version',
's17': 'board',
's2c': 'displayname',
'M1': 'prefs',
'Uff0001': 'path',
'Uff0002': '',
'uff0007': 'cmd',
'ufe00... | gpl-3.0 | 1,142,369,460,716,871,200 | 20.982143 | 46 | 0.543089 | false | 2.978208 | false | false | false |
our-city-app/oca-backend | src/rogerthat/pages/login.py | 1 | 11605 | # -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 | 5,234,816,009,816,448,000 | 35.152648 | 113 | 0.627574 | false | 3.967521 | false | false | false |
googleapis/python-irm | google/cloud/irm_v1alpha2/gapic/transports/incident_service_grpc_transport.py | 1 | 20473 | # -*- 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 | -3,519,468,932,222,391,300 | 35.888288 | 98 | 0.643921 | false | 5.177795 | false | false | false |
CLVsol/odoo_cl_addons | cl_person/person_address/cl_person_address.py | 1 | 2726 | # -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... | agpl-3.0 | -7,330,202,957,231,574,000 | 39.088235 | 98 | 0.469552 | false | 4.528239 | false | false | false |
Ezhil-Language-Foundation/open-tamil | solthiruthi/resources.py | 1 | 1405 | ## -*- coding: utf-8 -*-
## This file is part of Open-Tamil project.
## (C) 2015,2020 Muthiah Annamalai
##
from __future__ import print_function
import os
def _make_dict_with_path(srcfiles):
return dict([(srcfile.split(u".txt")[0], mk_path(srcfile)) for srcfile in srcfiles])
def get_data_dir():
dirname, fi... | mit | 4,160,694,511,781,497,300 | 23.649123 | 88 | 0.627046 | false | 2.983015 | false | false | false |
pinterest/kingpin | kingpin/metaconfig/metaconfig_utils.py | 1 | 19020 | #!/usr/bin/python
#
# Copyright 2016 Pinterest, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 | 1,019,133,969,854,918,900 | 43.441589 | 211 | 0.628549 | false | 4.197749 | true | false | false |
Akylas/CouchPotatoServer | couchpotato/core/plugins/manage/main.py | 1 | 2849 | from couchpotato.api import addApiView
from couchpotato.core.event import fireEvent, addEvent, fireEventAsync
from couchpotato.core.helpers.request import jsonified, getParam
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
from couchpotato.environment import Env
import os
impo... | gpl-3.0 | -3,737,406,707,848,226,300 | 33.325301 | 133 | 0.599158 | false | 4.356269 | false | false | false |
Amir-Hijack/Acc-Hijack | src/facebookLib.py | 1 | 1769 | # -*- coding: utf-8 -*-
from time import sleep
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import sys
reload(sys)
sys.setdefaultencoding('utf8')
''' facebookLib.py - Facebook bruteforce, seperate from mainLib to prevent any errors.
Comprises of a username checki... | gpl-3.0 | -8,152,327,688,107,481,000 | 35.102041 | 101 | 0.595252 | false | 3.716387 | false | false | false |
menpo/serializablecallable | serializablecallable/base.py | 1 | 6281 | import inspect
import importlib
import sys
from collections import namedtuple, Hashable
from functools import partial
try:
from unittest.mock import MagicMock, patch # Python 3
except ImportError:
from mock import MagicMock, patch # Python 2
from inspect import getargspec
SerializedCallable = namedtuple('Ser... | bsd-3-clause | -4,669,458,925,515,064,000 | 34.286517 | 79 | 0.651329 | false | 4.04443 | true | false | false |
syllog1sm/TextBlob | text/blob.py | 1 | 29687 | # -*- coding: utf-8 -*-
'''Wrappers for various units of text.'''
from __future__ import unicode_literals
import sys
import json
import string as pystring
from collections import defaultdict
from .packages import nltk
from .decorators import cached_property
from .utils import lowerstrip, PUNCTUATION_REGEX
from .infle... | mit | 800,950,500,900,574,200 | 36.295226 | 99 | 0.600936 | false | 4.201982 | false | false | false |
b-jesch/service.fritzbox.callmonitor | resources/lib/PhoneBooks/pyicloud/services/reminders.py | 1 | 3587 | from __future__ import absolute_import
from datetime import datetime
import time
import uuid
import json
from tzlocal import get_localzone
class RemindersService(object):
def __init__(self, service_root, session, params):
self.session = session
self.params = params
self._service_root = se... | gpl-2.0 | 6,290,168,076,146,102,000 | 31.609091 | 75 | 0.441595 | false | 4.808311 | false | false | false |
carsongee/formunculous | formunculous/urls.py | 1 | 4732 | # This file is part of formunculous.
#
# formunculous 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.
#
# formu... | gpl-3.0 | -2,882,577,813,195,735,000 | 32.560284 | 90 | 0.591716 | false | 3.33945 | false | false | false |
ardi69/pyload-0.4.10 | pyload/plugin/hoster/MyfastfileCom.py | 1 | 1074 | # -*- coding: utf-8 -*-
from pyload.utils import json_loads
from pyload.plugin.internal.MultiHoster import MultiHoster
class MyfastfileCom(MultiHoster):
__name = "MyfastfileCom"
__type = "hoster"
__version = "0.08"
__pattern = r'http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/dl/'
__config = [(... | gpl-3.0 | -1,776,470,991,979,768,300 | 30.588235 | 108 | 0.564246 | false | 3.284404 | false | false | false |
DedMemez/ODS-August-2017 | cogdominium/DistCogdoCrane.py | 1 | 35160 | # Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.cogdominium.DistCogdoCrane
from panda3d.physics import ActorNode, PhysicalNode, PhysicsCollisionHandler, PhysicsObject
from panda3d.direct import SmoothMover
from panda3d.core import BitMask32, CollideMask, CollisionHandler, CollisionHandlerEvent, C... | apache-2.0 | -2,962,020,186,007,563,000 | 38.093501 | 393 | 0.611177 | false | 3.471564 | false | false | false |
wphicks/Writing3D | pyw3d/blender_actions/trigger.py | 1 | 1973 | # Copyright (C) 2016 William Hicks
#
# This file is part of Writing3D.
#
# Writing3D is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
... | gpl-3.0 | -6,210,813,533,540,317,000 | 33.614035 | 78 | 0.65484 | false | 3.993927 | false | false | false |
Open-Power-System-Data/time_series | timeseries_scripts/imputation.py | 1 | 14280 | """
Open Power System Data
Time series Datapackage
imputation.py : fill functions for imputation of missing data.
"""
from datetime import datetime, date, timedelta
import pandas as pd
import numpy as np
import logging
logger = logging.getLogger(__name__)
logger.setLevel('INFO')
def find_nan(df, res_key, headers... | mit | -2,187,778,753,264,839,200 | 32.521127 | 140 | 0.60014 | false | 3.878327 | false | false | false |
30loops/django-sphinxdoc | setup.py | 1 | 1150 | #! /usr/bin/env python
from distutils.core import setup
import sys
reload(sys).setdefaultencoding('Utf-8')
setup(
name='django-sphinxdoc',
version='1.0',
author='Stefan Scherfke',
author_email='stefan at sofa-rockers.org',
description='Easily integrate Sphinx documentation into your website.',
... | bsd-3-clause | 3,340,625,887,401,585,700 | 30.944444 | 77 | 0.630435 | false | 4.092527 | false | true | false |
leppa/home-assistant | homeassistant/components/owntracks/messages.py | 1 | 11088 | """OwnTracks Message handlers."""
import json
import logging
from nacl.encoding import Base64Encoder
from nacl.secret import SecretBox
from homeassistant.components import zone as zone_comp
from homeassistant.components.device_tracker import (
SOURCE_TYPE_BLUETOOTH_LE,
SOURCE_TYPE_GPS,
)
from homeassistant.co... | apache-2.0 | 1,786,945,677,978,614,800 | 30.589744 | 90 | 0.637085 | false | 3.872861 | false | false | false |
jonathadv/PyPoABus | tests/test_cli.py | 1 | 3362 | # -*- coding: utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
# Disabling the below pylint warnings in order to use long names convention in the tests
# and because some entities are used seamlessly instead of being directly called.
# pylint: disable=invalid-name
# pylint: disable=unused-import
"""
... | mit | 7,278,359,651,027,564,000 | 29.017857 | 89 | 0.620167 | false | 3.674317 | true | false | false |
fimad/mitmproxy | netlib/tcp.py | 1 | 32312 | from __future__ import (absolute_import, print_function, division)
import os
import select
import socket
import sys
import threading
import time
import traceback
import binascii
from six.moves import range
import certifi
from backports import ssl_match_hostname
import six
import OpenSSL
from OpenSSL import SSL
from ... | mit | 7,919,982,118,599,797,000 | 34.121739 | 160 | 0.567405 | false | 4.174677 | false | false | false |
sebastienhupin/qxrad | tool/lib/qxjsonrpc/_access.py | 1 | 7491 | #!/usr/bin/python
# -*- coding: ascii -*-
'''==========================================================================
qxjsonrpc - JSON-RPC backend for the qooxdoo JavaScript library
(C) 2007 - Viktor Ferenczi (python@cx.hu) - Licence: GNU LGPL
-----------------------------------------------------------------... | lgpl-3.0 | -3,126,790,091,060,564,500 | 39.616667 | 79 | 0.641303 | false | 4.732154 | false | false | false |
ulikoehler/UliEngineering | UliEngineering/SignalProcessing/Normalize.py | 1 | 3030 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Functions for normalizing signals
"""
import numpy as np
from collections import namedtuple
import scipy.signal
from .Utils import peak_to_peak
__all__ = ["normalize_max", "center_to_zero", "normalize_minmax", "normalize_plusminus_peak"]
NormalizationResult = namedtu... | apache-2.0 | -2,281,879,049,683,676,700 | 28.705882 | 93 | 0.662706 | false | 3.997361 | false | false | false |
bacaldwell/ironic | ironic/tests/unit/drivers/modules/irmc/test_management.py | 1 | 15185 | # Copyright 2015 FUJITSU LIMITED
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | apache-2.0 | 6,273,096,235,012,135,000 | 40.831956 | 78 | 0.581429 | false | 3.548726 | true | false | false |
hb9kns/PyBitmessage | src/singleinstance.py | 1 | 3449 | #! /usr/bin/env python
import atexit
import errno
from multiprocessing import Process
import os
import sys
import state
try:
import fcntl # @UnresolvedImport
except:
pass
class singleinstance:
"""
Implements a single instance application by creating a lock file at appdata.
This is based upon th... | mit | -6,075,821,453,669,778,000 | 33.148515 | 101 | 0.52421 | false | 4.316646 | false | false | false |
maxolasersquad/orthosie | inventory/api_views.py | 1 | 6690 | # Copyright 2013 Jack David Baucum
#
# This file is part of Orthosie.
#
# Orthosie 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 l... | gpl-3.0 | -4,458,075,924,592,598,500 | 30.706161 | 73 | 0.63423 | false | 3.923754 | false | false | false |
KevinVDVelden/7DRL_2015 | Game/GameUtil.py | 1 | 17700 | import random
import math
from Util import *
import ECS
import Cheats
import GameComponents
import GameData
import Actions
import Window
def LoadEntities( self ):
self.playerAction = None
def playerAction( __, _, wasBlocked, curTurn ):
if self.playerAction is not None:
char = GameData.Pla... | gpl-2.0 | -9,095,789,401,380,697,000 | 39.045249 | 154 | 0.584294 | false | 3.942972 | false | false | false |
matt-tingen/debug | debug.py | 1 | 3419 | from functools import wraps
from pprint import pprint
class Debug:
enabled = True
allow_now = True
def __init__(self):
class on:
def __init__(self, parent):
self.parent = parent
def __call__(self):
self.parent.enabled = True
def... | mit | -1,933,733,955,191,477,200 | 28.230769 | 79 | 0.485815 | false | 4.683562 | false | false | false |
bolkedebruin/airflow | airflow/utils/log/gcs_task_handler.py | 1 | 7505 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 | 4,151,379,373,028,525,000 | 40.010929 | 104 | 0.619054 | false | 4.178731 | false | false | false |
cprov/snapcraft | tests/unit/commands/__init__.py | 1 | 3601 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2018 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | gpl-3.0 | -9,074,133,153,076,883,000 | 29.260504 | 87 | 0.630103 | false | 3.509747 | true | false | false |
anarang/robottelo | tests/foreman/endtoend/utils.py | 1 | 1566 | """Module that aggregates common bits of the end to end tests."""
from robottelo.vm import VirtualMachine
AK_CONTENT_LABEL = u'rhel-6-server-rhev-agent-rpms'
class ClientProvisioningMixin(object):
def client_provisioning(
self, activation_key_name, organization_label,
package_name='python... | gpl-3.0 | 1,101,187,075,575,255,000 | 42.5 | 79 | 0.644317 | false | 4.374302 | false | false | false |
NoYouShutup/CryptMeme | CryptMeme/apps/sam/Demos/streamTests/samOut.py | 1 | 2837 | #!/usr/bin/python
# open a I2P stream destination
# then open another stream that connects to the destination created by samForward.py or samIn.py
# then send bytes through the stream
# usage :
# ./samOut.py [ silent [ sessionName ] ]
#
# silent : should the first incoming after the connection reques... | mit | -655,332,114,216,717,400 | 53.557692 | 947 | 0.827282 | false | 2.18567 | false | false | false |
mahabs/nitro | nssrc/com/citrix/netscaler/nitro/resource/config/ca/capolicy_binding.py | 1 | 3874 | #
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 | 4,032,117,685,726,313,000 | 27.910448 | 118 | 0.697212 | false | 3.241841 | false | false | false |
commonsense/divisi2 | setup.py | 1 | 3743 | #!/usr/bin/env python
"""Divisi2: Commonsense Reasoning over Semantic Networks
Divisi2 is a library for reasoning by analogy and association over
semantic networks, including common sense knowledge. Divisi uses a
sparse higher-order SVD and can help find related concepts, features,
and relation types in any knowledge... | gpl-3.0 | 481,974,323,982,936 | 33.33945 | 111 | 0.662303 | false | 3.691321 | false | false | false |
coderjames/pascal | quex-0.63.1/quex/engine/generator/mega_state/core.py | 1 | 11790 | from quex.blackboard import setup as Setup, E_StateIndices
from quex.engine.analyzer.mega_state.template.state import TemplateState
from quex.engine.analyzer.mega_state.path_walker.state import PathWalkerState
from quex.engine.analyzer.mega_state.core import MegaStat... | bsd-2-clause | -6,559,487,895,619,935,000 | 47.122449 | 123 | 0.613401 | false | 3.857984 | false | false | false |
roghu/py3_projects | tests/Numbers/test_credit_card_validator.py | 1 | 1051 | import pytest
from src.Numbers.credit_card_validator import CardValidator, CardError
class TestCreditCard:
def test_valiator_success(self):
card = CardValidator(4556821195558787)
assert card.__str__() == "************8787"
assert card.__repr__() == "<Credit Card: ************8787>"
d... | mit | -7,047,360,668,135,310,000 | 34.033333 | 70 | 0.603235 | false | 3.700704 | true | false | false |
scitokens/scitokens | tests/test_scitokens.py | 1 | 12413 |
"""
Test cases for the Validator and Enforcer classes from the scitokens module.
"""
import os
import sys
import time
import unittest
import cryptography.hazmat.backends
import cryptography.hazmat.primitives.asymmetric.rsa
# Allow unittests to be run from within the project base.
if os.path.exists("src"):
sys.p... | apache-2.0 | -6,480,488,713,578,052,000 | 36.844512 | 114 | 0.596633 | false | 3.321648 | true | false | false |
iShoto/testpy | samples/keras_cifar10_intro/test.py | 1 | 9903 | # coding: utf-8
import os
import numpy as np
import matplotlib.pyplot as plt
from scipy.misc import toimage
import pandas as pd
import time
#from sklearn.model_selection import KFold
#from sklearn.model_selection import train_test_split
from keras.datasets import cifar10
from keras.models import Sequential
from keras... | mit | -2,263,601,383,694,599,700 | 28.215339 | 102 | 0.65051 | false | 2.895614 | true | false | false |
pbailis/bolton-sigmod2013-code | shim-code/tweet/stats.py | 1 | 3682 |
from pylab import *
convolen = -1
convolens = []
eventuals = []
explicits = []
replylens = []
convolendict = {}
bytes_per_explicit = 1
#mpl.rcParams['font.size'] = 12
mpl.rcParams['figure.figsize'] = 4, 1
#mpl.rcParams['lines.markersize'] = 14
#mpl.rcParams['lines.linewidth'] = 1.5
for line in open("conversations.... | apache-2.0 | -303,628,926,099,308,540 | 26.274074 | 139 | 0.666486 | false | 2.810687 | false | false | false |
Margherita-/camilla | lib/get_photo.py | 1 | 1068 | import flickr_api
import pickle
import os
# returns the urls of all photos in an album
def get_photos_url(photos):
lista_url = []
for photo in photos:
lista_url.append(photo.getPhotoFile('Medium'))
return lista_url
def give_me_photos():
if not os.path.exists('album.pickle'):
return ([], [])
fp1 = file('albu... | gpl-3.0 | -1,397,051,139,154,848,500 | 20.36 | 61 | 0.679775 | false | 2.630542 | false | false | false |
montenegroariel/sigos | apps/odontologicos/admin.py | 1 | 1425 | from django.contrib import admin
from .models import OrdenOdontologica, ArancelOdontologico, Entidad, Capitulo
class OrdenOdontologicaAdmin(admin.ModelAdmin):
list_display = [
'persona',
'localidad',
'lugar_trabajo',
'mes',
'anio'
]
search_fields = [
'pers... | gpl-3.0 | 9,189,499,504,768,650,000 | 19.070423 | 77 | 0.585965 | false | 3.180804 | false | false | false |
google-research/data-driven-advection | datadrivenpdes/core/integrate.py | 1 | 4705 | # python3
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 | 8,454,643,705,466,531,000 | 33.595588 | 80 | 0.687779 | false | 3.800485 | false | false | false |
rvelhote/bitcoin-indicator | interface/indicator.py | 1 | 2682 | # MIT License
#
# Copyright (c) 2017 Ricardo Velhote
#
# 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, mer... | mit | 3,826,399,072,015,603,000 | 40.276923 | 108 | 0.707681 | false | 4.250396 | false | false | false |
macosforge/ccs-calendarserver | txdav/caldav/resource.py | 1 | 4552 | ##
# Copyright (c) 2010-2017 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,048,175,554,441,219,300 | 27.993631 | 125 | 0.650264 | false | 4.339371 | false | false | false |
andrewfu0325/gem5-aladdin | sweeps/benchmarks/designsweeptypes.py | 1 | 1766 | # Design sweep class for gem5.
import os
from xenon.base.designsweeptypes import ExhaustiveSweep
from benchmarks import params
from generators import *
class Gem5DesignSweep(ExhaustiveSweep):
sweepable_params = [
# gem5 needs to know this to determine whether a cache should be attached
# to the accele... | bsd-3-clause | 174,195,536,780,014,200 | 32.320755 | 83 | 0.698754 | false | 3.574899 | false | false | false |
hziling/flango | flango/template.py | 1 | 11989 | # -*- coding: utf-8 -*-
"""
flango.template
~~~~~~~~~~~~~~
template module provide a simple template system that compiles
templates to Python code which like django and tornado template
modules.
Usage
-----
Well, you can view the tests file directly for the usage under tests.
Bas... | mit | 4,007,241,840,754,139,600 | 33.059659 | 116 | 0.534573 | false | 4.303302 | false | false | false |
pablobesada/tw | frontend/gnip/genderclassifier.py | 1 | 1721 | import re
from pprint import pprint
from mongo import MongoManager
from datetime import datetime, timedelta
class GenderClassifier(object):
cached_names_database = {}
@classmethod
def getNamesDatabase(cls, **kwargs):
max_age = kwargs.get('max_age', timedelta(seconds=0))
if not max_age or... | apache-2.0 | 3,422,839,984,736,192,500 | 31.471698 | 128 | 0.561302 | false | 3.483806 | false | false | false |
iulian787/spack | var/spack/repos/builtin/packages/qt/package.py | 1 | 23696 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
from spack.operating_systems.mac_os import macos_version
import llnl.util.tty as tty
import itertools
... | lgpl-2.1 | -1,463,404,528,243,253,200 | 38.625418 | 108 | 0.579887 | false | 3.287915 | true | false | false |
arunkgupta/gramps | gramps/plugins/import/importgeneweb.py | 1 | 36597 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Martin Hawlisch, Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# 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 Soft... | gpl-2.0 | 4,967,616,865,743,798,000 | 39.438674 | 199 | 0.51067 | false | 3.922929 | false | false | false |
bkuczenski/lca-tools | antelope_catalog/data_sources/ecoinvent.py | 1 | 4573 | import os
import re
from .data_source import DataSource, DataCollection
from .ecoinvent_lcia import EcoinventLciaConfig, EI_LCIA_SPREADSHEETS
FILE_PREFIX = ('current_Version_', 'ecoinvent ')
FILE_EXT = ('7z', 'zip')
ECOINVENT_SYS_MODELS = ('apos', 'conseq', 'cutoff')
MODELMAP = {
'apos': ('apos',),
'conseq': ... | gpl-2.0 | -8,512,925,242,131,286,000 | 36.483607 | 119 | 0.586486 | false | 3.640924 | false | false | false |
richardjuan/nots_parser | core/parser.py | 1 | 3044 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
class Parser:
def __init__(self,name):
self.rules = []
self.buffer = ""
self.full_sentence = ""
self.flags = [ 0,0,0,0,0,0 ] # secces , nl , end_instrc, interupt, no print , autoexec sentence
self.eatch_run = ""
self.separator = "\n"
self.argsep = " "
... | mit | -3,129,648,057,993,112,600 | 21.382353 | 97 | 0.567346 | false | 2.584041 | false | false | false |
ajylee/gpaw-rtxs | gpaw/test/complex.py | 1 | 1451 | from gpaw import GPAW, restart
from ase.structure import molecule
from gpaw.test import equal
Eini0 = -17.6122060535
Iini0 = 12
esolvers = ['cg', 'rmm-diis', 'dav']
E0 = {'cg': -17.612151335507559,
'rmm-diis': -17.612184220369553,
'dav': -17.612043641621657}
I0 = {'cg': 6, 'rmm-diis': 7, 'dav': 8... | gpl-3.0 | -8,990,381,093,668,258,000 | 24.017241 | 73 | 0.61337 | false | 2.662385 | false | false | false |
csachs/tunable | tunable/modulehelper.py | 1 | 2113 | # -*- coding: utf-8 -*-
"""
documentation
"""
import sys
import argparse
import importlib
import warnings
from itertools import product
class ModuleHelper(object):
Exception = Exception
Warning = Warning
Ignore = 1
error_mode = Exception
prefixes = [""]
modules = {}
@classmethod
... | mit | -7,339,069,100,482,631,000 | 24.768293 | 97 | 0.574539 | false | 4.260081 | false | false | false |
swcurran/tfrs | backend/api/serializers.py | 1 | 9172 | """
REST API Documentation for the NRS TFRS Credit Trading Application
The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation.
OpenAPI spec version: v1
... | apache-2.0 | 7,038,989,066,852,127,000 | 33.611321 | 208 | 0.68502 | false | 4.498283 | false | false | false |
mganeva/mantid | scripts/SANS/sans/common/configurations.py | 1 | 1321 | # 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 +
""" The SANSConfigurations class holds instru... | gpl-3.0 | 1,857,660,004,533,276,400 | 34.702703 | 117 | 0.688115 | false | 3.65928 | false | false | false |
sawdog/OraclePyDoc | oraclepydoc/oraschemasql.py | 1 | 12170 | """ Oracle catalog queries """
class OracleCatalogStatement:
def __init__(self, userSql='', ownerSql='', ownerColumn='owner'):
self._userSql = userSql
self._ownerSql = ownerSql
self._ownerColumn = ownerColumn
def userSql(self):
return self._userSql
def ownerSql(self, inC... | gpl-2.0 | 2,138,350,719,873,260,500 | 49.920502 | 143 | 0.505916 | false | 4.98158 | false | false | false |
jomoore/threepins | puzzle/admin.py | 1 | 4020 | """
Admin views for loading and editing puzzles.
Puzzles and blank grids are viewed as whole units using inline
elements. Some extra fields are added to upload XML and ipuz files
instead of relying on manual data entry.
"""
import json
from xml.etree import ElementTree
from django.contrib import admin
from django.db.... | mit | 8,092,349,561,535,401,000 | 36.570093 | 93 | 0.614179 | false | 3.56383 | false | false | false |
ayepezv/GAD_ERP | addons/lunch/models/lunch.py | 1 | 13268 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
from odoo import api, fields, models, _
from odoo.exceptions import AccessError, ValidationError
import odoo.addons.decimal_precision as dp
class LunchOrder(models.Model):
"""
A lunch order con... | gpl-3.0 | 2,116,819,551,086,005,000 | 43.226667 | 153 | 0.579891 | false | 3.945287 | false | false | false |
juice-ryang/online-judge | OnlineJudgeServer/db.py | 1 | 2516 | from datetime import datetime
from enum import Enum
from json import dumps
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy_utils import ChoiceType as EnumType
db = SQLAlchemy()
class JudgeStatus(Enum):
PENDING = 0
STARTED = 1
FAILED = 2
FINISHED = 3
class JudgeFeedback(db.Model):
_... | gpl-3.0 | 3,522,701,366,097,554,400 | 30.45 | 78 | 0.569952 | false | 3.955975 | false | false | false |
perkinslr/pypyjs | addedLibraries/twisted/internet/tcp.py | 1 | 42288 | # -*- test-case-name: twisted.test.test_tcp -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Various asynchronous TCP/IP classes.
End users shouldn't use this module directly - use the reactor APIs instead.
"""
from __future__ import division, absolute_import
# System Imports
import t... | mit | 7,567,373,965,345,442,000 | 34.77665 | 108 | 0.623558 | false | 4.399501 | false | false | false |
kantanand/insmartapps | server/learning/login/middleware.py | 1 | 2274 | # -*- coding: UTF-8 -*-
# django dependencies
from django.contrib.auth.views import redirect_to_login
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.conf import settings
# from reia import settings
# python dependencies
from re import compile
#---#
EXEMPT_URLS = [compile(settings.LOGIN_URL.lstrip('... | mit | -4,536,369,468,620,033,500 | 36.278689 | 87 | 0.647318 | false | 4.067979 | false | false | false |
gauteh/ibcao_py | ibcao/tests/test_depth_map.py | 1 | 1262 | # encoding: utf-8
import common
from common import outdir, TRAVIS
import logging as ll
import unittest as ut
from ibcao import *
import cartopy.crs as ccrs
import matplotlib
import matplotlib.pyplot as plt
import os
import os.path
class IbcaoDepthTest (ut.TestCase):
def setUp (self):
self.i = IBCAO ()
def... | lgpl-3.0 | 3,748,618,860,672,520,700 | 19.688525 | 88 | 0.604596 | false | 3.040964 | false | false | false |
svk/harmless7drl | vision.py | 1 | 5614 | # Spiral FOV is my pet FOV algorithm. However, I always struggle
# with it for 7DRLs -- it's become a tradition. Let's see how I
# do this year. Starting 1847.
# Angles are measured such that 1.0 is one full circle. This is
# convenient to work with angles without many floating-point
# hassles.
from math import atan2... | mit | -1,536,654,225,603,476,200 | 32.616766 | 78 | 0.498041 | false | 3.34565 | false | false | false |
nilbody/h2o-3 | h2o-py/tests/testdir_misc/pyunit_metric_json_check.py | 1 | 10652 | import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
# The purpose of this test is to detect a change in the _metric_json of MetricsBase objects. Many of the metric
# accessors require _metric_json to have a particular form.
def metric_json_check():
df = h2o.import_file(path=py... | apache-2.0 | 888,273,760,287,390,600 | 56.268817 | 120 | 0.393166 | false | 4.833031 | false | false | false |
cloudbase/coriolis | coriolis/api/v1/router.py | 1 | 9217 | # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
from oslo_log import log as logging
from coriolis import api
from coriolis.api.v1 import diagnostics
from coriolis.api.v1 import endpoint_actions
from coriolis.api.v1 import endpoint_destination_minion_pool_options
from coriolis.api.v1 import endpoint_de... | agpl-3.0 | -7,495,811,954,175,948,000 | 44.855721 | 82 | 0.592709 | false | 4.76577 | false | false | false |
Bachmann1234/journaler | journaler/models.py | 1 | 2071 | from collections import namedtuple
import json
import datetime
from pytz import utc
DATETIME_FORMAT = "%m-%d-%YT%H:%M:%S.%fZ"
"""
Stores a line of the food log
:type date UTC datetime
:type mood_rating int from 1 to 5 about your general mood
1 - Poor, 5 - Great
:type food_rating int from 1 to 5 about the food
... | apache-2.0 | 2,955,659,030,745,636,400 | 25.551282 | 104 | 0.618059 | false | 3.266562 | false | false | false |
MissionCriticalCloud/marvin | marvin/cloudstackAPI/createLoadBalancerRule.py | 1 | 6741 | """Creates a load balancer rule"""
from baseCmd import *
from baseResponse import *
class createLoadBalancerRuleCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""load balancer algorithm (source, roundrobin, leastconn)"""
"""Required"""
self.algorithm = ... | apache-2.0 | -2,408,419,068,455,296,000 | 41.664557 | 276 | 0.602285 | false | 4.340631 | false | false | false |
rofferom/gpstracker-android | tools/location.py | 1 | 1454 | import re
import datetime
import math
from collections import namedtuple
Location = namedtuple('Location', ['ts', 'date', 'lat', 'lon', 'accuracy', 'speed'])
def convertStrFloat(s):
return float(s.replace(',', '.'))
def formatTimezone(timezone):
if timezone == 0:
strTimezone = "GMT"
else:
if timezone > 0:
... | gpl-2.0 | -7,233,229,814,435,216,000 | 23.644068 | 153 | 0.649243 | false | 2.919679 | false | false | false |
LHEEA/meshmagick | meshmagick/densities.py | 1 | 1669 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Module to retrieve some densities of different mediums"""
_DENSITIES = {'CONCRETE': 2300.,
'REINFORCED_CONCRETE': 2400.,
'FRESH_WATER': 1000.,
'SALT_WATER': 1025.,
'SAND': 1600.,
'STEEL': 7850.,
... | gpl-3.0 | 938,801,555,605,954,600 | 21.554054 | 87 | 0.461354 | false | 3.247082 | false | false | false |
vesellov/visio2python | data2js.py | 1 | 25682 | #!/usr/bin/python
#data2js.py
#
#
# <<<COPYRIGHT>>>
#
#
#
#
import os
import sys
import re
import string
import pprint
def main():
d = {}
page = ''
link_id = ''
for line in open(sys.argv[1]).read().splitlines():
line = line.strip()
if line == '':
... | lgpl-3.0 | 1,833,742,733,765,269,500 | 44.95064 | 195 | 0.327116 | false | 4.555161 | false | false | false |
mittagessen/kraken | kraken/lib/codec.py | 1 | 8972 | # -*- coding: utf-8 -*-
#
# Copyright 2017 Benjamin Kiessling
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 | -5,360,282,497,666,862,000 | 39.233184 | 122 | 0.592399 | false | 3.902566 | false | false | false |
quanzhuo/scripts | dropbox_parser.py | 1 | 8246 | #!/usr/bin/env python3
"""A simple dropbox parser
This is a simple tool that can parse errors in android dropbox and
print errors on stardand output, The errors are stored in a global
dict variable named "result".
"""
import os
import sys
import re
import gzip
import shutil
import time
from datetime import datetime... | apache-2.0 | -6,668,455,114,190,119,000 | 29.094891 | 78 | 0.5878 | false | 3.352033 | false | false | false |
vollov/python-test | tests/unit/utils/test_instance_manager.py | 1 | 2378 | '''
this file demo how to manage instances
'''
import logging, unittest
logger=logging.getLogger('pytest')
class A(object):
conn='shared connection here'
def foo(self,x):
logger.debug('instance method call conn:' + self.conn)
print "executing foo(%s,%s)"%(self,x)
@classmethod
def... | mit | -3,240,063,045,336,426,500 | 22.544554 | 74 | 0.563078 | false | 3.647239 | true | false | false |
nickpack/reportlab | docs/genAll.py | 1 | 1540 | #!/bin/env python
import os, sys, traceback
def _genAll(verbose=1):
from reportlab.lib.testutils import setOutDir
setOutDir(__name__)
from reportlab.lib.testutils import testsFolder
topDir=os.path.dirname(testsFolder)
L = [os.path.join(topDir,f) for f in (
'docs/reference/genrefe... | bsd-3-clause | 2,471,236,109,906,953,700 | 31.478261 | 97 | 0.527273 | false | 3.414634 | false | false | false |
google/matched_markets | matched_markets/tests/test_data_simulator.py | 1 | 5955 | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | apache-2.0 | 4,039,507,994,984,469,500 | 32.083333 | 87 | 0.488329 | false | 4.375459 | true | false | false |
nelisky/py-stellar-base | stellar_base/memo.py | 1 | 1934 | # coding: utf-8
from .utils import XdrLengthError
from .stellarxdr import StellarXDR_pack as Xdr
# Compatibility for Python 3.x that don't have unicode type
try:
type(unicode)
except NameError:
unicode = str
class NoneMemo(object):
def __init__(self):
pass
def to_xdr_object(self):
ret... | apache-2.0 | -5,554,082,174,817,244,000 | 31.233333 | 113 | 0.638573 | false | 3.289116 | false | false | false |
jimy-byerley/Tron-R-reboot-reloaded- | shaders/arena_landing_zone.py | 1 | 2482 | from bge import logic as g
from bge import texture
from mathutils import *
from math import *
import bgl
cont = g.getCurrentController()
own = cont.owner
scene = g.getCurrentScene()
objlist = scene.objects
reflsize = 512 #reflection tex dimensions
refrsize = 512 #refraction tex dimensions
offset = 200.0 #geometry cli... | gpl-3.0 | -2,783,831,889,813,963,300 | 28.2 | 95 | 0.756245 | false | 2.823663 | false | false | false |
mit-dci/lit | test/testutil.py | 1 | 1359 | #!/usr/bin/env python3
# Copyright (c) 2018 The lit developers
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
"""Utils for lit testing"""
import time
import logging
import socket
logger = logging.getLogger("testframework")
def a... | mit | 6,088,042,509,442,119,000 | 28.543478 | 98 | 0.637969 | false | 3.713115 | false | false | false |
WeblateOrg/weblate | weblate/trans/migrations/0116_migrate_glossaries.py | 1 | 7111 | # Generated by Django 3.1.4 on 2021-02-01 14:12
import os
from django.conf import settings
from django.db import migrations
from django.utils.text import slugify
from translate.misc.xml_helpers import valid_chars_only
from weblate.formats.ttkit import TBXFormat
from weblate.utils.hash import calculate_hash
from webl... | gpl-3.0 | 6,813,968,418,671,555,000 | 36.230366 | 89 | 0.513992 | false | 4.599612 | false | false | false |
slgobinath/SafeEyes | safeeyes/plugins/mediacontrol/plugin.py | 1 | 2495 | #!/usr/bin/env python
# Safe Eyes is a utility to remind you to take break frequently
# to protect your eyes from eye strain.
# Copyright (C) 2019 Gobinath
# 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... | gpl-3.0 | -5,804,036,733,867,874,000 | 30.987179 | 98 | 0.668537 | false | 3.966614 | false | false | false |
robmcmullen/peppy | peppy/editra/ed_style.py | 1 | 34887 | ###############################################################################
# Name: ed_style.py #
# Purpose: Editra's style management system. Implements the interpretation of #
# Editra Style Sheets to the StyledTextCtrl. #
... | gpl-2.0 | 6,960,751,333,073,037,000 | 38.198876 | 88 | 0.539857 | false | 4.191638 | false | false | false |
oser-cs/oser-website | core/management/commands/utils.py | 1 | 4368 | """Utils for populatedb."""
import os
import re
import string
from itertools import cycle
from contextlib import contextmanager
from django.core.files import File
from django.db.models.base import ModelBase
from factory.base import FactoryMetaClass
HERE = os.path.dirname(os.path.abspath(__file__))
def format_keys(... | gpl-3.0 | 1,531,607,801,651,571,700 | 28.714286 | 78 | 0.57967 | false | 4.265625 | false | false | false |
mysql/mysql-utilities | scripts/mysqlrplms.py | 1 | 15549 | #!/usr/bin/env python
#
# Copyright (c) 2014, 2016 Oracle and/or its affiliates. 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; version 2 of the License.
#
# This program... | gpl-2.0 | -7,878,587,118,950,629,000 | 39.282383 | 79 | 0.592707 | false | 4.185464 | true | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.