repo_name stringlengths 5 100 | path stringlengths 4 254 | copies stringlengths 1 5 | size stringlengths 4 7 | content stringlengths 681 1M | license stringclasses 15
values | hash int64 -9,223,351,895,964,839,000 9,223,298,349B | line_mean float64 3.5 100 | line_max int64 15 1k | alpha_frac float64 0.25 0.97 | autogenerated bool 1
class | ratio float64 1.5 8.15 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Yvtou/Marriage-Spider | Match.py | 1 | 1711 | # -*- coding: utf-8 -*-
__author__ = 'Owen'
import urllib2
import re
from openpyxl import Workbook
#建立工作表格
wb = Workbook()
ws = wb.active
ws.title = "test"
#设置需要抓取的页面范围
for pageIndex in range(3, 10):
print u'正在抓取第' + str(pageIndex) + u'位的信息……'
#抓取网页的地址
url = 'http://www.i520.org.tw/products-' + str(pag... | gpl-2.0 | -8,156,034,206,582,531,000 | 28 | 210 | 0.518649 | false | 2.234277 | false | false | false |
baixuexue123/note | python/basics/internet/select/select_test.py | 1 | 2304 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import select
import socket
import Queue
"""
通常 nonblocking模式, 如果socket没准备好的情况下, 试图用发送或接受数据, 对send()和recv()的调用
会产生socket.error异常
"""
sock_server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock_server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, ... | bsd-2-clause | -3,976,293,605,853,064,000 | 28.813333 | 77 | 0.562165 | false | 3.726667 | false | false | false |
phenoxim/nova | nova/policies/config_drive.py | 1 | 1625 | # Copyright 2016 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 | -5,259,392,847,009,989,000 | 30.862745 | 78 | 0.622769 | false | 4.13486 | false | false | false |
locomatix/locomatix-python | locomatix/responses.py | 1 | 8527 | ###############################################################################
#
# Copyright 2010 Locomatix, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.... | apache-2.0 | 2,477,320,978,344,966,000 | 31.422053 | 114 | 0.700246 | false | 3.884738 | false | false | false |
mdraeger/alarmclock | settingsHandler.py | 1 | 1925 | ## alarmclock (resembles a an alarm clock for raspberry pi with a
## 2.8" LCD touch display
## Copyright (C) 2014 Marco Draeger
##
## 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 Fou... | gpl-3.0 | 5,689,815,801,235,118,000 | 35.320755 | 75 | 0.665974 | false | 3.811881 | false | false | false |
ucsd-ccbb/Oncolist | src/server/Schema/DrugsSchemaBuilder.py | 1 | 1857 | __author__ = 'guorongxu'
import sys
def build_schema(output_file, prefix):
filewriter = open(output_file, "a")
filewriter.write("curl -XDELETE \'http://localhost:9200/drugs/" + prefix + "\'\n")
filewriter.write("curl -XPUT \'http://localhost:9200/drugs/" + prefix + "/_mapping\' -d \'\n")
filewriter.w... | mit | -2,766,666,029,948,322,000 | 45.425 | 104 | 0.551427 | false | 2.747041 | false | false | false |
mdavoodi/konkourse-python | documents/forms.py | 1 | 1838 | # File upload form
from django import forms
from documents.restrictions import RestrictedFileField
class DocumentForm(forms.Form):
types = [
'application/msword',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/vnd.openxmlformats-officedocument.wordp... | mit | -2,663,933,192,018,307,000 | 47.368421 | 84 | 0.700762 | false | 3.805383 | false | false | false |
michelesr/network-monitor-server | src/addresses.py | 1 | 1625 | #! /usr/bin/env python
"""
Framework di monitoraggio della rete
Modulo per la gestione degli indirizzi di rete
"""
from socket import socket
def _get_ip():
"""
Questa funzione restituisce l'indirizzo ip della macchina ottenendolo
dal nome di una socket verso google.com. Restituisce False se si
v... | gpl-3.0 | 5,626,488,216,610,293,000 | 25.209677 | 75 | 0.634462 | false | 3.060264 | false | false | false |
seap-udea/jSpice | bin/jspice/spicext.py | 1 | 9507 | #!/usr/bin/python
#############################################################
# /###### /## #
# /##__ ## |__/ #
# /##| ## \__/ /###### /## /####### /###### #
# |__/| ###### /##__ ##| ## /##_____/ /##__ ... | apache-2.0 | -5,815,242,042,989,479,000 | 30.068627 | 88 | 0.535185 | false | 3.048092 | false | false | false |
Anaconda-Platform/anaconda-client | binstar_client/mixins/package.py | 1 | 1070 | '''
Created on May 23, 2014
@author: sean
'''
from binstar_client.utils import jencode
from binstar_client.errors import Conflict
class PackageMixin(object):
def copy(self, owner, package, version, basename=None,
to_owner=None, from_label='main', to_label='main', replace=False, update=False):
... | bsd-3-clause | 1,313,989,696,757,145,000 | 30.470588 | 117 | 0.628037 | false | 3.807829 | false | false | false |
colloquium/spacewalk | backend/server/test/unit-test/rhnSQL/test_executemany.py | 1 | 1833 | #!/usr/bin/python
# Copyright (c) 2005--2010 Red Hat, Inc.
#
#
#
# $Id$
raise Exception("""
This test is no more valid; see the bug
https://bugzilla.redhat.com/show_bug.cgi?id=423351
""")
import os
import unittest
from spacewalk.server import rhnSQL
DB = 'rhnuser/rhnuser@webdev'
class ExecutemanyTest(unittest.Te... | gpl-2.0 | -2,491,424,647,257,956,400 | 25.185714 | 78 | 0.556465 | false | 3.53861 | true | false | false |
agoravoting/agora-tally | agora_tally/ballot_codec/nvotes_codec.py | 1 | 46867 | # self file is part of agora-tally.
#
# Copyright (C) 2021 Agora Voting SL <agora@agoravoting.com>
# agora-tally is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License.
#
# ago... | agpl-3.0 | -8,964,742,366,602,631,000 | 30.878912 | 141 | 0.524092 | false | 3.682672 | false | false | false |
octaflop/artofpython | art/turtle/hilbert.py | 1 | 1024 | # -*- coding: utf-8 -*-
import turtle as t
iteration = 8
length = 5
def left_hilbert(length, width):
if length == 0:
return
t.right(90)
right_hilbert(length - 1, width)
t.forward(width)
t.left(90)
left_hilbert(length - 1, width)
t.forward(width)
left_hilbert(length - 1, width)... | mit | 3,001,966,034,552,017,000 | 18.320755 | 36 | 0.56543 | false | 2.775068 | false | false | false |
shivkantranade/geointegration | geointegration/settings.py | 1 | 2145 | """
Django settings for skr_webapp project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)... | unlicense | -6,588,610,857,729,066,000 | 23.386364 | 71 | 0.723077 | false | 3.269817 | false | false | false |
rolisz/receipt_budget | receipts/receipts/models.py | 1 | 3725 | from collections import namedtuple
import datetime
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models import Sum
from django.contrib.auth.models import User
from django.db.models.signals import pre_save
from django.dispatch import receiver
from geopy.geocoders import G... | bsd-3-clause | -7,431,672,799,133,433,000 | 34.47619 | 113 | 0.644832 | false | 3.812692 | false | false | false |
GoogleCloudPlatform/keras-idiomatic-programmer | zoo/mobilenet/mobilenet_v2_c.py | 1 | 8542 | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | -1,422,260,383,125,294,800 | 37.304933 | 100 | 0.581948 | false | 3.907594 | false | false | false |
comparemetrics/GoogleAppsAccountManager | src/GoogleAppsAccountManager/frontend/nickname2.py | 1 | 6343 | # -*- coding: utf-8 -*-
#
# GoogleAppsAccountManager: frontend/nickname2
# Copyright (C) 2012-2013 KAMEI Yutaka
#
# License: GNU General Public License version 2 or later
# Date: 2013-01-16, since 2013-01-16
#
# NICKNAME2 HELP
NICKNAME_HELP2 = """Usage: gapps-tool nickname2 <subcommand>
Available subcommands:
crea... | gpl-2.0 | 8,476,544,285,538,669,000 | 31.362245 | 96 | 0.523412 | false | 4.457484 | false | false | false |
adfernandes/mbed | targets/TARGET_STM/tools/STM32_gen_PeripheralPins.py | 5 | 73232 | #!/usr/bin/env python
"""
* SPDX-License-Identifier: BSD-3-Clause
******************************************************************************
*
* Copyright (c) 2016-2020 STMicroelectronics.
* All rights reserved.
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You ... | apache-2.0 | 4,804,557,385,279,924,000 | 37.421826 | 172 | 0.527993 | false | 3.115327 | false | false | false |
zetaops/zengine | tests/test_channel_management.py | 1 | 17190 | # -*- coding: utf-8 -*-
"""
"""
# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.
import time
from zengine.lib.test_utils import BaseTestCase
from zengine.models import User
from zengine.messaging.model import Channel, Subscri... | gpl-3.0 | 7,119,566,577,026,506,000 | 47.286517 | 99 | 0.615998 | false | 3.981932 | true | false | false |
AtalM2/iAtal | src/python/classes.py | 1 | 1384 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2012
#
# This file is part of iAtal.
#
# iAtal 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 opt... | gpl-3.0 | 8,569,586,578,108,410,000 | 29.086957 | 70 | 0.703035 | false | 3.226107 | false | false | false |
Daniel-CA/odoo-addons | __unported__/avanzosc_module_doc/wizard/create_module_documentation.py | 1 | 3050 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2008-2013 AvanzOSC S.L. All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 | -3,631,337,101,992,934,000 | 44.522388 | 83 | 0.535738 | false | 4.206897 | false | false | false |
neuromat/nira | person/views.py | 1 | 5872 | # -*- coding: utf-8 -*-
from collections import Counter
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.urls import reverse
from django.shortcuts import render, redirect
from django.utils.translation import ugettext_lazy as _
from person.models import CitationN... | mpl-2.0 | -4,193,132,889,697,596,000 | 36.608974 | 106 | 0.656724 | false | 3.385459 | false | false | false |
Hguimaraes/gtzan.keras | src/gtzan/data/make_dataset.py | 1 | 3938 | import os
import librosa
import itertools
import numpy as np
import pandas as pd
from scipy.stats import kurtosis
from scipy.stats import skew
def get_features(y, sr, n_fft = 1024, hop_length = 512):
# Features to concatenate in the final dictionary
features = {'centroid': None, 'roloff': None, 'flux': None, '... | mit | -2,235,305,071,240,203,500 | 35.472222 | 116 | 0.647029 | false | 3.145367 | false | false | false |
MridulS/GraphSpace | graphs/forms.py | 1 | 3011 | '''
See https://docs.djangoproject.com/en/dev/topics/forms/ for details.
'''
from django import forms
from graphs.util import db
class LoginForm(forms.Form):
'''
Login Form used to show login fields in GraphSpace webpages.
This form is located within the top navbar.
'''
# attrs to specify extra html attribut... | gpl-2.0 | 9,170,254,614,169,942,000 | 34.857143 | 175 | 0.68914 | false | 3.379349 | false | false | false |
onnudilol/vetcalc | calc/views.py | 1 | 8644 | from django.shortcuts import render
from common.models import Injection, CRI
from calc.forms import CalcInjForm, CRISimpleForm, CRIAdvancedForm, CRIInsulinForm, CRICPRForm, CRIMetoclopramideForm
from collections import OrderedDict
def calc_injection(request):
"""Calculates injection dosages based on weight.
... | mit | -8,529,278,159,513,784,000 | 33.854839 | 126 | 0.523022 | false | 3.841778 | false | false | false |
nelhage/taktician | python/test/train/test_features.py | 1 | 2650 | import tak.train
import tak.ptn
import tak.symmetry
import numpy as np
class TestFeatures(object):
def extra_planes(self, feat):
return feat[:,:,14:]
def is_onehot(self, m, axis=2):
return np.all(np.sum(m, axis) == 1)
def test_zero_features(self):
b = tak.Position.from_config(tak.Config(size=5))
... | mit | -8,654,246,127,363,407,000 | 29.113636 | 111 | 0.593585 | false | 2.38954 | false | false | false |
daniel-j-h/libosrmc | bindings/osrm_or-tools.py | 1 | 1925 | #!/usr/bin/env python2
from __future__ import print_function
import sys
import random
from osrmcpy import OSRM, Coordinate
from ortools.constraint_solver.pywrapcp import RoutingParameters, RoutingModel, RoutingSearchParameters
# Integration with Google's or-tools for Traveling Salesman Problems
def main():
if ... | mit | -8,368,498,982,474,790,000 | 30.557377 | 112 | 0.65974 | false | 3.827038 | false | false | false |
openp2pdesign/OpenMetaDesignApp | openmetadesign.py | 1 | 41157 | # -*- coding: utf-8 -*-
#
# Open MetaDesign 0.1
#
# Author: Massimo Menichinelli
# Website:
# http://openmetadesign.org
# http://openp2pdesign.org
#
# License: GPL v.3
#
import os
import wx
import wx.lib.mixins.inspection
import wx.lib.scrolledpanel as scrolled
import thread
#from github import Github
from modules.cl... | gpl-3.0 | -4,790,389,888,538,539,000 | 47.587957 | 200 | 0.627788 | false | 3.395825 | false | false | false |
tobijk/ecromedos | lib/net/ecromedos/plugins/glossary.py | 1 | 6305 | # -*- coding: utf-8 -*-
#
# Desc: This file is part of the ecromedos Document Preparation System
# Author: Tobias Koch <tobias@tobijk.de>
# License: MIT
# URL: http://www.ecromedos.net
#
import sys, locale, functools
import lxml.etree as etree
from net.ecromedos.error import ECMDSPluginError
def getInstance(c... | mit | -4,314,297,649,408,277,000 | 27.147321 | 77 | 0.51927 | false | 4.129011 | true | false | false |
fregaham/DISP | test/aplikace2/src/main.py | 1 | 1871 | # -*- coding: utf-8 -*-
# copyright (C) 2006 Marek Schmidt
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This prog... | gpl-2.0 | 1,727,076,181,453,910,800 | 27.348485 | 97 | 0.656868 | false | 3.401818 | false | false | false |
ashayas/MathSitter | files/fractionDivMult.py | 1 | 12369 | #!/usr/bin/env python3
"""
@author Ashaya Sharma
@date July 22, 2015
Fraction multiplication and division
Program that randomly generates multiplication and division of fraction problems
and checks if user input matches
MathSitter Beta
"""
import random
#tkinter is the GUI library used for project documentatio... | mit | 6,059,192,020,498,790,000 | 37.409938 | 281 | 0.600016 | false | 3.900347 | false | false | false |
jl2005/go-srs | research/tcp/tcp.server.py | 1 | 1922 | '''
================================================================================================
1. VirtualBox, Thinkpad, T430, 2CPU, 4096B/packet, S:Python, C:Python
python tcp.server.py 1990 4096
python tcp.client.py 127.0.0.1 1990 4096
----total-cpu-usage---- -dsk/total- ---net/lo-- ---paging-- ---system--
usr ... | mit | 7,797,210,427,724,604,000 | 35.264151 | 172 | 0.515088 | false | 3.140523 | false | false | false |
ryfeus/lambda-packs | pytorch/source/torch/_tensor_docs.py | 1 | 70644 | """Adds docstrings to Tensor functions"""
import torch._C
from torch._C import _add_docstr as add_docstr
from ._torch_docs import parse_kwargs
def add_docstr_all(method, docstr):
add_docstr(getattr(torch._C._TensorBase, method), docstr)
new_common_args = parse_kwargs("""
size (int...): a list, tuple, or :cl... | mit | 8,127,286,000,224,170,000 | 22.59519 | 114 | 0.59671 | false | 3.182162 | false | false | false |
peterheim1/robbie | bin/tf_head_tracker.py | 1 | 13024 | #!/usr/bin/env python
"""
tf_head_tracker.py - Version 1.0 2011-08-01
Move the head to track a PointStamped target on the /target_point topic.
Created for the Pi Robot Project: http://www.pirobot.org
Copyright (c) 2011 Patrick Goebel. All rights reserved.
This program is free software; ... | gpl-3.0 | 2,277,179,604,030,267,000 | 43.29932 | 124 | 0.575937 | false | 4.104633 | false | false | false |
kwameboame/newsdex | news/utils/twitter_utils.py | 1 | 5325 | # coding=utf-8
import json
import logging
import time
from datetime import datetime, timedelta
from django.utils import timezone
from tweepy import StreamListener, OAuthHandler, Stream, API
from news.models import TwitterUser, Tweet, TwitterAPISetting
from news.models.twitter import FilterKeyword, FilterLocation, Twit... | bsd-2-clause | -7,017,367,773,884,610,000 | 40.601563 | 169 | 0.627793 | false | 3.836455 | false | false | false |
rangermeier/flaskberry | flaskberry/models/disk.py | 1 | 3422 | # -*- coding: utf-8 -*-
import subprocess
import re
import os
import psutil
MOUNTPOINTS = ["/home/media/disks/usb%s" % i for i in range(8)]
class Disk(dict):
def __init__(self, **args):
self.mounted = False
if args.has_key("uuid"):
self.uuid = args["uuid"]
if self.uuid_exis... | mit | 7,954,179,522,211,220,000 | 32.54902 | 95 | 0.527177 | false | 3.884222 | false | false | false |
all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_1_0_6/models/imagingobjectselection.py | 1 | 9601 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 1.0.2.7202 (http://hl7.org/fhir/StructureDefinition/ImagingObjectSelection) on 2016-06-23.
# 2016, SMART Health IT.
from . import domainresource
class ImagingObjectSelection(domainresource.DomainResource):
""" Key Object Selection.
... | bsd-3-clause | 9,194,539,053,608,248,000 | 37.404 | 138 | 0.629726 | false | 4.418316 | false | false | false |
tochikuji/pyPyrTools | pyrtools/blurDn.py | 1 | 2593 | import numpy
from .namedFilter import namedFilter
from .corrDn import corrDn
def blurDn(*args):
''' RES = blurDn(IM, LEVELS, FILT)
Blur and downsample an image. The blurring is done with filter
kernel specified by FILT (default = 'binom5'), which can be a string
(to be passed to namedFilt... | mit | 7,257,363,821,098,295,000 | 32.675325 | 83 | 0.528731 | false | 3.320102 | false | false | false |
D4N/FSM_exercise_class | sheet_3/2d_plot.py | 1 | 2451 | #-*- coding: utf-8 -*-
from __future__ import division, print_function
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
class simulation_output(object):
def __init__(self, filename):
self.__filename = str(filename)
self.get_data_from_file()
def get_data_from_file... | gpl-3.0 | -4,800,749,468,022,277,000 | 22.796117 | 88 | 0.598939 | false | 2.64973 | false | false | false |
twilio/twilio-python | tests/integration/insights/v1/call/test_event.py | 1 | 7025 | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class EventTestCase(Integration... | mit | -8,465,989,922,263,330,000 | 41.575758 | 155 | 0.34306 | false | 4.961158 | true | false | false |
openfisca/legislation-ipp-to-code | ipp_tax_benefit_tables_to_openfisca_parameters.py | 1 | 24949 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <contact@openfisca.fr>
#
# Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of OpenFisca.
#
# OpenFisca is free software; you can redist... | agpl-3.0 | 6,170,964,241,538,797,000 | 38.871795 | 120 | 0.521463 | false | 3.857364 | true | false | false |
vecnet/om | website/apps/ts_om/views/ScenarioListView.py | 1 | 1416 | # -*- coding: utf-8 -*-
#
# This file is part of the VecNet OpenMalaria Portal.
# For copyright and licensing information about this package, see the
# NOTICE.txt and LICENSE.txt files in its top-level directory; they are
# available at https://github.com/vecnet/om
#
# This Source Code Form is subject to the terms of t... | mpl-2.0 | 7,419,997,059,402,621,000 | 38.333333 | 114 | 0.731638 | false | 3.847826 | false | false | false |
FilipeMaia/h5proxy | h5proxy/serializer.py | 1 | 5488 | import numpy
import h5py
import cPickle as pickle
class Serializer(object):
def __init__(self, parent, socket = None):
self._parent = parent
self._socket = socket
if(socket):
import threading
self.lock = threading.Lock()
else:
# Use an internal ... | bsd-2-clause | -8,297,233,515,295,991,000 | 36.589041 | 103 | 0.493258 | false | 4.447326 | false | false | false |
rssalessio/PythonVRFT | test/test_vrft.py | 1 | 3518 | # test_vrft.py - Unittest for VRFT
#
# Code author: [Alessio Russo - alessior@kth.se]
# Last update: 10th January 2021, by alessior@kth.se
#
# Copyright (c) [2017-2021] Alessio Russo [alessior@kth.se]. All rights reserved.
# This file is part of PythonVRFT.
# PythonVRFT is free software: you can redistribute it and/or ... | gpl-3.0 | -6,444,991,884,711,760,000 | 36.425532 | 90 | 0.545765 | false | 3.043253 | true | false | false |
vmonaco/single-hashing | single_hash.py | 1 | 2647 | '''
Created on Nov 20, 2012
@author: vinnie
'''
from utils import *
def in1d_running(q, A):
'''
j where q[k] in A for 0 <= k <= j
This is the maximum index j where q[0:j] is in A
'''
j = 0
while j < len(q) and q[j] in A:
j += 1
return j
def s_A(Q, A):
'''
s(A) = {(i,j) |... | mit | -4,057,426,931,684,197,400 | 24.451923 | 79 | 0.553457 | false | 2.870933 | false | false | false |
nudomarinero/mltier1 | test/test_extinction.py | 1 | 3308 | """
Test the extinction module
"""
from __future__ import print_function
import sys
import os
import unittest
import numpy as np
import requests.exceptions
from astropy import units as u
import numpy.testing as npt
# Append the module to test
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
from exti... | gpl-3.0 | -3,343,834,670,868,604,000 | 33.458333 | 130 | 0.682285 | false | 3.018248 | true | false | false |
futurecolors/gopython3 | gopython3/core/rest.py | 1 | 2372 | from django.db import transaction
from rest_framework import viewsets, routers, status, mixins
from rest_framework.decorators import api_view, action
from rest_framework.generics import RetrieveAPIView, ListAPIView
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framewo... | mit | -1,590,789,759,737,583,600 | 36.0625 | 135 | 0.676644 | false | 4.243292 | false | false | false |
Detailscool/YHSpider | BillboardAnalysis/bill/spiders/billtoprap.py | 1 | 1396 | #!/usr/bin/python
# -*- coding:utf-8 -*-
# billtoprap.py
# Created by HenryLee on 2017/9/14.
# Copyright © 2017年. All rights reserved.
# Description :
from bill.items import BillItem
from scrapy import Spider, Request
from bs4 import BeautifulSoup
class BillSpider(Spider):
name = 'billtoprap_spider'
allo... | mit | -5,613,891,393,085,021,000 | 38.8 | 117 | 0.608758 | false | 3.364734 | false | false | false |
HewlettPackard/python-hpOneView | hpOneView/oneview_client.py | 1 | 39340 | # -*- coding: utf-8 -*-
###
# (C) Copyright (2012-2018) Hewlett Packard Enterprise Development LP
#
# 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 limi... | mit | 2,875,821,582,522,807,000 | 30.598394 | 143 | 0.627173 | false | 4.40982 | true | false | false |
RuthAngus/chronometer | chronometer/fit_dispersion.py | 1 | 2000 | import numpy as np
from action_age_evolution import calc_dispersion
import emcee
import corner
import matplotlib.pyplot as plt
plotpar = {'axes.labelsize': 18,
'font.size': 10,
'legend.fontsize': 15,
'xtick.labelsize': 18,
'ytick.labelsize': 18,
'text.usetex': Tru... | mit | 5,217,928,310,203,504,000 | 27.985507 | 78 | 0.5585 | false | 2.628121 | false | false | false |
mozilla/universal-search-recommendation | recommendation/mozlog/middleware.py | 1 | 2336 | import json
import re
import time
from flask import current_app, request
IS_PROTOCOL = r'^[^\s]+\:\S'
IS_HOSTNAME = r'^[^\s]+\.\S'
LOG_PATH_BLACKLIST = [
'/favicon.ico',
'/__heartbeat__',
'/__lbheartbeat__',
'/nginx_status',
'/robots.txt',
'/images'
]
def request_timer():
"""
before... | mpl-2.0 | 9,072,272,571,820,170,000 | 28.948718 | 78 | 0.587329 | false | 3.952623 | false | false | false |
Gargamel1989/Seasoning-old | Seasoning/authentication/views/account_views.py | 1 | 6951 | from django.contrib.auth.decorators import login_required
from django.contrib.auth import get_user_model
from authentication.forms import AccountSettingsForm, DeleteAccountForm,\
CheckActiveAuthenticationForm
from authentication.models import NewEmail, User
from django.contrib import messages
from django.cont... | gpl-3.0 | 177,147,796,472,188,670 | 40.907407 | 161 | 0.625522 | false | 4.413333 | false | false | false |
pythoneasyway/python-class | class8.py | 1 | 1656 | #!/usr/bin/python
#: Title : class8.py
#: Date :
#: Author : pythoneasyway@gmail.com
#: Description : Class number 8
#: - exercises with lists
#: - adding steps into circle() to change the shape
#: Version : 1.0
# define 2 lists
even_list = list()
odd_list = li... | mit | 3,465,932,965,838,154,000 | 23 | 77 | 0.618961 | false | 3.272727 | false | false | false |
gdsfactory/gdsfactory | pp/components/extend_ports_list.py | 1 | 1197 | from typing import Any, Dict, List, Optional
from pp.cell import cell
from pp.component import Component
from pp.components.straight_heater import straight_with_heater
from pp.port import Port, auto_rename_ports
from pp.types import ComponentOrFactory
@cell
def extend_ports_list(
ports: List[Port],
extension... | mit | 2,180,702,165,455,955,500 | 26.204545 | 65 | 0.663325 | false | 3.638298 | false | false | false |
tksn/phoneauto | phoneauto/scriptgenerator/scriptgenerator_ui.py | 1 | 26121 | # -*- coding: utf-8 -*-
"""scriptgenerator GUI
:copyright: (c) 2015 by tksn
:license: MIT
"""
# pylint: disable=invalid-name
# pylint: disable=too-many-instance-attributes
# pylint: disable=too-few-public-methods
from __future__ import unicode_literals, print_function
import contextlib
import logging
import math
impo... | mit | -2,263,941,709,933,397,800 | 37.526549 | 79 | 0.567015 | false | 3.984289 | false | false | false |
b3orn/mania | mania/compiler.py | 1 | 3056 | # -*- coding: utf-8 -*-
'''
mania.compiler
~~~~~~~~~~~~~~
:copyright: (c) 2014 by Björn Schulz.
:license: MIT, see LICENSE for more details.
'''
from __future__ import absolute_import
import logging
import io
import mania.types
import mania.instructions
logger = logging.getLogger(__name__)
class Plac... | mit | -7,002,074,155,497,473,000 | 22.867188 | 81 | 0.629787 | false | 3.993464 | false | false | false |
tshi04/machine-learning-codes | GAN-tf-ff/dc_gen.py | 1 | 2717 | import re
import math
import numpy as np
import tensorflow as tf
import tensorflow.contrib as tc
from utils import *
class generator(object):
def __init__(self, data_name='MNIST'):
self.data_name = data_name
def __call__(self, input_data, img_shape, reuse=False, name='generator'):
if self.d... | gpl-3.0 | 7,319,559,567,595,346,000 | 35.716216 | 104 | 0.517483 | false | 2.915236 | false | false | false |
tmhorne/celtx | extensions/python/dom/nsdom/domcompile.py | 1 | 4935 | # ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (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.mozilla.org/MPL/
#
# Softwa... | mpl-2.0 | 78,361,717,112,699,170 | 39.45082 | 83 | 0.684904 | false | 3.913561 | false | false | false |
x5zone/Mynote | bet365/test.py | 1 | 5052 | #!/usr/bin/python
# coding:utf-8
import gzip
import re
import time
import redis
from urllib2 import urlopen
import urlparse
import bs4
r = redis.Redis(host='localhost',port=6379,db=0)
def save2redis(match_id,key,value):
r.hset(match_id,key,value)
def getfromredis(match_id):
return r.hgetall(match_id)
def mai... | unlicense | 2,712,315,846,516,340,700 | 30.779221 | 105 | 0.483449 | false | 3.032218 | false | false | false |
avian2/ec3k | ec3k.py | 1 | 12641 | """Software receiver for EnergyCount 3000
Copyright (C) 2015 Tomaz Solc <tomaz.solc@tablix.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) a... | gpl-3.0 | 8,677,844,192,735,593,000 | 26.126609 | 89 | 0.665849 | false | 2.827964 | false | false | false |
deepmind/dm_alchemy | dm_alchemy/symbolic_alchemy_wrapper.py | 1 | 7573 | # Lint as: python3
# Copyright 2020 DeepMind Technologies Limited. 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
#
# U... | apache-2.0 | 2,939,894,921,043,146,000 | 41.785311 | 80 | 0.663938 | false | 3.552064 | false | false | false |
miguelfrde/openautomata | openautomata/regex.py | 1 | 3734 |
from automata import *
from collections import defaultdict
OR = '|'
CLOSURE = '*'
POS_CLOSURE = '+'
WILD_CARD = '.'
SYMBOLS = (')', '(', OR, CLOSURE, POS_CLOSURE)
def balanced_parenthesis(txt):
count = 0
for c in txt:
if c == '(': count += 1
if c == ')': count -= 1
if count < 0: ... | mit | -8,601,334,346,309,791,000 | 34.226415 | 88 | 0.502678 | false | 3.783181 | false | false | false |
openlawlibrary/pygls | tests/lsp/test_code_action.py | 1 | 4987 | ############################################################################
# Copyright(c) Open Law Library. All rights reserved. #
# See ThirdPartyNotices.txt in the project root for additional notices. #
# #
# Licensed u... | apache-2.0 | 7,890,839,024,633,215,000 | 40.907563 | 95 | 0.487868 | false | 5.052685 | true | false | false |
santoshphilip/pyclearsky | tests/test_clearskyrad.py | 1 | 7459 | # Copyright (c) 2013 Santosh Philip
# =======================================================================
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# =========... | mpl-2.0 | 3,839,150,458,369,474,000 | 32.299107 | 101 | 0.578764 | false | 2.906859 | true | false | false |
SimFre/EasyMoney | EasyMoney.py | 1 | 2677 | #!/usr/local/bin/python3
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from ImportBase import ImportBase
from DbConnection import DbConnection
from Ui_MainWindow import Ui_MainWindow
from Control_MainWindow import Control_MainWindow
if __name__ == '__main__':
#dbFile = "/Users/laban/Documents/Ekonomi/Tran... | gpl-2.0 | 3,995,125,351,226,500,000 | 44.372881 | 98 | 0.661188 | false | 3.260658 | false | true | false |
zhaofengli/refill | backend/refill/models/context.py | 1 | 6166 | from concurrent.futures import ThreadPoolExecutor
from importlib import import_module
from ..utils import Utils
from uuid import uuid1
import mwparserfromhell
import celery.utils.log
import logging
import re
class Context:
def __init__(self):
"""Initialize the context
Note:
This does ... | bsd-2-clause | 8,985,644,120,945,626,000 | 31.452632 | 90 | 0.572494 | false | 4.550554 | false | false | false |
e-koch/VLA_Lband | 14B-088/HI/imaging/imaging_tests/HI_testing_channel_clean.py | 1 | 2992 |
import sys
import numpy as np
import os
from tasks import clean, feather
'''
Cleans an MS with a single channel given a mask and a model
'''
default("clean")
major, minor, revision = casadef.casa_version.split('.')
casa_version = 100 * int(major) + 10 * int(minor) + int(revision)
vis = sys.argv[-6]
model = sys.a... | mit | -1,046,448,077,323,866,400 | 34.2 | 79 | 0.573529 | false | 3.126437 | false | false | false |
our-city-app/oca-backend | src/rogerthat/web_client/pages/web_client.py | 1 | 2973 | # -*- coding: utf-8 -*-
# Copyright 2020 Green Valley NV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 | -7,659,937,712,498,835,000 | 32.404494 | 105 | 0.690885 | false | 3.906702 | false | false | false |
quantmind/lux | tests/mail/test_smtp.py | 1 | 1139 | from lux.utils import test
from lux.ext.smtp import EmailBackend
class SmtpTest(test.AppTestCase):
config_file = 'tests.mail'
@classmethod
def beforeAll(cls):
email = cls.app.email_backend
email.send_mails = email._send_mails
def test_backend(self):
backend = self.app.email_b... | bsd-3-clause | -7,785,915,141,844,986,000 | 33.515152 | 70 | 0.56453 | false | 3.900685 | true | false | false |
0sw4l/villas-de-san-pablo | apps/habilidades_blandas/migrations/0001_initial.py | 1 | 1800 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-21 18:47
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('personas', '0001_initial'),
]
... | mit | 489,150,653,691,920,600 | 42.902439 | 168 | 0.587778 | false | 3.805497 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.