repo_name stringlengths 6 61 | path stringlengths 4 230 | copies stringlengths 1 3 | size stringlengths 4 6 | text stringlengths 1.01k 850k | license stringclasses 15
values | hash int64 -9,220,477,234,079,998,000 9,219,060,020B | line_mean float64 11.6 96.6 | line_max int64 32 939 | alpha_frac float64 0.26 0.9 | autogenerated bool 1
class | ratio float64 1.62 6.1 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mlcommons/training | language_model/tensorflow/bert/cleanup_scripts/pick_eval_samples.py | 1 | 3819 | """Script for picking certain number of sampels.
"""
import argparse
import time
import logging
import collections
import tensorflow as tf
parser = argparse.ArgumentParser(
description="Eval sample picker for BERT.")
parser.add_argument(
'--input_tfrecord',
type=str,
default='',
help='Input tfreco... | apache-2.0 | -7,561,222,218,181,708,000 | 29.552 | 79 | 0.66431 | false | 3.481313 | false | false | false |
KhronosGroup/COLLADA-CTS | StandardDataSets/collada/library_visual_scenes/visual_scene/asset/created/created/created.py | 2 | 5414 |
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ... | mit | -7,654,057,124,771,957,000 | 49.609524 | 466 | 0.693572 | false | 4.246275 | false | false | false |
jeffh/rpi_courses | rpi_courses/scheduler.py | 1 | 5690 | from pyconstraints import Problem, is_nil, BruteForceSolver
__all__ = ['compute_schedules', 'TimeRange', 'Scheduler']
class TimeRange(object):
"Represents a time range to be restricted."
def __init__(self, start, end, dow):
self.start = start
self.end = end
self.days_of_week = dow
... | mit | -3,827,083,058,477,227,000 | 35.948052 | 143 | 0.614411 | false | 4.310606 | false | false | false |
urinieto/msaf-gpl | setup.py | 1 | 4267 | from setuptools import setup, Extension, find_packages
import glob
import imp
import sys
import numpy.distutils.misc_util
version = imp.load_source('msaf.version', 'msaf/version.py')
# Compile the CC algorithm
extra_compile_flags = ""
extra_linker_flags = ""
if "linux" in sys.platform:
extra_compile_flags = "-std... | gpl-2.0 | 6,130,109,003,087,455,000 | 40.833333 | 88 | 0.511366 | false | 3.98041 | false | false | false |
misan/RepRap-iTopie | odmt/ezdxf/entity.py | 3 | 7057 | # Purpose: entity module
# Created: 11.03.2011
# Copyright (C) 2011, Manfred Moitzi
# License: MIT License
from __future__ import unicode_literals
__author__ = "mozman <mozman@gmx.at>"
from .tags import cast_tag_value, DXFTag, DXFStructureError
class DXFNamespace(object):
""" Provides the dxf namespace for Gene... | gpl-3.0 | 8,453,596,017,149,558,000 | 32.76555 | 119 | 0.582117 | false | 3.671696 | false | false | false |
DropMuse/DropMuse | app/recommendation.py | 1 | 8083 | from lightfm import LightFM
import pickle
import db_utils
import scipy
import numpy as np
import numpy.linalg as la
from nltk.tokenize import RegexpTokenizer
from nltk.corpus import stopwords
regex_tokenizer = RegexpTokenizer(r'\w+')
eng_stopwords = stopwords.words('english')
NUM_COMPONENTS = 30
NUM_EPOCHS = 20
MODEL... | mit | 1,937,414,757,606,261,200 | 30.574219 | 77 | 0.610046 | false | 3.340083 | false | false | false |
mioann47/mobile-app-privacy-analyzer | mypythonscripts/AndroBugs_Framework-master/tools/modified/androguard/decompiler/dad/decompile.py | 7 | 17351 | # This file is part of Androguard.
#
# Copyright (c) 2012 Geoffroy Gueguen <geoffroy.gueguen@gmail.com>
# 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://... | gpl-3.0 | -4,954,932,580,214,477,000 | 36.154176 | 94 | 0.55674 | false | 3.955095 | false | false | false |
caveman-dick/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_nacl.py | 29 | 19862 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterf... | gpl-3.0 | 886,884,641,792,100,200 | 33.602787 | 126 | 0.627127 | false | 3.643735 | false | false | false |
neuromat/nira | scientific_mission/forms.py | 1 | 4327 | # -*- coding: utf-8 -*-
from cities_light.models import City
from configuration.models import ProcessNumber, PrincipalInvestigator
from dal import autocomplete
from .models import ScientificMission, Route
from django import forms
from django.utils.translation import ugettext_lazy as _
from person.models import Person
... | mpl-2.0 | 8,598,163,446,868,805,000 | 33.325397 | 119 | 0.621734 | false | 4.061033 | false | false | false |
Sorsly/subtle | google-cloud-sdk/lib/surface/deployment_manager/type_providers/create.py | 3 | 3619 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | mit | -8,182,365,602,064,727,000 | 35.19 | 134 | 0.700193 | false | 4.293001 | false | false | false |
datahuborg/datahub | src/inventory/models.py | 2 | 4354 | from django.conf import settings
from django.db import models
from django.db.utils import IntegrityError
class DataHubLegacyUser(models.Model):
"""DataHub's old User model. Replaced by the Django User model."""
id = models.AutoField(primary_key=True)
email = models.CharField(max_length=100, unique=True)
... | mit | 5,546,509,452,174,952,000 | 32.236641 | 76 | 0.634819 | false | 3.640468 | false | false | false |
bpatyi/simpleCRM | crm/migrations/0005_auto_20161023_1605.py | 1 | 4426 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-23 16:05
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('crm', '0004_auto_20161023_1143'),
]
operations = [
migrations.RenameField(
... | mit | -7,381,797,444,684,891,000 | 32.278195 | 64 | 0.553999 | false | 4.663857 | false | false | false |
megasan/210-CT | coursework 9.py | 1 | 1511 | """ Adapt the binary search algorithm so that instead of outputting whether a specific value was found, it outputs whether a value within an interval (specified by you) was found. Write the pseudocode and code and give the time complexity of the algorithm using the Big O notation."""
def bina... | mit | -8,335,320,677,247,389,000 | 33.97619 | 310 | 0.619457 | false | 4.22067 | false | false | false |
horoshenkih/rgg | generate-hrg.py | 1 | 1095 | #!/usr/bin/python
import sys
from argparse import ArgumentParser
from collections import Counter
import matplotlib.pyplot as plt
from lib.graph import HypRG
def main():
parser = ArgumentParser(description='Emulate hyperbolic random graph', epilog='Returns only edges (without isolated vertices!)')
parser.add... | mit | 67,064,435,395,282,450 | 27.076923 | 132 | 0.610046 | false | 3.318182 | false | false | false |
ircwaves/gips | gips/inventory/__init__.py | 1 | 16895 | #!/usr/bin/env python
################################################################################
# GIPS: Geospatial Image Processing System
#
# AUTHOR: Matthew Hanson
# EMAIL: matt.a.hanson@gmail.com
#
# Copyright (C) 2014-2018 Applied Geosolutions
#
# This program is free software; you can redist... | gpl-2.0 | 829,240,851,418,279,600 | 41.664141 | 113 | 0.576088 | false | 4.067164 | false | false | false |
tonghuashuai/42qu-notepad | lib/txt.py | 1 | 1143 | #coding:utf-8
def cnenlen(s):
if type(s) is str:
s = s.decode('utf-8', 'ignore')
return len(s.encode('gb18030', 'ignore')) // 2
def cnencut(s, length):
ts = type(s)
if ts is str:
s = s.decode('utf-8', 'ignore')
s = s.encode('gb18030', 'ignore')[:length*2].decode('gb18030', 'ignore'... | mit | -5,451,762,747,738,168,000 | 22.326531 | 76 | 0.488189 | false | 3.048 | false | false | false |
roman-kachanovsky/cmd.fm-python | commands/play.py | 1 | 2267 | from __future__ import unicode_literals, absolute_import
import random
import time
from .base import Command
from utils.colorize import colorize, Colors
from player.player import Player
class Play(Command):
name = 'play'
pattern = 'play {genre}'
example = ('play chillout', 'p jazz',)
description = '... | bsd-3-clause | -1,280,759,512,750,446,800 | 34.421875 | 115 | 0.591972 | false | 3.816498 | false | false | false |
geniusproject/ramses | ramses/registry.py | 5 | 2063 | """
Naive registry that is just a subclass of a python dictionary.
It is meant to be used to store objects and retrieve them when needed.
The registry is recreated on each app launch and is best suited to store some
dynamic or short-term data.
Storing an object should be performed by using the `add` function, and
retr... | apache-2.0 | -1,219,513,007,815,364,400 | 20.268041 | 77 | 0.632574 | false | 3.922053 | false | false | false |
huggingface/transformers | examples/research_projects/distillation/utils.py | 2 | 4280 | # coding=utf-8
# Copyright 2019-present, the HuggingFace Inc. team and Facebook, 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
#
# Un... | apache-2.0 | 6,582,052,665,545,975,000 | 31.180451 | 90 | 0.628505 | false | 3.404932 | false | false | false |
ngageoint/scale | scale/storage/delete_files_job.py | 1 | 1370 | """Defines the functions necessary to delete a file from a workspace"""
from __future__ import unicode_literals
import logging
import os
import sys
from error.exceptions import ScaleError, get_error_by_exception
logger = logging.getLogger(__name__)
GENERAL_FAIL_EXIT_CODE = 1
def delete_files(files, volume_path,... | apache-2.0 | -7,106,730,222,914,185,000 | 29.444444 | 116 | 0.671533 | false | 4.041298 | false | false | false |
fanchao01/spider | mini_spider/scheduler.py | 1 | 3735 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
This module provides classes to manage the threads
Classes:
SpiderThread, spider works in this classes
Scheduler, manage all the threads
Date: 2014/10/29 17:23:06
"""
import os
import logging
import threading
import htmlsaver
import utils
import errors
impor... | gpl-2.0 | 1,711,785,014,132,505,300 | 28.88 | 86 | 0.601874 | false | 4.029126 | false | false | false |
mistercrunch/airflow | airflow/example_dags/example_trigger_controller_dag.py | 5 | 1617 | #
# 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
# "License"); you may not... | apache-2.0 | -1,910,846,741,003,032,300 | 38.439024 | 107 | 0.75201 | false | 3.887019 | false | false | false |
michimussato/pypelyne2 | pypelyne2/payload/rr/7.0.29__installer/files/render_apps/scripts/houdini_render.py | 1 | 3430 | #python
# -*- coding: cp1252 -*-
######################################################################
#
# Royal Render Render script for Houdini
# Author: Royal Render, Holger Schoenberger, Binary Alchemy
# Version v 7.0.11
# Copyright (c) Holger Schoenberger - Binary Alchemy
#
#####################################... | gpl-2.0 | -989,458,583,689,781,900 | 31.056075 | 76 | 0.508163 | false | 3.806881 | false | false | false |
uclmr/inferbeddings | inferbeddings/models/training/corrupt.py | 1 | 2333 | # -*- coding: utf-8 -*-
import abc
import numpy as np
class ACorruptor(metaclass=abc.ABCMeta):
@abc.abstractmethod
def __call__(self, steps, entities):
raise NotImplementedError
class SimpleCorruptor(ACorruptor):
def __init__(self, index_generator=None, candidate_indices=None, corrupt_objects=F... | mit | -7,507,990,518,301,316,000 | 37.883333 | 117 | 0.673382 | false | 4.181004 | false | false | false |
martinjrobins/hobo | pints/_mcmc/_relativistic.py | 1 | 15546 | #
# Relativistic MCMC method
#
# This file is part of PINTS.
# Copyright (c) 2017-2019, University of Oxford.
# For licensing information, see the LICENSE file distributed with the PINTS
# software package.
#
from __future__ import absolute_import, division
from __future__ import print_function, unicode_literals
imp... | bsd-3-clause | 4,326,371,463,587,282,000 | 34.903002 | 79 | 0.580021 | false | 4.026418 | false | false | false |
sputnick-dev/weboob | modules/dresdenwetter/pages.py | 7 | 2368 | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2012 Romain Bignon, Florent Fourcot
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the Licen... | agpl-3.0 | 4,160,871,167,166,075,000 | 33.779412 | 83 | 0.614376 | false | 3.90264 | false | false | false |
ananthonline/grpc | src/python/grpcio/grpc/beta/_stub.py | 10 | 5555 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause | 1,938,392,540,574,530,300 | 34.83871 | 78 | 0.711791 | false | 3.965025 | false | false | false |
hms-dbmi/higlass | scripts/genes_by_popularity.py | 2 | 6935 | import os.path as op
base_dir = '/scr/fluidspace/pkerp/projects/genbank'
from pyspark.sql import *
sqlContext = SQLContext(sc)
# get the gene_id -> pubmed mapping
gene2pubmed = (sc.textFile(op.join(base_dir, "data/gene2pubmed"))
.filter(lambda x: x[0] !== '#')
.map(lambda x: x.split(... | mit | -8,093,512,945,961,685,000 | 42.34375 | 151 | 0.537563 | false | 3.237628 | false | false | false |
trianam/tests | python/vtkFileWrite.py | 2 | 1091 | #!/bin/python
import vtk
import vtk.util.colors
points = vtk.vtkPoints()
points.InsertNextPoint(0, 0, 0)
points.InsertNextPoint(0, 1, 0)
points.InsertNextPoint(1, 0, 0)
points.InsertNextPoint(0, 0, 1)
unstructuredGrid = vtk.vtkUnstructuredGrid()
unstructuredGrid.SetPoints(points)
unstructuredGrid.InsertNextCell(vtk.... | gpl-2.0 | -6,554,544,121,934,885,000 | 23.244444 | 60 | 0.80385 | false | 3.030556 | false | true | false |
ThoughtWorksInc/treadmill | treadmill/cli/show.py | 3 | 5434 | """Manage Treadmill app manifest.
"""
import logging
import urllib.request
import urllib.parse
import urllib.error
import click
from treadmill import cli
from treadmill import restclient
from treadmill import context
_LOGGER = logging.getLogger(__name__)
_STATE_FORMATTER = cli.make_formatter(cli.InstanceStatePret... | apache-2.0 | -5,616,701,384,826,257,000 | 28.058824 | 75 | 0.604343 | false | 3.889764 | false | false | false |
0x1997/webassets | src/webassets/filter/rjsmin/rjsmin.py | 15 | 13044 | #!/usr/bin/env python
# -*- coding: ascii -*-
#
# Copyright 2011
# Andr\xe9 Malo or his licensors, as applicable
#
# 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/... | bsd-2-clause | 1,364,870,503,790,118,100 | 35.847458 | 78 | 0.511116 | false | 3.395991 | false | false | false |
induane/pazar | src/pazar/webapp/migrations/0001_initial.py | 1 | 5684 | # Generated by Django 2.2.1 on 2019-05-08 12:18
from django.conf import settings
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import pazar.utils.html
import pazar.webapp.models.mixins
impor... | gpl-3.0 | 2,336,907,514,226,991,000 | 58.208333 | 329 | 0.614708 | false | 4.232316 | false | false | false |
moagstar/python-uncompyle6 | uncompyle6/parsers/parse15.py | 1 | 1053 | # Copyright (c) 2016 Rocky Bernstein
# Copyright (c) 2000-2002 by hartmut Goebel <hartmut@goebel.noris.de>
from spark_parser import DEFAULT_DEBUG as PARSER_DEFAULT_DEBUG
from uncompyle6.parser import PythonParserSingle
from uncompyle6.parsers.parse21 import Python21Parser
class Python15Parser(Python21Parser):
... | mit | 1,067,095,209,950,221,700 | 28.25 | 70 | 0.68471 | false | 3.581633 | false | false | false |
r-o-b-b-i-e/pootle | pootle/apps/pootle_store/models.py | 1 | 47262 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import datetime
import operator
from hashlib... | gpl-3.0 | 2,638,046,119,793,675,000 | 34.08686 | 83 | 0.583217 | false | 4.111169 | false | false | false |
codesmart-co/bit | bit/migrations/versions/4ad33f99723a_.py | 1 | 2133 | """empty message
Revision ID: 4ad33f99723a
Revises: 743a0a1b5bc9
Create Date: 2017-08-17 14:36:49.229000
"""
# revision identifiers, used by Alembic.
revision = '4ad33f99723a'
down_revision = '743a0a1b5bc9'
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
def upgrade():
# ### commands au... | apache-2.0 | 6,579,955,067,525,217,000 | 43.4375 | 187 | 0.700422 | false | 3.226929 | false | false | false |
bhargavz/py-twitter-sentiment-analysis | data/db/base/friendObj.py | 1 | 1835 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# FILE: friendObj.py
#
# An object that mirrors the friends table in the database
#
# Copyright by Author. All rights reserved. Not for reuse without
# express permissions.
#
#
import copy
class friendObj(object):
def __init__(self):
self.rid = None
... | mit | -2,967,404,588,936,243,000 | 28.596774 | 200 | 0.53951 | false | 3.224956 | false | false | false |
johnmartinsson/bird-species-classification | scripts/split_data.py | 1 | 1398 | import glob
import os
import tqdm
import numpy as np
import shutil
from bird import loader as l
source_dir = "/disk/martinsson-spring17/birdClef2016Subset"
classes = os.listdir(os.path.join(source_dir, "train"))
percentage_validation_sampels = 0.10
progress = tqdm.tqdm(range(len(classes)))
class_segmentss = [(c, glo... | mit | 5,780,680,124,122,952,000 | 35.789474 | 86 | 0.648069 | false | 3.304965 | false | false | false |
MSMBA/msmba-workflow | msmba-workflow/srclib/wax/examples/colored-buttondemo-1.py | 1 | 2145 | # colored-buttondemo-1.py
import sys
sys.path.append("../..")
from wax import *
COLORS = ['orange', 'chartreuse', 'papayawhip', 'dark blue', 'gold',
'red', 'yellow green', 'snow', 'hotpink', 'cadet blue']
# stick a custom event in Button
def MyOnClick(self, event):
print 'U clicked the button with lab... | gpl-2.0 | 1,223,521,510,981,702,100 | 32.515625 | 75 | 0.610723 | false | 3.569052 | false | false | false |
fogbow/fogbow-dashboard | openstack_dashboard/dashboards/fogbow/instance/tabs.py | 1 | 3301 | from django.utils.translation import ugettext_lazy as _
from horizon import tabs
import openstack_dashboard.models as fogbow_models
COMPUTE_TERM = fogbow_models.FogbowConstants.COMPUTE_TERM
STATE_TERM = fogbow_models.FogbowConstants.STATE_TERM
SHH_PUBLIC_KEY_TERM = fogbow_models.FogbowConstants.SHH_PUB... | apache-2.0 | 8,149,906,809,736,603,000 | 40.78481 | 97 | 0.617692 | false | 4.080346 | false | false | false |
joepetrini/bike-counter | webapp/main/logic.py | 1 | 4298 | import random
from datetime import datetime
from django.db import transaction
from django.utils.timezone import now
from .models import *
def csv_for_appt(appt):
out = ''
# Headers
out += "Time,Bike,Direction,"
for m in appt.organization.organizationmetrics_set.all():
out += "%s," % m.metric.n... | mit | 9,043,612,495,408,714,000 | 32.84252 | 178 | 0.577013 | false | 3.657872 | false | false | false |
frascoweb/frasco-tasks | frasco_tasks.py | 1 | 6915 | from frasco import Feature, action, execute_action, command, current_app, import_string, signal, copy_extra_feature_options, has_app_context
from celery import Celery
from celery.bin.worker import worker as celery_worker
from celery.bin.beat import beat as celery_beat
from celery.schedules import crontab
def pack_tas... | mit | 7,540,645,045,358,001,000 | 38.289773 | 140 | 0.597831 | false | 3.935686 | false | false | false |
alorchhota/bioinformatics-algorithms-1 | week9/code/5.LongestSharedSubstring.py | 1 | 6261 | import os
import csv
import sys
import re
import importlib
import networkx as nx
# settings
curDir = 'E:/GitHub/bioinformatics-algorithms-1/week9'
#curDir = 'D:/Copy/Coursera/Bioinformatics Algorithms (part-I)/MyPrograms/week9'
inputFile = './data/5.LongestSharedSubstring-2.txt'
inputFile = 'C:/Users/Ashis/Downloads/d... | gpl-2.0 | -353,684,072,726,431,040 | 31.952632 | 138 | 0.575307 | false | 3.776236 | false | false | false |
chinchliff/autophy | other_scripts/get_family_order_distributions.py | 1 | 2722 | import sys,sqlite3,os
from Bio import SeqIO
if __name__ == "__main__":
if len(sys.argv) != 3:
print "python get_family_order_distributions.py db outfile [working dir]"
sys.exit(0)
conn = sqlite3.connect(sys.argv[1])
c = conn.cursor()
try:
os.chdir(sys.argv[3])
except IndexE... | gpl-3.0 | -8,521,853,416,352,856,000 | 29.58427 | 104 | 0.477223 | false | 3.91092 | false | false | false |
juanjosegzl/learningpygame | bullet.py | 1 | 1307 | import pygame
from os.path import join as path_join
from vector import Vector
from entity import Entity
from constants import COLOR_BLACK
class Bullet(Entity):
""" Make the bullets independant"""
SPEED = 500
IMAGE_FILENAME = path_join('assets', "images", "laser.png")
def __init__(self, world, flip... | gpl-3.0 | 257,684,221,911,288,420 | 33.394737 | 73 | 0.575363 | false | 3.821637 | false | false | false |
google/deepvariant | deepvariant/resources.py | 1 | 5776 | # Copyright 2017 Google LLC. 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 conditions and the fol... | bsd-3-clause | -8,756,887,809,240,900,000 | 33.586826 | 80 | 0.701004 | false | 4.240822 | false | false | false |
leongold/lago | lago/config.py | 1 | 7126 | #
# Copyright 2016 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in th... | gpl-2.0 | 1,298,325,999,725,875,200 | 28.691667 | 81 | 0.60174 | false | 4.164816 | true | false | false |
wesm/statsmodels | scikits/statsmodels/base/wrapper.py | 1 | 2951 | import inspect
import functools
import types
import numpy as np
class ResultsWrapper(object):
"""
Class which wraps a statsmodels estimation Results class and steps in to
reattach metadata to results (if available)
"""
_wrap_attrs = {}
_wrap_methods = {}
def __init__(self, results):
... | bsd-3-clause | -7,016,303,070,008,334,000 | 28.217822 | 76 | 0.604541 | false | 3.66129 | false | false | false |
inuitwallet/NuBippy | encrypt/bip38.py | 1 | 3003 | import hashlib
import binascii
import encrypt.aes as aes
import encrypt.scrypt as scrypt
import num.enc as enc
def encrypt(privK, Baddress, Saddress, passphrase):
"""
BIP0038 private key encryption, Non-EC
"""
# 1. take the first four bytes of SHA256(SHA256(address)) of it. Let's call this "addr... | mit | 267,483,785,632,943,680 | 41.295775 | 139 | 0.708292 | false | 3.366592 | false | false | false |
ryfeus/lambda-packs | Tensorflow_Pandas_Numpy/source3.6/tensorflow/contrib/opt/python/training/nadam_optimizer.py | 57 | 4017 | # Copyright 2015 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 applica... | mit | 7,756,948,106,105,243,000 | 42.193548 | 80 | 0.643266 | false | 3.066412 | false | false | false |
Zaharid/reportengine | src/reportengine/templateparser.py | 1 | 4814 | # -*- coding: utf-8 -*-
"""
Created on Fri Nov 27 14:58:12 2015
@author: zah
"""
import functools
import contextlib
import jinja2
import jinja2.runtime
from jinja2.exceptions import TemplateError
from reportengine.resourcebuilder import ResourceError
class TemplateRecordError(ResourceError, TemplateError): pass
@... | gpl-2.0 | -8,748,257,079,778,189,000 | 34.659259 | 79 | 0.60241 | false | 4.520188 | false | false | false |
kohr-h/odl | examples/solvers/pdhg_denoising_L1_HuberTV.py | 2 | 2689 | """Total variation denoising using PDHG.
This example solves the L1-HuberTV problem
min_{x >= 0} ||x - d||_1
+ lam * sum_i eta_gamma(||grad(x)_i||_2)
where ``grad`` is the spatial gradient and ``d`` is given noisy data. Here
``eta_gamma`` denotes the Huber function. For more details, see the Hube... | mpl-2.0 | 9,206,175,589,211,194,000 | 28.877778 | 79 | 0.671625 | false | 3.001116 | false | false | false |
discos/discos-backend | src/timediscos.py | 1 | 1629 |
#
#
# Copyright 2015 Marco Bartolini, bartolini@ira.inaf.it
#
# 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... | apache-2.0 | 1,550,545,692,869,218,600 | 30.326923 | 76 | 0.667281 | false | 3.436709 | false | false | false |
rcbops/keystone-buildpackage | keystone/backends/ldap/api/user.py | 1 | 4236 | import ldap
import ldap.filter
import keystone.backends.backendutils as utils
from keystone.backends.api import BaseUserAPI
from keystone.backends.sqlalchemy.api.user import UserAPI as SQLUserAPI
from .. import models
from .base import BaseLdapAPI, add_redirects
class UserAPI(BaseLdapAPI, BaseUserAPI):
DEFAULT_... | apache-2.0 | 6,520,816,330,600,987,000 | 34.008264 | 78 | 0.594901 | false | 3.524126 | false | false | false |
Distrotech/scons | test/site_scons/override.py | 3 | 1992 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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 | 8,095,686,159,124,409,000 | 28.294118 | 73 | 0.712851 | false | 3.538188 | true | false | false |
BenjamenMeyer/aiohttp-mock | aiohttp_mock/router.py | 1 | 4282 | # Copyright 2015 by Benjamen R. Meyer
#
# 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 w... | apache-2.0 | -2,916,611,160,968,730,000 | 31.195489 | 78 | 0.613031 | false | 4.516878 | false | false | false |
tartavull/google-cloud-python | core/nox.py | 2 | 3004 | # Copyright 2016 Google 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 agreed to in writing, ... | apache-2.0 | 4,031,518,551,961,741,000 | 28.742574 | 75 | 0.638815 | false | 3.750312 | true | false | false |
hamogu/Cepheids | snapshotprogram/detection.py | 1 | 5252 | import numpy as np
from astropy.table import vstack
from photutils import DAOStarFinder
from astropy.nddata import NDData
from photutils.psf import extract_stars
from astropy.io import fits
from astropy.table import Table
datadir = '/melkor/d1/guenther/downdata/HST/CepMASTfull/'
# I blinked through the images in ds9 ... | mit | -3,056,475,336,787,686,000 | 37.335766 | 112 | 0.581302 | false | 2.935718 | false | false | false |
erudit/zenon | tests/functional/apps/public/journal/test_views.py | 1 | 135649 | from bs4 import BeautifulSoup
from collections import OrderedDict
from lxml import etree as et
import datetime as dt
import io
import os
import pikepdf
import unittest.mock
import subprocess
import itertools
from hashlib import md5
from unittest.mock import PropertyMock
from django.contrib.auth.models import Anonymou... | gpl-3.0 | 6,611,205,042,664,009,000 | 46.901239 | 138 | 0.603824 | false | 3.793905 | true | false | false |
macosforge/ccs-calendarserver | txdav/who/vcard.py | 1 | 13053 | ##
# Copyright (c) 2006-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 | -1,211,219,899,084,550,100 | 36.616715 | 129 | 0.535203 | false | 3.862977 | true | false | false |
ratoaq2/deluge | deluge/ui/console/cmdline/commands/move.py | 1 | 3154 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Nick Lanham <nick@afternight.org>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
from __fu... | gpl-3.0 | 7,143,375,092,837,900,000 | 35.252874 | 119 | 0.54629 | false | 4.064433 | false | false | false |
umitproject/openmonitor-desktop-agent | umit/icm/agent/core/PeerInfo.py | 1 | 4244 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 S2S Network Consultoria e Tecnologia da Informacao LTDA
#
# Author: Zhongjie Wang <wzj401@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
... | gpl-2.0 | -8,304,608,539,564,153,000 | 33.680672 | 102 | 0.53935 | false | 3.739207 | false | false | false |
ducted/duct | duct/sources/linux/sensors.py | 1 | 7282 | """
.. module:: sensors
:platform: unix
:synopsis: Provides checks for system sensors and SMART devices
.. moduleauthor:: Colin Alston <colin@imcol.in>
"""
import os
from zope.interface import implementer
from twisted.internet import defer
from duct.interfaces import IDuctSource
from duct.objects import Sourc... | mit | -3,479,305,473,948,432,400 | 27.896825 | 78 | 0.440538 | false | 4.571249 | false | false | false |
helicontech/zoo | Zoocmd/cmdline/argument_parser.py | 1 | 4696 | # -*- coding: utf-8 -*-
import argparse
"""Description of arguments of command line interface"""
def create_parser():
"""Create command line arguments parser"""
parser = argparse.ArgumentParser(description='Helicon Zoo command line')
# print settings from settings.yaml
parser.add_argument('--get-se... | apache-2.0 | 5,404,428,320,272,622,000 | 40.557522 | 134 | 0.640332 | false | 4.421846 | false | false | false |
lenards/pretty-doge | doge/image.py | 1 | 1650 | """
Magically manipulate and return the doge image.
"""
from math import floor
import numpy as np
from PIL import Image
from colorsys import rgb_to_hls, hls_to_rgb
LIGHT = (172, 143, 239)
DARK = (134, 30, 214)
def scrub_rgb(c):
return (int(floor(c[0] * 255)),
int(floor(c[1] * 255)),
i... | bsd-3-clause | 4,863,042,658,398,833,000 | 26.04918 | 66 | 0.569697 | false | 2.941176 | false | false | false |
datamindedbe/train-occupancy | ingest.py | 1 | 2244 | import argparse
from datetime import datetime, timedelta
import dateutil.relativedelta
from config import CONNECTION_STRING
from ingestion.etl import Etl
from ingestion.ingest import Ingest
CONNECTIONS_URL = 'http://graph.spitsgids.be/connections/?departureTime='
STATIONS_URL = 'https://irail.be/stations/NMBS'
FEEDB... | apache-2.0 | -4,994,390,314,920,525,000 | 39.071429 | 105 | 0.698752 | false | 3.415525 | false | false | false |
OmkarPathak/pygorithm | imgs/test_geometry/test_extrapolated_intersection/af_test_line_line_touching.py | 1 | 1371 | from utils import create_newfig, create_moving_line, create_still_segment, run_or_export
func_code = 'af'
func_name = 'test_line_line_touching'
def setup_fig01():
fig, ax, renderer = create_newfig('{}01'.format(func_code))
create_moving_line(fig, ax, renderer, (1, 3), (2, 3), (3, -3), 'top')
create_still... | mit | 4,029,336,342,482,772,000 | 39.352941 | 88 | 0.603939 | false | 2.747495 | false | false | false |
ezequielpereira/Time-Line | specs/FileTimeline.py | 2 | 5917 | # Copyright (C) 2009, 2010, 2011 Rickard Lindberg, Roger Lindberg
#
# This file is part of Timeline.
#
# Timeline 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... | gpl-3.0 | 8,495,560,757,091,305,000 | 38.446667 | 89 | 0.641541 | false | 3.693508 | true | false | false |
indico/cephalopod | mereswine/cli.py | 1 | 2467 | import click
import logging
import mondrian
from celery.bin.celery import CeleryCommand, command_classes
from flask import current_app
from flask.cli import FlaskGroup, with_appcontext
# XXX: Do not import any mereswine modules here!
# If any import from this module triggers an exception the dev server
# will die whi... | gpl-3.0 | -7,071,746,143,821,515,000 | 25.815217 | 112 | 0.684232 | false | 3.570188 | false | false | false |
malkoto1/just_cook | backend/sources/utils/skeleton.py | 1 | 1144 | __author__ = 'Vojda'
class User:
"""
This is the user class
"""
@classmethod
def from_dict(cls, object_dict):
return User(object_dict['username'], object_dict['password'], object_dict['admin'])
def __init__(self, username, password, admin=False):
self.username = username
... | gpl-2.0 | -8,236,627,754,515,718,000 | 22.367347 | 139 | 0.590909 | false | 4 | false | false | false |
miccrun/brewer | auth/views.py | 1 | 1348 |
from django.contrib.auth import login, logout
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from django.utils.decorators import method_decorator
from django.views.generic import (
FormView,
View,
)
from auth.forms import (
LoginForm,
RegisterFor... | mit | 7,860,899,273,064,127,000 | 23.962963 | 72 | 0.683976 | false | 3.884726 | false | false | false |
dcf21/4most-4gp-scripts | src/helper_code/base_synthesizer.py | 1 | 14736 | # -*- coding: utf-8 -*-
"""
Framework for code to synthesise a library of spectra.
"""
import argparse
import hashlib
import json
import logging
import os
import re
import sqlite3
import time
from os import path as os_path
from fourgp_speclib import SpectrumLibrarySqlite, Spectrum
from fourgp_specsynth import TurboS... | mit | 4,591,461,098,104,170,500 | 49.293515 | 120 | 0.514929 | false | 4.543941 | false | false | false |
binarybin/MPS_Proba | src/projectionboys.py | 1 | 5741 | """
Program name: MPS-Proba
Program purpose: The Alpha version of the APC 524 project.
File name: projectionboys.py
File purpose: the projection boys model
Responsible person: Bin Xu
"""
from numpy import zeros
import numpy as np
from model import Model
class ProjectionBoys(Model):
"""
A probablistic model th... | gpl-2.0 | 312,906,142,778,674,500 | 36.03871 | 189 | 0.503048 | false | 3.150933 | false | false | false |
fabiocaccamo/django-kway | kway/cache.py | 1 | 1533 | # -*- coding: utf-8 -*-
from django.core.cache import get_cache
from kway import settings, utils
def get_value_for_key(key, default_value = None):
cache = get_cache(settings.KWAY_CACHE_NAME)
localized_key = utils.get_localized_key(key)
value = None
if cache:
value... | mit | 5,651,205,504,249,544,000 | 22.6 | 92 | 0.551207 | false | 4.246537 | false | false | false |
pugpe/pugpe | apps/cert/migrations/0002_auto__add_attendee.py | 1 | 5385 | # -*- 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 'Attendee'
db.create_table('cert_attendee', (
('id', self.gf('django.db.models.fi... | mit | -4,034,517,740,122,692,600 | 58.844444 | 170 | 0.551346 | false | 3.693416 | false | false | false |
sevagas/macro_pack | src/modules/excel_dde.py | 1 | 2672 | #!/usr/bin/env python
# encoding: utf-8
# Only enabled on windows
import sys
from collections import OrderedDict
if sys.platform == "win32":
# Download and install pywin32 from https://sourceforge.net/projects/pywin32/files/pywin32/
import win32com.client # @UnresolvedImport
import logging
from modules.excel_... | apache-2.0 | -653,021,444,565,893,400 | 38.308824 | 114 | 0.583832 | false | 4.268371 | false | false | false |
ChimeraCoder/GOctober | july/people/migrations/0008_auto__add_field_project_updated_on.py | 2 | 9706 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from pytz import UTC
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Project.updated_on'
db.add_column(u'people_project', 'updated_on',
self.gf('dj... | mit | 4,708,723,472,445,294,000 | 73.661538 | 187 | 0.541315 | false | 3.604159 | false | false | false |
ODoSE/odose.nl | align_trim_orthologs.py | 1 | 9906 | #!/usr/bin/env python
"""Module to align and trim orthologs after the OrthoMCL step."""
from __future__ import division
from Bio import AlignIO
from shared import create_directory, extract_archive_of_files, create_archive_of_files, parse_options, \
CODON_TABLE_ID
from scatterplot import scatterplot
from versions i... | mit | 1,495,519,883,376,409,900 | 48.283582 | 121 | 0.687967 | false | 3.627243 | false | false | false |
jenholm/MontePy | Sim3.py | 1 | 1660 | #our unit of time here, is going to be
#one minute, and we're going to run for one week
SIM_TIME=7*24*60
DOW=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]
hour_array=["00","01", "02", "03", "04", "05", "06",
"07","08", "09", "10", "11", "12", "13",
"14","15", "16", "17", "18", "19", ... | gpl-3.0 | 4,859,559,912,248,309,000 | 28.740741 | 102 | 0.493976 | false | 3.408624 | false | false | false |
eneldoserrata/marcos_openerp | addons/report_geraldo/lib/geraldo/site/newsite/django_1_0/django/template/defaulttags.py | 9 | 38786 | """Default tags used by the template system, available to all templates."""
import sys
import re
from itertools import cycle as itertools_cycle
try:
reversed
except NameError:
from django.utils.itercompat import reversed # Python 2.3 fallback
from django.template import Node, NodeList, Template, Context, ... | agpl-3.0 | -7,235,047,295,472,682,000 | 33.910891 | 213 | 0.58155 | false | 4.125292 | false | false | false |
gandrewstone/yadog | PyHtmlGen/js.py | 1 | 4604 | import os.path
import os
from document import *
from module import *
def moduledir():
return os.path.dirname(os.path.abspath(__file__))
hidden = Marker("hidden")
# Modules: ( name, marker, [ (marker,[insert before marker,...] ), (marker,...), ...] )
jsm = Marker("js")
# Modules: ( name, marker, [ (marker,[inse... | gpl-3.0 | 6,350,722,387,476,507,000 | 28.139241 | 230 | 0.631842 | false | 3.290922 | false | false | false |
erickeller/edi | edi/commands/lxccommands/importcmd.py | 1 | 3325 | # -*- coding: utf-8 -*-
# Copyright (C) 2016 Matthias Luescher
#
# Authors:
# Matthias Luescher
#
# This file is part of edi.
#
# edi is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of... | lgpl-3.0 | -2,792,770,826,113,229,300 | 31.920792 | 90 | 0.603008 | false | 4.040097 | true | false | false |
tmwbook/nhs-honors-chemistry-2013 | Python/Molarity.py | 1 | 1634 | '''
@author: Thomas
'''
# M = moles solute / liters
def calculateMolarity():
molesSolute = float(raw_input('How many moles of the solute do you have?' ))
litersSolvent = float(raw_input('How many liters of the solvent do you have? '))
return float(molesSolute) / float(litersSolvent)
def calc... | mit | 4,177,069,595,224,972,000 | 29.461538 | 88 | 0.623623 | false | 3.536797 | false | false | false |
fundthmcalculus/propresenter-conversion | directoryconversiongui.py | 1 | 3130 | from tkinter import *
from tkinter import ttk
from tkinter import filedialog
from os.path import expanduser
from propresenterconverter import propresenterconverter
class directoryconversiongui:
def __init__(self):
# Create the gui.
self.window = Tk()
self.window.title("Directory Converter... | mit | -5,231,695,585,284,080,000 | 39.128205 | 120 | 0.600958 | false | 4.173333 | false | false | false |
crmccreary/openerp_server | openerp/addons/l10n_be/company.py | 8 | 1901 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 | -3,675,750,205,088,862,000 | 41.244444 | 79 | 0.559705 | false | 4.233853 | false | false | false |
amirhmoin/recodev | RecoDev-Prototype/extend_data/extend.py | 1 | 1108 | '''
import sys
sys.path.append('..')
'''
from master_utils import *
import numpy as np
import os
import MySQLdb
from lda import LDA
from sklearn.decomposition import LatentDirichletAllocation
import datetime
import lda_t1
class BugEvent:
def __init__(self, start, end, topic, id, final):
self.star... | bsd-3-clause | -4,493,428,429,327,756,300 | 23.622222 | 91 | 0.564079 | false | 3.78157 | false | false | false |
rubenvb/skia | infra/bots/buildstats/make_treemap.py | 11 | 1250 | # Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Creates a .tar.gz file containing an HTML treemap displaying the codesize.
Requires docker to be installed.
Example usage:
python make_treemap... | bsd-3-clause | 3,144,961,997,505,883,600 | 27.409091 | 77 | 0.5928 | false | 3.443526 | false | false | false |
renatahodovan/fuzzinator | tests/call/test_subprocess_call.py | 2 | 1891 | # Copyright (c) 2016-2018 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
import os
import pytest
import sys
import fuzzinator
from common... | bsd-3-clause | 1,759,386,165,031,792,400 | 71.730769 | 246 | 0.638287 | false | 2.904762 | true | false | false |
lehins/django-smartfields | smartfields/processors/video.py | 1 | 1968 | import re
import six
from smartfields.processors.base import ExternalFileProcessor
from smartfields.utils import ProcessingError
from smartfields.processors.mixin import CloudExternalFileProcessorMixin
__all__ = [
'FFMPEGProcessor', 'CloudFFMEGPRocessor'
]
class FFMPEGProcessor(ExternalFileProcessor):
durati... | mit | -6,904,748,000,513,170,000 | 40.020833 | 91 | 0.613313 | false | 3.858824 | false | false | false |
undeadpixel/mallet | scripts/roc_curve.py | 1 | 2248 | #!/usr/bin/env python
import sys, math
# added prent directory to import path
sys.path.append("..")
import mallet.viterbi as viterbi
import mallet.input.sequence_parser as seq_parser
import mallet.input.tgf_parser as tgf_parser
import mallet.safe_math as safe_math
STEPS = 100
def frange(start, end, step):
end ... | mit | -7,365,806,780,185,346,000 | 27.455696 | 102 | 0.63968 | false | 3.005348 | false | false | false |
tatemura/strudel | exp/cluster/bin/tokumx.py | 1 | 1624 | #!/usr/bin/python
#
# python script that deploys and runs tokumx
# arg: hostname (start|stop)
#
# NOTE
# TokuMX will not run with transparent huge pages enabled.
# To disable:
# (echo never > /sys/kernel/mm/transparent_hugepage/enabled)
import subprocess
import os
import sys
import json
import shutil
import re
import ... | apache-2.0 | 8,159,668,917,509,453,000 | 25.622951 | 93 | 0.592365 | false | 3.178082 | false | false | false |
jteehan/cfme_tests | cfme/tests/configure/test_access_control.py | 1 | 29148 | # -*- coding: utf-8 -*-
import fauxfactory
import pytest
import traceback
from cfme.configure.access_control import User, Group, Role, Tenant, Project
from utils import error
import cfme.fixtures.pytest_selenium as sel
from cfme import test_requirements
from cfme.base.credential import Credential
from cfme.automate.ex... | gpl-2.0 | -3,983,837,271,983,107,600 | 32.273973 | 99 | 0.628619 | false | 3.800261 | true | false | false |
Nexenta/lfs | setup.py | 1 | 1495 | #!/usr/bin/python
# Copyright 2011-2012 Nexenta 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 applicabl... | apache-2.0 | -4,710,356,204,277,387,000 | 30.145833 | 69 | 0.665552 | false | 3.813776 | false | false | false |
flomotlik/formica | tests/unit/test_s3.py | 1 | 2780 | from formica.s3 import temporary_bucket
import pytest
from .constants import STACK
@pytest.fixture
def bucket(mocker, boto_resource, boto_client):
return boto_resource.return_value.Bucket
STRING_BODY = "string"
# MD5 hash of body
STRING_KEY = "b45cffe084dd3d20d928bee85e7b0f21"
BINARY_BODY = "binary".encode()
BIN... | mit | -8,662,619,227,889,192,000 | 37.611111 | 160 | 0.721942 | false | 3.169897 | true | false | false |
ryaninhust/Press-Start-Button | tools/cut_edge.py | 1 | 2359 | #!/usr/bin/env python
#encoding: utf-8
import numpy as np
from PIL import Image
def create_data(file):
data_list = []
with open(file, 'r') as f:
for line in f:
line = line.rstrip('\n').split(' ')
feature_dict = {}
for l in line[1:]:
ls = l.split(':'... | mit | 7,847,049,955,560,052,000 | 32.7 | 83 | 0.574396 | false | 3.222678 | false | false | false |
artofhuman/django-clever-pages | page/views.py | 1 | 1468 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import get_object_or_404
from django.views.generic.detail import DetailView
from .models import Page
from meta.views import MetadataMixin
class MetaTagsMexin(MetadataMixin):
""" Mixin for show meta tegs from django-meta """
... | mit | -7,776,898,867,387,568,000 | 26.185185 | 78 | 0.664169 | false | 3.651741 | false | false | false |
bozokyzoltan/Disordered_conformers | disconf/predict/pre.py | 1 | 6087 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created by Zoltan Bozoky on 2014.07.02.
Under GPL licence.
Purpose:
========
Calculate PRE distances.
Note:
=====
The actual pre data is stored as a power of -6 in the bcd file!
"""
# Built-ins
# 3rd party modules
import numpy as np
# Project modules
from disconf... | gpl-2.0 | -1,215,891,602,983,140,600 | 38.525974 | 113 | 0.405126 | false | 4.861821 | false | false | false |
googleads/google-ads-python | google/ads/googleads/v8/errors/types/function_parsing_error.py | 1 | 1516 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 | -208,529,365,072,351,650 | 30.583333 | 74 | 0.682058 | false | 3.947917 | false | false | false |
jigarkb/FullContact | fullcontact.py | 1 | 1560 | import requests
import json
class FullContact(object):
def __init__(self, api_key):
self.api_key = api_key
self.url = url = "https://api.fullcontact.com/v2/person.json"
def get(self, **kwargs):
if 'apiKey' not in kwargs:
kwargs['apiKey'] = self.api_key
r = requests.g... | apache-2.0 | 826,975,456,134,007,600 | 35.27907 | 70 | 0.542949 | false | 3.880597 | false | false | false |
lilsweetcaligula/Online-Judges | leetcode/easy/implement_stack_using_queues/py/solution.py | 1 | 1370 | import collections
class MyStack(object):
def __init__(self):
"""
Initialize your data structure here.
"""
self._queue = collections.deque()
def push(self, x):
"""
Push element x onto stack.
:type x: int
:rtype: void
"""
self._q... | mit | -327,564,662,910,520,800 | 19.147059 | 73 | 0.475182 | false | 4.308176 | false | false | false |
vladimir-ipatov/ganeti | lib/mcpu.py | 1 | 18556 | #
#
# Copyright (C) 2006, 2007, 2011, 2012 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This progr... | gpl-2.0 | 515,231,502,783,152,700 | 29.978297 | 80 | 0.645398 | false | 3.833884 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.