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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9d9dad60fb7a4a12ac3627ec22f153d2fd0908f8 | 789 | py | Python | v32_3/app/route/route.py | thangpxph/python_training | e05eceba9b39dd0b23076be1eb3b85dee24fcdaa | [
"MIT"
] | null | null | null | v32_3/app/route/route.py | thangpxph/python_training | e05eceba9b39dd0b23076be1eb3b85dee24fcdaa | [
"MIT"
] | null | null | null | v32_3/app/route/route.py | thangpxph/python_training | e05eceba9b39dd0b23076be1eb3b85dee24fcdaa | [
"MIT"
] | null | null | null | from flask import Blueprint, request as flask_request, jsonify
from cartmigration.libs.utils import *
route_path = Blueprint('route_path', __name__)
@route_path.route("/action/<string:method>", methods = ['post'])
| 30.346154 | 64 | 0.730038 | from flask import Blueprint, request as flask_request, jsonify
from cartmigration.libs.utils import *
route_path = Blueprint('route_path', __name__)
@route_path.route("/action/<string:method>", methods = ['post'])
def action(method):
request_data = flask_request.data
if isinstance(request_data, bytes):
request_d... | 549 | 0 | 22 |
70567d2c43a47fc18436aa805eb67644efa687b1 | 26,350 | py | Python | tensorflow_federated/python/simulation/training_loop_test.py | alessiomora/federated | 3b501067ed7062aaec3cc8830aaec0a7cf8f0942 | [
"Apache-2.0"
] | 1 | 2021-05-10T10:49:34.000Z | 2021-05-10T10:49:34.000Z | tensorflow_federated/python/simulation/training_loop_test.py | alessiomora/federated | 3b501067ed7062aaec3cc8830aaec0a7cf8f0942 | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/simulation/training_loop_test.py | alessiomora/federated | 3b501067ed7062aaec3cc8830aaec0a7cf8f0942 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 46.390845 | 80 | 0.731917 | # Copyright 2021, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 19,538 | 5,551 | 213 |
730fc158f3d29e266101a018adaa55044281c82d | 1,167 | py | Python | src/quart_rate_limiter/redis_store.py | DebugOwO/quart-rate-limiter | cd3cb703f05d983a80d9a78486887af4f3a57e47 | [
"MIT"
] | null | null | null | src/quart_rate_limiter/redis_store.py | DebugOwO/quart-rate-limiter | cd3cb703f05d983a80d9a78486887af4f3a57e47 | [
"MIT"
] | null | null | null | src/quart_rate_limiter/redis_store.py | DebugOwO/quart-rate-limiter | cd3cb703f05d983a80d9a78486887af4f3a57e47 | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import Any, Optional
import aioredis
from .store import RateLimiterStoreABC
class RedisStore(RateLimiterStoreABC):
"""An redis backed store of rate limits.
Arguments:
address: The address of the redis instance.
kwargs: Any keyword arguments to pass ... | 30.710526 | 99 | 0.663239 | from datetime import datetime
from typing import Any, Optional
import aioredis
from .store import RateLimiterStoreABC
class RedisStore(RateLimiterStoreABC):
"""An redis backed store of rate limits.
Arguments:
address: The address of the redis instance.
kwargs: Any keyword arguments to pass ... | 627 | 0 | 135 |
acb41a4176be094274e70012ad8343911c4182ad | 30 | py | Python | src/keyrings/envvars/tests/__init__.py | wwuck/keyrings.envvars | ca8ddf39cd8162d6b5bb51623a8cfd5cbf37b547 | [
"MIT"
] | null | null | null | src/keyrings/envvars/tests/__init__.py | wwuck/keyrings.envvars | ca8ddf39cd8162d6b5bb51623a8cfd5cbf37b547 | [
"MIT"
] | 33 | 2021-11-30T11:43:54.000Z | 2022-01-29T20:05:52.000Z | src/keyrings/envvars/tests/__init__.py | wwuck/keyrings.envvars | ca8ddf39cd8162d6b5bb51623a8cfd5cbf37b547 | [
"MIT"
] | null | null | null | """keyrings.envvars tests."""
| 15 | 29 | 0.666667 | """keyrings.envvars tests."""
| 0 | 0 | 0 |
cf607c0b33f530d85d4a08f867beda70ad09ffa0 | 1,018 | py | Python | python/LogFileEntryTable.py | ferguman/OpenAg-MVP-II | 600ce329f373ef3dc867163cdd09a424b49cd007 | [
"MIT"
] | 2 | 2019-03-18T05:47:55.000Z | 2019-05-30T13:08:13.000Z | python/LogFileEntryTable.py | ferguman/OpenAg-MVP-II | 600ce329f373ef3dc867163cdd09a424b49cd007 | [
"MIT"
] | 14 | 2018-06-27T14:02:23.000Z | 2020-02-16T19:47:43.000Z | python/LogFileEntryTable.py | ferguman/OpenAg-MVP-II | 600ce329f373ef3dc867163cdd09a424b49cd007 | [
"MIT"
] | null | null | null | from time import time
| 39.153846 | 108 | 0.659136 | from time import time
class LogFileEntryTable(object):
#TODO Need to figure out a way to keep the log_entries table from over flowing.
def __init__(self, interval):
self.interval = interval
log_entries = {}
def add_log_entry(self, func, entry_val):
''' This function adds val... | 41 | 932 | 23 |
e075b7a83faeb41e24824072dfdc5caff4bca598 | 130 | py | Python | qproject/__init__.py | KirovVerst/YAQueueProject | d232267f67230dc54223c4b1019b6f66b9f5e249 | [
"MIT"
] | null | null | null | qproject/__init__.py | KirovVerst/YAQueueProject | d232267f67230dc54223c4b1019b6f66b9f5e249 | [
"MIT"
] | null | null | null | qproject/__init__.py | KirovVerst/YAQueueProject | d232267f67230dc54223c4b1019b6f66b9f5e249 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, unicode_literals
from qproject.celery import app as celery_app
__all__ = ['celery_app']
| 21.666667 | 56 | 0.823077 | from __future__ import absolute_import, unicode_literals
from qproject.celery import app as celery_app
__all__ = ['celery_app']
| 0 | 0 | 0 |
8dedf326c8351e9a175aadaaf4e5c00e01f7b8c7 | 3,247 | py | Python | bermuda/tests/test_bbox.py | glue-viz/bermuda | 0bc26bac376d4f08a4964481d1f737f6deb86270 | [
"BSD-3-Clause"
] | 1 | 2018-07-20T21:09:46.000Z | 2018-07-20T21:09:46.000Z | bermuda/tests/test_bbox.py | glue-viz/bermuda | 0bc26bac376d4f08a4964481d1f737f6deb86270 | [
"BSD-3-Clause"
] | null | null | null | bermuda/tests/test_bbox.py | glue-viz/bermuda | 0bc26bac376d4f08a4964481d1f737f6deb86270 | [
"BSD-3-Clause"
] | 1 | 2018-07-20T21:15:41.000Z | 2018-07-20T21:15:41.000Z | from numpy.testing import assert_allclose
import pytest
from ..bbox import AnchorPoint, FrozenError, BBox
| 28.234783 | 85 | 0.540807 | from numpy.testing import assert_allclose
import pytest
from ..bbox import AnchorPoint, FrozenError, BBox
class TestAnchor(object):
def setup_method(self, method):
self.a = AnchorPoint(x=1, y=2)
def test_anchor_init(self):
assert self.a.x == 1
assert self.a.y == 2
as... | 2,462 | 157 | 495 |
f1a4c916269fa93d57546166ac49a6863a3bbc75 | 541 | py | Python | demonstrations/synthesize_data/send_markers.py | stfnrpplngr/rteeg | e73331ef46a269cf0dda1b04333784ce3cf44247 | [
"MIT"
] | 30 | 2017-03-17T02:15:45.000Z | 2022-02-21T06:20:37.000Z | demonstrations/synthesize_data/send_markers.py | stfnrpplngr/rteeg | e73331ef46a269cf0dda1b04333784ce3cf44247 | [
"MIT"
] | 10 | 2016-12-29T21:09:47.000Z | 2017-03-28T18:05:06.000Z | demonstrations/synthesize_data/send_markers.py | stfnrpplngr/rteeg | e73331ef46a269cf0dda1b04333784ce3cf44247 | [
"MIT"
] | 12 | 2017-03-14T07:09:40.000Z | 2021-01-06T06:22:27.000Z | """Example program to demonstrate how to send markers into LSL."""
import random
import time
from pylsl import StreamInfo, StreamOutlet
info = StreamInfo(name='markers', type='Markers', channel_count=1,
channel_format='int32', source_id='markers_test1234')
# next make an outlet
outlet =... | 25.761905 | 72 | 0.674677 | """Example program to demonstrate how to send markers into LSL."""
import random
import time
from pylsl import StreamInfo, StreamOutlet
info = StreamInfo(name='markers', type='Markers', channel_count=1,
channel_format='int32', source_id='markers_test1234')
# next make an outlet
outlet =... | 0 | 0 | 0 |
54f7145a40819c4d3fb5da72f1515717ad7d7027 | 971 | py | Python | models/Iris/score.py | cghat/pipelines-azureml | 296349847f1d151af2e5366dad3b117d8e84ec67 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | models/Iris/score.py | cghat/pipelines-azureml | 296349847f1d151af2e5366dad3b117d8e84ec67 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | models/Iris/score.py | cghat/pipelines-azureml | 296349847f1d151af2e5366dad3b117d8e84ec67 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | import json
import numpy as np
import pickle
from sklearn.linear_model import Ridge
from azureml.core.model import Model
from inference_schema.schema_decorators import input_schema, output_schema
from inference_schema.parameter_types.numpy_parameter_type import NumpyParameterType
from utils import mylib
input_sample... | 27.742857 | 84 | 0.722966 | import json
import numpy as np
import pickle
from sklearn.linear_model import Ridge
from azureml.core.model import Model
from inference_schema.schema_decorators import input_schema, output_schema
from inference_schema.parameter_types.numpy_parameter_type import NumpyParameterType
from utils import mylib
def init():
... | 422 | 0 | 45 |
f5442fda543ea143316e891a5b0389f7115be0b9 | 789 | py | Python | baekjoon/11292.py | GihwanKim/Baekjoon | 52eb2bf80bb1243697858445e5b5e2d50d78be4e | [
"MIT"
] | null | null | null | baekjoon/11292.py | GihwanKim/Baekjoon | 52eb2bf80bb1243697858445e5b5e2d50d78be4e | [
"MIT"
] | null | null | null | baekjoon/11292.py | GihwanKim/Baekjoon | 52eb2bf80bb1243697858445e5b5e2d50d78be4e | [
"MIT"
] | null | null | null | """
11292 : 키 큰 사람
URL : https://www.acmicpc.net/problem/11292
Input :
3
John 1.75
Mary 1.64
Sam 1.81
2
Jose 1.62
Miguel 1.58
5
John 1.75
Mary 1.75
Sam 1.74
Jose 1.75
Miguel 1.75
0
Output :
... | 18.785714 | 47 | 0.474018 | """
11292 : 키 큰 사람
URL : https://www.acmicpc.net/problem/11292
Input :
3
John 1.75
Mary 1.64
Sam 1.81
2
Jose 1.62
Miguel 1.58
5
John 1.75
Mary 1.75
Sam 1.74
Jose 1.75
Miguel 1.75
0
Output :
... | 0 | 0 | 0 |
864726b1c8e9989ced807885a138a4c2e08ae26a | 1,459 | py | Python | dev/local/notebook/core.py | LaurenSpiegel/fastai_docs | 4fe6b62116d88dea9610548133e6cadb6b260a73 | [
"Apache-2.0"
] | null | null | null | dev/local/notebook/core.py | LaurenSpiegel/fastai_docs | 4fe6b62116d88dea9610548133e6cadb6b260a73 | [
"Apache-2.0"
] | null | null | null | dev/local/notebook/core.py | LaurenSpiegel/fastai_docs | 4fe6b62116d88dea9610548133e6cadb6b260a73 | [
"Apache-2.0"
] | null | null | null | #AUTOGENERATED! DO NOT EDIT! File to edit: dev/90_notebook_core.ipynb (unless otherwise specified).
__all__ = ['in_ipython', 'IN_IPYTHON', 'in_colab', 'IN_COLAB', 'in_notebook', 'IN_NOTEBOOK']
from ..imports import *
def in_ipython():
"Check if the code is running in the ipython environment (jupyter including)"
... | 31.717391 | 99 | 0.655243 | #AUTOGENERATED! DO NOT EDIT! File to edit: dev/90_notebook_core.ipynb (unless otherwise specified).
__all__ = ['in_ipython', 'IN_IPYTHON', 'in_colab', 'IN_COLAB', 'in_notebook', 'IN_NOTEBOOK']
from ..imports import *
def in_ipython():
"Check if the code is running in the ipython environment (jupyter including)"
... | 0 | 0 | 0 |
4d127e1cd3fe18cacf11291a387628624ffb1c7b | 5,685 | py | Python | requestsdata.py | saulcosta18/hackvt2016 | c4aa26b71079422ffbb7e15f1dfe41235c93a220 | [
"BSD-3-Clause"
] | null | null | null | requestsdata.py | saulcosta18/hackvt2016 | c4aa26b71079422ffbb7e15f1dfe41235c93a220 | [
"BSD-3-Clause"
] | null | null | null | requestsdata.py | saulcosta18/hackvt2016 | c4aa26b71079422ffbb7e15f1dfe41235c93a220 | [
"BSD-3-Clause"
] | null | null | null | import requests
import random
from hackvt2016.app import create_app
from hackvt2016.resource.models import Resource
from hackvt2016.category.models import Category
def load_seeds():
"""
max longitudes and latitudes:
Coordinates
[5:55]
lat: 42.777 - 44.953
long: (-72.632) - (-73.132)
lat: 44.452 - 4... | 50.758929 | 160 | 0.619173 | import requests
import random
from hackvt2016.app import create_app
from hackvt2016.resource.models import Resource
from hackvt2016.category.models import Category
def main():
create_app().app_context().push()
Resource.query.delete()
load_libraries()
load_seeds()
def load_seeds():
"""
max ... | 833 | 0 | 46 |
d11452d1558b0f5076cec42d82d74dea95d013aa | 3,528 | py | Python | [OPMan]/Seasonals [TV]/2011-4 - Fall/[a8292] Ben-To/BentoBD_NCOP1v01.py | LightArrowsEXE/Encoding-Projects | 4ea96a5b25a7710f615ada5ff25949c496492b53 | [
"MIT"
] | 57 | 2019-01-31T17:32:46.000Z | 2022-03-23T05:46:51.000Z | [OPMan]/Seasonals [TV]/2011-4 - Fall/[a8292] Ben-To/BentoBD_NCOP1v01.py | LightArrowsEXE/Encoding-Projects | 4ea96a5b25a7710f615ada5ff25949c496492b53 | [
"MIT"
] | null | null | null | [OPMan]/Seasonals [TV]/2011-4 - Fall/[a8292] Ben-To/BentoBD_NCOP1v01.py | LightArrowsEXE/Encoding-Projects | 4ea96a5b25a7710f615ada5ff25949c496492b53 | [
"MIT"
] | 12 | 2019-04-30T06:16:13.000Z | 2022-03-14T16:15:07.000Z | import subprocess
from typing import List, Tuple
import vapoursynth as vs
from lvsfunc.misc import source
from lvsfunc.types import Range
from vardautomation import (FSRCNNX_56_16_4_1, JAPANESE, AudioCutter,
AudioStream, BasicTool, FileInfo, FlacEncoder, Mux,
Pre... | 31.5 | 127 | 0.642574 | import subprocess
from typing import List, Tuple
import vapoursynth as vs
from lvsfunc.misc import source
from lvsfunc.types import Range
from vardautomation import (FSRCNNX_56_16_4_1, JAPANESE, AudioCutter,
AudioStream, BasicTool, FileInfo, FlacEncoder, Mux,
Pre... | 1,049 | -6 | 76 |
ee5b6fba5eb91f07b96eece0fb24f71f34b641c3 | 390 | py | Python | ribosome/test/klk/matchers/window.py | tek/ribosome-py | 8bd22e549ddff1ee893d6e3a0bfba123a09e96c6 | [
"MIT"
] | null | null | null | ribosome/test/klk/matchers/window.py | tek/ribosome-py | 8bd22e549ddff1ee893d6e3a0bfba123a09e96c6 | [
"MIT"
] | null | null | null | ribosome/test/klk/matchers/window.py | tek/ribosome-py | 8bd22e549ddff1ee893d6e3a0bfba123a09e96c6 | [
"MIT"
] | null | null | null | from kallikrein import Expectation
from kallikrein.matchers.comparison import eq
from ribosome.test.klk.expectation import await_k_with
from ribosome.nvim.io.compute import NvimIO
from ribosome.nvim.api.ui import current_cursor
__all__ = ('current_cursor_is',)
| 27.857143 | 66 | 0.8 | from kallikrein import Expectation
from kallikrein.matchers.comparison import eq
from ribosome.test.klk.expectation import await_k_with
from ribosome.nvim.io.compute import NvimIO
from ribosome.nvim.api.ui import current_cursor
def current_cursor_is(line: int, col: int) -> NvimIO[Expectation]:
return await_k_wit... | 102 | 0 | 23 |
a2f6168f0742f4589ed364cb98a691fe3a86d64b | 903 | py | Python | Exception Case/304. Range Sum Query 2D - Immutable.py | Into-Y0u/Github-Baby | 5e4e6b02f49c2c99533289be9d49911006cad919 | [
"MIT"
] | null | null | null | Exception Case/304. Range Sum Query 2D - Immutable.py | Into-Y0u/Github-Baby | 5e4e6b02f49c2c99533289be9d49911006cad919 | [
"MIT"
] | null | null | null | Exception Case/304. Range Sum Query 2D - Immutable.py | Into-Y0u/Github-Baby | 5e4e6b02f49c2c99533289be9d49911006cad919 | [
"MIT"
] | null | null | null |
# Your NumMatrix object will be instantiated and called as such:
# obj = NumMatrix(matrix)
# param_1 = obj.sumRegion(row1,col1,row2,col2)
| 30.1 | 75 | 0.528239 | class NumMatrix:
def __init__(self, mat: List[List[int]]):
row = len(mat)
col = len(mat[0])
self.dp = [[0]*(col+1) for _ in range(row+1)]
for i in range(row):
prefix = 0
for j in range(col):
prefix += mat[i][j]
... | 673 | -5 | 77 |
78b02f8a4c005f33a699cb1d5f31e0d92ffae42d | 6,033 | py | Python | tests/test_varma_lingam.py | Koji-Kurihara/lingam | 880561f619d2d185614df4a97b6bc38917f9e901 | [
"MIT"
] | 159 | 2019-08-22T05:17:19.000Z | 2022-03-28T23:41:27.000Z | tests/test_varma_lingam.py | Koji-Kurihara/lingam | 880561f619d2d185614df4a97b6bc38917f9e901 | [
"MIT"
] | 14 | 2020-04-26T17:25:42.000Z | 2022-02-14T08:05:05.000Z | tests/test_varma_lingam.py | Koji-Kurihara/lingam | 880561f619d2d185614df4a97b6bc38917f9e901 | [
"MIT"
] | 27 | 2020-01-19T07:31:08.000Z | 2021-12-26T06:23:35.000Z | import os
import numpy as np
import pandas as pd
from lingam.varma_lingam import VARMALiNGAM
def randnetbalanced(dims, samples, indegree, parminmax, errminmax):
"""
この関数は以前頂いたmatlabのスクリプトを移植したものですのでご確認不要です。
create a more balanced random network
Parameter
---------
dims : int
number o... | 32.262032 | 133 | 0.554119 | import os
import numpy as np
import pandas as pd
from lingam.varma_lingam import VARMALiNGAM
def randnetbalanced(dims, samples, indegree, parminmax, errminmax):
"""
この関数は以前頂いたmatlabのスクリプトを移植したものですのでご確認不要です。
create a more balanced random network
Parameter
---------
dims : int
number o... | 3,226 | 0 | 46 |
76fa268006028c6c1e1382c0093069282b0af4b7 | 2,295 | py | Python | examples/pxScene2d/external/libnode-v6.9.0/tools/comtypes/test/test_outparam.py | madanagopaltcomcast/pxCore | c4a3a40a190521c8b6383d126c87612eca5b3c42 | [
"Apache-2.0"
] | 212 | 2015-01-13T18:24:17.000Z | 2022-03-28T07:52:48.000Z | examples/pxScene2d/external/libnode-v6.9.0/tools/comtypes/test/test_outparam.py | madanagopaltcomcast/pxCore | c4a3a40a190521c8b6383d126c87612eca5b3c42 | [
"Apache-2.0"
] | 1,432 | 2017-06-21T04:08:48.000Z | 2020-08-25T16:21:15.000Z | examples/pxScene2d/external/libnode-v6.9.0/tools/comtypes/test/test_outparam.py | madanagopaltcomcast/pxCore | c4a3a40a190521c8b6383d126c87612eca5b3c42 | [
"Apache-2.0"
] | 317 | 2017-06-20T19:57:17.000Z | 2020-09-16T10:28:30.000Z | from ctypes import *
import unittest
import comtypes.test
comtypes.test.requires("devel")
from comtypes import BSTR, IUnknown, GUID, COMMETHOD, HRESULT
malloc = POINTER(IMalloc)()
oledll.ole32.CoGetMalloc(1, byref(malloc))
assert bool(malloc)
c_wchar_p.__ctypes_from_outparam__ = from_outparm
## print comstri... | 32.785714 | 81 | 0.606536 | from ctypes import *
import unittest
import comtypes.test
comtypes.test.requires("devel")
from comtypes import BSTR, IUnknown, GUID, COMMETHOD, HRESULT
class IMalloc(IUnknown):
_iid_ = GUID("{00000002-0000-0000-C000-000000000046}")
_methods_ = [
COMMETHOD([], c_void_p, "Alloc",
([], ... | 919 | 594 | 117 |
6f4549892c4096edd9c43c705922b69c8f1d0a6c | 2,458 | py | Python | scripts/logreg_multiclass_demo2.py | vipavlovic/pyprobml | 59a2edc682d0163955db5e2f27491ad772b60141 | [
"MIT"
] | 4,895 | 2016-08-17T22:28:34.000Z | 2022-03-31T17:07:15.000Z | scripts/logreg_multiclass_demo2.py | vipavlovic/pyprobml | 59a2edc682d0163955db5e2f27491ad772b60141 | [
"MIT"
] | 446 | 2016-09-17T14:35:29.000Z | 2022-03-31T19:59:33.000Z | scripts/logreg_multiclass_demo2.py | vipavlovic/pyprobml | 59a2edc682d0163955db5e2f27491ad772b60141 | [
"MIT"
] | 1,160 | 2016-08-18T23:19:27.000Z | 2022-03-31T12:44:07.000Z |
# Fit logistic regression models to 3 classs 2d data.
import superimport
import matplotlib.pyplot as plt
import numpy as np
from sklearn.preprocessing import PolynomialFeatures
from scipy.stats import multivariate_normal as mvn
from sklearn.linear_model import LogisticRegression
import matplotlib.colors as mcol
impo... | 30.725 | 127 | 0.615948 |
# Fit logistic regression models to 3 classs 2d data.
import superimport
import matplotlib.pyplot as plt
import numpy as np
from sklearn.preprocessing import PolynomialFeatures
from scipy.stats import multivariate_normal as mvn
from sklearn.linear_model import LogisticRegression
import matplotlib.colors as mcol
impo... | 769 | 0 | 68 |
3dfcfa26b3f03c211f08b2bc132c5c031fdace8e | 568 | py | Python | Sirius/roles.py | VladimirARodionov/sirius | 1c901935c65d7d02cbcf1f172b1f0ebd346bea95 | [
"MIT"
] | 10 | 2018-12-21T13:42:13.000Z | 2022-02-08T20:27:52.000Z | Sirius/roles.py | VladimirARodionov/sirius | 1c901935c65d7d02cbcf1f172b1f0ebd346bea95 | [
"MIT"
] | 14 | 2018-11-23T10:02:14.000Z | 2022-03-11T23:35:02.000Z | Sirius/roles.py | VladimirARodionov/sirius | 1c901935c65d7d02cbcf1f172b1f0ebd346bea95 | [
"MIT"
] | 2 | 2018-11-23T12:29:55.000Z | 2020-07-01T16:33:06.000Z | from rolepermissions.roles import AbstractUserRole
| 15.351351 | 50 | 0.727113 | from rolepermissions.roles import AbstractUserRole
class AdminRole(AbstractUserRole):
available_permissions = {}
class UserRole(AbstractUserRole):
available_permissions = {
}
class EditRole(AbstractUserRole):
available_permissions = {
}
class ReportsRole(AbstractUserRole):
available_perm... | 0 | 348 | 161 |
7756c016ce3496559cfa61adcacf9fdb4304fee4 | 14,346 | py | Python | python/presched.py | lsst/rtn-014 | 773e470c06371fffb3c9844923065a9f0e0e70bf | [
"CC-BY-4.0"
] | null | null | null | python/presched.py | lsst/rtn-014 | 773e470c06371fffb3c9844923065a9f0e0e70bf | [
"CC-BY-4.0"
] | null | null | null | python/presched.py | lsst/rtn-014 | 773e470c06371fffb3c9844923065a9f0e0e70bf | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python
"""Pre-schedule DDF sequences
"""
# pylint: disable=no-member
# imports
import sys
import logging
from argparse import ArgumentParser
import yaml
import numpy as np
import pandas as pd
import astropy.coordinates
import astropy.units as u
import lsst.sims.utils
# constants
# exception classes
... | 33.362791 | 88 | 0.640876 | #!/usr/bin/env python
"""Pre-schedule DDF sequences
"""
# pylint: disable=no-member
# imports
import sys
import logging
from argparse import ArgumentParser
import yaml
import numpy as np
import pandas as pd
import astropy.coordinates
import astropy.units as u
import lsst.sims.utils
# constants
# exception classes
... | 4,567 | 0 | 115 |
4ffb8db0c57128edf137b856b06f93dfc1f283a0 | 8,608 | py | Python | mab/gd/nbody/snapshot.py | maartenbreddels/mab | 112dcfbc4a74b07aff13d489b3776bca58fe9bdf | [
"MIT"
] | 1 | 2018-12-01T04:10:34.000Z | 2018-12-01T04:10:34.000Z | mab/gd/nbody/snapshot.py | maartenbreddels/mab | 112dcfbc4a74b07aff13d489b3776bca58fe9bdf | [
"MIT"
] | null | null | null | mab/gd/nbody/snapshot.py | maartenbreddels/mab | 112dcfbc4a74b07aff13d489b3776bca58fe9bdf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from numpy import *
from mab.binningtools import bingrid, binrange
import mab.gd.logging as logging
logger = logging.getLogger("gd.nbody.gadget")
| 33.364341 | 132 | 0.646027 | # -*- coding: utf-8 -*-
from numpy import *
from mab.binningtools import bingrid, binrange
import mab.gd.logging as logging
logger = logging.getLogger("gd.nbody.gadget")
class Component(object):
def __init__(self, name, q, p, mass, potential=None):
self.name = name
self.q = q
self.p = p
self.mass = mass
... | 7,669 | 53 | 707 |
0f9938e3d277edecec666efae97a653271e989ee | 6,892 | py | Python | chb/arm/ARMFunction.py | orinatic/CodeHawk-Binary | 8b4fd728213e629736d5ece840ea3b43cea53f30 | [
"MIT"
] | null | null | null | chb/arm/ARMFunction.py | orinatic/CodeHawk-Binary | 8b4fd728213e629736d5ece840ea3b43cea53f30 | [
"MIT"
] | null | null | null | chb/arm/ARMFunction.py | orinatic/CodeHawk-Binary | 8b4fd728213e629736d5ece840ea3b43cea53f30 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------
# CodeHawk Binary Analyzer
# Author: Henny Sipma
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2021 Aarno Labs LLC
#
# Permission is hereby granted, free of charg... | 36.465608 | 82 | 0.606065 | # ------------------------------------------------------------------------------
# CodeHawk Binary Analyzer
# Author: Henny Sipma
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2021 Aarno Labs LLC
#
# Permission is hereby granted, free of charg... | 4,218 | 442 | 23 |
6ece77b6e0e3299f441d2801f483c672b6b6feb4 | 9,137 | py | Python | KmeansCluster.py | QuKunLab/RA-OA | 0672bf306a31e2e4295ec7e6d279daf34ba30b91 | [
"BSD-2-Clause"
] | null | null | null | KmeansCluster.py | QuKunLab/RA-OA | 0672bf306a31e2e4295ec7e6d279daf34ba30b91 | [
"BSD-2-Clause"
] | null | null | null | KmeansCluster.py | QuKunLab/RA-OA | 0672bf306a31e2e4295ec7e6d279daf34ba30b91 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
import statsmodels.api as sm
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
from mpl_toolkits.mplot3d import Axes3D
import seaborn as sns
import os
import sys
import scipy.stats
from scipy.stats.mstats import... | 36.257937 | 246 | 0.700887 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
import statsmodels.api as sm
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
from mpl_toolkits.mplot3d import Axes3D
import seaborn as sns
import os
import sys
import scipy.stats
from scipy.stats.mstats import... | 6,615 | 0 | 45 |
53904af3d0ccc22a36392a88bb13320439f920d6 | 515 | py | Python | Versuch5/versuch5/task1.py | Tobias-Schoch/SSS | f8b078ca7f6482fc7c89d5f9e784a549459eefb7 | [
"MIT"
] | null | null | null | Versuch5/versuch5/task1.py | Tobias-Schoch/SSS | f8b078ca7f6482fc7c89d5f9e784a549459eefb7 | [
"MIT"
] | null | null | null | Versuch5/versuch5/task1.py | Tobias-Schoch/SSS | f8b078ca7f6482fc7c89d5f9e784a549459eefb7 | [
"MIT"
] | 1 | 2022-01-06T12:47:53.000Z | 2022-01-06T12:47:53.000Z | import redlab as rl
print("-------einzelneWerte-------------------------")
print("16BitValue:" + str(rl.cbAIn(0, 0, 1)))
print("VoltageValue:" + str(rl.cbVIn(0, 0, 1)))
print("-------Messreihe-------------------------")
print("Messreihe:" + str(rl.cbAInScan(0, 0, 0, 300, 8000, 1)))
print("Messreihe:" + str(rl.cbVInSca... | 42.916667 | 62 | 0.528155 | import redlab as rl
print("-------einzelneWerte-------------------------")
print("16BitValue:" + str(rl.cbAIn(0, 0, 1)))
print("VoltageValue:" + str(rl.cbVIn(0, 0, 1)))
print("-------Messreihe-------------------------")
print("Messreihe:" + str(rl.cbAInScan(0, 0, 0, 300, 8000, 1)))
print("Messreihe:" + str(rl.cbVInSca... | 0 | 0 | 0 |
d95999f3508116ce94aa9c4342d68c3a5e9948c8 | 1,021 | py | Python | foursight_core/stage.py | 4dn-dcic/foursight-core | 2e5ea594d38d04ad58f63ee42e5fb4b920bfb63c | [
"MIT"
] | null | null | null | foursight_core/stage.py | 4dn-dcic/foursight-core | 2e5ea594d38d04ad58f63ee42e5fb4b920bfb63c | [
"MIT"
] | 3 | 2021-08-11T07:09:24.000Z | 2022-02-16T18:58:45.000Z | foursight_core/stage.py | 4dn-dcic/foursight-core | 2e5ea594d38d04ad58f63ee42e5fb4b920bfb63c | [
"MIT"
] | null | null | null | import os
| 26.868421 | 89 | 0.629775 | import os
class Stage(object):
prod_stage_name = 'prod'
def __init__(self, foursight_prefix):
self.prefix = foursight_prefix
@classmethod
def get_stage_from_env_variable(cls):
# set environmental variables in .chalice/config.json
return os.environ.get('chalice_stage', 'dev')... | 745 | 242 | 23 |
c8e80520bc7afbfcc20d06219c5fce1dcc434c47 | 7,628 | py | Python | Groups/Group_ID_3/Resources/dgcca_pckg/dgcca.py | gupta19avaneesh/DataScience | b37fc1208fc47187352b2066dbdca629014d92db | [
"MIT"
] | null | null | null | Groups/Group_ID_3/Resources/dgcca_pckg/dgcca.py | gupta19avaneesh/DataScience | b37fc1208fc47187352b2066dbdca629014d92db | [
"MIT"
] | null | null | null | Groups/Group_ID_3/Resources/dgcca_pckg/dgcca.py | gupta19avaneesh/DataScience | b37fc1208fc47187352b2066dbdca629014d92db | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""DGCCA.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/15L_7jxf0KH81UjAO6waIbQso1nqML0kD
# Deep Generalized Cannonical Correlation Analysis Implementaion for 3 views
cca-zoo package is used for the implemntaion of gcca ... | 37.950249 | 300 | 0.62795 | # -*- coding: utf-8 -*-
"""DGCCA.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/15L_7jxf0KH81UjAO6waIbQso1nqML0kD
# Deep Generalized Cannonical Correlation Analysis Implementaion for 3 views
cca-zoo package is used for the implemntaion of gcca ... | 4,538 | 33 | 274 |
50d399aabd96ba4e8fc399b405e8d3519c4ea599 | 1,016 | py | Python | Calibration/HcalIsolatedTrackReco/python/isolPixelTrackProdL1T_cfi.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | Calibration/HcalIsolatedTrackReco/python/isolPixelTrackProdL1T_cfi.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | Calibration/HcalIsolatedTrackReco/python/isolPixelTrackProdL1T_cfi.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | import FWCore.ParameterSet.Config as cms
#IsolatedPixelTrackCandidateProducer default configuration
isolPixelTrackProd = cms.EDProducer("IsolatedPixelTrackCandidateL1TProducer",
L1eTauJetsSource = cms.InputTag( 'hltGtStage2Digis','Tau' ),
tauAssociationCone = cms.double( 0.0 ),
tauUnbi... | 46.181818 | 80 | 0.629921 | import FWCore.ParameterSet.Config as cms
#IsolatedPixelTrackCandidateProducer default configuration
isolPixelTrackProd = cms.EDProducer("IsolatedPixelTrackCandidateL1TProducer",
L1eTauJetsSource = cms.InputTag( 'hltGtStage2Digis','Tau' ),
tauAssociationCone = cms.double( 0.0 ),
tauUnbi... | 0 | 0 | 0 |
509f3b7436d7a1154fae2d44583752b3127e2a1d | 3,406 | py | Python | tools/utilities/pythonlibs/procmon.py | awf/ELL | 25c94a1422efc41d5560db11b136f9d8f957ad41 | [
"MIT"
] | 2,094 | 2016-09-28T05:55:24.000Z | 2019-05-04T19:06:36.000Z | tools/utilities/pythonlibs/procmon.py | awesomemachinelearning/ELL | cb897e3aec148a1e9bd648012b5f53ab9d0dd20c | [
"MIT"
] | 213 | 2017-06-30T12:53:40.000Z | 2019-05-03T06:35:38.000Z | tools/utilities/pythonlibs/procmon.py | awesomemachinelearning/ELL | cb897e3aec148a1e9bd648012b5f53ab9d0dd20c | [
"MIT"
] | 301 | 2017-03-24T08:40:00.000Z | 2019-05-02T21:22:28.000Z | #!/usr/bin/env python3
####################################################################################################
#
# Project: Embedded Learning Library (ELL)
# File: procmon.py
# Authors: Lisa Ong
#
# Requires: Python 3.4+, psutil (pip install psutil)
#
#############################################... | 36.623656 | 110 | 0.576629 | #!/usr/bin/env python3
####################################################################################################
#
# Project: Embedded Learning Library (ELL)
# File: procmon.py
# Authors: Lisa Ong
#
# Requires: Python 3.4+, psutil (pip install psutil)
#
#############################################... | 1,040 | 1,402 | 23 |
a67a765a9a4713271e8e62411009037eac7253b5 | 2,047 | py | Python | chapter5/logistic_regression_tf.py | arifmudi/Python-Machine-Learning-By-Example-Third-Edition | 7bdc45df2b519e3c0a929b03f0ac6fe30e028382 | [
"MIT"
] | 49 | 2020-03-21T08:37:46.000Z | 2022-02-01T12:48:23.000Z | chapter5/logistic_regression_tf.py | hmoharrer/Python-Machine-Learning-By-Example-Third-Edition | 7bdc45df2b519e3c0a929b03f0ac6fe30e028382 | [
"MIT"
] | 2 | 2021-03-28T17:25:57.000Z | 2021-04-05T18:14:55.000Z | chapter5/logistic_regression_tf.py | hmoharrer/Python-Machine-Learning-By-Example-Third-Edition | 7bdc45df2b519e3c0a929b03f0ac6fe30e028382 | [
"MIT"
] | 40 | 2020-05-02T18:30:00.000Z | 2022-02-27T09:15:16.000Z | '''
Source codes for Python Machine Learning By Example 3rd Edition (Packt Publishing)
Chapter 5 Predicting Online Ads Click-through with Logistic Regression
Author: Yuxi (Hayden) Liu (yuxi.liu.ece@gmail.com)
'''
import tensorflow as tf
import pandas as pd
n_rows = 300000
df = pd.read_csv("train", nrows=n_rows)
X = ... | 32.492063 | 101 | 0.713727 | '''
Source codes for Python Machine Learning By Example 3rd Edition (Packt Publishing)
Chapter 5 Predicting Online Ads Click-through with Logistic Regression
Author: Yuxi (Hayden) Liu (yuxi.liu.ece@gmail.com)
'''
import tensorflow as tf
import pandas as pd
n_rows = 300000
df = pd.read_csv("train", nrows=n_rows)
X = ... | 280 | 0 | 23 |
7afcc3bdf1870a247dc1c1d0dbd2c4cb23972b11 | 1,243 | py | Python | zipline/research/utils.py | zhangshoug/czipline | 6bce0abd4772443547f44669c0adb2b5c63f64db | [
"Apache-2.0"
] | 9 | 2019-05-18T10:44:48.000Z | 2022-01-01T15:12:49.000Z | zipline/research/utils.py | yuanyichuangzhi/czipline | 6bce0abd4772443547f44669c0adb2b5c63f64db | [
"Apache-2.0"
] | null | null | null | zipline/research/utils.py | yuanyichuangzhi/czipline | 6bce0abd4772443547f44669c0adb2b5c63f64db | [
"Apache-2.0"
] | 10 | 2019-05-18T10:58:55.000Z | 2022-03-24T13:37:17.000Z | """
辅助函数
"""
from cswd.common.utils import ensure_list
from .core import symbols, to_tdates
def select_output_by(output, start=None, end=None, assets=None):
"""
按时间及代码选择`pipeline`输出数据框
专用于研究环境下的run_pipeline输出结果分析
参数
----
output : MultiIndex DataFrame
pipeline输出结果
start : str... | 25.367347 | 90 | 0.552695 | """
辅助函数
"""
from cswd.common.utils import ensure_list
from .core import symbols, to_tdates
def select_output_by(output, start=None, end=None, assets=None):
"""
按时间及代码选择`pipeline`输出数据框
专用于研究环境下的run_pipeline输出结果分析
参数
----
output : MultiIndex DataFrame
pipeline输出结果
start : str... | 0 | 0 | 0 |
c9b3342238ce0d993691b8b895b75a947e901c00 | 3,162 | py | Python | utils/data/processing/cityscapes.py | m-zayan/deeplearning_utils | cc40636f46d13a81cb1020fdcfae84e52456fa06 | [
"MIT"
] | null | null | null | utils/data/processing/cityscapes.py | m-zayan/deeplearning_utils | cc40636f46d13a81cb1020fdcfae84e52456fa06 | [
"MIT"
] | null | null | null | utils/data/processing/cityscapes.py | m-zayan/deeplearning_utils | cc40636f46d13a81cb1020fdcfae84e52456fa06 | [
"MIT"
] | null | null | null | from typing import Callable, Dict, Any
import numpy as np
from . import _abstract
from ...ops.reshape import aligned_with
| 18.172414 | 94 | 0.529096 | from typing import Callable, Dict, Any
import numpy as np
from . import _abstract
from ...ops.reshape import aligned_with
def __np_as_type__(dtype):
def to_nbits(func: Callable):
def inner(*args, **kwargs) -> np.ndarray:
return func(*args, **kwargs).astype(dtype)
return inner
... | 2,612 | 353 | 69 |
0704bd67d154c320c0f8e0d4454e9c628972c408 | 2,068 | py | Python | NodeGraphQt/widgets/actions.py | uclatommy/NodeGraphQt | aaf09fa6e7cd0745218e6039ee2befdab117daec | [
"MIT"
] | 582 | 2018-03-04T10:25:32.000Z | 2022-03-31T06:41:17.000Z | NodeGraphQt/widgets/actions.py | zhollosy/NodeGraphQt | c2ad7ce3ee31e348207f18636571bcb53ac8f5b9 | [
"MIT"
] | 156 | 2018-03-03T21:41:36.000Z | 2022-03-29T02:14:42.000Z | NodeGraphQt/widgets/actions.py | zhollosy/NodeGraphQt | c2ad7ce3ee31e348207f18636571bcb53ac8f5b9 | [
"MIT"
] | 160 | 2018-03-09T10:29:42.000Z | 2022-03-31T06:41:23.000Z | #!/usr/bin/python
from Qt import QtCore, QtWidgets
from .stylesheet import STYLE_QMENU
# disable for issue #142
# def hideEvent(self, event):
# super(BaseMenu, self).hideEvent(event)
# for a in self.actions():
# if hasattr(a, 'node_id'):
# a.node_id = None
| 28.722222 | 59 | 0.587524 | #!/usr/bin/python
from Qt import QtCore, QtWidgets
from .stylesheet import STYLE_QMENU
class BaseMenu(QtWidgets.QMenu):
def __init__(self, *args, **kwargs):
super(BaseMenu, self).__init__(*args, **kwargs)
self.setStyleSheet(STYLE_QMENU)
self.node_class = None
self.graph = None
... | 1,350 | 255 | 150 |
18f3fbdbd98aa3ec3c80b36171574776f4dfd9c4 | 1,270 | py | Python | src/common/status.py | cchienhao/data_collector | 89546e6445f51ce29197c2bdc508d495a100ffb0 | [
"Apache-2.0"
] | 1 | 2016-02-05T06:54:15.000Z | 2016-02-05T06:54:15.000Z | src/common/status.py | cchienhao/data_collector | 89546e6445f51ce29197c2bdc508d495a100ffb0 | [
"Apache-2.0"
] | null | null | null | src/common/status.py | cchienhao/data_collector | 89546e6445f51ce29197c2bdc508d495a100ffb0 | [
"Apache-2.0"
] | null | null | null | '''
Created on Aug 29 2015
@author: kevin.chien@94301.ca
'''
# server info status code
OK = FlamesStatus(0, 'common.ok', 'OK.')
# server error status code
UNEXPECTED_EXCEPTION = FlamesStatus(1000001, 'common.unexpected_exception', 'Unknown Error.')
UNKNOWN_RESOURCE = FlamesStatus(1000002, 'common.unknown_res... | 36.285714 | 115 | 0.687402 | '''
Created on Aug 29 2015
@author: kevin.chien@94301.ca
'''
class FlamesStatus(object):
def __init__(self, code, key, message):
self.code = code
self.key = key
self.message = message
def __eq__(self, other):
if isinstance(other, FlamesStatus):
return other.code == ... | 258 | 6 | 106 |
9bfb88480b31160b32d5aff1097a83c3f22006d7 | 3,125 | py | Python | tests/unittests/pytorch_lightning/test_prepare.py | lf1-io/padl-extensions | f82c9591e07e30d770ea8ec4ae411d9b4838ac0a | [
"Apache-2.0"
] | 1 | 2022-03-15T14:16:01.000Z | 2022-03-15T14:16:01.000Z | tests/unittests/pytorch_lightning/test_prepare.py | lf1-io/padl-extensions | f82c9591e07e30d770ea8ec4ae411d9b4838ac0a | [
"Apache-2.0"
] | 4 | 2022-03-07T13:54:01.000Z | 2022-03-09T08:48:19.000Z | tests/unittests/pytorch_lightning/test_prepare.py | lf1-io/padl-extensions | f82c9591e07e30d770ea8ec4ae411d9b4838ac0a | [
"Apache-2.0"
] | null | null | null | import pytest
import torch
import tempfile
import shutil
import os
from tests.material import utils
import padl
from padl import transform, identity, batch
from padl_ext.pytorch_lightning.prepare import LightningModule
try:
import pytorch_lightning as pl
from pytorch_lightning.callbacks import ModelCheckpoin... | 32.552083 | 89 | 0.67872 | import pytest
import torch
import tempfile
import shutil
import os
from tests.material import utils
import padl
from padl import transform, identity, batch
from padl_ext.pytorch_lightning.prepare import LightningModule
try:
import pytorch_lightning as pl
from pytorch_lightning.callbacks import ModelCheckpoin... | 2,136 | 171 | 243 |
a8240d96ece80865b53b5757db01662c80a211d1 | 1,314 | py | Python | pyAnaf/console.py | agilegeeks/pyAnaf | 764f7d8fb300135a3d98559b953e3ca2a4507216 | [
"MIT"
] | null | null | null | pyAnaf/console.py | agilegeeks/pyAnaf | 764f7d8fb300135a3d98559b953e3ca2a4507216 | [
"MIT"
] | null | null | null | pyAnaf/console.py | agilegeeks/pyAnaf | 764f7d8fb300135a3d98559b953e3ca2a4507216 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import print_function
import sys
import os
import datetime
import pprint
try:
from pyAnaf.api import Anaf
except:
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from pyAnaf.api import Anaf
if __name__ == '__main__':
main()
| 21.540984 | 86 | 0.614916 | # coding: utf-8
from __future__ import print_function
import sys
import os
import datetime
import pprint
try:
from pyAnaf.api import Anaf
except:
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from pyAnaf.api import Anaf
class MyPrettyPrinter(pprint.PrettyPrinter):
... | 884 | 23 | 95 |
c0ac5e48f23ca1dfac72643fbf846a6c9a2d0143 | 3,837 | py | Python | binary_validation.py | jorgessanchez7/Global_Forecast_Validation | d3178acaa2a67801e832554a3f871b36c266fe3a | [
"MIT"
] | null | null | null | binary_validation.py | jorgessanchez7/Global_Forecast_Validation | d3178acaa2a67801e832554a3f871b36c266fe3a | [
"MIT"
] | null | null | null | binary_validation.py | jorgessanchez7/Global_Forecast_Validation | d3178acaa2a67801e832554a3f871b36c266fe3a | [
"MIT"
] | null | null | null | import pandas as pd
df = pd.read_csv('/Users/student/Dropbox/PhD/2019 Summer/Dissertation_v7/Colombia/Stations_Selected_Colombia_RT.csv')
IDs = df['Codigo'].tolist()
COMIDs = df['COMID'].tolist()
Names = df['Nombre'].tolist()
Rivers = df['Corriente'].tolist()
'''Get Historical Observed Water Levels'''
observed_wl_d... | 44.103448 | 192 | 0.765181 | import pandas as pd
df = pd.read_csv('/Users/student/Dropbox/PhD/2019 Summer/Dissertation_v7/Colombia/Stations_Selected_Colombia_RT.csv')
IDs = df['Codigo'].tolist()
COMIDs = df['COMID'].tolist()
Names = df['Nombre'].tolist()
Rivers = df['Corriente'].tolist()
'''Get Historical Observed Water Levels'''
observed_wl_d... | 0 | 0 | 0 |
cde94d9729ccd961b34eeaae00dfaa61f34100e7 | 484 | py | Python | solutions/python3/366.py | sm2774us/amazon_interview_prep_2021 | f580080e4a6b712b0b295bb429bf676eb15668de | [
"MIT"
] | 42 | 2020-08-02T07:03:49.000Z | 2022-03-26T07:50:15.000Z | solutions/python3/366.py | ajayv13/leetcode | de02576a9503be6054816b7444ccadcc0c31c59d | [
"MIT"
] | null | null | null | solutions/python3/366.py | ajayv13/leetcode | de02576a9503be6054816b7444ccadcc0c31c59d | [
"MIT"
] | 40 | 2020-02-08T02:50:24.000Z | 2022-03-26T15:38:10.000Z | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None | 26.888889 | 56 | 0.508264 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def findLeaves(self, root):
res = []
def dfs(node):
if not node: return -1
i = max(dfs(node.left)... | 280 | -6 | 49 |
803db500d5206ea38a29770ec6d7410e96768f5b | 15,094 | py | Python | data_loader.py | AnticPan/Hierarchical-GEC | c657ed21be6c01209d0e03e8e742365c26550947 | [
"MIT"
] | 1 | 2021-08-24T06:06:38.000Z | 2021-08-24T06:06:38.000Z | data_loader.py | AnticPan/Hierarchical-GEC | c657ed21be6c01209d0e03e8e742365c26550947 | [
"MIT"
] | null | null | null | data_loader.py | AnticPan/Hierarchical-GEC | c657ed21be6c01209d0e03e8e742365c26550947 | [
"MIT"
] | null | null | null | import random
import time
import numpy as np
import os
import difflib
import torch
from utils.structure import Example, Batch, Patch, lists2tensor, Token, BIO
from utils.tokenizer import Tokenizer
from typing import List, Union
from tqdm import tqdm
from collections import Counter
import Levenshtein
import math
import ... | 46.443077 | 112 | 0.567908 | import random
import time
import numpy as np
import os
import difflib
import torch
from utils.structure import Example, Batch, Patch, lists2tensor, Token, BIO
from utils.tokenizer import Tokenizer
from typing import List, Union
from tqdm import tqdm
from collections import Counter
import Levenshtein
import math
import ... | 14,461 | 216 | 92 |
f431633ee4462edfe7c7f4f450d9d0fb74a2ba86 | 372 | py | Python | game/drawing/background.py | samer25/Game-Tank | fa5b63f6b224e56205ab75b8aefcf557405e1ffe | [
"MIT"
] | null | null | null | game/drawing/background.py | samer25/Game-Tank | fa5b63f6b224e56205ab75b8aefcf557405e1ffe | [
"MIT"
] | 1 | 2020-04-13T21:04:46.000Z | 2020-04-13T22:17:12.000Z | game/drawing/background.py | samer25/Game-Tank | fa5b63f6b224e56205ab75b8aefcf557405e1ffe | [
"MIT"
] | null | null | null | from main_dir.drawing.background_loads import BackgroundLoads
"""getting the screen and setting background """
class BackGround:
"""taking the image"""
view_background = BackgroundLoads().load_and_move()
def redraw_game_window(self, screen):
"""setting background in the screen at position x y""... | 28.615385 | 62 | 0.715054 | from main_dir.drawing.background_loads import BackgroundLoads
"""getting the screen and setting background """
class BackGround:
"""taking the image"""
view_background = BackgroundLoads().load_and_move()
def redraw_game_window(self, screen):
"""setting background in the screen at position x y""... | 0 | 0 | 0 |
81315fed9dd12dbca559c8e90236ab5b3cad7118 | 3,011 | py | Python | yellowbrick/utils/decorators.py | souravsingh/yellowbrick | a5941a6c47fbe5264f3622bc15276ba618bbe1d0 | [
"Apache-2.0"
] | 20 | 2018-03-24T02:29:20.000Z | 2022-03-03T05:01:40.000Z | yellowbrick/utils/decorators.py | souravsingh/yellowbrick | a5941a6c47fbe5264f3622bc15276ba618bbe1d0 | [
"Apache-2.0"
] | 4 | 2018-03-20T12:01:17.000Z | 2019-04-07T16:02:19.000Z | yellowbrick/utils/decorators.py | souravsingh/yellowbrick | a5941a6c47fbe5264f3622bc15276ba618bbe1d0 | [
"Apache-2.0"
] | 5 | 2018-03-17T08:18:57.000Z | 2019-11-15T02:20:20.000Z | # yellowbrick.utils.decorators
# Decorators and descriptors for annotating yellowbrick library functions.
#
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>
# Created: Thu May 18 15:13:33 2017 -0400
#
# Copyright (C) 2017 District Data Labs
# For license information, see LICENSE.txt
#
# ID: decorators.py... | 31.041237 | 92 | 0.608436 | # yellowbrick.utils.decorators
# Decorators and descriptors for annotating yellowbrick library functions.
#
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>
# Created: Thu May 18 15:13:33 2017 -0400
#
# Copyright (C) 2017 District Data Labs
# For license information, see LICENSE.txt
#
# ID: decorators.py... | 133 | 0 | 26 |
47aea7edbb1624ac0e6d24aad6bfb86d4c710c29 | 1,169 | py | Python | manage.py | AymanKandil/OHAS | 1f19a790a8e8c6a864c0dcb75cf127f591121d3b | [
"MIT"
] | null | null | null | manage.py | AymanKandil/OHAS | 1f19a790a8e8c6a864c0dcb75cf127f591121d3b | [
"MIT"
] | null | null | null | manage.py | AymanKandil/OHAS | 1f19a790a8e8c6a864c0dcb75cf127f591121d3b | [
"MIT"
] | null | null | null | import argparse
from werkzeug.security import generate_password_hash
import secrets
import string
from modules.Auth.auth import auth
from modules.Auth.user_db import UserDatabase
from app import app
main()
| 29.974359 | 86 | 0.640719 | import argparse
from werkzeug.security import generate_password_hash
import secrets
import string
from modules.Auth.auth import auth
from modules.Auth.user_db import UserDatabase
from app import app
def main():
parser = argparse.ArgumentParser(description="Archive posters from impawards.com")
parser.add_argum... | 938 | 0 | 23 |
6d7e33ce60a96fcf9572c9733c365e3a8e958a32 | 12,085 | py | Python | version/database/db.py | rabaarabaa/happypanda | e35fe4b32ea4fd5f373f226c4d6026e0d6d11e80 | [
"Apache-2.0"
] | null | null | null | version/database/db.py | rabaarabaa/happypanda | e35fe4b32ea4fd5f373f226c4d6026e0d6d11e80 | [
"Apache-2.0"
] | 4 | 2020-11-10T01:43:50.000Z | 2021-01-14T21:14:38.000Z | version/database/db.py | rabaarabaa/happypanda | e35fe4b32ea4fd5f373f226c4d6026e0d6d11e80 | [
"Apache-2.0"
] | null | null | null | # """
# This file is part of Happypanda.
# Happypanda is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# any later version.
# Happypanda is distributed in the hope that it wi... | 31.146907 | 112 | 0.629458 | # """
# This file is part of Happypanda.
# Happypanda is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# any later version.
# Happypanda is distributed in the hope that it wi... | 5,093 | 0 | 361 |
ed614a563d311fbd9e62fbe065c720a65f267c7e | 2,788 | py | Python | DestroyerIGN/captchaServer.py | Ravenclaw-OIer/ISML_auto_voter | 9c53bd87530697d374163f571186542c3fc9734b | [
"MIT"
] | 128 | 2020-11-16T09:28:17.000Z | 2022-03-14T10:38:52.000Z | DestroyerIGN/captchaServer.py | Ravenclaw-OIer/ISML_auto_voter | 9c53bd87530697d374163f571186542c3fc9734b | [
"MIT"
] | 7 | 2020-11-27T14:45:19.000Z | 2022-02-15T09:47:12.000Z | DestroyerIGN/captchaServer.py | Ravenclaw-OIer/ISML_auto_voter | 9c53bd87530697d374163f571186542c3fc9734b | [
"MIT"
] | 11 | 2020-12-11T12:24:38.000Z | 2022-02-20T12:42:31.000Z | #coding:utf-8
portList=(8888,8889)#本服务器监听端口
import tornado.ioloop
import tornado.web
import numpy as np
from time import sleep
#import shutil
#import os
from random import random
from io import BytesIO
from PIL import Image
from base64 import b64decode
import utils
model = utils.loadmodel('Model.json', ... | 31.325843 | 79 | 0.581062 | #coding:utf-8
portList=(8888,8889)#本服务器监听端口
import tornado.ioloop
import tornado.web
import numpy as np
from time import sleep
#import shutil
#import os
from random import random
from io import BytesIO
from PIL import Image
from base64 import b64decode
import utils
model = utils.loadmodel('Model.json', ... | 1,790 | 25 | 129 |
07acdd890b5325633a96917335e808b0db43398b | 2,344 | py | Python | Emall/base_api.py | syz247179876/e_mall | f94e39e091e098242342f532ae371b8ff127542f | [
"Apache-2.0"
] | 7 | 2021-04-10T13:20:56.000Z | 2022-03-29T15:00:29.000Z | Emall/base_api.py | syz247179876/E_mall | f94e39e091e098242342f532ae371b8ff127542f | [
"Apache-2.0"
] | 9 | 2021-05-11T03:53:31.000Z | 2022-03-12T00:58:03.000Z | Emall/base_api.py | syz247179876/E_mall | f94e39e091e098242342f532ae371b8ff127542f | [
"Apache-2.0"
] | 2 | 2020-11-24T08:59:22.000Z | 2020-11-24T14:10:59.000Z | # -*- coding: utf-8 -*-
# @Time : 2020/11/21 上午11:27
# @Author : 司云中
# @File : base_api.py
# @Software: Pycharm
"""
通用API共享函数
"""
from rest_framework import status
from rest_framework.response import Response
from rest_framework.generics import GenericAPIView
from Emall.exceptions import SqlServerError
from Emall.re... | 30.441558 | 98 | 0.65273 | # -*- coding: utf-8 -*-
# @Time : 2020/11/21 上午11:27
# @Author : 司云中
# @File : base_api.py
# @Software: Pycharm
"""
通用API共享函数
"""
from rest_framework import status
from rest_framework.response import Response
from rest_framework.generics import GenericAPIView
from Emall.exceptions import SqlServerError
from Emall.re... | 263 | 0 | 54 |
0c04a654f297ea6cc5bad97d952631d9da83c061 | 2,532 | py | Python | commands/slowmode.py | edazpotato/bot | e2d7742b9432ea49552d2b73aed040330b1b3b0b | [
"MIT"
] | null | null | null | commands/slowmode.py | edazpotato/bot | e2d7742b9432ea49552d2b73aed040330b1b3b0b | [
"MIT"
] | null | null | null | commands/slowmode.py | edazpotato/bot | e2d7742b9432ea49552d2b73aed040330b1b3b0b | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2020 GamingGeek
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, dis... | 43.655172 | 133 | 0.697867 | """
MIT License
Copyright (c) 2020 GamingGeek
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, dis... | 1,180 | 100 | 46 |
f408d2dd962ede10ebbdcaff4c81acd93a0057e9 | 8,155 | py | Python | mamba/FastSubdirData.py | dmaljovec/mamba | 599c2820086b5d69df8c73a98b2a4acf5dffe0df | [
"BSD-3-Clause"
] | null | null | null | mamba/FastSubdirData.py | dmaljovec/mamba | 599c2820086b5d69df8c73a98b2a4acf5dffe0df | [
"BSD-3-Clause"
] | null | null | null | mamba/FastSubdirData.py | dmaljovec/mamba | 599c2820086b5d69df8c73a98b2a4acf5dffe0df | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function, unicode_literals
import bz2
import sys, os
from collections import defaultdict
from contextlib import closing
from errno import EACCES, ENODEV, EPERM
from... | 39.396135 | 104 | 0.638872 | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function, unicode_literals
import bz2
import sys, os
from collections import defaultdict
from contextlib import closing
from errno import EACCES, ENODEV, EPERM
from... | 5,570 | 357 | 72 |
1cdd6ff900ddffaaf978064ae475159f69ceb0b1 | 14,328 | py | Python | webenmr/controllers/xplor.py | andreagia/WEBNMR | 512a8cc04cf69300796585feae722614501389a9 | [
"Apache-2.0"
] | null | null | null | webenmr/controllers/xplor.py | andreagia/WEBNMR | 512a8cc04cf69300796585feae722614501389a9 | [
"Apache-2.0"
] | null | null | null | webenmr/controllers/xplor.py | andreagia/WEBNMR | 512a8cc04cf69300796585feae722614501389a9 | [
"Apache-2.0"
] | null | null | null | from lxml import etree
import logging
import random
import os
import shutil
import types, cgi
from pylons import config
from pylons import request, response, session, tmpl_context as c, url
from pylons.controllers.util import abort, redirect
from webenmr.model import Projects, Calculations, Jobs, CalculationTipology, U... | 43.418182 | 165 | 0.542155 | from lxml import etree
import logging
import random
import os
import shutil
import types, cgi
from pylons import config
from pylons import request, response, session, tmpl_context as c, url
from pylons.controllers.util import abort, redirect
from webenmr.model import Projects, Calculations, Jobs, CalculationTipology, U... | 13,386 | 17 | 310 |
9c5a68a883a88ef8d7d76077b1df4d21455cf9d3 | 1,633 | py | Python | lib/galaxy/model/migrate/versions/0135_add_library_tags.py | yvanlebras/galaxy | 6b8489ca866825bcdf033523120a8b24ea6e6342 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/model/migrate/versions/0135_add_library_tags.py | yvanlebras/galaxy | 6b8489ca866825bcdf033523120a8b24ea6e6342 | [
"CC-BY-3.0"
] | 2 | 2017-05-18T16:12:55.000Z | 2022-03-08T12:08:43.000Z | lib/galaxy/model/migrate/versions/0135_add_library_tags.py | yvanlebras/galaxy | 6b8489ca866825bcdf033523120a8b24ea6e6342 | [
"CC-BY-3.0"
] | null | null | null | """
This migration script adds support for storing tags in the context of a dataset in a library
"""
import logging
from sqlalchemy import (
Column,
ForeignKey,
Integer,
MetaData,
Table,
)
# Need our custom types, but don't import anything else from model
from galaxy.model.custom_types import Tri... | 27.677966 | 92 | 0.73117 | """
This migration script adds support for storing tags in the context of a dataset in a library
"""
import logging
from sqlalchemy import (
Column,
ForeignKey,
Integer,
MetaData,
Table,
)
# Need our custom types, but don't import anything else from model
from galaxy.model.custom_types import Tri... | 537 | 0 | 46 |
621bf6e7e7084f4fb8c71412d057f29ec2921329 | 7,780 | py | Python | tests/testactions.py | HeliumEdu/helium-cli | 926018a09b3e868a894a32295fdfcb2d134c9d41 | [
"MIT"
] | 2 | 2019-01-23T19:08:37.000Z | 2021-05-27T23:25:48.000Z | tests/testactions.py | HeliumEdu/helium-cli | 926018a09b3e868a894a32295fdfcb2d134c9d41 | [
"MIT"
] | 17 | 2018-04-20T14:45:29.000Z | 2020-03-16T19:03:31.000Z | tests/testactions.py | HeliumEdu/helium-cli | 926018a09b3e868a894a32295fdfcb2d134c9d41 | [
"MIT"
] | 2 | 2018-05-04T21:50:29.000Z | 2018-06-01T19:29:13.000Z | import os
from unittest import mock
from heliumcli import utils, settings
from heliumcli.main import main
from tests.helpers.commonhelper import given_config_exists
from .helpers import testcase, commonhelper
__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Helium Edu"
__version__ = "1.6.0"
| 39.492386 | 115 | 0.64473 | import os
from unittest import mock
from heliumcli import utils, settings
from heliumcli.main import main
from tests.helpers.commonhelper import given_config_exists
from .helpers import testcase, commonhelper
__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Helium Edu"
__version__ = "1.6.0"
class TestActi... | 6,936 | 516 | 23 |
69cac34efbadf6fd73233a4b23e60acd1487b619 | 168 | py | Python | tests/test_bi.py | kvh/dags-bi | 2e0877b19fb0738ba384b798ad1c5c33c4b3111e | [
"BSD-3-Clause"
] | 1 | 2020-12-22T23:22:10.000Z | 2020-12-22T23:22:10.000Z | tests/test_bi.py | kvh/dags-bi | 2e0877b19fb0738ba384b798ad1c5c33c4b3111e | [
"BSD-3-Clause"
] | null | null | null | tests/test_bi.py | kvh/dags-bi | 2e0877b19fb0738ba384b798ad1c5c33c4b3111e | [
"BSD-3-Clause"
] | 1 | 2021-07-11T10:07:16.000Z | 2021-07-11T10:07:16.000Z | from loguru import logger
logger.enable("snapflow")
if __name__ == "__main__":
test()
| 12 | 40 | 0.672619 | from loguru import logger
logger.enable("snapflow")
def test():
from snapflow_bi import module as bi
bi.run_tests()
if __name__ == "__main__":
test()
| 51 | 0 | 23 |
3ca576d08c7f3e8c7d9ea7df90eeae962a62ad25 | 3,045 | py | Python | ixian_docker/modules/docker/utils/client.py | kreneskyp/ixian-docker | ce7a6cee2f961b8446dc3d9429a809ab5a235467 | [
"Apache-2.0"
] | null | null | null | ixian_docker/modules/docker/utils/client.py | kreneskyp/ixian-docker | ce7a6cee2f961b8446dc3d9429a809ab5a235467 | [
"Apache-2.0"
] | null | null | null | ixian_docker/modules/docker/utils/client.py | kreneskyp/ixian-docker | ce7a6cee2f961b8446dc3d9429a809ab5a235467 | [
"Apache-2.0"
] | null | null | null | # Copyright [2018-2020] Peter Krenesky
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 29 | 94 | 0.663054 | # Copyright [2018-2020] Peter Krenesky
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 1,798 | 232 | 69 |
5ebe2bc6d18e0027e8dc40e731b3338063ebca8f | 1,011 | py | Python | api/routers.py | V-Holodov/pets_accounting | 300cb8748124b6f767e85404ee372b93b097098c | [
"MIT"
] | null | null | null | api/routers.py | V-Holodov/pets_accounting | 300cb8748124b6f767e85404ee372b93b097098c | [
"MIT"
] | 1 | 2021-12-22T14:08:37.000Z | 2021-12-22T14:08:37.000Z | api/routers.py | V-Holodov/pets_accounting | 300cb8748124b6f767e85404ee372b93b097098c | [
"MIT"
] | 1 | 2021-12-24T11:50:26.000Z | 2021-12-24T11:50:26.000Z | from rest_framework.routers import DefaultRouter, DynamicRoute, Route
class CustomBulkDeleteRouter(DefaultRouter):
"""
A custom URL router for the Product API that correctly routes
DELETE requests with multiple query parameters.
"""
routes = [
Route(
url=r"^{prefix}$",
... | 28.083333 | 75 | 0.485658 | from rest_framework.routers import DefaultRouter, DynamicRoute, Route
class CustomBulkDeleteRouter(DefaultRouter):
"""
A custom URL router for the Product API that correctly routes
DELETE requests with multiple query parameters.
"""
routes = [
Route(
url=r"^{prefix}$",
... | 0 | 0 | 0 |
ff6285e126baa8fdebcfba48c1625e8679c9397b | 229 | py | Python | mysite/annotatorapp/forms.py | hareeshbabu82ns/smart-sanskrit-annotator | 763e1dd067107334761ba66796a559c18c2a2807 | [
"MIT"
] | 7 | 2019-04-15T14:33:21.000Z | 2021-12-20T10:04:30.000Z | mysite/annotatorapp/forms.py | hareeshbabu82ns/smart-sanskrit-annotator | 763e1dd067107334761ba66796a559c18c2a2807 | [
"MIT"
] | 4 | 2020-07-05T17:46:45.000Z | 2021-12-11T16:46:40.000Z | mysite/annotatorapp/forms.py | hareeshbabu82ns/smart-sanskrit-annotator | 763e1dd067107334761ba66796a559c18c2a2807 | [
"MIT"
] | 6 | 2018-07-16T10:42:52.000Z | 2021-09-26T06:54:55.000Z | #landing page inputs taken as a form input.
from django import forms
from . import models
| 22.9 | 45 | 0.759825 | #landing page inputs taken as a form input.
from django import forms
from . import models
class inputlineform(forms.Form):
model = forms
line = forms.CharField(max_length = 100)
linetype = forms.CharField(max_length = 100)
| 0 | 114 | 23 |
ecd4753d62aad3a33f16e3c8b73b945e530c8b87 | 95 | py | Python | upgrade_tests/conftest.py | dineshjoshi/cassandra-dtest-1 | 18ccbb4d308c27b67a8d81a2c849dc27fc3e2b5c | [
"Apache-2.0"
] | 44 | 2017-07-13T14:20:42.000Z | 2022-03-27T23:55:27.000Z | upgrade_tests/conftest.py | dineshjoshi/cassandra-dtest-1 | 18ccbb4d308c27b67a8d81a2c849dc27fc3e2b5c | [
"Apache-2.0"
] | 64 | 2017-07-26T16:06:01.000Z | 2022-03-17T22:57:03.000Z | upgrade_tests/conftest.py | dineshjoshi/cassandra-dtest-1 | 18ccbb4d308c27b67a8d81a2c849dc27fc3e2b5c | [
"Apache-2.0"
] | 105 | 2017-07-13T14:28:14.000Z | 2022-03-23T04:22:46.000Z | from .upgrade_manifest import set_config
| 19 | 40 | 0.810526 | from .upgrade_manifest import set_config
def pytest_configure(config):
set_config(config)
| 31 | 0 | 23 |
fdf35f4f013b36b2c85286b3ae07725d2a4be6ed | 1,923 | py | Python | curation_portal/views/project_variants.py | macarthur-lab/variant-curation-portal | bd1e3afd609924fde727116525a00e67d433f1da | [
"MIT"
] | 1 | 2021-03-26T19:44:19.000Z | 2021-03-26T19:44:19.000Z | curation_portal/views/project_variants.py | macarthur-lab/variant-curation-portal | bd1e3afd609924fde727116525a00e67d433f1da | [
"MIT"
] | 50 | 2019-08-23T12:07:11.000Z | 2022-02-26T16:45:08.000Z | curation_portal/views/project_variants.py | macarthur-lab/variant-curation-portal | bd1e3afd609924fde727116525a00e67d433f1da | [
"MIT"
] | null | null | null | from django.db import transaction
from rest_framework.exceptions import NotFound, PermissionDenied
from rest_framework.generics import get_object_or_404
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.serializers import ModelSerializer
from rest_fr... | 34.339286 | 88 | 0.716069 | from django.db import transaction
from rest_framework.exceptions import NotFound, PermissionDenied
from rest_framework.generics import get_object_or_404
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.serializers import ModelSerializer
from rest_fr... | 1,154 | 232 | 46 |
7013918c81c6bad76dfdcdb70889dc3508a62702 | 328 | py | Python | URI/1 - INICIANTE/Python/1182 - ColunaNaMatriz.py | william-james-pj/LogicaProgramacao | 629f746e34da2e829dc7ea2e489ac36bb1b1fb13 | [
"MIT"
] | 1 | 2020-04-14T16:48:16.000Z | 2020-04-14T16:48:16.000Z | URI/1 - INICIANTE/Python/1182 - ColunaNaMatriz.py | william-james-pj/LogicaProgramacao | 629f746e34da2e829dc7ea2e489ac36bb1b1fb13 | [
"MIT"
] | null | null | null | URI/1 - INICIANTE/Python/1182 - ColunaNaMatriz.py | william-james-pj/LogicaProgramacao | 629f746e34da2e829dc7ea2e489ac36bb1b1fb13 | [
"MIT"
] | null | null | null | l = int(input())
operacao = input()
matriz = []
soma = 0.0
for x in range(0, 12):
linha = []
for y in range(0, 12):
linha.append(float(input()))
matriz.append(linha)
for x in range(0, 12):
soma += matriz[x][l]
if operacao == 'S':
print('{:.1f}'.format(soma))
else:
print('{:.1f}'.format(s... | 21.866667 | 36 | 0.554878 | l = int(input())
operacao = input()
matriz = []
soma = 0.0
for x in range(0, 12):
linha = []
for y in range(0, 12):
linha.append(float(input()))
matriz.append(linha)
for x in range(0, 12):
soma += matriz[x][l]
if operacao == 'S':
print('{:.1f}'.format(soma))
else:
print('{:.1f}'.format(s... | 0 | 0 | 0 |
fb5ab216047bdc84770b95501d224e4d5a3c6122 | 20,802 | py | Python | src/data/readers/load_hrit.py | gridl/kcl-fire-aot | 2833df64b289f5ef02b8b93c3c620d0ba702f5b5 | [
"MIT"
] | null | null | null | src/data/readers/load_hrit.py | gridl/kcl-fire-aot | 2833df64b289f5ef02b8b93c3c620d0ba702f5b5 | [
"MIT"
] | null | null | null | src/data/readers/load_hrit.py | gridl/kcl-fire-aot | 2833df64b289f5ef02b8b93c3c620d0ba702f5b5 | [
"MIT"
] | 1 | 2021-03-26T02:28:33.000Z | 2021-03-26T02:28:33.000Z | # open Himawari-8 standard format
# output data dictionary ready to put in frp_pixel.py
# the struction of the dictionary should be like this
# ['ir39', 'ir12', 'saa', 'ir11', 'cloudfree', 'lat',
# 'ir11rad', 'diff', 'sun_glint', 'ACQTIME', 'vza',
# 'vaa', 'lon', 'cmask', 'CMa_TEST', 'pixsize', 'szen',
# 'tirradratio',... | 36.430823 | 106 | 0.571484 | # open Himawari-8 standard format
# output data dictionary ready to put in frp_pixel.py
# the struction of the dictionary should be like this
# ['ir39', 'ir12', 'saa', 'ir11', 'cloudfree', 'lat',
# 'ir11rad', 'diff', 'sun_glint', 'ACQTIME', 'vza',
# 'vaa', 'lon', 'cmask', 'CMa_TEST', 'pixsize', 'szen',
# 'tirradratio',... | 284 | 0 | 23 |
668d96dc85f2dcb56b1266245486159c92348042 | 318 | py | Python | profiles_api/urls.py | shalaka-dengale16/profiles-rest-api | fb0ea419123ffe5a6a4000b7893fe506dd5456f9 | [
"MIT"
] | null | null | null | profiles_api/urls.py | shalaka-dengale16/profiles-rest-api | fb0ea419123ffe5a6a4000b7893fe506dd5456f9 | [
"MIT"
] | null | null | null | profiles_api/urls.py | shalaka-dengale16/profiles-rest-api | fb0ea419123ffe5a6a4000b7893fe506dd5456f9 | [
"MIT"
] | null | null | null | from django.urls import path,include
from rest_framework.routers import DefaultRouter
from profiles_api import views
router=DefaultRouter()
router.register('hello-viewset',views.HelloViewSet,basename='hello-viewset')
urlpatterns=[
path('hello-api/',views.HelloApi.as_view()),
path('',include(router.urls))
]
| 26.5 | 76 | 0.779874 | from django.urls import path,include
from rest_framework.routers import DefaultRouter
from profiles_api import views
router=DefaultRouter()
router.register('hello-viewset',views.HelloViewSet,basename='hello-viewset')
urlpatterns=[
path('hello-api/',views.HelloApi.as_view()),
path('',include(router.urls))
]
| 0 | 0 | 0 |
2a78100207b1f584bd76849f055d4bad916d1dcd | 897 | py | Python | start.py | zxlim/pyHookDeploy | 8b151dc0351b13df74555d2087daf877e6c80797 | [
"Apache-2.0"
] | 1 | 2020-08-07T04:29:02.000Z | 2020-08-07T04:29:02.000Z | start.py | zxlim/pyHookDeploy | 8b151dc0351b13df74555d2087daf877e6c80797 | [
"Apache-2.0"
] | null | null | null | start.py | zxlim/pyHookDeploy | 8b151dc0351b13df74555d2087daf877e6c80797 | [
"Apache-2.0"
] | 1 | 2021-07-15T14:01:55.000Z | 2021-07-15T14:01:55.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
##################################################
# Copyright (c) 2019 Zhao Xiang Lim.
# Distributed under the Apache License 2.0 (the "License").
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an... | 27.181818 | 74 | 0.639911 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
##################################################
# Copyright (c) 2019 Zhao Xiang Lim.
# Distributed under the Apache License 2.0 (the "License").
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an... | 67 | 0 | 23 |
6867d19bdffc28c622d54d9758507091ad086596 | 925 | py | Python | keanu-python/tests/test_traceplot.py | rs992214/keanu | f7f9b877aaaf9c9f732604f17da238e15dfdad13 | [
"MIT"
] | 153 | 2018-04-06T13:30:31.000Z | 2022-01-31T10:05:27.000Z | keanu-python/tests/test_traceplot.py | shinnlok/keanu | c75b2a00571a0da93c6b1d5e9f0cbe09aebdde4d | [
"MIT"
] | 168 | 2018-04-06T16:37:33.000Z | 2021-09-27T21:43:54.000Z | keanu-python/tests/test_traceplot.py | shinnlok/keanu | c75b2a00571a0da93c6b1d5e9f0cbe09aebdde4d | [
"MIT"
] | 46 | 2018-04-10T10:46:01.000Z | 2022-02-24T02:53:50.000Z | from collections import OrderedDict
import pytest
from numpy.testing import assert_array_equal
from keanu.plots import traceplot
from keanu.vartypes import sample_types
@pytest.fixture
| 28.90625 | 89 | 0.697297 | from collections import OrderedDict
import pytest
from numpy.testing import assert_array_equal
from keanu.plots import traceplot
from keanu.vartypes import sample_types
@pytest.fixture
def trace() -> sample_types:
return OrderedDict([("gamma", [1., 2., 3., 4.]), ("gaussian", [0.1, 0.2, 0.3, 0.4])])
def test_t... | 690 | 0 | 45 |
26b636a86c604a98c671236be20e5c67f52404ba | 2,189 | py | Python | lexical_analyzer.py | Tenchi88/lexical_analyzer | ef7b5d6af12de602c6f50c899928d36cb6408646 | [
"Apache-2.0"
] | null | null | null | lexical_analyzer.py | Tenchi88/lexical_analyzer | ef7b5d6af12de602c6f50c899928d36cb6408646 | [
"Apache-2.0"
] | null | null | null | lexical_analyzer.py | Tenchi88/lexical_analyzer | ef7b5d6af12de602c6f50c899928d36cb6408646 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import collections
from lexical_analyzer_helpers import *
| 36.483333 | 110 | 0.745089 | # -*- coding: utf-8 -*-
import collections
from lexical_analyzer_helpers import *
def get_top_words_in_path(path, name_type, speech_part, top_size=10):
if name_type not in ["variable", "function_definition"]:
raise ValueError(name_type + " not supported. Available types: [variable, function_definition]"... | 1,913 | 0 | 184 |
7797d8f5bfbc1aa24b9f92677ad4b1d2bac9ebb0 | 869 | py | Python | build.py | ryanc414/pytest_runner | 11681fea458de1761e808684f578e183bddc40ef | [
"MIT"
] | 21 | 2020-09-19T02:19:51.000Z | 2022-03-05T16:01:48.000Z | build.py | ryanc414/pytest_runner | 11681fea458de1761e808684f578e183bddc40ef | [
"MIT"
] | 12 | 2020-08-25T17:41:31.000Z | 2021-08-17T21:57:32.000Z | build.py | ryanc414/pytest_runner | 11681fea458de1761e808684f578e183bddc40ef | [
"MIT"
] | 8 | 2020-09-19T02:20:12.000Z | 2022-02-22T15:21:25.000Z | #!/usr/bin/env python3
"""
Build everything from source.
Handles:
1. Install npm dependencies and build the UI client
2. Build source and binary distributions of the python package.
"""
import os
import shutil
import subprocess
import sys
WEB_CLIENT_DIR = os.path.join(
os.path.dirname(__file__), "pytest_commande... | 22.868421 | 73 | 0.674338 | #!/usr/bin/env python3
"""
Build everything from source.
Handles:
1. Install npm dependencies and build the UI client
2. Build source and binary distributions of the python package.
"""
import os
import shutil
import subprocess
import sys
WEB_CLIENT_DIR = os.path.join(
os.path.dirname(__file__), "pytest_commande... | 466 | 0 | 23 |
6011f11e84b0ca5ba3caa12f9e06568d9dbe7af6 | 474 | py | Python | src/consensus/block_rewards.py | reghacker/chia-blockchain | 51ab6260dcfbd95b4be9686f717f8d63133ef50f | [
"Apache-2.0"
] | null | null | null | src/consensus/block_rewards.py | reghacker/chia-blockchain | 51ab6260dcfbd95b4be9686f717f8d63133ef50f | [
"Apache-2.0"
] | null | null | null | src/consensus/block_rewards.py | reghacker/chia-blockchain | 51ab6260dcfbd95b4be9686f717f8d63133ef50f | [
"Apache-2.0"
] | null | null | null | from src.util.ints import uint32, uint64
def calculate_block_reward(height: uint32) -> uint64:
"""
Returns the coinbase reward at a certain block height.
1 Chia coin = 16,000,000,000,000 = 16 trillion mojo.
"""
return uint64(14000000000000)
def calculate_base_fee(height: uint32) -> uint64:
"... | 26.333333 | 58 | 0.691983 | from src.util.ints import uint32, uint64
def calculate_block_reward(height: uint32) -> uint64:
"""
Returns the coinbase reward at a certain block height.
1 Chia coin = 16,000,000,000,000 = 16 trillion mojo.
"""
return uint64(14000000000000)
def calculate_base_fee(height: uint32) -> uint64:
"... | 0 | 0 | 0 |
b525ded27d8f2ca62cb466a65a21bbd19071ef22 | 3,061 | py | Python | dp_tornado/helper/security/crypto/__init__.py | donghak-shin/dp-tornado | 095bb293661af35cce5f917d8a2228d273489496 | [
"MIT"
] | 18 | 2015-04-07T14:28:39.000Z | 2020-02-08T14:03:38.000Z | dp_tornado/helper/security/crypto/__init__.py | donghak-shin/dp-tornado | 095bb293661af35cce5f917d8a2228d273489496 | [
"MIT"
] | 7 | 2016-10-05T05:14:06.000Z | 2021-05-20T02:07:22.000Z | dp_tornado/helper/security/crypto/__init__.py | donghak-shin/dp-tornado | 095bb293661af35cce5f917d8a2228d273489496 | [
"MIT"
] | 11 | 2015-12-15T09:49:39.000Z | 2021-09-06T18:38:21.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from dp_tornado.engine.helper import Helper as dpHelper
from Crypto.Cipher import AES
| 34.011111 | 116 | 0.611565 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from dp_tornado.engine.helper import Helper as dpHelper
from Crypto.Cipher import AES
class CryptoHelper(dpHelper):
def encrypt(self, plain, randomized=False, expire_in=0, key=None, raw=False, encode=True, pad=True):
if raw:
retu... | 2,690 | 8 | 211 |
b40678d6e6142c5ce139c5ab13bce7b7eed2edf6 | 10,091 | py | Python | Figures.py | swtietz/BA_Analysis | 197e4aad2b054dc9235808fcc5900659cec8cce6 | [
"MIT"
] | 1 | 2016-11-30T07:23:51.000Z | 2016-11-30T07:23:51.000Z | Figures.py | swtietz/BA_Analysis | 197e4aad2b054dc9235808fcc5900659cec8cce6 | [
"MIT"
] | null | null | null | Figures.py | swtietz/BA_Analysis | 197e4aad2b054dc9235808fcc5900659cec8cce6 | [
"MIT"
] | 1 | 2016-11-30T07:24:25.000Z | 2016-11-30T07:24:25.000Z | import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import matplotlib.cm
from scipy.signal.windows import gaussian
import sklearn.metrics
from DataSet import createDataSetFromFile
from Utils import getProjectPath
from Evaluation import getSpecificCol... | 36.168459 | 146 | 0.651373 | import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import matplotlib.cm
from scipy.signal.windows import gaussian
import sklearn.metrics
from DataSet import createDataSetFromFile
from Utils import getProjectPath
from Evaluation import getSpecificCol... | 9,384 | 0 | 170 |
7ca55fae0b20b4213cd5dea9d90664287f5cdc5c | 655 | py | Python | Ch9/datadefault_start.py | RiddhiDamani/Python | 06cba66aeafd9dc0fa849ec2112c0786a3e8f001 | [
"MIT"
] | null | null | null | Ch9/datadefault_start.py | RiddhiDamani/Python | 06cba66aeafd9dc0fa849ec2112c0786a3e8f001 | [
"MIT"
] | null | null | null | Ch9/datadefault_start.py | RiddhiDamani/Python | 06cba66aeafd9dc0fa849ec2112c0786a3e8f001 | [
"MIT"
] | null | null | null | # Python Object Oriented Programming by Joe Marini course example
# implementing default values in data classes
# Default Values always have to come first - i.e. before non-default values.
from dataclasses import dataclass, field
import random
@dataclass
b1 = Book("War and Peace", "Leo Tolstoy", 1225)
b2 = Book("T... | 27.291667 | 77 | 0.720611 | # Python Object Oriented Programming by Joe Marini course example
# implementing default values in data classes
# Default Values always have to come first - i.e. before non-default values.
from dataclasses import dataclass, field
import random
def price_func():
return float(random.randrange(20, 40))
@dataclass... | 39 | 187 | 45 |
7dc6f35c51c58e0ce7864e4def04a2076bf3889b | 2,954 | py | Python | modules/compressor.py | zeroone2numeral2/nmjpeg-bot | 8c77b0b90933cf2efb221fdad097e2087deae1f1 | [
"MIT"
] | 6 | 2018-03-25T02:04:18.000Z | 2020-07-03T04:22:30.000Z | modules/compressor.py | zeroone2numeral2/nmjpeg-bot | 8c77b0b90933cf2efb221fdad097e2087deae1f1 | [
"MIT"
] | null | null | null | modules/compressor.py | zeroone2numeral2/nmjpeg-bot | 8c77b0b90933cf2efb221fdad097e2087deae1f1 | [
"MIT"
] | 1 | 2019-08-12T16:25:12.000Z | 2019-08-12T16:25:12.000Z | import os
import sys
import logging
from telegram.ext import MessageHandler
from telegram.ext import CommandHandler
from telegram.ext import Filters
from telegram.ext import BaseFilter
from telegram.ext.dispatcher import run_async
from picture import Picture
logger = logging.getLogger(__name__)
BASE_F... | 28.403846 | 89 | 0.651997 | import os
import sys
import logging
from telegram.ext import MessageHandler
from telegram.ext import CommandHandler
from telegram.ext import Filters
from telegram.ext import BaseFilter
from telegram.ext.dispatcher import run_async
from picture import Picture
logger = logging.getLogger(__name__)
BASE_F... | 1,789 | 311 | 339 |
c06ed1ad8feac712313aca6df1e744a56c3c1611 | 2,687 | py | Python | python/observesim/observations.py | jsobeck/observesim | 8019c3031ad24cd08d9eb0e68b3fbe534a2d30ad | [
"BSD-3-Clause"
] | null | null | null | python/observesim/observations.py | jsobeck/observesim | 8019c3031ad24cd08d9eb0e68b3fbe534a2d30ad | [
"BSD-3-Clause"
] | null | null | null | python/observesim/observations.py | jsobeck/observesim | 8019c3031ad24cd08d9eb0e68b3fbe534a2d30ad | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
"""Observations module class.
Dependencies:
numpy
scipy
"""
class Observations(object):
"""Observations class.
Parameters:
----------
observatory : string
Observatory for tiles ('apo' or 'lco'; default 'apo')
Attributes:
----------
nobservations : np.int... | 26.343137 | 67 | 0.54038 | import numpy as np
"""Observations module class.
Dependencies:
numpy
scipy
"""
class Observations(object):
"""Observations class.
Parameters:
----------
observatory : string
Observatory for tiles ('apo' or 'lco'; default 'apo')
Attributes:
----------
nobservations : np.int... | 992 | 0 | 80 |
eba7469e17fc1598df3072271972a8ee3c7065f4 | 13,859 | py | Python | main.py | aziznal/luigi-sacco-and-route-encryption | 7e9ebba5572ef58e9f47bca9d443b93d579624d5 | [
"MIT"
] | 1 | 2022-02-24T18:34:36.000Z | 2022-02-24T18:34:36.000Z | main.py | aziznal/luigi-sacco-and-route-encryption | 7e9ebba5572ef58e9f47bca9d443b93d579624d5 | [
"MIT"
] | null | null | null | main.py | aziznal/luigi-sacco-and-route-encryption | 7e9ebba5572ef58e9f47bca9d443b93d579624d5 | [
"MIT"
] | null | null | null | from typing import Callable, Literal, Tuple
from PyQt5.QtWidgets import QApplication, QComboBox, QWidget
from PyQt5.QtGui import QPixmap
from gui import Gui
from logic.luigi_sacco import luigi_sacco_encrypt, luigi_sacco_decrypt, confirm_text_in_correct_lang, format_key_and_input_text
from logic.route_encryption imp... | 29.054507 | 139 | 0.696082 | from typing import Callable, Literal, Tuple
from PyQt5.QtWidgets import QApplication, QComboBox, QWidget
from PyQt5.QtGui import QPixmap
from gui import Gui
from logic.luigi_sacco import luigi_sacco_encrypt, luigi_sacco_decrypt, confirm_text_in_correct_lang, format_key_and_input_text
from logic.route_encryption imp... | 54 | 0 | 79 |
0d783e56e550a44e98454d237e710237dfde05ff | 5,589 | py | Python | Random-Programs/dev/battle.py | naumoff0/Archive | d4ad2da89abb1576dd5a7c72ded6bf9b45c3f610 | [
"MIT"
] | null | null | null | Random-Programs/dev/battle.py | naumoff0/Archive | d4ad2da89abb1576dd5a7c72ded6bf9b45c3f610 | [
"MIT"
] | null | null | null | Random-Programs/dev/battle.py | naumoff0/Archive | d4ad2da89abb1576dd5a7c72ded6bf9b45c3f610 | [
"MIT"
] | null | null | null | """ this program kills humans """
import sys
import time
import random
import builtins
import termcolor
PRINT_SPEED = 0.005
DEBUG_MODE = False
class human:
""" a human exists... to die """
def checkWound(self):
""" checks if a human is wounded """
dmg = random.randint(1, 4)
print("{... | 25.75576 | 102 | 0.55985 | """ this program kills humans """
import sys
import time
import random
import builtins
import termcolor
PRINT_SPEED = 0.005
DEBUG_MODE = False
class human:
""" a human exists... to die """
def __init__(self, name):
self.hp = 10
self.incombat = False
self.name = name
self.advant... | 120 | 0 | 26 |
1efe8318e95b52ae257743852a598257ff3b467e | 1,451 | py | Python | toolkit/src/NTIVirtualKeyBoard.py | FoxyRabbit67/enigma2-plugins | f6b94012726931fdf28e80a26226aec612b350de | [
"Linux-OpenIB"
] | 41 | 2016-01-21T17:54:44.000Z | 2021-06-26T05:54:41.000Z | toolkit/src/NTIVirtualKeyBoard.py | FoxyRabbit67/enigma2-plugins | f6b94012726931fdf28e80a26226aec612b350de | [
"Linux-OpenIB"
] | 22 | 2016-11-16T11:25:26.000Z | 2021-12-13T09:13:06.000Z | toolkit/src/NTIVirtualKeyBoard.py | FoxyRabbit67/enigma2-plugins | f6b94012726931fdf28e80a26226aec612b350de | [
"Linux-OpenIB"
] | 62 | 2016-02-05T22:55:48.000Z | 2022-03-12T21:48:22.000Z | from Tools.NumericalTextInput import NumericalTextInput
from Screens.VirtualKeyBoard import VirtualKeyBoard
from Components.ActionMap import NumberActionMap
| 27.377358 | 69 | 0.72295 | from Tools.NumericalTextInput import NumericalTextInput
from Screens.VirtualKeyBoard import VirtualKeyBoard
from Components.ActionMap import NumberActionMap
class NTIVirtualKeyBoard(VirtualKeyBoard, NumericalTextInput):
def __init__(self, session, **kwargs):
VirtualKeyBoard.__init__(self, session, **kwargs)
Numer... | 1,110 | 41 | 142 |
ae1e992f116581312c1a1a97506a08f6cff69711 | 6,426 | py | Python | validation/GCMC/TIP3_DIOX/build/create_solvent_boxes.py | GregorySchwing/wolfCalibration | 9ff7ca7f0d144da407c14f0f4e9a202c4691de2d | [
"MIT"
] | null | null | null | validation/GCMC/TIP3_DIOX/build/create_solvent_boxes.py | GregorySchwing/wolfCalibration | 9ff7ca7f0d144da407c14f0f4e9a202c4691de2d | [
"MIT"
] | null | null | null | validation/GCMC/TIP3_DIOX/build/create_solvent_boxes.py | GregorySchwing/wolfCalibration | 9ff7ca7f0d144da407c14f0f4e9a202c4691de2d | [
"MIT"
] | null | null | null | from Bio.PDB.PDBParser import PDBParser
from Bio.PDB.PDBIO import PDBIO
import numpy as np
import shutil
f = open("log.txt", "a")
parser = PDBParser(PERMISSIVE=1)
structure_id = "3rgk"
filename = "../1-1-build/MYO_HEME_MUT.pdb"
structure = parser.get_structure(structure_id, filename)
atoms = structure.get_atoms()
lis... | 36.931034 | 110 | 0.583411 | from Bio.PDB.PDBParser import PDBParser
from Bio.PDB.PDBIO import PDBIO
import numpy as np
import shutil
f = open("log.txt", "a")
parser = PDBParser(PERMISSIVE=1)
structure_id = "3rgk"
filename = "../1-1-build/MYO_HEME_MUT.pdb"
structure = parser.get_structure(structure_id, filename)
atoms = structure.get_atoms()
lis... | 0 | 0 | 0 |
0276c7a19b751d8212996f1a3edd5965b18f8e95 | 9,764 | py | Python | src/SALib/util/__init__.py | QianWanghhu/SALib | 95a3371e503f9253cb917b8f0101c0202b969c2b | [
"MIT"
] | 1 | 2019-12-20T00:32:45.000Z | 2019-12-20T00:32:45.000Z | src/SALib/util/__init__.py | QianWanghhu/SALib | 95a3371e503f9253cb917b8f0101c0202b969c2b | [
"MIT"
] | null | null | null | src/SALib/util/__init__.py | QianWanghhu/SALib | 95a3371e503f9253cb917b8f0101c0202b969c2b | [
"MIT"
] | null | null | null | """A set of utility functions
"""
from collections import OrderedDict
import pkgutil
from typing import Dict, Tuple
import numpy as np # type: ignore
import scipy as sp # type: ignore
from scipy import stats
from typing import List
from .util_funcs import (avail_approaches, read_param_file, _check_bounds, _check_g... | 32.013115 | 89 | 0.600676 | """A set of utility functions
"""
from collections import OrderedDict
import pkgutil
from typing import Dict, Tuple
import numpy as np # type: ignore
import scipy as sp # type: ignore
from scipy import stats
from typing import List
from .util_funcs import (avail_approaches, read_param_file, _check_bounds, _check_g... | 0 | 0 | 0 |
e9c9dd925406982a79befda5862e8bff57412e0d | 2,585 | py | Python | search.py | mizuff/gbf-rapid-search | 3d6ab8cdba5b4f3a4e9fe956056fe3f7d0bc0a7d | [
"0BSD"
] | 5 | 2018-03-06T02:23:21.000Z | 2019-04-25T06:38:05.000Z | search.py | mizuff/gbf-rapid-search | 3d6ab8cdba5b4f3a4e9fe956056fe3f7d0bc0a7d | [
"0BSD"
] | 1 | 2021-01-29T04:18:14.000Z | 2021-01-29T04:18:14.000Z | search.py | bookii/gbf-rapid-search | 3d6ab8cdba5b4f3a4e9fe956056fe3f7d0bc0a7d | [
"0BSD"
] | 4 | 2019-09-27T08:17:20.000Z | 2021-03-14T03:43:56.000Z | # -*- coding: utf-8 -*-
import json
import re
import subprocess
import sys
import time
from requests_oauthlib import OAuth1Session
# 取得したConsumer Key等と置き換えてください
CK = 'consumer_key'
CS = 'consumer_secret'
AT = 'access_token'
AS = 'access_token_secret'
FILTER_URL = 'https://stream.twitter.com/1.1/statuses/filter.json'... | 29.712644 | 114 | 0.597292 | # -*- coding: utf-8 -*-
import json
import re
import subprocess
import sys
import time
from requests_oauthlib import OAuth1Session
# 取得したConsumer Key等と置き換えてください
CK = 'consumer_key'
CS = 'consumer_secret'
AT = 'access_token'
AS = 'access_token_secret'
FILTER_URL = 'https://stream.twitter.com/1.1/statuses/filter.json'... | 2,193 | 0 | 140 |
91ea2b2a100b4f84af908e54d6c94e5a481595ad | 8,090 | py | Python | pysnmp/ASCEND-MIBTRANSACTION-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/ASCEND-MIBTRANSACTION-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/ASCEND-MIBTRANSACTION-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module ASCEND-MIBTRANSACTION-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ASCEND-MIBTRANSACTION-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:12:43 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.... | 139.482759 | 1,428 | 0.813103 | #
# PySNMP MIB module ASCEND-MIBTRANSACTION-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ASCEND-MIBTRANSACTION-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:12:43 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.... | 0 | 21 | 22 |
b04416d3afeafec6d7544afdc6277f1a157d0148 | 5,608 | py | Python | Applications/SIR/plotting.py | lcbendall/numerical_computing | 565cde92525ea44c55abe933c6419c1543f9800b | [
"CC-BY-3.0"
] | null | null | null | Applications/SIR/plotting.py | lcbendall/numerical_computing | 565cde92525ea44c55abe933c6419c1543f9800b | [
"CC-BY-3.0"
] | null | null | null | Applications/SIR/plotting.py | lcbendall/numerical_computing | 565cde92525ea44c55abe933c6419c1543f9800b | [
"CC-BY-3.0"
] | null | null | null | #! /usr/bin/env python
from __future__ import division
from scipy.integrate import ode
import numpy as np
import matplotlib.pyplot as plt
from solution import SIR #, SIRS, SIS
from scikits import bvp_solver
# Example()
# Exercise1()
# Exercise2()
# Exercise2a()
# Exercise2b()
Exercise3()
# Exercise4()
| 27.223301 | 120 | 0.599857 | #! /usr/bin/env python
from __future__ import division
from scipy.integrate import ode
import numpy as np
import matplotlib.pyplot as plt
from solution import SIR #, SIRS, SIS
from scikits import bvp_solver
def Example():
a, ya, b = 0., 2., 1.6
def ode_f(t,y):
return np.array([-1.*y+6.+2.*t])
ode_object = od... | 5,126 | 0 | 166 |
abed2523cd069a7a9682de47eb8de08c27d3fef1 | 61 | py | Python | sheetsync/version.py | guykisel/SheetSync | b6fa15f14320c2ae4fec88747f1f311dcabbac7b | [
"MIT"
] | 1 | 2017-03-30T17:38:06.000Z | 2017-03-30T17:38:06.000Z | sheetsync/version.py | guykisel/SheetSync | b6fa15f14320c2ae4fec88747f1f311dcabbac7b | [
"MIT"
] | null | null | null | sheetsync/version.py | guykisel/SheetSync | b6fa15f14320c2ae4fec88747f1f311dcabbac7b | [
"MIT"
] | null | null | null | # Single place version should be set.
__version__ = '0.2.2'
| 20.333333 | 38 | 0.704918 | # Single place version should be set.
__version__ = '0.2.2'
| 0 | 0 | 0 |
a72987c371cafa206db482ba7d75d97327c280aa | 1,273 | py | Python | app/nn_inference/common/base_wrapper.py | rahowa/workzone | b6fd3241fdbc9463e0e7eb863f82f9524be50830 | [
"MIT"
] | 1 | 2020-04-25T07:49:11.000Z | 2020-04-25T07:49:11.000Z | app/nn_inference/common/base_wrapper.py | rahowa/workzone | b6fd3241fdbc9463e0e7eb863f82f9524be50830 | [
"MIT"
] | null | null | null | app/nn_inference/common/base_wrapper.py | rahowa/workzone | b6fd3241fdbc9463e0e7eb863f82f9524be50830 | [
"MIT"
] | 1 | 2020-04-23T10:24:56.000Z | 2020-04-23T10:24:56.000Z | import json
from typing import Dict, Any, Sequence
from abc import ABC, abstractmethod
from typing import List
from app.base_types import Image
from app.result_types import BaseResult
class BaseWrapper(ABC):
"""
Base class for creating custom wrappers for
models based on neural networks
"""
@abs... | 23.145455 | 65 | 0.593087 | import json
from typing import Dict, Any, Sequence
from abc import ABC, abstractmethod
from typing import List
from app.base_types import Image
from app.result_types import BaseResult
class BaseWrapper(ABC):
"""
Base class for creating custom wrappers for
models based on neural networks
"""
@abs... | 16 | 0 | 54 |
4e67bf9d3581151e96fe9476c73689ab77c5975d | 8,084 | py | Python | deepracer_env_config/config_server.py | aws-deepracer/deepracer-env-config | 9df38766ac3f35f9138ed8a48f96e9cf367d44c0 | [
"Apache-2.0"
] | null | null | null | deepracer_env_config/config_server.py | aws-deepracer/deepracer-env-config | 9df38766ac3f35f9138ed8a48f96e9cf367d44c0 | [
"Apache-2.0"
] | null | null | null | deepracer_env_config/config_server.py | aws-deepracer/deepracer-env-config | 9df38766ac3f35f9138ed8a48f96e9cf367d44c0 | [
"Apache-2.0"
] | null | null | null | #################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"). ... | 35.769912 | 103 | 0.537853 | #################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"). ... | 0 | 0 | 0 |
62b633476715b0655f5140e6ad29476e0c09be91 | 2,734 | py | Python | tests/app/main/test_form_validators.py | alphagov-mirror/digitalmarketplace-admin-frontend | a46f2a1625a8fccdf5296c561b1dc07e63ad6970 | [
"MIT"
] | 7 | 2015-05-09T02:29:15.000Z | 2021-05-06T22:37:11.000Z | tests/app/main/test_form_validators.py | alphagov-mirror/digitalmarketplace-admin-frontend | a46f2a1625a8fccdf5296c561b1dc07e63ad6970 | [
"MIT"
] | 349 | 2015-02-24T11:24:05.000Z | 2021-07-27T15:23:50.000Z | tests/app/main/test_form_validators.py | alphagov-mirror/digitalmarketplace-admin-frontend | a46f2a1625a8fccdf5296c561b1dc07e63ad6970 | [
"MIT"
] | 16 | 2015-03-23T14:18:38.000Z | 2021-04-10T18:05:11.000Z | import mock
import pytest
from flask_wtf import Form
from wtforms.fields.core import Field
from wtforms.validators import StopValidation, ValidationError
from app.main.forms import AdminEmailAddressValidator, NotInDomainSuffixBlacklistValidator
from ..helpers import BaseApplicationTest
@mock.patch('app.main.forms.d... | 36.453333 | 120 | 0.726774 | import mock
import pytest
from flask_wtf import Form
from wtforms.fields.core import Field
from wtforms.validators import StopValidation, ValidationError
from app.main.forms import AdminEmailAddressValidator, NotInDomainSuffixBlacklistValidator
from ..helpers import BaseApplicationTest
@mock.patch('app.main.forms.d... | 1,674 | 569 | 153 |
4b332e150db5ee5e6294b41aa93700fbb5552631 | 756 | py | Python | sendinblue/jinja.py | apihackers/wagtail-sendinblue | c52a3ab22c1cb6a919326b9b20bb8bb69e95f7bc | [
"MIT"
] | 1 | 2018-02-01T16:39:08.000Z | 2018-02-01T16:39:08.000Z | sendinblue/jinja.py | apihackers/wagtail-sendinblue | c52a3ab22c1cb6a919326b9b20bb8bb69e95f7bc | [
"MIT"
] | null | null | null | sendinblue/jinja.py | apihackers/wagtail-sendinblue | c52a3ab22c1cb6a919326b9b20bb8bb69e95f7bc | [
"MIT"
] | null | null | null | import jinja2
from jinja2.ext import Extension
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from .models import SendinBlueSettings
@jinja2.contextfunction
settings = SendinBlueExtension
| 26.068966 | 64 | 0.752646 | import jinja2
from jinja2.ext import Extension
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from .models import SendinBlueSettings
@jinja2.contextfunction
def sendinblue(context):
request = context['request']
settings = SendinBlueSettings.for_site(request... | 423 | 16 | 71 |
f2d36c2c036a4f007ec818bf94e1b480398a8fa1 | 533 | py | Python | inserthelper.py | gabalese/py-BookBundler | 22420a2f865b3f5612962130412c2e93a2ae89ab | [
"MIT"
] | 2 | 2021-05-25T10:34:58.000Z | 2022-02-18T06:40:11.000Z | inserthelper.py | bigdig/SkinAI | 50c7e025d4c3ad6a7c9a2d5a227caf8314f352be | [
"MIT"
] | null | null | null | inserthelper.py | bigdig/SkinAI | 50c7e025d4c3ad6a7c9a2d5a227caf8314f352be | [
"MIT"
] | 1 | 2019-09-29T15:18:29.000Z | 2019-09-29T15:18:29.000Z | import database
import os
DIRECTORY = "pages/"
# helper script to add target contents to db
# could be refactored to accept a list of files via shell expansion
if __name__ == "__main__":
# test script
db = database.Database()
for path, dirs, files in os.walk(os.path.abspath(DIRECTORY)):
for singu... | 28.052632 | 72 | 0.630394 | import database
import os
DIRECTORY = "pages/"
# helper script to add target contents to db
# could be refactored to accept a list of files via shell expansion
if __name__ == "__main__":
# test script
db = database.Database()
for path, dirs, files in os.walk(os.path.abspath(DIRECTORY)):
for singu... | 0 | 0 | 0 |
f067864d9da92540424c0e9ce762420e165a9ec6 | 296 | py | Python | Python/py-check-strict-superset.py | DacioRomero/HackerRank | d1d43bd23e319bf8015a741eca70ba471a13c045 | [
"MIT"
] | 1 | 2020-07-28T00:08:38.000Z | 2020-07-28T00:08:38.000Z | Python/py-check-strict-superset.py | DacioRomero/HackerRank | d1d43bd23e319bf8015a741eca70ba471a13c045 | [
"MIT"
] | null | null | null | Python/py-check-strict-superset.py | DacioRomero/HackerRank | d1d43bd23e319bf8015a741eca70ba471a13c045 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
main()
| 21.142857 | 48 | 0.5 | def main():
A = set(map(int, input().split()))
for _ in range(int(input())):
subset = set(map(int, input().split()))
if A.intersection(subset) != subset:
print('False')
break
else:
print('True')
if __name__ == '__main__':
main()
| 235 | 0 | 22 |
380ca43fe4a19d64f64e568c8c5f1f118a342818 | 2,404 | py | Python | ansibleflow/run.py | jmvrbanac/ansible-flow | 666dc3664ed8001640d50c0e00d749f44f16826f | [
"Apache-2.0"
] | 13 | 2015-12-03T10:41:13.000Z | 2020-01-05T16:22:42.000Z | ansibleflow/run.py | jmvrbanac/ansible-flow | 666dc3664ed8001640d50c0e00d749f44f16826f | [
"Apache-2.0"
] | 2 | 2015-12-17T22:16:53.000Z | 2016-05-30T01:20:59.000Z | ansibleflow/run.py | jmvrbanac/ansible-flow | 666dc3664ed8001640d50c0e00d749f44f16826f | [
"Apache-2.0"
] | 6 | 2015-12-09T21:38:55.000Z | 2020-02-24T21:15:06.000Z | import os
import glob
import sys
from ansibleflow import log
from ansibleflow.config import get_config
from ansibleflow.venv import execute_under_env, env_exists
| 28.282353 | 77 | 0.663062 | import os
import glob
import sys
from ansibleflow import log
from ansibleflow.config import get_config
from ansibleflow.venv import execute_under_env, env_exists
def get_full_var_file_path(filename, environment):
file_path = filename
if environment.directory:
file_path = os.path.join(environment.dire... | 2,121 | 0 | 115 |
918279db550254174256b45efa403096b528d2d6 | 20,754 | py | Python | SciDataTool/Methods/DataND/plot_2D_Data.py | EOMYS-Public/SciDataTool | dd74504fbed8e4071582981ff8736c37f1c25bdc | [
"Apache-2.0"
] | null | null | null | SciDataTool/Methods/DataND/plot_2D_Data.py | EOMYS-Public/SciDataTool | dd74504fbed8e4071582981ff8736c37f1c25bdc | [
"Apache-2.0"
] | null | null | null | SciDataTool/Methods/DataND/plot_2D_Data.py | EOMYS-Public/SciDataTool | dd74504fbed8e4071582981ff8736c37f1c25bdc | [
"Apache-2.0"
] | null | null | null | from SciDataTool.Functions.Plot.plot_2D import plot_2D
from SciDataTool.Functions.Plot import (
unit_dict,
norm_dict,
axes_dict,
COLORS,
)
from SciDataTool.Functions.Load.import_class import import_class
from SciDataTool.Classes.Norm_indices import Norm_indices
from numpy import (
squeeze,
split... | 32.995231 | 154 | 0.504963 | from SciDataTool.Functions.Plot.plot_2D import plot_2D
from SciDataTool.Functions.Plot import (
unit_dict,
norm_dict,
axes_dict,
COLORS,
)
from SciDataTool.Functions.Load.import_class import import_class
from SciDataTool.Classes.Norm_indices import Norm_indices
from numpy import (
squeeze,
split... | 0 | 0 | 0 |
617b66d0fa72fce403e4b7e7d45099612d8d9b4e | 817 | py | Python | api/cities.py | csmets/travel-wish-list | 83d49d93e6f50fd20839f2097f8936cd88f166fb | [
"MIT"
] | null | null | null | api/cities.py | csmets/travel-wish-list | 83d49d93e6f50fd20839f2097f8936cd88f166fb | [
"MIT"
] | null | null | null | api/cities.py | csmets/travel-wish-list | 83d49d93e6f50fd20839f2097f8936cd88f166fb | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import json
import falcon
from database import Database
| 20.425 | 61 | 0.518972 | #!/usr/bin/python3
import json
import falcon
from database import Database
class City(object):
def on_get(self, req, resp, country, city):
db = Database()
country_data = db.fetch('countries', 'name', country)
country_code = country_data['code']
if city.lower() == 'all':
... | 693 | -2 | 50 |
1c85d6299243c4559cbeefd7d9134659dcbdcb5b | 294 | py | Python | src/python/nimbusml/utils/__init__.py | michaelgsharp/NimbusML | 50031157265f49eec85d27fe67582d9ddaf01ef9 | [
"MIT"
] | 134 | 2018-11-01T22:15:24.000Z | 2019-05-04T11:30:08.000Z | src/python/nimbusml/utils/__init__.py | michaelgsharp/NimbusML | 50031157265f49eec85d27fe67582d9ddaf01ef9 | [
"MIT"
] | 226 | 2019-05-07T19:00:44.000Z | 2021-01-06T07:59:48.000Z | src/python/nimbusml/utils/__init__.py | michaelgsharp/NimbusML | 50031157265f49eec85d27fe67582d9ddaf01ef9 | [
"MIT"
] | 43 | 2019-05-15T20:19:42.000Z | 2022-03-30T10:26:07.000Z | from .utils import get_X_y, evaluate_binary_classifier, load_img, ColumnSelector
try:
from inspect import signature
except ImportError:
from funcsigs import signature
__all__ = [
'get_X_y',
'evaluate_binary_classifier',
'load_img',
'ColumnSelector',
'signature'
]
| 19.6 | 80 | 0.727891 | from .utils import get_X_y, evaluate_binary_classifier, load_img, ColumnSelector
try:
from inspect import signature
except ImportError:
from funcsigs import signature
__all__ = [
'get_X_y',
'evaluate_binary_classifier',
'load_img',
'ColumnSelector',
'signature'
]
| 0 | 0 | 0 |
60d00d09c6b6a5e3e2a4aaaca9cc01937f5f3d0b | 4,554 | py | Python | gcloud/tasktmpl3/sites/utils.py | gangh/bk-sops | 29f4b4915be42650c2eeee637e0cf798e4066f09 | [
"Apache-2.0"
] | 1 | 2019-12-23T07:23:35.000Z | 2019-12-23T07:23:35.000Z | gcloud/tasktmpl3/sites/utils.py | bk-sops/bk-sops | 9f5950b13473bf7b5032528b20016b7a571bb3cd | [
"Apache-2.0"
] | 9 | 2020-02-12T03:15:49.000Z | 2021-06-10T22:04:51.000Z | gcloud/tasktmpl3/sites/utils.py | bk-sops/bk-sops | 9f5950b13473bf7b5032528b20016b7a571bb3cd | [
"Apache-2.0"
] | 1 | 2022-01-17T11:32:05.000Z | 2022-01-17T11:32:05.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 36.432 | 115 | 0.539306 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 3,874 | 0 | 23 |
a3c9bf11fc548a2900def0c6b7c4d550e107b31f | 231 | py | Python | lab6/q1/l6q1b.py | nandiniproothi/itt-lab | fb0381c00abc94fb0653e8e723ca6c3f60c0f7b3 | [
"MIT"
] | 11 | 2021-02-21T14:44:28.000Z | 2021-05-30T10:11:18.000Z | lab6/q1/l6q1b.py | nandiniproothi/itt-lab | fb0381c00abc94fb0653e8e723ca6c3f60c0f7b3 | [
"MIT"
] | null | null | null | lab6/q1/l6q1b.py | nandiniproothi/itt-lab | fb0381c00abc94fb0653e8e723ca6c3f60c0f7b3 | [
"MIT"
] | 1 | 2021-05-05T05:39:56.000Z | 2021-05-05T05:39:56.000Z | import re
s = "is this a string?!"
print("The original string is : " + s)
res = re.sub(r'[^\w\s]', '', s) #remove any char that is not a word, space, or tab using regex
print("The string after removing punctuation is: " + res)
| 23.1 | 94 | 0.645022 | import re
s = "is this a string?!"
print("The original string is : " + s)
res = re.sub(r'[^\w\s]', '', s) #remove any char that is not a word, space, or tab using regex
print("The string after removing punctuation is: " + res)
| 0 | 0 | 0 |
2b6971d2880d9e652e3f26af8a4ea9df7c720f1e | 1,301 | py | Python | chapter_one/bin/car.py | wrzehu/open_the_gates | 7c653067fe84d60988bf93feeb332645c989605a | [
"MIT"
] | null | null | null | chapter_one/bin/car.py | wrzehu/open_the_gates | 7c653067fe84d60988bf93feeb332645c989605a | [
"MIT"
] | null | null | null | chapter_one/bin/car.py | wrzehu/open_the_gates | 7c653067fe84d60988bf93feeb332645c989605a | [
"MIT"
] | null | null | null | class IllegalCarError(Exception):
"""Raised when the attributes of Car class are wrong"""
pass
| 26.55102 | 82 | 0.661799 | class IllegalCarError(Exception):
"""Raised when the attributes of Car class are wrong"""
pass
class Car:
def __init__(self, pax_count, car_mass, gear_count, ):
self.__pax_count = pax_count
self.pax_count_validation()
self.__car_mass = car_mass
self.car_mass_validation()... | 928 | 246 | 23 |
e2998563bd59901909ecc6b9bc2b036a4c157519 | 3,268 | py | Python | BSTU App/BSTU App/Database/DatabaseManagement/NavigationDB/Premise/GUK/Stage_5.py | alextar04/BSTU-APP | ff9df53335be4a94a1e04d4d4072b3bba18ba08b | [
"MIT"
] | null | null | null | BSTU App/BSTU App/Database/DatabaseManagement/NavigationDB/Premise/GUK/Stage_5.py | alextar04/BSTU-APP | ff9df53335be4a94a1e04d4d4072b3bba18ba08b | [
"MIT"
] | null | null | null | BSTU App/BSTU App/Database/DatabaseManagement/NavigationDB/Premise/GUK/Stage_5.py | alextar04/BSTU-APP | ff9df53335be4a94a1e04d4d4072b3bba18ba08b | [
"MIT"
] | null | null | null | import os
from peewee import *
from NavigationDB.Premise.PremiseDB import Premise
os.chdir('../../..')
PremiseRemove()
PremiseAdd() | 61.660377 | 93 | 0.705936 | import os
from peewee import *
from NavigationDB.Premise.PremiseDB import Premise
def PremiseAdd():
Premise.create(id=137, idMap=5, idTypePremise=0, name="515а", description="ГУК 515а")
Premise.create(id=138, idMap=5, idTypePremise=0, name="517", description="ГУК 517")
Premise.create(id=139, idMap=5, idTy... | 3,237 | 0 | 46 |
b2df41919d3facb549d20991b7050ec9f9c68b19 | 1,131 | py | Python | src/AgentAI/aiframework/AIModelParameter.py | Passer-D/GameAISDK | a089330a30b7bfe1f6442258a12d8c0086240606 | [
"Apache-2.0"
] | 1,210 | 2020-08-18T07:57:36.000Z | 2022-03-31T15:06:05.000Z | src/AgentAI/aiframework/AIModelParameter.py | guokaiSama/GameAISDK | a089330a30b7bfe1f6442258a12d8c0086240606 | [
"Apache-2.0"
] | 37 | 2020-08-24T02:48:38.000Z | 2022-01-30T06:41:52.000Z | src/AgentAI/aiframework/AIModelParameter.py | guokaiSama/GameAISDK | a089330a30b7bfe1f6442258a12d8c0086240606 | [
"Apache-2.0"
] | 275 | 2020-08-18T08:35:16.000Z | 2022-03-31T15:06:07.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making GameAISDK available.
This source code file is licensed under the GNU General Public License Version 3.
For full details, please refer to the file "LICENSE.txt" which is provided as part of this source code package.
Copyright... | 41.888889 | 111 | 0.727675 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making GameAISDK available.
This source code file is licensed under the GNU General Public License Version 3.
For full details, please refer to the file "LICENSE.txt" which is provided as part of this source code package.
Copyright... | 534 | 0 | 26 |
1f9c259eab6beff9924a84b7996362aabcacc9cf | 535 | py | Python | day3/supermarket.py | dikshaa1702/ml | c35f279b8fa7544517ca713c2c1e55f08270d4c3 | [
"Apache-2.0"
] | 1 | 2019-06-13T13:52:09.000Z | 2019-06-13T13:52:09.000Z | day3/supermarket.py | dikshaa1702/ml | c35f279b8fa7544517ca713c2c1e55f08270d4c3 | [
"Apache-2.0"
] | null | null | null | day3/supermarket.py | dikshaa1702/ml | c35f279b8fa7544517ca713c2c1e55f08270d4c3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu May 9 10:29:45 2019
@author: DiPu
"""
from collections import OrderedDict
od=OrderedDict()
while True:
user_inp = input("Enter Product: ")
if user_inp == "":
break
user_inp = user_inp.split()
key = " ".join(user_inp[:-1])
value = int(user_inp... | 17.833333 | 39 | 0.530841 | # -*- coding: utf-8 -*-
"""
Created on Thu May 9 10:29:45 2019
@author: DiPu
"""
from collections import OrderedDict
od=OrderedDict()
while True:
user_inp = input("Enter Product: ")
if user_inp == "":
break
user_inp = user_inp.split()
key = " ".join(user_inp[:-1])
value = int(user_inp... | 0 | 0 | 0 |
75835994dc81359fee88e3157fca38504d792923 | 1,500 | py | Python | neutron/plugins/bigswitch/routerrule_db.py | sajuptpm/notification_neutron | 45933f63c9eff0d2931a7209b040ff2dc69835c5 | [
"Apache-2.0"
] | 5 | 2015-10-20T07:56:53.000Z | 2017-12-31T22:39:15.000Z | neutron/plugins/bigswitch/routerrule_db.py | sajuptpm/notification_neutron | 45933f63c9eff0d2931a7209b040ff2dc69835c5 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/bigswitch/routerrule_db.py | sajuptpm/notification_neutron | 45933f63c9eff0d2931a7209b040ff2dc69835c5 | [
"Apache-2.0"
] | 3 | 2015-05-08T22:36:28.000Z | 2015-10-24T21:25:35.000Z | # Copyright 2013, Big Switch Networks
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 38.461538 | 78 | 0.656667 | # Copyright 2013, Big Switch Networks
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 0 | 730 | 46 |
c054d5e14cb3c24004c03f3f34246371b7c0bd0c | 315 | py | Python | Mundo 2/Ex048.py | FelipeDreissig/Prog-em-Py---CursoEmVideo | 59a85e228b4c7bc0738d1a213e71b0f7fb07d03a | [
"MIT"
] | null | null | null | Mundo 2/Ex048.py | FelipeDreissig/Prog-em-Py---CursoEmVideo | 59a85e228b4c7bc0738d1a213e71b0f7fb07d03a | [
"MIT"
] | null | null | null | Mundo 2/Ex048.py | FelipeDreissig/Prog-em-Py---CursoEmVideo | 59a85e228b4c7bc0738d1a213e71b0f7fb07d03a | [
"MIT"
] | null | null | null | ### soma de números
print('Iremos somar números ímpares que são múltiplos de 3')
s = 0
p = 0
for c in range(1,501,2):
print(c, end=' ')
if c%3==0:
p = p + 1
s = s + c
print('\nA soma de todos os números ímpares que são múltiplos de 3 é {}.\n O total de números múltiplos é {}.'.format(s, p)) | 31.5 | 124 | 0.596825 | ### soma de números
print('Iremos somar números ímpares que são múltiplos de 3')
s = 0
p = 0
for c in range(1,501,2):
print(c, end=' ')
if c%3==0:
p = p + 1
s = s + c
print('\nA soma de todos os números ímpares que são múltiplos de 3 é {}.\n O total de números múltiplos é {}.'.format(s, p)) | 0 | 0 | 0 |
cf5a28dbd86e8414bfaddf8c6202802aaaded915 | 14,327 | py | Python | testcases/OpenStack/vPing/vping_util.py | rski/functest-mirror | 7a2538438eab7a406c821acd7c72352f4a6ba364 | [
"Apache-2.0"
] | null | null | null | testcases/OpenStack/vPing/vping_util.py | rski/functest-mirror | 7a2538438eab7a406c821acd7c72352f4a6ba364 | [
"Apache-2.0"
] | null | null | null | testcases/OpenStack/vPing/vping_util.py | rski/functest-mirror | 7a2538438eab7a406c821acd7c72352f4a6ba364 | [
"Apache-2.0"
] | null | null | null | import os
import pprint
import re
import sys
import time
import paramiko
from scp import SCPClient
import functest.utils.functest_utils as ft_utils
import functest.utils.openstack_utils as os_utils
FUNCTEST_REPO = ft_utils.FUNCTEST_REPO
NAME_VM_1 = ft_utils.get_functest_config('vping.vm_name_1')
NAME_VM_2 = ft_utils... | 31.010823 | 79 | 0.580024 | import os
import pprint
import re
import sys
import time
import paramiko
from scp import SCPClient
import functest.utils.functest_utils as ft_utils
import functest.utils.openstack_utils as os_utils
FUNCTEST_REPO = ft_utils.FUNCTEST_REPO
NAME_VM_1 = ft_utils.get_functest_config('vping.vm_name_1')
NAME_VM_2 = ft_utils... | 12,151 | 0 | 529 |
3628d9d479bbe8458d81ca54ccbdce2f1d00cf41 | 919 | py | Python | src/analysis/duration/warping.py | EstevaoVieira/spikelearn | 060206558cc37c31493f1c9f01412d90375403cb | [
"MIT"
] | null | null | null | src/analysis/duration/warping.py | EstevaoVieira/spikelearn | 060206558cc37c31493f1c9f01412d90375403cb | [
"MIT"
] | null | null | null | src/analysis/duration/warping.py | EstevaoVieira/spikelearn | 060206558cc37c31493f1c9f01412d90375403cb | [
"MIT"
] | null | null | null | from spikelearn.data import io, select, to_feature_array, SHORTCUTS
from spikelearn.models.shuffle_decoding import shuffle_cross_predict
from catboost import CatBoostClassifier
from sklearn.linear_model import BayesianRidgeRegression
import pickle
allres = {}
for rat, dset in product(SHORTCUTS['group']['eletro'], DSE... | 45.95 | 80 | 0.713819 | from spikelearn.data import io, select, to_feature_array, SHORTCUTS
from spikelearn.models.shuffle_decoding import shuffle_cross_predict
from catboost import CatBoostClassifier
from sklearn.linear_model import BayesianRidgeRegression
import pickle
allres = {}
for rat, dset in product(SHORTCUTS['group']['eletro'], DSE... | 0 | 0 | 0 |
5ae2e5d8421127ef312b8bedb5149f9d2700c48b | 798 | py | Python | pytrade/__broker/__init__.py | sasano8/magnet-migrade | b5669b34a6a3b845df8df96dfedaf967df6b88e2 | [
"MIT"
] | null | null | null | pytrade/__broker/__init__.py | sasano8/magnet-migrade | b5669b34a6a3b845df8df96dfedaf967df6b88e2 | [
"MIT"
] | 4 | 2021-03-24T23:38:22.000Z | 2021-03-31T07:24:30.000Z | pytrade/__broker/__init__.py | sasano8/magnet-migrade | b5669b34a6a3b845df8df96dfedaf967df6b88e2 | [
"MIT"
] | null | null | null | from decimal import Decimal
from .. import logic
from ..portfolio import VirtualAccount
# class Calculator:
# def __init__(self, allocated_margin: Decimal):
# self.margin = allocated_margin
# def calc_amount_and_round_by_unit(self, real_price: Decimal, min_unit: Decimal):
# return logic.calc_... | 33.25 | 86 | 0.692982 | from decimal import Decimal
from .. import logic
from ..portfolio import VirtualAccount
# class Calculator:
# def __init__(self, allocated_margin: Decimal):
# self.margin = allocated_margin
# def calc_amount_and_round_by_unit(self, real_price: Decimal, min_unit: Decimal):
# return logic.calc_... | 0 | 0 | 0 |
077cd167f7e416bf1feacdd22f3ce9f5d2b54a8e | 9,897 | py | Python | codes/data_scripts/extract_subimages.py | Yangzhen0000/EDVR | 388ae869a1b4e2e6399f5feeea1f3acc969a3c75 | [
"Apache-2.0"
] | null | null | null | codes/data_scripts/extract_subimages.py | Yangzhen0000/EDVR | 388ae869a1b4e2e6399f5feeea1f3acc969a3c75 | [
"Apache-2.0"
] | null | null | null | codes/data_scripts/extract_subimages.py | Yangzhen0000/EDVR | 388ae869a1b4e2e6399f5feeea1f3acc969a3c75 | [
"Apache-2.0"
] | null | null | null | """A multi-thread tool to crop large images to sub-images for faster IO."""
import os
import os.path as osp
import sys
from multiprocessing import Pool
import numpy as np
import cv2
from PIL import Image
sys.path.append(osp.dirname(osp.dirname(osp.abspath(__file__))))
from utils.util import ProgressBar # noqa: E402
im... | 40.896694 | 131 | 0.579469 | """A multi-thread tool to crop large images to sub-images for faster IO."""
import os
import os.path as osp
import sys
from multiprocessing import Pool
import numpy as np
import cv2
from PIL import Image
sys.path.append(osp.dirname(osp.dirname(osp.abspath(__file__))))
from utils.util import ProgressBar # noqa: E402
im... | 9,399 | 0 | 92 |
a6c5666bb6e7e97b7a610fc225c2db5329510d51 | 9,818 | py | Python | synthetic/synthetic_utils.py | mlaugharn/EB_GFN | 2d20b5d37edb9c50e0bc0fb7feedbc390ddfefd7 | [
"MIT"
] | 24 | 2022-02-04T01:48:01.000Z | 2022-03-10T19:01:38.000Z | synthetic/synthetic_utils.py | mlaugharn/EB_GFN | 2d20b5d37edb9c50e0bc0fb7feedbc390ddfefd7 | [
"MIT"
] | null | null | null | synthetic/synthetic_utils.py | mlaugharn/EB_GFN | 2d20b5d37edb9c50e0bc0fb7feedbc390ddfefd7 | [
"MIT"
] | 5 | 2022-03-06T10:44:41.000Z | 2022-03-10T19:01:40.000Z | import torch as T
import torch
import torch.nn.functional as F
import numpy as np
import tqdm
import random
import sys, os
from matplotlib import pyplot as plt
from sympy.combinatorics.graycode import GrayCode
import time
import ipdb
from torch.autograd import Variable, Function
def pairwise_distances(x, y=No... | 32.40264 | 116 | 0.574659 | import torch as T
import torch
import torch.nn.functional as F
import numpy as np
import tqdm
import random
import sys, os
from matplotlib import pyplot as plt
from sympy.combinatorics.graycode import GrayCode
import time
import ipdb
def get_true_samples(db, size, bm, int_salce, discrete_dim, seed=None):
if see... | 8,301 | 10 | 490 |