hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bff90483e6a444cb5f10ac00e642caca1f6c71ca | 504 | py | Python | tests/test_basic_shell.py | TheFriendlyCoder/FriendlyShell | 8508c09e787cb8f0fc44c2a9e2587e8d4eec555c | [
"Apache-2.0"
] | null | null | null | tests/test_basic_shell.py | TheFriendlyCoder/FriendlyShell | 8508c09e787cb8f0fc44c2a9e2587e8d4eec555c | [
"Apache-2.0"
] | 93 | 2018-04-21T01:03:06.000Z | 2019-06-23T14:22:37.000Z | tests/test_basic_shell.py | TheFriendlyCoder/FriendlyShell | 8508c09e787cb8f0fc44c2a9e2587e8d4eec555c | [
"Apache-2.0"
] | null | null | null | import platform
from friendlyshell.basic_shell import BasicShell
import pytest
from mock import patch
@pytest.mark.skipif(platform.python_implementation()=="PyPy",
reason="Test not supported on PyPy")
if __name__ == "__main__":
pytest.main([__file__, "-v", "-s"]) | 26.526316 | 62 | 0.668651 | import platform
from friendlyshell.basic_shell import BasicShell
import pytest
from mock import patch
@pytest.mark.skipif(platform.python_implementation()=="PyPy",
reason="Test not supported on PyPy")
def test_init():
obj = BasicShell()
with patch('friendlyshell.base_shell.input') as Mock... | 191 | 0 | 22 |
e71fe983b798e8dfec73e6f334a585552f9fc45f | 1,796 | py | Python | block/block.py | Mechasparrow/Sparkles | f2bdcc0019da1f8dea2f3d9209c51c28a0b6a1e6 | [
"MIT"
] | null | null | null | block/block.py | Mechasparrow/Sparkles | f2bdcc0019da1f8dea2f3d9209c51c28a0b6a1e6 | [
"MIT"
] | 14 | 2017-11-22T04:34:59.000Z | 2018-02-13T02:51:30.000Z | block/block.py | Mechasparrow/Sparkles | f2bdcc0019da1f8dea2f3d9209c51c28a0b6a1e6 | [
"MIT"
] | null | null | null | import json
import hashlib
import base64
| 29.442623 | 163 | 0.601893 | import json
import hashlib
import base64
class Block:
def __init__(self, index, timestamp, data, prev_hash, hash=None, nonce=0):
self.index = index
self.timestamp = timestamp
self.data = data
self.prev_hash = prev_hash
self.hash = hash
self.nonce = nonce
def hea... | 1,499 | -9 | 265 |
ed3b5929aff7dcafb1020e00298084831d34d5d6 | 10,294 | py | Python | tests/app/tests/test_webpack.py | codetigerco/django-webpack-loader | 5e14eb3b82a92226b27788a08ac8bf08d6eb131e | [
"MIT"
] | null | null | null | tests/app/tests/test_webpack.py | codetigerco/django-webpack-loader | 5e14eb3b82a92226b27788a08ac8bf08d6eb131e | [
"MIT"
] | null | null | null | tests/app/tests/test_webpack.py | codetigerco/django-webpack-loader | 5e14eb3b82a92226b27788a08ac8bf08d6eb131e | [
"MIT"
] | 3 | 2020-06-19T15:41:19.000Z | 2020-10-05T08:58:10.000Z | import json
import os
import time
from subprocess import call
from threading import Thread
import django
from django.conf import settings
from django.test import RequestFactory, TestCase
from django.views.generic.base import TemplateView
from django_jinja.builtins import DEFAULT_EXTENSIONS
from unittest2 import skipIf... | 41.676113 | 146 | 0.61191 | import json
import os
import time
from subprocess import call
from threading import Thread
import django
from django.conf import settings
from django.test import RequestFactory, TestCase
from django.views.generic.base import TemplateView
from django_jinja.builtins import DEFAULT_EXTENSIONS
from unittest2 import skipIf... | 9,156 | 503 | 23 |
07d1a77517a90a65b1582298f4f1fabcaea35154 | 871 | py | Python | zerver/views/attachments.py | ricardoteixeiraduarte/zulip | 149132348feda1c6929e94e72abb167cc882fc74 | [
"Apache-2.0"
] | 3 | 2018-12-04T01:44:43.000Z | 2019-05-13T06:16:21.000Z | zerver/views/attachments.py | ricardoteixeiraduarte/zulip | 149132348feda1c6929e94e72abb167cc882fc74 | [
"Apache-2.0"
] | 58 | 2018-11-27T15:18:54.000Z | 2018-12-09T13:43:07.000Z | zerver/views/attachments.py | ricardoteixeiraduarte/zulip | 149132348feda1c6929e94e72abb167cc882fc74 | [
"Apache-2.0"
] | 9 | 2019-11-04T18:59:29.000Z | 2022-03-22T17:46:37.000Z | from django.http import HttpRequest, HttpResponse
from zerver.models import UserProfile
from zerver.lib.actions import notify_attachment_update
from zerver.lib.validator import check_int
from zerver.lib.response import json_success
from zerver.lib.attachments import user_attachments, remove_attachment, \
access_at... | 41.47619 | 96 | 0.777268 | from django.http import HttpRequest, HttpResponse
from zerver.models import UserProfile
from zerver.lib.actions import notify_attachment_update
from zerver.lib.validator import check_int
from zerver.lib.response import json_success
from zerver.lib.attachments import user_attachments, remove_attachment, \
access_at... | 488 | 0 | 46 |
84fd261465f62516dc0af20810d688ccad73a067 | 2,863 | py | Python | coyote_framework/util/apps/parallel.py | vaibhavrastogi1988/python_testing_framework | 583a2286479ed0ccda309c866a403dc92fa1bb3b | [
"MIT"
] | null | null | null | coyote_framework/util/apps/parallel.py | vaibhavrastogi1988/python_testing_framework | 583a2286479ed0ccda309c866a403dc92fa1bb3b | [
"MIT"
] | null | null | null | coyote_framework/util/apps/parallel.py | vaibhavrastogi1988/python_testing_framework | 583a2286479ed0ccda309c866a403dc92fa1bb3b | [
"MIT"
] | null | null | null | from multiprocessing import Process, Queue
import warnings
class ErrorInProcessException(RuntimeError):
"""Exception raised when one or more parallel processes raises an exception"""
def run_parallel(*functions):
"""Runs a series of functions in parallel. Return values are ordered by the order in which thei... | 37.671053 | 120 | 0.648271 | from multiprocessing import Process, Queue
import warnings
class ErrorInProcessException(RuntimeError):
"""Exception raised when one or more parallel processes raises an exception"""
def __init__(self, message, errors, *args, **kwargs):
self.message = message
self.errors = errors
sup... | 653 | 0 | 80 |
052059728aad75e7ecd44a97f4cab5c5b0b4bbc9 | 898 | py | Python | ms2ldaviz/update_features.py | RP0001/ms2ldaviz | 35ae516f5d3ec9d1a348e8308a4ea50f3ebcdfd7 | [
"MIT"
] | null | null | null | ms2ldaviz/update_features.py | RP0001/ms2ldaviz | 35ae516f5d3ec9d1a348e8308a4ea50f3ebcdfd7 | [
"MIT"
] | null | null | null | ms2ldaviz/update_features.py | RP0001/ms2ldaviz | 35ae516f5d3ec9d1a348e8308a4ea50f3ebcdfd7 | [
"MIT"
] | null | null | null | # Script to add the min and max mz values to feature objects
# takes as input the path of a dictionary file that must have a 'features' key
import os
import pickle
import numpy as np
import sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ms2ldaviz.settings")
import django
django.setup()
from basicviz.models im... | 25.657143 | 78 | 0.717149 | # Script to add the min and max mz values to feature objects
# takes as input the path of a dictionary file that must have a 'features' key
import os
import pickle
import numpy as np
import sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ms2ldaviz.settings")
import django
django.setup()
from basicviz.models im... | 0 | 0 | 0 |
c7a7e6ed0fe4cda560f6e62492631d7e16acbb55 | 1,184 | py | Python | builder/version.py | MyConbook/datatool | 1c12bb5124b48ae827c4832896fd81bf711ad44e | [
"Apache-2.0"
] | null | null | null | builder/version.py | MyConbook/datatool | 1c12bb5124b48ae827c4832896fd81bf711ad44e | [
"Apache-2.0"
] | null | null | null | builder/version.py | MyConbook/datatool | 1c12bb5124b48ae827c4832896fd81bf711ad44e | [
"Apache-2.0"
] | null | null | null | import os
import json
| 24.163265 | 112 | 0.717061 | import os
import json
class Version(object):
def __init__(self, options):
self.options = options
self.file_path = options.get_output_path("version.json")
def read(self):
self.is_new = not os.path.exists(self.file_path)
if not self.is_new:
# Read version file
ver_file = open(self.file_path, "r")
ver... | 995 | 1 | 166 |
942405e40afdd88558f03c151717b3c3dd3b1fe0 | 2,282 | py | Python | octavia-cli/octavia_cli/init/commands.py | faros-ai/airbyte | 2ebafe1817a71b5c0a8f8b6f448dbef9db708668 | [
"MIT"
] | 22 | 2020-08-27T00:47:20.000Z | 2020-09-17T15:39:39.000Z | octavia-cli/octavia_cli/init/commands.py | burmecia/airbyte | b9f79ccdf085ae69cff8743fc3f3191ef2b579d9 | [
"MIT"
] | 116 | 2020-08-27T01:11:27.000Z | 2020-09-19T02:47:52.000Z | octavia-cli/octavia_cli/init/commands.py | burmecia/airbyte | b9f79ccdf085ae69cff8743fc3f3191ef2b579d9 | [
"MIT"
] | 1 | 2020-09-15T06:10:01.000Z | 2020-09-15T06:10:01.000Z | #
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#
import importlib.resources as pkg_resources
import os
from pathlib import Path
from typing import Iterable, Tuple
import click
from octavia_cli.base_commands import OctaviaCommand
from . import example_files
DIRECTORIES_TO_CREATE = {"connections", "destin... | 38.677966 | 106 | 0.738826 | #
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#
import importlib.resources as pkg_resources
import os
from pathlib import Path
from typing import Iterable, Tuple
import click
from octavia_cli.base_commands import OctaviaCommand
from . import example_files
DIRECTORIES_TO_CREATE = {"connections", "destin... | 1,601 | 0 | 68 |
8315d2c7afb85dde1c99d1c84afee33fbbff73e6 | 5,734 | py | Python | applets/playgrounds/plots_playground.py | xenomarz/deep-signature | f831f05971727c5d00cf3b5c556b6a8b658048df | [
"MIT"
] | null | null | null | applets/playgrounds/plots_playground.py | xenomarz/deep-signature | f831f05971727c5d00cf3b5c556b6a8b658048df | [
"MIT"
] | null | null | null | applets/playgrounds/plots_playground.py | xenomarz/deep-signature | f831f05971727c5d00cf3b5c556b6a8b658048df | [
"MIT"
] | null | null | null | # python peripherals
import random
import os
import sys
import math
sys.path.insert(1, os.path.join(sys.path[0], '../..'))
# numpy
import numpy
# pandas
import pandas
# ipython
from IPython.display import display, HTML
# matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import matplotlib... | 36.062893 | 121 | 0.844785 | # python peripherals
import random
import os
import sys
import math
sys.path.insert(1, os.path.join(sys.path[0], '../..'))
# numpy
import numpy
# pandas
import pandas
# ipython
from IPython.display import display, HTML
# matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import matplotlib... | 0 | 0 | 0 |
5005ed493c0e7ffb6bca0eff9853fdaa2a10ac62 | 1,204 | py | Python | api/views.py | arwhyte/met | f80fbf65366d13413cebf4f1d49f7ba2ec0d5cac | [
"MIT"
] | null | null | null | api/views.py | arwhyte/met | f80fbf65366d13413cebf4f1d49f7ba2ec0d5cac | [
"MIT"
] | 5 | 2018-11-27T01:31:17.000Z | 2021-06-10T21:02:20.000Z | api/views.py | arwhyte/met | f80fbf65366d13413cebf4f1d49f7ba2ec0d5cac | [
"MIT"
] | 1 | 2018-12-17T17:04:15.000Z | 2018-12-17T17:04:15.000Z | from django.shortcuts import render
from met.models import Artist
from api.serializers import ArtistSerializer
from rest_framework import generics, permissions, status, viewsets
from rest_framework.response import Response
class ArtistViewSet(viewsets.ModelViewSet):
"""
This ViewSet provides both 'list' and 'detai... | 31.684211 | 73 | 0.817276 | from django.shortcuts import render
from met.models import Artist
from api.serializers import ArtistSerializer
from rest_framework import generics, permissions, status, viewsets
from rest_framework.response import Response
class ArtistViewSet(viewsets.ModelViewSet):
"""
This ViewSet provides both 'list' and 'detai... | 179 | 427 | 94 |
ff094f9844c007f21c1361d067d8f484dff418e6 | 27,270 | py | Python | pokeminer/notification.py | levijoseph/Levi | e8058933e8830fa07c6fbecbb15a0b3c585b402d | [
"MIT"
] | null | null | null | pokeminer/notification.py | levijoseph/Levi | e8058933e8830fa07c6fbecbb15a0b3c585b402d | [
"MIT"
] | null | null | null | pokeminer/notification.py | levijoseph/Levi | e8058933e8830fa07c6fbecbb15a0b3c585b402d | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta, timezone
from collections import deque
from math import sqrt
from time import monotonic
from logging import getLogger
from pkg_resources import resource_stream
from tempfile import NamedTemporaryFile
from .utils import load_pickle, dump_pickle
from .db import Session, get_poke... | 38.901569 | 121 | 0.579941 | from datetime import datetime, timedelta, timezone
from collections import deque
from math import sqrt
from time import monotonic
from logging import getLogger
from pkg_resources import resource_stream
from tempfile import NamedTemporaryFile
from .utils import load_pickle, dump_pickle
from .db import Session, get_poke... | 7,739 | 15,793 | 69 |
f1c1bf77c34041980fcc84957b781098ab32a71f | 3,159 | py | Python | AbletonLiveScripts/v10/ComradeEncoders/skin.py | lzref/ComradeEncoders | 154a10d7d1c83e6b8f28af7f19ee6cb2a45a88e9 | [
"MIT"
] | 1 | 2021-11-26T01:52:30.000Z | 2021-11-26T01:52:30.000Z | AbletonLiveScripts/v10/ComradeEncoders/skin.py | lzref/ComradeEncoders | 154a10d7d1c83e6b8f28af7f19ee6cb2a45a88e9 | [
"MIT"
] | null | null | null | AbletonLiveScripts/v10/ComradeEncoders/skin.py | lzref/ComradeEncoders | 154a10d7d1c83e6b8f28af7f19ee6cb2a45a88e9 | [
"MIT"
] | 1 | 2021-11-26T01:52:31.000Z | 2021-11-26T01:52:31.000Z | # uncompyle6 version 3.4.1
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.16 (v2.7.16:413a49145e, Mar 2 2019, 14:32:10)
# [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
# Embedded file name: /Users/versonator/Jenkins/live/output/mac_64_static/Release/python-bundle/MIDI Remote Scripts/SL_MkIII/ski... | 25.475806 | 132 | 0.600823 | # uncompyle6 version 3.4.1
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.16 (v2.7.16:413a49145e, Mar 2 2019, 14:32:10)
# [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
# Embedded file name: /Users/versonator/Jenkins/live/output/mac_64_static/Release/python-bundle/MIDI Remote Scripts/SL_MkIII/ski... | 0 | 2,614 | 23 |
21379215feb06f7d3c18bd160f2818dca2bcd3d0 | 186 | py | Python | 1117 - Validacao de Nota.py | le16bits/URI---Python | 9d22ae74f008104bc9c3c0e2d5f8cd59303bc1db | [
"Apache-2.0"
] | null | null | null | 1117 - Validacao de Nota.py | le16bits/URI---Python | 9d22ae74f008104bc9c3c0e2d5f8cd59303bc1db | [
"Apache-2.0"
] | null | null | null | 1117 - Validacao de Nota.py | le16bits/URI---Python | 9d22ae74f008104bc9c3c0e2d5f8cd59303bc1db | [
"Apache-2.0"
] | null | null | null | med=0
c=0
while c!=2:
n=float(input())
if n>=0 and n<=10:
med=med+n
c=c+1
else:
print("nota invalida")
med=med/2
print("media = %.2f" %med)
| 14.307692 | 32 | 0.467742 | med=0
c=0
while c!=2:
n=float(input())
if n>=0 and n<=10:
med=med+n
c=c+1
else:
print("nota invalida")
med=med/2
print("media = %.2f" %med)
| 0 | 0 | 0 |
9bd8849c7f1a7f3654e2873c3d90677a63dbc9bc | 517 | py | Python | atcoder/agc/agc026_b.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | 1 | 2018-11-12T15:18:55.000Z | 2018-11-12T15:18:55.000Z | atcoder/agc/agc026_b.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | atcoder/agc/agc026_b.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | for _ in range(int(input())):
A, B, C, D = map(int, input().split())
if A < B or C + D < B:
print("No")
continue
elif C >= B - 1:
print("Yes")
continue
ret = []
s_set = set()
now = A
while True:
now %= B
if now in s_set:
print("Yes"... | 20.68 | 42 | 0.382979 | for _ in range(int(input())):
A, B, C, D = map(int, input().split())
if A < B or C + D < B:
print("No")
continue
elif C >= B - 1:
print("Yes")
continue
ret = []
s_set = set()
now = A
while True:
now %= B
if now in s_set:
print("Yes"... | 0 | 0 | 0 |
988add07bc2ff22289d10f731798d2cfd279ae40 | 3,529 | py | Python | program files/plot_3d.py | FiZ-ix/FSAE-Tyre-Analysis | f41a6f84c221404983e6a8af5341aa2193126c4d | [
"MIT"
] | 3 | 2020-10-23T13:03:35.000Z | 2020-11-01T01:41:55.000Z | program files/plot_3d.py | FiZ-ix/FSAE-Tyre-Analysis | f41a6f84c221404983e6a8af5341aa2193126c4d | [
"MIT"
] | null | null | null | program files/plot_3d.py | FiZ-ix/FSAE-Tyre-Analysis | f41a6f84c221404983e6a8af5341aa2193126c4d | [
"MIT"
] | null | null | null | '''
A.Q. Snyder
TFR Tire Data Analysis
this code is written to analyze the TTC FSAE tire data
the code is written in a linear, easy to read format catered towards an engineering mindset
rather than efficient software
Contact: aaron.snyder@temple.edu for help running or understanding the program
'''
#_____________... | 34.940594 | 137 | 0.731935 | '''
A.Q. Snyder
TFR Tire Data Analysis
this code is written to analyze the TTC FSAE tire data
the code is written in a linear, easy to read format catered towards an engineering mindset
rather than efficient software
Contact: aaron.snyder@temple.edu for help running or understanding the program
'''
#_____________... | 0 | 0 | 0 |
e32f3c14c79545ff05c55c5bc297341537edf039 | 4,614 | py | Python | clickhouse.py | RaviTejaKomma/clickhouse-data-backup | f6f001346b94ab198068f424b008374e97302b5b | [
"MIT"
] | 1 | 2021-11-29T10:46:46.000Z | 2021-11-29T10:46:46.000Z | clickhouse.py | RaviTejaKomma/clickhouse-data-backup | f6f001346b94ab198068f424b008374e97302b5b | [
"MIT"
] | null | null | null | clickhouse.py | RaviTejaKomma/clickhouse-data-backup | f6f001346b94ab198068f424b008374e97302b5b | [
"MIT"
] | null | null | null | from clickhouse_driver import Client
from utils import *
from configs.default import *
def connect_db():
'''
Creates a connection to the CLickhouse database.
:return: Error if some exception occurred else tuple containing connection object and None.
'''
try:
client = Client(host='localhost... | 34.954545 | 193 | 0.651062 | from clickhouse_driver import Client
from utils import *
from configs.default import *
def connect_db():
'''
Creates a connection to the CLickhouse database.
:return: Error if some exception occurred else tuple containing connection object and None.
'''
try:
client = Client(host='localhost... | 0 | 0 | 0 |
60d7d86933d74789e6af8587cdafb6707d35891c | 6,966 | py | Python | anytask/courses/pythontask.py | AnnaSvalova/anytask | f814b43c496f67a2efe2a150873a1ae32ad97449 | [
"MIT"
] | 1 | 2018-12-03T05:48:43.000Z | 2018-12-03T05:48:43.000Z | anytask/courses/pythontask.py | AnnaSvalova/anytask | f814b43c496f67a2efe2a150873a1ae32ad97449 | [
"MIT"
] | null | null | null | anytask/courses/pythontask.py | AnnaSvalova/anytask | f814b43c496f67a2efe2a150873a1ae32ad97449 | [
"MIT"
] | 1 | 2021-09-18T22:38:20.000Z | 2021-09-18T22:38:20.000Z | from tasks.models import Task, TaskTaken
from issues.models import Issue
from django.conf import settings
from django.db.models import Q
from django.db import transaction
from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.contrib.auth.decorators import login_required
from django.t... | 35.005025 | 115 | 0.652168 | from tasks.models import Task, TaskTaken
from issues.models import Issue
from django.conf import settings
from django.db.models import Q
from django.db import transaction
from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.contrib.auth.decorators import login_required
from django.t... | 6,164 | 8 | 301 |
70f243da8ea27dfd8b48b82b37efe2226ca86dd1 | 3,967 | py | Python | dynaconf/base.py | rochacbruno/dynaconf_ng | 2127ce78c511047f4aa9499a826caf842dcdf036 | [
"MIT"
] | 6 | 2021-07-08T05:53:26.000Z | 2022-03-02T15:11:42.000Z | dynaconf/base.py | rochacbruno/dynaconf_ng | 2127ce78c511047f4aa9499a826caf842dcdf036 | [
"MIT"
] | 1 | 2021-07-13T13:49:43.000Z | 2021-07-13T13:49:43.000Z | dynaconf/base.py | rochacbruno/dynaconf_ng | 2127ce78c511047f4aa9499a826caf842dcdf036 | [
"MIT"
] | null | null | null | from pathlib import Path
from typing import Any, Optional, Union
from pydantic import BaseModel, BaseSettings, Extra, Field
SettingsField = Field # noqa
"""Extendable settings field"""
class BaseDynaconf:
"""Extendable model"""
def _d_get_value(self, key: str, default: Any = None) -> Any:
"""Get ... | 31.23622 | 79 | 0.586337 | from pathlib import Path
from typing import Any, Optional, Union
from pydantic import BaseModel, BaseSettings, Extra, Field
SettingsField = Field # noqa
"""Extendable settings field"""
class BaseDynaconf:
"""Extendable model"""
def _d_get_value(self, key: str, default: Any = None) -> Any:
"""Get ... | 389 | 0 | 27 |
6441c7d1b42e0ec4602b09d8c03ae526ed933d76 | 1,728 | py | Python | GUI/printer/Pillow-2.7.0/Tests/test_image_mode.py | y-gupta/rfid-auth-system | 44f3de884d05e1906757b97f0a1a140469a3290f | [
"Apache-2.0"
] | 5 | 2015-01-21T14:13:34.000Z | 2016-05-14T06:53:38.000Z | GUI/printer/Pillow-2.7.0/Tests/test_image_mode.py | 1upon0/rfid-auth-system | 44f3de884d05e1906757b97f0a1a140469a3290f | [
"Apache-2.0"
] | null | null | null | GUI/printer/Pillow-2.7.0/Tests/test_image_mode.py | 1upon0/rfid-auth-system | 44f3de884d05e1906757b97f0a1a140469a3290f | [
"Apache-2.0"
] | 3 | 2015-02-01T17:10:39.000Z | 2019-12-05T05:21:42.000Z | from helper import unittest, PillowTestCase, hopper
from PIL import Image
if __name__ == '__main__':
unittest.main()
# End of file
| 29.793103 | 71 | 0.489583 | from helper import unittest, PillowTestCase, hopper
from PIL import Image
class TestImageMode(PillowTestCase):
def test_sanity(self):
im = hopper()
im.mode
from PIL import ImageMode
ImageMode.getmode("1")
ImageMode.getmode("L")
ImageMode.getmode("P")
Im... | 1,496 | 15 | 77 |
eab6c257c582df55a8d67f6190eb0e09bd9ee002 | 5,713 | py | Python | pvlibs/data_import/loana.py | bfw930/pvlibs | 94bed6cbca1b349eac29136d6703959aeb61bf29 | [
"MIT"
] | null | null | null | pvlibs/data_import/loana.py | bfw930/pvlibs | 94bed6cbca1b349eac29136d6703959aeb61bf29 | [
"MIT"
] | 5 | 2020-03-24T17:26:11.000Z | 2020-12-15T04:39:42.000Z | pvlibs/data_import/loana.py | bfw930/pvlibs | 94bed6cbca1b349eac29136d6703959aeb61bf29 | [
"MIT"
] | null | null | null |
''' Functions
Summary:
This file contains
Example:
Usage of
Todo:
*
'''
''' Imports '''
# data array handling
import numpy as np
# data table handling
import pandas as pd
from operator import itemgetter
from itertools import groupby
''' Current-Voltage File Format Parse Functions '''
def ty... | 24.731602 | 117 | 0.561001 |
''' Functions
Summary:
This file contains
Example:
Usage of
Todo:
*
'''
''' Imports '''
# data array handling
import numpy as np
# data table handling
import pandas as pd
from operator import itemgetter
from itertools import groupby
''' Current-Voltage File Format Parse Functions '''
def ty... | 0 | 0 | 0 |
109fa9280bd1e97603de17491d9fb060284caed0 | 2,121 | py | Python | test/unit/core/hooks/test_HooksRegistry.py | novopl/peltak | 7c8ac44f994d923091a534870960fdae1e15e95e | [
"Apache-2.0"
] | 6 | 2015-09-10T13:20:34.000Z | 2021-02-15T08:10:27.000Z | test/unit/core/hooks/test_HooksRegistry.py | novopl/peltak | 7c8ac44f994d923091a534870960fdae1e15e95e | [
"Apache-2.0"
] | 41 | 2015-09-09T12:44:55.000Z | 2021-06-01T23:25:56.000Z | test/unit/core/hooks/test_HooksRegistry.py | novopl/peltak | 7c8ac44f994d923091a534870960fdae1e15e95e | [
"Apache-2.0"
] | null | null | null | # pylint: disable=missing-docstring
from unittest.mock import Mock
import pytest
from peltak.core.hooks import HooksRegister
| 23.054348 | 65 | 0.7124 | # pylint: disable=missing-docstring
from unittest.mock import Mock
import pytest
from peltak.core.hooks import HooksRegister
def test_is_called_when_subscribed():
fake_handler = Mock()
register = HooksRegister()
register('fake-hook')(fake_handler)
register.call('fake-hook')
fake_handler.assert... | 1,802 | 0 | 184 |
6793f836930f73e131d4395418728751c84330db | 2,155 | py | Python | backend/src/tests/test_datasets.py | VarityPlatform/lablr | f6eee78f5eb352f21c849a5ee72ee23b418167e1 | [
"MIT"
] | 1 | 2021-09-20T18:21:15.000Z | 2021-09-20T18:21:15.000Z | backend/src/tests/test_datasets.py | VarityPlatform/lablr | f6eee78f5eb352f21c849a5ee72ee23b418167e1 | [
"MIT"
] | null | null | null | backend/src/tests/test_datasets.py | VarityPlatform/lablr | f6eee78f5eb352f21c849a5ee72ee23b418167e1 | [
"MIT"
] | null | null | null | """
Test datasets
"""
from fastapi.testclient import TestClient
from main import app, PREFIX
client = TestClient(app)
EXAMPLE_DATASET_BODY = {
"name": "Unit Test Dataset",
"description": "Dataset created during a unit test",
"labels": [
{
"name": "Boolean",
"variant": "bo... | 25.963855 | 83 | 0.657077 | """
Test datasets
"""
from fastapi.testclient import TestClient
from main import app, PREFIX
client = TestClient(app)
EXAMPLE_DATASET_BODY = {
"name": "Unit Test Dataset",
"description": "Dataset created during a unit test",
"labels": [
{
"name": "Boolean",
"variant": "bo... | 0 | 0 | 0 |
6fa132238cc81afebcb7ad528f8226ca00e5c954 | 1,484 | py | Python | stego/mainPage/pythonScripts/decodification_commas.py | alexauf/steganographyLab | 57d47d81f9e6b076740d817e7334270420e0c489 | [
"Apache-2.0"
] | null | null | null | stego/mainPage/pythonScripts/decodification_commas.py | alexauf/steganographyLab | 57d47d81f9e6b076740d817e7334270420e0c489 | [
"Apache-2.0"
] | null | null | null | stego/mainPage/pythonScripts/decodification_commas.py | alexauf/steganographyLab | 57d47d81f9e6b076740d817e7334270420e0c489 | [
"Apache-2.0"
] | null | null | null | import os
import re
#If len > 0, the HTML line given contains single and/or double quotation marks
#Takes the HTML lines with quotation marks and returns the codification
#depending on if it has single or double quotation marks.
if __name__ == "__main__":
# test_bits_total()
# test_num_attributes_line... | 20.328767 | 78 | 0.588275 | import os
import re
#If len > 0, the HTML line given contains single and/or double quotation marks
def quotation_marks_lines (input):
re_list = [r'"(.*?)"', r"'(.*?)'"]
matches = []
for r in re_list:
matches += re.findall(r, input)
return len(matches)
def total_capacity (input):
maxbit... | 1,060 | 0 | 90 |
289b8db8ffece4af25a2aca154df3f13fc021a4d | 7,428 | py | Python | pricewars_merchant.py | hpi-epic/pricewars-merchant | 7981dad52034493f1f77e21e2aa297598c6ef769 | [
"MIT"
] | null | null | null | pricewars_merchant.py | hpi-epic/pricewars-merchant | 7981dad52034493f1f77e21e2aa297598c6ef769 | [
"MIT"
] | 14 | 2017-07-05T12:37:52.000Z | 2018-09-05T08:44:47.000Z | pricewars_merchant.py | hpi-epic/pricewars-merchant | 7981dad52034493f1f77e21e2aa297598c6ef769 | [
"MIT"
] | 8 | 2017-06-18T08:48:30.000Z | 2021-09-24T11:20:22.000Z | import json
from abc import ABCMeta, abstractmethod
import time
import threading
import hashlib
import base64
import random
from typing import Optional, List
from pathlib import Path
from api import Marketplace, Producer
from server import MerchantServer
from models import SoldOffer, Offer
| 38.487047 | 139 | 0.630587 | import json
from abc import ABCMeta, abstractmethod
import time
import threading
import hashlib
import base64
import random
from typing import Optional, List
from pathlib import Path
from api import Marketplace, Producer
from server import MerchantServer
from models import SoldOffer, Offer
class PricewarsMerchant(me... | 5,532 | 1,580 | 23 |
88d13ee6499a366bc31e75cade118cbe9a24e1e1 | 1,955 | py | Python | copy_timecode.py | flow-dev/CopyTimecodeAtoB | 5e4852dbff6d128b00160bddc20da5b222fe4f33 | [
"MIT"
] | null | null | null | copy_timecode.py | flow-dev/CopyTimecodeAtoB | 5e4852dbff6d128b00160bddc20da5b222fe4f33 | [
"MIT"
] | null | null | null | copy_timecode.py | flow-dev/CopyTimecodeAtoB | 5e4852dbff6d128b00160bddc20da5b222fe4f33 | [
"MIT"
] | null | null | null | import argparse
import glob
import os
from video_ffmpeg_utils import VideoFfmpegUtils
"""
Copy Timecode and enc ProResHQ or h265
Example:
python3 copy_timecode.py \
--video-src "PATH_TO_VIDEO_SRC" \
--video-out "PATH_TO_VIDEO_OUT" \
--codec h265 \
--copy-tc \
"""
# --------------... | 31.031746 | 120 | 0.662916 | import argparse
import glob
import os
from video_ffmpeg_utils import VideoFfmpegUtils
"""
Copy Timecode and enc ProResHQ or h265
Example:
python3 copy_timecode.py \
--video-src "PATH_TO_VIDEO_SRC" \
--video-out "PATH_TO_VIDEO_OUT" \
--codec h265 \
--copy-tc \
"""
# --------------... | 0 | 0 | 0 |
663ab76b35a4777947c738b5b827fe96066f92dc | 53,509 | py | Python | idpmodem/codecs/common.py | Inmarsat/idpmodem | 2b77f7ead25fa71a390fb4eb97ae966a464d6132 | [
"Apache-2.0"
] | 3 | 2021-01-07T16:01:54.000Z | 2021-12-19T04:15:12.000Z | idpmodem/codecs/common.py | Inmarsat/idpmodem | 2b77f7ead25fa71a390fb4eb97ae966a464d6132 | [
"Apache-2.0"
] | 1 | 2021-12-17T15:09:06.000Z | 2021-12-17T15:09:06.000Z | idpmodem/codecs/common.py | Inmarsat/idpmodem | 2b77f7ead25fa71a390fb4eb97ae966a464d6132 | [
"Apache-2.0"
] | 2 | 2019-02-06T09:02:40.000Z | 2020-03-17T02:55:16.000Z | """Codec functions for IDP Common Message Format supported by Inmarsat MGS.
Also supported on ORBCOMM IGWS1.
"""
from binascii import b2a_base64
from math import log2, ceil
from struct import pack, unpack
from typing import Tuple, Union
from warnings import WarningMessage, warn
import xml.etree.ElementTree as ET
from... | 35.912081 | 85 | 0.556617 | """Codec functions for IDP Common Message Format supported by Inmarsat MGS.
Also supported on ORBCOMM IGWS1.
"""
from binascii import b2a_base64
from math import log2, ceil
from struct import pack, unpack
from typing import Tuple, Union
from warnings import WarningMessage, warn
import xml.etree.ElementTree as ET
from... | 17,647 | 0 | 2,226 |
884d81afcabb1bff852b98a3da835296414d403e | 1,109 | py | Python | Python Essential Training/StructuredData.py | RaghuBhogireddy/python | 2f4a0118715dcf6829dc72b32256d5cb1e6df19f | [
"Apache-2.0"
] | null | null | null | Python Essential Training/StructuredData.py | RaghuBhogireddy/python | 2f4a0118715dcf6829dc72b32256d5cb1e6df19f | [
"Apache-2.0"
] | null | null | null | Python Essential Training/StructuredData.py | RaghuBhogireddy/python | 2f4a0118715dcf6829dc72b32256d5cb1e6df19f | [
"Apache-2.0"
] | null | null | null |
if __name__ == "__main__" : main() | 26.404762 | 101 | 0.542831 |
def main():
lists()
tuples()
dictionaries()
def lists():
# Lists are mutable means we can alter the data in the List Object
game = ['Rock', 'Paper', 'Scissors', 'Lizard', 'Spark']
# We can add items using append
game.append('Cricket')
print(game)
print('=====================')
... | 978 | 0 | 92 |
7dbd1e9b99127d118ff1370eda23f186ecbe47ac | 82 | py | Python | tests/__init__.py | omarvaneer/pharynx_redox | ffcd5733fd0823244f50590951e9af0bc9ae2518 | [
"MIT"
] | 2 | 2018-06-08T12:45:03.000Z | 2018-07-13T04:17:01.000Z | tests/__init__.py | omarvaneer/pharynx_redox | ffcd5733fd0823244f50590951e9af0bc9ae2518 | [
"MIT"
] | 17 | 2020-03-18T11:43:39.000Z | 2020-07-21T18:04:25.000Z | tests/__init__.py | half-adder/pharynx_redox | a5b99f6afb4a36a021d0439bb15d2c826de605b1 | [
"MIT"
] | 3 | 2021-07-21T16:14:28.000Z | 2021-07-27T15:38:39.000Z | from pathlib import Path
TEST_DATA_DIR = Path("/Users/sean/code/pharedox/data")
| 16.4 | 54 | 0.768293 | from pathlib import Path
TEST_DATA_DIR = Path("/Users/sean/code/pharedox/data")
| 0 | 0 | 0 |
d9df54afb8190932c8344788b1e8fec7824d4429 | 4,582 | py | Python | fastproject/modules/users/service.py | jorge4larcon/fastproject | 0a091940c22e27d813f38819027081314d334c22 | [
"MIT"
] | 12 | 2022-02-11T04:03:17.000Z | 2022-02-15T03:34:50.000Z | fastproject/modules/users/service.py | jorge4larcon/fastproject | 0a091940c22e27d813f38819027081314d334c22 | [
"MIT"
] | null | null | null | fastproject/modules/users/service.py | jorge4larcon/fastproject | 0a091940c22e27d813f38819027081314d334c22 | [
"MIT"
] | 1 | 2022-02-13T02:55:50.000Z | 2022-02-13T02:55:50.000Z | """Service module."""
import datetime
import uuid
import zoneinfo
from typing import Any, Optional
from ... import config
from ...utils import encoding
from . import password_hashing, repository
async def create_user(
username: str,
email: str,
first_name: str,
last_name: str,
password: str,
... | 34.712121 | 80 | 0.691619 | """Service module."""
import datetime
import uuid
import zoneinfo
from typing import Any, Optional
from ... import config
from ...utils import encoding
from . import password_hashing, repository
async def create_user(
username: str,
email: str,
first_name: str,
last_name: str,
password: str,
... | 0 | 0 | 0 |
45c50b07d8e2b5ce4b964895748ab5d6910015ff | 1,091 | py | Python | pySnowRadar/algorithms/GSFC.py | kingjml/pySnowRadar | a64721c3a84f255aa3bb9b872682a79969f7b1be | [
"MIT"
] | 4 | 2020-06-04T00:25:46.000Z | 2021-12-17T15:08:35.000Z | pySnowRadar/algorithms/GSFC.py | kingjml/pySnowRadar | a64721c3a84f255aa3bb9b872682a79969f7b1be | [
"MIT"
] | 7 | 2020-02-19T11:34:26.000Z | 2020-10-02T12:52:17.000Z | pySnowRadar/algorithms/GSFC.py | kingjml/pySnowRadar | a64721c3a84f255aa3bb9b872682a79969f7b1be | [
"MIT"
] | null | null | null | import numpy as np
def GSFC_NK(data, **kwargs):
'''
Picker algorithm by NASA Goddard
Arguments must include the snowradar trace data itself (passed as a 1D float array) as well as
any parameters required by the algorithm for layer-picking
Only 2 picked layers are expected
1. air-snow lay... | 33.060606 | 99 | 0.694775 | import numpy as np
def GSFC_NK(data, **kwargs):
'''
Picker algorithm by NASA Goddard
Arguments must include the snowradar trace data itself (passed as a 1D float array) as well as
any parameters required by the algorithm for layer-picking
Only 2 picked layers are expected
1. air-snow lay... | 0 | 0 | 0 |
bd76b89d924fd22fe938563772ebe5dbb2038dcc | 205 | py | Python | xarray_schema/types.py | carbonplan/xarray-schema | 0af2699ccc06b8028acff138deb452000c7bea86 | [
"MIT"
] | 16 | 2021-11-08T17:38:16.000Z | 2022-03-22T12:06:01.000Z | xarray_schema/types.py | carbonplan/xarray-schema | 0af2699ccc06b8028acff138deb452000c7bea86 | [
"MIT"
] | 25 | 2021-11-18T06:18:43.000Z | 2022-03-31T06:26:42.000Z | xarray_schema/types.py | carbonplan/xarray-schema | 0af2699ccc06b8028acff138deb452000c7bea86 | [
"MIT"
] | 2 | 2021-11-08T20:46:01.000Z | 2022-03-14T16:50:53.000Z | from typing import Dict, Tuple, Union
from numpy.typing import DTypeLike # noqa: F401
DimsT = Tuple[Union[str, None]]
ShapeT = Tuple[Union[int, None]]
ChunksT = Union[bool, Dict[str, Union[int, None]]]
| 25.625 | 50 | 0.721951 | from typing import Dict, Tuple, Union
from numpy.typing import DTypeLike # noqa: F401
DimsT = Tuple[Union[str, None]]
ShapeT = Tuple[Union[int, None]]
ChunksT = Union[bool, Dict[str, Union[int, None]]]
| 0 | 0 | 0 |
932caf98ac61173ef299a1e94e97dd848d7eb492 | 195 | py | Python | modules/feedback/models/__init__.py | heolin123/funcrowd | 20167783de208394c09ed0429a5f02ec6dd79c42 | [
"MIT"
] | null | null | null | modules/feedback/models/__init__.py | heolin123/funcrowd | 20167783de208394c09ed0429a5f02ec6dd79c42 | [
"MIT"
] | 11 | 2019-11-12T23:26:45.000Z | 2021-06-10T17:37:23.000Z | modules/feedback/models/__init__.py | heolin123/funcrowd | 20167783de208394c09ed0429a5f02ec6dd79c42 | [
"MIT"
] | null | null | null | from modules.feedback.models.feedback_field import FeedbackField
from modules.feedback.models.feedback_score_field import FeedbackScoreField
from modules.feedback.models.feedback import Feedback
| 48.75 | 75 | 0.892308 | from modules.feedback.models.feedback_field import FeedbackField
from modules.feedback.models.feedback_score_field import FeedbackScoreField
from modules.feedback.models.feedback import Feedback
| 0 | 0 | 0 |
997f062bf1fa44535ddbcb9d6600f67079e41a9f | 1,008 | py | Python | setup.py | Hi-king/redshells | de1bd1c7c95355a0b7f5920dacad7351d065bd4d | [
"MIT"
] | null | null | null | setup.py | Hi-king/redshells | de1bd1c7c95355a0b7f5920dacad7351d065bd4d | [
"MIT"
] | null | null | null | setup.py | Hi-king/redshells | de1bd1c7c95355a0b7f5920dacad7351d065bd4d | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
install_requires = [
'luigi',
'gokart>=0.1.20',
'python-dateutil==2.7.5',
... | 27.243243 | 125 | 0.673611 | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
install_requires = [
'luigi',
'gokart>=0.1.20',
'python-dateutil==2.7.5',
... | 0 | 0 | 0 |
4522b1410f732f09ed17b24de0fed7e2b5760f44 | 3,020 | py | Python | rio_viz/scripts/cli.py | bradh/rio-viz | bc73a06c09e49b19541543f1e758109466ca17f8 | [
"MIT"
] | null | null | null | rio_viz/scripts/cli.py | bradh/rio-viz | bc73a06c09e49b19541543f1e758109466ca17f8 | [
"MIT"
] | null | null | null | rio_viz/scripts/cli.py | bradh/rio-viz | bc73a06c09e49b19541543f1e758109466ca17f8 | [
"MIT"
] | null | null | null | """rio_viz.cli."""
import os
import tempfile
from contextlib import contextmanager, ExitStack
import click
from rio_viz import app, raster
from rio_cogeo.cogeo import cog_validate, cog_translate
from rio_cogeo.profiles import cog_profiles
@contextmanager
def TemporaryRasterFile(dst_path, suffix=".tif"):
"""Cre... | 31.789474 | 90 | 0.613245 | """rio_viz.cli."""
import os
import tempfile
from contextlib import contextmanager, ExitStack
import click
from rio_viz import app, raster
from rio_cogeo.cogeo import cog_validate, cog_translate
from rio_cogeo.profiles import cog_profiles
@contextmanager
def TemporaryRasterFile(dst_path, suffix=".tif"):
"""Cre... | 0 | 0 | 0 |
ddf8a80c9ef40019459999285c100aa0e114c9b4 | 1,040 | py | Python | solo/migrations/0001_initial.py | Saket-Komawar/Forex | a470cb59cc0e9d4ed71713975cd8d2f778540100 | [
"Apache-2.0"
] | null | null | null | solo/migrations/0001_initial.py | Saket-Komawar/Forex | a470cb59cc0e9d4ed71713975cd8d2f778540100 | [
"Apache-2.0"
] | 2 | 2020-06-05T17:30:33.000Z | 2021-06-10T18:53:59.000Z | solo/migrations/0001_initial.py | Saket-Komawar/Forex | a470cb59cc0e9d4ed71713975cd8d2f778540100 | [
"Apache-2.0"
] | 2 | 2017-02-01T09:24:27.000Z | 2017-02-05T17:09:02.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-24 09:04
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
| 29.714286 | 114 | 0.567308 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-24 09:04
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateMo... | 0 | 832 | 23 |
23fc7876e4e6e46fbb838f9d38c3d65f4947fba6 | 26,623 | py | Python | sequana/scripts/main.py | ddesvillechabrol/sequana | c92d6071e782df78566fffd15ad619c8c3df6fe3 | [
"BSD-3-Clause"
] | null | null | null | sequana/scripts/main.py | ddesvillechabrol/sequana | c92d6071e782df78566fffd15ad619c8c3df6fe3 | [
"BSD-3-Clause"
] | null | null | null | sequana/scripts/main.py | ddesvillechabrol/sequana | c92d6071e782df78566fffd15ad619c8c3df6fe3 | [
"BSD-3-Clause"
] | null | null | null | #-*- coding: utf-8 -*-
import sys
import os
import glob
import click
#import click_completion
#click_completion.init()
from sequana import version
import functools
__all__ = ["main"]
import sequana
import colorlog
logger = colorlog.getLogger(__name__)
# This can be used by all commands as a simple decorator
C... | 36.469863 | 190 | 0.645232 | #-*- coding: utf-8 -*-
import sys
import os
import glob
import click
#import click_completion
#click_completion.init()
from sequana import version
import functools
__all__ = ["main"]
import sequana
import colorlog
logger = colorlog.getLogger(__name__)
# This can be used by all commands as a simple decorator
def... | 324 | 0 | 45 |
5d1e7dc3e866c93d2b4626e52d2811ac3aeffb26 | 430 | py | Python | src/euler_python_package/euler_python/medium/p463.py | wilsonify/euler | 5214b776175e6d76a7c6d8915d0e062d189d9b79 | [
"MIT"
] | null | null | null | src/euler_python_package/euler_python/medium/p463.py | wilsonify/euler | 5214b776175e6d76a7c6d8915d0e062d189d9b79 | [
"MIT"
] | null | null | null | src/euler_python_package/euler_python/medium/p463.py | wilsonify/euler | 5214b776175e6d76a7c6d8915d0e062d189d9b79 | [
"MIT"
] | null | null | null | def problem463():
"""
The function $f$ is defined for all positive integers as follows:
• $f(1)=1$
• $f(3)=3$
• $f(2n)=f(n)$
• $f(4n + 1)=2f(2n + 1) - f(n)$
• $f(4n + 3)=3f(2n + 1) - 2f(n)$
The function $S(n)$ is defined as $\\sum_{i=1}^{n}f(i)$.
$... | 21.5 | 69 | 0.439535 | def problem463():
"""
The function $f$ is defined for all positive integers as follows:
• $f(1)=1$
• $f(3)=3$
• $f(2n)=f(n)$
• $f(4n + 1)=2f(2n + 1) - f(n)$
• $f(4n + 3)=3f(2n + 1) - 2f(n)$
The function $S(n)$ is defined as $\\sum_{i=1}^{n}f(i)$.
$... | 0 | 0 | 0 |
f8167a1c1ad122d2aa27edbcc0972069992f92e2 | 792 | py | Python | src/testscrape.py | kelpabc123/UCSDCourseBot | 267900801b00c7f470fc6c2dfb0f0cfe30580b13 | [
"MIT"
] | null | null | null | src/testscrape.py | kelpabc123/UCSDCourseBot | 267900801b00c7f470fc6c2dfb0f0cfe30580b13 | [
"MIT"
] | null | null | null | src/testscrape.py | kelpabc123/UCSDCourseBot | 267900801b00c7f470fc6c2dfb0f0cfe30580b13 | [
"MIT"
] | null | null | null | #this is for testing, an internal testbench to verify implemented features
from bs4 import BeautifulSoup
from course import MyCourse
import requests
import csv
import cscraper
cscraper.updateCSV()
courses = cscraper.findCoursebyID("MaTh 170")
for course in courses:
course.printCourse()
courses = cscraper.findCour... | 30.461538 | 74 | 0.744949 | #this is for testing, an internal testbench to verify implemented features
from bs4 import BeautifulSoup
from course import MyCourse
import requests
import csv
import cscraper
cscraper.updateCSV()
courses = cscraper.findCoursebyID("MaTh 170")
for course in courses:
course.printCourse()
courses = cscraper.findCour... | 0 | 0 | 0 |
b69bfe145a717d98c5a08a40b92361188a96eb44 | 1,455 | py | Python | pymantic/parsers/lark/base.py | machallboyd/pymantic | 159208f1a45d4bfda56adaa0cfdb555cadd89d39 | [
"BSD-3-Clause"
] | 12 | 2016-05-27T07:19:22.000Z | 2022-01-09T04:42:58.000Z | pymantic/parsers/lark/base.py | machallboyd/pymantic | 159208f1a45d4bfda56adaa0cfdb555cadd89d39 | [
"BSD-3-Clause"
] | 5 | 2015-09-07T16:07:46.000Z | 2021-01-04T21:03:18.000Z | pymantic/parsers/lark/base.py | machallboyd/pymantic | 159208f1a45d4bfda56adaa0cfdb555cadd89d39 | [
"BSD-3-Clause"
] | 2 | 2020-03-26T20:40:58.000Z | 2022-02-15T06:18:55.000Z | from pymantic.compat import (
binary_type,
)
class LarkParser(object):
"""Provide a consistent interface for parsing serialized RDF using one
of the lark parsers.
"""
def parse(self, string_or_stream, graph=None):
"""Parse a string or file-like object into RDF primitives and add
t... | 28.529412 | 74 | 0.594502 | from pymantic.compat import (
binary_type,
)
class LarkParser(object):
"""Provide a consistent interface for parsing serialized RDF using one
of the lark parsers.
"""
def __init__(self, lark):
self.lark = lark
def line_by_line_parser(self, stream):
for line in stream: # Equiv... | 171 | 0 | 53 |
d387510f698295a09b2327c0611bdbb9f98c718e | 3,452 | py | Python | utils_ml/tests/unittest/data_processing/test_data_processing_utils.py | RodSernaPerez/utils_ml | 72251447f5c33f3873c746e98f532ce19a5b6003 | [
"MIT"
] | null | null | null | utils_ml/tests/unittest/data_processing/test_data_processing_utils.py | RodSernaPerez/utils_ml | 72251447f5c33f3873c746e98f532ce19a5b6003 | [
"MIT"
] | null | null | null | utils_ml/tests/unittest/data_processing/test_data_processing_utils.py | RodSernaPerez/utils_ml | 72251447f5c33f3873c746e98f532ce19a5b6003 | [
"MIT"
] | null | null | null | import unittest
import numpy as np
from utils_ml.src.data_processing import data_processing_utils
if __name__ == '__main__':
unittest.main()
| 33.514563 | 119 | 0.532155 | import unittest
import numpy as np
from utils_ml.src.data_processing import data_processing_utils
class TestDataProcessingUtils(unittest.TestCase):
MSG = "Data processing utils:: UNITTEST:: "
def test_convert_to_one_hot_vectors_list_with_ints(self):
msg = self.MSG + "convert_to_one_hot_vectors_list... | 3,095 | 184 | 23 |
dc3f2757c0df48ed984cc60afdc04795aceea950 | 8,952 | py | Python | dependencies/FontTools/Mac/TTX.py | charlesmchen/typefacet | 8c6db26d0c599ece16f3704696811275120a4044 | [
"Apache-2.0"
] | 21 | 2015-01-16T05:10:02.000Z | 2021-06-11T20:48:15.000Z | dependencies/FontTools/Mac/TTX.py | charlesmchen/typefacet | 8c6db26d0c599ece16f3704696811275120a4044 | [
"Apache-2.0"
] | 1 | 2019-09-09T12:10:27.000Z | 2020-05-22T10:12:14.000Z | dependencies/FontTools/Mac/TTX.py | charlesmchen/typefacet | 8c6db26d0c599ece16f3704696811275120a4044 | [
"Apache-2.0"
] | 2 | 2015-05-03T04:51:08.000Z | 2018-08-24T08:28:53.000Z | """Main TTX application, Mac-only"""
#make sure we don't lose events to SIOUX
import MacOS
MacOS.EnableAppswitch(-1)
SetWatchCursor()
# a few constants
LOGFILENAME = "TTX errors"
PREFSFILENAME = "TTX preferences"
DEFAULTXMLOUTPUT = ":XML output"
DEFAULTTTOUTPUT = ":TrueType output"
import FrameWork
import MiniAEF... | 27.71517 | 93 | 0.705541 | """Main TTX application, Mac-only"""
#make sure we don't lose events to SIOUX
import MacOS
MacOS.EnableAppswitch(-1)
def SetWatchCursor():
import Qd, QuickDraw
Qd.SetCursor(Qd.GetCursor(QuickDraw.watchCursor).data)
def SetArrowCursor():
import Qd
Qd.SetCursor(Qd.qd.arrow)
SetWatchCursor()
# a few constants
LO... | 5,539 | 31 | 561 |
027ccfc7c5e008bba853d139b86860d3618ffd39 | 1,412 | py | Python | main.py | rudradatta/Flames | 3692564ef1c3493eb2e1586be47ca997ede97cb4 | [
"BSD-3-Clause"
] | null | null | null | main.py | rudradatta/Flames | 3692564ef1c3493eb2e1586be47ca997ede97cb4 | [
"BSD-3-Clause"
] | null | null | null | main.py | rudradatta/Flames | 3692564ef1c3493eb2e1586be47ca997ede97cb4 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# 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 o... | 27.153846 | 75 | 0.751416 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# 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 o... | 182 | 0 | 23 |
9e2d92bd74afeb262f1f3e8cd2eae3690b0b4724 | 4,076 | py | Python | tests/test_pipelines.py | sethvargo/scrapy-s3pipeline | 1a11de83c51c3863b471d806583fa5f3a5a6464a | [
"MIT"
] | 77 | 2017-12-07T11:31:14.000Z | 2022-03-18T21:08:33.000Z | tests/test_pipelines.py | sethvargo/scrapy-s3pipeline | 1a11de83c51c3863b471d806583fa5f3a5a6464a | [
"MIT"
] | 7 | 2019-04-19T23:55:22.000Z | 2021-03-06T22:22:37.000Z | tests/test_pipelines.py | sethvargo/scrapy-s3pipeline | 1a11de83c51c3863b471d806583fa5f3a5a6464a | [
"MIT"
] | 14 | 2017-12-07T11:31:42.000Z | 2022-03-18T20:54:09.000Z | from unittest import TestCase
from scrapy.exporters import JsonLinesItemExporter, JsonItemExporter
from scrapy.settings import BaseSettings, default_settings
from s3pipeline import S3Pipeline
from s3pipeline.strategies.s3 import S3Strategy
from s3pipeline.strategies.gcs import GCSStrategy
| 38.45283 | 95 | 0.673454 | from unittest import TestCase
from scrapy.exporters import JsonLinesItemExporter, JsonItemExporter
from scrapy.settings import BaseSettings, default_settings
from s3pipeline import S3Pipeline
from s3pipeline.strategies.s3 import S3Strategy
from s3pipeline.strategies.gcs import GCSStrategy
class TestPipelineSettings(... | 3,528 | 16 | 239 |
de7fb23e68e497f342ffadf54e891b1ee5789685 | 315 | py | Python | .ycm_extra_conf.py | AleksanderGondek/py-friends-and-strangers | eda80c13653b6208c8d178feb6283f5279abc6bf | [
"MIT"
] | null | null | null | .ycm_extra_conf.py | AleksanderGondek/py-friends-and-strangers | eda80c13653b6208c8d178feb6283f5279abc6bf | [
"MIT"
] | null | null | null | .ycm_extra_conf.py | AleksanderGondek/py-friends-and-strangers | eda80c13653b6208c8d178feb6283f5279abc6bf | [
"MIT"
] | null | null | null | """ Vim YouCompleteMe"""
import pathlib
| 21 | 46 | 0.619048 | """ Vim YouCompleteMe"""
import pathlib
def Settings(**kwargs):
return {
"interpreter_path": pathlib.Path(__file__)
.parent.absolute()
.joinpath(".venv/bin/python"),
"sys_path": [
pathlib.Path(__file__)
.parent.absolute()
.joinpath("py_friends_and_strangers")
]
}
| 252 | 0 | 23 |
395347f97ebf9ebe9440f03168b3fc2acdb1aae1 | 124 | py | Python | apiproxy/resources/py/base64-encode.py | shahbagdadi/apigee-saml-idp | f881ac7579e6496965b4aeac22ef132ac9857c1a | [
"MIT"
] | 3 | 2016-02-01T16:37:51.000Z | 2022-01-13T03:14:31.000Z | apiproxy/resources/py/base64-encode.py | shahbagdadi/apigee-saml-idp | f881ac7579e6496965b4aeac22ef132ac9857c1a | [
"MIT"
] | 1 | 2016-01-15T02:52:56.000Z | 2016-01-15T02:52:56.000Z | apiproxy/resources/py/base64-encode.py | shahbagdadi/apigee-saml-idp | f881ac7579e6496965b4aeac22ef132ac9857c1a | [
"MIT"
] | 6 | 2015-09-30T05:37:38.000Z | 2022-01-13T03:14:43.000Z | import base64
enc_response = base64.b64encode(flow.getVariable("sf.response"))
flow.setVariable("sf.response", enc_response) | 41.333333 | 64 | 0.814516 | import base64
enc_response = base64.b64encode(flow.getVariable("sf.response"))
flow.setVariable("sf.response", enc_response) | 0 | 0 | 0 |
ab4b9cb10b61ad5a5c3b660008f819e16fe29a51 | 1,022 | py | Python | aiida/storage/sqlite_temp/__init__.py | aiidateam/aiida_core | 46d244e32ac5eca2e22a3d088314591ce064be57 | [
"PSF-2.0",
"MIT"
] | 153 | 2016-12-23T20:59:03.000Z | 2019-07-02T06:47:52.000Z | aiida/storage/sqlite_temp/__init__.py | aiidateam/aiida_core | 46d244e32ac5eca2e22a3d088314591ce064be57 | [
"PSF-2.0",
"MIT"
] | 2,466 | 2016-12-24T01:03:52.000Z | 2019-07-04T13:41:08.000Z | aiida/storage/sqlite_temp/__init__.py | aiidateam/aiida_core | 46d244e32ac5eca2e22a3d088314591ce064be57 | [
"PSF-2.0",
"MIT"
] | 88 | 2016-12-23T16:28:00.000Z | 2019-07-01T15:55:20.000Z | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 35.241379 | 75 | 0.515656 | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 0 | 0 | 0 |
8421e6f29dc860c958defcb0f8837716e7ec31c1 | 633 | py | Python | migrations/versions/e1855559096_connection_full_name.py | ArthurPBressan/sisgep1 | d11151353b895a1a7b7673f90248ea3a0c209da6 | [
"MIT"
] | null | null | null | migrations/versions/e1855559096_connection_full_name.py | ArthurPBressan/sisgep1 | d11151353b895a1a7b7673f90248ea3a0c209da6 | [
"MIT"
] | null | null | null | migrations/versions/e1855559096_connection_full_name.py | ArthurPBressan/sisgep1 | d11151353b895a1a7b7673f90248ea3a0c209da6 | [
"MIT"
] | null | null | null | """connection full name
Revision ID: e1855559096
Revises: 401bc82cc255
Create Date: 2015-09-26 17:40:20.742180
"""
# revision identifiers, used by Alembic.
revision = 'e1855559096'
down_revision = '401bc82cc255'
from alembic import op
import sqlalchemy as sa
| 23.444444 | 93 | 0.703002 | """connection full name
Revision ID: e1855559096
Revises: 401bc82cc255
Create Date: 2015-09-26 17:40:20.742180
"""
# revision identifiers, used by Alembic.
revision = 'e1855559096'
down_revision = '401bc82cc255'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alemb... | 322 | 0 | 46 |
8b6c8edca98f0afe1dd1b31d15580fcba225aafd | 2,274 | py | Python | example/my_foo_project/cli_client.py | mattpaletta/optional-grpc | 71d827630c02478cbad79762fa05282590aeacc1 | [
"MIT"
] | 1 | 2019-02-15T02:57:32.000Z | 2019-02-15T02:57:32.000Z | example/my_foo_project/cli_client.py | mattpaletta/optional-grpc | 71d827630c02478cbad79762fa05282590aeacc1 | [
"MIT"
] | null | null | null | example/my_foo_project/cli_client.py | mattpaletta/optional-grpc | 71d827630c02478cbad79762fa05282590aeacc1 | [
"MIT"
] | null | null | null | import logging
from typing import Iterator
from my_foo_project.foo import Foo
from my_foo_project.client import foo_pb2
from optionalgrpc import IS_RUNNING_LOCAL
| 34.984615 | 118 | 0.611258 | import logging
from typing import Iterator
from my_foo_project.foo import Foo
from my_foo_project.client import foo_pb2
from optionalgrpc import IS_RUNNING_LOCAL
def run_sample_client(configs):
# Here's an example client.
# We want a client API, so we set `server = False`
client: Foo = Foo(configs = con... | 2,087 | 0 | 23 |
a119345d10c5b52a1ebc1a6ecbd3b0e6b211e871 | 3,156 | py | Python | dnppy/raster/to_numpy.py | NASA-DEVELOP/dnppy | 8f7ef6f0653f5a4ea730ee557c72a2c89c06ce0b | [
"NASA-1.3"
] | 65 | 2015-09-10T12:59:56.000Z | 2022-02-27T22:09:03.000Z | dnppy/raster/to_numpy.py | snowzm/dnppy | 8f7ef6f0653f5a4ea730ee557c72a2c89c06ce0b | [
"NASA-1.3"
] | 40 | 2015-04-08T19:23:30.000Z | 2015-08-04T15:53:11.000Z | dnppy/raster/to_numpy.py | snowzm/dnppy | 8f7ef6f0653f5a4ea730ee557c72a2c89c06ce0b | [
"NASA-1.3"
] | 45 | 2015-08-14T19:09:38.000Z | 2022-02-15T18:53:16.000Z | __author__ = "jwely"
__all__ = ["to_numpy"]
from is_rast import is_rast
from metadata import metadata
import os
import arcpy
import numpy
def to_numpy(raster, numpy_datatype = None):
"""
Wrapper for arcpy.RasterToNumpyArray with better metadata handling
This is just a wraper for the RasterToNumPyArray... | 34.681319 | 125 | 0.647655 | __author__ = "jwely"
__all__ = ["to_numpy"]
from is_rast import is_rast
from metadata import metadata
import os
import arcpy
import numpy
def to_numpy(raster, numpy_datatype = None):
"""
Wrapper for arcpy.RasterToNumpyArray with better metadata handling
This is just a wraper for the RasterToNumPyArray... | 0 | 0 | 0 |
76d771bbdc8f3eb0a59c176355568f1a9c11c64f | 244 | py | Python | output/models/nist_data/list_pkg/duration/schema_instance/nistschema_sv_iv_list_duration_length_2_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/list_pkg/duration/schema_instance/nistschema_sv_iv_list_duration_length_2_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/list_pkg/duration/schema_instance/nistschema_sv_iv_list_duration_length_2_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.nist_data.list_pkg.duration.schema_instance.nistschema_sv_iv_list_duration_length_2_xsd.nistschema_sv_iv_list_duration_length_2 import NistschemaSvIvListDurationLength2
__all__ = [
"NistschemaSvIvListDurationLength2",
]
| 40.666667 | 187 | 0.889344 | from output.models.nist_data.list_pkg.duration.schema_instance.nistschema_sv_iv_list_duration_length_2_xsd.nistschema_sv_iv_list_duration_length_2 import NistschemaSvIvListDurationLength2
__all__ = [
"NistschemaSvIvListDurationLength2",
]
| 0 | 0 | 0 |
b23d36fa5033cff1b7860caf5d44f22ca9d35ade | 3,422 | py | Python | iwjam_import.py | patrickgh3/iwjam | fd6f58bd5217dc13ed475779fe7f1ff6ca7f13be | [
"MIT"
] | null | null | null | iwjam_import.py | patrickgh3/iwjam | fd6f58bd5217dc13ed475779fe7f1ff6ca7f13be | [
"MIT"
] | null | null | null | iwjam_import.py | patrickgh3/iwjam | fd6f58bd5217dc13ed475779fe7f1ff6ca7f13be | [
"MIT"
] | null | null | null | from lxml import etree
import os
import sys
import shutil
import iwjam_util
# Performs an import of a mod project into a base project given a
# previously computed ProjectDiff between them,
# and a list of folder names to prefix
# ('%modname%' will be replaced with the mod's name)
| 36.404255 | 78 | 0.63647 | from lxml import etree
import os
import sys
import shutil
import iwjam_util
# Performs an import of a mod project into a base project given a
# previously computed ProjectDiff between them,
# and a list of folder names to prefix
# ('%modname%' will be replaced with the mod's name)
def do_import(base_dir, mod_dir, pdif... | 3,086 | 0 | 45 |
da909f52e4e4629a36fb95351150753741737518 | 591 | py | Python | Code/Simple_plots/SDA.py | Basvdbrink1998/Influencing-social-networks | 7b512edc4127680a37115c7e1434b06ebfa67e8a | [
"MIT"
] | null | null | null | Code/Simple_plots/SDA.py | Basvdbrink1998/Influencing-social-networks | 7b512edc4127680a37115c7e1434b06ebfa67e8a | [
"MIT"
] | null | null | null | Code/Simple_plots/SDA.py | Basvdbrink1998/Influencing-social-networks | 7b512edc4127680a37115c7e1434b06ebfa67e8a | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
"""
SDA.py: Plots the probability of the SDA model generating a connection
based on different parameters for Figure 2.4.
"""
n = 3
alphas = [2, 3, 8]
betas = [2, 3, 5]
colors = ['r', 'g', 'b']
d = np.arange(0.0, 10.0, 0.1)
ax = plt.subplot()
for i in range... | 19.7 | 74 | 0.597293 | import numpy as np
import matplotlib.pyplot as plt
"""
SDA.py: Plots the probability of the SDA model generating a connection
based on different parameters for Figure 2.4.
"""
def prop(a, b, d):
return 1/(1+(1/b*d)**a)
n = 3
alphas = [2, 3, 8]
betas = [2, 3, 5]
colors = ['r', 'g', 'b']
d = np.arange(0.... | 25 | 0 | 23 |
d7abc7d7c4ba16df06d2efc32c2e5bcb55a94d2b | 3,939 | py | Python | stratified_group_fold/sources/StratifiedGroupKFold.py | erelcan/stratified-group-fold | 0c38f403636b8b493abd145b5e03c09895182e83 | [
"Apache-2.0"
] | 2 | 2021-07-03T15:52:59.000Z | 2021-07-03T17:24:19.000Z | stratified_group_fold/sources/StratifiedGroupKFold.py | erelcan/stratified-group-fold | 0c38f403636b8b493abd145b5e03c09895182e83 | [
"Apache-2.0"
] | null | null | null | stratified_group_fold/sources/StratifiedGroupKFold.py | erelcan/stratified-group-fold | 0c38f403636b8b493abd145b5e03c09895182e83 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
from sklearn.model_selection._split import _BaseKFold
from partition_optimizers import equally_partition_into_bins, mixed_equally_partition_into_bins
# Using get_n_splits from the super class.
| 44.258427 | 138 | 0.637218 | import pandas as pd
from sklearn.model_selection._split import _BaseKFold
from partition_optimizers import equally_partition_into_bins, mixed_equally_partition_into_bins
# Using get_n_splits from the super class.
class StratifiedGroupKFold(_BaseKFold):
def __init__(self, n_splits=5, mixed_groups=False, opt_type=0,... | 3,473 | 18 | 234 |
5bb3d6d12d12e77d5fb9cceeb72b3faad2278553 | 515 | py | Python | the_mechanic_backend/apps/stock/migrations/0002_spare_store.py | muthukumar4999/the-mechanic-backend | 1e31affddf60d2de72445a85dd2055bdeba6f670 | [
"MIT"
] | null | null | null | the_mechanic_backend/apps/stock/migrations/0002_spare_store.py | muthukumar4999/the-mechanic-backend | 1e31affddf60d2de72445a85dd2055bdeba6f670 | [
"MIT"
] | 5 | 2020-06-05T22:30:20.000Z | 2021-09-08T01:12:27.000Z | the_mechanic_backend/apps/stock/migrations/0002_spare_store.py | muthukumar4999/the-mechanic-backend | 1e31affddf60d2de72445a85dd2055bdeba6f670 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.5 on 2019-03-31 08:34
from django.db import migrations, models
import django.db.models.deletion
| 24.52381 | 125 | 0.623301 | # Generated by Django 2.1.5 on 2019-03-31 08:34
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
('stock', '0001_initial'),
]
operations = [
migrations.AddField(
... | 0 | 368 | 23 |
9eea5aa106be395c4d8d95d6ed8621ad09adecab | 11,054 | py | Python | src/yativ/resources/testscale.py | Ahuge/yativ | 506511c9f5c6d77c6e488f6f593044b78541cfb5 | [
"MIT"
] | null | null | null | src/yativ/resources/testscale.py | Ahuge/yativ | 506511c9f5c6d77c6e488f6f593044b78541cfb5 | [
"MIT"
] | null | null | null | src/yativ/resources/testscale.py | Ahuge/yativ | 506511c9f5c6d77c6e488f6f593044b78541cfb5 | [
"MIT"
] | null | null | null | import numpy
from numpy import genfromtxt
my_data = genfromtxt('matrix.csv', delimiter=',')
def bin_ndarray(ndarray, new_shape, operation='sum'):
"""
Bins an ndarray in all axes based on the target shape, by summing or
averaging.
Number of output dimensions must match number of input dimensions... | 33.907975 | 102 | 0.495024 | import numpy
from numpy import genfromtxt
my_data = genfromtxt('matrix.csv', delimiter=',')
def bin_ndarray(ndarray, new_shape, operation='sum'):
"""
Bins an ndarray in all axes based on the target shape, by summing or
averaging.
Number of output dimensions must match number of input dimensions... | 3,226 | 0 | 138 |
0b841db886c83062d035de64ee8299f98561f3f8 | 14,235 | py | Python | apps/pay/views.py | agamgn/django-Tourism | ee8fae54981d135cbd7ddaf9131eb77ea7b2fb8a | [
"MIT"
] | 9 | 2019-06-30T06:34:22.000Z | 2021-11-09T17:21:16.000Z | apps/pay/views.py | agamgn/django-Tourism | ee8fae54981d135cbd7ddaf9131eb77ea7b2fb8a | [
"MIT"
] | 14 | 2019-12-22T02:04:18.000Z | 2022-03-11T23:44:38.000Z | apps/pay/views.py | agamgn/django-Tourism | ee8fae54981d135cbd7ddaf9131eb77ea7b2fb8a | [
"MIT"
] | 3 | 2019-06-30T06:35:57.000Z | 2019-12-18T03:42:43.000Z | from django.shortcuts import render
from django.views.generic import View
from django.shortcuts import render, redirect, HttpResponseRedirect, reverse, HttpResponse
from alipay import Alipay
import time
import string
import random
import json
from operation.models import ShoppingCart, Shopping
from .models import *
f... | 33.104651 | 101 | 0.58595 | from django.shortcuts import render
from django.views.generic import View
from django.shortcuts import render, redirect, HttpResponseRedirect, reverse, HttpResponse
from alipay import Alipay
import time
import string
import random
import json
from operation.models import ShoppingCart, Shopping
from .models import *
f... | 12,825 | 12 | 259 |
e7f8c7e0394d0153b2a8616fd41a38bdbade771f | 4,958 | py | Python | authorize/apis/transaction.py | pegler/authorizesauce | e0dc408638b916973db9185911a20aec8fa6143d | [
"MIT"
] | null | null | null | authorize/apis/transaction.py | pegler/authorizesauce | e0dc408638b916973db9185911a20aec8fa6143d | [
"MIT"
] | 1 | 2020-08-07T16:56:59.000Z | 2020-08-07T16:56:59.000Z | authorize/apis/transaction.py | pegler/authorizesauce | e0dc408638b916973db9185911a20aec8fa6143d | [
"MIT"
] | 2 | 2018-09-05T14:47:08.000Z | 2020-08-07T15:52:37.000Z | from decimal import Decimal
import urllib
import requests
from authorize.exceptions import AuthorizeConnectionError, \
AuthorizeResponseError
PROD_URL = 'https://secure.authorize.net/gateway/transact.dll'
TEST_URL = 'https://test.authorize.net/gateway/transact.dll'
RESPONSE_FIELDS = {
0: 'response_code',
... | 38.434109 | 77 | 0.615772 | from decimal import Decimal
import urllib
import requests
from authorize.exceptions import AuthorizeConnectionError, \
AuthorizeResponseError
PROD_URL = 'https://secure.authorize.net/gateway/transact.dll'
TEST_URL = 'https://test.authorize.net/gateway/transact.dll'
RESPONSE_FIELDS = {
0: 'response_code',
... | 4,153 | 8 | 261 |
031d46e50198f0c6342052897973976a91bd5c45 | 3,897 | py | Python | src/core/src/tortuga/scripts/get_component_list.py | sutasu/tortuga | 48d7cde4fa652346600b217043b4a734fa2ba455 | [
"Apache-2.0"
] | 33 | 2018-03-02T17:07:39.000Z | 2021-05-21T18:02:51.000Z | src/core/src/tortuga/scripts/get_component_list.py | sutasu/tortuga | 48d7cde4fa652346600b217043b4a734fa2ba455 | [
"Apache-2.0"
] | 201 | 2018-03-05T14:28:24.000Z | 2020-11-23T19:58:27.000Z | src/core/src/tortuga/scripts/get_component_list.py | sutasu/tortuga | 48d7cde4fa652346600b217043b4a734fa2ba455 | [
"Apache-2.0"
] | 23 | 2018-03-02T17:21:59.000Z | 2020-11-18T14:52:38.000Z | # Copyright 2008-2018 Univa Corporation
#
# 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... | 31.942623 | 80 | 0.627149 | # Copyright 2008-2018 Univa Corporation
#
# 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... | 2,830 | 14 | 149 |
c764640dcde065c4a996dc262f48bc4fce5645f6 | 6,311 | py | Python | darling_ansible/python_venv/lib/python3.7/site-packages/oci/os_management/models/software_package_file.py | revnav/sandbox | f9c8422233d093b76821686b6c249417502cf61d | [
"Apache-2.0"
] | null | null | null | darling_ansible/python_venv/lib/python3.7/site-packages/oci/os_management/models/software_package_file.py | revnav/sandbox | f9c8422233d093b76821686b6c249417502cf61d | [
"Apache-2.0"
] | null | null | null | darling_ansible/python_venv/lib/python3.7/site-packages/oci/os_management/models/software_package_file.py | revnav/sandbox | f9c8422233d093b76821686b6c249417502cf61d | [
"Apache-2.0"
] | 1 | 2020-06-25T03:12:58.000Z | 2020-06-25T03:12:58.000Z | # coding: utf-8
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 27.202586 | 245 | 0.615116 | # coding: utf-8
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 177 | 0 | 81 |
4a054595b354fc56a93e4664562ef67d04d9e103 | 1,765 | py | Python | esp32_ulp/definesdb.py | wnienhaus/micropython-esp32-ulp | 19d4b98d41fae74062d855760d7aaef1988804f6 | [
"MIT"
] | 63 | 2018-03-11T20:28:18.000Z | 2022-02-03T15:03:24.000Z | esp32_ulp/definesdb.py | wnienhaus/micropython-esp32-ulp | 19d4b98d41fae74062d855760d7aaef1988804f6 | [
"MIT"
] | 56 | 2018-03-11T18:48:18.000Z | 2022-03-01T00:16:26.000Z | esp32_ulp/definesdb.py | wnienhaus/micropython-esp32-ulp | 19d4b98d41fae74062d855760d7aaef1988804f6 | [
"MIT"
] | 14 | 2018-03-13T07:33:39.000Z | 2022-02-03T15:03:27.000Z | import os
import btree
from .util import file_exists
DBNAME = 'defines.db'
| 22.341772 | 52 | 0.538244 | import os
import btree
from .util import file_exists
DBNAME = 'defines.db'
class DefinesDB:
def __init__(self):
self._file = None
self._db = None
self._db_exists = None
def clear(self):
self.close()
try:
os.remove(DBNAME)
self._db_exists = Fals... | 1,347 | -5 | 346 |
5fba5e1f1bfcf9ffc2e970adf233be126a9270aa | 630 | py | Python | app/bootstrap/settings/components/db.py | enix403/django-compose-starter-template | 5195ee0a1e59f567fcb314973a91a531324e50b2 | [
"Apache-2.0"
] | null | null | null | app/bootstrap/settings/components/db.py | enix403/django-compose-starter-template | 5195ee0a1e59f567fcb314973a91a531324e50b2 | [
"Apache-2.0"
] | null | null | null | app/bootstrap/settings/components/db.py | enix403/django-compose-starter-template | 5195ee0a1e59f567fcb314973a91a531324e50b2 | [
"Apache-2.0"
] | null | null | null | from app.bootstrap.configmanager import ConfigManager
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'USER': ConfigManager.get('db.user'),
'NAME': ConfigManager.get('db.name'),
'PASSWORD': ConfigManager.get('db.pass'),
'HOST': ConfigManager.get('db.hos... | 31.5 | 69 | 0.684127 | from app.bootstrap.configmanager import ConfigManager
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'USER': ConfigManager.get('db.user'),
'NAME': ConfigManager.get('db.name'),
'PASSWORD': ConfigManager.get('db.pass'),
'HOST': ConfigManager.get('db.hos... | 0 | 0 | 0 |
010a4ac03204c1908e45dac9fcc0777e17bb6512 | 1,485 | py | Python | polygones_rose_v4.py | mercadder/python | 85a005fee24a613ac5bb33847cccc8e32f1ceebd | [
"MIT"
] | null | null | null | polygones_rose_v4.py | mercadder/python | 85a005fee24a613ac5bb33847cccc8e32f1ceebd | [
"MIT"
] | null | null | null | polygones_rose_v4.py | mercadder/python | 85a005fee24a613ac5bb33847cccc8e32f1ceebd | [
"MIT"
] | null | null | null | import turtle #module tha drawn things
draw_square()
| 29.117647 | 63 | 0.531987 | import turtle #module tha drawn things
def draw_square():
turtle.setworldcoordinates(-300, -300, 600, 600)
background = turtle.Screen() #create the background
background.bgcolor ("#084B8A") #background color
titi = turtle.Turtle() #titi is an intance of Turtle class
titi.shape("square")
titi.co... | 1,408 | 0 | 22 |
b55102e6c9f6acb641d3ac9a4e1d55faf0f27f26 | 692 | py | Python | tests/test_dialects.py | jdp/jarg | 61ddf8ab6ec4ec33df21943295c0dac3444105f3 | [
"MIT"
] | 45 | 2015-01-01T06:01:33.000Z | 2021-10-01T14:39:41.000Z | tests/test_dialects.py | btoztas/jarg | 61ddf8ab6ec4ec33df21943295c0dac3444105f3 | [
"MIT"
] | 1 | 2018-12-04T17:56:04.000Z | 2018-12-04T17:56:04.000Z | tests/test_dialects.py | btoztas/jarg | 61ddf8ab6ec4ec33df21943295c0dac3444105f3 | [
"MIT"
] | 1 | 2018-12-04T18:33:55.000Z | 2018-12-04T18:33:55.000Z | import pytest
from jarg.dialects import FormDialect, JSONDialect
| 25.62963 | 71 | 0.632948 | import pytest
from jarg.dialects import FormDialect, JSONDialect
def test_JSONDialect():
dialect = JSONDialect()
assert dialect.to_python("bar") == "bar"
assert dialect.to_python("42") == 42
assert dialect.to_python("4.20") == 4.2
assert dialect.to_python('"69"') == '"69"'
assert dialect.fr... | 577 | 0 | 46 |
1cb040e596b26589cbb11a733ba1ebdffd781115 | 2,400 | py | Python | cohesity_management_sdk/models/nfs_connection.py | nick6655/management-sdk-python | 88e792cb83e5c24a22af495b220c145d0c45841d | [
"Apache-2.0"
] | null | null | null | cohesity_management_sdk/models/nfs_connection.py | nick6655/management-sdk-python | 88e792cb83e5c24a22af495b220c145d0c45841d | [
"Apache-2.0"
] | null | null | null | cohesity_management_sdk/models/nfs_connection.py | nick6655/management-sdk-python | 88e792cb83e5c24a22af495b220c145d0c45841d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2021 Cohesity Inc.
class NfsConnection(object):
"""Implementation of the 'NfsConnection' model.
:TODO Type description here.
Attributes:
client_ip (string): Information of a Universal Data
Adapter cluster, only valid for an entity of view_name kClu... | 30.379747 | 81 | 0.588333 | # -*- coding: utf-8 -*-
# Copyright 2021 Cohesity Inc.
class NfsConnection(object):
"""Implementation of the 'NfsConnection' model.
:TODO Type description here.
Attributes:
client_ip (string): Information of a Universal Data
Adapter cluster, only valid for an entity of view_name kClu... | 0 | 0 | 0 |
9599f3ef46405278aa67da39176eb1314ae4583e | 12,783 | py | Python | modules/windows_jumplist/JumpListParser.py | naaya17/carpe | fa2e3cfebe20f8839c985e5b9b78b538800172a1 | [
"Apache-2.0"
] | 56 | 2019-02-07T06:21:45.000Z | 2022-03-21T08:19:24.000Z | modules/windows_jumplist/JumpListParser.py | naaya17/carpe | fa2e3cfebe20f8839c985e5b9b78b538800172a1 | [
"Apache-2.0"
] | 5 | 2020-05-25T17:29:00.000Z | 2021-12-13T20:49:08.000Z | modules/windows_jumplist/JumpListParser.py | naaya17/carpe | fa2e3cfebe20f8839c985e5b9b78b538800172a1 | [
"Apache-2.0"
] | 31 | 2019-03-13T10:23:49.000Z | 2021-11-04T12:14:58.000Z | import os.path, sys
from modules.windows_jumplist.consts import *
from ctypes import *
from modules.windows_jumplist.lib.delphi import *
from modules.windows_jumplist.lib.yjSysUtils import *
from modules.windows_jumplist.lib.yjDateTime import *
from modules.windows_jumplist.LNKFileParser import TLNKFileParser
from mod... | 42.327815 | 132 | 0.509192 | import os.path, sys
from modules.windows_jumplist.consts import *
from ctypes import *
from modules.windows_jumplist.lib.delphi import *
from modules.windows_jumplist.lib.yjSysUtils import *
from modules.windows_jumplist.lib.yjDateTime import *
from modules.windows_jumplist.LNKFileParser import TLNKFileParser
from mod... | 10,217 | 775 | 114 |
bb59e61d09ed7c1f58341c38fc5c90691b4f1d4e | 774 | py | Python | mimodata.py | theignorantzen/VLC-Pi | 66f50d9393429c55716c4c036240c44a4e601a98 | [
"MIT"
] | null | null | null | mimodata.py | theignorantzen/VLC-Pi | 66f50d9393429c55716c4c036240c44a4e601a98 | [
"MIT"
] | null | null | null | mimodata.py | theignorantzen/VLC-Pi | 66f50d9393429c55716c4c036240c44a4e601a98 | [
"MIT"
] | null | null | null | import RPi.GPIO as GPIO
import binascii
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(12, GPIO.OUT)
GPIO.setup(16, GPIO.OUT)
GPIO.setup(5, GPIO.OUT)
GPIO.setup(6, GPIO.OUT)
GPIO.setup(13, GPIO.OUT)
GPIO.setup(19, GPIO.OUT)
pin = [12, 16, 5, 6, 13, 19]
k = 0
st="110101011010111"
cols = 6
rows = len(st)/3
arr = [[0]*... | 18 | 40 | 0.564599 | import RPi.GPIO as GPIO
import binascii
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(12, GPIO.OUT)
GPIO.setup(16, GPIO.OUT)
GPIO.setup(5, GPIO.OUT)
GPIO.setup(6, GPIO.OUT)
GPIO.setup(13, GPIO.OUT)
GPIO.setup(19, GPIO.OUT)
pin = [12, 16, 5, 6, 13, 19]
k = 0
st="110101011010111"
cols = 6
rows = len(st)/3
arr = [[0]*... | 0 | 0 | 0 |
42ae96f4a947574eed72fb622a55bbd38b1b9cc0 | 3,589 | py | Python | code_fragment_generator/tcp_api_generator.py | Longxr/python-data-process | f5f8c2c89b449b76dde31d13c6cabb6b97b0023f | [
"MIT"
] | null | null | null | code_fragment_generator/tcp_api_generator.py | Longxr/python-data-process | f5f8c2c89b449b76dde31d13c6cabb6b97b0023f | [
"MIT"
] | null | null | null | code_fragment_generator/tcp_api_generator.py | Longxr/python-data-process | f5f8c2c89b449b76dde31d13c6cabb6b97b0023f | [
"MIT"
] | null | null | null | # coding=utf-8
import os
import re
import string
from string import Template
if __name__ == '__main__':
root_dir = os.path.dirname(os.path.abspath(__file__))
input_file = open(os.path.join(root_dir, 'input.cpp'), 'r', encoding='gb18030', errors='ignore')
out_file = open(os.path.join(root_dir, 'output.cpp... | 32.333333 | 164 | 0.676512 | # coding=utf-8
import os
import re
import string
from string import Template
def fun_replace(str):
str1 = re.sub(r'[^\w\s]','', str)
return str1.strip()
def fun_get_attri(line):
line_list = line.split('//')
comment = ''
if len(line_list) > 1:
comment = '//' + line_list[1]
line_list ... | 593 | 0 | 46 |
35b5028184a8de2f02ce4af30620f4dde17fa65e | 2,512 | py | Python | DeeProtein/scripts/extract_targets.py | juzb/DeeProtein | 487694a24abdb4656499111c8a8904dfcb1d98ab | [
"MIT"
] | 12 | 2019-02-21T14:09:13.000Z | 2021-03-05T02:02:21.000Z | DeeProtein/scripts/extract_targets.py | juzb/DeeProtein | 487694a24abdb4656499111c8a8904dfcb1d98ab | [
"MIT"
] | null | null | null | DeeProtein/scripts/extract_targets.py | juzb/DeeProtein | 487694a24abdb4656499111c8a8904dfcb1d98ab | [
"MIT"
] | 5 | 2019-05-15T05:37:41.000Z | 2021-09-29T12:20:00.000Z | import pandas as pd
import sys
import os
deep_go_data = sys.argv[1]
dataset_path_in = sys.argv[2]
dataset_path_out = sys.argv[3]
go_file_out = sys.argv[4]
df = pd.read_pickle(deep_go_data)
targets = list(df.targets)
gos = list(df.gos)
go_freqs = {}
target2go = dict(zip(targets, gos))
target_path = os.path.join(dat... | 35.380282 | 95 | 0.501194 | import pandas as pd
import sys
import os
deep_go_data = sys.argv[1]
dataset_path_in = sys.argv[2]
dataset_path_out = sys.argv[3]
go_file_out = sys.argv[4]
df = pd.read_pickle(deep_go_data)
targets = list(df.targets)
gos = list(df.gos)
go_freqs = {}
target2go = dict(zip(targets, gos))
target_path = os.path.join(dat... | 0 | 0 | 0 |
a445050476ee2d8a028886e92dc18e1d0a2333df | 717 | py | Python | getImage.py | tzuhan1106/Crawler_Of_Cosmetic | 2094388b248f269e787eeb90c01679735cc1e58c | [
"MIT"
] | 1 | 2016-04-04T09:42:47.000Z | 2016-04-04T09:42:47.000Z | getImage.py | tzuhan1106/Crawler_Of_Cosmetic | 2094388b248f269e787eeb90c01679735cc1e58c | [
"MIT"
] | null | null | null | getImage.py | tzuhan1106/Crawler_Of_Cosmetic | 2094388b248f269e787eeb90c01679735cc1e58c | [
"MIT"
] | null | null | null | import requests, json
from bs4 import BeautifulSoup
import shutil
import os
try:
os.chdir('img')
#means cd path
except:
print('path error')
imageUrlPattern = 'http://www.watsons.com.tw'
res =requests.get('http://www.watsons.com.tw/%E7%86%B1%E9%8A%B7%E5%95%86%E5%93%81/c/bestSeller?q=:igcBestSeller:category:1... | 28.68 | 164 | 0.641562 | import requests, json
from bs4 import BeautifulSoup
import shutil
import os
try:
os.chdir('img')
#means cd path
except:
print('path error')
imageUrlPattern = 'http://www.watsons.com.tw'
res =requests.get('http://www.watsons.com.tw/%E7%86%B1%E9%8A%B7%E5%95%86%E5%93%81/c/bestSeller?q=:igcBestSeller:category:1... | 0 | 0 | 0 |
321a802ba08a82beb1f2f48347ea60bfd848d06e | 11,155 | py | Python | pyatv/mrp/__init__.py | SylvainCecchetto/pyatv | b5386440ce6c170219975a17d6b6561026bfd790 | [
"MIT"
] | null | null | null | pyatv/mrp/__init__.py | SylvainCecchetto/pyatv | b5386440ce6c170219975a17d6b6561026bfd790 | [
"MIT"
] | null | null | null | pyatv/mrp/__init__.py | SylvainCecchetto/pyatv | b5386440ce6c170219975a17d6b6561026bfd790 | [
"MIT"
] | null | null | null | """Implementation of the MediaRemoteTV Protocol used by ATV4 and later."""
import logging
import asyncio
from datetime import datetime
from pyatv import (const, exceptions)
from pyatv.mrp import (messages, protobuf)
from pyatv.mrp.srp import SRPAuthHandler
from pyatv.mrp.connection import MrpConnection
from pyatv.mrp... | 30.900277 | 78 | 0.622143 | """Implementation of the MediaRemoteTV Protocol used by ATV4 and later."""
import logging
import asyncio
from datetime import datetime
from pyatv import (const, exceptions)
from pyatv.mrp import (messages, protobuf)
from pyatv.mrp.srp import SRPAuthHandler
from pyatv.mrp.connection import MrpConnection
from pyatv.mrp... | 550 | 0 | 54 |
09f3c8ba4bc1ac8de8b0e61c1b08a475d36e80c0 | 14,319 | py | Python | quantipy/core/cluster.py | encount/quantipy3 | 01fe350b79594ba162cd48ce91f6e547e74265fe | [
"MIT"
] | null | null | null | quantipy/core/cluster.py | encount/quantipy3 | 01fe350b79594ba162cd48ce91f6e547e74265fe | [
"MIT"
] | null | null | null | quantipy/core/cluster.py | encount/quantipy3 | 01fe350b79594ba162cd48ce91f6e547e74265fe | [
"MIT"
] | null | null | null | from .chain import Chain
import pickle
from collections import OrderedDict
import pandas as pd
import copy
from quantipy.core.tools.view.query import get_dataframe
from quantipy.core.helpers.functions import get_text
import os
class Cluster(OrderedDict):
"""
Container class in form of an OrderedDict... | 37.681579 | 103 | 0.488163 | from .chain import Chain
import pickle
from collections import OrderedDict
import pandas as pd
import copy
from quantipy.core.tools.view.query import get_dataframe
from quantipy.core.helpers.functions import get_text
import os
class Cluster(OrderedDict):
"""
Container class in form of an OrderedDict... | 221 | 0 | 87 |
428811f65bf037cde24824501010272b928b75b5 | 1,419 | py | Python | web/models/mysql.py | zhengbigbig/python_demo | 29b62bea9e5abaa02e51744a926f722d1b99ec8d | [
"MIT"
] | null | null | null | web/models/mysql.py | zhengbigbig/python_demo | 29b62bea9e5abaa02e51744a926f722d1b99ec8d | [
"MIT"
] | null | null | null | web/models/mysql.py | zhengbigbig/python_demo | 29b62bea9e5abaa02e51744a926f722d1b99ec8d | [
"MIT"
] | null | null | null | import pymysql
import logging
# 对数据进行转码
db = MySQLDB(user='root', password='root', db='test')
| 23.65 | 90 | 0.677237 | import pymysql
import logging
class MySQLDB(object):
def __init__(self, host='localhost', port=3306, user='root', password='root', db='test'):
# cursorclass=pymysql.cursors.DictCursor 数据库查询返回dict --> 默认:tuple
self.conn = pymysql.connect(
host=host, port=port, user=user, password=password, db=db,
charset='u... | 1,228 | 1 | 141 |
d8a7faef64fcbcfb31c2692058def68f00243918 | 9,244 | py | Python | ark/utils/plot_utils.py | angelolab/ark-analysis | 5b248e5413c383bf03fac53d8ae9180fd2310222 | [
"Apache-2.0"
] | 17 | 2020-10-15T20:50:12.000Z | 2022-01-27T19:24:40.000Z | ark/utils/plot_utils.py | angelolab/ark-analysis | 5b248e5413c383bf03fac53d8ae9180fd2310222 | [
"Apache-2.0"
] | 309 | 2020-08-14T16:21:36.000Z | 2022-03-24T22:22:53.000Z | ark/utils/plot_utils.py | angelolab/ark-analysis | 5b248e5413c383bf03fac53d8ae9180fd2310222 | [
"Apache-2.0"
] | 4 | 2020-10-12T21:04:55.000Z | 2021-07-06T09:42:49.000Z | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import xarray as xr
from skimage.segmentation import find_boundaries
from skimage.exposure import rescale_intensity
from ark.utils import load_utils
from ark.utils import misc_utils
# plotting functions
from ar... | 44.442308 | 96 | 0.583514 | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import xarray as xr
from skimage.segmentation import find_boundaries
from skimage.exposure import rescale_intensity
from ark.utils import load_utils
from ark.utils import misc_utils
# plotting functions
from ar... | 0 | 0 | 0 |
e923430b6a6eb327b695a54846e7a3076c5d0662 | 1,542 | py | Python | src/trainer/sr/base.py | sanghyun-son/srwarp | d7cc08db5ba5ec9103f1813f76d1da825afe1a5b | [
"MIT"
] | 82 | 2021-04-22T09:22:46.000Z | 2022-03-30T03:06:47.000Z | src/trainer/sr/base.py | sanghyun-son/srwarp | d7cc08db5ba5ec9103f1813f76d1da825afe1a5b | [
"MIT"
] | 3 | 2021-08-04T15:40:52.000Z | 2022-02-21T10:10:52.000Z | src/trainer/sr/base.py | sanghyun-son/srwarp | d7cc08db5ba5ec9103f1813f76d1da825afe1a5b | [
"MIT"
] | 11 | 2021-05-16T14:54:33.000Z | 2022-02-18T08:25:37.000Z | from trainer.gan import dcgan
from misc.gpu_utils import parallel_forward as pforward
from model.utils import forward_utils as futils
_parent_class = dcgan.GANTrainer
| 27.052632 | 63 | 0.479248 | from trainer.gan import dcgan
from misc.gpu_utils import parallel_forward as pforward
from model.utils import forward_utils as futils
_parent_class = dcgan.GANTrainer
class SRTrainer(_parent_class):
def __init__(self, *args, x8=False, quads=False, **kwargs):
super().__init__(*args, **kwargs)
self... | 1,242 | 109 | 23 |
132727ab48ce64a42309c69292ca835404984f0d | 9,500 | py | Python | soft/compiler.ctuning-cc/customize.py | G4V/ck-env | b882480b00b9dbd88f15eef58440772e09414f64 | [
"BSD-3-Clause"
] | 80 | 2015-03-03T14:27:39.000Z | 2022-01-04T15:37:01.000Z | soft/compiler.ctuning-cc/customize.py | G4V/ck-env | b882480b00b9dbd88f15eef58440772e09414f64 | [
"BSD-3-Clause"
] | 78 | 2016-02-20T07:47:05.000Z | 2021-05-01T13:33:31.000Z | soft/compiler.ctuning-cc/customize.py | G4V/ck-env | b882480b00b9dbd88f15eef58440772e09414f64 | [
"BSD-3-Clause"
] | 22 | 2016-07-29T07:25:11.000Z | 2021-02-08T16:18:26.000Z | #
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
##############################################################################
# setup envir... | 33.333333 | 116 | 0.572842 | #
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
##############################################################################
# setup envir... | 0 | 0 | 0 |
292b05d1269b68175aa7424e7be5c81a7dc02868 | 34,115 | py | Python | scripts/external.py | tth030/SM_ESR_isostasy | fbd2ac586e8e31dd18a0988181514bc2fff7f08a | [
"MIT"
] | null | null | null | scripts/external.py | tth030/SM_ESR_isostasy | fbd2ac586e8e31dd18a0988181514bc2fff7f08a | [
"MIT"
] | null | null | null | scripts/external.py | tth030/SM_ESR_isostasy | fbd2ac586e8e31dd18a0988181514bc2fff7f08a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import numpy as np
import colorsys
import matplotlib.pyplot as plt
from matplotlib.ticker import (MultipleLocator, FormatStrFormatter,
AutoMinorLocator,ScalarFormatter)
import netCDF4
import os
import pyproj
import pickle
from statsmodels.stats.weightstats import De... | 42.378882 | 179 | 0.563535 | #!/usr/bin/env python
import numpy as np
import colorsys
import matplotlib.pyplot as plt
from matplotlib.ticker import (MultipleLocator, FormatStrFormatter,
AutoMinorLocator,ScalarFormatter)
import netCDF4
import os
import pyproj
import pickle
from statsmodels.stats.weightstats import De... | 12,773 | 0 | 230 |
7efc8c4fae98330e9b5cd2edb68a5c99c316055a | 1,601 | py | Python | connection_ss_simple.py | Liuzhe30/pygcn | ac13e8873b9eb7360ac88a88afb160db652e4699 | [
"MIT"
] | null | null | null | connection_ss_simple.py | Liuzhe30/pygcn | ac13e8873b9eb7360ac88a88afb160db652e4699 | [
"MIT"
] | null | null | null | connection_ss_simple.py | Liuzhe30/pygcn | ac13e8873b9eb7360ac88a88afb160db652e4699 | [
"MIT"
] | null | null | null | import numpy as np
content = np.loadtxt('/data/rasa.content')
with open('/data/join.fasta') as fasta:
with open('/data/rasa.cites', 'a+') as w:
line = fasta.readline()
num = 0
while line:
if(line[0] == '>'):
line = fasta.readline()
continue
... | 39.04878 | 134 | 0.381012 | import numpy as np
content = np.loadtxt('/data/rasa.content')
with open('/data/join.fasta') as fasta:
with open('/data/rasa.cites', 'a+') as w:
line = fasta.readline()
num = 0
while line:
if(line[0] == '>'):
line = fasta.readline()
continue
... | 0 | 0 | 0 |
81cccc9193a552e5305de4736e9b47ff1daf7cbb | 431 | py | Python | cpp/apps/MolecularEditor/py/gen_linkers.py | ProkopHapala/SimpleSimulationEngine | 240f9b7e85b3a6eda7a27dc15fe3f7b8c08774c5 | [
"MIT"
] | 26 | 2016-12-04T04:45:12.000Z | 2022-03-24T09:39:28.000Z | cpp/apps/MolecularEditor/py/gen_linkers.py | Aki78/FlightAI | 9c5480f2392c9c89b9fee4902db0c4cde5323a6c | [
"MIT"
] | null | null | null | cpp/apps/MolecularEditor/py/gen_linkers.py | Aki78/FlightAI | 9c5480f2392c9c89b9fee4902db0c4cde5323a6c | [
"MIT"
] | 2 | 2019-02-09T12:31:06.000Z | 2019-04-28T02:24:50.000Z | #!/usr/bin/python
import numpy as np
#fin = open("H56.bas",r)
bas=np.genfromtxt("H56.bas", skip_header=1)
#bas=bas[:5]
#print( bas )
k0=30.0
l0=0.0
mol0=0
pos0 = np.array([0.0,0.0,0.0])
fout = open("linkers.ini",'w')
fout.write("%i\n" %(len(bas)) )
for i,l in enumerate( bas ):
pos = l[1:]
fout.write("%i %i ... | 15.962963 | 115 | 0.561485 | #!/usr/bin/python
import numpy as np
#fin = open("H56.bas",r)
bas=np.genfromtxt("H56.bas", skip_header=1)
#bas=bas[:5]
#print( bas )
k0=30.0
l0=0.0
mol0=0
pos0 = np.array([0.0,0.0,0.0])
fout = open("linkers.ini",'w')
fout.write("%i\n" %(len(bas)) )
for i,l in enumerate( bas ):
pos = l[1:]
fout.write("%i %i ... | 0 | 0 | 0 |
083025e9c10a03d7077ec680c49de682ca96c2ac | 975 | py | Python | reconstruct_itinerary.py | pranavdave893/Leetcode | 1f30ea37af7b60585d168b15d9397143f53c92a1 | [
"MIT"
] | null | null | null | reconstruct_itinerary.py | pranavdave893/Leetcode | 1f30ea37af7b60585d168b15d9397143f53c92a1 | [
"MIT"
] | null | null | null | reconstruct_itinerary.py | pranavdave893/Leetcode | 1f30ea37af7b60585d168b15d9397143f53c92a1 | [
"MIT"
] | null | null | null | from collections import defaultdict
abc = Solution()
print (abc.findItinerary([["JFK","KUL"],["JFK","NRT"],["NRT","JFK"]])) # ["JFK","NRT","JFK","KUL"]
print (abc.findItinerary([["MUC", "LHR"], ["JFK", "MUC"], ["SFO", "SJC"], ["LHR", "SFO"]]))
print (abc.findItinerary([["JFK","SFO"],["JFK","ATL"],["SFO","ATL"],["ATL",... | 30.46875 | 98 | 0.493333 | from collections import defaultdict
class Solution(object):
def findItinerary(self, tickets):
"""
:type tickets: List[List[str]]
:rtype: List[str]
"""
if not tickets: return []
tickets.sort(key=lambda x:x[1])
graph = defaultdict(list)
for x,... | 179 | 430 | 23 |
afd755dfee7d3d7bac1e03b8b5df69a6f5aad4ee | 2,906 | py | Python | RoadCrackSegmentation/train.py | ForrestPi/DefectDetection | 7e999335ffbd50519cdfaba7de0d6bfa306a579a | [
"Unlicense"
] | 4 | 2020-06-03T08:10:13.000Z | 2021-06-11T09:46:48.000Z | RoadCrackSegmentation/train.py | ForrestPi/DefectDetection | 7e999335ffbd50519cdfaba7de0d6bfa306a579a | [
"Unlicense"
] | null | null | null | RoadCrackSegmentation/train.py | ForrestPi/DefectDetection | 7e999335ffbd50519cdfaba7de0d6bfa306a579a | [
"Unlicense"
] | 1 | 2020-04-14T08:28:04.000Z | 2020-04-14T08:28:04.000Z | import argparse, glob,os
from keras.callbacks import ModelCheckpoint, LearningRateScheduler, EarlyStopping, ReduceLROnPlateau
from keras.optimizers import Adam
import data_loader
from metrics import *
from net.Unet import Net
# from net.GCUnet import Net
os.environ["CUDA_VISIBLE_DEVICES"] = "3"
parser = argparse.Argu... | 38.236842 | 131 | 0.73916 | import argparse, glob,os
from keras.callbacks import ModelCheckpoint, LearningRateScheduler, EarlyStopping, ReduceLROnPlateau
from keras.optimizers import Adam
import data_loader
from metrics import *
from net.Unet import Net
# from net.GCUnet import Net
os.environ["CUDA_VISIBLE_DEVICES"] = "3"
parser = argparse.Argu... | 0 | 0 | 0 |
caa97c1dcca054cf4bc1742ac91c84392b651a86 | 476 | py | Python | 5th/date_time.py | byplacebo/introduction-to-programming-with-python_kor | 73e2b023c30f0d70006540371b547e1ba5d020ff | [
"MIT"
] | null | null | null | 5th/date_time.py | byplacebo/introduction-to-programming-with-python_kor | 73e2b023c30f0d70006540371b547e1ba5d020ff | [
"MIT"
] | null | null | null | 5th/date_time.py | byplacebo/introduction-to-programming-with-python_kor | 73e2b023c30f0d70006540371b547e1ba5d020ff | [
"MIT"
] | null | null | null | import datetime
print(datetime.date.today())
today = datetime.date.today()
print(today)
print(today.year)
print(today.month)
print(today.day)
print(today.strftime("%d %b %Y"))
print(today.strftime("%A %B %y"))
print(today.strftime("Please attend out event %A, %B %d in the year %Y"))
userInput = input("Please enter ... | 22.666667 | 73 | 0.712185 | import datetime
print(datetime.date.today())
today = datetime.date.today()
print(today)
print(today.year)
print(today.month)
print(today.day)
print(today.strftime("%d %b %Y"))
print(today.strftime("%A %B %y"))
print(today.strftime("Please attend out event %A, %B %d in the year %Y"))
userInput = input("Please enter ... | 0 | 0 | 0 |
4c4d5fd83018f166f6ed697aab80a4fea008d871 | 7,005 | py | Python | zobs/ross/hf_precip_all.py | NMTHydro/Recharge | bbc1a05add92064acffeffb19f04e370b99a7918 | [
"Apache-2.0"
] | 7 | 2016-08-30T15:18:11.000Z | 2021-08-22T00:28:10.000Z | zobs/ross/hf_precip_all.py | dgketchum/etrm | f74f5771fbc6ba5750a790e384eac422b598325a | [
"Apache-2.0"
] | 2 | 2016-06-08T06:41:45.000Z | 2016-06-23T20:47:26.000Z | zobs/ross/hf_precip_all.py | dgketchum/etrm | f74f5771fbc6ba5750a790e384eac422b598325a | [
"Apache-2.0"
] | 1 | 2018-09-18T10:38:08.000Z | 2018-09-18T10:38:08.000Z | # ===============================================================================
# Copyright 2016 ross
#
# 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/LICE... | 42.97546 | 116 | 0.47666 | # ===============================================================================
# Copyright 2016 ross
#
# 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/LICE... | 5,499 | 0 | 23 |
9dad5462e0f34fe2372c1417e1e6437ba154dbda | 115 | py | Python | python/setup.py | brkyvz/test-python | 73ca100915542cdde9aab2bdb97d1f37dc107249 | [
"Apache-2.0"
] | 892 | 2016-02-13T19:33:07.000Z | 2022-03-29T09:49:49.000Z | graphframes-dist/graphframes-0.4.0-spark2.1-s_2.11/python/setup.py | thuongdinh-agilityio/docker-spark-anaconda | 79834649704e94678752aef6e34b47b649c26349 | [
"MIT"
] | 380 | 2016-02-03T23:10:21.000Z | 2022-02-24T05:52:31.000Z | graphframes-dist/graphframes-0.4.0-spark2.1-s_2.11/python/setup.py | thuongdinh-agilityio/docker-spark-anaconda | 79834649704e94678752aef6e34b47b649c26349 | [
"MIT"
] | 250 | 2016-02-03T00:02:52.000Z | 2022-03-28T08:46:07.000Z | # Your python setup file. An example can be found at:
# https://github.com/pypa/sampleproject/blob/master/setup.py
| 38.333333 | 60 | 0.765217 | # Your python setup file. An example can be found at:
# https://github.com/pypa/sampleproject/blob/master/setup.py
| 0 | 0 | 0 |
a06fa2fed28030104a105135e887bc003bb4ac6c | 9,122 | py | Python | NLPCode/sentiment_analysis/LSTM/main.py | trusthlt/dp-across-nlp-tasks | ec3e03511420044cdb0bb1a3574925d354ff03f4 | [
"Apache-2.0"
] | 1 | 2021-12-21T14:05:34.000Z | 2021-12-21T14:05:34.000Z | NLPCode/sentiment_analysis/LSTM/main.py | trusthlt/dp-across-nlp-tasks | ec3e03511420044cdb0bb1a3574925d354ff03f4 | [
"Apache-2.0"
] | null | null | null | NLPCode/sentiment_analysis/LSTM/main.py | trusthlt/dp-across-nlp-tasks | ec3e03511420044cdb0bb1a3574925d354ff03f4 | [
"Apache-2.0"
] | null | null | null | import sys
import os
sys.path.insert(1, os.path.join(sys.path[0], '..'))
import torch
from torchtext.legacy import data
from torchtext.legacy import datasets
import random
import torch.optim as optim
import torch.nn as nn
import time
from train_eval_models import train, evaluate
from lstm_model import LSTM
from utils i... | 46.540816 | 228 | 0.638128 | import sys
import os
sys.path.insert(1, os.path.join(sys.path[0], '..'))
import torch
from torchtext.legacy import data
from torchtext.legacy import datasets
import random
import torch.optim as optim
import torch.nn as nn
import time
from train_eval_models import train, evaluate
from lstm_model import LSTM
from utils i... | 8,423 | 0 | 91 |
006efc88627e312fb8810bcd78fa7b9cddb78c3f | 659 | py | Python | BOJ/exaustive_search_boj/start_link.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | BOJ/exaustive_search_boj/start_link.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | BOJ/exaustive_search_boj/start_link.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | # BOJ 14889
import sys
from itertools import combinations
si = sys.stdin.readline
n = int(si())
graph = [list(map(int, si().split())) for _ in range(n)]
people = [i for i in range(n)]
comb = list(combinations(people, n // 2))
size = len(comb)
start = comb[: size // 2]
link = list(reversed(comb[size // 2 :]))
sub = 1... | 20.59375 | 56 | 0.569044 | # BOJ 14889
import sys
from itertools import combinations
si = sys.stdin.readline
n = int(si())
graph = [list(map(int, si().split())) for _ in range(n)]
people = [i for i in range(n)]
comb = list(combinations(people, n // 2))
size = len(comb)
start = comb[: size // 2]
link = list(reversed(comb[size // 2 :]))
sub = 1... | 0 | 0 | 0 |
f18108c4b4b18796e84bfc2bec317d23dbceab63 | 1,117 | py | Python | leetcode/math/largest-time-for-given-digits.py | jaimeulloa61/data-structure-and-algorithms | 76140bb36b62ebc7c60914c48a323aae4956fb0a | [
"MIT"
] | 81 | 2020-05-22T14:22:04.000Z | 2021-12-18T10:11:23.000Z | leetcode/math/largest-time-for-given-digits.py | jaimeulloa61/data-structure-and-algorithms | 76140bb36b62ebc7c60914c48a323aae4956fb0a | [
"MIT"
] | 4 | 2020-08-06T21:08:00.000Z | 2021-03-31T16:07:50.000Z | leetcode/math/largest-time-for-given-digits.py | jaimeulloa61/data-structure-and-algorithms | 76140bb36b62ebc7c60914c48a323aae4956fb0a | [
"MIT"
] | 37 | 2020-05-22T14:25:21.000Z | 2021-12-30T03:13:13.000Z | """
## Questions: EASY
### 949. [Largest Time for Given Digits](https://leetcode.com/problems/largest-time-for-given-digits)
Given an array of 4 digits, return the largest 24 hour time that can be made.
The smallest 24 hour time is 00:00, and the largest is 23:59. Starting from 00:00, a time is larger if more time ... | 24.822222 | 117 | 0.622202 | """
## Questions: EASY
### 949. [Largest Time for Given Digits](https://leetcode.com/problems/largest-time-for-given-digits)
Given an array of 4 digits, return the largest 24 hour time that can be made.
The smallest 24 hour time is 00:00, and the largest is 23:59. Starting from 00:00, a time is larger if more time ... | 302 | -6 | 49 |
2d9606afaaacd45328bcef0d50dd3a9ce97bc2cc | 3,244 | py | Python | docs/conf.py | Substancia/fdtd | 9444deba9a31f9ef4b4618c1b6c753cf46cc1ae7 | [
"MIT"
] | null | null | null | docs/conf.py | Substancia/fdtd | 9444deba9a31f9ef4b4618c1b6c753cf46cc1ae7 | [
"MIT"
] | null | null | null | docs/conf.py | Substancia/fdtd | 9444deba9a31f9ef4b4618c1b6c753cf46cc1ae7 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 34.147368 | 79 | 0.664612 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 140 | 0 | 45 |
5d5cfccfe104c17e1292b078cb47b07be3d866c4 | 1,065 | py | Python | app/deleteuser.py | ST4NSB/music-recommendation-system | eb8fef34b96a097b78c58e908307032f043bfcd2 | [
"MIT"
] | null | null | null | app/deleteuser.py | ST4NSB/music-recommendation-system | eb8fef34b96a097b78c58e908307032f043bfcd2 | [
"MIT"
] | null | null | null | app/deleteuser.py | ST4NSB/music-recommendation-system | eb8fef34b96a097b78c58e908307032f043bfcd2 | [
"MIT"
] | 1 | 2021-09-04T21:17:37.000Z | 2021-09-04T21:17:37.000Z | from typing import Any, Dict
from flask import jsonify, make_response, request, abort
from flask.helpers import make_response
from flask_restful import Resource
from werkzeug.exceptions import HTTPException
from werkzeug.wrappers import Response
| 35.5 | 74 | 0.613146 | from typing import Any, Dict
from flask import jsonify, make_response, request, abort
from flask.helpers import make_response
from flask_restful import Resource
from werkzeug.exceptions import HTTPException
from werkzeug.wrappers import Response
class DeleteUser(Resource):
def __init__(self, rs: Any, api_key: str)... | 718 | 6 | 76 |
0c032bdb1b147e4aa1adad5967d0417d16a3da49 | 390 | py | Python | app/models/domain/articles.py | StanislavRud/api-realword-app-test | 9a49f299b02cec26d237f3bc4b363c8b93520b7b | [
"MIT"
] | 1,875 | 2019-03-27T14:26:20.000Z | 2022-03-31T14:52:50.000Z | app/models/domain/articles.py | StanislavRud/api-realword-app-test | 9a49f299b02cec26d237f3bc4b363c8b93520b7b | [
"MIT"
] | 232 | 2019-04-11T11:05:48.000Z | 2022-03-05T10:23:50.000Z | app/models/domain/articles.py | StanislavRud/api-realword-app-test | 9a49f299b02cec26d237f3bc4b363c8b93520b7b | [
"MIT"
] | 433 | 2019-04-11T01:48:59.000Z | 2022-03-31T10:33:42.000Z | from typing import List
from app.models.common import DateTimeModelMixin, IDModelMixin
from app.models.domain.profiles import Profile
from app.models.domain.rwmodel import RWModel
| 22.941176 | 62 | 0.753846 | from typing import List
from app.models.common import DateTimeModelMixin, IDModelMixin
from app.models.domain.profiles import Profile
from app.models.domain.rwmodel import RWModel
class Article(IDModelMixin, DateTimeModelMixin, RWModel):
slug: str
title: str
description: str
body: str
tags: List[... | 0 | 185 | 23 |
4c2412ee0bfe7391af1f0ace035b2d7d655dc6b5 | 872 | py | Python | visual_mpc/policy/handcrafted/playback_policy.py | thomasweng15/visual_foresight | 0f00ffcfc05e9ce47d76d440d91c298a35d8f7b1 | [
"MIT"
] | 108 | 2018-12-04T04:57:07.000Z | 2022-03-15T21:13:36.000Z | visual_mpc/policy/handcrafted/playback_policy.py | thomasweng15/visual_foresight | 0f00ffcfc05e9ce47d76d440d91c298a35d8f7b1 | [
"MIT"
] | 16 | 2019-03-12T13:31:45.000Z | 2022-03-11T23:36:12.000Z | visual_mpc/policy/handcrafted/playback_policy.py | thomasweng15/visual_foresight | 0f00ffcfc05e9ce47d76d440d91c298a35d8f7b1 | [
"MIT"
] | 35 | 2018-12-05T08:41:54.000Z | 2022-03-15T21:13:37.000Z | import numpy as np
from visual_mpc.policy.policy import Policy
import sys
if sys.version_info[0] < 3:
import cPickle as pkl
else:
import pickle as pkl
| 30.068966 | 70 | 0.649083 | import numpy as np
from visual_mpc.policy.policy import Policy
import sys
if sys.version_info[0] < 3:
import cPickle as pkl
else:
import pickle as pkl
class PlaybackPolicy(Policy):
def __init__(self, agentparams, policyparams, gpu_id, npgu):
self._hp = self._default_hparams()
self._overrid... | 601 | 8 | 103 |
705c2e7f64edcd9f9ffde7a0277d8c6b633c79e3 | 2,338 | py | Python | portfolio/Python/scrapy/netthandelen/coverbrands_spider.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | null | null | null | portfolio/Python/scrapy/netthandelen/coverbrands_spider.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | null | null | null | portfolio/Python/scrapy/netthandelen/coverbrands_spider.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | 5 | 2016-03-22T07:40:46.000Z | 2021-05-30T16:12:21.000Z | import os
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, HtmlResponse
from scrapy.utils.url import urljoin_rfc
from scrapy.utils.response import get_base_url
from product_spiders.items import Product, ProductLoaderWithNameStrip as ProductLoader
from ... | 50.826087 | 151 | 0.639008 | import os
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, HtmlResponse
from scrapy.utils.url import urljoin_rfc
from scrapy.utils.response import get_base_url
from product_spiders.items import Product, ProductLoaderWithNameStrip as ProductLoader
from ... | 1,667 | 191 | 23 |
70ec56ff780f5dd797f1ef1f0a062e333cc08162 | 1,829 | py | Python | tests/integration/agent/test_agent_manager.py | datacraft-dsc/starfish-py | 95ff24410f056e8e2d313c3af97439fe003e294a | [
"Apache-2.0"
] | 4 | 2019-02-08T03:47:36.000Z | 2019-10-17T21:45:23.000Z | tests/integration/agent/test_agent_manager.py | datacraft-dsc/starfish-py | 95ff24410f056e8e2d313c3af97439fe003e294a | [
"Apache-2.0"
] | 81 | 2019-02-09T01:01:51.000Z | 2020-07-01T08:35:07.000Z | tests/integration/agent/test_agent_manager.py | oceanprotocol/ocean-py | 318ad0de2519e61d0a301c040a48d1839cd82425 | [
"Apache-2.0"
] | 1 | 2021-01-28T12:14:03.000Z | 2021-01-28T12:14:03.000Z | """
Unit test AgentManager
"""
import pytest
import secrets
from starfish.agent_manager import AgentManager
from starfish.asset import DataAsset
from starfish.network.ddo import DDO
| 25.054795 | 83 | 0.726627 | """
Unit test AgentManager
"""
import pytest
import secrets
from starfish.agent_manager import AgentManager
from starfish.asset import DataAsset
from starfish.network.ddo import DDO
def test_agent_manager_register(config):
manager = AgentManager()
manager.register_agents(config['agents'])
assert(mana... | 1,572 | 0 | 69 |
032adfb13952d189310f2016bb5a3fedf65a3dad | 2,356 | py | Python | ahvl/options/lookup/sshhostkey.py | gardar/ahvl | 045b5882d94fc2d4ba7b194bf65ebfbf9d2e1d6d | [
"MIT"
] | 4 | 2019-10-12T12:11:23.000Z | 2021-12-20T13:53:28.000Z | ahvl/options/lookup/sshhostkey.py | gardar/ahvl | 045b5882d94fc2d4ba7b194bf65ebfbf9d2e1d6d | [
"MIT"
] | 2 | 2021-02-05T12:52:55.000Z | 2022-02-11T10:58:52.000Z | ahvl/options/lookup/sshhostkey.py | gardar/ahvl | 045b5882d94fc2d4ba7b194bf65ebfbf9d2e1d6d | [
"MIT"
] | 1 | 2020-08-13T07:52:27.000Z | 2020-08-13T07:52:27.000Z | #
# import modules
#
from ahvl.options.base import OptionsBase
from ahvl.helper import AhvlMsg, AhvlHelper
#
# helper/message
#
msg = AhvlMsg()
hlp = AhvlHelper()
#
# OptionsLookupSSHHostKey
#
# set option prefix
# set path
# useable variables:
# - {find}
# - {hostname}
# set default opti... | 24.040816 | 129 | 0.532683 | #
# import modules
#
from ahvl.options.base import OptionsBase
from ahvl.helper import AhvlMsg, AhvlHelper
#
# helper/message
#
msg = AhvlMsg()
hlp = AhvlHelper()
#
# OptionsLookupSSHHostKey
#
class OptionsLookupSSHHostKey(OptionsBase):
# set option prefix
def get_prefix(self):
# return option prefi... | 1,761 | 22 | 179 |
3a1594135a5ff0e3497e305d1ed292ee397596f7 | 1,276 | py | Python | tests/integration/__init__.py | codeanonorg/Simple | f96d241f6a39e9f9dc949a3598cd46f4b6d044f4 | [
"MIT"
] | 2 | 2021-01-23T23:33:08.000Z | 2021-01-24T14:01:53.000Z | tests/integration/__init__.py | codeanonorg/Simple | f96d241f6a39e9f9dc949a3598cd46f4b6d044f4 | [
"MIT"
] | null | null | null | tests/integration/__init__.py | codeanonorg/Simple | f96d241f6a39e9f9dc949a3598cd46f4b6d044f4 | [
"MIT"
] | null | null | null | """
Copyright (c) 2021 SolarLiner, jdrprod, Arxaqapi
This software is released under the MIT License.
https://opensource.org/licenses/MIT
"""
import os
import json
import unittest
from pathlib import Path
from Simple.document import Document
| 27.73913 | 83 | 0.583072 | """
Copyright (c) 2021 SolarLiner, jdrprod, Arxaqapi
This software is released under the MIT License.
https://opensource.org/licenses/MIT
"""
import os
import json
import unittest
from pathlib import Path
from Simple.document import Document
class FolderExpansionTest(unittest.TestCase):
def __init__(self, ... | 850 | 50 | 125 |
8c4caf932f48cc51a3aeb48a3097d04e3375be45 | 12,246 | py | Python | trading/views/offers.py | DarkoR12/dafi-system | f923ea4273b04f7acc7016b2f7d03e51eb00b85b | [
"MIT"
] | 7 | 2019-08-03T12:25:18.000Z | 2021-11-02T12:51:33.000Z | trading/views/offers.py | DarkoR12/dafi-system | f923ea4273b04f7acc7016b2f7d03e51eb00b85b | [
"MIT"
] | 11 | 2019-08-20T17:07:37.000Z | 2021-11-23T14:26:07.000Z | trading/views/offers.py | DarkoR12/dafi-system | f923ea4273b04f7acc7016b2f7d03e51eb00b85b | [
"MIT"
] | 4 | 2020-04-06T11:33:02.000Z | 2021-10-31T09:10:53.000Z | import json
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.core.exceptions import ValidationError
from django.db.models import Q
from django.shortcuts import redirect
from django.urls import reverse
from django.views.generic import DetailView, ListView, TemplateView
from me... | 31.643411 | 274 | 0.609832 | import json
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.core.exceptions import ValidationError
from django.db.models import Q
from django.shortcuts import redirect
from django.urls import reverse
from django.views.generic import DetailView, ListView, TemplateView
from me... | 8,751 | 2,756 | 233 |
4d22960ef5f9a340afb99d07dec3bd573b96f594 | 2,096 | py | Python | lesson 1/parseXLS.py | olive-everest/wrangling_mongodb | f4af9c0e5d6ac9611b2a1b6dc2b2ed46df07bc15 | [
"MIT"
] | 2 | 2020-03-03T23:57:09.000Z | 2020-10-20T03:30:40.000Z | lesson 1/parseXLS.py | olive-everest/wrangling_mongodb | f4af9c0e5d6ac9611b2a1b6dc2b2ed46df07bc15 | [
"MIT"
] | null | null | null | lesson 1/parseXLS.py | olive-everest/wrangling_mongodb | f4af9c0e5d6ac9611b2a1b6dc2b2ed46df07bc15 | [
"MIT"
] | 2 | 2018-09-03T21:48:51.000Z | 2019-05-27T07:45:42.000Z | #!~/envs/python3/udacity_python_mongodb
import xlrd
import pprint
datafile = "datasets/2013_ERCOT_Hourly_Load_Data.xls"
data = parse_file(datafile)
pprint.pprint(data)
assert data['maxtime'] == (2013, 8, 13, 17, 0, 0)
assert round(data['maxvalue'], 10) == round(18779.02551, 10)
| 27.578947 | 113 | 0.614504 | #!~/envs/python3/udacity_python_mongodb
import xlrd
import pprint
datafile = "datasets/2013_ERCOT_Hourly_Load_Data.xls"
def parse_file(datafile):
workbook = xlrd.open_workbook(datafile)
sheet = workbook.sheet_by_index(0)
data = [
[
sheet.cell_value(r, col)
for col in ra... | 1,787 | 0 | 23 |
f2cc08c2712855bb70c1b2df5f5eceb724bfcb74 | 2,611 | py | Python | LinkedList/NthNode.py | pritsheth/Algorithms-Python | b8af30cbf95a772c9b9b997a30ff2c8b56a040e0 | [
"MIT"
] | null | null | null | LinkedList/NthNode.py | pritsheth/Algorithms-Python | b8af30cbf95a772c9b9b997a30ff2c8b56a040e0 | [
"MIT"
] | null | null | null | LinkedList/NthNode.py | pritsheth/Algorithms-Python | b8af30cbf95a772c9b9b997a30ff2c8b56a040e0 | [
"MIT"
] | null | null | null |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
l1 = ListNode(1)
l2 = ListNode(6)
l3 = ListNode(2)
l4 = ListNode(5)
l5 = ListNode(4)
l1.next = l2
l2.next = l3
l3.next = l4
l4.next = l5
list = [1,2,3,4]
print("cond",list)
s = S... | 20.24031 | 57 | 0.475297 |
class Solution(object):
def mergeKLists(self, lists):
"""
:type lists: List[ListNode]
:rtype: ListNode
"""
head = point = ListNode(0)
q = PriorityQueue()
for l in lists:
if l:
q.put((l.val, l))
while not q.empty():
... | 1,538 | 494 | 202 |
af764e5dafc2947fe07066ff6030906511929558 | 4,562 | py | Python | language-model/optimizers/.ipynb_checkpoints/SRRAdam-checkpoint.py | minhtannguyen/RAdam | 44f403288df375bae0785cc82dd8c888eaaaa441 | [
"Apache-2.0"
] | null | null | null | language-model/optimizers/.ipynb_checkpoints/SRRAdam-checkpoint.py | minhtannguyen/RAdam | 44f403288df375bae0785cc82dd8c888eaaaa441 | [
"Apache-2.0"
] | null | null | null | language-model/optimizers/.ipynb_checkpoints/SRRAdam-checkpoint.py | minhtannguyen/RAdam | 44f403288df375bae0785cc82dd8c888eaaaa441 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Scheduled restarting RAdam
"""
import math
import torch
from optimizer import Optimizer | 43.447619 | 176 | 0.47523 | # -*- coding: utf-8 -*-
"""
Scheduled restarting RAdam
"""
import math
import torch
from optimizer import Optimizer
class SRRAdam(Optimizer):
def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=5e-4, iter_count=1, restarting_iter=50):
defaults = dict(lr=lr, betas=betas, eps=eps, ... | 4,301 | 4 | 142 |
69cc881c3132317dc99b291b997c426537752b21 | 591 | py | Python | _Dist/NeuralNetworks/_Tests/_UnitTests/UnitTestUtil.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 1,107 | 2016-09-21T02:18:36.000Z | 2022-03-29T02:52:12.000Z | _Dist/NeuralNetworks/_Tests/_UnitTests/UnitTestUtil.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 18 | 2016-12-22T10:24:47.000Z | 2022-03-11T23:18:43.000Z | _Dist/NeuralNetworks/_Tests/_UnitTests/UnitTestUtil.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 776 | 2016-12-21T12:08:08.000Z | 2022-03-21T06:12:08.000Z | import os
import shutil
root_cwd = os.path.abspath("../")
| 31.105263 | 69 | 0.700508 | import os
import shutil
root_cwd = os.path.abspath("../")
def clear_cache():
cwd = os.getcwd()
local_data_folder = os.path.join(cwd, "_Data")
if os.path.isdir(local_data_folder):
shutil.rmtree(local_data_folder)
shutil.rmtree(os.path.join(cwd, "_Models"))
remote_cache_folder = os.path.joi... | 508 | 0 | 23 |
6f5491579cffa286e720c032978958a0958d8bfb | 7,293 | py | Python | cryptonote/classes/wallet/address.py | kayabaNerve/cryptonote-library | 00bef43527172cffa75c2445430f36ceb80fbcb6 | [
"MIT"
] | 8 | 2020-11-08T07:13:43.000Z | 2021-09-20T11:14:23.000Z | cryptonote/classes/wallet/address.py | kayabaNerve/cryptonote-library | 00bef43527172cffa75c2445430f36ceb80fbcb6 | [
"MIT"
] | 7 | 2020-11-08T04:23:32.000Z | 2022-03-24T04:26:13.000Z | cryptonote/classes/wallet/address.py | kayabaNerve/cryptonote-library | 00bef43527172cffa75c2445430f36ceb80fbcb6 | [
"MIT"
] | 5 | 2020-11-08T06:09:38.000Z | 2021-05-10T17:52:24.000Z | """Address file. Handles address encoding and decoding."""
# Types.
from typing import Tuple, Optional, Any
# Keccak hash function.
from Cryptodome.Hash import keccak
# Crypto class.
from cryptonote.crypto.crypto import Crypto
# Base58 Character Set.
BASE58: str = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqr... | 34.728571 | 92 | 0.574386 | """Address file. Handles address encoding and decoding."""
# Types.
from typing import Tuple, Optional, Any
# Keccak hash function.
from Cryptodome.Hash import keccak
# Crypto class.
from cryptonote.crypto.crypto import Crypto
# Base58 Character Set.
BASE58: str = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqr... | 25 | 0 | 27 |