hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | 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 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2607f9a0dc3f776f74cee4716c6c68d127b158 | 117 | py | Python | engineersmy/core/admin.py | engineersmy/service | d5cc450fbeab533c92872a9306a4a12d471f1af4 | [
"BSD-2-Clause"
] | null | null | null | engineersmy/core/admin.py | engineersmy/service | d5cc450fbeab533c92872a9306a4a12d471f1af4 | [
"BSD-2-Clause"
] | 4 | 2021-04-08T18:42:54.000Z | 2021-06-10T17:46:39.000Z | engineersmy/core/admin.py | engineersmy/service | d5cc450fbeab533c92872a9306a4a12d471f1af4 | [
"BSD-2-Clause"
] | 1 | 2018-09-19T11:52:23.000Z | 2018-09-19T11:52:23.000Z | from django.contrib import admin
from .models import Event
# Register your models here.
admin.site.register(Event)
| 16.714286 | 32 | 0.794872 | from django.contrib import admin
from .models import Event
admin.site.register(Event)
| true | true |
1c2608e5da8bc28cc3620d5b4bca0772fb4d4fc4 | 1,119 | py | Python | sdk/identity/azure-identity/azure/identity/_constants.py | gautam714/azure-sdk-for-python | 1741c199c42e8c85a2e14bc78195fd992837ef92 | [
"MIT"
] | null | null | null | sdk/identity/azure-identity/azure/identity/_constants.py | gautam714/azure-sdk-for-python | 1741c199c42e8c85a2e14bc78195fd992837ef92 | [
"MIT"
] | null | null | null | sdk/identity/azure-identity/azure/identity/_constants.py | gautam714/azure-sdk-for-python | 1741c199c42e8c85a2e14bc78195fd992837ef92 | [
"MIT"
] | null | null | null | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
class EnvironmentVariables:
AZURE_CLIENT_ID = "AZURE_CLIENT_ID"
AZURE_CLIENT_SECRET = "AZURE_CLIENT_SECRET"
AZURE_TENANT_ID = "AZURE_TENANT_ID"
CLIENT_... | 37.3 | 139 | 0.716711 |
class EnvironmentVariables:
AZURE_CLIENT_ID = "AZURE_CLIENT_ID"
AZURE_CLIENT_SECRET = "AZURE_CLIENT_SECRET"
AZURE_TENANT_ID = "AZURE_TENANT_ID"
CLIENT_SECRET_VARS = (AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID)
AZURE_CLIENT_CERTIFICATE_PATH = "AZURE_CLIENT_CERTIFICATE_PATH"
CERT... | true | true |
1c2609e854b107dd08e135f85873d2499d5f58a8 | 265 | py | Python | tests/artificial/transf_Integration/trend_PolyTrend/cycle_5/ar_/test_artificial_128_Integration_PolyTrend_5__0.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/artificial/transf_Integration/trend_PolyTrend/cycle_5/ar_/test_artificial_128_Integration_PolyTrend_5__0.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/artificial/transf_Integration/trend_PolyTrend/cycle_5/ar_/test_artificial_128_Integration_PolyTrend_5__0.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 5, transform = "Integration", sigma = 0.0, exog_count = 0, ar_order = 0); | 37.857143 | 165 | 0.732075 | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 5, transform = "Integration", sigma = 0.0, exog_count = 0, ar_order = 0); | true | true |
1c260a44b3673f1acb2349e6c5067b10c969da47 | 971 | py | Python | py/client/pydeephaven/_constants.py | mattrunyon/deephaven-core | 80e3567e4647ab76a81e483d0a8ab542f9aadace | [
"MIT"
] | 55 | 2021-05-11T16:01:59.000Z | 2022-03-30T14:30:33.000Z | py/client/pydeephaven/_constants.py | mattrunyon/deephaven-core | 80e3567e4647ab76a81e483d0a8ab542f9aadace | [
"MIT"
] | 943 | 2021-05-10T14:00:02.000Z | 2022-03-31T21:28:15.000Z | py/client/pydeephaven/_constants.py | mattrunyon/deephaven-core | 80e3567e4647ab76a81e483d0a8ab542f9aadace | [
"MIT"
] | 29 | 2021-05-10T11:33:16.000Z | 2022-03-30T21:01:54.000Z | #
# Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending
#
from enum import Enum
from pydeephaven.proto import table_pb2
class AggType(Enum):
SUM = table_pb2.ComboAggregateRequest.AggType.SUM
ABS_SUM = table_pb2.ComboAggregateRequest.AggType.ABS_SUM
GROUP = table_pb2.ComboAggregateRequest.AggT... | 42.217391 | 71 | 0.805355 |
from enum import Enum
from pydeephaven.proto import table_pb2
class AggType(Enum):
SUM = table_pb2.ComboAggregateRequest.AggType.SUM
ABS_SUM = table_pb2.ComboAggregateRequest.AggType.ABS_SUM
GROUP = table_pb2.ComboAggregateRequest.AggType.GROUP
AVG = table_pb2.ComboAggregateRequest.AggType.AVG
... | true | true |
1c260af8f0dfbbc3a362ced42b79060f455b292c | 120 | py | Python | .circleci/build_bundle.py | cloudify-incubator/cloudify-ecosystem-test | a3c514408b4295cb33cb2a7090d44825ed0d601f | [
"Apache-2.0"
] | 1 | 2019-07-21T01:44:05.000Z | 2019-07-21T01:44:05.000Z | .circleci/build_bundle.py | cloudify-incubator/cloudify-ecosystem-test | a3c514408b4295cb33cb2a7090d44825ed0d601f | [
"Apache-2.0"
] | 2 | 2021-08-25T15:56:12.000Z | 2022-02-22T19:03:40.000Z | .circleci/build_bundle.py | cloudify-incubator/cloudify-ecosystem-test | a3c514408b4295cb33cb2a7090d44825ed0d601f | [
"Apache-2.0"
] | 3 | 2020-04-08T07:34:46.000Z | 2020-05-19T07:46:58.000Z | from ecosystem_cicd_tools.packaging import build_plugins_bundle
if __name__ == '__main__':
build_plugins_bundle()
| 20 | 63 | 0.808333 | from ecosystem_cicd_tools.packaging import build_plugins_bundle
if __name__ == '__main__':
build_plugins_bundle()
| true | true |
1c260bfa0c6c43bbe13c2c6db65abcd6ea7027b1 | 33,258 | py | Python | cyvcf2/tests/test_reader.py | timothymillar/cyvcf2 | acde4eab6e441f01f25cca48afc921343a810fa3 | [
"MIT"
] | null | null | null | cyvcf2/tests/test_reader.py | timothymillar/cyvcf2 | acde4eab6e441f01f25cca48afc921343a810fa3 | [
"MIT"
] | null | null | null | cyvcf2/tests/test_reader.py | timothymillar/cyvcf2 | acde4eab6e441f01f25cca48afc921343a810fa3 | [
"MIT"
] | null | null | null | from __future__ import print_function
from ..cyvcf2 import VCF, Variant, Writer
import numpy as np
import os.path
from nose.tools import assert_raises
import tempfile
import sys
import os
import atexit
try:
from pathlib import Path
except ImportError:
from pathlib2 import Path # python 2 backport
HERE = os.path.... | 30.511927 | 1,121 | 0.60169 | from __future__ import print_function
from ..cyvcf2 import VCF, Variant, Writer
import numpy as np
import os.path
from nose.tools import assert_raises
import tempfile
import sys
import os
import atexit
try:
from pathlib import Path
except ImportError:
from pathlib2 import Path
HERE = os.path.dirname(__file__)
V... | true | true |
1c260bfd7b861b024d34e7a364b74743fdc70e9b | 4,519 | py | Python | test/test_main_gui.py | Zhibade/easy-file-renamer | d9a14bdf7acaf438ec6ae1428c71fd07fb9e4231 | [
"MIT"
] | null | null | null | test/test_main_gui.py | Zhibade/easy-file-renamer | d9a14bdf7acaf438ec6ae1428c71fd07fb9e4231 | [
"MIT"
] | null | null | null | test/test_main_gui.py | Zhibade/easy-file-renamer | d9a14bdf7acaf438ec6ae1428c71fd07fb9e4231 | [
"MIT"
] | null | null | null | """
Test cases for main_gui module
"""
import sys
from unittest import TestCase
from unittest.mock import patch
from PySide2.QtWidgets import QApplication
from PySide2.QtTest import QTest
from PySide2.QtCore import Qt
from app.ui.main_gui import GUI
QApplication(sys.argv)
class TestAddPrefixCheckbox(TestCase):
... | 31.165517 | 96 | 0.655676 |
import sys
from unittest import TestCase
from unittest.mock import patch
from PySide2.QtWidgets import QApplication
from PySide2.QtTest import QTest
from PySide2.QtCore import Qt
from app.ui.main_gui import GUI
QApplication(sys.argv)
class TestAddPrefixCheckbox(TestCase):
def setUpClass():
print("\n... | true | true |
1c260c114cfc418c27eb03bd1cac34515ad8a51e | 6,360 | py | Python | Marantz.py | adrianziser/sonos_connect-marantz-bridge | d17f21afc4d88cc0523fac4691d53608fed91ed6 | [
"Apache-2.0"
] | 1 | 2017-02-26T16:05:28.000Z | 2017-02-26T16:05:28.000Z | Marantz.py | adrianziser/sonos_connect-marantz-bridge | d17f21afc4d88cc0523fac4691d53608fed91ed6 | [
"Apache-2.0"
] | 1 | 2021-08-06T06:58:07.000Z | 2021-08-06T06:58:07.000Z | Marantz.py | adrianziser/sonos_connect-marantz-bridge | d17f21afc4d88cc0523fac4691d53608fed91ed6 | [
"Apache-2.0"
] | 1 | 2022-01-19T19:52:32.000Z | 2022-01-19T19:52:32.000Z | import threading
import telnetlib
import re
import sys
__author__ = 'Josh'
class IP():
sources = ["TUNER", "DVD", "BD", "TV", "SAT", "SAT/CBL", "MPLAY", "GAME", "AUX1", "NET", "PANDORA", "SIRIUSXM",
"LASTFM", "FLICKR", "FAVORITES", "IRADIO", "SERVER", "USB/IPOD", "USB", "IPD", "IRP", "FVP"]
d... | 38.083832 | 270 | 0.554245 | import threading
import telnetlib
import re
import sys
__author__ = 'Josh'
class IP():
sources = ["TUNER", "DVD", "BD", "TV", "SAT", "SAT/CBL", "MPLAY", "GAME", "AUX1", "NET", "PANDORA", "SIRIUSXM",
"LASTFM", "FLICKR", "FAVORITES", "IRADIO", "SERVER", "USB/IPOD", "USB", "IPD", "IRP", "FVP"]
d... | false | true |
1c260d71cf5a5fe3c70b4c1fa33674ae8e132bde | 1,280 | py | Python | tests/test_dungeon.py | botamochi0x12/Python-Roguelike-Framework | 230101fb076e3d2a8009ce3320d25cf197192328 | [
"MIT"
] | 25 | 2016-12-08T14:31:16.000Z | 2021-12-16T11:04:57.000Z | tests/test_dungeon.py | botamochi0x12/Python-Roguelike-Framework | 230101fb076e3d2a8009ce3320d25cf197192328 | [
"MIT"
] | 4 | 2015-01-10T23:37:02.000Z | 2016-08-07T16:23:39.000Z | tests/test_dungeon.py | botamochi0x12/Python-Roguelike-Framework | 230101fb076e3d2a8009ce3320d25cf197192328 | [
"MIT"
] | 11 | 2016-10-01T20:09:24.000Z | 2021-08-15T20:46:14.000Z | """
Run with:
python2.7 -m unittest discover tests
"""
import unittest
from areas.level import Level
from managers.game_manager import GameManager
from components.stats import Stats
@unittest.skip('This is out of date and causes travis to fail')
class DungeonTestCase(unittest.TestCase):
def setUp(self):
... | 29.767442 | 104 | 0.692188 | import unittest
from areas.level import Level
from managers.game_manager import GameManager
from components.stats import Stats
@unittest.skip('This is out of date and causes travis to fail')
class DungeonTestCase(unittest.TestCase):
def setUp(self):
self.game_manager = GameManager()
level = Leve... | true | true |
1c260dd6b36b8f5a1653c647aac1e9626aea659e | 19,881 | py | Python | src/main/bin/python/python2.7/site-packages/PIL/JpegImagePlugin.py | otrack/serverless-shell | f3fcd28353b775caddd45e2db8998537d8a6d8a4 | [
"Apache-2.0"
] | 132 | 2021-02-24T12:14:35.000Z | 2022-03-28T13:06:22.000Z | src/main/bin/python/python2.7/site-packages/PIL/JpegImagePlugin.py | otrack/serverless-shell | f3fcd28353b775caddd45e2db8998537d8a6d8a4 | [
"Apache-2.0"
] | null | null | null | src/main/bin/python/python2.7/site-packages/PIL/JpegImagePlugin.py | otrack/serverless-shell | f3fcd28353b775caddd45e2db8998537d8a6d8a4 | [
"Apache-2.0"
] | 3 | 2021-12-08T15:20:46.000Z | 2021-12-13T04:55:08.000Z | #
# The Python Imaging Library.
# $Id$
#
# JPEG (JFIF) file handling
#
# See "Digital Compression and Coding of Continous-Tone Still Images,
# Part 1, Requirements and Guidelines" (CCITT T.81 / ISO 10918-1)
#
# History:
# 1995-09-09 fl Created
# 1995-09-13 fl Added full parser
# 1996-03-25 fl Added hack to use th... | 33.868825 | 103 | 0.561742 |
# Part 1, Requirements and Guidelines" (CCITT T.81 / ISO 10918-1)
__version__ = "0.6"
import array, struct
from PIL import Image, ImageFile, _binary
from PIL.JpegPresets import presets
i8 = _binary.i8
o8 = _binary.o8
i16 = _binary.i16be
i32 = _binary.i32be
def Skip(self, marker):
... | true | true |
1c261011534289fb34534dc11e71c642056e5af1 | 204 | py | Python | Binary.py | sanxy/hacktoberfest-1 | 913582b310688d496602e8b1bc9166cb64866e38 | [
"MIT"
] | null | null | null | Binary.py | sanxy/hacktoberfest-1 | 913582b310688d496602e8b1bc9166cb64866e38 | [
"MIT"
] | null | null | null | Binary.py | sanxy/hacktoberfest-1 | 913582b310688d496602e8b1bc9166cb64866e38 | [
"MIT"
] | 1 | 2020-09-30T18:53:05.000Z | 2020-09-30T18:53:05.000Z | # Function to print binary number using recursion
def convertToBinary(n):
if n > 1:
convertToBinary(n//2)
print(n % 2,end = '')
# decimal number
dec = 34
convertToBinary(dec)
print()
| 11.333333 | 49 | 0.647059 |
def convertToBinary(n):
if n > 1:
convertToBinary(n//2)
print(n % 2,end = '')
dec = 34
convertToBinary(dec)
print()
| true | true |
1c2610d1c6a76ceb6643a623248ea6877901b82d | 36,170 | py | Python | opentargets/model/evidence/phenotype.py | CTTV/data_model | 1ca94e9ba5dd33e02a539326d37db0813d4d4be9 | [
"Apache-2.0"
] | null | null | null | opentargets/model/evidence/phenotype.py | CTTV/data_model | 1ca94e9ba5dd33e02a539326d37db0813d4d4be9 | [
"Apache-2.0"
] | 1 | 2017-02-03T17:06:54.000Z | 2018-01-17T17:18:18.000Z | opentargets/model/evidence/phenotype.py | CTTV/data_model | 1ca94e9ba5dd33e02a539326d37db0813d4d4be9 | [
"Apache-2.0"
] | 1 | 2017-04-13T16:50:57.000Z | 2017-04-13T16:50:57.000Z | '''
Copyright 2014-2018 Biogen, Celgene Corporation, EMBL - European Bioinformatics Institute, GlaxoSmithKline, Takeda Pharmaceutical Company and Wellcome Sanger Institute
This software was developed as part of the Open Targets project. For more information please see: http://www.opentargets.org
Licensed under the Ap... | 47.157757 | 395 | 0.695383 | import re
import sys
import iso8601
import types
import json
import logging
import six
import collections
import opentargets.model.evidence.core
import opentargets.model.evidence.linkout as evidence_linkout
import opentargets.model.bioentity as bioentity
__author__ = "Gautier Koscielny"
__copyright__ = "Copyright 2014... | true | true |
1c261314ad798b2dbb3d0d7e8e5e082fdd6910b1 | 135 | py | Python | stix_shifter_modules/guardium/stix_translation/results_translator.py | pyromaneact/stix-shifter | 431c6f66513cd0db8e338a4e2952a40666bc294b | [
"Apache-2.0"
] | 129 | 2019-10-09T17:13:03.000Z | 2022-03-03T08:25:46.000Z | stix_shifter_modules/guardium/stix_translation/results_translator.py | pyromaneact/stix-shifter | 431c6f66513cd0db8e338a4e2952a40666bc294b | [
"Apache-2.0"
] | 415 | 2019-10-03T14:29:20.000Z | 2022-03-31T18:23:41.000Z | stix_shifter_modules/guardium/stix_translation/results_translator.py | pyromaneact/stix-shifter | 431c6f66513cd0db8e338a4e2952a40666bc294b | [
"Apache-2.0"
] | 178 | 2019-10-08T22:18:48.000Z | 2022-03-21T11:04:05.000Z | from stix_shifter_utils.stix_translation.src.json_to_stix.json_to_stix import JSONToStix
class ResultsTranslator(JSONToStix):
pass | 33.75 | 88 | 0.866667 | from stix_shifter_utils.stix_translation.src.json_to_stix.json_to_stix import JSONToStix
class ResultsTranslator(JSONToStix):
pass | true | true |
1c2613956b03a746bdf0edd50d60294b8153f2c0 | 1,488 | py | Python | publication/migrations/0002_post.py | pauloaugusto-dmf/blog_django | 7374e85dd4f0622aefbbb99d27ceb85f19fd1cd8 | [
"MIT"
] | 2 | 2021-12-31T22:14:31.000Z | 2021-12-31T22:14:34.000Z | publication/migrations/0002_post.py | pauloaugusto-dmf/blog_django | 7374e85dd4f0622aefbbb99d27ceb85f19fd1cd8 | [
"MIT"
] | null | null | null | publication/migrations/0002_post.py | pauloaugusto-dmf/blog_django | 7374e85dd4f0622aefbbb99d27ceb85f19fd1cd8 | [
"MIT"
] | null | null | null | # Generated by Django 4.0 on 2022-01-01 17:05
import autoslug.fields
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
('publication',... | 41.333333 | 147 | 0.620296 |
import autoslug.fields
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
('publication', '0001_initial'),
]
operations = [
... | true | true |
1c2613c0842565de160357db3ec395b66bc47f04 | 398 | py | Python | Binary Search/leetcode744. Find Smallest Letter Greater Than Target.py | aurora314156/leetcode | 7fb6096f9af255e46c69d83254b58b1558e082d8 | [
"MIT"
] | null | null | null | Binary Search/leetcode744. Find Smallest Letter Greater Than Target.py | aurora314156/leetcode | 7fb6096f9af255e46c69d83254b58b1558e082d8 | [
"MIT"
] | null | null | null | Binary Search/leetcode744. Find Smallest Letter Greater Than Target.py | aurora314156/leetcode | 7fb6096f9af255e46c69d83254b58b1558e082d8 | [
"MIT"
] | null | null | null |
class Solution:
def nextGreatestLetter(self, letters: List[str], target: str) -> str:
if target >= letters[-1]: return letters[0]
left, right = 0, len(letters)
while left < right:
mid = left + (right - left) // 2
if letters[mid] <= target:
left = mid ... | 33.166667 | 73 | 0.502513 |
class Solution:
def nextGreatestLetter(self, letters: List[str], target: str) -> str:
if target >= letters[-1]: return letters[0]
left, right = 0, len(letters)
while left < right:
mid = left + (right - left) // 2
if letters[mid] <= target:
left = mid ... | true | true |
1c2613c3875ee0484f22f2313cdb6cd75fda6c6e | 8,551 | py | Python | docs/conf.py | lbmm/S.E.Arch | 45b3394f172687e12fb5686f183b5cd440fdc8ff | [
"MIT"
] | null | null | null | docs/conf.py | lbmm/S.E.Arch | 45b3394f172687e12fb5686f183b5cd440fdc8ff | [
"MIT"
] | null | null | null | docs/conf.py | lbmm/S.E.Arch | 45b3394f172687e12fb5686f183b5cd440fdc8ff | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pubblicazioniASI documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in t... | 30.981884 | 76 | 0.721319 |
import sys
import os
cwd = os.getcwd()
project_root = os.path.dirname(cwd)
sys.path.insert(0, project_root)
import pubblicazioniASI
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
projec... | true | true |
1c26171184ff83792c7c71812358689252aa73bf | 210 | py | Python | config/logging_configurator.py | dkeefe3773/pong-rl | e0d548267d7e0ca1b8690224cfd827af8ff571ab | [
"MIT"
] | null | null | null | config/logging_configurator.py | dkeefe3773/pong-rl | e0d548267d7e0ca1b8690224cfd827af8ff571ab | [
"MIT"
] | null | null | null | config/logging_configurator.py | dkeefe3773/pong-rl | e0d548267d7e0ca1b8690224cfd827af8ff571ab | [
"MIT"
] | null | null | null | import logging.config
from pathlib import Path
true_path = Path(__file__).parent / 'logging.conf'
logging.config.fileConfig(str(true_path.resolve()))
def get_logger(name):
return logging.getLogger(name)
| 21 | 51 | 0.77619 | import logging.config
from pathlib import Path
true_path = Path(__file__).parent / 'logging.conf'
logging.config.fileConfig(str(true_path.resolve()))
def get_logger(name):
return logging.getLogger(name)
| true | true |
1c261787e9aecc8f3d6c4151eb0144f4342e538c | 7,670 | py | Python | test/functional/test_framework/test_node.py | byeonggoon/blockteam1-1 | 59e7890bb3d6c1091355c8e91898fdb7199a3328 | [
"MIT"
] | null | null | null | test/functional/test_framework/test_node.py | byeonggoon/blockteam1-1 | 59e7890bb3d6c1091355c8e91898fdb7199a3328 | [
"MIT"
] | null | null | null | test/functional/test_framework/test_node.py | byeonggoon/blockteam1-1 | 59e7890bb3d6c1091355c8e91898fdb7199a3328 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Class for hashrootd node under test"""
import decimal
import errno
import http.client
import json
import lo... | 40.157068 | 248 | 0.640287 |
import decimal
import errno
import http.client
import json
import logging
import os
import subprocess
import time
from .util import (
assert_equal,
get_rpc_proxy,
rpc_url,
wait_until,
)
from .authproxy import JSONRPCException
BITCOIND_PROC_WAIT_TIMEOUT = 60
class TestNode():
def __init__(se... | true | true |
1c2618f50237e05fab6d1f1c0fc21b7767153ca6 | 756 | py | Python | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_posicao_do_maior.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_posicao_do_maior.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_posicao_do_maior.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # --------------------------
# UFSC - CTC - INE - INE5603
# Exercício Processa Números
# --------------------------
# Classe responsável por encontrar a posição do maior número.
from view.paineis.painel_abstrato import PainelAbstrato
from model.processa_numeros import posicao_do_maior
class PainelPosicaoDoMaior(Paine... | 34.363636 | 95 | 0.634921 |
from view.paineis.painel_abstrato import PainelAbstrato
from model.processa_numeros import posicao_do_maior
class PainelPosicaoDoMaior(PainelAbstrato):
def __init__(self):
super().__init__('Posição do Maior Número')
def interaja(self):
numeros = self._leiaints()
posicao = posicao... | true | true |
1c261915c95ee723309d5ba6841cb5853f610bc2 | 3,439 | py | Python | arg_mine/data/download_gdelt_climate_en.py | mpesavento/arg-mine | 8f689a0298233248f08ee0e6f69e1c58eda6e453 | [
"MIT"
] | 2 | 2020-06-11T20:10:51.000Z | 2020-07-24T20:09:30.000Z | arg_mine/data/download_gdelt_climate_en.py | mpesavento/arg-mine | 8f689a0298233248f08ee0e6f69e1c58eda6e453 | [
"MIT"
] | null | null | null | arg_mine/data/download_gdelt_climate_en.py | mpesavento/arg-mine | 8f689a0298233248f08ee0e6f69e1c58eda6e453 | [
"MIT"
] | null | null | null | """
.. _download_gdelt_climate_en:
"""
import os
import requests
import zipfile
import logging
from dotenv import find_dotenv, load_dotenv
from arg_mine import PROJECT_DIR
from arg_mine.utils import LOG_FMT, get_logger
_logger = get_logger(__name__, logging.DEBUG)
# URL taken from https://blog.gdeltproject.org/a-ne... | 30.705357 | 184 | 0.674324 | import os
import requests
import zipfile
import logging
from dotenv import find_dotenv, load_dotenv
from arg_mine import PROJECT_DIR
from arg_mine.utils import LOG_FMT, get_logger
_logger = get_logger(__name__, logging.DEBUG)
T = "http://data.gdeltproject.org/blog/2020-climate-change-narrative/WebNewsEnglishSnippet... | true | true |
1c2619981199d0b0eb687149520029f838e62472 | 19,131 | py | Python | jasmin/routing/test/test_jasminApi.py | balsagoth/jasmin | 53d55f6af8c0d5faca51849e5953452a0dd93452 | [
"Apache-2.0"
] | null | null | null | jasmin/routing/test/test_jasminApi.py | balsagoth/jasmin | 53d55f6af8c0d5faca51849e5953452a0dd93452 | [
"Apache-2.0"
] | null | null | null | jasmin/routing/test/test_jasminApi.py | balsagoth/jasmin | 53d55f6af8c0d5faca51849e5953452a0dd93452 | [
"Apache-2.0"
] | null | null | null | #pylint: disable=W0401,W0611
import re
from twisted.trial.unittest import TestCase
from jasmin.routing import jasminApi
from jasmin.routing.jasminApi import *
class GroupTestCase(TestCase):
def test_normal(self):
g = Group('GID')
self.assertEqual(g.gid, 'GID')
self.assertEqual(str(g), st... | 45.658711 | 118 | 0.672521 |
import re
from twisted.trial.unittest import TestCase
from jasmin.routing import jasminApi
from jasmin.routing.jasminApi import *
class GroupTestCase(TestCase):
def test_normal(self):
g = Group('GID')
self.assertEqual(g.gid, 'GID')
self.assertEqual(str(g), str(g.gid))
def test_is_e... | true | true |
1c261a25ecf9f427f2317f05275503f7e50d0753 | 6,093 | py | Python | NeumannOptimizerNumpy.py | jay-z007/neumann-optimizer | c931631346a1097d198983684d7c68d91ae82d39 | [
"MIT"
] | 10 | 2018-10-25T04:37:30.000Z | 2019-03-08T15:05:27.000Z | NeumannOptimizerNumpy.py | jay-z007/neumann-optimizer | c931631346a1097d198983684d7c68d91ae82d39 | [
"MIT"
] | null | null | null | NeumannOptimizerNumpy.py | jay-z007/neumann-optimizer | c931631346a1097d198983684d7c68d91ae82d39 | [
"MIT"
] | 3 | 2018-05-07T19:08:57.000Z | 2019-09-04T06:22:11.000Z | import numpy as np
import time
from math import exp
import matplotlib.pyplot as plt
def gradient_descent( func, initial_x, eps=1e-5, maximum_iterations=65536, learning_rate=1e-2 ):
"""
Gradient Descent
func: the function to optimize It is called as "value, gradient = func( x, 1 )
initial_... | 32.409574 | 128 | 0.592811 | import numpy as np
import time
from math import exp
import matplotlib.pyplot as plt
def gradient_descent( func, initial_x, eps=1e-5, maximum_iterations=65536, learning_rate=1e-2 ):
if eps <= 0:
raise ValueError("Epsilon must be positive")
x = np.matrix(initial_x)
values = []
runtimes = [... | true | true |
1c261a871ff20e6af03aa235aa99df2213287eb7 | 362 | py | Python | tests/unit/models_secrets_test.py | kennylajara/docker-py | a48a5a9647761406d66e8271f19fab7fa0c5f582 | [
"Apache-2.0"
] | 5,611 | 2015-01-02T16:46:16.000Z | 2022-03-31T21:49:58.000Z | tests/unit/models_secrets_test.py | sdrees/docker-py | 8595cca8186b5d53c04ef71a1a3db86b7c53b012 | [
"Apache-2.0"
] | 2,176 | 2015-01-01T00:57:56.000Z | 2022-03-31T13:21:54.000Z | tests/unit/models_secrets_test.py | sdrees/docker-py | 8595cca8186b5d53c04ef71a1a3db86b7c53b012 | [
"Apache-2.0"
] | 1,774 | 2015-01-05T12:49:03.000Z | 2022-03-29T13:27:47.000Z | import unittest
from .fake_api_client import make_fake_client
from .fake_api import FAKE_SECRET_NAME
class CreateServiceTest(unittest.TestCase):
def test_secrets_repr(self):
client = make_fake_client()
secret = client.secrets.create(name="super_secret", data="secret")
assert secret.__repr... | 30.166667 | 74 | 0.737569 | import unittest
from .fake_api_client import make_fake_client
from .fake_api import FAKE_SECRET_NAME
class CreateServiceTest(unittest.TestCase):
def test_secrets_repr(self):
client = make_fake_client()
secret = client.secrets.create(name="super_secret", data="secret")
assert secret.__repr... | true | true |
1c261b0e458a4df0c5c6b77296408c96b78082c7 | 287 | py | Python | app.py | nikitcha/ceebios-biowser | d416a026d14dc410f5d1e48190f8a6ba74e97998 | [
"MIT"
] | null | null | null | app.py | nikitcha/ceebios-biowser | d416a026d14dc410f5d1e48190f8a6ba74e97998 | [
"MIT"
] | null | null | null | app.py | nikitcha/ceebios-biowser | d416a026d14dc410f5d1e48190f8a6ba74e97998 | [
"MIT"
] | null | null | null | import dash
import dash_bootstrap_components as dbc
import flask
app = dash.Dash(__name__,
title='Ceebios Biowser',
suppress_callback_exceptions=True,
#external_stylesheets=[dbc.themes.BOOTSTRAP]
)
server = app.server
| 23.916667 | 60 | 0.627178 | import dash
import dash_bootstrap_components as dbc
import flask
app = dash.Dash(__name__,
title='Ceebios Biowser',
suppress_callback_exceptions=True,
)
server = app.server
| true | true |
1c261b27d1e1955d20b1b00a6723c0327d7a3330 | 1,470 | py | Python | gitee/handler.py | Jiangxinz/Paddle-bot | 87a1c381f2ca6a31d5bf665945625f6710f5292e | [
"Apache-2.0"
] | 14 | 2020-05-15T01:24:22.000Z | 2022-02-23T09:03:50.000Z | gitee/handler.py | Jiangxinz/Paddle-bot | 87a1c381f2ca6a31d5bf665945625f6710f5292e | [
"Apache-2.0"
] | 18 | 2020-05-06T09:45:31.000Z | 2021-12-29T13:00:51.000Z | gitee/handler.py | Jiangxinz/Paddle-bot | 87a1c381f2ca6a31d5bf665945625f6710f5292e | [
"Apache-2.0"
] | 11 | 2020-04-28T11:17:00.000Z | 2022-02-14T01:43:27.000Z | import requests
import logging
logging.basicConfig(
level=logging.INFO,
filename='./logs/pr.log',
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
class GiteePROperation():
def __init__(self):
self.prUrl = 'https://gitee.com/api/v5/repos/{own... | 29.4 | 74 | 0.54966 | import requests
import logging
logging.basicConfig(
level=logging.INFO,
filename='./logs/pr.log',
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
class GiteePROperation():
def __init__(self):
self.prUrl = 'https://gitee.com/api/v5/repos/{own... | true | true |
1c261c28d7ec5bceecb9dac6ef2faee8cae1e631 | 7,792 | py | Python | release/stubs.min/System/Windows/Forms/__init___parts/ToolStripPanelRow.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/ToolStripPanelRow.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/ToolStripPanelRow.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | class ToolStripPanelRow(Component,IComponent,IDisposable,IArrangedElement):
"""
Represents a row of a System.Windows.Forms.ToolStripPanel that can contain controls.
ToolStripPanelRow(parent: ToolStripPanel)
"""
def Instance(self):
""" This function has been arbitrarily put into the stubs"""
return ... | 40.373057 | 402 | 0.737936 | class ToolStripPanelRow(Component,IComponent,IDisposable,IArrangedElement):
return ToolStripPanelRow()
def CanMove(self,toolStripToDrag):
"""
CanMove(self: ToolStripPanelRow,toolStripToDrag: ToolStrip) -> bool
"""
pass
pass
def MemberwiseClone(self,*args):
def OnBoundsChanged(self,*args):
""... | true | true |
1c261d3bde9c35e2dbce9f28015b4595e8ebf102 | 5,477 | py | Python | tests/unittest/test_documents.py | 0x20bf-org/tor | 3b1443826d12d4956afd08a3febce0ce0dd087ef | [
"Apache-2.0"
] | null | null | null | tests/unittest/test_documents.py | 0x20bf-org/tor | 3b1443826d12d4956afd08a3febce0ce0dd087ef | [
"Apache-2.0"
] | null | null | null | tests/unittest/test_documents.py | 0x20bf-org/tor | 3b1443826d12d4956afd08a3febce0ce0dd087ef | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 James Brown
#
# 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 in writing, ... | 30.769663 | 88 | 0.650721 |
import datetime
import json
import os
from enum import Enum
from functools import reduce
from operator import ior
import pytest
from torpy.documents.basics import TorDocumentObject
from torpy.documents.dir_key_certificate import DirKeyCertificate, DirKeyCertificateList
from torpy.documents.network_statu... | true | true |
1c261d5ec3e07c54ca10bf396399d886d6f93415 | 7,812 | py | Python | homeassistant/components/influxdb.py | jamescurtin/home-assistant | 6a9968ccb9b0082f5629e50955549d432aba7d90 | [
"Apache-2.0"
] | 2 | 2020-02-20T18:47:55.000Z | 2021-11-09T11:33:28.000Z | homeassistant/components/influxdb.py | moose51789/home-assistant | 63c9d59d5455850fd4b37c2475fe6f10effb5245 | [
"Apache-2.0"
] | 1 | 2021-02-08T20:56:06.000Z | 2021-02-08T20:56:06.000Z | homeassistant/components/influxdb.py | moose51789/home-assistant | 63c9d59d5455850fd4b37c2475fe6f10effb5245 | [
"Apache-2.0"
] | 1 | 2019-09-15T04:45:12.000Z | 2019-09-15T04:45:12.000Z | """
A component which allows you to send data to an Influx database.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/influxdb/
"""
import logging
import re
import voluptuous as vol
from homeassistant.const import (
EVENT_STATE_CHANGED, STATE_UNAVA... | 37.023697 | 78 | 0.620456 | import logging
import re
import voluptuous as vol
from homeassistant.const import (
EVENT_STATE_CHANGED, STATE_UNAVAILABLE, STATE_UNKNOWN, CONF_HOST,
CONF_PORT, CONF_SSL, CONF_VERIFY_SSL, CONF_USERNAME, CONF_PASSWORD,
CONF_EXCLUDE, CONF_INCLUDE, CONF_DOMAINS, CONF_ENTITIES)
from homeassistant.helpers imp... | true | true |
1c261de7eba1d718ae08365112f3fe9ba3144b7e | 744 | py | Python | telegram_bot.py | GJvignesh/topgear_sentiment_analysis | 92834f0a5ad0e658208c0ea088683bffc46b844e | [
"Apache-2.0"
] | null | null | null | telegram_bot.py | GJvignesh/topgear_sentiment_analysis | 92834f0a5ad0e658208c0ea088683bffc46b844e | [
"Apache-2.0"
] | null | null | null | telegram_bot.py | GJvignesh/topgear_sentiment_analysis | 92834f0a5ad0e658208c0ea088683bffc46b844e | [
"Apache-2.0"
] | null | null | null | # from knockknock import telegram_sender
import requests
def telegram_bot_sendtext(bot_message):
# Bot Name: ml_contest_bot
# Group Name: Machine_learning_contest
# bot_token = '862315976:AAE1Vzu9L5J1liCNrrCVnWdNTS4vGKvRZww'
# bot_chatID = '-324127062'
bot_message_str = str(bot_message)
bot_t... | 33.818182 | 146 | 0.752688 |
import requests
def telegram_bot_sendtext(bot_message):
bot_message_str = str(bot_message)
bot_token = '862315976:AAE1Vzu9L5J1liCNrrCVnWdNTS4vGKvRZww'
bot_chatID = '-324127062'
send_text = 'https://api.telegram.org/bot' + bot_token + '/sendMessage?chat_id=' + bot_chatID + '&parse... | true | true |
1c261e44272b37d56e72c2f5e302a80f938ea4b7 | 1,009 | py | Python | PythonEdition/210_findOrder.py | cxiaolong/Algorithm-Practice | 6f3d3f4b14a3fc170a3dc47b2ab24f8e37cb941c | [
"MIT"
] | null | null | null | PythonEdition/210_findOrder.py | cxiaolong/Algorithm-Practice | 6f3d3f4b14a3fc170a3dc47b2ab24f8e37cb941c | [
"MIT"
] | null | null | null | PythonEdition/210_findOrder.py | cxiaolong/Algorithm-Practice | 6f3d3f4b14a3fc170a3dc47b2ab24f8e37cb941c | [
"MIT"
] | null | null | null | from typing import List
# 广度优先搜索
class Solution:
def canOrder(self, numCourses: int, prerequisites: List[List[int]]) -> bool:
# 存储有向图
edges = {}
# 存储每个节点的入度
indeg = [0] * numCourses
# 存储答案
result = []
for info in prerequisites:
edges[info[1]] = ... | 24.02381 | 80 | 0.470763 | from typing import List
class Solution:
def canOrder(self, numCourses: int, prerequisites: List[List[int]]) -> bool:
edges = {}
indeg = [0] * numCourses
result = []
for info in prerequisites:
edges[info[1]] = info[0]
indeg[info[0... | true | true |
1c261e44c9e0fc80ee03e887d028cc085548bf24 | 987 | py | Python | src/rogerthat/exceptions/app.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | src/rogerthat/exceptions/app.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | src/rogerthat/exceptions/app.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... | 35.25 | 77 | 0.74772 |
from __future__ import unicode_literals
from rogerthat.rpc.service import BusinessException
class DuplicateAppIdException(BusinessException):
def __init__(self, app_id):
self.app_id = app_id
message = 'There already exists an app with app id {}'.format(app_id)
super(Dupli... | true | true |
1c261e7827b14f47b8c24300694dca067b2dbb4d | 7,537 | py | Python | pytorch_lightning/accelerators/base_accelerator.py | RafaelGoncalves8/pytorch-lightning | 7285613974bb3f87c9cde4bd6ddd074d0769ef82 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/accelerators/base_accelerator.py | RafaelGoncalves8/pytorch-lightning | 7285613974bb3f87c9cde4bd6ddd074d0769ef82 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/accelerators/base_accelerator.py | RafaelGoncalves8/pytorch-lightning | 7285613974bb3f87c9cde4bd6ddd074d0769ef82 | [
"Apache-2.0"
] | null | null | null | import os
import math
from enum import Enum
from typing import Any
import torch
from pytorch_lightning.utilities import AMPType, rank_zero_warn
from pytorch_lightning.utilities.apply_func import move_data_to_device
from pytorch_lightning.utilities.exceptions import MisconfigurationException
from pytorch_lightning.uti... | 33.798206 | 103 | 0.646411 | import os
import math
from enum import Enum
from typing import Any
import torch
from pytorch_lightning.utilities import AMPType, rank_zero_warn
from pytorch_lightning.utilities.apply_func import move_data_to_device
from pytorch_lightning.utilities.exceptions import MisconfigurationException
from pytorch_lightning.uti... | true | true |
1c261f323dac71408755305ef3fa4466bfe1b55d | 514 | py | Python | DungeonAPI/blueprints/users_blueprint.py | Organization-for-CS-Build-Week-1/CS-Build-Week-1-Flask | 32ee1b7d343fa8e0e7abe2e625cf7978796b07b0 | [
"MIT"
] | null | null | null | DungeonAPI/blueprints/users_blueprint.py | Organization-for-CS-Build-Week-1/CS-Build-Week-1-Flask | 32ee1b7d343fa8e0e7abe2e625cf7978796b07b0 | [
"MIT"
] | 3 | 2020-04-27T20:56:45.000Z | 2020-04-29T15:55:29.000Z | DungeonAPI/blueprints/users_blueprint.py | Organization-for-CS-Build-Week-1/CS-Build-Week-1-Flask | 32ee1b7d343fa8e0e7abe2e625cf7978796b07b0 | [
"MIT"
] | 1 | 2021-08-31T19:25:00.000Z | 2021-08-31T19:25:00.000Z | from flask import Blueprint, jsonify
from ..models import Users
from .middleware import admin_only
blueprint = Blueprint('users', __name__, url_prefix="/api/models/users")
@blueprint.route('/', methods=['GET'])
@admin_only
def get_all():
users = Users.query.all()
return jsonify([user.serialize() for user in ... | 25.7 | 72 | 0.715953 | from flask import Blueprint, jsonify
from ..models import Users
from .middleware import admin_only
blueprint = Blueprint('users', __name__, url_prefix="/api/models/users")
@blueprint.route('/', methods=['GET'])
@admin_only
def get_all():
users = Users.query.all()
return jsonify([user.serialize() for user in ... | true | true |
1c2620c6cff3a208b85f99aa6840c06917ee993c | 138 | py | Python | project/teams/admin.py | NoobLucifer/NSP | f411570924905f1bf3c39fa36b5949e5b9e37c0a | [
"MIT"
] | 20 | 2018-08-02T15:10:30.000Z | 2019-05-15T14:38:06.000Z | project/teams/admin.py | nk521/NSP | ecffc873fbfe3471ed320f0698adca4e8c573ab5 | [
"MIT"
] | 55 | 2018-06-19T04:31:56.000Z | 2018-07-19T17:42:00.000Z | project/teams/admin.py | nk521/NSP | ecffc873fbfe3471ed320f0698adca4e8c573ab5 | [
"MIT"
] | 10 | 2018-08-03T10:42:16.000Z | 2019-01-31T10:07:57.000Z | from django.contrib import admin
from .models import *
# Register your models here.
admin.site.register(Team)
admin.site.register(Member) | 23 | 32 | 0.797101 | from django.contrib import admin
from .models import *
admin.site.register(Team)
admin.site.register(Member) | true | true |
1c2620ed7c044fe97a53bf4dd2af283cd6ee30e0 | 1,162 | py | Python | alembic/versions/00032_5aa994117f07_.py | awesome-archive/ReadableWebProxy | 360104694a21bc14c7756f29205c95823387e30b | [
"BSD-3-Clause"
] | 193 | 2016-08-02T22:04:35.000Z | 2022-03-09T20:45:41.000Z | alembic/versions/00032_5aa994117f07_.py | awesome-archive/ReadableWebProxy | 360104694a21bc14c7756f29205c95823387e30b | [
"BSD-3-Clause"
] | 533 | 2016-08-23T20:48:23.000Z | 2022-03-28T15:55:13.000Z | alembic/versions/00032_5aa994117f07_.py | awesome-archive/ReadableWebProxy | 360104694a21bc14c7756f29205c95823387e30b | [
"BSD-3-Clause"
] | 19 | 2015-08-13T18:01:08.000Z | 2021-07-12T17:13:09.000Z | """empty message
Revision ID: 5aa994117f07
Revises: 85a1c0888f3d
Create Date: 2017-09-28 04:03:38.834496
"""
# revision identifiers, used by Alembic.
revision = '5aa994117f07'
down_revision = '85a1c0888f3d'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy_utils.... | 26.409091 | 94 | 0.773666 |
revision = '5aa994117f07'
down_revision = '85a1c0888f3d'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy_utils.types import TSVectorType
from sqlalchemy_searchable import make_searchable
import sqlalchemy_utils
from sqlalchemy.dialects.postgresql.base import i... | true | true |
1c2621d3efecd97a37f3c49d7ecd220c624ad458 | 2,238 | py | Python | share/scripts/inverse/configuration_compare.py | Pallavi-Banerjee21/votca.csg | d88977b0bec6159b567871d8901f990120a6f2e4 | [
"Apache-2.0"
] | null | null | null | share/scripts/inverse/configuration_compare.py | Pallavi-Banerjee21/votca.csg | d88977b0bec6159b567871d8901f990120a6f2e4 | [
"Apache-2.0"
] | null | null | null | share/scripts/inverse/configuration_compare.py | Pallavi-Banerjee21/votca.csg | d88977b0bec6159b567871d8901f990120a6f2e4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
#
# Copyright 2009-2011 The VOTCA Development Team (http://www.votca.org)
#
# 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... | 29.84 | 94 | 0.672029 |
from optparse import OptionParser
usage = "usage: %prog [options] conf1 conf2"
parser = OptionParser(usage=usage)
parser.add_option("--eps", dest="eps", metavar="EPS",
help="tolerance for mismatch", default=1e-2)
(options, args) = parser.parse_args()
def die(s... | false | true |
1c2621fd61d60b58ed07e1c7bf5cce977eede08f | 921 | py | Python | quotes.py | JVacation/Project | abe1c61b45a88a4c84143d64d07566102554a410 | [
"MIT"
] | null | null | null | quotes.py | JVacation/Project | abe1c61b45a88a4c84143d64d07566102554a410 | [
"MIT"
] | 5 | 2021-02-08T20:45:12.000Z | 2022-03-12T00:29:48.000Z | quotes.py | JVacation/Project | abe1c61b45a88a4c84143d64d07566102554a410 | [
"MIT"
] | null | null | null | from tkinter import *
import requests,json,traceback,feedparser
from PIL import Image, ImageTk
import random
news_country_code = 'gb'
weather_api_token = '<TOKEN>' # create account at https://darksky.net/dev/
xlarge_text_size = 94
large_text_size = 48
medium_text_size = 28
small_text_size = 18
class Quotes(Frame):
... | 32.892857 | 106 | 0.67861 | from tkinter import *
import requests,json,traceback,feedparser
from PIL import Image, ImageTk
import random
news_country_code = 'gb'
weather_api_token = '<TOKEN>'
xlarge_text_size = 94
large_text_size = 48
medium_text_size = 28
small_text_size = 18
class Quotes(Frame):
def __init__(self, parent, *args, **kwarg... | true | true |
1c262235dbcf371a90f5b8c58a665eac3c3e138e | 33,212 | py | Python | tests/notice_build_tests.py | cfpb/regulations-parser | 9b6e1ab2dbec93a915eb6da9a2d88c723b9ac424 | [
"CC0-1.0"
] | 36 | 2015-01-05T21:17:36.000Z | 2020-04-28T21:02:55.000Z | tests/notice_build_tests.py | DalavanCloud/regulations-parser | 9b6e1ab2dbec93a915eb6da9a2d88c723b9ac424 | [
"CC0-1.0"
] | 49 | 2015-01-28T15:54:25.000Z | 2018-08-20T20:20:08.000Z | tests/notice_build_tests.py | DalavanCloud/regulations-parser | 9b6e1ab2dbec93a915eb6da9a2d88c723b9ac424 | [
"CC0-1.0"
] | 23 | 2015-01-28T15:34:18.000Z | 2021-02-20T10:53:34.000Z | # vim: set encoding=utf-8
import os
import shutil
import tempfile
from unittest import TestCase
from lxml import etree
from regparser.notice import build, changes
from regparser.notice.diff import DesignateAmendment, Amendment
from regparser.tree.struct import Node
import settings
class NoticeBuildTest(TestCase):
... | 37.870011 | 79 | 0.507106 |
import os
import shutil
import tempfile
from unittest import TestCase
from lxml import etree
from regparser.notice import build, changes
from regparser.notice.diff import DesignateAmendment, Amendment
from regparser.tree.struct import Node
import settings
class NoticeBuildTest(TestCase):
def setUp(self):
... | true | true |
1c26229c6d2f4cf5b09aa7f716fcf3c7139995f1 | 5,549 | py | Python | tools/tensorpack/examples/cifar-convnet.py | laceyg/ternarynet | b17744c2aba3aba7e7e72decb3b8a02792d33b54 | [
"Apache-2.0"
] | 2 | 2017-03-16T17:16:37.000Z | 2020-07-17T04:27:45.000Z | tools/tensorpack/examples/cifar-convnet.py | laceyg/ternarynet | b17744c2aba3aba7e7e72decb3b8a02792d33b54 | [
"Apache-2.0"
] | null | null | null | tools/tensorpack/examples/cifar-convnet.py | laceyg/ternarynet | b17744c2aba3aba7e7e72decb3b8a02792d33b54 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# File: cifar-convnet.py
# Author: Yuxin Wu <ppwwyyxxc@gmail.com>
import tensorflow as tf
import argparse
import numpy as np
import os
from tensorpack import *
import tensorpack.tfutils.symbolic_functions as symbf
from tensorpack.tfutils.summary import *
from tensorpack.ut... | 34.899371 | 92 | 0.599748 |
import tensorflow as tf
import argparse
import numpy as np
import os
from tensorpack import *
import tensorpack.tfutils.symbolic_functions as symbf
from tensorpack.tfutils.summary import *
from tensorpack.utils.gpu import get_nr_gpu
class Model(ModelDesc):
def __init__(self, cifar_classnum):
super(Mo... | true | true |
1c2623d238b3de2bae87d9eae327584f97cd5fb9 | 6,341 | py | Python | tools/mkblocks.py | Commodore-Bench/u5remastered | 02c7ed86055e368b97d3c3c5ca26622782bd564d | [
"Apache-2.0"
] | 14 | 2020-02-07T06:55:40.000Z | 2022-01-15T19:54:00.000Z | tools/mkblocks.py | Commodore-Bench/u5remastered | 02c7ed86055e368b97d3c3c5ca26622782bd564d | [
"Apache-2.0"
] | 1 | 2021-11-21T23:06:24.000Z | 2021-11-21T23:06:24.000Z | tools/mkblocks.py | Commodore-Bench/u5remastered | 02c7ed86055e368b97d3c3c5ca26622782bd564d | [
"Apache-2.0"
] | 3 | 2020-02-22T13:48:18.000Z | 2021-04-06T17:09:43.000Z | #!/usr/bin/env python3
# ----------------------------------------------------------------------------
# Copyright 2019 Drunella
#
# 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:/... | 32.352041 | 109 | 0.598171 |
import os
import sys
import glob
import subprocess
import argparse
import hashlib
import traceback
import pprint
def readblockmap_info(filename):
directory = dict()
with open(filename) as f:
result = [line.split() for line in f]
for l in result:
directory[l[0]] = ... | true | true |
1c2623f0e721c7aede2c4c891a1b5c81ed24eb72 | 325 | py | Python | 6 kyu/Ternary Logic.py | mwk0408/codewars_solutions | 9b4f502b5f159e68024d494e19a96a226acad5e5 | [
"MIT"
] | 6 | 2020-09-03T09:32:25.000Z | 2020-12-07T04:10:01.000Z | 6 kyu/Ternary Logic.py | mwk0408/codewars_solutions | 9b4f502b5f159e68024d494e19a96a226acad5e5 | [
"MIT"
] | 1 | 2021-12-13T15:30:21.000Z | 2021-12-13T15:30:21.000Z | 6 kyu/Ternary Logic.py | mwk0408/codewars_solutions | 9b4f502b5f159e68024d494e19a96a226acad5e5 | [
"MIT"
] | null | null | null | from itertools import zip_longest
def ternary(a, c):
res=[]
for power,(i, j) in enumerate(zip_longest(transform(a), transform(c), fillvalue=0)):
res.append(str((j-i)%3))
return int("".join(res[::-1]) or "0", 3)
def transform(n):
res=[]
while n:
res.append(n%3)
n//=3
retur... | 27.083333 | 88 | 0.575385 | from itertools import zip_longest
def ternary(a, c):
res=[]
for power,(i, j) in enumerate(zip_longest(transform(a), transform(c), fillvalue=0)):
res.append(str((j-i)%3))
return int("".join(res[::-1]) or "0", 3)
def transform(n):
res=[]
while n:
res.append(n%3)
n//=3
retur... | true | true |
1c2624075bf711b41698fd316ae7337a73aeffa3 | 46,172 | py | Python | ocbind/interfaces/interface/subinterfaces/subinterface/ipv6/config/__init__.py | SeanCondon/onos-config-demo | 0789d397b46fd5cda512ae7fffe35e1a4bfdfdbe | [
"Apache-2.0"
] | 1 | 2019-08-01T17:42:57.000Z | 2019-08-01T17:42:57.000Z | ocbind/interfaces/interface/subinterfaces/subinterface/ipv6/config/__init__.py | SeanCondon/onos-config-demo | 0789d397b46fd5cda512ae7fffe35e1a4bfdfdbe | [
"Apache-2.0"
] | 1 | 2021-05-26T16:38:04.000Z | 2021-05-26T16:38:04.000Z | ocbind/interfaces/interface/subinterfaces/subinterface/ipv6/config/__init__.py | SeanCondon/onos-config-demo | 0789d397b46fd5cda512ae7fffe35e1a4bfdfdbe | [
"Apache-2.0"
] | 4 | 2019-07-24T16:52:39.000Z | 2021-12-03T02:08:13.000Z | # -*- coding: utf-8 -*-
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBoo... | 59.885863 | 534 | 0.744239 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.ya... | true | true |
1c26248c9cf1b1d77b6c707e945c9ef088cf3407 | 149 | py | Python | ErrorDefine.py | Wenqi-Zhu/Wavedance | 039566360970581e70eabdce7410403cf88a8c20 | [
"MIT"
] | 1 | 2020-01-15T14:16:39.000Z | 2020-01-15T14:16:39.000Z | ErrorDefine.py | Wenqi-Zhu/Wavedance | 039566360970581e70eabdce7410403cf88a8c20 | [
"MIT"
] | null | null | null | ErrorDefine.py | Wenqi-Zhu/Wavedance | 039566360970581e70eabdce7410403cf88a8c20 | [
"MIT"
] | null | null | null | class SimulatorError(Exception):
pass
class ConvergenceError(Exception):
pass
class CircuitParameterError(Exception):
pass
| 13.545455 | 40 | 0.704698 | class SimulatorError(Exception):
pass
class ConvergenceError(Exception):
pass
class CircuitParameterError(Exception):
pass
| true | true |
1c2626b02415e3a8e0ebcbf75d9817b3786a260a | 2,503 | py | Python | GPy_regression_demo.py | nrjl/GPN | c7bd98d69e075ef05bcb2a443c02a71a916a71f4 | [
"MIT"
] | null | null | null | GPy_regression_demo.py | nrjl/GPN | c7bd98d69e075ef05bcb2a443c02a71a916a71f4 | [
"MIT"
] | null | null | null | GPy_regression_demo.py | nrjl/GPN | c7bd98d69e075ef05bcb2a443c02a71a916a71f4 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
#from matplotlib.collections import PatchCollection
import nice_plot_colors as npc
import GPy
plt.rc('font',**{'family':'serif','sans-serif':['Computer Modern Roman']})
plt.rc('text', usetex=True)
np.random.seed(1)
noise = 0.2
n... | 30.156627 | 135 | 0.681183 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
import nice_plot_colors as npc
import GPy
plt.rc('font',**{'family':'serif','sans-serif':['Computer Modern Roman']})
plt.rc('text', usetex=True)
np.random.seed(1)
noise = 0.2
n_training = 8
opt_hyper = False
gp_l = 0.02
gp_var... | true | true |
1c2626f066ff41119a1df54786bbe95a9c2d3be1 | 986 | py | Python | test/common/methods.py | ga4gh/refget-cloud | c39a65acba9818414789f004cced487562012bf0 | [
"Apache-2.0"
] | null | null | null | test/common/methods.py | ga4gh/refget-cloud | c39a65acba9818414789f004cced487562012bf0 | [
"Apache-2.0"
] | 3 | 2021-04-30T21:12:42.000Z | 2021-06-02T02:11:45.000Z | test/common/methods.py | ga4gh/refget-cloud | c39a65acba9818414789f004cced487562012bf0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Common helper functions for testing"""
from ga4gh.refget.config.properties import Properties
from ga4gh.refget.http.request import Request
from ga4gh.refget.http.response import Response
def setup_properties(props_dict):
return Properties(props_dict)
def setup_request(request_dict):
... | 30.8125 | 64 | 0.663286 |
from ga4gh.refget.config.properties import Properties
from ga4gh.refget.http.request import Request
from ga4gh.refget.http.response import Response
def setup_properties(props_dict):
return Properties(props_dict)
def setup_request(request_dict):
request = Request()
info = [
{"method": request.add... | true | true |
1c2626f63e570d853ca242bacfb7123968dcd114 | 825 | py | Python | code/Herencia.py | Koki-Orba/Learn | b8c9285b52fa73c8b801eae27a41cc86be1421bd | [
"MIT"
] | null | null | null | code/Herencia.py | Koki-Orba/Learn | b8c9285b52fa73c8b801eae27a41cc86be1421bd | [
"MIT"
] | null | null | null | code/Herencia.py | Koki-Orba/Learn | b8c9285b52fa73c8b801eae27a41cc86be1421bd | [
"MIT"
] | null | null | null | # ejemplo de herencia
class pokemon: #clase superior (padre)
pass
def __init__(self, nombre, tipo):
#vamos a declarar los atributos
self.nombre = nombre
self.tipo = tipo
def descripcion(self):
return "{} es un pokemon de tipo {}".format(self.nombre, self.tipo)
class pikachu... | 34.375 | 98 | 0.692121 |
class pokemon:
pass
def __init__(self, nombre, tipo):
self.nombre = nombre
self.tipo = tipo
def descripcion(self):
return "{} es un pokemon de tipo {}".format(self.nombre, self.tipo)
class pikachu(pokemon):
def ataque(self, tipo_ataque):
return "{} tipo de a... | true | true |
1c26271f8f09ece30089f61b8b5a57556aaa5b20 | 6,853 | py | Python | mainapp/views/meeting.py | stv0g/meine-stadt-transparent | 059f7d25c5d11f476a8856928bed389f529f8546 | [
"MIT"
] | 34 | 2017-10-04T14:20:41.000Z | 2022-03-11T18:06:48.000Z | mainapp/views/meeting.py | stv0g/meine-stadt-transparent | 059f7d25c5d11f476a8856928bed389f529f8546 | [
"MIT"
] | 588 | 2017-10-14T18:31:17.000Z | 2022-03-16T13:00:30.000Z | mainapp/views/meeting.py | codeformuenster/meine-stadt-transparent | 1458bc6acad40183908e2b7cc98ef92165d1123a | [
"MIT"
] | 11 | 2017-11-27T10:12:59.000Z | 2022-02-09T10:27:11.000Z | import json
from datetime import date
from typing import List
import dateutil.parser
from dateutil.relativedelta import relativedelta
from django.conf import settings
from django.db.models import Count
from django.http import JsonResponse, HttpResponse
from django.shortcuts import render, get_object_or_404
from django... | 35.324742 | 118 | 0.686561 | import json
from datetime import date
from typing import List
import dateutil.parser
from dateutil.relativedelta import relativedelta
from django.conf import settings
from django.db.models import Count
from django.http import JsonResponse, HttpResponse
from django.shortcuts import render, get_object_or_404
from django... | true | true |
1c262798be1e02d2fcaf1d47232a96b775cf738f | 4,028 | py | Python | kws_streaming/models/svdf.py | SachitNayak/google-research | 2893b06a7a60f243be22a06f975f1eb85702d0fa | [
"Apache-2.0"
] | 1 | 2020-11-25T09:11:13.000Z | 2020-11-25T09:11:13.000Z | kws_streaming/models/svdf.py | SachitNayak/google-research | 2893b06a7a60f243be22a06f975f1eb85702d0fa | [
"Apache-2.0"
] | 15 | 2020-09-25T22:39:40.000Z | 2022-02-10T02:11:48.000Z | kws_streaming/models/svdf.py | SachitNayak/google-research | 2893b06a7a60f243be22a06f975f1eb85702d0fa | [
"Apache-2.0"
] | 2 | 2020-08-29T08:58:30.000Z | 2021-08-29T09:59:34.000Z | # coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# 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 applicab... | 30.515152 | 78 | 0.67577 |
from kws_streaming.layers import modes
from kws_streaming.layers import speech_features
from kws_streaming.layers import svdf
from kws_streaming.layers.compat import tf
from kws_streaming.layers.stream import Stream
from kws_streaming.models.utils import parse
def model_parameters(parser_nn):
parser... | true | true |
1c262798ef0ccd5b4443db834625c2d6f8b2099a | 4,081 | py | Python | savu/plugins/unregistered/i18_loaders/i18_mm_loader.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 39 | 2015-03-30T14:03:42.000Z | 2022-03-16T16:50:33.000Z | savu/plugins/unregistered/i18_loaders/i18_mm_loader.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 670 | 2015-02-11T11:08:09.000Z | 2022-03-21T09:27:57.000Z | savu/plugins/unregistered/i18_loaders/i18_mm_loader.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 54 | 2015-02-13T14:09:52.000Z | 2022-01-24T13:57:09.000Z | # Copyright 2014 Diamond Light Source Ltd.
#
# 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 t... | 36.765766 | 74 | 0.665523 |
import logging
from savu.plugins.loaders.base_loader import BaseLoader
from savu.plugins.unregistered.i18_loaders.base_i18_multi_modal_loader\
import BaseI18MultiModalLoader
from savu.plugins.unregistered.i18_loaders.i18_xrd_loader \
import I18XrdLoader as xrd
from savu.plugins.unregistered.i18_l... | true | true |
1c26288d8adbef21ec1a9d51e3b52527256e088e | 6,210 | py | Python | src/rogers/__main__.py | cylance/rogers | a2300ed518fa01e0f2fcb77f1c10f7124ea7f49a | [
"Apache-2.0"
] | 14 | 2018-03-22T14:55:30.000Z | 2021-01-08T07:23:14.000Z | src/rogers/__main__.py | cylance/rogers | a2300ed518fa01e0f2fcb77f1c10f7124ea7f49a | [
"Apache-2.0"
] | 1 | 2019-01-29T16:03:54.000Z | 2019-01-29T16:03:54.000Z | src/rogers/__main__.py | cylance/rogers | a2300ed518fa01e0f2fcb77f1c10f7124ea7f49a | [
"Apache-2.0"
] | 5 | 2019-01-06T21:58:42.000Z | 2021-12-07T12:02:53.000Z | """ Entry points for Rogers malware similarity tool
"""
from . import config
from . import store
from .index import Index
from .generated import Feature
from .sample import pe
from . import logger as l
from . import api
import argparse
import pandas as pd
log = l.get_logger('rogers')
INDEX_OPTIONS = Index.list_ava... | 34.88764 | 152 | 0.719968 | from . import config
from . import store
from .index import Index
from .generated import Feature
from .sample import pe
from . import logger as l
from . import api
import argparse
import pandas as pd
log = l.get_logger('rogers')
INDEX_OPTIONS = Index.list_available_index()
def _samples_from_args(args):
db = ... | true | true |
1c2628cab691e794b080909314621c4faaabbaa5 | 8,831 | py | Python | vixcoin_functions/feature_functions.py | paocarvajal1912/VIXM-Algorithmic-Strategy | acc8fa7cc735638f1605cd7a8785e01b499f5d58 | [
"MIT"
] | null | null | null | vixcoin_functions/feature_functions.py | paocarvajal1912/VIXM-Algorithmic-Strategy | acc8fa7cc735638f1605cd7a8785e01b499f5d58 | [
"MIT"
] | null | null | null | vixcoin_functions/feature_functions.py | paocarvajal1912/VIXM-Algorithmic-Strategy | acc8fa7cc735638f1605cd7a8785e01b499f5d58 | [
"MIT"
] | null | null | null | # Vixm Feature Functions
import pandas as pd
from arch import arch_model
import yfinance as yf
from datetime import datetime
import numpy as np
def garch_fit_and_predict(series, ticker, horizon=1, p=1, q=1, o=1, print_series_name=False):
#p=1,q=1, o=1
#series=returns_df['spy']
#horizon=1
"""
Thi... | 42.253589 | 148 | 0.688371 |
import pandas as pd
from arch import arch_model
import yfinance as yf
from datetime import datetime
import numpy as np
def garch_fit_and_predict(series, ticker, horizon=1, p=1, q=1, o=1, print_series_name=False):
series=series.dropna()
shock_skew_gm_model=arch_model(
seri... | true | true |
1c2629fd583598cee3584543ca1004a0e9a23497 | 798 | py | Python | qnarre.old/nn/gpt_2.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | qnarre.old/nn/gpt_2.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | qnarre.old/nn/gpt_2.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | # Copyright 2019 Quantapix 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 applicable l... | 46.941176 | 80 | 0.692982 | true | true | |
1c262a36d27b6022b6dc305585cf67b5b8a1f3bf | 21,605 | py | Python | klever/core/vtg/weaver/__init__.py | kirillyat/klever | 259cc1345df91a47bc028f813613f063a8465429 | [
"Apache-2.0"
] | 16 | 2018-07-14T15:37:02.000Z | 2020-07-11T14:26:59.000Z | klever/core/vtg/weaver/__init__.py | kirillyat/klever | 259cc1345df91a47bc028f813613f063a8465429 | [
"Apache-2.0"
] | 2 | 2019-10-28T22:32:31.000Z | 2020-04-24T09:24:20.000Z | klever/core/vtg/weaver/__init__.py | kirillyat/klever | 259cc1345df91a47bc028f813613f063a8465429 | [
"Apache-2.0"
] | 10 | 2018-11-09T12:54:15.000Z | 2021-10-31T17:01:39.000Z | #
# Copyright (c) 2019 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# 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
#
# h... | 51.07565 | 119 | 0.582874 |
import glob
import json
import multiprocessing
import os
import shutil
from clade import Clade
import klever.core.components
import klever.core.utils
import klever.core.vtg.utils
import klever.core.vtg.plugins
from klever.core.cross_refs import CrossRefs
class Weaver(klever.core.vtg.plugins.Plugin)... | true | true |
1c262b080104f8edad6e7ada7b3d2eec26ef99a7 | 9,104 | py | Python | rfvision/components/pose_heads/topdown_heatmap_simple_head_3d.py | tycoer/rfvision-1 | db6e28746d8251d1f394544c32b9e0af388d9964 | [
"Apache-2.0"
] | null | null | null | rfvision/components/pose_heads/topdown_heatmap_simple_head_3d.py | tycoer/rfvision-1 | db6e28746d8251d1f394544c32b9e0af388d9964 | [
"Apache-2.0"
] | null | null | null | rfvision/components/pose_heads/topdown_heatmap_simple_head_3d.py | tycoer/rfvision-1 | db6e28746d8251d1f394544c32b9e0af388d9964 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
import torch.nn as nn
from rfvision.components.pose_heads import Heatmap3DHead, Heatmap1DHead, MultilabelClassificationHead
from rfvision.core.evaluation_pose.top_down_eval import (
keypoints_from_heatmaps3d, multilabel_classification_a... | 39.582609 | 164 | 0.596112 |
import numpy as np
import torch
import torch.nn as nn
from rfvision.components.pose_heads import Heatmap3DHead, Heatmap1DHead, MultilabelClassificationHead
from rfvision.core.evaluation_pose.top_down_eval import (
keypoints_from_heatmaps3d, multilabel_classification_accuracy, pose_pck_accuracy)
from rfvision.core.... | true | true |
1c262c5500f9ecf3c9055f47393fa83307410e0f | 4,657 | py | Python | setup.py | Tirzono/teamcity-messages | e7f7334e2956a9e707222e4c83de9ffeb15b8ac0 | [
"Apache-2.0"
] | 105 | 2015-06-24T15:40:41.000Z | 2022-02-04T10:30:34.000Z | setup.py | Tirzono/teamcity-messages | e7f7334e2956a9e707222e4c83de9ffeb15b8ac0 | [
"Apache-2.0"
] | 145 | 2015-06-24T15:26:28.000Z | 2022-03-22T20:04:19.000Z | setup.py | Tirzono/teamcity-messages | e7f7334e2956a9e707222e4c83de9ffeb15b8ac0 | [
"Apache-2.0"
] | 76 | 2015-07-20T08:18:21.000Z | 2022-03-18T20:03:53.000Z | # coding=utf-8
import os
import re
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGELOG.txt')).read()
except IO... | 33.028369 | 130 | 0.644621 |
import os
import re
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGELOG.txt')).read()
except IOError:
REA... | true | true |
1c262ce384323c09164056da9f51f36e65b5aff6 | 4,786 | py | Python | SLV_script.py | gmiaslab/DifferentialNetworks | beaaef02e109bf4f4c78ff21147eae8b3108e889 | [
"MIT"
] | null | null | null | SLV_script.py | gmiaslab/DifferentialNetworks | beaaef02e109bf4f4c78ff21147eae8b3108e889 | [
"MIT"
] | null | null | null | SLV_script.py | gmiaslab/DifferentialNetworks | beaaef02e109bf4f4c78ff21147eae8b3108e889 | [
"MIT"
] | null | null | null | import matplotlib
matplotlib.use('agg')
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 8 09:31:31 2021
This script:
* Produces Saliva DN
* Performs reactome analysis
* Plots Heatmaps ----> must initialize before import the module
* Plots the DN ----> must initialize before import the module
@... | 35.451852 | 91 | 0.633305 | import matplotlib
matplotlib.use('agg')
import os, warnings
import networkx as nx
import preprocess_raw_data as prd, differential_network as dn, \
reactome_results_evaluation as rre
import dir_conf
dir_conf.initialize('SLV')
warnings.filterwarnings('ignore')
def pre_process(df, NaN_in_sparse_genes):
df = df.... | true | true |
1c262d25156e36c90640f3dbe3edc374d1e0182f | 1,533 | py | Python | discore/models/_user.py | geek-space-hq/disco | 45f4870426e635353b3621f5089880cbb30c683c | [
"MIT"
] | 3 | 2020-09-14T08:53:33.000Z | 2021-06-05T05:41:45.000Z | discore/models/_user.py | geek-space-hq/discore | 45f4870426e635353b3621f5089880cbb30c683c | [
"MIT"
] | 17 | 2020-09-13T08:26:09.000Z | 2020-09-16T16:08:52.000Z | discore/models/_user.py | geek-space-hq/disco | 45f4870426e635353b3621f5089880cbb30c683c | [
"MIT"
] | null | null | null | from __future__ import annotations
from enum import IntEnum
from typing import List, Optional
from pydantic import BaseModel
from pydantic.fields import Field
from ._guild import GuildMember, Integration
class User(BaseModel):
id: str
username: str
discriminator: str
bot: bool = Field(default=False... | 21 | 52 | 0.667319 | from __future__ import annotations
from enum import IntEnum
from typing import List, Optional
from pydantic import BaseModel
from pydantic.fields import Field
from ._guild import GuildMember, Integration
class User(BaseModel):
id: str
username: str
discriminator: str
bot: bool = Field(default=False... | true | true |
1c262d683da38d8cf287acc4b08c9721b2547e9f | 11,125 | py | Python | tests/regressiontests/forms/tests/error_messages.py | jezdez-archive/django-old | 9e28c4f4e90f8dfcfbb55bb13be437afb4f870e9 | [
"BSD-3-Clause"
] | 1 | 2017-07-08T06:24:07.000Z | 2017-07-08T06:24:07.000Z | tests/regressiontests/forms/tests/error_messages.py | cheshire/django | d9c4eacbd95f6a02e67f669f294da2dc8967a630 | [
"BSD-3-Clause"
] | null | null | null | tests/regressiontests/forms/tests/error_messages.py | cheshire/django | d9c4eacbd95f6a02e67f669f294da2dc8967a630 | [
"BSD-3-Clause"
] | 1 | 2020-07-15T05:01:00.000Z | 2020-07-15T05:01:00.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms import *
from django.test import TestCase
from django.utils import unittest
from django.utils.safestring import mark_safe
from .fields import verify_exists_urls
class Asser... | 41.356877 | 119 | 0.589663 |
from __future__ import absolute_import
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms import *
from django.test import TestCase
from django.utils import unittest
from django.utils.safestring import mark_safe
from .fields import verify_exists_urls
class AssertFormErrorsMixin(object... | false | true |
1c262dfefb6195547c283f97789d5561f73228c1 | 2,860 | py | Python | g29-wheel/g29_carla/src/g29_calra/joy2cmd.py | shikishima-TasakiLab/carla-autoware | be972924827ed0b53c029b20a2634fc60b273e0d | [
"MIT"
] | null | null | null | g29-wheel/g29_carla/src/g29_calra/joy2cmd.py | shikishima-TasakiLab/carla-autoware | be972924827ed0b53c029b20a2634fc60b273e0d | [
"MIT"
] | null | null | null | g29-wheel/g29_carla/src/g29_calra/joy2cmd.py | shikishima-TasakiLab/carla-autoware | be972924827ed0b53c029b20a2634fc60b273e0d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from sensor_msgs.msg import Joy
from carla_msgs.msg import CarlaEgoVehicleControl
cmd_pub = None
reverse = False
def joy_callback(data):
global reverse
# data.axes[0] : steer : -1 <= steer <= 1
# data.axes[1] : clutch : -1 <= clutch <= 1
... | 38.648649 | 114 | 0.526224 |
import rospy
from sensor_msgs.msg import Joy
from carla_msgs.msg import CarlaEgoVehicleControl
cmd_pub = None
reverse = False
def joy_callback(data):
global reverse
... | true | true |
1c262fc485991ad1f3c571f5400bff4bbb4fb4e0 | 316 | py | Python | caas-StopRunning.py | abhishekkhandal/py-project | f9597afcf02ef06a6ce005d5c5b98af24a89eaaf | [
"MIT"
] | 3 | 2017-06-16T12:50:09.000Z | 2018-06-25T09:57:24.000Z | caas-StopRunning.py | abhishekkhandal/py-project | f9597afcf02ef06a6ce005d5c5b98af24a89eaaf | [
"MIT"
] | null | null | null | caas-StopRunning.py | abhishekkhandal/py-project | f9597afcf02ef06a6ce005d5c5b98af24a89eaaf | [
"MIT"
] | null | null | null | #!/usr/bin/python2
import commands,cgi
print "content-type: text/html"
stopRunning = commands.getstatusoutput('for container_id in $(docker ps --filter="name=$name" -q -a);do docker stop $container_id;done')
if stopRunning[0] == 0:
print "location: dp.py"
print
else:
print "Containers could not be stopped"
| 26.333333 | 137 | 0.727848 |
import commands,cgi
print "content-type: text/html"
stopRunning = commands.getstatusoutput('for container_id in $(docker ps --filter="name=$name" -q -a);do docker stop $container_id;done')
if stopRunning[0] == 0:
print "location: dp.py"
print
else:
print "Containers could not be stopped"
| false | true |
1c262fda3e846e5311ad72809d56a1bf38e61484 | 110 | py | Python | tests/fixtures/jewel.py | Clustaar/lupin | 9ef73642d84a99adb80abf5a922a9422ddae9254 | [
"MIT"
] | 22 | 2017-10-18T08:27:20.000Z | 2022-03-25T18:53:43.000Z | tests/fixtures/jewel.py | Clustaar/lupin | 9ef73642d84a99adb80abf5a922a9422ddae9254 | [
"MIT"
] | 5 | 2019-09-16T15:31:55.000Z | 2022-02-10T08:29:14.000Z | tests/fixtures/jewel.py | Clustaar/lupin | 9ef73642d84a99adb80abf5a922a9422ddae9254 | [
"MIT"
] | null | null | null | class Jewel(object):
def __init__(self, name, carat):
self.name = name
self.carat = carat
| 22 | 36 | 0.6 | class Jewel(object):
def __init__(self, name, carat):
self.name = name
self.carat = carat
| true | true |
1c26321927ddd981db497e2f4af191b35557f4a4 | 957 | py | Python | bin/generate-static-network-config.py | untangle/ats-podman | 28a827d3be6baf6722a38bfc8945c99255c183d0 | [
"CNRI-Python"
] | null | null | null | bin/generate-static-network-config.py | untangle/ats-podman | 28a827d3be6baf6722a38bfc8945c99255c183d0 | [
"CNRI-Python"
] | null | null | null | bin/generate-static-network-config.py | untangle/ats-podman | 28a827d3be6baf6722a38bfc8945c99255c183d0 | [
"CNRI-Python"
] | 2 | 2021-09-24T21:57:12.000Z | 2021-11-01T08:35:17.000Z | #! /usr/bin/python3
import jinja2
import json
import os.path
import socket
import struct
import subprocess
import sys
PRJ_DIR = os.path.join(os.path.dirname(__file__), '..')
TPL = os.path.join(PRJ_DIR, 'assets/network-static.js.j2')
def podman_get_network_config(container_name, network_name):
output = subproce... | 25.864865 | 109 | 0.714734 |
import jinja2
import json
import os.path
import socket
import struct
import subprocess
import sys
PRJ_DIR = os.path.join(os.path.dirname(__file__), '..')
TPL = os.path.join(PRJ_DIR, 'assets/network-static.js.j2')
def podman_get_network_config(container_name, network_name):
output = subprocess.getoutput(f'podm... | true | true |
1c2632259898829725b952158eaf10d6d0c324cf | 816 | py | Python | var/spack/repos/builtin/packages/py-emcee/package.py | adrianjhpc/spack | 0a9e4fcee57911f2db586aa50c8873d9cca8de92 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2020-10-15T01:08:42.000Z | 2021-10-18T01:28:18.000Z | var/spack/repos/builtin/packages/py-emcee/package.py | adrianjhpc/spack | 0a9e4fcee57911f2db586aa50c8873d9cca8de92 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2019-07-30T10:12:28.000Z | 2019-12-17T09:02:27.000Z | var/spack/repos/builtin/packages/py-emcee/package.py | adrianjhpc/spack | 0a9e4fcee57911f2db586aa50c8873d9cca8de92 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 5 | 2019-07-30T09:42:14.000Z | 2021-01-25T05:39:20.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyEmcee(PythonPackage):
"""emcee is an MIT licensed pure-Python implementation of Goodman ... | 38.857143 | 95 | 0.743873 |
from spack import *
class PyEmcee(PythonPackage):
homepage = "http://dan.iel.fm/emcee/current/"
url = "https://pypi.io/packages/source/e/emcee/emcee-2.2.1.tar.gz"
version('2.2.1', sha256='b83551e342b37311897906b3b8acf32979f4c5542e0a25786ada862d26241172')
version('2.1.0', sha256='5ce1039a3d78fb9... | true | true |
1c2633372ca268263988a715305c220265d8849d | 10,250 | py | Python | python/ray/tests/test_object_spilling_3.py | doudoupo/ray | 9aa0b4e89e240efe2d5c7ec17b6f2cd48ea2e021 | [
"Apache-2.0"
] | 1 | 2022-03-28T06:18:30.000Z | 2022-03-28T06:18:30.000Z | python/ray/tests/test_object_spilling_3.py | doudoupo/ray | 9aa0b4e89e240efe2d5c7ec17b6f2cd48ea2e021 | [
"Apache-2.0"
] | 10 | 2022-03-09T22:55:37.000Z | 2022-03-19T07:15:42.000Z | python/ray/tests/test_object_spilling_3.py | doudoupo/ray | 9aa0b4e89e240efe2d5c7ec17b6f2cd48ea2e021 | [
"Apache-2.0"
] | null | null | null | import json
import re
import platform
import sys
import zlib
import shutil
import time
from collections import defaultdict
import random
import numpy as np
import pytest
import ray
from ray._private.test_utils import wait_for_condition
from ray.tests.test_object_spilling import is_dir_empty, assert_no_thrashing
from r... | 31.635802 | 86 | 0.656488 | import json
import re
import platform
import sys
import zlib
import shutil
import time
from collections import defaultdict
import random
import numpy as np
import pytest
import ray
from ray._private.test_utils import wait_for_condition
from ray.tests.test_object_spilling import is_dir_empty, assert_no_thrashing
from r... | true | true |
1c2633e612afa81408036065fe1bf0cf9b3db217 | 13,997 | py | Python | test/test_nmt_utils.py | EiffL/NaMaster | 41cc7839083511fe6be2eb20e93b8916c5c1f1f3 | [
"BSD-3-Clause"
] | null | null | null | test/test_nmt_utils.py | EiffL/NaMaster | 41cc7839083511fe6be2eb20e93b8916c5c1f1f3 | [
"BSD-3-Clause"
] | null | null | null | test/test_nmt_utils.py | EiffL/NaMaster | 41cc7839083511fe6be2eb20e93b8916c5c1f1f3 | [
"BSD-3-Clause"
] | null | null | null | import unittest
import numpy as np
import pymaster as nmt
import healpy as hp
from .testutils import normdiff, read_flat_map
#Unit tests associated with the NmtField and NmtFieldFlat classes
class TestUtilsSynfastFsk(unittest.TestCase) :
def setUp(self) :
self.nx=141
self.ny=311
self.lx=n... | 49.989286 | 109 | 0.650497 | import unittest
import numpy as np
import pymaster as nmt
import healpy as hp
from .testutils import normdiff, read_flat_map
class TestUtilsSynfastFsk(unittest.TestCase) :
def setUp(self) :
self.nx=141
self.ny=311
self.lx=np.radians(1.)
self.ly=np.radians(1.)
self.nbpw=30... | true | true |
1c2634372ee6606892c3316de15c9231913ff3fd | 11,031 | py | Python | Project_Rev9.py | andreroche/Project2018 | d110e1c0c06368644b7212b6872d61551011dbfc | [
"Apache-2.0"
] | null | null | null | Project_Rev9.py | andreroche/Project2018 | d110e1c0c06368644b7212b6872d61551011dbfc | [
"Apache-2.0"
] | null | null | null | Project_Rev9.py | andreroche/Project2018 | d110e1c0c06368644b7212b6872d61551011dbfc | [
"Apache-2.0"
] | null | null | null | # André Roche 27-Apr-2018 Project Final - Programming and Scripting, Fisher's IRIS Data Set.
# The program / script was developed in blocks or segments as learning and investigation continued.
# This includes learning of python as a tool in addition to the investigation of the dataset.
# For ease of review, each b... | 35.130573 | 142 | 0.712356 |
# The program / script was developed in blocks or segments as learning and investigation continued.
# This includes learning of python as a tool in addition to the investigation of the dataset.
# For ease of review, each block will be named and will correspond with description of data in the final report.
# Bl... | true | true |
1c26347d9706ee59dfcc55489e0d96f0fd857c3d | 5,217 | py | Python | open-hackathon-server/src/hackathon/admin/admin_mgr.py | akondasif/open-hackathon-bak_01 | d60ad764edf689a95b6ffcc56815338b380801de | [
"MIT"
] | null | null | null | open-hackathon-server/src/hackathon/admin/admin_mgr.py | akondasif/open-hackathon-bak_01 | d60ad764edf689a95b6ffcc56815338b380801de | [
"MIT"
] | null | null | null | open-hackathon-server/src/hackathon/admin/admin_mgr.py | akondasif/open-hackathon-bak_01 | d60ad764edf689a95b6ffcc56815338b380801de | [
"MIT"
] | 1 | 2019-04-03T23:13:55.000Z | 2019-04-03T23:13:55.000Z | # -*- coding: utf-8 -*-
"""
Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
The MIT License (MIT)
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 res... | 35.489796 | 111 | 0.650949 |
import sys
sys.path.append("..")
from hackathon.database.models import AdminHackathonRel, UserEmail, Hackathon
from hackathon.hackathon_response import bad_request, not_found, internal_server_error, ok, precondition_failed
from hackathon import RequiredFeature, Component
from flask import g
class AdminManager(Compo... | true | true |
1c2635d1054989bee4d8e02c9a10cf2421fd6d08 | 6,115 | py | Python | serpent/frame_grabber.py | JackEasons/SerpentAI | 00a487dd088c6ca2528d025f3273c0a796efe210 | [
"MIT"
] | 6,762 | 2017-09-17T20:28:40.000Z | 2022-03-31T12:35:47.000Z | serpent/frame_grabber.py | JackEasons/SerpentAI | 00a487dd088c6ca2528d025f3273c0a796efe210 | [
"MIT"
] | 159 | 2017-09-19T21:54:58.000Z | 2021-03-26T18:15:58.000Z | serpent/frame_grabber.py | JackEasons/SerpentAI | 00a487dd088c6ca2528d025f3273c0a796efe210 | [
"MIT"
] | 880 | 2017-09-23T01:16:50.000Z | 2022-03-27T18:58:30.000Z | import numpy as np
import mss
from redis import StrictRedis
from serpent.config import config
import time
from serpent.game_frame import GameFrame
from serpent.game_frame_buffer import GameFrameBuffer
from serpent.frame_transformation_pipeline import FrameTransformationPipeline
redis_client = StrictRedis(**conf... | 36.616766 | 176 | 0.629926 | import numpy as np
import mss
from redis import StrictRedis
from serpent.config import config
import time
from serpent.game_frame import GameFrame
from serpent.game_frame_buffer import GameFrameBuffer
from serpent.frame_transformation_pipeline import FrameTransformationPipeline
redis_client = StrictRedis(**conf... | true | true |
1c2635d4a8c0acbe25502e3b9870420a38b7e22e | 7,383 | py | Python | tensorflow/tools/docs/doc_generator_visitor_test.py | abhaikollara/tensorflow | 4f96df3659696990cb34d0ad07dc67843c4225a9 | [
"Apache-2.0"
] | 848 | 2019-12-03T00:16:17.000Z | 2022-03-31T22:53:17.000Z | tensorflow/tools/docs/doc_generator_visitor_test.py | abhaikollara/tensorflow | 4f96df3659696990cb34d0ad07dc67843c4225a9 | [
"Apache-2.0"
] | 656 | 2019-12-03T00:48:46.000Z | 2022-03-31T18:41:54.000Z | tensorflow/tools/docs/doc_generator_visitor_test.py | abhaikollara/tensorflow | 4f96df3659696990cb34d0ad07dc67843c4225a9 | [
"Apache-2.0"
] | 506 | 2019-12-03T00:46:26.000Z | 2022-03-30T10:34:56.000Z | # Copyright 2015 The TensorFlow 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 applica... | 28.952941 | 80 | 0.63741 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import types
from tensorflow.python.platform import googletest
from tensorflow.tools.docs import doc_generator_visitor
from tensorflow.tools.docs import generate_lib
class NoDunderVisitor(doc_... | true | true |
1c2635fd7077cd98d6ef9dd0f3149121343cd29d | 2,564 | py | Python | rts/game_CF/game.py | awesome-archive/ELF | ba956fbfc74d28d6df26472f5b464d2d038c040c | [
"BSD-3-Clause"
] | 1 | 2021-09-29T07:34:27.000Z | 2021-09-29T07:34:27.000Z | rts/game_CF/game.py | awesome-archive/ELF | ba956fbfc74d28d6df26472f5b464d2d038c040c | [
"BSD-3-Clause"
] | null | null | null | rts/game_CF/game.py | awesome-archive/ELF | ba956fbfc74d28d6df26472f5b464d2d038c040c | [
"BSD-3-Clause"
] | 1 | 2021-09-29T07:33:29.000Z | 2021-09-29T07:33:29.000Z | # Copyright (c) 2017-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. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import minirts
from date... | 30.891566 | 124 | 0.635725 |
import minirts
from datetime import datetime
import sys, os
from rts.engine import CommonLoader
from rlpytorch import ArgsProvider
class Loader(CommonLoader):
def __init__(self):
super(Loader, self).__init__(minirts)
def _get_actor_spec(self):
return dict(
batchsize=self.a... | true | true |
1c2636775f27515118bc04aacd6b43e6ebbbc60c | 882 | py | Python | D4/D4_2.py | mineiwik/AoC_2019 | 09b762906e8cb4f5ee6e036b4e088912938c2e4c | [
"MIT"
] | 1 | 2019-12-06T16:52:14.000Z | 2019-12-06T16:52:14.000Z | D4/D4_2.py | mineiwik/AoC_2019 | 09b762906e8cb4f5ee6e036b4e088912938c2e4c | [
"MIT"
] | null | null | null | D4/D4_2.py | mineiwik/AoC_2019 | 09b762906e8cb4f5ee6e036b4e088912938c2e4c | [
"MIT"
] | null | null | null | # AoC 2019 - Day 4 - Part 2
f = open('input.txt', 'r')
code_range = list(map(int, f.readline().split('-')))
sum = 0
for i in range(code_range[0], code_range[1]):
code = str(i)
doubles = 0
wrong = False
before_previous_digit = -1
previous_digit = -1
j = 0
for digit in code:
if int... | 27.5625 | 92 | 0.507937 |
f = open('input.txt', 'r')
code_range = list(map(int, f.readline().split('-')))
sum = 0
for i in range(code_range[0], code_range[1]):
code = str(i)
doubles = 0
wrong = False
before_previous_digit = -1
previous_digit = -1
j = 0
for digit in code:
if int(digit) >= previous_digit:
... | true | true |
1c2636c8c7a6282a30fbfe16a27b45a3c0382a46 | 118,670 | py | Python | build/releases/release-0.571py3/ob/lisp-core.py | farinacci/lispers.net | e1ed6e0f0a242b13ad629afb0fc1c7072b19b30c | [
"Apache-2.0"
] | 26 | 2019-02-01T19:12:21.000Z | 2022-03-25T04:40:38.000Z | build/releases/release-0.571/ob/lisp-core.py | farinacci/lispers.net | e1ed6e0f0a242b13ad629afb0fc1c7072b19b30c | [
"Apache-2.0"
] | 3 | 2019-10-29T17:49:19.000Z | 2022-03-20T21:21:31.000Z | build/releases/release-0.569/ob/lisp-core.py | farinacci/lispers.net | e1ed6e0f0a242b13ad629afb0fc1c7072b19b30c | [
"Apache-2.0"
] | 4 | 2019-02-02T16:50:48.000Z | 2020-10-29T03:10:58.000Z | # -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com>
#
# 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... | 45.889404 | 158 | 0.631474 |
from __future__ import division
from future import standard_library
standard_library . install_aliases ( )
from builtins import str
from past . utils import old_div
import lisp
import lispconfig
import multiprocessing
import threading
from subprocess import getoutput
i... | true | true |
1c2636fd143e19b15f72abca377e9ffd354358e7 | 8,924 | py | Python | mmseg/models/decode_heads/decode_head.py | ancientmooner/mmsegmentation | 1af2ad6a9f0a69e848c3cf8c307f75120c7f99b6 | [
"Apache-2.0"
] | 1 | 2020-07-15T09:43:56.000Z | 2020-07-15T09:43:56.000Z | mmseg/models/decode_heads/decode_head.py | dun933/mmsegmentation | 1af2ad6a9f0a69e848c3cf8c307f75120c7f99b6 | [
"Apache-2.0"
] | null | null | null | mmseg/models/decode_heads/decode_head.py | dun933/mmsegmentation | 1af2ad6a9f0a69e848c3cf8c307f75120c7f99b6 | [
"Apache-2.0"
] | null | null | null | from abc import ABCMeta, abstractmethod
import torch
import torch.nn as nn
from mmcv.cnn import normal_init
from mmseg.core import build_pixel_sampler
from mmseg.ops import resize
from ..builder import build_loss
from ..losses import accuracy
class BaseDecodeHead(nn.Module, metaclass=ABCMeta):
"""Base class for... | 38.8 | 78 | 0.594464 | from abc import ABCMeta, abstractmethod
import torch
import torch.nn as nn
from mmcv.cnn import normal_init
from mmseg.core import build_pixel_sampler
from mmseg.ops import resize
from ..builder import build_loss
from ..losses import accuracy
class BaseDecodeHead(nn.Module, metaclass=ABCMeta):
def __init__(sel... | true | true |
1c26372f1767c05a5cb51ee25cc00468cf520ec0 | 126 | py | Python | configs/beemovie/beemovie.py | ravenflarf/att | dee3231e6ef80674178dac7621390ce10deace85 | [
"Unlicense"
] | null | null | null | configs/beemovie/beemovie.py | ravenflarf/att | dee3231e6ef80674178dac7621390ce10deace85 | [
"Unlicense"
] | null | null | null | configs/beemovie/beemovie.py | ravenflarf/att | dee3231e6ef80674178dac7621390ce10deace85 | [
"Unlicense"
] | null | null | null | # Default settings
# More info in README.py
# The name of the text to use from the local directory
text_name = "beemovie.txt" | 25.2 | 54 | 0.753968 |
text_name = "beemovie.txt" | true | true |
1c26373b664d35c4390c2c7aa896d754f12bc7e6 | 703 | py | Python | test/integration/__init__.py | synapticarbors/mike | 39d6373cce9b3c9097c72ee3259389b06552fb4d | [
"BSD-3-Clause"
] | null | null | null | test/integration/__init__.py | synapticarbors/mike | 39d6373cce9b3c9097c72ee3259389b06552fb4d | [
"BSD-3-Clause"
] | null | null | null | test/integration/__init__.py | synapticarbors/mike | 39d6373cce9b3c9097c72ee3259389b06552fb4d | [
"BSD-3-Clause"
] | null | null | null | import subprocess
import unittest
class SubprocessError(unittest.TestCase.failureException):
def __init__(self, message):
unittest.TestCase.failureException.__init__(
self, '\n{line}\n{msg}\n{line}'.format(line='-' * 60, msg=message)
)
def assertPopen(command, returncode=0):
proc... | 28.12 | 78 | 0.687055 | import subprocess
import unittest
class SubprocessError(unittest.TestCase.failureException):
def __init__(self, message):
unittest.TestCase.failureException.__init__(
self, '\n{line}\n{msg}\n{line}'.format(line='-' * 60, msg=message)
)
def assertPopen(command, returncode=0):
proc... | true | true |
1c2637a779f113f5b10c5971e8a7449170fdd2d2 | 22,024 | py | Python | py/desispec/scripts/editexptable.py | echaussidon/desispec | 8a8bd59653861509dd630ffc8e1cd6c67f6cdd51 | [
"BSD-3-Clause"
] | null | null | null | py/desispec/scripts/editexptable.py | echaussidon/desispec | 8a8bd59653861509dd630ffc8e1cd6c67f6cdd51 | [
"BSD-3-Clause"
] | null | null | null | py/desispec/scripts/editexptable.py | echaussidon/desispec | 8a8bd59653861509dd630ffc8e1cd6c67f6cdd51 | [
"BSD-3-Clause"
] | null | null | null |
from desispec.workflow.exptable import get_exposure_table_name,get_exposure_table_path, \
get_exposure_flags, get_last_step_options, get_exposure_table_column_defs, \
keyval_change_reporting, deconstruct_keyval_reporting
from desispec.workfl... | 53.326877 | 123 | 0.658736 |
from desispec.workflow.exptable import get_exposure_table_name,get_exposure_table_path, \
get_exposure_flags, get_last_step_options, get_exposure_table_column_defs, \
keyval_change_reporting, deconstruct_keyval_reporting
from desispec.workfl... | true | true |
1c2637d45fd542109c496e9604f4d1071c7d4bef | 1,862 | py | Python | egd_site/www/translations.py | herwix/egd_site | b440745bace1402d9d361b7707d8fef94ddbac62 | [
"MIT"
] | null | null | null | egd_site/www/translations.py | herwix/egd_site | b440745bace1402d9d361b7707d8fef94ddbac62 | [
"MIT"
] | null | null | null | egd_site/www/translations.py | herwix/egd_site | b440745bace1402d9d361b7707d8fef94ddbac62 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import frappe
no_cache = 1
sitemap = 0
def get_context(context):
import os
import io
# from frappe.translate import get_messages_for_app
from frappe.translate import deduplicate_messages
from frappe.translate import get_all_messages_from_js_files
from frappe.translate ... | 29.555556 | 93 | 0.735231 | from __future__ import unicode_literals
import frappe
no_cache = 1
sitemap = 0
def get_context(context):
import os
import io
from frappe.translate import deduplicate_messages
from frappe.translate import get_all_messages_from_js_files
from frappe.translate import get_server_messages
from frappe.translate i... | true | true |
1c26385514419cbc8e20068d4661a707e99c6428 | 923 | py | Python | balance.py | Dovisal1/citi-bike | 8912e0b15c038d5d8818bd868547f2986ce7a0bd | [
"MIT"
] | null | null | null | balance.py | Dovisal1/citi-bike | 8912e0b15c038d5d8818bd868547f2986ce7a0bd | [
"MIT"
] | null | null | null | balance.py | Dovisal1/citi-bike | 8912e0b15c038d5d8818bd868547f2986ce7a0bd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import csv
import glob
from datetime import datetime
timeformat = '%m/%d/%Y %H:%M:%S'
start = []
end = []
for file in glob.glob('*2016*csv'):
print(file)
with open(file,'r') as csvfile:
reader = csv.reader(csvfile, delimiter=',')
next(reader)
for row in reader:
start.ap... | 22.512195 | 127 | 0.703142 |
import os
import csv
import glob
from datetime import datetime
timeformat = '%m/%d/%Y %H:%M:%S'
start = []
end = []
for file in glob.glob('*2016*csv'):
print(file)
with open(file,'r') as csvfile:
reader = csv.reader(csvfile, delimiter=',')
next(reader)
for row in reader:
start.append(row[4])
end.ap... | true | true |
1c26385ca291b6867d85bd4afa79370d81305f1e | 2,659 | py | Python | test/test_subcomponent.py | brsynth/pySBOL3 | 5ae15b4f171991b3cd216b7548ffde7902f41c12 | [
"MIT"
] | null | null | null | test/test_subcomponent.py | brsynth/pySBOL3 | 5ae15b4f171991b3cd216b7548ffde7902f41c12 | [
"MIT"
] | null | null | null | test/test_subcomponent.py | brsynth/pySBOL3 | 5ae15b4f171991b3cd216b7548ffde7902f41c12 | [
"MIT"
] | null | null | null | import unittest
import sbol3
class TestSubComponent(unittest.TestCase):
def setUp(self) -> None:
sbol3.set_defaults()
def tearDown(self) -> None:
sbol3.set_defaults()
def test_create(self):
sbol3.set_namespace('https://github.com/synbiodex/pysbol3')
instance_of = sbol3.... | 37.985714 | 71 | 0.639338 | import unittest
import sbol3
class TestSubComponent(unittest.TestCase):
def setUp(self) -> None:
sbol3.set_defaults()
def tearDown(self) -> None:
sbol3.set_defaults()
def test_create(self):
sbol3.set_namespace('https://github.com/synbiodex/pysbol3')
instance_of = sbol3.... | true | true |
1c2638a65d1c07cb19c9f85e310207eba980671f | 357 | py | Python | ssd/modeling/backbone/__init__.py | mgoin/SSD | 3de8fcfce18fc3dac42d11e1c1b18c8bb342f3ca | [
"MIT"
] | null | null | null | ssd/modeling/backbone/__init__.py | mgoin/SSD | 3de8fcfce18fc3dac42d11e1c1b18c8bb342f3ca | [
"MIT"
] | null | null | null | ssd/modeling/backbone/__init__.py | mgoin/SSD | 3de8fcfce18fc3dac42d11e1c1b18c8bb342f3ca | [
"MIT"
] | null | null | null | from ssd.modeling import registry
from .vgg import VGG
from .mobilenet import MobileNetV2
from .efficient_net import EfficientNet
from .resnet import ResNet50
__all__ = ['build_backbone', 'VGG', 'MobileNetV2', 'EfficientNet', 'ResNet50']
def build_backbone(cfg):
return registry.BACKBONES[cfg.MODEL.BACKBONE.NAME]... | 29.75 | 90 | 0.787115 | from ssd.modeling import registry
from .vgg import VGG
from .mobilenet import MobileNetV2
from .efficient_net import EfficientNet
from .resnet import ResNet50
__all__ = ['build_backbone', 'VGG', 'MobileNetV2', 'EfficientNet', 'ResNet50']
def build_backbone(cfg):
return registry.BACKBONES[cfg.MODEL.BACKBONE.NAME]... | true | true |
1c26397e8cd6680eb843dc82b95fb5e49e41d049 | 2,710 | py | Python | cardinal_pythonlib/crypto.py | RudolfCardinal/pythonlib | 4c583ad1aae3c1166a4e6f964df87eb6c02a73cb | [
"Apache-2.0"
] | 10 | 2015-09-30T02:46:48.000Z | 2021-07-23T05:03:38.000Z | cardinal_pythonlib/crypto.py | RudolfCardinal/pythonlib | 4c583ad1aae3c1166a4e6f964df87eb6c02a73cb | [
"Apache-2.0"
] | 9 | 2019-07-04T11:10:31.000Z | 2021-09-23T21:11:42.000Z | cardinal_pythonlib/crypto.py | RudolfCardinal/pythonlib | 4c583ad1aae3c1166a4e6f964df87eb6c02a73cb | [
"Apache-2.0"
] | 4 | 2017-07-17T15:17:44.000Z | 2021-07-23T05:03:41.000Z | #!/usr/bin/env python
# cardinal_pythonlib/crypto.py
"""
===============================================================================
Original code copyright (C) 2009-2021 Rudolf Cardinal (rudolf@pobox.com).
This file is part of cardinal_pythonlib.
Licensed under the Apache License, Version 2.0 (the ... | 35.194805 | 79 | 0.62214 |
# requirements. However, it is vital for this module.
#
# noinspection PyUnresolvedReferences
import bcrypt # pip install bcrypt; see https://pypi.org/project/bcrypt/
# =============================================================================
# bcrypt
# ======================================================... | true | true |
1c2639f4b89f2331528e1d9bce02ddce5577878c | 3,916 | py | Python | src/transformer_deploy/benchmarks/utils.py | averkij/transformer-deploy | 2a0b527dc187e14c718d36dbac8a3e29e34cf78b | [
"Apache-2.0"
] | 1 | 2022-02-14T07:58:33.000Z | 2022-02-14T07:58:33.000Z | src/transformer_deploy/benchmarks/utils.py | averkij/transformer-deploy | 2a0b527dc187e14c718d36dbac8a3e29e34cf78b | [
"Apache-2.0"
] | null | null | null | src/transformer_deploy/benchmarks/utils.py | averkij/transformer-deploy | 2a0b527dc187e14c718d36dbac8a3e29e34cf78b | [
"Apache-2.0"
] | null | null | null | # Copyright 2021, Lefebvre Sarrut Services
#
# 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 ag... | 36.259259 | 115 | 0.693054 |
import logging
import time
from collections import OrderedDict
from contextlib import contextmanager
from typing import Dict, List, Tuple
import numpy as np
import torch
def print_timings(name: str, timings: List[float]) -> None:
mean_time = 1e3 * np.mean(timings)
std_time = 1e3 * np.std(timing... | true | true |
1c263a0dbb57c12a0565f3d69f6aa647751a40a3 | 31 | py | Python | test.py | dolphincn/python | 467d36f212c1c6be34a7dd2382b98d8e02cdb4ca | [
"Apache-2.0"
] | null | null | null | test.py | dolphincn/python | 467d36f212c1c6be34a7dd2382b98d8e02cdb4ca | [
"Apache-2.0"
] | null | null | null | test.py | dolphincn/python | 467d36f212c1c6be34a7dd2382b98d8e02cdb4ca | [
"Apache-2.0"
] | null | null | null | print ("hello")
print ("hello") | 15.5 | 15 | 0.645161 | print ("hello")
print ("hello") | true | true |
1c263a6cba81f9a784763c85cee7fc553daacf81 | 3,478 | py | Python | setup.py | klarh/flowws-structure-pretraining | d54103d30df98ed846768d6e0ed851edcd53bfcc | [
"MIT"
] | null | null | null | setup.py | klarh/flowws-structure-pretraining | d54103d30df98ed846768d6e0ed851edcd53bfcc | [
"MIT"
] | null | null | null | setup.py | klarh/flowws-structure-pretraining | d54103d30df98ed846768d6e0ed851edcd53bfcc | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
from setuptools import setup
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
version_fname = os.path.join(THIS_DIR, 'flowws_structure_pretraining', 'version.py')
with open(version_fname) as version_file:
exec(version_file.read())
readme_fname = os.path.join(THIS_DIR, 'READM... | 28.508197 | 115 | 0.658424 |
import os
from setuptools import setup
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
version_fname = os.path.join(THIS_DIR, 'flowws_structure_pretraining', 'version.py')
with open(version_fname) as version_file:
exec(version_file.read())
readme_fname = os.path.join(THIS_DIR, 'README.md')
with open(read... | true | true |
1c263acf3f2a664206f0aa4d6c6f888a1124b5d5 | 999 | py | Python | pysaurus/database/viewport/layers/group_layer.py | notoraptor/pysaurus | 3bf5fe8c15e0e0e580e5edaea05b4a1298641367 | [
"MIT"
] | null | null | null | pysaurus/database/viewport/layers/group_layer.py | notoraptor/pysaurus | 3bf5fe8c15e0e0e580e5edaea05b4a1298641367 | [
"MIT"
] | 4 | 2021-08-13T14:03:02.000Z | 2022-03-05T16:02:45.000Z | pysaurus/database/viewport/layers/group_layer.py | notoraptor/pysaurus | 3bf5fe8c15e0e0e580e5edaea05b4a1298641367 | [
"MIT"
] | null | null | null | from typing import Sequence
from pysaurus.database.video import Video
from pysaurus.database.viewport.layers.layer import Layer
from pysaurus.database.viewport.viewtools.group import Group
class GroupLayer(Layer):
__slots__ = ()
__props__ = ("group_id",)
_cache: Group
def set_group_id(self, group_i... | 28.542857 | 72 | 0.684685 | from typing import Sequence
from pysaurus.database.video import Video
from pysaurus.database.viewport.layers.layer import Layer
from pysaurus.database.viewport.viewtools.group import Group
class GroupLayer(Layer):
__slots__ = ()
__props__ = ("group_id",)
_cache: Group
def set_group_id(self, group_i... | true | true |
1c263af7050a40ca360b6ba87caead2e2064b209 | 1,166 | py | Python | apps/dash-vtk-tutorials/demos/t02_imagedata.py | JeroenvdSande/dash-sample-apps | 106fa24693cfdaf47c06466a0aed78e642344f91 | [
"MIT"
] | 2,332 | 2019-05-10T18:24:20.000Z | 2022-03-30T21:46:29.000Z | apps/dash-vtk-tutorials/demos/t02_imagedata.py | JeroenvdSande/dash-sample-apps | 106fa24693cfdaf47c06466a0aed78e642344f91 | [
"MIT"
] | 384 | 2019-05-09T19:19:56.000Z | 2022-03-12T00:58:24.000Z | apps/dash-vtk-tutorials/demos/t02_imagedata.py | JeroenvdSande/dash-sample-apps | 106fa24693cfdaf47c06466a0aed78e642344f91 | [
"MIT"
] | 3,127 | 2019-05-16T17:20:45.000Z | 2022-03-31T17:59:07.000Z | import dash
import dash_html_components as html
import dash_vtk
content = dash_vtk.View(
[
dash_vtk.VolumeRepresentation(
[
# GUI to control Volume Rendering
# + Setup good default at startup
dash_vtk.VolumeController(),
# Actual ... | 26.5 | 80 | 0.403945 | import dash
import dash_html_components as html
import dash_vtk
content = dash_vtk.View(
[
dash_vtk.VolumeRepresentation(
[
dash_vtk.VolumeController(),
dash_vtk.ImageData(
dimensions=[5, 5, ... | true | true |
1c263bd6e9524090f165a2b56bcc299efc13ba8e | 9,170 | py | Python | fanficdownloader/adapters/adapter_hpfanficarchivecom.py | rodrigonz/rodrigodeoliveiracosta-clone | 5fb6d2a167e24199f8080ba78392821659575685 | [
"Apache-2.0"
] | null | null | null | fanficdownloader/adapters/adapter_hpfanficarchivecom.py | rodrigonz/rodrigodeoliveiracosta-clone | 5fb6d2a167e24199f8080ba78392821659575685 | [
"Apache-2.0"
] | null | null | null | fanficdownloader/adapters/adapter_hpfanficarchivecom.py | rodrigonz/rodrigodeoliveiracosta-clone | 5fb6d2a167e24199f8080ba78392821659575685 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2012 Fanficdownloader team
#
# 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 require... | 42.06422 | 162 | 0.576118 |
import time
import logging
logger = logging.getLogger(__name__)
import re
import urllib2
from .. import BeautifulSoup as bs
from ..htmlcleanup import stripHTML
from .. import exceptions as exceptions
from base_adapter import BaseSiteAdapter, makeDate
def getClass():
return HPFanf... | false | true |
1c263e513fcba1305c1c17b87c47365068b2f3d7 | 14,777 | py | Python | dask/dataframe/methods.py | rockwellw/dask | c1f6d61368af6f9c67d39d23406eb267a0308bb9 | [
"BSD-3-Clause"
] | null | null | null | dask/dataframe/methods.py | rockwellw/dask | c1f6d61368af6f9c67d39d23406eb267a0308bb9 | [
"BSD-3-Clause"
] | null | null | null | dask/dataframe/methods.py | rockwellw/dask | c1f6d61368af6f9c67d39d23406eb267a0308bb9 | [
"BSD-3-Clause"
] | 1 | 2020-06-03T07:06:57.000Z | 2020-06-03T07:06:57.000Z | import warnings
import numpy as np
import pandas as pd
from pandas.api.types import is_categorical_dtype, union_categoricals
from toolz import partition
from .utils import (
PANDAS_VERSION,
is_series_like,
is_dataframe_like,
PANDAS_GT_0250,
hash_object_dispatch,
group_split_dispatch,
)
from ..... | 29.732394 | 88 | 0.584422 | import warnings
import numpy as np
import pandas as pd
from pandas.api.types import is_categorical_dtype, union_categoricals
from toolz import partition
from .utils import (
PANDAS_VERSION,
is_series_like,
is_dataframe_like,
PANDAS_GT_0250,
hash_object_dispatch,
group_split_dispatch,
)
from ..... | true | true |
1c263f1b272d6d3f1564ed85145eb61dc441ca23 | 37,815 | py | Python | docs/architecture/api.py | karahbit/radical.pilot | c611e1df781749deef899dcf5815728e1d8a962e | [
"MIT"
] | null | null | null | docs/architecture/api.py | karahbit/radical.pilot | c611e1df781749deef899dcf5815728e1d8a962e | [
"MIT"
] | null | null | null | docs/architecture/api.py | karahbit/radical.pilot | c611e1df781749deef899dcf5815728e1d8a962e | [
"MIT"
] | null | null | null | """
DEPRECATED!!!
GO INTO THE REAL CODE (API/SP1)
Discussion
----------
RADICAL-Pilot API spec
===================
Pilot States
------------
"""
UNKNOWN = 'Unknown'
"""
No state information could be obtained for that pilot.
"""
PENDING = 'Pending'
"""
This state identifies a newly constructed pilot which is n... | 27.322977 | 92 | 0.557795 |
UNKNOWN = 'Unknown'
PENDING = 'Pending'
RUNNING = 'Running'
DONE = 'Done'
CANCELED = 'Canceled'
FAILED = 'Failed'
import radical.saga.exceptions as rse
class IncorrectURL (rse.IncorrectUrl) :
pass
class BadParameter (rse.BadParameter) :
pass
class DoesNotExist (rse.DoesNotExist) :
pass
class Inc... | true | true |
1c263f7abb3e9f7e2ae8bcf076d373db61b07394 | 3,434 | py | Python | gaphor/core/styling/__init__.py | vanillajonathan/gaphor | d39f436aea7d667c194dd62c6ae79411c23a3b26 | [
"Apache-2.0"
] | 867 | 2018-01-09T00:19:09.000Z | 2022-03-31T02:49:23.000Z | gaphor/core/styling/__init__.py | vanillajonathan/gaphor | d39f436aea7d667c194dd62c6ae79411c23a3b26 | [
"Apache-2.0"
] | 790 | 2018-01-13T23:47:07.000Z | 2022-03-31T16:04:27.000Z | gaphor/core/styling/__init__.py | sitedata/gaphor | c83eff0bd595d1a8e766a157f0268e5206eed22c | [
"Apache-2.0"
] | 117 | 2018-01-09T02:24:49.000Z | 2022-03-23T08:07:42.000Z | from __future__ import annotations
import operator
from typing import Callable, Dict, Iterator, Literal, Protocol, Sequence, Tuple, Union
import tinycss2
from gaphor.core.styling.declarations import (
FONT_SIZE_VALUES,
number,
parse_declarations,
)
from gaphor.core.styling.parser import SelectorError
fro... | 27.693548 | 104 | 0.610076 | from __future__ import annotations
import operator
from typing import Callable, Dict, Iterator, Literal, Protocol, Sequence, Tuple, Union
import tinycss2
from gaphor.core.styling.declarations import (
FONT_SIZE_VALUES,
number,
parse_declarations,
)
from gaphor.core.styling.parser import SelectorError
fro... | true | true |
1c2640c795e144e181770fe13f9c9d50d6d4acf9 | 3,878 | py | Python | Python/DataAugmentationUtilsPackage/DataAugmentationUtils/Visualize.py | danlamanna/ShapeWorks | 58ffac86cbea1e7f0b4ede9ff6ded167bd5dfc14 | [
"MIT"
] | null | null | null | Python/DataAugmentationUtilsPackage/DataAugmentationUtils/Visualize.py | danlamanna/ShapeWorks | 58ffac86cbea1e7f0b4ede9ff6ded167bd5dfc14 | [
"MIT"
] | null | null | null | Python/DataAugmentationUtilsPackage/DataAugmentationUtils/Visualize.py | danlamanna/ShapeWorks | 58ffac86cbea1e7f0b4ede9ff6ded167bd5dfc14 | [
"MIT"
] | null | null | null | import csv
import re
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from PIL import Image
import pandas as pd
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.layouts import gridplot
from bokeh.models import (BasicTicker, Circle, ColumnDataSource, DataRange1d,... | 32.588235 | 103 | 0.594121 | import csv
import re
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from PIL import Image
import pandas as pd
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.layouts import gridplot
from bokeh.models import (BasicTicker, Circle, ColumnDataSource, DataRange1d,... | true | true |
1c2640dcdc973579c25209a47704a2826ddd2d3f | 1,883 | py | Python | setup.py | codenerix/django-codenerix | 1fc2edb451c5cf2359e243d860940876af0cf575 | [
"Apache-2.0"
] | 15 | 2018-03-21T10:47:57.000Z | 2022-02-01T08:17:56.000Z | setup.py | codenerix/django-codenerix | 1fc2edb451c5cf2359e243d860940876af0cf575 | [
"Apache-2.0"
] | 4 | 2018-04-11T10:19:08.000Z | 2020-02-29T18:54:36.000Z | setup.py | codenerix/django-codenerix | 1fc2edb451c5cf2359e243d860940876af0cf575 | [
"Apache-2.0"
] | 5 | 2018-03-12T16:57:02.000Z | 2021-04-15T16:51:08.000Z | import os
import sys
from setuptools import setup
import codenerix
#from setuptools.command.install import install
#class CustomInstallCommand(install):
# """Customized setuptools install command - prints a friendly greeting."""
# def run(self):
# print "Hello, developer, how are you? :)"
# instal... | 33.625 | 126 | 0.6718 | import os
import sys
from setuptools import setup
import codenerix
oin(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
requirements = codenerix.__requirements__['all']
if sys.version_info[0] < 3:
... | true | true |
1c264261ec7efaa1cbc57ab2641b4833b360e8c6 | 1,837 | py | Python | fython/lex/line.py | nicolasessisbreton/fython | 988f5a94cee8b16b0000501a22239195c73424a1 | [
"Apache-2.0"
] | 41 | 2016-01-21T05:14:45.000Z | 2021-11-24T20:37:21.000Z | fython/lex/line.py | nicolasessisbreton/fython | 988f5a94cee8b16b0000501a22239195c73424a1 | [
"Apache-2.0"
] | 5 | 2016-01-21T05:36:37.000Z | 2016-08-22T19:26:51.000Z | fython/lex/line.py | nicolasessisbreton/fython | 988f5a94cee8b16b0000501a22239195c73424a1 | [
"Apache-2.0"
] | 3 | 2016-01-23T04:03:44.000Z | 2016-08-21T15:58:38.000Z | from .config import *
class Line:
def __init__(s, module, line):
s.module = module
if line == '':
s.is_empty = 1
s.line = ''
else:
ndx = line.rfind('<')
s.lineno = int(line[ndx+1:])
s.line = line[:ndx]
s.line = s.line.rstrip()
s.is_empty = s.line == ''
if s.is_empty:
s.has_colon... | 24.171053 | 69 | 0.659771 | from .config import *
class Line:
def __init__(s, module, line):
s.module = module
if line == '':
s.is_empty = 1
s.line = ''
else:
ndx = line.rfind('<')
s.lineno = int(line[ndx+1:])
s.line = line[:ndx]
s.line = s.line.rstrip()
s.is_empty = s.line == ''
if s.is_empty:
s.has_colon... | true | true |
1c264293c5b3926f07972e9a0de69f89389d619e | 1,948 | py | Python | samples/category_list.py | gauravphagrehpe/python-opsramp | 9ed8397cff70f866b9ed9bd1d7010a189481c62c | [
"Apache-2.0"
] | 6 | 2020-03-30T12:53:44.000Z | 2022-03-05T11:37:12.000Z | samples/category_list.py | gauravphagrehpe/python-opsramp | 9ed8397cff70f866b9ed9bd1d7010a189481c62c | [
"Apache-2.0"
] | 20 | 2019-07-10T13:24:00.000Z | 2021-01-25T14:26:23.000Z | samples/category_list.py | gauravphagrehpe/python-opsramp | 9ed8397cff70f866b9ed9bd1d7010a189481c62c | [
"Apache-2.0"
] | 21 | 2019-06-26T12:05:33.000Z | 2022-03-28T11:44:39.000Z | #!/usr/bin/env python
#
# Exercise the opsramp module as an illustration of how to use it.
#
# (c) Copyright 2019-2021 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 ... | 26.324324 | 74 | 0.62885 |
import os
import logging
import argparse
import opsramp.binding
def connect():
url = os.environ['OPSRAMP_URL']
key = os.environ['OPSRAMP_KEY']
secret = os.environ['OPSRAMP_SECRET']
return opsramp.binding.connect(url, key, secret)
def parse_argv():
parser = argparse.ArgumentPar... | true | true |
1c2642a960d1a4e6ec96c204ca32016d5d466887 | 4,587 | py | Python | contrib/linearize/linearize-hashes.py | CoinBitCore/temp | a2ebefc861aa979b441286a203d574197459b0d6 | [
"MIT"
] | null | null | null | contrib/linearize/linearize-hashes.py | CoinBitCore/temp | a2ebefc861aa979b441286a203d574197459b0d6 | [
"MIT"
] | null | null | null | contrib/linearize/linearize-hashes.py | CoinBitCore/temp | a2ebefc861aa979b441286a203d574197459b0d6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# linearize-hashes.py: List blocks in a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2017 The Coinbit Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ impo... | 29.031646 | 90 | 0.691083 |
from __future__ import print_function
try:
import http.client as httplib
except ImportError:
import httplib
import json
import re
import base64
import sys
import os
import os.path
settings = {}
e()
class CoinbitRPC:
def __init__(self, host, port, username, password):
authpair = "%s:%s" % (usern... | true | true |
1c2645575b3ef179ea7521895f5cf074935b1644 | 1,790 | py | Python | pkg/releasing/print_rel_notes.py | 128technology/rules_pkg | cb54c427343aa48c32e3c09ddcc8f6316cdbd5a6 | [
"Apache-2.0"
] | null | null | null | pkg/releasing/print_rel_notes.py | 128technology/rules_pkg | cb54c427343aa48c32e3c09ddcc8f6316cdbd5a6 | [
"Apache-2.0"
] | null | null | null | pkg/releasing/print_rel_notes.py | 128technology/rules_pkg | cb54c427343aa48c32e3c09ddcc8f6316cdbd5a6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Bazel 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 applicable la... | 27.96875 | 74 | 0.653631 |
import sys
from string import Template
import textwrap
from releasing import release_tools
def print_notes(repo, version, tarball_path, org='bazelbuild'):
file_name = release_tools.package_basename(repo, version)
sha256 = release_tools.get_package_sha256(tarball_path)
url = 'https://github.com/%... | true | true |
1c2645c4b07e8b666176a8ea206f27e7b927fef9 | 9,922 | py | Python | utils/natsort.py | orionzhou/biolib | 940fb66f1b2608d34a2d00ebdf41dc84c6381f42 | [
"BSD-2-Clause"
] | 3 | 2019-02-22T20:35:23.000Z | 2021-11-25T10:01:50.000Z | utils/natsort.py | orionzhou/biolib | 940fb66f1b2608d34a2d00ebdf41dc84c6381f42 | [
"BSD-2-Clause"
] | null | null | null | utils/natsort.py | orionzhou/biolib | 940fb66f1b2608d34a2d00ebdf41dc84c6381f42 | [
"BSD-2-Clause"
] | 1 | 2021-02-19T03:10:14.000Z | 2021-02-19T03:10:14.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Adapted from Seth M. Morton's natsort library:
<https://github.com/SethMMorton/natsort>
Here are a collection of examples of how this module can be used.
See the README or the natsort homepage for more details.
>>> a = ['a2', 'a5', 'a9', 'a1', 'a4', 'a10', 'a6']
... | 35.690647 | 114 | 0.545152 |
import re
float_sign_exp_re = re.compile(r'([-+]?\d*\.?\d+(?:[eE][-+]?\d+)?)')
float_nosign_exp_re = re.compile(r'(\d*\.?\d+(?:[eE][-+]?\d+)?)')
float_sign_noexp_re = re.compile(r'([-+]?\d*\.?\d+)')
float_nosign_noexp_re = re.compile(r'(\d*\.?\d+)')
int_nosign_re = re.compile(r'(\d+)')
int_sign_re = re.compile(r... | true | true |
1c2646bcd2d7e73ce00a8d5847d238c5e2f97c52 | 560 | py | Python | Module_02/webdriver_ejemplo01.py | JJSerAnexinet/2021_python_selenium | adce51a33ec791db4ce4c0c07a4952d487a27561 | [
"Unlicense"
] | null | null | null | Module_02/webdriver_ejemplo01.py | JJSerAnexinet/2021_python_selenium | adce51a33ec791db4ce4c0c07a4952d487a27561 | [
"Unlicense"
] | null | null | null | Module_02/webdriver_ejemplo01.py | JJSerAnexinet/2021_python_selenium | adce51a33ec791db4ce4c0c07a4952d487a27561 | [
"Unlicense"
] | null | null | null | """Second Selenium Example"""
from selenium import webdriver
driver_path = '/Users/jjserna/Documents/Repository/2021_python_selenium/drivers/chromedriver'
driver = webdriver.Chrome(executable_path=driver_path)
driver.get('https://saucelabs.com/resources/articles/selenium-grid')
print(f'Current title: {driver.title}')... | 37.333333 | 93 | 0.789286 |
from selenium import webdriver
driver_path = '/Users/jjserna/Documents/Repository/2021_python_selenium/drivers/chromedriver'
driver = webdriver.Chrome(executable_path=driver_path)
driver.get('https://saucelabs.com/resources/articles/selenium-grid')
print(f'Current title: {driver.title}')
print(f'Current url: {driver.... | true | true |
1c264848373dc39734e2d5722eda582a9525b54a | 215 | py | Python | sample.py | indiranell/sample_flask | 25253aeb54b0e9d765b7cdb301223bafa25c4ce6 | [
"MIT"
] | null | null | null | sample.py | indiranell/sample_flask | 25253aeb54b0e9d765b7cdb301223bafa25c4ce6 | [
"MIT"
] | null | null | null | sample.py | indiranell/sample_flask | 25253aeb54b0e9d765b7cdb301223bafa25c4ce6 | [
"MIT"
] | null | null | null | """
Flask app to host my sample
"""
from flask import Flask
app = Flask(__name__)
@app.route("/")
def index_page():
return "Hello"
#--start---
if __name__=='__main__':
app.run(host='0.0.0.0',port=6464)
| 12.647059 | 37 | 0.627907 |
from flask import Flask
app = Flask(__name__)
@app.route("/")
def index_page():
return "Hello"
if __name__=='__main__':
app.run(host='0.0.0.0',port=6464)
| true | true |
1c2648a8d5938b4600c0201abfd250f0e2f3ce83 | 402 | py | Python | quickstart/urls.py | PanBurtik/myapp | 6ba9f255cacf8ea33e06b0d6eac41962d12670e5 | [
"MIT"
] | null | null | null | quickstart/urls.py | PanBurtik/myapp | 6ba9f255cacf8ea33e06b0d6eac41962d12670e5 | [
"MIT"
] | null | null | null | quickstart/urls.py | PanBurtik/myapp | 6ba9f255cacf8ea33e06b0d6eac41962d12670e5 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('myapp/', include('myapp.urls')),
path('admin/', admin.site.urls),
]
if settings.DEBUG:
urlpatterns.extend(static(settings.MEDIA_URL, docu... | 28.714286 | 85 | 0.751244 | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('myapp/', include('myapp.urls')),
path('admin/', admin.site.urls),
]
if settings.DEBUG:
urlpatterns.extend(static(settings.MEDIA_URL, docu... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.