text stringlengths 4 1.02M | meta dict |
|---|---|
from __future__ import division
from datetime import timedelta, time
import nose
from distutils.version import LooseVersion
import numpy as np
import pandas as pd
from pandas import (Index, Series, DataFrame, Timestamp, Timedelta,
TimedeltaIndex, isnull, date_range,
timedelta_r... | {
"content_hash": "725b2614b152c9018759017fc24f32d4",
"timestamp": "",
"source": "github",
"line_count": 1848,
"max_line_length": 79,
"avg_line_length": 39.681277056277054,
"alnum_prop": 0.5499993181601233,
"repo_name": "BigDataforYou/movie_recommendation_workshop_1",
"id": "8f55a68a6a27a8e9454e3e08e7... |
import sqlite3
sql = 'create table zzz (aaa JSON)'
sql = 'select info1,count(*) from xxx group by info1'
sql = 'select count(*) from xxx'
sql = 'select * from xxx where aspect like "%,%" limit 36'
sql = 'select * from xxx where flex="fin" limit 36'
sql = 'select flex,count(*) from xxx where pos=="czasownik" group by ... | {
"content_hash": "003880baf31701ba5e8d72024b9c6a55",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 74,
"avg_line_length": 32.5,
"alnum_prop": 0.6857142857142857,
"repo_name": "mobarski/sandbox",
"id": "bf6b85cb0c4d34322b2f1a0f0b91d43da95cd1d3",
"size": "455",
"binary":... |
from django.contrib.auth import get_user_model
from django.forms import widgets, Media
from django.forms.utils import ErrorDict
from django.utils.translation import gettext_lazy as _
from djng.forms import fields
from sass_processor.processor import sass_processor
from shop.forms.base import DialogForm, DialogModelForm... | {
"content_hash": "d3931d20717315f2395a60460e457e88",
"timestamp": "",
"source": "github",
"line_count": 366,
"max_line_length": 122,
"avg_line_length": 40.30601092896175,
"alnum_prop": 0.6203904555314533,
"repo_name": "awesto/django-shop",
"id": "5e1ffa21669ae5b185d578ba8da047ef0a10a585",
"size": "... |
import datetime
import os
import re
import json
import urllib2
import requests
import logging
import uuid
import urlparse
from dateutil.parser import parse
from django.conf import settings
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import g... | {
"content_hash": "edf518971509b25511e3a3dbca6ec502",
"timestamp": "",
"source": "github",
"line_count": 1943,
"max_line_length": 119,
"avg_line_length": 39.64848172928461,
"alnum_prop": 0.5479444942040838,
"repo_name": "cga-harvard/hypermap",
"id": "defc089f63bc83b23f2a0dc9ddbf2d6afb78fb66",
"size"... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('oidc_provider', '0013_auto_20160407_1912'),
]
operations = [
migrations.AddField(
model_name='client',
name='jwt_alg',
... | {
"content_hash": "47d810214ed0d453cbf5a36b66440285",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 69,
"avg_line_length": 25,
"alnum_prop": 0.5327272727272727,
"repo_name": "ByteInternet/django-oidc-provider",
"id": "18a34c2a6898323a035a2bead9f5f294e315e735",
"size": "62... |
from MainFunc import main
nameInput = "LicPlateImages/use01.jpg"
nameOutput = "Output/imgDrawRec.jpg"
print(main(nameInput,nameOutput))
| {
"content_hash": "9c1ac2ef37507021f89faa83772e5c8d",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 38,
"avg_line_length": 27.4,
"alnum_prop": 0.8029197080291971,
"repo_name": "DreamN/Smart-Tollbooth",
"id": "209954dad988b9606d021e0b9f62c86a5399d6b3",
"size": "208",
"bin... |
"""
marquee model
"""
import datetime
from mongoengine import Document, StringField, DateTimeField, BooleanField
class Marquee(Document):
"""Marquee collection in main mongodb."""
display_text = StringField(max_length=50, required=True)
is_active = BooleanField(default=True, required=True)
updated_a... | {
"content_hash": "336ad1d9f586c9c34efa8b703f0b392c",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 74,
"avg_line_length": 25.894736842105264,
"alnum_prop": 0.6686991869918699,
"repo_name": "grtfou/data-analytics-web",
"id": "7b233e56e39ede185e51772a53f5b031fd8939c7",
"si... |
from __future__ import unicode_literals
from sqlalchemy.ext.declarative import declared_attr
from indico.core.db import db
from indico.core.db.sqlalchemy.principals import PrincipalMixin
from indico.core.db.sqlalchemy.util.models import auto_table_args
from indico.util.string import return_ascii
class AttachmentFol... | {
"content_hash": "de9a0d420e5e37ee976d80a11c91ed5d",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 104,
"avg_line_length": 28.58823529411765,
"alnum_prop": 0.6579218106995884,
"repo_name": "OmeGak/indico",
"id": "15dc6b2715b671a368c67691dc385d7e754d12d5",
"size": "2158",... |
from laboratory.settings import TIME_ZONE
from utils.db import namedtuplefetchall
from django.db import connection
def get_resource_by_research_hospital():
with connection.cursor() as cursor:
cursor.execute(
"""
SELECT scheduleresource_id, researches_id, dr.title, dr.short_title, d... | {
"content_hash": "1a1b4cefe5721bcc38ef7f2d523580bc",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 131,
"avg_line_length": 37.224137931034484,
"alnum_prop": 0.5845298749421028,
"repo_name": "moodpulse/l2",
"id": "32dbeb7e0b9a76adcfccabe7ab1b870705ffa9b3",
"size": "4318"... |
import xbmc
import threading
from quasar.logger import log
from quasar.rpc import server_thread
from quasar.monitor import QuasarMonitor
from quasar.daemon import quasard_thread
from quasar.library import library_thread
def run():
# Make sure the XBMC jsonrpc server is started.
xbmc.startServer(xbmc.SERVER_JS... | {
"content_hash": "1d9fd760deb2f9d306260fae003c9b19",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 82,
"avg_line_length": 27.133333333333333,
"alnum_prop": 0.699017199017199,
"repo_name": "likeitneverwentaway/plugin.video.quasar",
"id": "035cda2110928567f4679031010588f2a09... |
import cli
(output, error) = cli.run('echo hi')
print(output)
print(error)
| {
"content_hash": "fc902ff200480ac7bdc37ecb98da5551",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 36,
"avg_line_length": 18.75,
"alnum_prop": 0.7066666666666667,
"repo_name": "jasonwee/common-util-py",
"id": "e30b2513b8f51172f3d0bbe53cb7f791fe8eb2ee",
"size": "212",
"b... |
import numpy as np
import pytest
from statsmodels.datasets import randhie
from statsmodels.graphics.correlation import plot_corr, plot_corr_grid
@pytest.mark.matplotlib
def test_plot_corr(close_figures):
hie_data = randhie.load_pandas()
corr_matrix = np.corrcoef(hie_data.data.values.T)
plot_corr(corr_ma... | {
"content_hash": "962bae29d05fad70d4cf2c302f54078e",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 76,
"avg_line_length": 29.20689655172414,
"alnum_prop": 0.7119244391971665,
"repo_name": "josef-pkt/statsmodels",
"id": "de38158239c3c4fb10e2705cef8c562d8ddbe226",
"size": ... |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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,
... | {
"content_hash": "09a7afcbc96e33544e2f6b9ff0448349",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 73,
"avg_line_length": 30.134328358208954,
"alnum_prop": 0.6968796433878157,
"repo_name": "datalogics/scons",
"id": "5284d0a0bf890efb3d5b33dfed36a77d93f1a285",
"size": "201... |
from pyarrow.lib import benchmark_PandasObjectIsNull
| {
"content_hash": "269bdf1a337dd7a91066edc37fe19524",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 52,
"avg_line_length": 53,
"alnum_prop": 0.8867924528301887,
"repo_name": "itaiin/arrow",
"id": "ef1ef538dd47b9e869a6ac7ba8ba56c46b9e0ac2",
"size": "855",
"binary": false,... |
import emailipy
src = {}
for extension in ["html", "css"]:
with open("tests/test.{}".format(extension), "r") as f:
src[extension] = f.read()
def header(text):
print("\n", text, "\n", "=" * len(text))
header("Original CSS")
print(src["css"])
header("Original HTML")
print(src["html"])
header("Result... | {
"content_hash": "dcb3bea255144ef23e5e2f919f122eae",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 59,
"avg_line_length": 21.130434782608695,
"alnum_prop": 0.6378600823045267,
"repo_name": "Parsely/emailipy",
"id": "ad24e20a061ff477d51cff582bb4461c564d2bef",
"size": "486... |
from satistjenesten.scene import GenericScene
import numpy
class MosaicScene(GenericScene):
"""
Mosaic scene is an extension of GenericScene where
Several scenes are combined into one
"""
def compose_mosaic(self, scenes_list, resample_method='nn'):
self.scenes = sort_scenes_by_timestamp(s... | {
"content_hash": "1cea178fbcbb862a2583786b500f5d9d",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 81,
"avg_line_length": 35.588235294117645,
"alnum_prop": 0.618732782369146,
"repo_name": "metno/satistjenesten",
"id": "76e81ee5397d7115d623008fa01f6c37b87ff2e1",
"size": "... |
import os
import errno
import shutil
import glob
import logging
import hashlib
import sqlite3
from subprocess import call
from PyPDF2 import PdfFileWriter, PdfFileReader
import pypandoc
import yaml
from colorlog import ColoredFormatter
class Pykell:
"""
Class to generate documents from markdown files, righ... | {
"content_hash": "27f84e5b8ee183a272dc0e2ba65321f8",
"timestamp": "",
"source": "github",
"line_count": 515,
"max_line_length": 144,
"avg_line_length": 34.14174757281553,
"alnum_prop": 0.5219814593641585,
"repo_name": "morgulbrut/Pykell",
"id": "df588e8586c69ac34b73a7d95cf4ad5a17eb230d",
"size": "1... |
"""Tests for V2 summary ops from summary_ops_v2."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import unittest
import six
from tensorflow.core.framework import graph_pb2
from tensorflow.core.framework import node_def_pb2
from tensorflow.cor... | {
"content_hash": "f083e459f2db3c2ad71493d67ebffcdb",
"timestamp": "",
"source": "github",
"line_count": 1133,
"max_line_length": 85,
"avg_line_length": 36.510150044130626,
"alnum_prop": 0.6534835372044674,
"repo_name": "theflofly/tensorflow",
"id": "c03360042765afe39b0c88be799aa09571b5e81b",
"size"... |
"""Simple pre-gen hook for testing the handling of different exit codes."""
import sys
{% if cookiecutter.abort_pre_gen == "yes" %}
sys.exit(5)
{% else %}
sys.exit(0)
{% endif %}
| {
"content_hash": "03b1e1898e6f881a73ff672abeab1726",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 75,
"avg_line_length": 20.11111111111111,
"alnum_prop": 0.6574585635359116,
"repo_name": "michaeljoseph/cookiecutter",
"id": "659056300e17145937f60e0069cc07c7aac2b668",
"siz... |
__all__ = ('EVENT_SCHEDULER_START', 'EVENT_SCHEDULER_SHUTDOWN',
'EVENT_SCHEDULER_JOB_ADDED', 'EVENT_SCHEDULER_JOB_REMOVED',
'EVENT_JOB_EXECUTED', 'EVENT_JOB_ERROR', 'EVENT_JOB_MISSED',
'EVENT_ALL', 'SchedulerEvent', 'JobEvent')
EVENT_SCHEDULER_START = 1 # The scheduler was star... | {
"content_hash": "6f23e5e8a456af215cd8c9a85db59880",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 77,
"avg_line_length": 41.76086956521739,
"alnum_prop": 0.6574700676730869,
"repo_name": "ecdpalma/napscheduler",
"id": "a4080c44c719f199254c5d26c593df4e421e0708",
"size": ... |
import sys
import json
import math
import re
import os
def main():
"""
Using the JSON file of stream info, and formatted Hydro data points, this script
combines them and bins them into several JSON files. This allows the server to
only have to account for one set of Hydro data, instead of keeping streams... | {
"content_hash": "4c39517c26577445b4e25a4df393193c",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 93,
"avg_line_length": 36.266129032258064,
"alnum_prop": 0.5897264843228819,
"repo_name": "prashantchhabra89/Alternate-Power-Source-Property-Mapper",
"id": "bf28c7ad199310a0... |
import sys
def decrypt(phrase):
sentence = list(map(int, phrase.split()[4:]))
offset = 32 - min(sentence)
return ''.join(map(lambda x: chr(x + offset), sentence))
def main():
with open(sys.argv[1]) as input_file:
for phrase in input_file:
print(decrypt(phrase.strip()))
if __na... | {
"content_hash": "06da5d52baa9232f8363f22f706ac7d9",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 64,
"avg_line_length": 25.071428571428573,
"alnum_prop": 0.5783475783475783,
"repo_name": "leaen/Codeeval-solutions",
"id": "6373ea078f838fd3a48f55156d5c4c0e8e4ba8d0",
"siz... |
"""
babel.messages.catalog
~~~~~~~~~~~~~~~~~~~~~~
Data structures for message catalogs.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
import re
import time
from cgi import parse_header
from datetime import datetime, time as time_
from difflib import get... | {
"content_hash": "2f40c8855c438418a540a2b5cd2d4cc2",
"timestamp": "",
"source": "github",
"line_count": 814,
"max_line_length": 85,
"avg_line_length": 38.04054054054054,
"alnum_prop": 0.5559179719037624,
"repo_name": "kawamon/hue",
"id": "fd40058ad486bbbd7e576c61afd62a0fa0e22991",
"size": "30989",
... |
"""This example gets all teams.
To create teams, run create_teams.py.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more information, see the "Caching authentication information"
section of our README.
"""... | {
"content_hash": "3ccca7d9dad68be627effa1a0da936ab",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 77,
"avg_line_length": 28.926829268292682,
"alnum_prop": 0.6973018549747049,
"repo_name": "wubr2000/googleads-python-lib",
"id": "89694fb98cb0fceb9d1557ddec4d3b61eceaf14c",
... |
import numpy as np
from numpy.matlib import repmat
import utilities as util
class AnchorCalibrator(object):
def __init__(self, numberOfAnchors):
# Public attributes
self.numberOfAnchors = numberOfAnchors
self.anchorPositions = None
# Private attributes
self.distanceMatrixS... | {
"content_hash": "742143159c57a6a53da5a8d6c0ab355e",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 103,
"avg_line_length": 35.07909604519774,
"alnum_prop": 0.5558060879368658,
"repo_name": "mgreiff/numerical_analysis",
"id": "96a24978d4ec05b399be50049b1fad2e7fde05f5",
"... |
"""Google Cloud Storage client.
This library evolved from the Google App Engine GCS client available at
https://github.com/GoogleCloudPlatform/appengine-gcs-client.
"""
import cStringIO
import errno
import fnmatch
import logging
import multiprocessing
import os
import Queue
import re
import threading
import time
impo... | {
"content_hash": "3880b7694eeeba92c8fd05190746e628",
"timestamp": "",
"source": "github",
"line_count": 870,
"max_line_length": 92,
"avg_line_length": 34.62413793103448,
"alnum_prop": 0.6435613982671049,
"repo_name": "amitsela/beam",
"id": "c76c99d14c54b828b036702acc94ab74cef4dfa0",
"size": "30907"... |
import datetime
import os
import unittest
from google.gax.errors import GaxError
from google.gax.grpc import exc_to_code
from grpc import StatusCode
import requests
from google.cloud.environment_vars import PUBSUB_EMULATOR
from google.cloud.exceptions import Conflict
from google.cloud.pubsub import client
from test_... | {
"content_hash": "07d96480b7c40cd07eb61b856186eeab",
"timestamp": "",
"source": "github",
"line_count": 392,
"max_line_length": 79,
"avg_line_length": 36.88520408163265,
"alnum_prop": 0.6352444844041774,
"repo_name": "calpeyser/google-cloud-python",
"id": "eddfd1274da08e9cec17e8965c8e4047831a3f6d",
... |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import json
import logging
import re
import traceback
import webapp2
from dashboard.api import api_auth
from dashboard.common import utils
_ALLOWED_ORIGINS = [
'chromeperf.appspot.com',
'pinpoint-dot... | {
"content_hash": "55af11a3660ad57e11b933cb6edc0c2a",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 80,
"avg_line_length": 29.333333333333332,
"alnum_prop": 0.6902173913043478,
"repo_name": "endlessm/chromium-browser",
"id": "aba2d2dfce36ea8fdc8db953f427982c521d514f",
"s... |
__author__ = """Chris Tabor (dxdstudio@gmail.com)"""
if __name__ == '__main__':
from os import getcwd
from os import sys
sys.path.append(getcwd())
from MOAL.helpers.display import Section
from MOAL.helpers.display import print_h2
from MOAL.helpers.display import print_info
import inspect
import ast
DEBUG... | {
"content_hash": "60ae3b9c46be3f0131a1d008ce911d07",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 77,
"avg_line_length": 25.649350649350648,
"alnum_prop": 0.5539240506329114,
"repo_name": "christabor/MoAL",
"id": "530129c39a783a4db3757153b0fcc499d01874f2",
"size": "2000... |
from cStringIO import StringIO
from binascii import b2a_hex
from socket import error as socketerror
protocol_name = 'BitTorrent protocol'
def toint(s):
return long(b2a_hex(s), 16)
def tobinary(i):
return (chr(i >> 24) + chr((i >> 16) & 0xFF) +
chr((i >> 8) & 0xFF) + chr(i & 0xFF))
# header, reserve... | {
"content_hash": "79aef59cbab9e172308065dac5367a6c",
"timestamp": "",
"source": "github",
"line_count": 699,
"max_line_length": 98,
"avg_line_length": 32.065808297567955,
"alnum_prop": 0.5626840367627376,
"repo_name": "mgp/bittorrent-dissected",
"id": "f3555030f5601de21779aebfd834b82494294777",
"si... |
'''
Script to convert .xsd file to VASP input files.
'''
import argparse
import os
import re
import sys
import logging
import numpy as np
from vaspy.matstudio import XsdFile
from vaspy.incar import InCar
from vaspy import PY2
if PY2:
import commands as subprocess
else:
import subprocess
_logger = loggi... | {
"content_hash": "62cd03ea2ced6a952acfa833497788c4",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 88,
"avg_line_length": 32.52469135802469,
"alnum_prop": 0.572973998861264,
"repo_name": "PytLab/VASPy",
"id": "81350c65d7e8622606196ec22c2f9fc875a8a011",
"size": "5291",
... |
"""The Compensation integration."""
import logging
import numpy as np
import voluptuous as vol
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.const import (
CONF_ATTRIBUTE,
CONF_SOURCE,
CONF_UNIQUE_ID,
CONF_UNIT_OF_MEASUREMENT,
)
from homeassistant.core import H... | {
"content_hash": "ff1a1056f2fb602020506aabae8a4410",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 92,
"avg_line_length": 29.353982300884955,
"alnum_prop": 0.6032559541754597,
"repo_name": "nkgilley/home-assistant",
"id": "9fb5b8e9b2b1c05623e9555f6280202e8d48861d",
"siz... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import json
import os
class JSONConfigLoader:
'''
Loads a set of tasks and a schedule for them from a JSON file::
{
"tasks":
{
... | {
"content_hash": "8ff6395b3890b75e462a87973740073a",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 78,
"avg_line_length": 36.45323741007194,
"alnum_prop": 0.5395697651470298,
"repo_name": "general-ai-challenge/Round1",
"id": "73032c4df732b833fb18479d05128bd56b9291fd",
"... |
from django.db import migrations, models
import huntserver.models
class Migration(migrations.Migration):
dependencies = [
('huntserver', '0060_remove_puzzle_is_html_puzzle'),
]
operations = [
migrations.AddField(
model_name='puzzle',
name='puzzle_file',
... | {
"content_hash": "657a658d2a3e2e7769f5eae507a71bf9",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 141,
"avg_line_length": 27.58823529411765,
"alnum_prop": 0.650319829424307,
"repo_name": "dlareau/puzzlehunt_server",
"id": "e81e41c00f70b449fed42b6fd43d482bc08b59ee",
"siz... |
from __future__ import unicode_literals
import frappe
import unittest
class TestActivityLog(unittest.TestCase):
def test_activity_log(self):
from frappe.auth import LoginManager, CookieManager
# test user login log
frappe.local.form_dict = frappe._dict({
'cmd': 'login',
'sid': 'Guest',
'pwd': 'admin'... | {
"content_hash": "c02eda769f2ed535150492f51984e468",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 68,
"avg_line_length": 28.84090909090909,
"alnum_prop": 0.7084318360914106,
"repo_name": "tmimori/frappe",
"id": "e2f749ff04929e75ad7b50b9dcad5fad1d390caf",
"size": "1370",... |
from django.conf.urls import patterns, url
from django.core.urlresolvers import reverse_lazy
from django.contrib.auth.decorators import permission_required
from django.views.generic import ArchiveIndexView, YearArchiveView, MonthArchiveView, DayArchiveView, DetailView, ListView, RedirectView
from django.views.generic.e... | {
"content_hash": "972d15ed72549fb3de18fa5bbc97b469",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 136,
"avg_line_length": 73.42780748663101,
"alnum_prop": 0.4434491297065035,
"repo_name": "ngageoint/geoevents",
"id": "b59269fdc70f1b2f949a9aa46d5fc77afd2f2d5e",
"size": ... |
from django.apps.registry import Apps
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# Because we want to test creation and deletion of these as separate things,
# these models are all inserted into a separate Apps so the main test
# runner doesn't migrate them.
new_apps = ... | {
"content_hash": "e7d59557b54aeba883b0cb60e501b5d2",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 99,
"avg_line_length": 24.18243243243243,
"alnum_prop": 0.6814752724224644,
"repo_name": "aleksandra-tarkowska/django",
"id": "f5f59f7416de23a64543274f38ccdd85f682bc79",
"... |
"""Support for the SQLite database.
For information on connecting using a specific driver, see the documentation
section regarding that driver.
Date and Time Types
-------------------
SQLite does not have built-in DATE, TIME, or DATETIME types, and pysqlite does not provide
out of the box functionality for translat... | {
"content_hash": "63dde24731761e05c8908d4643621903",
"timestamp": "",
"source": "github",
"line_count": 613,
"max_line_length": 145,
"avg_line_length": 38.07993474714519,
"alnum_prop": 0.5653086578417513,
"repo_name": "igemsoftware/SYSU-Software2013",
"id": "2597a2e19c36b7725698a67de61ab98d45301f84",... |
import configparser
import datetime
import email.encoders
import email.mime.base
import email.mime.image
import email.mime.multipart
import email.mime.text
import getpass
import optparse
import os
import smtplib
import sys
# ipa参数
ipaRootDir = "/Users/" + getpass.getuser() + "/Desktop/"
ipaFileDir = datetime.datetime.... | {
"content_hash": "6737d3bf5e7b995bd0e3cc34b8d576d4",
"timestamp": "",
"source": "github",
"line_count": 311,
"max_line_length": 114,
"avg_line_length": 36.82958199356913,
"alnum_prop": 0.5303823991618648,
"repo_name": "atbj505/pythonIpa",
"id": "c19b47e65378f5569ccf2167cbbb044d6342a93d",
"size": "1... |
"""
To run these tests against a live database:
1. Modify the file ``keystone/tests/unit/config_files/backend_sql.conf`` to use
the connection for your live database.
2. Set up a blank, live database
3. Run the tests using::
tox -e py27 -- keystone.tests.unit.test_sql_upgrade
WARNING::
Your database will... | {
"content_hash": "4c0c71053b1a07c761e1164c79cf5256",
"timestamp": "",
"source": "github",
"line_count": 869,
"max_line_length": 79,
"avg_line_length": 40.072497123130034,
"alnum_prop": 0.5453866697297763,
"repo_name": "takeshineshiro/keystone",
"id": "7b14fc6772117ecbddc1ebd81d3984f23d18ad59",
"siz... |
from flask import jsonify, request
from flask_restful import Resource, reqparse
import requests, json, base64, struct
from api.sql.models import * #import all of the models from models.py
from api.app.parse_json import * #for json arg parsing
from collections import OrderedDict
# Method for encoding ints with base64... | {
"content_hash": "1ea5e1a916deb272bf43b7f23914f490",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 186,
"avg_line_length": 38.63461538461539,
"alnum_prop": 0.5462087273933964,
"repo_name": "devopsec/threatdetectionservice",
"id": "692e957361a1496479a759bcbf533d94bb3dab8a"... |
"""A class to store named variables and a scope operator to manage sharing."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections as collections_lib
import copy
import enum # pylint: disable=g-bad-import-order
import functools
import sys
im... | {
"content_hash": "798f7c41d4033c2771a9f281834d0db5",
"timestamp": "",
"source": "github",
"line_count": 2451,
"max_line_length": 109,
"avg_line_length": 41.98286413708691,
"alnum_prop": 0.648600583090379,
"repo_name": "jalexvig/tensorflow",
"id": "aca44bcd449d05db5885768391262284e61bf07b",
"size": ... |
from Generator import Generator
from os.path import exists, join
from os import mkdir
from re import search
class RepositoryGenerator(Generator):
def generate_abstract_repository(self):
abstract_repository_template = open(join(self.template_dir,'template.abstract.txt'),'r')
abstract_repository_tem... | {
"content_hash": "875397ffccb1e4be77b10468d77e1e43",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 109,
"avg_line_length": 40.87301587301587,
"alnum_prop": 0.5537864077669903,
"repo_name": "wieden-kennedy/spring-jpa-hibernate-templator",
"id": "b8328bf7fd12efbe2eed25c44492... |
from __future__ import annotations
import copy
import datetime
import io
import os
import re
import tempfile
import textwrap
import unittest
import warnings
from collections import OrderedDict
from unittest import mock
import pytest
from airflow import configuration
from airflow.configuration import (
AirflowCon... | {
"content_hash": "2bfb43a4eedbcfccf4467087b320097f",
"timestamp": "",
"source": "github",
"line_count": 1284,
"max_line_length": 109,
"avg_line_length": 41.08644859813084,
"alnum_prop": 0.5866742488863614,
"repo_name": "apache/airflow",
"id": "68710ca14e73266f95c4c90b250ef8d66f4937ed",
"size": "535... |
class BrokenLinksPipeline(object):
def process_item(self, item, spider):
return item
| {
"content_hash": "8f7001435cf134f3969a8bca5fecda41",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 41,
"avg_line_length": 32.333333333333336,
"alnum_prop": 0.7010309278350515,
"repo_name": "bootstraponline/scrapy-broken-links",
"id": "e59021c7608825992da7728b5bae1366445d203... |
from common2 import *
# NAME IDEA -> pooling/random/sparse/distributed hebbian/horde/crowd/fragment/sample memory
# FEATURES:
# + boost -- neurons with empty mem slots learn faster
# + noise --
# + dropout -- temporal disabling of neurons
# + decay -- remove from mem
# + negatives -- learning to avoid detecting some... | {
"content_hash": "7ffc76dd667a9ed8c9996b141385406a",
"timestamp": "",
"source": "github",
"line_count": 345,
"max_line_length": 119,
"avg_line_length": 25.243478260869566,
"alnum_prop": 0.590882994603284,
"repo_name": "mobarski/sandbox",
"id": "52e5db2a6ed8eea0c6a6c2fe9a736e01e282c7bd",
"size": "87... |
import itertools
import sys
from peewee import ModelQueryResultWrapper
from peewee import NaiveQueryResultWrapper
from playhouse.tests.base import ModelTestCase
from playhouse.tests.base import skip_test_if
from playhouse.tests.base import test_db
from playhouse.tests.models import *
class TestQueryResultWrapper(Mod... | {
"content_hash": "181a44d83e38b4d273caa648592c7ea1",
"timestamp": "",
"source": "github",
"line_count": 1671,
"max_line_length": 120,
"avg_line_length": 36.048473967684025,
"alnum_prop": 0.48378903331839235,
"repo_name": "ghukill/peewee",
"id": "16809fa68b443002be9feaa06ab3d3c25a5a2232",
"size": "6... |
import pmisc, pytest, docs.support.my_module
def test_func():
"""Test func() function."""
pmisc.assert_exception(
docs.support.my_module.func,
TypeError,
"Argument `name` is not valid",
{"name": 5},
)
assert docs.support.my_module.func("John") == "My name is John"
def... | {
"content_hash": "db1bfa6e5a5f73b99b18ae28524c15f3",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 70,
"avg_line_length": 30.043478260869566,
"alnum_prop": 0.6251808972503617,
"repo_name": "pmacosta/pexdoc",
"id": "855473e147c91d65dd0dbc25164553d20e06dc4e",
"size": "840"... |
"""Download Littlefield Simulation data.
Datasets are defined in the 'datasets' and may need to be updated.
"""
import csv
import datetime
import os
import requests
import auth
import config
class DownloadError(RuntimeError):
pass
def download(dataset):
"""Gets the latest known data for the given dataset... | {
"content_hash": "53a016b2efe9f9a1936cb5df663f04cc",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 101,
"avg_line_length": 31.096153846153847,
"alnum_prop": 0.626777983920841,
"repo_name": "eallrich/littlefield",
"id": "8fafb92f0a4004ec2b83802400c1a14d5fda2ea8",
"size":... |
import unittest
from graphtheory.structures.edges import Edge
from graphtheory.structures.graphs import Graph
from graphtheory.coloring.edgecolorntl import NTLEdgeColoring
# a d
# 0 --- 1 --- 2 outerplanar, chordal, 2-tree
# | / | / | 4 colors (best)
# c| b/ c| b/ c|
# | / | / |
# 3 --- 4 --- 5... | {
"content_hash": "810c64f81093bd5c0ac81dcee269f913",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 78,
"avg_line_length": 31.155172413793103,
"alnum_prop": 0.5550636413945766,
"repo_name": "ufkapano/graphs-dict",
"id": "188cee77701e84f57b29e9fb69daba16aadcbed7",
"size": ... |
from . import Dataset
import numpy as np
class MiniBatches(Dataset):
"""
Convert data into mini-batches.
"""
def __init__(self, dataset, batch_size=20, cache=True):
self.origin = dataset
self.size = batch_size
self._cached_train_set = None
self._cached_valid_set = None
... | {
"content_hash": "66d8308789577f0f8f34106d3d946a9b",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 68,
"avg_line_length": 31.62857142857143,
"alnum_prop": 0.575880758807588,
"repo_name": "zomux/deepy",
"id": "bf98b3894567a5ba943b688e7882cd862ccafbbd",
"size": "2262",
"... |
import requests
class RedFlare:
def __init__(self, url, timeout=10):
json = requests.get(url, timeout=timeout).json()
self.servers = []
self.players = []
for serverkey in json:
server = json[serverkey]
serverdata = {
'host': server['host'],
... | {
"content_hash": "a4c4c24012c4a0b8c5fddeb22593a588",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 74,
"avg_line_length": 35.588235294117645,
"alnum_prop": 0.45950413223140496,
"repo_name": "shacknetisp/fourthevaz",
"id": "ca28c37aad83c69870de4b6e0daee80749481e1d",
"size... |
import os
from populus.utils.filesystem import is_same_path
def test_paths_that_dont_exist(project_dir):
assert not os.path.exists('not-a-real-path')
assert not os.path.exists('also-not-a-real-path')
assert not is_same_path('not-a-real-path', 'also-not-a-real-path')
def test_paths_that_exist(project_d... | {
"content_hash": "f70fd15b4f89c52b89a484ae477b07a9",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 70,
"avg_line_length": 29.04,
"alnum_prop": 0.6914600550964187,
"repo_name": "pipermerriam/populus",
"id": "66bfeb44a0c2358518a6c36954d01dce30539423",
"size": "726",
"bin... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para Wupload
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core impor... | {
"content_hash": "80394097d1efe6fc6eee85c56a1b1721",
"timestamp": "",
"source": "github",
"line_count": 279,
"max_line_length": 222,
"avg_line_length": 41.702508960573475,
"alnum_prop": 0.5795444778685002,
"repo_name": "jose36/plugin.video.ProyectoLuzDigital",
"id": "4908651b41ec302744197dae97139dab0... |
from datetime import datetime, timedelta
import isodate
import re
from juliabox.cloud import Compute
from juliabox.jbox_util import JBoxCfg
from handler_base import JBoxHandler
from juliabox.interactive import SessContainer
from juliabox.jbox_tasks import JBoxAsyncJob
from juliabox.db import JBoxUserV2, JBoxDynConfig... | {
"content_hash": "44713b7e117b5691beb93208f256a3d8",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 116,
"avg_line_length": 39.039408866995075,
"alnum_prop": 0.5526813880126183,
"repo_name": "EricForgy/JuliaBox",
"id": "cc753da691b4c3647a901ad2844adb42a8814c6e",
"size": ... |
c.NotebookApp.ip = '*'
## Supply extra arguments that will be passed to Jinja environment.
#c.NotebookApp.jinja_environment_options = {}
## Extra variables to supply to jinja templates when rendering.
#c.NotebookApp.jinja_template_vars = {}
## The kernel manager class to use.
#c.NotebookApp.kernel_manager_class = 'n... | {
"content_hash": "0c188799d2cc03b9c238be204f3b68de",
"timestamp": "",
"source": "github",
"line_count": 427,
"max_line_length": 104,
"avg_line_length": 38.19203747072599,
"alnum_prop": 0.6740250183958794,
"repo_name": "mkolod/mxnet_seq2seq",
"id": "646be37353fed67eb126e26dd9f7457f6a2edf6e",
"size":... |
import argparse
from colorama import Fore
import itertools
from sklearn import cross_validation # , metrics
# from sklearn.pipeline import Pipeline
# from sklearn.feature_extraction import text
from tweedr.lib.text import gloss
from tweedr.models import DBSession, TokenizedLabel, Label
from tweedr.ml import compare_l... | {
"content_hash": "b74b633af8ec789c45da2cbf323e02b5",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 103,
"avg_line_length": 45.160377358490564,
"alnum_prop": 0.6363066638813453,
"repo_name": "dssg/tweedr",
"id": "2563073c3e840798f3f7c1cb39fb39a0c589949f",
"size": "4799",... |
"""
Several Basic Data models.
"""
# Authors: Marcel Caraciolo <marcel@muricoca.com>
# License: BSD Style
import numpy as np
from .base import BaseDataModel
from .utils import UserNotFoundError, ItemNotFoundError
import logging
logger = logging.getLogger('crab')
###################################################... | {
"content_hash": "9cae868bd418487bff415194d2ed4412",
"timestamp": "",
"source": "github",
"line_count": 756,
"max_line_length": 94,
"avg_line_length": 34.264550264550266,
"alnum_prop": 0.5333153180975911,
"repo_name": "imouren/crab",
"id": "010dbf78c097df5b4502761f11517308e1648899",
"size": "25927"... |
"""
A suite of manual-page processing tools.
"""
# ------------------------------- MODULE INFO ---------------------------------
__all__ = [
"manual_check",
"manuals_install",
"manuals_probe",
"manpath_select"
]
# ------------------------------- MODULE INFO ---------------------------------
# --------... | {
"content_hash": "df627c9f7bc67897c9f24a7448eacf6b",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 79,
"avg_line_length": 39.43981481481482,
"alnum_prop": 0.6148608991665688,
"repo_name": "jhxie/skaff",
"id": "022ee7ae9b8d2fd9393e7f2f36c328d1283dc90b",
"size": "8543",
... |
"""This example gets all campaigns with AWQL.
To add a campaign, run add_campaign.py.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more information, see the "Caching authentication information"
section of ... | {
"content_hash": "a745bd6db58db370f217d5faa0d90915",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 77,
"avg_line_length": 28.42222222222222,
"alnum_prop": 0.6489444878811571,
"repo_name": "googleads/googleads-python-lib",
"id": "f5e511a23bc0207eee2dcff4f962ba1fb99afd11",
... |
from six.moves import xrange
from sqlalchemy.orm import exc as s_exc
from testtools import matchers
from neutron.common import exceptions as n_exc
from neutron import context
from neutron.db import api as db
from neutron.db import db_base_plugin_v2
from neutron.plugins.cisco.common import cisco_constants
from neutron.... | {
"content_hash": "80689574147cbc0b1cb126a12db01623",
"timestamp": "",
"source": "github",
"line_count": 843,
"max_line_length": 79,
"avg_line_length": 48.37366548042704,
"alnum_prop": 0.5301258000441403,
"repo_name": "vijayendrabvs/hap",
"id": "f8d544340cf20b008acd05281a45ae50131fcb56",
"size": "41... |
from django.conf.urls import include, url,patterns
from django.contrib import admin
from django.views.generic import TemplateView
from django.conf import settings
from django_comments_threaded.api import views as comment_views
from moto.moe.api import views
from rest_framework.authentication import SessionAuthenticatio... | {
"content_hash": "87602c6f439bfd8d29644c62e7815dbc",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 124,
"avg_line_length": 45.11363636363637,
"alnum_prop": 0.6861460957178841,
"repo_name": "bung87/moto-moe",
"id": "9b7b1a15fff35cda1a5d6d323aede3bb0405b187",
"size": "1985... |
""" Code for checking the display of the module
for unbalanced-tuple-unpacking and unpacking-non-sequence
"""
def unpack():
""" Return something"""
return (1, 2, 3)
def nonseq():
""" Return non sequence """
return 1
| {
"content_hash": "2055e9a274238fa781964c39b4aff4e7",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 57,
"avg_line_length": 22.272727272727273,
"alnum_prop": 0.6204081632653061,
"repo_name": "arju88nair/projectCulminate",
"id": "59d9abbe41f0b99d623f702179c1bf6b9c463529",
"... |
import os
from binascii import hexlify
import django.contrib.auth
from django.core.exceptions import PermissionDenied
from django.contrib.auth.decorators import user_passes_test
def active_staff_required(function):
def ensure_is_active_staff(user):
if not user.is_authenticated():
return False
... | {
"content_hash": "0f086c3621e03cd0ec290708dcd0f4c4",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 81,
"avg_line_length": 36.59574468085106,
"alnum_prop": 0.672093023255814,
"repo_name": "castedo/celauth",
"id": "0e198ea4967844b2692ad587a3207a5c531fd082",
"size": "1720",... |
import copy
from cStringIO import StringIO
from fnmatch import fnmatch
import gzip
import hashlib
import logging
import mimetypes
import os
from boto.s3.key import Key
import app_config
import utils
logging.basicConfig(format=app_config.LOG_FORMAT)
logger = logging.getLogger(__name__)
logger.setLevel(app_config.LOG_... | {
"content_hash": "2d7da539b45fea33841e883c8f01877b",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 93,
"avg_line_length": 27.26771653543307,
"alnum_prop": 0.5763788622581577,
"repo_name": "nprapps/rockymountain",
"id": "ff4a363d67e8280a27db9e52621bd098ffbeb959",
"size":... |
import re
from streamlink.plugin import Plugin
from streamlink.plugin import PluginArguments, PluginArgument
from streamlink.plugin.api import validate
from streamlink.stream import HLSStream
CHANNEL_API_URL = "http://live.afreecatv.com:8057/afreeca/player_live_api.php"
STREAM_INFO_URLS = "{rmd}/broad_stream_assign.h... | {
"content_hash": "2cdacd55f4225b6c5ee9867381786191",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 93,
"avg_line_length": 31.01123595505618,
"alnum_prop": 0.5701086956521739,
"repo_name": "back-to/streamlink",
"id": "a9fec3f683343155640f460ceb38c931f13b8305",
"size": "5... |
import os
import email
import logging
import re
from email.header import decode_header, make_header
import base64
import hashlib
import dateutil.parser
from dateutil import tz
from dateutil.tz import tzlocal
import datetime
from bs4 import BeautifulSoup
import sys
# Make sure the current directory is in the
# path so ... | {
"content_hash": "8fe955ea2e6e53888a2e523d3971c5f1",
"timestamp": "",
"source": "github",
"line_count": 757,
"max_line_length": 144,
"avg_line_length": 43.57595772787318,
"alnum_prop": 0.5219328826507412,
"repo_name": "IntegralDefense/integralutils",
"id": "3943cc6160eeef34c48f00279925568b40f8640f",
... |
import os
import re
import subprocess
import time
from optparse import OptionParser
import sys
################################################################################
## Build Ocelot
def build(options):
command = "scons -Q"
if options.clean:
command += " -c"
if options.debug:
command += " mode=debug"... | {
"content_hash": "da6ea3aa945e8580ce89be3f22f2f6ca",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 80,
"avg_line_length": 28.443946188340806,
"alnum_prop": 0.5724420621157181,
"repo_name": "shinpei0208/gdev",
"id": "0eb2a0e2f75cf2e50b90197bb0b82d692896a311",
"size": "67... |
from django.contrib.sites.models import Site
from django.views.generic.list_detail import object_list
from django.core.paginator import EmptyPage, InvalidPage, Paginator
from django.db.models import Q
from django.http import Http404, HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404, render_t... | {
"content_hash": "a91539f2ca4131fa40c2c7e228029554",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 145,
"avg_line_length": 33.97860962566845,
"alnum_prop": 0.6432168712621971,
"repo_name": "albatrossandco/brubeck_cms",
"id": "d362fa5fbb32fc8a2acfbb7156040540538c78bf",
"... |
from oslo.config import cfg
OPTS = [
cfg.StrOpt('default-data-uri',
default='file:///usr/local/etc/default_data.json',
help='URI for default data'),
cfg.StrOpt('sources-root', default='/var/local/stackalytics',
help='The folder that holds all project sources to ana... | {
"content_hash": "bd5b8bf9cfa9db11353b6356f555b074",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 76,
"avg_line_length": 49.75,
"alnum_prop": 0.6017587939698492,
"repo_name": "HolySparky/stackalytics",
"id": "6a8273a0da8c081130aafe8a1badcb9f81b7665e",
"size": "2174",
... |
"""Test class for Ironic ManagerService."""
import datetime
import time
import mock
from oslo.config import cfg
from testtools.matchers import HasLength
from ironic.common import driver_factory
from ironic.common import exception
from ironic.common import states
from ironic.common import utils as ironic_utils
from i... | {
"content_hash": "869e46d6d6fe109c8df4facba578c5dc",
"timestamp": "",
"source": "github",
"line_count": 1302,
"max_line_length": 79,
"avg_line_length": 46.564516129032256,
"alnum_prop": 0.6044831510713049,
"repo_name": "varunarya10/ironic",
"id": "307b7c99cc18bf722452cd263ac6df64315a4fc8",
"size": ... |
import openid
if openid.__version__ < '2.0.0':
raise ImportError, 'You need python-openid 2.0.0 or newer'
elif openid.__version__ < '2.1.0':
from openid import sreg as oidsreg
else:
from openid.extensions import sreg as oidsreg
from openid.extensions import pape as oidpape
from openid.extensions im... | {
"content_hash": "f66b88ef14fc7d3381ef89ab79bf02d3",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 90,
"avg_line_length": 34.25984251968504,
"alnum_prop": 0.6099747184555274,
"repo_name": "jjanssen/django-openid-consumer",
"id": "8454068d0d15a64d2016b123751e17fb28fdbfc4",... |
"""sample_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cl... | {
"content_hash": "3ac477961054165c6fc2166eed36d5e5",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 79,
"avg_line_length": 36.666666666666664,
"alnum_prop": 0.7012987012987013,
"repo_name": "chadgh/django-xcache",
"id": "4e6c02f9d1e833b06403a273ea04650428947b55",
"size": ... |
import os
import sys
from flask import Flask
from flask import render_template
app = Flask(__name__)
@app.route('/')
def index():
bk = os.environ['BEACON_KEY']
bh = os.environ['BEACON_HOST']
return render_template('index.html', beacon_key=bk, beacon_host=bh)
if __name__ == '__main__':
app.run()
| {
"content_hash": "4902d10e8787daf82861dfb3259f71f8",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 69,
"avg_line_length": 20.466666666666665,
"alnum_prop": 0.6612377850162866,
"repo_name": "SiftScience/inline-javascript",
"id": "31115804c5dfc1f7790082d6b547923a4cdd2e2d",
... |
from setuptools import setup, find_packages
setup(
name = 'TlFEM',
version = '1.0.0',
author = 'Dorival M Pedroso',
author_email = 'dorival.pedroso@gmail.com',
packages = find_packages(),
package_data = {'': ['data/*.msh', 'data/*.cmp']},
scrip... | {
"content_hash": "c3b299f247ad5cf6c4ade58d6c3dfafa",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 74,
"avg_line_length": 34.05,
"alnum_prop": 0.5022026431718062,
"repo_name": "cpmech/tlfem",
"id": "657de82dbdb5782050e2b383b13f18f78a17b767",
"size": "849",
"binary": fa... |
import os
import dateutil.parser
from flask import flash
from model import db, Device, Move, Sample
from lxml import objectify
from filters import degree_to_radian, radian_to_degree
from datetime import datetime, timedelta
from _import import postprocess_move
from geopy.distance import vincenty
import numpy as np
# Im... | {
"content_hash": "9535da42ce6a3bc999a647f1a1e4b9e1",
"timestamp": "",
"source": "github",
"line_count": 357,
"max_line_length": 153,
"avg_line_length": 41.23809523809524,
"alnum_prop": 0.6088846624099986,
"repo_name": "mourningsun75/openmoves",
"id": "f6d07d4b568c62ca382b0afbb2521dd8a2bca1a3",
"siz... |
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/poi/hq/shared_hutt_lrg.iff"
result.attribute_template_id = -1
result.stfName("poi_n","hq_hutt_lrg")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "14bf99521fd3bc4d004005741948e842",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 63,
"avg_line_length": 22.384615384615383,
"alnum_prop": 0.6769759450171822,
"repo_name": "obi-two/Rebelion",
"id": "341be9359a73f6edb221a78d20e173bdff39b85d",
"size": "436... |
from __future__ import annotations
from collections import defaultdict
from operator import itemgetter
import typing as t
from accesslink import AccessLink as PolarApi
from accesslink.endpoints.daily_activity_transaction import DailyActivityTransaction
import pendulum
from psycopg2.extensions import connection
import... | {
"content_hash": "46e81db4d66ecf61e81f19adf4f56a46",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 97,
"avg_line_length": 36.72727272727273,
"alnum_prop": 0.5933843384338434,
"repo_name": "eirki/gargbot_3000",
"id": "a5fc5906a10f87d7731cc497bda3266cbf67b42a",
"size": "4... |
import factory
from django.test import TestCase
from accounts.models import User
class UserFactory(factory.DjangoModelFactory):
first_name = 'John'
last_name = 'Doe'
is_active = True
class Meta:
model = User
django_get_or_create = ('email',)
class AccountsModelsTests(TestCase):
... | {
"content_hash": "d658691ebd52c56777e1ba85d5760d9a",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 92,
"avg_line_length": 27.285714285714285,
"alnum_prop": 0.62478184991274,
"repo_name": "lroyland/SalaSIS",
"id": "e0de53286d5e0b0ed8a6d444dde9e63ee75b7f45",
"size": "1146"... |
import sublime, sublime_plugin, re
from ..util import sublime_view_util
############################################################################
# div タグを取得します。
############################################################################
def get_div(div_default_class):
div_default_class = " class=\"" + div_defau... | {
"content_hash": "c838cd50ff28adb50ecb8c01f4be980c",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 76,
"avg_line_length": 32.81481481481482,
"alnum_prop": 0.4548532731376975,
"repo_name": "seiichisan/HapoItak",
"id": "ac8643a2b998959a99fbaf2467ee4da984c79f77",
"size": "9... |
import os
import sys
from keras.preprocessing.text import Tokenizer
def getTexts(TEXT_DATA_DIR):
texts = [] # list of text samples
labels_index = {} # dictionary mapping label name to numeric id
labels = [] # list of label ids
for name in sorted(os.listdir(TEXT_DATA_DIR)):
path = os.path.joi... | {
"content_hash": "d19a5d0db6d0b5046ac3885edcb9c775",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 69,
"avg_line_length": 35.47727272727273,
"alnum_prop": 0.5285073670723895,
"repo_name": "huajianjiu/Radical_CR_Encoder",
"id": "cd187f175b44b0c8a5456d0b4c8cc996c75146a1",
... |
import logging
from pyvisdk.exceptions import InvalidArgumentError
# This module is NOT auto-generated
# Inspired by decompiled Java classes from vCenter's internalvim25stubs.jar
# Unless states otherside, the methods and attributes were not used by esxcli,
# and thus not tested
log = logging.getLogger(__name__)
def... | {
"content_hash": "12fb0dd9b0e574e5b6beca122d3ee913",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 146,
"avg_line_length": 40.63333333333333,
"alnum_prop": 0.7145200984413453,
"repo_name": "xuru/pyvisdk",
"id": "7e0e7b42b2bb76009da3abefb488bf06deb7f56d",
"size": "1220",
... |
# CODED TO BE EXECUTED SERVER SIDE :
# cd /home/common/shade
# python3 manage.py shell
import sys
from apis.voca import *
##################################
# Init des paths et noms de fichiers
AddLog('title' , 'Début du nettoyage du fichier')
work_dir = '/home/common/shade/apis/raw/021_raw/'
# Nom du fi... | {
"content_hash": "5bf72d943a309034036413cf14d16641",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 95,
"avg_line_length": 29.238095238095237,
"alnum_prop": 0.5863192182410424,
"repo_name": "sighill/shade_app",
"id": "565b6ee129c1c945d5fe2d95572df096ca8019f8",
"size": "12... |
import collections
import hashlib
import re
from couchdbkit import ResourceNotFound
from django_prbac.utils import has_privilege
from corehq import privileges, toggles
from corehq.apps.app_manager.dbaccessors import get_apps_in_domain
from corehq.apps.hqwebapp.templatetags.hq_shared_tags import toggle_enabled
from co... | {
"content_hash": "67245b9a7e148c165dd9598944202e84",
"timestamp": "",
"source": "github",
"line_count": 357,
"max_line_length": 108,
"avg_line_length": 35.745098039215684,
"alnum_prop": 0.6831752997413996,
"repo_name": "dimagi/commcare-hq",
"id": "f6193e29b77af048db02717d76ed17d36ffd0dc2",
"size": ... |
from django.conf import settings
auth_app, auth_model = settings.AUTH_USER_MODEL.lower().split('.')
user_view_permission = (
auth_app,
auth_model,
'view_{}'.format(auth_model)
)
GROUPS = (
('editor', (
('domain', 'attribute', 'add_attribute'),
('domain', 'attribute', 'change_attribute'),
('... | {
"content_hash": "c6c66fa6b837bef65f5c23353957bdba",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 66,
"avg_line_length": 43.40875912408759,
"alnum_prop": 0.5631410795359004,
"repo_name": "rdmorganiser/rdmo",
"id": "e6ccbd0546aed82ba7abb2c314bac3c540c9dcd5",
"size": "59... |
from django.contrib.auth import get_user_model
from django.shortcuts import get_object_or_404
from rest_framework import status
from rest_framework.permissions import AllowAny
from rest_framework.response import Response
from rest_framework.settings import api_settings
from rest_framework.views import APIView
from weba... | {
"content_hash": "6e5150a007b20b34544fe91b8c41a484",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 85,
"avg_line_length": 33.06395348837209,
"alnum_prop": 0.6444522595393002,
"repo_name": "sunscrapers/djoser",
"id": "255105d7723d755806f1276670ae3802d73b1ded",
"size": "5... |
from datetime import datetime
from opentuner import tuningrunmain
class TuningRunManager(tuningrunmain.TuningRunMain):
"""
This class manages a tuning run in a "slave" configuration, where main()
is controlled by an another program.
"""
def __init__(self, measurement_interface, args, **kwargs):
super(Tu... | {
"content_hash": "3084c92804c95872fc3a9f98473b9439",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 81,
"avg_line_length": 33.064516129032256,
"alnum_prop": 0.7014634146341463,
"repo_name": "lazyparser/opentuner",
"id": "5dc3ab97abf75e8d7c87311f78a9efef9297d757",
"size": ... |
import re
import warnings
import numpy as np
from .util import _str_to_num, _is_int, maketrans, translate, _words_group
from .verify import _Verify, _ErrList, VerifyError, VerifyWarning
from . import conf
from ...extern.six import string_types, integer_types, text_type, binary_type
from ...utils.exceptions import As... | {
"content_hash": "f14766b89fdcb5400fbb7a353881cc88",
"timestamp": "",
"source": "github",
"line_count": 1263,
"max_line_length": 82,
"avg_line_length": 38.23277909738717,
"alnum_prop": 0.5466161365142479,
"repo_name": "kelle/astropy",
"id": "668c28aa878c4a41e451de627e2f6aedb36b2a2f",
"size": "48352... |
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from future.builtins import ( # noqa
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
pow, round, super,
filter, map, zip)
import etcd
import yaml
from confi... | {
"content_hash": "b76215a7966323510dc573fdb8a026e0",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 74,
"avg_line_length": 30.177419354838708,
"alnum_prop": 0.5521111704970604,
"repo_name": "totem/config",
"id": "65547ced439998621eb605ddf4e4638d4574f9dc",
"size": "1871",
... |
"""Test transaction relay behavior during IBD:
- Set fee filters to MAX_MONEY
- Don't request transactions
- Ignore all transaction messages
"""
from decimal import Decimal
import time
from test_framework.messages import (
CInv,
COIN,
CTransaction,
from_hex,
msg_inv,
ms... | {
"content_hash": "74dd576c4275cc52118807ccb991c96b",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 116,
"avg_line_length": 43.31764705882353,
"alnum_prop": 0.6719174361759913,
"repo_name": "namecoin/namecore",
"id": "03b68482fc3a6aa27831838f42cfa4c3d578ef4e",
"size": "38... |
""" nav_square.py - Version 1.1 2013-12-20
A basic demo of the using odometry data to move the robot
along a square trajectory.
Created for the Pi Robot Project: http://www.pirobot.org
Copyright (c) 2012 Patrick Goebel. All rights reserved.
This program is free software; you can redistribute it ... | {
"content_hash": "59cddf0dda778d5e848515bc010773dd",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 123,
"avg_line_length": 40.020833333333336,
"alnum_prop": 0.6116605934409162,
"repo_name": "tramin/frobo",
"id": "34b2b020a8583aa311536b2bf3fa1cb7d42a2268",
"size": "5786"... |
"""Hold GenBank data in a straightforward format.
classes:
- Record - All of the information in a GenBank record.
- Reference - hold reference data for a record.
- Feature - Hold the information in a Feature Table.
- Qualifier - Qualifiers on a Feature.
17-MAR-2009: added support for WGS and WGS_SCAF... | {
"content_hash": "57202cd3e9a9b8d6bf28504f7ee6a80b",
"timestamp": "",
"source": "github",
"line_count": 665,
"max_line_length": 85,
"avg_line_length": 34.31578947368421,
"alnum_prop": 0.5466257668711656,
"repo_name": "zjuchenyuan/BioWeb",
"id": "b148be9986be4a4f1535611cbf94c718570b13d3",
"size": "2... |
import os
import psutil
import subprocess
from subprocess import Popen, PIPE
from sandesh.nodeinfo.cpuinfo.ttypes import *
class MemCpuUsageData(object):
def __init__(self, pid, last_cpu, last_time):
self.pid = pid
self.last_cpu = last_cpu
self.last_time = last_time
try:
... | {
"content_hash": "d1053ec31ce8cd09bdd8d1ea6496865e",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 80,
"avg_line_length": 35.18115942028985,
"alnum_prop": 0.5870236869207003,
"repo_name": "tcpcloud/contrail-controller",
"id": "3242ab35cf0ef018527e5041b379de2c3bafdb45",
... |
from __future__ import unicode_literals
import os
import re
from akamai.db.fields import AkamaiFilePathField
from akamai.utils import get_storage_class
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from model_utils.mo... | {
"content_hash": "1ed37e957f8acb24cb6c4db1aa07b319",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 309,
"avg_line_length": 31.94857142857143,
"alnum_prop": 0.5952423537828653,
"repo_name": "g3rd/django-akamai-storage",
"id": "2866e77ff2e60d78b45c48eea1616d9cb0ce5ee4",
"... |
import pytest
from api.base.settings.defaults import API_BASE
from framework.auth.oauth_scopes import public_scopes
@pytest.mark.django_db
class TestScopeList:
def test_scope_list(self, app):
url_scopes = '/{}scopes/'.format(API_BASE)
res_scopes = app.get(url_scopes)
# test_scope_list_s... | {
"content_hash": "057244667c86b5836f5b908b21512ca4",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 68,
"avg_line_length": 29.25,
"alnum_prop": 0.6267806267806267,
"repo_name": "sloria/osf.io",
"id": "18290773092e41972fa9741c24541a607494007b",
"size": "702",
"binary": f... |
"""
The script builds OpenCV.framework for OSX.
"""
from __future__ import print_function
import os, os.path, sys, argparse, traceback, multiprocessing
# import common code
sys.path.insert(0, os.path.abspath(os.path.abspath(os.path.dirname(__file__))+'/../ios'))
from build_framework import Builder
class OSXBuilder(B... | {
"content_hash": "0b4d8679e8a9aa98e14c50b049e113bf",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 159,
"avg_line_length": 39.08695652173913,
"alnum_prop": 0.6390433815350389,
"repo_name": "zzjkf2009/Midterm_Astar",
"id": "2db5cd2564ac6c73afd556801f4f75b657d220a5",
"size... |
from __future__ import unicode_literals
from . import BaseProvider
from . import date_time
import random
import hashlib
import string
class Provider(BaseProvider):
language_codes = ('cn', 'de', 'el', 'en', 'es', 'fr', 'it', 'pt', 'ru')
@classmethod
def boolean(cls, chance_of_getting_true=50):
retu... | {
"content_hash": "47a43983c31756f64c73e74399adca87",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 99,
"avg_line_length": 31,
"alnum_prop": 0.5962305183037332,
"repo_name": "DonHilborn/DataGenerator",
"id": "44bd027538190c1bfca90f678701ca491cb79126",
"size": "2775",
"b... |
"""
Authors: Damien Irving (irving.damien@gmail.com)
Copyright 2015 CSIRO
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": "90b75ff169bbcae8228273d52756771b",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 105,
"avg_line_length": 36.70103092783505,
"alnum_prop": 0.6230337078651685,
"repo_name": "CWSL/cwsl-mas",
"id": "c651f23bdfadc2a25bd05c43883faf222544d6d3",
"size": "3560",... |
from msrest.serialization import Model
class GenerateUploadUriParameter(Model):
"""Properties for generating an upload URI.
:param blob_name: The blob name of the upload URI.
:type blob_name: str
"""
_attribute_map = {
'blob_name': {'key': 'blobName', 'type': 'str'},
}
def __ini... | {
"content_hash": "07c95d8361d105e86c22ecc18b3b0643",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 56,
"avg_line_length": 23.875,
"alnum_prop": 0.6230366492146597,
"repo_name": "SUSE/azure-sdk-for-python",
"id": "134acf42259218f707f1900b6cad09dd64d029b1",
"size": "856",
... |
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc"))
from bitcoinrpc.authproxy import JSONRPCException
from test_framework import BitcoinTestFramework
from util import assert_equal, Decimal
import auxpow
class GetAuxBlockTest (BitcoinTestFramework):
d... | {
"content_hash": "801864c0014ac351d8fd517d9d6d7768",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 101,
"avg_line_length": 39.321100917431195,
"alnum_prop": 0.6794213719085395,
"repo_name": "JeremyRand/namecoin-core",
"id": "fe737737c63a146b60d7725ce61fc6215fa1693a",
"s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.