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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
demisto/content | Packs/DBotTruthBombs/Integrations/DBotTruthBombs/DBotTruthBombs.py | 1 | 2663 | import random
import traceback
import demistomock as demisto # noqa: F401
import urllib3
from CommonServerPython import * # noqa: F401
# Disable insecure warnings
urllib3.disable_warnings()
BASE_URL = 'https://api.chucknorris.io'
CATEGORIES = ['career', 'dev', 'history', 'money', 'movie', 'music', 'science', 'sp... | mit | 99,612,129,514,512,580 | 24.605769 | 106 | 0.611716 | false | 3.358134 | false | false | false |
Octaplex/elviz | elviz/util.py | 1 | 2854 | from __future__ import division, print_function
import math
def interpolate(color, val, base = (0, 0, 0)):
return tuple(b + (c-b)*val for c, b in zip(color, base))
def avg(xs):
xs = list(xs)
return sum(xs)/len(xs)
#function from Simpson's Rule Wikipedia example: https://en.wikipedia.org/wiki/Simpso... | mit | -5,738,025,642,283,193,000 | 28.729167 | 95 | 0.49965 | false | 2.333606 | false | false | false |
sinhrks/chainer | cupy/cudnn.py | 1 | 3674 | import atexit
import numpy
import six
from cupy import cuda
from cupy.cuda import cudnn
_handles = {}
def get_handle():
global _handles
device = cuda.Device()
handle = _handles.get(device.id, None)
if handle is None:
handle = cudnn.create()
_handles[device.id] = handle
return h... | mit | -6,129,332,665,741,319,000 | 28.392 | 78 | 0.622754 | false | 3.666667 | false | false | false |
isb-cgc/ISB-CGC-Webapp | visualizations/models.py | 1 | 4118 | #
# Copyright 2015-2019, Institute for Systems Biology
#
# 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 ... | apache-2.0 | -6,174,952,871,045,021,000 | 38.605769 | 140 | 0.705197 | false | 3.583986 | false | false | false |
CivilNet/Gemfield | dockerfiles/py-faster-rcnn/files/gemfield/py-faster-rcnn/caffe-fast-rcnn/python/caffe/io.py | 1 | 13024 | import numpy as np
import skimage.io
from scipy.ndimage import zoom
from skimage.transform import resize
try:
# Python3 will most likely not be able to load protobuf
from caffe.proto import caffe_pb2
except:
import sys
if sys.version_info >= (3, 0):
print("Failed to include caffe_pb2, things mi... | gpl-3.0 | 1,957,268,488,618,897,400 | 32.56701 | 110 | 0.572712 | false | 3.735016 | false | false | false |
Royal-Society-of-New-Zealand/NZ-ORCID-Hub | orcid_api_v3/models/name_v30_rc2.py | 1 | 9104 | # coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import si... | mit | -4,066,881,017,732,954,600 | 28.84918 | 176 | 0.586226 | false | 3.68583 | false | false | false |
oliver-sanders/cylc | cylc/flow/cycling/loader.py | 1 | 4617 | # THIS FILE IS PART OF THE CYLC SUITE ENGINE.
# Copyright (C) 2008-2019 NIWA & British Crown (Met Office) & Contributors.
#
# 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 th... | gpl-3.0 | -6,678,707,663,947,246,000 | 33.455224 | 79 | 0.7141 | false | 3.290805 | false | false | false |
pyrocko/pyrocko | src/io/sac.py | 1 | 14160 | # http://pyrocko.org - GPLv3
#
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
'''SAC IO library for Python'''
from __future__ import absolute_import
import struct
import logging
import math
import numpy as num
from calendar import timegm
from time import gmtime
from pyrocko import trac... | gpl-3.0 | -3,979,738,111,691,541,000 | 31.328767 | 79 | 0.533333 | false | 3.454501 | false | false | false |
sigmavirus24/curryer | curryer/curry.py | 1 | 2898 | import inspect
Infinity = float('inf')
ARITIES = {
inspect.Parameter.VAR_POSITIONAL: Infinity,
inspect.Parameter.VAR_KEYWORD: Infinity,
}
class Curry:
def __init__(self, wrapped_callable, curried=False, signature=None,
bound_arguments=None):
if inspect.isclass(wrapped_callab... | bsd-3-clause | -7,861,904,328,249,032,000 | 30.5 | 78 | 0.619738 | false | 4.09901 | false | false | false |
ugur-mehmet/twitterClone | twitter/views.py | 1 | 1952 | from django.shortcuts import render, render_to_response, redirect
from django.http import HttpResponse
from django.core.context_processors import csrf
from django.contrib.auth.models import User
from django.contrib.auth import authenticate
from django.contrib.auth.decorators import login_required, permission_required
f... | apache-2.0 | 6,136,697,009,983,525,000 | 34.490909 | 112 | 0.741291 | false | 2.874816 | false | false | false |
ecederstrand/exchangelib | exchangelib/extended_properties.py | 1 | 13011 | import logging
from decimal import Decimal
from .ewsdatetime import EWSDateTime
from .properties import EWSElement, ExtendedFieldURI
from .util import create_element, add_xml_child, get_xml_attrs, get_xml_attr, set_xml_value, value_to_xml_text, \
xml_text_to_value, is_iterable, TNS
log = logging.getLogger(__name_... | bsd-2-clause | -9,009,817,323,437,828,000 | 40.836013 | 120 | 0.606256 | false | 3.721682 | false | false | false |
jefemagril/fermipy | fermipy/irfs.py | 1 | 32592 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function
import glob
import re
import numpy as np
from scipy.interpolate import RegularGridInterpolator
from scipy.interpolate import UnivariateSpline
import healpy as hp
from astropy.io import fits
... | bsd-3-clause | 8,317,751,308,319,974,000 | 30.890411 | 107 | 0.563942 | false | 3.228209 | false | false | false |
wapiflapi/gxf | gxf/extensions/disassemble.py | 1 | 1469 | # -*- coding: utf-8 -*-
import gxf
@gxf.register()
class Disassemble(gxf.DataCommand):
'''
Disassemble a specified section of memory.
'''
def setup(self, parser):
parser.add_argument("what", type=gxf.LocationType())
parser.add_argument("until", type=gxf.LocationType(), nargs='?')
... | mit | 4,517,690,244,646,569,500 | 31.644444 | 76 | 0.572498 | false | 3.737913 | false | false | false |
madgik/exareme | Exareme-Docker/src/exareme/exareme-tools/madis/src/functionslocal/aggregate/statistics.py | 1 | 3075 | import functions
from array import *
try:
from collections import OrderedDict
except ImportError:
# Python 2.6
from lib.collections26 import OrderedDict
__docformat__ = 'reStructuredText en'
class gramian:
registered = True # Value to define db operator
def __init__(self):
self.init =... | mit | -4,268,922,587,787,302,000 | 23.404762 | 93 | 0.515772 | false | 3.810409 | false | false | false |
clsb/miles | miles/transition_kernel.py | 1 | 7793 | """Transition kernel class.
A transition kernel allows us to estimate the (full-resolution)
transition operator in milestoning.
The main goal of this class is to keep track of the transitions and
obtain:
1. the stationary flux vector,
2. an approximation of the stationary distribution, and
3. the estimated mean fi... | mit | 2,953,614,801,955,421,000 | 32.161702 | 124 | 0.600924 | false | 4.810494 | false | false | false |
NeCTAR-RC/karaage-user | kguser/conf/settings.py | 1 | 1269 | # Django settings for kguser project.
from os import path
from karaage.conf.defaults import *
TEMPLATE_DIRS += (
'/usr/share/kguser/templates',
)
ROOT_URLCONF = 'kguser.conf.urls'
SITE_ID = 2
STATIC_ROOT = '/var/lib/karaage-user/static'
STATIC_URL = '/kguser_media/'
LOGIN_URL = 'kgauth_login_select'
ALLOW_REG... | gpl-3.0 | -7,600,228,089,277,839,000 | 26 | 102 | 0.660362 | false | 2.985882 | false | false | false |
guziy/basemap | lib/mpl_toolkits/basemap/proj.py | 1 | 18030 | from __future__ import (absolute_import, division, print_function)
import numpy as np
import pyproj
import math
try:
from inspect import cleandoc as dedent
except ImportError:
# Deprecated as of version 3.1. Not quite the same
# as textwrap.dedent.
from matplotlib.cbook import dedent
__version__ = '1.... | gpl-2.0 | -4,398,054,427,502,555,600 | 42.031026 | 93 | 0.553466 | false | 3.300384 | false | false | false |
thomdixon/pysha2 | sha2/sha512.py | 1 | 4630 | #!/usr/bin/python
__author__ = 'Thomas Dixon'
__license__ = 'MIT'
import copy, struct, sys
def new(m=None):
return sha512(m)
class sha512(object):
_k = (0x428a2f98d728ae22L, 0x7137449123ef65cdL, 0xb5c0fbcfec4d3b2fL, 0xe9b5dba58189dbbcL,
0x3956c25bf348b538L, 0x59f111f1b605d019L, 0x923f82a4af194f9bL,... | mit | -6,486,915,968,141,978,000 | 40.711712 | 122 | 0.618143 | false | 2.238878 | false | false | false |
hpcleuven/easybuild-framework | easybuild/framework/easyconfig/format/two.py | 1 | 5835 | # #
# Copyright 2013-2016 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (... | gpl-2.0 | 7,924,998,836,819,652,000 | 40.978417 | 117 | 0.691345 | false | 3.900401 | true | false | false |
TuvaLabs/django-inapp-survey | inapp_survey/admin.py | 1 | 2828 | from django.contrib import admin
from django import forms
from string import Template
from django.utils.safestring import mark_safe
from .models import CampaignCustomParam, Campaign, CampaignQuestion, \
UserCampaign, UserCampaignResponse
# Widget to set markdown editor
class MarkdownDelightEditorWidget(forms.Tex... | apache-2.0 | 7,853,130,417,444,531,000 | 23.17094 | 112 | 0.634371 | false | 4.02276 | false | false | false |
bendaf/diff_drive_entropy | sim_01_dd_sim.py | 1 | 5557 | import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation
from matplotlib.patches import RegularPolygon
import matplotlib.image as mpimg
rad = np.pi/180
class Agent:
def __init__(self, position, size, angle=0):
self.speed = 2.
self.angle = angle # rad
self.s... | gpl-2.0 | 3,314,550,808,353,785,300 | 31.869822 | 165 | 0.563636 | false | 3.23153 | false | false | false |
nkmk/python-snippets | notebook/pandas_options.py | 1 | 17360 | import pandas as pd
import pprint
print(pd.__version__)
# 0.23.0
print(pd.options.display.max_rows)
# 60
pd.options.display.max_rows = 100
print(pd.options.display.max_rows)
# 100
print(dir(pd.options))
# ['compute', 'display', 'html', 'io', 'mode', 'plotting']
pprint.pprint(dir(pd.options.display))
# ['chop_thre... | mit | 8,378,338,827,191,834,000 | 38.365079 | 147 | 0.696601 | false | 3.393939 | false | false | false |
fraserphysics/F_UNCLE | F_UNCLE/Models/RandomVariable.py | 1 | 2953 | """A model of a normally distributed random variable of known mean
sigma = k epsilon + c epsilon'
"""
import copy
import numpy as np
from ..Utils.PhysicsModel import GaussianModel
from ..Utils.Struc import Struc
class RandomVariable(GaussianModel):
"""A model of a normally distributed random variable of k... | gpl-2.0 | 524,840,704,532,178,560 | 23.204918 | 76 | 0.495767 | false | 3.645679 | false | false | false |
viridia/coda | libs/coda/compiler/ast.py | 1 | 6129 | # Abstract syntax tree for CODA IDL
# ============================================================================
# Scopes
# ============================================================================
class DefScope:
'Mixin class for descriptors which are also scopes.'
def __init__(self):
self.structs = []
... | apache-2.0 | 8,560,300,822,354,853,000 | 25.192308 | 79 | 0.544624 | false | 4.177914 | false | false | false |
fflewddur/python-phash | scripts/compare-images.py | 2 | 1133 | #!/usr/bin/env python
# encoding: utf-8
from __future__ import absolute_import, print_function, unicode_literals
import argparse
import sys
from more_itertools import grouper
from phash import cross_correlation, image_digest
def main():
parser = argparse.ArgumentParser()
parser.add_argument('files', metava... | cc0-1.0 | -3,408,765,113,167,875,000 | 24.177778 | 76 | 0.601942 | false | 3.422961 | false | false | false |
makism/dyfunconn | tests/test_tvfcgs.py | 1 | 3099 | # -*- coding: utf-8 -*-
"""Tests for time-varying functional connectivity graphs module."""
import pytest
import scipy as sp
from scipy import io
import numpy as np
import os
from numpy import testing
from dyconnmap import tvfcg, tvfcg_ts, tvfcg_cfc, tvfcg_compute_windows
from dyconnmap.fc import PAC, PLV, plv
def ... | bsd-3-clause | -9,014,730,551,532,827,000 | 24.825 | 90 | 0.650855 | false | 2.63073 | true | false | false |
opello/adventofcode | 2019/python/02-2.py | 1 | 1292 | #!/usr/bin/env python
def test(memory, noun, verb):
pc = 0
m = memory[:]
if noun is not None:
m[1] = noun
if verb is not None:
m[2] = verb
while pc < len(m):
opcode = m[pc]
if opcode == 1:
augend = m[m[pc + 1]]
addend = m[m[pc + 2]]
... | mit | 1,802,724,112,444,968,000 | 22.490909 | 63 | 0.4613 | false | 3.34715 | false | false | false |
erickmusembi/Robot-Project | Robot Project/src/GUI 1.2.py | 1 | 4687 | # Purpose:
# Use the GUI, WASD or the arrow keys to control the robots movement.
# Reason for updated version:
# Reason for an updated version is that using the setWidgetProperties, I would be able to eliminate a lot of repeated
# code and be able to set everything easily through one function therefore saving ti... | mit | 1,625,657,180,546,753,000 | 36.504 | 142 | 0.59633 | false | 3.938655 | false | false | false |
HaraldWeber/client | src/vault/__init__.py | 1 | 7577 | #-------------------------------------------------------------------------------
# Copyright (c) 2012 Gael Honorez.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the GNU Public License v3.0
# which accompanies this distribution, and is available at
# http://w... | gpl-3.0 | -5,015,302,621,376,567,000 | 42.297143 | 245 | 0.571334 | false | 4.062735 | false | false | false |
yunpian/yunpian-python-sdk | yunpian_python_sdk/api/tpl.py | 1 | 6941 | # -*- coding: utf-8 -*-
'''
Created on Jun 19, 2017
@author: dzh
'''
from ..model.constant import (YP_TPL_HOST, APIKEY, VERSION_V2, VERSION_V1, TEMPLATE, TPL_CONTENT, TPL_ID)
from .ypapi import YunpianApi, CommonResultHandler
class TplApi(YunpianApi):
'''模版接口 https://www.yunpian.com/api2.0/tpl.html'''
def _... | mit | -3,225,037,988,573,082,600 | 32.748466 | 132 | 0.577168 | false | 2.115769 | false | false | false |
pepetreshere/odoo | addons/website_sale_digital/models/account_invoice.py | 2 | 1117 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class AccountInvoiceLine(models.Model):
_inherit = ['account.move.line']
def get_digital_purchases(self):
partner = self.env.user.partner_id
# Get paid invoices
... | agpl-3.0 | 8,972,636,751,532,917,000 | 33.90625 | 134 | 0.548791 | false | 3.773649 | false | false | false |
1flow/1flow | oneflow/core/migrations/0045_auto__chg_field_subscription_name.py | 2 | 37393 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Subscription.name'
db.alter_column(u'core_subscription... | agpl-3.0 | -198,511,866,078,923,400 | 94.882051 | 203 | 0.555746 | false | 3.594098 | false | false | false |
nakamura-akifumi/kassis_orange | app_search/views.py | 1 | 6907 | from django.shortcuts import render_to_response, redirect
import riak
import urllib, json
import urllib.parse
import urllib.request
from importer.models import ndl_search_opensearch
import pprint
from django.core.context_processors import csrf
from django.http import HttpResponseNotFound
from django.conf import setting... | mit | -4,388,822,527,134,955,500 | 32.460396 | 136 | 0.577748 | false | 3.411913 | false | false | false |
DmZ/ajenti | plugins/iptables/main.py | 1 | 9577 | from ajenti.ui import *
from ajenti.com import implements
from ajenti.api import *
from ajenti.utils import *
from backend import *
class FirewallPlugin(CategoryPlugin):
text = 'Firewall'
icon = '/dl/iptables/icon.png'
folder = 'system'
platform = ['debian', 'arch', 'opensuse']
defactions = ['AC... | lgpl-3.0 | -949,075,916,936,795,500 | 41.376106 | 131 | 0.481466 | false | 3.975509 | false | false | false |
andrewyoung1991/abjad | abjad/tools/documentationtools/GraphvizNode.py | 1 | 3593 | # -*- encoding: utf-8 -*-
from abjad.tools.datastructuretools import TreeContainer
from abjad.tools.documentationtools.GraphvizObject import GraphvizObject
class GraphvizNode(TreeContainer, GraphvizObject):
r'''A Graphviz node.
'''
### INITIALIZER ###
def __init__(
self,
attributes=N... | gpl-3.0 | 760,710,467,650,906,200 | 26.860465 | 75 | 0.567214 | false | 4.594629 | false | false | false |
umbc-hackafe/sign-drivers | python/games/life.py | 1 | 1050 | from scipy.signal import convolve2d
import numpy as np
import graphics
import random
import driver
import game
import time
rows = 15
cols = 112
class Life(game.Game):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.start = time.time()
self.randomize()
def r... | mit | -3,963,532,010,214,968,300 | 26.631579 | 123 | 0.608571 | false | 3.488372 | false | false | false |
miaecle/deepchem | deepchem/models/tests/test_reload.py | 1 | 1303 | """
Test reload for trained models.
"""
__author__ = "Bharath Ramsundar"
__copyright__ = "Copyright 2016, Stanford University"
__license__ = "MIT"
import unittest
import tempfile
import numpy as np
import deepchem as dc
import tensorflow as tf
from sklearn.ensemble import RandomForestClassifier
class TestReload(unit... | mit | 3,035,550,749,530,206,700 | 26.145833 | 71 | 0.693784 | false | 3.569863 | true | false | false |
sjjhsjjh/blender-driver | applications/marker.py | 1 | 8722 | #!/usr/bin/python
# (c) 2018 Jim Hawkins. MIT licensed, see https://opensource.org/licenses/MIT
# Part of Blender Driver, see https://github.com/sjjhsjjh/blender-driver
"""Python module for Blender Driver demonstration application.
This application adds to the pulsar application. The code illustrates:
- Basic use o... | mit | -3,173,711,479,737,320,400 | 38.466063 | 89 | 0.602155 | false | 3.962744 | false | false | false |
IdeaSolutionsOnline/ERP4R | core/objs/mapa_gestao.py | 1 | 1819 | # !/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""
ERP+
"""
__author__ = ['António Anacleto', 'Jair Medina', 'Abner Oliveira']
__credits__ = []
__version__ = "1.0"
__maintainer__ = ['António Anacleto', 'Jair Medina', 'Jair Medina', 'Abner Oliveira']
__status__ = "Development"
__model_name__= 'mapa_gestao.MapaGestao... | mit | 6,957,941,945,899,023,000 | 30.258621 | 230 | 0.56481 | false | 2.914791 | false | false | false |
sadanandb/pmt | src/tactic/ui/input/text_input_wdg.py | 1 | 53881 | ###########################################################
#
# Copyright (c) 2005-2008, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without w... | epl-1.0 | 705,004,786,934,905,300 | 33.170366 | 147 | 0.481561 | false | 4.152678 | false | false | false |
divio/askbot-devel | askbot/migrations/0134_create_personal_groups_for_all_users.py | 1 | 31877 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from askbot.utils.console import ProgressBar
def format_group_name(user):
"""returns name of the personal group
given the user object
"""
return '_internal_%s_%d' % (user.user... | gpl-3.0 | 3,776,445,326,700,323,300 | 83.330688 | 226 | 0.550962 | false | 3.746709 | false | false | false |
ActiveState/code | recipes/Python/578033_Find_Path_to_Object/recipe-578033.py | 1 | 2083 | import itertools
import collections
def nth(iterable, n, default=None):
"Returns the nth item or a default value"
return next(itertools.islice(iterable, n, None), default)
def find(item, source, depth=1, queue_limit=1000000, found_limit=1000000):
"Tries to find a pathway to access item from source."
a... | mit | 467,757,699,489,428,900 | 38.301887 | 76 | 0.490639 | false | 4.901176 | false | false | false |
editxt/editxt | editxt/platform/mac/app.py | 1 | 2969 | # -*- coding: utf-8 -*-
# EditXT
# Copyright 2007-2014 Daniel Miller <millerdev@gmail.com>
#
# This file is part of EditXT, a programmer's text editor for Mac OS X,
# which can be found at http://editxt.org/.
#
# EditXT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publ... | gpl-3.0 | 2,669,758,308,648,887,300 | 28.989899 | 71 | 0.692826 | false | 3.835917 | false | false | false |
enlavin/MagicBrakeLight | tools/plot.py | 1 | 2653 | """
ldr.py
Display analog data from Arduino using Python (matplotlib)
Author: Mahesh Venkitachalam
Website: electronut.in
"""
import argparse
import serial
from collections import deque
import matplotlib.pyplot as plt
import matplotlib.animation as animation
# plot class
class AnalogPlot(object):
# constr
d... | mit | 207,627,975,991,424,030 | 22.477876 | 62 | 0.564644 | false | 3.449935 | false | false | false |
apanda/modeling | tests/single_fw_test_short_non_rono.py | 1 | 1335 | from examples import NoRonoTest
import z3
import time
import random
import sys
def ResetZ3 ():
z3._main_ctx = None
z3.main_ctx()
z3.set_param('smt.random_seed', random.SystemRandom().randint(0, sys.maxint))
iters = 10
min_hosts = 5
max_hosts = 1000
print "host dmz_time q_time h_time total"
for hc in xrang... | bsd-3-clause | 7,503,695,785,355,351,000 | 26.8125 | 85 | 0.634457 | false | 2.883369 | false | false | false |
rhyolight/nupic.son | app/soc/modules/seeder/logic/providers/provider.py | 1 | 2789 | # Copyright 2010 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | apache-2.0 | 330,479,242,027,618,800 | 30.337079 | 78 | 0.700251 | false | 4.491143 | false | false | false |
katerina7479/pypdflite | pypdflite/pdfobjects/pdffont.py | 1 | 4907 | from .fontref import pdf_character_widths
import copy
CORE_FONTS = {
'courier': 'Courier',
'courier_bold': 'Courier-Bold',
'courier_italic': 'Courier-Oblique',
'courier_bold_italic': 'Courier-BoldOblique',
'helvetica': 'Helvetica',
'helvetica_bold': 'Helvetica-Bold',
'helvetica_it... | mit | 7,889,658,794,822,979,000 | 30.932886 | 76 | 0.539026 | false | 3.789189 | false | false | false |
pyoceans/pocean-core | pocean/dsg/timeseries/im.py | 1 | 1754 | #!python
# coding=utf-8
from pocean.cf import CFDataset
from pocean import logger # noqa
class IncompleteMultidimensionalTimeseries(CFDataset):
@classmethod
def is_mine(cls, dsg, strict=False):
try:
rvars = dsg.filter_by_attrs(cf_role='timeseries_id')
assert len(rvars) == 1
... | mit | 473,172,081,902,996,000 | 29.77193 | 94 | 0.566705 | false | 4.17619 | false | false | false |
manthansharma/snippet-api | snippet/views.py | 1 | 2876 | from django.contrib.auth.models import User
from requests import Response
from rest_framework import generics
from rest_framework import permissions, renderers, parsers
from rest_framework.authtoken.models import Token
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest... | mit | -3,041,957,953,474,178,600 | 30.955556 | 86 | 0.747914 | false | 3.691913 | false | false | false |
bennesp/PyLanDiscovery | PyLanDiscovery.py | 1 | 8419 | #!/usr/bin/python2
import logging, os
from ARP import DiscoverARP
from ICMP import DiscoverICMP
from sniff import DiscoverSniff
from scapy.all import srp1, Ether, ARP, IP, conf, get_if_hwaddr
from gi.repository import Gtk, GObject
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
conf.verb=0
VERSION = "0.4b"... | gpl-3.0 | -6,476,980,161,558,292,000 | 31.890625 | 168 | 0.618363 | false | 3.015401 | false | false | false |
PhillyDSA/phillydsa-com | home/migrations/0011_auto_20170802_1459.py | 1 | 1152 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-02 18:59
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('home', '0010_homepage_share_image'),
]
operations ... | agpl-3.0 | 6,126,321,873,750,861,000 | 43.307692 | 308 | 0.645833 | false | 3.827243 | false | false | false |
danvk/webdiff | setup.py | 1 | 1319 | from setuptools import setup, find_packages
with open('README.md', encoding='utf8') as fh:
long_description = fh.read()
setup(name='webdiff',
version='0.15.0',
description='Two-column web-based git difftool',
long_description=long_description,
long_description_content_type='text/markdown... | apache-2.0 | -4,414,071,558,550,249,500 | 28.977273 | 63 | 0.55345 | false | 4.109034 | false | true | false |
diogo149/autocause | autocause/feature_functions.py | 1 | 3185 | from collections import defaultdict
import numpy as np
from scipy.special import psi
from scipy.stats import pearsonr, chisquare, f_oneway, kruskal
from scipy.spatial.distance import dice, sokalsneath, yule, rogerstanimoto, sokalmichener
from sklearn.decomposition import FastICA
from boomlet.metrics import categorica... | mit | -5,086,420,161,681,375,000 | 25.764706 | 90 | 0.633281 | false | 2.996237 | false | false | false |
docusign/docusign-python-client | docusign_esign/apis/power_forms_api.py | 1 | 40194 | # coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.gi... | mit | 4,390,320,988,661,440,000 | 42.641694 | 140 | 0.551575 | false | 4.681887 | false | false | false |
DouglasOrr/Snippets | treelearn/treelearn/__init__.py | 1 | 2808 | import collections
### HyperOptimization Parameters ###
Scalar = collections.namedtuple("Scalar", ("scale", "default", "min", "max"))
Either = collections.namedtuple("Either", ("alternatives",))
def linear(default, min = None, max = None):
return Scalar("linear", default, min, max)
def logarithmic(default, min ... | mit | 1,935,802,217,488,837,400 | 35 | 91 | 0.644943 | false | 3.836066 | false | false | false |
BL-Labs/meetingsparser | add_meetingdays_to_csv.py | 1 | 5196 | import csv
from datetime import datetime, timedelta
INPUTFILE = 'geocoded_notdated_allyears.csv'
MATCHOUTPUTFILE = 'daysfound.csv'
NOMATCH_FILE = 'unmatched.csv'
MEETINGDATE_HEADER = 'Item Type Metadata:meeting date'
COLLECTION_NAME_HEADER = 'Collection'
# NB This doesn't do anything? commenting out for now.
#Impor... | mit | 6,873,420,354,752,857,000 | 44.982301 | 139 | 0.621824 | false | 3.880508 | false | false | false |
jameslivulpi/pythonprograms | excredit.py | 1 | 4395 | #!/usr/bin/env python3
# James Livulpi
# October 19th 2013
# Triangle program with functions
# SELF EVALUATION
# PROGRAM PRESENTATION
# The header comment at the top contains
# * Your name:yes
# * Date:yes
# * Short specification of the program:
# The comments have correct spelling, gra... | gpl-3.0 | -3,084,694,631,657,090,600 | 35.322314 | 78 | 0.683049 | false | 3.428237 | false | false | false |
patcurry/WebGIS | keywords/views.py | 1 | 1366 | from django.shortcuts import render
from django.shortcuts import get_object_or_404
from keywords.forms import KeywordCreateForm
from keywords.models import Keyword
def keyword_list(request):
"""
This is a view that will show all the keywords.
This view should also show the number of datasets for each key... | mit | -263,101,636,972,582,100 | 31.52381 | 78 | 0.665447 | false | 3.847887 | false | false | false |
Edraak/edx-platform | common/djangoapps/cors_csrf/decorators.py | 1 | 1469 | """Decorators for cross-domain CSRF. """
from django.utils.decorators import decorator_from_middleware
from django.views.decorators.csrf import ensure_csrf_cookie
from cors_csrf.middleware import CrossDomainCsrfViewMiddleware
def ensure_csrf_cookie_cross_domain(func):
"""View decorator for sending a cross-domain C... | agpl-3.0 | -2,878,877,935,169,656,000 | 37.657895 | 75 | 0.697754 | false | 4.126404 | false | false | false |
niwinz/phantompy | phantompy/context.py | 1 | 5303 | # -*- coding: utf-8 -*-
import json
import datetime
from .api import library as lib
from . import util
class Context(object):
def __init__(self):
self._ctx_ptr = lib.ph_context_init()
self._cfg = Config()
def __del__(self):
self._ctx_ptr = None
self._cfg = None
lib.p... | lgpl-2.1 | 5,857,091,495,928,827,000 | 25.515 | 93 | 0.543655 | false | 4.026576 | true | false | false |
eaplatanios/tensorflow | tensorflow/python/ops/resource_variable_ops.py | 1 | 46843 | # Copyright 2016 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... | apache-2.0 | -6,873,279,324,449,681,000 | 40.974014 | 108 | 0.656171 | false | 4.229998 | false | false | false |
galaxy-team/website | newrelic/hooks/framework_pyramid.py | 1 | 3437 | from __future__ import with_statement
import types
import newrelic.api.in_function
import newrelic.api.function_trace
import newrelic.api.transaction
import newrelic.api.object_wrapper
import newrelic.api.error_trace
import newrelic.api.web_transaction
class ViewCallableWrapper(object):
def __init__(self, wrapp... | agpl-3.0 | 8,193,824,038,273,632,000 | 32.368932 | 76 | 0.625546 | false | 3.987239 | false | false | false |
aleksanderhan/imdel_backend | image_server/models.py | 1 | 1355 | from __future__ import unicode_literals
from django.db import models
from django.conf import settings
from django.db.models.signals import post_save
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
def image_path(instance, filename):
# file will be uploaded to MEDIA_ROOT/us... | apache-2.0 | 8,083,244,643,382,870,000 | 33.74359 | 95 | 0.743173 | false | 3.722527 | false | false | false |
thebritican/anovelmous | anovelmous/tests/post_example_novel.py | 1 | 1193 | import argparse
from nltk.corpus import brown
import requests
import arrow
import json
parser = argparse.ArgumentParser()
parser.add_argument('host')
args = parser.parse_args()
def create_new_novel():
url = 'http://{host}/api/novel'.format(host=args.host)
response = requests.post(url, json={'title': 'Test No... | mit | 2,410,901,449,329,036,300 | 31.27027 | 102 | 0.666387 | false | 3.332402 | false | false | false |
loggerhead/Easy-Karabiner | tests/test_generator.py | 1 | 4219 | # -*- coding: utf-8 -*-
from easy_karabiner import __version__
from easy_karabiner import util
from easy_karabiner import query
from easy_karabiner.generator import *
def test_generator():
query.DefinitionBucket.clear()
KEYMAP_ALIAS = {
'flip': 'FlipScrollWheel',
}
DEFINITIONS = {
'BIL... | mit | -3,318,104,241,627,815,400 | 36.008772 | 98 | 0.522399 | false | 3.602904 | false | false | false |
AndKyr/GETELEC | python/ML_FN_plot_comparison.py | 1 | 1760 | #! /usr/bin/python
import numpy as np
import getelec_mod as gt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import matplotlib as mb
font = 30
# mb.rcParams["font.family"] = "Serif"
mb.rcParams["font.size"] = font
mb.rcParams["axes.labelsize"] = font
mb.rcParams["xtick.labelsize"] = font
mb.... | gpl-3.0 | 4,077,963,664,117,768,700 | 23.444444 | 126 | 0.598864 | false | 2.303665 | false | false | false |
centrologic/django-codenerix | codenerix/templatetags/codenerix_lists.py | 1 | 8986 | # -*- coding: utf-8 -*-
#
# django-codenerix
#
# Copyright 2017 Centrologic Computational Logistic Center S.L.
#
# Project URL : http://www.codenerix.com
#
# 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 ... | apache-2.0 | -7,059,109,933,935,863,000 | 25.823881 | 206 | 0.601157 | false | 3.766136 | false | false | false |
incuna/incuna-test-utils | tests/testcases/test_integration.py | 1 | 7807 | # -*- coding: utf-8 -*-
import pytest
from django.contrib.sessions.backends.base import SessionBase
from django.core.handlers.wsgi import WSGIRequest
from django.http import HttpResponse
from incuna_test_utils.testcases.integration import BaseIntegrationTestCase
from tests.factories import UserFactory
from tests.views... | bsd-2-clause | 3,304,966,985,659,805,000 | 33.767857 | 89 | 0.659091 | false | 4.045714 | true | false | false |
liris-vision/starling | harpia/harpiagcfrontend.py | 1 | 35795 | # -*- coding: utf-8 -*-
#
# STARLING PROJECT
# (based on HARPIA PROJECT)
#
# S2i - Intelligent Industrial Systems
# DAS - Automation and Systems Department
# UFSC - Federal University of Santa Catarina
# LIRIS - Laboratoire d'InfoRmatique en Image et Systèmes d'information
#
# Copyright: 2006 - 2007 Luis Carlos Dill ... | gpl-3.0 | -1,738,351,735,758,642,200 | 32.546392 | 232 | 0.63343 | false | 3.25874 | false | false | false |
jaor/bigmler | bigmler/association/dispatcher.py | 1 | 7115 | # -*- coding: utf-8 -*-
#
# Copyright 2015-2020 BigML
#
# 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 ... | apache-2.0 | -1,373,919,397,807,068,700 | 36.845745 | 79 | 0.653689 | false | 4.093786 | true | false | false |
sixfeetup/cloud-custodian | c7n/schema.py | 1 | 12563 | # Copyright 2016-2017 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | apache-2.0 | 9,042,088,915,373,696,000 | 33.138587 | 82 | 0.526626 | false | 4.28625 | false | false | false |
annahs/atmos_research | AL_1min_mass_number_data_to_db.py | 1 | 7539 | #this script is used to add rBC mass to the database
import sys
import os
import datetime
import pickle
import numpy as np
import matplotlib.pyplot as plt
from pprint import pprint
from scipy.optimize import curve_fit
from scipy import stats
from SP2_particle_record_UTC import ParticleRecord
from struct import *
impor... | mit | -5,694,704,111,355,992 | 30.4125 | 145 | 0.654331 | false | 2.548682 | false | false | false |
JanusWind/FC | janus_dialog_save.py | 1 | 4157 | ################################################################################
##
## Janus -- GUI Software for Processing Thermal-Ion Measurements from the
## Wind Spacecraft's Faraday Cups
##
## Copyright (C) 2016 Bennett A. Maruca (bmaruca@udel.edu)
##
## This program is free software: you can redistribute... | gpl-3.0 | -6,470,617,714,519,949,000 | 31.732283 | 80 | 0.53452 | false | 3.944023 | false | false | false |
petrasovaa/grass-rdigit | mapwin/buffered.py | 1 | 73985 | """
@package mapwin.mapwindow
@brief Map display canvas - buffered window.
Classes:
- mapwindow::BufferedWindow
- mapwindow::GraphicsSet
- mapwindow::GraphicsSetItem
(C) 2006-2013 by the GRASS Development Team
This program is free software under the GNU General Public License
(>=v2). Read the file COPYING that c... | gpl-2.0 | -2,906,821,691,940,038,000 | 34.621088 | 110 | 0.53546 | false | 4.062431 | false | false | false |
kd0aij/matrixpilot_old | Tools/MAVLink/mavlink/pymavlink/examples/sigloss.py | 1 | 2193 | #!/usr/bin/env python
'''
show times when signal is lost
'''
import sys, time, os
# allow import from the parent directory, where mavlink.py is
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
from optparse import OptionParser
parser = OptionParser("sigloss.py [options... | gpl-3.0 | -708,016,801,666,724,100 | 33.370968 | 115 | 0.590971 | false | 3.685714 | false | false | false |
googlecodelabs/gcp-marketplace-integrated-saas | python3/impl/step_6_usage_reporting/report.py | 1 | 3372 | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 | 6,478,601,517,065,755,000 | 33.408163 | 81 | 0.557829 | false | 4.379221 | false | false | false |
mozilla/kitsune | kitsune/dashboards/urls.py | 1 | 1537 | from django.conf.urls import url
from kitsune.dashboards import api, views
urlpatterns = [
url(r"^localization$", views.localization, name="dashboards.localization"),
url(r"^contributors$", views.contributors, name="dashboards.contributors"),
url(r"^contributors-old$", views.contributors_old, name="dashb... | bsd-3-clause | 4,026,228,865,629,046,000 | 33.155556 | 93 | 0.635003 | false | 3.930946 | false | true | false |
nriley/StreamVision | HotKey.py | 1 | 2815 | import ctypes
import ctypes.util
__all__ = ('RegisterEventHotKey', 'EventHotKeyID')
Carbon = ctypes.cdll.LoadLibrary(ctypes.util.find_library('Carbon'))
# CFTypeRef CFRetain(CFTypeRef cf);
Carbon.CFRetain.argtypes = [ctypes.c_void_p]
Carbon.CFRetain.restype = ctypes.c_void_p
# void CFRelease(CFTypeRef cf);
Carbon.C... | bsd-2-clause | -5,402,326,462,514,040,000 | 30.988636 | 78 | 0.691297 | false | 3.239356 | false | false | false |
marinho/django-plus | djangoplus/modify_models.py | 1 | 3997 | """
Examples
========
my_app/models.py
----------------
from django.db import models
class CustomerType(models.Model):
name = models.CharField(max_length=50)
def __unicode__(self):
return self.name
class Customer(models.Model):
name = models.CharField(max_length=50)
... | lgpl-3.0 | 3,554,979,180,138,547,000 | 29.746154 | 101 | 0.607706 | false | 4.307112 | false | false | false |
AndrewX192/qubes-core | dom0/qvm-core/qubesutils.py | 1 | 58353 | #!/usr/bin/python
#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2011 Marek Marczykowski <marmarek@invisiblethingslab.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation;... | gpl-2.0 | -7,701,784,351,436,791,000 | 38.189389 | 158 | 0.568283 | false | 3.543633 | false | false | false |
theshammy/GenAn | src/angular_gen/angular_generator.py | 1 | 19326 | import subprocess
import zipfile
import os
import shutil
from angular_gen.jinja_filters import sub_routes_filter
from jinja2 import Environment, FileSystemLoader
from main.common import BColors, FrontendGenerator
_MSG_HEADER_INFO = BColors.OKBLUE + "ANGULAR GENERATOR:" + BColors.ENDC
_MSG_HEADER_FAIL = BColors.FAIL +... | mit | 4,385,819,325,228,946,400 | 38.683778 | 122 | 0.581393 | false | 3.72729 | false | false | false |
CygnusNetworks/nssct | tests/test_logs.py | 1 | 2310 | # -*- encoding: utf-8 -*-
import glob
import logging
import unittest
import nssct.backend.mock
import nssct.controller
import nssct.engine
import nssct.log
import nssct.plugins.detect
import nssct.report
class CheckHandler(logging.Handler):
def __init__(self):
logging.Handler.__init__(self)
self.formatter = nss... | gpl-2.0 | 983,082,181,798,162,600 | 29.8 | 87 | 0.741558 | false | 3.151432 | true | false | false |
wiheto/teneto | teneto/networkmeasures/temporal_degree_centrality.py | 1 | 8735 | """Calculates temporal degree centrality"""
import numpy as np
from ..utils import process_input
def temporal_degree_centrality(tnet, axis=0, calc='overtime', communities=None,
decay=0, ignorediagonal=True):
r"""
Temporal degree of network.
The sum of all connections each ... | gpl-3.0 | -2,613,147,875,896,468,000 | 39.627907 | 97 | 0.584201 | false | 3.608013 | false | false | false |
alset333/NetworkedLearningChatbot | PeterMaar-NetLrnChatBot/Server/Server.py | 1 | 2862 | #!/usr/bin/env python3
# Server.py
import socket
import Chatbot # PyCharm seems to think this is an error, but it seems fine.
import random
__author__ = 'Peter Maar'
__version__ = '0.1.0'
def send(ip, port, message):
udp_ip = ip
udp_port = port
sock = socket.socket(socket.AF_INET, # Internet
... | bsd-3-clause | -5,175,963,492,048,397,000 | 35.227848 | 209 | 0.640461 | false | 3.411204 | false | false | false |
thorrak/fermentrack | gravity/tilt/tilt_monitor_aio.py | 1 | 6514 | #!/usr/bin/python
# TODO - Figure out the best way to convert this to use sync_to_async calls
import os, sys
os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true"
# Let's get sentry support going
from sentry_sdk import init, capture_exception
# This is the sentry queue for Fermentrack
#init('http://3a1cc1f229ae4b0f88a4c6f... | mit | 4,269,213,573,986,152,000 | 35.80226 | 135 | 0.690359 | false | 3.389178 | false | false | false |
chromium/chromium | mojo/public/tools/mojom/mojom/parse/ast.py | 9 | 14957 | # Copyright 2014 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.
"""Node classes for the AST for a Mojo IDL file."""
# Note: For convenience of testing, you probably want to define __eq__() methods
# for all node types; it... | bsd-3-clause | -2,401,944,399,128,534,000 | 34.028103 | 80 | 0.666845 | false | 3.920577 | false | false | false |
DoctorMalboro/CharlaPySidePyDayLujan2014 | ejemplos/ui_ejemplo_14.py | 1 | 2195 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\ejemplo.ui'
#
# Created: Sat Sep 20 10:17:47 2014
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_MainWindow(object):
def setupUi... | bsd-3-clause | 7,782,218,745,461,749,000 | 46.717391 | 129 | 0.722096 | false | 3.784483 | false | false | false |
no2a/ansible | lib/ansible/module_utils/basic.py | 1 | 71241 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 | -245,384,741,776,502,340 | 36.35763 | 182 | 0.552687 | false | 4.181055 | false | false | false |
mohsaad/Algorithms | machine_learning/autoencoders/vae_tf.py | 1 | 6330 | from __future__ import print_function, division
#from builtins import range, input
import util
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
st = tf.contrib.bayesflow.stochastic_tensor
Normal = tf.contrib.distributions.Normal
Bernoulli = tf.contrib.distributions.Bernoulli
class DenseLa... | mit | 358,886,650,287,889,200 | 29.728155 | 95 | 0.573618 | false | 3.436482 | false | false | false |
SuperOxigen/pic16f917-simulator | pic/memory.py | 1 | 1575 |
class RegisterBank(object):
def __init__(self,
registers: list,
size: int):
self._registers = [None]*size
self._size = size
self._nameMap = {} # str -> index
for i in range(min(len(registers), size)):
self.registers[i] = registers[i]
... | mit | 5,036,802,121,288,166,000 | 27.636364 | 74 | 0.552381 | false | 3.908189 | false | false | false |
rtb1c13/scripts | Hydration_FE/scale_OH.py | 1 | 1489 | #!/usr/bin/env python
# Script to print out scaled quadrupole entries for a list of atom types (user-dfeined)
import sys
if len(sys.argv) < 3:
print "Usage = scale_OH.py [FILENAME] [ATOM TYPES]"
# Read in input file and atom types
infile = sys.argv[1]
attypes = []
for i in sys.argv[2:]:
attypes.append(int(i))
... | gpl-2.0 | -1,553,060,507,358,545,000 | 27.09434 | 87 | 0.62458 | false | 2.777985 | false | false | false |
menify/sandbox | aql/aql/utils/aql_path_utils.py | 1 | 11554 | #
# Copyright (c) 2014 The developers of Aqualid project - http://aqualid.googlecode.com
#
# 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 th... | mit | 7,092,666,700,097,147,000 | 27.458128 | 113 | 0.525705 | false | 3.88631 | false | false | false |
amyliu345/zulip | contrib_bots/run.py | 1 | 2044 | #!/usr/bin/env python
from __future__ import print_function
import importlib
import logging
import optparse
import os
import sys
our_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, our_dir)
from bot_lib import run_message_handler_for_bot
def get_lib_module(lib_fn):
lib_fn = os.path.abspath(l... | apache-2.0 | 2,688,408,368,011,759,000 | 27 | 76 | 0.608611 | false | 3.676259 | false | false | false |
kansanmuisti/kamu | lexicon/stemming.py | 1 | 2558 | # -*- coding: utf-8 -*-
import os
import re
import ctypes
import threading
from itertools import chain
stripper = re.compile(r'[^\w\-:]', re.U)
def string_to_words(s):
s = s.lower()
s = stripper.sub(' ', s)
words = s.split()
return words
class Stemmer(object):
FI_PROJECT = 'sukija/suomi.pro'
... | agpl-3.0 | -1,664,404,970,068,755,000 | 29.238095 | 71 | 0.50748 | false | 3.243934 | false | false | false |
mapr/impala | tests/query_test/test_metadata_query_statements.py | 1 | 8983 | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Impala tests for queries that query metadata and set session settings
import logging
import pytest
from tests.beeswax.impala_beeswax import ImpalaBeeswaxException
from subprocess import call
from tests.common.test_vector import *
from test... | apache-2.0 | 5,331,585,580,957,946,000 | 40.206422 | 89 | 0.668485 | false | 3.439127 | true | false | false |
shrimpboyho/openrobot | robotpy/translate.py | 1 | 6184 | '''
This module consists of the main functions that handle code translation from the front-end (openrobot) to an internal representation.
'''
import re
from constants import *
from helper import *
def translate(FILENAME):
''' Translate function '''
# Standard storage containers
functions = ... | mit | -9,010,086,039,002,676,000 | 24.886957 | 133 | 0.589748 | false | 3.614261 | false | false | false |
rashoodkhan/DjangoBB | djangobb_forum/models.py | 1 | 19091 | # coding: utf-8
from hashlib import sha1
import os
from django.conf import settings
from django.contrib.auth.models import Group
from django.db import models
from django.db.models import aggregates
from django.db.models.signals import post_save
from django.utils import timezone
from django.utils.translation import ug... | bsd-3-clause | -5,691,613,692,580,210,000 | 39.705757 | 184 | 0.634592 | false | 3.841247 | true | false | false |
facoy/facoy | Import/ImportAST.py | 1 | 2286 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from java.util import Date
from java.util.concurrent import Executors, TimeUnit
from GitSearch.Indexer.NewJavaParser import parse
import GitSearch.MyUtils as MyUtils
from java.lang import Runnable
from java.util.concurrent import Callable
pool = Executors.newFixedThreadPo... | apache-2.0 | -4,834,848,341,981,076,000 | 27.936709 | 158 | 0.70547 | false | 2.956016 | false | false | false |
joy13975/elfin | pymol_scripts/extensions/extrude_hub_at_single_n.py | 1 | 2736 | #!/usr/bin/env python3
#
# A PyMol extension script to test extrusion of a hub from a single module's
# n-term
#
def main():
"""main"""
raise RuntimeError('This module should not be executed as a script')
if __name__ =='__main__':
main()
in_pymol = False
try:
import pymol
in_py... | mit | 4,517,744,708,969,852,000 | 31.390244 | 91 | 0.550439 | false | 3.571802 | false | false | false |
masterkeywikz/seq2graph | amr2seq/data_prep/identify_entity.py | 1 | 1607 | #!/usr/bin/python
import re, sys
def entities_inline(line):
pattern = re.compile('\[([^\[\]]+)\]')
entities = []
line = line.strip()
if line:
position = 0
#print >>wf, 'sentence %d:' % (i+1)
while position < len(line):
match = pattern.search(line, position)
... | mit | 5,390,245,021,939,217,000 | 29.903846 | 62 | 0.425638 | false | 4.037688 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.