text stringlengths 4 1.02M | meta dict |
|---|---|
"""Higher level ops for building layers."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import six
from tensorflow.contrib.framework.python.ops import add_arg_scope
from tensorflow.contrib.framework.python.ops import variables
from ten... | {
"content_hash": "495e89965a601526f0c1347a9becc86b",
"timestamp": "",
"source": "github",
"line_count": 1865,
"max_line_length": 80,
"avg_line_length": 43.83699731903485,
"alnum_prop": 0.6341063652820588,
"repo_name": "XueqingLin/tensorflow",
"id": "2f2db2953be2ea0f026c15b5161d626f215765db",
"size"... |
""""""
import tkinter as tk
from tkinter import ttk
# link
__title__ = "PageView"
__version__ = "1.2.3"
__author__ = "DeflatedPickle"
class PageView(ttk.Frame):
"""
-----DESCRIPTION-----
A navigable frame that can hold however many pages you want.
-----USAGE-----
pageView = Pag... | {
"content_hash": "3e41181ce8ba27770ab9441f872fcf1c",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 91,
"avg_line_length": 32.42857142857143,
"alnum_prop": 0.561453744493392,
"repo_name": "DeflatedPickle/pkinter",
"id": "c6c43a821f0fe0c45554d399a4a556f45a86b8c1",
"size":... |
import uuid
from tempest_lib import exceptions as lib_exc
import testtools
from tempest.api.compute import base
from tempest.common import tempest_fixtures as fixtures
from tempest.common.utils import data_utils
from tempest import config
from tempest import test
CONF = config.CONF
class ServersAdminNegativeTestJS... | {
"content_hash": "42a6b496cceb388f119487987ec5d200",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 76,
"avg_line_length": 41.909774436090224,
"alnum_prop": 0.5767850735557948,
"repo_name": "Vaidyanath/tempest",
"id": "7fd87f6a04b1095d4db4c531a85ec08ad171443f",
"size": "... |
import numpy as np
import random
from oscar.constants import *
from oscar.util.point import Point
from oscar.shared.minimap import Minimap
from oscar.shared.screen import Screen
from oscar.shared.camera import Camera
from oscar.util.unit import Unit
from oscar.util.location import Location
""" Keeps track of idle uni... | {
"content_hash": "69c050100573d6d3cc99d525412e7388",
"timestamp": "",
"source": "github",
"line_count": 244,
"max_line_length": 111,
"avg_line_length": 42.25819672131148,
"alnum_prop": 0.5391329647948793,
"repo_name": "Xaxetrov/OSCAR",
"id": "51898359ae9382049362d9eccd2fa5500be4e833",
"size": "1031... |
def new(num_buckets=256):
"""Initializes a Map with the given number of buckets."""
aMap = []
for i in range(0, num_buckets):
aMap.append([])
return aMap
def hash_key(aMap, key):
"""Given a key this will create a number and then convert it to
an index for the aMap's buckets."""
ret... | {
"content_hash": "fb8f7eb58be8db81491fdafb71b602fa",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 67,
"avg_line_length": 26,
"alnum_prop": 0.5997150997150997,
"repo_name": "githubfun/lphw",
"id": "2a1374241bf29af48c99b4f368ba8457d615e450",
"size": "702",
"binary": fal... |
"""Wait for all subtasks have done.
"""
import tornado
import tornado.locks
from tornado.concurrent import Future
class ProcessWaiter(tornado.locks._TimeoutGarbageCollector):
def __init__(self):
super(ProcessWaiter, self).__init__()
self._value = 0
def __repr__(self):
res = super(Pro... | {
"content_hash": "dc5621307a7a4ca3b23a05e203d718c9",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 103,
"avg_line_length": 33.032786885245905,
"alnum_prop": 0.5712158808933002,
"repo_name": "ly0/starfarming-python",
"id": "430a23fd10c18592aea0f46c2df1f1e73fec3911",
"size... |
from chameleon.tales import StructureExpr
from chameleon.codegen import template
from smc.mw import MediaWiki
class MediaWikiExpression(StructureExpr):
def __call__(self, target, engine):
compiler = engine.parse(self.expression)
body = compiler.assign_value(target)
def mw_render(content)... | {
"content_hash": "4b4f3c33394e022d81e1cf9b6ba6fdb1",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 103,
"avg_line_length": 35.411764705882355,
"alnum_prop": 0.6428571428571429,
"repo_name": "cyplp/cyplp.wikipedia",
"id": "7a2432f1fa01a421d82076a163e36b435a11f013",
"size"... |
from functools import partial
from plaid.errors import PLAID_ERROR_MAP
from plaid.http import _outer_http_request
from plaid.utils import to_json
_base_http_request = _outer_http_request()
# method keyword arg to simplify partial function application
def http_request(url, method=None, data=None, suppress_errors=F... | {
"content_hash": "efb586c5bfdd59a9ab364177ead49335",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 69,
"avg_line_length": 32.19230769230769,
"alnum_prop": 0.7264038231780168,
"repo_name": "erikbern/plaid-python",
"id": "b271a5c9a1306ae8119f7e6566f61a52b00ed529",
"size": ... |
raise Exception("TESS.py got replaced with PredictedTESS.py")
| {
"content_hash": "1b026ebebd203d831bb81c3d244f0513",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 61,
"avg_line_length": 62,
"alnum_prop": 0.8064516129032258,
"repo_name": "zkbt/exopop",
"id": "762823ef4e97d2bbe7f40ffac426f910588e84fe",
"size": "62",
"binary": false,
... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/furniture/jedi/shared_frn_all_banner_light.iff"
result.attribute_template_id = 6
result.stfName("frn_n","frn_all_banner_light")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "c5063d694aa3e55771b3d9b4df0c7e19",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 83,
"avg_line_length": 24.53846153846154,
"alnum_prop": 0.6990595611285266,
"repo_name": "obi-two/Rebelion",
"id": "9fba9271ce7bcceb494ebbfac65dc16287b058ce",
"size": "464"... |
def singleton(cls, *args, **kw):
instances = {}
def getinstance():
if cls not in instances:
instances[cls] = cls(*args, **kw)
return instances[cls]
return getinstance | {
"content_hash": "c6afb38eeb64a7143420b4aadea89dc2",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 45,
"avg_line_length": 29.428571428571427,
"alnum_prop": 0.5776699029126213,
"repo_name": "jwang-share/theysay",
"id": "3bacaa3c3b5cba64fc5703070480e7f80741c0e1",
"size": "2... |
from js9 import j
def configure(job):
"""
this method will be called from the node.zero-os install action.
"""
import netaddr
from zeroos.orchestrator.configuration import get_configuration, get_jwt_token
from zeroos.orchestrator.sal.Node import Node
from zeroos.orchestrator.sal.Container ... | {
"content_hash": "dd0012f48b8366b61ecbd678aa471160",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 130,
"avg_line_length": 46.18032786885246,
"alnum_prop": 0.6599219027334043,
"repo_name": "g8os/grid",
"id": "b269d7f98a3c3d1d84e2e8a923fe87fe30b0bf65",
"size": "2817",
"... |
import unittest
from azure.storage.blob import (
BlockBlobService,
)
from azure.storage.blob.models import StandardBlobTier, BatchSetBlobTierSubRequest, RehydratePriority
from tests.testcase import (
StorageTestCase,
record,
)
# -----------------------------------------------------------------------------... | {
"content_hash": "839f00c9fca49a69ac7e47563e1cf7c4",
"timestamp": "",
"source": "github",
"line_count": 324,
"max_line_length": 120,
"avg_line_length": 43.00617283950617,
"alnum_prop": 0.6437491029137362,
"repo_name": "Azure/azure-storage-python",
"id": "262a35439c4386774e833b52aec75643ee2e970a",
"... |
"""Test spending coinbase transactions.
The coinbase transaction in block N can appear in block
N+100... so is valid in the mempool when the best block
height is N+99.
This test makes sure coinbase spends that will be mature
in the next block are accepted into the memory pool,
but less mature coinbase spends are NOT.
... | {
"content_hash": "28b50293b426e380aa69c659ae40cefd",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 93,
"avg_line_length": 37.50704225352113,
"alnum_prop": 0.6308674427337589,
"repo_name": "Bitcoin-ABC/bitcoin-abc",
"id": "14786a500cee2182c8f37e93a91c2caf1053376b",
"size"... |
import csv
import itertools
import logging
import re
import urllib2
from datetime import date
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.support.ui import Select
from exceptions import MissingAttributeException
fro... | {
"content_hash": "3ea0d45e26965dbff329201a6c86ec66",
"timestamp": "",
"source": "github",
"line_count": 345,
"max_line_length": 117,
"avg_line_length": 36.26086956521739,
"alnum_prop": 0.5806554756195044,
"repo_name": "PatrickSpieker/ThePyStrikesBack",
"id": "cb6c8cb6291df6eee2acfbe318315ec4fe55853c"... |
"""Helpers for sun events."""
from __future__ import annotations
import datetime
from typing import TYPE_CHECKING
from homeassistant.const import SUN_EVENT_SUNRISE, SUN_EVENT_SUNSET
from homeassistant.core import HomeAssistant, callback
from homeassistant.loader import bind_hass
from homeassistant.util import dt as d... | {
"content_hash": "c083c918f613adc6c6e35b679488cfda",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 86,
"avg_line_length": 29.861313868613138,
"alnum_prop": 0.6590075776093864,
"repo_name": "GenericStudent/home-assistant",
"id": "09a329cd2752ba6c7d3954753f96b13f6084cf36",
... |
from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter
from . import views
router = DefaultRouter()
router.register(r'posts', views.PostViewSet)
router.register(r'comments', views.CommentViewSet)
router.register(r'tags', views.TagViewSet)
urlpatterns = [
url(r'^', include(rout... | {
"content_hash": "6a809d6dc31adaffa6d890a66aa63450",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 50,
"avg_line_length": 25.615384615384617,
"alnum_prop": 0.7657657657657657,
"repo_name": "ppnchb/django-board",
"id": "651249f629f30ff11bed4b6831eaf409e827ea59",
"size": "... |
Test.describe('Example test')
array = [1, 2, 3]
Test.assert_equals(find_average(array), 2)
| {
"content_hash": "b8e4104f1abdbcce3d838e5772a43954",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 42,
"avg_line_length": 30.333333333333332,
"alnum_prop": 0.7032967032967034,
"repo_name": "RevansChen/online-judge",
"id": "a5adfe085f06b99a345c14361df6055b68f9e722",
"size"... |
from flask import Blueprint
bp = Blueprint('file', __name__, url_prefix='/file')
from . import views
| {
"content_hash": "97766981a8ef21d9b56e6af5ee24d798",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 52,
"avg_line_length": 20.6,
"alnum_prop": 0.6893203883495146,
"repo_name": "justin-sh/amber-and-justin",
"id": "0df335a44e3f1986fd7d08c9f748f953388b5c07",
"size": "103",
... |
from envisage.ui.tasks.preferences_pane import PreferencesPane
from traits.api import Str, Int, Bool, Password, Color, Property, Float, Enum
from traitsui.api import View, Item, Group, VGroup, HGroup, UItem
from pychron.core.pychron_traits import PositiveInteger, PositiveFloat
from pychron.core.ui.custom_label_editor ... | {
"content_hash": "55087239eec7e00d271c38da4c22b0ec",
"timestamp": "",
"source": "github",
"line_count": 377,
"max_line_length": 104,
"avg_line_length": 33.09814323607427,
"alnum_prop": 0.539669818881231,
"repo_name": "NMGRL/pychron",
"id": "2700f409a4ece812a7d1671eeedfd6f50af7c236",
"size": "13278"... |
from fixture import DataSet
class ValidNoRelationsData(DataSet):
class Meta:
django_model = 'app.NoRelations'
class one:
char = "one"
num = 1
class two:
char = "two"
num = 2
class InvalidNoRelationsData(DataSet):
class Meta:
django_model = 'app.NoRela... | {
"content_hash": "4ab8e5b0038256b8b10f6373dd0d34dc",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 51,
"avg_line_length": 18.131147540983605,
"alnum_prop": 0.5650994575045208,
"repo_name": "winhamwr/django-xls-fixtures",
"id": "d513102e6777ec445874dfd26628c5a057e5e4af",
... |
"""
We have four main abstractions: Users, Collections, Memberships, and Roles.
Users represent people, like students in a school, teachers for a classroom, or volunteers setting up informal
installations. There are two main user types, ``FacilityUser`` and ``DeviceOwner``. A ``FacilityUser`` belongs to a
particular f... | {
"content_hash": "f5f78ba31e5be31579193fb046e415d8",
"timestamp": "",
"source": "github",
"line_count": 979,
"max_line_length": 144,
"avg_line_length": 42.97037793667007,
"alnum_prop": 0.6726490444042978,
"repo_name": "aronasorman/kolibri",
"id": "d4d04dde8cbbe3d7106a947c6b4b9fdbfe30f735",
"size": ... |
import sys
import numpy as np
import operator
import random
from scipy.spatial import distance
from sklearn.cross_validation import train_test_split
from sklearn.datasets import load_iris
def normalise(dataset):
maxes = np.max(dataset, axis=0)
mins = np.min(dataset, axis=0)
ranges = maxes - mins
retu... | {
"content_hash": "d8e082b5c741b917abd60f0f87636a9f",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 80,
"avg_line_length": 25.382022471910112,
"alnum_prop": 0.621071270473661,
"repo_name": "noelevans/sandpit",
"id": "31c9eea01f249511ea880fca1bd98f20a23d1539",
"size": "225... |
import os
import urllib
import logging
import datetime
import re
from lib import feedparser
from xml.sax import saxutils
from google.appengine.ext import webapp
from controller.utils import template
from google.appengine.ext.webapp import util
from google.appengine.ext import db
from django.utils impor... | {
"content_hash": "4429d1609a7e3093ac2e7731fbaa5c5f",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 197,
"avg_line_length": 41.85635359116022,
"alnum_prop": 0.53629883843717,
"repo_name": "co-meeting/crowy",
"id": "a05a7286bd479c8f3e855534c71132fe626c0f57",
"size": "7778... |
"""
This module implements classes (called Fitters) which combine optimization
algorithms (typically from `scipy.optimize`) with statistic functions to perform
fitting. Fitters are implemented as callable classes. In addition to the data
to fit, the ``__call__`` method takes an instance of
`~astropy.modeling.core.Fitta... | {
"content_hash": "8ee6f9c892143cef47acbc0315c39ce5",
"timestamp": "",
"source": "github",
"line_count": 1778,
"max_line_length": 157,
"avg_line_length": 40.16029246344207,
"alnum_prop": 0.5630558084167775,
"repo_name": "aleksandr-bakanov/astropy",
"id": "72820abe73ed43069b0142c3b5ea5c00dced6f34",
"... |
from datetime import datetime
from PLC.Faults import *
from PLC.Parameter import Parameter, Mixed
from PLC.Filter import Filter
from PLC.Table import Row, Table
from PLC.Nodes import Node, Nodes
from PLC.Slices import Slice, Slices
from PLC.LeaseFilter import LeaseFilter
from PLC.Timestamp import Timestamp
class Leas... | {
"content_hash": "b6a146cc1bd8ac9c03763e2f4137a515",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 90,
"avg_line_length": 34.476190476190474,
"alnum_prop": 0.6205110497237569,
"repo_name": "dreibh/planetlab-lxc-plcapi",
"id": "9da3d3b0f173c9929a46c77245fd62da9079aa3c",
"... |
import click
import inspect
import os
import requests
from onecodex.exceptions import OneCodexException, UnboundObject
def as_uri(uuid, base_class):
return base_class._resource._schema._uri.rstrip("#") + "/" + uuid
def coerce_search_value(search_value, field_name, base_class):
from onecodex.models import O... | {
"content_hash": "a109a6b2f3526dbed4fa524b8fcbf9d4",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 99,
"avg_line_length": 37.00471698113208,
"alnum_prop": 0.5697896749521989,
"repo_name": "refgenomics/onecodex",
"id": "e2740d3f04d16f6560cb0b5dc5a3ad68e5d09f12",
"size": ... |
"""Tests for layers.feature_column_ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from tensorflow.contrib.layers.python.layers import feature_column_ops
class TransformerTest(tf.test.TestCase):
def t... | {
"content_hash": "36be26bc97c6af981751618e4625d03b",
"timestamp": "",
"source": "github",
"line_count": 1117,
"max_line_length": 80,
"avg_line_length": 47.42614145031334,
"alnum_prop": 0.5427277017461066,
"repo_name": "dhalleine/tensorflow",
"id": "d36e369ef76fb45af5d138a168af52e6d57f3fbf",
"size":... |
"""added psysuite apk management
Revision ID: 1322ec780acd
Revises: 8ee4d82ef1a1
Create Date: 2020-07-30 16:27:14.595064
"""
# revision identifiers, used by Alembic.
revision = '1322ec780acd'
down_revision = '8ee4d82ef1a1'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generat... | {
"content_hash": "10634da2385b9cd18f6a01d547f74c5d",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 63,
"avg_line_length": 27.970588235294116,
"alnum_prop": 0.6855941114616193,
"repo_name": "allspeak/api.allspeak.eu",
"id": "c32faa8d99205d17f502b05c70e5f69dd82cbed7",
"siz... |
"""Class representing message/* MIME documents."""
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
__all__ = ['MIMEMessage']
from future.backports.email import message
from future.backports.email.mime.nonmultipart import MIMENonMultipart
cl... | {
"content_hash": "8fd6fb375576f137226bc3c20f85fedc",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 78,
"avg_line_length": 41.03030303030303,
"alnum_prop": 0.6646971935007385,
"repo_name": "agincel/AdamTestBot",
"id": "f53bd78a8b8ad4c0ef0b7cc5fe6d1c06fae7d08b",
"size": "1... |
"""
test_section
------------
Tests for `section` models module.
"""
import os
import shutil
import unittest
from section import models
class TestSection(unittest.TestCase):
def setUp(self):
pass
def test_something(self):
pass
def tearDown(self):
pass
| {
"content_hash": "245c97e8d13822a4a65b9b1b7afdf503",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 37,
"avg_line_length": 12.333333333333334,
"alnum_prop": 0.6283783783783784,
"repo_name": "thongly/independent-section",
"id": "9b9c8f5cb9f9ff09ba676e0a227e7442ec3526d4",
"... |
from fladgejt.helpers import decode_key
from fladgejt.structures import Studium, ZapisnyList
def convert(rows):
# For now, votrfront expects all columns to be strings, not numbers or null.
return [{ k: '' if v is None else str(v) for k, v in row.items() } for row in rows]
class RestStudiumMixin:
def get... | {
"content_hash": "adca421d75723598c37db57e26afd4f2",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 87,
"avg_line_length": 42.30952380952381,
"alnum_prop": 0.5576814856499719,
"repo_name": "fmfi-svt/votr",
"id": "a830f7bcd175a4c932b014ea3187813861a00c74",
"size": "1778",
... |
import pytest
from tests.providers.google.cloud.utils.gcp_authenticator import GCP_DATACATALOG_KEY
from tests.test_utils.gcp_system_helpers import CLOUD_DAG_FOLDER, GoogleSystemTest, provide_gcp_context
@pytest.mark.credential_file(GCP_DATACATALOG_KEY)
class CloudDataflowExampleDagsSystemTest(GoogleSystemTest):
... | {
"content_hash": "342f471fc38c2dc030989707e02d5758",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 103,
"avg_line_length": 44.09090909090909,
"alnum_prop": 0.8020618556701031,
"repo_name": "sekikn/incubator-airflow",
"id": "724faf8dcc896197a4b946847da963193bcce235",
"siz... |
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineRes... | {
"content_hash": "511de24d574b5b36d8c7857d2d6a36dd",
"timestamp": "",
"source": "github",
"line_count": 338,
"max_line_length": 241,
"avg_line_length": 46.781065088757394,
"alnum_prop": 0.655135340247913,
"repo_name": "Azure/azure-sdk-for-python",
"id": "44f4ab35cbc5f0c910af96405b291959261e35f1",
"... |
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/firework/shared_fx_01.iff"
result.attribute_template_id = -1
result.stfName("obj_n","unknown_object")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "8ff901035f13b692fd0748960208d729",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 60,
"avg_line_length": 22.23076923076923,
"alnum_prop": 0.6816608996539792,
"repo_name": "obi-two/Rebelion",
"id": "bd5052c90a1248bd0b5379e9e9acd95b09c46425",
"size": "434"... |
"""
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 ... | {
"content_hash": "0903a8425bcd83807c89bf3874286bbe",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 121,
"avg_line_length": 34.30555555555556,
"alnum_prop": 0.708502024291498,
"repo_name": "NordicSemiconductor/pyOCD",
"id": "f5d226919bde823268baa282324654227ae5ae20",
"siz... |
"""Time management routines.
"""
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
from ctypes import *
from . import dll
SDL_GetTicks = dll.function(
'SDL_GetTicks',
'''Get the number of milliseconds since the SDL library initialization.
Note that this value wraps if the program runs for more ... | {
"content_hash": "ebc54e54116431266f3bcf0a225c5f58",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 75,
"avg_line_length": 31.78787878787879,
"alnum_prop": 0.6585319351763584,
"repo_name": "dangillet/cocos",
"id": "b1843b7ce6824589d84de7697a318f1f52cb68c7",
"size": "5268... |
import oandapyV20
account_id = #inserisci il TUO account_id
key = #inserisci la key
api = oandapyV20.API(environment="practice", access_token=key)
| {
"content_hash": "1336685b77963c1a0950295e2927a512",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 62,
"avg_line_length": 30.8,
"alnum_prop": 0.7402597402597403,
"repo_name": "matteonicolo/Forex",
"id": "446881c1ed4a49dc6da1ede79ce071bfca26dfb5",
"size": "154",
"binary"... |
from kludd.routes.interval import interval
from kludd.routes.specific import specific
| {
"content_hash": "65dc7192c25d14a82ffeb833272c0179",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 42,
"avg_line_length": 43,
"alnum_prop": 0.8604651162790697,
"repo_name": "Owlree/kludd",
"id": "d77b4a639ec4383d3274126276de81c72212c0d3",
"size": "86",
"binary": false,
... |
from setuptools import setup
setup(name='django-museum',
version='0.2.1',
description='Manage different picture sizes easily in your Django project.',
url='https://github.com/franciscomoma/django-museum',
author='Francisco Molina',
author_email='franciscomoma@gmail.com',
license='MI... | {
"content_hash": "5bc6e27a90e3605a5b0fec2f0545981f",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 82,
"avg_line_length": 33.92,
"alnum_prop": 0.5860849056603774,
"repo_name": "franciscomoma/django-museum",
"id": "36026482f61eebed767bbc72ee10d3b23f20083e",
"size": "848",... |
from django.shortcuts import render,redirect, get_object_or_404
import django_bolts.utils as cutils
from django.contrib.auth.models import User
from django.contrib.sites.models import get_current_site
from django.http import HttpResponseForbidden,HttpResponse
from django.template.loader import render_to_string
from dja... | {
"content_hash": "2cb52cb4a0057d91eab23106690d1920",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 120,
"avg_line_length": 37.5,
"alnum_prop": 0.5994285714285714,
"repo_name": "vivek2010/django_bolts",
"id": "a2be6e150f9a7d1100699d0b8101f3214b8820e0",
"size": "5250",
... |
from unittest import TestCase
import numpy as np
import pandas as pd
import hf_bi
| {
"content_hash": "faa8464a61b0297d812368ac52d6b6a1",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 29,
"avg_line_length": 18,
"alnum_prop": 0.7444444444444445,
"repo_name": "welfare520/hf_bi",
"id": "bc23f94eeceb93eb1b5f206515c18567fa84997e",
"size": "90",
"binary": fal... |
import sys
import sqwiggle
if len(sys.argv) < 4 :
print('There should be 4 arguments')
sys.exit(1)
token = str(sys.argv[1])
room_id = str(sys.argv[2])
message = str(sys.argv[3])
client = sqwiggle.Sqwiggle(token=token)
client.method('/messages', method='POST', parameters={'room_id': room_id, 'text': message, ... | {
"content_hash": "458a06f82ddc6d461dc9afdf0f9c707e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 125,
"avg_line_length": 27.307692307692307,
"alnum_prop": 0.6704225352112676,
"repo_name": "hijonathan/step-sqwiggle-notify",
"id": "51e68304f057481a1be56a6c47067e78efa16e01"... |
"""Imports offline conversion values for specific clicks into your account.
To get THE Google Click ID for a click, run a CLICK_PERFORMANCE_REPORT.
Tags: ConversionTrackerService.mutate, OfflineConversionFeedService.mutate
"""
__author__ = 'Joseph DiLallo'
from googleads import adwords
CONVERSION_NAME = 'INSERT_C... | {
"content_hash": "cf89ac135105786bf5edba903d77390d",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 79,
"avg_line_length": 32.6375,
"alnum_prop": 0.6790501723477594,
"repo_name": "jdilallo/jdilallo-test",
"id": "7dc63846f1c74aacbf877336402919743a91c5e6",
"size": "3229",
... |
"""
Build a protein tableau.
The implemntation is actually in pttableau.py which is used by ptgraph2.py
(Pro-Origami),
Also used to create SSE midpoint distance matrix.
Tableaux are described by Kamat and Lesk 2007
'Contact Patterns Between Helices and Strands of Sheet Define Protein
Folding Patterns' Proteins 66:86... | {
"content_hash": "5df76ef612fa5e321f4f2a9ccd5a4edb",
"timestamp": "",
"source": "github",
"line_count": 1102,
"max_line_length": 127,
"avg_line_length": 42.6442831215971,
"alnum_prop": 0.5378558964974252,
"repo_name": "NirBenTalLab/proorigami-ptgraph",
"id": "554f580cedaaaca39697f7eccae0467ed0eac2fd"... |
'''Testing numerical differentiation
Still some problems, with API (args tuple versus *args)
finite difference Hessian has some problems that I didn't look at yet
Should Hessian also work per observation, if fun returns 2d
'''
from __future__ import print_function
import numpy as np
from numpy.testing import assert_... | {
"content_hash": "037abc737275f6ea9bb25c28c9399cc6",
"timestamp": "",
"source": "github",
"line_count": 366,
"max_line_length": 152,
"avg_line_length": 38.5792349726776,
"alnum_prop": 0.5681303116147309,
"repo_name": "alekz112/statsmodels",
"id": "50e4c6e4bcf2fb9461115d83301b6ae3d7dcbe86",
"size": ... |
"""Container for CSS settings relevant to sphinx themes"""
| {
"content_hash": "9f8201677e5e3e23294f1edce16c6d5b",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 58,
"avg_line_length": 59,
"alnum_prop": 0.7627118644067796,
"repo_name": "chrisjsewell/ipypublish",
"id": "c8a2297297f2a253b5fb691017fb80086c68749b",
"size": "59",
"binar... |
from mongoengine import IntField, StringField, DictField, ReferenceField
from django_town.utils import json
from django.utils.six import string_types
from django.db.models.loading import get_model
class OptionField(IntField):
def __init__(self, option=None, **kwargs):
self.option = option
super(Op... | {
"content_hash": "b2e937c66c7b810460d85abca586871e",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 119,
"avg_line_length": 35.10285714285714,
"alnum_prop": 0.6141950187204949,
"repo_name": "uptown/django-town",
"id": "9cf0f7f0d9416808a0e5b0eb1f938c239ae00e48",
"size": "... |
from django import template
from django.template.loader import render_to_string
from impacts_world.core.models import HeaderSettings
register = template.Library()
@register.simple_tag(takes_context=True)
def header(context, *args, **kwargs):
request = context['request']
settings = HeaderSettings.for_site(req... | {
"content_hash": "27f3a0e88d6d86b7e3f09584e4d94a45",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 88,
"avg_line_length": 32.69565217391305,
"alnum_prop": 0.620345744680851,
"repo_name": "bruecksen/impacts-world",
"id": "c5e0519aedb3709dd00beb2de801b7a1a395492d",
"size":... |
from .resource import Resource
class ExpressRouteCircuit(Resource):
"""ExpressRouteCircuit resource.
Variables are only populated by the server, and will be ignored when
sending a request.
:param id: Resource ID.
:type id: str
:ivar name: Resource name.
:vartype name: str
:ivar type:... | {
"content_hash": "a26f0321ce04f170bb99652211d25ff9",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 143,
"avg_line_length": 50.177083333333336,
"alnum_prop": 0.6765621756279843,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "e06b244936a1c97d92a74635442c15cda9aaf8cb",
... |
import json
import uuid
from datetime import datetime
from importlib import import_module
from urllib.parse import urlparse
from django.core.urlresolvers import resolve, Resolver404
from http.client import responses as REASON_PHRASES
from django_rt.settings import settings
class JsonDateTimeEncoder(json.JSONEncoder)... | {
"content_hash": "114e648023cc585bb2bb99852666576b",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 114,
"avg_line_length": 31.27338129496403,
"alnum_prop": 0.6507936507936508,
"repo_name": "jhannington/django-rt",
"id": "f11191f2cd5d18f85e7f9ada988c3b59a58ce7c1",
"size"... |
from sys import argv, exit
import re
from parse import parse
if len(argv) != 3:
print('usage: {} <reference.xml> <out-xml-file>'.format(argv[0]))
exit(1)
plugin = parse(argv[1])
with open(argv[2], 'w') as fxml:
for cmd in plugin.commands:
if plugin.short_name:
func = 'sim{}.{}'.format... | {
"content_hash": "d96238e74fc82c46b781860acaf74c1c",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 84,
"avg_line_length": 33.72727272727273,
"alnum_prop": 0.5435759209344115,
"repo_name": "EricssonResearch/scott-eu",
"id": "097fdb476d30aa0a615e4267ab5a2716f4150e18",
"siz... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from mcrouter.test.MCProcess import *
from mcrouter.test.McrouterTestCase import McrouterTestCase
class TestLogicalRoutingPolicies(McrouterTestCase):
config = './mcr... | {
"content_hash": "b520c6ac8d814664b872ac557d2a3d54",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 71,
"avg_line_length": 35.766666666666666,
"alnum_prop": 0.6346691519105312,
"repo_name": "247687009/mcrouter",
"id": "4a38becde1c1e2f179df899b3b44476cc1009f14",
"size": "1... |
"""
urlquery module
"""
import cache
import database
def compose_response(is_malware=False):
response = { "malware" : str(is_malware) }
return response
def exists_in_cache(url, cache_hostname):
return cache.exists(url, cache_hostname)
def exists_in_database(url, db_hostname, table_name, conf):
... | {
"content_hash": "062a4fb4af794b4f0fc390f865b8d22a",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 72,
"avg_line_length": 26.333333333333332,
"alnum_prop": 0.6611489776046738,
"repo_name": "vitovitolo/yama",
"id": "e82e4fc6291f943d0c427139e4ff13fae8314521",
"size": "1027... |
"""
================================================================
Compute sparse inverse solution with mixed norm: MxNE and irMxNE
================================================================
Runs an (ir)MxNE (L1/L2 [1]_ or L0.5/L2 [2]_ mixed norm) inverse solver.
L0.5/L2 is done with irMxNE which allows for sp... | {
"content_hash": "92e66d4f491bc64b28b8110b1bb9c47d",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 79,
"avg_line_length": 43.924369747899156,
"alnum_prop": 0.5953701932274728,
"repo_name": "teonlamont/mne-python",
"id": "0cf660cf0840886a5e7f21e392797114c235398a",
"size"... |
"""
Created on Fri Jul 31 09:45:08 2015
@author: fmullall
"""
import matplotlib.pyplot as mp
import numpy as np
import queryMast
import nca
class QueryK2ByTgtId(queryMast.QueryMast):
def __init__(self):
"""Query the MAST for K2 data by Investigation ID
All the code that does the work is stored... | {
"content_hash": "7ae0d3d08acc5c0e239b1d2f873250b6",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 84,
"avg_line_length": 26.11764705882353,
"alnum_prop": 0.6052123552123552,
"repo_name": "barentsen/dave",
"id": "d186b8bd9718fc41edf307af0e9667da25c99728",
"size": "3132"... |
"""Module containing class for recording metadata about a run."""
import collections
import datetime
import json
import logging
import math
import multiprocessing
import os
import re
import time
from chromite.cbuildbot import archive_lib
from chromite.cbuildbot import cbuildbot_config
from chromite.cbuildbot import r... | {
"content_hash": "b5c32bcfb469e0739db3a063e2c79a08",
"timestamp": "",
"source": "github",
"line_count": 836,
"max_line_length": 80,
"avg_line_length": 36.11722488038278,
"alnum_prop": 0.6469828442736968,
"repo_name": "chadversary/chromiumos.chromite",
"id": "cdeb6a0f47a60f8004d87bad444babaeab3aecd5",... |
from django.shortcuts import get_object_or_404
from django.views.decorators.http import require_POST, require_GET
from django.http import HttpResponse, HttpResponseRedirect
from django.utils.translation import ugettext_lazy as _
from models import Draft
from django.contrib import messages
@require_POST
def save(reques... | {
"content_hash": "e484dae089f86efe68f46cb50ff5cd33",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 111,
"avg_line_length": 35.9375,
"alnum_prop": 0.7217391304347827,
"repo_name": "platypus-creation/django-draft",
"id": "ad377d84a91f6f70a5269ef1dac4d7387273e5bc",
"size": ... |
import argparse
import ConfigParser
import daemon
import extras
# as of python-daemon 1.6 it doesn't bundle pidlockfile anymore
# instead it depends on lockfile-0.9.1 which uses pidfile.
pid_file_module = extras.try_imports(['daemon.pidlockfile', 'daemon.pidfile'])
import logging
import logging.config
import os
impor... | {
"content_hash": "f4743bd541a7f41995c143e4127353c0",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 78,
"avg_line_length": 35.82641509433962,
"alnum_prop": 0.5931114388034548,
"repo_name": "devdattakulkarni/zuul_messaging",
"id": "7b45b9b104637cf804d90cec0f67b6dde138e5a2",... |
import api
import workflow
def get_posts(access_token):
response = api.Delicious(access_token).posts.all()
posts = response['posts']['post']
return posts
def main(wf):
try:
# Get API key from Keychain
access_token = wf.get_password('delicious_access_token')
except workflow.Passwo... | {
"content_hash": "87806649cd653d9d185504183a78d554",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 83,
"avg_line_length": 27.26086956521739,
"alnum_prop": 0.6475279106858054,
"repo_name": "scraplesh/delicious-alfredworkflow",
"id": "2bd1d977a5ea6cfbcb6af78f493d9f085111aaf4... |
import torch as t
from torch.autograd import Variable as V
from torch import FloatTensor as FT
import numpy as np
from bayestorch.hmc import HMCSampler
class SimpleTrainer:
def __init__(self, env,critic,hallucinator,policy_buffer,policy_c, noise_dim):
self.env = env
self.hallucinator = hallucinator... | {
"content_hash": "0c78b6a761b9626b72903fff9a0d8123",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 100,
"avg_line_length": 36.06542056074766,
"alnum_prop": 0.5750194350868101,
"repo_name": "fizz-ml/policybandit",
"id": "b88696a3e87855e5a9061958b5aecb47382f1178",
"size":... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import statsmodels.api as sm
np.random.seed(9876789)
# ## OLS estimation
#
# Artificial data:
nsample = 100
x = np.linspace(0, 10, 100)
X = np.column_stack((x, x**2))
beta = np.array([1, 0.1, 10])
e = np.random.normal(size=nsample)
# Our model n... | {
"content_hash": "48f5dfe03a8ecc052b21f9422ce6cce7",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 76,
"avg_line_length": 25.91324200913242,
"alnum_prop": 0.6845814977973568,
"repo_name": "josef-pkt/statsmodels",
"id": "1b1a76ebcf442c1196e66deafc844a31c245b634",
"size":... |
"""Test configs for binary_op."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow.lite.testing.zip_test_utils import create_tensor_data
from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests
from tensorfl... | {
"content_hash": "f124f361db123d95774a363b77f6ee62",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 78,
"avg_line_length": 30.798994974874372,
"alnum_prop": 0.5557187143090226,
"repo_name": "arborh/tensorflow",
"id": "88702b0542fa3b6203ffc5ccf2dbfc6979eb07d7",
"size": "6... |
"""
RDFlib Store implementation for Django, providing lots of extra goodies.
Use this application by just including it in your INSTALLED_APPS. After this,
you can create a new Graph using:
>>> import rdflib
>>> g = rdflib.Graph('Django')
"""
from rdflib.plugin import register
from rdflib.store import Store
registe... | {
"content_hash": "e5d8ff137451e5a0ed81eee6c29f097b",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 77,
"avg_line_length": 25.133333333333333,
"alnum_prop": 0.7506631299734748,
"repo_name": "publysher/rdflib-django",
"id": "0dab3f69aac8a574be5a3ff15ce8f028ab51ff2c",
"size... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/bandolier/shared_ith_mercenary_bandolier.iff"
result.attribute_template_id = 11
result.stfName("item_n","ith_mercenary_bandolier")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
r... | {
"content_hash": "2c7a486016af13c3ff42a96f268af91a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 91,
"avg_line_length": 25.53846153846154,
"alnum_prop": 0.7168674698795181,
"repo_name": "obi-two/Rebelion",
"id": "b78eb5e2f6af9261200e26b4d66c8c02eb752a16",
"size": "477"... |
"""
Asterisk Voicemail interface.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/mailbox.asteriskvm/
"""
import logging
from homeassistant.components.asterisk_mbox import DOMAIN as ASTERISK_DOMAIN
from homeassistant.components.mailbox import (
CONTE... | {
"content_hash": "99d60a83c0dc543880c396caa73ff20c",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 76,
"avg_line_length": 30.56,
"alnum_prop": 0.6697207678883071,
"repo_name": "tinloaf/home-assistant",
"id": "087018084f2c781ce5f3a6374c8a33afaa4a564c",
"size": "2292",
"... |
"""Trains a classifier and evaluates finetuning performance. Specifically for sequential training of models"""
from typing import Sequence
from absl import app
from absl import flags
from absl import logging
import numpy as np # pylint: disable=unused-import
import resnet
import tensorflow as tf
from load_data impo... | {
"content_hash": "048a6c1a5746fc584efb13982fa042a6",
"timestamp": "",
"source": "github",
"line_count": 1090,
"max_line_length": 158,
"avg_line_length": 43.154128440366975,
"alnum_prop": 0.5802330031038735,
"repo_name": "google-research/simplicity-bias",
"id": "ad1d9f51c0b7c499fbeb2acddffd114dc6dc77c... |
from sklearn2sql_heroku.tests.classification import generic as class_gen
class_gen.test_model("RandomForestClassifier" , "BreastCancer" , "hive")
| {
"content_hash": "74078eb2bfe443946c010244f01c3a4d",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 72,
"avg_line_length": 37,
"alnum_prop": 0.7972972972972973,
"repo_name": "antoinecarme/sklearn2sql_heroku",
"id": "b5d653ef13f7faf680df182de06fcca2f1e2f4fc",
"size": "148",... |
'''
Bitcoin base58 encoding and decoding.
Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain)
'''
import hashlib
# for compatibility with following code...
class SHA256:
new = hashlib.sha256
if str != bytes:
# Python 3.x
def ord(c):
return c
def chr(n):
return ... | {
"content_hash": "526c7c34815e81344075e8ac3d2714e5",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 97,
"avg_line_length": 23.934959349593495,
"alnum_prop": 0.5883152173913043,
"repo_name": "Bitcoin-ABC/bitcoin-abc",
"id": "88d6da81d09946c24cf86db2382e25a679917576",
"siz... |
from django.http import HttpResponseRedirect, HttpResponse, JsonResponse, HttpResponseNotFound, HttpResponseForbidden
from django.contrib import messages
from django.conf import settings
from django.utils.encoding import smart_str
from django.contrib.auth.decorators import login_required
from kubernetes import client, ... | {
"content_hash": "2694b7bc5582195c88bcf2479f704204",
"timestamp": "",
"source": "github",
"line_count": 387,
"max_line_length": 117,
"avg_line_length": 34.348837209302324,
"alnum_prop": 0.5988114044986083,
"repo_name": "gongweibao/cloud",
"id": "7018618396acc5ab9300d22f2b0fe10aec30722e",
"size": "1... |
import sys
import mock
import netaddr
from neutron.common import constants as l3_constants
from neutron.openstack.common import uuidutils
from neutron.tests import base
from neutron.plugins.cisco.cfg_agent.device_drivers.csr1kv import (
cisco_csr1kv_snippets as snippets)
sys.modules['ncclient'] = mock.MagicMock(... | {
"content_hash": "f9808c23ff6a0fdbd6ec27def0c5c059",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 79,
"avg_line_length": 42.90298507462686,
"alnum_prop": 0.5799269438163159,
"repo_name": "virtualopensystems/neutron",
"id": "c93b2d45b01aab8862c8560eeae95809934ffcd1",
"s... |
from a10sdk.common.A10BaseClass import A10BaseClass
class Store(A10BaseClass):
""" :param create: {"default": 0, "optional": true, "type": "number", "description": "Create an import store profile", "format": "flag"}
:param name: {"description": "profile name to store remote url", "format": "string", "... | {
"content_hash": "dc52ffff2da6698182cbe7264bed92d7",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 157,
"avg_line_length": 34.41463414634146,
"alnum_prop": 0.6158752657689582,
"repo_name": "a10networks/a10sdk-python",
"id": "e13b0aed3d0fb25728e212db61785565574ed9ac",
"si... |
import time
import traceback
from concurrent.futures import ThreadPoolExecutor
from typing import Dict, Tuple
from kubernetes.client.rest import ApiException
import polyaxon_sdk
from polyaxon import live_state, settings
from polyaxon.agents import converter
from polyaxon.agents.spawners.spawner import Spawner
from ... | {
"content_hash": "1aa0a74990e9242ea5fe7de94637ebd3",
"timestamp": "",
"source": "github",
"line_count": 443,
"max_line_length": 96,
"avg_line_length": 35.73363431151242,
"alnum_prop": 0.5416929879974731,
"repo_name": "polyaxon/polyaxon",
"id": "f921f93ca09b291fde3af9053deab034cfca2921",
"size": "16... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fundraising', '0007_auto_20150119_1335'),
('fundraising', '0003_auto_20150119_1842'),
]
operations = [
]
| {
"content_hash": "f3142e8318073153e96b70d3802c02a3",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 51,
"avg_line_length": 20.071428571428573,
"alnum_prop": 0.6476868327402135,
"repo_name": "gnarf/djangoproject.com",
"id": "6dd56ff629527f701c4bb8c67611ac1f0cfa60d3",
"size... |
import cv2
import sys
name = "upload/IB_answer_sheet7.png"
image = cv2.imread(name)
f = open("answer.txt")
answer = f.read()
temp = "%s" %"1"
print(temp)
sys.exit()
print(answer) | {
"content_hash": "c52ec72930ad16e84917d420ed4c491c",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 36,
"avg_line_length": 13.071428571428571,
"alnum_prop": 0.6612021857923497,
"repo_name": "Hubert51/AutoGrading",
"id": "6d6660c9c0d5bed1de05d25f7eed4280ce61a42c",
"size": ... |
from msrest.paging import Paged
class SnapshotPaged(Paged):
"""
A paging container for iterating over a list of :class:`Snapshot <azure.mgmt.compute.v2016_04_30_preview.models.Snapshot>` object
"""
_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'k... | {
"content_hash": "3d2fad4bc2a85e055b299406b6e2c4b7",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 133,
"avg_line_length": 29.125,
"alnum_prop": 0.6008583690987125,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "0d2d8bc3af20aed494e88e38aeb059672559cb47",
"size": "94... |
"""
sphinx.directives
~~~~~~~~~~~~~~~~~
Handlers for additional ReST directives.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from docutils.parsers.rst import Directive, directives
from sphinx import addnodes
from sphinx.... | {
"content_hash": "c85118f02b8b99d85e1540638de003ac",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 81,
"avg_line_length": 35.70680628272251,
"alnum_prop": 0.625366568914956,
"repo_name": "analurandis/Tur",
"id": "250a013e96b5b3330a9f3cb417aafe67fbebb50b",
"size": "6844"... |
import abc
import os.path
import json
import logging
from collections import defaultdict, Counter
from shlex import quote as shq
import yaml
import jinja2
from hailtop.utils import RETRY_FUNCTION_SCRIPT, flatten
from .utils import generate_token
from .environment import GCP_PROJECT, GCP_ZONE, DOMAIN, IP, CI_UTILS_IMAGE... | {
"content_hash": "51227d223954ddc980b907bd6aeae300",
"timestamp": "",
"source": "github",
"line_count": 1011,
"max_line_length": 162,
"avg_line_length": 34.196834817012856,
"alnum_prop": 0.532091516501316,
"repo_name": "cseed/hail",
"id": "516853316b22a4ee2b76ae13990bb6ccb2ec7428",
"size": "34573",... |
"""
TestFS
An ongoing attempt at learning by doing with Python-FUSE
Copyright (c) 2012 Sean Harlow (firstname) at (firstname)(lastname) dot info
Released under the BSD license, see COPYING file for info.
"""
import errno, fuse, stat, time
import logging as log
# Setup FUSE
fuse.fuse_python_api = (0, 2)
... | {
"content_hash": "898daa6efda69dfe13469eac5f89094c",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 111,
"avg_line_length": 28.329268292682926,
"alnum_prop": 0.6289281102023245,
"repo_name": "wolrah/TestFS",
"id": "13cf1ad4cb97b25f30ddfb36cbb8d1c2440fd576",
"size": "2346"... |
"""
Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import re
import time
from extra.safe2bin.safe2bin import safecharencode
from lib.core.agent import agent
from lib.core.common import Backend
from lib.core.common import calculateDeltaSeconds
from ... | {
"content_hash": "4033bdb9e6973ee814fb68d3cf9e710c",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 170,
"avg_line_length": 42.41025641025641,
"alnum_prop": 0.6473196291817815,
"repo_name": "glaudsonml/kurgan-ai",
"id": "1e4216ef342fb1426415dca6acfad41e557126d3",
"size":... |
"""Terminal reporting of the full testing process."""
import collections
import os
import sys
import textwrap
from io import StringIO
from pathlib import Path
from types import SimpleNamespace
from typing import cast
from typing import Dict
from typing import List
from typing import Tuple
import pluggy
import _pytest... | {
"content_hash": "4dae1bd7460c5b9a9f49a1b2448f989b",
"timestamp": "",
"source": "github",
"line_count": 2545,
"max_line_length": 107,
"avg_line_length": 33.17996070726915,
"alnum_prop": 0.509763982804969,
"repo_name": "Akasurde/pytest",
"id": "f0e58e5b4c4a0023c7c01ccc7e75d2063c75bc6a",
"size": "846... |
from __future__ import absolute_import, unicode_literals
from django.conf.urls import url
from bizsprint.users import views
urlpatterns = [
# URL pattern for the UserListView
url(
regex=r'^$',
view=views.UserListView.as_view(),
name='list'
),
# URL pattern for the UserRedirec... | {
"content_hash": "fd58cb3878c249649a01229e18c73382",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 56,
"avg_line_length": 22,
"alnum_prop": 0.5818181818181818,
"repo_name": "DJMedhaug/BizSprint",
"id": "0fa24403e3e6a39879862660b0369e3296ec2ce0",
"size": "794",
"binary"... |
"""Testing dll.py."""
import pytest
from data_structures.dll import DoublyLinkedList, DoubleNode
@pytest.fixture
def new_dll():
"""Return empty dll."""
return DoublyLinkedList()
@pytest.fixture
def init_dll():
"""Return non empty dll."""
dll = DoublyLinkedList()
dll.push(1)
dll.push(2)
... | {
"content_hash": "7fc5aa0894586c0f006f9b37211cf461",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 77,
"avg_line_length": 25.917582417582416,
"alnum_prop": 0.6533813864744541,
"repo_name": "fordf/data-structures",
"id": "9dd12d4dd533b90931a1f1db907bf33cdfb738be",
"size"... |
from SimpleCV.base import *
from SimpleCV.ImageClass import Image
from SimpleCV.Features.FeatureExtractorBase import *
class EdgeHistogramFeatureExtractor(FeatureExtractorBase):
"""
Create a 1D edge length histogram and 1D edge angle histogram.
This method takes in an image, applies an edge detector,... | {
"content_hash": "c828654f417292df57c39cfad0f2ce5a",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 78,
"avg_line_length": 31.225806451612904,
"alnum_prop": 0.5945247933884298,
"repo_name": "intelie/pycollector",
"id": "2acc5979a4794f8e11ba63f1c6e96efda2ed08ca",
"size": "... |
"""
example:
import optfunc
@optfunc.arghelp('rest_','input files')
def main(rest_=['-'],keyfields=1,sep='\t',usage_='-h usage'):
"-h usage" # optional: usage_ arg instead
pass
"""
from optparse import OptionParser, make_option
import sys, inspect, re
doc_name='usage_'
rest_name='rest_' # remaining position... | {
"content_hash": "2a812d9f60ec29dabebcb7bb783d54bb",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 107,
"avg_line_length": 33.01244813278009,
"alnum_prop": 0.5726495726495726,
"repo_name": "Simperium/simperium-python",
"id": "1a9154fff18977ab98dec975e4cd7c526c7fb68d",
"... |
from selenium.webdriver import Firefox
from selenium.webdriver.common.by import By
driver_class = Firefox
implicit_timeout = 30
wait_timeout = 30
default_search_type = By.ID
try:
from local_webium_settings import *
except ImportError:
pass
| {
"content_hash": "c5c67114502d275a347417a6779dca00",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 43,
"avg_line_length": 19.307692307692307,
"alnum_prop": 0.7689243027888446,
"repo_name": "drptbl/webium",
"id": "aa6228a1cd833ca0428eea3652a2691078668e60",
"size": "251",
... |
def dispatch(*dispatchers, **kwargs):
""" Dispatch
:arg dispatchers: will be a iterable of pair tuple
which has dispatcher function as first element
and target function as second element.
The dispatcher function will take same arguments with target functions
and will return True or False.
... | {
"content_hash": "a10ba4087ce428214ce02015a250225d",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 91,
"avg_line_length": 31.08888888888889,
"alnum_prop": 0.6208005718370264,
"repo_name": "hirokiky/wraptools",
"id": "8083108265085e03320878a00b2137fa9ba402c8",
"size": "27... |
import os
from setuptools import setup, find_packages
setup(
name='fakeredis',
version='0.8.2',
description="Fake implementation of redis API for testing purposes.",
long_description=open(os.path.join(os.path.dirname(__file__),
'README.rst')).read(),
license... | {
"content_hash": "58685d87e8a9ae337eaecc65f7026dad",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 73,
"avg_line_length": 32.5,
"alnum_prop": 0.5798076923076924,
"repo_name": "Tinche/fakeredis",
"id": "1964d9f5992b0037120e0ef0d1ff7cd6b6478342",
"size": "1040",
"binary"... |
import tornado.ioloop
import tornado.options
import tornado.httpserver
from application import Application
import sys
from tornado.options import define, options
define("port", default=8888, help="run on the given port", type=int)
def main():
tornado.options.parse_command_line()
http_server = tornado.httpserver.HT... | {
"content_hash": "42eb3abeae2998d1cb9a1a451b2358a2",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 78,
"avg_line_length": 30.526315789473685,
"alnum_prop": 0.7448275862068966,
"repo_name": "iYefeng/traits",
"id": "0c6ba2e2cfa8098f8a27332b927791ad28f3aec9",
"size": "627",... |
import os
import sys
if os.sys.platform == 'win32':
sys.path.append(".\\..") # - dla windowsa
else:
sys.path.append("../") # - dla linuksa
from Contacts import *
from pygglib import GGSession
from Helpers import *
from GGConstans import *
import time
#
# 11327271, haslo eto2007
#
def login_ok_event... | {
"content_hash": "e6c8ce927540f25e4bf12f7fd6306870",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 136,
"avg_line_length": 32.2,
"alnum_prop": 0.6909937888198758,
"repo_name": "jakubkosinski/pygglib",
"id": "f3e8216fa638927c20ae7fcb19e4ed905077d8db",
"size": "1932",
"b... |
from __future__ import unicode_literals
from django.db import migrations, models
from awx.main.migrations._create_system_jobs import create_clearsessions_jt, create_cleartokens_jt
class Migration(migrations.Migration):
dependencies = [
('main', '0077_v360_add_default_orderings'),
]
operations =... | {
"content_hash": "832753d6e9e3569c636a38de5a19c0e0",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 407,
"avg_line_length": 58.44444444444444,
"alnum_prop": 0.697084917617237,
"repo_name": "GoogleCloudPlatform/sap-deployment-automation",
"id": "c6a00a24c1f7266df802bdc82dc49... |
from importlib import import_module
from django.apps import AppConfig as BaseAppConfig
class AppConfig(BaseAppConfig):
name = "portal"
def ready(self):
import_module("portal.receivers")
| {
"content_hash": "87d8543ab8adb815853994d7dedb1966",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 50,
"avg_line_length": 18.818181818181817,
"alnum_prop": 0.7294685990338164,
"repo_name": "acarl123/acuity",
"id": "b4a53a805f4c9eaf0dba91ac9cb8a530eb626afd",
"size": "207"... |
"""PhaseExecutor module for handling the phases of a test.
Each phase is an instance of phase_data.PhaseInfo and therefore has relevant
options. Each option is taken into account when executing a phase, such as
checking options.run_if as soon as possible and timing out at the appropriate
time.
A phase must return an ... | {
"content_hash": "ef0b62955d1c1f1db4c4db18ad488e89",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 80,
"avg_line_length": 36.94949494949495,
"alnum_prop": 0.7206123564789503,
"repo_name": "amyxchen/openhtf",
"id": "6b747f68462bebb2f0a8f1a66bd6e7a8fa3e73da",
"size": "791... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cycontacts', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='contact',
old_name='given_name',
... | {
"content_hash": "69cc3f634be76ede0ddb72bb6a44ec81",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 40,
"avg_line_length": 22.217391304347824,
"alnum_prop": 0.5459882583170255,
"repo_name": "shawnhermans/cyborgcrm",
"id": "f29ea9afcff3cd57c7579350b213b3ecdc3c31d7",
"size"... |
from string import ascii_lowercase
from itertools import product
from scipy.spatial.distance import pdist, squareform
import editdistance
import numpy as np
import pdb
import sys
import re
import gzip
NMER_SIZE = 3
# --- loading and prep --- #
def get_base32():
"""
Generate nmers of base32 characters.
"""... | {
"content_hash": "c6d02d37f5e270ecd9b28f480de5c66a",
"timestamp": "",
"source": "github",
"line_count": 320,
"max_line_length": 96,
"avg_line_length": 34.703125,
"alnum_prop": 0.6105357946870779,
"repo_name": "corcra/leekspeak",
"id": "69bab2012a676254824d73cf747377ef7a2d835c",
"size": "11176",
"... |
"""
CORE APP
This module provides an interface to the app's managers.
"""
from django.db import models
from django.utils import timezone
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.template.defaultfilters import slugify
# from polymorphic import... | {
"content_hash": "001bcaf8b5b0bc01e0ba455babc0d102",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 85,
"avg_line_length": 33.28270042194093,
"alnum_prop": 0.6261409736308317,
"repo_name": "unomena/tunobase-core",
"id": "e02933019e3e41d17a5ef3ba6de4808bcc92db4c",
"size":... |
print "Content-type:text/html\n\n"
import MySQLdb
import hashlib
import cgi
import sys
import json
import uuid
def hash_password(password):
salt = uuid.uuid4().hex
return hashlib.sha256(salt.encode() + password.encode()).hexdigest() + ':' + salt
# grab data from POSTed JSON
data = sys.stdin.read()
myjson = js... | {
"content_hash": "d1e3b43bb64e24c675c312b517ad8af5",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 85,
"avg_line_length": 23.15909090909091,
"alnum_prop": 0.6879293424926398,
"repo_name": "Rovel/ultra-motivator",
"id": "aa43b95ab44e2767f0a364a6e1f259668d8a9e4c",
"size": ... |
from flask import Flask
from flask import request
from flask import Response
from functools import wraps
from OpenSSL import SSL
from fgapiserverconfig import FGApiServerConfig
import os
import sys
import json
import logging.config
"""
FutureGateway APIServer front-end
"""
__author__ = "Riccardo Bruno"
__copyright_... | {
"content_hash": "a1079d3a1f8d3bf689f29b955c12e628",
"timestamp": "",
"source": "github",
"line_count": 427,
"max_line_length": 79,
"avg_line_length": 37.89695550351288,
"alnum_prop": 0.5997404523544679,
"repo_name": "FutureGateway/geAPIServer",
"id": "282d436fbafe07dccd488446e06b7ceecc34e374",
"si... |
"Point website users at configurable on-call administrators"
import codecs as _codecs
from distutils.core import setup
import os.path as _os_path
from django_on_call import __version__
_this_dir = _os_path.dirname(__file__)
setup(
name='django-on-call',
version=__version__,
maintainer='W. Trevor King',... | {
"content_hash": "c281584a0fe13490ea5243f91c93e013",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 98,
"avg_line_length": 35.21951219512195,
"alnum_prop": 0.618421052631579,
"repo_name": "wking/django-on-call",
"id": "55345f39509250e21e284e399eaf2d554da34999",
"size": "1... |
import tensorflow as tf
import numpy as np
from six.moves import xrange
def discount_episode_rewards(rewards=[], gamma=0.99, mode=0):
""" Take 1D float array of rewards and compute discounted rewards for an
episode. When encount a non-zero value, consider as the end a of an episode.
Parameters
-------... | {
"content_hash": "02387669b26be272416c8771d21d7145",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 112,
"avg_line_length": 35.457364341085274,
"alnum_prop": 0.6058154787931789,
"repo_name": "luoxier/CycleGAN_Tensorlayer",
"id": "f6d5449b87471ffcdfcd46c7138bd1f404bb8616",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.