text stringlengths 4 1.02M | meta dict |
|---|---|
from django.db import models
from datetime import datetime, date
from django.contrib.auth.models import User
# Create your models here.
class XUser(User):
date_of_birth = models.DateField("Date of Birth")
blood_type = models.CharField(max_length=5)
allergies = models.CharField(max_length=500)
comments ... | {
"content_hash": "8efdae8a4e6bd69f35e876a1c5ba55db",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 53,
"avg_line_length": 26.263157894736842,
"alnum_prop": 0.6913827655310621,
"repo_name": "Thyri/TouchSave",
"id": "489dabc9cafba54402fbaac4086d3c87cbce1087",
"size": "499"... |
"""Accesses the google.datastore.v1 Datastore API."""
import collections
import json
import os
import pkg_resources
import platform
from google.gax import api_callable
from google.gax import config
from google.gax import path_template
from google.gax.utils import oneof
import google.gax
from google.cloud.gapic.datas... | {
"content_hash": "b5925c5a761e6e164e3efd6be75ae7ed",
"timestamp": "",
"source": "github",
"line_count": 385,
"max_line_length": 158,
"avg_line_length": 43.13246753246753,
"alnum_prop": 0.6232686980609419,
"repo_name": "ammarkhann/FinalSeniorCode",
"id": "f3bce200828d5f94386eb503fcb37e647622e54b",
"... |
'''
Tashlin Reddy
August 2020
Fuzzy Match strings in Columns of CSV file
'''
#read in dependencies
import pandas as pd
import numpy as np
from fuzzywuzzy import fuzz
#read in csv form
form = pd.read_csv('form.csv')
#form = pd.read_csv('https...')
#iterate over each column and check if there is a list to fuz... | {
"content_hash": "3eb5e53800a770ef702ef4e468849c23",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 81,
"avg_line_length": 26.84931506849315,
"alnum_prop": 0.5413265306122449,
"repo_name": "TheBrane/sodi-data-acquisition",
"id": "66c7d3282d85ba127113c264105300424936e998",
... |
"""Tests for moma_option."""
from unittest import mock
from absl.testing import absltest
import dm_env
from dm_robotics import agentflow as af
from dm_robotics.moma import moma_option
import numpy as np
class MomaOptionTest(absltest.TestCase):
def _create_agentflow_lambda_option(self, on_step_func):
return a... | {
"content_hash": "6035090a1f54809f802bbce24292bc68",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 70,
"avg_line_length": 31.95774647887324,
"alnum_prop": 0.628470691934773,
"repo_name": "deepmind/dm_robotics",
"id": "63b074da21412de121d31be2104016da62bac69b",
"size": "2... |
from u2flib_host.constants import APDU_OK, INS_GET_VERSION
from u2flib_host.yubicommon.compat import int2byte
from u2flib_host import exc
import struct
class U2FDevice(object):
"""
A handle to a U2F device.
device.open() needs to be called prior to using the device, and
device.close() should be calle... | {
"content_hash": "33dea96bd5f7bd2d25ea5e17337217dd",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 77,
"avg_line_length": 29.197674418604652,
"alnum_prop": 0.5448028673835126,
"repo_name": "Yubico/python-u2flib-host",
"id": "183d96bb0104aab14c5af50810e09d38da3ce845",
"si... |
from crispy_forms.bootstrap import FormActions
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Fieldset, Layout, Submit, Div
from django import forms
from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _
from core.widgets import SimpleMDE... | {
"content_hash": "6ef564720372c7c420c66bc6796cb9ce",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 61,
"avg_line_length": 27.606060606060606,
"alnum_prop": 0.6322722283205269,
"repo_name": "ccwang002/biocloud-server-kai",
"id": "decfdff235dbfdea627328ad6321120ff3f522d6",
... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from collections import defaultdict
from twitter.common.collections import OrderedSet
class UnionProducts(object):
"""Here, products for a target are th... | {
"content_hash": "e4dd65f9da806c09f1833f666ef79609",
"timestamp": "",
"source": "github",
"line_count": 285,
"max_line_length": 103,
"avg_line_length": 37.49473684210526,
"alnum_prop": 0.683230394909227,
"repo_name": "pgroudas/pants",
"id": "431d398fbf0a8bb9e37c5e581225a59f054b0fc9",
"size": "10833... |
import sys
import MySQLdb
def print_scores(cur):
cur.execute("SELECT name, score FROM leaderboard ORDER BY score DESC;")
print "Num high scores: %d" % cur.rowcount
for (name, score) in cur:
print "%s, %d" % (name, int(score))
print "Content-type: text/plain"
print ""
try:
db = MySQLdb.connect(host="",
... | {
"content_hash": "dfdd50a248a3c7de503c697ae3339580",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 73,
"avg_line_length": 22.782608695652176,
"alnum_prop": 0.5687022900763359,
"repo_name": "Matt5sean3/moon-defender",
"id": "0ac49b3b4d6e8f624d1b072b72c6914ca92b71cd",
"siz... |
""":mod:`numpy.ma..mrecords`
Defines the equivalent of :class:`numpy.recarrays` for masked arrays,
where fields can be accessed as attributes.
Note that :class:`numpy.ma.MaskedArray` already supports structured datatypes
and the masking of individual fields.
.. moduleauthor:: Pierre Gerard-Marchant
"""
# We should ... | {
"content_hash": "c90b20b0c75b6fc0c22d0f4721907be2",
"timestamp": "",
"source": "github",
"line_count": 770,
"max_line_length": 82,
"avg_line_length": 34.64805194805195,
"alnum_prop": 0.552569436635556,
"repo_name": "madphysicist/numpy",
"id": "70087632e9f62cd01943f3343e716dcf972b588f",
"size": "26... |
import datetime
import json
import os
from xml.dom.minidom import getDOMImplementation
from ipf.data import Data, Representation
from ipf.dt import *
from ipf.sysinfo import SiteName
from ipf.step import Step
from .entity import *
######################################################################################... | {
"content_hash": "d416e0b27634acd10d7f548acb901f7a",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 119,
"avg_line_length": 34.60162601626016,
"alnum_prop": 0.5044642857142857,
"repo_name": "ericblau/ipf-xsede",
"id": "7d9e5b21023994547330573e87f4aade99b1c923",
"size": "... |
from google.cloud import retail_v2beta
def sample_get_product():
# Create a client
client = retail_v2beta.ProductServiceClient()
# Initialize request argument(s)
request = retail_v2beta.GetProductRequest(
name="name_value",
)
# Make the request
response = client.get_product(reque... | {
"content_hash": "d85714ae2b15e47b6d075e8687fd943d",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 62,
"avg_line_length": 23.31578947368421,
"alnum_prop": 0.7042889390519187,
"repo_name": "googleapis/python-retail",
"id": "d6d31565b3c9cc290364d19e4eb1fd2b24e3e3ed",
"size... |
import datetime
import logging
import httplib
import httplib as http # TODO: Inconsistent usage of aliased import
from dateutil.parser import parse as parse_date
from flask import request
import markupsafe
from modularodm.exceptions import ValidationError, NoResultsFound, MultipleResultsFound
from modularodm import Q... | {
"content_hash": "6a75514d0edcf7eeef1336a0b7d56b43",
"timestamp": "",
"source": "github",
"line_count": 847,
"max_line_length": 169,
"avg_line_length": 32.684769775678866,
"alnum_prop": 0.6255960121369745,
"repo_name": "TomHeatwole/osf.io",
"id": "74a9cd205595d7f3f2fe5b397dd03973f1de7aa3",
"size": ... |
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | {
"content_hash": "63a7b42141a5a2c9c21637f74c2dc11a",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 122,
"avg_line_length": 39.700934579439256,
"alnum_prop": 0.6975047080979284,
"repo_name": "alexryndin/ambari",
"id": "a418f6dbd9485e2882c47f95db23c560770e7056",
"size": "... |
import os, sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
from pip.req import parse_requirements
try:
from loginsightwebhookdemo import __version__ as loginsightwebhookdemoversion # TODO Replace with a static variant?
except ImportError:
loginsightwebho... | {
"content_hash": "9a5603fb2ff118a8aee6a262e7d2bd9c",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 137,
"avg_line_length": 33.227722772277225,
"alnum_prop": 0.6489868891537545,
"repo_name": "vmw-loginsight/webhook-shims",
"id": "065cf92a9d654bc650273b6e39abf0a6793d00fa",
... |
import numpy as np
import pandas as pd
from scipy.integrate import trapz
from itertools import count, izip
import cPickle as pkl
# import imaging_analysis as ia
from ..classes.interval import Interval, ImagingInterval
def calc_activity(
experiment, method, interval=None, dF='from_file', channel='Ch2',
... | {
"content_hash": "5e5a1ab71a0eb89ca9f2b621b84622b7",
"timestamp": "",
"source": "github",
"line_count": 594,
"max_line_length": 95,
"avg_line_length": 43.7962962962963,
"alnum_prop": 0.558793004036133,
"repo_name": "losonczylab/Zaremba_NatNeurosci_2017",
"id": "e24f5b374ac637277a16f8b73f5e7532029e7f0... |
from __future__ import division, unicode_literals
"""
This module defines classes to represent the density of states, etc.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "2.0"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyuep@gmail.com"
__date__ = "Mar 20,... | {
"content_hash": "2e3b75f5399eda12624640e6d0e54a02",
"timestamp": "",
"source": "github",
"line_count": 492,
"max_line_length": 82,
"avg_line_length": 35.10569105691057,
"alnum_prop": 0.5309170912459472,
"repo_name": "ctoher/pymatgen",
"id": "57d6271062684f9d871a4633c59fef18da2a0a2b",
"size": "1728... |
from nose.tools import assert_equal
import matplotlib.dviread as dr
import os.path
original_find_tex_file = dr.find_tex_file
def setup():
dr.find_tex_file = lambda x: x
def teardown():
dr.find_tex_file = original_find_tex_file
def test_PsfontsMap():
filename = os.path.join(
os.path.dirname(__fil... | {
"content_hash": "14c981237813a3d26d56111750aa2e53",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 71,
"avg_line_length": 33.34,
"alnum_prop": 0.6064787042591482,
"repo_name": "lthurlow/Network-Grapher",
"id": "fe3739e8b144ce835273a946d129cef75507b11b",
"size": "1667",
... |
"""343. Integer Break
https://leetcode.com/problems/integer-break/
Given a positive integer n, break it into the sum of at least two positive
integers and maximize the product of those integers.
Return the maximum product you can get.
Example 1:
Input: 2
Output: 1
Explanation: 2 = 1 + 1, 1 × 1 = 1.
Example 2:
Inpu... | {
"content_hash": "c4096d6be3589f2763e7cabb39c1ce01",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 74,
"avg_line_length": 21.91891891891892,
"alnum_prop": 0.5450061652281134,
"repo_name": "isudox/leetcode-solution",
"id": "c83d504c72d12e86c96593895d45053603661f1b",
"size... |
import sys
# Define a main() function that prints a little greeting.
def main():
# Get the name from the command line, using 'World' as a fallback.
if len(sys.argv) <= 9:
name = sys.argv[1]
print 'The number of donuts', sys.argv[1]
if len(sys.argv) >= 9:
name = sys.argv[1]
print 'The number of donu... | {
"content_hash": "d1a208c69192f6e4812d34f9f49a65f2",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 68,
"avg_line_length": 30.11111111111111,
"alnum_prop": 0.6476014760147601,
"repo_name": "allenjcochran/google-python-class",
"id": "31d2f51701794939b8fa2ed1ff4a19267e3b8b84"... |
"""
Expose public exceptions & warnings
"""
from pandas._config.config import OptionError
from pandas._libs.tslibs import OutOfBoundsDatetime
class NullFrequencyError(ValueError):
"""
Error raised when a null `freq` attribute is used in an operation
that needs a non-null frequency, particularly `Datetim... | {
"content_hash": "43754c18426db0ddcf8bb46250076e00",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 85,
"avg_line_length": 29.485,
"alnum_prop": 0.6413430557910802,
"repo_name": "TomAugspurger/pandas",
"id": "4c4ce9df855435784c273175f82c98de0ecfd4b7",
"size": "5913",
"... |
"""
[2017-06-07] Challenge #318 [Intermediate] 2020 - NBA Revolution
https://www.reddit.com/r/dailyprogrammer/comments/6ft96y/20170607_challenge_318_intermediate_2020_nba/
# Description
We are in June 2020 and the [NBA](https://en.wikipedia.org/wiki/National_Basketball_Association) just decided to change
the format o... | {
"content_hash": "eeb75e3de87d14945dcccf5dce24bc49",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 119,
"avg_line_length": 35.41228070175438,
"alnum_prop": 0.7436215011146892,
"repo_name": "DayGitH/Python-Challenges",
"id": "537751060c1cecc478e544eb9334d850c5b89f42",
"s... |
"""
Module to create PKCS#1 v1.5 RSA signatures
See RFC3447__ or the `original RSA Labs specification`__.
This scheme is more properly called ``RSASSA-PKCS1-v1_5``.
For example, a sender can create the signature of a message using
its private RSA key:
>>> from Cryptodome.Signature import pkcs1_1... | {
"content_hash": "b83bc012ce52361d49fda1188ddee7ad",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 108,
"avg_line_length": 37.3304347826087,
"alnum_prop": 0.5963195900302819,
"repo_name": "mchristopher/PokemonGo-DesktopMap",
"id": "3b75f044dbfe5c54c1a34883b090030fafdccde4... |
__author__ = "ymotongpoo <ymotongpoo@gmail.com>"
__date__ = "$2010/09/20 22:43:10$"
__version__ = "$Revision: 0.10"
__credits__ = "0x7d8 -- programming training"
from time import sleep
import os
import urllib
import re
from StringIO import StringIO
from lxml import etree
xml_header = '<?xml version="1.0" encoding="UT... | {
"content_hash": "1f59b20aa91a4dbe86d904c0a876fc06",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 78,
"avg_line_length": 24.38888888888889,
"alnum_prop": 0.5390349968937668,
"repo_name": "ymotongpoo/restroom",
"id": "fd41169b9973166da9606e16040705b90bda4862",
"size": "... |
import time
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
from PyQt4.QtNetwork import *
# Class for Website-Rendering. Uses QWebPage, which
# requires a running QtGui to work.
class WebkitRenderer(QObject):
"""A class that helps to create 'screenshots' of webpages using
Qt'... | {
"content_hash": "c1aa73666bf79e1ecbb5b804d2078644",
"timestamp": "",
"source": "github",
"line_count": 357,
"max_line_length": 395,
"avg_line_length": 43.15126050420168,
"alnum_prop": 0.6400519311911717,
"repo_name": "Mitali-Sodhi/CodeLingo",
"id": "8e7d3c5fb0cdaaec4d2c3bbd0480baefec77b908",
"size... |
__updated__ = "2016-05-10"
import json
from protoExt.models import CustomDefinition, ViewDefinition
from protoExt.views import validateRequest
from protoExt.utils.utilsWeb import JsonError
from protoExt.views.protoGetPci import getBasePci
from protoLib.getStuff import getDjangoModel
from protoExt.utils.utilsBase impor... | {
"content_hash": "b665482bd12e9d67d48c9f2b94d926af",
"timestamp": "",
"source": "github",
"line_count": 360,
"max_line_length": 111,
"avg_line_length": 31.475,
"alnum_prop": 0.5384343835495543,
"repo_name": "DarioGT/docker-carra",
"id": "3354045b186f4c1b4a36dd3ead49640edf209fa0",
"size": "11355",
... |
"""Executed when package directory is called as a script"""
from .dlcli import main
main()
| {
"content_hash": "c395fbf2e98a2777b7f14ddde97fc3b7",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 59,
"avg_line_length": 23,
"alnum_prop": 0.7391304347826086,
"repo_name": "dataloop/dlcli",
"id": "5713fce1586ea572241f7b6548ca3ce773abe0cf",
"size": "92",
"binary": false... |
'''
validation.py
Created by Thomas Mangin on 2013-03-18.
Copyright (c) 2009-2013 Exa Networks. All rights reserved.
'''
__all__ = ["validation", "ValidationError"]
FORMAT = 3
DEBUG = False
from collections import deque
from collections import OrderedDict
from exabgp.data import check
TYPE=check.TYPE
PRESENCE=che... | {
"content_hash": "108eaaff04dc29ddb02f7c1ccd1d3c38",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 161,
"avg_line_length": 42.11842105263158,
"alnum_prop": 0.6611215245235864,
"repo_name": "jbfavre/exabgp",
"id": "7457b9da9c91a4c34d750ad0ff0af4fef547c2c9",
"size": "1282... |
from __future__ import absolute_import, print_function, unicode_literals
from aldryn_apphooks_config.managers.base import ManagerMixin, QuerySetMixin
try:
from parler.managers import TranslatableManager, TranslatableQuerySet
except ImportError:
raise ImportError(
'Parler can not be found. Use pip inst... | {
"content_hash": "a092632d825a7362c3d83f63b3ce55f2",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 77,
"avg_line_length": 38.35,
"alnum_prop": 0.711212516297262,
"repo_name": "Venturi/oldcms",
"id": "3c7d8b78491a2808c81eed5e365a0807e31fe658",
"size": "1558",
"binary": ... |
"""Proximal stochastic dual coordinate ascent optimizer for linear models."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os.path
import threading
import uuid
from six.moves import range # pylint: disable=redefined-builtin
from tensorflow.pytho... | {
"content_hash": "8512056d70d3fedae3892a8b299f111c",
"timestamp": "",
"source": "github",
"line_count": 405,
"max_line_length": 80,
"avg_line_length": 40.214814814814815,
"alnum_prop": 0.6569042794867072,
"repo_name": "panmari/tensorflow",
"id": "5820794f35adb6391e6ff09b2f89e2fece5ac6eb",
"size": "... |
import os
import requests
from collections import defaultdict
data_directory = os.path.dirname(__file__) + '/data/'
iso639_data_directory = data_directory + '/iso639/'
try:
os.mkdir(data_directory)
except FileExistsError: pass
try:
os.mkdir(iso639_data_directory)
except FileExistsError: pass
iso_639_files =... | {
"content_hash": "760fa56070421be7e103f8f4d668a2f5",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 109,
"avg_line_length": 38.504901960784316,
"alnum_prop": 0.573520050922979,
"repo_name": "longnow/panlex-tools",
"id": "0f481f93de330357294b5d91a23571359c3293df",
"size":... |
import sys
from . import main
main(sys.argv[1:])
| {
"content_hash": "9e4cec50058cb2aef6fc4c9fe6e580b9",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 18,
"avg_line_length": 12.5,
"alnum_prop": 0.7,
"repo_name": "sswan/thresh",
"id": "aa0d21e167fcae5137ecd9fc28f7b2d904820f48",
"size": "50",
"binary": false,
"copies": "... |
import datetime
import os
import django
from django.utils.translation import ugettext_lazy as _
# Which settings are we using?
# Useful for debugging.
SETTINGS = 'base'
# Base paths
DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__))
SITE_ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__)... | {
"content_hash": "66deff472b15eb12363e6487b3eb45c0",
"timestamp": "",
"source": "github",
"line_count": 271,
"max_line_length": 101,
"avg_line_length": 26.309963099630995,
"alnum_prop": 0.617671809256662,
"repo_name": "ibrahimcesar/panda",
"id": "327ad60ff8f26678bc26a5203575e5700a3212b0",
"size": "... |
import re
from zope.interface import Interface, implements
re_flags = re.M | re.U | re.I | re.S
class IWebBuilder(Interface):
"""."""
class WebBuilder(object):
implements(IWebBuilder)
configurations = {}
class Data(object):
def __init__(self, request):
self.__dict__.update(request.matchd... | {
"content_hash": "ad61504346f8902ff9f28517a666869e",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 74,
"avg_line_length": 27.16176470588235,
"alnum_prop": 0.4840281537628587,
"repo_name": "hellfish2/collective.generic.webbuilder",
"id": "27d2c03732e98c2878bd0b2d674090e305e... |
"""
@author: Disa Mhembere
@organization: Johns Hopkins University
@contact: disa@jhu.edu
@summary: A module to alter/update the MRdjango database as necessary
"""
'''
FileField stores files e.g. to media/documents based MEDIA_ROOT
Generally, each model maps to a single database table.
'''
from django.db import mode... | {
"content_hash": "973647748581378c5eb5b820689d720e",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 113,
"avg_line_length": 41.50574712643678,
"alnum_prop": 0.712545001384658,
"repo_name": "neurodata/ndgrutedb",
"id": "3e98ddb3cc911e1017e1ab11fb58d7bc2e31acd0",
"size": "4... |
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import sys
import os
import re
# python... | {
"content_hash": "25b422abb8811aeebab4de914339b13b",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 119,
"avg_line_length": 34.72950819672131,
"alnum_prop": 0.5383526079773424,
"repo_name": "mbohlool/client-python",
"id": "56f30084efdc5b2fda66928829cdb50c6de3c71c",
"size... |
"""Tools for serializing `Function`s."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.core.protobuf import saved_object_graph_pb2
from tensorflow.python.eager import function as defun
from tensorflow.python.framework import func_graph as ... | {
"content_hash": "b7675ff2144584b523658ebc8d915127",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 109,
"avg_line_length": 42.0679012345679,
"alnum_prop": 0.7393983859134262,
"repo_name": "cxxgtxy/tensorflow",
"id": "aaaead7c3fe935748e2fed6afed7dea96bcf6272",
"size": "7... |
'''
Created on Jul 26, 2016
@author: cesar
'''
from matplotlib import pyplot as plt
def levelMarkGraphsLabels(marksDictionary,date0,datef,rates=True,save=None):
"""
Plots of the marks
"""
levels = marksDictionary.keys()
levels.sort()
levelToIndices = dict(zip(levels,range(len(levels))))
... | {
"content_hash": "fa32f3502f1f5440a7b522d94c67380b",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 76,
"avg_line_length": 30.714285714285715,
"alnum_prop": 0.6159468438538206,
"repo_name": "cesarali/Tag2Hierarchy",
"id": "8102c9801c92f39012762d7bdc7f02ceaac855b1",
"size"... |
import testtools
from kmip.core import exceptions
from kmip.core import primitives
from kmip.core import utils
class TestBase(testtools.TestCase):
def setUp(self):
super(TestBase, self).setUp()
self.stream = utils.BytearrayStream()
self.bad_init = 'Bad Base initialization: attribute {0} ... | {
"content_hash": "d079bdc252248e310f81f6b44eab18a2",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 78,
"avg_line_length": 30.857798165137616,
"alnum_prop": 0.5724691541548982,
"repo_name": "OpenKMIP/PyKMIP",
"id": "0dfbdce7bedc1bb7a57479839b562df3305b9439",
"size": "737... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/furniture/all/shared_frn_all_lamp_tbl_s01.iff"
result.attribute_template_id = 6
result.stfName("frn_n","frn_lamp_table")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "709e19b96f93c7c7cb290bccc7d99d57",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 82,
"avg_line_length": 24,
"alnum_prop": 0.6923076923076923,
"repo_name": "anhstudios/swganh",
"id": "9bd4719429d0bcffd6530acfc47b8d3b70a80cae",
"size": "457",
"binary": ... |
from oslo_log import log as logging
from oslo_utils import excutils
from tempest_lib.common.utils import data_utils
from tempest.common import fixed_network
from tempest.common import service_client
from tempest.common import waiters
from tempest import config
CONF = config.CONF
LOG = logging.getLogger(__name__)
d... | {
"content_hash": "78aad95d2e4b54d13533e0e12a83570e",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 79,
"avg_line_length": 39.90909090909091,
"alnum_prop": 0.5756089013492203,
"repo_name": "liucode/tempest-master",
"id": "41b0529e8b63302e26f9e7fce92a290a7280d99c",
"size"... |
import os
import json
import boto3
table = boto3.resource("dynamodb").Table(os.environ.get("RAMBLINGS_TABLE_NAME"))
def _log_dynamo(response):
print("HTTPStatusCode:{}, RetryAttempts:{}, ScannedCount:{}, Count:{}".format(
response.get("ResponseMetadata").get("HTTPStatusCode"),
response.get("Respo... | {
"content_hash": "f79d5010c384c4acc4aa3fd5db80cf97",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 82,
"avg_line_length": 28.708333333333332,
"alnum_prop": 0.6415094339622641,
"repo_name": "Vilsepi/infinimonkey",
"id": "9abd7bf8e2009fbdf32f76a5f4741c73ccd70600",
"size": ... |
import re
import math
import json
import collections
from functools import partial
def mean(xs):
s = 0.0
for x in xs:
s += x
return s / len(xs)
def std(xs):
return math.sqrt(mean([x**2 for x in xs]) - mean(xs)**2)
def stat_mean(arr, default=float('NaN'), ndigits=0):
return round(mean(a... | {
"content_hash": "b0a19e2dee7b28112f2c0f06304c60e3",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 148,
"avg_line_length": 30.5,
"alnum_prop": 0.5302430751837196,
"repo_name": "eucpp/allocgc",
"id": "a303a871e86f707b480ca80b48b4010503b66f39",
"size": "7076",
"binary":... |
"""
Test that expr will time out and allow other threads to run if it blocks.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class ExprDoesntDeadlockTestCase(TestBase):
mydir = TestBase.com... | {
"content_hash": "98b57b562675b854717e26a6dba567b8",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 87,
"avg_line_length": 35.70175438596491,
"alnum_prop": 0.654054054054054,
"repo_name": "endlessm/chromium-browser",
"id": "d7d963390b051e01fe8079d003be89605c4d23e3",
"size... |
quote= "I think there is a world market for maybe five computers."
print("Original quote:")
print(quote)
print("\nIn uppercase:")
print(quote.upper())
print("\nIn lowercase:")
print(quote.lower())
print("\nAs a title:")
print(quote.title())
print("\nWith a minor replacement:")
print(quote.replace("five", "millions... | {
"content_hash": "bfe003822e2ab1d927c8f476609fdc81",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 66,
"avg_line_length": 19.857142857142858,
"alnum_prop": 0.7050359712230215,
"repo_name": "Ry09/Python-projects",
"id": "e517baba1ae846884d62463520f5269e81035867",
"size": ... |
import xxx, yyy
| {
"content_hash": "9541b63048ed698088514c386f4677e9",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 15,
"avg_line_length": 16,
"alnum_prop": 0.75,
"repo_name": "github/codeql",
"id": "4a22939b33361c5bb0b1555b1fa2349604714829",
"size": "16",
"binary": false,
"copies": "... |
from google.cloud import vision_v1p3beta1
async def sample_delete_reference_image():
# Create a client
client = vision_v1p3beta1.ProductSearchAsyncClient()
# Initialize request argument(s)
request = vision_v1p3beta1.DeleteReferenceImageRequest(
name="name_value",
)
# Make the request... | {
"content_hash": "5b435b459782f6d82cd54205f2d6c039",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 75,
"avg_line_length": 26.823529411764707,
"alnum_prop": 0.7456140350877193,
"repo_name": "googleapis/python-vision",
"id": "64870e36ab75550565cc3bc3e6d26a235289ac39",
"siz... |
from flask import Blueprint, render_template, abort, redirect, request, \
g, url_for
from lektor.admin.utils import fs_path_to_url_path
from lektor.environment import PRIMARY_ALT
from werkzeug.wsgi import extract_path_info
bp = Blueprint('dash', __name__, url_prefix='/admin')
endpoints = [
('/', 'index'),... | {
"content_hash": "2b7b04f6b26d894f3d67cc045a143aec",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 79,
"avg_line_length": 29.395833333333332,
"alnum_prop": 0.6236711552090716,
"repo_name": "mitsuhiko/lektor",
"id": "23e1e04b73dd152a9f66aeb8586f2be81cb336eb",
"size": "141... |
from __future__ import absolute_import, division, print_function, unicode_literals
import pytest ; pytest
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Standard library imports
# External impo... | {
"content_hash": "a470ddd07fa401f363cd4ae84a3ea694",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 82,
"avg_line_length": 32.03896103896104,
"alnum_prop": 0.3980543169841913,
"repo_name": "timsnyder/bokeh",
"id": "86e2cb060789348ae409483cfe6bf3d54296c160",
"size": "2971"... |
"""
Surge unit tests.
"""
from __future__ import division, print_function, unicode_literals, absolute_import
import sys
import os
from decimal import Decimal, ROUND_HALF_EVEN, getcontext
import psycopg2 as db
import psycopg2.extensions as ext
from psycopg2.extras import RealDictCursor
import unittest
HERE = os.path.... | {
"content_hash": "c92412921789a10495d4b181f24610b8",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 82,
"avg_line_length": 26.82758620689655,
"alnum_prop": 0.6458868894601543,
"repo_name": "tinybike/Surge",
"id": "5015e2abc6d34b572e395bb8bf1a54aa4f6d5aac",
"size": "1578",... |
"""Manila base exception handling.
Includes decorator for re-raising Manila-type exceptions.
SHOULD include dedicated exception logging.
"""
import re
from oslo_concurrency import processutils
from oslo_config import cfg
from oslo_log import log
import six
import webob.exc
from manila.i18n import _
from manila.i18... | {
"content_hash": "3ba41115ae0801253023f56289af75a3",
"timestamp": "",
"source": "github",
"line_count": 658,
"max_line_length": 79,
"avg_line_length": 26.603343465045594,
"alnum_prop": 0.6778634675806913,
"repo_name": "jcsp/manila",
"id": "9da2a14e86c30d884e4e3fe3cc90f70414693d5b",
"size": "18237",... |
class DirectoryNotifier:
def __init__(self, dirname):
if not os.path.isdir(dirname):
raise RuntimeError, "you can only watch a directory."
self.dirname = dirname
self.fd = os.open(dirname, 0)
self.currentcontents = os.listdir(dirname)
self.oldsig = fcntl.fcntl(self.fd, fcntl.F_GETSIG)
fcntl.fcntl(self.f... | {
"content_hash": "ed6db6704ffc0cc1b2dbec2573d7ef35",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 90,
"avg_line_length": 34.575,
"alnum_prop": 0.7093275488069414,
"repo_name": "ActiveState/code",
"id": "69456aa7810f2757ab70128f1fa87e50cbfafb2e",
"size": "1848",
"binar... |
""" The module provides:
* functions used when evaluating signature's features
* regexp's constants used when evaluating signature's features
"""
import unicodedata
import regex as re
from talon.utils import to_unicode
from talon.signature.constants import SIGNATURE_MAX_LINES
rc = re.compile
RE_EMAIL = rc('\S@\S... | {
"content_hash": "14fffaafb7fcaa7f523e3cf1123a8354",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 79,
"avg_line_length": 30.22421524663677,
"alnum_prop": 0.5948071216617211,
"repo_name": "tgwizard/talon",
"id": "7085a7454a171f9563ad310c6d3750be513484fa",
"size": "6765"... |
import pytest
import os
from pelops.datasets.str import get_sa_cam_id
from pelops.datasets.str import get_sa_car_id
from pelops.datasets.str import int_from_string
from pelops.datasets.str import StrDataset
@pytest.fixture
def str_sa(tmpdir):
""" Set up some test files and an instance of StrDataset(). """
# ... | {
"content_hash": "ede6a0bdf210addc51b1718350eb9d9a",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 104,
"avg_line_length": 33.898395721925134,
"alnum_prop": 0.5898406688752169,
"repo_name": "dave-lab41/pelops",
"id": "b5212715bcb7ca23c91cddd0b1659489400bc765",
"size": "... |
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from BRWRY_bootstrap.forms import BRWRYForm, BRWRYTest, HardwareForm, InstructionForm
from BRWRY_bootstrap.models import Hardware, Instruction
from BRWRY_django.BRWRY_bootstrap.forms import BRWRYModelForm, BRWRYInlineForm... | {
"content_hash": "b9de48605c36b4d181c6a3169fe14cd5",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 111,
"avg_line_length": 30.612903225806452,
"alnum_prop": 0.6101159114857745,
"repo_name": "oehokie/BRWRY-old",
"id": "896f1a36bc2756459ff1fc5b2808f9c9584e0dd0",
"size": "... |
import os
import traceback
filename = 'file.txt'
try:
f = open (filename, 'r')
try:
print f.read()
finally:
f.close()
except (os.error, IOError) as ex:
traceback.print_exc(ex)
| {
"content_hash": "b76c8eaeaafa4049ab2f8276371835ea",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 33,
"avg_line_length": 17.416666666666668,
"alnum_prop": 0.5933014354066986,
"repo_name": "janusnic/21v-python",
"id": "27425fc505e313be83b1716af1fbf769b37dabee",
"size": "... |
import logging
from cliff import command
class DeployPlugin(command.Command):
"""Overcloud Image Build plugin"""
auth_required = False
log = logging.getLogger(__name__ + ".BuildPlugin")
def get_parser(self, prog_name):
parser = super(DeployPlugin, self).get_parser(prog_name)
return ... | {
"content_hash": "9418994f7f89f11c0f0d2c80431fe0f1",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 64,
"avg_line_length": 24.941176470588236,
"alnum_prop": 0.6650943396226415,
"repo_name": "bcrochet/python-rdomanager-oscplugin",
"id": "5e001d98e519538d771c191a20a8780140fb1... |
'''
Created on 1-Apr-2015
@author: Asawari.Vaidya
'''
import cgi
import cgitb
from PythonNetBanxSDK.CardPayments.Authorization import Authorization
from PythonNetBanxSDK.CardPayments.BillingDetails import BillingDetails
from PythonNetBanxSDK.CardPayments.Card import Card
from PythonNetBanxSDK.CardPayments.CardExpiry ... | {
"content_hash": "14cf0e96a29e7ad46a93ae2791651f1b",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 110,
"avg_line_length": 28.838709677419356,
"alnum_prop": 0.7885906040268457,
"repo_name": "OptimalPayments/Python_SDK",
"id": "8b6bb1c78d73401e029bbbd23a2e0a73887e8949",
"... |
from file_operation import read_all_from_file
from git_ignore_add import git_ignore_add_ignorelist
# git ignore which
def git_ignore_which(languages):
if len(languages)==0:
return
ignores = git_ignore_add_ignorelist(languages)
if len(ignores)==0:
print "no available git ignore file"
return
for ignore in ig... | {
"content_hash": "2d8f3c714ebb8bddd0c8bd91680dd51b",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 52,
"avg_line_length": 22.733333333333334,
"alnum_prop": 0.7565982404692082,
"repo_name": "imwithye/git-ignore",
"id": "ba6d0004aac52fa6b74e2050b103295af70695e3",
"size": "... |
from django.conf.urls import url
from django.views.decorators.csrf import csrf_exempt
from . import views
urlpatterns = [
url(r'^votecollector/device/$',
views.DeviceStatus.as_view(),
name='votecollector_device'),
url(r'^votecollector/start_voting/(?P<id>\d+)/$',
views.StartYNA.as_vie... | {
"content_hash": "f37c509c77e949ff0fc6211699ef5634",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 74,
"avg_line_length": 32.22222222222222,
"alnum_prop": 0.549867374005305,
"repo_name": "jwinzer/openslides-votecollector",
"id": "36d09b6c54a11dd531253d9b1f33678e4cf43931",... |
"""
This module contains the loss classes.
Specific losses are used for regression, binary classification or multiclass
classification.
"""
# Author: Nicolas Hug
from abc import ABC, abstractmethod
import numpy as np
from scipy.special import expit, logsumexp, xlogy
from .common import Y_DTYPE
from .common import G... | {
"content_hash": "04a3e1cf47f813198b9c402259fbc1ca",
"timestamp": "",
"source": "github",
"line_count": 427,
"max_line_length": 79,
"avg_line_length": 40.976580796252925,
"alnum_prop": 0.621592272961079,
"repo_name": "glemaitre/scikit-learn",
"id": "c336bd347e4cf963064008ce17d97e2ae37cc4fe",
"size"... |
import os
import sys
import datetime
from fabric.colors import red, green
from fabric.operations import local, prompt
PROJECT_NAME = 'ssheepdog'
APPS = ['ssheepdog']
TESTS = ' '.join(APPS)
COVERAGE_SOURCES = ','.join(APPS)
COVERAGE_PARAMS = "--omit='*migrations*,*tests*"
ENVS = {
'dev': {
'repo_url': 'git... | {
"content_hash": "74193bc5094db1bd2bcad5469f007bde",
"timestamp": "",
"source": "github",
"line_count": 301,
"max_line_length": 83,
"avg_line_length": 23.774086378737543,
"alnum_prop": 0.5824482951369481,
"repo_name": "SheepDogInc/ssheepdog",
"id": "255eff84a00e39b29c7f40f4e0fa3d4946b3eb79",
"size"... |
import Sougou
import Ziguang
import Baidu
| {
"content_hash": "5eacb33c681041cf260049f92b58bd1a",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 14,
"avg_line_length": 14,
"alnum_prop": 0.8571428571428571,
"repo_name": "zer4tul/RIME-Extend-Dict",
"id": "18eb6bc9b7033e14a2b6bd8760d188c3a0ef54d3",
"size": "89",
"bina... |
from .NotifierClass import Notifier
import twitter
import re
class TVNotifier(Notifier):
def __init__(self,cfgParser,insec):
self.header = insec
self.conskey = cfgParser.get(insec,"conskey").strip()
self.conssecret = cfgParser.get(insec,"conssecret").strip()
self.acctokenkey = cfgParser.get(insec,"acctokenk... | {
"content_hash": "c42fefc3d5c29ccfb982178df0f09185",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 101,
"avg_line_length": 31.40909090909091,
"alnum_prop": 0.6714905933429812,
"repo_name": "joshcvt/natinal",
"id": "c2fd77a15aceb4bde2b02e71d5110bad7ab3a71f",
"size": "1382... |
"""This module is deprecated. Please use :mod:`airflow.operators.branch`."""
import warnings
# pylint: disable=unused-import
from airflow.operators.branch import BaseBranchOperator # noqa
warnings.warn(
"This module is deprecated. Please use `airflow.operators.branch`.", DeprecationWarning, stacklevel=2
)
| {
"content_hash": "b55dd201e77606555d7f69247808cfd3",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 105,
"avg_line_length": 31.5,
"alnum_prop": 0.7714285714285715,
"repo_name": "sekikn/incubator-airflow",
"id": "218e26e77e8d9831a3e6ec206eca764c81c3ee1d",
"size": "1102",
... |
import numpy as np
from matplotlib import colors
def rainbow(n):
"""
Returns a list of colors sampled at equal intervals over the spectrum.
Parameters
----------
n : int
The number of colors to return
Returns
-------
R : (n,3) array
An of rows of RGB color values
... | {
"content_hash": "974cc807e15968c152aca7ba8bfa8c83",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 74,
"avg_line_length": 24.23076923076923,
"alnum_prop": 0.5904761904761905,
"repo_name": "pprett/statsmodels",
"id": "615cc4609fdb33faf7e31b9891e444bd6c4837fa",
"size": "63... |
"""
This file is part of the web2py Web Framework
Developed by Massimo Di Pierro <mdipierro@cs.depaul.edu>,
limodou <limodou@gmail.com> and srackham <srackham@gmail.com>.
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
"""
import os
import sys
import code
import logging
import types
import re
import optparse
... | {
"content_hash": "747a838e4f504a65db4a09388e3e2f7d",
"timestamp": "",
"source": "github",
"line_count": 419,
"max_line_length": 96,
"avg_line_length": 30.990453460620525,
"alnum_prop": 0.5609549480169427,
"repo_name": "SEA000/uw-empathica",
"id": "948d7e276b8275c5dff82e0878315968a0239a2a",
"size": ... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lexicon', '306_0122_auto_20161007_0255'),
]
operations = [
migrations.AlterModelOptions(
name='source',
options={},
... | {
"content_hash": "f52d12cc1485ebc0da4e0ea9d3678c5c",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 53,
"avg_line_length": 23.441176470588236,
"alnum_prop": 0.5194479297365119,
"repo_name": "lingdb/CoBL-public",
"id": "451639fbc8929d806c51a405fe7f821888f55ee1",
"size": "8... |
import blameDBQuery as query
import sqlite3
import argparse
import os
parser = argparse.ArgumentParser(description = "check for files that should maybe be excluded")
parser.add_argument('database', help="which db to check")
parser.add_argument('exclusions', help="file containing exclusions (same format at plot.py)")
p... | {
"content_hash": "e4586ca9b28f49bc61bb496e440bf44b",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 95,
"avg_line_length": 32.9375,
"alnum_prop": 0.6840607210626186,
"repo_name": "bradneuman/BlameOverTime",
"id": "d8c78fbe0bbbecfc311b88c846efd70fe4bc0e76",
"size": "1088",... |
"""REANA-Job-Controller errors."""
class ComputingBackendSubmissionError(Exception):
"""Operation to compute backend could not be performed."""
| {
"content_hash": "bd5ebf676be68c6257b7448892c80806",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 62,
"avg_line_length": 30,
"alnum_prop": 0.7533333333333333,
"repo_name": "tiborsimko/reana-job-controller",
"id": "e88673c857d919122e49ef5973a381e73d31f8cf",
"size": "388",... |
import os
from os import path as op
import shutil
import glob
import warnings
from nose.tools import assert_true, assert_raises
from mne.commands import (mne_browse_raw, mne_bti2fiff, mne_clean_eog_ecg,
mne_compute_proj_ecg, mne_compute_proj_eog,
mne_coreg, mne_kit2f... | {
"content_hash": "9a90978f5d70c6f2843368f72e1c5fb4",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 79,
"avg_line_length": 33.98809523809524,
"alnum_prop": 0.6009340338587273,
"repo_name": "wronk/mne-python",
"id": "55de6ca2ebf407c5e15860ab22df728bfdbcd4e3",
"size": "858... |
__author__ = 'Josh Allen Bosley'
import SocketServer
import sql_settings
import request_handler
# Query information
recognized_queries = ['u', 'i', 's', 'g', 'a', 'ci'] # update, insert, select, generate
recent_queries = []
max_stored_queries = 25
class TCPConnectionHandler(SocketServer.BaseReque... | {
"content_hash": "fba2ef009b99d0e48d827c965e5ae20e",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 90,
"avg_line_length": 24.642857142857142,
"alnum_prop": 0.6376811594202898,
"repo_name": "LSSUHDTeam/ReservationServer",
"id": "a9ef375fe73c098f3ff6509a9e70067d66aeb86c",
... |
""":mod:`wand` --- Simple `MagickWand API`_ binding for Python
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. _MagickWand API: http://www.imagemagick.org/script/magick-wand.php
"""
| {
"content_hash": "2d81f3e07d40f3822ade419c3d44fa68",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 69,
"avg_line_length": 29,
"alnum_prop": 0.46798029556650245,
"repo_name": "tommo/gii",
"id": "c7992243745d06ab6cb5fbf98cc38ab12be1939e",
"size": "203",
"binary": false,
... |
import sys
import joblib
import pytest
from joblib.testing import check_subprocess_call
def test_version():
assert hasattr(joblib, '__version__'), (
"There are no __version__ argument on the joblib module")
def test_no_start_method_side_effect_on_import():
# check that importing joblib does not impl... | {
"content_hash": "367f1e10edeb1404bf910130af8933fb",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 78,
"avg_line_length": 36.64,
"alnum_prop": 0.6719432314410481,
"repo_name": "ryfeus/lambda-packs",
"id": "9c3b12b909f62ffb2b94e85374c6dadabc69c21e",
"size": "1832",
"bin... |
from FPPbrowser import app
from flask import render_template, request, jsonify, flash
from matplotlib import pyplot as plt
from bokeh import plotting as bkplt
from bokeh.embed import file_html, components
from bokeh.resources import CDN
import numpy as np
import os, os.path
# import vespa
import json
import mpld3
# s... | {
"content_hash": "e759e8da338385aeb6be3e16182a40b8",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 109,
"avg_line_length": 30.07936507936508,
"alnum_prop": 0.712401055408971,
"repo_name": "timothydmorton/vespa-visualization",
"id": "3aeac806c6b1a38163cd07e6961910ddcf7fd3ab... |
import functools
import inspect
import logging
from logging import handlers
import os
import sys
import time
from oslo.config import cfg
from sahara.openstack.common import log
CONF = cfg.CONF
LOG = log.getLogger(__name__)
def _get_log_file_path(logfile):
logdir = CONF.log_dir
if not logdir:
logdi... | {
"content_hash": "3fea83d9330a7d6040d7cd3369c2d5fd",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 73,
"avg_line_length": 23.78723404255319,
"alnum_prop": 0.59391771019678,
"repo_name": "tellesnobrega/storm_plugin",
"id": "0f029c052a1a6184bfbf806c0e9a6375466b7786",
"size... |
import visvis as vv
import OpenGL.GL as gl
import numpy as np
def getframe(ob):
""" getframe(object)
Get a snapshot of the current figure or axes or axesContainer.
It is retured as a numpy array (color image).
Also see vv.screenshot().
"""
# Get figure
fig = ob.GetFigure()
... | {
"content_hash": "de0511902c8d516670daa1cdb377d44b",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 74,
"avg_line_length": 24.958904109589042,
"alnum_prop": 0.5817782656421515,
"repo_name": "pbfy0/visvis",
"id": "93e95904509a04370751594f40ed82f935961b07",
"size": "1999",
... |
"""
Script that evaluates the `SunMoon` class.
For one location, this script computes solar event times for all of
the nights of one year by three methods:
1. with one call to get_solar_events_in_interval
2. with one call per day to get_solar_events
3. with one call per event to get_solar_event_time
For ... | {
"content_hash": "c648ed7ee98c79e6e11a04fc23523aab",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 78,
"avg_line_length": 28.322727272727274,
"alnum_prop": 0.6127427379232868,
"repo_name": "HaroldMills/Vesper",
"id": "f7ccebc76b73ec797ad45545c54b0fb73f054e01",
"size": "... |
from abc import ABC
from typing import TYPE_CHECKING
from azure.core.pipeline.transport import HttpRequest
from ._configuration import AzureReservationAPIConfiguration
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core import AsyncPipelineClient
from .._serialization imp... | {
"content_hash": "4333dff587857f00f9fb518348c125e0",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 68,
"avg_line_length": 27.857142857142858,
"alnum_prop": 0.7692307692307693,
"repo_name": "Azure/azure-sdk-for-python",
"id": "985979c1d804ce6c6bc8dc0c616269b7bb9be5df",
"s... |
"""Unit tests."""
import mock
import pytest
from google.cloud import trace_v1
from google.cloud.trace_v1.proto import trace_pb2
from google.protobuf import empty_pb2
class MultiCallableStub(object):
"""Stub for the grpc.UnaryUnaryMultiCallable interface."""
def __init__(self, method, channel_stub):
... | {
"content_hash": "35121d5d557f735ed71e15b89d43e2cf",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 87,
"avg_line_length": 33.868263473053894,
"alnum_prop": 0.6412659123055162,
"repo_name": "tswast/google-cloud-python",
"id": "a2601fb1848d5ee409750bd1d0ff47804282a9b2",
"... |
import os
import sys
from django.core.management.base import AppCommand
from django_extensions.management.utils import _make_writeable
from optparse import make_option
class Command(AppCommand):
option_list = AppCommand.option_list + (
make_option('--name', '-n', action='store', dest='tag_library_name', d... | {
"content_hash": "ecb36fd2e694fc640d94fc54934d13a0",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 156,
"avg_line_length": 44.161764705882355,
"alnum_prop": 0.6087246087246088,
"repo_name": "Titulacion-Sistemas/PythonTitulacion-EV",
"id": "d8f33c6cc05971ce310f72837968915ae... |
"""This code example deactivates all active placements.
To determine which placements exist, run get_all_placements.py.
"""
# Import appropriate modules from the client library.
from googleads import ad_manager
PLACEMENT_ID = 'INSERT_PLACEMENT_ID_HERE'
def main(client, placement_id):
# Initialize appropriate se... | {
"content_hash": "c6df26cc34d7f20c892f8ebff07c2454",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 78,
"avg_line_length": 31.97826086956522,
"alnum_prop": 0.681169272603671,
"repo_name": "Aloomaio/googleads-python-lib",
"id": "7b031b549854c8a94b7a644d628f093ecda7355a",
"... |
'''
Copyright (C) 2012 Diego Torres Milano
Created on Aug 31, 2013
@author: diego
'''
import sys
import os
from com.dtmilano.android.viewclient import ViewClient
if len(sys.argv) < 2:
sys.exit("usage: %s filename.png [serialno]" % sys.argv[0])
filename = sys.argv.pop(1)
device, serialno = ViewClient.connectT... | {
"content_hash": "7f47b14684564a1a1ad62c85633a8662",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 66,
"avg_line_length": 20.68421052631579,
"alnum_prop": 0.7302798982188295,
"repo_name": "jyx140521/AndroidViewClient",
"id": "5656379c380c66fd71f349c8dda78742d9507742",
"s... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('myblog', '0006_auto_20150423_1231'),
]
operations = [
migrations.CreateModel(
name='Env',
fields=[
('id', mo... | {
"content_hash": "49ec6b3effc678442372491161e08728",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 114,
"avg_line_length": 34.528301886792455,
"alnum_prop": 0.5207650273224044,
"repo_name": "madarou/angular-django",
"id": "d17c3379c56107003df754e4b8fca44421fe5b21",
"size... |
from django.conf.urls import patterns,url,include
from django.conf import settings
from django.views.generic.base import RedirectView,TemplateView
from .leave.forms import StartRequestForm, RequesterForm, CheckRequestForm
from os.path import join, dirname
_dir = join(dirname(__file__))
from django.contrib import ad... | {
"content_hash": "ce9816ea18a353756a8c98a95a01d3ab",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 142,
"avg_line_length": 53.30508474576271,
"alnum_prop": 0.5761526232114468,
"repo_name": "mikewolfli/django-goflow",
"id": "b9f8d18016f4a9d4e3e5159a035a23bb896a281a",
"siz... |
""":synopsis: Common functions for text encodings.
:module: mom.codec.text
Text encoding
-------------
::
"There is no such thing as plain text."
- Plain Text.
UTF-8 is one of the many ways in which Unicode strings can be represented as
a *sequence of bytes*, and because UTF-8 is ... | {
"content_hash": "cbaf3a037a634d568c0a55d43aaa51eb",
"timestamp": "",
"source": "github",
"line_count": 295,
"max_line_length": 79,
"avg_line_length": 29.257627118644066,
"alnum_prop": 0.6765148881937203,
"repo_name": "gorakhargosh/mom",
"id": "45dc78e987ee2bcc474ecbcd0efd8e9745a91ccc",
"size": "93... |
from __future__ import unicode_literals
import pytest
import time
from cupboard import Cupboard
from redis import ConnectionError
from test_env import INVARIANT_ENVS, INVARIANT_KEYS, INVARIANT_VALUES, filename
def test_expiry():
d = INVARIANT_ENVS[0](Cupboard)
d.rmkeys()
with d.pass_arguments(ex=1):
... | {
"content_hash": "3b3e15cae547fe0deb2acf5f693c0b6f",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 79,
"avg_line_length": 17.29268292682927,
"alnum_prop": 0.5881523272214386,
"repo_name": "lukedeo/Cupboard",
"id": "404a0bc6ffcd13078ce7479ba7884a3af74fe739",
"size": "709"... |
"""Client for interacting with the Google Cloud DNS API."""
from google.api_core import page_iterator
from google.api_core import client_options as client_options_mod
from google.cloud.client import ClientWithProject
from google.cloud.dns._http import Connection
from google.cloud.dns.zone import ManagedZone
class C... | {
"content_hash": "29e16814446dec2df1afca09cd3c5600",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 80,
"avg_line_length": 38.853658536585364,
"alnum_prop": 0.6216258631512869,
"repo_name": "googleapis/python-dns",
"id": "780849d7037751a810d9962e0f6066fc9f862055",
"size"... |
"""
Save test plots for all styles defined in `mpltools.style`.
Note that `test_artists_plot` calls `matplotlib.pyplot.tight_layout` so subplot
spacing is not tested for this plot.
"""
from __future__ import print_function
import os
import os.path as pth
import numpy as np
import matplotlib as mpl
mpl.use('Agg')
im... | {
"content_hash": "1293fd6d4f342bee5c39a4327bfc96c4",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 79,
"avg_line_length": 25.582417582417584,
"alnum_prop": 0.6280068728522337,
"repo_name": "matteoicardi/mpltools",
"id": "1cb7f86dff4a8f233d7fd461488f8ccc52fa15ca",
"size":... |
import requests
# Budapest
longitude = 19.05
latitude = 47.53
url_template = 'https://api.forecast.io/forecast/{api}/{lat},{lon}'
apikey = 'e2fd60c047ae3fac95a0618a98a9e5fd'
url = url_template.format(api=apikey, lat=latitude, lon=longitude)
# print url
params_dict = {
'units': 'si'
}
r = requests.get(url, par... | {
"content_hash": "e0f387d7b5bf95d8b14f0d7d415a56be",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 67,
"avg_line_length": 17.8,
"alnum_prop": 0.6651685393258427,
"repo_name": "Pylvax/code",
"id": "5c362194c59f55fd08a22913df6680d8ff3cbe1d",
"size": "445",
"binary": fals... |
import datetime
import json
from django.contrib.auth.mixins import LoginRequiredMixin
from django.core.exceptions import PermissionDenied
from django.urls import reverse
from django.http import HttpResponse, HttpResponseRedirect
from django.views.generic import (
CreateView, DetailView, UpdateView, View, )
fr... | {
"content_hash": "2f12867d9cf165eebf28ecffee47b4d1",
"timestamp": "",
"source": "github",
"line_count": 257,
"max_line_length": 78,
"avg_line_length": 32.3307392996109,
"alnum_prop": 0.613431219159947,
"repo_name": "ugoertz/django-familio",
"id": "f6e6cfa20b9194838de488d6c7cd22aa20ce4a3a",
"size": ... |
import re
station_list_search='/nfs/a90/eepdw/Data/Observations/Radiosonde_downloaded_from_NOAA_GUAN/igra-stations.txt'
def StationListParse(station_list_search):
'''
'''
station_metadata=[]
f = open(station_list_search,'r')
for line in f:
line = line.strip()
line=re.sub(r'([A-Z]... | {
"content_hash": "dfecce3c444071912d8a687d6439648e",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 109,
"avg_line_length": 28.29787234042553,
"alnum_prop": 0.5977443609022557,
"repo_name": "peterwilletts24/Python-Scripts",
"id": "dc1c5b7efe9b22ceb3ef2ba21b7fd93c35e98fa4",
... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_perlek.iff"
result.attribute_template_id = 9
result.stfName("monster_name","perlek")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "96b9a43082ab655e8266fc8a649d2628",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 52,
"avg_line_length": 21.615384615384617,
"alnum_prop": 0.6868327402135231,
"repo_name": "obi-two/Rebelion",
"id": "fb7f4968392e71e2f67c5df898a5f08dbe5bfeab",
"size": "426... |
import sqlalchemy as sa
from alembic import op
"""empty message
Revision ID: 30572c3dd213
Revises: None
Create Date: 2016-06-12 15:05:34.114215
"""
# revision identifiers, used by Alembic.
# revision identifiers, used by Alembic.
revision = '30572c3dd213'
down_revision = None
def upgrade():
op.create_table('... | {
"content_hash": "d7921c136c3b2603daad6a166b033c2e",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 79,
"avg_line_length": 40.018181818181816,
"alnum_prop": 0.5329395729213994,
"repo_name": "andela-hoyeboade/bucketlist-api",
"id": "e8b609ff71107b482d6bdd7778440977baf9b690",... |
from __future__ import absolute_import
import numpy as np
import tensorflow as tf
from autogp import util
from . import likelihood
class Softmax(likelihood.Likelihood):
def __init__(self, num_samples=2000):
self.num_samples = num_samples
def log_cond_prob(self, outputs, latent):
return tf.re... | {
"content_hash": "8a7abb190890694dd984b8efc2bb2a44",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 92,
"avg_line_length": 36.96969696969697,
"alnum_prop": 0.6581967213114754,
"repo_name": "ebonilla/AutoGP",
"id": "39cce1228252754b0da42623929a851614749a12",
"size": "1220"... |
"""Utilities of visualising an environment."""
from collections import deque
from typing import Callable, Dict, List, Optional, Tuple, Union
import numpy as np
import gymnasium as gym
from gymnasium import Env, logger
from gymnasium.core import ActType, ObsType
from gymnasium.error import DependencyNotInstalled
from ... | {
"content_hash": "aa37706019c5ad98ba1a8dcf221dbc6c",
"timestamp": "",
"source": "github",
"line_count": 393,
"max_line_length": 126,
"avg_line_length": 39.42239185750636,
"alnum_prop": 0.5759375201703996,
"repo_name": "Farama-Foundation/Gymnasium",
"id": "65803b4f7b5683fb7584942198b68f9cc367d812",
... |
from rpython.rlib import jit
jitdriver = jit.JitDriver(reds=["i", "s"], greens=["self"])
class Regex(object):
_immutable_fields_ = ["empty"]
def __init__(self, empty):
# empty denotes whether the regular expression
# can match the empty string
self.empty = empty
# mark that is ... | {
"content_hash": "ddd1bb3b36cb92ee2c38497787d263a5",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 81,
"avg_line_length": 26.09722222222222,
"alnum_prop": 0.5620010643959553,
"repo_name": "fhahn/miniregex",
"id": "2da90d0213c679a42117710b67545f1eef77a802",
"size": "3758... |
import random
import pylab
import pickle as pkl
import numpy as np
import pandas as pd
from scipy.misc import imread, imresize
from lasagne import layers
from theano.tensor.nnet import softmax
from nolearn.lasagne import NeuralNet
from nolearn.lasagne import BatchIterator
from sklearn.cross_validation import train_test... | {
"content_hash": "8173c447411b650d4542dae421003c55",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 87,
"avg_line_length": 31.533333333333335,
"alnum_prop": 0.7209302325581395,
"repo_name": "ManasiKhapke/Project",
"id": "07129fe1ad2a74ef9894b1d6fb71bfba075fcab1",
"size": ... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.preprocessing import Imputer
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
from sklearn.cross_validation import train_test_split
from sklearn.preprocessing import StandardScaler
# from StringIO import StringIO
# import g... | {
"content_hash": "1eecc9121ec57823529cee7d8e1d0466",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 100,
"avg_line_length": 32.58571428571429,
"alnum_prop": 0.6650591845681718,
"repo_name": "lancezlin/ml_template_py",
"id": "20db4b4dfdd35eb0b4c394fbe27e6cf0f6bd2c9c",
"siz... |
"""
split and interactively page a string or file of text
"""
def more(text, numlines=15):
lines = text.splitlines() # like split('\n') but no '' at end
while lines:
chunk = lines[:numlines]
lines = lines[numlines:]
for line in chunk: print(line)
if lines and input('More?') no... | {
"content_hash": "d9bf9b823875a6a299acc3a3cc381336",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 80,
"avg_line_length": 34.86666666666667,
"alnum_prop": 0.5544933078393881,
"repo_name": "yubo/program",
"id": "e1c264c3b7d4328daf308dfa3ccbe3dcd9ad65a0",
"size": "546",
... |
import hTools2.dialogs.glyphs.copy_paste
reload(hTools2.dialogs.glyphs.copy_paste)
hTools2.dialogs.glyphs.copy_paste.copyPasteGlyphDialog()
| {
"content_hash": "6ff694df3140135710aa319751bf9ac4",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 56,
"avg_line_length": 35.25,
"alnum_prop": 0.8439716312056738,
"repo_name": "gferreira/hTools2_extension",
"id": "86ff1581adfdbc6ba1c6c689e6a0d1e115b08d15",
"size": "161",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.