text stringlengths 4 1.02M | meta dict |
|---|---|
"""
[8/22/2012] Challenge #90 [intermediate] (Scientific Units Calculator)
https://www.reddit.com/r/dailyprogrammer/comments/ynw65/8222012_challenge_90_intermediate_scientific/
In the SI system, measurements of scientific quantities are expressed in terms of 7 standard 'base' units for various
quantities:
the "second... | {
"content_hash": "0d29538ec56ed551ad812693d2e40c23",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 118,
"avg_line_length": 49.390243902439025,
"alnum_prop": 0.7387654320987654,
"repo_name": "DayGitH/Python-Challenges",
"id": "0374e696879596789cb59123ec2352627e62316f",
"s... |
'''
.. py:module:: contexts
:platform: Unix
Contexts for framing the tweets.
'''
import sys
import os
from abc import ABCMeta
import time
import json
import urllib
import urllib2
import operator
import logging
import traceback
import datetime
from random import choice
from PIL import Image
from pattern.en imp... | {
"content_hash": "9aacb8dc3a42dfbf901ad291a71ecd85",
"timestamp": "",
"source": "github",
"line_count": 600,
"max_line_length": 191,
"avg_line_length": 38.92166666666667,
"alnum_prop": 0.5442983770821735,
"repo_name": "assamite/TwatBot",
"id": "785f72dfbed07f04982c965e7b037ca724c9aa27",
"size": "23... |
from __future__ import unicode_literals
import frappe
from frappe import _, msgprint
from frappe.utils import flt, cstr, now, get_datetime_str
from frappe.utils.background_jobs import enqueue
from frappe.model.base_document import BaseDocument, get_controller
from frappe.model.naming import set_new_name
from werkzeug.e... | {
"content_hash": "3141aaf4417951fc4ee7f95e46634bb2",
"timestamp": "",
"source": "github",
"line_count": 1008,
"max_line_length": 112,
"avg_line_length": 31.29265873015873,
"alnum_prop": 0.6846843990742796,
"repo_name": "vqw/frappe",
"id": "01d5847789d66bad7e6a578c215b68b75b1b41bb",
"size": "31644",... |
"""
ArrowHead
=========
Micro-framework for flowchart computing
_ _ _ _ _ _ _
____|_|_|_|_|_|_| |_| | |___|_|_|__|_|_| \\____________\\
| | | \ | \ |_| |_|_| | | |_ | | |_/ /
Arrowhead is a framework for constructing flow charts composed of steps
connected by (possibly... | {
"content_hash": "6ca7d619ee2d3f6f8856c15378ca8374",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 79,
"avg_line_length": 44.148148148148145,
"alnum_prop": 0.7290268456375839,
"repo_name": "zyga/arrowhead",
"id": "82d16316c74cf3ae464760f45c29e4f7c9b6d25e",
"size": "2384"... |
"""Test the zapwallettxes functionality.
- start three oakcoind nodes
- create four transactions on node 0 - two are confirmed and two are
unconfirmed.
- restart node 1 and verify that both the confirmed and the unconfirmed
transactions are still available.
- restart node 0 and verify that the confirmed transactio... | {
"content_hash": "807cf9ba77d954c4330e586e7132b5d4",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 106,
"avg_line_length": 36.92307692307692,
"alnum_prop": 0.6350694444444445,
"repo_name": "stratton-oakcoin/oakcoin",
"id": "1c9ee6127e9a307af5edb4b5670b36a4b621e018",
"siz... |
from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
import os, sys, subprocess
from django.conf import settings
from emma.interface.models import Metadata, Keyword
import logging
#--------------------------------------------------------------------------------------------... | {
"content_hash": "55998fa324ebd20c436409f404750919",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 104,
"avg_line_length": 29.523809523809526,
"alnum_prop": 0.44233870967741934,
"repo_name": "djangowebstudio/emma",
"id": "dea69598fe72f584fa30736aeb84c1b49b9e9977",
"size"... |
def extractPickupnovelsCom(item):
'''
Parser for 'pickupnovels.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', 'Loiter... | {
"content_hash": "ed0188fd635d0206446da7ee7b00b7cb",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 104,
"avg_line_length": 25.904761904761905,
"alnum_prop": 0.6268382352941176,
"repo_name": "fake-name/ReadableWebProxy",
"id": "509fbf0d80cebf6a1a4ff9dba02e4952c1264ee9",
"... |
""" Contains the logic for `aq add cluster systemlist`. """
from aquilon.aqdb.model import SystemList
from aquilon.worker.broker import BrokerCommand # pylint: disable=W0611
from aquilon.worker.commands.add_cluster_member_priority import \
CommandAddClusterMemberPriority
class CommandAddClusterSystemList(Comman... | {
"content_hash": "f737bbea930ffc74ac845f011c656996",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 72,
"avg_line_length": 36.69230769230769,
"alnum_prop": 0.7819706498951782,
"repo_name": "guillaume-philippon/aquilon",
"id": "011b052a940f8c0f1fef8e1b087a0cd634e92a68",
"s... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.core.targets.dependencies import Dependencies
from pants.backend.jvm.targets.java_library import JavaLibrary
from pants.backend.jvm.tasks.jvm_platfo... | {
"content_hash": "dc123bd88c069d63e8d2fe515e53599a",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 101,
"avg_line_length": 38.206896551724135,
"alnum_prop": 0.6459085439229844,
"repo_name": "laurentgo/pants",
"id": "b76edb61a8a8d092fac8808884af79d88b769ea2",
"size": "67... |
import nusoft.package.local as local_package
import os
class Geant4(local_package.LocalPackage):
""" The GEANT4 installation package.
:param _tar_name: name of the tar file to download/install
:param _version: version of GEANT4 to install.
:param _source_path: path to place the source files
""... | {
"content_hash": "e68abf56ff27999732de2dcb92069664",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 130,
"avg_line_length": 49.52459016393443,
"alnum_prop": 0.6160211850380669,
"repo_name": "pgjones/nusoft",
"id": "aaa7e957a7eb5cac580192dae0c47db1c2017ef1",
"size": "3268"... |
__version__=''' $Id: fonts.py 3342 2008-12-12 15:55:34Z andy $ '''
__doc__='''Utilities to associate bold and italic versions of fonts into families
Bold, italic and plain fonts are usually implemented in separate disk files;
but non-trivial apps want <b>this</b> to do the right thing. We therefore
need to keep 'map... | {
"content_hash": "ddf2dc1422c4c497db2ee5b89063d529",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 95,
"avg_line_length": 35.90217391304348,
"alnum_prop": 0.5470784135634272,
"repo_name": "fergalmoran/Chrome2Kindle",
"id": "3da6a641245c2efe914ac1e975ec3081d8016f47",
"siz... |
__author__ = 'developer'
import sys
import os
import numpy as np
from pprint import pprint
from math import sqrt
from random import random
# y = mx +b
# m is slope, b is y-intercept
def computeError(coefficients, points):
totalError = 0
N= len(points)
#iterate over all points
for i in range(0, N):
... | {
"content_hash": "1638333275e2d71b26acb3e51b2e80c8",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 87,
"avg_line_length": 26.349593495934958,
"alnum_prop": 0.5775995063252083,
"repo_name": "melhindi/Assignments_ParallelDataProcessingAndAnalysis",
"id": "b6fc31ed1ac0653a39... |
from test_framework import generic_test
def test_collatz_conjecture(n: int) -> bool:
# TODO - you fill in here.
return False
if __name__ == '__main__':
exit(
generic_test.generic_test_main('collatz_checker.py',
'collatz_checker.tsv',
... | {
"content_hash": "80f2827550d64ceee8757aecb540b7e1",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 64,
"avg_line_length": 27.846153846153847,
"alnum_prop": 0.5193370165745856,
"repo_name": "shobhitmishra/CodingProblems",
"id": "9e878cebb405cc3c9e69917bbd753852945cc4fa",
... |
from django.conf.urls import url
from hs_core import views
from hs_core.views.autocomplete import autocomplete
urlpatterns = [
# internal API
url(r'^_internal/(?P<shortkey>[0-9a-f-]+)/add-files-to-resource/$',
views.add_files_to_resource, name='add_files_to_resource'),
url(r'^_internal/(?P<shortkey... | {
"content_hash": "605aee5354180f1da3a768935edaad40",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 120,
"avg_line_length": 71.73109243697479,
"alnum_prop": 0.645618556701031,
"repo_name": "hydroshare/hydroshare",
"id": "840c8f45b62363eb2f2a19269771f8f0b33b30e2",
"size":... |
from models.group import Group
test_data = [
Group(name="name1", header="header1", footer="footer1"),
Group(name="name2", header="header2", footer="footer2")
]
| {
"content_hash": "043abe9a8a9cc8947d579b42533ad997",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 60,
"avg_line_length": 21.375,
"alnum_prop": 0.6666666666666666,
"repo_name": "rmolewska/Python_course",
"id": "b2be11636746494bda768dafd6233683e8ff3904",
"size": "172",
"... |
from webmarks.bookmarks.apiviews import add_folder_bookmark_view
from webmarks.bookmarks import viewsets
from django.conf.urls import include
from django.conf.urls import url
from rest_framework import routers
apiRouter = routers.DefaultRouter()
apiRouter.register(r'folders', viewsets.FolderViewSet)
apiRouter.register... | {
"content_hash": "442c5ea801e677cc1cba773c26bd0a24",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 86,
"avg_line_length": 44.15384615384615,
"alnum_prop": 0.7317073170731707,
"repo_name": "EricMuller/mynotes-backend",
"id": "ce532c38b355d293bb158364491bb05977a1b203",
"si... |
"""
client api
"""
import logging
import logging.handlers
import eventlet
from os.path import normpath, getsize
from simplecfs.message.packet import MakeDirPacket, ListDirPacket,\
ValidDirPacket, StatusDirPacket, RemoveDirPacket, AddFilePacket,\
AddChunkPacket, AddFileCommitPacket, StatFilePacket, DeleteFilePa... | {
"content_hash": "6729053d17be6f84a92a49af43009b4f",
"timestamp": "",
"source": "github",
"line_count": 918,
"max_line_length": 87,
"avg_line_length": 33.333333333333336,
"alnum_prop": 0.526437908496732,
"repo_name": "charley-ye/SCFS-v1",
"id": "4f7e1f6f3826777d8026b3ce72699cdc8a09887b",
"size": "3... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("order", "0067_auto_20181102_1054")]
operations = [
migrations.AddField(
model_name="order",
name="checkout_token",
field=models.CharField(blank=True, max_length=36),
... | {
"content_hash": "cecf51fc04960e0a1b94bdf4fef4f2c8",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 62,
"avg_line_length": 24,
"alnum_prop": 0.6041666666666666,
"repo_name": "maferelo/saleor",
"id": "95cb5bce8f6ebe2df5ec47fe92abca97eaca2be4",
"size": "385",
"binary": fa... |
# -*- coding: utf-8 -*-
""" Task 702 """
def closest_pair(clusters, distance, cluster_distance, distances_cache):
""" Zwraca parę grup o najmniejszej wzajemnej odległości... """
best_i = None
best_j = None
best_d = None
for i in xrange(len(clusters)):
cluster_a = clusters[i]
for j ... | {
"content_hash": "800f21e1c45f7c4babd75bbb8b6bdd99",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 72,
"avg_line_length": 37.5,
"alnum_prop": 0.5430303030303031,
"repo_name": "katzoo/amu",
"id": "94eac09968e2060de069c1c02cd61f6ac63964b9",
"size": "830",
"binary": false... |
karesansui_conf = '/etc/karesansui/application.conf'
pysilhouette_conf = '/etc/pysilhouette/silhouette.conf'
search_path = ''
| {
"content_hash": "1ba53378736ccb4baa5a69c4128c158b",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 55,
"avg_line_length": 42,
"alnum_prop": 0.7698412698412699,
"repo_name": "karesansui/karesansui",
"id": "8a8623bf510b4446a030e89236ca5051dc974fcb",
"size": "173",
"binary... |
"""
Flask-Mail
----------
A Flask extension for sending email messages.
Please refer to the online documentation for details.
Links
`````
* `documentation <http://packages.python.org/Flask-Mail>`_
"""
from setuptools import setup
setup(
name='Flask-Mail',
version='0.9.1',
url='https://github.com/rdupl... | {
"content_hash": "1036242bd36d1fa12b5996d9f8b5e620",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 70,
"avg_line_length": 23.814814814814813,
"alnum_prop": 0.5933125972006221,
"repo_name": "gerasim13/flask-mail",
"id": "8354de8276ae1f30a04292841ba4b7835cf7fc55",
"size": ... |
from django.test import TestCase
from huxley.accounts.exceptions import AuthenticationError, PasswordChangeFailed
from huxley.accounts.models import User
from huxley.utils.test import TestUsers
class UserTestCase(TestCase):
def test_authenticate(self):
'''It should correctly authenticate and return a us... | {
"content_hash": "9b653413ff9ec5facae3659bff631d18",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 80,
"avg_line_length": 41.0126582278481,
"alnum_prop": 0.6231481481481481,
"repo_name": "jmosky12/huxley",
"id": "0cdc19a2dffd822af02ce39702e263629dde229a",
"size": "3389",... |
"""Command for adding a backend to a backend service."""
import copy
from googlecloudsdk.api_lib.compute import backend_services_utils
from googlecloudsdk.api_lib.compute import base_classes
from googlecloudsdk.api_lib.compute import instance_groups_utils
from googlecloudsdk.calliope import base
from googlecloudsdk.c... | {
"content_hash": "c97c6934aeb34ef1daa07492b64eccf9",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 79,
"avg_line_length": 36.30316742081448,
"alnum_prop": 0.696622211142964,
"repo_name": "KaranToor/MA450",
"id": "5b6d0d7f8d786a9a4fc11f5c94d61ccf8d29a3de",
"size": "8619"... |
"""
Script to process article database into cleaned dataset.
"""
import re
import pandas as pd
def fix_separators(s: str) -> str:
"""Return s with commas inserted between fields."""
upper_than_lower = re.compile(r'([a-z])([A-Z])')
return upper_than_lower.sub(r'\1,\2', s)
def clean_data(articles: pd.Data... | {
"content_hash": "318b201bde76cc72eb64ee9743639a4d",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 67,
"avg_line_length": 28.57894736842105,
"alnum_prop": 0.6740331491712708,
"repo_name": "bmassman/fake_news",
"id": "c25958c65ffa6e8d8cd99025d5050c603611051d",
"size": "56... |
import time
from bs4 import BeautifulSoup
import json
import codecs
import urllib2
import urllib
import httplib2
import contextlib
import re, urlparse
import os
def get_page(url):
text = ''
with contextlib.closing(urllib.urlopen(url)) as opened:
text = opened.read()
return text
def username_format(username):
fo... | {
"content_hash": "c8e84437607b1b48eb0d2f7a2aef17d3",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 89,
"avg_line_length": 22.91549295774648,
"alnum_prop": 0.6742470805162877,
"repo_name": "n43jl/mdp",
"id": "46569ec6f53536f845932d5810a170400f6e329a",
"size": "1669",
"b... |
"""
$Id$
$URL$
Copyright (c) 2010 foption
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distr... | {
"content_hash": "5afb4931183c69e3e8b686301ab58b0a",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 137,
"avg_line_length": 32.347457627118644,
"alnum_prop": 0.6418653392716793,
"repo_name": "msteinhoff/foption-bot",
"id": "f99534cc175ea4ee64d35897d8edb4d49acf49d8",
"siz... |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Get-DomainUser',
'Author': ['@harmj0y'],
'Description': ('Query information for a given user or users in the specified domain. Part of PowerView.'),
... | {
"content_hash": "aa59837c2359f3c2ad9fcce003ae4f5d",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 165,
"avg_line_length": 41.52272727272727,
"alnum_prop": 0.4616858237547893,
"repo_name": "bneg/Empire",
"id": "c031626e1114013041fc375b7d8dfcf490f2913a",
"size": "7308",
... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "akktool.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is rea... | {
"content_hash": "8d46b7c277248acddb6ba76d6c75b4dd",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 77,
"avg_line_length": 37.285714285714285,
"alnum_prop": 0.6206896551724138,
"repo_name": "HorayNarea/Akktool",
"id": "53164992a83c5689674fa9562f29951b5e1dbc94",
"size": "8... |
"""Tests for showing timestamps."""
from datetime import MAXYEAR, datetime
import pytest
def max_timestamp_for_datetime():
"""Calculate the latest timestamp Python will allow in a datetime."""
max_datetime = datetime(
year=MAXYEAR, month=12, day=31, hour=23, minute=59, second=59
)
return int... | {
"content_hash": "6729d8f61161637f4fb27fdd631fdc7b",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 78,
"avg_line_length": 31.559322033898304,
"alnum_prop": 0.6240601503759399,
"repo_name": "craiga/unixtimesta.mp",
"id": "f2afdf1124fb61f45518d4d505b06b86fb523991",
"size":... |
"""Script to plot correlation between distances."""
import lds
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
sns.set(style='whitegrid')
num_pairs = 100
plt.figure(figsize=(8, 4))
plt.subplot(1, 2, 1)
hidden_state_dim = 2
lds_pairs = [(lds.generate_linear_dynamical_system(hidden_state_dim),... | {
"content_hash": "13e49987e4a6bfc61edf75552bc33abc",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 80,
"avg_line_length": 34.673469387755105,
"alnum_prop": 0.6851088875809299,
"repo_name": "google-research/google-research",
"id": "ae6e25c177db5699c4c3ea3bcbc91b7cbb77910b",... |
"""
Django settings for PhotoManagementSystem project.
Generated by 'django-admin startproject' using Django 1.8.5.
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/
"""... | {
"content_hash": "9b05fbe07c84bb0960f0e01846898132",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 71,
"avg_line_length": 24.586206896551722,
"alnum_prop": 0.6372136512388967,
"repo_name": "39M/PhotoTheater",
"id": "7bdd7ef5625da1621f131177934d86f586fde55d",
"size": "42... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "uidjangotemplate.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# iss... | {
"content_hash": "ae98de22be6518e897e05bd5a0e933e6",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 80,
"avg_line_length": 37.714285714285715,
"alnum_prop": 0.625,
"repo_name": "cisco-gve/epnm_alarm_report",
"id": "505487e4b83edca329e437a512f1e166eca711d1",
"size": "814",... |
"""
Models for notifications app.
"""
import json
import jsonpickle
import six
from django.conf import settings
from django.db import models
from django.utils.module_loading import import_string
@six.python_2_unicode_compatible
class SentNotification(models.Model):
"""
Stores info on the notification that w... | {
"content_hash": "40c88a24e72b310c2b6e2948c136b9ab",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 107,
"avg_line_length": 30.34313725490196,
"alnum_prop": 0.6759289176090468,
"repo_name": "worthwhile/django-herald",
"id": "3b702e1f21c5b6446349369ad0c0eacdadcf305f",
"si... |
from keywordgroup import KeywordGroup
class _CookieKeywords(KeywordGroup):
def delete_all_cookies(self):
"""Deletes all cookies."""
self._current_browser().delete_all_cookies()
def delete_cookie(self, name):
"""Deletes cookie matching `name`.
If the cookie is not found, nothi... | {
"content_hash": "b375027803169acc72a8b701319c5309",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 92,
"avg_line_length": 35.69444444444444,
"alnum_prop": 0.6023346303501945,
"repo_name": "hbmartin/robotframework-selenium2library",
"id": "07b33859071c95cfc71a69073552cbe59a... |
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server.models.tapi_common_admin_state_pac import TapiCommonAdminStatePac # noqa: F401,E501
from tapi_server.models.tapi_commo... | {
"content_hash": "a5b24ff702dcef632c2e109b153166aa",
"timestamp": "",
"source": "github",
"line_count": 395,
"max_line_length": 314,
"avg_line_length": 42.05569620253164,
"alnum_prop": 0.7180351553094149,
"repo_name": "karthik-sethuraman/ONFOpenTransport",
"id": "a32391099274102fe14012ed3e23b15a1f366... |
"""
Provides step definitions to:
* run commands, like behave
* create textual files within a working directory
TODO:
matcher that ignores empty lines and whitespace and has contains comparison
"""
from __future__ import absolute_import, print_function
from behave import given, when, then, step, matchers
f... | {
"content_hash": "5c8926b919569f94d2944a4642e143e0",
"timestamp": "",
"source": "github",
"line_count": 521,
"max_line_length": 81,
"avg_line_length": 37.96928982725528,
"alnum_prop": 0.6127792943079567,
"repo_name": "Abdoctor/behave",
"id": "fd4c830a8e5c4e371217598a7a43f5157c1d088f",
"size": "1979... |
import sys
import DefaultTable
import array
from fontTools import ttLib
from fontTools.misc.textTools import safeEval
class table__c_v_t(DefaultTable.DefaultTable):
def decompile(self, data, ttFont):
values = array.array("h")
values.fromstring(data)
if sys.byteorder <> "big":
values.byteswap()
self.value... | {
"content_hash": "1f626e1a414b7c7ee904258d8640015f",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 51,
"avg_line_length": 24.183673469387756,
"alnum_prop": 0.6717299578059072,
"repo_name": "shadowmint/nwidget",
"id": "be08ca3ae565eb03990b953414db5d4098ce487d",
"size": "1... |
import sys
if sys.version_info[:2] < (3, 2):
from xml.sax.saxutils import escape
else:
from html import escape
WINNERS = ("Nikolai Andrianov", "Matt Biondi", "Bjørn Dæhlie",
"Birgit Fischer", "Sawao Kato", "Larisa Latynina", "Carl Lewis",
"Michael Phelps", "Mark Spitz", "Jenny Thomp... | {
"content_hash": "2593a411055b9e13ed32f4d367128b14",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 72,
"avg_line_length": 27.658227848101266,
"alnum_prop": 0.54279176201373,
"repo_name": "nwiizo/workspace_2017",
"id": "7b3af895d4d63c260134d44e23d2e40812b45d97",
"size": "... |
from django.db import migrations, models
import django.db.models.deletion
import geotrek.authent.models
class Migration(migrations.Migration):
dependencies = [
('common', '0002_auto_20170323_1433'),
]
operations = [
migrations.AlterField(
model_name='filetype',
na... | {
"content_hash": "5605716a70575d39317d712cfb7b403f",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 238,
"avg_line_length": 40.78260869565217,
"alnum_prop": 0.6748400852878464,
"repo_name": "GeotrekCE/Geotrek-admin",
"id": "a31d18ae2517147e65284876fc354793598b76cd",
"size... |
__author__ = 'api.roman.public@gmail.com (Roman Nurik)'
import gdata.maps.client
import gdata.client
import gdata.sample_util
import gdata.data
import atom.data
class MapsExample:
def __init__(self):
"""Creates a GDataService and provides ClientLogin auth details to it."""
# Authenticate using ClientLog... | {
"content_hash": "c37449972b6d58b0daf4b0d204b69815",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 79,
"avg_line_length": 32.689655172413794,
"alnum_prop": 0.6609704641350211,
"repo_name": "dekom/threepress-bookworm-read-only",
"id": "a636989ca9c21f947ab4bdc01990d4f2caa4f... |
"""Utility functions used by values.py and ps_values.py."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.distribute import distribute_lib
from tensorflow.python.distribute import distribution_strategy_context as ds_context
from ten... | {
"content_hash": "d92d8a56eb615e299816d62d21139234",
"timestamp": "",
"source": "github",
"line_count": 379,
"max_line_length": 115,
"avg_line_length": 37.25857519788918,
"alnum_prop": 0.6903193824799944,
"repo_name": "frreiss/tensorflow-fred",
"id": "369e2435d9bca44cc37b57ce62eb8988d61c6369",
"siz... |
from django.contrib import admin
import djangotoolbox.fields as toolbox
from django import forms
from django.forms import ModelForm
from django.shortcuts import get_object_or_404, render_to_response, redirect
from django.db import models
from django.contrib import messages
from django.utils.html import escape
try: fro... | {
"content_hash": "2e181ace33864b8f1ec293a9e93e9273",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 154,
"avg_line_length": 34.25,
"alnum_prop": 0.6253041362530414,
"repo_name": "philterphactory/prosthetic-runner",
"id": "3f80b26ef7de64dc230f52230e4bea5d17cb7250",
"size"... |
import json
import time
import uuid
import boto3
import sure # noqa # pylint: disable=unused-import
from moto import mock_sqs, mock_lambda, mock_logs
from tests.test_awslambda.test_lambda import get_test_zip_file1, get_role_name
@mock_logs
@mock_lambda
@mock_sqs
def test_invoke_function_from_sqs_exception():
lo... | {
"content_hash": "1d8dafef47b8e2c0c136be09cb0d6299",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 88,
"avg_line_length": 30.196969696969695,
"alnum_prop": 0.6156547917711992,
"repo_name": "spulec/moto",
"id": "f9e6da573ce1719aa6150c4974e96d5d1023dfe2",
"size": "1993",
... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Cart.last_update'
db.add_column('sell_cart', 'last_update', self.gf('django.db.models.fields.DateTimeField')... | {
"content_hash": "5b28207878d1766154bc343ce057cb04",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 205,
"avg_line_length": 76.66863905325444,
"alnum_prop": 0.5444933240719302,
"repo_name": "StephenPower/CollectorCity-Market-Place",
"id": "c6ef13c722f46b11f9ec4c491e05e781c... |
from __future__ import absolute_import, division, print_function, unicode_literals
from azure.mgmt.web import WebSiteManagementClient
from ..azure_common import BaseTest, arm_template, cassette_name
from c7n_azure.session import Session
from mock import patch
from c7n.exceptions import PolicyValidationError
from c7n.... | {
"content_hash": "2a802d30f6f098ac6986ef5e1ecf9ad2",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 100,
"avg_line_length": 38.66519823788546,
"alnum_prop": 0.4748775207929817,
"repo_name": "kapilt/cloud-custodian",
"id": "3443a836ad32ecf26a12a40835a6b1e75be25785",
"size... |
import httplib
from datetime import datetime, timedelta
from mock import MagicMock, Mock, patch
from tests.unit import unittest
from tests.unit import AWSMockServiceTestCase
import boto.ec2
from boto.regioninfo import RegionInfo
from boto.ec2.blockdevicemapping import BlockDeviceType, BlockDeviceMapping
from boto.ec... | {
"content_hash": "31b399a789e6e035343fc2dd7a553804",
"timestamp": "",
"source": "github",
"line_count": 1410,
"max_line_length": 121,
"avg_line_length": 42.08510638297872,
"alnum_prop": 0.5299966295921806,
"repo_name": "kaushik94/boto",
"id": "c68f29332a3425738904542fde9b86eb4516d07a",
"size": "593... |
"""Utils UTs."""
from unittest import main
from b3j0f.utils.ut import UTCase
from .base import Schema
from ..utils import (
DynamicValue, data2schema, ThisSchema, validate, updatecontent,
RegisteredSchema, dump, RefSchema, AnySchema, data2schemacls,
datatype2schemacls
)
from ..elementary import (
Str... | {
"content_hash": "11beed037640e1c6101fae9333630e3b",
"timestamp": "",
"source": "github",
"line_count": 446,
"max_line_length": 79,
"avg_line_length": 22.8542600896861,
"alnum_prop": 0.5620523888943393,
"repo_name": "b3j0f/schema",
"id": "8c9b8f5593ed36d184f4fee4f5171ae773ad6dd1",
"size": "11534",
... |
"""Options for BigMLer linear regression
"""
def get_linear_regression_options(defaults=None):
"""Adding arguments for the linear regression subcommand
"""
if defaults is None:
defaults = {}
options = {
# Input fields to include in the linear regression.
'--inear-fields': {
... | {
"content_hash": "1252beaaa1fc73fed7535e6a32277e32",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 74,
"avg_line_length": 38.30555555555556,
"alnum_prop": 0.5514865844815083,
"repo_name": "jaor/bigmler",
"id": "f37f84acfeb99f5092c8d175243cf2c411809bf3",
"size": "3360",
... |
import os, sys, inspect
if os.path.join(sys.path[0][:sys.path[0].rfind(os.sep)], '../..') not in sys.path:
sys.path.append(os.path.join(sys.path[0][:sys.path[0].rfind(os.sep)], '../..'))
import pyeq2, pyeq2.ExtendedVersionHandlers
if __name__ == "__main__":
for submodule in inspect.getmembers(pyeq2.Models_2... | {
"content_hash": "395bcc1a961865ea06f72230ed01a6b6",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 134,
"avg_line_length": 56.13333333333333,
"alnum_prop": 0.5564133016627079,
"repo_name": "JMoravec/unkRadnet",
"id": "82855143fa8c962425d5d41f49adb5551c14a438",
"size": "1... |
from flask import Blueprint
main = Blueprint('main', __name__)
from . import errors
from . import views
| {
"content_hash": "7084bb8613f62d25144c34831f8207c7",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 34,
"avg_line_length": 17.666666666666668,
"alnum_prop": 0.7169811320754716,
"repo_name": "lvhuiyang/cxcy-ims",
"id": "19559f85510ed221f36b749fd447a6dc09fa2bb4",
"size": "10... |
import os
import pkg_resources
def add_plugin(egg_info_dir, plugin_name):
"""
Add the plugin to the given distribution (or spec), in
.egg-info/paster_plugins.txt
"""
fn = os.path.join(egg_info_dir, 'paster_plugins.txt')
if not os.path.exists(fn):
lines = []
else:
f = open(fn... | {
"content_hash": "e829a3dd6b3dcf0391a2d016acf186a2",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 76,
"avg_line_length": 30.71212121212121,
"alnum_prop": 0.5614208189442526,
"repo_name": "santisiri/popego",
"id": "34afc5a32f41a656af6a6af392ff33d9271df783",
"size": "422... |
import requests
import jsonpickle
from requests_oauthlib import OAuth1
from urllib.parse import parse_qs, urlencode
import cherrypy
from collections import defaultdict
import json
import os
import re
from collections import defaultdict
# For readable serializations
jsonpickle.set_encoder_options('json', sort_keys=Tr... | {
"content_hash": "4426eed72846f69e4089b8ffa0bcddc0",
"timestamp": "",
"source": "github",
"line_count": 421,
"max_line_length": 150,
"avg_line_length": 36.365795724465556,
"alnum_prop": 0.5872632266492489,
"repo_name": "anjishnu/ask-alexa-twitter",
"id": "e0986b7dc3912a34a19f7612f40be9b6072d9a7e",
... |
import autocomplete_light
from django import forms
from django.core.validators import RegexValidator
from django.utils.translation import ugettext as _
from .models import Person, Country, Genre, Language, Film
class SearchForm(forms.Form):
title = forms.ModelChoiceField(
Film.objects.all(),
widg... | {
"content_hash": "9c9126445fa4da3be6de7546b7c7ff74",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 85,
"avg_line_length": 28.690140845070424,
"alnum_prop": 0.648993618065783,
"repo_name": "dvalcarce/filmyou-web",
"id": "971f069fe11d4386ed79499e12949a607bd48fcf",
"size": ... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('website', '0007_partner_logo'),
]
operations = [
migrations.RemoveField(
model_name='partner',
name='description',
),
]
| {
"content_hash": "95d559fb3896bf70ae78c5234bd33ced",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 41,
"avg_line_length": 18.823529411764707,
"alnum_prop": 0.5875,
"repo_name": "HackSoftware/hackconf.bg",
"id": "143f31a0e6d5cf78f0aeefe6a8b69b436f4b55c9",
"size": "392",
... |
__author__ = 'Joe Linn'
import abc
import pylastica.param
class AbstractFacet(pylastica.param.Param):
__metaclass__ = abc.ABCMeta
def __init__(self, name):
"""
@param name: the name of the facet
@type name: str
"""
super(AbstractFacet, self).__init__()
self._f... | {
"content_hash": "9d6412dc819442a69410ddcab6259abd",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 121,
"avg_line_length": 25.838383838383837,
"alnum_prop": 0.5390930414386239,
"repo_name": "jlinn/pylastica",
"id": "52f914289ecc62095448fe9e4d6b7c66e38a926e",
"size": "255... |
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('fum', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='groups',
name='creat... | {
"content_hash": "1aab44c27e625ecd53e4bc7b7c7e6c3c",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 97,
"avg_line_length": 31.18421052631579,
"alnum_prop": 0.5915611814345991,
"repo_name": "tigeli/futurice-ldap-user-manager",
"id": "aa41dca745fca9268d4ca1250aaf81b970bc1379"... |
import logging
import requests
import mimeparse
class RawVideoPlugin:
"""An export plugin that only tries to post the raw source of a video.
"""
def __init__(self, useragent: str, **options):
""" This plugin requires no initialization other than useragent.
:param useragent: The useragen... | {
"content_hash": "7cef7280ef7a73ad6c9c86f6c658950b",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 77,
"avg_line_length": 34.87301587301587,
"alnum_prop": 0.5616750113791534,
"repo_name": "Shugabuga/LapisMirror",
"id": "634cf3cd45ace7871fda3a99ca217b05a8148b6b",
"size": ... |
import os
import tempfile
from office365.sharepoint.client_context import ClientContext
from tests import test_team_site_url, test_client_credentials
client = ClientContext(test_team_site_url).with_credentials(test_client_credentials)
sharing_link_url = "https://mediadev8.sharepoint.com/:x:/s/team/EcEbi_M2xQJLng_bvQ... | {
"content_hash": "e0ec05d3129b87b29205e0cf0bad6671",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 120,
"avg_line_length": 40.0625,
"alnum_prop": 0.7784711388455539,
"repo_name": "vgrem/Office365-REST-Python-Client",
"id": "b49b2b8887aadf09e08cc993a0fd377e2a6ac9ef",
"siz... |
import os
import csv
delimiter = ','
quote_character = '"'
DATADIR = ""
DATAFILE = "beatles-diskography.csv"
def parse_file(datafile):
data = []
csv_fp = open(DATAFILE, 'rb')
csv_reader = csv.DictReader(csv_fp, fieldnames=[], restkey='undefined-fieldnames', delimiter=delimiter, quotecha... | {
"content_hash": "f6885825730aa2651334a88054642e9e",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 361,
"avg_line_length": 36.42857142857143,
"alnum_prop": 0.6284313725490196,
"repo_name": "mgumiero9/python",
"id": "1fda82ca4eedb2b9e17151bfd63d19a102f9b812",
"size": "102... |
# mygame/world/batchcode_world.py
from evennia import create_object, search_object
from typeclasses import rooms, exits
from evennia.utils import evtable
from world import map_module
# We begin by creating our rooms so we can detail them later.
centre = create_object(rooms.Room, key="crossroads")
north =... | {
"content_hash": "48732915034d7abfcf7cc2dc8a19258c",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 76,
"avg_line_length": 37.986111111111114,
"alnum_prop": 0.6420475319926874,
"repo_name": "whitehorse-io/encarnia",
"id": "cb3796fadc6b0c5f24d29c8269e2b85bd6cf808d",
"size"... |
'''
Author: Hans Erik Heggem
Email: hans.erik.heggem@gmail.com
Project: Master's Thesis - Autonomous Inspection Of Wind Blades
Repository: Master's Thesis - CV (Computer Vision)
'''
################### UNIT TEST ########################
import unittest
from Settings.TestData import TestData
from TestUnits.Test_ma... | {
"content_hash": "45d80bc52810004410fdeb1361ccfcfa",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 181,
"avg_line_length": 43.96212121212121,
"alnum_prop": 0.6998104428743753,
"repo_name": "hansehe/Wind-Blade-Inspection",
"id": "df512af487e1ee74dd636cf9a693f10ef0d0f137",
... |
__author__ = 'SL_RU'
### Логика музыкального плеера
import os
import aplayer
import random
import json
import aplayer
import musicplaylist
import audiobook
import time
def log(s):
print("BOOKS_PLAYER:" + s)
class BooksPlayer(object):
aplayer = None
books = list()
cur_book = None
path = ""
c... | {
"content_hash": "c9d2bcf23fc5764e26e261aa418d8e3f",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 130,
"avg_line_length": 26.504,
"alnum_prop": 0.555086024750981,
"repo_name": "SL-RU/RaspiBluePlayer",
"id": "9a7c83193f9130d53336fca93a9353c40bfe3062",
"size": "3337",
... |
'''
@author: sheng
@license:
'''
SPELL=u'shànglián'
CN=u'上廉'
NAME=u'shanglian42'
CHANNEL='largeintestine'
CHANNEL_FULLNAME='LargeIntestineChannelofHand-Yangming'
SEQ='LI9'
if __name__ == '__main__':
pass
| {
"content_hash": "c523d942cbd5696c9ac25671960804f0",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 55,
"avg_line_length": 13.3125,
"alnum_prop": 0.6807511737089202,
"repo_name": "sinotradition/meridian",
"id": "cd956b8ef88e061148ca5173bcf914b0c3b094e6",
"size": "253",
... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'certified'}
DOCUMENTATION = """
module: na_ontap_ntp
short_description: NetApp ONTAP NTP server
extends... | {
"content_hash": "b5f1e643b1e4b824ba64ba85242762cc",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 85,
"avg_line_length": 34.41628959276018,
"alnum_prop": 0.5512753089666053,
"repo_name": "SergeyCherepanov/ansible",
"id": "6c578805876a9cd3e9eb5943ae9689c931f8019d",
"siz... |
try:
# This API exists only in Python 2.6 and higher. :(
import multiprocessing
except ImportError:
multiprocessing = None
import ctypes
import errno
import logging
import os
import platform
import StringIO
import signal
import subprocess
import sys
import time
from webkitpy.common.system.deprecated_logg... | {
"content_hash": "1a50b6b8cf12354e852a0a1d6ea99619",
"timestamp": "",
"source": "github",
"line_count": 395,
"max_line_length": 103,
"avg_line_length": 41.75949367088607,
"alnum_prop": 0.5871476204910578,
"repo_name": "mogoweb/webkit_for_android5.1",
"id": "7d198dd43ea2532f8ac0024cac4416c46fbdfd71",
... |
'''Autogenerated by get_gl_extensions script, do not edit!'''
from OpenGL import platform as _p
from OpenGL.GL import glget
EXTENSION_NAME = 'GL_APPLE_float_pixels'
_p.unpack_constants( """GL_HALF_APPLE 0x140B
GL_RGBA_FLOAT32_APPLE 0x8814
GL_RGB_FLOAT32_APPLE 0x8815
GL_ALPHA_FLOAT32_APPLE 0x8816
GL_INTENSITY_FLOAT32_AP... | {
"content_hash": "ef5218052d8004ae70507d8e0bd71bf9",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 71,
"avg_line_length": 34.833333333333336,
"alnum_prop": 0.7954545454545454,
"repo_name": "frederica07/Dragon_Programming_Process",
"id": "ba52be7159b0c5fccd286b7747384619672... |
from . import domainresource
class DetectedIssue(domainresource.DomainResource):
""" Clinical issue with action.
Indicates an actual or potential clinical issue with or between one or more
active or proposed clinical actions for a patient; e.g. Drug-drug
interaction, Ineffective treatment frequenc... | {
"content_hash": "d952af5c83e447edda07e2a538e5f950",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 104,
"avg_line_length": 38.08629441624365,
"alnum_prop": 0.6170864987338398,
"repo_name": "all-of-us/raw-data-repository",
"id": "e2201a7a7bbb693c6f88b38f61126bd5ee3147de",
... |
"""
Virtual namespace for other pacakges to extend the growler server
"""
from typing import Dict
from types import ModuleType
import sys
from importlib import (
import_module,
)
class GrowlerExtensionImporter:
__path__ = 'growler.ext'
__name__ = 'GrowlerExtensionImporter'
__mods__: Dict[str, Modul... | {
"content_hash": "1e2fd375a3b5dacc94c9c20b31076499",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 77,
"avg_line_length": 24.853658536585368,
"alnum_prop": 0.6025515210991168,
"repo_name": "pyGrowler/Growler",
"id": "937833ccf4799dceeea3331498e7f25de40eb64b",
"size": "10... |
from __future__ import unicode_literals
from ..nx import NetworkXMetrics
def test_NetworkXMetrics_inputs():
input_map = dict(compute_clique_related_measures=dict(usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
in_file=dict(mandatory=True,
),
out_edge_metrics_... | {
"content_hash": "196acdd9aa3c83bbf0a5f7613c9b5986",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 74,
"avg_line_length": 28.571428571428573,
"alnum_prop": 0.651875,
"repo_name": "mick-d/nipype",
"id": "46c077af1bfcc1b48bd7782dc8366b9b63e35229",
"size": "1654",
"binary... |
"""A wrapper around the PX-Web API.
As implementations and versions vary, this is best used as a base class,
for more specific scrapers to extend.
If used directly, an API endpoint must be set:
scraper = PXWeb(base_url="http://api.example.com/")
# ...or:
scraper = PXWeb()
scraper.base_url = "http://ap... | {
"content_hash": "ff1f0e0b81b95a2b0d9f11b55af637bf",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 84,
"avg_line_length": 34.56603773584906,
"alnum_prop": 0.5477620087336245,
"repo_name": "jplusplus/statscraper",
"id": "fe893aebdc935d3ac6c63daa97abf70a7fc7803d",
"size":... |
from elasticsearch_dsl.search import Q, Search
def test_count_all(data_client):
s = Search(using=data_client).index("git")
assert 53 == s.count()
def test_count_prefetch(data_client, mocker):
mocker.spy(data_client, "count")
search = Search(using=data_client).index("git")
search.execute()
a... | {
"content_hash": "10a0676c013f042fcfb7090bc22679e4",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 88,
"avg_line_length": 28.36,
"alnum_prop": 0.6685472496473907,
"repo_name": "elastic/elasticsearch-dsl-py",
"id": "4b2ed9584c3adfa20c24bf7f6c394267bf6ca425",
"size": "1497... |
import discord
from discord.ext import commands
import random
class Keks:
"""
The Keks Cog
"""
def __init__(self, bot):
self.bot = bot
self.cookie_answers = [
"Oh vielen Dank!",
"Om nom nom :yum:",
"Ich liebe Kekse! :laughing:",
":blush:"... | {
"content_hash": "d3cdcd067c3906e09d48d557c405a601",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 62,
"avg_line_length": 21.285714285714285,
"alnum_prop": 0.5285234899328859,
"repo_name": "failgod-marcus/failCogs",
"id": "b5bf2c4db54eb7a30acc319ae7caa1b3fd422378",
"size... |
from __future__ import absolute_import
from django.utils.translation import ugettext as _
from django.conf import settings
from django.core import validators
from django.core.exceptions import ValidationError
from django.db import connection
from django.db.models import Q
from zerver.decorator import authenticated_api... | {
"content_hash": "90d6fac57a5afab1c059b462b6f8e814",
"timestamp": "",
"source": "github",
"line_count": 852,
"max_line_length": 115,
"avg_line_length": 43.99295774647887,
"alnum_prop": 0.5944186542873913,
"repo_name": "peiwei/zulip",
"id": "0f1301ffb12f60a89ecb69275f1e8158166f2cde",
"size": "37482"... |
__author__ = 'john'
import csv
from operator import itemgetter
import uuid
from pattern.metrics import similarity, levenshtein, LEVENSHTEIN, DICE
from fuzzywuzzy import fuzz
import nltk
import string
london = '<insert TARGET file>'
entities = '<insert PRIME file>'
def getPublicCompanies():
pc = []
with open... | {
"content_hash": "32d4051e928bf298774c3556b0163ce3",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 121,
"avg_line_length": 31.037037037037038,
"alnum_prop": 0.5657816229116945,
"repo_name": "johnconnelly75/matchr",
"id": "9238c01af6ea3a5e121e13f928a7c3a2bfdc4714",
"size... |
import itertools
from sahara.common.policies import base
from sahara.common.policies import cluster
from sahara.common.policies import cluster_template
from sahara.common.policies import cluster_templates
from sahara.common.policies import clusters
from sahara.common.policies import data_source
from sahara.common.poli... | {
"content_hash": "1afe0d27afe4eb54b6678f9ea2e09b5f",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 55,
"avg_line_length": 35.86274509803921,
"alnum_prop": 0.7288135593220338,
"repo_name": "openstack/sahara",
"id": "ad56e03b68be1acc85b2b1b8afa12bb50ae95fb4",
"size": "2375... |
from skdaccess.framework.data_class import DataFetcherStream, TableWrapper
from skdaccess.framework.param_class import *
from skdaccess.utilities.mahali_util import convert_date
from pkg_resources import resource_filename
# Standard library imports
from glob import glob
import shutil
import os
import json
from collec... | {
"content_hash": "b5660a6275749735faea094612afbd22",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 137,
"avg_line_length": 38.99354838709677,
"alnum_prop": 0.5660158835208471,
"repo_name": "skdaccess/skdaccess",
"id": "c8642271b120588fd260dc3e323524892deef2fd",
"size": ... |
from rest_framework import serializers
from constants.payments import PROVIDER_LOOKUP
from market.models import Price, price_locale
from mkt.webpay.models import ProductIcon
class PriceSerializer(serializers.ModelSerializer):
prices = serializers.SerializerMethodField('get_prices')
localized = serializers.S... | {
"content_hash": "f13ad854fcb0b58076177e6f5f8457f5",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 78,
"avg_line_length": 30.291666666666668,
"alnum_prop": 0.6279229711141678,
"repo_name": "jinankjain/zamboni",
"id": "a7c0b255d678d3af2d1749216528dcdc15aa692c",
"size": "1... |
"""
ComplaintsApi.py
Copyright 2016 SmartBear Software
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... | {
"content_hash": "81c63c6ff89ecd3c917e8caac9a381bc",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 292,
"avg_line_length": 39.82644628099174,
"alnum_prop": 0.5951442207926956,
"repo_name": "CallControl/CallControlClient",
"id": "e388b5b8b96af502786922baa4a507712893a580",
... |
import requests
from django.utils.translation import gettext_lazy as _
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
from ..base import ProviderException
from .provider import DoubanProvider
class DoubanOAuth2Adapter(OAuth2Adapter):
... | {
"content_hash": "4efc0adeabfb98146b4729333bdfaf79",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 81,
"avg_line_length": 32.023809523809526,
"alnum_prop": 0.6535315985130111,
"repo_name": "rsalmaso/django-allauth",
"id": "d96dda7cec8a5d37c3a62559cb20ebfa996b080c",
"size... |
import unittest
from cupy import testing
@testing.gpu
class TestCount(unittest.TestCase):
_multiprocess_can_split_ = True
@testing.for_all_dtypes()
@testing.numpy_cupy_allclose(type_check=False)
def test_count_nonzero(self, xp, dtype):
m = testing.shaped_random((2, 3), xp, xp.bool_)
... | {
"content_hash": "11ecac6a065237aa406e743b401027af",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 56,
"avg_line_length": 27.653846153846153,
"alnum_prop": 0.631432545201669,
"repo_name": "sinhrks/chainer",
"id": "74574a57f5646a39fc244bb600c77eeb02ebbd25",
"size": "719",... |
from django.conf import settings
def braintree_client_side_encryption_key(request):
return {
'BRAINTREE_CLIENT_SIDE_ENCRYPTION_KEY':
getattr(settings, 'BRAINTREE_CLIENT_SIDE_ENCRYPTION_KEY', None),
}
| {
"content_hash": "2bf0101e92a517412932bdf08061b078",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 72,
"avg_line_length": 28.25,
"alnum_prop": 0.7035398230088495,
"repo_name": "iconfinder/djbraintree",
"id": "97f387f24d08cd7665041c2be8975ea79740ea9c",
"size": "226",
"bi... |
from setuptools import setup
# ensure dependencies are installed
import simple
import simplewheel
assert simplewheel.__version__ == "2.0"
setup(
name="pep518_with_extra_and_markers",
version="1.0",
py_modules=["pep518_with_extra_and_markers"],
)
| {
"content_hash": "8cb9ab3a16decc223aeef231670ec52b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 49,
"avg_line_length": 20.076923076923077,
"alnum_prop": 0.7164750957854407,
"repo_name": "pradyunsg/pip",
"id": "bfac5b46783d51451a3861b726fd93b4a77f4702",
"size": "283",
... |
from landlab.field.scalar_data_fields import ScalarDataFields, FieldError
from landlab.field.grouped import ModelDataFields, GroupError, GroupSizeError
from landlab.field.field_mixin import ModelDataFieldsMixIn
from .graph_field import GraphFields
__all__ = ['ScalarDataFields', 'ModelDataFields', 'ModelDataFieldsMixIn... | {
"content_hash": "075e5a238e782a3bb1e7bef3179644f9",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 77,
"avg_line_length": 56.714285714285715,
"alnum_prop": 0.7909319899244333,
"repo_name": "csherwood-usgs/landlab",
"id": "37479db8188eb85f424298710ec0b2a3e7c70bee",
"size":... |
from .Metric import *
from .Linalg import *
from .Scaler import *
from .Trainer import *
from .Visualizer import *
| {
"content_hash": "ebe1b094f26e6dc28a38b580a6b8bb91",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 25,
"avg_line_length": 23,
"alnum_prop": 0.7391304347826086,
"repo_name": "MaxInGaussian/GomPlex",
"id": "380f86f5072d894a0ac84e78173b3a5a24182259",
"size": "381",
"binary... |
"""Fichier contenant l'action ecrire."""
from corps.fonctions import valider_cle
from primaires.scripting.action import Action
from primaires.scripting.instruction import ErreurExecution
class ClasseAction(Action):
"""écrit une information dans une structure."""
@classmethod
def init_types(cls):
... | {
"content_hash": "534dc879d8c7a39e183e5e5419d5e9f3",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 77,
"avg_line_length": 34.03921568627451,
"alnum_prop": 0.6209677419354839,
"repo_name": "vlegoff/tsunami",
"id": "636decb1437709765496666bf5a14cbcdfb90728",
"size": "3326"... |
from __future__ import division, unicode_literals, print_function
from django.db.models.signals import m2m_changed
def commodity_inventory_changed(sender, instance, *args, **kwargs):
from libs.datetimes import dates_during
from hawaii.apps.commodity.models import CommodityProduct, CommodityInventory
inve... | {
"content_hash": "3dc58eeb2fb7d7646e901839d391eda9",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 136,
"avg_line_length": 38.388888888888886,
"alnum_prop": 0.743849493487699,
"repo_name": "chenchiyuan/hawaii",
"id": "24922da768b8f40ab36d40bb91f7cbb6210eedf4",
"size": "1... |
import json
import urlparse
import requests
import app
def get_video_api_url(video_id):
return 'https://www.googleapis.com/youtube/v3/videos?part=snippet&id=%s&key=%s' % (video_id, app.config.GOOGLE_SERVER_API_KEY)
def get_channel_api_url(channel_id):
return 'https://www.googleapis.com/youtube/v3/channels?... | {
"content_hash": "8a1631df4d01a82b2107bcaf8c88e436",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 200,
"avg_line_length": 27.42016806722689,
"alnum_prop": 0.5896414342629482,
"repo_name": "arpitbbhayani/penny",
"id": "8b2b721377cbf483a572e25db53c1d9d9c754c3d",
"size": ... |
import io
import re
from setuptools import setup
with io.open('./xero/__init__.py', encoding='utf8') as version_file:
version_match = re.search(
r"^__version__ = ['\"]([^'\"]*)['\"]", version_file.read(), re.M
)
if version_match:
version = version_match.group(1)
else:
raise Run... | {
"content_hash": "25707498dd71432974f30fd6fb99d3cb",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 85,
"avg_line_length": 29.98148148148148,
"alnum_prop": 0.5898702903026559,
"repo_name": "thisismyrobot/pyxero",
"id": "d540050d9c440e1676d6e8e917b2d528cae1aaeb",
"size": "... |
from distutils.core import setup
setup(name='electrical',
version='0.1',
description='electrical',
url='http://example.com',
author='bhaskaran',
author_email='baskar4n@gmail.com',
license='MIT License',
packages=['electrical'],)
| {
"content_hash": "f9a1ceb6e99f619300d65b00ccae86c1",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 40,
"avg_line_length": 27.7,
"alnum_prop": 0.6173285198555957,
"repo_name": "bhaskar4n/Electrical-Library-",
"id": "7321f02adcff6f39669c9ae98a1ab8e9001d2281",
"size": "277"... |
from django import forms
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
from .models import User
class MyUserChangeForm(UserChangeForm):
class Meta(UserChangeForm.Meta):
model = User
... | {
"content_hash": "f4599ac29efcfe39c7fd13465e47e191",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 84,
"avg_line_length": 30.72972972972973,
"alnum_prop": 0.7053649956024626,
"repo_name": "genomics-geek/cookiecutter-django-reactjs",
"id": "a7000f2e0dfc62101c87472ff8186a5d3... |
class AxonList:
#Constructor. You can initialize your AxonListe our leave it empty
def __init__(self,listAxon=None):
"""
:param listAxon: axon liste to join. facultative, will be initialized empty if none
"""
if listAxon is None:
self.__listAxon=set()
self... | {
"content_hash": "57802741e73f02edfb6d2db9fcfba73b",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 115,
"avg_line_length": 33.314516129032256,
"alnum_prop": 0.5400629387557492,
"repo_name": "neuropoly/axonsegpy",
"id": "39c3118dd225abf7c4d89e369bde84bbbd22f407",
"size":... |
from CommonServerPython import DemistoException
from pytest import raises
def test_http_request_json_negative(requests_mock):
from VulnDB import Client, vulndb_get_cve_command
base_path = 'https://vulndb.cyberriskanalytics.com'
requests_mock.post(
f'{base_path}/oauth/token',
json={
... | {
"content_hash": "105e262d58a2136508f2d601a5262b7b",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 95,
"avg_line_length": 40.23809523809524,
"alnum_prop": 0.6532544378698225,
"repo_name": "demisto/content",
"id": "474b555f378e0b3854d885600cce64d6610bb687",
"size": "845",... |
"""
These integration tests exist solely to test the interaction between pyggybank and GPG on the CLI.
All attempts should be made to avoid extending these tests in preference for unit tests of the functions
themselves (where necessary, mocking out the GPG interactions).
TODO: It would be great to bring these tests in... | {
"content_hash": "bca40a363aadd2a999aedb0280588fca",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 112,
"avg_line_length": 27.141592920353983,
"alnum_prop": 0.6507988262145419,
"repo_name": "pelson/pyggybank",
"id": "de73f1e30b10e028598467929425da35cc1c4e27",
"size": "3... |
from __future__ import absolute_import, print_function, unicode_literals
import io
import logging
import os
import re
from datetime import datetime
import salt.client
import salt.config
import salt.runner
import six
import yaml
from django.conf import settings
from stackdio.salt.utils.logging import setup_logfile_lo... | {
"content_hash": "6310a69584209bb0015a230a61dd9e91",
"timestamp": "",
"source": "github",
"line_count": 453,
"max_line_length": 98,
"avg_line_length": 33.909492273730685,
"alnum_prop": 0.5536748909576199,
"repo_name": "stackdio/stackdio",
"id": "3914a986ccb293feb52de1967ba49e39bd6902dc",
"size": "1... |
"""
App configuration for ``polymorphic_auth.email`` app.
"""
# Register signal handlers, but avoid interacting with the database.
# See: https://docs.djangoproject.com/en/1.8/ref/applications/#django.apps.AppConfig.ready
from django.apps import AppConfig
from django.utils.module_loading import autodiscover_modules
... | {
"content_hash": "b47e19dccc06839d50d7f47e0feee5d9",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 90,
"avg_line_length": 31.714285714285715,
"alnum_prop": 0.7319819819819819,
"repo_name": "ixc/django-polymorphic-auth",
"id": "15d8b6480aa6b6050555e7b2141cdd9c93e41fb7",
"... |
from __future__ import absolute_import
import pytest
import schematec.converters as converters
import schematec.exc as exc
def test_none():
with pytest.raises(exc.ConvertationError):
converters.array(None)
def test_empty_list():
assert converters.array([]) == []
def test_empty_tuple():
asser... | {
"content_hash": "337f2a93a19d903c2ef8b315b8b73bcf",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 81,
"avg_line_length": 19.95945945945946,
"alnum_prop": 0.6086662153012864,
"repo_name": "mylokin/schematec",
"id": "114baa60f3db3ba0efee775fe824e36c62df1ef9",
"size": "147... |
from lice.core import __version__
from setuptools import setup, find_packages
long_description = open('README.rst').read()
setup(
name="lice",
version=__version__,
author="Jeremy Carbaugh",
author_email="jcarbaugh@gmail.com",
url='https://github.com/jcarbaugh/lice',
description='Generate a lic... | {
"content_hash": "0b7959f7d48f28afffa2c2a8904507be",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 56,
"avg_line_length": 28.428571428571427,
"alnum_prop": 0.6532663316582915,
"repo_name": "stupidamigo/lice-python",
"id": "93ddaed4599b099c3c70a24d5160355f3a709d2e",
"size... |
from typing import Any
from argparse import ArgumentParser
from zerver.lib.actions import do_deactivate_realm
from zerver.lib.management import ZulipBaseCommand
class Command(ZulipBaseCommand):
help = """Script to deactivate a realm."""
def add_arguments(self, parser: ArgumentParser) -> None:
self.a... | {
"content_hash": "cb8cfbae48e09c914bc949f20e0632db",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 78,
"avg_line_length": 32.608695652173914,
"alnum_prop": 0.6626666666666666,
"repo_name": "Galexrt/zulip",
"id": "1704de37a55db47618148a46d75c7ca700c37ee7",
"size": "751",
... |
"""A binary to train CIFAR-10 using multiple GPUs with synchronous updates.
Accuracy:
cifar10_multi_gpu_train.py achieves ~86% accuracy after 100K steps (256
epochs of data) as judged by cifar10_eval.py.
Speed: With batch_size 128.
System | Step Time (sec/batch) | Accuracy
-------------------------------... | {
"content_hash": "bc52929982cb3889d1b6cb064b7b0b75",
"timestamp": "",
"source": "github",
"line_count": 264,
"max_line_length": 80,
"avg_line_length": 38.13636363636363,
"alnum_prop": 0.646404449741756,
"repo_name": "alexgorban/models",
"id": "8cb8a096f844acace21a6a74e294e5a6e13ce5ff",
"size": "107... |
"""Moves patterns in path formats (suitable for moving articles)."""
from __future__ import division, absolute_import, print_function
import re
from beets.plugins import BeetsPlugin
__author__ = 'baobab@heresiarch.info'
__version__ = '1.1'
PATTERN_THE = u'^[the]{3}\s'
PATTERN_A = u'^[a][n]?\s'
FORMAT = u'{0}, {1}'
... | {
"content_hash": "d4a938005f572c5eaa5eb59db9c72e7d",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 71,
"avg_line_length": 30.011764705882353,
"alnum_prop": 0.47040376323010585,
"repo_name": "diego-plan9/beets",
"id": "cfb583ced1408ecdb74372153246ffc2009ecc7b",
"size": "3... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.