hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
364b600d3ef5acf33fe924e1359281a6bf39ef53 | 1,862 | py | Python | psltdsim/plot/__init__.py | thadhaines/PSLTDSim | 1bc598f3733c1369c164f54249e5f7757e6bf466 | [
"MIT"
] | null | null | null | psltdsim/plot/__init__.py | thadhaines/PSLTDSim | 1bc598f3733c1369c164f54249e5f7757e6bf466 | [
"MIT"
] | null | null | null | psltdsim/plot/__init__.py | thadhaines/PSLTDSim | 1bc598f3733c1369c164f54249e5f7757e6bf466 | [
"MIT"
] | null | null | null | #import sys
#if sys.version_info[0] > 2:
# import matplotlib.pyplot as plt
# The above doesn't seem to perform as desired, as a result
# each function handles own import of matplotlib...
from .sysPePmF import sysPePmF
from .sysPePmFLoad import sysPePmFLoad
from .sysPQVF import sysPQVF
from .sysPLQF import sysPLQF
... | 26.6 | 59 | 0.833512 |
5cc19a3a98ab3c6710fc4842e7e1a8b3b0add251 | 806 | py | Python | setup.py | slinghq/sling | 710b2743d43b6378c10f7c58e004257e53b164f6 | [
"Apache-2.0"
] | 6 | 2015-12-07T13:14:15.000Z | 2021-05-27T10:17:35.000Z | setup.py | slinghq/sling | 710b2743d43b6378c10f7c58e004257e53b164f6 | [
"Apache-2.0"
] | null | null | null | setup.py | slinghq/sling | 710b2743d43b6378c10f7c58e004257e53b164f6 | [
"Apache-2.0"
] | 3 | 2015-12-07T12:25:27.000Z | 2015-12-07T13:14:47.000Z | from setuptools import setup
with open('requirements.txt', 'r') as f:
install_requires = [l.strip() for l in f.readlines()]
setup(
name='sling',
version='0.1.1',
url='https://github.com/slinghq/sling',
license='Apache',
author='SlingHQ',
author_email='support@slinghq.com',
install_re... | 27.793103 | 71 | 0.631514 |
bdfdea8bc5af91e69f7f82f1455e0b3563088123 | 17,551 | py | Python | cvpods/structures/interval.py | WFDetector/WFDetection | b16d35b3a3a5de62de9e0bac83eccd21b6358b53 | [
"Apache-2.0"
] | null | null | null | cvpods/structures/interval.py | WFDetector/WFDetection | b16d35b3a3a5de62de9e0bac83eccd21b6358b53 | [
"Apache-2.0"
] | null | null | null | cvpods/structures/interval.py | WFDetector/WFDetection | b16d35b3a3a5de62de9e0bac83eccd21b6358b53 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
# Modified by WFDetection, Inc. and its affiliates. All Rights Reserved
import math
from enum import IntEnum, unique
from typing import Iterator, List, Tuple, Union
import numpy as np
import torch
from torchvision.ops.boxes import box_area
from c... | 35.172345 | 116 | 0.554555 |
71bdc6deee698f930927648a21778017faa54c8a | 6,349 | py | Python | geotrek/api/mobile/serializers/trekking.py | GeotrekCE/Geotrek-admin | efcc7a6c2ccb6aee6b299b22f33f236dd8a23d91 | [
"BSD-2-Clause"
] | 50 | 2016-10-19T23:01:21.000Z | 2022-03-28T08:28:34.000Z | geotrek/api/mobile/serializers/trekking.py | GeotrekCE/Geotrek-admin | efcc7a6c2ccb6aee6b299b22f33f236dd8a23d91 | [
"BSD-2-Clause"
] | 1,422 | 2016-10-27T10:39:40.000Z | 2022-03-31T13:37:10.000Z | geotrek/api/mobile/serializers/trekking.py | GeotrekCE/Geotrek-admin | efcc7a6c2ccb6aee6b299b22f33f236dd8a23d91 | [
"BSD-2-Clause"
] | 46 | 2016-10-27T10:59:10.000Z | 2022-03-22T15:55:56.000Z | import os
from django.conf import settings
from rest_framework import serializers
from rest_framework_gis import serializers as geo_serializers
from geotrek.api.mobile.serializers.tourism import InformationDeskSerializer
from geotrek.api.v2.functions import Transform, Length, StartPoint, EndPoint
from geotrek.zoning.m... | 46.007246 | 118 | 0.633643 |
a7fb9ab62109a0d2ace16fc3c2987865620fb899 | 28,596 | py | Python | dashboard/dashboard/add_point.py | ravitejavalluri/catapult | 246a39a82c2213d913a96fff020a263838dc76e6 | [
"BSD-3-Clause"
] | null | null | null | dashboard/dashboard/add_point.py | ravitejavalluri/catapult | 246a39a82c2213d913a96fff020a263838dc76e6 | [
"BSD-3-Clause"
] | null | null | null | dashboard/dashboard/add_point.py | ravitejavalluri/catapult | 246a39a82c2213d913a96fff020a263838dc76e6 | [
"BSD-3-Clause"
] | 1 | 2020-07-24T05:13:01.000Z | 2020-07-24T05:13:01.000Z | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""URL endpoint to allow Buildbot slaves to post data to the dashboard."""
import copy
import json
import logging
import math
import re
from google.appengi... | 34.328932 | 80 | 0.693279 |
f3221580408becc6230fc52b93ac6a7f52761013 | 558 | py | Python | December-14/python_Nilesh2000.py | Nilesh2000/A-December-of-Algorithms-2019 | da92ef23b473d083fea48f102fd46646b604342a | [
"MIT"
] | null | null | null | December-14/python_Nilesh2000.py | Nilesh2000/A-December-of-Algorithms-2019 | da92ef23b473d083fea48f102fd46646b604342a | [
"MIT"
] | null | null | null | December-14/python_Nilesh2000.py | Nilesh2000/A-December-of-Algorithms-2019 | da92ef23b473d083fea48f102fd46646b604342a | [
"MIT"
] | null | null | null | # Author - Nilesh D
# December 14 - A Wordplay with Vowels and Consonants
def subString(s, n):
vowel = ['a', 'e', 'i', 'o', 'u']
scoreA = scoreB = 0
for i in range(n):
for len in range(i+1, n+1):
subsStr = s[i: len]
if subsStr[0] in vowel:
scoreA += 1
... | 24.26087 | 56 | 0.507168 |
432acc41c7f52ec3d4c5e581a080ea3b9dec9355 | 24,548 | py | Python | as3/parser.py | eigenein/python-as3 | 323b58fd19359842332a1b045857f793cd124aa3 | [
"MIT"
] | 1 | 2019-05-27T11:25:18.000Z | 2019-05-27T11:25:18.000Z | as3/parser.py | eigenein/python-as3 | 323b58fd19359842332a1b045857f793cd124aa3 | [
"MIT"
] | null | null | null | as3/parser.py | eigenein/python-as3 | 323b58fd19359842332a1b045857f793cd124aa3 | [
"MIT"
] | null | null | null | from __future__ import annotations
from collections import deque
from typing import Any, Callable, Deque, Dict, Iterable, Iterator, List, NoReturn, Optional, Set, Tuple
from as3 import ast_, interpreter
from as3.enums import TokenType
from as3.exceptions import ASSyntaxError
from as3.interpreter import undefined
from... | 41.39629 | 125 | 0.641885 |
baa8e5419574c2e6c66a0be895c5b955916d1136 | 3,294 | py | Python | crystalpy/tests/util/StokesVectorTest.py | oasys-kit/crystalpy | 4852851c622ef914844178577dea4075e92cd8dd | [
"MIT"
] | null | null | null | crystalpy/tests/util/StokesVectorTest.py | oasys-kit/crystalpy | 4852851c622ef914844178577dea4075e92cd8dd | [
"MIT"
] | null | null | null | crystalpy/tests/util/StokesVectorTest.py | oasys-kit/crystalpy | 4852851c622ef914844178577dea4075e92cd8dd | [
"MIT"
] | null | null | null | """
Unittest for StokesVector class.
"""
import unittest
import numpy as np
from numpy.testing import assert_array_almost_equal
from crystalpy.util.StokesVector import StokesVector
class StokesVectorTest(unittest.TestCase):
def setUp(self):
self.element_list = [0.78177969457877930,
... | 41.175 | 87 | 0.603825 |
ea73d795a7c662240fdc6da80ce19265608f08fc | 19,216 | py | Python | inna/quantizer/quantize_caffe.py | caoqichun/inspur-inna | 0848ec5db3c04aa8e2b65caff8095dd3ac4040ca | [
"Apache-2.0"
] | null | null | null | inna/quantizer/quantize_caffe.py | caoqichun/inspur-inna | 0848ec5db3c04aa8e2b65caff8095dd3ac4040ca | [
"Apache-2.0"
] | null | null | null | inna/quantizer/quantize_caffe.py | caoqichun/inspur-inna | 0848ec5db3c04aa8e2b65caff8095dd3ac4040ca | [
"Apache-2.0"
] | null | null | null | # uncompyle6 version 3.3.1
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.7.1 (default, Dec 14 2018, 19:28:38)
# [GCC 7.3.0]
# Embedded file name: ./xfdnn/tools/quantize/quantize_caffe.py
# Compiled at: 2018-10-13 08:25:54
import numpy as np, google.protobuf.text_format as tfmt, caffe
from quantize_base imp... | 41.956332 | 145 | 0.680579 |
e199256c0db2cc90feb17bcd534c2e32fb2b6c90 | 14,831 | py | Python | workbench/tools/history.py | matthiask/workbench | f09dfd3f4d946c1091b6c1e96940d56335a736a3 | [
"MIT"
] | 15 | 2020-09-02T22:17:34.000Z | 2022-02-01T20:09:10.000Z | workbench/tools/history.py | matthiask/workbench | f09dfd3f4d946c1091b6c1e96940d56335a736a3 | [
"MIT"
] | 18 | 2020-01-08T15:28:26.000Z | 2022-02-28T02:46:41.000Z | workbench/tools/history.py | matthiask/workbench | f09dfd3f4d946c1091b6c1e96940d56335a736a3 | [
"MIT"
] | 8 | 2020-09-29T08:00:24.000Z | 2022-01-16T11:58:19.000Z | from collections import namedtuple
from decimal import Decimal
from django.db import models
from django.http import Http404
from django.urls import reverse
from django.utils import dateparse
from django.utils.html import conditional_escape, format_html, mark_safe
from django.utils.text import capfirst
from django.util... | 28.466411 | 84 | 0.586744 |
08ebe5a877519505b833e19db4b5523a088dcf6b | 3,321 | py | Python | scikit-learn-weighted_kde/doc/tutorial/machine_learning_map/svg2imagemap.py | RTHMaK/git-squash-master | 76c4c8437dd18114968e69a698f4581927fcdabf | [
"BSD-2-Clause"
] | 1 | 2021-11-26T12:22:13.000Z | 2021-11-26T12:22:13.000Z | scikit-learn-weighted_kde/doc/tutorial/machine_learning_map/svg2imagemap.py | RTHMaK/git-squash-master | 76c4c8437dd18114968e69a698f4581927fcdabf | [
"BSD-2-Clause"
] | null | null | null | scikit-learn-weighted_kde/doc/tutorial/machine_learning_map/svg2imagemap.py | RTHMaK/git-squash-master | 76c4c8437dd18114968e69a698f4581927fcdabf | [
"BSD-2-Clause"
] | null | null | null | #!/usr/local/bin/python
"""
This script converts a subset of SVG into an HTML imagemap
Note *subset*. It only handles <path> elements, for which it only pays
attention to the M and L commands. Futher, it only notices the "translate"
transform.
It was written to generate the examples in the documentation for maphil... | 36.494505 | 127 | 0.654321 |
b738e722eea2039e1054bd77151aa37c95f7a1a3 | 281 | py | Python | saleor/cart/context_processors.py | jdruiter/saleor | 9393ac20bd3e82c8ec1f17f6e47e3d7379f20419 | [
"BSD-3-Clause"
] | null | null | null | saleor/cart/context_processors.py | jdruiter/saleor | 9393ac20bd3e82c8ec1f17f6e47e3d7379f20419 | [
"BSD-3-Clause"
] | 1 | 2022-02-10T14:46:00.000Z | 2022-02-10T14:46:00.000Z | saleor/cart/context_processors.py | jdruiter/saleor | 9393ac20bd3e82c8ec1f17f6e47e3d7379f20419 | [
"BSD-3-Clause"
] | null | null | null | """Cart-related context processors."""
from __future__ import unicode_literals
from .utils import get_cart_from_request
def cart_counter(request):
"""Expose the number of items in cart."""
cart = get_cart_from_request(request)
return {'cart_counter': cart.quantity}
| 25.545455 | 45 | 0.754448 |
f53865e6de0f342a514dac42793b599e5aa63069 | 3,184 | py | Python | tests/test_static_graph.py | zbmain/PGL | dbded6a1543248b0a33c05eb476ddc513401a774 | [
"Apache-2.0"
] | 1,389 | 2019-06-11T03:29:20.000Z | 2022-03-29T18:25:43.000Z | tests/test_static_graph.py | zbmain/PGL | dbded6a1543248b0a33c05eb476ddc513401a774 | [
"Apache-2.0"
] | 232 | 2019-06-21T06:52:10.000Z | 2022-03-29T08:20:31.000Z | tests/test_static_graph.py | zbmain/PGL | dbded6a1543248b0a33c05eb476ddc513401a774 | [
"Apache-2.0"
] | 229 | 2019-06-20T12:13:58.000Z | 2022-03-25T12:04:48.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 31.215686 | 77 | 0.633794 |
e870bfceb35044841df9ce2bd8f04ca7be6d8b8d | 2,352 | py | Python | blockchain.py | mmz-001/simple-blockchain | e7f3e10791a1597bae14d4bee9261f644d75587f | [
"MIT"
] | null | null | null | blockchain.py | mmz-001/simple-blockchain | e7f3e10791a1597bae14d4bee9261f644d75587f | [
"MIT"
] | null | null | null | blockchain.py | mmz-001/simple-blockchain | e7f3e10791a1597bae14d4bee9261f644d75587f | [
"MIT"
] | null | null | null | import hashlib
from datetime import datetime
class Blockchain:
def __init__(self):
self.chain = []
self.current_tx = []
# Add the genesis block the the Blockchain
self.chain.append(self.genesis_block)
@property
def genesis_block(self):
"""The first b... | 21 | 94 | 0.522109 |
47681fb1482c398fffac920b0b5d12390cca7713 | 9,245 | py | Python | Scripts/etasteadyfv.py | dbcooney/Protocell_Paper_Code | 8ae4ae3b6487905c18e5fdf5d5f48756cb7b0134 | [
"BSD-3-Clause"
] | null | null | null | Scripts/etasteadyfv.py | dbcooney/Protocell_Paper_Code | 8ae4ae3b6487905c18e5fdf5d5f48756cb7b0134 | [
"BSD-3-Clause"
] | null | null | null | Scripts/etasteadyfv.py | dbcooney/Protocell_Paper_Code | 8ae4ae3b6487905c18e5fdf5d5f48756cb7b0134 | [
"BSD-3-Clause"
] | null | null | null | """
Script used to generate Figures B.1 and B.2, comparing the analytically calculated
steady states for the fast-dimer and fast-slow dimorphic models with the states
achieved after a large number of steps under numerical finite volume simulations of
the same models.
"""
import numpy as np
import matplotlib.pyplo... | 30.919732 | 141 | 0.674202 |
086bb4c46858895d54d08a8b0f1c3218dfdde3b9 | 378 | py | Python | exercises1-115/d115 - Criando um menu.py | renankalfa/Curso_em_Video | d9012e7f8c87fcc0ea27082279da234364f7e9a8 | [
"MIT"
] | 3 | 2022-01-08T23:16:07.000Z | 2022-01-17T14:11:25.000Z | exercises1-115/d115 - Criando um menu.py | renankalfa/Curso_em_Video | d9012e7f8c87fcc0ea27082279da234364f7e9a8 | [
"MIT"
] | null | null | null | exercises1-115/d115 - Criando um menu.py | renankalfa/Curso_em_Video | d9012e7f8c87fcc0ea27082279da234364f7e9a8 | [
"MIT"
] | null | null | null | from d115.visuais import *
from d115.tratamento import *
from d115.bancodedados import *
while True:
menu('Pessoas cadastradas', 'Cadastrar Pessoa', 'Encerrar Programa')
option = testaoption(input('\033[33mSua opção: \033[m'))
if option == 1:
mostrarcadastradas()
if option == 2:
armazen... | 25.2 | 72 | 0.634921 |
298e1191c06271831d4f1dd6f591995ac16a5a5e | 5,337 | py | Python | validation/emulation/experiments/linear-gpolka.p4app/test/latency_test_var/gpolka-fabric_bw10/heatmap_latency.py | nerds-ufes/G-PolKA | 9c6bd42167bc333f6421a751c93a88c00841def9 | [
"Apache-2.0",
"MIT"
] | null | null | null | validation/emulation/experiments/linear-gpolka.p4app/test/latency_test_var/gpolka-fabric_bw10/heatmap_latency.py | nerds-ufes/G-PolKA | 9c6bd42167bc333f6421a751c93a88c00841def9 | [
"Apache-2.0",
"MIT"
] | null | null | null | validation/emulation/experiments/linear-gpolka.p4app/test/latency_test_var/gpolka-fabric_bw10/heatmap_latency.py | nerds-ufes/G-PolKA | 9c6bd42167bc333f6421a751c93a88c00841def9 | [
"Apache-2.0",
"MIT"
] | null | null | null | import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from numpy import genfromtxt
# X
n_of_hops = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
# X
pkt_sizes = ["64", "128", "256", "512", "1024", "1300"]
pkt_sizes.reverse()
array = []
def get_values(p_size):
values_ping = []
... | 29.983146 | 88 | 0.610455 |
c9b774b167b67ab29dc1375cdb73b0ed8f0d856e | 12,464 | py | Python | PyU4V/tests/unit_tests/test_pyu4v_requests.py | SiSTm1/PyU4V | ce9784fc5f8192024cfa42509b8d45583b83f01d | [
"MIT"
] | 19 | 2020-01-06T12:02:25.000Z | 2021-12-14T06:50:04.000Z | PyU4V/tests/unit_tests/test_pyu4v_requests.py | SiSTm1/PyU4V | ce9784fc5f8192024cfa42509b8d45583b83f01d | [
"MIT"
] | 53 | 2019-12-17T17:26:44.000Z | 2022-02-03T12:28:34.000Z | PyU4V/tests/unit_tests/test_pyu4v_requests.py | SiSTm1/PyU4V | ce9784fc5f8192024cfa42509b8d45583b83f01d | [
"MIT"
] | 13 | 2019-01-24T17:10:05.000Z | 2019-12-09T06:33:21.000Z | # Copyright (c) 2020 Dell Inc. or its subsidiaries.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 44.99639 | 77 | 0.628931 |
ec730f1c6e3d36bec5d0c6144bd9479bc3560a7c | 7,064 | py | Python | astrality/tests/actions/test_copy_action.py | JakobGM/Astrality | 72935b616f9a6a2e9254e9cd9319b525c596e8f0 | [
"MIT"
] | 111 | 2018-03-19T12:56:35.000Z | 2022-02-05T11:19:04.000Z | astrality/tests/actions/test_copy_action.py | JakobGM/Astrality | 72935b616f9a6a2e9254e9cd9319b525c596e8f0 | [
"MIT"
] | 120 | 2018-02-22T11:23:08.000Z | 2021-03-25T22:13:47.000Z | astrality/tests/actions/test_copy_action.py | JakobGM/Astrality | 72935b616f9a6a2e9254e9cd9319b525c596e8f0 | [
"MIT"
] | 7 | 2018-04-06T14:28:33.000Z | 2020-03-18T20:25:59.000Z | """Tests for astrality.actions.CopyAction."""
from pathlib import Path
from astrality.actions import CopyAction
from astrality.persistence import CreatedFiles
def test_null_object_pattern():
"""Copy actions without options should do nothing."""
copy_action = CopyAction(
options={},
directory... | 27.920949 | 76 | 0.640006 |
42507b93018771630b9ea8a6ebbffbe1c5861e1a | 608 | py | Python | {{cookiecutter.repo_name}}/{{cookiecutter.package_name}}/test/test_pyspark_entrypoint.py | daniel-cortez-stevenson/cookiecutter-pyspark-cloud | 5a8818e086f810f66627862a0a0fa2e1741ae5a7 | [
"Apache-2.0"
] | 3 | 2020-05-06T20:01:34.000Z | 2021-07-14T17:19:43.000Z | {{cookiecutter.repo_name}}/{{cookiecutter.package_name}}/test/test_pyspark_entrypoint.py | daniel-cortez-stevenson/cookiecutter-pyspark-aws-emr | 5a8818e086f810f66627862a0a0fa2e1741ae5a7 | [
"Apache-2.0"
] | 1 | 2020-05-07T03:42:05.000Z | 2020-05-26T18:02:22.000Z | {{cookiecutter.repo_name}}/{{cookiecutter.package_name}}/test/test_pyspark_entrypoint.py | daniel-cortez-stevenson/cookiecutter-pyspark-aws-emr | 5a8818e086f810f66627862a0a0fa2e1741ae5a7 | [
"Apache-2.0"
] | 2 | 2020-10-29T21:34:52.000Z | 2021-12-28T12:53:12.000Z | """
Copyright 2020 Daniel Cortez Stevenson
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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... | 30.4 | 72 | 0.779605 |
e087519151d90f5a9e6050272ff806461c9d5cca | 26,307 | py | Python | scripts/db/budget/budggosql12.py | CCLab/Raw-Salad | 1ec028985e2b910aca31302fb57ed0677778756e | [
"BSD-3-Clause"
] | null | null | null | scripts/db/budget/budggosql12.py | CCLab/Raw-Salad | 1ec028985e2b910aca31302fb57ed0677778756e | [
"BSD-3-Clause"
] | null | null | null | scripts/db/budget/budggosql12.py | CCLab/Raw-Salad | 1ec028985e2b910aca31302fb57ed0677778756e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import getpass
import os
import optparse
import csv
import psycopg2
import psycopg2.extras
import simplejson as json
from ConfigParser import ConfigParser
#-----------------------------
def get_db_connect(fullpath, dbtype):
connect_dict= {}
defaults= {
'based... | 49.080224 | 257 | 0.572471 |
ab2e14d37fdede644b22d20e694b2927dfb2e0d0 | 18,663 | py | Python | core/dbt/config/project.py | nchammas/dbt | ea4948ff8a0d076425ecab1f4ec187296876589c | [
"Apache-2.0"
] | null | null | null | core/dbt/config/project.py | nchammas/dbt | ea4948ff8a0d076425ecab1f4ec187296876589c | [
"Apache-2.0"
] | null | null | null | core/dbt/config/project.py | nchammas/dbt | ea4948ff8a0d076425ecab1f4ec187296876589c | [
"Apache-2.0"
] | null | null | null | from copy import deepcopy
from dataclasses import dataclass
from itertools import chain
from typing import List, Dict, Any, Optional, TypeVar, Union, Tuple, Callable
import hashlib
import os
from dbt.clients.system import resolve_path_from_base
from dbt.clients.system import path_exists
from dbt.clients.system import ... | 33.748644 | 79 | 0.641644 |
a61d15ef6ef3a78682fa36cb0e57d3cc9dc1a41f | 5,810 | py | Python | tools/schedulers.py | dong03/DogNoseLandmarks | ac5d1e0436e9e0835a6939f8d125f1d36007bc62 | [
"MIT"
] | 1 | 2020-09-09T04:34:55.000Z | 2020-09-09T04:34:55.000Z | tools/schedulers.py | dong03/DogNoseLandmarks | ac5d1e0436e9e0835a6939f8d125f1d36007bc62 | [
"MIT"
] | null | null | null | tools/schedulers.py | dong03/DogNoseLandmarks | ac5d1e0436e9e0835a6939f8d125f1d36007bc62 | [
"MIT"
] | null | null | null | from bisect import bisect_right
from timm.optim import AdamW
from torch import optim
from torch.optim import lr_scheduler
from torch.optim.rmsprop import RMSprop
from torch.optim.adamw import AdamW
from torch.optim.lr_scheduler import MultiStepLR, CyclicLR
from torch.optim.lr_scheduler import _LRScheduler
from apex.opt... | 45.748031 | 132 | 0.624957 |
2e959f8ed7a4499d9c31891b4aea32055ab1ea01 | 296 | py | Python | myFirstPiPy/myFirstPiPy/tests/test_all.py | StudentESE/myFirstPiP | b6116753f77f1f3cec9b36f73d86a008fe27c500 | [
"BSD-2-Clause"
] | null | null | null | myFirstPiPy/myFirstPiPy/tests/test_all.py | StudentESE/myFirstPiP | b6116753f77f1f3cec9b36f73d86a008fe27c500 | [
"BSD-2-Clause"
] | null | null | null | myFirstPiPy/myFirstPiPy/tests/test_all.py | StudentESE/myFirstPiP | b6116753f77f1f3cec9b36f73d86a008fe27c500 | [
"BSD-2-Clause"
] | null | null | null | import unittest
import __init__ as myModule
class TestMyMethod(unittest.TestCase):
def test_myMethod(self):
self.assertEqual(myModule.myMethod(), "Hello PiP")
def test_myVariable(self):
self.assertIs(myModule.myVariable, 123)
if __name__ == '__main__':
unittest.main() | 32.888889 | 58 | 0.726351 |
c8f733c620e2eb5a11eadb130462c3f53340d87d | 1,391 | py | Python | part_2_read_test_json.py | hooplapunta/cc_tools | 43bc430b3374f55a72c13c3bb01bd5422ec5c4aa | [
"MIT"
] | null | null | null | part_2_read_test_json.py | hooplapunta/cc_tools | 43bc430b3374f55a72c13c3bb01bd5422ec5c4aa | [
"MIT"
] | null | null | null | part_2_read_test_json.py | hooplapunta/cc_tools | 43bc430b3374f55a72c13c3bb01bd5422ec5c4aa | [
"MIT"
] | null | null | null | import test_data
import json
#Creates and returns a GameLibrary object(defined in test_data) from loaded json_data
def make_game_library_from_json( json_data ):
#Initialize a new GameLibrary
game_library = test_data.GameLibrary()
### Begin Add Code Here ###
#Loop through the json_data
#Create ... | 31.613636 | 90 | 0.718188 |
f9ba7c323173201b928f341ba4b0774443a55b1f | 3,712 | py | Python | DeepLearning/pytorch/papers/EfficientDet/backbone.py | MikoyChinese/Learn | c482b1e84496279935b5bb2cfc1e6d78e2868c63 | [
"Apache-2.0"
] | null | null | null | DeepLearning/pytorch/papers/EfficientDet/backbone.py | MikoyChinese/Learn | c482b1e84496279935b5bb2cfc1e6d78e2868c63 | [
"Apache-2.0"
] | null | null | null | DeepLearning/pytorch/papers/EfficientDet/backbone.py | MikoyChinese/Learn | c482b1e84496279935b5bb2cfc1e6d78e2868c63 | [
"Apache-2.0"
] | null | null | null | import torch
from torch import nn
from efficientdet.model import BiFPN, Regressor, Classifier, EfficientNet
from efficientdet.utils import Anchors
class EfficientDetBackbone(nn.Module):
def __init__(self, num_classes=80, compound_coef=0, load_weights=False, **kwargs):
super(EfficientDetBackbone, self)._... | 44.722892 | 115 | 0.562769 |
d9a6d5e397e715bcf69c1e2cb9b31432e9ae2d4d | 12,764 | py | Python | featuretools/variable_types/variable.py | jeffzi/featuretools | cd674b3f302832cacb3ce9cc95d5ce2f5052a4d6 | [
"BSD-3-Clause"
] | null | null | null | featuretools/variable_types/variable.py | jeffzi/featuretools | cd674b3f302832cacb3ce9cc95d5ce2f5052a4d6 | [
"BSD-3-Clause"
] | null | null | null | featuretools/variable_types/variable.py | jeffzi/featuretools | cd674b3f302832cacb3ce9cc95d5ce2f5052a4d6 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import pandas as pd
from featuretools.utils.gen_utils import find_descendents
class Variable(object):
"""Represent a variable in an entity
A Variable is analogous to a column in table in a relational database
Args:
id (str) : Id of variable. Must match underlying data in Enti... | 29.752914 | 159 | 0.63875 |
bcf2535a3b2410e7b659082114e1fa965f50d07d | 1,749 | py | Python | tests/unit/resources/networking/test_interconnect_types.py | PragadeeswaranS/oneview-python | 3acc113b8dd30029beb7c228c3bc2bbe67d3485b | [
"Apache-2.0"
] | null | null | null | tests/unit/resources/networking/test_interconnect_types.py | PragadeeswaranS/oneview-python | 3acc113b8dd30029beb7c228c3bc2bbe67d3485b | [
"Apache-2.0"
] | null | null | null | tests/unit/resources/networking/test_interconnect_types.py | PragadeeswaranS/oneview-python | 3acc113b8dd30029beb7c228c3bc2bbe67d3485b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
###
# (C) Copyright [2019] Hewlett Packard Enterprise Development LP
#
# 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
#... | 35.693878 | 139 | 0.74271 |
000d7adbe57df358025e2c9b6c3390e117ef0dbd | 2,466 | py | Python | huawei_lte/errors.py | bfg100k/HuaweiB525Router | dd2c6b2954b1e48f571e6024c2c5fb29e90ef0b1 | [
"MIT"
] | 64 | 2019-02-05T23:31:57.000Z | 2022-02-13T22:59:31.000Z | huawei_lte/errors.py | bfg100k/HuaweiB525Router | dd2c6b2954b1e48f571e6024c2c5fb29e90ef0b1 | [
"MIT"
] | 14 | 2019-07-13T22:43:21.000Z | 2021-01-04T22:46:20.000Z | huawei_lte/errors.py | bfg100k/HuaweiB525Router | dd2c6b2954b1e48f571e6024c2c5fb29e90ef0b1 | [
"MIT"
] | 20 | 2019-05-09T12:48:16.000Z | 2022-01-12T10:55:29.000Z | import huawei_lte.xmlobjects as xmlobjects
class RouterError(Exception):
__ERRORS = [
[2000, 'Python API: %s - %s'],
[100001, 'An unkown error occurred'],
[100002, 'No such URL. The router does not support this function'],
[100003, 'You have no rights to access this function'],
... | 39.142857 | 100 | 0.607461 |
0b3e3c8e7b8d7d624827e0aff2c268649440b0fb | 8,526 | py | Python | api/tacticalrmm/tacticalrmm/constants.py | v2cloud/tacticalrmm | 12f599f9749985f66ff9b559c5e5abd36064b182 | [
"MIT"
] | null | null | null | api/tacticalrmm/tacticalrmm/constants.py | v2cloud/tacticalrmm | 12f599f9749985f66ff9b559c5e5abd36064b182 | [
"MIT"
] | null | null | null | api/tacticalrmm/tacticalrmm/constants.py | v2cloud/tacticalrmm | 12f599f9749985f66ff9b559c5e5abd36064b182 | [
"MIT"
] | null | null | null | from enum import Enum
from django.db import models
class MeshAgentIdent(Enum):
WIN32 = 3
WIN64 = 4
LINUX32 = 5
LINUX64 = 6
LINUX_ARM_64 = 26
LINUX_ARM_HF = 25
def __str__(self):
return str(self.value)
CORESETTINGS_CACHE_KEY = "core_settings"
ROLE_CACHE_PREFIX = "role_"
class ... | 26.811321 | 76 | 0.629369 |
f5bff68874a788009cfe6f66ced9081140bda556 | 9,783 | py | Python | markdown_it/rules_block/list.py | tadeu/markdown-it-py | 53d9b3379494dc7f4ef53eaf4726399aac875215 | [
"MIT"
] | 285 | 2020-04-30T02:45:16.000Z | 2022-03-30T03:25:44.000Z | markdown_it/rules_block/list.py | tadeu/markdown-it-py | 53d9b3379494dc7f4ef53eaf4726399aac875215 | [
"MIT"
] | 181 | 2020-04-30T21:31:24.000Z | 2022-03-22T12:20:35.000Z | markdown_it/rules_block/list.py | tadeu/markdown-it-py | 53d9b3379494dc7f4ef53eaf4726399aac875215 | [
"MIT"
] | 37 | 2020-05-04T22:30:43.000Z | 2022-03-19T22:54:17.000Z | # Lists
import logging
from .state_block import StateBlock
from ..common.utils import isSpace
LOGGER = logging.getLogger(__name__)
# Search `[-+*][\n ]`, returns next pos after marker on success
# or -1 on fail.
def skipBulletListMarker(state: StateBlock, startLine: int):
pos = state.bMarks[startLine] + state.... | 28.605263 | 87 | 0.58019 |
278d9602b03ec5b23a68f59190a5f44c74df243c | 1,572 | py | Python | include/matrix/python/console_formatter.py | lanfis/Walker | db174fcc0e672da7c3113571a8ce772ad2e1fac5 | [
"MIT"
] | null | null | null | include/matrix/python/console_formatter.py | lanfis/Walker | db174fcc0e672da7c3113571a8ce772ad2e1fac5 | [
"MIT"
] | null | null | null | include/matrix/python/console_formatter.py | lanfis/Walker | db174fcc0e672da7c3113571a8ce772ad2e1fac5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# license removed for brevity
import sys
class Console_Formatter:
def INFO(self, msg, node_name=None):
MSG = None if node_name is "" else self.GREEN+"[{}]".format(self.node_name)
MSG = MSG + self.NO_COLOR + msg +self.NO_COLOR
return MSG
def... | 36.55814 | 85 | 0.540712 |
905000858d4e2d7bbf8d8b5f01fe46157656448c | 5,455 | py | Python | cnc/hal_virtual.py | whisperoftheshot/PyCNC | 41cb8c11c66bf21d168dc7f2756ade4a8514a139 | [
"MIT"
] | null | null | null | cnc/hal_virtual.py | whisperoftheshot/PyCNC | 41cb8c11c66bf21d168dc7f2756ade4a8514a139 | [
"MIT"
] | null | null | null | cnc/hal_virtual.py | whisperoftheshot/PyCNC | 41cb8c11c66bf21d168dc7f2756ade4a8514a139 | [
"MIT"
] | null | null | null | from __future__ import division
import time
from cnc.pulses import *
from cnc.config import *
""" This is virtual device class which is very useful for debugging.
It checks PulseGenerator with some tests.
"""
def init():
""" Initialize GPIO pins and machine itself.
"""
logging.info("initialize hal")... | 32.861446 | 79 | 0.530889 |
ea1de5d55853926d9987b4fa4ffddd545999e802 | 2,917 | py | Python | AsciiArt/ascii-art.py | linxiaohui/CodeRepoPy | 0bb6a47225b0638dec360dd441ed506f9295a4b1 | [
"MIT"
] | null | null | null | AsciiArt/ascii-art.py | linxiaohui/CodeRepoPy | 0bb6a47225b0638dec360dd441ed506f9295a4b1 | [
"MIT"
] | null | null | null | AsciiArt/ascii-art.py | linxiaohui/CodeRepoPy | 0bb6a47225b0638dec360dd441ed506f9295a4b1 | [
"MIT"
] | null | null | null | """
How it works?
We scale a given image to a standard resolution that suitably represents the ASCII version of a given image.
The scaled version is then converted to a grayscale image.
In a grayscale image, there are 256 shades of gray, or in other words,
each pixel carries only the intensity information whi... | 36.924051 | 113 | 0.70929 |
0cd46792179934cd95439eef8eafea9b385d2853 | 832 | py | Python | jaraco/input/binary.py | jaraco/jaraco.input | 2693448286ce496efc82045ad4e1165f0479cc15 | [
"MIT"
] | null | null | null | jaraco/input/binary.py | jaraco/jaraco.input | 2693448286ce496efc82045ad4e1165f0479cc15 | [
"MIT"
] | null | null | null | jaraco/input/binary.py | jaraco/jaraco.input | 2693448286ce496efc82045ad4e1165f0479cc15 | [
"MIT"
] | null | null | null | def get_bit_values(number, size=32):
"""
Get bit values as a list for a given number
>>> get_bit_values(1) == [0]*31 + [1]
True
>>> get_bit_values(0xDEADBEEF)
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, ..., 0, 1, 1, 1, 1]
You may override the default word size of 32-bits to match your actual
... | 24.470588 | 74 | 0.579327 |
702bc72f4925fdf589162911cef89997a640ed7b | 1,691 | py | Python | examples/dfp/v201805/inventory_service/get_all_ad_units.py | christineyi3898/googleads-python-lib | cd707dc897b93cf1bbb19355f7424e7834e7fb55 | [
"Apache-2.0"
] | 1 | 2019-10-21T04:10:22.000Z | 2019-10-21T04:10:22.000Z | examples/dfp/v201805/inventory_service/get_all_ad_units.py | christineyi3898/googleads-python-lib | cd707dc897b93cf1bbb19355f7424e7834e7fb55 | [
"Apache-2.0"
] | null | null | null | examples/dfp/v201805/inventory_service/get_all_ad_units.py | christineyi3898/googleads-python-lib | cd707dc897b93cf1bbb19355f7424e7834e7fb55 | [
"Apache-2.0"
] | 1 | 2019-10-21T04:10:51.000Z | 2019-10-21T04:10:51.000Z | #!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 33.82 | 77 | 0.719101 |
22810b8afffdfed8a7d5fe3862bd01a9ab75b727 | 32,927 | py | Python | sdk/core/azure-core/tests/azure_core_asynctests/test_basic_transport.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 1 | 2020-12-10T03:17:51.000Z | 2020-12-10T03:17:51.000Z | sdk/core/azure-core/tests/azure_core_asynctests/test_basic_transport.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/core/azure-core/tests/azure_core_asynctests/test_basic_transport.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 1 | 2020-07-31T16:33:36.000Z | 2020-07-31T16:33:36.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE.txt in the project root for
# license information.
# -------------------------------------------------------------------------
from six.mo... | 35.216043 | 149 | 0.62675 |
294d21728368aea940319594e4b0dd7b90e02d84 | 523 | py | Python | geokey/users/migrations/0002_auto_20150106_1420.py | universityofsussex/geokey | 25e161dbc81841c57c148053dbe99facc81e84b8 | [
"Apache-2.0"
] | null | null | null | geokey/users/migrations/0002_auto_20150106_1420.py | universityofsussex/geokey | 25e161dbc81841c57c148053dbe99facc81e84b8 | [
"Apache-2.0"
] | null | null | null | geokey/users/migrations/0002_auto_20150106_1420.py | universityofsussex/geokey | 25e161dbc81841c57c148053dbe99facc81e84b8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from django.db import migrations
def create_anonymous(apps, schema_editor):
User = apps.get_model("users", "User")
if not User.objects.filter(display_name='AnonymousUser').exists():
User.objects.create(
display_name='AnonymousUser',
password='',
... | 20.115385 | 70 | 0.602294 |
ccb1280133f71916654ae3a70f30845926149cd0 | 9,155 | py | Python | src/old/multimodal_code/utils.py | trungnt13/digisami_journal | 671486d0fe7b65cad80daf8e8b96d475245c5fed | [
"Apache-2.0"
] | null | null | null | src/old/multimodal_code/utils.py | trungnt13/digisami_journal | 671486d0fe7b65cad80daf8e8b96d475245c5fed | [
"Apache-2.0"
] | null | null | null | src/old/multimodal_code/utils.py | trungnt13/digisami_journal | 671486d0fe7b65cad80daf8e8b96d475245c5fed | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function, division, absolute_import
import os
from six.moves import cPickle
import random
import numpy as np
from odin import fuel as F
from odin.utils import get_modelpath, Progbar, bidict
from odin.stats import freqcount
CODE_PATH = '/home/trung/src/digisami'
DATASET_PATH = '/home/tru... | 33.534799 | 101 | 0.518187 |
1b98a017bc628a35aa80ac880da460199d38bdc8 | 3,746 | py | Python | apps/auth/fixtures.py | Eudorajab1/websaw | 7c3a369789d23ac699868fa1eff6c63e3e5c1e36 | [
"MIT"
] | 1 | 2022-03-29T00:12:12.000Z | 2022-03-29T00:12:12.000Z | apps/auth/fixtures.py | Eudorajab1/websaw | 7c3a369789d23ac699868fa1eff6c63e3e5c1e36 | [
"MIT"
] | null | null | null | apps/auth/fixtures.py | Eudorajab1/websaw | 7c3a369789d23ac699868fa1eff6c63e3e5c1e36 | [
"MIT"
] | null | null | null | from websaw import DefaultApp, DefaultContext, XAuth, AuthErr, redirect
from websaw.core import request, Fixture, BaseContext
from pprint import pprint
class Auth(XAuth):
def take_on(self, ctx: BaseContext):
self.data.ctx = ctx
self.data.db = ctx.auth_db
self.data.session = ctx.session
... | 36.019231 | 85 | 0.599039 |
aa5ff839cefe5bbec114956e9a9593d3945beeb0 | 321,430 | py | Python | pyboto3/docdb.py | gehad-shaat/pyboto3 | 4a0c2851a8bc04fb1c71c36086f7bb257e48181d | [
"MIT"
] | 91 | 2016-12-31T11:38:37.000Z | 2021-09-16T19:33:23.000Z | pyboto3/docdb.py | gehad-shaat/pyboto3 | 4a0c2851a8bc04fb1c71c36086f7bb257e48181d | [
"MIT"
] | 7 | 2017-01-02T18:54:23.000Z | 2020-08-11T13:54:02.000Z | pyboto3/docdb.py | gehad-shaat/pyboto3 | 4a0c2851a8bc04fb1c71c36086f7bb257e48181d | [
"MIT"
] | 26 | 2016-12-31T13:11:00.000Z | 2022-03-03T21:01:12.000Z | '''
The MIT License (MIT)
Copyright (c) 2016 WavyCloud
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, p... | 37.523932 | 1,428 | 0.676191 |
e20be1b9fe1b4f062c386feb79c75ab3c83f453d | 6,046 | py | Python | benchmarks/skimage/cucim_restoration_bench.py | chrisroat/cucim | 8b909e374b9a77bb1c8ad747c793c30a3d86d4b4 | [
"Apache-2.0"
] | null | null | null | benchmarks/skimage/cucim_restoration_bench.py | chrisroat/cucim | 8b909e374b9a77bb1c8ad747c793c30a3d86d4b4 | [
"Apache-2.0"
] | null | null | null | benchmarks/skimage/cucim_restoration_bench.py | chrisroat/cucim | 8b909e374b9a77bb1c8ad747c793c30a3d86d4b4 | [
"Apache-2.0"
] | null | null | null | import math
import os
import pickle
import cucim.skimage
import cucim.skimage.restoration
import cupy as cp
import cupyx.scipy.ndimage as ndi
import numpy as np
import pandas as pd
import skimage
import skimage.restoration
from cucim.skimage.restoration import denoise_tv_chambolle as tv_gpu
from skimage.restoration im... | 31.989418 | 119 | 0.577407 |
24d3f587dfe209aac6560a64bf5eac919b86013b | 28,038 | py | Python | test/functional/__init__.py | NicolasT/swift | 16e1e1e3c6a921a335e5340be9bde698f4ee5b65 | [
"Apache-2.0"
] | null | null | null | test/functional/__init__.py | NicolasT/swift | 16e1e1e3c6a921a335e5340be9bde698f4ee5b65 | [
"Apache-2.0"
] | null | null | null | test/functional/__init__.py | NicolasT/swift | 16e1e1e3c6a921a335e5340be9bde698f4ee5b65 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 36.603133 | 79 | 0.634389 |
1c4da840d1b02cac2a696c76cc31d30757ac9afb | 344 | py | Python | ch07/07_09.py | leeseedong/book-cryptocurrency | 58c0bb3f5a80f8cc73ba47c4839be3bd33c9d67c | [
"Apache-2.0"
] | 121 | 2019-03-23T13:53:06.000Z | 2022-03-28T15:15:03.000Z | ch07/07_09.py | leeseedong/book-cryptocurrency | 58c0bb3f5a80f8cc73ba47c4839be3bd33c9d67c | [
"Apache-2.0"
] | 3 | 2021-04-14T14:31:26.000Z | 2021-05-09T13:46:14.000Z | ch07/07_09.py | leeseedong/book-cryptocurrency | 58c0bb3f5a80f8cc73ba47c4839be3bd33c9d67c | [
"Apache-2.0"
] | 114 | 2019-03-21T13:43:03.000Z | 2022-03-31T18:42:11.000Z | import pybithumb
import numpy as np
df = pybithumb.get_ohlcv("BTC")
df = df['2018']
df['range'] = (df['high'] - df['low']) * 0.5
df['target'] = df['open'] + df['range'].shift(1)
df['ror'] = np.where(df['high'] > df['target'],
df['close'] / df['target'],
1)
ror = df['ror'].c... | 21.5 | 48 | 0.505814 |
13b84123abf3bc2e468a223d7995e489fea72362 | 539 | py | Python | plotly/validators/scattergeo/marker/colorbar/titlefont/_size.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/scattergeo/marker/colorbar/titlefont/_size.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 1 | 2020-12-15T16:56:11.000Z | 2020-12-15T16:56:11.000Z | plotly/validators/scattergeo/marker/colorbar/titlefont/_size.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name='size',
parent_name='scattergeo.marker.colorbar.titlefont',
**kwargs
):
super(SizeValidator, self).__init__(
plotly_name=p... | 26.95 | 66 | 0.597403 |
9a673d0823617f1e57ab61e645a2b71a7950e3f5 | 1,409 | py | Python | card.py | catInside/ES_best_team | 580c567369b03c0f2350bc4c9d7289b092cc104a | [
"Apache-2.0"
] | null | null | null | card.py | catInside/ES_best_team | 580c567369b03c0f2350bc4c9d7289b092cc104a | [
"Apache-2.0"
] | null | null | null | card.py | catInside/ES_best_team | 580c567369b03c0f2350bc4c9d7289b092cc104a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from character import Character
class Card(object):
def __init__(self, name, point, char_name):
self.name = name
self.point = point
self.char_name = char_name
self.char = None
def __eq__(self, othe... | 28.18 | 60 | 0.479063 |
b838f5fe549bb4358128f3f652c93844cc7b1dcc | 480 | py | Python | Fractions/__init__.py | alexcamargos/Learning_Python_Programming | f1cce9f85a672468b6ed1eb98dea9f7c09443722 | [
"MIT"
] | 2 | 2021-06-04T23:39:14.000Z | 2021-09-15T05:36:35.000Z | Fractions/__init__.py | alexcamargos/Learning_Python_Programming | f1cce9f85a672468b6ed1eb98dea9f7c09443722 | [
"MIT"
] | null | null | null | Fractions/__init__.py | alexcamargos/Learning_Python_Programming | f1cce9f85a672468b6ed1eb98dea9f7c09443722 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
#
# -----------------------------------------------------------------------------------------------------------------------
# Name: Fractions
# Version: 0.0.1
# Summary: fractions.py - implements a rational numbers
#
# Author: Alexsander Lopes Camargos
# Author-email: alca... | 34.285714 | 122 | 0.341667 |
6c466adbde4791d8151eb64ba2b26f4456c73990 | 1,074 | py | Python | socialite/apps/twitter/decorators.py | dgouldin/django-socialite | 4de4060f5d8ab89ae9dd4032e66e526873351ba4 | [
"MIT"
] | 1 | 2015-01-30T19:05:26.000Z | 2015-01-30T19:05:26.000Z | socialite/apps/twitter/decorators.py | dgouldin/django-socialite | 4de4060f5d8ab89ae9dd4032e66e526873351ba4 | [
"MIT"
] | null | null | null | socialite/apps/twitter/decorators.py | dgouldin/django-socialite | 4de4060f5d8ab89ae9dd4032e66e526873351ba4 | [
"MIT"
] | 2 | 2016-06-26T13:49:31.000Z | 2021-08-13T01:00:15.000Z | import urllib
import urlparse
from django.conf import settings
from django.contrib.auth import logout
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
def twitter_login_required(func):
def inner(request, *args, **kwargs):
# hack the impersonate paramter out of the ... | 37.034483 | 87 | 0.687151 |
ea865e7832061ca11eeb9a2676141f671a136da5 | 554 | py | Python | twobuntu/articles/migrations/0002_article_image.py | muhiza/originarities | ca0a67363579e6237127386f13baa2ab7a7c2717 | [
"Apache-2.0"
] | 16 | 2015-01-12T12:25:28.000Z | 2021-06-22T03:23:44.000Z | twobuntu/articles/migrations/0002_article_image.py | muhiza/originarities | ca0a67363579e6237127386f13baa2ab7a7c2717 | [
"Apache-2.0"
] | 5 | 2015-01-02T01:23:40.000Z | 2015-10-22T06:11:40.000Z | twobuntu/articles/migrations/0002_article_image.py | muhiza/originarities | ca0a67363579e6237127386f13baa2ab7a7c2717 | [
"Apache-2.0"
] | 11 | 2015-01-27T06:23:45.000Z | 2020-05-20T11:46:12.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('images', '0001_initial'),
('articles', '0001_initial'),
]
operations = [
migrations.AddField(
model_name... | 25.181818 | 143 | 0.613718 |
11597855bc41e62f8ffb42fdfd67ab1b4a3f9d81 | 6,437 | py | Python | nagare/validate.py | nagareproject/config | 8832debb888f771f6112ae07698bc355354a783c | [
"BSD-3-Clause"
] | null | null | null | nagare/validate.py | nagareproject/config | 8832debb888f771f6112ae07698bc355354a783c | [
"BSD-3-Clause"
] | null | null | null | nagare/validate.py | nagareproject/config | 8832debb888f771f6112ae07698bc355354a783c | [
"BSD-3-Clause"
] | null | null | null | # Encoding: utf-8
# --
# Copyright (c) 2008-2021 Net-ng.
# All rights reserved.
#
# This software is licensed under the BSD License, as described in
# the file LICENSE.txt, which you should have received as part of
# this distribution.
# --
from functools import partial
from .config_exceptions import SpecificationEr... | 31.4 | 117 | 0.614727 |
2dfa2de408ddc95e57f93088944f3b784b9cc8e0 | 8,755 | py | Python | spark/spark_admin.py | wensheng/spark | ab47107d000f0670f4cfe131637f72471a04cfb2 | [
"MIT"
] | null | null | null | spark/spark_admin.py | wensheng/spark | ab47107d000f0670f4cfe131637f72471a04cfb2 | [
"MIT"
] | null | null | null | spark/spark_admin.py | wensheng/spark | ab47107d000f0670f4cfe131637f72471a04cfb2 | [
"MIT"
] | null | null | null | import os
import sys
import shutil
import spark
from optparse import OptionParser
join = os.path.join
cur_dir = os.getcwd()
proj_template = join(spark.__path__[0],'proj')
files_dir = join(proj_template,'files')
def main():
usage = "usage: %prog [options] [args]"
parser = OptionParser(usage)
parser.add_option("-c",... | 31.721014 | 92 | 0.7004 |
6290dde983b2bf260a0cbce3e4e1a512bf627117 | 1,178 | py | Python | drned/drned/choice.py | micnovak/drned-xmnr | af68d4ab1162b7cdcda61da6e825b61ba0069c66 | [
"Apache-2.0"
] | 7 | 2019-05-21T22:25:16.000Z | 2022-01-24T16:06:02.000Z | drned/drned/choice.py | micnovak/drned-xmnr | af68d4ab1162b7cdcda61da6e825b61ba0069c66 | [
"Apache-2.0"
] | 45 | 2018-10-16T14:35:40.000Z | 2022-03-24T16:11:25.000Z | drned/drned/choice.py | micnovak/drned-xmnr | af68d4ab1162b7cdcda61da6e825b61ba0069c66 | [
"Apache-2.0"
] | 6 | 2019-06-17T20:35:19.000Z | 2021-05-12T13:21:50.000Z | class Choice(object):
def __init__(self, children, name):
self.children = {}
self.indexes = {}
self.add(children, name)
self.done = False
def add(self, children, name):
if name not in self.children:
self.children[name] = children
self.indexes[name... | 28.047619 | 62 | 0.55348 |
0b1ef82017bc12fcbc5bfd81d5ba603840e67d95 | 3,276 | py | Python | tools/div_free_base.py | marvin-eisenberger/hamiltonian-interpolation | d18c2f401feffc672998c5fa1d50c1de03dba902 | [
"MIT"
] | 5 | 2021-01-05T23:16:55.000Z | 2021-07-23T12:26:06.000Z | tools/div_free_base.py | marvin-eisenberger/hamiltonian-interpolation | d18c2f401feffc672998c5fa1d50c1de03dba902 | [
"MIT"
] | null | null | null | tools/div_free_base.py | marvin-eisenberger/hamiltonian-interpolation | d18c2f401feffc672998c5fa1d50c1de03dba902 | [
"MIT"
] | 1 | 2021-02-22T08:31:05.000Z | 2021-02-22T08:31:05.000Z | import torch
import math
import numpy as np
from torch.nn import Parameter
import torch.sparse
from shape_utils import *
from param import device, device_cpu
import quaternion as quat
from base_tools import *
def compute_eigenvectors_3d(vert, k):
kv = torch.arange(1, k+1, device=device, dtype=torch.float32).unsqu... | 30.055046 | 120 | 0.625153 |
bd45238f75d96d54115593c1c93ef151a0fd7267 | 847 | py | Python | programmers/lv3/17676.py | KLumy/Basic-Algorithm | e52e4200c1955a9062569814ff3418dd06666845 | [
"MIT"
] | 1 | 2021-01-22T15:58:32.000Z | 2021-01-22T15:58:32.000Z | programmers/lv3/17676.py | KLumy/Basic-Algorithm | e52e4200c1955a9062569814ff3418dd06666845 | [
"MIT"
] | null | null | null | programmers/lv3/17676.py | KLumy/Basic-Algorithm | e52e4200c1955a9062569814ff3418dd06666845 | [
"MIT"
] | null | null | null | from typing import List
import heapq
def solution(lines: List[str]) -> int:
traffic_log = []
for line in lines:
date, time, delay = line.split()
time = time.split(":")
time = (
3600000 * int(time[0]) + 60000 * int(time[1]) + int(float(time[2]) * 1000)
)
de... | 24.911765 | 86 | 0.57379 |
dfa092cce2f01e3530a85da95c547bc44ff85e51 | 288 | py | Python | urdudataste/arynews/arynews/pipelines.py | Mubashar-arb/urdu-dataset | 16b7db91d93d0833fc41fbf9b396b05d92cd7df2 | [
"MIT"
] | 2 | 2021-07-12T15:14:44.000Z | 2021-07-16T14:27:30.000Z | urdudataste/arynews/arynews/pipelines.py | Mubashar-arb/urdu-dataset | 16b7db91d93d0833fc41fbf9b396b05d92cd7df2 | [
"MIT"
] | null | null | null | urdudataste/arynews/arynews/pipelines.py | Mubashar-arb/urdu-dataset | 16b7db91d93d0833fc41fbf9b396b05d92cd7df2 | [
"MIT"
] | 1 | 2021-07-14T06:31:33.000Z | 2021-07-14T06:31:33.000Z | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
class ArynewsPipeline(object):
def process_item(self, item, spider):
return item
| 24 | 65 | 0.711806 |
edae53f608072fcfe8f65b2f540f04766a643822 | 1,263 | py | Python | src/android/toga_android/app.py | Donyme/toga | 2647c7dc5db248025847e3a60b115ff51d4a0d4a | [
"BSD-3-Clause"
] | null | null | null | src/android/toga_android/app.py | Donyme/toga | 2647c7dc5db248025847e3a60b115ff51d4a0d4a | [
"BSD-3-Clause"
] | null | null | null | src/android/toga_android/app.py | Donyme/toga | 2647c7dc5db248025847e3a60b115ff51d4a0d4a | [
"BSD-3-Clause"
] | null | null | null | from android import PythonActivity
from .window import Window
class MainWindow(Window):
pass
class TogaApp:
def __init__(self, app):
self._interface = app
def onStart(self):
print("Toga app: onStart")
def onResume(self):
print("Toga app: onResume")
def onResume(self):... | 21.40678 | 78 | 0.625495 |
7a57b82c3f6ef4ffb82de994f2376cbf530c312f | 2,852 | py | Python | train_interaction.py | zwxxxuan/EPI | 1c48994afc97518a4d8e6df7f6cabaa8792bb425 | [
"MIT"
] | 28 | 2019-02-22T05:00:10.000Z | 2021-09-23T05:12:59.000Z | train_interaction.py | zwxxxuan/EPI | 1c48994afc97518a4d8e6df7f6cabaa8792bb425 | [
"MIT"
] | 3 | 2019-06-04T05:38:42.000Z | 2019-10-27T03:51:56.000Z | train_interaction.py | zwxxxuan/EPI | 1c48994afc97518a4d8e6df7f6cabaa8792bb425 | [
"MIT"
] | 1 | 2020-09-04T02:10:09.000Z | 2020-09-04T02:10:09.000Z | from rllab.baselines.linear_feature_baseline import LinearFeatureBaseline
from rllab.envs.normalized_env import normalize
from rllab.envs.gym_env import GymEnv
from sandbox.rocky.tf.envs.base import TfEnv
from sandbox.rocky.tf.policies.gaussian_mlp_policy import GaussianMLPPolicy
import pickle
import rllab.misc.logger ... | 31.340659 | 92 | 0.690393 |
d74b76ad57d48d1af7a80ea329a9edbf60c2b541 | 2,093 | py | Python | prudentia/cli.py | StarterSquad/prudentia | 44a0a8bd54a3dfcd46c16ed295ca660bb3865368 | [
"MIT"
] | 29 | 2015-02-04T06:39:12.000Z | 2019-02-26T08:50:56.000Z | prudentia/cli.py | StarterSquad/prudentia | 44a0a8bd54a3dfcd46c16ed295ca660bb3865368 | [
"MIT"
] | 44 | 2015-01-05T16:08:12.000Z | 2018-12-29T20:40:42.000Z | prudentia/cli.py | StarterSquad/prudentia | 44a0a8bd54a3dfcd46c16ed295ca660bb3865368 | [
"MIT"
] | 7 | 2015-01-30T17:28:49.000Z | 2021-02-14T23:43:26.000Z | import argparse
import os
import sys
from os import path
from ansible import __version__ as ansible_ver
from . import __version__ as prudentia_ver
# Setting Ansible config file environment variable as first thing
cwd = path.dirname(path.realpath(__file__))
os.environ['ANSIBLE_CONFIG'] = path.join(cwd, 'ansible.cfg')
... | 36.086207 | 101 | 0.655518 |
870a5b54de48a268106166a740702e42685f1dd9 | 264 | py | Python | loghub/emails.py | mskasal/loghub | b4821759012468d9003ec1119c06b8db9c3a17d0 | [
"MIT"
] | null | null | null | loghub/emails.py | mskasal/loghub | b4821759012468d9003ec1119c06b8db9c3a17d0 | [
"MIT"
] | null | null | null | loghub/emails.py | mskasal/loghub | b4821759012468d9003ec1119c06b8db9c3a17d0 | [
"MIT"
] | null | null | null | from flask.ext.mail import Message
from loghub import mail
def send_email(subject, sender, recipients, text_body, html_body):
msg = Message(subject, sender = sender, recipients = recipients)
msg.body = text_body
msg.html = html_body
mail.send(msg) | 33 | 68 | 0.738636 |
c7a18f6b2dc263a28bbb7cb8d8990ce3618a2615 | 8,334 | py | Python | test/test_who.py | rliebz/whoswho | 0c411e418c240fcec6ea0a23d15bd003056c65d0 | [
"MIT"
] | 28 | 2018-02-14T23:14:59.000Z | 2021-07-08T07:24:54.000Z | test/test_who.py | rliebz/whoswho | 0c411e418c240fcec6ea0a23d15bd003056c65d0 | [
"MIT"
] | 1 | 2019-01-21T15:25:49.000Z | 2019-01-23T19:03:06.000Z | test/test_who.py | rliebz/whoswho | 0c411e418c240fcec6ea0a23d15bd003056c65d0 | [
"MIT"
] | 2 | 2018-09-27T05:46:46.000Z | 2020-07-16T05:19:02.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
import nose
from nose.tools import *
from whoswho import who, config
from nameparser.config.titles import TITLES as NAMEPARSER_TITLES
class TestMatch(unittest.TestCase):
def setUp(self):
self.name = 'Robert Evan Liebowitz... | 40.852941 | 83 | 0.636069 |
21bf09393f379989fa9a94930ed6fd4c2689b37f | 2,778 | py | Python | tests/test_transfer.py | pacdao/gov-token | 7ce7b8916c70e145f311e4190507b245dbeb2c12 | [
"MIT"
] | null | null | null | tests/test_transfer.py | pacdao/gov-token | 7ce7b8916c70e145f311e4190507b245dbeb2c12 | [
"MIT"
] | null | null | null | tests/test_transfer.py | pacdao/gov-token | 7ce7b8916c70e145f311e4190507b245dbeb2c12 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import brownie
import pytest
@pytest.mark.skip(reason="no transfer")
def test_sender_balance_decreases(accounts, token):
sender_balance = token.balanceOf(accounts[0])
amount = sender_balance // 4
token.transfer(accounts[1], amount, {"from": accounts[0]})
assert token.balanceOf(acc... | 30.527473 | 79 | 0.711303 |
8f526e9eff86ecaae78fbf6c9fde06132bae1365 | 287 | py | Python | chainer/utils/array.py | takeratta/chainer | 02686e98cd6dc8f20979a1f3a79130f076cbfc6c | [
"MIT"
] | 7 | 2017-05-08T07:02:40.000Z | 2018-12-02T18:35:39.000Z | chainer/utils/array.py | takeratta/chainer | 02686e98cd6dc8f20979a1f3a79130f076cbfc6c | [
"MIT"
] | null | null | null | chainer/utils/array.py | takeratta/chainer | 02686e98cd6dc8f20979a1f3a79130f076cbfc6c | [
"MIT"
] | 1 | 2021-05-27T16:52:11.000Z | 2021-05-27T16:52:11.000Z | import numpy
from chainer import cuda
def as_vec(x):
return x.ravel()
def as_mat(x):
return x.reshape(len(x), -1)
def empty_like(x):
if cuda.available and isinstance(x, cuda.ndarray):
return cuda.cupy.empty_like(x)
else:
return numpy.empty_like(x)
| 15.105263 | 54 | 0.655052 |
675dd6d84ca6e1b7163035d8cba62b570a642b90 | 545 | py | Python | publishconf.py | tijptjik/thegodsproject | 8014f7b546289b9ca3aec64f6492b8312628d0a2 | [
"MIT"
] | null | null | null | publishconf.py | tijptjik/thegodsproject | 8014f7b546289b9ca3aec64f6492b8312628d0a2 | [
"MIT"
] | null | null | null | publishconf.py | tijptjik/thegodsproject | 8014f7b546289b9ca3aec64f6492b8312628d0a2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
SITEURL = 'http://thegodsproject.com'
RELATIVE_URLS = Fa... | 21.8 | 53 | 0.752294 |
8131b3e77af825166020447c9a094c9068cb4ac7 | 8,735 | py | Python | examples/examples/views.py | flying-sausages/iommi | 1cf0a2c513f37392d93df7a5ffeb9958f27f4216 | [
"BSD-3-Clause"
] | null | null | null | examples/examples/views.py | flying-sausages/iommi | 1cf0a2c513f37392d93df7a5ffeb9958f27f4216 | [
"BSD-3-Clause"
] | null | null | null | examples/examples/views.py | flying-sausages/iommi | 1cf0a2c513f37392d93df7a5ffeb9958f27f4216 | [
"BSD-3-Clause"
] | null | null | null | import json
from datetime import (
date,
datetime,
)
from pathlib import Path
from django.conf import settings
from django.contrib.auth.models import User
from django.db import OperationalError
from django.urls import (
include,
path,
reverse,
)
from tri_declarative import (
get_members,
is... | 29.019934 | 189 | 0.581339 |
07082b46d2f9fd351d588d56007c0aece9086a25 | 1,998 | py | Python | app/strava/test_tasks.py | AartGoossens/sweaty-reports | 02e6de908cd7d9dcd04e36f383444bd9f62d387b | [
"MIT"
] | 1 | 2020-09-07T13:08:01.000Z | 2020-09-07T13:08:01.000Z | app/strava/test_tasks.py | AartGoossens/sweaty-reports | 02e6de908cd7d9dcd04e36f383444bd9f62d387b | [
"MIT"
] | 3 | 2020-03-24T17:56:14.000Z | 2021-02-02T22:31:19.000Z | app/strava/test_tasks.py | AartGoossens/sweaty-reports | 02e6de908cd7d9dcd04e36f383444bd9f62d387b | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from pathlib import Path
import asynctest
import pytest
from .. import config
from . import tasks
from .models import StravaAthlete
from .schemas import Event
@pytest.mark.asyncio
async def test_handle_event(mocker):
event = Event(
aspect_type='update',
event_ti... | 27 | 87 | 0.737237 |
055613217cedabfb50bb2114101518002e365b6e | 7,168 | py | Python | relation_engine_server/api_versions/api_v1.py | slebras/relation_engine | 71d5cc4841b5140b09da8751eb61cd9ba2c83430 | [
"MIT"
] | null | null | null | relation_engine_server/api_versions/api_v1.py | slebras/relation_engine | 71d5cc4841b5140b09da8751eb61cd9ba2c83430 | [
"MIT"
] | null | null | null | relation_engine_server/api_versions/api_v1.py | slebras/relation_engine | 71d5cc4841b5140b09da8751eb61cd9ba2c83430 | [
"MIT"
] | null | null | null | import flask
from relation_engine_server.utils import (
arango_client,
spec_loader,
auth,
bulk_import,
pull_spec,
config,
parse_json,
)
from relation_engine_server.utils.json_validation import run_validator
from relation_engine_server.exceptions import InvalidParameters
api_v1 = flask.Bluep... | 36.385787 | 97 | 0.666574 |
7c5298ef6ba4cba447f060d790bb6d76fdec2a4d | 12,896 | py | Python | mpparser/mp_parser.py | nomad-coe/nomad-parser-mp | ef6874c976ab4f801f652254aeedfa8852bce0dd | [
"Apache-2.0"
] | null | null | null | mpparser/mp_parser.py | nomad-coe/nomad-parser-mp | ef6874c976ab4f801f652254aeedfa8852bce0dd | [
"Apache-2.0"
] | null | null | null | mpparser/mp_parser.py | nomad-coe/nomad-parser-mp | ef6874c976ab4f801f652254aeedfa8852bce0dd | [
"Apache-2.0"
] | null | null | null | #
# Copyright The NOMAD Authors.
#
# This file is part of NOMAD.
# See https://nomad-lab.eu for further info.
#
# 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/lic... | 45.730496 | 105 | 0.628102 |
4807e068bebaaddc9e58ef5cba0f03ca622b1978 | 1,979 | py | Python | app_verifications/thread/thread_checks.py | kskarbinski/threads-api | c144c1cb51422095922310d278f80e4996c10ea0 | [
"MIT"
] | null | null | null | app_verifications/thread/thread_checks.py | kskarbinski/threads-api | c144c1cb51422095922310d278f80e4996c10ea0 | [
"MIT"
] | null | null | null | app_verifications/thread/thread_checks.py | kskarbinski/threads-api | c144c1cb51422095922310d278f80e4996c10ea0 | [
"MIT"
] | null | null | null | from app_verifications import BaseChecks
from app_data.threads import threads, threads_invitations, threads_applications
from app_utils.helpers.finders import FindModel
class ThreadChecks(BaseChecks):
"""
Checks related to thread/threads.
All checks return True or False.
"""
def __init__(self, val... | 38.803922 | 116 | 0.749368 |
0636110aa501f3df35d633a1a75dcc94ab026c20 | 1,357 | py | Python | apps/common/const.py | constructorfleet/AutomationApps | a7d14582e30c1d1a4392774ab4e7e00055fa0e26 | [
"MIT"
] | null | null | null | apps/common/const.py | constructorfleet/AutomationApps | a7d14582e30c1d1a4392774ab4e7e00055fa0e26 | [
"MIT"
] | null | null | null | apps/common/const.py | constructorfleet/AutomationApps | a7d14582e30c1d1a4392774ab4e7e00055fa0e26 | [
"MIT"
] | null | null | null | ARG_OR = 'or'
ARG_AND = 'and'
ARG_ENTITY_ID = 'entity_id'
ARG_ATTRIBUTE = 'attribute'
ARG_EXISTS = 'exists'
ARG_STATE = 'state'
ARG_VALUE = 'value'
ARG_HOUR = 'hour'
ARG_MINUTE = 'minute'
ARG_SECOND = 'second'
ARG_BEFORE = 'before'
ARG_AFTER = 'after'
ARG_AT = 'at'
ARG_DOMAIN = 'domain'
ARG_GROUPS = 'groups'
ARG_SERVIC... | 21.887097 | 43 | 0.750184 |
3013977f7a7b727b4dbed6f9a1232d26aa143b9b | 3,090 | py | Python | models.py | zhikangD/CycleGAN-Tensorflow-PyTorch-Simple | 68357996780b758ae313814be16366255080cebf | [
"MIT"
] | null | null | null | models.py | zhikangD/CycleGAN-Tensorflow-PyTorch-Simple | 68357996780b758ae313814be16366255080cebf | [
"MIT"
] | null | null | null | models.py | zhikangD/CycleGAN-Tensorflow-PyTorch-Simple | 68357996780b758ae313814be16366255080cebf | [
"MIT"
] | 1 | 2020-11-20T06:30:46.000Z | 2020-11-20T06:30:46.000Z | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import ops
import functools
import tensorflow as tf
import tensorflow.contrib.slim as slim
conv = functools.partial(slim.conv2d, activation_fn=None)
deconv = functools.partial(slim.conv2d_transpose, activatio... | 46.119403 | 112 | 0.594822 |
7373e82adcdb3483a229c5c89389d5c91b30d4f9 | 6,688 | py | Python | custom_components/nicehash/nicehash.py | v00g100skr/ha-nicehash | 5db5848daff713016893654db5c1636ff7d1ca22 | [
"MIT"
] | null | null | null | custom_components/nicehash/nicehash.py | v00g100skr/ha-nicehash | 5db5848daff713016893654db5c1636ff7d1ca22 | [
"MIT"
] | null | null | null | custom_components/nicehash/nicehash.py | v00g100skr/ha-nicehash | 5db5848daff713016893654db5c1636ff7d1ca22 | [
"MIT"
] | null | null | null | """
NiceHash API interface
References:
- https://docs.nicehash.com/main/index.html
- https://github.com/nicehash/rest-clients-demo/blob/master/python/nicehash.py
"""
from datetime import datetime
from hashlib import sha256
import hmac
import httpx
import json
import logging
import re
import sys
from time import mkti... | 32 | 118 | 0.576106 |
1175b116ca844b90ff9ad6bcdce62a70c87ac173 | 521 | py | Python | Algorithms and Data Structures/old/bubble_sort.py | ioyy900205/PyTorch_mess-around | 90d255e17158699fd7902f7746b35fa18975112e | [
"MIT"
] | null | null | null | Algorithms and Data Structures/old/bubble_sort.py | ioyy900205/PyTorch_mess-around | 90d255e17158699fd7902f7746b35fa18975112e | [
"MIT"
] | null | null | null | Algorithms and Data Structures/old/bubble_sort.py | ioyy900205/PyTorch_mess-around | 90d255e17158699fd7902f7746b35fa18975112e | [
"MIT"
] | null | null | null | '''
Date: 2021-06-22 09:59:40
LastEditors: Liuliang
LastEditTime: 2021-06-22 10:24:49
Description: bubble_sort
'''
import random
# from random_int_list import *
from bacic_module.random_int_list import *
import numpy as np
def bubble_sort(li):
lenth = len(li)
for i in range(lenth-1):
for j in range(l... | 18.607143 | 62 | 0.642994 |
963ee09542fe0d3266b44a4bfea45ad516209877 | 22,486 | py | Python | checkers-reference/checkers_P2.py | cjsproject/Draughts-Checkers | 76928822692c3daeb87e2f75db1e2ca825abec29 | [
"MIT"
] | null | null | null | checkers-reference/checkers_P2.py | cjsproject/Draughts-Checkers | 76928822692c3daeb87e2f75db1e2ca825abec29 | [
"MIT"
] | null | null | null | checkers-reference/checkers_P2.py | cjsproject/Draughts-Checkers | 76928822692c3daeb87e2f75db1e2ca825abec29 | [
"MIT"
] | null | null | null | from __future__ import nested_scopes
import string
import random
#======================== Class GameEngine =======================================
class GameEngine:
def __init__(self, str_name):
self.str = str_name
def __str__(self):
return self.str
#The return value should be a move that is... | 42.994264 | 111 | 0.42373 |
90a03e48bff9d125781226a18da32cb2fa337ac4 | 14,217 | py | Python | tests/sdc/test_populate.py | beda-software/adibox-sdc | 0c2da41ac5ddbe0e33657fe51c6ee7d5aeb382ee | [
"MIT"
] | 7 | 2020-05-14T21:00:42.000Z | 2021-10-17T09:10:18.000Z | tests/sdc/test_populate.py | beda-software/adibox-sdc | 0c2da41ac5ddbe0e33657fe51c6ee7d5aeb382ee | [
"MIT"
] | 27 | 2020-07-16T06:59:04.000Z | 2021-11-18T13:22:35.000Z | tests/sdc/test_populate.py | beda-software/adibox-sdc | 0c2da41ac5ddbe0e33657fe51c6ee7d5aeb382ee | [
"MIT"
] | 2 | 2020-11-06T09:30:09.000Z | 2021-03-03T09:48:27.000Z | from tests.utils import create_parameters
async def test_initial_expression_populate(sdk, safe_db):
q = sdk.client.resource(
"Questionnaire",
**{
"status": "active",
"launchContext": [{"name": "LaunchPatient", "type": "Patient",},],
"item": [
{
... | 31.805369 | 123 | 0.346627 |
2bcacca1fd20eb7692188f2edfb3dd40e2cc8b93 | 27,224 | py | Python | tests/sagemaker/test_deployment.py | Kublai-Jing/mlflow | ad60bf1f6d4496573f8f278efd192fd282dfe5aa | [
"Apache-2.0"
] | null | null | null | tests/sagemaker/test_deployment.py | Kublai-Jing/mlflow | ad60bf1f6d4496573f8f278efd192fd282dfe5aa | [
"Apache-2.0"
] | null | null | null | tests/sagemaker/test_deployment.py | Kublai-Jing/mlflow | ad60bf1f6d4496573f8f278efd192fd282dfe5aa | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import os
import pytest
import time
import mock
from collections import namedtuple
import boto3
import botocore
import numpy as np
from click.testing import CliRunner
from sklearn.linear_model import LogisticRegression
import mlflow
import mlflow.pyfunc
import mlflow.sklearn
im... | 42.604069 | 100 | 0.728181 |
68842b90a583a5aea244d6f55aa00a3004c2bb04 | 3,743 | py | Python | intel-sds-proto/vsm_configure_guide/packages/vsmclient/python-vsmclient/build/lib.linux-x86_64-2.7/vsmclient/v1/vsm_snapshots.py | opensds/proposals | 03735f5e19203bdff698454f2633ca483c92129d | [
"Apache-2.0"
] | 5 | 2017-03-21T09:11:55.000Z | 2018-11-19T14:44:36.000Z | intel-sds-proto/vsm_configure_guide/packages/vsmclient/python-vsmclient/vsmclient/v1/vsm_snapshots.py | opensds/proposals | 03735f5e19203bdff698454f2633ca483c92129d | [
"Apache-2.0"
] | 3 | 2018-02-06T06:17:10.000Z | 2020-07-10T17:29:47.000Z | intel-sds-proto/vsm_configure_guide/packages/vsmclient/python-vsmclient/build/lib.linux-x86_64-2.7/vsmclient/v1/vsm_snapshots.py | opensds/proposals | 03735f5e19203bdff698454f2633ca483c92129d | [
"Apache-2.0"
] | 7 | 2018-02-06T03:54:13.000Z | 2021-09-08T10:51:38.000Z | # Copyright 2011 Denali Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 28.572519 | 78 | 0.595512 |
d27da2089adcce348ae644644bcb466a4dfb1013 | 773 | py | Python | algorithmic_time_complexity_plotter/plotter.py | MihaiAC/Algorithms-and-Data-Structures | 23356090816e1ca53707128d243592a358212e47 | [
"MIT"
] | null | null | null | algorithmic_time_complexity_plotter/plotter.py | MihaiAC/Algorithms-and-Data-Structures | 23356090816e1ca53707128d243592a358212e47 | [
"MIT"
] | null | null | null | algorithmic_time_complexity_plotter/plotter.py | MihaiAC/Algorithms-and-Data-Structures | 23356090816e1ca53707128d243592a358212e47 | [
"MIT"
] | null | null | null | from matplotlib import pyplot
from functools import partial
import timeit
class Plotter:
#generator = generates a list of appropiate arguments for the function, based on the previous list of arguments
#func = function of which the runtime will be measured
#n = number of plot points (executions of function ... | 35.136364 | 115 | 0.637775 |
d6b820669860a875206e6c576d38ec80bebf16e7 | 2,001 | py | Python | code/autoencoder.py | stjordanis/ml-cheatsheet | d34e096032b7ae826868be8808aee01699cec491 | [
"MIT"
] | 1,031 | 2019-12-04T23:51:59.000Z | 2022-03-31T10:44:51.000Z | code/autoencoder.py | stjordanis/ml-cheatsheet | d34e096032b7ae826868be8808aee01699cec491 | [
"MIT"
] | 41 | 2019-12-04T17:21:22.000Z | 2022-02-26T08:43:01.000Z | code/autoencoder.py | stjordanis/ml-cheatsheet | d34e096032b7ae826868be8808aee01699cec491 | [
"MIT"
] | 253 | 2019-12-06T06:46:08.000Z | 2022-03-23T01:24:16.000Z |
import torch.nn as nn
from torch.autograd import Variable
class Autoencoder(nn.Module):
def __init__(self, in_shape):
super().__init__()
c,h,w = in_shape
self.encoder = nn.Sequential(
nn.Linear(c*h*w, 128),
nn.ReLU(),
nn.Linear(128, 64),
nn.... | 27.410959 | 88 | 0.50075 |
82f889092288f46a74d16aabc0c4571dad4852ce | 1,757 | py | Python | RRT.py | garymullen/python-visualization-of-the-RRT-algorithm-with-pygame | deeb7122ffc247982463e1358004a51c1886307a | [
"MIT"
] | 4 | 2021-05-24T00:56:53.000Z | 2022-01-23T19:17:09.000Z | RRT.py | garymullen/python-visualization-of-the-RRT-algorithm-with-pygame | deeb7122ffc247982463e1358004a51c1886307a | [
"MIT"
] | 1 | 2021-08-07T11:20:26.000Z | 2021-08-07T11:20:26.000Z | RRT.py | garymullen/python-visualization-of-the-RRT-algorithm-with-pygame | deeb7122ffc247982463e1358004a51c1886307a | [
"MIT"
] | 4 | 2021-07-24T15:19:32.000Z | 2022-02-19T12:57:10.000Z | import pygame
from RRTbasePy import RRTGraph
from RRTbasePy import RRTMap
import time
def main():
dimensions =(512,512)
start=(50,50)
goal=(300,300)
obsdim=30
obsnum=50
iteration=0
t1=0
pygame.init()
map=RRTMap(start,goal,dimensions,obsdim,obsnum)
graph=RRTGraph... | 19.741573 | 96 | 0.515083 |
34cc61dcdea320c9c0bbb06dcf12fe8d2dacee45 | 1,255 | py | Python | modules/splunk_sdk.py | julianwieg/attack_range_local | b32de256726033de144790ad8640899f3b80cc48 | [
"Apache-2.0"
] | 101 | 2020-09-20T23:21:24.000Z | 2022-03-14T20:57:28.000Z | modules/splunk_sdk.py | julianwieg/attack_range_local | b32de256726033de144790ad8640899f3b80cc48 | [
"Apache-2.0"
] | 34 | 2020-09-17T21:33:12.000Z | 2022-03-09T09:40:31.000Z | modules/splunk_sdk.py | julianwieg/attack_range_local | b32de256726033de144790ad8640899f3b80cc48 | [
"Apache-2.0"
] | 36 | 2020-09-20T03:29:21.000Z | 2022-03-29T14:11:24.000Z |
import sys
import time
from time import sleep
import splunklib.results as results
import splunklib.client as client
import splunklib.results as results
import requests
from xml.etree import ElementTree
def export_search(host, s, password, export_mode="raw", out=sys.stdout, username="admin", port=8089):
"""
E... | 34.861111 | 101 | 0.661355 |
40be783019bc9221eb5d49fa012e23aeefd6872e | 262 | py | Python | mathgenerator/funcs/hcfFunc.py | furins/mathgenerator | 3ba50015ef4d9abaa404b5d3b9bb272cfdcf2deb | [
"MIT"
] | null | null | null | mathgenerator/funcs/hcfFunc.py | furins/mathgenerator | 3ba50015ef4d9abaa404b5d3b9bb272cfdcf2deb | [
"MIT"
] | null | null | null | mathgenerator/funcs/hcfFunc.py | furins/mathgenerator | 3ba50015ef4d9abaa404b5d3b9bb272cfdcf2deb | [
"MIT"
] | null | null | null | from .__init__ import *
def hcfFunc(maxVal=20):
a = random.randint(1, maxVal)
b = random.randint(1, maxVal)
x, y = a, b
while(y):
x, y = y, x % y
problem = f"HCF of {a} and {b} = "
solution = str(x)
return problem, solution
| 21.833333 | 38 | 0.549618 |
e0e35c7f7ad169d750cb4d1183be2e57bcc335fa | 847 | py | Python | Scripts/rst2latex.py | OlcaytoKorcan/project-management-system | 5544f7abcd6549a7a6f2dd1f75ebbcbae5a1a09f | [
"MIT"
] | null | null | null | Scripts/rst2latex.py | OlcaytoKorcan/project-management-system | 5544f7abcd6549a7a6f2dd1f75ebbcbae5a1a09f | [
"MIT"
] | null | null | null | Scripts/rst2latex.py | OlcaytoKorcan/project-management-system | 5544f7abcd6549a7a6f2dd1f75ebbcbae5a1a09f | [
"MIT"
] | null | null | null | #!c:\users\o\documents\github\project-management-system\scripts\python.exe
# $Id: rst2latex.py 5905 2009-04-16 12:04:49Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing LaTeX.
"""
try:
... | 31.37037 | 76 | 0.681228 |
32a006cecf21432a2d1e5264b4f4fa9c538f647f | 7,778 | py | Python | python/ray/serve/http_util.py | kifarid/ray | 43c97c2afb979987be82fa50048674e9b6776d5d | [
"Apache-2.0"
] | 3 | 2021-08-29T20:41:21.000Z | 2022-01-31T18:47:51.000Z | python/ray/serve/http_util.py | QPC-database/amazon-ray | 55aa4cac02a412b96252aea4e8c3f177a28324a1 | [
"Apache-2.0"
] | 64 | 2021-06-19T07:06:15.000Z | 2022-03-26T07:13:16.000Z | python/ray/serve/http_util.py | majacQ/ray | bc08c6cdcc7ddf4da751ca2a972defd3db509061 | [
"Apache-2.0"
] | null | null | null | import asyncio
from dataclasses import dataclass
import inspect
import json
from typing import Any, Dict, List, Optional, Type
import starlette.requests
from ray.serve.exceptions import RayServeException
@dataclass
class HTTPRequestWrapper:
scope: Dict[Any, Any]
body: bytes
def build_starlette_request(sco... | 35.354545 | 79 | 0.63371 |
24960a7047743d71bfcf4e5c16062a85246a5a5d | 2,871 | py | Python | data_generator.py | foamliu/Super-Resolution-Net | 684a59f12ed0a0a89f7067c81bfd6fba8090f618 | [
"MIT"
] | 14 | 2018-06-08T19:14:11.000Z | 2019-07-23T06:09:10.000Z | data_generator.py | foamliu/Super-Resolution-Net | 684a59f12ed0a0a89f7067c81bfd6fba8090f618 | [
"MIT"
] | 1 | 2019-02-28T02:50:26.000Z | 2019-12-18T07:28:11.000Z | data_generator.py | foamliu/Super-Resolution-Net | 684a59f12ed0a0a89f7067c81bfd6fba8090f618 | [
"MIT"
] | 6 | 2018-07-21T17:12:23.000Z | 2019-12-09T11:08:23.000Z | import os
import random
from random import shuffle
import cv2 as cv
import imutils
import numpy as np
from keras.utils import Sequence
from config import batch_size, img_size, channel, image_folder
from utils import random_crop, preprocess_input
class DataGenSequence(Sequence):
def __init__(self, usage, scale):... | 28.425743 | 91 | 0.626959 |
d11a8dd7792b9a361db59e31f2a1ab13ddde4539 | 591 | py | Python | run.py | kairos03/NetsPresso-ModelSearch-Dataset-Validator | b88b844867a6cb6e65962847c37cf196dcbcbc2d | [
"Apache-2.0"
] | null | null | null | run.py | kairos03/NetsPresso-ModelSearch-Dataset-Validator | b88b844867a6cb6e65962847c37cf196dcbcbc2d | [
"Apache-2.0"
] | null | null | null | run.py | kairos03/NetsPresso-ModelSearch-Dataset-Validator | b88b844867a6cb6e65962847c37cf196dcbcbc2d | [
"Apache-2.0"
] | null | null | null | import argparse
import importlib
from src.utils import validate
if __name__=="__main__":
parser = argparse.ArgumentParser(description='Dataset validator.')
parser.add_argument('--dir', type=str, required=True, help='dataset path.')
parser.add_argument('--format', type=str, required=True, help='dataset for... | 45.461538 | 86 | 0.739425 |
6f39112dfd59cfca7bc7ac085d42e398c7994856 | 12,928 | py | Python | lstchain/io/lstcontainers.py | yrenier/cta-lstchain | 4af91ebb37a33b5af5ea91dd53e29cdfc6b2f9a0 | [
"BSD-3-Clause"
] | 1 | 2020-05-12T09:00:55.000Z | 2020-05-12T09:00:55.000Z | lstchain/io/lstcontainers.py | yrenier/cta-lstchain | 4af91ebb37a33b5af5ea91dd53e29cdfc6b2f9a0 | [
"BSD-3-Clause"
] | 10 | 2020-11-18T10:12:46.000Z | 2021-01-28T15:54:04.000Z | lstchain/io/lstcontainers.py | yrenier/cta-lstchain | 4af91ebb37a33b5af5ea91dd53e29cdfc6b2f9a0 | [
"BSD-3-Clause"
] | 1 | 2020-11-05T09:45:43.000Z | 2020-11-05T09:45:43.000Z | """
Functions to handle custom containers for the mono reconstruction of LST1
"""
import astropy.units as u
import numpy as np
from astropy.units import Quantity
from astropy.coordinates import Angle
from ctapipe.core import Container, Field
from ctapipe.image import leakage, concentration
from ctapipe.image import ti... | 38.248521 | 95 | 0.639465 |
9540941d7e77d51d8827e7b5bc0756e42d6b9d07 | 2,768 | py | Python | post_gnome/tests/test_nc_reader.py | rsignell-usgs/post_gnome | e24492751458570e00d07e7dd1958881f6dfa51b | [
"MIT",
"Unlicense"
] | 2 | 2017-02-15T20:45:42.000Z | 2020-10-09T16:00:00.000Z | post_gnome/tests/test_nc_reader.py | rsignell-usgs/post_gnome | e24492751458570e00d07e7dd1958881f6dfa51b | [
"MIT",
"Unlicense"
] | 10 | 2015-06-25T23:42:11.000Z | 2021-06-22T16:19:19.000Z | post_gnome/tests/test_nc_reader.py | rsignell-usgs/post_gnome | e24492751458570e00d07e7dd1958881f6dfa51b | [
"MIT",
"Unlicense"
] | 15 | 2016-01-11T20:49:10.000Z | 2020-10-15T18:02:20.000Z | # for py2/3 compatibility
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import datetime
import pytest
import numpy as np
import netCDF4
from post_gnome import nc_particles
## test the Reader
def test_read_required():
"""
Does it find the required variables and a... | 32.564706 | 95 | 0.627529 |
1abb36793fe016be519eb96eb75623172a21c09a | 287 | py | Python | .binder/streamlit_call.py | op07n/minimal-streamlit-example | 1af747769dee3a5414da57ca3b66ea915d0fd06a | [
"MIT"
] | null | null | null | .binder/streamlit_call.py | op07n/minimal-streamlit-example | 1af747769dee3a5414da57ca3b66ea915d0fd06a | [
"MIT"
] | null | null | null | .binder/streamlit_call.py | op07n/minimal-streamlit-example | 1af747769dee3a5414da57ca3b66ea915d0fd06a | [
"MIT"
] | null | null | null | from subprocess import Popen
def load_jupyter_server_extension(nbapp):
"""serve the bokeh-app directory with bokeh server"""
Popen(["streamlit", "run", "st_runner.py", "apps", "--browser.serverAddress=0.0.0.0", "--server.enableCORS=False", "--browser.gatherUsageStats=False"])
| 41 | 155 | 0.721254 |
6c419b9401838ce31e68eea4acee8e44f393d97e | 14,474 | py | Python | flytekit/bin/entrypoint.py | cosmicBboy/flytek | 84c6b52c7a9673326bc7d1c9e84ebcb0f00c61d1 | [
"Apache-2.0"
] | null | null | null | flytekit/bin/entrypoint.py | cosmicBboy/flytek | 84c6b52c7a9673326bc7d1c9e84ebcb0f00c61d1 | [
"Apache-2.0"
] | 1 | 2021-02-05T02:57:25.000Z | 2021-02-05T02:57:25.000Z | flytekit/bin/entrypoint.py | cosmicBboy/flytekit | 84c6b52c7a9673326bc7d1c9e84ebcb0f00c61d1 | [
"Apache-2.0"
] | null | null | null | import datetime as _datetime
import importlib as _importlib
import logging as _logging
import os as _os
import pathlib
import random as _random
import click as _click
from flyteidl.core import literals_pb2 as _literals_pb2
from flytekit.annotated.base_task import IgnoreOutputs, PythonTask
from flytekit.annotated.cont... | 48.408027 | 120 | 0.717632 |
6e1f4432892e88fb8964a7870a1086f59cdb59d5 | 1,916 | py | Python | consumers/venv/lib/python3.7/site-packages/mode/loop/__init__.py | spencerpomme/Public-Transit-Status-with-Apache-Kafka | 2c85d7daadf4614fe7ce2eabcd13ff87236b1c7e | [
"MIT"
] | null | null | null | consumers/venv/lib/python3.7/site-packages/mode/loop/__init__.py | spencerpomme/Public-Transit-Status-with-Apache-Kafka | 2c85d7daadf4614fe7ce2eabcd13ff87236b1c7e | [
"MIT"
] | null | null | null | consumers/venv/lib/python3.7/site-packages/mode/loop/__init__.py | spencerpomme/Public-Transit-Status-with-Apache-Kafka | 2c85d7daadf4614fe7ce2eabcd13ff87236b1c7e | [
"MIT"
] | null | null | null | """AsyncIO event loop implementations.
This contains a registry of different AsyncIO loop implementations
to be used with Mode.
The choices available are:
aio **default**
Normal :mod:`asyncio` event loop policy.
eventlet
Use :pypi:`eventlet` as the event loop.
This uses :pypi:`aioeventlet` and will app... | 26.611111 | 73 | 0.670668 |
925846305232b47b95688c11f7dc0f7fd4a50264 | 4,759 | py | Python | stem_cell_hypothesis/en_electra_base/joint/dep_srl.py | emorynlp/stem-cell-hypothesis | 48a628093d93d653865fbac6409d179cddd99293 | [
"Apache-2.0"
] | 4 | 2021-09-17T15:23:31.000Z | 2022-02-28T10:18:04.000Z | stem_cell_hypothesis/en_electra_base/joint/dep_srl.py | emorynlp/stem-cell-hypothesis | 48a628093d93d653865fbac6409d179cddd99293 | [
"Apache-2.0"
] | null | null | null | stem_cell_hypothesis/en_electra_base/joint/dep_srl.py | emorynlp/stem-cell-hypothesis | 48a628093d93d653865fbac6409d179cddd99293 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2021-01-06 16:12
from typing import List
from elit.common.dataset import SortingSamplerBuilder
from elit.common.transform import NormalizeToken
from elit.components.mtl.loss_balancer import MovingAverageBalancer
from elit.components.mtl.multi_task_learning import MultiTa... | 40.675214 | 121 | 0.63921 |
22459a396d7b0a0eb35e7719c951c7eaa43f63c6 | 6,939 | py | Python | backend/nameless_smoke_29209/settings.py | crowdbotics-apps/nameless-smoke-29209 | 0310cd6965c9578c28fbc5f097cfb3f5b13be412 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/nameless_smoke_29209/settings.py | crowdbotics-apps/nameless-smoke-29209 | 0310cd6965c9578c28fbc5f097cfb3f5b13be412 | [
"FTL",
"AML",
"RSA-MD"
] | 9 | 2021-07-26T20:22:32.000Z | 2021-07-26T20:22:37.000Z | backend/nameless_smoke_29209/settings.py | crowdbotics-apps/nameless-smoke-29209 | 0310cd6965c9578c28fbc5f097cfb3f5b13be412 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
Django settings for nameless_smoke_29209 project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
... | 29.653846 | 112 | 0.731373 |
3144af2f76110b235b8d7a9595088b101ae780ad | 66 | py | Python | repositorytools/cli/commands/__init__.py | MaciejKucia/repositorytools | b9c6b2c3404e0395609dec05cae329b3576aa9a7 | [
"Apache-2.0"
] | 32 | 2017-09-25T08:01:27.000Z | 2022-03-16T21:53:37.000Z | repositorytools/cli/commands/__init__.py | MaciejKucia/repositorytools | b9c6b2c3404e0395609dec05cae329b3576aa9a7 | [
"Apache-2.0"
] | 30 | 2015-05-28T11:02:31.000Z | 2017-08-22T12:40:27.000Z | repositorytools/cli/commands/__init__.py | MaciejKucia/repositorytools | b9c6b2c3404e0395609dec05cae329b3576aa9a7 | [
"Apache-2.0"
] | 16 | 2017-12-11T06:17:22.000Z | 2021-10-09T06:35:33.000Z | __author__ = 'msamia'
from .artifact import *
from .repo import * | 16.5 | 23 | 0.727273 |
bdea1feb316e9dc7ab85fa5f868681217edde391 | 5,508 | py | Python | dist-packages/reportlab/lib/attrmap.py | Jianwei-Wang/python2.7_lib | 911b8e81512e5ac5f13e669ab46f7693ed897378 | [
"PSF-2.0"
] | 51 | 2015-01-20T19:50:34.000Z | 2022-03-05T21:23:32.000Z | dist-packages/reportlab/lib/attrmap.py | Jianwei-Wang/python2.7_lib | 911b8e81512e5ac5f13e669ab46f7693ed897378 | [
"PSF-2.0"
] | 16 | 2015-11-15T04:23:43.000Z | 2021-09-27T14:14:20.000Z | dist-packages/reportlab/lib/attrmap.py | Jianwei-Wang/python2.7_lib | 911b8e81512e5ac5f13e669ab46f7693ed897378 | [
"PSF-2.0"
] | 46 | 2015-03-28T10:18:14.000Z | 2021-12-16T15:57:47.000Z | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/attrmap.py
__version__=''' $Id$ '''
__doc__='''Framework for objects whose assignments are checked. Used by graphics.
We developed reportlab/graph... | 33.180723 | 134 | 0.593319 |
574ea42f6af5980b3c62319e2f0f1ba1e9c5761d | 26,727 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_route_filter_rules_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_route_filter_rules_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_route_filter_rules_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.402957 | 221 | 0.671755 |
cd4b22b05346ba150ae1e3d72287c4250f2f87fd | 360 | py | Python | python_socks/async_/curio/__init__.py | sjamgade/python-socks | e9c7718b104c382ff381f059705d1e929ec63f22 | [
"Apache-2.0"
] | null | null | null | python_socks/async_/curio/__init__.py | sjamgade/python-socks | e9c7718b104c382ff381f059705d1e929ec63f22 | [
"Apache-2.0"
] | null | null | null | python_socks/async_/curio/__init__.py | sjamgade/python-socks | e9c7718b104c382ff381f059705d1e929ec63f22 | [
"Apache-2.0"
] | null | null | null | from ..._types import ProxyType
from ..._proxy_factory import ProxyFactory
from ._proxy import (
CurioProxy,
Socks5Proxy,
Socks4Proxy,
HttpProxy
)
class Proxy(ProxyFactory[CurioProxy]):
types = {
ProxyType.SOCKS4: Socks4Proxy,
ProxyType.SOCKS5: Socks5Proxy,
ProxyType.HTTP: ... | 18 | 42 | 0.669444 |
1cd969d6bc7ca029dbf1576d8bafdcee9960f59a | 1,813 | py | Python | Metodos_numericos/MetodosDeGauss/GaussJacobi.py | iOsnaaente/Faculdade_ECA-UFSM | aea8b8d66169b073c439b47ad990e45695cbe953 | [
"MIT"
] | null | null | null | Metodos_numericos/MetodosDeGauss/GaussJacobi.py | iOsnaaente/Faculdade_ECA-UFSM | aea8b8d66169b073c439b47ad990e45695cbe953 | [
"MIT"
] | null | null | null | Metodos_numericos/MetodosDeGauss/GaussJacobi.py | iOsnaaente/Faculdade_ECA-UFSM | aea8b8d66169b073c439b47ad990e45695cbe953 | [
"MIT"
] | null | null | null | from numpy import zeros, linspace, array
from numpy.linalg import norm
def gaussJacobi(A, B, Ap, e):
C = zeros((len(A), len(A)))
g = zeros((len(B),1))
# Construir as matrizes C e g
for i in range(len(A)):
g[i] = B[i]/A[i][i]
for j in range(len(A)):
if i == j :
... | 25.9 | 102 | 0.472697 |
465dd63a290c6ff839bdc8d8fca6fefb889aa9bf | 70,309 | py | Python | binance/client.py | fzxa/python-binance | 78a64a67cad02ca6397b0b95486b2bc830ae5ef0 | [
"MIT"
] | 2 | 2018-12-26T12:09:30.000Z | 2020-09-27T08:21:05.000Z | binance/client.py | fzxa/python-binance | 78a64a67cad02ca6397b0b95486b2bc830ae5ef0 | [
"MIT"
] | null | null | null | binance/client.py | fzxa/python-binance | 78a64a67cad02ca6397b0b95486b2bc830ae5ef0 | [
"MIT"
] | 2 | 2018-08-19T16:30:15.000Z | 2018-12-09T10:20:15.000Z | # coding=utf-8
import hashlib
import hmac
import requests
import time
from operator import itemgetter
from .helpers import date_to_milliseconds, interval_to_milliseconds
from .exceptions import BinanceAPIException, BinanceRequestException, BinanceWithdrawException
class Client(object):
API_URL = 'https://api.bi... | 34.031462 | 251 | 0.538722 |
670e229496f29510882f893323b38836fd781192 | 6,212 | py | Python | dohproxy/client_protocol.py | rfinnie/doh-proxy | 3340626e7c2ee1d094f3c81feb693be712f337a2 | [
"BSD-3-Clause"
] | null | null | null | dohproxy/client_protocol.py | rfinnie/doh-proxy | 3340626e7c2ee1d094f3c81feb693be712f337a2 | [
"BSD-3-Clause"
] | null | null | null | dohproxy/client_protocol.py | rfinnie/doh-proxy | 3340626e7c2ee1d094f3c81feb693be712f337a2 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2018-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
#
import aioh2
import asyncio
import dns.message
import priority
import struct
import urllib.p... | 33.042553 | 78 | 0.629105 |
ce72e0c8e22fdbdfd00bc6eb0596c2eeb03207ec | 4,163 | py | Python | mobidziennik.py | JakubKoralewski/mobidziennik-do-kalendarza | bab06b843e1b5d011625549c56551dabff079787 | [
"MIT"
] | null | null | null | mobidziennik.py | JakubKoralewski/mobidziennik-do-kalendarza | bab06b843e1b5d011625549c56551dabff079787 | [
"MIT"
] | null | null | null | mobidziennik.py | JakubKoralewski/mobidziennik-do-kalendarza | bab06b843e1b5d011625549c56551dabff079787 | [
"MIT"
] | null | null | null | from robobrowser import RoboBrowser
#from bs4 import BeautifulSoup
import re
br = RoboBrowser()
br.open('https://lo2kalisz.mobidziennik.pl/dziennik/')
form = br.get_form()
form['login'] = input("Podaj login: ")
form['haslo'] = input("Podaj haslo: ")
br.submit_form(form)
br.open('https://lo2kalisz.mobidzi... | 28.319728 | 148 | 0.582513 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.