hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | 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 130 | 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 130 | 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.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e378dff356b7c9a889df6eeb44f8e9b82bcceb8c | 3,933 | py | Python | phonebox_plugin/views.py | Xeizzeth/phonebox_plugin | b4e2f6ac04203b25e78292ad2bc98a490645ff47 | [
"MIT"
] | 38 | 2021-02-07T20:54:12.000Z | 2022-02-21T19:18:17.000Z | phonebox_plugin/views.py | Xeizzeth/phonebox_plugin | b4e2f6ac04203b25e78292ad2bc98a490645ff47 | [
"MIT"
] | 13 | 2021-04-19T15:25:31.000Z | 2022-03-12T18:04:38.000Z | phonebox_plugin/views.py | Xeizzeth/phonebox_plugin | b4e2f6ac04203b25e78292ad2bc98a490645ff47 | [
"MIT"
] | 15 | 2021-02-22T11:26:30.000Z | 2022-03-23T12:37:27.000Z | #!./venv/bin/python
from django.conf import settings
from packaging import version
NETBOX_CURRENT_VERSION = version.parse(settings.VERSION)
| 32.775 | 74 | 0.764811 | #!./venv/bin/python
from netbox.views import generic
from .models import Number, VoiceCircuit
from . import filters
from . import forms
from . import tables
from django.conf import settings
from packaging import version
NETBOX_CURRENT_VERSION = version.parse(settings.VERSION)
class NumberListView(generic.ObjectLi... | 0 | 0 | 0 | 3,316 | 0 | 0 | 0 | 27 | 433 |
7067196f7b2063ce74384bb490b01db8a2ee09fd | 3,985 | py | Python | protogenerator/core/descriptors/enum_descriptor.py | googleinterns/schemaorg-generator | 12b7f41856a8b4a3480d310e8c3f2e97e747efac | [
"Apache-2.0"
] | null | null | null | protogenerator/core/descriptors/enum_descriptor.py | googleinterns/schemaorg-generator | 12b7f41856a8b4a3480d310e8c3f2e97e747efac | [
"Apache-2.0"
] | null | null | null | protogenerator/core/descriptors/enum_descriptor.py | googleinterns/schemaorg-generator | 12b7f41856a8b4a3480d310e8c3f2e97e747efac | [
"Apache-2.0"
] | 1 | 2020-10-29T16:22:43.000Z | 2020-10-29T16:22:43.000Z | # Copyright 2020 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, sof... | 36.559633 | 109 | 0.635885 | # Copyright 2020 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, sof... | 0 | 0 | 0 | 3,172 | 0 | 0 | 0 | 26 | 89 |
be50cf2d47abb25ac1d35571a413795ba331c594 | 13,536 | py | Python | grow/pods/static.py | matthiasrohmer/grow | 88fae5026040ad0f7dd9260ee290cebbe49b39d7 | [
"MIT"
] | null | null | null | grow/pods/static.py | matthiasrohmer/grow | 88fae5026040ad0f7dd9260ee290cebbe49b39d7 | [
"MIT"
] | null | null | null | grow/pods/static.py | matthiasrohmer/grow | 88fae5026040ad0f7dd9260ee290cebbe49b39d7 | [
"MIT"
] | null | null | null | import mimetypes
import yaml
mimetypes.add_type('application/font-woff', '.woff')
mimetypes.add_type('application/font-woff', '.woff')
mimetypes.add_type('image/bmp', '.cur')
mimetypes.add_type('image/svg+xml', '.svg')
mimetypes.add_type('text/css', '.css')
SKIP_PATTERNS = [
'**/.**',
]
# Allow the yaml du... | 42.168224 | 110 | 0.594046 | from . import controllers
from . import messages
from grow.common import urls
from grow.translations import locales
from datetime import datetime
import fnmatch
import hashlib
import mimetypes
import os
import re
import time
import webob
import yaml
mimetypes.add_type('application/font-woff', '.woff')
mimetypes.add_ty... | 0 | 3,186 | 0 | 9,497 | 0 | 80 | 0 | -21 | 356 |
ed5dc7fbe5d1853866769daf83a8fd0e7b5abc65 | 1,893 | py | Python | tests/trestle/core/models/write_action_test.py | PritamDutt/compliance-trestle | 7edadde2bd2949e73a085bd78ef57995250fc9cb | [
"Apache-2.0"
] | null | null | null | tests/trestle/core/models/write_action_test.py | PritamDutt/compliance-trestle | 7edadde2bd2949e73a085bd78ef57995250fc9cb | [
"Apache-2.0"
] | null | null | null | tests/trestle/core/models/write_action_test.py | PritamDutt/compliance-trestle | 7edadde2bd2949e73a085bd78ef57995250fc9cb | [
"Apache-2.0"
] | null | null | null | # -*- mode:python; coding:utf-8 -*-
# Copyright (c) 2020 IBM Corp. 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
... | 33.803571 | 75 | 0.743265 | # -*- mode:python; coding:utf-8 -*-
# Copyright (c) 2020 IBM Corp. 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6a8219fb862a4d1c6fba9135a0bfd9620b4f8a37 | 1,650 | py | Python | ripcord/api/__init__.py | kickstandproject/ripcord | 6a9a59df834f08dad001a8439447ed4b699639ed | [
"Apache-2.0"
] | 1 | 2016-03-26T21:30:17.000Z | 2016-03-26T21:30:17.000Z | ripcord/api/__init__.py | kickstandproject/ripcord | 6a9a59df834f08dad001a8439447ed4b699639ed | [
"Apache-2.0"
] | null | null | null | ripcord/api/__init__.py | kickstandproject/ripcord | 6a9a59df834f08dad001a8439447ed4b699639ed | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2013 PolyBeacon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | 35.869565 | 74 | 0.631515 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2013 PolyBeacon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
164cf8647016545d99d548afb98795e57792cae8 | 1,756 | py | Python | noxfile.py | lewoudar/configuror | 21cc768ca7548e193c3e585491c2b0fd86b49f3c | [
"Apache-2.0"
] | 2 | 2020-04-24T16:24:19.000Z | 2021-12-26T02:28:55.000Z | noxfile.py | lewoudar/configuror | 21cc768ca7548e193c3e585491c2b0fd86b49f3c | [
"Apache-2.0"
] | 8 | 2019-11-08T14:12:43.000Z | 2020-01-05T16:51:30.000Z | noxfile.py | lewoudar/configuror | 21cc768ca7548e193c3e585491c2b0fd86b49f3c | [
"Apache-2.0"
] | null | null | null |
import nox
nox.options.reuse_existing_virtualenvs = True
PYTHON_VERSIONS = ['3.6', '3.7', '3.8']
| 27.015385 | 86 | 0.665148 | import os
import shutil
import nox
nox.options.reuse_existing_virtualenvs = True
PYTHON_VERSIONS = ['3.6', '3.7', '3.8']
@nox.session(python=PYTHON_VERSIONS[-1])
def lint(session):
"""Performs pep8 and security checks."""
source_code = 'configuror'
session.install('flake8==3.7.9', 'bandit==1.6.2')
... | 0 | 1,488 | 0 | 0 | 0 | 0 | 0 | -20 | 182 |
a04c09a2067d2cdebbbd76490ba595924d663536 | 26,488 | py | Python | QUANTAXIS_Test/mytest.py | xixigaga/QUANTAXIS | 6f8e7aaa976d4e4072c96ede747e07d56618f53e | [
"MIT"
] | null | null | null | QUANTAXIS_Test/mytest.py | xixigaga/QUANTAXIS | 6f8e7aaa976d4e4072c96ede747e07d56618f53e | [
"MIT"
] | 3 | 2020-10-24T03:56:06.000Z | 2021-10-18T03:48:28.000Z | QUANTAXIS_Test/mytest.py | xixigaga/QUANTAXIS | 6f8e7aaa976d4e4072c96ede747e07d56618f53e | [
"MIT"
] | null | null | null | # coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2020 azai/Rgveda/GolemQuant
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation... | 38.83871 | 169 | 0.54923 | # coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2020 azai/Rgveda/GolemQuant
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation... | 1,284 | 0 | 0 | 1,148 | 0 | 7,455 | 0 | 312 | 239 |
5301e5652125c4c5b4a0f5b510162296ac736436 | 2,667 | py | Python | computer_version/meter_pointer/test_color.py | afterloe/opencv-practice | 83d76132d004ebbc96d99d34a0fd3fc37a044f9f | [
"MIT"
] | 5 | 2020-03-13T07:34:30.000Z | 2021-10-01T03:03:05.000Z | computer_version/meter_pointer/test_color.py | afterloe/Opencv-practice | 83d76132d004ebbc96d99d34a0fd3fc37a044f9f | [
"MIT"
] | null | null | null | computer_version/meter_pointer/test_color.py | afterloe/Opencv-practice | 83d76132d004ebbc96d99d34a0fd3fc37a044f9f | [
"MIT"
] | 1 | 2020-03-01T12:35:02.000Z | 2020-03-01T12:35:02.000Z | #!/usr/bin/env python3
# -*- coding=utf-8 -*-
import cv2 as cv
"""
"""
if "__main__" == __name__:
main()
cv.destroyAllWindows()
| 32.925926 | 132 | 0.55643 | #!/usr/bin/env python3
# -*- coding=utf-8 -*-
import cv2 as cv
import imutils
import time
import math
import numpy as np
"""
"""
def calculate_distance(x1, y1, x2, y2):
return np.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
def main():
image = cv.imread("G:\\Project\\opencv-ascs-resources\\... | 96 | 0 | 0 | 0 | 0 | 2,363 | 0 | -30 | 142 |
2ae688c1e45c4864cee99bc93db6eb2d51954e98 | 997 | py | Python | PythonExe/ex070.py | ScnMatheus/my-python-projects | 9cc3511dd6e25d9b16429347598c105f15bd6916 | [
"MIT"
] | null | null | null | PythonExe/ex070.py | ScnMatheus/my-python-projects | 9cc3511dd6e25d9b16429347598c105f15bd6916 | [
"MIT"
] | null | null | null | PythonExe/ex070.py | ScnMatheus/my-python-projects | 9cc3511dd6e25d9b16429347598c105f15bd6916 | [
"MIT"
] | null | null | null | #crie um programa que leia o nome e o preo de varios produtos
#dever perguntar se o usurio quer continuar, no final mostre:
#qual o total gasto nas compras
# quantos produtos custam mais de R$ 1000
#qual o nome do produto mais barato?
print('-=-'*10)
print(' MERCADO BARATO ')
print('-=-'*10)
preco = 0
menor... | 28.485714 | 98 | 0.622869 | #crie um programa que leia o nome e o preço de varios produtos
#dever perguntar se o usuário quer continuar, no final mostre:
#qual é o total gasto nas compras
# quantos produtos custam mais de R$ 1000
#qual o nome do produto mais barato?
print('-=-'*10)
print(' MERCADÂO BARATO ')
print('-=-'*10)
preco = 0
m... | 8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c4213ad64416e9f2e14aa285b3ee7be94d395889 | 3,287 | py | Python | smt/tests/test_kpls_auto.py | Laurentww/smt | f124c01ffa78c04b80221dded278a20123dac742 | [
"BSD-3-Clause"
] | 354 | 2017-08-15T22:12:58.000Z | 2022-03-31T08:34:19.000Z | smt/tests/test_kpls_auto.py | enjoyneer87/smt | 4a4df255b9259965439120091007f9852f41523e | [
"BSD-3-Clause"
] | 258 | 2017-08-11T15:08:40.000Z | 2022-03-30T09:54:26.000Z | smt/tests/test_kpls_auto.py | enjoyneer87/smt | 4a4df255b9259965439120091007f9852f41523e | [
"BSD-3-Clause"
] | 184 | 2017-08-11T14:55:17.000Z | 2022-03-17T11:22:50.000Z | """
Author: Paul Saves
This package is distributed under New BSD license.
"""
import unittest
print_output = False
if __name__ == "__main__":
print_output = True
print("%6s %8s %18s %18s" % ("SM", "Problem", "Train. pt. error", "Test pt. error"))
unittest.main()
| 25.284615 | 88 | 0.583207 | """
Author: Paul Saves
This package is distributed under New BSD license.
"""
import numpy as np
import unittest
import inspect
from collections import OrderedDict
from smt.problems import Sphere, TensorProduct, Rosenbrock, Branin
from smt.sampling_methods import LHS
from smt.utils.sm_test_case import SMTestCase
... | 0 | 0 | 0 | 2,642 | 0 | 0 | 0 | 138 | 225 |
7dee1721ef5108e82bfc4b3a1e5249cfd7753ebc | 6,272 | py | Python | thonnycontrib/pyboard/api_stubs/pyb.py | thonny/thonny-pyboard | d967ffe653ef3678ae4ab8ed6a58ca696b47b6a6 | [
"MIT"
] | 2 | 2019-04-11T08:21:05.000Z | 2020-03-30T20:32:07.000Z | thonnycontrib/pyboard/api_stubs/pyb.py | thonny/thonny-pyboard | d967ffe653ef3678ae4ab8ed6a58ca696b47b6a6 | [
"MIT"
] | null | null | null | thonnycontrib/pyboard/api_stubs/pyb.py | thonny/thonny-pyboard | d967ffe653ef3678ae4ab8ed6a58ca696b47b6a6 | [
"MIT"
] | 1 | 2019-07-14T19:23:32.000Z | 2019-07-14T19:23:32.000Z |
SD = None
hid_keyboard = None
hid_mouse = None
| 10.851211 | 34 | 0.459343 |
class ADC:
''
def read():
pass
def read_timed():
pass
def read_timed_multi():
pass
class ADCAll:
''
def read_channel():
pass
def read_core_temp():
pass
def read_core_vbat():
pass
def read_core_vref():
pass
def read_... | 0 | 0 | 0 | 5,085 | 0 | 64 | 0 | 0 | 1,057 |
df2419dd964817e42ac855a45dd5c7a9291c652c | 2,115 | py | Python | index_auth_service/friends/tests/test_managers.py | Silver3310/Index-auth-service | 2dcd71f735f2b160fa0056c0bb752fcad7a84ecd | [
"MIT"
] | 1 | 2022-02-09T02:57:10.000Z | 2022-02-09T02:57:10.000Z | index_auth_service/friends/tests/test_managers.py | Silver3310/Index-auth-service | 2dcd71f735f2b160fa0056c0bb752fcad7a84ecd | [
"MIT"
] | null | null | null | index_auth_service/friends/tests/test_managers.py | Silver3310/Index-auth-service | 2dcd71f735f2b160fa0056c0bb752fcad7a84ecd | [
"MIT"
] | 1 | 2022-02-09T03:03:26.000Z | 2022-02-09T03:03:26.000Z | import pytest
pytestmark = pytest.mark.django_db
| 26.772152 | 79 | 0.640189 | import pytest
from django.conf import settings
from index_auth_service.friends.models import Friendship
from index_auth_service.users.tests.factories import UserFactory
from .factories import FriendshipFactory
pytestmark = pytest.mark.django_db
class TestFriendshipManager:
def test_find_friends(
self,
... | 0 | 0 | 0 | 1,843 | 0 | 0 | 0 | 108 | 113 |
557cc8a7aa370fe5c8af45f16078aa56b25e405f | 674 | py | Python | mesh/reconstruction.py | gavin971/pyro2 | 55c6d98b9c5d9372badc703ad5deb4a9d2cb8b06 | [
"BSD-3-Clause"
] | 3 | 2017-05-24T14:16:49.000Z | 2019-01-02T19:21:07.000Z | mesh/reconstruction.py | gavin971/pyro2 | 55c6d98b9c5d9372badc703ad5deb4a9d2cb8b06 | [
"BSD-3-Clause"
] | null | null | null | mesh/reconstruction.py | gavin971/pyro2 | 55c6d98b9c5d9372badc703ad5deb4a9d2cb8b06 | [
"BSD-3-Clause"
] | null | null | null | import mesh.patch as patch
import mesh.reconstruction_f as reconstruction_f
| 33.7 | 83 | 0.626113 | import mesh.patch as patch
import mesh.reconstruction_f as reconstruction_f
import mesh.array_indexer as ai
def limit(data, myg, idir, limiter):
if limiter < 10:
if limiter == 0:
limit_func = reconstruction_f.nolimit
elif limiter == 1:
limit_func = reconstruction_f.limit2
... | 0 | 0 | 0 | 0 | 0 | 543 | 0 | 10 | 45 |
ce70a32da7a4765cdeef8eec12e8bade1f28ad59 | 1,848 | py | Python | main/mpv/template.py | RoastVeg/cports | 803c7f07af341eb32f791b6ec1f237edb2764bd5 | [
"BSD-2-Clause"
] | null | null | null | main/mpv/template.py | RoastVeg/cports | 803c7f07af341eb32f791b6ec1f237edb2764bd5 | [
"BSD-2-Clause"
] | null | null | null | main/mpv/template.py | RoastVeg/cports | 803c7f07af341eb32f791b6ec1f237edb2764bd5 | [
"BSD-2-Clause"
] | null | null | null | pkgname = "mpv"
pkgver = "0.34.1"
pkgrel = 0
build_style = "waf"
configure_args = [
"--confdir=/etc/mpv", "--docdir=/usr/share/examples/mpv",
"--zshdir=/usr/share/zsh/site-functions", "--enable-libmpv-shared",
"--enable-cplugins", "--enable-cdda", "--enable-dvbin",
"--enable-dvdnav", "--enable-libarchiv... | 40.173913 | 76 | 0.666126 | pkgname = "mpv"
pkgver = "0.34.1"
pkgrel = 0
build_style = "waf"
configure_args = [
"--confdir=/etc/mpv", "--docdir=/usr/share/examples/mpv",
"--zshdir=/usr/share/zsh/site-functions", "--enable-libmpv-shared",
"--enable-cplugins", "--enable-cdda", "--enable-dvbin",
"--enable-dvdnav", "--enable-libarchiv... | 0 | 53 | 0 | 0 | 0 | 60 | 0 | 0 | 46 |
f22df4fc15a7c5e6aa2e77a721d485a5dc92c579 | 804 | py | Python | LeetCode/0515. Find Largest Value in Each Tree Row/solution.py | InnoFang/algorithms | 01847903f757722b6c877e1631e5413b9376c82e | [
"Apache-2.0"
] | null | null | null | LeetCode/0515. Find Largest Value in Each Tree Row/solution.py | InnoFang/algorithms | 01847903f757722b6c877e1631e5413b9376c82e | [
"Apache-2.0"
] | null | null | null | LeetCode/0515. Find Largest Value in Each Tree Row/solution.py | InnoFang/algorithms | 01847903f757722b6c877e1631e5413b9376c82e | [
"Apache-2.0"
] | null | null | null | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
"""
78 / 78 test cases passed.
Runtime: 52 ms
Memory Usage: 17.6 MB
"""
| 26.8 | 67 | 0.497512 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
"""
78 / 78 test cases passed.
Runtime: 52 ms
Memory Usage: 17.6 MB
"""
class Solution:
def largestValues(self, root: Optio... | 0 | 0 | 0 | 517 | 0 | 0 | 0 | 0 | 22 |
b0c0f27cf3bfab65350e69a5ce89c56ac4cad14d | 5,911 | py | Python | examples/pl_getdata.py | sanduanji/reid_platform | daa410acf5ec96bf4e17fceaeaf5e209e3928307 | [
"MIT"
] | null | null | null | examples/pl_getdata.py | sanduanji/reid_platform | daa410acf5ec96bf4e17fceaeaf5e209e3928307 | [
"MIT"
] | null | null | null | examples/pl_getdata.py | sanduanji/reid_platform | daa410acf5ec96bf4e17fceaeaf5e209e3928307 | [
"MIT"
] | null | null | null | from __future__ import print_function, absolute_import
| 32.838889 | 82 | 0.682456 | from __future__ import print_function, absolute_import
import argparse
import os.path as osp
import numpy as np
import sys
import torch
from torch import nn
from torch.backends import cudnn
from torch.utils.data import DataLoader
import tkinter as tk
from tkinter import ttk
import tkinter.font as tkFont
from reid imp... | 0 | 0 | 0 | 0 | 0 | 4,849 | 0 | 356 | 645 |
4729617395af2416efcaa130869d5946a99d3d54 | 224 | py | Python | note24/order_system (3)/test2.py | icexmoon/python-learning-notes | 838c91d896404290b89992b6517be1b6a79df41f | [
"MIT"
] | null | null | null | note24/order_system (3)/test2.py | icexmoon/python-learning-notes | 838c91d896404290b89992b6517be1b6a79df41f | [
"MIT"
] | null | null | null | note24/order_system (3)/test2.py | icexmoon/python-learning-notes | 838c91d896404290b89992b6517be1b6a79df41f | [
"MIT"
] | null | null | null |
macroCommand = MacroCommand()
macroCommand() | 22.4 | 38 | 0.651786 | class MacroCommand():
def __init__(self, commands:list):
self.commands = commands
def __call__(self):
for command in self.commands:
command()
macroCommand = MacroCommand()
macroCommand() | 0 | 0 | 0 | 157 | 0 | 0 | 0 | 0 | 22 |
3a8ceb9c5e6bc6cf5b6a418a391cb2131fc167b1 | 339 | py | Python | graph_generator.py | zhaofeng-shu33/triangle_counting | 4a2f92ed005868f39934d983c6a633c888f8ccd8 | [
"Apache-2.0"
] | null | null | null | graph_generator.py | zhaofeng-shu33/triangle_counting | 4a2f92ed005868f39934d983c6a633c888f8ccd8 | [
"Apache-2.0"
] | 1 | 2019-10-01T08:59:46.000Z | 2019-10-04T14:06:49.000Z | graph_generator.py | zhaofeng-shu33/triangle_counting | 4a2f92ed005868f39934d983c6a633c888f8ccd8 | [
"Apache-2.0"
] | 1 | 2019-11-10T08:59:51.000Z | 2019-11-10T08:59:51.000Z | import struct
import os
BUILD_DIR = os.environ.get('BUILD_DIR', 'build')
if __name__ == '__main__':
f = open(os.path.join(BUILD_DIR, 'test_io.bin'), 'wb')
f.write(struct.pack('6I',0,1,2,0,1,2))
f.close()
f = open(os.path.join(BUILD_DIR, 'test_io_false.bin'), 'wb')
f.write(struct.pack('5I',0,1,1,2,... | 24.214286 | 64 | 0.619469 | import struct
import os
BUILD_DIR = os.environ.get('BUILD_DIR', 'build')
if __name__ == '__main__':
f = open(os.path.join(BUILD_DIR, 'test_io.bin'), 'wb')
f.write(struct.pack('6I',0,1,2,0,1,2))
f.close()
f = open(os.path.join(BUILD_DIR, 'test_io_false.bin'), 'wb')
f.write(struct.pack('5I',0,1,1,2,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4aea924e177a43d62285a6e6b23098f4fa4e3f5d | 9,999 | py | Python | figure1_additional.py | ashindin/Inclined_sweeps_HAARP | 547eca3d64a4043ba92c59333d009371863d79e4 | [
"MIT"
] | 1 | 2020-07-11T03:48:55.000Z | 2020-07-11T03:48:55.000Z | figure1_additional.py | ashindin/Inclined_sweeps_HAARP | 547eca3d64a4043ba92c59333d009371863d79e4 | [
"MIT"
] | null | null | null | figure1_additional.py | ashindin/Inclined_sweeps_HAARP | 547eca3d64a4043ba92c59333d009371863d79e4 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 18})
pol_thres=0.7
xlsx_filename='/home/ashindin/owncloud/0002_see_incl/Data_1_5.83.xlsx'
table=pd.read_excel(xlsx_filename, index_col=None, header=None)
Ex, Ey, Ez, h, X, T, n2, labs =[],[],[],[],[],[],[],[]
fo... | 40.481781 | 124 | 0.557956 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 18})
pol_thres=0.7
xlsx_filename='/home/ashindin/owncloud/0002_see_incl/Data_1_5.83.xlsx'
table=pd.read_excel(xlsx_filename, index_col=None, header=None)
Ex, Ey, Ez, h, X, T, n2, labs =[],[],[],[],[],[],[],[]
fo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fea688429f87982fb8a93218e858284b0251c00a | 33,835 | py | Python | src/python/process_scripts/map_characters.py | abd5ge/movievis | 1945b12128f8324dde5778bf7fffb7fc6d9b6cf3 | [
"MIT"
] | 2 | 2020-04-12T21:50:57.000Z | 2020-04-13T03:26:17.000Z | src/python/process_scripts/map_characters.py | abd5ge/movievis | 1945b12128f8324dde5778bf7fffb7fc6d9b6cf3 | [
"MIT"
] | 7 | 2020-11-13T18:45:29.000Z | 2022-03-12T00:23:54.000Z | src/python/process_scripts/map_characters.py | abd5ge/movievis | 1945b12128f8324dde5778bf7fffb7fc6d9b6cf3 | [
"MIT"
] | 2 | 2020-04-12T21:54:50.000Z | 2020-04-16T04:53:54.000Z | from __future__ import unicode_literals
# import editdistance
try:
except:
print("Could not import pylcs; falling back to py_common_subseq")
DEBUG = False
# class LevSimilarity(Similarity):
# def __init__(self, threshold=0.0):
# self.threshold = threshold
# def get_similarity(self, name1, name... | 42.506281 | 173 | 0.597429 | from __future__ import unicode_literals
import argparse
import csv
import json
import re
import os
import unicodedata
import itertools
import concurrent.futures
# import editdistance
import pandas as pd
try:
import pylcs
def lcs(s1, s2):
return pylcs.lcs(s1, s2)
except:
print("Could not import pyl... | 0 | 0 | 0 | 28,123 | 0 | 3,949 | 0 | -64 | 636 |
63599d2a530e91d2e1d53e1418f911f544a0d91a | 295 | py | Python | tests/test_graphical_units/test_functions.py | osuzdalev/manim-1 | adab2430645637a5e7e73832d3a6ff9e7d390159 | [
"MIT"
] | 2 | 2021-08-22T14:51:53.000Z | 2021-10-17T16:01:24.000Z | tests/test_graphical_units/test_functions.py | osuzdalev/manim-1 | adab2430645637a5e7e73832d3a6ff9e7d390159 | [
"MIT"
] | null | null | null | tests/test_graphical_units/test_functions.py | osuzdalev/manim-1 | adab2430645637a5e7e73832d3a6ff9e7d390159 | [
"MIT"
] | 1 | 2021-03-31T20:46:51.000Z | 2021-03-31T20:46:51.000Z |
__module_test__ = "functions"
| 26.818182 | 87 | 0.762712 | from manim import *
from tests.test_graphical_units.testing.frames_comparison import frames_comparison
__module_test__ = "functions"
@frames_comparison
def test_FunctionGraph(scene):
graph = FunctionGraph(lambda x: 2 * np.cos(0.5 * x), x_range=[-PI, PI], color=BLUE)
scene.add(graph)
| 0 | 137 | 0 | 0 | 0 | 0 | 0 | 59 | 67 |
f2ba582488da19c49c781d84a748100228d2a6ee | 3,834 | py | Python | src/feature_selection.py | Benetti-Hub/Multiphase-Flow-Regimes | bd80439453469c0d6ff353dd42a2b00b2828bd2e | [
"Apache-2.0"
] | null | null | null | src/feature_selection.py | Benetti-Hub/Multiphase-Flow-Regimes | bd80439453469c0d6ff353dd42a2b00b2828bd2e | [
"Apache-2.0"
] | null | null | null | src/feature_selection.py | Benetti-Hub/Multiphase-Flow-Regimes | bd80439453469c0d6ff353dd42a2b00b2828bd2e | [
"Apache-2.0"
] | null | null | null | '''Utility functions for the Feature Selection Notebook'''
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import accuracy_score, f1_score
import lightgbm as lgbm
def plot_ANOVA(imp_f_classif, save=True):
'''
Plo... | 31.42623 | 106 | 0.619718 | '''Utility functions for the Feature Selection Notebook'''
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import accuracy_score, f1_score
import lightgbm as lgbm
def plot_ANOVA(imp_f_classif, save=True):
'''
Plo... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9d8b56b7dd586d93afc47913b1898f5ab7883e14 | 341 | py | Python | tagging/migrations/0004_merge_20180921_1247.py | strugo/django-tagging | c7720535556c5f15aef0aaf392000b0c97965537 | [
"BSD-3-Clause"
] | 1 | 2021-02-14T18:49:18.000Z | 2021-02-14T18:49:18.000Z | tagging/migrations/0004_merge_20180921_1247.py | strugo/django-tagging | c7720535556c5f15aef0aaf392000b0c97965537 | [
"BSD-3-Clause"
] | null | null | null | tagging/migrations/0004_merge_20180921_1247.py | strugo/django-tagging | c7720535556c5f15aef0aaf392000b0c97965537 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-21 12:47
from __future__ import unicode_literals
| 20.058824 | 49 | 0.665689 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-21 12:47
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('tagging', '0003_adapt_max_tag_length'),
('tagging', '0003_auto_20161115_0906'),
]
... | 0 | 0 | 0 | 169 | 0 | 0 | 0 | 11 | 46 |
d136f1527e08ce39d7b8a7e660f9c6532911f3ed | 1,509 | py | Python | shopyo/app.py | MrSunshyne/shopyo | cd3fe9942841743007f109e51469e8497680a678 | [
"MIT"
] | 1 | 2020-04-05T13:03:11.000Z | 2020-04-05T13:03:11.000Z | shopyo/app.py | MrSunshyne/shopyo | cd3fe9942841743007f109e51469e8497680a678 | [
"MIT"
] | null | null | null | shopyo/app.py | MrSunshyne/shopyo | cd3fe9942841743007f109e51469e8497680a678 | [
"MIT"
] | null | null | null |
app = create_app('development')
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')
| 30.795918 | 69 | 0.777336 | from flask import Flask, redirect
from flask_wtf.csrf import CSRFProtect
from addon import db, login_manager, ma
from config import app_config
def create_app(config_name):
app = Flask(__name__)
app.config.from_object(app_config[config_name])
db.init_app(app)
ma.init_app(app)
login_manager.init_a... | 0 | 73 | 0 | 0 | 0 | 1,165 | 0 | 55 | 112 |
0489731e34107e54ace58ece45592ae663e898e0 | 13,780 | py | Python | test/dynamics/models/test_generator_models.py | mtreinish/qiskit-dynamics | 1c2abca01e4f1bf4c66431103340ecd6c5f67817 | [
"Apache-2.0"
] | null | null | null | test/dynamics/models/test_generator_models.py | mtreinish/qiskit-dynamics | 1c2abca01e4f1bf4c66431103340ecd6c5f67817 | [
"Apache-2.0"
] | null | null | null | test/dynamics/models/test_generator_models.py | mtreinish/qiskit-dynamics | 1c2abca01e4f1bf4c66431103340ecd6c5f67817 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 35.153061 | 99 | 0.603338 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 0 | 0 | 0 | 12,745 | 0 | 0 | 0 | 196 | 291 |
7dbb46434026418f35f91a9285c0767203877e0b | 4,354 | py | Python | im_v2/ccxt/data/extract/download_historical_data.py | alphamatic/amp | 5018137097159415c10eaa659a2e0de8c4e403d4 | [
"BSD-3-Clause"
] | 5 | 2021-08-10T23:16:44.000Z | 2022-03-17T17:27:00.000Z | im_v2/ccxt/data/extract/download_historical_data.py | alphamatic/amp | 5018137097159415c10eaa659a2e0de8c4e403d4 | [
"BSD-3-Clause"
] | 330 | 2021-06-10T17:28:22.000Z | 2022-03-31T00:55:48.000Z | im_v2/ccxt/data/extract/download_historical_data.py | alphamatic/amp | 5018137097159415c10eaa659a2e0de8c4e403d4 | [
"BSD-3-Clause"
] | 6 | 2021-06-10T17:20:32.000Z | 2022-03-28T08:08:03.000Z | #!/usr/bin/env python
"""
Script to download historical data from CCXT.
Use as:
# Download data for CCXT for trading universe `v03` from 2019-01-01 to now:
> download_historical_data.py \
--dst_dir 'test' \
--universe 'v03' \
--start_datetime '2019-01-01'
Import as:
import im_v2.ccxt.data.extract.dow... | 30.447552 | 80 | 0.628158 | #!/usr/bin/env python
"""
Script to download historical data from CCXT.
Use as:
# Download data for CCXT for trading universe `v03` from 2019-01-01 to now:
> download_historical_data.py \
--dst_dir 'test' \
--universe 'v03' \
--start_datetime '2019-01-01'
Import as:
import im_v2.ccxt.data.extract.dow... | 0 | 0 | 0 | 0 | 0 | 3,588 | 0 | 35 | 180 |
590d8de8bf744cdfaa4d9f3f82d36a9864edf3bf | 25,183 | py | Python | python/handler.py | kgladstone/thesis | 6e35fbd7c2cd08e868ce5c36cd64e8025c9e5f53 | [
"BSD-3-Clause"
] | null | null | null | python/handler.py | kgladstone/thesis | 6e35fbd7c2cd08e868ce5c36cd64e8025c9e5f53 | [
"BSD-3-Clause"
] | null | null | null | python/handler.py | kgladstone/thesis | 6e35fbd7c2cd08e868ce5c36cd64e8025c9e5f53 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
Filename: handler.py
Author: Keith Gladstone
Description:
This file is the heart of the program
It handles all vehicle allocation and repositioning
Contains trip_buffer, trip_location_hash_table, etc.
"""
import csv
import sys
from collections import deque
from math im... | 43.796522 | 98 | 0.64611 | #!/usr/bin/env python
"""
Filename: handler.py
Author: Keith Gladstone
Description:
This file is the heart of the program
It handles all vehicle allocation and repositioning
Contains trip_buffer, trip_location_hash_table, etc.
"""
import csv
import sys
from collections import deque
from math im... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
914cfd77d3892cb4712872995721e9e8cf776aec | 1,212 | py | Python | core/forms.py | Jokotoye18/DjangoEcommerce | ce17e7a36cff72623f67eb01221bdec323ebfb31 | [
"MIT"
] | null | null | null | core/forms.py | Jokotoye18/DjangoEcommerce | ce17e7a36cff72623f67eb01221bdec323ebfb31 | [
"MIT"
] | 4 | 2021-03-30T14:22:12.000Z | 2021-06-10T19:35:45.000Z | core/forms.py | Jokotoye18/DjangoEcommerce | ce17e7a36cff72623f67eb01221bdec323ebfb31 | [
"MIT"
] | null | null | null |
PAYMENT_METHOD = (
('S', 'stripe'),
('P', 'paypal')
) | 46.615385 | 130 | 0.70132 | from django import forms
from .models import BillingAddress
from django_countries.fields import CountryField
from django_countries.widgets import CountrySelectWidget
PAYMENT_METHOD = (
('S', 'stripe'),
('P', 'paypal')
)
class BillingAddressForm(forms.ModelForm):
same_billing_address = forms.BooleanField(... | 0 | 0 | 0 | 960 | 0 | 0 | 0 | 78 | 111 |
37788a8ca874e96f8e6c2587f107172bb4db2bb4 | 7,274 | py | Python | src/third_party/wiredtiger/test/suite/test_verbose03.py | benety/mongo | 203430ac9559f82ca01e3cbb3b0e09149fec0835 | [
"Apache-2.0"
] | null | null | null | src/third_party/wiredtiger/test/suite/test_verbose03.py | benety/mongo | 203430ac9559f82ca01e3cbb3b0e09149fec0835 | [
"Apache-2.0"
] | null | null | null | src/third_party/wiredtiger/test/suite/test_verbose03.py | benety/mongo | 203430ac9559f82ca01e3cbb3b0e09149fec0835 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a com... | 47.855263 | 135 | 0.678994 | #!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a com... | 0 | 2,324 | 0 | 3,155 | 0 | 0 | 0 | 41 | 89 |
b69313242ff3954bc2e977fe3a858149821e416d | 257 | py | Python | app/api/db/petition_test_data.py | ChegeBryan/politico | 746ef4c76931928ef145593092c8b391421a50fd | [
"MIT"
] | 1 | 2021-09-08T13:17:03.000Z | 2021-09-08T13:17:03.000Z | app/api/db/petition_test_data.py | ChegeBryan/politico | 746ef4c76931928ef145593092c8b391421a50fd | [
"MIT"
] | 62 | 2019-02-04T07:08:32.000Z | 2021-05-06T19:49:03.000Z | app/api/db/petition_test_data.py | ChegeBryan/politico | 746ef4c76931928ef145593092c8b391421a50fd | [
"MIT"
] | 5 | 2019-02-11T18:21:14.000Z | 2022-02-25T07:41:07.000Z | # petition test dummy data
petition = {
"office": 1,
"contested_by": 2,
"body": "some string",
"evidence": ['https://image.url']
}
invalid_petition_data = {
"office": "Not integer",
"body": 2,
"evidence": "Not a list of url"
}
| 17.133333 | 37 | 0.571984 | # petition test dummy data
petition = {
"office": 1,
"contested_by": 2,
"body": "some string",
"evidence": ['https://image.url']
}
invalid_petition_data = {
"office": "Not integer",
"body": 2,
"evidence": "Not a list of url"
}
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
873a65b9ef155fde35bc54bd1a84d03fd2c17704 | 451 | py | Python | src/kedro_devops/pipelines/data_engineering/nodes/transform_uppercase.py | julianlrcsumz/kedro-devops | 873fbd35a1c47d1b97786e516d70b1b9ece83664 | [
"MIT"
] | null | null | null | src/kedro_devops/pipelines/data_engineering/nodes/transform_uppercase.py | julianlrcsumz/kedro-devops | 873fbd35a1c47d1b97786e516d70b1b9ece83664 | [
"MIT"
] | null | null | null | src/kedro_devops/pipelines/data_engineering/nodes/transform_uppercase.py | julianlrcsumz/kedro-devops | 873fbd35a1c47d1b97786e516d70b1b9ece83664 | [
"MIT"
] | 4 | 2021-10-15T13:36:53.000Z | 2021-11-12T16:16:50.000Z | import pandas as pd
from requests import Response
def transform_uppercase(data_set: Response) -> pd.DataFrame:
"""
Transform a lowercase dataframe to uppercase.
Args:
data (pd.DataFrame): A raw dataframe
Returns:
pd.DataFrame: An uppercase dataframe
"""
json_data = data_set.j... | 23.736842 | 60 | 0.68071 | import pandas as pd
from requests import Response
def transform_uppercase(data_set: Response) -> pd.DataFrame:
"""
Transform a lowercase dataframe to uppercase.
Args:
data (pd.DataFrame): A raw dataframe
Returns:
pd.DataFrame: An uppercase dataframe
"""
json_data = data_set.j... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
23660dc491a39ae78ddad366f825d8b7d3630c41 | 535 | py | Python | CURSO UDEMY/TEORICAS/5.py | CamilliCerutti/Exercicios-de-Python-curso-em-video | 6571a5c5cb7b4398352a7778c55588c0c16f13c2 | [
"MIT"
] | null | null | null | CURSO UDEMY/TEORICAS/5.py | CamilliCerutti/Exercicios-de-Python-curso-em-video | 6571a5c5cb7b4398352a7778c55588c0c16f13c2 | [
"MIT"
] | null | null | null | CURSO UDEMY/TEORICAS/5.py | CamilliCerutti/Exercicios-de-Python-curso-em-video | 6571a5c5cb7b4398352a7778c55588c0c16f13c2 | [
"MIT"
] | null | null | null | frase = 'O rato roeu a roupa do rei de roma'
tamanho = len(frase)
contador = 0
nova_string = ''
print(frase)
while True:
input_do_usuario = input('Qual letra voce deseja colocar maiuscula: ')
if input_do_usuario not in frase:
print('Escolha uma letra que esteja no texto')
else:
break
whi... | 21.4 | 74 | 0.657944 | frase = 'O rato roeu a roupa do rei de roma'
tamanho = len(frase)
contador = 0
nova_string = ''
print(frase)
while True:
input_do_usuario = input('Qual letra voce deseja colocar maiuscula: ')
if input_do_usuario not in frase:
print('Escolha uma letra que esteja no texto')
else:
break
whi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9cf65e28a279c6041cf2dd8a3d2c3545e5e2c9ed | 2,994 | py | Python | Layer.py | orishamir/OriScapy | 68acbe9c4ccefcdf611de58277e64a4055111a58 | [
"MIT"
] | null | null | null | Layer.py | orishamir/OriScapy | 68acbe9c4ccefcdf611de58277e64a4055111a58 | [
"MIT"
] | null | null | null | Layer.py | orishamir/OriScapy | 68acbe9c4ccefcdf611de58277e64a4055111a58 | [
"MIT"
] | null | null | null | from colorama import init, Style
RST = Style.RESET_ALL
init() | 31.851064 | 147 | 0.514696 | from abc import ABCMeta, abstractmethod
from colorama import init, Fore, Style
RST = Style.RESET_ALL
init()
class Layer(metaclass=ABCMeta):
def __truediv__(self, other):
if hasattr(self, 'data'):
self.data = self.data / other
else:
self.data = other
return self
... | 0 | 0 | 0 | 2,864 | 0 | 0 | 0 | 24 | 45 |
0a0859528945a7b944482442b0ffc658d0dc05f9 | 18,295 | py | Python | fsl/utils/path.py | physimals/fslpy | 10dd3f996c79d402c65cf0af724b8b00082d5176 | [
"Apache-2.0"
] | null | null | null | fsl/utils/path.py | physimals/fslpy | 10dd3f996c79d402c65cf0af724b8b00082d5176 | [
"Apache-2.0"
] | null | null | null | fsl/utils/path.py | physimals/fslpy | 10dd3f996c79d402c65cf0af724b8b00082d5176 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# path.py - Utility functions for working with file/directory paths.
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
"""This module contains a few utility functions for working with file system
paths.
.. autosummary::
:nosignatures:
deepest
shallowest
allFiles
hasExt
a... | 31.166951 | 108 | 0.607598 | #!/usr/bin/env python
#
# path.py - Utility functions for working with file/directory paths.
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
"""This module contains a few utility functions for working with file system
paths.
.. autosummary::
:nosignatures:
deepest
shallowest
allFiles
hasExt
a... | 0 | 0 | 0 | 128 | 0 | 0 | 0 | 44 | 23 |
45a3d4d8a1f127580265a0a3c5979a90f99be58c | 2,219 | py | Python | implementation/data_io.py | rpalo/masters-thesis | fcc0beb933634b17dbe41bde982e947204fd498b | [
"MIT"
] | null | null | null | implementation/data_io.py | rpalo/masters-thesis | fcc0beb933634b17dbe41bde982e947204fd498b | [
"MIT"
] | null | null | null | implementation/data_io.py | rpalo/masters-thesis | fcc0beb933634b17dbe41bde982e947204fd498b | [
"MIT"
] | null | null | null | """Data I/O: Import and export data to other useable formats."""
import csv
from pathlib import Path
from model import Job
def import_csv(filename, base_dir=Path("data/")):
"""Converts CSV files with the relevant data (see columns below) to
a list of Jobs.
"""
datafile = base_dir / filename
with ... | 36.377049 | 85 | 0.545291 | """Data I/O: Import and export data to other useable formats."""
import csv
from pathlib import Path
from model import Job
def import_csv(filename, base_dir=Path("data/")):
"""Converts CSV files with the relevant data (see columns below) to
a list of Jobs.
"""
datafile = base_dir / filename
with ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4b6df05e93d40512d05614cf34c5a45fa482901a | 3,203 | py | Python | main.py | dilynfullerton/turing | f175b14b1fb1afe9f2bfeebd1cc069eef6658706 | [
"CC0-1.0"
] | 3 | 2016-07-20T08:46:55.000Z | 2018-05-14T11:27:41.000Z | main.py | dilynfullerton/turing | f175b14b1fb1afe9f2bfeebd1cc069eef6658706 | [
"CC0-1.0"
] | null | null | null | main.py | dilynfullerton/turing | f175b14b1fb1afe9f2bfeebd1cc069eef6658706 | [
"CC0-1.0"
] | null | null | null |
main()
| 31.401961 | 80 | 0.652825 | from turing import turing_machine_from_file
from turing import tape_from_file
from turing import Tape
def main():
# busy_beaver3 = turing_machine_from_file('examples/bb3.txt')
# busy_beaver3.compute(
# input_tape='examples/bb3_input.txt',
# print_results=False)
#
# busy_beaver4 = turin... | 0 | 0 | 0 | 0 | 0 | 3,068 | 0 | 36 | 89 |
3494f87ceb9d94ec03be1cb6fd48f0923ce4c7df | 7,460 | py | Python | tests/jaxpr_effects_test.py | mbmccoy/jax | 74346f464bc8369d81964305fcf05f95f43fb2d3 | [
"Apache-2.0"
] | null | null | null | tests/jaxpr_effects_test.py | mbmccoy/jax | 74346f464bc8369d81964305fcf05f95f43fb2d3 | [
"Apache-2.0"
] | 3 | 2022-01-24T06:14:55.000Z | 2022-02-14T06:15:38.000Z | tests/jaxpr_effects_test.py | mbmccoy/jax | 74346f464bc8369d81964305fcf05f95f43fb2d3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 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, ... | 29.959839 | 78 | 0.684316 | # Copyright 2022 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, ... | 0 | 1,031 | 0 | 5,173 | 0 | 0 | 0 | 41 | 335 |
7c48d9a6536a3ab26943aaff46659b78907afae2 | 14,748 | py | Python | stage3/06-install-jamulus/files/midi-jamulus-xtouchmini-16ch.py | kdoren/pi-gen | f4421d81bf6b90232e5d39878e03016005324f92 | [
"BSD-3-Clause"
] | null | null | null | stage3/06-install-jamulus/files/midi-jamulus-xtouchmini-16ch.py | kdoren/pi-gen | f4421d81bf6b90232e5d39878e03016005324f92 | [
"BSD-3-Clause"
] | null | null | null | stage3/06-install-jamulus/files/midi-jamulus-xtouchmini-16ch.py | kdoren/pi-gen | f4421d81bf6b90232e5d39878e03016005324f92 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
#
# Midi routing layer between jack and jamulus
# For Behringer X-Touch Mini MIDI controller
#
# Layer A: control 8 jamulus channels 0-7 (slider controls ALSA master level)
# Layer B: Control 8 jamulus channels 8-15 (slider controls ALSA capture level)
#
# Rotary encoder has 2 states (push to t... | 38.108527 | 128 | 0.62978 | #!/usr/bin/python3
#
# Midi routing layer between jack and jamulus
# For Behringer X-Touch Mini MIDI controller
#
# Layer A: control 8 jamulus channels 0-7 (slider controls ALSA master level)
# Layer B: Control 8 jamulus channels 8-15 (slider controls ALSA capture level)
#
# Rotary encoder has 2 states (push to t... | 0 | 0 | 0 | 0 | 0 | 5,567 | 0 | -13 | 202 |
04625ef97b3d9a70d91769d8ccbc3dd7efc12726 | 1,082 | py | Python | tools/filters/axt_to_fasta.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | 2 | 2016-02-23T00:09:14.000Z | 2019-02-11T07:48:44.000Z | tools/filters/axt_to_fasta.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | 1 | 2015-02-21T18:48:19.000Z | 2015-02-27T15:50:32.000Z | tools/filters/axt_to_fasta.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | 6 | 2015-05-27T13:09:50.000Z | 2019-02-11T07:48:46.000Z | #!/usr/bin/env python
"""
Adapted from bx/scripts/axt_to_fasta.py
"""
import pkg_resources
pkg_resources.require( "bx-python" )
# $$$ this should be moved to a bx.align.fasta module
if __name__ == "__main__": main()
| 21.64 | 66 | 0.654344 | #!/usr/bin/env python
"""
Adapted from bx/scripts/axt_to_fasta.py
"""
from galaxy import eggs
import pkg_resources
pkg_resources.require( "bx-python" )
import sys
import bx.align.axt
def usage(s=None):
message = """
axt_to_fasta species1 species2 < axt_file > fasta_file
"""
if (s == None): sys.exit (message)
else:... | 0 | 0 | 0 | 0 | 0 | 735 | 0 | -11 | 136 |
5b924eaa5c7595b402c7d9e6b8d0304889589068 | 809 | py | Python | hackerrank/30 Days of Code/Day 5 - Loops/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | 4 | 2020-07-24T01:59:50.000Z | 2021-07-24T15:14:08.000Z | hackerrank/30 Days of Code/Day 5 - Loops/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | hackerrank/30 Days of Code/Day 5 - Loops/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 28.892857 | 46 | 0.363412 | import io
import unittest
from contextlib import redirect_stdout
import solution
class TestQ(unittest.TestCase):
def test_case_0(self):
text_trap = io.StringIO()
with redirect_stdout(text_trap):
solution.main(2)
self.assertEqual(text_trap.getvalue(),
'... | 0 | 0 | 0 | 654 | 0 | 0 | 0 | -1 | 90 |
92f341927ed4dd0d4741361b5318c57e665127b7 | 52,243 | py | Python | networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py | Gitweijie/first_project | e27ec5a03b20022a66c994c0ee89ef7023cc5c29 | [
"Apache-2.0"
] | null | null | null | networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py | Gitweijie/first_project | e27ec5a03b20022a66c994c0ee89ef7023cc5c29 | [
"Apache-2.0"
] | null | null | null | networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py | Gitweijie/first_project | e27ec5a03b20022a66c994c0ee89ef7023cc5c29 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Cisco Systems, Inc. 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 requir... | 45.271231 | 79 | 0.604866 | # Copyright 2014 Cisco Systems, Inc. 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 requir... | 0 | 3,042 | 0 | 47,043 | 0 | 0 | 0 | 328 | 538 |
e14c362ef033e9d01558bffaeb08648350895f3c | 995 | py | Python | src/models/client.py | fibasile/ticket-gateway | 811a216281a17150adca3edf691f9cf5a1478d2f | [
"MIT"
] | null | null | null | src/models/client.py | fibasile/ticket-gateway | 811a216281a17150adca3edf691f9cf5a1478d2f | [
"MIT"
] | null | null | null | src/models/client.py | fibasile/ticket-gateway | 811a216281a17150adca3edf691f9cf5a1478d2f | [
"MIT"
] | null | null | null | """
Define the Channel model
"""
KEY_LENGTH = 64
| 27.638889 | 72 | 0.657286 | """
Define the Channel model
"""
from . import db
from .abc import BaseModel, MetaBaseModel
from binascii import hexlify
import os
KEY_LENGTH = 64
class Client(db.Model, BaseModel, metaclass=MetaBaseModel):
""" The Channel model """
__tablename__ = 'client'
slug = db.Column(db.String(300), primary_key=T... | 0 | 78 | 0 | 745 | 0 | 0 | 0 | 10 | 111 |
1c6561b063054a6ec52921b6fecd24fdbfbcb829 | 3,209 | py | Python | electrum/tests/test_three_keys_transaction.py | mgrychow/electrum-vault | a15b0fc5db4e83801cd7f1ba3defd56daa0b058a | [
"MIT"
] | 8 | 2020-03-18T21:55:38.000Z | 2021-03-01T12:54:47.000Z | electrum/tests/test_three_keys_transaction.py | mgrychow/electrum-vault | a15b0fc5db4e83801cd7f1ba3defd56daa0b058a | [
"MIT"
] | 6 | 2020-07-10T13:17:21.000Z | 2021-04-26T11:47:22.000Z | electrum/tests/test_three_keys_transaction.py | mgrychow/electrum-vault | a15b0fc5db4e83801cd7f1ba3defd56daa0b058a | [
"MIT"
] | 8 | 2020-05-10T11:04:15.000Z | 2021-05-06T14:51:46.000Z |
TX = '0200000001eaa85f4446a8d48b345592b7bc540678ef1e0f4a80b4893e9bedbf9aae636d9400000000280000255121023765a77db702ab87d5cf6431d81a4734d9a636eb95446ffe01fa06ac190ce56c51aefdffffff02008c86470000000017a9142664929e5ed5356477dad1404f51bb507e89f9aa87b0398ecb0300000017a914a2703755a1b5e5aa06e742f3db127628d6ed40cd876c030000'
... | 38.202381 | 317 | 0.714241 | from collections import namedtuple
from typing import List
from unittest import TestCase
from electrum import Transaction
from electrum.three_keys.multikey_generator import MultiKeyScriptGenerator
from electrum.three_keys.transaction import ThreeKeysTransaction, TxType
TX = '0200000001eaa85f4446a8d48b345592b7bc540678... | 0 | 0 | 0 | 2,547 | 0 | 0 | 0 | 138 | 202 |
483a6d2c7223c8cfe9fb9a0e0968b1ec56d31e1b | 2,745 | py | Python | sirius/matrices.py | natebunnyfield/sirius | b57863e9d5f241ee8a3c7c2b43bf0da5b85d486c | [
"BSD-3-Clause"
] | 1 | 2019-10-01T17:15:24.000Z | 2019-10-01T17:15:24.000Z | sirius/matrices.py | natebunnyfield/sirius | b57863e9d5f241ee8a3c7c2b43bf0da5b85d486c | [
"BSD-3-Clause"
] | null | null | null | sirius/matrices.py | natebunnyfield/sirius | b57863e9d5f241ee8a3c7c2b43bf0da5b85d486c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from math import ceil
import os
import yaml
CONFIG_DIR = os.path.abspath(os.path.join(__file__, '..', 'shipping_configs'))
# ups ground
UPS_GROUND_ZIP_TO_ZONE = yaml.load(open(os.path.join(CONFIG_DIR, 'ups_ground_zip_to_zone.yaml'), 'r'))
UPS_GROUND_ZONE_WEIGHT_PRICE =... | 35.192308 | 114 | 0.668488 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from math import ceil
import os
import yaml
CONFIG_DIR = os.path.abspath(os.path.join(__file__, '..', 'shipping_configs'))
# ups ground
UPS_GROUND_ZIP_TO_ZONE = yaml.load(open(os.path.join(CONFIG_DIR, 'ups_ground_zip_to_zone.yaml'), 'r'))
UPS_GROUND_ZONE_WEIGHT_PRICE =... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0b23c6c86af91d41e4d8bda165dad1aab59afd10 | 16,743 | py | Python | music.py | edvinassaikevicius/Discord_Music_Bot | 931f64c76d3164626ddee27ef00bfef443ca27a6 | [
"MIT"
] | null | null | null | music.py | edvinassaikevicius/Discord_Music_Bot | 931f64c76d3164626ddee27ef00bfef443ca27a6 | [
"MIT"
] | null | null | null | music.py | edvinassaikevicius/Discord_Music_Bot | 931f64c76d3164626ddee27ef00bfef443ca27a6 | [
"MIT"
] | null | null | null | import re
url_rx = re.compile(r'https?://(?:www\.)?.+')
"""
Robert A. USF Computer Science
A cog to hold all of the functions used to play music for the bot.
""" | 49.979104 | 217 | 0.61351 | import re
import random
import discord
import lavalink
from discord.ext import commands
import asyncio
import fileRead
url_rx = re.compile(r'https?://(?:www\.)?.+')
"""
Robert A. USF Computer Science
A cog to hold all of the functions used to play music for the bot.
"""
class music(commands.Cog):
def __init__(self... | 0 | 12,757 | 2,478 | 1,162 | 0 | 22 | 0 | -23 | 186 |
579cdee2a6b24c2118b16d29b2ea7f8695a96d6a | 4,766 | py | Python | notebooks/vacc_booster_gap.py | pbarber/ni-covid-tweets | fd108d8d570aafe4dca6741066af8c2ef92e6b03 | [
"MIT"
] | 1 | 2021-12-13T23:08:45.000Z | 2021-12-13T23:08:45.000Z | notebooks/vacc_booster_gap.py | aarong1/ni-covid-tweets | cbe1e2bc4333b31cdf4e281ed04fc77743938faa | [
"MIT"
] | 18 | 2021-03-30T19:45:37.000Z | 2022-02-02T18:36:17.000Z | notebooks/vacc_booster_gap.py | aarong1/ni-covid-tweets | cbe1e2bc4333b31cdf4e281ed04fc77743938faa | [
"MIT"
] | 1 | 2021-12-13T23:08:32.000Z | 2021-12-13T23:08:32.000Z | # %%
import datetime
import pandas
from plot_shared import plot_points_average_and_trend
# %%
df = pandas.read_csv('https://api.coronavirus.data.gov.uk/v2/data?areaType=nation&metric=cumPeopleVaccinatedFirstDoseByPublishDate&metric=cumPeopleVaccinatedSecondDoseByPublishDate&format=csv')
df.rename(columns={
'cumPe... | 46.72549 | 193 | 0.652749 | # %%
import datetime
import pandas
import altair
from plot_shared import plot_points_average_and_trend
# %%
df = pandas.read_csv('https://api.coronavirus.data.gov.uk/v2/data?areaType=nation&metric=cumPeopleVaccinatedFirstDoseByPublishDate&metric=cumPeopleVaccinatedSecondDoseByPublishDate&format=csv')
df.rename(column... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -8 | 22 |
12d73c6d2017c67c4a8634393e9f0c3835f37434 | 2,369 | py | Python | stock/strategy/gapup.py | shenzhongqiang/cnstock_py | 2bb557657a646acb9d20d3ce78e15cf68390f8ea | [
"MIT"
] | 2 | 2016-10-31T04:05:11.000Z | 2017-04-17T08:46:53.000Z | stock/strategy/gapup.py | shenzhongqiang/cnstock_py | 2bb557657a646acb9d20d3ce78e15cf68390f8ea | [
"MIT"
] | null | null | null | stock/strategy/gapup.py | shenzhongqiang/cnstock_py | 2bb557657a646acb9d20d3ce78e15cf68390f8ea | [
"MIT"
] | null | null | null | import sys
import copy
import numpy as np
import pandas as pd
from sklearn.svm import SVR
import matplotlib.pyplot as plt
from matplotlib.finance import candlestick
from matplotlib.dates import date2num, WeekdayLocator, DateFormatter, MONDAY, MonthLocator
symbols = get_stock_symbols('all')
marketdata = backtestdata.B... | 28.890244 | 90 | 0.67919 | import sys
import copy
import numpy as np
import pandas as pd
from sklearn.svm import SVR
import matplotlib.pyplot as plt
from matplotlib.finance import candlestick
from matplotlib.dates import date2num, WeekdayLocator, DateFormatter, MONDAY, MonthLocator
from stock.utils.symbol_util import *
from stock.globalvar impor... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 44 | 88 |
99b469d88749b5c5e4fcfb6f7404572eef939fc6 | 62 | py | Python | mplibtest.py | stroblme/hqsp-stqft | c2f8f8964648578755d3938bf8658e4c834548e8 | [
"MIT"
] | null | null | null | mplibtest.py | stroblme/hqsp-stqft | c2f8f8964648578755d3938bf8658e4c834548e8 | [
"MIT"
] | null | null | null | mplibtest.py | stroblme/hqsp-stqft | c2f8f8964648578755d3938bf8658e4c834548e8 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
plt.plot(range(10))
plt.show() | 20.666667 | 31 | 0.774194 | import matplotlib.pyplot as plt
plt.plot(range(10))
plt.show() | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
87496910ea9ab1a763212c44a602527db390c55c | 1,317 | py | Python | cli/test/functional/test_step_functions.py | mattsb42/accretion | 7cce5f4ed6d290bd9314b116be91417ded6b0f64 | [
"Apache-2.0"
] | 1 | 2019-10-19T11:18:17.000Z | 2019-10-19T11:18:17.000Z | cli/test/functional/test_step_functions.py | mattsb42/accretion | 7cce5f4ed6d290bd9314b116be91417ded6b0f64 | [
"Apache-2.0"
] | 13 | 2019-06-10T07:03:26.000Z | 2019-11-06T01:09:38.000Z | cli/test/functional/test_step_functions.py | mattsb42/accretion | 7cce5f4ed6d290bd9314b116be91417ded6b0f64 | [
"Apache-2.0"
] | null | null | null | """Functional tests for ``accretion_cli._stepfunctions``."""
import pytest
pytestmark = [pytest.mark.local, pytest.mark.functional]
| 29.266667 | 118 | 0.759301 | """Functional tests for ``accretion_cli._stepfunctions``."""
import json
import pytest
from accretion_cli._templates.services.stepfunctions import _artifact_builder_workflow, _replication_listener_workflow
from .functional_test_utils import load_vector
pytestmark = [pytest.mark.local, pytest.mark.functional]
def ... | 0 | 0 | 0 | 0 | 0 | 931 | 0 | 112 | 137 |
1e2b33389dc089f41107ab2ec2a2cb95a2e849f3 | 5,167 | py | Python | tests/test_tweet_sentiment.py | chrisfalter/BLM | eeb3eb3e011ec2ec02a21f90451422b5e22c2b9e | [
"MIT"
] | 1 | 2021-06-13T15:55:49.000Z | 2021-06-13T15:55:49.000Z | tests/test_tweet_sentiment.py | chrisfalter/BLM | eeb3eb3e011ec2ec02a21f90451422b5e22c2b9e | [
"MIT"
] | null | null | null | tests/test_tweet_sentiment.py | chrisfalter/BLM | eeb3eb3e011ec2ec02a21f90451422b5e22c2b9e | [
"MIT"
] | null | null | null |
sample_text = "It was the best of times, it was the worst of times, " \
"it was the age of wisdom, it was the age of foolishness, " \
"it was the epoch of belief, it was the epoch of incredulity, " \
"it was the season of Life, it was the season of Darkness, " \
"it was the spring of hope, it was the ... | 35.881944 | 108 | 0.689375 | import pytest
from src.tweet_sentiment import (
EmoScores,
PronounCounts,
SentimentAnalysis,
summarize_sentiment,
_get_emotion_scores,
_get_pronoun_counts,
_get_sentiment
)
sample_text = "It was the best of times, it was the worst of times, " \
"it was the age of wisdom, it was the ag... | 0 | 0 | 0 | 0 | 0 | 3,863 | 0 | 157 | 321 |
a8ff93872dcb01832b50b6a88d9561e1d8f9eda9 | 2,765 | py | Python | Banking-Inferences(Inferential-Statistics)/code.py | RohanBarghare/ga-learner-dsmp-repo | ec5aa9697d79da48b6e3446d2a9bc4f0544560c9 | [
"MIT"
] | null | null | null | Banking-Inferences(Inferential-Statistics)/code.py | RohanBarghare/ga-learner-dsmp-repo | ec5aa9697d79da48b6e3446d2a9bc4f0544560c9 | [
"MIT"
] | null | null | null | Banking-Inferences(Inferential-Statistics)/code.py | RohanBarghare/ga-learner-dsmp-repo | ec5aa9697d79da48b6e3446d2a9bc4f0544560c9 | [
"MIT"
] | null | null | null | # --------------
import pandas as pd
import scipy.stats as stats
import math
import numpy as np
import warnings
warnings.filterwarnings('ignore')
#Sample_Size
sample_size=2000
#Z_Critical Score
z_critical = stats.norm.ppf(q = 0.95)
# path [File location variable]
data=pd.read_csv(path)
#Cod... | 27.929293 | 88 | 0.670163 | # --------------
import pandas as pd
import scipy.stats as stats
import math
import numpy as np
import warnings
warnings.filterwarnings('ignore')
#Sample_Size
sample_size=2000
#Z_Critical Score
z_critical = stats.norm.ppf(q = 0.95)
# path [File location variable]
data=pd.read_csv(path)
#Cod... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
090738636e324433c3033993224836a0912177a0 | 3,453 | py | Python | face_streaming_server.py | PNUIOTLAB/face_recognition_client | ee44ebbc8e76cb940577dd9ce31fe06a09c18de6 | [
"BSL-1.0"
] | null | null | null | face_streaming_server.py | PNUIOTLAB/face_recognition_client | ee44ebbc8e76cb940577dd9ce31fe06a09c18de6 | [
"BSL-1.0"
] | null | null | null | face_streaming_server.py | PNUIOTLAB/face_recognition_client | ee44ebbc8e76cb940577dd9ce31fe06a09c18de6 | [
"BSL-1.0"
] | null | null | null | import time
import threading
from flask import Flask
import socket
import select
# Flask Image frame
global video_frame
video_frame = None
# thread-safe .
global thread_lock
thread_lock = threading.Lock()
# Raspberry Camera GStreamer
GSTREAMER_PIPELINE = 'nvarguscamerasrc ! video/x-raw(memory:NVMM), width=1... | 31.108108 | 313 | 0.637706 | import cv2
import time
import threading
from flask import Response, Flask
import time
import os
import sys
import socket
import select
# Flask 객체로 Image frame 전달
global video_frame
video_frame = None
# 다양한 브라우저에서 프레임들의 thread-safe 출력을 잠근다.
global thread_lock
thread_lock = threading.Lock()
# Raspberry Camera에 접근하기 위한... | 408 | 103 | 0 | 0 | 456 | 814 | 0 | -34 | 180 |
c5bc60fc16c77b9e8d2c61a215a4fe4027b0f78b | 1,401 | py | Python | LeetCode/python-R1/0024- 两两交换链表中的节点/V1.py | huuuuusy/Programming-Practice-Everyday | c78b368ab0439d85b8a69f6d9c8154d708bafc9c | [
"Apache-2.0"
] | 4 | 2019-08-27T11:28:03.000Z | 2020-12-24T07:10:22.000Z | LeetCode/python-R1/0024- 两两交换链表中的节点/V1.py | huuuuusy/Programming-Practice-Everyday | c78b368ab0439d85b8a69f6d9c8154d708bafc9c | [
"Apache-2.0"
] | null | null | null | LeetCode/python-R1/0024- 两两交换链表中的节点/V1.py | huuuuusy/Programming-Practice-Everyday | c78b368ab0439d85b8a69f6d9c8154d708bafc9c | [
"Apache-2.0"
] | 4 | 2019-09-20T09:44:01.000Z | 2020-12-24T07:10:23.000Z | """
@Author: huuuuusy
@GitHub: https://github.com/huuuuusy
Ubuntu 18.04
IDE: VS Code 1.37
python == 3.7.3
"""
"""
:
: 48 ms, Python3 76.77%
: 13.8 MB, Python3 5.93%
"""
#
if __name__ == "__main__":
l1 = ListNode(1)
l1.next = ListNode(2)
l1.next.next = ListNode(3)
... | 23.35 | 65 | 0.540328 | """
@Author: huuuuusy
@GitHub: https://github.com/huuuuusy
系统: Ubuntu 18.04
IDE: VS Code 1.37
工具: python == 3.7.3
"""
"""
思路:
暴力解法,直接取出所有元素,排序后再存入新的链表中
结果:
执行用时 : 48 ms, 在所有 Python3 提交中击败了76.77%的用户
内存消耗 : 13.8 MB, 在所有 Python3 提交中击败了5.93%的用户
"""
# 定义链表
class ListNode:
def __init__(self,x):
sel... | 279 | 0 | 0 | 712 | 0 | 0 | 0 | 0 | 46 |
9f592c9983e58816d6a9a02264b3012dba617a05 | 1,290 | py | Python | logger.py | Anu1996rag/PythonLogging | 3231c76c680a20df27182e99ffcc116f95b5f864 | [
"MIT"
] | null | null | null | logger.py | Anu1996rag/PythonLogging | 3231c76c680a20df27182e99ffcc116f95b5f864 | [
"MIT"
] | null | null | null | logger.py | Anu1996rag/PythonLogging | 3231c76c680a20df27182e99ffcc116f95b5f864 | [
"MIT"
] | null | null | null | # this file creates new log files in the particular folders created by the
# createFolder file and generates separate log files for separate programs
import logging, logging.config
# logging levels
loglevel = "debug"
if loglevel.upper() == "DEBUG":
loglevels = logging.DEBUG
elif loglevel.upper() == "INFO":
l... | 26.326531 | 110 | 0.717054 | # this file creates new log files in the particular folders created by the
# createFolder file and generates separate log files for separate programs
import os,inspect
import logging,logging.config
from createFolder import createFolder
# logging levels
loglevel = "debug"
if loglevel.upper() == "DEBUG":
loglevel... | 0 | 0 | 0 | 0 | 0 | 600 | 0 | 11 | 91 |
e0c9ffa5cddba48275d62feb92bcea844dd90204 | 2,764 | py | Python | app.py | galaxyxxxxx/audio2img | d44a34de1fb7c6bcd5dc3ba40704077a457e9c48 | [
"MIT"
] | null | null | null | app.py | galaxyxxxxx/audio2img | d44a34de1fb7c6bcd5dc3ba40704077a457e9c48 | [
"MIT"
] | null | null | null | app.py | galaxyxxxxx/audio2img | d44a34de1fb7c6bcd5dc3ba40704077a457e9c48 | [
"MIT"
] | 1 | 2021-01-27T05:47:03.000Z | 2021-01-27T05:47:03.000Z | from flask import Flask
app = Flask(__name__)
#CORS(app, supports_credentials=True) #For
#app.config['SEND_FILE_MAX_AGE_DEFAULT'] = timedelta(seconds=1) #
# api
ASR_URL = 'https://voice.lenovomm.com/lasf/asr'
#
if __name__ == '__main__':
app.run(debug=True)
| 31.05618 | 118 | 0.613965 | from flask import Flask, render_template, request, jsonify,redirect, url_for
from werkzeug.utils import secure_filename
import requests
import random
import json
import os
import time
import xlrd
from flask_cors import CORS
from requests_toolbelt import MultipartEncoder
app = Flask(__name__)
#CORS(app, supports_crede... | 237 | 341 | 0 | 0 | 0 | 1,722 | 0 | 49 | 289 |
758f9f954011f69548b7ff155de4e6d303ed3998 | 756 | py | Python | easy/count-primes.py | therealabdi2/LeetcodeQuestions | 4c45ee836482a2c7b59906f7a7a99b5b3fa17317 | [
"MIT"
] | null | null | null | easy/count-primes.py | therealabdi2/LeetcodeQuestions | 4c45ee836482a2c7b59906f7a7a99b5b3fa17317 | [
"MIT"
] | null | null | null | easy/count-primes.py | therealabdi2/LeetcodeQuestions | 4c45ee836482a2c7b59906f7a7a99b5b3fa17317 | [
"MIT"
] | null | null | null | """Count the number of prime numbers less than a non-negative number, n.
Example 1:
Input: n = 10
Output: 4
Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7.
Example 2:
Input: n = 0
Output: 0
Example 3:
Input: n = 1
Output: 0"""
s = Solution()
print(s.countPrimes(12))
| 19.894737 | 78 | 0.589947 | """Count the number of prime numbers less than a non-negative number, n.
Example 1:
Input: n = 10
Output: 4
Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7.
Example 2:
Input: n = 0
Output: 0
Example 3:
Input: n = 1
Output: 0"""
import math
class Solution:
def countPrimes(self, n: in... | 0 | 0 | 0 | 419 | 0 | 0 | 0 | -10 | 45 |
1cab8e10520f9ed00a854568085670a24e8869bf | 1,041 | py | Python | train/grid_search.py | veritas9872/Knowledge-Distillation-Task | d260b1057c96cfc52af8ff7a0775befbd102f59d | [
"MIT"
] | 2 | 2020-02-16T13:30:27.000Z | 2021-01-18T14:18:26.000Z | train/grid_search.py | veritas9872/Knowledge-Distillation-Task | d260b1057c96cfc52af8ff7a0775befbd102f59d | [
"MIT"
] | null | null | null | train/grid_search.py | veritas9872/Knowledge-Distillation-Task | d260b1057c96cfc52af8ff7a0775befbd102f59d | [
"MIT"
] | null | null | null | """
Code for applying grid search to find the best parameters for knowledge distillation.
The distillation ratio and temperature parameters are being tuned in this search.
"""
import torch
if __name__ == '__main__':
# Reproducibility settings.
torch.backends.cudnn.benchmark = False
torch.backends.cudnn.d... | 31.545455 | 91 | 0.673391 | """
Code for applying grid search to find the best parameters for knowledge distillation.
The distillation ratio and temperature parameters are being tuned in this search.
"""
import torch
from train.distill_knowledge import main
from utils.options import knowledge_distillation_options
def grid_search():
options... | 0 | 0 | 0 | 0 | 0 | 561 | 0 | 54 | 68 |
6ee110a8e3ab8f33b2314a11563292fe766bc8bb | 1,121 | py | Python | psst.py | Thomas-Hirsch/airflow-dags | 37b1e9a44dbfd508c1f6b86c712d699bfdff4ca2 | [
"Apache-2.0"
] | null | null | null | psst.py | Thomas-Hirsch/airflow-dags | 37b1e9a44dbfd508c1f6b86c712d699bfdff4ca2 | [
"Apache-2.0"
] | null | null | null | psst.py | Thomas-Hirsch/airflow-dags | 37b1e9a44dbfd508c1f6b86c712d699bfdff4ca2 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from airflow import DAG
from airflow.contrib.operators.kubernetes_pod_operator import KubernetesPodOperator
# GLOBAL ENV VARIABLES
IMAGE_VERSION = "v1.0.0"
IMAGE = f"593291632749.dkr.ecr.eu-west-1.amazonaws.com/airflow-psst-data:{IMAGE_VERSION}"
ROLE = "airflow_psst_data"
# Task argument... | 24.911111 | 89 | 0.711864 | from datetime import datetime, timedelta
import airflow
from airflow import DAG
from airflow.contrib.operators.kubernetes_pod_operator import KubernetesPodOperator
from airflow.utils.dates import days_ago
# GLOBAL ENV VARIABLES
IMAGE_VERSION = "v1.0.0"
IMAGE = f"593291632749.dkr.ecr.eu-west-1.amazonaws.com/airflow-ps... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 23 | 45 |
dd078f8b597fc5457e2c4a5dbf2b958195904e31 | 661 | py | Python | boofuzz/boofuzz/connections/ip_constants.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | 2 | 2021-05-05T12:03:01.000Z | 2021-06-04T14:27:15.000Z | boofuzz/boofuzz/connections/ip_constants.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | null | null | null | boofuzz/boofuzz/connections/ip_constants.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | 2 | 2021-05-05T12:03:09.000Z | 2021-06-04T14:27:21.000Z | """
This file contains constants for the IPv4 protocol.
.. versionchanged:: 0.2.0
ip_constants has been moved into the connections subpackage.
The full path is now boofuzz.connections.ip_constants
"""
IPV4_PROTOCOL_UDP = 0x11
#: Theoretical maximum length of a UDP packet, based on constraints in the UDP
#: pac... | 38.882353 | 78 | 0.779123 | """
This file contains constants for the IPv4 protocol.
.. versionchanged:: 0.2.0
ip_constants has been moved into the connections subpackage.
The full path is now boofuzz.connections.ip_constants
"""
IPV4_PROTOCOL_UDP = 0x11
#: Theoretical maximum length of a UDP packet, based on constraints in the UDP
#: pac... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
31e33b4f971db68d33d49ba1581c6e72c9b06d43 | 4,183 | py | Python | mdcs/explore.py | knc6/MDCS-api-tools | eb51a1124e3daf2c4c1e968395f66e85c22b92f9 | [
"CC0-1.0"
] | null | null | null | mdcs/explore.py | knc6/MDCS-api-tools | eb51a1124e3daf2c4c1e968395f66e85c22b92f9 | [
"CC0-1.0"
] | null | null | null | mdcs/explore.py | knc6/MDCS-api-tools | eb51a1124e3daf2c4c1e968395f66e85c22b92f9 | [
"CC0-1.0"
] | null | null | null | #! /usr/bin/env python
import requests
from utils import check_response
def select_all(host,user,pswd,cert=None,format=None):
"""Get all data from the MDCS server
Inputs:
host - string, URL of MDCS instance
user - string, username of desired account on MDCS server
pswd - string, pa... | 41.415842 | 87 | 0.643318 | #! /usr/bin/env python
import requests
from collections import OrderedDict
from utils import check_response
def select_all(host,user,pswd,cert=None,format=None):
"""Get all data from the MDCS server
Inputs:
host - string, URL of MDCS instance
user - string, username of desired account on M... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 22 |
d3e0669a72fd4a4883dec6a69028023f6abf7602 | 45,858 | py | Python | aerospike_helpers/expressions/list.py | mcoberly2/aerospike-client-python | d405891f0d6d8b2fc14f78841370bc6a1d302494 | [
"Apache-2.0"
] | null | null | null | aerospike_helpers/expressions/list.py | mcoberly2/aerospike-client-python | d405891f0d6d8b2fc14f78841370bc6a1d302494 | [
"Apache-2.0"
] | null | null | null | aerospike_helpers/expressions/list.py | mcoberly2/aerospike-client-python | d405891f0d6d8b2fc14f78841370bc6a1d302494 | [
"Apache-2.0"
] | null | null | null | ##########################################################################
# Copyright 2013-2021 Aerospike, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/... | 44.009597 | 180 | 0.62748 | ##########################################################################
# Copyright 2013-2021 Aerospike, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/... | 0 | 0 | 0 | 42,980 | 0 | 0 | 0 | 214 | 845 |
f63c55bac69dfb491106ccd06c919a0136dd5de3 | 885 | py | Python | files/split.py | acepj60/MkCheck | 7765cfad3e7ef198945fa2fe70c1b3cb8f9e5290 | [
"Unlicense"
] | 1 | 2021-11-06T23:02:22.000Z | 2021-11-06T23:02:22.000Z | files/split.py | whiterabb17/MkCheck | 567ab17743209e08e5d8d391a8eaf217cb0dd3c5 | [
"Unlicense"
] | null | null | null | files/split.py | whiterabb17/MkCheck | 567ab17743209e08e5d8d391a8eaf217cb0dd3c5 | [
"Unlicense"
] | null | null | null | #/usr/bin/env python3
my_file = '/opt/MkCheck/files/tiks.txt'
sorting = True
hold_lines = []
with open(my_file,'r') as text_file:
for row in text_file:
hold_lines.append(row)
outer_count = 1
line_count = 0
while sorting:
count = 0
increment = (outer_count-1) * 51
left = len(hold_lines) - increme... | 28.548387 | 81 | 0.6 | #/usr/bin/env python3
my_file = '/opt/MkCheck/files/tiks.txt'
sorting = True
hold_lines = []
with open(my_file,'r') as text_file:
for row in text_file:
hold_lines.append(row)
outer_count = 1
line_count = 0
while sorting:
count = 0
increment = (outer_count-1) * 51
left = len(hold_lines) - increme... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
468df631c0ced920bcc593cd678b29e0a5f82a05 | 3,710 | py | Python | websauna/system/form/fields.py | maikroeder/websauna | fd266cf5e4761cd4c1f3e33be47ad8358b4c6afa | [
"CNRI-Python"
] | null | null | null | websauna/system/form/fields.py | maikroeder/websauna | fd266cf5e4761cd4c1f3e33be47ad8358b4c6afa | [
"CNRI-Python"
] | null | null | null | websauna/system/form/fields.py | maikroeder/websauna | fd266cf5e4761cd4c1f3e33be47ad8358b4c6afa | [
"CNRI-Python"
] | 1 | 2021-04-15T17:35:57.000Z | 2021-04-15T17:35:57.000Z | import deform
from websauna.compat.typing import Callable
def defer_widget_values(widget: type, values_callback: Callable, **kwargs) -> deform.widget.Widget:
"""Allow select or checkbox widget values construction deferred during the execution time.
:param widget: Any Deform widget class, see :py:class:`defor... | 30.162602 | 145 | 0.634232 | import enum
import json
import colander
import deform
from websauna.compat.typing import Union
from websauna.compat.typing import Callable
from websauna.system.model.json import NestedMutationDict, NestedMutationList, json_serializer
def defer_widget_values(widget: type, values_callback: Callable, **kwargs) -> defo... | 0 | 104 | 0 | 2,808 | 0 | 0 | 0 | 66 | 208 |
c5d192f0d3e6f2a85910c1d1c34a01b007447f70 | 4,044 | py | Python | code/Examples/Python/HelloWorld/HelloWorldPublisher.py | xander-m2k/Fast-DDS-docs | 13e20cd24e159cdb5f2e7ab1fdb87880c2370aa0 | [
"Apache-2.0"
] | null | null | null | code/Examples/Python/HelloWorld/HelloWorldPublisher.py | xander-m2k/Fast-DDS-docs | 13e20cd24e159cdb5f2e7ab1fdb87880c2370aa0 | [
"Apache-2.0"
] | null | null | null | code/Examples/Python/HelloWorld/HelloWorldPublisher.py | xander-m2k/Fast-DDS-docs | 13e20cd24e159cdb5f2e7ab1fdb87880c2370aa0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Proyectos y Sistemas de Mantenimiento SL (eProsima).
#
# 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... | 35.165217 | 117 | 0.691642 | # Copyright 2022 Proyectos y Sistemas de Mantenimiento SL (eProsima).
#
# 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... | 0 | 0 | 0 | 3,040 | 0 | 0 | 0 | -11 | 135 |
86f75c2522b6bfb188910c0c2dfff8de507bbbd7 | 772 | py | Python | mainapp/accounts/admin.py | mfjimenezco/django-adminlte-base | 00384e62e408e43b5a178bd180d7fb4aff134b2b | [
"MIT"
] | null | null | null | mainapp/accounts/admin.py | mfjimenezco/django-adminlte-base | 00384e62e408e43b5a178bd180d7fb4aff134b2b | [
"MIT"
] | null | null | null | mainapp/accounts/admin.py | mfjimenezco/django-adminlte-base | 00384e62e408e43b5a178bd180d7fb4aff134b2b | [
"MIT"
] | null | null | null | """
Account admin register.
"""
# Django
# Models
| 22.705882 | 80 | 0.619171 | """
Account admin register.
"""
# Django
from django.contrib import admin
from django.contrib import messages
# Models
from accounts.models import UserRequest
@admin.register(UserRequest)
class UserRequestAdmin(admin.ModelAdmin):
"""User Request Admin"""
list_display = (
'username',
'email',... | 0 | 588 | 0 | 0 | 0 | 0 | 0 | 43 | 89 |
b8169855ec0aaf15dc5d25cc4a2e7fb043cb45d6 | 33 | py | Python | tests/__init__.py | fundamentals-of-data-science/ct1 | 26a0abf06fd4324636d7944369d6a8be2d66ec71 | [
"MIT"
] | null | null | null | tests/__init__.py | fundamentals-of-data-science/ct1 | 26a0abf06fd4324636d7944369d6a8be2d66ec71 | [
"MIT"
] | 134 | 2020-12-14T08:21:54.000Z | 2022-03-31T21:06:13.000Z | tests/__init__.py | fundamentals-of-data-science/ct1 | 26a0abf06fd4324636d7944369d6a8be2d66ec71 | [
"MIT"
] | null | null | null | """Unit test package for ct1."""
| 16.5 | 32 | 0.636364 | """Unit test package for ct1."""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a9fc4344ed64e93da9a289bce09caae40d52fb57 | 141 | py | Python | src/compath_resources/exporters/__init__.py | ComPath/resources | e8da7b511c2b558b8fd0bf38888b512008ac1ba3 | [
"MIT"
] | 3 | 2018-05-14T14:46:39.000Z | 2019-06-20T10:28:26.000Z | src/compath_resources/exporters/__init__.py | ComPath/compath-resources | e8da7b511c2b558b8fd0bf38888b512008ac1ba3 | [
"MIT"
] | 13 | 2020-03-28T13:36:32.000Z | 2021-01-19T15:00:07.000Z | src/compath_resources/exporters/__init__.py | ComPath/resources | e8da7b511c2b558b8fd0bf38888b512008ac1ba3 | [
"MIT"
] | 1 | 2021-12-01T09:49:59.000Z | 2021-12-01T09:49:59.000Z | # -*- coding: utf-8 -*-
"""Exporters for ComPath resources."""
| 20.142857 | 38 | 0.666667 | # -*- coding: utf-8 -*-
"""Exporters for ComPath resources."""
from .bel import get_bel # noqa:F401
from .rdf import get_rdf # noqa:F401
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 71 |
a1bafe40f9d60a18d8fce01e601bfa263bc96c72 | 183 | py | Python | bindings/python/examples/Restore.py | Fimbure/icebox-1 | 0b81992a53e1b410955ca89bdb6f8169d6f2da86 | [
"MIT"
] | 521 | 2019-03-29T15:44:08.000Z | 2022-03-22T09:46:19.000Z | bindings/python/examples/Restore.py | Fimbure/icebox-1 | 0b81992a53e1b410955ca89bdb6f8169d6f2da86 | [
"MIT"
] | 30 | 2019-06-04T17:00:49.000Z | 2021-09-08T20:44:19.000Z | bindings/python/examples/Restore.py | Fimbure/icebox-1 | 0b81992a53e1b410955ca89bdb6f8169d6f2da86 | [
"MIT"
] | 99 | 2019-03-29T16:04:13.000Z | 2022-03-28T16:59:34.000Z |
from PyFDP.FDP import FDP
if __name__ == '__main__':
#fdp = FDP("7_SP1_x64")
fdp = FDP("8_1_x64")
#fdp = FDP("10_x64")
fdp.Restore()
| 15.25 | 27 | 0.551913 | import struct
from PyFDP.FDP import FDP
if __name__ == '__main__':
#fdp = FDP("7_SP1_x64")
fdp = FDP("8_1_x64")
#fdp = FDP("10_x64")
fdp.Restore()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -8 | 22 |
1c400f0eed5bedcf15ac83b8b0358c7c54ae6b43 | 21 | py | Python | salad/__init__.py | Work4Labs/salad | 176869a4437103d501feb3035beaf162c2507435 | [
"BSD-3-Clause"
] | null | null | null | salad/__init__.py | Work4Labs/salad | 176869a4437103d501feb3035beaf162c2507435 | [
"BSD-3-Clause"
] | null | null | null | salad/__init__.py | Work4Labs/salad | 176869a4437103d501feb3035beaf162c2507435 | [
"BSD-3-Clause"
] | null | null | null | VERSION = "0.4.14.2"
| 10.5 | 20 | 0.571429 | VERSION = "0.4.14.2"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0664b5cd87247d123675d6ed514eb83e81d53698 | 3,755 | py | Python | utils/attention_plotter_utils.py | inboxedshoe/attention-learn-to-route | d9ebb13ec7e06fc5d2373c851a13913dab1594fc | [
"MIT"
] | null | null | null | utils/attention_plotter_utils.py | inboxedshoe/attention-learn-to-route | d9ebb13ec7e06fc5d2373c851a13913dab1594fc | [
"MIT"
] | null | null | null | utils/attention_plotter_utils.py | inboxedshoe/attention-learn-to-route | d9ebb13ec7e06fc5d2373c851a13913dab1594fc | [
"MIT"
] | null | null | null |
#creates the data graph instance
#this will create our initial plotly graph to display
| 29.108527 | 88 | 0.530226 |
import numpy as np
import plotly.graph_objs as go
import networkx as nx
#creates the data graph instance
def generate_graph(pts, instance=0, dictionary=True):
if not dictionary:
# temp demand list with depot and nodes
temp_demand = pts[instance][2]
temp_demand.insert(0, 0)
# temp... | 0 | 0 | 0 | 0 | 0 | 3,547 | 0 | 6 | 112 |
743b485b8add2d51b33af6b72fb698306723a312 | 2,848 | py | Python | GAparsimony/lhs/util/utilityLHS.py | misantam/GAparsimony | 0241092dc5d7741b5546151ff829167588e4f703 | [
"MIT"
] | null | null | null | GAparsimony/lhs/util/utilityLHS.py | misantam/GAparsimony | 0241092dc5d7741b5546151ff829167588e4f703 | [
"MIT"
] | 1 | 2021-12-05T10:24:55.000Z | 2021-12-05T11:01:25.000Z | GAparsimony/lhs/util/utilityLHS.py | misantam/GAparsimony | 0241092dc5d7741b5546151ff829167588e4f703 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 28.19802 | 104 | 0.572331 | # -*- coding: utf-8 -*-
import numpy as np
from .bclib import inner_product
def isValidLHS_int(matrix):
for jcol in range(matrix.shape[1]):
total = 0
for irow in range(matrix.shape[0]):
total = total + matrix[irow, jcol]
if not total == int(matrix.shape[0] * (matrix.shape[0] + ... | 0 | 0 | 0 | 0 | 0 | 2,511 | 0 | 8 | 284 |
ca26151593854c11dd77251a6952907ae9d39bb6 | 5,212 | py | Python | browser/process.py | gocept/alphaflow | 4b797cb12fb52254b1884159fd9a8b899c739f7c | [
"ZPL-2.1",
"ZPL-2.0"
] | null | null | null | browser/process.py | gocept/alphaflow | 4b797cb12fb52254b1884159fd9a8b899c739f7c | [
"ZPL-2.1",
"ZPL-2.0"
] | null | null | null | browser/process.py | gocept/alphaflow | 4b797cb12fb52254b1884159fd9a8b899c739f7c | [
"ZPL-2.1",
"ZPL-2.0"
] | 1 | 2021-11-01T07:58:18.000Z | 2021-11-01T07:58:18.000Z | # Copyright (c) 2007 gocept gmbh & co. kg
# See also LICENSE.txt
# $Id$
"""Process related views"""
import Products.AlphaFlow.interfaces
import Products.AlphaFlow.process
| 34.289474 | 76 | 0.646969 | # Copyright (c) 2007 gocept gmbh & co. kg
# See also LICENSE.txt
# $Id$
"""Process related views"""
import zope.component
from Products.CMFCore.utils import getToolByName
from Products.Archetypes.config import UID_CATALOG
import Products.AlphaFlow.interfaces
import Products.AlphaFlow.process
from Products.AlphaFlow.... | 0 | 0 | 0 | 4,705 | 0 | 0 | 0 | 102 | 227 |
93e18ce7f40ed19716c2eff6ecac85730cb2095f | 1,224 | py | Python | VimbaCam/ColorMap/ehtplot/build/lib/ehtplot/color/merge.py | zzpwahaha/VimbaCamJILA | 3baed1b5313e6c198d54a33c2c84357035d5146a | [
"MIT"
] | 1 | 2021-06-14T11:51:37.000Z | 2021-06-14T11:51:37.000Z | VimbaCam/ColorMap/ehtplot/build/lib/ehtplot/color/merge.py | zzpwahaha/VimbaCamJILA | 3baed1b5313e6c198d54a33c2c84357035d5146a | [
"MIT"
] | null | null | null | VimbaCam/ColorMap/ehtplot/build/lib/ehtplot/color/merge.py | zzpwahaha/VimbaCamJILA | 3baed1b5313e6c198d54a33c2c84357035d5146a | [
"MIT"
] | 2 | 2021-01-20T16:22:57.000Z | 2021-02-14T12:31:02.000Z | #!/usr/bin/env python3
#
# Copyright (C) 2018--2019 Chi-kwan Chan
# Copyright (C) 2018--2019 Steward Observatory
#
# This file is part of ehtplot.
#
# ehtplot 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, ei... | 37.090909 | 70 | 0.71732 | #!/usr/bin/env python3
#
# Copyright (C) 2018--2019 Chi-kwan Chan
# Copyright (C) 2018--2019 Steward Observatory
#
# This file is part of ehtplot.
#
# ehtplot 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, ei... | 0 | 0 | 0 | 0 | 0 | 51 | 0 | 41 | 45 |
4b966c0ae593681a28d86b6768f14fd6e0a06939 | 894 | py | Python | bot.py | ImGabe/vending-machine | bdb49968f7d0395b1771f19c5254afb9d948f42c | [
"MIT"
] | null | null | null | bot.py | ImGabe/vending-machine | bdb49968f7d0395b1771f19c5254afb9d948f42c | [
"MIT"
] | null | null | null | bot.py | ImGabe/vending-machine | bdb49968f7d0395b1771f19c5254afb9d948f42c | [
"MIT"
] | 1 | 2020-11-20T15:25:26.000Z | 2020-11-20T15:25:26.000Z | from pathlib import Path
from app import client, config
def load_extensions(cogs: str) -> None:
'''
Loads all extensions recursively.\n
Params:
cogs: str
Relative path to cogs dir.
'''
for extension in Path(cogs).rglob('*.py'):
extension = '.'.join(extension.parts)[:-3]
... | 22.35 | 60 | 0.62528 | from pathlib import Path
import configparser
import json
import discord
from app import client, config
@client.event
async def on_ready():
await client.change_presence(
status=config['CLIENT']['STATUS'],
activity=discord.Game(config['CLIENT']['ACTIVITY']))
print('Up and running!')
def loa... | 0 | 182 | 0 | 0 | 0 | 0 | 0 | -19 | 90 |
671214d2338ab823f014d1f4f04fcba09906319f | 564 | py | Python | examples/tools/davidson_eigh.py | Warlocat/pyscf | 94c21e2e9745800c7efc7256de0d628fc60afc36 | [
"Apache-2.0"
] | 2 | 2019-05-28T05:25:56.000Z | 2019-11-09T02:16:43.000Z | examples/tools/davidson_eigh.py | lzypotato/pyscf | 94c21e2e9745800c7efc7256de0d628fc60afc36 | [
"Apache-2.0"
] | null | null | null | examples/tools/davidson_eigh.py | lzypotato/pyscf | 94c21e2e9745800c7efc7256de0d628fc60afc36 | [
"Apache-2.0"
] | 1 | 2019-11-09T02:13:16.000Z | 2019-11-09T02:13:16.000Z | #!/usr/bin/env python
'''
Calling davidson solver for the lowest eigenvalues of a Hermitian matrix
'''
import numpy
from pyscf import lib
n = 100
a = numpy.random.rand(n,n)
a = a + a.T
# Define the matrix-vector operation
# Define the preconditioner. It can be just the diagonal elements of the
# ma... | 20.142857 | 78 | 0.677305 | #!/usr/bin/env python
'''
Calling davidson solver for the lowest eigenvalues of a Hermitian matrix
'''
import numpy
from pyscf import lib
n = 100
a = numpy.random.rand(n,n)
a = a + a.T
# Define the matrix-vector operation
def matvec(x):
return a.dot(x)
# Define the preconditioner. It can be ju... | 0 | 0 | 0 | 0 | 0 | 14 | 0 | 0 | 23 |
3d79bf9dde091d861b40e8d30fad0af92b14e60d | 6,033 | py | Python | L_softmax/l_softmax.py | githubhjx/Deep-Learning- | 5a22fb5696d930ed334aa1cbf2b213956b1c7026 | [
"Apache-2.0"
] | null | null | null | L_softmax/l_softmax.py | githubhjx/Deep-Learning- | 5a22fb5696d930ed334aa1cbf2b213956b1c7026 | [
"Apache-2.0"
] | null | null | null | L_softmax/l_softmax.py | githubhjx/Deep-Learning- | 5a22fb5696d930ed334aa1cbf2b213956b1c7026 | [
"Apache-2.0"
] | null | null | null | import math
margin = 4
beta = 100
scale = 0.99
beta_min = 0
eps = 0
c_map = []
k_map = []
c_m_n = lambda m, n: math.factorial(n) / math.factorial(m) / math.factorial(n - m)
for i in range(margin + 1):
c_map.append(c_m_n(i, margin))
k_map.append(math.cos(i * math.pi / margin))
def find_k(cos_t):
'''find k... | 37.943396 | 116 | 0.532405 | import numpy as np
import math
import uuid
import tensorflow as tf
margin = 4
beta = 100
scale = 0.99
beta_min = 0
eps = 0
c_map = []
k_map = []
c_m_n = lambda m, n: math.factorial(n) / math.factorial(m) / math.factorial(n - m)
for i in range(margin + 1):
c_map.append(c_m_n(i, margin))
k_map.append(math.cos(i ... | 0 | 0 | 0 | 0 | 0 | 5,028 | 0 | -11 | 135 |
f114e6783c5c73f9ca3b2209f92b1d2dec1ed046 | 701 | py | Python | pytorch_nst/config.py | tomsitter/pytorch-style-transfer-nbdev | 71ebd7a2f097ec94eac636b4e0c52a39fb66bdc6 | [
"Apache-2.0"
] | null | null | null | pytorch_nst/config.py | tomsitter/pytorch-style-transfer-nbdev | 71ebd7a2f097ec94eac636b4e0c52a39fb66bdc6 | [
"Apache-2.0"
] | 5 | 2021-09-08T02:55:55.000Z | 2022-03-12T01:00:56.000Z | pytorch_nst/config.py | tomsitter/pytorch-style-transfer-nbdev | 71ebd7a2f097ec94eac636b4e0c52a39fb66bdc6 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: 01_config.ipynb (unless otherwise specified).
__all__ = ['device', 'imsize', 'normalization_mean', 'normalization_std', 'content_layers_default',
'style_layers_default']
# Cell
import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
im... | 41.235294 | 99 | 0.728959 | # AUTOGENERATED! DO NOT EDIT! File to edit: 01_config.ipynb (unless otherwise specified).
__all__ = ['device', 'imsize', 'normalization_mean', 'normalization_std', 'content_layers_default',
'style_layers_default']
# Cell
import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
im... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
07a62f6d7ebf94a24a8085c3c1373df54bd21409 | 874 | py | Python | geninfo/info/forms.py | genomika/geninfo | 0604bf65c57847500db84523a2c8707a12f7a5a8 | [
"MIT"
] | 3 | 2022-02-15T15:33:44.000Z | 2022-02-16T15:31:28.000Z | geninfo/info/forms.py | genomika/geninfo | 0604bf65c57847500db84523a2c8707a12f7a5a8 | [
"MIT"
] | null | null | null | geninfo/info/forms.py | genomika/geninfo | 0604bf65c57847500db84523a2c8707a12f7a5a8 | [
"MIT"
] | null | null | null |
# from django.forms import ModelChoiceField
| 30.137931 | 89 | 0.602975 | from django import forms
# from django.forms import ModelChoiceField
from .models import Incident
class IncidentForm(forms.ModelForm):
class Meta:
model = Incident
fields = "__all__"
def clean(self):
status_type = self.cleaned_data["status_incident"]
end_date = self.cleaned_... | 4 | 0 | 0 | 749 | 0 | 0 | 0 | 10 | 67 |
439fcd1f7d1571e2b523084ad698125578bf666a | 530 | py | Python | tests/test_models.py | codingjoe/django-mail-auth | 21b102e511bd801f04fbb2328d846e625dac7f60 | [
"MIT"
] | 39 | 2019-04-12T22:44:55.000Z | 2021-12-12T06:03:47.000Z | tests/test_models.py | codingjoe/django-mail-auth | 21b102e511bd801f04fbb2328d846e625dac7f60 | [
"MIT"
] | 49 | 2019-05-28T10:58:51.000Z | 2022-03-29T00:33:18.000Z | tests/test_models.py | codingjoe/django-mail-auth | 21b102e511bd801f04fbb2328d846e625dac7f60 | [
"MIT"
] | 6 | 2019-08-07T06:16:38.000Z | 2022-02-25T12:14:13.000Z | import pytest
try:
import psycopg2
except ImportError:
psycopg2 = None
postgres_only = pytest.mark.skipif(
psycopg2 is None, reason="at least mymodule-1.1 required"
)
| 23.043478 | 72 | 0.739623 | import pytest
from django.db import IntegrityError
from mailauth.contrib.user import models
try:
import psycopg2
except ImportError:
psycopg2 = None
postgres_only = pytest.mark.skipif(
psycopg2 is None, reason="at least mymodule-1.1 required"
)
class TestEmailUser:
@postgres_only
def test_emai... | 0 | 220 | 0 | -1 | 0 | 0 | 0 | 34 | 94 |
906bf78de9d6afaf9d670aa83f0803631f27085d | 2,209 | py | Python | model.py | LucijanZgonik/Vislice | e82614929927438a13df349afedc39a4b19eb290 | [
"MIT"
] | null | null | null | model.py | LucijanZgonik/Vislice | e82614929927438a13df349afedc39a4b19eb290 | [
"MIT"
] | null | null | null | model.py | LucijanZgonik/Vislice | e82614929927438a13df349afedc39a4b19eb290 | [
"MIT"
] | null | null | null | STEVILO_DOVOLJENIH_NAPAK = 10
PRAVILNA_CRKA = '+'
NAPACNA_CRKA = '-'
PONOVLJENA_CRKA = 'o'
ZMAGA = 'W'
PORAZ = 'L'
bazen_besed = []
with open ("Vislice/besede.txt") as datoteka_bazena:
for beseda in datoteka_bazena:
bazen_besed.append(beseda.strip().lower())
... | 21.240385 | 63 | 0.466274 | STEVILO_DOVOLJENIH_NAPAK = 10
PRAVILNA_CRKA = '+'
NAPACNA_CRKA = '-'
PONOVLJENA_CRKA = 'o'
ZMAGA = 'W'
PORAZ = 'L'
class Igra:
def __init__(self,geslo,crke=None):
self.geslo = geslo
if crke is None:
self.crke = []
else:
self.crke = [c.lower() for c in cr... | 0 | 0 | 0 | 1,712 | 0 | 81 | 0 | -8 | 75 |
172ceb42551e8d4b82c6d6256ce9ad79098808ef | 830 | py | Python | Python/ex39.py | Anderson0312/Python | 1fd225378c55309640d584a4894393f7c40dc9ed | [
"MIT"
] | 1 | 2022-02-01T17:59:50.000Z | 2022-02-01T17:59:50.000Z | Python/ex39.py | Anderson0312/Python | 1fd225378c55309640d584a4894393f7c40dc9ed | [
"MIT"
] | null | null | null | Python/ex39.py | Anderson0312/Python | 1fd225378c55309640d584a4894393f7c40dc9ed | [
"MIT"
] | null | null | null | print('-=' * 15)
print('{:^30}'.format('LOJA SUPER BARATO'))
print('-=' * 15)
total = cont1000 = menor = cont = 0
nomemenor = ''
while True:
nomeP = str(input('Nome do produto: '))
preco = float(input('Preo: R$ '))
cont += 1
soun = ' '
print('-' * 30)
while soun not in 'SN':
soun = str(i... | 28.62069 | 69 | 0.543373 | print('-=' * 15)
print('{:^30}'.format('LOJA SUPER BARATÃO'))
print('-=' * 15)
total = cont1000 = menor = cont = 0
nomemenor = ''
while True:
nomeP = str(input('Nome do produto: '))
preco = float(input('Preço: R$ '))
cont += 1
soun = ' '
print('-' * 30)
while soun not in 'SN':
soun = str... | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7da5f84d5906da12c0ab908da3370cab26295fcb | 3,525 | py | Python | scratch/regression/rolling_validation/plot_losses.py | finn-dodgson/DeepHalos | 86e0ac6c24ac97a0a2a0a60a7ea3721a04bd050c | [
"MIT"
] | 2 | 2021-07-26T10:56:33.000Z | 2021-12-20T17:30:53.000Z | scratch/regression/rolling_validation/plot_losses.py | finn-dodgson/DeepHalos | 86e0ac6c24ac97a0a2a0a60a7ea3721a04bd050c | [
"MIT"
] | 1 | 2021-11-25T21:01:19.000Z | 2021-12-05T01:40:53.000Z | scratch/regression/rolling_validation/plot_losses.py | finn-dodgson/DeepHalos | 86e0ac6c24ac97a0a2a0a60a7ea3721a04bd050c | [
"MIT"
] | 1 | 2021-11-27T02:35:10.000Z | 2021-11-27T02:35:10.000Z | import numpy as np
import matplotlib.pyplot as plt
paths = '/Users/lls/Documents/deep_halos_files/regression/rolling_val/'
paths_all = [paths + '0dropout/', paths + '0.1dropout/', paths + '0.2dropout/', paths + '0.3dropout/',
paths + 'no_sim3/']
dropout_pc = ["0", "10", "20", "30", "40"]
f, axes = plt.s... | 40.517241 | 133 | 0.571348 | import numpy as np
import matplotlib.pyplot as plt
paths = '/Users/lls/Documents/deep_halos_files/regression/rolling_val/'
paths_all = [paths + '0dropout/', paths + '0.1dropout/', paths + '0.2dropout/', paths + '0.3dropout/',
paths + 'no_sim3/']
dropout_pc = ["0", "10", "20", "30", "40"]
f, axes = plt.s... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1ef0fee033bf0679a68c77bee0f826dfd87bc8a2 | 1,348 | py | Python | metecho/api/migrations/0103_alter_task_status.py | RupertBarrow/Metecho | 322f7fab7e18063c38ee2e803b7a68212d87fe2c | [
"BSD-3-Clause"
] | 21 | 2020-04-02T21:39:58.000Z | 2022-01-31T19:43:47.000Z | metecho/api/migrations/0103_alter_task_status.py | RupertBarrow/Metecho | 322f7fab7e18063c38ee2e803b7a68212d87fe2c | [
"BSD-3-Clause"
] | 1,316 | 2020-03-30T21:56:34.000Z | 2022-03-01T10:08:56.000Z | metecho/api/migrations/0103_alter_task_status.py | oddbird/MetaShare | 71fb667eaea6990e9d89be13d9a47e76db2a6c46 | [
"BSD-3-Clause"
] | 21 | 2020-07-21T11:58:47.000Z | 2021-11-25T00:48:21.000Z | # Generated by Django 3.2.2 on 2021-05-13 15:34
| 28.680851 | 87 | 0.597181 | # Generated by Django 3.2.2 on 2021-05-13 15:34
from django.db import migrations, models
from metecho.api.models import TaskStatus
def set_task_canceled_statuses(apps, schema_editor):
Task = apps.get_model("api", "Task")
for instance in Task.objects.filter(
status=TaskStatus.IN_PROGRESS, pr_is_open=... | 0 | 0 | 0 | 656 | 0 | 487 | 0 | 39 | 115 |
ae0e727020da9082f868380f9e604cec3980a139 | 3,278 | py | Python | kangrouter.py | TheSolvingMachine/kangrouter-py | 0e385372675978ad7f6c4e8daea54401564304b2 | [
"Apache-2.0"
] | 1 | 2017-11-07T22:36:24.000Z | 2017-11-07T22:36:24.000Z | kangrouter.py | TheSolvingMachine/kangrouter-py | 0e385372675978ad7f6c4e8daea54401564304b2 | [
"Apache-2.0"
] | null | null | null | kangrouter.py | TheSolvingMachine/kangrouter-py | 0e385372675978ad7f6c4e8daea54401564304b2 | [
"Apache-2.0"
] | null | null | null |
KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1"
| 33.44898 | 70 | 0.599451 | import time
from tsm.common.app import exception
import requests
import json
from requests.packages.urllib3.util.retry import Retry
from requests.adapters import HTTPAdapter
KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1"
class KangRouterClient:
pathbase = "https://thesolvingmachine.com/kangrouter/srv... | 0 | 0 | 0 | 3,007 | 0 | 0 | 0 | 42 | 157 |
06345111138d441a5b029be39d16a41e55a74520 | 5,728 | py | Python | enCount/fastqs.py | mstrazar/enCount | dcff565ce96afe37aa8a41995637d00cce02360d | [
"MIT"
] | null | null | null | enCount/fastqs.py | mstrazar/enCount | dcff565ce96afe37aa8a41995637d00cce02360d | [
"MIT"
] | null | null | null | enCount/fastqs.py | mstrazar/enCount | dcff565ce96afe37aa8a41995637d00cce02360d | [
"MIT"
] | null | null | null | import os
import datetime
import enCount
# populate list with currently queued jobs
submitted_downloads = dict(
(j.meta['file_path'], j) for j in enCount.queues.downloads.jobs
)
def get_file_path(e_acc, f_acc, f_url, f_size, f_md5):
"""Return path to file or None if file not available."""
# query DB
... | 34.506024 | 78 | 0.59602 | import os
import shutil
import requests
import hashlib
import tempfile
import datetime
from bson.objectid import ObjectId
import enCount
# populate list with currently queued jobs
submitted_downloads = dict(
(j.meta['file_path'], j) for j in enCount.queues.downloads.jobs
)
def _update_dbrec_status(dbrec_id, new... | 0 | 0 | 0 | 0 | 0 | 2,488 | 0 | -14 | 156 |
2a9b9fac2b90d7be9b56fb00bbe59ce86f2c68ac | 335 | py | Python | VT_gen_urls.py | sparklingSky/vt-gen-urls | fb0d23caa5c47627363ac8db0e4aa7f12d794a41 | [
"MIT"
] | 1 | 2017-04-27T06:54:08.000Z | 2017-04-27T06:54:08.000Z | VT_gen_urls.py | sparklingSky/vt-gen-urls | fb0d23caa5c47627363ac8db0e4aa7f12d794a41 | [
"MIT"
] | null | null | null | VT_gen_urls.py | sparklingSky/vt-gen-urls | fb0d23caa5c47627363ac8db0e4aa7f12d794a41 | [
"MIT"
] | null | null | null | __author__ = 'sparklingSky'
import ipcalc
f = open('VT_links.txt', 'w')
subnet = raw_input('Enter subnet with prefix in format 1.2.3.0/24: ')
for x in ipcalc.Network(subnet):
f.write('https://www.virustotal.com/en/ip-address/' + str(x) + '/information/' + '\n')
f.close()
print 'Completed. See the result in file... | 25.769231 | 90 | 0.683582 | __author__ = 'sparklingSky'
import ipcalc
f = open('VT_links.txt', 'w')
subnet = raw_input('Enter subnet with prefix in format 1.2.3.0/24: ')
for x in ipcalc.Network(subnet):
f.write('https://www.virustotal.com/en/ip-address/' + str(x) + '/information/' + '\n')
f.close()
print 'Completed. See the result in file... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2ce45fac8db13d29869dc715eb1b786c4b40a0a5 | 4,051 | py | Python | navycut/contrib/auth/__init__.py | navycut/navycut | 1d49621105c7c4683d52a3d2c853ae7165b9dc0d | [
"MIT"
] | 13 | 2021-04-26T04:00:36.000Z | 2021-09-18T19:57:58.000Z | navycut/contrib/auth/__init__.py | FlaskAio/navycut | 40f378f1710a26645df8d726c4d1caf33097da50 | [
"MIT"
] | 21 | 2021-09-27T03:19:21.000Z | 2022-03-31T03:20:59.000Z | navycut/contrib/auth/__init__.py | FlaskAio/navycut | 40f378f1710a26645df8d726c4d1caf33097da50 | [
"MIT"
] | 7 | 2021-07-21T06:21:55.000Z | 2021-09-02T17:58:04.000Z | from flask_login import (LoginManager as _LoginManager, logout_user as _logout_user, login_user as _login_user)
from .models import User
from navycut.utils.security import check_password_hash
from navycut.errors.misc import DataTypeMismatchError
from .decorators import (login_required as login_required, group_required... | 31.161538 | 92 | 0.646013 | from flask_login import (
LoginManager as _LoginManager,
logout_user as _logout_user,
login_user as _login_user
)
from .models import User
from navycut.utils.security import check_password_hash
from navycut.errors.misc import DataTypeMismatchError
from .decorators import (
login_required as login_... | 0 | 87 | 0 | 336 | 0 | 0 | 0 | 57 | 72 |
b83c60d4492dc1f05faf5d5bbad4a6170cee1206 | 8,027 | py | Python | src/vm-builder-0.12.4+bzr489/build/lib.linux-x86_64-2.7/VMBuilder/util.py | cryptorinium/Num2 | e83ea5b18b7822c73699de2a667d189791c48fbb | [
"MIT"
] | null | null | null | src/vm-builder-0.12.4+bzr489/build/lib.linux-x86_64-2.7/VMBuilder/util.py | cryptorinium/Num2 | e83ea5b18b7822c73699de2a667d189791c48fbb | [
"MIT"
] | null | null | null | src/vm-builder-0.12.4+bzr489/build/lib.linux-x86_64-2.7/VMBuilder/util.py | cryptorinium/Num2 | e83ea5b18b7822c73699de2a667d189791c48fbb | [
"MIT"
] | null | null | null | #
# Uncomplicated VM Builder
# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation.
#
# ... | 35.052402 | 140 | 0.639342 | #
# Uncomplicated VM Builder
# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation.
#
# ... | 0 | 0 | 0 | 902 | 0 | 2,693 | 0 | 9 | 161 |
a8f1d9e916607551577ad10de7f094657e42fb01 | 20,490 | py | Python | mssqlclient.py | iptL-F4ck/mssqlproxy | c64bfe4ba05ad1f8e8a608692da94819f6652693 | [
"MIT"
] | null | null | null | mssqlclient.py | iptL-F4ck/mssqlproxy | c64bfe4ba05ad1f8e8a608692da94819f6652693 | [
"MIT"
] | null | null | null | mssqlclient.py | iptL-F4ck/mssqlproxy | c64bfe4ba05ad1f8e8a608692da94819f6652693 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2020 BlackArrow
#
#
# This product includes software developed by
# SecureAuth Corporation (https://www.secureauth.com/).
#
# Description: [MS-TDS] & [MC-SQLR] example.
#
# Original author:
# Alberto Solino (beto@coresecurity.com/@agsolino)
#
# Author:
# Pablo Martinez (https:/... | 37.052441 | 158 | 0.551147 | #!/usr/bin/env python
#
# Copyright (c) 2020 BlackArrow
#
#
# This product includes software developed by
# SecureAuth Corporation (https://www.secureauth.com/).
#
# Description: [MS-TDS] & [MC-SQLR] example.
#
# Original author:
# Alberto Solino (beto@coresecurity.com/@agsolino)
#
# Author:
# Pablo Martinez (https:/... | 0 | 0 | 0 | 7,116 | 0 | 6,466 | 0 | -44 | 326 |
400ff23eea96eef52d15f5da1e54e1282902b729 | 19,636 | py | Python | blesuite/cli/blesuite_cli.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | 198 | 2016-08-04T05:45:38.000Z | 2022-02-17T08:30:58.000Z | blesuite/cli/blesuite_cli.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | 13 | 2018-02-04T14:16:16.000Z | 2020-10-09T02:16:24.000Z | blesuite/cli/blesuite_cli.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | 57 | 2016-08-08T04:24:04.000Z | 2022-01-24T08:43:02.000Z | import argparse
from blesuite.connection_manager import BLEConnectionManager
from blesuite_wrapper import ble_service_read, ble_service_read_async, ble_service_write, ble_handle_subscribe, ble_service_scan, ble_service_write_async, ble_run_smart_scan
from blesuite import utils
from blesuite.utils.print_helper import pr... | 53.214092 | 120 | 0.503718 | import argparse
from blesuite.connection_manager import BLEConnectionManager
from blesuite_wrapper import ble_service_read, ble_service_read_async, ble_service_write, \
ble_handle_subscribe, ble_service_scan, ble_service_write_async, ble_run_smart_scan
from blesuite import utils
from blesuite.utils.print_helper imp... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0 |
39aeba465593157cc9fb66cd31b7e29f8c8eba57 | 370 | py | Python | sample/sample1_make_notebook.py | mtb-beta/evernote-api-sample | ff441da01b7c8075ad31fca7d22127fe4ceb7866 | [
"MIT"
] | null | null | null | sample/sample1_make_notebook.py | mtb-beta/evernote-api-sample | ff441da01b7c8075ad31fca7d22127fe4ceb7866 | [
"MIT"
] | null | null | null | sample/sample1_make_notebook.py | mtb-beta/evernote-api-sample | ff441da01b7c8075ad31fca7d22127fe4ceb7866 | [
"MIT"
] | null | null | null | """
NOTE:
"""
from decouple import config
TOKEN = config("EVERNOTE_DEVELOPPER_TOKEN")
USE_SANDBOX = config("USE_SANDBOX", True, cast=bool)
if __name__ == "__main__":
main()
| 20.555556 | 68 | 0.751351 | """
NOTE: ノートブックを作成するサンプル
"""
from decouple import config
from pyevernote import EvernoteApp
TOKEN = config("EVERNOTE_DEVELOPPER_TOKEN")
USE_SANDBOX = config("USE_SANDBOX", True, cast=bool)
def main():
evernote_app = EvernoteApp(token=TOKEN, use_sandbox=USE_SANDBOX)
evernote_app.create_notebook("My Sample N... | 45 | 0 | 0 | 0 | 0 | 115 | 0 | 13 | 46 |
93c19bda05ff270d52ae3931fc78f2d516181331 | 422 | py | Python | avishan/migrations/0005_baseuser_language.py | Afshari9978/django-avishan | 67b997e1063a1f2cf17699eaa292a98844aa0fe9 | [
"MIT"
] | 1 | 2021-05-09T09:55:54.000Z | 2021-05-09T09:55:54.000Z | avishan/migrations/0005_baseuser_language.py | Afshari9978/django-avishan | 67b997e1063a1f2cf17699eaa292a98844aa0fe9 | [
"MIT"
] | null | null | null | avishan/migrations/0005_baseuser_language.py | Afshari9978/django-avishan | 67b997e1063a1f2cf17699eaa292a98844aa0fe9 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-02-15 22:28
| 22.210526 | 66 | 0.620853 | # Generated by Django 3.0.3 on 2020-02-15 22:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('avishan', '0004_usergroup_authenticate_with_phone_otp'),
]
operations = [
migrations.AddField(
model_name='baseuser',
... | 0 | 0 | 0 | 308 | 0 | 0 | 0 | 19 | 46 |
c36aea22e9c375be0d8543ddc1eba0ff9f8acd15 | 258 | py | Python | students/K33422/laboratory_works/Daria Plotskaya/lab_2/users/urls.py | olticher/ITMO_ICT_WebDevelopment_2021-2022 | 3de8728c29638d6733ad0664bf13e0d1eccae899 | [
"MIT"
] | null | null | null | students/K33422/laboratory_works/Daria Plotskaya/lab_2/users/urls.py | olticher/ITMO_ICT_WebDevelopment_2021-2022 | 3de8728c29638d6733ad0664bf13e0d1eccae899 | [
"MIT"
] | null | null | null | students/K33422/laboratory_works/Daria Plotskaya/lab_2/users/urls.py | olticher/ITMO_ICT_WebDevelopment_2021-2022 | 3de8728c29638d6733ad0664bf13e0d1eccae899 | [
"MIT"
] | null | null | null | from django.urls import path
from django.contrib.auth.views import LoginView
from .views import UserCreateFormView
urlpatterns = [
path("login/", LoginView.as_view(), name="login"),
path("register/", UserCreateFormView.as_view(), name="register")
]
| 28.666667 | 68 | 0.744186 | from django.urls import path
from django.contrib.auth.views import LoginView
from .views import UserCreateFormView
urlpatterns = [
path("login/", LoginView.as_view(), name="login"),
path("register/", UserCreateFormView.as_view(), name="register")
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4d0fba564fa46a0b48e5aa0c5c73cd2775df2ea9 | 15,765 | py | Python | CLOUD_ML_newaccuracy_4person.py | qqxx6661/Trajectory-prediction | c5f783bdbb14c98e9d6be60c1624c65b9110b6b3 | [
"Apache-2.0"
] | 2 | 2018-09-27T06:57:28.000Z | 2019-07-13T12:15:48.000Z | CLOUD_ML_newaccuracy_4person.py | qqxx6661/Trajectory-prediction | c5f783bdbb14c98e9d6be60c1624c65b9110b6b3 | [
"Apache-2.0"
] | null | null | null | CLOUD_ML_newaccuracy_4person.py | qqxx6661/Trajectory-prediction | c5f783bdbb14c98e9d6be60c1624c65b9110b6b3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# coding=utf-8
import time
if __name__ == '__main__':
glo_start = time.time()
test_file = "gallery/15-21/15-21_person_1_ML.csv"
# 180s
# train_file = ['gallery/14-23/14-23_person_0_ML.csv', 'gallery/14-23/14-23_person_1_ML.csv',
# 'gallery/14-23/14-23_per... | 43.549724 | 101 | 0.577101 | #!/usr/bin/env python3
# coding=utf-8
import numpy as np
from sklearn.svm import SVC
from sklearn.externals import joblib
from sklearn import linear_model
from sklearn.neural_network import MLPClassifier
from sklearn.preprocessing import StandardScaler
from sklearn.tree import DecisionTreeClassifier
import time
def _... | 1,263 | 0 | 0 | 0 | 0 | 9,772 | 0 | 109 | 292 |
a8da6c27168c030127b89099f0e61debcd9543af | 3,829 | py | Python | src/automations/cms_automations/migrations/0001_initial.py | sebastianmanger/django-automations | 070e700d29ef68f1b27c7f016ee6a08c41be56fe | [
"MIT"
] | 20 | 2021-04-25T16:19:09.000Z | 2022-02-17T13:55:57.000Z | src/automations/cms_automations/migrations/0001_initial.py | sebastianmanger/django-automations | 070e700d29ef68f1b27c7f016ee6a08c41be56fe | [
"MIT"
] | 25 | 2021-11-21T14:39:59.000Z | 2022-02-01T11:32:17.000Z | src/automations/cms_automations/migrations/0001_initial.py | sebastianmanger/django-automations | 070e700d29ef68f1b27c7f016ee6a08c41be56fe | [
"MIT"
] | 4 | 2021-11-21T04:27:55.000Z | 2022-03-04T01:37:06.000Z | # Generated by Django 3.1.8 on 2021-05-02 11:09
| 33.587719 | 108 | 0.402455 | # Generated by Django 3.1.8 on 2021-05-02 11:09
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("cms", "0022_auto_20180620_1551"),
]
operations = [
migrations.CreateModel(
... | 0 | 0 | 0 | 3,682 | 0 | 0 | 0 | 30 | 68 |
3771c6c2f4d9250af64216e9c17b431cf831fb7a | 988 | py | Python | ivy/ext/ivy_shortcodes.py | swsch/ivy | 4932cf7541acff13815be613b0f3335b21c86670 | [
"Unlicense"
] | null | null | null | ivy/ext/ivy_shortcodes.py | swsch/ivy | 4932cf7541acff13815be613b0f3335b21c86670 | [
"Unlicense"
] | null | null | null | ivy/ext/ivy_shortcodes.py | swsch/ivy | 4932cf7541acff13815be613b0f3335b21c86670 | [
"Unlicense"
] | null | null | null | import ivy
import sys
try:
import shortcodes
except ImportError:
shortcodes = None
# Use a single parser instance to parse all files.
parser = None
# The bare 'shortcodes' attribute for custom settings is deprecated.
if shortcodes:
| 28.228571 | 73 | 0.601215 | import ivy
import sys
try:
import shortcodes
except ImportError:
shortcodes = None
# Use a single parser instance to parse all files.
parser = None
# The bare 'shortcodes' attribute for custom settings is deprecated.
if shortcodes:
@ivy.filters.register('node_text')
def render(text, node):
... | 0 | 716 | 0 | 0 | 0 | 0 | 0 | 0 | 27 |
72d447079357ad9532eb8adbf4c6e89fc73bc0c4 | 2,270 | py | Python | example_cycles/tests/benchmark_electric_propulsor.py | askprash/pyCycle | e0845d7e320b6cb47367734c26ec3410c9fa5bf7 | [
"Apache-2.0"
] | null | null | null | example_cycles/tests/benchmark_electric_propulsor.py | askprash/pyCycle | e0845d7e320b6cb47367734c26ec3410c9fa5bf7 | [
"Apache-2.0"
] | null | null | null | example_cycles/tests/benchmark_electric_propulsor.py | askprash/pyCycle | e0845d7e320b6cb47367734c26ec3410c9fa5bf7 | [
"Apache-2.0"
] | null | null | null | import unittest
if __name__ == "__main__":
unittest.main() | 31.527778 | 79 | 0.644053 | import numpy as np
import unittest
import os
import openmdao.api as om
from openmdao.utils.assert_utils import assert_near_equal
import pycycle.api as pyc
from example_cycles.electric_propulsor import MPpropulsor
class ElectricPropulsorTestCase(unittest.TestCase):
def benchmark_case1(self):
prob =... | 0 | 0 | 0 | 1,983 | 0 | 0 | 0 | 65 | 158 |
836c857326383b2e3a35255f393ce2a2ae805a24 | 758 | py | Python | beta.py | SecDet65/bug-py | d311d6621e8d7edd0bf43ba632690c0842188f06 | [
"Apache-2.0"
] | null | null | null | beta.py | SecDet65/bug-py | d311d6621e8d7edd0bf43ba632690c0842188f06 | [
"Apache-2.0"
] | null | null | null | beta.py | SecDet65/bug-py | d311d6621e8d7edd0bf43ba632690c0842188f06 | [
"Apache-2.0"
] | null | null | null | import os
print(':::IMPORTANTE::: USE AS LETRAS CORRESPONDENTES => C (CESIUS), K (KELVIN) OU F (FIRENHEIT)\n\n')
temp = input('Qual temperatura quer saber? ')
tv = float(input('Digite o valor da temperatura: '))
if(temp == 'c'):
fah = ((tv * 1.8) + 32)
kel = (tv + 273.15)
cel = tv
print('Fah... | 30.32 | 105 | 0.53562 | import os
print(':::IMPORTANTE::: USE AS LETRAS CORRESPONDENTES => C (CESIUS), K (KELVIN) OU F (FIRENHEIT)\n\n')
temp = input('Qual temperatura quer saber? ')
tv = float(input('Digite o valor da temperatura: '))
if(temp == 'c'):
fah = ((tv * 1.8) + 32)
kel = (tv + 273.15)
cel = tv
print('Fah... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
71a31accb034925ee37a6aa3d035b5ee027cd116 | 78,984 | py | Python | ctypesgen/test/testsuite.py | EPC-MSU/ctypesgen | 21979b7dce0382f3e78ca18efc552217c60c46ef | [
"BSD-2-Clause"
] | null | null | null | ctypesgen/test/testsuite.py | EPC-MSU/ctypesgen | 21979b7dce0382f3e78ca18efc552217c60c46ef | [
"BSD-2-Clause"
] | null | null | null | ctypesgen/test/testsuite.py | EPC-MSU/ctypesgen | 21979b7dce0382f3e78ca18efc552217c60c46ef | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: ascii -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
#
"""Simple test suite using unittest.
By clach04 (Chris Clark).
Calling:
python test/testsuite.py
or
cd test
./testsuite.py
Could use any unitest compatible test runner (nose, etc.)
Aims to test for regress... | 35.260714 | 106 | 0.309696 | #!/usr/bin/env python3
# -*- coding: ascii -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
#
"""Simple test suite using unittest.
By clach04 (Chris Clark).
Calling:
python test/testsuite.py
or
cd test
./testsuite.py
Could use any unitest compatible test runner (nose, etc.)
Aims to test for regress... | 0 | 299 | 0 | 75,578 | 0 | 1,506 | 0 | -19 | 499 |
ed6d3463406712dea80304bda0142186ee00fea2 | 16,056 | py | Python | stubs/micropython-latest-docstubs/lcd160cr.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | stubs/micropython-latest-docstubs/lcd160cr.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | stubs/micropython-latest-docstubs/lcd160cr.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | """
control of LCD160CR display. See: https://docs.micropython.org/en/latest/library/lcd160cr.html
This module provides control of the MicroPython LCD160CR display.
"""
# source version: latest
# origin module:: micropython/docs/library/lcd160cr.rst
from typing import Any
# Orientations of the display, used by :m... | 36.995392 | 99 | 0.587506 | """
control of LCD160CR display. See: https://docs.micropython.org/en/latest/library/lcd160cr.html
This module provides control of the MicroPython LCD160CR display.
"""
# source version: latest
# origin module:: micropython/docs/library/lcd160cr.rst
from typing import Any, Tuple
from .machine import SPI
# Orienta... | 0 | 440 | 0 | 14,532 | 0 | 0 | 0 | 10 | 45 |