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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0efaecb6691920ae4e16e6c7986dfb8538105b96 | 9,189 | py | Python | deepobs/tensorflow/testproblems/tolstoi_char_rnn.py | H0merJayS1mpson/deepobscustom | e85816ce42466326dac18841c58b79f87a4a1a7c | [
"MIT"
] | null | null | null | deepobs/tensorflow/testproblems/tolstoi_char_rnn.py | H0merJayS1mpson/deepobscustom | e85816ce42466326dac18841c58b79f87a4a1a7c | [
"MIT"
] | null | null | null | deepobs/tensorflow/testproblems/tolstoi_char_rnn.py | H0merJayS1mpson/deepobscustom | e85816ce42466326dac18841c58b79f87a4a1a7c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""A two-layer LSTM for character-level language modelling on Tolstoi's War and Peace."""
import tensorflow as tf
from ..datasets.tolstoi import tolstoi
from .testproblem import TestProblem
class tolstoi_char_rnn(TestProblem):
"""DeepOBS test problem class for a two-layer LSTM for charac... | 37.971074 | 89 | 0.616716 | # -*- coding: utf-8 -*-
"""A two-layer LSTM for character-level language modelling on Tolstoi's War and Peace."""
import tensorflow as tf
from ..datasets.tolstoi import tolstoi
from .testproblem import TestProblem
class tolstoi_char_rnn(TestProblem):
"""DeepOBS test problem class for a two-layer LSTM for charac... | 0 | 0 | 0 |
68a8fbe161e5eea1b7487e0de4fee1fdbbed936c | 328 | py | Python | SonodaUmi/camera.py | Aperturedimigo/PL | 52ac2fe878a72b74ac0ab0b33678fbdc54724d93 | [
"MIT"
] | null | null | null | SonodaUmi/camera.py | Aperturedimigo/PL | 52ac2fe878a72b74ac0ab0b33678fbdc54724d93 | [
"MIT"
] | null | null | null | SonodaUmi/camera.py | Aperturedimigo/PL | 52ac2fe878a72b74ac0ab0b33678fbdc54724d93 | [
"MIT"
] | null | null | null | from io import BytesIO
from time import sleep
from PyQt5.QtGui import QPixmap
from picamera import PiCamera
# Create an in-memory stream
my_stream = BytesIO()
camera = PiCamera()
camera.start_preview()
# Camera warm-up time
sleep(100)
camera.capture(my_stream, 'jpeg')
qp = QPixmap()
qp.loadFromData(my... | 20.5 | 34 | 0.743902 | from io import BytesIO
from time import sleep
from PyQt5.QtGui import QPixmap
from picamera import PiCamera
# Create an in-memory stream
my_stream = BytesIO()
camera = PiCamera()
camera.start_preview()
# Camera warm-up time
sleep(100)
camera.capture(my_stream, 'jpeg')
qp = QPixmap()
qp.loadFromData(my... | 0 | 0 | 0 |
e113e51f680ef8d827fb3dad26bbcfd40f3e92fd | 386 | py | Python | smart_pathlib/local_file.py | gfournier/smart_pathlib | bcb3c5b778728c26ec5c1eb519bdf720fb9d8e2b | [
"MIT"
] | null | null | null | smart_pathlib/local_file.py | gfournier/smart_pathlib | bcb3c5b778728c26ec5c1eb519bdf720fb9d8e2b | [
"MIT"
] | 1 | 2021-02-13T10:32:54.000Z | 2021-02-14T06:26:43.000Z | smart_pathlib/local_file.py | gfournier/smart_pathlib | bcb3c5b778728c26ec5c1eb519bdf720fb9d8e2b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2021 Guillaume Fournier <fournierg@gmail.com>
#
# This file is forked from `smart_open` project.
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
#
import os
SCHEME = 'file'
| 17.545455 | 61 | 0.699482 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2021 Guillaume Fournier <fournierg@gmail.com>
#
# This file is forked from `smart_open` project.
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
#
import os
SCHEME = 'file'
def exists(uri, transport_params):
return os.path.exist... | 79 | 0 | 46 |
ccd8b22a004ce890bc47555740c37e7c9057141d | 11,254 | py | Python | DPrepB-C/pipe.py | SKA-ScienceDataProcessor/SIP-DPrep | 7b98bfa4d9f76c6f8bafcb97613e2533cc9426fd | [
"Apache-2.0"
] | 1 | 2019-01-23T13:03:42.000Z | 2019-01-23T13:03:42.000Z | DPrepB-C/pipe.py | SKA-ScienceDataProcessor/SIP-DPrep | 7b98bfa4d9f76c6f8bafcb97613e2533cc9426fd | [
"Apache-2.0"
] | null | null | null | DPrepB-C/pipe.py | SKA-ScienceDataProcessor/SIP-DPrep | 7b98bfa4d9f76c6f8bafcb97613e2533cc9426fd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
__author__ = "Jamie Farnes"
__email__ = "jamie.farnes@oerc.ox.ac.uk"
import os
import time as t
import subprocess
import argparse
import numpy as np
from processing_components.image.operations import import_image_from_fits, export_image_to_fits, \
qa_image
from processing_components.visibi... | 40.775362 | 146 | 0.631242 | #!/usr/bin/env python
__author__ = "Jamie Farnes"
__email__ = "jamie.farnes@oerc.ox.ac.uk"
import os
import time as t
import subprocess
import argparse
import numpy as np
from processing_components.image.operations import import_image_from_fits, export_image_to_fits, \
qa_image
from processing_components.visibi... | 341 | 0 | 26 |
3d52c66f7bcb248488ef7201e07b465f69d919be | 3,420 | py | Python | tests/test_voronoi_layer.py | LaurenceWarne/maplayerpy | fd5cd97a37023740bd25fa54773702ff1039427e | [
"MIT"
] | null | null | null | tests/test_voronoi_layer.py | LaurenceWarne/maplayerpy | fd5cd97a37023740bd25fa54773702ff1039427e | [
"MIT"
] | null | null | null | tests/test_voronoi_layer.py | LaurenceWarne/maplayerpy | fd5cd97a37023740bd25fa54773702ff1039427e | [
"MIT"
] | null | null | null | import random
import numpy as np
import pytest
from maplayerpy.voronoi_layer import (VoronoiLayer, get_random_points_spaced,
get_random_voronoi_layer,
get_voronoi_layer)
@pytest.mark.voronoi_img
| 28.5 | 78 | 0.531579 | import random
import numpy as np
import pytest
from maplayerpy.voronoi_layer import (VoronoiLayer, get_random_points_spaced,
get_random_voronoi_layer,
get_voronoi_layer)
@pytest.mark.voronoi_img
def test_voronoi_img():
import cv2
no_... | 2,908 | 0 | 229 |
7a4bd9a6886f8c29b1fa8048bb6eb5fb2add74ce | 721 | py | Python | meetup/meetup.py | gordonli08/Exercism-python | ff3d79ccc61bac7475641ee6c2f19a0367e3e254 | [
"MIT"
] | null | null | null | meetup/meetup.py | gordonli08/Exercism-python | ff3d79ccc61bac7475641ee6c2f19a0367e3e254 | [
"MIT"
] | null | null | null | meetup/meetup.py | gordonli08/Exercism-python | ff3d79ccc61bac7475641ee6c2f19a0367e3e254 | [
"MIT"
] | null | null | null | import calendar
from datetime import date
days = dict(zip(list(calendar.day_name),range(7)))
week_dict = {
"1st":0,
"2nd":1,
"3rd":2,
"4th":3,
"5th":4,
"teenth":[13,14,15,16,17,18,19]
}
| 21.205882 | 119 | 0.665742 | import calendar
from datetime import date
days = dict(zip(list(calendar.day_name),range(7)))
week_dict = {
"1st":0,
"2nd":1,
"3rd":2,
"4th":3,
"5th":4,
"teenth":[13,14,15,16,17,18,19]
}
class MeetupDayException(Exception):
pass
def meetup(year, month, week, day_of_week):
dates = [day for day in calendar.Cal... | 456 | 21 | 46 |
eca3d5f34519de179ccbe03ab98a5386b8d0d81b | 9,635 | py | Python | flask_gatekeeper/gatekeeper.py | k0rventen/flask-gatekeeper | 9a3457f56aa7c43d0a7f4f40dd44acb7098b635a | [
"MIT"
] | 1 | 2021-05-02T16:56:40.000Z | 2021-05-02T16:56:40.000Z | flask_gatekeeper/gatekeeper.py | k0rventen/flask-gatekeeper | 9a3457f56aa7c43d0a7f4f40dd44acb7098b635a | [
"MIT"
] | null | null | null | flask_gatekeeper/gatekeeper.py | k0rventen/flask-gatekeeper | 9a3457f56aa7c43d0a7f4f40dd44acb7098b635a | [
"MIT"
] | null | null | null | """A (very) simple banning & rate limiting extension for Flask.
"""
from inspect import signature
import time
from collections import deque
from functools import wraps
from flask import request
| 43.795455 | 186 | 0.643591 | """A (very) simple banning & rate limiting extension for Flask.
"""
from inspect import signature
import time
from collections import deque
from functools import wraps
from flask import request
class IP:
def __init__(self, ban_count, rate_count):
"""IP record that keeps track of reports and requests made... | 825 | 8,567 | 46 |
4cfdd6601c7b7cb48ab20b417f8a158c7c931b5b | 127 | py | Python | uptee/messaging/urls.py | teeworldsCNFun/upTee | 1c04b7421f4834f83bbb9f59f43dfebac08e56b0 | [
"BSD-3-Clause"
] | 2 | 2018-12-26T18:48:58.000Z | 2021-07-20T23:41:14.000Z | uptee/messaging/urls.py | teeworldsCNFun/upTee | 1c04b7421f4834f83bbb9f59f43dfebac08e56b0 | [
"BSD-3-Clause"
] | 13 | 2015-01-20T19:18:10.000Z | 2022-03-07T21:35:55.000Z | uptee/messaging/urls.py | teeworldsCNFun/upTee | 1c04b7421f4834f83bbb9f59f43dfebac08e56b0 | [
"BSD-3-Clause"
] | 3 | 2015-12-04T20:10:50.000Z | 2022-01-24T12:31:09.000Z | from django.conf.urls import *
urlpatterns = patterns('messaging.views',
url(r'^contact/$', 'contact', name='contact'),
)
| 21.166667 | 50 | 0.677165 | from django.conf.urls import *
urlpatterns = patterns('messaging.views',
url(r'^contact/$', 'contact', name='contact'),
)
| 0 | 0 | 0 |
07201b67beeaf697ef36f79b77817d9b58e7ce68 | 1,022 | py | Python | data_processing/ddh5_Plotting/ddh5_freq_sweep_plotting.py | PITT-HATLAB/data_processing | ad49bb921e0fc90b90f0b696e2cbb662019f5f40 | [
"MIT"
] | null | null | null | data_processing/ddh5_Plotting/ddh5_freq_sweep_plotting.py | PITT-HATLAB/data_processing | ad49bb921e0fc90b90f0b696e2cbb662019f5f40 | [
"MIT"
] | null | null | null | data_processing/ddh5_Plotting/ddh5_freq_sweep_plotting.py | PITT-HATLAB/data_processing | ad49bb921e0fc90b90f0b696e2cbb662019f5f40 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 1 14:02:03 2021
@author: Hatlab_3
for getting many files out of a particular directory with Wolfie's directory structure'
"""
import easygui
import os
from plottr.apps.autoplot import autoplotDDH5, script, main
from plottr.data.datadict_storage import all_datadicts_fro... | 28.388889 | 87 | 0.588063 | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 1 14:02:03 2021
@author: Hatlab_3
for getting many files out of a particular directory with Wolfie's directory structure'
"""
import easygui
import os
from plottr.apps.autoplot import autoplotDDH5, script, main
from plottr.data.datadict_storage import all_datadicts_fro... | 530 | 0 | 23 |
855d2ad3e5d79cc0741d1688a292b12f7917267d | 283 | py | Python | fabfile/helper/print_helper.py | kurochan/config-collector | 656da97eb219eb5bcf913173dd7aa76d0cedd44c | [
"MIT"
] | 1 | 2017-07-30T17:35:10.000Z | 2017-07-30T17:35:10.000Z | fabfile/helper/print_helper.py | kurochan/config-collector | 656da97eb219eb5bcf913173dd7aa76d0cedd44c | [
"MIT"
] | null | null | null | fabfile/helper/print_helper.py | kurochan/config-collector | 656da97eb219eb5bcf913173dd7aa76d0cedd44c | [
"MIT"
] | 1 | 2015-03-01T08:52:14.000Z | 2015-03-01T08:52:14.000Z | # -*- coding: utf-8 -*-
from fabric.api import env
from fabric.utils import puts
from fabric.colors import *
| 25.727273 | 46 | 0.628975 | # -*- coding: utf-8 -*-
from fabric.api import env
from fabric.utils import puts
from fabric.colors import *
def task_puts(msg = "", task = None):
if task is None and "task_name" in env:
task = env.task_name
line = "[{0}] {1}".format(cyan(task), msg)
puts(line)
| 151 | 0 | 23 |
55b76ff148dc504b10e22a1f063c39dd2e7c80c6 | 1,145 | py | Python | app/migrations/0002_auto_20160213_1140.py | AxiaCore/Mission-Control-Dashboard | fd2611a00b5ec124d3f1b1e93dea87e428ab3af2 | [
"MIT"
] | null | null | null | app/migrations/0002_auto_20160213_1140.py | AxiaCore/Mission-Control-Dashboard | fd2611a00b5ec124d3f1b1e93dea87e428ab3af2 | [
"MIT"
] | null | null | null | app/migrations/0002_auto_20160213_1140.py | AxiaCore/Mission-Control-Dashboard | fd2611a00b5ec124d3f1b1e93dea87e428ab3af2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-13 16:40
from __future__ import unicode_literals
from django.db import migrations, models
| 30.945946 | 114 | 0.557205 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-13 16:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 0 | 967 | 23 |
6f30935d0f151c9c3481de0b6bf62bbce0ab35f3 | 2,790 | py | Python | aiogremlin/exceptions.py | platinummonkey/trolliusgremlin | eae145c94f5943eb6d616ea2b44a9368715bba92 | [
"MIT"
] | null | null | null | aiogremlin/exceptions.py | platinummonkey/trolliusgremlin | eae145c94f5943eb6d616ea2b44a9368715bba92 | [
"MIT"
] | null | null | null | aiogremlin/exceptions.py | platinummonkey/trolliusgremlin | eae145c94f5943eb6d616ea2b44a9368715bba92 | [
"MIT"
] | null | null | null | """Gremlin Server exceptions."""
__all__ = ("RequestError", "GremlinServerError")
| 44.285714 | 79 | 0.548746 | """Gremlin Server exceptions."""
__all__ = ("RequestError", "GremlinServerError")
class StatusException(IOError):
def __init__(self, value, result):
"""Handle all exceptions returned from the Gremlin Server.
"""
self.value = value
self.response = {
498: ("MALFORMED_RE... | 0 | 2,635 | 69 |
d6663a939d1d15909186d6dd9f28d2414d0e46be | 1,599 | py | Python | u24_lymphocyte/third_party/treeano/sandbox/nodes/tests/stochastic_pooling_test.py | ALSM-PhD/quip_classification | 7347bfaa5cf11ae2d7a528fbcc43322a12c795d3 | [
"BSD-3-Clause"
] | 45 | 2015-04-26T04:45:51.000Z | 2022-01-24T15:03:55.000Z | u24_lymphocyte/third_party/treeano/sandbox/nodes/tests/stochastic_pooling_test.py | ALSM-PhD/quip_classification | 7347bfaa5cf11ae2d7a528fbcc43322a12c795d3 | [
"BSD-3-Clause"
] | 8 | 2018-07-20T20:54:51.000Z | 2020-06-12T05:36:04.000Z | u24_lymphocyte/third_party/treeano/sandbox/nodes/tests/stochastic_pooling_test.py | ALSM-PhD/quip_classification | 7347bfaa5cf11ae2d7a528fbcc43322a12c795d3 | [
"BSD-3-Clause"
] | 22 | 2018-05-21T23:57:20.000Z | 2022-02-21T00:48:32.000Z | import nose.tools as nt
import numpy as np
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
from treeano.sandbox.nodes import stochastic_pooling
fX = theano.config.floatX
| 33.3125 | 75 | 0.539712 | import nose.tools as nt
import numpy as np
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
from treeano.sandbox.nodes import stochastic_pooling
fX = theano.config.floatX
def test_stochastic_pool_2d_node_serialization():
tn.check_serialization(stochastic_pooling.StochasticPool2D... | 1,321 | 0 | 69 |
76a48b1067ecfc79ed31c9d5ec55e4f9418cc5f4 | 5,984 | py | Python | src/main.py | JustWhit3/WaveNCC | a2575028e1b03f3d4161474fa415e15a434f5314 | [
"MIT"
] | 3 | 2022-02-12T20:34:09.000Z | 2022-03-12T02:00:30.000Z | src/main.py | JustWhit3/WaveNCC | a2575028e1b03f3d4161474fa415e15a434f5314 | [
"MIT"
] | 1 | 2022-02-04T09:35:53.000Z | 2022-02-04T09:36:20.000Z | src/main.py | JustWhit3/WaveNCC | a2575028e1b03f3d4161474fa415e15a434f5314 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 21 12:32:00 2022
Author: Gianluca Bianco
"""
#################################################
# Libraries
#################################################
import sys, os
import functions as ft
from termcolor import colored
import numpy as np
f... | 43.05036 | 125 | 0.472259 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 21 12:32:00 2022
Author: Gianluca Bianco
"""
#################################################
# Libraries
#################################################
import sys, os
import functions as ft
from termcolor import colored
import numpy as np
f... | 5,378 | 0 | 23 |
c14ec39cd557953ad7c55b6bf474f5e403ef1418 | 1,022 | py | Python | filtered_csv.py | tamarakatic/github-users-distance | 3b50e17327e30702ed387947066e0f45874f6bff | [
"MIT"
] | null | null | null | filtered_csv.py | tamarakatic/github-users-distance | 3b50e17327e30702ed387947066e0f45874f6bff | [
"MIT"
] | null | null | null | filtered_csv.py | tamarakatic/github-users-distance | 3b50e17327e30702ed387947066e0f45874f6bff | [
"MIT"
] | 1 | 2019-10-03T16:43:54.000Z | 2019-10-03T16:43:54.000Z | import pandas as pd
import json
from io import StringIO
df = pd.read_csv('data/2012_05_06.csv')
nan_index = df[(df['type'] == 'MemberEvent') & df.isnull().any(axis=1)].index
df = df.drop(nan_index)
df = df.apply(filter_data, axis=1)
print("\n Writing to CSV file...")
df.to_csv('filter/2012_05_06.csv', sep='\t')
pr... | 24.926829 | 77 | 0.610568 | import pandas as pd
import json
from io import StringIO
df = pd.read_csv('data/2012_05_06.csv')
nan_index = df[(df['type'] == 'MemberEvent') & df.isnull().any(axis=1)].index
df = df.drop(nan_index)
def remove_prefix(text, prefix):
if text.startswith(prefix):
return text[len(prefix):]
return text
de... | 640 | 0 | 46 |
a7472a869ed41690dcea7cd34560243e5d8649aa | 7,808 | py | Python | scripts/fixedpeers-check.py | douglaslins1606/axewallet-ios | ee8c91a8e984b4ceac73854cdfab31f7907991ac | [
"MIT"
] | 1 | 2018-12-09T18:37:11.000Z | 2018-12-09T18:37:11.000Z | scripts/fixedpeers-check.py | douglaslins1606/axewallet-ios | ee8c91a8e984b4ceac73854cdfab31f7907991ac | [
"MIT"
] | null | null | null | scripts/fixedpeers-check.py | douglaslins1606/axewallet-ios | ee8c91a8e984b4ceac73854cdfab31f7907991ac | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
##
## Compatible with Python >= 2.6, < 3.*
##
##
## Created by Andrew Podkovyrin, 2018
## Copyright © 2018 Axe Foundation. All rights reserved.
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentat... | 31.611336 | 117 | 0.635886 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
##
## Compatible with Python >= 2.6, < 3.*
##
##
## Created by Andrew Podkovyrin, 2018
## Copyright © 2018 Axe Foundation. All rights reserved.
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentat... | 5,466 | 0 | 138 |
4c384c0e524ba4cebcbaf0654fb126a4ea7e691b | 2,456 | py | Python | odoo-13.0/addons/l10n_de_skr03/__manifest__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | odoo-13.0/addons/l10n_de_skr03/__manifest__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | odoo-13.0/addons/l10n_de_skr03/__manifest__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# SKR03
# =====
# Dieses Modul bietet Ihnen einen deutschen Kontenplan basierend auf dem SKR03.
# Gemäss der aktuellen Einstellungen ist ein neues Unternehmen in Odoo
# Umsatzsteuerpflichtig. Zahlreiche Erlös- und Aufwa... | 42.344828 | 79 | 0.728827 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# SKR03
# =====
# Dieses Modul bietet Ihnen einen deutschen Kontenplan basierend auf dem SKR03.
# Gemäss der aktuellen Einstellungen ist ein neues Unternehmen in Odoo
# Umsatzsteuerpflichtig. Zahlreiche Erlös- und Aufwa... | 0 | 0 | 0 |
40b6bda9b75117b8ec9657879e6d3735b2ad1d21 | 950 | py | Python | jp.atcoder/abc057/abc057_d/8220196.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc057/abc057_d/8220196.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc057/abc057_d/8220196.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | from statistics import mean
n, a, b = [int(_) for _ in input().split()]
values = [int(v) for v in input().split()]
values.sort(reverse=True)
maximum_mean = mean(values[:a])
print(maximum_mean)
min_value = values[:a][-1]
accepted = values[:a].count(min_value)
full = values.count(min_value)
print(cmb(f... | 22.619048 | 50 | 0.502105 | from statistics import mean
n, a, b = [int(_) for _ in input().split()]
values = [int(v) for v in input().split()]
values.sort(reverse=True)
maximum_mean = mean(values[:a])
print(maximum_mean)
min_value = values[:a][-1]
accepted = values[:a].count(min_value)
full = values.count(min_value)
def cmb(n, r)... | 588 | 0 | 25 |
8f52d8cb0c71819be36701d3d2402be0ecf90285 | 2,200 | py | Python | tests/test_items/test_tasks.py | gtdavidv/exchangelib | d7041b6a96b6f2cda25ef528358e0245c8d79bd4 | [
"BSD-2-Clause"
] | null | null | null | tests/test_items/test_tasks.py | gtdavidv/exchangelib | d7041b6a96b6f2cda25ef528358e0245c8d79bd4 | [
"BSD-2-Clause"
] | null | null | null | tests/test_items/test_tasks.py | gtdavidv/exchangelib | d7041b6a96b6f2cda25ef528358e0245c8d79bd4 | [
"BSD-2-Clause"
] | null | null | null | from decimal import Decimal
from exchangelib.ewsdatetime import EWSDateTime, EWSTimeZone, UTC_NOW
from exchangelib.folders import Tasks
from exchangelib.items import Task
from .test_basics import CommonItemTest
| 40.740741 | 116 | 0.688636 | from decimal import Decimal
from exchangelib.ewsdatetime import EWSDateTime, EWSTimeZone, UTC_NOW
from exchangelib.folders import Tasks
from exchangelib.items import Task
from .test_basics import CommonItemTest
class TasksTest(CommonItemTest):
TEST_FOLDER = 'tasks'
FOLDER_CLASS = Tasks
ITEM_CLASS = Task... | 1,825 | 138 | 23 |
e68ed84d5c4168fba87f5ab45d7c79625c4d8b61 | 241 | py | Python | Custom Exceptions.py | NewLife1324/PyStorage | 3ec9dcd92210baf3fda147f1c3f7266e905e041c | [
"MIT"
] | null | null | null | Custom Exceptions.py | NewLife1324/PyStorage | 3ec9dcd92210baf3fda147f1c3f7266e905e041c | [
"MIT"
] | null | null | null | Custom Exceptions.py | NewLife1324/PyStorage | 3ec9dcd92210baf3fda147f1c3f7266e905e041c | [
"MIT"
] | null | null | null | # My Exception
print('hello')
raise Other('a') | 21.909091 | 39 | 0.655602 | # My Exception
print('hello')
class NewLifeUtilsWorkError(Exception):
def __init__(self, text):
self.txt = text
class Other(NewLifeUtilsWorkError):
def __init__(self, text):
self.txt = text
raise Other('a') | 56 | 33 | 97 |
0414f49b201a169a4310448215ca028b77ddbe20 | 4,017 | py | Python | preprocessing/stationarity.py | kbrezinski/complexity | 2077825c8ec64df03dfb9f791b7578d64cb35567 | [
"MIT"
] | null | null | null | preprocessing/stationarity.py | kbrezinski/complexity | 2077825c8ec64df03dfb9f791b7578d64cb35567 | [
"MIT"
] | null | null | null | preprocessing/stationarity.py | kbrezinski/complexity | 2077825c8ec64df03dfb9f791b7578d64cb35567 | [
"MIT"
] | null | null | null |
from statsmodels.tsa.stattools import adfuller,kpss
import warnings
def determine_interval(intervals,df,labels):
"""
@Author: Kenneth Brezinski, Department of Electrical and Computer Engineering
args:
df: pandas dataframe containing your time series
intervals: how many subintervals will b... | 26.084416 | 106 | 0.566592 |
from statsmodels.tsa.stattools import adfuller,kpss
import warnings
def fuller_test(interval,y):
## Diadic: 2 or Triadic: 3 shopping
cond = False
result = adfuller(y)
if result[4]['5%'] > result[0]:
print('Stationary interval found at frame size equal to epoch')
cond = True
f... | 2,920 | 0 | 69 |
84f3f9c8916a8b8e43e44b2871b160f4c105be8b | 229 | py | Python | test/ndds2coco/gen_measure_video.py | HienDT27/annotation_utils | 1f4e95f4cfa08de5bbab20f90a6a75fba66a69b9 | [
"MIT"
] | 13 | 2020-01-28T04:45:22.000Z | 2022-03-10T03:35:49.000Z | test/ndds2coco/gen_measure_video.py | HienDT27/annotation_utils | 1f4e95f4cfa08de5bbab20f90a6a75fba66a69b9 | [
"MIT"
] | 4 | 2020-02-14T08:56:03.000Z | 2021-05-21T10:38:30.000Z | test/ndds2coco/gen_measure_video.py | HienDT27/annotation_utils | 1f4e95f4cfa08de5bbab20f90a6a75fba66a69b9 | [
"MIT"
] | 7 | 2020-04-10T07:56:25.000Z | 2021-12-17T11:19:23.000Z | from annotation_utils.coco.structs import COCO_Dataset
dataset = COCO_Dataset.load_from_path('measure_coco/measure/output.json')
dataset.save_video(
save_path='merged_mask_measure_viz.mp4',
show_details=True,
fps=3
) | 28.625 | 73 | 0.799127 | from annotation_utils.coco.structs import COCO_Dataset
dataset = COCO_Dataset.load_from_path('measure_coco/measure/output.json')
dataset.save_video(
save_path='merged_mask_measure_viz.mp4',
show_details=True,
fps=3
) | 0 | 0 | 0 |
5eaf5c8b4d9ffedf67fc03e6f5309032f0ac74c7 | 5,776 | py | Python | utils/data_handle.py | Taltalite/Chamaeleo_HEDGES | 259a3608c60ecc6adf7ed1485adc4226b09bddb4 | [
"MIT"
] | null | null | null | utils/data_handle.py | Taltalite/Chamaeleo_HEDGES | 259a3608c60ecc6adf7ed1485adc4226b09bddb4 | [
"MIT"
] | null | null | null | utils/data_handle.py | Taltalite/Chamaeleo_HEDGES | 259a3608c60ecc6adf7ed1485adc4226b09bddb4 | [
"MIT"
] | null | null | null | import gzip
import pickle
import struct
from warnings import warn
import math
import os
from Chamaeleo.utils.monitor import Monitor
| 29.620513 | 110 | 0.566828 | import gzip
import pickle
import struct
from warnings import warn
import math
import os
from Chamaeleo.utils.monitor import Monitor
def read_bits_from_str(string, segment_length=120, need_logs=False):
monitor = Monitor()
if need_logs:
print("Read binary matrix from string: " + string)
data = [... | 5,402 | 0 | 230 |
edc22c0a09a19a1b803f3775127300f30edcdb08 | 6,218 | py | Python | tests/test_hgvs_validator.py | jmuhlich/hgvs | 26aba8877791b0f94f1e14a5a49c60bcdaf2e6fd | [
"Apache-2.0"
] | null | null | null | tests/test_hgvs_validator.py | jmuhlich/hgvs | 26aba8877791b0f94f1e14a5a49c60bcdaf2e6fd | [
"Apache-2.0"
] | null | null | null | tests/test_hgvs_validator.py | jmuhlich/hgvs | 26aba8877791b0f94f1e14a5a49c60bcdaf2e6fd | [
"Apache-2.0"
] | 3 | 2016-08-08T03:04:37.000Z | 2020-01-16T08:56:16.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
from nose.plugins.attrib import attr
from hgvs.exceptions import HGVSValidationError
import hgvs.dataproviders.uta
import hgvs.variantmapper
import hgvs.parser
import hgvs.validator
db_dir = ['... | 49.349206 | 134 | 0.741396 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
from nose.plugins.attrib import attr
from hgvs.exceptions import HGVSValidationError
import hgvs.dataproviders.uta
import hgvs.variantmapper
import hgvs.parser
import hgvs.validator
db_dir = ['... | 281 | 0 | 81 |
c26cbe03b112f329b82be2d9927dce7d09567cc3 | 2,128 | py | Python | f0027/f0027.py | soda-lab/Features | 1d94c0f6343d36d9e5b1e150311e4e7ccdf0b7d9 | [
"Unlicense"
] | null | null | null | f0027/f0027.py | soda-lab/Features | 1d94c0f6343d36d9e5b1e150311e4e7ccdf0b7d9 | [
"Unlicense"
] | 1 | 2019-05-05T03:45:14.000Z | 2019-05-09T05:04:00.000Z | f0027/f0027.py | soda-lab/Features | 1d94c0f6343d36d9e5b1e150311e4e7ccdf0b7d9 | [
"Unlicense"
] | null | null | null | from qgis.core import *
from PyQt5.QtCore import *
# This is necessary for the processing to work ### Otherwise get "algorithm not found" error
from qgis.analysis import QgsNativeAlgorithms
import sys
import os
QgsApplication.setPrefixPath("/usr",True)
# Starts the application, with False to not launch t... | 32.242424 | 170 | 0.711936 | from qgis.core import *
from PyQt5.QtCore import *
# This is necessary for the processing to work ### Otherwise get "algorithm not found" error
from qgis.analysis import QgsNativeAlgorithms
import sys
import os
QgsApplication.setPrefixPath("/usr",True)
# Starts the application, with False to not launch t... | 0 | 0 | 0 |
fb74f0052b38b91d8368a5c21622053443eb043c | 468 | py | Python | modules/vtk_basic/vtkTreeWriter.py | chrisidefix/devide | 99bfe156e710fa47ba7ae88b0ce1eef592a3a439 | [
"BSD-3-Clause"
] | 25 | 2015-08-24T16:05:14.000Z | 2020-12-09T20:07:14.000Z | modules/vtk_basic/vtkTreeWriter.py | chrisidefix/devide | 99bfe156e710fa47ba7ae88b0ce1eef592a3a439 | [
"BSD-3-Clause"
] | 1 | 2016-02-16T21:18:10.000Z | 2016-02-16T21:18:10.000Z | modules/vtk_basic/vtkTreeWriter.py | chrisidefix/devide | 99bfe156e710fa47ba7ae88b0ce1eef592a3a439 | [
"BSD-3-Clause"
] | 5 | 2016-02-16T20:05:37.000Z | 2020-01-31T11:27:39.000Z | # class generated by DeVIDE::createDeVIDEModuleFromVTKObject
from module_kits.vtk_kit.mixins import SimpleVTKClassModuleBase
import vtk
| 36 | 63 | 0.702991 | # class generated by DeVIDE::createDeVIDEModuleFromVTKObject
from module_kits.vtk_kit.mixins import SimpleVTKClassModuleBase
import vtk
class vtkTreeWriter(SimpleVTKClassModuleBase):
def __init__(self, module_manager):
SimpleVTKClassModuleBase.__init__(
self, module_manager,
vtk.vtk... | 258 | 25 | 49 |
5c910944525a5cbf2bade339ba76bbc12e13c434 | 2,014 | py | Python | pipeline_diagnostics/list_patients_with_endpoints.py | ratschlab/circEWS | b2b1f00dac4f5d46856a2c7abe2ca4f12d4c612d | [
"MIT"
] | 34 | 2020-03-17T16:42:00.000Z | 2022-03-29T15:53:24.000Z | pipeline_diagnostics/list_patients_with_endpoints.py | ranxiao/circEWS | 1e52880c268f8f763bbc16763131634ffc217153 | [
"MIT"
] | 3 | 2020-07-30T22:37:10.000Z | 2021-08-10T00:02:30.000Z | pipeline_diagnostics/list_patients_with_endpoints.py | ranxiao/circEWS | 1e52880c268f8f763bbc16763131634ffc217153 | [
"MIT"
] | 14 | 2020-04-22T01:13:54.000Z | 2021-11-27T20:23:41.000Z | #!/usr/bin/env
# author: stephanie hyland
# make a list of PIDS with non-empty, non-all-unknown endpoint data
import pandas as pd
import glob
import ipdb
import paths
def check_list():
"""
slow but w/e
"""
pids_with_endpoints = open(paths.derived_dir + 'patients_with_endpoints_v6b.txt', 'r')
pids... | 44.755556 | 128 | 0.64995 | #!/usr/bin/env
# author: stephanie hyland
# make a list of PIDS with non-empty, non-all-unknown endpoint data
import pandas as pd
import glob
import ipdb
import paths
def compile_list():
pids_with_endpoints = open(paths.derived_dir + 'patients_with_endpoints_v6b.txt', 'w')
pids_without_endpoints = open(paths... | 874 | 0 | 23 |
2a7ef850855b2c58139264d487c67301ef1b98a4 | 5,713 | py | Python | django_cloud_deploy/tests/unit/cloudlib/project_test.py | wangxf123456/django-cloud-deploy | 82c4d5094c44a59226a294bd585dce67cec877c5 | [
"Apache-2.0"
] | 1 | 2019-02-12T21:41:18.000Z | 2019-02-12T21:41:18.000Z | django_cloud_deploy/tests/unit/cloudlib/project_test.py | DalavanCloud/django-cloud-deploy | ba81fc9698c57c0e23faccf25ad4480e3e416643 | [
"Apache-2.0"
] | null | null | null | django_cloud_deploy/tests/unit/cloudlib/project_test.py | DalavanCloud/django-cloud-deploy | ba81fc9698c57c0e23faccf25ad4480e3e416643 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | 36.621795 | 80 | 0.618064 | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | 3,913 | 0 | 456 |
9ac8ba85f5ea9dab46636ebe07853339f4ed00f8 | 15,167 | py | Python | couchbase/management/queries.py | kulabh/couchbase-python-client | eb52c53302dfa563e289f04af518d40b3921767b | [
"Apache-2.0"
] | 1 | 2021-04-22T14:46:06.000Z | 2021-04-22T14:46:06.000Z | couchbase/management/queries.py | kulabh/couchbase-python-client | eb52c53302dfa563e289f04af518d40b3921767b | [
"Apache-2.0"
] | 3 | 2021-04-19T14:57:20.000Z | 2021-05-14T12:29:50.000Z | couchbase/management/queries.py | kulabh/couchbase-python-client | eb52c53302dfa563e289f04af518d40b3921767b | [
"Apache-2.0"
] | null | null | null | from couchbase_core._ixmgmt import N1QL_PRIMARY_INDEX, IxmgmtRequest, N1qlIndex
from couchbase_core.bucketmanager import BucketManager
from couchbase.options import OptionBlock, OptionBlockTimeOut, forward_args, timedelta
from typing import *
from couchbase.management.generic import GenericManager
import attr
from attr... | 40.337766 | 149 | 0.616866 | from couchbase_core._ixmgmt import N1QL_PRIMARY_INDEX, IxmgmtRequest, N1qlIndex
from couchbase_core.bucketmanager import BucketManager
from couchbase.options import OptionBlock, OptionBlockTimeOut, forward_args, timedelta
from typing import *
from couchbase.management.generic import GenericManager
import attr
from attr... | 3,150 | 10,543 | 255 |
d9ac38d2b951b9772b4e8a6d5b30a7c8a86fe00a | 277 | py | Python | Libraries/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython-0.22-py2.7-macosx-10.5-intel.egg/Cython/Compiler/Parsing.py | mlewis1973/pyosirix | 77757744f250ea1e3be083f50dce70f7aa094c5d | [
"BSD-3-Clause"
] | 20 | 2016-02-02T10:31:41.000Z | 2021-11-08T08:35:25.000Z | Libraries/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython-0.22-py2.7-macosx-10.5-intel.egg/Cython/Compiler/Parsing.py | mlewis1973/pyosirix | 77757744f250ea1e3be083f50dce70f7aa094c5d | [
"BSD-3-Clause"
] | 7 | 2016-10-21T04:15:22.000Z | 2020-02-15T04:06:19.000Z | Libraries/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython-0.22-py2.7-macosx-10.5-intel.egg/Cython/Compiler/Parsing.py | mlewis1973/pyosirix | 77757744f250ea1e3be083f50dce70f7aa094c5d | [
"BSD-3-Clause"
] | 9 | 2018-01-24T21:46:10.000Z | 2022-03-08T09:42:42.000Z | __bootstrap__()
| 34.625 | 68 | 0.783394 | def __bootstrap__():
global __bootstrap__, __loader__, __file__
import sys, pkg_resources, imp
__file__ = pkg_resources.resource_filename(__name__,'Parsing.so')
__loader__ = None; del __bootstrap__, __loader__
imp.load_dynamic(__name__,__file__)
__bootstrap__()
| 239 | 0 | 22 |
a96c2651c4a1f0985f3702ac2a5074d6ad36c543 | 2,610 | py | Python | research/cv/AlignedReID++/src/samplers.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/AlignedReID++/src/samplers.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/AlignedReID++/src/samplers.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | """construct the sampler"""
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 37.285714 | 105 | 0.651724 | """construct the sampler"""
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 1,402 | 0 | 80 |
194e6fbbe2adf5e01ca6675eab03687e6daff993 | 1,748 | py | Python | model.py | Rahul-404/Handwritten-digit-recognition-MNIST | c20fca30c2cfc26e15c64b45e3065111e9c5b974 | [
"MIT"
] | null | null | null | model.py | Rahul-404/Handwritten-digit-recognition-MNIST | c20fca30c2cfc26e15c64b45e3065111e9c5b974 | [
"MIT"
] | null | null | null | model.py | Rahul-404/Handwritten-digit-recognition-MNIST | c20fca30c2cfc26e15c64b45e3065111e9c5b974 | [
"MIT"
] | null | null | null | import keras
from keras.datasets import mnist
from keras.utils.np_utils import to_categorical
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPool2D
from keras import backend as K
# the datam split between train and test
(X_train, y_train), (X_te... | 32.37037 | 118 | 0.756865 | import keras
from keras.datasets import mnist
from keras.utils.np_utils import to_categorical
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPool2D
from keras import backend as K
# the datam split between train and test
(X_train, y_train), (X_te... | 0 | 0 | 0 |
1c52441e909ea6338f7890e372f6689f12cc462d | 856 | py | Python | setup.py | FabricioSMarin/XRFtomo | f5c9f6411bea9a85082d943af873e83f81431e5a | [
"BSD-3-Clause"
] | null | null | null | setup.py | FabricioSMarin/XRFtomo | f5c9f6411bea9a85082d943af873e83f81431e5a | [
"BSD-3-Clause"
] | null | null | null | setup.py | FabricioSMarin/XRFtomo | f5c9f6411bea9a85082d943af873e83f81431e5a | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='xrftomo',
author='Fabricio Marin, Chris Roehrig, Arthur Glowacki, Francesco De Carlo, Si Chen',
packages=find_packages(),
version=open('VERSION').read().strip(),
description = 'Pre-processing too... | 31.703704 | 89 | 0.608645 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='xrftomo',
author='Fabricio Marin, Chris Roehrig, Arthur Glowacki, Francesco De Carlo, Si Chen',
packages=find_packages(),
version=open('VERSION').read().strip(),
description = 'Pre-processing too... | 0 | 0 | 0 |
641469b84a75d3d8fdfe422d2a46f28822affd09 | 11,799 | py | Python | Lib/idlelib/idle_test/mock_tk.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | 1 | 2018-06-21T18:21:24.000Z | 2018-06-21T18:21:24.000Z | Lib/idlelib/idle_test/mock_tk.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | null | null | null | Lib/idlelib/idle_test/mock_tk.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | null | null | null | """Classes that replace tkinter gui objects used by an object being tested.
A gui object jest anything przy a master albo parent parameter, which jest
typically required w spite of what the doc strings say.
"""
klasa Event:
'''Minimal mock przy attributes dla testing event handlers.
This jest nie a gui objec... | 39.461538 | 83 | 0.62251 | """Classes that replace tkinter gui objects used by an object being tested.
A gui object jest anything przy a master albo parent parameter, which jest
typically required w spite of what the doc strings say.
"""
klasa Event:
'''Minimal mock przy attributes dla testing event handlers.
This jest nie a gui objec... | 1,442 | 0 | 157 |
a36cc579056371399883bb90df9a7f8742f78705 | 97 | py | Python | wsgidav/addons/__init__.py | monash-merc/wsgidav | ba4aa2f64edfd3e3bb21958b56e18d5d92e3065c | [
"MIT"
] | null | null | null | wsgidav/addons/__init__.py | monash-merc/wsgidav | ba4aa2f64edfd3e3bb21958b56e18d5d92e3065c | [
"MIT"
] | null | null | null | wsgidav/addons/__init__.py | monash-merc/wsgidav | ba4aa2f64edfd3e3bb21958b56e18d5d92e3065c | [
"MIT"
] | null | null | null | #__all__ = ['nt_domain_controller',
# 'simplemysqlabstractionlayer',
# ]
| 24.25 | 43 | 0.556701 | #__all__ = ['nt_domain_controller',
# 'simplemysqlabstractionlayer',
# ]
| 0 | 0 | 0 |
6a9d3e7a23277b7064d4f1909c00a7b69502e420 | 6,598 | py | Python | examples/epstein_civil_violence/epstein_civil_violence/agent.py | DoofCoder/mesa | b290439e4f68a1a5a4906246546b69e7d783dcfb | [
"Apache-2.0"
] | 1,704 | 2015-02-01T17:59:44.000Z | 2022-03-30T13:25:47.000Z | examples/epstein_civil_violence/epstein_civil_violence/agent.py | DoofCoder/mesa | b290439e4f68a1a5a4906246546b69e7d783dcfb | [
"Apache-2.0"
] | 1,048 | 2015-01-12T01:16:05.000Z | 2022-03-31T11:44:33.000Z | examples/epstein_civil_violence/epstein_civil_violence/agent.py | DoofCoder/mesa | b290439e4f68a1a5a4906246546b69e7d783dcfb | [
"Apache-2.0"
] | 831 | 2015-03-04T13:41:25.000Z | 2022-03-30T14:33:17.000Z | import math
from mesa import Agent
class Citizen(Agent):
"""
A member of the general population, may or may not be in active rebellion.
Summary of rule: If grievance - risk > threshold, rebel.
Attributes:
unique_id: unique int
x, y: Grid coordinates
hardship: Agent's 'perceiv... | 35.283422 | 88 | 0.588209 | import math
from mesa import Agent
class Citizen(Agent):
"""
A member of the general population, may or may not be in active rebellion.
Summary of rule: If grievance - risk > threshold, rebel.
Attributes:
unique_id: unique int
x, y: Grid coordinates
hardship: Agent's 'perceiv... | 0 | 0 | 0 |
0569b74f5c195d4d63346d5bb1817842014e165f | 217 | py | Python | asr/query_strategies/__init__.py | parisa-zahedi/automated-systematic-review | cf04172b5681f3863ca9dce496003158192ce422 | [
"MIT"
] | null | null | null | asr/query_strategies/__init__.py | parisa-zahedi/automated-systematic-review | cf04172b5681f3863ca9dce496003158192ce422 | [
"MIT"
] | null | null | null | asr/query_strategies/__init__.py | parisa-zahedi/automated-systematic-review | cf04172b5681f3863ca9dce496003158192ce422 | [
"MIT"
] | null | null | null |
from modAL.uncertainty import (entropy_sampling,
uncertainty_sampling,
margin_sampling)
from asr.query_strategies.random_sampling import random_sampling
| 31 | 64 | 0.626728 |
from modAL.uncertainty import (entropy_sampling,
uncertainty_sampling,
margin_sampling)
from asr.query_strategies.random_sampling import random_sampling
| 0 | 0 | 0 |
221894281469639c1b72dded984705ad5b3472e4 | 1,390 | py | Python | gurklang/stdlib_modules/streams.py | decorator-factory/gurklang-pyimpl-interpreter | bd4275949c094d81a729da6a910b4bbecadaff0f | [
"MIT"
] | 4 | 2020-12-24T21:24:55.000Z | 2021-12-02T10:38:04.000Z | gurklang/stdlib_modules/streams.py | decorator-factory/gurklang-pyimpl-interpreter | bd4275949c094d81a729da6a910b4bbecadaff0f | [
"MIT"
] | 17 | 2020-12-21T20:09:18.000Z | 2021-12-01T23:24:45.000Z | gurklang/stdlib_modules/streams.py | decorator-factory/gurklang-pyimpl-interpreter | bd4275949c094d81a729da6a910b4bbecadaff0f | [
"MIT"
] | 2 | 2020-12-20T17:23:25.000Z | 2020-12-20T21:02:57.000Z | from typing import List, Tuple
from ..builtin_utils import BuiltinModule, Fail, make_simple
from ..types import Value, Stack, Str, Atom, Vec
module = BuiltinModule("streams")
T, V, S = Tuple, Value, Stack
@module.register_simple('str->stream')
@module.register_simple('list->stream') | 28.367347 | 72 | 0.610791 | from typing import List, Tuple
from ..builtin_utils import BuiltinModule, Fail, make_simple
from ..types import Value, Stack, Str, Atom, Vec
module = BuiltinModule("streams")
T, V, S = Tuple, Value, Stack
def make_str_stream(s: str, i: int = 0):
@make_simple()
def __str_stream(stack: S, fail: Fail):
... | 1,009 | 0 | 90 |
b8a7b6bce00812ed46f9c4787f7451db04fcfaeb | 1,335 | py | Python | ie_classifier.py | Dorencon/Classification-and-detection | 412428a5774b2bbe6b33b3d6038ac92b73adb28f | [
"MIT"
] | null | null | null | ie_classifier.py | Dorencon/Classification-and-detection | 412428a5774b2bbe6b33b3d6038ac92b73adb28f | [
"MIT"
] | null | null | null | ie_classifier.py | Dorencon/Classification-and-detection | 412428a5774b2bbe6b33b3d6038ac92b73adb28f | [
"MIT"
] | null | null | null | from openvino.inference_engine import IECore
import cv2
import numpy as np | 40.454545 | 115 | 0.610487 | from openvino.inference_engine import IECore
import cv2
import numpy as np
class InferenceEngineClassifier:
def __init__(self, configPath = None, weightsPath = None, device = None, extension = None, classesPath = None):
IEc = IECore()
if (extension and device == "CPU"):
IEc.add_extensio... | 1,123 | 11 | 127 |
05046bb9b3ba7d82f4a8c732c14c23e96f21cd6c | 7,637 | py | Python | ddv_alts.py | bobeu/algorandescrow | 1a3715a802f88ee8e491d6445bcf9a3c211ac0aa | [
"Apache-2.0"
] | null | null | null | ddv_alts.py | bobeu/algorandescrow | 1a3715a802f88ee8e491d6445bcf9a3c211ac0aa | [
"Apache-2.0"
] | null | null | null | ddv_alts.py | bobeu/algorandescrow | 1a3715a802f88ee8e491d6445bcf9a3c211ac0aa | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from ddv_global import client, reply_keyboard, keyboard, pk_keyboard
from ddv_waitforconfirmation import wait_for_confirmation
from algosdk.future.transaction import AssetTransferTxn
from telegram.inline.inlinekeyboardbutton import InlineKeyboardButton
from telegram.inline... | 36.023585 | 125 | 0.624722 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from ddv_global import client, reply_keyboard, keyboard, pk_keyboard
from ddv_waitforconfirmation import wait_for_confirmation
from algosdk.future.transaction import AssetTransferTxn
from telegram.inline.inlinekeyboardbutton import InlineKeyboardButton
from telegram.inline... | 0 | 0 | 0 |
7f1f211773401ad5795860d716016250702f8db0 | 2,030 | py | Python | ObjectRecognition/Multi-Shot/em_algorithm_for_our_dataset.py | Holstrup/ObjectRecognition | 7c26c38e09fca6d2b36184acc1784c23cc107731 | [
"MIT"
] | 2 | 2020-03-20T01:34:01.000Z | 2021-09-22T19:46:28.000Z | ObjectRecognition/Multi-Shot/em_algorithm_for_our_dataset.py | Holstrup/ObjectRecognition | 7c26c38e09fca6d2b36184acc1784c23cc107731 | [
"MIT"
] | null | null | null | ObjectRecognition/Multi-Shot/em_algorithm_for_our_dataset.py | Holstrup/ObjectRecognition | 7c26c38e09fca6d2b36184acc1784c23cc107731 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import multivariate_normal
from database_actions import get_known_encodings
import sklearn.decomposition as deco
## Helper function for plotting a 2D Gaussian
## Load data
data = get_known_encodings()[0].transpose()
x = (data - np.mean(data, 0)) / n... | 27.066667 | 82 | 0.649754 | import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import multivariate_normal
from database_actions import get_known_encodings
import sklearn.decomposition as deco
## Helper function for plotting a 2D Gaussian
def plot_normal(mu, Sigma):
l, V = np.linalg.eigh(Sigma)
l[l < 0] = 0
t = np.lin... | 220 | 0 | 22 |
735e3f60b64c0c4f89bd5dbd3ecfbf19f25d530f | 19,692 | py | Python | distla/distla_core/distla_core/root_solution_unfold/test_probabilityfunctions.py | google/distla_core | 7f0d8ab7b847a75e0fc713627488643a8984712a | [
"Apache-2.0"
] | 2 | 2021-12-19T21:17:06.000Z | 2021-12-25T09:19:47.000Z | distla/distla_core/distla_core/root_solution_unfold/test_probabilityfunctions.py | google/distla_core | 7f0d8ab7b847a75e0fc713627488643a8984712a | [
"Apache-2.0"
] | null | null | null | distla/distla_core/distla_core/root_solution_unfold/test_probabilityfunctions.py | google/distla_core | 7f0d8ab7b847a75e0fc713627488643a8984712a | [
"Apache-2.0"
] | 1 | 2021-12-25T09:19:56.000Z | 2021-12-25T09:19:56.000Z | # Copyright 2021 The Distla Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 40.269939 | 101 | 0.751828 | # Copyright 2021 The Distla Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 0 | 0 | 0 |
cf550d5046a14f319037b7c1e06767b5b0ef9a2d | 6,493 | py | Python | analysis_tools/data_processing.py | google-research/policy-learning-landscape | 96c99bc67ce40559c61bdb6110f625671fc96055 | [
"Apache-2.0"
] | 52 | 2018-11-01T05:30:19.000Z | 2022-01-17T10:44:55.000Z | analysis_tools/data_processing.py | google-research/policy-learning-landscape | 96c99bc67ce40559c61bdb6110f625671fc96055 | [
"Apache-2.0"
] | null | null | null | analysis_tools/data_processing.py | google-research/policy-learning-landscape | 96c99bc67ce40559c61bdb6110f625671fc96055 | [
"Apache-2.0"
] | 12 | 2018-11-01T15:04:18.000Z | 2022-03-29T10:38:07.000Z | # coding=utf-8
# Copyright 2018 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 34.354497 | 97 | 0.708301 | # coding=utf-8
# Copyright 2018 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 0 | 0 | 0 |
c760fcdd39295f98ff32bcf57538c6ed04f2ad26 | 1,273 | py | Python | bunkai/algorithm/bunkai_sbd/annotator/linebreak_force_annotator.py | t-yamamura/bunkai | 6a6da28329fbdde2a53176740d403ef96fab4f28 | [
"Apache-2.0"
] | null | null | null | bunkai/algorithm/bunkai_sbd/annotator/linebreak_force_annotator.py | t-yamamura/bunkai | 6a6da28329fbdde2a53176740d403ef96fab4f28 | [
"Apache-2.0"
] | null | null | null | bunkai/algorithm/bunkai_sbd/annotator/linebreak_force_annotator.py | t-yamamura/bunkai | 6a6da28329fbdde2a53176740d403ef96fab4f28 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import re
from bunkai.base.annotation import Annotations, SpanAnnotation
from bunkai.base.annotator import Annotator
RE_LBS = re.compile(r'[\n\s]*\n[\n\s]*')
| 28.931818 | 78 | 0.586803 | #!/usr/bin/env python3
import re
from bunkai.base.annotation import Annotations, SpanAnnotation
from bunkai.base.annotator import Annotator
RE_LBS = re.compile(r'[\n\s]*\n[\n\s]*')
class LinebreakForceAnnotator(Annotator):
def __init__(self):
super().__init__(rule_name=self.__class__.__name__)
def ... | 993 | 20 | 76 |
db2b70ef1b086a4f2912233a9df83803b5a5843a | 6,528 | py | Python | bpy_lambda/2.78/scripts/addons_contrib/cmu_mocap_browser/__init__.py | resultant-gamedev/bpy_lambda | c8cf46c10c69e74a0892b621d76c62edaa5b04bc | [
"MIT"
] | null | null | null | bpy_lambda/2.78/scripts/addons_contrib/cmu_mocap_browser/__init__.py | resultant-gamedev/bpy_lambda | c8cf46c10c69e74a0892b621d76c62edaa5b04bc | [
"MIT"
] | null | null | null | bpy_lambda/2.78/scripts/addons_contrib/cmu_mocap_browser/__init__.py | resultant-gamedev/bpy_lambda | c8cf46c10c69e74a0892b621d76c62edaa5b04bc | [
"MIT"
] | 1 | 2019-11-24T18:43:42.000Z | 2019-11-24T18:43:42.000Z | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program 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 3
# of the License, or (at your option) any later version.
#
# This program is distrib... | 37.734104 | 80 | 0.633885 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program 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 3
# of the License, or (at your option) any later version.
#
# This program is distrib... | 3,726 | 798 | 115 |
206a9c69306d592c115aec3d15b213f0ce82ace6 | 10,077 | py | Python | tools/blendShape.py | fsanges/glTools | 8ff0899de43784a18bd4543285655e68e28fb5e5 | [
"MIT"
] | 165 | 2015-01-26T05:22:04.000Z | 2022-03-22T02:50:41.000Z | tools/blendShape.py | qeeji/glTools | 8ff0899de43784a18bd4543285655e68e28fb5e5 | [
"MIT"
] | 5 | 2015-12-02T02:39:44.000Z | 2020-12-09T02:45:54.000Z | tools/blendShape.py | qeeji/glTools | 8ff0899de43784a18bd4543285655e68e28fb5e5 | [
"MIT"
] | 83 | 2015-02-10T17:18:24.000Z | 2022-02-10T07:16:47.000Z | import maya.cmds as mc
import glTools.utils.blendShape
import glTools.utils.stringUtils
def createFromSelection(origin='local',deformOrder=None,prefix=None):
'''
Create basic blendShape from selection.
@param origin: Create a local or world space belndShape deformer. Accepted values - "local" or "world".
@type or... | 33.148026 | 191 | 0.708842 | import maya.cmds as mc
import glTools.utils.blendShape
import glTools.utils.stringUtils
def createFromSelection(origin='local',deformOrder=None,prefix=None):
'''
Create basic blendShape from selection.
@param origin: Create a local or world space belndShape deformer. Accepted values - "local" or "world".
@type or... | 0 | 0 | 0 |
64f5194701eda95eab1cfdf7781165805dd935b7 | 75 | py | Python | dynamic_formsets/__init__.py | nitr0man/django-dynamic-formsets | e6a738b5f93a4721be3f5612b311fce610b16ed2 | [
"BSD-3-Clause"
] | 8 | 2017-04-05T23:18:19.000Z | 2021-04-21T12:57:31.000Z | dynamic_formsets/__init__.py | nitr0man/django-dynamic-formsets | e6a738b5f93a4721be3f5612b311fce610b16ed2 | [
"BSD-3-Clause"
] | null | null | null | dynamic_formsets/__init__.py | nitr0man/django-dynamic-formsets | e6a738b5f93a4721be3f5612b311fce610b16ed2 | [
"BSD-3-Clause"
] | 7 | 2017-07-13T22:21:27.000Z | 2021-02-11T10:05:16.000Z | default_app_config = 'dynamic_formsets.apps.DynamicFormsetsConfig' # NOQA
| 37.5 | 74 | 0.84 | default_app_config = 'dynamic_formsets.apps.DynamicFormsetsConfig' # NOQA
| 0 | 0 | 0 |
b91942c0dbb4762fe1182a73cc0430502ed2ae5e | 9,900 | py | Python | raiden/log_config.py | sangaman/raiden | d67d780909148f34528e129fd777dbfcdf0322dc | [
"MIT"
] | null | null | null | raiden/log_config.py | sangaman/raiden | d67d780909148f34528e129fd777dbfcdf0322dc | [
"MIT"
] | null | null | null | raiden/log_config.py | sangaman/raiden | d67d780909148f34528e129fd777dbfcdf0322dc | [
"MIT"
] | null | null | null | import datetime
import logging
import logging.config
import logging.handlers
import os
import re
import sys
from functools import wraps
from typing import Any, Callable, Dict, FrozenSet, List, Optional, Pattern, Tuple
import gevent
import structlog
LOG_BLACKLIST: Dict[Pattern, str] = {
re.compile(r"\b(access_?tok... | 36.666667 | 99 | 0.621616 | import datetime
import logging
import logging.config
import logging.handlers
import os
import re
import sys
from functools import wraps
from typing import Any, Callable, Dict, FrozenSet, List, Optional, Pattern, Tuple
import gevent
import structlog
LOG_BLACKLIST: Dict[Pattern, str] = {
re.compile(r"\b(access_?tok... | 6,749 | 14 | 202 |
39ca5346670600658860e3fca56ddd28f8264096 | 20,311 | py | Python | venv/Lib/site-packages/psychopy/experiment/components/button/__init__.py | mintzer/pupillometry-rf-back | cfa86fa984a49dce0123798f8de5b838c02e10d5 | [
"CC-BY-4.0"
] | null | null | null | venv/Lib/site-packages/psychopy/experiment/components/button/__init__.py | mintzer/pupillometry-rf-back | cfa86fa984a49dce0123798f8de5b838c02e10d5 | [
"CC-BY-4.0"
] | null | null | null | venv/Lib/site-packages/psychopy/experiment/components/button/__init__.py | mintzer/pupillometry-rf-back | cfa86fa984a49dce0123798f8de5b838c02e10d5 | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2021 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
from os import path
from pathlib import Path
from psychopy.alerts import alerttools
from ... | 43.399573 | 124 | 0.526808 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2021 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
from os import path
from pathlib import Path
from psychopy.alerts import alerttools
from ... | 18,234 | 0 | 189 |
e56e313773e1b2213e1ecd8886a75725a9089736 | 680 | py | Python | src/arbies/trays/file.py | broiledmeat/arbies | 29f3ce498dbd3265b1181dde62629df3deda0440 | [
"MIT"
] | null | null | null | src/arbies/trays/file.py | broiledmeat/arbies | 29f3ce498dbd3265b1181dde62629df3deda0440 | [
"MIT"
] | null | null | null | src/arbies/trays/file.py | broiledmeat/arbies | 29f3ce498dbd3265b1181dde62629df3deda0440 | [
"MIT"
] | null | null | null | from __future__ import annotations
import os
from PIL import Image
from arbies.manager import Manager, ConfigDict
from . import Tray
| 27.2 | 86 | 0.679412 | from __future__ import annotations
import os
from PIL import Image
from arbies.manager import Manager, ConfigDict
from . import Tray
class FileTray(Tray):
def __init__(self, manager: Manager):
super().__init__(manager)
self.path: str = os.path.join(os.getcwd(), 'arbies.png')
def serve(self, ... | 426 | 97 | 23 |
e1c5b63af10801893536b641dd88d6ffd262cb0f | 61 | py | Python | vision/utils/__init__.py | SoonminHwang/pytorch-ssd | 1d6b9427a4b649bc2ce85a82511b9dd299f9d3e8 | [
"MIT"
] | null | null | null | vision/utils/__init__.py | SoonminHwang/pytorch-ssd | 1d6b9427a4b649bc2ce85a82511b9dd299f9d3e8 | [
"MIT"
] | null | null | null | vision/utils/__init__.py | SoonminHwang/pytorch-ssd | 1d6b9427a4b649bc2ce85a82511b9dd299f9d3e8 | [
"MIT"
] | null | null | null | from .misc import *
from .tensorboard import run_tensorboard
| 20.333333 | 40 | 0.819672 | from .misc import *
from .tensorboard import run_tensorboard
| 0 | 0 | 0 |
0a5fc02a89b762faf6e7f46e4da141e65c89327f | 25,178 | py | Python | wsme/types.py | mail2nsrajesh/wsme | 9f84e4c7c59b172a09341af2ab496d07e29e01aa | [
"MIT"
] | 2 | 2020-11-05T06:09:20.000Z | 2021-01-03T07:22:18.000Z | wsme/types.py | mail2nsrajesh/wsme | 9f84e4c7c59b172a09341af2ab496d07e29e01aa | [
"MIT"
] | null | null | null | wsme/types.py | mail2nsrajesh/wsme | 9f84e4c7c59b172a09341af2ab496d07e29e01aa | [
"MIT"
] | null | null | null | import base64
import datetime
import decimal
import inspect
import logging
import netaddr
import re
import six
import sys
import uuid
import weakref
from wsme import exc
log = logging.getLogger(__name__)
#: The 'str' (python 2) or 'bytes' (python 3) type.
#: Its use should be restricted to
#: pure ascii strings as t... | 29.938169 | 79 | 0.606085 | import base64
import datetime
import decimal
import inspect
import logging
import netaddr
import re
import six
import sys
import uuid
import weakref
from wsme import exc
log = logging.getLogger(__name__)
#: The 'str' (python 2) or 'bytes' (python 3) type.
#: Its use should be restricted to
#: pure ascii strings as t... | 12,512 | 3,438 | 1,095 |
ea7236400f2e4d07ec79a99a0352e08c19052cd8 | 121 | py | Python | config/youtube_secret.py | SpaceAppsXploration/semantic-data-chronos | f7908f50892781154d623f46303812e88fdecb57 | [
"Apache-2.0"
] | 1 | 2017-06-15T17:51:19.000Z | 2017-06-15T17:51:19.000Z | config/youtube_secret.py | SpaceAppsXploration/semantic-data-chronos | f7908f50892781154d623f46303812e88fdecb57 | [
"Apache-2.0"
] | null | null | null | config/youtube_secret.py | SpaceAppsXploration/semantic-data-chronos | f7908f50892781154d623f46303812e88fdecb57 | [
"Apache-2.0"
] | null | null | null | __author__ = 'Lorenzo'
YOUTUBE_API_SERVICE_NAME = "youtube"
YOUTUBE_API_VERSION = "v3"
_KEY = '**********************'
| 17.285714 | 36 | 0.603306 | __author__ = 'Lorenzo'
YOUTUBE_API_SERVICE_NAME = "youtube"
YOUTUBE_API_VERSION = "v3"
_KEY = '**********************'
| 0 | 0 | 0 |
821b5e3b321ad3fc71573d135218765d3909a6ed | 304 | py | Python | app/User.py | craigderington/serviceauto | 28958e3cb82431151c02c4bd600cf887c54d2866 | [
"MIT"
] | null | null | null | app/User.py | craigderington/serviceauto | 28958e3cb82431151c02c4bd600cf887c54d2866 | [
"MIT"
] | null | null | null | app/User.py | craigderington/serviceauto | 28958e3cb82431151c02c4bd600cf887c54d2866 | [
"MIT"
] | null | null | null | """User Model."""
from config.database import Model
from orator.orm import has_many
class User(Model):
"""User Model."""
__fillable__ = ["name", "email", "password"]
__auth__ = "email"
@has_many("id", "user_id")
| 17.882353 | 48 | 0.611842 | """User Model."""
from config.database import Model
from orator.orm import has_many
class User(Model):
"""User Model."""
__fillable__ = ["name", "email", "password"]
__auth__ = "email"
@has_many("id", "user_id")
def cars(self):
from app.Car import Car
return Car
| 45 | 0 | 26 |
77baf7062818145f17a9ac9dadf5299f599cb365 | 1,754 | py | Python | fooster/console/demo.py | lilyinstarlight/python-fooster-console | e2cd6a80298ba0c22334fdb0967b8c3f074fa49e | [
"MIT"
] | null | null | null | fooster/console/demo.py | lilyinstarlight/python-fooster-console | e2cd6a80298ba0c22334fdb0967b8c3f074fa49e | [
"MIT"
] | null | null | null | fooster/console/demo.py | lilyinstarlight/python-fooster-console | e2cd6a80298ba0c22334fdb0967b8c3f074fa49e | [
"MIT"
] | null | null | null | import paramiko
import fooster.console
if __name__ == '__main__':
main()
| 28.754098 | 110 | 0.604903 | import paramiko
import fooster.console
def main():
def docstring(a, b, c='c'):
"""
This function concatenates input strings.
Params:
a: str
b: str
c: str = 'c'
Returns:
concatenated: str
"""
return a + b + c
def argpa... | 1,650 | 0 | 23 |
46668d45a8679b0fff4d90ba130bc1898c1ed301 | 9,340 | py | Python | src/schemathesis/_hypothesis.py | tuffnatty/schemathesis | c104923f31235df49555ab0c8d92b5cb81957de0 | [
"MIT"
] | null | null | null | src/schemathesis/_hypothesis.py | tuffnatty/schemathesis | c104923f31235df49555ab0c8d92b5cb81957de0 | [
"MIT"
] | null | null | null | src/schemathesis/_hypothesis.py | tuffnatty/schemathesis | c104923f31235df49555ab0c8d92b5cb81957de0 | [
"MIT"
] | null | null | null | """Provide strategies for given endpoint(s) definition."""
import asyncio
import inspect
import re
from base64 import b64encode
from functools import partial
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from urllib.parse import quote_plus
import hypothesis
import hypothesis.strategies as st
fro... | 39.576271 | 118 | 0.702677 | """Provide strategies for given endpoint(s) definition."""
import asyncio
import inspect
import re
from base64 import b64encode
from functools import partial
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from urllib.parse import quote_plus
import hypothesis
import hypothesis.strategies as st
fro... | 4,452 | 0 | 253 |
68aa41a2d3e0b64696753524447604d00ab9fee5 | 233 | py | Python | wrds2pg/__init__.py | EvanJo/wrds2pg | a3b754c04df0e1c2330ef202d52faeb2c84304b1 | [
"MIT"
] | 6 | 2021-02-25T00:37:27.000Z | 2022-03-22T09:36:09.000Z | wrds2pg/__init__.py | EvanJo/wrds2pg | a3b754c04df0e1c2330ef202d52faeb2c84304b1 | [
"MIT"
] | 22 | 2019-02-17T22:56:51.000Z | 2021-09-11T16:29:24.000Z | wrds2pg/__init__.py | iangow/wrds2pg | 80fcf8e6aeec92abaafc9d0e69bf23ad5850eaa9 | [
"MIT"
] | 4 | 2019-09-02T22:51:04.000Z | 2021-07-18T11:53:26.000Z | name = "wrds2pg"
from wrds2pg.wrds2pg import wrds_update, run_file_sql, get_modified_str
from wrds2pg.wrds2pg import make_engine, get_process, wrds_process_to_pg
from wrds2pg.wrds2pg import wrds_id, set_table_comment, get_table_sql
| 38.833333 | 72 | 0.854077 | name = "wrds2pg"
from wrds2pg.wrds2pg import wrds_update, run_file_sql, get_modified_str
from wrds2pg.wrds2pg import make_engine, get_process, wrds_process_to_pg
from wrds2pg.wrds2pg import wrds_id, set_table_comment, get_table_sql
| 0 | 0 | 0 |
dc13acb0da5decc6829064aff1db1908d6636e11 | 1,287 | py | Python | plugins/servicenow/icon_servicenow/actions/get_attachments_for_an_incident/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | null | null | null | plugins/servicenow/icon_servicenow/actions/get_attachments_for_an_incident/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | null | null | null | plugins/servicenow/icon_servicenow/actions/get_attachments_for_an_incident/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | null | null | null | import insightconnect_plugin_runtime
from .schema import GetAttachmentsForAnIncidentInput, GetAttachmentsForAnIncidentOutput, Input, Output, Component
# Custom imports below
from icon_servicenow.util.request_helper import RequestHelper
| 39 | 113 | 0.658897 | import insightconnect_plugin_runtime
from .schema import GetAttachmentsForAnIncidentInput, GetAttachmentsForAnIncidentOutput, Input, Output, Component
# Custom imports below
from icon_servicenow.util.request_helper import RequestHelper
class GetAttachmentsForAnIncident(insightconnect_plugin_runtime.Action):
def ... | 922 | 51 | 76 |
f6576b4a0a23ce06b38d3a12dc2cbbf7b01f643f | 41,084 | py | Python | vosges.py | vadimkantorov/expsge | 224f869b609ff15dfb288bcd0814a2931b1a3d94 | [
"MIT"
] | null | null | null | vosges.py | vadimkantorov/expsge | 224f869b609ff15dfb288bcd0814a2931b1a3d94 | [
"MIT"
] | null | null | null | vosges.py | vadimkantorov/expsge | 224f869b609ff15dfb288bcd0814a2931b1a3d94 | [
"MIT"
] | null | null | null | import os
import re
import sys
import imp
import math
import copy
import json
import time
import errno
import shutil
import hashlib
import argparse
import traceback
import functools
import itertools
import subprocess
import xml.dom.minidom
__tool_name__ = 'vosges'
if __name__ == '__main__':
unhandled_exception_hook... | 46.527746 | 800 | 0.684622 | import os
import re
import sys
import imp
import math
import copy
import json
import time
import errno
import shutil
import hashlib
import argparse
import traceback
import functools
import itertools
import subprocess
import xml.dom.minidom
__tool_name__ = 'vosges'
class P:
project_page = 'http://github.com/vadimkant... | 31,671 | 3,212 | 579 |
2d4bf35c0255a499f94a87d490af68ce091b3901 | 6,935 | py | Python | rl_libarary/network/network_arch.py | Jiayuan-Gu/policy-refactorization | c626c598d735d4c08c2c0553da34196b3fba0b6d | [
"MIT"
] | 6 | 2020-10-22T18:57:41.000Z | 2021-04-17T22:57:33.000Z | rl_libarary/network/network_arch.py | Jiayuan-Gu/policy-refactorization | c626c598d735d4c08c2c0553da34196b3fba0b6d | [
"MIT"
] | null | null | null | rl_libarary/network/network_arch.py | Jiayuan-Gu/policy-refactorization | c626c598d735d4c08c2c0553da34196b3fba0b6d | [
"MIT"
] | 1 | 2021-01-23T03:28:52.000Z | 2021-01-23T03:28:52.000Z | #######################################################################
# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
################################... | 39.403409 | 90 | 0.522855 | #######################################################################
# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
################################... | 5,920 | 28 | 282 |
5264c3b556ef8aee1ba4aeea67a683c2bead1caa | 686 | py | Python | Python/13. Regex and Parsing/exercise11.py | mukeshmithrakumar/HackerRankSolutions | cd9e71be5e8703287b9f4efc042df8827175af1b | [
"MIT"
] | 12 | 2019-10-29T09:49:26.000Z | 2022-02-21T09:43:41.000Z | Python/13. Regex and Parsing/exercise11.py | ozturkosu/HackerRankSolutions | cd9e71be5e8703287b9f4efc042df8827175af1b | [
"MIT"
] | null | null | null | Python/13. Regex and Parsing/exercise11.py | ozturkosu/HackerRankSolutions | cd9e71be5e8703287b9f4efc042df8827175af1b | [
"MIT"
] | 10 | 2019-12-22T03:18:50.000Z | 2021-09-23T16:55:25.000Z | # HTML Parser - Part 2 "https://www.hackerrank.com/challenges/html-parser-part-2/problem"
from html.parser import HTMLParser
html = ""
for i in range(int(input())):
html += input().rstrip()
html += '\n'
parser = MyHTMLParser()
parser.feed(html)
parser.close()
| 22.129032 | 89 | 0.580175 | # HTML Parser - Part 2 "https://www.hackerrank.com/challenges/html-parser-part-2/problem"
from html.parser import HTMLParser
class MyHTMLParser(HTMLParser):
def handle_comment(self, data):
number_of_line = len(data.split('\n'))
if number_of_line > 1:
print('>>> Multi-line Comment')
... | 326 | 10 | 76 |
4a23555eff788fa6188ab6355ad62a5e2404a9ab | 23,524 | py | Python | appengine/swarming/swarming_bot/api/platforms/win.py | hixio-mh/luci-py | 5e2606b0db8f5dac25e9f84fdf71d103da393894 | [
"Apache-2.0"
] | null | null | null | appengine/swarming/swarming_bot/api/platforms/win.py | hixio-mh/luci-py | 5e2606b0db8f5dac25e9f84fdf71d103da393894 | [
"Apache-2.0"
] | 1 | 2022-03-02T11:45:18.000Z | 2022-03-02T11:45:18.000Z | appengine/swarming/swarming_bot/api/platforms/win.py | hixio-mh/luci-py | 5e2606b0db8f5dac25e9f84fdf71d103da393894 | [
"Apache-2.0"
] | 1 | 2021-07-23T15:32:55.000Z | 2021-07-23T15:32:55.000Z | # Copyright 2015 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Windows specific utility functions."""
import ctypes
import logging
import os
import platform
import re
import string
import subprocess
import... | 33.462304 | 97 | 0.682622 | # Copyright 2015 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Windows specific utility functions."""
import ctypes
import logging
import os
import platform
import re
import string
import subprocess
import... | 3,011 | 658 | 142 |
8e12716e979558c2134b43f7954452d2ead815d0 | 3,639 | py | Python | src/nbsvm.py | 82ndAirborneDiv/autism_surveillance | e647e8cc70cba72cc8c4c8afdf2f7a9132ac06fa | [
"Apache-2.0"
] | null | null | null | src/nbsvm.py | 82ndAirborneDiv/autism_surveillance | e647e8cc70cba72cc8c4c8afdf2f7a9132ac06fa | [
"Apache-2.0"
] | 1 | 2020-03-16T14:20:35.000Z | 2020-03-16T14:20:35.000Z | src/nbsvm.py | 82ndAirborneDiv/autism_surveillance | e647e8cc70cba72cc8c4c8afdf2f7a9132ac06fa | [
"Apache-2.0"
] | 1 | 2020-11-13T14:19:42.000Z | 2020-11-13T14:19:42.000Z | import numpy as np
import pandas as pd
import GPy, GPyOpt
from sklearn.model_selection import train_test_split
from sklearn.metrics import brier_score_loss as brier_score
from sklearn.metrics import accuracy_score, f1_score
from scipy.sparse import load_npz
from stuff.models import NBSVM, simpleNBSVM
from stuff.tools... | 34.990385 | 75 | 0.574059 | import numpy as np
import pandas as pd
import GPy, GPyOpt
from sklearn.model_selection import train_test_split
from sklearn.metrics import brier_score_loss as brier_score
from sklearn.metrics import accuracy_score, f1_score
from scipy.sparse import load_npz
from stuff.models import NBSVM, simpleNBSVM
from stuff.tools... | 469 | 0 | 52 |
19c3b9de302ca7b988a9a9a91185e1307784caf7 | 1,113 | py | Python | Tests/Methods/Mesh/Mesh/test_get_node.py | tobsen2code/pyleecan | 5b1ded9e389e0c79ed7b7c878b6e939f2d9962e9 | [
"Apache-2.0"
] | 95 | 2019-01-23T04:19:45.000Z | 2022-03-17T18:22:10.000Z | Tests/Methods/Mesh/Mesh/test_get_node.py | ecs-kev/pyleecan | 1faedde4b24acc6361fa1fdd4e980eaec4ca3a62 | [
"Apache-2.0"
] | 366 | 2019-02-20T07:15:08.000Z | 2022-03-31T13:37:23.000Z | Tests/Methods/Mesh/Mesh/test_get_node.py | ecs-kev/pyleecan | 1faedde4b24acc6361fa1fdd4e980eaec4ca3a62 | [
"Apache-2.0"
] | 74 | 2019-01-24T01:47:31.000Z | 2022-02-25T05:44:42.000Z | # -*- coding: utf-8 -*-
import pytest
from pyleecan.Classes.MeshMat import MeshMat
from pyleecan.Classes.NodeMat import NodeMat
from pyleecan.Classes.CellMat import CellMat
import numpy as np
@pytest.mark.MeshSol
class Test_get_node(object):
"""unittest for nodes getter methods"""
@classmethod
def test_... | 31.8 | 92 | 0.624438 | # -*- coding: utf-8 -*-
import pytest
from pyleecan.Classes.MeshMat import MeshMat
from pyleecan.Classes.NodeMat import NodeMat
from pyleecan.Classes.CellMat import CellMat
import numpy as np
@pytest.mark.MeshSol
class Test_get_node(object):
"""unittest for nodes getter methods"""
@classmethod
def setup_... | 325 | 0 | 26 |
64fa5e300050f6c6cc8f2e49d92ca5a441ee4385 | 2,397 | py | Python | piRNA_analysis/snakemake/05_remove_known_ncRNA.py | rberrens/SPOCD1-piRNA_directed_DNA_met | 8e795436197ef41f07159624e45d6b0fddb1ded8 | [
"MIT"
] | 4 | 2020-07-17T12:03:38.000Z | 2021-03-11T03:30:20.000Z | piRNA_analysis/snakemake/05_remove_known_ncRNA.py | rberrens/SPOCD1-piRNA_directed_DNA_met | 8e795436197ef41f07159624e45d6b0fddb1ded8 | [
"MIT"
] | null | null | null | piRNA_analysis/snakemake/05_remove_known_ncRNA.py | rberrens/SPOCD1-piRNA_directed_DNA_met | 8e795436197ef41f07159624e45d6b0fddb1ded8 | [
"MIT"
] | 1 | 2021-08-15T07:11:52.000Z | 2021-08-15T07:11:52.000Z | configfile: 'config_spocd1_pi.yaml'
bowtie = "/usr/local/Cellar/bowtie/1.2.1.1/bin/bowtie"
rule all:
input:
expand("Processed/mapped/{sample}_mirna_mature.sam", sample = config["samples"]),
expand("Processed/unmapped/{sample}_mirna_mature_unmmaped.fasta", sample = config["samples"]),
expand("Processed/mappe... | 33.760563 | 98 | 0.684606 | configfile: 'config_spocd1_pi.yaml'
bowtie = "/usr/local/Cellar/bowtie/1.2.1.1/bin/bowtie"
rule all:
input:
expand("Processed/mapped/{sample}_mirna_mature.sam", sample = config["samples"]),
expand("Processed/unmapped/{sample}_mirna_mature_unmmaped.fasta", sample = config["samples"]),
expand("Processed/mappe... | 0 | 0 | 0 |
4d0033a6673bd48eda72fbaa68b7bd7aec6aef43 | 716 | py | Python | Lintcode/Ladder_8_System Design/5_Web Crawler & Google Suggestion/500. Inverted Index.py | ctc316/algorithm-python | ac4580d55e05e93e407c6156c9bb801808027d60 | [
"MIT"
] | null | null | null | Lintcode/Ladder_8_System Design/5_Web Crawler & Google Suggestion/500. Inverted Index.py | ctc316/algorithm-python | ac4580d55e05e93e407c6156c9bb801808027d60 | [
"MIT"
] | null | null | null | Lintcode/Ladder_8_System Design/5_Web Crawler & Google Suggestion/500. Inverted Index.py | ctc316/algorithm-python | ac4580d55e05e93e407c6156c9bb801808027d60 | [
"MIT"
] | null | null | null | '''
Definition of Document
class Document:
def __init__(self, id, cotent):
self.id = id
self.content = content
'''
# @param {Document[]} docs a list of documents
# @return {dict(string, int[])} an inverted index | 27.538462 | 53 | 0.515363 | '''
Definition of Document
class Document:
def __init__(self, id, cotent):
self.id = id
self.content = content
'''
class Solution:
# @param {Document[]} docs a list of documents
# @return {dict(string, int[])} an inverted index
def invertedIndex(self, docs):
inverted = {}
... | 435 | -6 | 48 |
87045c96bb353363f39dc08a1c8d7a1570d2c146 | 2,320 | py | Python | hn_clone/posts/migrations/0001_initial.py | bkavanagh/dj-hackernews-clone | 543d2774c2b956dd6aadd81a4f51c3df6c3e9060 | [
"MIT"
] | null | null | null | hn_clone/posts/migrations/0001_initial.py | bkavanagh/dj-hackernews-clone | 543d2774c2b956dd6aadd81a4f51c3df6c3e9060 | [
"MIT"
] | null | null | null | hn_clone/posts/migrations/0001_initial.py | bkavanagh/dj-hackernews-clone | 543d2774c2b956dd6aadd81a4f51c3df6c3e9060 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-12 08:17
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| 35.692308 | 118 | 0.547414 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-12 08:17
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations... | 0 | 2,077 | 23 |
a76a4ea80ec4b884509d547a9b9e63b9cbd85352 | 336 | py | Python | punchclock/urls.py | Haughar/punchclock | 4031167693aab85f3577f0e2a6d50d0b482c4bfe | [
"Apache-2.0"
] | 3 | 2017-01-26T00:15:57.000Z | 2021-01-21T00:49:34.000Z | punchclock/urls.py | Haughar/punchclock | 4031167693aab85f3577f0e2a6d50d0b482c4bfe | [
"Apache-2.0"
] | null | null | null | punchclock/urls.py | Haughar/punchclock | 4031167693aab85f3577f0e2a6d50d0b482c4bfe | [
"Apache-2.0"
] | 1 | 2016-09-14T21:52:03.000Z | 2016-09-14T21:52:03.000Z | from django.conf.urls import *
urlpatterns = patterns('punchclock.views',
url(r'^$', 'start_task'),
url(r'^switch/$', 'switch_task'),
url(r'^activities/$', 'get_activities'),
url(r'^shift-details/$', 'shift_details'),
... | 37.333333 | 65 | 0.446429 | from django.conf.urls import *
urlpatterns = patterns('punchclock.views',
url(r'^$', 'start_task'),
url(r'^switch/$', 'switch_task'),
url(r'^activities/$', 'get_activities'),
url(r'^shift-details/$', 'shift_details'),
... | 0 | 0 | 0 |
3d9b0bb5afd37fe840d12aefa2edcc7ec1d4f278 | 15,742 | py | Python | fuse_examples/classification/cmmd/runner.py | alexgo1/fuse-med-ml | 928375828ff321d2bf7b2084389e34e1db0682e9 | [
"Apache-2.0"
] | null | null | null | fuse_examples/classification/cmmd/runner.py | alexgo1/fuse-med-ml | 928375828ff321d2bf7b2084389e34e1db0682e9 | [
"Apache-2.0"
] | null | null | null | fuse_examples/classification/cmmd/runner.py | alexgo1/fuse-med-ml | 928375828ff321d2bf7b2084389e34e1db0682e9 | [
"Apache-2.0"
] | null | null | null |
"""
(C) Copyright 2021 IBM Corp.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... | 44.343662 | 145 | 0.597955 |
"""
(C) Copyright 2021 IBM Corp.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... | 8,909 | 0 | 66 |
983f40fad149e0db228d233c258634dc7ba94784 | 509 | py | Python | src/reader.py | vdragan1993/serbian-document-network | b9efa3ca47dd5d1d93112bd38a9c54fb9cec79b9 | [
"Apache-2.0"
] | 1 | 2017-11-16T19:26:54.000Z | 2017-11-16T19:26:54.000Z | src/reader.py | vdragan1993/serbian-document-network | b9efa3ca47dd5d1d93112bd38a9c54fb9cec79b9 | [
"Apache-2.0"
] | null | null | null | src/reader.py | vdragan1993/serbian-document-network | b9efa3ca47dd5d1d93112bd38a9c54fb9cec79b9 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
__author__ = "Dragan Vidakovic"
import codecs
def read_file_content(path):
"""
Read file from given path
:param path: file path
:return: file content
"""
f = codecs.open(path, 'r', 'utf8')
content = f.read()
f.close()
return content
def read_file_line(path):
""... | 18.178571 | 38 | 0.59725 | # coding=utf-8
__author__ = "Dragan Vidakovic"
import codecs
def read_file_content(path):
"""
Read file from given path
:param path: file path
:return: file content
"""
f = codecs.open(path, 'r', 'utf8')
content = f.read()
f.close()
return content
def read_file_line(path):
""... | 0 | 0 | 0 |
ba6e68d632bd87e5d36e4f672a6999c57a5273c3 | 4,654 | py | Python | host_watch.py | iPlantCollaborativeOpenSource/host_watch | f0802a5826905ebc77ac3fa156b7582792da34f3 | [
"BSD-3-Clause"
] | null | null | null | host_watch.py | iPlantCollaborativeOpenSource/host_watch | f0802a5826905ebc77ac3fa156b7582792da34f3 | [
"BSD-3-Clause"
] | null | null | null | host_watch.py | iPlantCollaborativeOpenSource/host_watch | f0802a5826905ebc77ac3fa156b7582792da34f3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import csv
import json
import logging
import os
import time
import sys
from collections import namedtuple
from datetime import datetime
from pprint import pformat
from subprocess import Popen, PIPE
from celery import Celery
from celery.events.snapshot impor... | 30.418301 | 97 | 0.690374 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import csv
import json
import logging
import os
import time
import sys
from collections import namedtuple
from datetime import datetime
from pprint import pformat
from subprocess import Popen, PIPE
from celery import Celery
from celery.events.snapshot impor... | 2,858 | 0 | 115 |
3a74271d83bf8dc84945ccf3b8efcf669534670a | 957 | py | Python | main.py | gilegue/scraping-saham | bd0902a8f3d5d838ca4a19657ff6cdcb3f2654aa | [
"MIT"
] | null | null | null | main.py | gilegue/scraping-saham | bd0902a8f3d5d838ca4a19657ff6cdcb3f2654aa | [
"MIT"
] | null | null | null | main.py | gilegue/scraping-saham | bd0902a8f3d5d838ca4a19657ff6cdcb3f2654aa | [
"MIT"
] | null | null | null | """
GET: data muncul jika url dijalankan lewat browser
POST: data tidak bisa diambil lewat browser, namun hanya bisa diambil berdasar permintaan dengan metode post dari form
"""
import requests
import json
import pprint
# Coba jalankan get dari link
try:
result = requests.get('https://www.idx.co.id/umbraco/Surfac... | 28.147059 | 118 | 0.62278 | """
GET: data muncul jika url dijalankan lewat browser
POST: data tidak bisa diambil lewat browser, namun hanya bisa diambil berdasar permintaan dengan metode post dari form
"""
import requests
import json
import pprint
# Coba jalankan get dari link
try:
result = requests.get('https://www.idx.co.id/umbraco/Surfac... | 0 | 0 | 0 |
f1159041e146bdb9c5b19510a52d63ee8c4d795e | 1,741 | py | Python | 8/src.py | amalloy/advent-of-code-2016 | 1623383f6736e856d50ac2b7d2c41e2cf7936964 | [
"MIT"
] | null | null | null | 8/src.py | amalloy/advent-of-code-2016 | 1623383f6736e856d50ac2b7d2c41e2cf7936964 | [
"MIT"
] | null | null | null | 8/src.py | amalloy/advent-of-code-2016 | 1623383f6736e856d50ac2b7d2c41e2cf7936964 | [
"MIT"
] | null | null | null | import sys
import regex
instr_regex = regex.compile(r"""(?|(rect)\ (\d+)x(\d+) # use same group numbers in each | branch
| rotate\ (row)\ y=(\d+)\ by\ (\d+)
| rotate\ (column)\ x=(\d+)\ by\ (\d+))""",
regex.VERBOSE)
parse_... | 29.508475 | 100 | 0.540494 | import sys
import regex
class Rect:
def __init__(self, cols, rows):
self.cols = cols
self.rows = rows
def transform(self, _g):
return [(y, x, '#') for y in range(self.rows) for x in range(self.cols)]
class Row:
def __init__(self, row, amt):
self.row = row
self.amt ... | 829 | -42 | 353 |
28b1a7cbb018ae2d07a51c67ff0b9066ff35fef6 | 486 | py | Python | CryostatGUI/plotting&datahandling/extractdata.py | Cryostat-GUI/Cryostat-GUI | 9b538ecaef4f1c0758907b9ee32d79ffd6793867 | [
"MIT"
] | 2 | 2018-11-23T15:59:19.000Z | 2019-01-28T20:18:58.000Z | CryostatGUI/plotting&datahandling/extractdata.py | Cryostat-GUI/Cryostat-GUI | 9b538ecaef4f1c0758907b9ee32d79ffd6793867 | [
"MIT"
] | 54 | 2018-10-16T20:03:32.000Z | 2021-11-09T09:07:03.000Z | CryostatGUI/plotting&datahandling/extractdata.py | Cryostat-GUI/Cryostat-GUI | 9b538ecaef4f1c0758907b9ee32d79ffd6793867 | [
"MIT"
] | 9 | 2018-11-04T17:37:30.000Z | 2021-05-03T21:15:33.000Z | from data_functions import conf
import shutil
filebase = "./../Logs/"
data = filebase + "cooldown_20200422_19.db"
if __name__ == "__main__":
df = conf(data)
df = df.loc[df.times_res - df.times_temps < 1]
# print(df.iloc[:, 1:4:2])
dfexp = df.iloc[:, 1:4:2]
# print(data[10:-3])
newfile = data... | 24.3 | 82 | 0.625514 | from data_functions import conf
import shutil
filebase = "./../Logs/"
data = filebase + "cooldown_20200422_19.db"
if __name__ == "__main__":
df = conf(data)
df = df.loc[df.times_res - df.times_temps < 1]
# print(df.iloc[:, 1:4:2])
dfexp = df.iloc[:, 1:4:2]
# print(data[10:-3])
newfile = data... | 0 | 0 | 0 |
482d569f7295dc4840df23751093dd60ffc6a82a | 1,427 | py | Python | spandex/tests/conftest.py | UDST/spandex | 2f485b190d521bc84e9a66d71c8161b5214570d8 | [
"BSD-3-Clause"
] | 21 | 2015-09-24T08:20:13.000Z | 2020-08-10T16:15:03.000Z | spandex/tests/conftest.py | UDST/spandex | 2f485b190d521bc84e9a66d71c8161b5214570d8 | [
"BSD-3-Clause"
] | 3 | 2018-05-22T21:04:48.000Z | 2018-05-30T20:40:44.000Z | spandex/tests/conftest.py | UDST/spandex | 2f485b190d521bc84e9a66d71c8161b5214570d8 | [
"BSD-3-Clause"
] | 14 | 2015-09-21T17:59:02.000Z | 2020-05-06T05:12:40.000Z | import os
import pytest
from spandex import TableLoader
from spandex.spatialtoolz import conform_srids
@pytest.fixture(scope='function')
def loader(request):
"""Recreate sample schema from shapefiles and tear down when done."""
# Configure TableLoader to use directory containing sample shapefiles.
root_... | 32.431818 | 74 | 0.677645 | import os
import pytest
from spandex import TableLoader
from spandex.spatialtoolz import conform_srids
@pytest.fixture(scope='function')
def loader(request):
"""Recreate sample schema from shapefiles and tear down when done."""
# Configure TableLoader to use directory containing sample shapefiles.
root_... | 95 | 0 | 26 |
360bb258606d79a7e8d9980f9d650a84e413e377 | 3,416 | py | Python | hydrodynamics/prolates.py | saridut/FloriPy | 0117d358b9c2362ea32ecf9ec719fdaed87d3e14 | [
"MIT"
] | null | null | null | hydrodynamics/prolates.py | saridut/FloriPy | 0117d358b9c2362ea32ecf9ec719fdaed87d3e14 | [
"MIT"
] | null | null | null | hydrodynamics/prolates.py | saridut/FloriPy | 0117d358b9c2362ea32ecf9ec719fdaed87d3e14 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import math
import numpy as np
from floripy.mathutils.linalg import perm_tensor
| 34.16 | 74 | 0.510539 | #!/usr/bin/env python
import math
import numpy as np
from floripy.mathutils.linalg import perm_tensor
class Prolates_hydrodynamics(object):
def __init__(self, model, flowfield, kwargs):
self._model = model
self._num_bodies = self._model.num_bodies
self._all_prolate_a = model.get_all_prola... | 3,012 | 277 | 23 |
a3ec976157a2053001d5cc542fdb7fe2a39c3953 | 300 | py | Python | api/contests/admin.py | ucpr/onlinejudge | 472b4671dc8fde8bd2f2b139ce61bc52e8137fcc | [
"MIT"
] | null | null | null | api/contests/admin.py | ucpr/onlinejudge | 472b4671dc8fde8bd2f2b139ce61bc52e8137fcc | [
"MIT"
] | null | null | null | api/contests/admin.py | ucpr/onlinejudge | 472b4671dc8fde8bd2f2b139ce61bc52e8137fcc | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Contest, Problem, Submittion, RegistContestUser, Standing
# Register your models here.
admin.site.register(Contest)
admin.site.register(Problem)
admin.site.register(Submittion)
admin.site.register(RegistContestUser)
admin.site.register(Standing)
| 30 | 77 | 0.83 | from django.contrib import admin
from .models import Contest, Problem, Submittion, RegistContestUser, Standing
# Register your models here.
admin.site.register(Contest)
admin.site.register(Problem)
admin.site.register(Submittion)
admin.site.register(RegistContestUser)
admin.site.register(Standing)
| 0 | 0 | 0 |
fce7fafeac05e4f358747e96108b86c1527933b1 | 153 | py | Python | backend/test_workaround.py | Ebraegel/code-challenge-backend | 379d2f2d8efc77cfb373c4f118815f1a3f44f5e5 | [
"MIT"
] | null | null | null | backend/test_workaround.py | Ebraegel/code-challenge-backend | 379d2f2d8efc77cfb373c4f118815f1a3f44f5e5 | [
"MIT"
] | null | null | null | backend/test_workaround.py | Ebraegel/code-challenge-backend | 379d2f2d8efc77cfb373c4f118815f1a3f44f5e5 | [
"MIT"
] | null | null | null | # this is just here to trick pytest into finding my modules
# I probably set something up wrong, but this is the quickest workaround I found to fix it :) | 76.5 | 93 | 0.771242 | # this is just here to trick pytest into finding my modules
# I probably set something up wrong, but this is the quickest workaround I found to fix it :) | 0 | 0 | 0 |
73b991335fc701acd68a4e033e02b5be193dad42 | 1,147 | py | Python | setup.py | telegents/django-rest-framework-nr | 601d029d3a01bb8e1e3e633aaabe9da8f071f4db | [
"MIT"
] | null | null | null | setup.py | telegents/django-rest-framework-nr | 601d029d3a01bb8e1e3e633aaabe9da8f071f4db | [
"MIT"
] | null | null | null | setup.py | telegents/django-rest-framework-nr | 601d029d3a01bb8e1e3e633aaabe9da8f071f4db | [
"MIT"
] | null | null | null | #!/bin/bin/env python
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
setup(
name='djangorestframework-nr',
version='0.1.1',
description='Provide nested router support to Django REST Framework',
url='https://g... | 32.771429 | 73 | 0.636443 | #!/bin/bin/env python
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
setup(
name='djangorestframework-nr',
version='0.1.1',
description='Provide nested router support to Django REST Framework',
url='https://g... | 0 | 0 | 0 |
9e66c430ce139f7ed41aa01422a1336d2cbf5329 | 1,799 | py | Python | paraphase/util/switchable_dropout_wrapper.py | tingkai-zhang/Paraphase | ed57430a76781c17c41c265e51e41abeb8d83a48 | [
"Apache-2.0"
] | 354 | 2017-05-20T08:03:57.000Z | 2022-01-16T07:06:03.000Z | paraphase/util/switchable_dropout_wrapper.py | tingkai-zhang/Paraphase | ed57430a76781c17c41c265e51e41abeb8d83a48 | [
"Apache-2.0"
] | 17 | 2017-05-21T18:30:22.000Z | 2019-08-14T12:57:51.000Z | paraphase/util/switchable_dropout_wrapper.py | tingkai-zhang/Paraphase | ed57430a76781c17c41c265e51e41abeb8d83a48 | [
"Apache-2.0"
] | 93 | 2017-05-20T20:09:59.000Z | 2021-05-02T05:13:25.000Z | import tensorflow as tf
from tensorflow.contrib.rnn import DropoutWrapper
class SwitchableDropoutWrapper(DropoutWrapper):
"""
A wrapper of tensorflow.contrib.rnn.DropoutWrapper that does not apply
dropout if is_train is not True (dropout only in training).
"""
| 42.833333 | 75 | 0.602001 | import tensorflow as tf
from tensorflow.contrib.rnn import DropoutWrapper
class SwitchableDropoutWrapper(DropoutWrapper):
"""
A wrapper of tensorflow.contrib.rnn.DropoutWrapper that does not apply
dropout if is_train is not True (dropout only in training).
"""
def __init__(self, cell, is_train, in... | 1,467 | 0 | 53 |
31fe204cbf21d1b04873a0024fa37c9b36c54660 | 791 | py | Python | test/add-tables.py | deephaven/action-assert-dh-tables-present | b53127e3ff83c0915ce96662890fbf7ea509a787 | [
"Apache-2.0"
] | null | null | null | test/add-tables.py | deephaven/action-assert-dh-tables-present | b53127e3ff83c0915ce96662890fbf7ea509a787 | [
"Apache-2.0"
] | 3 | 2021-10-29T18:58:10.000Z | 2022-03-21T18:12:44.000Z | test/add-tables.py | deephaven/action-assert-dh-tables-present | b53127e3ff83c0915ce96662890fbf7ea509a787 | [
"Apache-2.0"
] | null | null | null | """
add-tables.py
A Python script that adds a few tables to Deephaven.
@copyright Deephaven Data Labs
"""
from pydeephaven import Session
import time
session = None
#Simple retry loop in case the server tries to launch before Deephaven is ready
count = 0
max_count = 5
while (count < max_count):
try:
se... | 22.6 | 79 | 0.702908 | """
add-tables.py
A Python script that adds a few tables to Deephaven.
@copyright Deephaven Data Labs
"""
from pydeephaven import Session
import time
session = None
#Simple retry loop in case the server tries to launch before Deephaven is ready
count = 0
max_count = 5
while (count < max_count):
try:
se... | 0 | 0 | 0 |
d49db3801546288c83221546cd14ae55ce9093e5 | 1,313 | py | Python | elasticpedia/config/elastic_conf.py | vcutrona/elasticpedia | fcb23008a6fedaaa25c876a58b0365e9b273e147 | [
"Apache-2.0"
] | 3 | 2020-03-31T15:57:21.000Z | 2020-04-02T16:09:23.000Z | elasticpedia/config/elastic_conf.py | vcutrona/elasticpedia | fcb23008a6fedaaa25c876a58b0365e9b273e147 | [
"Apache-2.0"
] | null | null | null | elasticpedia/config/elastic_conf.py | vcutrona/elasticpedia | fcb23008a6fedaaa25c876a58b0365e9b273e147 | [
"Apache-2.0"
] | null | null | null | import os
from enum import Enum
| 27.93617 | 101 | 0.575019 | import os
from enum import Enum
class ElasticConfig:
def __init__(self,
resource: str,
nodes: str = "localhost",
port: int = 9200,
wan_only: bool = False,
mapping_id: str = None):
self._nodes = os.getenv("ELASTIC_NODES"... | 819 | 438 | 23 |
ab2a83197c89a1e0ff6cfb6e1d7534c8066151cd | 5,834 | py | Python | PokerRL/cfr/MCCFR.py | MAWUT0R/PokerRL | 95708a5f7a16cb151bc4253132bdfd22ea7a9b25 | [
"MIT"
] | 1 | 2022-02-28T11:51:44.000Z | 2022-02-28T11:51:44.000Z | PokerRL/cfr/MCCFR.py | MAWUT0R/PokerRL | 95708a5f7a16cb151bc4253132bdfd22ea7a9b25 | [
"MIT"
] | null | null | null | PokerRL/cfr/MCCFR.py | MAWUT0R/PokerRL | 95708a5f7a16cb151bc4253132bdfd22ea7a9b25 | [
"MIT"
] | 1 | 2022-03-05T10:10:24.000Z | 2022-03-05T10:10:24.000Z | # Copyright (c) 2019 Eric Steinberger
import numpy as np
import sys
from PokerRL.cfr._MCCFRBase import MCCFRBase as _MCCFRBase
| 41.375887 | 108 | 0.508742 | # Copyright (c) 2019 Eric Steinberger
import numpy as np
import sys
from PokerRL.cfr._MCCFRBase import MCCFRBase as _MCCFRBase
class MCCFR(_MCCFRBase):
def __init__(self,
name,
chief_handle,
game_cls,
agent_bet_set,
starting_... | 5,488 | 3 | 212 |
ed4bdba5a4eae3253f1d7c30cfde20e098d5f149 | 152 | py | Python | CodeUp/2721_순환문자열.py | woorimlee/cpp_CTCI_6E_APSS | ff1d42e871ba853ac3de726df0c609885ba07573 | [
"MIT"
] | 2 | 2020-12-30T03:35:51.000Z | 2021-02-28T20:39:09.000Z | CodeUp/2721_순환문자열.py | woorimlee/cpp_CTCI_6E_APSS | ff1d42e871ba853ac3de726df0c609885ba07573 | [
"MIT"
] | 1 | 2020-12-08T08:48:40.000Z | 2021-04-09T04:58:57.000Z | CodeUp/2721_순환문자열.py | woorimlee/Algorithm-Repository | ff1d42e871ba853ac3de726df0c609885ba07573 | [
"MIT"
] | null | null | null | s1 = input()
s2 = input()
s3 = input()
if s1[-1] == s2[0] and s2[-1] == s3[0] and s3[-1] == s1[0] :
print("good")
else :
print("bad")
#이거 뭔가 이상
| 16.888889 | 60 | 0.486842 | s1 = input()
s2 = input()
s3 = input()
if s1[-1] == s2[0] and s2[-1] == s3[0] and s3[-1] == s1[0] :
print("good")
else :
print("bad")
#이거 뭔가 이상
| 0 | 0 | 0 |
5383461e118503345bd83f69def60dc7578dfe65 | 2,685 | py | Python | run4.py | Ckst123/KoBERT-events | 68eb22845b179bcaf13771fea776be3d9772306f | [
"Apache-2.0"
] | null | null | null | run4.py | Ckst123/KoBERT-events | 68eb22845b179bcaf13771fea776be3d9772306f | [
"Apache-2.0"
] | null | null | null | run4.py | Ckst123/KoBERT-events | 68eb22845b179bcaf13771fea776be3d9772306f | [
"Apache-2.0"
] | null | null | null | from data_loader import load_data, tokenizer
from models import BertForMultipleLabelSequenceClassificationWithFocalLoss
from transformers import AutoConfig
import torch
from tqdm.auto import tqdm
from transformers import get_scheduler
from transformers import AdamW
from sklearn.metrics import accuracy_score, f1_score
... | 29.833333 | 110 | 0.650279 | from data_loader import load_data, tokenizer
from models import BertForMultipleLabelSequenceClassificationWithFocalLoss
from transformers import AutoConfig
import torch
from tqdm.auto import tqdm
from transformers import get_scheduler
from transformers import AdamW
from sklearn.metrics import accuracy_score, f1_score
... | 2,154 | 0 | 69 |
4bd94a5c4ac0744f7a63a24fc4e6139eb9914015 | 15,746 | py | Python | tspwplib/converter.py | PatrickOHara/tspwplib | fcb6d3fb310f8f6adea1f01d1f2f4f5a732f3319 | [
"MIT"
] | 1 | 2020-12-06T12:22:59.000Z | 2020-12-06T12:22:59.000Z | tspwplib/converter.py | PatrickOHara/tspwplib | fcb6d3fb310f8f6adea1f01d1f2f4f5a732f3319 | [
"MIT"
] | 6 | 2020-11-27T12:53:10.000Z | 2021-01-29T11:38:04.000Z | tspwplib/converter.py | PatrickOHara/tspwplib | fcb6d3fb310f8f6adea1f01d1f2f4f5a732f3319 | [
"MIT"
] | null | null | null | """Converting between different types of graphs"""
from copy import deepcopy
import math
from typing import Dict, List, Tuple, Union
import networkx as nx
import pandas as pd
from .exception import UnexpectedSelfLoopException
from .types import (
Edge,
EdgeFunction,
EdgeFunctionName,
EdgeList,
Edg... | 31.366534 | 97 | 0.66582 | """Converting between different types of graphs"""
from copy import deepcopy
import math
from typing import Dict, List, Tuple, Union
import networkx as nx
import pandas as pd
from .exception import UnexpectedSelfLoopException
from .types import (
Edge,
EdgeFunction,
EdgeFunctionName,
EdgeList,
Edg... | 0 | 0 | 0 |
56b0ecee08d118c8c4aa1e0d5b5c4214a1dceb5f | 1,597 | py | Python | app/segurity.py | Jebux01/fastapi_curse | 0cb2587215ff8721d9a7fee0c9a3791c78ca6512 | [
"MIT"
] | null | null | null | app/segurity.py | Jebux01/fastapi_curse | 0cb2587215ff8721d9a7fee0c9a3791c78ca6512 | [
"MIT"
] | null | null | null | app/segurity.py | Jebux01/fastapi_curse | 0cb2587215ff8721d9a7fee0c9a3791c78ca6512 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from typing import Optional
from fastapi import HTTPException, status
from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
from jose import JWTError, jwt
from passlib.context import CryptContext
from .models import crud
from pydantic import BaseModel
pwd... | 37.139535 | 83 | 0.724483 | from datetime import datetime, timedelta
from typing import Optional
from fastapi import HTTPException, status
from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
from jose import JWTError, jwt
from passlib.context import CryptContext
from .models import crud
from pydantic import BaseModel
pwd... | 925 | 167 | 23 |
1c14663942cdee274628e5af587f4c22f3eaaeeb | 14,815 | py | Python | lhotse/audio.py | leixin/lhotse | 24d713b81e8dbc0cdfec1038024a3b8a44eb54bd | [
"Apache-2.0"
] | null | null | null | lhotse/audio.py | leixin/lhotse | 24d713b81e8dbc0cdfec1038024a3b8a44eb54bd | [
"Apache-2.0"
] | null | null | null | lhotse/audio.py | leixin/lhotse | 24d713b81e8dbc0cdfec1038024a3b8a44eb54bd | [
"Apache-2.0"
] | null | null | null | import warnings
from dataclasses import asdict, dataclass
from io import BytesIO
from math import sqrt
from pathlib import Path
from subprocess import PIPE, run
from typing import Callable, Dict, Iterable, List, Optional, Union, Tuple
import numpy as np
from lhotse.utils import Decibels, Pathlike, Seconds, SetContain... | 40.040541 | 114 | 0.638677 | import warnings
from dataclasses import asdict, dataclass
from io import BytesIO
from math import sqrt
from pathlib import Path
from subprocess import PIPE, run
from typing import Callable, Dict, Iterable, List, Optional, Union, Tuple
import numpy as np
from lhotse.utils import Decibels, Pathlike, Seconds, SetContain... | 4,388 | 0 | 580 |
7e280785ef49530dd2e1f8d498269eea3692e7e7 | 3,110 | py | Python | gen_layer.py | JohnTanium/attck_empire | acb86a9817217a7f994cbf7266c8355e7cddc6d5 | [
"Apache-2.0"
] | 41 | 2018-09-05T05:14:26.000Z | 2021-01-10T06:04:08.000Z | gen_layer.py | JohnTanium/attck_empire | acb86a9817217a7f994cbf7266c8355e7cddc6d5 | [
"Apache-2.0"
] | null | null | null | gen_layer.py | JohnTanium/attck_empire | acb86a9817217a7f994cbf7266c8355e7cddc6d5 | [
"Apache-2.0"
] | 9 | 2018-09-06T02:01:55.000Z | 2020-09-13T05:02:44.000Z | # Please note that this script was based on the original code developed by MITRE ATT&CK team used for the generation of
# ATT&CK Navigator files. This script was slightly modified and configured to output JSON file instead.
# https://github.com/mitre/attack-navigator
# attack_layers_simple.py - the "hello, world"... | 39.367089 | 140 | 0.646624 | # Please note that this script was based on the original code developed by MITRE ATT&CK team used for the generation of
# ATT&CK Navigator files. This script was slightly modified and configured to output JSON file instead.
# https://github.com/mitre/attack-navigator
# attack_layers_simple.py - the "hello, world"... | 2,008 | 0 | 23 |
6c1cfb390921e1e9254ef0211a9449ae3403dbf6 | 832 | py | Python | train/utils/utils_metrics.py | ntaagarwal/indoorInverse | b26e2ec0a772c3bf99a695daaa3c1bff5b353708 | [
"MIT"
] | 1 | 2022-02-05T07:06:54.000Z | 2022-02-05T07:06:54.000Z | train/utils/utils_metrics.py | ntaagarwal/indoorInverse | b26e2ec0a772c3bf99a695daaa3c1bff5b353708 | [
"MIT"
] | null | null | null | train/utils/utils_metrics.py | ntaagarwal/indoorInverse | b26e2ec0a772c3bf99a695daaa3c1bff5b353708 | [
"MIT"
] | 4 | 2022-02-03T13:32:22.000Z | 2022-02-11T23:08:37.000Z | import numpy as np | 33.28 | 115 | 0.638221 | import numpy as np
def compute_errors_depth_nyu(ground_truth, predication):
# accuracy
threshold = np.maximum((ground_truth / predication),(predication / ground_truth))
a1 = (threshold < 1.25 ).mean()
a2 = (threshold < 1.25 ** 2 ).mean()
a3 = (threshold < 1.25 ** 3 ).mean()
#MSE
rmse = (g... | 791 | 0 | 23 |
ad05e0a82b7a51436763a427042c7b6e901ffe4a | 6,662 | py | Python | suumo_scrapy/spiders/suumo.py | wakamezake/suumo_scrapy | bce0a3536d92902e508eb982c96a85668155232f | [
"MIT"
] | 1 | 2021-03-25T08:55:38.000Z | 2021-03-25T08:55:38.000Z | suumo_scrapy/spiders/suumo.py | wakamezake/suumo_scrapy | bce0a3536d92902e508eb982c96a85668155232f | [
"MIT"
] | null | null | null | suumo_scrapy/spiders/suumo.py | wakamezake/suumo_scrapy | bce0a3536d92902e508eb982c96a85668155232f | [
"MIT"
] | null | null | null | from datetime import datetime
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
import scrapy
from suumo_scrapy.items import SuumoScrapyItem, ArticleItemLoader
| 52.873016 | 198 | 0.638697 | from datetime import datetime
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
import scrapy
from suumo_scrapy.items import SuumoScrapyItem, ArticleItemLoader
class SuumoSpider(CrawlSpider):
name = 'suumo'
allowed_domains = ['suumo.jp']
# start_urls = [
# ... | 5,808 | 664 | 23 |
a18bacf6ada98506f47bd947618d1f0cfc7b37a7 | 20 | py | Python | lightcontrol/ledcontrol/__init__.py | reefberrypi/reefberrypi | f1e9977e8f56b402ef4d231ba8d4cdd0e469db42 | [
"MIT"
] | null | null | null | lightcontrol/ledcontrol/__init__.py | reefberrypi/reefberrypi | f1e9977e8f56b402ef4d231ba8d4cdd0e469db42 | [
"MIT"
] | null | null | null | lightcontrol/ledcontrol/__init__.py | reefberrypi/reefberrypi | f1e9977e8f56b402ef4d231ba8d4cdd0e469db42 | [
"MIT"
] | null | null | null | __author__ = 'outm'
| 10 | 19 | 0.7 | __author__ = 'outm'
| 0 | 0 | 0 |
12ec6ffaf1669a125e29a7b1eb6ff548467b3776 | 3,712 | py | Python | _unittests/ut_jenkinshelper/test_yaml_jenkins_startup_linux.py | Pandinosaurus/pyquickhelper | 326276f656cf88989e4d0fcd006ada0d3735bd9e | [
"MIT"
] | 18 | 2015-11-10T08:09:23.000Z | 2022-02-16T11:46:45.000Z | _unittests/ut_jenkinshelper/test_yaml_jenkins_startup_linux.py | Pandinosaurus/pyquickhelper | 326276f656cf88989e4d0fcd006ada0d3735bd9e | [
"MIT"
] | 321 | 2015-06-14T21:34:28.000Z | 2021-11-28T17:10:03.000Z | _unittests/ut_jenkinshelper/test_yaml_jenkins_startup_linux.py | Pandinosaurus/pyquickhelper | 326276f656cf88989e4d0fcd006ada0d3735bd9e | [
"MIT"
] | 10 | 2015-06-20T01:35:00.000Z | 2022-01-19T15:54:32.000Z | """
@brief test log(time=2s)
"""
import sys
import os
import unittest
import re
from pyquickhelper.loghelper import fLOG
from pyquickhelper.jenkinshelper.jenkins_server import JenkinsExt
from pyquickhelper.jenkinshelper.jenkins_helper import default_engines, setup_jenkins_server_yml
if __name__ == "__main__":... | 36.038835 | 96 | 0.509159 | """
@brief test log(time=2s)
"""
import sys
import os
import unittest
import re
from pyquickhelper.loghelper import fLOG
from pyquickhelper.jenkinshelper.jenkins_server import JenkinsExt
from pyquickhelper.jenkinshelper.jenkins_helper import default_engines, setup_jenkins_server_yml
class TestYamlJenkinsStartu... | 3,262 | 32 | 77 |
39b93fdfb8a3fe0e22858fcc5cd555c4e5362d12 | 8,973 | py | Python | src/easel/site/contents/proxies.py | tnahs/easel | eb7ed750097729ffb9330207730fd23ff5f6571b | [
"MIT"
] | null | null | null | src/easel/site/contents/proxies.py | tnahs/easel | eb7ed750097729ffb9330207730fd23ff5f6571b | [
"MIT"
] | null | null | null | src/easel/site/contents/proxies.py | tnahs/easel | eb7ed750097729ffb9330207730fd23ff5f6571b | [
"MIT"
] | null | null | null | import abc
import json
import logging
import pathlib
from typing import TYPE_CHECKING, Callable, List, Optional, Tuple
import PIL.Image
import PIL.ImageFilter
from ..defaults import Defaults
from ..globals import Globals
if TYPE_CHECKING:
from .contents import Image
logger = logging.getLogger()
class BasePr... | 27.86646 | 92 | 0.590327 | import abc
import json
import logging
import pathlib
from typing import TYPE_CHECKING, Callable, List, Optional, Tuple
import PIL.Image
import PIL.ImageFilter
from ..defaults import Defaults
from ..globals import Globals
if TYPE_CHECKING:
from .contents import Image
logger = logging.getLogger()
class BasePr... | 5,841 | 1,552 | 197 |
7fc1cd437f81424176772858eeb3a21139fd3d66 | 7,955 | py | Python | release/stubs.min/System/Windows/Forms/__init___parts/KeysConverter.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/System/Windows/Forms/__init___parts/KeysConverter.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/System/Windows/Forms/__init___parts/KeysConverter.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class KeysConverter(TypeConverter,IComparer):
"""
Provides a System.ComponentModel.TypeConverter to convert System.Windows.Forms.Keys objects to and from other representations.
KeysConverter()
"""
def CanConvertFrom(self,*__args):
"""
CanConvertFrom(self: KeysConverter,context: ITypeDescriptorCon... | 29.462963 | 215 | 0.730233 | class KeysConverter(TypeConverter,IComparer):
"""
Provides a System.ComponentModel.TypeConverter to convert System.Windows.Forms.Keys objects to and from other representations.
KeysConverter()
"""
def CanConvertFrom(self,*__args):
"""
CanConvertFrom(self: KeysConverter,context: ITypeDescriptorCon... | 0 | 0 | 0 |
5e62b7c384d90ee2d356019095e01a58599b2cb4 | 23,820 | py | Python | parsers.py | DeadCodeProductions/dead | a8e65abd76bf4a10268317bbf7a168c03c84e5f8 | [
"Apache-2.0"
] | 20 | 2022-02-25T10:49:53.000Z | 2022-03-17T09:17:27.000Z | parsers.py | DeadCodeProductions/dead | a8e65abd76bf4a10268317bbf7a168c03c84e5f8 | [
"Apache-2.0"
] | 3 | 2022-02-28T20:00:32.000Z | 2022-03-28T12:52:35.000Z | parsers.py | DeadCodeProductions/dead | a8e65abd76bf4a10268317bbf7a168c03c84e5f8 | [
"Apache-2.0"
] | null | null | null | import argparse
from typing import Any, Sequence
| 27.665505 | 307 | 0.597313 | import argparse
from typing import Any, Sequence
def config_parser(
expected_entries: Sequence[tuple[Any, ...]]
) -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(add_help=False)
for _, path, desc in expected_entries:
parser.add_argument("--" + ".".join(path), help=desc)
parser.ad... | 23,555 | 0 | 207 |
bf1426cc246d0cdc2ad79bead2b24ce8ac61c2e6 | 1,041 | py | Python | asynchronous_qiwi/call/API/QIWIWallet/webhook_api/register_hook.py | LexLuthorReal/asynchronous_qiwi | 5847a8d4008493656e973e5283888a4e57234962 | [
"MIT"
] | 3 | 2021-05-20T02:36:30.000Z | 2021-11-28T16:00:15.000Z | asynchronous_qiwi/call/API/QIWIWallet/webhook_api/register_hook.py | LexLuthorReal/asynchronous_qiwi | 5847a8d4008493656e973e5283888a4e57234962 | [
"MIT"
] | null | null | null | asynchronous_qiwi/call/API/QIWIWallet/webhook_api/register_hook.py | LexLuthorReal/asynchronous_qiwi | 5847a8d4008493656e973e5283888a4e57234962 | [
"MIT"
] | 1 | 2021-11-28T16:00:20.000Z | 2021-11-28T16:00:20.000Z | from .....data.URL import QIWIWalletURLS
from .....connector.aiohttp_connector import Connector
from .....data_types.connector.request_type import PUT
from .....data_types.QIWIWallet import HookType, NotifyType
| 43.375 | 118 | 0.637848 | from .....data.URL import QIWIWalletURLS
from .....connector.aiohttp_connector import Connector
from .....data_types.connector.request_type import PUT
from .....data_types.QIWIWallet import HookType, NotifyType
class RegistrationHookAPI:
@classmethod
async def register_hook(cls, wallet_api_key: str, hook_typ... | 757 | 49 | 23 |
9e7b1d76cca47a843354505453349edd0738cce1 | 1,262 | py | Python | client.py | gdelvalle/RU_Python_IV_API | 0c6d34fe1ae2b95466077cab730adbc8d39335b3 | [
"MIT"
] | null | null | null | client.py | gdelvalle/RU_Python_IV_API | 0c6d34fe1ae2b95466077cab730adbc8d39335b3 | [
"MIT"
] | null | null | null | client.py | gdelvalle/RU_Python_IV_API | 0c6d34fe1ae2b95466077cab730adbc8d39335b3 | [
"MIT"
] | 1 | 2019-03-20T21:29:11.000Z | 2019-03-20T21:29:11.000Z | #!/usr/bin/env python2
from __future__ import print_function
import requests
import logging
import sys
# debug_mode()
if len(sys.argv) > 1:
url = sys.argv[1]
else:
url = "http://localhost:5000/"
# first request
first_hit = requests.get(url)
first_json = first_hit.json()
token = first_json.pop('token')
titl... | 24.745098 | 65 | 0.679081 | #!/usr/bin/env python2
from __future__ import print_function
import requests
import logging
import sys
def debug_mode():
try: # for Python 3
from http.client import HTTPConnection
except ImportError:
from httplib import HTTPConnection
HTTPConnection.debuglevel = 1
logging.basicConfi... | 385 | 0 | 23 |
e8d92cb30dd56ce55f76ba636b94eaab843a180e | 32 | py | Python | k12_2_c.py | DerBaum28/PythonKara | a026975c07f928869f0fcb6ed650c124a877f4ed | [
"MIT"
] | null | null | null | k12_2_c.py | DerBaum28/PythonKara | a026975c07f928869f0fcb6ed650c124a877f4ed | [
"MIT"
] | 1 | 2022-02-09T17:42:59.000Z | 2022-02-09T17:42:59.000Z | k12_2_c.py | DerBaum28/PythonKara | a026975c07f928869f0fcb6ed650c124a877f4ed | [
"MIT"
] | 1 | 2022-01-26T09:50:13.000Z | 2022-01-26T09:50:13.000Z | x = 1
tools.showMessage(str(x)) | 10.666667 | 25 | 0.6875 | x = 1
tools.showMessage(str(x)) | 0 | 0 | 0 |
629fb8eff6414b3bffa9468222c19b974485643e | 3,109 | py | Python | tests/test_integration.py | evewurtele/pyrpipe | f8f40bba5355a9acac055a5512666549579dc9b9 | [
"MIT"
] | null | null | null | tests/test_integration.py | evewurtele/pyrpipe | f8f40bba5355a9acac055a5512666549579dc9b9 | [
"MIT"
] | null | null | null | tests/test_integration.py | evewurtele/pyrpipe | f8f40bba5355a9acac055a5512666549579dc9b9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 11 10:27:44 2020
@author: usingh
Test various pyrpipe modules used with each other
"""
from pyrpipe import sra,qc,mapping,assembly,quant,tools
from pyrpipe import pyrpipe_utils as pu
from testingEnvironment import testSpecs
import os
testVars=tes... | 34.932584 | 120 | 0.699904 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 11 10:27:44 2020
@author: usingh
Test various pyrpipe modules used with each other
"""
from pyrpipe import sra,qc,mapping,assembly,quant,tools
from pyrpipe import pyrpipe_utils as pu
from testingEnvironment import testSpecs
import os
testVars=tes... | 2,539 | 0 | 27 |