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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d23a830cb4e13b7e73b64bf53b38781e2f971948 | 3,133 | py | Python | auth_service.py | open-bms/open-bms-core | 36d9e2992f9dedeb5794f49993bfdb8da3fe4be7 | [
"MIT"
] | null | null | null | auth_service.py | open-bms/open-bms-core | 36d9e2992f9dedeb5794f49993bfdb8da3fe4be7 | [
"MIT"
] | 2 | 2021-12-14T04:07:24.000Z | 2021-12-15T23:28:54.000Z | auth_service.py | open-bms/open-bms-core | 36d9e2992f9dedeb5794f49993bfdb8da3fe4be7 | [
"MIT"
] | null | null | null | """The auth service module configures the flask app for the OpenBMS auth service.
The auth service provides an API for managing and authenticating user accounts. Users
may authenticate through a number of supported identity provides using SAML or through a
native OpenBMS account using an email address and password. Th... | 33.688172 | 88 | 0.721673 | """The auth service module configures the flask app for the OpenBMS auth service.
The auth service provides an API for managing and authenticating user accounts. Users
may authenticate through a number of supported identity provides using SAML or through a
native OpenBMS account using an email address and password. Th... | 0 | 0 | 0 |
11482d584e2b935307aae8ac905f448fa6b0334e | 1,119 | py | Python | cnn_code/download.py | neurocaience/deepfreeze | 2a8c7da7519df2bacb640917695bd7d226e8d4f4 | [
"MIT"
] | 1 | 2020-11-17T06:41:10.000Z | 2020-11-17T06:41:10.000Z | cnn_code/download.py | neurocaience/DeepFreeze | 2a8c7da7519df2bacb640917695bd7d226e8d4f4 | [
"MIT"
] | null | null | null | cnn_code/download.py | neurocaience/DeepFreeze | 2a8c7da7519df2bacb640917695bd7d226e8d4f4 | [
"MIT"
] | 1 | 2020-06-18T04:25:48.000Z | 2020-06-18T04:25:48.000Z | """=============================================================================
Download experimental directory.
============================================================================="""
import argparse
import os
# ------------------------------------------------------------------------------
def mkdir(direc... | 31.971429 | 80 | 0.416443 | """=============================================================================
Download experimental directory.
============================================================================="""
import argparse
import os
# ------------------------------------------------------------------------------
def mkdir(direc... | 0 | 0 | 0 |
79370707ea19958677a1687502db406a21323fe7 | 576 | py | Python | test/tablature_test.py | illume/eyestabs | 9ce717743a6a4fe7b561c68599e9352da3acf080 | [
"Unlicense"
] | null | null | null | test/tablature_test.py | illume/eyestabs | 9ce717743a6a4fe7b561c68599e9352da3acf080 | [
"Unlicense"
] | null | null | null | test/tablature_test.py | illume/eyestabs | 9ce717743a6a4fe7b561c68599e9352da3acf080 | [
"Unlicense"
] | null | null | null | ################################################################################
# User Libs
import test_utils
import test.unittest as unittest
import tablature as tab
# Std Libs
import os
################################################################################
################################... | 27.428571 | 81 | 0.401042 | ################################################################################
# User Libs
import test_utils
import test.unittest as unittest
import tablature as tab
# Std Libs
import os
################################################################################
class TestTablature(unittest.Tes... | 87 | 18 | 52 |
758fa9c537d5f3560f051905e3a75eea1d8a820b | 77 | py | Python | ofcourse/tests/__main__.py | liam-middlebrook/ofCourse | e93dc1b7fa825ad130a2b2a6eb8b5048e2c4005d | [
"Apache-2.0"
] | null | null | null | ofcourse/tests/__main__.py | liam-middlebrook/ofCourse | e93dc1b7fa825ad130a2b2a6eb8b5048e2c4005d | [
"Apache-2.0"
] | null | null | null | ofcourse/tests/__main__.py | liam-middlebrook/ofCourse | e93dc1b7fa825ad130a2b2a6eb8b5048e2c4005d | [
"Apache-2.0"
] | null | null | null | import test_yaml
import test_new
test_yaml.run_tests()
test_new.run_tests()
| 12.833333 | 21 | 0.831169 | import test_yaml
import test_new
test_yaml.run_tests()
test_new.run_tests()
| 0 | 0 | 0 |
0915537fd83ad76cc12260da6e25dbff6438a263 | 1,718 | py | Python | ietf/utils/models.py | hassanakbar4/ietfdb | cabee059092ae776015410640226064331c293b7 | [
"BSD-3-Clause"
] | 25 | 2022-03-05T08:26:52.000Z | 2022-03-30T15:45:42.000Z | ietf/utils/models.py | hassanakbar4/ietfdb | cabee059092ae776015410640226064331c293b7 | [
"BSD-3-Clause"
] | 219 | 2022-03-04T17:29:12.000Z | 2022-03-31T21:16:14.000Z | ietf/utils/models.py | hassanakbar4/ietfdb | cabee059092ae776015410640226064331c293b7 | [
"BSD-3-Clause"
] | 22 | 2022-03-04T15:34:34.000Z | 2022-03-28T13:30:59.000Z | # Copyright The IETF Trust 2015-2020, All Rights Reserved
import itertools
from django.db import models
class ForeignKey(models.ForeignKey):
"A local ForeignKey proxy which provides the on_delete value required under Django 2.0."
class OneToOneField(models.OneToOneField):
"A local OneToOneField prox... | 38.177778 | 95 | 0.708382 | # Copyright The IETF Trust 2015-2020, All Rights Reserved
import itertools
from django.db import models
class DumpInfo(models.Model):
date = models.DateTimeField()
host = models.CharField(max_length=128)
tz = models.CharField(max_length=32, default='UTC')
class VersionInfo(models.Model):
time ... | 245 | 451 | 102 |
0a6321c2240f9ea7f8a93b45daf5ef2dc3b73b95 | 11,227 | py | Python | tests/test_config.py | beschouten/home-assistant | f50c30bbbad4d92e342c8547630c63c0c7882803 | [
"MIT"
] | null | null | null | tests/test_config.py | beschouten/home-assistant | f50c30bbbad4d92e342c8547630c63c0c7882803 | [
"MIT"
] | null | null | null | tests/test_config.py | beschouten/home-assistant | f50c30bbbad4d92e342c8547630c63c0c7882803 | [
"MIT"
] | null | null | null | """Test config utils."""
# pylint: disable=too-many-public-methods,protected-access
import os
import tempfile
import unittest
import unittest.mock as mock
import pytest
from voluptuous import MultipleInvalid
from homeassistant.core import DOMAIN, HomeAssistantError, Config
import homeassistant.config as config_util
f... | 35.528481 | 77 | 0.625367 | """Test config utils."""
# pylint: disable=too-many-public-methods,protected-access
import os
import tempfile
import unittest
import unittest.mock as mock
import pytest
from voluptuous import MultipleInvalid
from homeassistant.core import DOMAIN, HomeAssistantError, Config
import homeassistant.config as config_util
f... | 761 | 0 | 27 |
b6635285c7d00ae82d0c261aeba71329a67efc08 | 14,586 | py | Python | ipf/glue2/compute.py | pauldalewilliams/ipf | 2bee1746d74724105a88b6b152bab4318ff32bfd | [
"Apache-2.0"
] | 1 | 2018-03-16T23:25:10.000Z | 2018-03-16T23:25:10.000Z | ipf/glue2/compute.py | pauldalewilliams/ipf | 2bee1746d74724105a88b6b152bab4318ff32bfd | [
"Apache-2.0"
] | 2 | 2020-07-26T02:42:48.000Z | 2022-03-23T16:37:49.000Z | ipf/glue2/compute.py | pauldalewilliams/ipf | 2bee1746d74724105a88b6b152bab4318ff32bfd | [
"Apache-2.0"
] | 3 | 2020-06-15T18:20:15.000Z | 2021-05-25T15:50:35.000Z |
###############################################################################
# Copyright 2011-2014 The University of Texas at Austin #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #... | 44.066465 | 189 | 0.593857 |
###############################################################################
# Copyright 2011-2014 The University of Texas at Austin #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #... | 9,904 | 486 | 396 |
7268716acc82c2e94387b7f98b37eb3a235bba97 | 488 | py | Python | src/azure_keyvault_browser/widgets/__init__.py | samdobson/azure-keyvault-browser | 7e7200dad34f668e477229fe3698e59195b68a78 | [
"MIT"
] | 5 | 2021-12-17T00:18:44.000Z | 2021-12-29T05:18:47.000Z | src/azure_keyvault_browser/widgets/__init__.py | samdobson/azure-keyvault-browser | 7e7200dad34f668e477229fe3698e59195b68a78 | [
"MIT"
] | 6 | 2021-12-20T17:57:21.000Z | 2021-12-29T10:29:04.000Z | src/azure_keyvault_browser/widgets/__init__.py | samdobson/azure-keyvault-browser | 7e7200dad34f668e477229fe3698e59195b68a78 | [
"MIT"
] | 1 | 2021-12-20T15:06:03.000Z | 2021-12-20T15:06:03.000Z | from .filter import FilterWidget
from .flash import FlashWidget, ShowFlashNotification
from .header import HeaderWidget
from .help import HelpWidget
from .secret_properties import SecretPropertiesWidget
from .secret_versions import SecretVersionsWidget
from .secrets import SecretsWidget
__all__ = (
"SecretsWidget"... | 25.684211 | 53 | 0.776639 | from .filter import FilterWidget
from .flash import FlashWidget, ShowFlashNotification
from .header import HeaderWidget
from .help import HelpWidget
from .secret_properties import SecretPropertiesWidget
from .secret_versions import SecretVersionsWidget
from .secrets import SecretsWidget
__all__ = (
"SecretsWidget"... | 0 | 0 | 0 |
97cd577d5266057515b84c623a4e2cb5632a6417 | 382 | py | Python | Section 18/4.Document-scope-of-the-variables.py | airbornum/-Complete-Python-Scripting-for-Automation | bc053444f8786259086269ca1713bdb10144dd74 | [
"MIT"
] | 18 | 2020-04-13T03:14:06.000Z | 2022-03-09T18:54:41.000Z | Section 18/4.Document-scope-of-the-variables.py | airbornum/-Complete-Python-Scripting-for-Automation | bc053444f8786259086269ca1713bdb10144dd74 | [
"MIT"
] | null | null | null | Section 18/4.Document-scope-of-the-variables.py | airbornum/-Complete-Python-Scripting-for-Automation | bc053444f8786259086269ca1713bdb10144dd74 | [
"MIT"
] | 22 | 2020-04-29T21:12:42.000Z | 2022-03-17T18:19:54.000Z |
main()
| 11.235294 | 32 | 0.599476 | def myfunction1():
x=60 #This is local variable
print("Welcome to functions")
print("x value from fun1: ",x)
#myfunction2()
return None
def myfunction2(y): #Parameter
print("Thank you!!")
print("x value from fun2: ",y)
return None
def main():
#global x
x=10
myfunction1()
myfunction2(x... | 273 | 0 | 73 |
ea4e6724ee9153b7da1be30b271755785ac1a14b | 3,196 | py | Python | pycausal_explorer/meta/_xlearner.py | gotolino/pycausal-explorer | 250309674c0657b9ccd318aea0893827da1badfe | [
"MIT"
] | 3 | 2022-01-28T12:32:43.000Z | 2022-02-12T23:26:52.000Z | pycausal_explorer/meta/_xlearner.py | gotolino/pycausal-explorer | 250309674c0657b9ccd318aea0893827da1badfe | [
"MIT"
] | 8 | 2022-02-06T19:34:47.000Z | 2022-03-11T17:24:23.000Z | pycausal_explorer/meta/_xlearner.py | gotolino/pycausal-explorer | 250309674c0657b9ccd318aea0893827da1badfe | [
"MIT"
] | null | null | null | import numpy as np
from sklearn.base import clone
from sklearn.ensemble import RandomForestRegressor
from sklearn.utils.validation import check_is_fitted, check_X_y
from pycausal_explorer.base import BaseCausalModel
from ..reweight import PropensityScore
class XLearner(BaseCausalModel):
"""
Implementation ... | 31.96 | 105 | 0.604506 | import numpy as np
from sklearn.base import clone
from sklearn.ensemble import RandomForestRegressor
from sklearn.utils.validation import check_is_fitted, check_X_y
from pycausal_explorer.base import BaseCausalModel
from ..reweight import PropensityScore
class XLearner(BaseCausalModel):
"""
Implementation ... | 2,099 | 0 | 108 |
cbbef13972885989e5977242841f369812ccf86f | 5,437 | py | Python | tests/fixtures/test_funding_awards_json/content_05_expected.py | elifesciences/elife-tools | ee345bf0e6703ef0f7e718355e85730abbdfd117 | [
"MIT"
] | 9 | 2015-04-16T08:13:31.000Z | 2020-05-18T14:03:06.000Z | tests/fixtures/test_funding_awards_json/content_05_expected.py | elifesciences/elife-tools | ee345bf0e6703ef0f7e718355e85730abbdfd117 | [
"MIT"
] | 310 | 2015-02-11T00:30:09.000Z | 2021-07-14T23:58:50.000Z | tests/fixtures/test_funding_awards_json/content_05_expected.py | elifesciences/elife-tools | ee345bf0e6703ef0f7e718355e85730abbdfd117 | [
"MIT"
] | 9 | 2015-02-04T01:21:28.000Z | 2021-06-15T12:50:47.000Z | # coding=utf-8
from collections import OrderedDict
expected = [
OrderedDict(
[
("id", u"par-1"),
(
"source",
OrderedDict(
[
("funderId", u"10.13039/100006978"),
(
... | 29.389189 | 105 | 0.22586 | # coding=utf-8
from collections import OrderedDict
expected = [
OrderedDict(
[
("id", u"par-1"),
(
"source",
OrderedDict(
[
("funderId", u"10.13039/100006978"),
(
... | 0 | 0 | 0 |
1859eec29c6660f3e68c133f3169370664e0a82a | 114 | py | Python | apps/web/admin.py | fabioanderegg/code_annotate | 671c5f2b1eee30dffb85e58ce961e18d3344bc94 | [
"MIT"
] | null | null | null | apps/web/admin.py | fabioanderegg/code_annotate | 671c5f2b1eee30dffb85e58ce961e18d3344bc94 | [
"MIT"
] | null | null | null | apps/web/admin.py | fabioanderegg/code_annotate | 671c5f2b1eee30dffb85e58ce961e18d3344bc94 | [
"MIT"
] | null | null | null | from django.contrib import admin
from apps.web.models import CodeAnnotation
admin.site.register(CodeAnnotation)
| 19 | 42 | 0.842105 | from django.contrib import admin
from apps.web.models import CodeAnnotation
admin.site.register(CodeAnnotation)
| 0 | 0 | 0 |
d1a1ee0a1ae8da5ce6bbf899e475145bdd0f5451 | 2,011 | py | Python | PuppeteerLibrary/keywords/mockresponse.py | sdvicorp/robotframework-puppeteer | af6fa68b04c3cdac3a7662cffda6da2a5ace38d1 | [
"Apache-2.0"
] | 37 | 2019-10-28T01:35:43.000Z | 2022-03-31T04:11:49.000Z | PuppeteerLibrary/keywords/mockresponse.py | sdvicorp/robotframework-puppeteer | af6fa68b04c3cdac3a7662cffda6da2a5ace38d1 | [
"Apache-2.0"
] | 61 | 2020-07-16T00:18:22.000Z | 2022-03-24T07:12:05.000Z | PuppeteerLibrary/keywords/mockresponse.py | sdvicorp/robotframework-puppeteer | af6fa68b04c3cdac3a7662cffda6da2a5ace38d1 | [
"Apache-2.0"
] | 10 | 2020-03-03T05:28:05.000Z | 2022-02-14T10:03:44.000Z | from PuppeteerLibrary.ikeywords.imockresponse_async import iMockResponseAsync
from PuppeteerLibrary.base.robotlibcore import keyword
from PuppeteerLibrary.base.librarycomponent import LibraryComponent
| 40.22 | 140 | 0.611636 | from PuppeteerLibrary.ikeywords.imockresponse_async import iMockResponseAsync
from PuppeteerLibrary.base.robotlibcore import keyword
from PuppeteerLibrary.base.librarycomponent import LibraryComponent
class MockResponseKeywords(LibraryComponent):
def __init__(self, ctx):
super().__init__(ctx)
def ge... | 167 | 1,619 | 23 |
a29fc96079d39943724101eb7ecfb452bcb65d11 | 254 | py | Python | splintr/__init__.py | shreykshah/splintr | 1fc2580606c1ccfe36ad13be68794e69c450ed05 | [
"Apache-2.0"
] | 2 | 2021-01-18T07:12:28.000Z | 2021-01-18T07:12:43.000Z | splintr/__init__.py | vsrin1/splintr | 218a268dd8cc3aa02e1adc69ab556922f6e01a11 | [
"Apache-2.0"
] | null | null | null | splintr/__init__.py | vsrin1/splintr | 218a268dd8cc3aa02e1adc69ab556922f6e01a11 | [
"Apache-2.0"
] | 2 | 2020-07-18T15:38:19.000Z | 2020-07-18T20:35:10.000Z | __all__ = ['DataParallel', 'ModelParallel', 'benchmarks', 'dataparallel', 'modelparallel']
from .DataParallel import DataParallel
from .ModelParallel import ModelParallel
import splintr.benchmarks
import splintr.dataparallel
import splintr.modelparallel
| 36.285714 | 90 | 0.830709 | __all__ = ['DataParallel', 'ModelParallel', 'benchmarks', 'dataparallel', 'modelparallel']
from .DataParallel import DataParallel
from .ModelParallel import ModelParallel
import splintr.benchmarks
import splintr.dataparallel
import splintr.modelparallel
| 0 | 0 | 0 |
7fca4dacf6508d4beaf221a6e17c5e956d2bb365 | 141 | py | Python | test/__init__.py | CjwRiver/apiAutoTest | 35f1c2475e76dd34089e2cee33b351a1ca97c168 | [
"MIT"
] | null | null | null | test/__init__.py | CjwRiver/apiAutoTest | 35f1c2475e76dd34089e2cee33b351a1ca97c168 | [
"MIT"
] | null | null | null | test/__init__.py | CjwRiver/apiAutoTest | 35f1c2475e76dd34089e2cee33b351a1ca97c168 | [
"MIT"
] | null | null | null | #!/usr/bin/env/python3
# -*- coding:utf-8 -*-
"""
@project: apiAutoTest
@author: cjw
@file: __init__.py.py
@ide: PyCharm
@time: 2020/7/31
""" | 15.666667 | 22 | 0.638298 | #!/usr/bin/env/python3
# -*- coding:utf-8 -*-
"""
@project: apiAutoTest
@author: cjw
@file: __init__.py.py
@ide: PyCharm
@time: 2020/7/31
""" | 0 | 0 | 0 |
9a7b5fda502bc31c6581fe21da183c411caabf7c | 8,331 | py | Python | purge-user.py | appaegis/api-script-samples | f5445b351411fe858e2130e47b28befccc6262e8 | [
"MIT"
] | null | null | null | purge-user.py | appaegis/api-script-samples | f5445b351411fe858e2130e47b28befccc6262e8 | [
"MIT"
] | null | null | null | purge-user.py | appaegis/api-script-samples | f5445b351411fe858e2130e47b28befccc6262e8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import logging
import argparse
import pydash
from lib.common import USER_EMAIL
from lib.common import API_KEY
from lib.common import API_SECRET
from lib.common import USER_API
from lib.common import TEAM_API
from lib.common import ROLE_API
from lib.common import POLICY_API
from ... | 42.28934 | 121 | 0.723443 | #!/usr/bin/env python
# coding: utf-8
import logging
import argparse
import pydash
from lib.common import USER_EMAIL
from lib.common import API_KEY
from lib.common import API_SECRET
from lib.common import USER_API
from lib.common import TEAM_API
from lib.common import ROLE_API
from lib.common import POLICY_API
from ... | 7,260 | 0 | 23 |
7d59636da25ea632171a4002c1c95bd69b16a857 | 946 | py | Python | hanoi.py | PanzeriT/hanoi | 7817bda536d059f438c9268c5f0c6a40ef78ca94 | [
"MIT"
] | null | null | null | hanoi.py | PanzeriT/hanoi | 7817bda536d059f438c9268c5f0c6a40ef78ca94 | [
"MIT"
] | null | null | null | hanoi.py | PanzeriT/hanoi | 7817bda536d059f438c9268c5f0c6a40ef78ca94 | [
"MIT"
] | null | null | null | from typing import TypeVar, Generic, List
T = TypeVar('T')
if __name__ == '__main__':
discs: int = 5
tower_a: Stack[int] = Stack()
tower_b: Stack[int] = Stack()
tower_c: Stack[int] = Stack()
for i in range(discs, 0, -1):
tower_a.push(i)
print(tower_a, tower_b, tower_c)
hanoi(to... | 23.073171 | 80 | 0.581395 | from typing import TypeVar, Generic, List
T = TypeVar('T')
class Stack(Generic[T]):
def __init__(self) -> None:
self._container: List[T] = []
def push(self, item: T) -> None:
self._container.append(item)
def pop(self) -> T:
return self._container.pop()
def __repr__(self) -... | 437 | 3 | 154 |
96e121827578905e3826a776de058f40e9f17b21 | 1,076 | py | Python | code/tests/test_prepare/test_utils.py | evolaemp/svmcc | c57c92c6b97f57ab8f7bc20ac06c1c77d96c5143 | [
"MIT"
] | 1 | 2020-07-16T05:01:16.000Z | 2020-07-16T05:01:16.000Z | code/tests/test_prepare/test_utils.py | evolaemp/svmcc | c57c92c6b97f57ab8f7bc20ac06c1c77d96c5143 | [
"MIT"
] | null | null | null | code/tests/test_prepare/test_utils.py | evolaemp/svmcc | c57c92c6b97f57ab8f7bc20ac06c1c77d96c5143 | [
"MIT"
] | 2 | 2017-04-29T07:29:53.000Z | 2020-07-16T16:48:42.000Z | import os.path
from unittest import TestCase
from code.cli import PARAMS_DIR, TESTS_DIR
from code.prepare.base import load_data
from code.prepare.params import load_params
from code.prepare.utils import *
FIXTURE_DATASET = os.path.join(TESTS_DIR, 'fixtures/GER.tsv')
FIXTURE_DATASET_ASJP = os.path.join(TESTS_DIR, ... | 26.9 | 71 | 0.754647 | import os.path
from unittest import TestCase
from code.cli import PARAMS_DIR, TESTS_DIR
from code.prepare.base import load_data
from code.prepare.params import load_params
from code.prepare.utils import *
FIXTURE_DATASET = os.path.join(TESTS_DIR, 'fixtures/GER.tsv')
FIXTURE_DATASET_ASJP = os.path.join(TESTS_DIR, ... | 603 | 9 | 123 |
96f83df3d849dd9cc0fc7a9ffc76ce58dd3d7421 | 6,356 | py | Python | python/uw/data/timed_data.py | tburnett/pointlike | a556f07650c2f17d437c86fdafe9f9a33f59758e | [
"BSD-3-Clause"
] | 1 | 2019-03-19T14:45:28.000Z | 2019-03-19T14:45:28.000Z | python/uw/data/timed_data.py | tburnett/pointlike | a556f07650c2f17d437c86fdafe9f9a33f59758e | [
"BSD-3-Clause"
] | null | null | null | python/uw/data/timed_data.py | tburnett/pointlike | a556f07650c2f17d437c86fdafe9f9a33f59758e | [
"BSD-3-Clause"
] | 1 | 2018-08-24T18:58:27.000Z | 2018-08-24T18:58:27.000Z | """
Process time data set
see create_timed_data to generate files with times for all
Extract a single data set around a cone with TimedData
"""
import os, glob, pickle
import healpy
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from astropy.time import Time, TimeDelta
from . import binned_dat... | 38.993865 | 111 | 0.599434 | """
Process time data set
see create_timed_data to generate files with times for all
Extract a single data set around a cone with TimedData
"""
import os, glob, pickle
import healpy
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from astropy.time import Time, TimeDelta
from . import binned_dat... | 821 | 0 | 80 |
aaa5afe2a6b97519f2ef121d1b8310c6670e70c9 | 399 | py | Python | bot.py | AdrianoBinhara/RegisterBot | 234fe49de32f8449ee30059e65fd0523ae9e16f4 | [
"MIT"
] | 8 | 2021-09-24T18:48:59.000Z | 2021-11-09T18:54:44.000Z | bot.py | AdrianoBinhara/RegisterBot | 234fe49de32f8449ee30059e65fd0523ae9e16f4 | [
"MIT"
] | null | null | null | bot.py | AdrianoBinhara/RegisterBot | 234fe49de32f8449ee30059e65fd0523ae9e16f4 | [
"MIT"
] | 2 | 2021-09-25T12:49:06.000Z | 2021-09-29T04:39:00.000Z | from discord.ext import commands
import os
from decouple import config
bot = commands.Bot("!")
load_cogs(bot)
TOKEN = config("TOKEN")
bot.run(TOKEN)
| 18.136364 | 49 | 0.646617 | from discord.ext import commands
import os
from decouple import config
bot = commands.Bot("!")
def load_cogs(bot):
bot.load_extension("manager")
bot.load_extension("tasks.purge")
for file in os.listdir("commands"):
if file.endswith(".py"):
cog = file[:-3]
bot.load_extensi... | 222 | 0 | 23 |
ae3d873948253fda96cab2ffa3da72359b1782fc | 87 | py | Python | chocolate/sample/__init__.py | Intelecy/chocolate | 0ba4f6f0130eab851d32d5534241c8cac3f6666e | [
"BSD-3-Clause"
] | 105 | 2017-10-27T02:14:22.000Z | 2022-01-13T12:57:05.000Z | chocolate/sample/__init__.py | Intelecy/chocolate | 0ba4f6f0130eab851d32d5534241c8cac3f6666e | [
"BSD-3-Clause"
] | 31 | 2017-10-03T13:41:35.000Z | 2021-08-20T21:01:29.000Z | chocolate/sample/__init__.py | areeh/chocolate | 5f946cb9daf42c3ab44508648917d46bc105c2fc | [
"BSD-3-Clause"
] | 38 | 2017-10-05T20:19:42.000Z | 2022-03-28T11:34:04.000Z | from .grid import Grid
from .random import Random
from .quasirandom import QuasiRandom
| 21.75 | 36 | 0.827586 | from .grid import Grid
from .random import Random
from .quasirandom import QuasiRandom
| 0 | 0 | 0 |
ca8bad046acf42a1b6463df94d5faf8e7e548b29 | 219 | py | Python | game/__init__.py | Randomneo/python_game | b5a4f399e092ff84a813509380156d0f91a761fa | [
"WTFPL"
] | null | null | null | game/__init__.py | Randomneo/python_game | b5a4f399e092ff84a813509380156d0f91a761fa | [
"WTFPL"
] | null | null | null | game/__init__.py | Randomneo/python_game | b5a4f399e092ff84a813509380156d0f91a761fa | [
"WTFPL"
] | null | null | null | from enum import Enum
from .core.vector2 import Vector2
screen_size = width, height = 1040, 480
map_size = Vector2(x=10000, y=1000)
gravity = 1.5
| 18.25 | 39 | 0.671233 | from enum import Enum
from .core.vector2 import Vector2
screen_size = width, height = 1040, 480
map_size = Vector2(x=10000, y=1000)
gravity = 1.5
class Colors(Enum):
black = (0, 0, 0)
white = (255, 255, 255)
| 0 | 48 | 23 |
be9918c89550f09504e0af7a94d005b3d72c1c51 | 5,052 | py | Python | ingesters/youtube/search.py | skratchdot/media-tools | bca0c683fb637aeefda1c49454a118f809047d97 | [
"MIT"
] | 13 | 2019-12-09T07:56:13.000Z | 2021-08-03T01:45:53.000Z | ingesters/youtube/search.py | skratchdot/media-tools | bca0c683fb637aeefda1c49454a118f809047d97 | [
"MIT"
] | 1 | 2020-04-29T00:00:14.000Z | 2021-07-09T14:24:19.000Z | ingesters/youtube/search.py | skratchdot/media-tools | bca0c683fb637aeefda1c49454a118f809047d97 | [
"MIT"
] | 3 | 2020-04-27T15:36:36.000Z | 2021-03-29T17:52:35.000Z | # -*- coding: utf-8 -*-
# Search API docs: https://developers.google.com/youtube/v3/docs/search/list
# Search API Python docs: https://developers.google.com/resources/api-libraries/documentation/youtube/v3/python/latest/youtube_v3.search.html
# Examples: https://github.com/youtube/api-samples/tree/master/python
impor... | 37.422222 | 182 | 0.64034 | # -*- coding: utf-8 -*-
# Search API docs: https://developers.google.com/youtube/v3/docs/search/list
# Search API Python docs: https://developers.google.com/resources/api-libraries/documentation/youtube/v3/python/latest/youtube_v3.search.html
# Examples: https://github.com/youtube/api-samples/tree/master/python
impor... | 0 | 0 | 0 |
b33e830b1007fc54e85f27112bd5b96f20551d3c | 8,472 | py | Python | bubuku/controller.py | zalando-nakadi/bubuku | 5738cc9309ed46e86fcad41b6fb580ddd69af8fd | [
"MIT"
] | 32 | 2017-10-17T09:59:46.000Z | 2022-01-23T11:39:31.000Z | bubuku/controller.py | zalando-nakadi/bubuku | 5738cc9309ed46e86fcad41b6fb580ddd69af8fd | [
"MIT"
] | 91 | 2017-07-13T15:43:15.000Z | 2022-02-21T13:06:35.000Z | bubuku/controller.py | zalando-nakadi/bubuku | 5738cc9309ed46e86fcad41b6fb580ddd69af8fd | [
"MIT"
] | 3 | 2018-04-19T13:13:00.000Z | 2018-09-11T05:59:38.000Z | import logging
from time import time
from typing import Tuple, Optional
from bubuku.broker import BrokerManager
from bubuku.communicate import sleep_and_operate
from bubuku.env_provider import EnvProvider
from bubuku.zookeeper import BukuExhibitor
_LOG = logging.getLogger('bubuku.controller')
#
# Returns a ... | 40.535885 | 118 | 0.608357 | import logging
from time import time
from typing import Tuple, Optional
from bubuku.broker import BrokerManager
from bubuku.communicate import sleep_and_operate
from bubuku.env_provider import EnvProvider
from bubuku.zookeeper import BukuExhibitor
_LOG = logging.getLogger('bubuku.controller')
class Change(object):
... | 7,329 | 3 | 655 |
ea7f69405d55960dd53034f6c6f8fca3da210fe6 | 1,312 | py | Python | roman-to-integer/solution.py | thehimel/problem-solving | b7cd019e50895a0d2438947a0a826774eb7ce82f | [
"MIT"
] | null | null | null | roman-to-integer/solution.py | thehimel/problem-solving | b7cd019e50895a0d2438947a0a826774eb7ce82f | [
"MIT"
] | null | null | null | roman-to-integer/solution.py | thehimel/problem-solving | b7cd019e50895a0d2438947a0a826774eb7ce82f | [
"MIT"
] | null | null | null | def integer(roman):
"""
Function to convert a roman numeral to integer.
:type roman: str
:rtype: int
"""
# Initialize a dictionary of symbol and values
symbol_value = {
'M': 1000,
'D': 500,
'C': 100,
'L': 50,
'X': 10,
'V': 5,
'I': 1
... | 23.428571 | 76 | 0.567073 | def integer(roman):
"""
Function to convert a roman numeral to integer.
:type roman: str
:rtype: int
"""
# Initialize a dictionary of symbol and values
symbol_value = {
'M': 1000,
'D': 500,
'C': 100,
'L': 50,
'X': 10,
'V': 5,
'I': 1
... | 0 | 0 | 0 |
c700279aa1df8709d4b0dabb418cb7afd030f998 | 1,098 | py | Python | agbot/core/plugin/plugin_manager_static.py | chinapnr/agbot | 9739ce1c2198e50111629db2d1de785edd06876e | [
"MIT"
] | 2 | 2018-06-23T06:48:46.000Z | 2018-06-23T10:11:50.000Z | agbot/core/plugin/plugin_manager_static.py | chinapnr/agbot | 9739ce1c2198e50111629db2d1de785edd06876e | [
"MIT"
] | 5 | 2020-01-03T09:33:02.000Z | 2021-06-02T00:49:52.000Z | agbot/core/plugin/plugin_manager_static.py | chinapnr/agbot | 9739ce1c2198e50111629db2d1de785edd06876e | [
"MIT"
] | 1 | 2021-07-07T07:17:27.000Z | 2021-07-07T07:17:27.000Z | from fishbase import logger
class PluginsManagerStatic(object):
"""
1. 现阶段插件是用来进行请求或者响应参数的处理
2. 暂时规定插件必须实现 run 方法
3. 使用实例:
pm = PluginsManager()
pm.run_plugin('demo.demo_md5',
{'sign_type':'md5','data_sign_params':'param1, param2'}, {'param1':'1','param2':'2','param3':'3'})
... | 33.272727 | 106 | 0.604736 | from fishbase import logger
class PluginsManagerStatic(object):
"""
1. 现阶段插件是用来进行请求或者响应参数的处理
2. 暂时规定插件必须实现 run 方法
3. 使用实例:
pm = PluginsManager()
pm.run_plugin('demo.demo_md5',
{'sign_type':'md5','data_sign_params':'param1, param2'}, {'param1':'1','param2':'2','param3':'3'})
... | 692 | 0 | 81 |
6b3f4acf49e4b6dc2a76d42d703ee2157fa96ee9 | 1,057 | py | Python | problems/test_0088.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | 1 | 2017-06-17T23:47:17.000Z | 2017-06-17T23:47:17.000Z | problems/test_0088.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | null | null | null | problems/test_0088.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 23.488889 | 75 | 0.434248 | import unittest
class Solution:
def merge(self, nums1, m, nums2, n):
"""
:type nums1: List[int]
:type m: int
:type nums2: List[int]
:type n: int
:rtype: void Do not return anything, modify nums1 in-place instead.
"""
hi = m + n - 1
m -= 1
... | 302 | 589 | 99 |
8ff3e9267e1da09adc5fb8a5ff21ae54a517201e | 64,575 | py | Python | samap/analysis.py | vishalbelsare/SAMap | 2a2170496019f37dda113bb52bb55169825f7e05 | [
"MIT"
] | 20 | 2021-03-20T05:06:41.000Z | 2022-02-16T08:25:46.000Z | samap/analysis.py | vishalbelsare/SAMap | 2a2170496019f37dda113bb52bb55169825f7e05 | [
"MIT"
] | 47 | 2021-01-29T21:04:57.000Z | 2022-03-18T11:53:44.000Z | samap/analysis.py | vishalbelsare/SAMap | 2a2170496019f37dda113bb52bb55169825f7e05 | [
"MIT"
] | 6 | 2021-02-12T18:07:05.000Z | 2022-03-09T01:02:06.000Z | import sklearn.utils.sparsefuncs as sf
from . import q, ut, pd, sp, np, warnings, sc
from .utils import to_vo, to_vn, substr, df_to_dict, sparse_knn, prepend_var_prefix
from samalg import SAM
from scipy.stats import rankdata
def GOEA(target_genes,GENE_SETS,df_key='GO',goterms=None,fdr_thresh=0.25,p_thresh=1e-3):
... | 39.065336 | 157 | 0.556392 | import sklearn.utils.sparsefuncs as sf
from . import q, ut, pd, sp, np, warnings, sc
from .utils import to_vo, to_vn, substr, df_to_dict, sparse_knn, prepend_var_prefix
from samalg import SAM
from scipy.stats import rankdata
def _log_factorial(n):
return np.log(np.arange(1,n+1)).sum()
def _log_binomial(n,k):
... | 6,186 | 16,934 | 213 |
96b6e0621d791d164add30bfcebd7a97b026a24f | 2,329 | py | Python | teste.py | danielrodrigues97/Teste_Pratico_Publca | c4a48f2fd86ee371ae593ec4ffc440fe527d2a9b | [
"MIT"
] | null | null | null | teste.py | danielrodrigues97/Teste_Pratico_Publca | c4a48f2fd86ee371ae593ec4ffc440fe527d2a9b | [
"MIT"
] | null | null | null | teste.py | danielrodrigues97/Teste_Pratico_Publca | c4a48f2fd86ee371ae593ec4ffc440fe527d2a9b | [
"MIT"
] | null | null | null | # -*- coding:UTF-8 -*-
import sys
reqMax = []
reqMin = []
cont = 0
#print(limpar())
p = 0
while p != 4:
print('~'*30)
print('Para Inserir dados do jogo aperte [1]: ')
print('Para consultar dados dos jogos aperte [2]: ')
print('para limpar a tabela de jogos aperte [3]')
print('... | 24.010309 | 72 | 0.509661 | # -*- coding:UTF-8 -*-
import sys
reqMax = []
reqMin = []
cont = 0
def limpar ():
with open('tabela_jogos.txt', 'w') as arquivo:
arquivo.close
global cont
cont = 0
reqMax.clear()
reqMin.clear()
def consulta ():
print('~'*30)
linha = open('tabela_jogos.txt','r')
leitura = ... | 1,590 | 0 | 73 |
416556fc1a0a4d093835838d768bf3c2f23c309f | 597 | py | Python | app/templatetags/messages.py | augustakingfoundation/queryjane_app | 2c7b27db9e16288c49520b94704246b25dd262b6 | [
"MIT"
] | 5 | 2018-08-07T07:01:04.000Z | 2021-03-19T00:16:59.000Z | app/templatetags/messages.py | augustakingfoundation/queryjane_app | 2c7b27db9e16288c49520b94704246b25dd262b6 | [
"MIT"
] | 1 | 2018-04-30T07:27:03.000Z | 2018-04-30T07:27:03.000Z | app/templatetags/messages.py | augustakingfoundation/queryjane_app | 2c7b27db9e16288c49520b94704246b25dd262b6 | [
"MIT"
] | 3 | 2018-08-08T11:57:01.000Z | 2020-10-02T05:42:13.000Z | from django import template
from account.models import UserMessage
from account.models import Conversation
register = template.Library()
@register.assignment_tag
@register.assignment_tag
@register.assignment_tag
| 20.586207 | 40 | 0.743719 | from django import template
from account.models import UserMessage
from account.models import Conversation
register = template.Library()
@register.assignment_tag
def get_user_messages_count(user):
return UserMessage.objects.filter(
user_to=user,
).count()
@register.assignment_tag
def get_new_user_... | 311 | 0 | 66 |
1504c2faa52e511b14f1969c5baf3ba4565022ac | 3,368 | py | Python | run_scripts/plot_fetch_eval.py | yifan-you-37/rl_swiss | 8b0ee7caa5c1fa93860916004cf4fd970667764f | [
"MIT"
] | 56 | 2019-10-20T03:09:02.000Z | 2022-03-25T09:21:40.000Z | run_scripts/plot_fetch_eval.py | yifan-you-37/rl_swiss | 8b0ee7caa5c1fa93860916004cf4fd970667764f | [
"MIT"
] | 3 | 2020-10-01T07:33:51.000Z | 2021-05-12T03:40:57.000Z | run_scripts/plot_fetch_eval.py | yifan-you-37/rl_swiss | 8b0ee7caa5c1fa93860916004cf4fd970667764f | [
"MIT"
] | 10 | 2019-11-04T16:56:09.000Z | 2022-03-25T09:21:41.000Z | import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os.path as osp
import joblib
MAIN_PATH = '/scratch/gobi2/kamyar/oorl_rlkit/output'
WHAT_TO_PLOT = 'faster_all_eval_stats.pkl'
# WHAT_TO_PLOT = 'faster_all_eval_stats.pkl'
# WHAT_TO_PLOT = 'faster_all_eval_stats.pkl'
dat... | 39.623529 | 115 | 0.655582 | import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os.path as osp
import joblib
MAIN_PATH = '/scratch/gobi2/kamyar/oorl_rlkit/output'
WHAT_TO_PLOT = 'faster_all_eval_stats.pkl'
# WHAT_TO_PLOT = 'faster_all_eval_stats.pkl'
# WHAT_TO_PLOT = 'faster_all_eval_stats.pkl'
dat... | 0 | 0 | 0 |
6141339f3c082173b90146c68f9445d1b6345332 | 936 | py | Python | web_project/Report/views.py | nosy0411/Object_Oriented_Programming | e6713b5131c125ac50814d375057f06da43e958e | [
"MIT"
] | null | null | null | web_project/Report/views.py | nosy0411/Object_Oriented_Programming | e6713b5131c125ac50814d375057f06da43e958e | [
"MIT"
] | null | null | null | web_project/Report/views.py | nosy0411/Object_Oriented_Programming | e6713b5131c125ac50814d375057f06da43e958e | [
"MIT"
] | null | null | null | from django.shortcuts import render, get_object_or_404, redirect
from .models import RepPost
from .forms import RepForm
from django.utils import timezone
from django.contrib.auth.decorators import login_required
@login_required | 34.666667 | 102 | 0.642094 | from django.shortcuts import render, get_object_or_404, redirect
from .models import RepPost
from .forms import RepForm
from django.utils import timezone
from django.contrib.auth.decorators import login_required
@login_required
def rep_post(request):
user = request.user
talkable = True
if user.handle.skku:... | 686 | 0 | 22 |
a449f75f76ba154fd1a52ce57663d5dace977604 | 2,566 | py | Python | int_to_line.py | CUUATS/feature-class-sync | 05bf8e44f5721655e9bb71590849af460ec0256a | [
"BSD-3-Clause"
] | null | null | null | int_to_line.py | CUUATS/feature-class-sync | 05bf8e44f5721655e9bb71590849af460ec0256a | [
"BSD-3-Clause"
] | null | null | null | int_to_line.py | CUUATS/feature-class-sync | 05bf8e44f5721655e9bb71590849af460ec0256a | [
"BSD-3-Clause"
] | null | null | null | #int_to_line.py
#This script takes intersection and road segment and determine the direction of the road segment in contrast to the intersection.
import arcpy
from arcpy import env
from arcpy.sa import *
arcpy.CheckOutExtension("Spatial")
arcpy.env.overwriteOutput = True
#input configuration
env.workspace = "C:/Users... | 26.729167 | 129 | 0.601715 | #int_to_line.py
#This script takes intersection and road segment and determine the direction of the road segment in contrast to the intersection.
import arcpy
from arcpy import env
from arcpy.sa import *
arcpy.CheckOutExtension("Spatial")
arcpy.env.overwriteOutput = True
#input configuration
env.workspace = "C:/Users... | 1,912 | 0 | 138 |
f9989169a6208962fd766e65aab7abac678b046b | 318 | py | Python | cactusco/celery.py | cactus-computing/product-recommendation | b5d9bb27205a4fb032fd19934ecab56a5a8c6d81 | [
"MIT"
] | null | null | null | cactusco/celery.py | cactus-computing/product-recommendation | b5d9bb27205a4fb032fd19934ecab56a5a8c6d81 | [
"MIT"
] | null | null | null | cactusco/celery.py | cactus-computing/product-recommendation | b5d9bb27205a4fb032fd19934ecab56a5a8c6d81 | [
"MIT"
] | null | null | null | import os
from celery import Celery
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'cactusco.settings')
app = Celery('cactusco')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()
@app.task(bind=True)
| 26.5 | 69 | 0.742138 | import os
from celery import Celery
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'cactusco.settings')
app = Celery('cactusco')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()
@app.task(bind=True)
def debug_task(self):
print(f'Request: {self.request!r}') | 41 | 0 | 22 |
9424aef899235c1a9aa2de958ac45e3889e4b3b5 | 3,306 | py | Python | tests/bak/_alignment_func.py | jumbrich/dtpattern | 38433c89d169a280b0439b9cd4f463d5d7604dd7 | [
"MIT"
] | null | null | null | tests/bak/_alignment_func.py | jumbrich/dtpattern | 38433c89d169a280b0439b9cd4f463d5d7604dd7 | [
"MIT"
] | 2 | 2018-04-25T22:13:34.000Z | 2018-04-26T17:52:43.000Z | tests/bak/_alignment_func.py | jumbrich/dtpattern | 38433c89d169a280b0439b9cd4f463d5d7604dd7 | [
"MIT"
] | null | null | null | from dtpattern import alignment
from dtpattern.alignment import needle, finalize, gap_penalty, match_award, mismatch_penalty, water
from dtpattern.utils import translate
from dtpattern.alignment import alignment as al
def align(s1,s2):
"""
input is a list of characters or character set symbols for each s1 a... | 27.322314 | 112 | 0.61827 | from dtpattern import alignment
from dtpattern.alignment import needle, finalize, gap_penalty, match_award, mismatch_penalty, water
from dtpattern.utils import translate
from dtpattern.alignment import alignment as al
def to_list(alpha):
if isinstance(alpha, str):
return [c for c in alpha]
def _translate... | 993 | 0 | 115 |
2899f0c4f189edbe9eb0b4a1b531ba0952b7d769 | 785 | py | Python | mediasort/__init__.py | aroberts/mediasort | c70836b11d19bd9fad63e22c7aa5217ae4a4cef3 | [
"BSD-3-Clause"
] | 1 | 2020-01-04T09:14:23.000Z | 2020-01-04T09:14:23.000Z | mediasort/__init__.py | aroberts/mediasort | c70836b11d19bd9fad63e22c7aa5217ae4a4cef3 | [
"BSD-3-Clause"
] | null | null | null | mediasort/__init__.py | aroberts/mediasort | c70836b11d19bd9fad63e22c7aa5217ae4a4cef3 | [
"BSD-3-Clause"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
handler = logging.StreamHandler()
formatter = logging.Formatter(
'%(asctime)s %(levelname)s %(message)s',
"%Y-%m-%d %H:%M:%S"
)
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLevel(logging.INFO)
import mimetypes
| 27.068966 | 70 | 0.700637 | import logging
logger = logging.getLogger(__name__)
handler = logging.StreamHandler()
formatter = logging.Formatter(
'%(asctime)s %(levelname)s %(message)s',
"%Y-%m-%d %H:%M:%S"
)
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLevel(logging.INFO)
import mimetypes
def setup_logging(confi... | 443 | 0 | 46 |
3d45fe73ba920eaffc67a7fa644b7150bb3136b0 | 6,819 | py | Python | limix_ext/leap/core/calc_h2.py | glimix/limix-ext | 7cf7a3b2b02f6a73cbba90f1945a06b9295b7357 | [
"MIT"
] | null | null | null | limix_ext/leap/core/calc_h2.py | glimix/limix-ext | 7cf7a3b2b02f6a73cbba90f1945a06b9295b7357 | [
"MIT"
] | 2 | 2017-06-05T08:29:22.000Z | 2017-06-07T16:54:54.000Z | limix_ext/leap/core/calc_h2.py | glimix/limix-ext | 7cf7a3b2b02f6a73cbba90f1945a06b9295b7357 | [
"MIT"
] | null | null | null | import logging
import numpy as np
import scipy.stats as stats
from .eigd import eigenDecompose
| 33.757426 | 79 | 0.525884 | import logging
import numpy as np
import scipy.stats as stats
from .eigd import eigenDecompose
def calcLiabThreholds(U, S, keepArr, phe, numRemovePCs, prev):
#Run logistic regression
G = U[:, -numRemovePCs:] * np.sqrt(S[-numRemovePCs:])
import sklearn.linear_model
Logreg = sklearn.linear_model.Logi... | 6,602 | 0 | 115 |
abb4ba64e345114c0b5be170656a0f297a42cd96 | 511 | py | Python | Vignette_filter.py | OhmVikrant/Vignette-Filter-using-OpenCV | 4ffe8ad956370721cea9b648765e22d6ae56cdcc | [
"MIT"
] | 2 | 2020-09-05T19:03:29.000Z | 2020-09-05T19:08:56.000Z | Vignette_filter.py | OhmVikrant/Vignette-Filter-using-OpenCV | 4ffe8ad956370721cea9b648765e22d6ae56cdcc | [
"MIT"
] | null | null | null | Vignette_filter.py | OhmVikrant/Vignette-Filter-using-OpenCV | 4ffe8ad956370721cea9b648765e22d6ae56cdcc | [
"MIT"
] | null | null | null | import numpy as np
import cv2
input = cv2.imread('input/strawberry.jpg')
height, width = input_image.shape[:2]
x_gauss = cv2.getGaussianKernel(width,250)
y_gauss = cv2.getGaussianKernel(height,200)
kernel = x_gauss * y_gauss.T
mask = kernel * 255 / np.linalg.norm(kernel)
ou... | 20.44 | 47 | 0.610568 | import numpy as np
import cv2
input = cv2.imread('input/strawberry.jpg')
height, width = input_image.shape[:2]
x_gauss = cv2.getGaussianKernel(width,250)
y_gauss = cv2.getGaussianKernel(height,200)
kernel = x_gauss * y_gauss.T
mask = kernel * 255 / np.linalg.norm(kernel)
ou... | 0 | 0 | 0 |
b54d847ae63ed6f54873fdf4e76f651ed8a2b61d | 4,248 | py | Python | python-src/graphoire/digraph.py | ccorbell/graphoire | 566b0a27a9d6b87c5952bcc6e257a6d90621ca06 | [
"Apache-2.0"
] | null | null | null | python-src/graphoire/digraph.py | ccorbell/graphoire | 566b0a27a9d6b87c5952bcc6e257a6d90621ca06 | [
"Apache-2.0"
] | null | null | null | python-src/graphoire/digraph.py | ccorbell/graphoire | 566b0a27a9d6b87c5952bcc6e257a6d90621ca06 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 5 11:40:58 2021
@author: Christopher Corbell
Things we can use here:
- construct Digraph from underlying Graph (default direction for edges)
- DigraphFactory to construct some interesting digraphs
"""
from graphoire.graph import Graph
cl... | 28.702703 | 87 | 0.558851 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 5 11:40:58 2021
@author: Christopher Corbell
Things we can use here:
- construct Digraph from underlying Graph (default direction for edges)
- DigraphFactory to construct some interesting digraphs
"""
from graphoire.graph import Graph
cl... | 1,771 | 0 | 229 |
0c131e9958b01000cfd500c7e63ab05467f30879 | 6,362 | py | Python | bgp/rlkit/torch/tdm/envs/reacher_7dof_env.py | aypan17/value_learning | 240a67ecf99b178fe0c4ced2bfd1dd50453fbdfe | [
"MIT"
] | null | null | null | bgp/rlkit/torch/tdm/envs/reacher_7dof_env.py | aypan17/value_learning | 240a67ecf99b178fe0c4ced2bfd1dd50453fbdfe | [
"MIT"
] | null | null | null | bgp/rlkit/torch/tdm/envs/reacher_7dof_env.py | aypan17/value_learning | 240a67ecf99b178fe0c4ced2bfd1dd50453fbdfe | [
"MIT"
] | null | null | null | from collections import OrderedDict
import numpy as np
from gym.envs.mujoco import mujoco_env
from gym.spaces import Box
from bgp.rlkit.core import logger as default_logger
from bgp.rlkit.core.eval_util import create_stats_ordered_dict
from bgp.rlkit.core.serializable import Serializable
from bgp.rlkit.envs.mujoco_en... | 33.661376 | 86 | 0.596511 | from collections import OrderedDict
import numpy as np
from gym.envs.mujoco import mujoco_env
from gym.spaces import Box
from bgp.rlkit.core import logger as default_logger
from bgp.rlkit.core.eval_util import create_stats_ordered_dict
from bgp.rlkit.core.serializable import Serializable
from bgp.rlkit.envs.mujoco_en... | 4,407 | 1,231 | 261 |
066cb5c7846b0bc11e82f86423780ee8635d8724 | 1,295 | py | Python | simpleformat.py | Kronuz/sublime-rst-completion | ed265f303ff2b3e1c4e8d92d2c8f23ebb8ba425c | [
"BSD-3-Clause"
] | 173 | 2015-01-05T06:26:06.000Z | 2022-03-26T08:18:58.000Z | simpleformat.py | Kronuz/sublime-rst-completion | ed265f303ff2b3e1c4e8d92d2c8f23ebb8ba425c | [
"BSD-3-Clause"
] | 29 | 2015-02-17T09:16:40.000Z | 2022-02-07T11:25:26.000Z | simpleformat.py | Kronuz/sublime-rst-completion | ed265f303ff2b3e1c4e8d92d2c8f23ebb8ba425c | [
"BSD-3-Clause"
] | 44 | 2015-03-08T20:49:23.000Z | 2022-03-09T23:52:53.000Z | import sublime
import sublime_plugin
class SurroundCommand(sublime_plugin.TextCommand):
"""
Base class to surround the selection with text.
"""
surround = ''
| 30.116279 | 100 | 0.613127 | import sublime
import sublime_plugin
class SurroundCommand(sublime_plugin.TextCommand):
"""
Base class to surround the selection with text.
"""
surround = ''
def run(self, edit):
for sel in self.view.sel():
len_surround = len(self.surround)
sel_str = self.view.subs... | 837 | 159 | 119 |
5db314ef9db7f8c30d914a66c1929ddcb62a2832 | 535 | py | Python | server/generator.py | cryptSky/hlsa_task8 | ed0d8d9d69b5e8f3bdfa5964c66ce6dcf27f07c1 | [
"MIT"
] | null | null | null | server/generator.py | cryptSky/hlsa_task8 | ed0d8d9d69b5e8f3bdfa5964c66ce6dcf27f07c1 | [
"MIT"
] | null | null | null | server/generator.py | cryptSky/hlsa_task8 | ed0d8d9d69b5e8f3bdfa5964c66ce6dcf27f07c1 | [
"MIT"
] | null | null | null | import requests
from faker import Faker
from faker.providers import date_time
import json
fake = Faker()
fake.add_provider(date_time)
for i in range(40000000):
user = {
'name': fake.name(),
'email': fake.email(),
'birthdate': fake.date()
}
response = requests.post('http://localhos... | 23.26087 | 82 | 0.6 | import requests
from faker import Faker
from faker.providers import date_time
import json
fake = Faker()
fake.add_provider(date_time)
for i in range(40000000):
user = {
'name': fake.name(),
'email': fake.email(),
'birthdate': fake.date()
}
response = requests.post('http://localhos... | 0 | 0 | 0 |
6d8fbfaae089b733b5e1d89796d42c25b15b2835 | 1,212 | py | Python | python/korean-breaks.py | ye-kyaw-thu/tools- | 805e0759cb1b700cb99ce96364e9d8056143df64 | [
"MIT"
] | 11 | 2018-10-01T11:00:12.000Z | 2021-11-20T18:18:17.000Z | python/korean-breaks.py | ye-kyaw-thu/tools- | 805e0759cb1b700cb99ce96364e9d8056143df64 | [
"MIT"
] | null | null | null | python/korean-breaks.py | ye-kyaw-thu/tools- | 805e0759cb1b700cb99ce96364e9d8056143df64 | [
"MIT"
] | 4 | 2020-06-12T09:42:18.000Z | 2021-12-12T07:04:28.000Z | import sys
from hangul_utils import *
# for word segmentation and pos tagging of Korean text
# Note: You need to install "hangul-utils" in advanced
# Ref link: https://github.com/kaniblu/hangul-utils
# written by Ye Kyaw Thu, Visiting Professor, LST, NECTEC, Thailand
#
# How to run: python ./korean-breaks.py <input-fi... | 33.666667 | 85 | 0.633663 | import sys
from hangul_utils import *
# for word segmentation and pos tagging of Korean text
# Note: You need to install "hangul-utils" in advanced
# Ref link: https://github.com/kaniblu/hangul-utils
# written by Ye Kyaw Thu, Visiting Professor, LST, NECTEC, Thailand
#
# How to run: python ./korean-breaks.py <input-fi... | 0 | 0 | 0 |
8aa0dc07029827c92adf1033bab41cb860f33c8b | 127 | py | Python | DataStructure_And_Algorithm/Week5/edit_distance/edit_distance.py | sngvahmed/Algorithm-Coursera | 6b789b32ddee0bad6f754f3466cfb1a237ce6d0e | [
"Apache-2.0"
] | null | null | null | DataStructure_And_Algorithm/Week5/edit_distance/edit_distance.py | sngvahmed/Algorithm-Coursera | 6b789b32ddee0bad6f754f3466cfb1a237ce6d0e | [
"Apache-2.0"
] | null | null | null | DataStructure_And_Algorithm/Week5/edit_distance/edit_distance.py | sngvahmed/Algorithm-Coursera | 6b789b32ddee0bad6f754f3466cfb1a237ce6d0e | [
"Apache-2.0"
] | 1 | 2018-07-09T09:49:01.000Z | 2018-07-09T09:49:01.000Z | # Uses python3
if __name__ == "__main__":
print(edit_distance(input(), input()))
| 12.7 | 42 | 0.645669 | # Uses python3
def edit_distance(s, t):
return 0
if __name__ == "__main__":
print(edit_distance(input(), input()))
| 19 | 0 | 22 |
cb33b840af0eb1bd12c538c2fcda80451df7fc05 | 3,729 | py | Python | robot_teleop/nodes/auto_move_special.py | caffreyu/icra_ros_love_cannot_speak | 75719fdb2c69ac229ef22146076593af8e70905f | [
"Apache-2.0"
] | null | null | null | robot_teleop/nodes/auto_move_special.py | caffreyu/icra_ros_love_cannot_speak | 75719fdb2c69ac229ef22146076593af8e70905f | [
"Apache-2.0"
] | 1 | 2020-01-02T20:55:07.000Z | 2020-01-02T20:55:07.000Z | robot_teleop/nodes/auto_move_special.py | caffreyu/icra_ros_love_cannot_speak | 75719fdb2c69ac229ef22146076593af8e70905f | [
"Apache-2.0"
] | 1 | 2019-12-27T02:51:08.000Z | 2019-12-27T02:51:08.000Z | #!/usr/bin/env python
# encoding: utf-8
import rospy
import tf
from std_msgs.msg import Float64, Int32, Int8
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Twist, Vector3
from PID import PID
from math import sin, cos, pi, atan2, sqrt
autoMove = AUTO_MOVE()
"""LinearPub = rospy.Publisher("/command/l... | 28.25 | 92 | 0.565567 | #!/usr/bin/env python
# encoding: utf-8
import rospy
import tf
from std_msgs.msg import Float64, Int32, Int8
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Twist, Vector3
from PID import PID
from math import sin, cos, pi, atan2, sqrt
class AUTO_MOVE():
# all self properties
linear_vel = 0.02... | 2,538 | 402 | 23 |
9e9a250fcdb96c00671c5336a19a02e3051aab22 | 777 | py | Python | rcs_back/users_app/views.py | e-kondr01/rcs_back | f0f224d01f7051cce9d5feef692216d48cba6f31 | [
"MIT"
] | null | null | null | rcs_back/users_app/views.py | e-kondr01/rcs_back | f0f224d01f7051cce9d5feef692216d48cba6f31 | [
"MIT"
] | null | null | null | rcs_back/users_app/views.py | e-kondr01/rcs_back | f0f224d01f7051cce9d5feef692216d48cba6f31 | [
"MIT"
] | 1 | 2021-09-25T19:18:55.000Z | 2021-09-25T19:18:55.000Z | from django.conf import settings
from django.contrib.auth import get_user_model
from rest_framework.response import Response
from rest_framework.views import APIView
User = get_user_model()
class RetrieveCurrentUserView(APIView):
"""Возвращает информацию о текущем пользователе"""
| 28.777778 | 63 | 0.664093 | from django.conf import settings
from django.contrib.auth import get_user_model
from rest_framework.response import Response
from rest_framework.views import APIView
User = get_user_model()
class RetrieveCurrentUserView(APIView):
"""Возвращает информацию о текущем пользователе"""
def get(self, request, *arg... | 462 | 0 | 27 |
1e2e746d8cf1983c40a783689474f3881ce5bf4c | 624 | py | Python | SCRIPTS/radiotelescopes/plot.py | sarrvesh/academicpages.github.io | 909d8e700ed62c00d48472cf8d8564b0bf4da369 | [
"MIT"
] | null | null | null | SCRIPTS/radiotelescopes/plot.py | sarrvesh/academicpages.github.io | 909d8e700ed62c00d48472cf8d8564b0bf4da369 | [
"MIT"
] | null | null | null | SCRIPTS/radiotelescopes/plot.py | sarrvesh/academicpages.github.io | 909d8e700ed62c00d48472cf8d8564b0bf4da369 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
# Create a Miller project
map = Basemap(projection='hammer', lon_0=20, resolution='l')
# Plot coastlines
map.drawcoastlines(linewidth=0.)
map.fillcontinents(alpha=0.85)
# Parse telescopes.txt and plot the points on the m... | 28.363636 | 64 | 0.690705 | #!/usr/bin/env python
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
# Create a Miller project
map = Basemap(projection='hammer', lon_0=20, resolution='l')
# Plot coastlines
map.drawcoastlines(linewidth=0.)
map.fillcontinents(alpha=0.85)
# Parse telescopes.txt and plot the points on the m... | 0 | 0 | 0 |
c8ca8a03f3df1b90e7b2cb76b7672aa11b991729 | 56 | py | Python | PI/ButtonCodes/__init__.py | HotShot0901/PI | 7e6fd0f68b4222e09ea825f27709ec5b1e51e928 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"bzip2-1.0.6",
"BSD-3-Clause"
] | null | null | null | PI/ButtonCodes/__init__.py | HotShot0901/PI | 7e6fd0f68b4222e09ea825f27709ec5b1e51e928 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"bzip2-1.0.6",
"BSD-3-Clause"
] | null | null | null | PI/ButtonCodes/__init__.py | HotShot0901/PI | 7e6fd0f68b4222e09ea825f27709ec5b1e51e928 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"bzip2-1.0.6",
"BSD-3-Clause"
] | null | null | null | from .KeyCodes import *
from .MouseButtonCodes import *
| 18.666667 | 31 | 0.785714 | from .KeyCodes import *
from .MouseButtonCodes import *
| 0 | 0 | 0 |
679f5da77d443219a419e0989ed1854a3c205526 | 12,787 | py | Python | train_models/evaluation.py | WangStephen/DL-limited-angle-CT-reconstruction | f43c3fe806a2eee316dcbb26bddeb51c4f4a9f92 | [
"MIT"
] | 7 | 2019-11-07T11:33:28.000Z | 2021-04-01T07:43:15.000Z | train_models/evaluation.py | WangStephen/DL-limited-angle-CT-reconstruction | f43c3fe806a2eee316dcbb26bddeb51c4f4a9f92 | [
"MIT"
] | 1 | 2021-03-14T03:19:33.000Z | 2022-01-12T21:47:32.000Z | train_models/evaluation.py | WangStephen/DL-limited-angle-CT-reconstruction | f43c3fe806a2eee316dcbb26bddeb51c4f4a9f92 | [
"MIT"
] | 2 | 2020-04-03T05:58:16.000Z | 2021-01-06T10:24:55.000Z | """Evaluation
This script consists of evaluation functions needed
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import datetime
import tensorflow as tf
from tensorflow.python.tools import inspect_checkpoint as chkp
import load_data
from geometry_parameters import TE... | 28.929864 | 135 | 0.635098 | """Evaluation
This script consists of evaluation functions needed
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import datetime
import tensorflow as tf
from tensorflow.python.tools import inspect_checkpoint as chkp
import load_data
from geometry_parameters import TE... | 0 | 0 | 0 |
4943f5346adc95d886e6def13a429e87d873fbf5 | 407 | py | Python | object_oriented_programming/exercise_online_shopping/main.py | jepster/python_advanced_techniques | f4b0e0dda7b66be55f650f9f902e735d3f5a9f64 | [
"MIT"
] | null | null | null | object_oriented_programming/exercise_online_shopping/main.py | jepster/python_advanced_techniques | f4b0e0dda7b66be55f650f9f902e735d3f5a9f64 | [
"MIT"
] | null | null | null | object_oriented_programming/exercise_online_shopping/main.py | jepster/python_advanced_techniques | f4b0e0dda7b66be55f650f9f902e735d3f5a9f64 | [
"MIT"
] | null | null | null | from user import User
brianna = User(1, 'Brianna')
mary = User(2, 'Mary')
keyboard = brianna.sell_product('Keyboard', 'A nice mechanical keyboard', 100)
print(keyboard.availability) # => True
mary.buy_product(keyboard)
print(keyboard.availability) # => False
review = mary.write_review('This is the best keyboard ev... | 31.307692 | 78 | 0.732187 | from user import User
brianna = User(1, 'Brianna')
mary = User(2, 'Mary')
keyboard = brianna.sell_product('Keyboard', 'A nice mechanical keyboard', 100)
print(keyboard.availability) # => True
mary.buy_product(keyboard)
print(keyboard.availability) # => False
review = mary.write_review('This is the best keyboard ev... | 0 | 0 | 0 |
f955de0f4e7b4a1551cb812c5d39fa4c25a310b3 | 3,125 | py | Python | wins/factories.py | uktrade/export-wins-data | 46caa444812e89abe504bec8c15aa7f7ba1a247e | [
"MIT"
] | 5 | 2016-09-12T12:52:45.000Z | 2020-03-24T14:43:13.000Z | wins/factories.py | uktrade/export-wins-data | 46caa444812e89abe504bec8c15aa7f7ba1a247e | [
"MIT"
] | 435 | 2016-10-18T12:51:39.000Z | 2021-06-09T17:22:08.000Z | wins/factories.py | uktrade/export-wins-data | 46caa444812e89abe504bec8c15aa7f7ba1a247e | [
"MIT"
] | 2 | 2016-12-06T10:37:21.000Z | 2017-02-22T17:27:43.000Z | import datetime
import factory
from factory.fuzzy import FuzzyChoice
from wins.models import (
Advisor,
Breakdown,
CustomerResponse,
HVC,
Notification,
Win,
)
from wins.constants import BUSINESS_POTENTIAL, SECTORS, WIN_TYPES
from users.factories import UserFactory
WIN_TYPES_DICT = {y: x for... | 23.496241 | 83 | 0.71008 | import datetime
import factory
from factory.fuzzy import FuzzyChoice
from wins.models import (
Advisor,
Breakdown,
CustomerResponse,
HVC,
Notification,
Win,
)
from wins.constants import BUSINESS_POTENTIAL, SECTORS, WIN_TYPES
from users.factories import UserFactory
class WinFactory(factory.Dj... | 0 | 2,642 | 138 |
75d8ba5a4947dfff19c704082544896b55e0089a | 75 | py | Python | Common/Python/Data-Structures/Trees/__init__.py | MattiKemp/Data-Structures-And-Algorithms | 37a4eb4f092f5a058643ef5ac302fe16d97f84dc | [
"Unlicense"
] | null | null | null | Common/Python/Data-Structures/Trees/__init__.py | MattiKemp/Data-Structures-And-Algorithms | 37a4eb4f092f5a058643ef5ac302fe16d97f84dc | [
"Unlicense"
] | null | null | null | Common/Python/Data-Structures/Trees/__init__.py | MattiKemp/Data-Structures-And-Algorithms | 37a4eb4f092f5a058643ef5ac302fe16d97f84dc | [
"Unlicense"
] | null | null | null | from . import BinarySearchTree
from . import BinaryTree
from . import Tree
| 18.75 | 30 | 0.8 | from . import BinarySearchTree
from . import BinaryTree
from . import Tree
| 0 | 0 | 0 |
925e82a012459a533ccdda2bba698f54b3c8fa68 | 205 | py | Python | flyingpigeon/tests/test_cdo.py | Zeitsperre/flyingpigeon | 678370bf428af7ffe11ee79be3b8a89c73215e5e | [
"Apache-2.0"
] | 1 | 2016-12-04T18:01:49.000Z | 2016-12-04T18:01:49.000Z | flyingpigeon/tests/test_cdo.py | Zeitsperre/flyingpigeon | 678370bf428af7ffe11ee79be3b8a89c73215e5e | [
"Apache-2.0"
] | 13 | 2017-03-16T15:44:21.000Z | 2019-08-19T16:56:04.000Z | flyingpigeon/tests/test_cdo.py | Zeitsperre/flyingpigeon | 678370bf428af7ffe11ee79be3b8a89c73215e5e | [
"Apache-2.0"
] | null | null | null | import pytest
from .common import TESTDATA
from flyingpigeon.utils import local_path
from cdo import Cdo
cdo = Cdo()
| 17.083333 | 65 | 0.77561 | import pytest
from .common import TESTDATA
from flyingpigeon.utils import local_path
from cdo import Cdo
cdo = Cdo()
def test_sinfo():
cdo.sinfo(input=local_path(TESTDATA['cmip5_tasmax_2006_nc']))
| 62 | 0 | 23 |
481cea70c60a9294257dfd00b7d7c5217cf84b4b | 4,758 | py | Python | tests/test_TransactionBook.py | LukHad/AccountBook | 8da3ebbd2a824efb9d50f7695ceaaa6cf2370cd8 | [
"MIT"
] | null | null | null | tests/test_TransactionBook.py | LukHad/AccountBook | 8da3ebbd2a824efb9d50f7695ceaaa6cf2370cd8 | [
"MIT"
] | null | null | null | tests/test_TransactionBook.py | LukHad/AccountBook | 8da3ebbd2a824efb9d50f7695ceaaa6cf2370cd8 | [
"MIT"
] | null | null | null | from datetime import datetime
import os
import nose
import nose.tools
from TransactionBook.model.TransactionBook import *
def save_load(tb):
"""
Helper function wich does save and load the data.
:param tb: Transaction Book
:return tb2: Transaction Book after save load operation
"""
filename ... | 34.729927 | 100 | 0.678857 | from datetime import datetime
import os
import nose
import nose.tools
from TransactionBook.model.TransactionBook import *
def dummy_transactions():
tb = TransactionBook()
tb.new_transaction("01.07.2017", "Account 1", "My first transaction", 1000, "Income")
tb.new_transaction("11.08.2017", "Account 1", "Ci... | 3,765 | 0 | 253 |
36f627215083cec554625dd2e5e80318d8b62864 | 782 | py | Python | tests/builders.py | Spairet/nip | c37beede2709fee68663eee76e7a63a36aae03da | [
"MIT"
] | 13 | 2021-06-17T10:50:13.000Z | 2022-03-26T14:54:26.000Z | tests/builders.py | Spairet/nip | c37beede2709fee68663eee76e7a63a36aae03da | [
"MIT"
] | 2 | 2021-07-09T08:59:54.000Z | 2021-07-21T12:22:59.000Z | tests/builders.py | Spairet/nip | c37beede2709fee68663eee76e7a63a36aae03da | [
"MIT"
] | 1 | 2021-07-26T17:31:38.000Z | 2021-07-26T17:31:38.000Z | from nip import nip, dumps
@nip
@nip("myfunc")
@nip
| 17 | 58 | 0.589514 | from nip import nip, dumps
@nip
class SimpleClass:
def __init__(self, name: str):
self.name = name
@nip("print_method")
def print(self):
print(self.name)
return 312983
@nip("myfunc")
def MySecretFunction(a: int, b: int = 0, c: int = 0):
return a + 2 * b + 3 * c
@nip
class ... | 419 | 65 | 237 |
205f841d52dcdd4a86affc009e851addf2fcf525 | 1,814 | py | Python | 141 Linked List Cycle.py | scorpionpd/LeetCode-all | 0d65494f37d093d650b83b93409e874c041f3abe | [
"MIT"
] | null | null | null | 141 Linked List Cycle.py | scorpionpd/LeetCode-all | 0d65494f37d093d650b83b93409e874c041f3abe | [
"MIT"
] | null | null | null | 141 Linked List Cycle.py | scorpionpd/LeetCode-all | 0d65494f37d093d650b83b93409e874c041f3abe | [
"MIT"
] | null | null | null | """
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
"""
__author__ = 'Danyang'
# Definition for singly-linked list.
| 36.28 | 76 | 0.312018 | """
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
"""
__author__ = 'Danyang'
# Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def hasCycle(self, head):
... | 47 | 1,516 | 71 |
20647d88459b1d700e8e2bbf54730b3fedf4e894 | 5,226 | py | Python | huaweicloud-sdk-cloudrtc/huaweicloudsdkcloudrtc/v2/model/record_rule_req.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-cloudrtc/huaweicloudsdkcloudrtc/v2/model/record_rule_req.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-cloudrtc/huaweicloudsdkcloudrtc/v2/model/record_rule_req.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class RecordRuleReq:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is a... | 27.797872 | 104 | 0.590126 | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class RecordRuleReq:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is a... | 0 | 0 | 0 |
74458867b1ca3d7d9fb26951a2f67859b9b082c0 | 542 | py | Python | contest/impls/render_markdown.py | nya3jp/rules_contest | e74a9892785912b11bbd975068641e558aa4a623 | [
"MIT"
] | 6 | 2020-09-03T13:10:49.000Z | 2021-03-10T01:13:49.000Z | contest/impls/render_markdown.py | nya3jp/rules_contest | e74a9892785912b11bbd975068641e558aa4a623 | [
"MIT"
] | 11 | 2020-05-22T09:43:29.000Z | 2021-03-24T10:55:49.000Z | contest/impls/render_markdown.py | nya3jp/rules_contest | e74a9892785912b11bbd975068641e558aa4a623 | [
"MIT"
] | null | null | null | import argparse
import markdown
_EXTENSIONS = (
'markdown.extensions.fenced_code',
'markdown.extensions.tables',
)
if __name__ == '__main__':
main()
| 19.357143 | 58 | 0.656827 | import argparse
import markdown
_EXTENSIONS = (
'markdown.extensions.fenced_code',
'markdown.extensions.tables',
)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--output', required=True)
parser.add_argument('--input', required=True)
options = parser.parse_args()
wi... | 353 | 0 | 23 |
c26d1e2e9e627e7d37923e241ab3efd749499c2a | 2,813 | py | Python | html_parser.py | WuTao1530663/web_spider_in_python | 1a3ba3471942bc5e38b1d5cac37568341ff0dd6f | [
"Apache-2.0"
] | null | null | null | html_parser.py | WuTao1530663/web_spider_in_python | 1a3ba3471942bc5e38b1d5cac37568341ff0dd6f | [
"Apache-2.0"
] | null | null | null | html_parser.py | WuTao1530663/web_spider_in_python | 1a3ba3471942bc5e38b1d5cac37568341ff0dd6f | [
"Apache-2.0"
] | null | null | null | from bs4 import BeautifulSoup
import re
import urllib.parse
import requests
if __name__ == '__main__':
info = u"""<div id="info" class="">\
<span>\
<span class="pl"> 作者</span>\
<a class="" href="/search/%E5%8D%A1%E5%8B%92%E5%BE%B7%C2%B7%E8%83%A1%E8%B5%9B%E5%B0%BC">[美] 卡勒德·胡赛尼</a>\
</span><br... | 43.276923 | 131 | 0.603271 | from bs4 import BeautifulSoup
import re
import urllib.parse
import requests
class HtmlParser(object):
def parse(self,url, html_content):
book_data = {}
soup = BeautifulSoup(html_content, 'html.parser',from_encoding='utf-8')
book_data['书籍ID'] = url[-8:-1]
book_data['书名'] = soup.find(... | 1,804 | 4 | 48 |
0443796cd2d92bcfaddb64cdd45f4bd50ae576c8 | 4,012 | py | Python | pybycus/authtab.py | lutetiensis/pybycus | 20ed6f2d7aeeee397bc27593fe085d981a1cc2a0 | [
"BSD-3-Clause"
] | 1 | 2020-10-17T17:23:58.000Z | 2020-10-17T17:23:58.000Z | pybycus/authtab.py | lutetiensis/pybycus | 20ed6f2d7aeeee397bc27593fe085d981a1cc2a0 | [
"BSD-3-Clause"
] | null | null | null | pybycus/authtab.py | lutetiensis/pybycus | 20ed6f2d7aeeee397bc27593fe085d981a1cc2a0 | [
"BSD-3-Clause"
] | null | null | null | """ AUTHTAB.DIR file parser. """
from pybycus.file import File
class AuthTab(File):
""" The Author List (with the filename AUTHTAB.DIR) contains
descriptive information for each text file on the disc. The
purpose of the Author Table is to allow the user to ask for
the author Plato, for example, withou... | 47.761905 | 80 | 0.55683 | """ AUTHTAB.DIR file parser. """
from pybycus.file import File
class AuthTab(File):
""" The Author List (with the filename AUTHTAB.DIR) contains
descriptive information for each text file on the disc. The
purpose of the Author Table is to allow the user to ask for
the author Plato, for example, withou... | 3,246 | 0 | 27 |
a18b85ca07be6bc3638261609d5cbff00fdb06a4 | 724 | py | Python | rmf_building_map_tools/building_map/vertex.py | morty-clobot/rmf_traffic_editor | 2d9f32cef709482914c20b4b3c4fef938f87bdf3 | [
"Apache-2.0"
] | 40 | 2019-12-03T09:02:16.000Z | 2021-03-16T00:25:38.000Z | rmf_building_map_tools/building_map/vertex.py | morty-clobot/rmf_traffic_editor | 2d9f32cef709482914c20b4b3c4fef938f87bdf3 | [
"Apache-2.0"
] | 149 | 2019-11-28T14:47:39.000Z | 2021-03-24T14:05:58.000Z | rmf_building_map_tools/building_map/vertex.py | CLOBOT-Co-Ltd/rmf_traffic_editor | 2d9f32cef709482914c20b4b3c4fef938f87bdf3 | [
"Apache-2.0"
] | 30 | 2019-11-28T14:49:47.000Z | 2021-03-14T18:28:17.000Z | from .param_value import ParamValue
| 30.166667 | 64 | 0.584254 | from .param_value import ParamValue
class Vertex:
def __init__(self, yaml_node):
self.x = float(yaml_node[0])
self.y = float(-yaml_node[1])
self.z = float(yaml_node[2]) # currently always 0
self.name = yaml_node[3]
self.params = {}
if len(yaml_node) > 4 and len(ya... | 592 | -8 | 103 |
320e0a142f301f2fe27e02d1482f04be409d2b92 | 2,980 | py | Python | tests/data_collection_tests/test_observational_data_collector.py | CITCOM-project/CausalTestingFramework | ca83012dbaf7b1f95c118939570fc8b2c49bca68 | [
"MIT"
] | 1 | 2021-12-15T14:54:32.000Z | 2021-12-15T14:54:32.000Z | tests/data_collection_tests/test_observational_data_collector.py | AndrewC19/CausalTestingFramework | ca83012dbaf7b1f95c118939570fc8b2c49bca68 | [
"MIT"
] | 42 | 2021-11-25T11:11:07.000Z | 2022-03-21T09:47:02.000Z | tests/data_collection_tests/test_observational_data_collector.py | AndrewC19/CausalTestingFramework | ca83012dbaf7b1f95c118939570fc8b2c49bca68 | [
"MIT"
] | null | null | null | import unittest
import os
import pandas as pd
from causal_testing.data_collection.data_collector import ObservationalDataCollector
from causal_testing.specification.causal_specification import Scenario
from causal_testing.specification.variable import Input, Output, Meta
from scipy.stats import uniform, rv_discrete
fro... | 48.852459 | 110 | 0.696309 | import unittest
import os
import pandas as pd
from causal_testing.data_collection.data_collector import ObservationalDataCollector
from causal_testing.specification.causal_specification import Scenario
from causal_testing.specification.variable import Input, Output, Meta
from scipy.stats import uniform, rv_discrete
fro... | 2,301 | 35 | 185 |
9a5d1f0b059d53e886a9801f5cbd41c0b55883cd | 2,953 | py | Python | pymoo/model/individual.py | gabicavalcante/pymoo | 1711ce3a96e5ef622d0116d6c7ea4d26cbe2c846 | [
"Apache-2.0"
] | 3 | 2020-09-18T19:33:31.000Z | 2020-09-18T19:33:33.000Z | pymoo/model/individual.py | gabicavalcante/pymoo | 1711ce3a96e5ef622d0116d6c7ea4d26cbe2c846 | [
"Apache-2.0"
] | null | null | null | pymoo/model/individual.py | gabicavalcante/pymoo | 1711ce3a96e5ef622d0116d6c7ea4d26cbe2c846 | [
"Apache-2.0"
] | 1 | 2022-03-31T08:19:13.000Z | 2022-03-31T08:19:13.000Z | import copy
# @property
# def F(self):
# attr = "F"
# if attr in self.__dict__:
# return self.__dict__[attr]
# else:
# return None
# Gets called when the item is not found via __getattribute__
# def __getattr__(self, item):
# return super(Indiv... | 24.815126 | 89 | 0.525906 | import copy
class Individual:
def __init__(self, X=None, F=None, CV=None, G=None, feasible=None, **kwargs) -> None:
self.X = X
self.F = F
self.CV = CV
self.G = G
self.feasible = feasible
self.data = kwargs
self.attr = set(self.__dict__.keys())
def has(... | 1,767 | -7 | 369 |
e0cfec01c7bd874d0cf8518ed6414b1765f009fe | 2,171 | py | Python | tests/test_controllers.py | kaaass/BGmi | 564ea664efed10a18dfcedb39552e688a66966c0 | [
"MIT"
] | 483 | 2017-09-15T16:35:11.000Z | 2022-03-29T16:34:56.000Z | tests/test_controllers.py | kaaass/BGmi | 564ea664efed10a18dfcedb39552e688a66966c0 | [
"MIT"
] | 205 | 2017-09-14T01:24:25.000Z | 2022-03-17T09:59:28.000Z | tests/test_controllers.py | kaaass/BGmi | 564ea664efed10a18dfcedb39552e688a66966c0 | [
"MIT"
] | 48 | 2017-09-19T16:09:55.000Z | 2022-02-04T10:08:25.000Z | import unittest
from bgmi.lib.constants import BANGUMI_UPDATE_TIME
from bgmi.lib.controllers import (
add,
cal,
delete,
mark,
recreate_source_relatively_table,
search,
)
from bgmi.main import setup
| 31.014286 | 74 | 0.58176 | import unittest
from bgmi.lib.constants import BANGUMI_UPDATE_TIME
from bgmi.lib.controllers import (
add,
cal,
delete,
mark,
recreate_source_relatively_table,
search,
)
from bgmi.main import setup
class ControllersTest(unittest.TestCase):
def setUp(self):
self.bangumi_name_1 = "名... | 1,714 | 226 | 23 |
9f86c14a0806b55f9050c006457010a10a435371 | 1,262 | py | Python | data formatting/format.py | ManindraDeMel/Deep-Deblurring | 0332591d3aaa3940542f34b6603fd3dd154416bf | [
"MIT"
] | null | null | null | data formatting/format.py | ManindraDeMel/Deep-Deblurring | 0332591d3aaa3940542f34b6603fd3dd154416bf | [
"MIT"
] | null | null | null | data formatting/format.py | ManindraDeMel/Deep-Deblurring | 0332591d3aaa3940542f34b6603fd3dd154416bf | [
"MIT"
] | null | null | null | from PIL import Image, ImageFilter
import random
# This library only words with the assumption that the dataset has been formatted as 0.jpg, 1.jpg ... or 0.png, 1.png ... accordingly | 45.071429 | 171 | 0.681458 | from PIL import Image, ImageFilter
import random
# This library only words with the assumption that the dataset has been formatted as 0.jpg, 1.jpg ... or 0.png, 1.png ... accordingly
def blurImage(path, blur_num):
if (random.randint(0, 2) > 1): # Using different blurs randomly, if you only have a dataset with s... | 986 | 0 | 92 |
ae93b350a737e64fb7552c84ff50d4dbc14ab372 | 1,610 | py | Python | get_bitcoin_price.py | ZanW/newsScraper_new | a1995c18d256856c66387bcf290d02e82ae24869 | [
"MIT"
] | null | null | null | get_bitcoin_price.py | ZanW/newsScraper_new | a1995c18d256856c66387bcf290d02e82ae24869 | [
"MIT"
] | null | null | null | get_bitcoin_price.py | ZanW/newsScraper_new | a1995c18d256856c66387bcf290d02e82ae24869 | [
"MIT"
] | null | null | null | import os
import time
import pandas as pd
FETCH_URL = "https://poloniex.com/public?command=returnChartData¤cyPair=%s&start=%d&end=%d&period=300"
#PAIR_LIST = ["BTC_ETH"]
DATA_DIR = "data"
COLUMNS = ["date","high","low","open","close","volume","quoteVolume","weightedAverage"]
if __name__ == '__main__':
main... | 26.393443 | 108 | 0.625466 | import os
import time
import pandas as pd
FETCH_URL = "https://poloniex.com/public?command=returnChartData¤cyPair=%s&start=%d&end=%d&period=300"
#PAIR_LIST = ["BTC_ETH"]
DATA_DIR = "data"
COLUMNS = ["date","high","low","open","close","volume","quoteVolume","weightedAverage"]
def get_data(pair):
datafile = o... | 1,241 | 0 | 46 |
8c40bdc8938659a4ff899b242ef3d828e3dcba06 | 1,551 | py | Python | hearthbreaker/cards/weapons/hunter.py | anuragpapineni/Hearthbreaker-evolved-agent | d519d42babd93e3567000c33a381e93db065301c | [
"MIT"
] | null | null | null | hearthbreaker/cards/weapons/hunter.py | anuragpapineni/Hearthbreaker-evolved-agent | d519d42babd93e3567000c33a381e93db065301c | [
"MIT"
] | null | null | null | hearthbreaker/cards/weapons/hunter.py | anuragpapineni/Hearthbreaker-evolved-agent | d519d42babd93e3567000c33a381e93db065301c | [
"MIT"
] | null | null | null | from hearthbreaker.constants import CHARACTER_CLASS, CARD_RARITY
from hearthbreaker.game_objects import WeaponCard, Weapon
| 33 | 94 | 0.601547 | from hearthbreaker.constants import CHARACTER_CLASS, CARD_RARITY
from hearthbreaker.game_objects import WeaponCard, Weapon
class EaglehornBow(WeaponCard):
def __init__(self):
super().__init__("Eaglehorn Bow", 3, CHARACTER_CLASS.HUNTER,
CARD_RARITY.RARE)
def create_weapon(self... | 1,249 | 25 | 152 |
069bc2c04b617aebb7c7459106d35ec20698985f | 2,659 | py | Python | sdk/python/touca/cli/_merge.py | trytouca/trytouca | eae38a96407d1ecac543c5a5fb05cbbe632ddfca | [
"Apache-2.0"
] | 6 | 2022-03-19T02:57:11.000Z | 2022-03-31T16:34:34.000Z | sdk/python/touca/cli/_merge.py | trytouca/trytouca | eae38a96407d1ecac543c5a5fb05cbbe632ddfca | [
"Apache-2.0"
] | null | null | null | sdk/python/touca/cli/_merge.py | trytouca/trytouca | eae38a96407d1ecac543c5a5fb05cbbe632ddfca | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Touca, Inc. Subject to Apache-2.0 License.
from sys import stderr, stdout
from pathlib import Path
from argparse import ArgumentParser
from loguru import logger
from touca.cli._common import Operation
| 33.2375 | 81 | 0.599097 | # Copyright 2022 Touca, Inc. Subject to Apache-2.0 License.
from sys import stderr, stdout
from pathlib import Path
from argparse import ArgumentParser
from loguru import logger
from touca.cli._common import Operation
def _merge(touca_cli: Path, dir_src: Path, dir_dst: Path):
from subprocess import Popen
if... | 2,233 | 159 | 46 |
9cb3935c9a570950e26ec0e2f7fcb068ee01b448 | 4,939 | py | Python | chess/game.py | rdebek/chess | 0f72894ded5b464994ae03993c5224f705dc8eb7 | [
"MIT"
] | null | null | null | chess/game.py | rdebek/chess | 0f72894ded5b464994ae03993c5224f705dc8eb7 | [
"MIT"
] | null | null | null | chess/game.py | rdebek/chess | 0f72894ded5b464994ae03993c5224f705dc8eb7 | [
"MIT"
] | null | null | null | import pygame
import moves
from typing import List
from pieces.king import King
import copy
SIZE = (1000, 800)
SQUARE_WIDTH = int(0.8 * SIZE[0] // 8)
SQUARE_HEIGHT = SIZE[1] // 8
IMAGES = {}
pygame.init()
screen = pygame.display.set_mode(SIZE)
move_feed = []
running = True
board_array = [
['Br', 'Bn', 'Bb', 'Bq'... | 33.828767 | 117 | 0.561652 | import pygame
import moves
from typing import List
from pieces.king import King
import copy
SIZE = (1000, 800)
SQUARE_WIDTH = int(0.8 * SIZE[0] // 8)
SQUARE_HEIGHT = SIZE[1] // 8
IMAGES = {}
pygame.init()
screen = pygame.display.set_mode(SIZE)
move_feed = []
running = True
board_array = [
['Br', 'Bn', 'Bb', 'Bq'... | 3,010 | 0 | 184 |
00893092dc39939fef6d823715dc13387f457e50 | 1,135 | py | Python | pyiArduinoI2Cbumper/examples/changeLineType.py | tremaru/pyiArduinoI2Cbumper | 94cb0ee7c38cb375cf1df97cacc7b3db3374e594 | [
"MIT"
] | null | null | null | pyiArduinoI2Cbumper/examples/changeLineType.py | tremaru/pyiArduinoI2Cbumper | 94cb0ee7c38cb375cf1df97cacc7b3db3374e594 | [
"MIT"
] | null | null | null | pyiArduinoI2Cbumper/examples/changeLineType.py | tremaru/pyiArduinoI2Cbumper | 94cb0ee7c38cb375cf1df97cacc7b3db3374e594 | [
"MIT"
] | null | null | null | # ПРИМЕР ПОЛУЧЕНИЯ И УКАЗАНИЯ ТИПА ЛИНИИ ТРАССЫ:
# Тип линии, равно как и калибровочные значения,
# хранятся в энергонезависимой памяти модуля.
from time import sleep
# Подключаем библиотеку для работы с бампером I2C-flash.
from pyiArduinoI2Cbumper import *
# Объявляем объект bum для работы с функциями и метода... | 28.375 | 73 | 0.710132 | # ПРИМЕР ПОЛУЧЕНИЯ И УКАЗАНИЯ ТИПА ЛИНИИ ТРАССЫ:
# Тип линии, равно как и калибровочные значения,
# хранятся в энергонезависимой памяти модуля.
from time import sleep
# Подключаем библиотеку для работы с бампером I2C-flash.
from pyiArduinoI2Cbumper import *
# Объявляем объект bum для работы с функциями и метода... | 0 | 0 | 0 |
8a9aae2331f5c2c081342a50ca86c1dea6863527 | 470 | py | Python | FMsystem/dashboard/migrations/0002_auto_20191112_1718.py | emetowinner/FMS | 85fd1791ab9835c20cf6473703e6adf72416719a | [
"Apache-2.0"
] | null | null | null | FMsystem/dashboard/migrations/0002_auto_20191112_1718.py | emetowinner/FMS | 85fd1791ab9835c20cf6473703e6adf72416719a | [
"Apache-2.0"
] | null | null | null | FMsystem/dashboard/migrations/0002_auto_20191112_1718.py | emetowinner/FMS | 85fd1791ab9835c20cf6473703e6adf72416719a | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2.6 on 2019-11-12 17:18
from django.db import migrations
| 19.583333 | 47 | 0.548936 | # Generated by Django 2.2.6 on 2019-11-12 17:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='userprofile',
name='user',
),
... | 0 | 364 | 23 |
c91d0475a83d6bf7dbbdd3cfc8f67e8f444ecc8a | 9,594 | py | Python | demo_doc2sim_education.py | interxuxing/qa_education | 1ae8247bd05b1870b14c3af6c1eceea2c5c9dd14 | [
"MIT"
] | 1 | 2018-07-05T06:20:55.000Z | 2018-07-05T06:20:55.000Z | demo_doc2sim_education.py | interxuxing/qa_education | 1ae8247bd05b1870b14c3af6c1eceea2c5c9dd14 | [
"MIT"
] | null | null | null | demo_doc2sim_education.py | interxuxing/qa_education | 1ae8247bd05b1870b14c3af6c1eceea2c5c9dd14 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
"""
This script is used to build a qa data for usage.
Typically, each enty contains three elements: a question, an answer, a url
"""
import sys
import re
import os
import jieba
import gensim
try:
import cPickle as pickle
except:
import pickle
reload(sys)
sys.setdefaultencoding('utf-8'... | 35.014599 | 114 | 0.654472 | # -*- coding:utf-8 -*-
"""
This script is used to build a qa data for usage.
Typically, each enty contains three elements: a question, an answer, a url
"""
import sys
import re
import os
import jieba
import gensim
try:
import cPickle as pickle
except:
import pickle
reload(sys)
sys.setdefaultencoding('utf-8'... | 0 | 0 | 0 |
cac677165073ebf21ff71868eeada85dd2f640ab | 3,661 | py | Python | satchmo/apps/l10n/south_migrations/0001_initial.py | predatell/satchmo | 6ced1f845aadec240c7e433c3cbf4caca96e0d92 | [
"BSD-3-Clause"
] | 1 | 2019-10-08T16:19:59.000Z | 2019-10-08T16:19:59.000Z | satchmo/apps/l10n/south_migrations/0001_initial.py | predatell/satchmo | 6ced1f845aadec240c7e433c3cbf4caca96e0d92 | [
"BSD-3-Clause"
] | null | null | null | satchmo/apps/l10n/south_migrations/0001_initial.py | predatell/satchmo | 6ced1f845aadec240c7e433c3cbf4caca96e0d92 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
| 57.203125 | 123 | 0.575253 | # -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Country'
db.create_table('l10n_country', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
... | 1,793 | 1,753 | 25 |
c8da72bb34454c737c7eea75fbed5dc53854c72b | 217 | py | Python | sources/__init__.py | LXG-Shadow/BilibiliGetFavorite | a3912eb983be5f420c3729d705eefbf06d240309 | [
"Apache-2.0"
] | 60 | 2018-08-27T07:10:58.000Z | 2021-07-14T11:13:53.000Z | sources/__init__.py | LXG-Shadow/BilibiliGetFavorite | a3912eb983be5f420c3729d705eefbf06d240309 | [
"Apache-2.0"
] | 6 | 2019-09-09T02:50:23.000Z | 2021-06-08T21:46:16.000Z | sources/__init__.py | LXG-Shadow/BilibiliGetFavorite | a3912eb983be5f420c3729d705eefbf06d240309 | [
"Apache-2.0"
] | 17 | 2019-01-20T08:46:01.000Z | 2021-06-30T10:44:01.000Z | from .bilibili.biliAudio import *
from .bilibili.biliVideo import *
from .bilibili.biliLive import *
from .wenku8.Wenku8TXT import *
from .video.imomoe import *
from .video.kakadm import *
from .audio.netease import * | 31 | 33 | 0.778802 | from .bilibili.biliAudio import *
from .bilibili.biliVideo import *
from .bilibili.biliLive import *
from .wenku8.Wenku8TXT import *
from .video.imomoe import *
from .video.kakadm import *
from .audio.netease import * | 0 | 0 | 0 |
03b4111150c9056bb5e0216fdc83c869ac11a37e | 19,080 | py | Python | plotting_scripts/pylot_utils.py | erdos-project/erdos-experiments | 56eea1d52991ada5cc3c4a2e26ddc1da31f1ac2e | [
"Apache-2.0"
] | 1 | 2022-03-04T11:41:35.000Z | 2022-03-04T11:41:35.000Z | plotting_scripts/pylot_utils.py | erdos-project/erdos-experiments | 56eea1d52991ada5cc3c4a2e26ddc1da31f1ac2e | [
"Apache-2.0"
] | null | null | null | plotting_scripts/pylot_utils.py | erdos-project/erdos-experiments | 56eea1d52991ada5cc3c4a2e26ddc1da31f1ac2e | [
"Apache-2.0"
] | null | null | null | import ast
import csv
import json
from absl import flags
import numpy as np
import pandas as pd
FLAGS = flags.FLAGS
def get_timestamps_with_obstacles(filename, obstacle_distance_threshold=10):
"""Finds timestamps when we detected obstacles."""
print(filename)
df = pd.read_csv(
filename,
... | 39.503106 | 101 | 0.574266 | import ast
import csv
import json
from absl import flags
import numpy as np
import pandas as pd
FLAGS = flags.FLAGS
class ProfileEvent(object):
def __init__(self, json_dict):
self.name = json_dict['name']
self.event_time = float(json_dict['ts']) / 1000.0 # in ms
self.runtime = float(js... | 14,336 | 3,194 | 279 |
553261ede6908d15a260c9d80a6cc7e5e9bc751f | 1,256 | py | Python | solutions/longest-substring-without-repeating-characters.py | oopsno/leetcode.py | fe454137aef32b4950a1fdb398f90d5212a90fb8 | [
"WTFPL"
] | 1 | 2017-11-30T12:23:59.000Z | 2017-11-30T12:23:59.000Z | solutions/longest-substring-without-repeating-characters.py | oopsno/leetcode.py | fe454137aef32b4950a1fdb398f90d5212a90fb8 | [
"WTFPL"
] | null | null | null | solutions/longest-substring-without-repeating-characters.py | oopsno/leetcode.py | fe454137aef32b4950a1fdb398f90d5212a90fb8 | [
"WTFPL"
] | null | null | null | # encoding: UTF-8
from leetcode import *
from typing import Generator, Tuple
@Problem(3, 'Longest Substring Without Repeating Characters', Difficulty.Medium, Tags.HashTable, Tags.String, Tags.TwoPointers)
@Solution.test.lengthOfLongestSubstring
@Solution.test.lengthOfLongestSubstring
@Solution.test.lengthOfLon... | 26.166667 | 127 | 0.585191 | # encoding: UTF-8
from leetcode import *
from typing import Generator, Tuple
@Problem(3, 'Longest Substring Without Repeating Characters', Difficulty.Medium, Tags.HashTable, Tags.String, Tags.TwoPointers)
class Solution:
@staticmethod
def iterate(s: str) -> Generator[Tuple[int, int], None, None]:
"""... | 292 | 612 | 88 |
691c6dad4265dcd18d18b8b3764b927ce6ce8e3c | 381 | py | Python | wikidata-to-gedcom/mywikidata/WikidataKeys.py | lmallez/wikidata-to-gedcom | fac73e0cb6589e25bcb3c8c388ff7afc86273586 | [
"MIT"
] | 5 | 2019-11-12T20:45:46.000Z | 2020-04-30T05:57:01.000Z | wikidata-to-gedcom/mywikidata/WikidataKeys.py | lmallez/wikidata-to-gedcom | fac73e0cb6589e25bcb3c8c388ff7afc86273586 | [
"MIT"
] | null | null | null | wikidata-to-gedcom/mywikidata/WikidataKeys.py | lmallez/wikidata-to-gedcom | fac73e0cb6589e25bcb3c8c388ff7afc86273586 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
| 19.05 | 29 | 0.574803 | #!/usr/bin/env python3
class WikidataKey:
HUMAN = 'Q5'
MALE = 'Q6581097'
FEMALE = 'Q6581072'
ADOPTED = 'Q20746725'
SEX = 'P21'
FATHER = 'P22'
MOTHER = 'P25'
INSTANCE_OF = 'P31'
CHILD = 'P40'
FAMILY = 'P53'
GIVEN_NAME = 'P735'
FAMILY_NAME = 'P734'
DATE_OF_BIRTH = 'P5... | 0 | 334 | 23 |
e4d46792cc68d8be20c27212cb496b7f1e2c6189 | 101,385 | py | Python | emoji_list.py | williln/emojihaiku | 87a5558c2de397726d4fc360cf1e11da2152a9f3 | [
"MIT"
] | 20 | 2015-07-24T09:36:41.000Z | 2020-05-09T16:22:02.000Z | emoji_list.py | williln/emojihaiku | 87a5558c2de397726d4fc360cf1e11da2152a9f3 | [
"MIT"
] | 9 | 2015-07-24T04:54:52.000Z | 2017-03-20T20:14:50.000Z | emoji_list.py | williln/emojihaiku | 87a5558c2de397726d4fc360cf1e11da2152a9f3 | [
"MIT"
] | 7 | 2015-08-18T06:18:35.000Z | 2021-04-10T17:06:24.000Z | EMOJI_LIST = [
':1st_place_medal:',
':2nd_place_medal:',
':3rd_place_medal:',
':AB_button_(blood_type):',
':ATM_sign:',
':A_button_(blood_type):',
':Afghanistan:',
':Albania:',
':Algeria:',
':American_Samoa:',
':Andorra:',
':Angola:',
':Anguilla:',
':Antarctica:',
... | 27.460726 | 64 | 0.630646 | EMOJI_LIST = [
':1st_place_medal:',
':2nd_place_medal:',
':3rd_place_medal:',
':AB_button_(blood_type):',
':ATM_sign:',
':A_button_(blood_type):',
':Afghanistan:',
':Albania:',
':Algeria:',
':American_Samoa:',
':Andorra:',
':Angola:',
':Anguilla:',
':Antarctica:',
... | 0 | 0 | 0 |
d31af86c40fba5fb7d0eda60023797aec4514b11 | 1,686 | py | Python | app.py | selmargoulart08/dolarparareal | 8824b628d668037cf2981db9107d4e75d8a23ff9 | [
"MIT"
] | 2 | 2022-03-04T16:13:12.000Z | 2022-03-04T21:21:37.000Z | app.py | selmargoulart08/dolarparareal | 8824b628d668037cf2981db9107d4e75d8a23ff9 | [
"MIT"
] | null | null | null | app.py | selmargoulart08/dolarparareal | 8824b628d668037cf2981db9107d4e75d8a23ff9 | [
"MIT"
] | null | null | null | from flask import Flask,render_template,request
import requests
app = Flask(__name__)
API_KEY = 'RQM7GIDWT0ZU2WLU'
@app.route('/',methods=['GET','POST'])
if __name__ == "__main__":
app.run(debug= False) | 45.567568 | 156 | 0.603203 | from flask import Flask,render_template,request
import requests
app = Flask(__name__)
API_KEY = 'RQM7GIDWT0ZU2WLU'
@app.route('/',methods=['GET','POST'])
def home():
if request.method == 'POST':
try:
amount = request.form['amount']
amount = float(amount)
fro... | 1,441 | 0 | 23 |
0ae14a3b6881e84b6465b5b3418017ee6a55395e | 4,134 | py | Python | je_verification_code/modules/generate.py | JE-Chen/Python_Generate_Verification_Code | e26869ce778b682ef098b4b4c41f9a85bdf85f97 | [
"MIT"
] | 3 | 2020-12-21T03:59:09.000Z | 2020-12-30T07:27:49.000Z | je_verification_code/modules/generate.py | JE-Chen/Python_Generate_Verification_Code | e26869ce778b682ef098b4b4c41f9a85bdf85f97 | [
"MIT"
] | null | null | null | je_verification_code/modules/generate.py | JE-Chen/Python_Generate_Verification_Code | e26869ce778b682ef098b4b4c41f9a85bdf85f97 | [
"MIT"
] | null | null | null | import base64
import os
import random
from io import BytesIO
import matplotlib.font_manager as fm
from PIL import Image, ImageDraw, ImageFont
| 33.33871 | 102 | 0.577891 | import base64
import os
import random
from io import BytesIO
import matplotlib.font_manager as fm
from PIL import Image, ImageDraw, ImageFont
class GenerateVerificationCode:
@staticmethod
def generate_color(color_r: int = 255, color_g: int = 255, color_b: int = 255):
"""
:param color_r: Colo... | 620 | 3,347 | 23 |
72feb42656b0d22751d723a497e020605e203efa | 700 | py | Python | pycargr/__init__.py | Florents-Tselai/PyCarGr | ed8ae8878d0d188d1f9ab44b62ed529764ef8e45 | [
"MIT"
] | 13 | 2017-05-07T20:40:23.000Z | 2022-03-09T12:40:02.000Z | pycargr/__init__.py | Florents-Tselai/PyCarGr | ed8ae8878d0d188d1f9ab44b62ed529764ef8e45 | [
"MIT"
] | 1 | 2021-12-08T17:45:49.000Z | 2021-12-08T17:45:49.000Z | pycargr/__init__.py | Florents-Tselai/PyCarGr | ed8ae8878d0d188d1f9ab44b62ed529764ef8e45 | [
"MIT"
] | 14 | 2017-05-08T07:45:17.000Z | 2022-03-20T07:54:28.000Z | from json import dumps
from pathlib import Path
from sqlite3 import connect
from pycargr.model import Car
DB_PATH = Path.home().joinpath('pycargr.db')
SEARCH_BASE_URL = 'https://www.car.gr/classifieds/cars/'
| 35 | 112 | 0.594286 | from json import dumps
from pathlib import Path
from sqlite3 import connect
from pycargr.model import Car
DB_PATH = Path.home().joinpath('pycargr.db')
SEARCH_BASE_URL = 'https://www.car.gr/classifieds/cars/'
def save_car(*cars):
car_data = [(c.car_id, c.title, c.price, c.release_date, c.km, c.bhp, c.url, c.col... | 465 | 0 | 23 |
41bf7bbb2675b0dfe18d90074eb48a93a6f2e4c5 | 1,293 | py | Python | tests/generator_python3_marshmallow_test.py | expobrain/json-schema-codegen | e22b386333c6230e5d6f5984fd947fdd7b947e82 | [
"MIT"
] | 21 | 2018-06-15T16:08:57.000Z | 2022-02-11T16:16:11.000Z | tests/generator_python3_marshmallow_test.py | expobrain/json-schema-codegen | e22b386333c6230e5d6f5984fd947fdd7b947e82 | [
"MIT"
] | 14 | 2018-08-09T18:02:19.000Z | 2022-01-24T18:04:17.000Z | tests/generator_python3_marshmallow_test.py | expobrain/json-schema-codegen | e22b386333c6230e5d6f5984fd947fdd7b947e82 | [
"MIT"
] | 4 | 2018-11-30T18:19:10.000Z | 2021-11-18T04:04:36.000Z | from pathlib import Path
import ast
import pytest
import astor
import warnings
import os
from json_codegen import load_schema
from json_codegen.generators.python3_marshmallow import Python3MarshmallowGenerator
SCHEMAS_DIR = Path(__file__).parent / "fixtures" / "schemas"
FIXTURES_DIR = Path(__file__).parent / "fixtu... | 26.9375 | 91 | 0.743233 | from pathlib import Path
import ast
import pytest
import astor
import warnings
import os
from json_codegen import load_schema
from json_codegen.generators.python3_marshmallow import Python3MarshmallowGenerator
SCHEMAS_DIR = Path(__file__).parent / "fixtures" / "schemas"
FIXTURES_DIR = Path(__file__).parent / "fixtu... | 687 | 0 | 45 |
9b3c571c5bc94ea87ff20714b5a8b05aada9fe40 | 569 | py | Python | ABC/abc051-abc100/abc079/d.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 2 | 2020-06-12T09:54:23.000Z | 2021-05-04T01:34:07.000Z | ABC/abc051-abc100/abc079/d.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 961 | 2020-06-23T07:26:22.000Z | 2022-03-31T21:34:52.000Z | ABC/abc051-abc100/abc079/d.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
if __name__ == '__main__':
main()
| 21.074074 | 61 | 0.411248 | # -*- coding: utf-8 -*-
def main():
h, w = map(int, input().split())
c = [list(map(int, input().split())) for _ in range(10)]
a = [list(map(int, input().split())) for _ in range(h)]
ans = 0
for k in range(10):
for i in range(10):
for j in range(10):
... | 473 | 0 | 25 |
cf03515cb78738608985a3bcb75662fa5776e3d7 | 638 | py | Python | Docs/Examples/howtos/glyphMath_00.py | Vectro-Type-Foundry/robofab | cd65d78292d24358c98dce53d283314cdc85878e | [
"BSD-3-Clause"
] | 61 | 2015-01-17T10:15:45.000Z | 2018-12-02T13:53:02.000Z | Docs/Examples/howtos/glyphMath_00.py | Vectro-Type-Foundry/robofab | cd65d78292d24358c98dce53d283314cdc85878e | [
"BSD-3-Clause"
] | 37 | 2015-01-05T23:44:56.000Z | 2018-03-16T19:05:28.000Z | Docs/Examples/howtos/glyphMath_00.py | Vectro-Type-Foundry/robofab | cd65d78292d24358c98dce53d283314cdc85878e | [
"BSD-3-Clause"
] | 25 | 2015-01-08T19:49:36.000Z | 2018-10-29T00:36:46.000Z | # robofab manual
# Glyphmath howto
# Fun examples
#FLM: Fun with GlyphMath
# this example is meant to run with the RoboFab Demo Font
# as the Current Font. So, if you're doing this in FontLab
# import the Demo Font UFO first.
from robofab.world import CurrentFont
from random import random
f = CurrentFont()
conde... | 22.785714 | 58 | 0.747649 | # robofab manual
# Glyphmath howto
# Fun examples
#FLM: Fun with GlyphMath
# this example is meant to run with the RoboFab Demo Font
# as the Current Font. So, if you're doing this in FontLab
# import the Demo Font UFO first.
from robofab.world import CurrentFont
from random import random
f = CurrentFont()
conde... | 0 | 0 | 0 |
0220466f686772c657c40b619251e273a74a65d7 | 1,376 | py | Python | pypy/translator/js/examples/console/docloader.py | camillobruni/pygirl | ddbd442d53061d6ff4af831c1eab153bcc771b5a | [
"MIT"
] | 12 | 2016-01-06T07:10:28.000Z | 2021-05-13T23:02:02.000Z | pypy/translator/js/examples/console/docloader.py | camillobruni/pygirl | ddbd442d53061d6ff4af831c1eab153bcc771b5a | [
"MIT"
] | null | null | null | pypy/translator/js/examples/console/docloader.py | camillobruni/pygirl | ddbd442d53061d6ff4af831c1eab153bcc771b5a | [
"MIT"
] | 2 | 2016-07-29T07:09:50.000Z | 2016-10-16T08:50:26.000Z |
""" Simple module for loading documentation of various
pypy-cs from doc directory
"""
import py
| 31.272727 | 76 | 0.582122 |
""" Simple module for loading documentation of various
pypy-cs from doc directory
"""
import py
class DocLoader(object):
def __init__(self, consoles, docdir, testfile):
self.consoles = consoles
self.docdir = py.path.local(docdir)
assert self.docdir.check(dir=1)
self.testfile = tes... | 1,144 | 3 | 130 |
9160e3ca26bcd83ce1ff19da7116c3bd5688dbed | 5,685 | py | Python | src/sst/elements/scheduler/simulations/makeInput.py | feldergast/sst-elements | a7abc015aed709feb05821d269d233110569fd72 | [
"BSD-3-Clause"
] | 2 | 2019-06-10T15:32:03.000Z | 2019-06-11T14:17:32.000Z | src/sst/elements/scheduler/simulations/makeInput.py | feldergast/sst-elements | a7abc015aed709feb05821d269d233110569fd72 | [
"BSD-3-Clause"
] | 39 | 2016-01-06T15:08:15.000Z | 2020-06-03T18:12:31.000Z | src/sst/elements/scheduler/simulations/makeInput.py | feldergast/sst-elements | a7abc015aed709feb05821d269d233110569fd72 | [
"BSD-3-Clause"
] | 2 | 2021-05-23T02:28:02.000Z | 2021-09-08T13:38:46.000Z | #!/usr/bin/env python
'''
SST scheduler simulation input file generator
Input parameters are given below
Setting a parameter to "default" or "" will select the default option
'''
import os
# Input workload trace path:
traceName = 'jobtrace_files/bisection_N1.sim'
# Output file name:
outFile = 'simple_libtopomap_bisec... | 34.664634 | 81 | 0.610554 | #!/usr/bin/env python
'''
SST scheduler simulation input file generator
Input parameters are given below
Setting a parameter to "default" or "" will select the default option
'''
import os
# Input workload trace path:
traceName = 'jobtrace_files/bisection_N1.sim'
# Output file name:
outFile = 'simple_libtopomap_bisec... | 0 | 0 | 0 |
30654d429382de6f8edb4c2fc8cb6391f4f78fba | 2,626 | py | Python | gaul/utils/pbar.py | al-jshen/gaul | f0c8d165adc4dbec328af34e26d8988a89c5c385 | [
"Apache-2.0",
"MIT"
] | null | null | null | gaul/utils/pbar.py | al-jshen/gaul | f0c8d165adc4dbec328af34e26d8988a89c5c385 | [
"Apache-2.0",
"MIT"
] | null | null | null | gaul/utils/pbar.py | al-jshen/gaul | f0c8d165adc4dbec328af34e26d8988a89c5c385 | [
"Apache-2.0",
"MIT"
] | null | null | null | from jax import lax
from jax.experimental import host_callback
from tqdm.auto import tqdm
def progress_bar_scan(num_samples, message=None):
"""
Progress bar for a JAX scan.
"""
if message is None:
message = f"Running for {num_samples:,} iterations"
tqdm_bars = {}
if num_samples > 20:
... | 30.183908 | 86 | 0.589871 | from jax import lax
from jax.experimental import host_callback
from tqdm.auto import tqdm
def progress_bar_scan(num_samples, message=None):
"""
Progress bar for a JAX scan.
"""
if message is None:
message = f"Running for {num_samples:,} iterations"
tqdm_bars = {}
if num_samples > 20:
... | 682 | 0 | 139 |
b637446c57444ed8cb2a019389bc13205a3f6424 | 671 | py | Python | regina_normalizer/dict_data.py | grammatek/regina_normalizer | 61ffeafcf1b967b44a3a9f99727013779bfeba13 | [
"Apache-2.0"
] | null | null | null | regina_normalizer/dict_data.py | grammatek/regina_normalizer | 61ffeafcf1b967b44a3a9f99727013779bfeba13 | [
"Apache-2.0"
] | null | null | null | regina_normalizer/dict_data.py | grammatek/regina_normalizer | 61ffeafcf1b967b44a3a9f99727013779bfeba13 | [
"Apache-2.0"
] | null | null | null | import logging
from pathlib import Path | 29.173913 | 85 | 0.611028 | import logging
from pathlib import Path
class PronDict:
lexicon = None
def __init__(self, lexicon_file='data/lexicon.txt'):
"""
Initialize the lexicon containing the words from the pronunciation dictionary
:param lexicon_file: path to lexicon file
"""
try:
w... | 89 | 521 | 22 |
0edcdddf3b20da72b40dd815ce537c579e072a60 | 7,088 | py | Python | skimage/future/graph/tests/test_rag.py | bvnayak/scikit-image | a6654763f1445aa198dcaab8bd77fe0e2a699c72 | [
"BSD-3-Clause"
] | null | null | null | skimage/future/graph/tests/test_rag.py | bvnayak/scikit-image | a6654763f1445aa198dcaab8bd77fe0e2a699c72 | [
"BSD-3-Clause"
] | null | null | null | skimage/future/graph/tests/test_rag.py | bvnayak/scikit-image | a6654763f1445aa198dcaab8bd77fe0e2a699c72 | [
"BSD-3-Clause"
] | 1 | 2021-02-20T14:11:39.000Z | 2021-02-20T14:11:39.000Z | import numpy as np
from skimage.future import graph
from skimage._shared.version_requirements import is_installed
from skimage import segmentation
import pytest
@pytest.mark.skipif(not is_installed('networkx'),
reason="networkx not installed")
@pytest.mark.skipif(not is_installed('networkx'),
... | 31.784753 | 76 | 0.592833 | import numpy as np
from skimage.future import graph
from skimage._shared.version_requirements import is_installed
from skimage import segmentation
import pytest
def max_edge(g, src, dst, n):
default = {'weight': -np.inf}
w1 = g[n].get(src, default)['weight']
w2 = g[n].get(dst, default)['weight']
retur... | 5,527 | 0 | 271 |
d69fac53ce9bde7627a2d348edbe244afc9d3c48 | 5,347 | py | Python | alunos/views.py | Antonio-Neves/Gestao-Escolar | a97052beb571a32619d4e6b6f5e7c3aae3bc8e9b | [
"MIT"
] | 7 | 2021-05-21T00:23:40.000Z | 2021-12-09T12:35:00.000Z | alunos/views.py | Antonio-Neves/Gestao-Escolar | a97052beb571a32619d4e6b6f5e7c3aae3bc8e9b | [
"MIT"
] | null | null | null | alunos/views.py | Antonio-Neves/Gestao-Escolar | a97052beb571a32619d4e6b6f5e7c3aae3bc8e9b | [
"MIT"
] | 7 | 2021-08-03T22:28:36.000Z | 2022-03-13T20:08:40.000Z | from django.shortcuts import redirect, render, reverse
from django.urls import reverse_lazy
from django.contrib import messages
from django.db.models import Case, CharField, Value, When
from django.views.generic.base import TemplateView
from django.views.generic import ListView
from django.views.generic.edit import Cr... | 27.994764 | 86 | 0.734618 | from django.shortcuts import redirect, render, reverse
from django.urls import reverse_lazy
from django.contrib import messages
from django.db.models import Case, CharField, Value, When
from django.views.generic.base import TemplateView
from django.views.generic import ListView
from django.views.generic.edit import Cr... | 1,230 | 2,311 | 158 |
3275a9b589be4d602a175fa7da9c5e68fd17c61c | 3,319 | py | Python | src/predict.py | elangovana/object-tracking | a9359ac3e3926102f9998eb20500746343e14826 | [
"Apache-2.0"
] | 1 | 2019-12-17T01:17:01.000Z | 2019-12-17T01:17:01.000Z | src/predict.py | elangovana/object-tracking | a9359ac3e3926102f9998eb20500746343e14826 | [
"Apache-2.0"
] | 2 | 2021-09-08T01:37:46.000Z | 2022-03-12T00:13:53.000Z | src/predict.py | elangovana/object-tracking | a9359ac3e3926102f9998eb20500746343e14826 | [
"Apache-2.0"
] | null | null | null | # *****************************************************************************
# * Copyright 2019 Amazon.com, Inc. and its affiliates. All Rights Reserved. *
# *
# Licensed under the Amazon Software License (the "License"). *
... | 38.593023 | 86 | 0.536607 | # *****************************************************************************
# * Copyright 2019 Amazon.com, Inc. and its affiliates. All Rights Reserved. *
# *
# Licensed under the Amazon Software License (the "License"). *
... | 1,885 | 0 | 108 |
c4fbb9422b36b275ee83b64ac351d700c80cd454 | 185 | py | Python | pythonexamples/generatepassword.py | faizmd12/ADVANCEDREFLECTIVEADOPTION | 830083a000fc76b58999de88edc668df7c16bad7 | [
"Apache-2.0"
] | null | null | null | pythonexamples/generatepassword.py | faizmd12/ADVANCEDREFLECTIVEADOPTION | 830083a000fc76b58999de88edc668df7c16bad7 | [
"Apache-2.0"
] | 3 | 2018-09-19T17:00:05.000Z | 2018-09-20T03:42:37.000Z | pythonexamples/generatepassword.py | faizmd12/ADVANCEDREFLECTIVEADOPTION | 830083a000fc76b58999de88edc668df7c16bad7 | [
"Apache-2.0"
] | 2 | 2018-09-20T03:28:36.000Z | 2018-09-20T03:31:27.000Z | import string
from random import *
characters = string.ascii_letters + string.punctuation + string.digits
pswd = "".join(choice(characters) for x in range(randint(6, 14)))
print pswd
| 30.833333 | 71 | 0.756757 | import string
from random import *
characters = string.ascii_letters + string.punctuation + string.digits
pswd = "".join(choice(characters) for x in range(randint(6, 14)))
print pswd
| 0 | 0 | 0 |
fb8ba77729ed278c59294b6a64660bff6686985f | 2,180 | py | Python | openslides/agenda/apps.py | boehlke/OpenSlides | 7a64fb83ebda2cb41706f62d7cfc5a63dbcab4a2 | [
"MIT"
] | null | null | null | openslides/agenda/apps.py | boehlke/OpenSlides | 7a64fb83ebda2cb41706f62d7cfc5a63dbcab4a2 | [
"MIT"
] | null | null | null | openslides/agenda/apps.py | boehlke/OpenSlides | 7a64fb83ebda2cb41706f62d7cfc5a63dbcab4a2 | [
"MIT"
] | null | null | null | from typing import Any, Dict, Set
from django.apps import AppConfig
def required_users(element: Dict[str, Any]) -> Set[int]:
"""
Returns all user ids that are displayed as speaker in the given element.
"""
return set(speaker["user_id"] for speaker in element["speakers"])
| 32.058824 | 88 | 0.673394 | from typing import Any, Dict, Set
from django.apps import AppConfig
class AgendaAppConfig(AppConfig):
name = "openslides.agenda"
verbose_name = "OpenSlides Agenda"
angular_site_module = True
def ready(self):
# Import all required stuff.
from django.db.models.signals import pre_delete... | 1,503 | 362 | 23 |
b60ba245f6e4ca2d7772d3fac4ee1aec9528d42b | 2,367 | py | Python | pysamples/pytictoc/txc13.py | ranarashadmahmood/OMNETPY | 13ab49106a3ac700aa633a8eb37acdad5e3157ab | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 31 | 2020-06-23T13:53:47.000Z | 2022-03-28T08:09:00.000Z | pysamples/pytictoc/txc13.py | ranarashadmahmood/OMNETPY | 13ab49106a3ac700aa633a8eb37acdad5e3157ab | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 8 | 2020-11-01T21:35:47.000Z | 2021-08-29T11:40:50.000Z | pysamples/pytictoc/txc13.py | ranarashadmahmood/OMNETPY | 13ab49106a3ac700aa633a8eb37acdad5e3157ab | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 8 | 2021-03-22T15:32:22.000Z | 2022-02-02T14:57:56.000Z | """
In this step the destination address is no longer node 2 -- we draw a
random destination, and we'll add the destination address to the message.
The best way is to subclass cMessage and add destination as a data member.
To make the model execute longer, after a message arrives to its destination
the destination no... | 32.875 | 100 | 0.607098 | """
In this step the destination address is no longer node 2 -- we draw a
random destination, and we'll add the destination address to the message.
The best way is to subclass cMessage and add destination as a data member.
To make the model execute longer, after a message arrives to its destination
the destination no... | 1,717 | 15 | 180 |
ebcc63cf681a889e84bf9cc7e88caeb454c5a2b5 | 844 | py | Python | examples/metadata.py | SpotlightKid/jackclient-python | cfc1e6a11f50f98abcd351b6e372e98da8e3a06d | [
"MIT"
] | 120 | 2015-04-03T03:55:04.000Z | 2022-03-06T07:21:38.000Z | examples/metadata.py | SpotlightKid/jackclient-python | cfc1e6a11f50f98abcd351b6e372e98da8e3a06d | [
"MIT"
] | 84 | 2015-01-04T12:42:43.000Z | 2022-03-15T18:13:13.000Z | examples/metadata.py | SpotlightKid/jackclient-python | cfc1e6a11f50f98abcd351b6e372e98da8e3a06d | [
"MIT"
] | 31 | 2015-04-11T13:03:35.000Z | 2022-03-06T07:21:38.000Z | #!/usr/bin/env python3
"""Set/get/remove client/port metadata."""
from pprint import pprint
import jack
client = jack.Client('Metadata-Client')
port = client.inports.register('input')
client.set_property(client, jack.METADATA_PRETTY_NAME, 'Best Client Ever')
print('Client "pretty" name:',
jack.get_property(cli... | 27.225806 | 74 | 0.770142 | #!/usr/bin/env python3
"""Set/get/remove client/port metadata."""
from pprint import pprint
import jack
client = jack.Client('Metadata-Client')
port = client.inports.register('input')
client.set_property(client, jack.METADATA_PRETTY_NAME, 'Best Client Ever')
print('Client "pretty" name:',
jack.get_property(cli... | 0 | 0 | 0 |
e395b41818739ee3e695c411d1a683c3bf241ba7 | 5,284 | py | Python | trench_automation/main.py | yozoon/TrenchDepositionAutomation | 4eb1dd9fbabe7a782aa2070de144240616c00472 | [
"MIT"
] | null | null | null | trench_automation/main.py | yozoon/TrenchDepositionAutomation | 4eb1dd9fbabe7a782aa2070de144240616c00472 | [
"MIT"
] | null | null | null | trench_automation/main.py | yozoon/TrenchDepositionAutomation | 4eb1dd9fbabe7a782aa2070de144240616c00472 | [
"MIT"
] | null | null | null | import csv
from argparse import ArgumentParser, ArgumentTypeError
from os import path
from string import Template
from subprocess import Popen
from tempfile import NamedTemporaryFile
import numpy as np
import util
# This import only works if the directory where "generate_trench.so" is located is present in
# the PYT... | 37.211268 | 112 | 0.614497 | import csv
from argparse import ArgumentParser, ArgumentTypeError
from os import path
from string import Template
from subprocess import Popen
from tempfile import NamedTemporaryFile
import numpy as np
import util
# This import only works if the directory where "generate_trench.so" is located is present in
# the PYT... | 3,392 | 0 | 23 |
fd3c6d601192d4d75328ddcda0cc18d339d3860f | 41,703 | py | Python | pirates/makeapirate/NameGUI.py | ksmit799/POTCO-PS | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 8 | 2017-01-24T04:33:29.000Z | 2020-11-01T08:36:24.000Z | pirates/makeapirate/NameGUI.py | ksmit799/Pirates-Online-Remake | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 1 | 2017-03-02T18:05:17.000Z | 2017-03-14T06:47:10.000Z | pirates/makeapirate/NameGUI.py | ksmit799/Pirates-Online-Remake | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 11 | 2017-03-02T18:46:07.000Z | 2020-11-01T08:36:26.000Z | # File: N (Python 2.4)
import random
import types
import string
from direct.fsm import StateData
from direct.fsm import ClassicFSM
from direct.fsm import State
from direct.gui import DirectGuiGlobals
from direct.gui.DirectGui import *
from direct.task import Task
from pandac.PandaModules import *
from pandac.PandaModu... | 41.578265 | 1,162 | 0.603362 | # File: N (Python 2.4)
import random
import types
import string
from direct.fsm import StateData
from direct.fsm import ClassicFSM
from direct.fsm import State
from direct.gui import DirectGuiGlobals
from direct.gui.DirectGui import *
from direct.task import Task
from pandac.PandaModules import *
from pandac.PandaModu... | 38,199 | 2,622 | 23 |
9feb5e9b65602d98fbbe238994e65df1e102a0e9 | 972 | py | Python | app.py | BelminD/bobby | 8763fa9e12dd911dfe8e279bd33db65495ec067b | [
"MIT"
] | 1 | 2020-03-02T14:50:11.000Z | 2020-03-02T14:50:11.000Z | app.py | BelminD/bobby | 8763fa9e12dd911dfe8e279bd33db65495ec067b | [
"MIT"
] | null | null | null | app.py | BelminD/bobby | 8763fa9e12dd911dfe8e279bd33db65495ec067b | [
"MIT"
] | 1 | 2020-03-26T08:56:06.000Z | 2020-03-26T08:56:06.000Z | import argparse
import config
import utils
from chat import ChatSession
from utils import Color
if __name__ == '__main__':
main()
| 22.604651 | 140 | 0.609053 | import argparse
import config
import utils
from chat import ChatSession
from utils import Color
def parser():
parser = argparse.ArgumentParser()
parser.add_argument(
'-f',
'--file_name',
type=str,
help='chatlog output filename, .txt format'
)
return parser.parse_args()... | 790 | 0 | 46 |
005e24a95240d597e4128dcd7bd42257cd1d34bb | 486 | py | Python | tests/checkio/home/test_most_wanted_letter.py | zoido/checkio_python_solutions | 858cc7eafbbf55c8506e14cce260d17406fbf09c | [
"MIT"
] | null | null | null | tests/checkio/home/test_most_wanted_letter.py | zoido/checkio_python_solutions | 858cc7eafbbf55c8506e14cce260d17406fbf09c | [
"MIT"
] | 2 | 2017-10-14T17:44:17.000Z | 2018-04-06T18:53:37.000Z | tests/checkio/home/test_most_wanted_letter.py | zoido/checkio_python_solutions | 858cc7eafbbf55c8506e14cce260d17406fbf09c | [
"MIT"
] | null | null | null | from checkio.home.most_wanted_letter import checkio
| 37.384615 | 68 | 0.598765 | from checkio.home.most_wanted_letter import checkio
def test_checkio():
assert checkio("Hello World!") == "l", "Hello test"
assert checkio("How do you do?") == "o", "O is most wanted"
assert checkio("One") == "e", "All letter only once."
assert checkio("Oops!") == "o", "Don't forget about lower case."... | 410 | 0 | 23 |
f22e830fb9aacfaedbbdc3927d8137c30da1348f | 3,346 | py | Python | train.py | takahiro-777/tf-dqn-reversi | 35875c593e58b60173c290b0a04544dfa288289f | [
"MIT"
] | null | null | null | train.py | takahiro-777/tf-dqn-reversi | 35875c593e58b60173c290b0a04544dfa288289f | [
"MIT"
] | 3 | 2017-11-04T05:55:09.000Z | 2017-11-04T11:49:21.000Z | train.py | takahiro-777/tf-dqn-reversi | 35875c593e58b60173c290b0a04544dfa288289f | [
"MIT"
] | null | null | null | import copy
from Reversi import Reversi
from dqn_agent import DQNAgent
if __name__ == "__main__":
# parameters
#n_epochs = 1000
n_epochs = 5
# environment, agent
env = Reversi()
# playerID
playerID = [env.Black, env.White, env.Black]
# player agent
players = []
# player[0]=... | 32.173077 | 110 | 0.443515 | import copy
from Reversi import Reversi
from dqn_agent import DQNAgent
if __name__ == "__main__":
# parameters
#n_epochs = 1000
n_epochs = 5
# environment, agent
env = Reversi()
# playerID
playerID = [env.Black, env.White, env.Black]
# player agent
players = []
# player[0]=... | 0 | 0 | 0 |