repo_name stringlengths 5 92 | path stringlengths 4 221 | copies stringclasses 19
values | size stringlengths 4 6 | content stringlengths 766 896k | license stringclasses 15
values | hash int64 -9,223,277,421,539,062,000 9,223,102,107B | line_mean float64 6.51 99.9 | line_max int64 32 997 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 13.6 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ssdi-drive/nuxeo-drive | nuxeo-drive-client/nxdrive/engine/next/engine_next.py | 1 | 1582 | # coding: utf-8
""" Evolution to try new engine solution. """
from nxdrive.client.remote_document_client import RemoteDocumentClient
from nxdrive.client.remote_file_system_client import RemoteFileSystemClient
from nxdrive.client.remote_filtered_file_system_client import \
RemoteFilteredFileSystemClient
from nxdriv... | lgpl-2.1 | 5,264,211,132,705,381,000 | 41.756757 | 104 | 0.721871 | false | 3.945137 | false | false | false |
AmI-2015/python-intermediate | metrics.py | 1 | 2662 | '''
Created on Mar 19, 2014
@author: Dario Bonino <dario.bonino@gmail.com>
Copyright (c) 2014 Dario Bonino
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/LICE... | apache-2.0 | -8,028,598,815,019,101,000 | 28.588889 | 92 | 0.654771 | false | 3.852388 | false | false | false |
scribblemaniac/MCEdit2Blender | blocks/Transparent.py | 1 | 3837 | import bpy
import mathutils
from Block import Block
class Transparent(Block):
"""A block with a texture that contains transparent or translucent pixels"""
def makeObject(self, x, y, z, metadata):
mesh = bpy.data.meshes.new(name="Block")
mesh.from_pydata([[-0.5,-0.5,-0.5],[0.5,-0.5,-0.5],[-... | gpl-3.0 | 8,452,518,236,062,519,000 | 49.486842 | 216 | 0.594996 | false | 3.282293 | false | false | false |
ambyte/Vertaler | src/modules/startupapp.py | 1 | 2108 | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Copyright (c) 2011 Sergey Gulyaev <astraway@gmail.com>
#
# This file is part of Vertaler.
#
# Vertaler is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... | gpl-2.0 | -8,542,072,036,966,153,000 | 28.690141 | 78 | 0.591556 | false | 4.216 | false | false | false |
SoCdesign/EHA | Tools/Minimization_Tool/essential_checker_extraction.py | 1 | 7029 | # copyright 2016 Siavoosh Payandeh Azad and Behrad Niazmand
import package_file
import copy
def extract_checker_info(name_string):
package_file.list_of_detection_info_sa0[name_string] = []
package_file.list_of_detection_info_sa1[name_string] = []
package_file.list_of_true_misses_sa0[name_string] = []
... | gpl-3.0 | 3,876,197,300,479,161,300 | 43.487342 | 108 | 0.543463 | false | 3.760835 | false | false | false |
funkbit/django-funky-user | funky_user/managers.py | 1 | 1568 | from datetime import datetime
from django.contrib.auth.models import BaseUserManager as DjangoBaseUserManager
from django.utils import timezone
class UserManager(DjangoBaseUserManager):
"""
Default manager for the User model.
"""
###################################
# Required Django manager meth... | bsd-2-clause | -2,770,687,478,345,300,000 | 26.508772 | 81 | 0.55676 | false | 4.467236 | false | false | false |
tdozat/Parser | dataset.py | 1 | 5660 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright 2016 Timothy Dozat
#
# 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 ... | apache-2.0 | 8,636,058,868,906,911,000 | 29.928962 | 145 | 0.510247 | false | 3.847723 | false | false | false |
SWENG500-Team1/FitnessForSplunk | misc/python-oauth2-test/python_server.py | 1 | 1192 | from bottle import route, run, request # Python server library
import sys
import httplib2, urllib
import base64
# Hello World route example
@route('/hello')
def hello():
return "Hello World!"
# Fitbit callback route
@route('/auth/fitbit/callback')
def fitbit_callback():
# Edit these variables to suit you... | mit | -3,756,327,715,078,418,000 | 33.085714 | 117 | 0.687081 | false | 3.475219 | false | false | false |
HEP-DL/root2hdf5 | root2hdf5/plugins/larcv/pmt.py | 1 | 1321 | from root2hdf5.data_types.base import BaseData
import numpy as np
import logging
class PMTData(BaseData):
logger = logging.getLogger('root2hdf5.data_types.pmt')
tree_name = 'image2d_pmt_tree'
def __init__(self, _file, output_file):
super(PMTData, self).__init__(_file)
from larcv import larcv
self.ar... | gpl-3.0 | -8,310,864,700,203,725,000 | 40.28125 | 103 | 0.657835 | false | 3.064965 | false | false | false |
jolyonb/edx-platform | lms/djangoapps/courseware/management/commands/clean_xml.py | 1 | 4518 | from __future__ import print_function
import os
import sys
import traceback
import lxml.etree
from django.core.management.base import BaseCommand
from fs.osfs import OSFS
from path import Path as path
from xmodule.modulestore.xml import XMLModuleStore
def traverse_tree(course):
"""
Load every descriptor in... | agpl-3.0 | -2,033,734,661,561,714,200 | 27.77707 | 104 | 0.568172 | false | 4.019573 | false | false | false |
lmaycotte/quark | quark/plugin_modules/ports.py | 1 | 26370 | # Copyright 2013 Openstack Foundation
# 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 requ... | apache-2.0 | 2,644,880,706,528,607,000 | 39.382848 | 79 | 0.594539 | false | 3.957677 | false | false | false |
ctmil/meli_oerp | models/posting.py | 1 | 7027 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 | -4,238,164,900,268,997,000 | 37.700565 | 129 | 0.556994 | false | 4.043153 | false | false | false |
japsu/desugaala | status/models.py | 1 | 1102 | from collections import defaultdict
from django.db import models
from vote.models import Category, Option
class Watch(models.Model):
category = models.ForeignKey(Category)
def evaluate(self):
results = dict((wo.option, 0) for wo in self.watchoption_set.all())
for ballot_category in self.category.ballot... | mit | -4,102,352,009,066,950,000 | 31.441176 | 84 | 0.702359 | false | 3.673333 | false | false | false |
beatrizChagas/scrm-solutions | extracao/rsoservices/service_preprocessing_twitter_v1_ACS.py | 1 | 5056 | # -*- coding: UTF-8 -*-
import sys
import emoji
import mysql.connector
from extracao.rsoservices.config import config
from extracao.rsoservices.emoji_dict import emoticon_dict
from extracao.rsoservices.preprocessing_dict import EMOJI_CARACTER
add_message_table0 = ("INSERT INTO extracao_processamento_twee... | gpl-3.0 | 3,370,406,689,246,566,000 | 35.746269 | 139 | 0.433347 | false | 4.209825 | false | false | false |
sio2project/filetracker | setup.py | 1 | 1364 | from os import path
import io
from setuptools import setup, find_packages
with io.open(
path.join(path.abspath(path.dirname(__file__)), 'README.md'), encoding='utf-8'
) as f:
long_description = f.read()
setup(
name='filetracker',
version='2.1.5',
author='SIO2 Project Team',
author_email='sio2@... | gpl-3.0 | 2,672,298,170,505,186,000 | 28.652174 | 82 | 0.611437 | false | 3.618037 | false | false | false |
mohamedhagag/community-addons | analytic_resource_plan/model/analytic_resource_plan.py | 1 | 10135 | # -*- coding: utf-8 -*-
# © 2015 Eficent Business and IT Consulting Services S.L.
# (Jordi Ballester Alomar)
#
# © 2015 Serpent Consulting Services Pvt. Ltd.
# (Sudhir Arya)
#
# © 2016 Matmoz d.o.o.
# (Matjaž Mozetič)
#
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import time
from openerp impo... | agpl-3.0 | -7,276,925,191,341,370,000 | 30.169231 | 79 | 0.531096 | false | 4.053621 | false | false | false |
petershvets/spark-etl | spark_etl_extract.py | 1 | 9475 | #!/usr/bin/python
from simple_salesforce import Salesforce
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
from pyspark import Row
from pyspark.sql.types import *
#from pyspark.sql.functions import *
from optparse import OptionParser
from pyspark.sql import Data... | apache-2.0 | -803,472,950,311,587,300 | 45.446078 | 210 | 0.688021 | false | 3.332747 | true | false | false |
JensAstrup/pyEchosign | tests/test_agreement.py | 1 | 8056 | from unittest import TestCase
from six import StringIO
from pyEchosign.exceptions.echosign import PermissionDenied
try:
from unittest.mock import Mock, patch
except ImportError:
from mock import Mock, patch
from pyEchosign.classes.agreement import Agreement
from pyEchosign.classes.account import... | mit | -2,151,252,365,031,162,400 | 34.963303 | 127 | 0.636172 | false | 4.001987 | true | false | false |
numb3r33/StumbpleUponChallenge | src/data/make_dataset.py | 1 | 1475 | import pandas as pd
import numpy as np
import json
from unidecode import unidecode
def extract_domain(url):
# extract domains
domain = url.lower().split('/')[2]
domain_parts = domain.split('.')
# e.g. co.uk
if domain_parts[-2] not in ['com', 'co']:
return '.'.join(domain_parts[-2:])
e... | mit | 4,679,320,032,139,094,000 | 21.692308 | 65 | 0.51661 | false | 3.734177 | false | false | false |
brunoliveira8/managyment | project/gym_app/migrations/0001_initial.py | 1 | 7312 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
m... | mit | 6,572,833,183,942,440,000 | 42.011765 | 185 | 0.526258 | false | 4.195066 | false | false | false |
cobbler/cobbler | cobbler/cobbler_collections/distros.py | 1 | 4476 | """
Copyright 2006-2009, Red Hat, Inc and Others
Michael DeHaan <michael.dehaan AT gmail>
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 late... | gpl-2.0 | -4,830,930,041,022,205,000 | 37.586207 | 120 | 0.605004 | false | 4.405512 | false | false | false |
bennylope/django-site-contacts | contact/migrations/0001_initial.py | 1 | 4272 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.conf import settings
USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
USER_MODEL_NAME = USER_MODEL.split('.')[1]
class Migration(SchemaMigration):
def forwa... | bsd-3-clause | 1,464,142,631,011,156,500 | 58.333333 | 182 | 0.562968 | false | 3.753954 | false | false | false |
nathantypanski/zombierl | character.py | 1 | 2941 | from libtcod import libtcodpy as libtcod
import object as O
import map_vars as M
import status as S
import random
class Character (O.Object):
def __init__ (self, name, max_health, x, y, char, color, npc=False,
strength=5, to_hit=0.8, view_distance=10):
self.name = name
self.health = max_health
self... | gpl-3.0 | -7,985,737,944,965,132,000 | 28.707071 | 76 | 0.606256 | false | 3.057173 | false | false | false |
matthagy/Jamenson | jamenson/compiler/Attic/constant_reduction.py | 1 | 4970 | '''Evaluate constant expressions in ir
'''
from __future__ import absolute_import
from __future__ import with_statement
import operator as O
from ..runtime.multimethod import MultiMethod, defmethod, around
from .resolution import compile_time_resolve, UnresolvableError
from .walk import propigate_location
from . imp... | apache-2.0 | 2,729,221,520,801,868,300 | 27.895349 | 98 | 0.602817 | false | 3.319973 | false | false | false |
frappe/frappe | frappe/utils/file_manager.py | 1 | 13378 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
import frappe
import os, base64, re, json
import hashlib
import mimetypes
import io
from frappe.utils import get_hook_method, get_files_path, random_string, encode, cstr, call_hook_method, cint
from frappe import _
from... | mit | -1,703,635,252,731,318,000 | 28.662971 | 130 | 0.690537 | false | 2.928634 | false | false | false |
lig/picket_deadend | apps/picket/middleware.py | 1 | 1686 | """
Copyright 2010 Serge Matveenko
This file is part of Picket.
Picket 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.
Picket is distribut... | gpl-3.0 | 5,305,808,671,908,993,000 | 35.652174 | 75 | 0.708185 | false | 4.345361 | false | false | false |
whatitslike/spiders | zhihu/roundtables.py | 1 | 1046 | from .agent import do_request
from .base import BaseSource
from .types import Types
class RoundTables(BaseSource):
def __init__(self):
super(RoundTables, self).__init__()
self._start_urls = [
'https://api.zhihu.com/roundtables?excerpt_len=75'
]
def _parse(self, json_objs... | gpl-3.0 | -4,115,169,817,327,442,000 | 28.055556 | 71 | 0.5 | false | 4.023077 | false | false | false |
adelina-t/compute-hyperv | hyperv/nova/livemigrationops.py | 1 | 5536 | # Copyright 2012 Cloudbase Solutions Srl
# 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 r... | apache-2.0 | 8,935,619,094,054,086,000 | 40.62406 | 78 | 0.621568 | false | 4.304821 | false | false | false |
JimDuggan/SDMR | pysd2r/pysd2r_scripts/models/SIR.py | 1 | 4264 | """
Python model "SIR.py"
Translated using PySD version 0.9.0
"""
from __future__ import division
import numpy as np
from pysd import utils
import xarray as xr
from pysd.py_backend.functions import cache
from pysd.py_backend import functions
_subscript_dict = {}
_namespace = {
'TIME': 'time',
'Time': 'time',... | mit | 5,341,325,515,212,766,000 | 15.920635 | 93 | 0.56379 | false | 3.015559 | false | false | false |
bennylope/sysenv | sysenv/__init__.py | 1 | 1422 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Ben Lopatin'
__email__ = 'ben@wellfire.co'
__version__ = '0.1.0'
import os
import re
import logging
from .data import EnvDict
logger = logging.getLogger(__name__)
def read_file_values(env_file, fail_silently=True):
"""
Borrowed from Honcho
"... | bsd-3-clause | 1,805,632,655,056,492,500 | 22.311475 | 74 | 0.539381 | false | 3.202703 | false | false | false |
FEniCS/dolfin | python/dolfin/function/functionspace.py | 1 | 8437 | # -*- coding: utf-8 -*-
"""Main module for DOLFIN"""
# Copyright (C) 2017 Chris N. Richardson and Garth N. Wells
#
# Distributed under the terms of the GNU Lesser Public License (LGPL),
# either version 3 of the License, or (at your option) any later
# version.
import types
import ffc
import ufl
import dolfin.cpp as ... | lgpl-3.0 | -3,374,285,540,439,778,300 | 34.902128 | 97 | 0.576271 | false | 4.105596 | false | false | false |
peterlharding/PDQ | examples/ppa_1998/chap3/multi_class.py | 1 | 2445 | #!/usr/bin/env python
###############################################################################
# Copyright (C) 1994 - 2009, Performance Dynamics Company #
# #
# This software is licensed as described in the file COP... | mit | -8,317,115,764,989,448,000 | 34.716418 | 80 | 0.42454 | false | 4.130068 | false | false | false |
kleinfeld/medpy | medpy/graphcut/generate.py | 1 | 16523 | """
@package medpy.graphcut.generate
Provides functionality to generate graphs efficiently from nD label-images and image voxels.
Functions:
- def graph_from_labels(label_image,
fg_markers,
bg_markers,
regional_term = False,
bo... | gpl-3.0 | 8,061,059,661,752,991,000 | 50.313665 | 183 | 0.638988 | false | 4.531816 | false | false | false |
twisted/mantissa | xmantissa/_recordattr.py | 1 | 6833 | # -*- test-case-name: xmantissa.test.test_recordattr -*-
"""
Utility support for attributes on items which compose multiple Axiom attributes
into a single epsilon.structlike.record attribute. This can be handy when
composing a simple, common set of columns that several tables share into a
recognizable object that is ... | mit | 748,060,930,660,187,400 | 36.961111 | 79 | 0.635299 | false | 4.549268 | false | false | false |
TheHonestGene/thehonestgene-pipeline | thehonestgenepipeline/riskprediction.py | 1 | 1383 | from celery.utils.log import get_task_logger
from celery.signals import after_setup_task_logger
from thehonestgenepipeline.celery import celery
from riskpredictor.core import predictor as pred
from os import path
from . import GENOTYPE_FOLDER,DATA_FOLDER
from . import get_platform_from_genotype
from .progress_logger ... | mit | -3,424,874,194,230,446,000 | 37.444444 | 110 | 0.723066 | false | 3.537084 | false | false | false |
kaushik94/sympy | sympy/core/function.py | 1 | 112629 | """
There are three types of functions implemented in SymPy:
1) defined functions (in the sense that they can be evaluated) like
exp or sin; they have a name and a body:
f = exp
2) undefined function which have a name but no body. Undefined
functions can be defined using a Function cla... | bsd-3-clause | 1,533,985,883,591,207,000 | 33.35906 | 142 | 0.548837 | false | 3.914535 | false | false | false |
OpenInfoporto/infoporto.odoo.ecommerce | infoporto/odoo/ecommerce/lib/odoo.py | 1 | 5284 | from infoporto.odoo.core.odoo import OdooInstance
class Odoo(object):
# settings
def getCurrency(self):
""" Retrieve currency from Odoo Company settings """
odoo_core = OdooInstance()
# company ID should be dynamic
return odoo_core.read('res.company', 1, ['currency_id'])
... | gpl-2.0 | 833,721,185,680,812,400 | 32.025 | 103 | 0.488266 | false | 4.268174 | false | false | false |
cgeoffroy/son-analyze | son-scikit/tests/unit/son_scikit/hl_prometheus_test.py | 1 | 2358 | # Copyright (c) 2015 SONATA-NFV, Thales Communications & Security
# ALL RIGHTS RESERVED.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | apache-2.0 | 4,939,344,521,716,886,000 | 38.3 | 74 | 0.707379 | false | 3.363766 | false | false | false |
fnurl/alot | docs/source/generate_commands.py | 1 | 4877 | from __future__ import absolute_import
import sys
import os
HERE = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(HERE, '..', '..'))
from alot.commands import *
from alot.commands import COMMANDS
import alot.buffers
from argparse import HelpFormatter, SUPPRESS, OPTIONAL, ZERO_OR_MORE, ONE_OR_MORE, PARSER, RE... | gpl-3.0 | 7,545,414,185,903,129,000 | 36.229008 | 100 | 0.498462 | false | 4.007395 | false | false | false |
exhacking/TKinter | jam.py | 1 | 1891 | # file: digital.py
# versi: python 2.7
# Program Jam Digital dengan Tkinter
# created by Exhacking.net
# update: 02/08/2012 12.13 AM
# memanggil modul Tkinter
from Tkinter import *
# memanggil modul time (untuk mengakses waktu saat ini)
import time
class JamDigital:
""" Kelas Jam Digital"""
def __init... | gpl-3.0 | -8,135,576,838,944,078,000 | 29.516129 | 72 | 0.594395 | false | 3.221465 | false | false | false |
PlanetHunt/satgen | config_step.py | 1 | 3618 | #!/bin/env python
# -*- coding: utf-8 -*-
"""
This class is menat to read step configurations
for the different parameters related to the satelite.
the syntax of the step parameters should be like this
[Parameter Name]
Start Value = float / int
Step = float / int
End Value = float / int
...
...
...
This configuratio... | mit | 1,390,979,606,951,293,700 | 28.414634 | 77 | 0.563571 | false | 4.168203 | true | false | false |
projectweekend/raspberry-pi-io | raspberry_pi_io/io.py | 1 | 1595 | import yaml
from api import DeviceConfig
from gpio import PinManager
from rabbit import AsyncConsumer
class IOService(object):
def __init__(self, config_file):
with open(config_file) as file:
self.config = yaml.safe_load(file)
self.load_device_config()
self.initialize_pin_man... | mit | -9,010,794,593,780,724,000 | 27.482143 | 96 | 0.584326 | false | 4.197368 | true | false | false |
adamwiggins/cocos2d | test/test_menu_centered.py | 2 | 1158 | #
# Cocos
# http://code.google.com/p/los-cocos/
#
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from pyglet import image
from pyglet.gl import *
from pyglet import font
from cocos.director import *
from cocos.menu import *
from cocos.scene import *
from cocos.layer import *
... | bsd-3-clause | -8,547,460,937,734,142,000 | 21.705882 | 65 | 0.556995 | false | 3.289773 | false | false | false |
durante987/nonogram_solver | nonogram_solver.py | 1 | 1269 | #!/usr/bin/env python3.8
"""
A program that tries to solve nonograms.
"""
import argparse
import logging
import sys
from nonogram.raster import Raster
from nonogram import solver
def main(args=None):
"""
Read the puzzle from the input file and start solving it.
"""
logging.basicConfig(format='%(mess... | mit | -9,051,952,016,072,988,000 | 27.840909 | 79 | 0.622537 | false | 3.880734 | false | false | false |
Springerle/hovercraft-slides | {{cookiecutter.repo_name}}/setup.py | 1 | 1618 | """A setup shim for 'rituals'"""
import os
import re
import sys
import subprocess
from datetime import datetime
try:
url = subprocess.check_output('git remote get-url origin',
stderr=subprocess.STDOUT, shell=True)
except subprocess.CalledProcessError:
url = '{{ cookiecutter.ur... | cc0-1.0 | 7,890,750,058,121,851,000 | 33.425532 | 101 | 0.588381 | false | 3.65237 | false | false | false |
luskaner/wps-dict | wps_dict/wps_dict/interface/gui/bootstrap.py | 1 | 3244 |
from os.path import dirname, abspath
from .SignalHandler import *
from ...providers.online.downloadable.list import online_downloadable_providers
from ...providers.online.queryable.list import online_queryable_providers
from ...providers.offline.list import offline_providers
from ...tools.list import tools
gi.requir... | gpl-3.0 | -6,190,776,960,386,111,000 | 38.084337 | 120 | 0.711776 | false | 3.798595 | false | false | false |
ykaneko/quantum | quantum/extensions/portbindings.py | 1 | 3587 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 OpenStack Foundation.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.... | apache-2.0 | 8,823,158,288,647,582,000 | 34.514851 | 79 | 0.651241 | false | 3.972315 | false | false | false |
ntymtsiv/tempest | tempest/services/compute/v3/json/quotas_client.py | 1 | 2980 | # Copyright 2012 NTT Data
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | apache-2.0 | -6,148,559,382,273,381,000 | 31.747253 | 78 | 0.6 | false | 3.941799 | false | false | false |
koss822/misc | Linux/MySettings/myvim/vim/bundle/jedi-vim/pythonx/jedi/test/completion/decorators.py | 1 | 5367 | # -----------------
# normal decorators
# -----------------
def decorator(func):
def wrapper(*args):
return func(1, *args)
return wrapper
@decorator
def decorated(a,b):
return a,b
exe = decorated(set, '')
#? set
exe[1]
#? int()
exe[0]
# more complicated with args/kwargs
def dec(func):
def ... | gpl-3.0 | 978,030,315,969,505,900 | 15.31307 | 78 | 0.533259 | false | 3.246824 | false | false | false |
odahoda/noisicaa | noisicaa/music/project_client.py | 1 | 15366 | #!/usr/bin/python3
# @begin:license
#
# Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de>
#
# 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 y... | gpl-2.0 | 6,034,009,819,632,288,000 | 38.099237 | 98 | 0.617988 | false | 3.993243 | false | false | false |
pFernbach/hpp-rbprm-corba | src/hpp/corbaserver/rbprm/client.py | 1 | 1639 | #!/usr/bin/env python
#
# Copyright (c) 2014 CNRS
# Author: Steve Tonneau
#
# This file is part of hpp-rbprm-corba.
# hpp-rbprm-corba 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 o... | lgpl-3.0 | -2,557,956,103,731,145,700 | 35.422222 | 76 | 0.706528 | false | 3.47983 | false | false | false |
alexmogavero/home-assistant | homeassistant/components/knx.py | 1 | 12903 | """
Support for KNX components.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/knx/
"""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.const import (
EVENT_HOMEASSISTANT_STOP, CONF_H... | apache-2.0 | -1,636,903,083,226,797,800 | 29.288732 | 79 | 0.558785 | false | 4.293844 | true | false | false |
mrgambal/vulyk | vulyk/models/tasks.py | 1 | 6601 | # -*- coding: utf-8 -*-
"""Module contains all models directly related to the main entity - tasks."""
from collections import namedtuple
from typing import Any, Dict, List
from bson import ObjectId
from flask_mongoengine import Document
from mongoengine import (
BooleanField,
CASCADE,
DateTimeField,
Di... | bsd-3-clause | -6,040,339,416,882,159,000 | 26.961864 | 82 | 0.579936 | false | 4.009113 | false | false | false |
Yellowen/Owrang | stock/doctype/stock_entry/stock_entry.py | 1 | 35585 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
import webnotes.defaults
from webnotes.utils import cstr, cint, flt, comma_or, nowdate
from webnotes.model.doc import Document, addchild
from webnote... | agpl-3.0 | -4,433,923,836,272,466,400 | 34.656313 | 112 | 0.658423 | false | 3.018492 | false | false | false |
koalalorenzo/greatdiary | main.py | 1 | 15891 | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
import gtk
import webkit
import gobject
import xml.dom.minidom
from xml.dom.minidom import Node
import time
import os
import sys
import crypt, random, string
import libcrypt
from sqlite3 import dbapi2 as sqlite
gobject.threads_init()
def dialog_info(info):
"""
... | gpl-3.0 | 8,236,639,972,998,706,000 | 36.992823 | 155 | 0.601914 | false | 3.537759 | false | false | false |
egh/spydaap | spydaap/parser/vorbis.py | 1 | 3664 | # Copyright (C) 2008 Erik Hetzner
# This file is part of Spydaap. Spydaap 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.
# Spydaap i... | gpl-3.0 | -2,897,420,776,476,224,500 | 32.925926 | 72 | 0.623908 | false | 3.283154 | false | false | false |
BillClyde/safenetfs | safenet/api/directory.py | 1 | 4211 | import safenet.api
import requests
import json
from StringIO import StringIO
import base64
__author__ = "William Clyde"
__copyright__ = "Copyright 2016, William Clyde"
__license__ = "MIT"
class Directory:
"""Directory management"""
def __init__(self):
"""__init__"""
self.headers = {'content-... | mit | 7,075,495,754,665,540,000 | 28.243056 | 98 | 0.495607 | false | 4.763575 | false | false | false |
macarthur-lab/xbrowse | xbrowse_server/base/management/commands/get_lof_variants.py | 1 | 4504 | from collections import defaultdict
import csv
from django.core.management.base import BaseCommand
import elasticsearch
import elasticsearch_dsl
import json
import settings
from seqr.models import Individual
from seqr.views.utils.orm_to_json_utils import _get_json_for_individuals
from xbrowse_server.base.models import... | agpl-3.0 | -8,824,804,290,275,084,000 | 47.44086 | 134 | 0.583925 | false | 4.201493 | false | false | false |
coala-analyzer/coala-quickstart | coala_quickstart/generation/FileGlobs.py | 1 | 2475 | import os
from coalib.parsing.Globbing import glob_escape
from coala_quickstart.generation.Utilities import get_gitignore_glob
from coala_utils.Question import ask_question
from coala_quickstart.Strings import GLOB_HELP
from coalib.collecting.Collectors import collect_files
def get_project_files(log_printer,
... | agpl-3.0 | 1,518,963,703,581,851,000 | 33.375 | 77 | 0.634343 | false | 3.891509 | false | false | false |
tehasdf/AdventOfCode2016 | p4.py | 1 | 1371 | from collections import Counter
def split(name):
name, _, sector_checksum = name.strip().rpartition('-')
sector, _, checksum = sector_checksum.partition('[')
checksum = checksum[:-1]
return name, int(sector), checksum
def real(name, checksum):
letters = Counter(name.replace('-', ''))
return ... | mit | 1,116,403,845,823,417,200 | 24.388889 | 73 | 0.565281 | false | 3.335766 | false | false | false |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyQt4/QtNetwork/QHttpMultiPart.py | 1 | 1266 | # encoding: utf-8
# module PyQt4.QtNetwork
# from /usr/lib/python3/dist-packages/PyQt4/QtNetwork.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
class QHttpMultiPart(__PyQt4_QtCore.QObject):
"""
QHttpMultiPart(QObject parent=None)
QHttpMultiPa... | gpl-2.0 | -5,000,133,939,483,875,000 | 29.878049 | 105 | 0.670616 | false | 3.767857 | false | false | false |
JeroenZegers/Nabu-MSSS | nabu/processing/feature_computers/angspec.py | 1 | 1409 | """@file angspec.py
contains the angular spectrum feature computer"""
import numpy as np
import base
import feature_computer
from sigproc import snip
class Angspec(feature_computer.FeatureComputer):
"""the feature computer class to compute angular spectrum feature"""
def comp_feat(self, sig, rate):
... | mit | 173,415,704,382,370,140 | 27.18 | 86 | 0.568488 | false | 3.881543 | false | false | false |
pablorecio/Cobaya | src/cobaya/config.py | 1 | 2598 | ###############################################################################
# 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 #
... | gpl-3.0 | 8,995,140,087,937,473,000 | 33.64 | 79 | 0.516166 | false | 4.631016 | true | false | false |
drblez/dynamodb-transaction-manager | dynamodb2/constructor.py | 1 | 6099 | from datetime import datetime
import decimal
__author__ = 'drblez'
"""
Field('f1', 'value1').field('f2', 'value2').field('f3', 42).field('f4', ['a', 'b', 'c']).field('f5', [1, 2, 3]).dict
{
'f1': {'S': 'value1'),
'f2': {'S': 'value2'},
'f3': {'N': '42'},
'f4': {'SS': ['a', 'b... | gpl-3.0 | 1,864,183,897,517,733,000 | 24.62605 | 120 | 0.499918 | false | 3.639021 | false | false | false |
arcturusannamalai/Ezhil-Lang | ezhil/ezhil_transforms.py | 2 | 7334 | #!/usr/bin/python
# -*- coding: utf-8 -*-
##
## (C) 2015 Muthiah Annamalai
## Licensed under GPL Version 3
##
## Interpreter for Ezhil language
from __future__ import print_function
import sys
PYTHON3 = (sys.version[0] == '3')
if PYTHON3:
unicode = str
## Tx
from .transform import Visitor, TransformVisitor
from .... | gpl-3.0 | 3,367,327,256,590,115,300 | 34.73399 | 128 | 0.583954 | false | 3.725732 | false | false | false |
tpoy0099/option_calculator | gui_impl/position_editor.py | 1 | 4509 | #coding=utf8
from qt_ui.ui_position_editor import Ui_position_editor_dialog
from gui_impl.qt_mvc_impl import MatrixModel, AutoFormDelegate
from gui_impl.qtableview_utility import getSelectedRows
from utility.data_handler import TableHandler
from PyQt4.QtCore import *
from PyQt4.QtGui import *
########################... | gpl-2.0 | -6,616,695,230,852,411,000 | 37.211864 | 94 | 0.573963 | false | 4.080543 | false | false | false |
nasa-gibs/onearth | src/empty_tile/oe_generate_empty_tile.py | 1 | 11279 | #!/usr/bin/env python3
# Copyright (c) 2002-2017, California Institute of Technology.
# All rights reserved. Based on Government Sponsored Research under contracts NAS7-1407 and/or NAS7-03001.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the followi... | apache-2.0 | 599,956,554,437,236,400 | 38.855124 | 229 | 0.61282 | false | 4.051365 | false | false | false |
LearnEra/LearnEraPlaftform | common/lib/xmodule/xmodule/modulestore/tests/test_publish.py | 1 | 7315 | """
Test the publish code (mostly testing that publishing doesn't result in orphans)
"""
from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule.modulestore.tests.test_split_w_old_mongo import SplitWMongoCourseBoostrapper
from xmodule.modulestore.tests.factories import check_mongo_calls
from xmodule.m... | agpl-3.0 | 2,435,826,882,299,244,500 | 52.394161 | 154 | 0.5892 | false | 3.91805 | true | false | false |
eek6/squeakspace | lib/squeakspace/common/util_http.py | 1 | 14648 |
import urlparse
import json
import Cookie
import squeakspace.common.squeak_ex as ex
def json_fun(object):
#return json.dumps(object)
return json.dumps(object, indent=4) + '\n'
def respond(environ, start_response, status, content, response_headers=None):
if response_headers == None:
response_hea... | gpl-3.0 | -6,834,943,958,178,356,000 | 32.290909 | 94 | 0.608684 | false | 4.125035 | false | false | false |
T3kton/subcontractor | subcontractor/credentials.py | 1 | 1841 | import json
import ssl
from urllib import request
VAULT_TIMEOUT = 20
_handler = None
def getCredentials( value ):
if value is None:
return None
return _handler.get( value )
def setup( config ):
global _handler
vault_type = config.get( 'credentials', 'type', fallback=None )
if not vault_type: # ... | apache-2.0 | 6,615,458,542,644,797,000 | 24.219178 | 97 | 0.595872 | false | 3.674651 | true | false | false |
ronas/PythonGNF | Igor/Tabuada.py | 1 | 1262 | '''
numero = int(input("Número para a tabuada: "))
for multiplicador in range(1,11):
print (numero,"x",multiplicador,"=",(numero*multiplicador))
'''
#
# Calculo de Horas trabalhadas.
# Autor: Igor Nunes
# Materia: Programa Python
# Orientador: Ronaldo
# Aula de total de horas trabalhadas
#
#Leitur... | gpl-3.0 | 7,292,178,075,437,664,000 | 23.16 | 66 | 0.68124 | false | 2.270758 | false | false | false |
Tuxemon/Tuxemon | tuxemon/event/actions/add_item.py | 1 | 1612 | #
# Tuxemon
# Copyright (c) 2014-2017 William Edwards <shadowapex@gmail.com>,
# Benjamin Bean <superman2k5@gmail.com>
#
# This file is part of Tuxemon
#
# 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-3.0 | -5,283,441,857,624,997,000 | 31.24 | 85 | 0.71464 | false | 3.980247 | false | false | false |
rjonnal/zernike | __init__.py | 1 | 20006 | """This module contains functions for Zernike calculations. Mainly the private
function _zgen, a generator function for Zernike polynomials. The public
functions make use of _zgen to create height or slope maps in a unit
pupil, corresponding to individual Zernike terms.
Author: Ravi S. Jonnal / Werner Lab, UC Davis
R... | gpl-2.0 | 5,358,316,222,424,130,000 | 33.732639 | 112 | 0.517845 | false | 3.833301 | false | false | false |
dongguangming/django-books | models.py | 1 | 1560 | #import all of the things we will be using
from django.db import models
from tagging.fields import TagField
# to help with translation of field names
from django.utils.translation import ugettext_lazy as _
# to have a generic foreign key for any model
from django.cont... | bsd-3-clause | 7,885,029,974,770,089,000 | 36.04878 | 76 | 0.633974 | false | 4.309392 | false | false | false |
taarifa/taarifa_backend | taarifa_backend/models.py | 1 | 4325 | import datetime
from flask_security import RoleMixin, UserMixin
from flask_mongoengine.wtf import model_form
from taarifa_backend import db
fieldmap = {
'BinaryField': db.BinaryField,
'BooleanField': db.BooleanField,
'ComplexDateTimeField': db.ComplexDateTimeField,
'DateTimeField': db.DateTimeField,
... | bsd-3-clause | 7,360,685,039,675,874,000 | 30.801471 | 84 | 0.672139 | false | 3.854724 | false | false | false |
gochaorg/mailscripts | emailer/mailer.py | 1 | 12253 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import smtplib
import os
import re
import sys
import imaplib
import email
import tempfile
import shutil
import datetime
import quopri
import base64
import hashlib
import quopri
import base64
import hashlib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase imp... | mit | -74,163,532,198,789,380 | 26.899743 | 114 | 0.656008 | false | 2.316823 | false | false | false |
nihlaeth/HorseLife | interface/cli/display.py | 1 | 7394 | """Interface to inherit from for *Display classes."""
from textwrap import fill
from core.core import Core
from core.messagecore import MessageCore
from core.stablecore import StableCore
from core.pasturecore import PastureCore
from core.towncore import TownCore
from core.contractercore import ContracterCore
from supp... | gpl-2.0 | -9,055,528,757,811,274,000 | 34.37799 | 75 | 0.545983 | false | 4.564198 | false | false | false |
zojoncj/cleanthehead | nsnitro/nsresources/nssslvserver.py | 1 | 23417 | from nsbaseresource import NSBaseResource
__author__ = 'Aleksandar Topuzovic'
class NSSSLVServer(NSBaseResource):
def __init__(self, json_data=None):
"""
Supplied with json_data the object can be pre-filled
"""
super(NSSSLVServer, self).__init__(... | apache-2.0 | -8,071,013,944,966,436,000 | 41.041293 | 105 | 0.503737 | false | 5.378273 | false | false | false |
benvcarr/algorithms_course | hw2/carr-hw2.py | 1 | 5854 | #!/usr/bin/python
"""
Benjamin Carr
Homework #2 - MPCS 55001
Answers:
(1) Program below.
(2) My program is correct for all cases where both the numbers and the distances from the median
are unique. I spent a lot of time (30+ hrs) trying to figure out other ways of doing this other than using a
dictio... | apache-2.0 | -1,535,948,675,559,064,000 | 32.233918 | 116 | 0.640588 | false | 3.57169 | false | false | false |
USGSDenverPychron/pychron | pychron/spectrometer/base_magnet.py | 1 | 12604 | # ===============================================================================
# Copyright 2014 Jake Ross
#
# 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... | apache-2.0 | 4,398,844,861,938,323,000 | 33.157182 | 118 | 0.485401 | false | 4.355218 | false | false | false |
jptomo/rpython-lang-scheme | rpython/translator/test/snippet.py | 1 | 19453 | """Snippets for translation
This module holds various snippets, to be used by translator
unittests.
We define argument types as default arguments to the snippet
functions.
"""
numtype = (int, float)
anytype = (int, float, str)
seqtype = (list, tuple)
def if_then_else(cond=anytype, x=anytype, y=anytype):
if cond... | mit | 713,307,751,522,421,600 | 16.384272 | 98 | 0.522027 | false | 2.990469 | false | false | false |
cu-csc/automaton | tests/deployment_tests.py | 1 | 2068 | """
Module that tests various deployment functionality
To run me from command line:
cd automaton/tests
export PYTHONPATH=$PYTHONPATH:../
python -m unittest -v deployment_tests
unset PYTHONPATH
I should have used nose but
"""
import unittest
from lib import util
from deployment import common
class test_deployment_... | mit | 3,975,989,049,178,258,000 | 32.901639 | 76 | 0.62911 | false | 3.843866 | true | false | false |
agirardeaudale/nbawebstats | docs/generaterequestrst.py | 1 | 2103 | #!/usr/bin/env python
from jinja2 import Environment, FileSystemLoader
import json
import os
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
DATA_PATH = os.path.abspath(os.path.join(THIS_DIR, '../nbawebstats/requests.json'))
RST_PATH = os.path.abspath(os.path.join(THIS_DIR, 'requests.rst'))
def format_internal... | mit | -3,689,226,585,242,646,500 | 35.258621 | 83 | 0.61864 | false | 3.458882 | false | false | false |
OpenAcademy-OpenStack/nova-scheduler | nova/api/openstack/compute/plugins/v3/admin_password.py | 1 | 2734 | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 | 1,025,928,680,341,808,000 | 35.453333 | 79 | 0.696781 | false | 4.232198 | false | false | false |
wpjesus/codematch | ietf/group/mails.py | 1 | 2488 | # generation of mails
import re
from django.utils.html import strip_tags
from django.utils.text import wrap
from django.conf import settings
from django.core.urlresolvers import reverse as urlreverse
from ietf.utils.mail import send_mail, send_mail_text
from ietf.mailtrigger.utils import gather_address_lists
def ... | bsd-3-clause | -7,655,907,386,327,128,000 | 41.169492 | 159 | 0.659164 | false | 3.357625 | false | false | false |
amaozhao/basecms | mptt/managers.py | 1 | 46897 | """
A custom manager for working with trees of objects.
"""
from __future__ import unicode_literals
import contextlib
from django.db import models, connections, router
from django.db.models import F, ManyToManyField, Max, Q
from django.utils.translation import ugettext as _
from mptt.exceptions import CantDisableUpda... | mit | -7,849,403,533,287,064,000 | 38.376154 | 99 | 0.543766 | false | 4.029991 | false | false | false |
pickettd/SerialPort-RealTime-Data-Plotter | com_monitor.py | 1 | 5133 |
import Queue, threading, timeit, serial
from globals import *
class ComMonitorThread(threading.Thread):
""" A thread for monitoring a COM port. The COM port is
opened when the thread is started.
data_q:
Queue for received data. Items in the queue are
(dat... | mit | 5,029,071,917,656,844,000 | 31.283019 | 64 | 0.447691 | false | 4.203931 | false | false | false |
fintech-circle/edx-platform | lms/djangoapps/gating/api.py | 1 | 4680 | """
API for the gating djangoapp
"""
from collections import defaultdict
import json
import logging
from lms.djangoapps.courseware.entrance_exams import get_entrance_exam_content
from openedx.core.lib.gating import api as gating_api
from opaque_keys.edx.keys import UsageKey
from util import milestones_helpers
log = ... | agpl-3.0 | -109,539,272,815,895,200 | 39.344828 | 113 | 0.678846 | false | 4.08377 | false | false | false |
starnose/liar | liarutils.py | 1 | 3600 | ###################################################################################
# liarutils.py, utility calls for liar
###################################################################################
#
# Copyright 2013 David Hicks (Starnose Ltd)
#
# This file is part of Liar
#
# Liar is free software: you can... | gpl-3.0 | 8,115,426,600,985,354,000 | 40.37931 | 164 | 0.553611 | false | 3.71517 | false | false | false |
Pinyto/cloud | keyserver/models.py | 1 | 4666 | # coding=utf-8
"""
Pinyto cloud - A secure cloud database for your personal data
Copyright (C) 2019 Pina Merkert <pina@pinae.net>
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 t... | gpl-3.0 | -5,410,453,920,801,267,000 | 39.224138 | 103 | 0.661166 | false | 4.257299 | false | false | false |
digitie/magneto | core/util.py | 1 | 3603 | # -*- coding: UTF-8 -*-
from time import sleep
import logging
import serial
import sys
import binascii
from log import MainLogger
def enum(*sequential, **named):
enums = dict(zip(sequential, range(len(sequential))), **named)
reverse = dict((value, key) for key, value in enums.iteritems())
enums['reverse_m... | unlicense | -5,885,136,105,583,912,000 | 28.540984 | 72 | 0.600888 | false | 4.146145 | false | false | false |
robmcmullen/pyatasm | pyatasm/assemble.py | 1 | 3007 | from .pyatasm_mac65 import mac65_assemble
class Assemble(object):
def __init__(self, source, verbose=False):
self.verbose = verbose
if isinstance(source, str):
source = source.encode("utf-8")
self.errors, text = mac65_assemble(source)
self.segments = []
self.tran... | gpl-2.0 | -70,870,082,602,270,100 | 35.228916 | 95 | 0.536748 | false | 3.910273 | false | false | false |
stcakova/Battle-city | world.py | 1 | 1375 | import pygame
from pygame import rect
from constants import *
from part import Wall, Brick
class World:
world = [[None for x in range(26)] for y in range(19)]
def __init__(self):
self.brick = pygame.image.load("pictures/brick.jpeg")
self.wall = pygame.image.load("pictures/wall.png")
... | gpl-2.0 | 8,877,047,811,533,497,000 | 33.375 | 64 | 0.555636 | false | 3.798343 | false | false | false |
DTOcean/dtocean-core | test_data/inputs_wp2_wave.py | 1 | 3952 | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 09 10:39:38 2015
@author: 108630
"""
import os
from datetime import datetime, timedelta
import numpy as np
dir_path = os.path.dirname(__file__)
# Setup
x = np.linspace(0.,1000.,20.)
y = np.linspace(0.,300.,20.)
nx = len(x)
ny = len(y)
# Bathymetry?
X, Y = np.meshgr... | gpl-3.0 | 6,940,826,449,139,902,000 | 27.846715 | 84 | 0.584008 | false | 2.903747 | false | false | false |
qsnake/gpaw | gpaw/test/xcatom.py | 1 | 1515 | import numpy as np
import numpy.random as ra
from gpaw.setup import create_setup
from gpaw.xc import XC
from gpaw.test import equal
x = 0.000001
ra.seed(8)
for xc in ['LDA', 'PBE']:
print xc
xc = XC(xc)
s = create_setup('N', xc)
ni = s.ni
nii = ni * (ni + 1) // 2
D_p = 0.1 * ra.random(nii) + 0... | gpl-3.0 | -138,882,968,460,386,080 | 30.5625 | 77 | 0.473267 | false | 2.431782 | false | false | false |
cabanm/project-euler | problem46.py | 1 | 1213 | # Project Euler - Problem 46
# --------------------------
# What is the smallest odd composite that cannot be written as the sum of a prime and twice a square?
from myMath import isPrime
from time import time
# Find primes up to a certain number and output a list of them
def primes(top):
seive = range(2, top+1)
for... | gpl-2.0 | -4,701,724,964,660,752,000 | 29.325 | 101 | 0.663644 | false | 2.834112 | false | false | false |
tdjordan/tortoisegit | gitgtk/addremove.py | 1 | 1219 | #
# Add/Remove dialog for TortoiseHg
#
# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com>
#
try:
import pygtk
pygtk.require("2.0")
except:
pass
import gtk
import gobject
from mercurial import ui, util, hg
from mercurial.i18n import _
from status import GStatus
def run(hgcmd='add', root='', cwd='', files=[... | gpl-2.0 | 2,293,648,415,399,881,700 | 23.38 | 80 | 0.579984 | false | 3.224868 | false | false | false |
vaimi/pydisambiguation | ui/qtgui.py | 1 | 6824 | from PyQt5.QtWidgets import (QWidget, QFrame, QLabel, QPushButton, QComboBox, QLineEdit,QTextEdit, QGridLayout, QApplication, QHBoxLayout, QRadioButton)
import logging
class AlgorithmRadioButton(QRadioButton):
def __init__(self, text, id=None, group=None):
super().__init__(text)
self.algorithmId = ... | gpl-3.0 | -1,755,694,650,714,857,700 | 36.494505 | 215 | 0.637749 | false | 4.115802 | false | false | false |
aaronmckinstry706/twitter-crime-prediction | src/jobs/crime_prediction/run.py | 1 | 13899 | import datetime
import logging
import operator
import os
import sys
import pyspark as pyspark
import pyspark.ml.feature as feature
import pyspark.ml.classification as classification
import pyspark.ml as ml
import pyspark.ml.clustering as clustering
import pyspark.sql as sql
import pyspark.sql.functions as functions
im... | gpl-3.0 | 3,743,084,505,325,110,000 | 38.598291 | 118 | 0.66163 | false | 3.428466 | false | false | false |
RuthAngus/LSST-max | code/GP_periodogram.py | 1 | 1066 | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from GProtation import make_plot, lnprob, neglnlike
import emcee
import time
import george
from george.kernels import ExpSquaredKernel, ExpSine2Kernel
import scipy.optimize as spo
def GP_periodogram(x, y, yerr, p_init, plims, N):
... | mit | -6,016,110,204,443,567,000 | 27.052632 | 77 | 0.707317 | false | 2.820106 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.