repo_name stringlengths 6 90 | path stringlengths 4 230 | copies stringlengths 1 4 | size stringlengths 4 7 | content stringlengths 734 985k | license stringclasses 15
values | hash int64 -9,223,303,126,770,100,000 9,223,233,360B | line_mean float64 3.79 99.6 | line_max int64 19 999 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 8.06 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
vipmunot/Data-Analysis-using-Python | Kaggle Competitions/Getting started with Kaggle-73.py | 1 | 4368 | ## 2. Looking at the data ##
# We can use the pandas library in python to read in the csv file.
# This creates a pandas dataframe and assigns it to the titanic variable.
titanic = pandas.read_csv("titanic_train.csv")
# Print the first 5 rows of the dataframe.
print(titanic.head(5))
print(titanic.describe())
## 3. Mi... | mit | -5,394,495,463,459,755,000 | 37.324561 | 118 | 0.718407 | false | 3.111111 | true | false | false |
GrognardsFromHell/TemplePlus | tpdatasrc/tpgamefiles/scr/race_utils.py | 1 | 4313 | from __main__ import game
from toee import *
import race_defs
#########################################
# Ability scores
#########################################
def OnGetAbilityScore(attachee, args, evt_obj):
statType = args.get_param(0)
statMod = args.get_param(1)
if attachee.d20_query(Q_Polymorphed):
if (stat... | mit | 2,443,396,031,072,316,000 | 32.176923 | 104 | 0.636216 | false | 2.881096 | false | false | false |
mdavoodi/konkourse-python | account/forms.py | 1 | 6143 | from django import forms
from django.forms import ModelForm
from django.contrib.auth.models import User
from account.models import UserProfile
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.forms import extras
class AccountInitialForm(forms.ModelForm):
password_repeat = forms.CharFiel... | mit | -573,634,236,590,220,700 | 35.349112 | 108 | 0.538499 | false | 4.480671 | false | false | false |
DoomHammer/layerpeeler | layerpeeler/__init__.py | 1 | 9136 | from __future__ import print_function
from docker import Client
from treelib import Node, Tree
import sys
import urwid
class ExampleTreeWidget(urwid.TreeWidget):
__metaclass__ = urwid.MetaSignals
signals = ['remove_image']
def __init__(self, node):
self.__super.__init__(node)
# insert an... | bsd-2-clause | -7,598,857,740,291,292,000 | 34.274131 | 95 | 0.54641 | false | 3.700284 | false | false | false |
JoseALermaIII/python-tutorials | pythontutorials/books/AutomateTheBoringStuff/Ch11/Projects/P3_2048.py | 1 | 2490 | """2048
2048 is a simple game where you combine tiles by sliding them up, down, left, or
right with the arrow keys. You can actually get a fairly high score by repeatedly
sliding in an up, right, down, and left pattern over and over again.
Write a program that will open the game at https://gabrielecirulli.github.io/2... | mit | 7,399,014,100,949,717,000 | 32.2 | 95 | 0.664659 | false | 3.971292 | false | false | false |
vivek-bala/radical.entk | setup.py | 2 | 7121 | #!/usr/bin/env python
__author__ = "Vivek Balasubramanian"
__email__ = "vivek.balasubramanian@rutgers.edu"
__copyright__ = "Copyright 2017, The RADICAL Project at Rutgers"
__license__ = "MIT"
""" Setup script. Used by easy_install and pip. """
import os
import sys
import subprocess
from setuptools imp... | mit | -8,007,724,085,334,041,000 | 33.235577 | 101 | 0.543884 | false | 3.975991 | false | false | false |
knightXun/BabyCare | collector/collector_manager.py | 1 | 1738 | import time
import info.v1.container as v1
import collector.types as types
metricLabelPrefix = "io.cadvisor.metric."
class collectorData(object):
def __init__(self, collectors = None, nextCollectionTime = None):
self.collectors = collectors
self.nextCollectionTime = nextCollectionTime
class Gener... | apache-2.0 | 2,514,304,423,714,819,600 | 29.491228 | 81 | 0.618527 | false | 4.051282 | false | false | false |
fowode/pychess | lib/pychess/widgets/pydock/StarArrowButton.py | 20 | 8101 | from __future__ import absolute_import
from math import ceil as float_ceil
ceil = lambda f: int(float_ceil(f))
import cairo
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GObject
from .OverlayWindow import OverlayWindow
POSITIONS_COUNT = 5
NORTH, EAST, SOUTH, WEST, CENTER = ra... | gpl-3.0 | -7,248,843,441,207,237,000 | 39.505 | 103 | 0.577336 | false | 3.409512 | false | false | false |
chenders/hours | sources/adium.py | 1 | 3340 | import subprocess
import re
import glob
from .base import HoursDataSource
from lxml import etree
from lxml import objectify
from datetime import timedelta
from django.conf import settings
from django.utils.html import escape
from bs4 import BeautifulSoup
from dateutil import parser
from django.utils import timezone
c... | mit | -717,501,770,508,640,100 | 48.850746 | 98 | 0.502395 | false | 4.260204 | false | false | false |
stillinbed/ZenPacks.Enterasys.Resources | ZenPacks/Enterasys/Resources/EtsysStorage.py | 1 | 1220 | from Products.ZenModel.DeviceComponent import DeviceComponent
from Products.ZenModel.ManagedEntity import ManagedEntity
from Products.ZenModel.ZenossSecurity import ZEN_CHANGE_DEVICE
from Products.ZenRelations.RelSchema import ToManyCont, ToOne
class EtsysStorage(DeviceComponent, ManagedEntity):
meta_type = porta... | gpl-2.0 | -6,374,961,781,619,847,000 | 28.756098 | 62 | 0.615574 | false | 3.92283 | false | false | false |
kalantal/s3-tests | s3tests/realistic.py | 14 | 8770 | import hashlib
import random
import string
import struct
import time
import math
import tempfile
import shutil
import os
NANOSECOND = int(1e9)
def generate_file_contents(size):
"""
A helper function to generate binary contents for a given size, and
calculates the md5 hash of the contents appending itsel... | mit | 8,082,312,844,322,675,000 | 30.209964 | 160 | 0.600684 | false | 3.870256 | false | false | false |
awemulya/fieldsight-kobocat | onadata/apps/logger/south_migrations/0041_convert_lng_lat_to_points.py | 13 | 12235 | # -*- coding: utf-8 -*-
from south.v2 import DataMigration
from onadata.apps.logger.models.instance import Instance
from onadata.libs.utils.model_tools import queryset_iterator
class Migration(DataMigration):
def forwards(self, orm):
"Parse all instance to add geoms."
for obj in queryset_iterato... | bsd-2-clause | -2,608,164,450,719,312,400 | 76.929936 | 187 | 0.55096 | false | 3.600647 | false | false | false |
GFZ-Centre-for-Early-Warning/caravan | local_run.py | 1 | 3176 | '''
Wrapper around the caravan core.
1. Reads event info from a pickle file, generated by events_receiver.py
2. Generates a RunInfo a passes it to the caravan_run function
3. Once the simulation is completed, the report is generated an saved in a folder named after the event hash,
so it could retrieved by the web i... | bsd-3-clause | -5,913,779,265,622,080,000 | 27.357143 | 110 | 0.707494 | false | 3.367975 | false | false | false |
FlorentChamault/My_sickbeard | sickbeard/providers/thinkgeek.py | 8 | 9555 | # -*- coding: latin-1 -*-
# Author: Raver2046 <raver2046@gmail.com>
# based on tpi.py
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 S... | gpl-3.0 | 7,990,043,602,925,267,000 | 47.015075 | 169 | 0.581371 | false | 3.841978 | false | false | false |
brechtm/rinohtype | tests_regression/sphinx/test-relativepaths/template/__init__.py | 1 | 1483 | from pathlib import Path
from rinoh import register_template
from rinoh.attribute import OverrideDefault, Var
from rinoh.dimension import CM
from rinoh.image import Image
from rinoh.stylesheets import sphinx_article
from rinoh.template import (DocumentTemplate, ContentsPartTemplate,
PageTem... | agpl-3.0 | 4,615,230,529,580,176,000 | 31.955556 | 75 | 0.731625 | false | 4.119444 | false | false | false |
JensTimmerman/radical.pilot | examples/tutorial/kmeans_seq.py | 1 | 6048 | #!/usr/bin/env python
__copyright__ = "Copyright 2013-2014, http://radical.rutgers.edu"
__license__ = "MIT"
import sys
import radical.pilot as rp
""" DESCRIPTION: A Simple Workload consisting one task of sequential k-means clustering.
"""
# READ: The RADICAL-Pilot documentation:
# http://radicalpilot.readthed... | mit | -8,000,864,166,587,389,000 | 33.959538 | 101 | 0.575397 | false | 4.256158 | false | false | false |
rronen/HAF-score | plotting/plot_2d_mut_scatter.py | 1 | 14570 | #!/usr/bin/env python
''' plotting utility for 2D mutation scatters '''
import sys, os, math, operator, random
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from collections import defaultdict
from matplotlib import rcParams
import brewer2mpl
''' internal imports, parent dir '''
sys.path.inser... | gpl-2.0 | -4,320,878,883,819,346,400 | 41.727273 | 143 | 0.511256 | false | 2.948796 | false | false | false |
njoyard/django-rql-filter | rql_filter/parser/semantics.py | 1 | 1068 | # -*- coding: utf-8 -*-
from django.db.models import Q
class RQLSemantics:
OPERATORS = {
'==': 'eq',
'!=': 'ne',
'=ne=': 'ne',
'<=': 'lte',
'=le=': 'lte',
'<': 'lt',
'=lt=': 'lt',
'>=': 'gte',
'=ge=': 'gte',
'>': 'gt',
'=gt=... | mit | 3,864,936,231,509,938,000 | 19.150943 | 48 | 0.409176 | false | 3.59596 | false | false | false |
haematologic/cellcountr | cellcounter/main/migrations/0001_initial.py | 2 | 19590 | # -*- 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 'CellCountInstance'
db.create_table('main_cellcountinstance', (
('id', self.gf('d... | mit | -2,567,848,476,487,941,600 | 65.410169 | 182 | 0.594946 | false | 3.652125 | false | false | false |
ideaworld/FHIR_Tester | FHIR_Tester_backend/services/genomics_test_generator/type_generator.py | 1 | 5159 | import random
import string
from datetime import datetime, date
import pytz
def random_string_generate(length):
'''
random string generator
@param length: length of the string to be generated, required
@type length: int
@return random string
@rtype str
'''
random.seed(1)
return ''.... | mit | 6,601,524,811,302,159,000 | 24.795 | 100 | 0.595852 | false | 3.896526 | false | false | false |
vollov/ocbl-rest | authentication/models.py | 1 | 2830 | from __future__ import unicode_literals
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, BaseUserManager
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from django.core.mail import send_mail
from datetime import date
cl... | mit | -2,918,532,406,282,788,000 | 35.294872 | 103 | 0.627562 | false | 4.360555 | false | false | false |
stuart-knock/tvb-library | contrib/simulator/models/brunel_wang.py | 1 | 25716 | # -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Scientific Package. This package holds all simulators, and
# analysers necessary to run brain-simulations. You can use it stand alone or
# in conjunction with TheVirtualBrain-Framework Package. See content of the
# documentation-folder for more details. See also http://www... | gpl-2.0 | -8,305,188,751,094,265,000 | 37.264881 | 110 | 0.526795 | false | 3.091368 | false | false | false |
UGA-WSAG/wsextensions | WebServiceToolWorkflow_REST_SOAP/WebServiceTool_input_url_m.py | 1 | 4494 | '''
@author Akshay Choche, Chaitanya Guttula
@see LICENSE (MIT style license file).
'''
import jpype
import logging
import warnings
import os
import sys
import platform
with warnings.catch_warnings():
warnings.simplefilter("ignore")
import commands
import urllib2
'''
Takes the description ... | mit | -6,052,199,608,683,195,000 | 39.486486 | 142 | 0.625278 | false | 3.723281 | false | false | false |
imp/nfstest | baseobj.py | 1 | 15862 | #===============================================================================
# Copyright 2012 NetApp, Inc. All Rights Reserved,
# contribution by Jorge Mora <mora@netapp.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 ... | gpl-2.0 | -6,257,445,698,753,356,000 | 32.045833 | 104 | 0.525785 | false | 4.471948 | false | false | false |
danishabdullah/redis-alchemy | setup.py | 1 | 1326 | from setuptools import setup, find_packages
with open('requirements.txt', 'r') as reqs:
requirements = reqs.readlines()
with open("README.md", 'r') as fyle:
readme = "\n".join(fyle.readlines())
setup(
name="redis_alchemy",
description = "redis_alchemy is a thin wrapper over redis python library"
... | bsd-3-clause | 355,387,483,591,289,200 | 34.864865 | 78 | 0.61463 | false | 3.993976 | false | false | false |
ttadano/alamode | tools/plotdos.py | 1 | 6219 | #!/usr/bin/env python
#
# plotdos.py
#
# Simple script to visualize phonon DOS
#
# Copyright (c) 2014 Terumasa Tadano
#
# This file is distributed under the terms of the MIT license.
# Please see the file 'LICENCE.txt' in the root directory
# or http://opensource.org/licenses/mit-license.php for information.
#
import ... | mit | 179,249,787,459,437,380 | 27.268182 | 128 | 0.562148 | false | 3.307979 | false | false | false |
Kortemme-Lab/klab | klab/gfx/colors.py | 1 | 3032 | #!/usr/bin/python
# encoding: utf-8
"""
colors.py
Color-related functions.
Created by Shane O'Connor 2013
"""
import colorsys
from klab.pymath.discrete import dumb_relative_half_prime
def saturate_hex_color(hexcolor, adjustment = 1.0):
'''Takes in an RGB color in 6-character hexadecimal with an optional preced... | mit | 8,616,011,403,307,969,000 | 48.721311 | 183 | 0.661939 | false | 3.263724 | false | false | false |
jskinn/robot-vision-experiment-framework | metadata/camera_intrinsics.py | 1 | 9708 | # Copyright (c) 2017, John Skinner
import typing
import numpy as np
import util.database_helpers as dh
class CameraIntrinsics:
"""
An object holding all the information about the camera intrinsics for a given image.
"""
__slots__ = ['_width', '_height', '_fx', '_fy', '_cx', '_cy', '_s', '_k1', '_k2',... | bsd-2-clause | -2,403,453,835,844,238,300 | 33.303887 | 111 | 0.535744 | false | 3.949552 | false | false | false |
msteinhoff/foption-bot | src/python/objects/topic.py | 1 | 1508 | '''
Created on 27.01.2012
@author: rack
'''
from sqlalchemy import Column, Integer, DateTime, Text
from sqlalchemy.orm import relationship, backref
from sqlalchemy.schema import ForeignKey
from core.persistence import SqlAlchemyPersistence
class Topic(SqlAlchemyPersistence.Base):
"""
Represent... | mit | 5,041,121,516,653,809,000 | 23.59322 | 76 | 0.568302 | false | 4.053763 | false | false | false |
stefanistrate/kaggle-digit-recognizer | cnn/deeper_main.py | 1 | 4082 | #!/usr/bin/env python
import imgaug.augmenters as iaa
import numpy as np
import os
import pandas as pd
import tensorflow as tf
from deeper_model import model_fn
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_integer(
'training_steps', 5000,
'Number of training steps.')
tf.app.flags.DEFINE_integer(
... | mit | -1,007,390,551,489,556,500 | 32.459016 | 77 | 0.584517 | false | 3.316003 | false | false | false |
juliakreutzer/bandit-neuralmonkey | neuralmonkey/tests/test_model_part.py | 1 | 1749 | #!/usr/bin/env python3.5
"""Test ModelPart class."""
import os
import tempfile
import unittest
import numpy as np
import tensorflow as tf
from neuralmonkey.vocabulary import Vocabulary
from neuralmonkey.encoders.recurrent import SentenceEncoder
class Test(unittest.TestCase):
"""Test capabilities of model part.... | bsd-3-clause | 491,774,032,779,042,800 | 29.155172 | 72 | 0.642081 | false | 3.793926 | true | false | false |
Xustyx/RouteSimulator | route.py | 1 | 1874 | #The MIT License (MIT)
#
#Copyright (c) 2016 Xustyx
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, p... | mit | 1,027,749,456,662,987,000 | 38.893617 | 79 | 0.703842 | false | 4.239819 | false | false | false |
fedora-infra/fmn.sse | setup.py | 1 | 1883 | """ Setup file for fmn.sse """
from setuptools import setup
def get_description():
with open('README.md', 'r') as f:
return ''.join(f.readlines()[2:])
def get_requirements(filename='requirements.txt'):
"""
Get the contents of a file listing the requirements.
:param filename: path to a requi... | gpl-2.0 | 3,367,731,335,764,402,000 | 30.915254 | 85 | 0.613383 | false | 4.111354 | false | false | false |
egolus/NoteOrganiser | setup.py | 2 | 1481 | from distutils.core import setup
from setuptools import find_packages
import os
# Find all packages
PACKAGES = find_packages()
# Platform independent recovery of the home directory. It is always put as
# a hidden folder, '.noteorganiser', in the unix tradition.
MAIN = os.path.join(os.path.expanduser("~"), '.noteorg... | mit | -1,404,988,024,174,000,400 | 35.121951 | 74 | 0.629305 | false | 3.412442 | false | false | false |
ProjectQ-Framework/ProjectQ | projectq/cengines/_cmdmodifier_test.py | 1 | 1744 | # -*- coding: utf-8 -*-
# Copyright 2017 ProjectQ-Framework (www.projectq.ch)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | apache-2.0 | 723,475,163,947,571,100 | 38.636364 | 108 | 0.720757 | false | 3.84141 | false | false | false |
Azure/azure-sdk-for-python | sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/_configuration.py | 1 | 3228 | # 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 | 1,492,696,829,863,221,500 | 47.179104 | 134 | 0.683395 | false | 4.521008 | true | false | false |
areriff/pythonlearncanvas | Mini Challenge/BingoChallenge.py | 1 | 1578 | # # coding=utf-8
# You should create a program to display a bingo board starting with 10 randomly chosen numbers, like this:
#
# Bingo!
# Here's your board:
#
# __ __ __ __ __ __ __ __ __ __
# __ 12 __ __ __ __ __ __ 99 __
# __ __ __ __ __ __ __ __ __ __
# __ __ __ __ __ __ __ __ __ __
# __ __ 56 __ __ __ 87 __ __ __
#... | mit | 4,022,696,087,385,129,000 | 39.307692 | 321 | 0.592875 | false | 3.351812 | false | false | false |
shub0/algorithm-data-structure | python/palindrome_partitioning.py | 1 | 2040 | #! /usr/bin/python
'''
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
For example, given s = "aab",
Return
[
["aa","b"],
["a","a","b"]
]
Additional quesiton:
Return the minimal cut for partition
'''
class Solu... | bsd-3-clause | 125,134,502,195,264,480 | 27.333333 | 96 | 0.530392 | false | 3.585237 | false | false | false |
jakelever/kindred | kindred/manualAnnotation.py | 1 | 3537 | import kindred
from collections import OrderedDict,defaultdict
import six
# Colors to use for output sentences with annotation
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
class RESPON... | mit | 8,378,696,824,409,864,000 | 30.580357 | 388 | 0.722929 | false | 3.394434 | false | false | false |
google/latexify_py | setup.py | 1 | 1671 | # 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 agreed to in writing, ... | apache-2.0 | 7,252,832,417,544,792,000 | 31.134615 | 74 | 0.658887 | false | 3.969121 | false | false | false |
kraj/zephyr | ext/hal/nxp/mcux/scripts/import_mcux_sdk.py | 1 | 3779 | #!/usr/bin/env python3
#
# Copyright (c) 2018, NXP
#
# SPDX-License-Identifier: Apache-2.0
"""Import files from an NXP MCUXpresso SDK archive into Zephyr
The MCUXpresso SDK provides device header files and peripheral drivers for NXP
Kinetis, LPC, and i.MX SoCs. Zephyr drivers for these SoCs are shims that adapt
MCUXp... | apache-2.0 | 3,281,463,942,610,386,400 | 30.756303 | 82 | 0.644615 | false | 3.585389 | false | false | false |
mqingyn/tornetcd | demo/test.py | 1 | 1132 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created by qingyun.meng on 16/1/19.
import time
from tornetcd import Client, EtcdResult
from tornado import ioloop, httpclient, gen, options
from functools import partial
from tornado.gen import sleep
def setUp(self):
self.ioloop = ioloop.IOLoop.instance()
self.... | bsd-3-clause | -8,441,966,229,058,865,000 | 27.3 | 95 | 0.636042 | false | 3.281159 | false | false | false |
jeffmacinnes/pyneal | src/pynealLogger.py | 1 | 2280 | """ Pyneal Logging Module
Tools to set up a logger for a given Pyneal run
"""
# python 2/3 compatibility
from __future__ import print_function
import os
import sys
import logging
def createLogger(log_fName):
""" Generic tool to create a logger with preset formatting.
Log messages will be written to the lo... | mit | 5,643,980,547,604,622 | 33.029851 | 123 | 0.692105 | false | 4.137931 | false | false | false |
doctoryes/project_euler | prob11.py | 1 | 7479 | #!/usr/bin/env python
# -*- coding: latin-1 -*-
# In the 20×20 grid below, four numbers along a diagonal line have been marked in red.
#
# 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08
# 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00
# 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 3... | mit | 6,289,538,956,337,753,000 | 38.363158 | 135 | 0.617596 | false | 3.274518 | false | false | false |
rwl/PyCIM | CIM15/IEC61970/Wires/ReactiveCapabilityCurve.py | 1 | 5822 | # Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... | mit | -6,705,252,714,631,775,000 | 54.447619 | 825 | 0.747166 | false | 4.088483 | false | false | false |
thehub/hubplus | scripts/clean_names_and_tags.py | 1 | 1833 | import ipdb
from apps.plus_tags.models import Tag, tag_add, tag_stop_words
from apps.plus_lib.utils import bad_name, clean_tag, clean_name
from apps.plus_groups.models import TgGroup
from apps.plus_wiki.models import WikiPage
from apps.plus_resources.models import Resource
print "Bad tags"
print tag_stop_words
exit()
... | gpl-3.0 | 5,319,468,710,852,768,000 | 31.732143 | 116 | 0.573923 | false | 3.255773 | false | false | false |
ivanistheone/waiter | runs/serializers.py | 1 | 3645 |
from rest_framework import serializers
from .models import ContentChannel, ContentChannelRun, ChannelRunStage
class ContentChannelSerializer(serializers.ModelSerializer):
channel_id = serializers.UUIDField(format='hex')
class Meta:
model = ContentChannel
fields = ('channel_id', 'name', 'de... | mit | 3,371,928,224,882,106,400 | 34.735294 | 117 | 0.658162 | false | 4.03208 | false | false | false |
enhean/fredist | src/fredist/ppattach.py | 1 | 19559 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Enrique Henestroza Anguiano
#
"""
PP attachment module. Supports calculation of pp subcat and preference scores,
and correction of a predicted parse using a simple score-based model.
"""
import sys
import codecs
import assoc
import cPickle
from dtbutils import... | gpl-3.0 | 2,902,593,237,007,112,000 | 37.730693 | 79 | 0.465208 | false | 3.53625 | false | false | false |
RichardLeeK/MachineLearning | MachineLearning/CBFV/CBFVCV.py | 1 | 2229 | import pickle
import datetime
import ml.shallow_model as sm
import ml.deep_model as dl
import data_gen as dg
import sys
import numpy as np
import threading
parameter_class = 'HRV,SPE,MOR(3)R'
threshold = 1.3
fold = 5
mode = parameter_class + '_' + str(threshold) + '_' + str(fold)
def pos_counter(Y):
cnt = 0
for ... | mit | -8,650,796,737,417,599,000 | 27.576923 | 90 | 0.555406 | false | 2.631641 | true | false | false |
chaitjo/personalized-dialog | build_data.py | 1 | 1047 | import os
import requests
import shutil
def download(url, path, fname):
print('downloading ' + fname)
outfile = os.path.join(path, fname)
with requests.Session() as session:
response = session.get(url, stream=True)
CHUNK_SIZE = 32768
with open(outfile, 'wb') as f:
for c... | mit | 2,267,727,947,111,767 | 30.727273 | 110 | 0.625597 | false | 3.241486 | false | false | false |
kadhikari/navitia | source/jormungandr/jormungandr/scenarios/helpers.py | 3 | 9127 | # Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... | agpl-3.0 | -5,281,232,708,766,701,000 | 37.348739 | 116 | 0.654432 | false | 3.440256 | false | false | false |
theatrus/eve-central.com | lib/dowser/reftree.py | 8 | 5892 |
import gc
import sys
from types import FrameType
class Tree:
def __init__(self, obj):
self.obj = obj
self.filename = sys._getframe().f_code.co_filename
self._ignore = {}
def ignore(self, *objects):
for obj in objects:
self._ignore[id(obj)] = None
... | agpl-3.0 | 4,039,642,370,802,396,700 | 30.010526 | 81 | 0.525458 | false | 3.96234 | false | false | false |
jiaphuan/models | research/deeplab/datasets/remove_gt_colormap.py | 2 | 2641 | # Copyright 2018 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 | -5,425,014,478,964,137,000 | 30.819277 | 80 | 0.655434 | false | 4.159055 | false | false | false |
ddcatgg/dglib | dglib/network/topicclient.py | 1 | 4061 | # -*- coding: gbk -*-
from twisted.internet import reactor, protocol, task
from twisted.protocols.policies import TimeoutMixin
from dglib import tracer
from dglib.thread_safe import Event
from handler.httphandler import HttpHandler
DEBUG = False
class TopicClient(object):
def __init__(self, host, port)... | mit | 8,317,906,290,610,031,000 | 25.255034 | 84 | 0.679882 | false | 2.953455 | false | false | false |
sunu/localshare | utils.py | 1 | 2238 | # -*- coding: utf-8 -*-
from http.server import BaseHTTPRequestHandler
import urllib.request as urllib
import os
import socket
import netifaces
class LocalFileHandler(BaseHTTPRequestHandler):
"""Handler to serve local file."""
def do_GET(self):
# Continue only if the requested file matches the file... | mit | 2,631,423,199,668,850,000 | 28.84 | 85 | 0.61126 | false | 4.098901 | false | false | false |
zydou/open-reid | reid/evaluators.py | 2 | 4419 | from __future__ import print_function, absolute_import
import time
from collections import OrderedDict
import torch
from .evaluation_metrics import cmc, mean_ap
from .feature_extraction import extract_cnn_feature
from .utils.meters import AverageMeter
def extract_features(model, data_loader, print_freq=1, metric=No... | mit | -5,254,849,887,829,396,000 | 35.825 | 76 | 0.559855 | false | 3.360456 | false | false | false |
AstroTech/atlassian-python-api | examples/jira/jira_project_leaders.py | 2 | 1123 | # coding=utf-8
from urllib.parse import quote
from atlassian import Jira
jira = Jira(url="http://localhost:8080", username="admin", password="admin")
EMAIL_SUBJECT = quote("Jira access to project {project_key}")
EMAIL_BODY = quote(
"""I am asking for access to the {project_key} project in Jira.
To give me the a... | apache-2.0 | -7,535,443,019,956,631,000 | 34.09375 | 108 | 0.683882 | false | 3.444785 | false | false | false |
pankajp/pyface | pyface/drop_handler.py | 2 | 1667 | from pyface.i_drop_handler import IDropHandler
from traits.api import Callable, HasTraits, List, provides, Str
@provides(IDropHandler)
class BaseDropHandler(HasTraits):
""" Basic drop handler
"""
### BaseDropHandler interface #############################################
# Returns True if the current ... | bsd-3-clause | 7,103,371,174,849,163,000 | 32.34 | 79 | 0.586083 | false | 4.70904 | false | false | false |
harry0519/nsnqt | nsnqtlib/strategies/privatestrategy.py | 1 | 11881 | # -*- coding:utf-8 -*-
from nsnqtlib.strategies.strategy import basestrategy
import pandas as pd
import tushare as ts
class privatestrategy(basestrategy):
'''
重写买入条件和卖出条件,
'''
def __init__(self,startdate=(2011, 1, 1),enddate=[],emafast=12,emaslow=26,demday=9):
self.pre_MA = False
... | bsd-2-clause | 3,519,500,231,552,236,000 | 35.421538 | 144 | 0.54355 | false | 3.527116 | false | false | false |
acharyaparag/Compiler | dict.py | 1 | 3324 | reservedt = {
'start': 1,
'prog': 2,
'body': 3,
'declpart': 4,
'decllist': 5,
'decllist-': 6,
'declstat': 7,
'declstat-': 8,
'type': 9,
'procpart': 10,
'proclist': 11,
'proc': 12,
'prochead': 13,
'... | apache-2.0 | -8,901,043,000,736,352,000 | 20.171975 | 45 | 0.29272 | false | 3.156695 | false | false | false |
Statoil/libres | python/tests/res/job_queue/test_job_queue_manager.py | 1 | 5961 | from res.job_queue import JobStatusType, Driver,QueueDriverEnum, JobQueue, JobQueueNode, JobQueueManager
from res.enkf import ResConfig
from tests import ResTest
from tests.utils import wait_until
from ecl.util.test import TestAreaContext
import os, stat
from threading import BoundedSemaphore
def dummy_ok_callback(ar... | gpl-3.0 | 8,545,796,549,184,415,000 | 35.796296 | 133 | 0.581782 | false | 3.514741 | true | false | false |
pdelsante/thug | thug/ActiveX/modules/TextStream.py | 1 | 4534 |
import os
import hashlib
import string
import random
import errno
import logging
from thug.Magic.Magic import Magic
log = logging.getLogger("Thug")
class TextStream(object):
def __init__(self):
self.stream = list()
self._Line = 1
self._Column = 1
self._cu... | gpl-2.0 | 6,776,680,722,617,891,000 | 24.908571 | 95 | 0.520071 | false | 4.033808 | false | false | false |
achim1/pmttools | tests/test_characterisitcs.py | 1 | 1132 | import pytest
import numpy as np
from pmttools import characteristics as c
from scipy.constants import elementary_charge as ELEMENTARY_CHARGE
from pyevsel.fitting import Model
def datafactory():
return np.linspace(0,1000, 10000)
def randomdatafactory():
return np.random.normal(3, .2, 10000)
def modelfactor... | gpl-3.0 | 190,900,384,679,782,240 | 24.727273 | 77 | 0.683746 | false | 3.127072 | true | false | false |
lsaffre/lino | lino/mixins/bleached.py | 1 | 6534 | # -*- coding: UTF-8 -*-
# Copyright 2016-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""
Remove all tags except some when saving the content of a
:class:`RichHtmlField <lino.core.fields.RichHtmlField>`.
When copying rich text from other applications into Lino, the text can
contain styles and othe... | bsd-2-clause | -1,091,100,784,810,152,600 | 31.187192 | 79 | 0.61004 | false | 3.710392 | false | false | false |
pombredanne/django-bulbs | tests/sections/test_sections_commands.py | 1 | 2741 | from django.core.management import call_command
from elasticsearch.exceptions import TransportError
from model_mommy import mommy
from bulbs.content.models import Content
from bulbs.sections.models import Section
from bulbs.utils.test import BaseIndexableTestCase
class CommandsTestCase(BaseIndexableTestCase):
de... | mit | 6,115,818,963,232,872,000 | 35.56 | 104 | 0.456768 | false | 4.894643 | true | false | false |
chdb/DhammaMap | app/Libs/passlib/tests/test_win32.py | 6 | 1949 | """tests for passlib.win32 -- (c) Assurance Technologies 2003-2009"""
#=============================================================================
# imports
#=============================================================================
# core
from binascii import hexlify
import warnings
# site
# pkg
from passlib.test... | mit | -4,128,844,265,978,544,000 | 37.215686 | 87 | 0.465367 | false | 4.350446 | true | false | false |
founders4schools/django-surveys | src/surveys/migrations/0001_squashed_0003_auto_20160803_1427.py | 1 | 2766 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.utils.timezone
from django.db import migrations, models
from surveys.settings import surveys_settings
class Migration(migrations.Migration):
replaces = [('surveys', '0001_initial'), ('surveys', '0002_auto_20151218_1000'), ('surveys',... | mit | 840,886,490,961,197,400 | 38.514286 | 124 | 0.560738 | false | 4.349057 | false | false | false |
Southpaw-TACTIC/TACTIC | src/tactic/protocol/api_test.py | 1 | 4779 | #
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permission.
#
#
#
import tacticenv
from pyasm.common import Cont... | epl-1.0 | 6,424,590,456,447,843,000 | 20.922018 | 74 | 0.547813 | false | 3.943069 | true | false | false |
marcstreeter/ChatterBlog | app/shared/Member/models.py | 1 | 3234 | # Built-in
import datetime
import logging
# Module
from app import db
from app.config import config
logger = logging.getLogger(config.root_logger + __name__)
class Member(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(120))
password = db.Column(db.String(100))
#p... | apache-2.0 | 3,901,543,075,130,493,400 | 38.439024 | 276 | 0.661719 | false | 3.85 | false | false | false |
Nic30/hwtLib | hwtLib/types/net/ip.py | 1 | 1291 | from hwt.hdl.types.bits import Bits
from hwt.hdl.types.struct import HStruct
from hwtLib.types.ctypes import uint8_t, uint16_t
IPv4 = 4
IPv6 = 6
IHL_DEFAULT = 5
l4port_t = Bits(16)
ipv4_t = Bits(4 * 8)
ipv6_t = Bits(128)
ipver_t = Bits(4)
class IP_FLAGS():
DONT_FRAGMENT = 0b010
MORE_FRAGMENTS = 0b100
cl... | mit | -1,878,663,169,679,888,400 | 19.492063 | 104 | 0.55306 | false | 2.516569 | false | false | false |
RayleighChen/SummerVac | yang/学习/0719-迭代.py | 1 | 4189 | Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> #ÇÐÆ¬
>>> L=['yhy','xhp','yyl','yrl','cpc']
>>> L
['yhy', 'xhp', 'yyl', 'yrl', 'cpc']
>>> #ÌáȡǰÈý¸öÔªËØ
>>> [L[0],L[1],L[2]]
['yhy', 'xhp', 'yyl']
>>> #... | gpl-2.0 | -538,924,966,293,109,570 | 27.114094 | 390 | 0.533779 | false | 1.797083 | false | false | false |
pyQuest/mount-api | mountapi/core/app.py | 1 | 1026 | from typing import Type
import mountapi.core
from mountapi.core.exceptions import InvalidRunner
from mountapi.core.settings import AbstractSettings
from mountapi.runners import AbstractRunner
from mountapi.schema import AbstractSchema
class Application:
def __init__(self, settings: Type[AbstractSettings], routes... | apache-2.0 | 794,944,331,443,450,000 | 34.37931 | 79 | 0.701754 | false | 4.365957 | false | false | false |
joshisa/taiga-back | taiga/projects/migrations/0009_auto_20141024_1037.py | 29 | 1306 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0008_auto_20141024_1012'),
]
operations = [
migrations.AlterField(
model_name='issuestatus',
... | agpl-3.0 | 5,384,684,512,499,135,000 | 30.853659 | 84 | 0.55513 | false | 4.397306 | false | false | false |
sbywater/django-asana | djasana/migrations/0011_modifies_choices.py | 1 | 1252 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-18 10:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djasana', '0010_short_webhook_secret'),
]
operations = [
migrations.AlterFi... | mit | -1,114,649,347,259,727,100 | 49.08 | 647 | 0.591054 | false | 3.430137 | false | false | false |
JiYouMCC/python-practice | game/flight_rising.py | 1 | 20509 | # -*- coding: utf-8 -*-
from collections import namedtuple
from colour import Color
import datetime
breed_rule_list = {
('Plentiful', 'Plentiful'): (0.5, 0.5),
('Plentiful', 'Common'): (0.7, 0.3),
('Plentiful', 'Uncommon'): (0.85, 0.15),
('Plentiful', 'Limited'): (0.95, 0.05),
('Plentiful', 'Rare')... | mit | -4,967,579,967,976,948,000 | 30.456418 | 152 | 0.552874 | false | 2.597017 | false | false | false |
Greymerk/python-rpg | src/world/terrain/simplex.py | 1 | 18270 | # Copyright (c) 2012 Eliot Eshelman
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in... | gpl-3.0 | 2,641,745,593,274,365,000 | 30.998249 | 87 | 0.596223 | false | 2.320295 | false | false | false |
DolphinDream/sverchok | nodes/solid/make_compound.py | 2 | 3141 |
import bpy
from bpy.props import StringProperty, EnumProperty
from sverchok.node_tree import SverchCustomTreeNode
from sverchok.data_structure import flatten_data, map_recursive, zip_long_repeat, ensure_nesting_level, get_data_nesting_level
from sverchok.utils.curve.core import SvCurve
from sverchok.utils.surface.cor... | gpl-3.0 | -6,698,414,033,697,707,000 | 38.2625 | 126 | 0.618911 | false | 3.533183 | false | false | false |
soul-F/forumdemo | article/views.py | 1 | 2005 | # coding: utf-8
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from django.shortcuts import render_to_response,redirect
from models import Article
from block.views import Demo
from django.contrib.auth.models import User
from django.template.context import RequestContext
f... | gpl-2.0 | 2,184,803,759,291,823,900 | 43.909091 | 104 | 0.678987 | false | 3.827519 | false | false | false |
edgedb/edgedb | edb/edgeql/compiler/setgen.py | 1 | 52040 | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | apache-2.0 | -778,054,161,267,368,100 | 34.425459 | 79 | 0.572636 | false | 3.783076 | false | false | false |
CiscoSystems/horizon | openstack_dashboard/dashboards/project/firewalls/tables.py | 1 | 10559 | # Copyright 2013, Big Switch Networks, 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 applic... | apache-2.0 | -1,772,190,080,196,900,400 | 35.160959 | 78 | 0.572119 | false | 4.487463 | false | false | false |
kigawas/musicbox | NEMbox/const.py | 2 | 1341 | # encoding: UTF-8
# KenHuang: 使配置文件夹符合XDG标准
import os
class Constant(object):
if "XDG_CONFIG_HOME" in os.environ:
conf_dir = os.path.join(os.environ["XDG_CONFIG_HOME"], "netease-musicbox")
else:
conf_dir = os.path.join(os.path.expanduser("~"), ".netease-musicbox")
config_path = os.path.joi... | mit | 1,182,806,116,434,627,000 | 41.612903 | 82 | 0.62377 | false | 2.884279 | false | false | false |
balanced/PyXB | pyxb/utils/domutils.py | 3 | 29686 | # -*- coding: utf-8 -*-
# Copyright 2009-2013, Peter A. Bigot
#
# 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... | apache-2.0 | -1,966,561,453,625,264,400 | 42.400585 | 133 | 0.666307 | false | 4.332458 | false | false | false |
tedlaz/pyted | pykoinoxrista/koinoxrista/pymiles/gui/fields/selector.py | 2 | 1575 | # -*- coding: utf-8 -*-
from checkbox import Checkbox
from date import Date
from date_or_empty import Date_or_empty
from integer import Integer
from integer_spin import Integer_spin
from numeric import Numeric
from numeric_spin import Numeric_spin
from text import Text
from text_button import Text_button
from text_com... | gpl-3.0 | -6,738,539,690,037,145,000 | 27.636364 | 55 | 0.648254 | false | 3.908189 | false | false | false |
sabertazimi/hust-lab | network/sdn/lab4.py | 1 | 1455 | #!/usr/bin/python
from mininet.net import Mininet
from mininet.node import OVSKernelSwitch, RemoteController
from mininet.cli import CLI
from mininet.util import dumpNodeConnections
from mininet.log import setLogLevel
def simpleTest():
"Create and test a simple network"
net = Mininet(controller=RemoteControll... | mit | 7,851,114,870,481,217,000 | 29.3125 | 88 | 0.669416 | false | 2.939394 | false | false | false |
networks-lab/isilib | metaknowledge/bin/metaknowledgeDocsGen.py | 2 | 16396 | #Written by Reid McIlroy-Young for Dr. John McLevey, University of Waterloo 2015
"""This is intended for metaknowledge only and may not work with anything else"""
import inspect
import argparse
import os
import time
import metaknowledge
import metaknowledge.WOS.tagProcessing
import importlib
import re
documentedModul... | gpl-2.0 | 703,039,425,187,570,700 | 40.19598 | 210 | 0.593132 | false | 3.383409 | false | false | false |
sehoonha/optskills | optskills/problems/phase_controller.py | 1 | 3601 | import numpy as np
from sim_problem import SPDController, PDController, JTController
class Phase(object):
def __init__(self, _skel, _target, _terminate, _vfs=None):
self.skel = _skel
self.target = np.array(_target)
self.terminate = _terminate
self.vfs = _vfs if _vfs is not None els... | mit | 6,783,222,780,373,632,000 | 30.043103 | 76 | 0.558734 | false | 3.506329 | false | false | false |
OpenFurry/submitify | submitify/views/notifications.py | 1 | 3048 | from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.shortcuts import (
get_object_or_404,
redirect,
render,
)
from submitify.forms import NotificationForm
from submitify.models import (
Call,
Notification,
Submission,
)
@login_required
def... | mit | 1,411,148,932,406,041,600 | 39.105263 | 78 | 0.621391 | false | 4.360515 | false | false | false |
manahl/PythonTrainingExercises | Intermediate/Generators/Generator.py | 1 | 1262 | #!/usr/bin/env python
"""Create a generator gen_seq() that creates the infinite geometric series:
1, 1/2, 1/4, 1/8...
Write a function first_N(num) that sums the first num values
Write a function until_small(epsilon) that sums the sequence until the
additional term is less than some small value epsilon.
Created on S... | bsd-3-clause | 8,227,984,962,546,700,000 | 20.389831 | 83 | 0.62916 | false | 3.063107 | false | false | false |
jameslivulpi/pythonprograms | triangle1.py | 1 | 4401 | #!/usr/bin/env python3
# James Livulpi
# October 19th 2013
# Triangle program with functions
# SELF EVALUATION
# PROGRAM PRESENTATION
# The header comment at the top contains
# * Your name:yes
# * Date:yes
# * Short specification of the program:
# The comments have correct spelling, gra... | gpl-3.0 | 4,014,181,189,164,046,000 | 35.371901 | 78 | 0.682118 | false | 3.435597 | false | false | false |
foursquare/commons-old | src/python/twitter/pants/tasks/jvm_run.py | 2 | 3424 | # ==================================================================================================
# Copyright 2012 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | apache-2.0 | 155,812,254,989,405,500 | 38.813953 | 100 | 0.619159 | false | 3.804444 | false | false | false |
jmgilman/neolib2 | neolib/user/hooks/UserDetails.py | 1 | 2137 | from neolib.user.hooks.Hook import Hook
from neolib.user.Neopet import Neopet
class UserDetails(Hook):
"""A hook for grabbing the user's neopoints and active pet"""
_log_name = 'neolib.user.hooks.UserDetails'
_paths = {
'nps': '//*[@id="npanchor"]',
'neopet_name': '//*[@id="content"]/tab... | gpl-2.0 | -9,053,353,417,530,015,000 | 37.160714 | 98 | 0.491343 | false | 3.503279 | false | false | false |
mrcaps/rainmon | code/ui/settings.py | 1 | 4680 | #Copyright (c) 2012, Carnegie Mellon University.
#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
# notice, this list of condition... | bsd-3-clause | 4,087,178,295,531,506,700 | 33.411765 | 122 | 0.705342 | false | 3.676355 | false | false | false |
hacklabr/django-discussion | discussion/migrations/0017_auto_20161110_1317.py | 1 | 1039 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('discussion', '0016_auto_20161107_1510'),
... | agpl-3.0 | 6,062,189,480,368,335,000 | 34.827586 | 146 | 0.604427 | false | 4.258197 | false | false | false |
MSusik/invenio | invenio/legacy/bibauthorid/rabbit.py | 3 | 10322 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2011, 2012, 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at yo... | gpl-2.0 | 7,645,950,776,731,821,000 | 43.878261 | 133 | 0.663728 | false | 3.624298 | true | false | false |
google/trax | trax/layers/research/rel_attention.py | 1 | 26455 | # coding=utf-8
# Copyright 2021 The Trax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 | 2,837,871,922,469,217,300 | 37.847283 | 82 | 0.651559 | false | 3.747698 | false | false | false |
mikekestemont/pandora | pandora/utils.py | 1 | 5441 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import codecs
import re
import ConfigParser
def load_annotated_dir(directory='directory', format='.tab', extension='.txt', nb_instances=None,
include_lemma=True, include_morph=True, include_pos=True)... | mit | 8,016,618,309,144,082,000 | 35.516779 | 97 | 0.471788 | false | 4.537948 | true | false | false |
flypy/flypy | flypy/compiler/optimizations/throwing.py | 1 | 1631 | # -*- coding: utf-8 -*-
"""
Rewrite exceptions that are thrown and caught locally to jumps.
"""
from flypy.compiler import excmodel
from pykit.analysis import cfa
from pykit.optimizations import local_exceptions
def rewrite_local_exceptions(func, env):
"""
Rewrite exc_throw(exc) -> jump(handler_block) for s... | bsd-2-clause | 6,874,953,765,339,075,000 | 33 | 77 | 0.601471 | false | 4.047146 | false | false | false |
dholm/voidwalker | voidwalker/backends/gdb/target.py | 1 | 6391 | # (void)walker GDB backend
# Copyright (C) 2012-2013 David Holm <dholmster@gmail.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any ... | gpl-3.0 | -7,539,885,543,053,625,000 | 34.904494 | 78 | 0.572524 | false | 4.047498 | false | false | false |
openSUSE/osc | osc/cmdln.py | 3 | 57515 | # Copyright (c) 2002-2005 ActiveState Corp.
# License: MIT (see LICENSE.txt for license details)
# Author: Trent Mick (TrentM@ActiveState.com)
# Home: http://trentm.com/projects/cmdln/
from __future__ import print_function
"""An improvement on Python's standard cmd.py module.
As with cmd.py, this module provides... | gpl-2.0 | 4,479,572,029,144,081,000 | 34.768035 | 159 | 0.535773 | false | 4.081104 | false | false | false |
NYU-CAL/Disco | Python/magnetosonicwaveAnalysis.py | 1 | 6707 | import sys
import math
import numpy as np
import matplotlib.pyplot as plt
import discopy.util as util
import discopy.geom as geom
import discopy.calc as ca
def rhoProf(x, a, x0, L, rho0):
rho = np.empty(x.shape)
rho[:] = rho0
inn = np.fabs(x-x0) < L
xin = x[inn]
f = 1.0 - (xin-x0)*(xin-x0)/(L*L)
... | gpl-3.0 | 7,443,595,011,334,220,000 | 28.034632 | 78 | 0.52557 | false | 2.377526 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.