text
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
231
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
score
float64
0
0.34
import rhwl_hr import rhwl_holidays import controllers
vnsofthe/odoo-dev
addons/rhwl_hr/__init__.py
Python
agpl-3.0
55
0
#!/usr/bin/python # Import the necessary package to process data in JSON format try: import json except ImportError: import simplejson as json # Import the necessary methods from "twitter" library from twitter import Twitter, OAuth, TwitterHTTPError, TwitterStream # from twython import Twython from secret import ...
mnrozhkov/candybot
twitter_stream.py
Python
gpl-2.0
1,522
0.027595
from controllers.board_controller import BoardController from models.move import Move from models.board import Board controller = BoardController() controller.init_game()
daniellima/othello
main.py
Python
mit
204
0.014706
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Oct 18 15:53:27 2016 @author: Michael Wu Benchmark test: Giving classification performances of: Random forest(rf), MultitaskDNN(tf), RobustMultitaskDNN(tf_robust), Logistic regression(logreg), Graph convolution(graphconv) ...
bowenliu16/deepchem
examples/benchmark.py
Python
gpl-3.0
23,002
0.012086
#gets COUNT tweets from user's timeline import os import tweepy import cPickle as pickle from config import Config #constants COUNT = 200 #tweepy configuration keys = file('config.cfg') cfg = Config(keys) consumer_key= cfg.consumer_key consumer_secret= cfg.consumer_secret access_token= cfg.access_token access_toke...
dnr2/fml-twitter
tweets.py
Python
mit
1,301
0.017679
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # CSS Compare documentation build configuration file, created by # sphinx-quickstart on Tue Oct 6 06:29:25 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this ...
alflanagan/css_compare
doc/conf.py
Python
agpl-3.0
9,525
0.005879
#!/usr/bin/env python """ Example that displays how to switch between Emacs and Vi input mode. """ from prompt_toolkit import prompt from prompt_toolkit.enums import EditingMode from prompt_toolkit.key_binding.manager import KeyBindingManager from prompt_toolkit.keys import Keys from prompt_toolkit.styles import style...
melund/python-prompt-toolkit
examples/switch-between-vi-emacs.py
Python
bsd-3-clause
1,411
0.000709
#!/usr/bin/python # -*- coding: utf-8 -*- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
wilvk/ansible
lib/ansible/modules/network/aci/aci_taboo_contract.py
Python
gpl-3.0
4,522
0.002211
import os import boto3 import json import urllib.parse from elasticsearch import ElasticsearchException from botocore.exceptions import ClientError from common.elasticsearch_client import * from common.constants import * from common.logger_utility import * class HandleBucketEvent: def _fetchS3DetailsFromEvent(se...
VolpeUSDOT/CV-PEP
lambda/cvp-qc/bucket_handler_lambda/bucket_event_lambda_handler.py
Python
mit
9,274
0.003882
# coding=utf-8 # Author: Dustyn Gibson <miigotu@gmail.com> # # This file is part of Medusa. # # Medusa 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...
Thraxis/pymedusa
sickbeard/providers/thepiratebay.py
Python
gpl-3.0
7,881
0.00368
from cls_method_decorators import debugmethods class metatype(type): def __new__(cls, cls_name, bases, cls_dict): clsobj = super().__new__(cls, cls_name, bases, cls_dict) clsobj = debugmethods(clsobj) return clsobj class Animal(metaclass = metatype): def __init__(self, name): ...
kmad1729/python_notes
metaprogramming/practice_code/metatype_demo.py
Python
unlicense
583
0.010292
''' Button Behavior =============== The :class:`~kivy.uix.behaviors.button.ButtonBehavior` `mixin <https://en.wikipedia.org/wiki/Mixin>`_ class provides :class:`~kivy.uix.button.Button` behavior. You can combine this class with other widgets, such as an :class:`~kivy.uix.image.Image`, to provide alternative buttons th...
inclement/kivy
kivy/uix/behaviors/button.py
Python
mit
6,290
0
# Copyright (c) 2001-2005 Twisted Matrix Laboratories. # See LICENSE for details. import sys, os, sha from twisted.trial import unittest from twisted.words.protocols.jabber.component import ConnectComponentAuthenticator, ComponentInitiatingInitializer from twisted.words.protocols import jabber from twisted.words.pro...
santisiri/popego
envs/ALPHA-POPEGO/lib/python2.5/site-packages/twisted/words/test/test_jabbercomponent.py
Python
bsd-3-clause
4,313
0.002319
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
jaggu303619/asylum
openerp/addons/crm/report/__init__.py
Python
agpl-3.0
1,107
0.00271
# Copyright (c) 2014, FTW Forschungszentrum Telekommunikation Wien # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this...
anderasberger/pydnsmap
pydnsmap/util.py
Python
bsd-3-clause
18,175
0.010344
#!/usr/bin/env python """ Extract pronunciations from the ELP items. Outputs a CSV with the orthographic and phonological form on each line. The phonological form is stripped of syllabification and stress markers. """ # Copyright 2013 Constantine Lignos # # Licensed under the Apache License, Version 2.0 (the "Licens...
lingtools/lingtools
extract_elp_prons.py
Python
apache-2.0
4,566
0
from bs4 import BeautifulSoup import os PATH = '/home/arj/arj_projects/imp_dump/kv_advanced/course_material/Advanced_Python_Course_(KV_October_2019)' VID_DIR = 'advanced_videos' LESSON_VID_MAP = { # 'AD_-_Decorators_2': '29B_Decorators.webm', # 'AD_-_Introduction': '01_Introduction.webm', # 'AD_-_Exercise1': '04_Ex...
ankitjavalkar/algosutra
yaksh_video_replacer/replacer.py
Python
gpl-2.0
2,250
0.005333
# BlenderBIM Add-on - OpenBIM Blender Add-on # Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com> # # This file is part of BlenderBIM Add-on. # # BlenderBIM Add-on 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 Fo...
IfcOpenShell/IfcOpenShell
src/blenderbim/blenderbim/bim/module/style/prop.py
Python
lgpl-3.0
1,292
0
# encoding: utf-8 from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'Template', fields ['name'] db.delete_unique('django_template', ['name']) def backwards(self, orm): # Adding uniqu...
tbtimes/checkup-survey
editorial_board/dbtemplates/south_migrations/0002_auto__del_unique_template_name.py
Python
mit
1,636
0.006724
#!/usr/bin/env python """ wsonoma.py This module inherits from RecipeParser, and provides an implementation for parsing recipes from the williams-sonoma.com site. """ from urllib.parse import urlsplit from parser import RecipeParser class WilliamsSonoma(RecipeParser): def getTitle(self): """The title...
dpapathanasiou/recipebook
sites/wsonoma.py
Python
mit
2,219
0.001803
import numpy as np def hessian(im_input, sigma): """ Calculates hessian of image I convolved with a gaussian kernel with covariance C = [Sigma^2 0; 0 Sigma^2]. Parameters ---------- im_input : array_like M x N grayscale image. sigma : double standard deviation of gaussian ...
DigitalSlideArchive/HistomicsTK
histomicstk/utils/hessian.py
Python
apache-2.0
1,287
0
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals """ Unit tests for ``octoprint.settings``. """ __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2...
foosel/OctoPrint
tests/settings/__init__.py
Python
agpl-3.0
394
0.007653
import os import re import json import urllib.parse import urllib.request import contextlib import hashlib from lxml import etree from django.conf import settings from django.http import HttpResponse, JsonResponse, Http404 from django.views.decorators.csrf import csrf_exempt from django.views.decorators.vary import va...
gislab-npo/gislab-web
server/webgis/map/views.py
Python
gpl-2.0
9,021
0.002439
__author__ = 'BeyondSky' from collections import defaultdict class Solution(object): def getHint(self, secret, guess): """ :type secret: str :type guess: str :rtype: str """ bulls = cows = 0 digits = defaultdict(int) # first pass: count bulls and non...
BeyondSkyCoder/BeyondCoder
leetcode/python/bulls_and_cows.py
Python
apache-2.0
1,021
0.002938
# -*- coding: utf-8 -*- # # Copyright (C) 2014-2019 khalim19 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
khalim19/gimp-plugin-export-layers
export_layers/pygimplib/gui/itembox.py
Python
gpl-3.0
18,637
0.014863
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2017-02-11 15:40 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('reports', '0010_auto_20170211_0306'), ] operations = [ migrations.RemoveField( ...
diegojromerolopez/djanban
src/djanban/apps/reports/migrations/0011_auto_20170211_1640.py
Python
mit
573
0
# -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: test.py Description : Author : JHao date: 2017/3/7 ------------------------------------------------- Change Activity: 2017/3/7: ---------------------------------------------...
jhao104/proxy_pool
test.py
Python
mit
770
0.003916
from ._compat import unittest from ._adapt import DEFAULT_URI from pydal import DAL class DALtest(unittest.TestCase): def __init__(self, *args, **kwargs): super(DALtest, self).__init__(*args, **kwargs) self._connections = [] def connect(self, *args, **kwargs): if not args: ...
niphlod/pydal
tests/_helpers.py
Python
bsd-3-clause
758
0.001319
""" Support for Satel Integra devices. For more details about this component, please refer to the documentation at https://home-assistant.io/components/satel_integra/ """ import asyncio import logging import voluptuous as vol from homeassistant.core import callback from homeassistant.const import ( STATE_ALARM...
PetePriority/home-assistant
homeassistant/components/satel_integra/__init__.py
Python
apache-2.0
5,379
0
# coding=utf-8 from __future__ import unicode_literals """ Utility library for interacting with unimate """ import socket import types class Client(object): """ Unimate client """ def __init__(self, server, port): if not isinstance(server, types.StringTypes): raise TypeError("serv...
smarkets/pyunimate
unimate.py
Python
mit
1,311
0.00382
# -*- coding: utf-8 -*- # Use this file to easily define all of your cron jobs. # # It's helpful to understand cron before proceeding. # http://en.wikipedia.org/wiki/Cron # # Learn more: http://github.com/fengsp/plan from plan import Plan cron = Plan() # register one command, script or module # cron.command('comman...
supergis/git_notebook
other/schedule.py
Python
gpl-3.0
515
0
# -*- coding: utf-8 -*- # Copyright(C) 2013 Fourcot Florent # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your o...
blckshrk/Weboob
modules/poivy/browser.py
Python
agpl-3.0
2,888
0.001385
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import logging import os import re import subprocess import sys import time from collections import defaultdict from html import unescape from urllib.error import URLError from urllib.parse import quote, urlparse, urlsplit, urlunsplit from urllib.request im...
talha131/pelican
pelican/tools/pelican_import.py
Python
agpl-3.0
37,631
0
# coding=utf-8 # Author: Dustyn Gibson <miigotu@gmail.com> # URL: https://sickrage.github.io # # This file is part of SickRage. # # SickRage 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 ...
adaur/SickRage
sickbeard/providers/thepiratebay.py
Python
gpl-3.0
6,703
0.003431
#!/usr/bin/env python # Copyright 2012 Google Inc. All Rights Reserved. """Tests for grr.lib.flows.general.services.""" from grr.lib import aff4 from grr.lib import rdfvalue from grr.lib import test_lib class ServicesTest(test_lib.FlowTestsBaseclass): def testEnumerateRunningServices(self): class ClientMo...
MiniSEC/GRR_clone
lib/flows/general/services_test.py
Python
apache-2.0
1,398
0.003577
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Jocelyn Jaubert # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at yo...
franek/weboob
modules/societegenerale/backend.py
Python
agpl-3.0
2,388
0.000839
import volmdlr import volmdlr.edges import volmdlr.wires import volmdlr.faces p1 = volmdlr.Point3D(0.15, 0.48, 0.5) p2 = volmdlr.Point3D(0.15, 0.1, 0.5) p1s = volmdlr.Point2D(0, 0) p2s = volmdlr.Point2D(0.1, 0) p3s = volmdlr.Point2D(0.2, 0.1) p4s = volmdlr.Point2D(-0.01, 0.05) surface2d = volmdlr.faces.Surface2D(vol...
masfaraud/volmdlr
scripts/faces/planar.py
Python
gpl-3.0
1,693
0.002363
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Nicolas Duhamel # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at y...
yannrouillard/weboob
modules/bp/pages/accountlist.py
Python
agpl-3.0
3,140
0.000637
# -*- coding: utf-8 -*- # © 2014-2015 Avanzosc # © 2014-2015 Pedro M. Baeza # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from . import models
Endika/manufacture
mrp_production_real_cost/__init__.py
Python
agpl-3.0
165
0
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai __license__ = 'GPL v3' __copyright__ = '2011, Timothy Legge <timlegge@gmail.com> and Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import os from contextlib import closing class Bookmark(): # {{{ ''' A simple class fetching boo...
insomnia-lab/calibre
src/calibre/devices/kobo/bookmark.py
Python
gpl-3.0
4,557
0.007022
# -*- coding: utf-8 -*- from django import forms from django.utils.translation import ugettext_lazy as _ from djangosige.apps.estoque.models import LocalEstoque class LocalEstoqueForm(forms.ModelForm): class Meta: model = LocalEstoque fields = ('descricao',) widgets = { 'des...
thiagopena/djangoSIGE
djangosige/apps/estoque/forms/local.py
Python
mit
461
0
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
ueshin/apache-spark
python/pyspark/pandas/tests/test_window.py
Python
apache-2.0
13,671
0.003292
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import AppConfig class ScheduleConfig(AppConfig): name = 'schedule'
CongBao/mrsys.online
sub_mrsys/schedule/apps.py
Python
apache-2.0
156
0
#!/usr/bin/python2.4 # # Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
rickiepark/openbidder
protobuf/protobuf-2.6.1/python/stubout.py
Python
mit
4,934
0.004662
""" Django settings for ecommerce project. Generated by 'django-admin startproject' using Django 1.8. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build path...
Maelstroms38/ecommerce
src/ecommerce/settings/local.py
Python
mit
7,411
0.003778
# versione 0.5 import socket import threading import hashlib import base64 import json class BadWSRequest(Exception): pass class BadWSFrame(Exception): pass class BadCmdCall(Exception): pass class BadCmdParam(Exception): pass class Client(threading.Thread): _MAGIC_STRING = '258EAFA5-E914-47...
ferdas/ws-rpc
websocket.py
Python
gpl-3.0
8,711
0.011365
import theano.tensor as T import numpy as np from cuboid.bricks import Flattener, FilterPool, Dropout, BatchNormalization from cuboid.bricks import Convolutional, LeakyRectifier, BrickSequence from blocks.bricks.conv import MaxPooling from blocks.bricks import Linear, Softmax from blocks.initialization import Isotrop...
lukemetz/MLFun
DistCifar10/model.py
Python
mit
1,811
0.008283
#!/usr/bin/env python """ Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ optDict = { # Format: # Family: { "parameter name": "parameter datatype" }, # Or: # Family: { "parameter name"...
krintoxi/NoobSec-Toolkit
NoobSecToolkit /tools/inject/lib/core/optiondict.py
Python
gpl-2.0
13,002
0.000154
from trollius import subprocess from trollius import test_utils import trollius as asyncio import os import signal import sys import warnings from trollius import BrokenPipeError, ConnectionResetError, ProcessLookupError from trollius import From, Return from trollius import base_subprocess from trollius import test_su...
haypo/trollius
tests/test_subprocess.py
Python
apache-2.0
18,416
0.000163
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
ghchinoy/tensorflow
tensorflow/python/distribute/multi_worker_util_test.py
Python
apache-2.0
8,226
0.004012
""" Oriented graph aka ERD painter """ # Copyright (C) Petr Vanek <petr@yarpen.cz> , 2005 # # 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...
tocisz/oraschemadoc
oraschemadoc/dot.py
Python
gpl-2.0
6,714
0.003724
#!/usr/bin/env python3 # This file is part of OpenSoccerManager. # # OpenSoccerManager 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 ver...
OpenSoccerManager/opensoccermanager
uigtk/continuedialog.py
Python
gpl-3.0
1,783
0
import pytest @pytest.fixture(params=["EUROPE", "ASIA", "AMERICAS"]) def region(request): return request.param @pytest.fixture(params=["pseudonym", "Tuxedo"]) def game_name(request): return request.param @pytest.fixture(params=["sudo", "riot"]) def tag_line(request): return request.param @pytest.fix...
pseudonym117/Riot-Watcher
tests/integration/riot/test_AccountApi.py
Python
mit
1,465
0.001365
import socket s = socket.socket() host = socket.gethostname() port = 1234 s.bind((host, port)) s.listen(5) while True: c, addr = s.accept() print "Get coonect from", addr c.send('Thanks your coonecting') c.close()
cheenwe/cheenwe.github.io
study/python/8_get_web_page.py
Python
mit
220
0.022727
#!/usr/bin/python # Copyright (c) 2014 SwiftStack, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
caiobrentano/swift_undelete
setup.py
Python
apache-2.0
1,663
0.000601
from distutils.core import Command from setuptools import setup class TestCommand(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): from django.conf import settings settings.configure( DATABASES...
hanuprateek/django-jsonfield
setup.py
Python
mit
1,596
0.001253
# -*- coding: utf-8 -*- """Tree utilities """ class TranslationKind(object): in_ = 'in' out_ = 'out' def _normalize_branche(branche, node_mapping): new_branches = [] if node_mapping: node_id = node_mapping.get('node_id') parts = node_id.split('/') aliases = node_mapping.get('...
ecreall/deform_treepy
deform_treepy/utilities/tree_utility.py
Python
agpl-3.0
11,176
0.000358
from tools.load import LoadMatrix lm=LoadMatrix() traindat = lm.load_numbers('../data/fm_train_real.dat') testdat = lm.load_numbers('../data/fm_test_real.dat') label_traindat = lm.load_labels('../data/label_train_multiclass.dat') parameter_list = [[traindat,testdat,label_traindat,3],[traindat,testdat,label_traindat,3]...
ratschlab/ASP
examples/undocumented/python_modular/classifier_knn_modular.py
Python
gpl-2.0
1,033
0.03969
#!/usr/bin/env python # -*- coding: utf-8 -*- """ getname ~~~~~~~ Get popular cat/dog/superhero/supervillain names. :copyright: (c) 2015 by lord63. :license: MIT, see LICENSE for more details. """ from getname.main import random_name __title__ = "getname" __version__ = '0.1.1' __author__ = "lor...
lord63/getname
getname/__init__.py
Python
mit
385
0
""" Parses input files of the Cross-section tool, and generates valid input files from (modified) settings in Python. """ from collections import OrderedDict from ruamel import yaml from cslib import ( units) from cslib.settings import ( Type, Model, ModelType, Settings, each_value_conforms, check_settin...
eScatter/cstool
cstool/parse_input.py
Python
apache-2.0
7,511
0.001333
from ._costs import *
csxeba/ReSkiv
brainforge/costs/__init__.py
Python
gpl-3.0
22
0
from ll1_symbols import * YAML_OUTPUT = """terminals: %s non-terminals: %s eof-marker: %s error-marker: %s start-symbol: %s productions: %s table: %s""" YAML_OUTPUT_NO_TABLE = """terminals: %s non-terminals: %s eof-marker: %s error-marker: %s start-symbol: %s productions: %s""" class YamlGenerator(object): """docs...
liuxue1990/python-ll1-parser-generator
yaml_generator.py
Python
gpl-3.0
1,932
0.036232
# Generated by Django 2.1.5 on 2019-01-14 14:14 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [("donations", "0006_document_deleted")] operations = [ migrations.AlterField( model_name="spendingrequest", ...
lafranceinsoumise/api-django
agir/donations/migrations/0007_auto_20190114_1514.py
Python
agpl-3.0
681
0
import inspect from functools import total_ordering def yield_once(iterator): """ Decorator to make an iterator yield each result only once. :param iterator: Any iterator :return: An iterator that yields every result only once at most. """ def yield_once_generator(*args, **kwargs): ...
Adrianzatreanu/coala-decorators
coala_decorators/decorators.py
Python
mit
11,053
0.00009
# problem 48 # Project Euler __author__ = 'Libao Jin' __date__ = 'July 18, 2015' def lastTenDigits(number): string = str(number) lastTen = int(string[-10:]) return lastTen def amazingSum(n): s = 0 while n >= 1: s += n ** n n -= 1 return s def selfPowers(n): s = amazingSum(n) l = lastTenDigits(s) return...
imthomasking/MATLAB-files
Python/Project.Euler/Answers.Python/48.py
Python
mit
391
0.048593
#!/usr/bin/python3 """datahelpers.py: Provides functions for handling data.""" __author__ = 'Andrei Muntean' __license__ = 'MIT License' import numpy as np def shuffle_data(x, y): random_indexes = np.random.permutation(x.shape[0]) shuffled_x = np.empty_like(x) shuffled_y = np.empty_like(y) for in...
andreimuntean/LinearRegression
LinearRegression/datahelpers.py
Python
mit
1,252
0.0088
import random import re from datetime import datetime, timedelta from string import letters from django.contrib.auth.models import User from django.contrib.auth.tokens import default_token_generator from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ValidationError from djan...
anushbmx/kitsune
kitsune/users/api.py
Python
bsd-3-clause
16,254
0.000984
from pushyou import db class User(db.Model): __tablename__ = 'user' id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(255), unique=True) status = db.Column(db.SmallInteger) account_type = db.Column(db.SmallInteger) # Staff,Client, email = db.Column(db.String(...
rbeardow/boki
boki/user.py
Python
mit
1,427
0.004905
# defivelo-intranet -- Outil métier pour la gestion du Défi Vélo # Copyright (C) 2020 Didier 'OdyX' Raboud <didier.raboud@liip.ch> # # This program 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...
defivelo/db
apps/challenge/views/settings.py
Python
agpl-3.0
3,051
0.000657
""" Tests for new channel bot """ import datetime import time import unittest import mock import new_channel_bot def _make_fake_api(channels, posts): """ Construct a fake slack API Args: channels (dict): List of channels to mock in. posts (array): Collection of all calls to the postMessage api....
democrats/new-channel-bot
tests/test_new_channel_bot.py
Python
mit
4,261
0
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
Azure/azure-sdk-for-python
sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_groups_operations.py
Python
mit
47,878
0.004511
__author__ = 'bptripp' import numpy as np from scipy.optimize import curve_fit import matplotlib.pyplot as plt from sklearn.cluster import KMeans from sklearn.discriminant_analysis import LinearDiscriminantAnalysis from keras.models import Sequential from keras.layers.core import Dense, Activation, Flatten from keras....
bptripp/grasp-convnet
py/cninit.py
Python
mit
7,083
0.009318
# 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. import fnmatch import imp import logging import modulefinder import optparse import os import sys import zipfile from telemetry import benchmark from teleme...
guorendong/iridium-browser-ubuntu
tools/telemetry/telemetry/util/find_dependencies.py
Python
bsd-3-clause
9,310
0.009774
from django.conf import settings from django.core.exceptions import ValidationError from django.forms import ModelForm from django.forms.widgets import HiddenInput, TextInput, Select, CheckboxInput from alert.userHandling.models import Alert class CreateAlertForm(ModelForm): def __init__(self, *args, **kwargs): ...
shashi792/courtlistener
alert/alerts/forms.py
Python
agpl-3.0
1,815
0
# coding=utf-8 # # URL: https://sickrage.github.io # # This file is part of SickRage. # # SickRage 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 lat...
ukanga/SickRage
sickbeard/providers/hdbits.py
Python
gpl-3.0
6,545
0.00275
# Copyright (c) 2015 FUJITSU LIMITED # Copyright (c) 2012 EMC Corporation. # 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 Licen...
Hybrid-Cloud/cinder
cinder/volume/drivers/fujitsu/eternus_dx_fc.py
Python
apache-2.0
8,064
0
""" 4 2 belas seratus 4 puluh 0 9 ribu seratus 2 puluh 1 2 puluh 1 ribu 3 puluh 0 9 ratus 5 ribu 0 8 puluh 2 juta 8 ratus 8 belas ribu seratus 8 puluh 8 3 ratus 1 juta 4 puluh 8 ribu 5 ratus 8 puluh 8 """ def kata(n): angka = range(11) temp = "" if n < 12: temp += str(angka[n]) elif n < 20: ...
agusmakmun/Some-Examples-of-Simple-Python-Script
list/katakan.py
Python
agpl-3.0
984
0.01626
# -*- mode: python; coding: utf-8; -*- # # This file is part of Invenio. # Copyright (C) 2010, 2011, 2012 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or...
CERNDocumentServer/invenio
modules/bibsort/lib/bibsort_daemon.py
Python
gpl-2.0
15,964
0.003257
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-07-31 17:48 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('catalog', '0001_initial'), ...
gileno/djangoecommerce
checkout/migrations/0003_order_orderitem.py
Python
cc0-1.0
2,362
0.004671
# # This file is part of pySMT. # # Copyright 2014 Andrea Micheli and Marco Gario # # 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 ...
idkwim/pysmt
pysmt/solvers/pico.py
Python
apache-2.0
4,835
0.001861
# Microsoft Azure Linux Agent # # Copyright 2018 Microsoft Corporation # # 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 b...
Azure/WALinuxAgent
azurelinuxagent/pa/deprovision/default.py
Python
apache-2.0
10,146
0.001774
# author: Adrian Rosebrock # website: http://www.pyimagesearch.com # USAGE # BE SURE TO INSTALL 'imutils' PRIOR TO EXECUTING THIS COMMAND # python sorting_contours.py # import the necessary packages from imutils import contours import imutils import cv2 # load the shapes image clone it, convert it to grayscale,...
jrosebr1/imutils
demos/sorting_contours.py
Python
mit
1,343
0.008935
''' ''' import re import http import logging import urllib import urllib.request from itertools import * import collections.abc from versa.driver import memory from versa import I, VERSA_BASEIRI, ORIGIN, RELATIONSHIP, TARGET, ATTRIBUTES from versa.reader import rdfalite from versa.reader.rdfalite import RDF_NS, SCHEM...
uogbuji/Library.Link
pylib/util.py
Python
apache-2.0
17,711
0.005533
import os import time import cPickle from Plugins.Plugin import PluginDescriptor from Screens.Console import Console from Screens.ChoiceBox import ChoiceBox from Screens.MessageBox import MessageBox from Screens.Screen import Screen from Screens.Standby import TryQuitMainloop from Screens.Ipkg import Ipkg from Screens....
Taapat/enigma2-openpli-fulan
lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py
Python
gpl-2.0
81,511
0.028143
def extractWwwTccedwardsCom(item): ''' Parser for 'www.tccedwards.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('PRC', 'PRC', 'translated'), ('Loiterous', 'Lo...
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractWwwTccedwardsCom.py
Python
bsd-3-clause
548
0.034672
# coding=utf-8 from django.apps import AppConfig from watson import search as watson class CatalogConfig(AppConfig): name = 'catalog' verbose_name = 'Catálogo' def ready(self): Product = self.get_model('Product') watson.register(Product)
gileno/djangoecommerce
catalog/apps.py
Python
cc0-1.0
272
0
import sys, os sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'scrapers')) sys.path.append("..") from datetime import datetime from pymongo import MongoClient from database import * import error import sync import group_members as groupMembersApi def importGroupMembers ( school_id, branch_id, team_eleme...
boh1996/LectioAPI
importers/importGroupMembers.py
Python
mit
3,867
0.041376
from datetime import datetime from src import yamlsettings as settings from models.models import Workday from calendar import monthrange import time from math import ceil,floor class Utils: WEEKDAYS=["monday","tuesday","wednesday","thursday", "friday", "saturday", "sunday"] MONTHS=["january","february","m...
Nexolight/wtstamp
src/utils.py
Python
gpl-2.0
17,014
0.020336
# Copyright (C) 2010,2011,2012 Chris Lalancette <clalance@redhat.com> # Copyright (C) 2012,2013 Chris Lalancette <clalancette@gmail.com> # This library 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;...
imcleod/anaconda-ec2
ozutil.py
Python
lgpl-2.1
22,263
0.001887
"""Test adding external statistics from Tibber.""" from unittest.mock import AsyncMock from homeassistant.components.recorder.statistics import statistics_during_period from homeassistant.components.tibber.sensor import TibberDataCoordinator from homeassistant.util import dt as dt_util from .test_common import CONSUM...
rohitranjan1991/home-assistant
tests/components/tibber/test_statistics.py
Python
mit
2,649
0.00151
""" Various global variables """ import os PROG_NAME = "gBuilder" PROG_VERSION = "2.0.0" environ = {"os":"Windows", "path":os.environ["GINI_HOME"]+"/", "remotepath":"./", "images":os.environ["GINI_HOME"]+"/share/gbuilder/images/", "config":os.environ["GINI_HOME"]+"/etc/", ...
sciyoshi/gini
frontend/src/gbuilder/Core/globals.py
Python
mit
1,542
0.029183
"""This module contains tests that exercise the canned VMware Automate stuff.""" from textwrap import dedent import fauxfactory import pytest from widgetastic.widget import View from widgetastic_patternfly import Dropdown from cfme import test_requirements from cfme.common import BaseLoggedInPage from cfme.infrastruc...
izapolsk/integration_tests
cfme/tests/automate/test_vmware_methods.py
Python
gpl-2.0
4,838
0.00186
# -*- coding: utf-8 -*- import tensorflow as tf import numpy as np # Parameters # ================================================== # Data Parameters # tf.flags.DEFINE_string("positive_data_file", "./data/rt-polaritydata/rt-polarity.pos", "Data source for the positive data.") # tf.flags.DEFINE_string("negative_data...
kevinlee9/cnn-text-classification-tf
load.py
Python
apache-2.0
1,773
0.003384
from bot_constant import FORWARD_LIST import global_vars from utils import send_both_side from command import command_listener import telegram import logging logger = logging.getLogger("CTBPlugin." + __name__) logger.debug(__name__ + " loading") global_vars.create_variable('group_members', [[]] * len(FORWARD_LIST)) ...
nickyc4/coolq-telegram-bot
plugins/qq_namelist.py
Python
gpl-3.0
1,401
0.012274
from setuptools import setup with open('README.md') as f: long_description = f.read() setup( name='Flask-pyoidc', version='3.9.0', packages=['flask_pyoidc'], package_dir={'': 'src'}, url='https://github.com/zamzterz/flask-pyoidc', license='Apache 2.0', author='Samuel Gulliksson', a...
its-dirg/Flask-pyoidc
setup.py
Python
apache-2.0
704
0
#!/usr/bin/env python """RDFValues used to communicate with Chipsec.""" from grr_response_core.lib import rdfvalue from grr_response_core.lib.rdfvalues import paths as rdf_paths from grr_response_core.lib.rdfvalues import structs as rdf_structs from grr_response_proto import chipsec_pb2 class DumpFlashImageRequest...
google/grr
grr/core/grr_response_core/lib/rdfvalues/chipsec_types.py
Python
apache-2.0
1,216
0.010691
#!/usr/bin/env python # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software...
appium/python-client
test/unit/webdriver/device/remote_fs_test.py
Python
apache-2.0
3,434
0.000874
# This file is part of PRAW. # # PRAW 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. # # PRAW is distributed in the hope that it will ...
dmarx/praw
praw/errors.py
Python
gpl-3.0
14,656
0.000068
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2010, 2011, 2012, 2013 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or ...
AlbertoPeon/invenio
modules/bibupload/lib/batchuploader_engine.py
Python
gpl-2.0
28,252
0.004071
"""update sample prep steps Revision ID: 45f4b2dbc41a Revises: d1653e552ab Create Date: 2018-07-18 10:01:26.668385 """ # revision identifiers, used by Alembic. revision = '45f4b2dbc41a' down_revision = 'd1653e552ab' import sqlalchemy as sa from alembic import op def upgrade(): for step in ('mount', 'gold_tabl...
UManPychron/pychron
alembic_dvc/versions/45f4b2dbc41a_update_sample_prep_s.py
Python
apache-2.0
607
0.003295