hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
588f9c4616a8701d1460beff010278c4c26a6a2e | 241 | py | Python | eve_travel_helper/__init__.py | Srogozins/eve-travel-helper | a0d2013ecff84abcb257ad54fd2496124eef866a | [
"BSD-3-Clause"
] | null | null | null | eve_travel_helper/__init__.py | Srogozins/eve-travel-helper | a0d2013ecff84abcb257ad54fd2496124eef866a | [
"BSD-3-Clause"
] | 12 | 2015-03-09T17:48:47.000Z | 2015-06-02T15:16:25.000Z | eve_travel_helper/__init__.py | Srogozins/eve-travel-helper | a0d2013ecff84abcb257ad54fd2496124eef866a | [
"BSD-3-Clause"
] | null | null | null | """ eve_travel_helper -- EVE Online travel planning helper tool package
This tool is intended to provide assistance to EVE Online players with
planning travel routes.
Modules:
* routing
* server
Sub-packages:
* dbclient
"""
| 16.066667 | 71 | 0.726141 | """ eve_travel_helper -- EVE Online travel planning helper tool package
This tool is intended to provide assistance to EVE Online players with
planning travel routes.
Modules:
* routing
* server
Sub-packages:
* dbclient
"""
| 0 | 0 | 0 |
9a640f969b8dd7c10de98c827afc3b6fe4c62de3 | 3,625 | py | Python | tests/client/test_check_trap.py | andrewthetechie/py-healthchecks.io | 6dadc281d5a43408e5100b7eae614a530f57c9d7 | [
"MIT"
] | 1 | 2021-12-17T06:51:48.000Z | 2021-12-17T06:51:48.000Z | tests/client/test_check_trap.py | andrewthetechie/py-healthchecks.io | 6dadc281d5a43408e5100b7eae614a530f57c9d7 | [
"MIT"
] | 32 | 2021-12-06T23:26:36.000Z | 2022-03-28T01:40:12.000Z | tests/client/test_check_trap.py | andrewthetechie/py-healthchecks.io | 6dadc281d5a43408e5100b7eae614a530f57c9d7 | [
"MIT"
] | null | null | null | from urllib.parse import urljoin
import pytest
import respx
from httpx import Client as HTTPXClient
from httpx import Response
from healthchecks_io import CheckCreate
from healthchecks_io import CheckTrap
from healthchecks_io import CheckUpdate
from healthchecks_io import PingFailedError
from healthchecks_io import W... | 36.989796 | 88 | 0.751172 | from urllib.parse import urljoin
import pytest
import respx
from httpx import Client as HTTPXClient
from httpx import Response
from healthchecks_io import CheckCreate
from healthchecks_io import CheckTrap
from healthchecks_io import CheckUpdate
from healthchecks_io import PingFailedError
from healthchecks_io import W... | 2,899 | 0 | 177 |
7ce1ee071621f61bb7527b607cc7c202068b0b7b | 940 | py | Python | math/probability.py | Rin-The-QT-Bunny/Kabalium | ebb2ce611b715c7f9e212426e2d914418445d3b6 | [
"CC0-1.0"
] | null | null | null | math/probability.py | Rin-The-QT-Bunny/Kabalium | ebb2ce611b715c7f9e212426e2d914418445d3b6 | [
"CC0-1.0"
] | null | null | null | math/probability.py | Rin-The-QT-Bunny/Kabalium | ebb2ce611b715c7f9e212426e2d914418445d3b6 | [
"CC0-1.0"
] | null | null | null | """
Distributions and Probability Tools
"""
import math
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
from scipy.stats import multivariate_normal
#plt.style.use('seaborn')
# 第一簇的数据
num1, mu1, var1 = 400, [0.5, 0.5], [1, 3]
X1 = np.random.multivariate_normal(mu1... | 29.375 | 70 | 0.66383 | """
Distributions and Probability Tools
"""
import math
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
from scipy.stats import multivariate_normal
#plt.style.use('seaborn')
def C(n,m):
# Cnm means the combinational number of n boxes with m balls
return mat... | 281 | 0 | 50 |
456177cc19c195f1558e04dd4f40c6b9406dfaba | 1,268 | py | Python | tests/test_wrapbuffer.py | slmnv5/pepelats | 044efa45be4c15289de9e300d681c2008af69962 | [
"MIT"
] | 1 | 2022-01-06T02:51:25.000Z | 2022-01-06T02:51:25.000Z | tests/test_wrapbuffer.py | slmnv5/pepelats | 044efa45be4c15289de9e300d681c2008af69962 | [
"MIT"
] | null | null | null | tests/test_wrapbuffer.py | slmnv5/pepelats | 044efa45be4c15289de9e300d681c2008af69962 | [
"MIT"
] | 1 | 2021-12-01T20:52:21.000Z | 2021-12-01T20:52:21.000Z | import unittest
from loop import WrapBuffer
from utils import make_sin_sound, SD_RATE
sound_len = 500_000 # samples
sound = make_sin_sound(440, sound_len / SD_RATE)
if __name__ == "__main__":
unittest.main()
| 27.565217 | 60 | 0.657729 | import unittest
from loop import WrapBuffer
from utils import make_sin_sound, SD_RATE
sound_len = 500_000 # samples
sound = make_sin_sound(440, sound_len / SD_RATE)
class TestWrapBuffer(unittest.TestCase):
def test_1(self):
test_buff = WrapBuffer()
test_buff.record_samples(sound[:100_000], 0)
... | 900 | 19 | 131 |
66af38c441b2bb64e4989e31c860ba86ebd137fd | 7,268 | py | Python | tests/test_functions.py | joshuafuller/adsbxcot | 49718e0f004be040fb2712952464ccec4ba8e19a | [
"Apache-2.0"
] | 18 | 2020-11-13T11:54:23.000Z | 2022-03-23T15:25:10.000Z | tests/test_functions.py | joshuafuller/adsbxcot | 49718e0f004be040fb2712952464ccec4ba8e19a | [
"Apache-2.0"
] | 9 | 2020-11-17T07:54:58.000Z | 2022-02-09T23:29:52.000Z | tests/test_functions.py | joshuafuller/adsbxcot | 49718e0f004be040fb2712952464ccec4ba8e19a | [
"Apache-2.0"
] | 7 | 2021-05-06T22:00:39.000Z | 2022-01-31T06:25:01.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Python Team Awareness Kit (PyTAK) Module Tests."""
import asyncio
import csv
import io
import urllib
import xml.etree.ElementTree
import pytest
import adsbxcot.functions
__author__ = 'Greg Albrecht W2GMD <oss@undef.net>'
__copyright__ = 'Copyright 2021 Orion Labs, I... | 33.33945 | 119 | 0.509906 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Python Team Awareness Kit (PyTAK) Module Tests."""
import asyncio
import csv
import io
import urllib
import xml.etree.ElementTree
import pytest
import adsbxcot.functions
__author__ = 'Greg Albrecht W2GMD <oss@undef.net>'
__copyright__ = 'Copyright 2021 Orion Labs, I... | 6,722 | 0 | 136 |
3613d965085b8c8d23f5f7e8c431c083ad6d3328 | 1,063 | py | Python | exercises/ex_4_3.py | bcornelusse/ELEC0053-circuits-electriques | ee86a908d4d0b3bc95e41e5eef9031a00604db40 | [
"BSD-2-Clause"
] | 3 | 2018-03-07T10:17:38.000Z | 2021-06-21T06:20:51.000Z | exercises/ex_4_3.py | bcornelusse/ELEC0053-circuits-electriques | ee86a908d4d0b3bc95e41e5eef9031a00604db40 | [
"BSD-2-Clause"
] | null | null | null | exercises/ex_4_3.py | bcornelusse/ELEC0053-circuits-electriques | ee86a908d4d0b3bc95e41e5eef9031a00604db40 | [
"BSD-2-Clause"
] | 1 | 2020-06-04T19:23:11.000Z | 2020-06-04T19:23:11.000Z | # Exercise 4.3
from matplotlib import pyplot as plt
from RSE.impedance import Impedance
Z_1 = Impedance(3, 5)
Z_2 = Impedance(5, -6)
Z_0 = Impedance(2, 3)
Z_12 = Z_1.parallel(Z_2)
Z_tot = Z_0 + Z_12
E = complex(100, 0)
# Compute currents.
I = E/Z_tot.Z
V_12 = Z_0.Z * I
V_23 = Z_12.Z * I
I_Z1 = V_12 / Z_1.Z
I_Z2 ... | 20.056604 | 55 | 0.634055 | # Exercise 4.3
from matplotlib import pyplot as plt
from RSE.impedance import Impedance
def print_complex(n: complex):
return '({c.real:.2f} + {c.imag:.2f}i)'.format(c=n)
Z_1 = Impedance(3, 5)
Z_2 = Impedance(5, -6)
Z_0 = Impedance(2, 3)
Z_12 = Z_1.parallel(Z_2)
Z_tot = Z_0 + Z_12
E = complex(100, 0)
# Comp... | 65 | 0 | 23 |
ef0b1e90a414cd10b99ab947636c1ca2151cab55 | 430 | py | Python | flatlist/__init__.py | dwabece/flatlist | 61b6f7f70bf9db2bf14f8bfdebce2c4f9a95811f | [
"WTFPL"
] | null | null | null | flatlist/__init__.py | dwabece/flatlist | 61b6f7f70bf9db2bf14f8bfdebce2c4f9a95811f | [
"WTFPL"
] | null | null | null | flatlist/__init__.py | dwabece/flatlist | 61b6f7f70bf9db2bf14f8bfdebce2c4f9a95811f | [
"WTFPL"
] | null | null | null | __version__ = '0.0.1'
def flatten_list(input_list):
"""
Flattens list with many nested lists.
>>> flatten_list([1, [2, [3], [4]]])
[1, 2, 3, 4]
"""
result = []
for item in input_list:
if isinstance(item, list):
result.extend(flatten_list(item))
# yield from... | 20.47619 | 45 | 0.532558 | __version__ = '0.0.1'
def flatten_list(input_list):
"""
Flattens list with many nested lists.
>>> flatten_list([1, [2, [3], [4]]])
[1, 2, 3, 4]
"""
result = []
for item in input_list:
if isinstance(item, list):
result.extend(flatten_list(item))
# yield from... | 0 | 0 | 0 |
b26f3009a69601dfd293b29d8ba30ede3ebd93f2 | 10,205 | py | Python | composeml/label_maker.py | flowersw/compose | d51a397988f4a9b78a489260b541d02d59a4d290 | [
"BSD-3-Clause"
] | 1 | 2021-04-22T00:48:21.000Z | 2021-04-22T00:48:21.000Z | composeml/label_maker.py | flowersw/compose | d51a397988f4a9b78a489260b541d02d59a4d290 | [
"BSD-3-Clause"
] | 14 | 2021-03-04T19:27:33.000Z | 2022-03-07T01:00:50.000Z | composeml/label_maker.py | flowersw/compose | d51a397988f4a9b78a489260b541d02d59a4d290 | [
"BSD-3-Clause"
] | null | null | null | from sys import stdout
from tqdm import tqdm
from composeml.data_slice import DataSliceGenerator
from composeml.label_search import ExampleSearch, LabelSearch
from composeml.label_times import LabelTimes
class LabelMaker:
"""Automatically makes labels for prediction problems."""
def __init__(self, target_e... | 39.708171 | 166 | 0.619402 | from sys import stdout
from tqdm import tqdm
from composeml.data_slice import DataSliceGenerator
from composeml.label_search import ExampleSearch, LabelSearch
from composeml.label_times import LabelTimes
class LabelMaker:
"""Automatically makes labels for prediction problems."""
def __init__(self, target_e... | 87 | 0 | 31 |
4f71e1c937b43af22eece8ca9d295888877421bd | 24,684 | py | Python | sparse/tune_sparse_dense_mali_test2.py | sunghern/Auto-Compression | 7c1123e5ffb63b0c34bef2db40dbfb560cb25c2e | [
"MIT"
] | 11 | 2019-11-26T04:33:31.000Z | 2022-03-28T11:35:54.000Z | sparse/tune_sparse_dense_mali_test2.py | sunghern/Auto-Compression | 7c1123e5ffb63b0c34bef2db40dbfb560cb25c2e | [
"MIT"
] | 22 | 2019-11-26T06:48:07.000Z | 2021-12-20T12:50:16.000Z | sparse/tune_sparse_dense_mali_test2.py | sunghern/Auto-Compression | 7c1123e5ffb63b0c34bef2db40dbfb560cb25c2e | [
"MIT"
] | 10 | 2019-11-26T04:33:57.000Z | 2021-10-12T04:30:48.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 42.48537 | 494 | 0.641792 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 10,792 | 0 | 113 |
9ea03ef9a7f91e79eaec7affb8fae971a0ddb50d | 2,523 | py | Python | Scripts/build_identity_profile.py | seatonullberg/PyPPA | 0175b38b2c8944d43f8d7b7f07b04f0bb46f8744 | [
"BSD-2-Clause"
] | 1 | 2017-11-12T23:18:49.000Z | 2017-11-12T23:18:49.000Z | Scripts/build_identity_profile.py | seatonullberg/PyPPA | 0175b38b2c8944d43f8d7b7f07b04f0bb46f8744 | [
"BSD-2-Clause"
] | null | null | null | Scripts/build_identity_profile.py | seatonullberg/PyPPA | 0175b38b2c8944d43f8d7b7f07b04f0bb46f8744 | [
"BSD-2-Clause"
] | null | null | null | import dlib
import pickle
import numpy as np
import os
import argparse
from utils import path_utils
from utils import identity_profile_utils
def main(path=None):
"""
Creates an IdentityProfile
:param path: (str) absolute path to a directory containing training images
- the end of the path... | 37.102941 | 108 | 0.692033 | import dlib
import pickle
import numpy as np
import os
import argparse
from utils import path_utils
from utils import identity_profile_utils
def main(path=None):
"""
Creates an IdentityProfile
:param path: (str) absolute path to a directory containing training images
- the end of the path... | 0 | 0 | 0 |
222000c011a49d429d50cb833a0e75575999b37e | 703 | py | Python | Algorithm/String/Red OR Green.py | smsubham/Data-Structure-Algorithms-Questions | 45da68231907068ef4e4a0444ffdac69b337fa7c | [
"Apache-2.0"
] | null | null | null | Algorithm/String/Red OR Green.py | smsubham/Data-Structure-Algorithms-Questions | 45da68231907068ef4e4a0444ffdac69b337fa7c | [
"Apache-2.0"
] | null | null | null | Algorithm/String/Red OR Green.py | smsubham/Data-Structure-Algorithms-Questions | 45da68231907068ef4e4a0444ffdac69b337fa7c | [
"Apache-2.0"
] | null | null | null | # https://practice.geeksforgeeks.org/problems/red-or-green5711/1/?category[]=Strings&category[]=Strings&page=1&query=category[]Stringspage1category[]Strings#
#User function Template for python3
#{
# Driver Code Starts
#Initial Template for Python 3
if __name__=='__main__':
t=int(input())
for _ in range(t):
... | 25.107143 | 157 | 0.561878 | # https://practice.geeksforgeeks.org/problems/red-or-green5711/1/?category[]=Strings&category[]=Strings&page=1&query=category[]Stringspage1category[]Strings#
#User function Template for python3
class Solution:
def RedOrGreen(self,N,S):
#code here
count = [0] * 2
for c in S:
if ... | 214 | -6 | 49 |
c2b614bd1efd11cc8596ed9f047ce9555bc76d30 | 7,227 | py | Python | src/adaptationengine_plugintester/harness.py | IntelLabsEurope/AdaptationEngineFramework | bbf7a2ca32b84c6208b43ee55c14bc5262fc51b2 | [
"Apache-2.0"
] | 1 | 2016-02-11T16:26:10.000Z | 2016-02-11T16:26:10.000Z | src/adaptationengine_plugintester/harness.py | IntelLabsEurope/AdaptationEngineFramework | bbf7a2ca32b84c6208b43ee55c14bc5262fc51b2 | [
"Apache-2.0"
] | null | null | null | src/adaptationengine_plugintester/harness.py | IntelLabsEurope/AdaptationEngineFramework | bbf7a2ca32b84c6208b43ee55c14bc5262fc51b2 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2015 INTEL RESEARCH AND INNOVATION IRELAND LIMITED
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or... | 30.1125 | 79 | 0.575896 | """
Copyright 2015 INTEL RESEARCH AND INNOVATION IRELAND LIMITED
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or... | 6,182 | 0 | 69 |
6ac060184271e5720aac6230094cb4944c0ce7d6 | 4,534 | py | Python | src/socketio/redis_manager.py | rrsal/python-socketio | 826a3e9ae0e22757172433bd6b29ec655689fa75 | [
"MIT"
] | 2,977 | 2015-07-15T08:01:56.000Z | 2022-03-31T15:36:09.000Z | src/socketio/redis_manager.py | rrsal/python-socketio | 826a3e9ae0e22757172433bd6b29ec655689fa75 | [
"MIT"
] | 758 | 2015-07-15T09:37:11.000Z | 2022-03-31T22:49:07.000Z | src/socketio/redis_manager.py | rrsal/python-socketio | 826a3e9ae0e22757172433bd6b29ec655689fa75 | [
"MIT"
] | 584 | 2015-08-08T03:16:29.000Z | 2022-03-30T09:25:30.000Z | import logging
import pickle
import time
try:
import redis
except ImportError:
redis = None
from .pubsub_manager import PubSubManager
logger = logging.getLogger('socketio')
class RedisManager(PubSubManager): # pragma: no cover
"""Redis based client manager.
This class implements a Redis backend f... | 38.423729 | 78 | 0.568152 | import logging
import pickle
import time
try:
import redis
except ImportError:
redis = None
from .pubsub_manager import PubSubManager
logger = logging.getLogger('socketio')
class RedisManager(PubSubManager): # pragma: no cover
"""Redis based client manager.
This class implements a Redis backend f... | 2,948 | 0 | 162 |
cdb58c025ce1f81e588941581ff984b5bcd2ae7e | 4,412 | py | Python | peacecorps/contenteditor/forms.py | cmc333333/peacecorps-site | 6779b9ac7a8f1013aaa4aa302ad78c992ea2b3e4 | [
"CC0-1.0"
] | 8 | 2015-01-06T15:38:12.000Z | 2016-05-02T23:55:39.000Z | peacecorps/contenteditor/forms.py | cmc333333/peacecorps-site | 6779b9ac7a8f1013aaa4aa302ad78c992ea2b3e4 | [
"CC0-1.0"
] | 61 | 2015-01-05T18:20:57.000Z | 2016-01-28T22:08:03.000Z | peacecorps/contenteditor/forms.py | cmc333333/peacecorps-site | 6779b9ac7a8f1013aaa4aa302ad78c992ea2b3e4 | [
"CC0-1.0"
] | 12 | 2015-02-04T21:15:41.000Z | 2021-02-17T11:03:27.000Z | import logging
from django import forms
from django.contrib.admin.forms import AdminAuthenticationForm
from django.contrib.auth.forms import (
AdminPasswordChangeForm, PasswordChangeForm, UserCreationForm)
from django.utils.translation import ugettext_lazy as _
from contenteditor import models
class LoggingAuth... | 39.392857 | 78 | 0.650499 | import logging
from django import forms
from django.contrib.admin.forms import AdminAuthenticationForm
from django.contrib.auth.forms import (
AdminPasswordChangeForm, PasswordChangeForm, UserCreationForm)
from django.utils.translation import ugettext_lazy as _
from contenteditor import models
class LoggingAuth... | 940 | 809 | 103 |
3a8934715fb09567c2c2b434108e522f2b4ccbf7 | 1,662 | py | Python | src/utils.py | TTomatoZhang/GHGCN | 09a07ff9e29e5889b912ca5feff74bb9308eda55 | [
"Apache-2.0"
] | null | null | null | src/utils.py | TTomatoZhang/GHGCN | 09a07ff9e29e5889b912ca5feff74bb9308eda55 | [
"Apache-2.0"
] | null | null | null | src/utils.py | TTomatoZhang/GHGCN | 09a07ff9e29e5889b912ca5feff74bb9308eda55 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
from sklearn import metrics
import pickle
| 33.918367 | 111 | 0.68231 | import numpy as np
import torch
from sklearn import metrics
import pickle
def sample_reconstruction(z_mean, z_log_std):
# using gumbel softmax
num_nodes = z_mean.size()[0]
normal = torch.distributions.Normal(0, 1)
#sample z to approximate the posterior of A
z = normal.sample(z_mean.size())
z =... | 1,496 | 0 | 92 |
02e69e7311211e92d05111ae823529ab948e170c | 12,778 | py | Python | log_decorator/test/test_log.py | Pavel-Egorov/log_decorator | 8b7f66a18b531e5f3e6e23d60b70e3d8dc89510e | [
"Apache-2.0"
] | null | null | null | log_decorator/test/test_log.py | Pavel-Egorov/log_decorator | 8b7f66a18b531e5f3e6e23d60b70e3d8dc89510e | [
"Apache-2.0"
] | null | null | null | log_decorator/test/test_log.py | Pavel-Egorov/log_decorator | 8b7f66a18b531e5f3e6e23d60b70e3d8dc89510e | [
"Apache-2.0"
] | null | null | null | import logging
from datetime import datetime
from unittest import TestCase
from unittest.mock import MagicMock, patch, ANY
from uuid import uuid1
from log_decorator import log
# noinspection DuplicatedCode
# noinspection DuplicatedCode
| 33.538058 | 114 | 0.563703 | import logging
from datetime import datetime
from unittest import TestCase
from unittest.mock import MagicMock, patch, ANY
from uuid import uuid1
from log_decorator import log
class TestLog(TestCase):
def setUp(self):
self.test_call_id = uuid1().hex
self.uuid1_mock = MagicMock(return_value=MagicM... | 12,075 | 3 | 452 |
426b744903c0239e03ef4ef537e308bfcd6a9c72 | 2,710 | py | Python | LC_problems/1728.py | Howardhuang98/Blog | cf58638d6d0bbf55b95fe08e43798e7dd14219ac | [
"MIT"
] | null | null | null | LC_problems/1728.py | Howardhuang98/Blog | cf58638d6d0bbf55b95fe08e43798e7dd14219ac | [
"MIT"
] | null | null | null | LC_problems/1728.py | Howardhuang98/Blog | cf58638d6d0bbf55b95fe08e43798e7dd14219ac | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@File : 1728.py
@Contact : huanghoward@foxmail.com
@Modify Time : 2022/5/10 22:30
------------
"""
import collections
from typing import List
if __name__ == '__main__':
s = Solution()
print(s.canMouseWin(["####F","#C...","M...."], catJ... | 35.194805 | 118 | 0.420664 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@File : 1728.py
@Contact : huanghoward@foxmail.com
@Modify Time : 2022/5/10 22:30
------------
"""
import collections
from typing import List
class Solution:
def canMouseWin(self, grid: List[str], catJump: int, mouseJump: int) -> bool:
... | 2,322 | -6 | 49 |
d3b77120473ef31f2ef79a0e2ea70785736dc587 | 1,257 | py | Python | v3/as_drivers/sched/asynctest.py | Dilepa/micropython-async | 3c8817d9ead33bcd8399d0935ffb24dd7bcd6e71 | [
"MIT"
] | 443 | 2017-01-01T20:54:46.000Z | 2022-03-28T06:17:30.000Z | v3/as_drivers/sched/asynctest.py | Dilepa/micropython-async | 3c8817d9ead33bcd8399d0935ffb24dd7bcd6e71 | [
"MIT"
] | 79 | 2017-01-28T17:53:32.000Z | 2022-02-08T10:05:04.000Z | v3/as_drivers/sched/asynctest.py | Dilepa/micropython-async | 3c8817d9ead33bcd8399d0935ffb24dd7bcd6e71 | [
"MIT"
] | 126 | 2017-02-17T13:06:01.000Z | 2022-03-07T03:50:50.000Z | # asynctest.py Demo of asynchronous code scheduling tasks with cron
# Copyright (c) 2020 Peter Hinch
# Released under the MIT License (MIT) - see LICENSE file
import uasyncio as asyncio
from sched.sched import schedule
from time import localtime
try:
asyncio.run(main())
finally:
_ = asyncio.new_event_loop()
| 33.972973 | 91 | 0.647574 | # asynctest.py Demo of asynchronous code scheduling tasks with cron
# Copyright (c) 2020 Peter Hinch
# Released under the MIT License (MIT) - see LICENSE file
import uasyncio as asyncio
from sched.sched import schedule
from time import localtime
def foo(txt): # Demonstrate callback
yr, mo, md, h, m, s, wd = loc... | 868 | 0 | 69 |
73ab89ce555e209a9b360cac8f9d2d2538e5131d | 1,029 | py | Python | cv_workshops/8-day/6-clazz.py | afterloe/opencv-practice | 83d76132d004ebbc96d99d34a0fd3fc37a044f9f | [
"MIT"
] | 5 | 2020-03-13T07:34:30.000Z | 2021-10-01T03:03:05.000Z | cv_workshops/8-day/6-clazz.py | afterloe/Opencv-practice | 83d76132d004ebbc96d99d34a0fd3fc37a044f9f | [
"MIT"
] | null | null | null | cv_workshops/8-day/6-clazz.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
import numpy as np
"""
视频的读写与处理
FPS即每秒多少帧的处理能力,一般情况下(人类对300毫秒以下的变动是无法察觉的)每秒大于5帧的处理可以认为是视屏处理
"""
if "__main__" == __name__:
main()
| 21.4375 | 68 | 0.525753 | #!/usr/bin/env python3
# -*- coding=utf-8 -*-
import cv2 as cv
import numpy as np
"""
视频的读写与处理
FPS即每秒多少帧的处理能力,一般情况下(人类对300毫秒以下的变动是无法察觉的)每秒大于5帧的处理可以认为是视屏处理
"""
def process(frame, option):
dst = frame
if 1 == option:
dst = cv.bitwise_not(frame)
if 2 == option:
... | 758 | 0 | 50 |
cc241bf078185f3bf1613b1440e7428e5cee7327 | 4,217 | py | Python | Utils/Exceptions.py | Caius-Lu/Savior | 47c22e06c38cc9b5f7007d79f791015c8b2b76aa | [
"BSD-2-Clause"
] | 108 | 2021-03-19T03:45:48.000Z | 2022-03-29T12:19:38.000Z | Utils/Exceptions.py | Caius-Lu/Savior | 47c22e06c38cc9b5f7007d79f791015c8b2b76aa | [
"BSD-2-Clause"
] | 2 | 2021-05-12T07:26:21.000Z | 2021-07-16T12:53:52.000Z | Utils/Exceptions.py | Caius-Lu/Savior | 47c22e06c38cc9b5f7007d79f791015c8b2b76aa | [
"BSD-2-Clause"
] | 27 | 2021-03-19T05:50:26.000Z | 2021-12-28T07:13:09.000Z | # todo: 后续需要重新规划major code和mirror code,前期先这样写
class AlgorithmOperatorException(CustomException):
"""
算子异常基类
"""
MAJOR_CODE = 1
class AlgorithmInputParameterException(AlgorithmOperatorException):
"""
算子入参异常
"""
MIRROR_CODE = 11
class InputParameterAbnormalException(AlgorithmInputPar... | 17.004032 | 73 | 0.686033 | # todo: 后续需要重新规划major code和mirror code,前期先这样写
class CustomException(Exception):
MAJOR_CODE = 0
MIRROR_CODE = 0
def format_exception(self):
return self.MAJOR_CODE * 100 + self.MIRROR_CODE, str(self)
class AlgorithmOperatorException(CustomException):
"""
算子异常基类
"""
MAJOR_CODE = 1
... | 247 | 116 | 72 |
ed137151ee55b87a32e34e4458e0b9b93ff78d36 | 510 | py | Python | python/test/util.py | vkocaman/spark-nlp | dd4d18846c6274121ab4aa6e671a1d87549c2cd9 | [
"Apache-2.0"
] | 1 | 2021-11-15T22:20:09.000Z | 2021-11-15T22:20:09.000Z | python/test/util.py | vkocaman/spark-nlp | dd4d18846c6274121ab4aa6e671a1d87549c2cd9 | [
"Apache-2.0"
] | null | null | null | python/test/util.py | vkocaman/spark-nlp | dd4d18846c6274121ab4aa6e671a1d87549c2cd9 | [
"Apache-2.0"
] | null | null | null | from pyspark.sql import SparkSession
import os
| 26.842105 | 89 | 0.601961 | from pyspark.sql import SparkSession
import os
class SparkContextForTest:
spark = SparkSession.builder \
.master("local[4]") \
.config("spark.jars", 'lib/sparknlp.jar,lib/sparknlp-ocr.jar') \
.config("spark.driver.memory", "6500M") \
.getOrCreate()
spark.sparkContext.setLogLev... | 0 | 438 | 23 |
fc4d8e9107b1c075331241297982a316e3727ea9 | 16,530 | py | Python | erica_app/erica/pyeric/eric.py | digitalservice4germany/steuerlotse | ef3e094e4d7d4768431a50ac4be60672cd03221d | [
"MIT"
] | 20 | 2021-07-02T07:49:08.000Z | 2022-03-18T22:26:10.000Z | erica_app/erica/pyeric/eric.py | digitalservice4germany/steuerlotse | ef3e094e4d7d4768431a50ac4be60672cd03221d | [
"MIT"
] | 555 | 2021-06-28T15:35:15.000Z | 2022-03-31T11:51:55.000Z | erica_app/erica/pyeric/eric.py | digitalservice4germany/steuerlotse | ef3e094e4d7d4768431a50ac4be60672cd03221d | [
"MIT"
] | 1 | 2021-07-04T20:34:12.000Z | 2021-07-04T20:34:12.000Z | import logging
import os
import tempfile
from contextlib import contextmanager
from ctypes import Structure, c_int, c_uint32, c_char_p, c_void_p, pointer, CDLL, RTLD_GLOBAL
from dataclasses import dataclass
from typing import ByteString
from erica.config import get_settings, Settings
from erica.pyeric.eric_errors impo... | 40.024213 | 119 | 0.648336 | import logging
import os
import tempfile
from contextlib import contextmanager
from ctypes import Structure, c_int, c_uint32, c_char_p, c_void_p, pointer, CDLL, RTLD_GLOBAL
from dataclasses import dataclass
from typing import ByteString
from erica.config import get_settings, Settings
from erica.pyeric.eric_errors impo... | 6,800 | 540 | 388 |
368c29d9fda5480349720a3909b354de0bd4a95d | 3,023 | py | Python | modules/matrixmult.py | benedictvs/FOCS-Calculator | 25dad4c6624be1950ce21594b4127c05be20b121 | [
"MIT"
] | 1 | 2021-11-22T21:54:28.000Z | 2021-11-22T21:54:28.000Z | modules/matrixmult.py | benedictvs/FOCS-Calculator | 25dad4c6624be1950ce21594b4127c05be20b121 | [
"MIT"
] | 34 | 2021-10-07T22:55:23.000Z | 2021-12-06T00:48:55.000Z | modules/matrixmult.py | benedictvs/FOCS-Calculator | 25dad4c6624be1950ce21594b4127c05be20b121 | [
"MIT"
] | 1 | 2021-10-18T23:33:44.000Z | 2021-10-18T23:33:44.000Z | import numpy as np
from abstractclasses import solver, solver_model
"""
Matrix multiplcation solves for the distance between two points in 2 or 3
dimensional space.
"""
# ————————————————————————————————————————————————
# MATRIX MULTIPLICATION SOLVER CLASS
# ———————————————————————————————————————————————... | 33.966292 | 79 | 0.471386 | import numpy as np
from abstractclasses import solver, solver_model
"""
Matrix multiplcation solves for the distance between two points in 2 or 3
dimensional space.
"""
# ————————————————————————————————————————————————
# MATRIX MULTIPLICATION SOLVER CLASS
# ———————————————————————————————————————————————... | 2,369 | 49 | 133 |
8e3b1c8f2e480a357249c851458ce3bfb4f62ba2 | 5,229 | py | Python | x5gonlamtools/tools/text2phrase/text2phraser.py | X5GON/lamapi | 0558c3b7af520ab83bdbd29e1b1b9b87bdc147b0 | [
"BSD-2-Clause"
] | null | null | null | x5gonlamtools/tools/text2phrase/text2phraser.py | X5GON/lamapi | 0558c3b7af520ab83bdbd29e1b1b9b87bdc147b0 | [
"BSD-2-Clause"
] | null | null | null | x5gonlamtools/tools/text2phrase/text2phraser.py | X5GON/lamapi | 0558c3b7af520ab83bdbd29e1b1b9b87bdc147b0 | [
"BSD-2-Clause"
] | null | null | null | import os
import pickle
from gensim.models.phrases import Phraser, Phrases
from gensim.utils import SaveLoad as gensimSaveLoad
from typing import List, Text, Any
PathType = str
# TODO: Search truth typing of phraser
PhraserType = Any
# %%
# %%
# %%
# %%
# %%
# print("Saving done")
# %%
# %%
# %%
if ... | 39.315789 | 117 | 0.625167 | import os
import pickle
from gensim.models.phrases import Phraser, Phrases
from gensim.utils import SaveLoad as gensimSaveLoad
from typing import List, Text, Any
PathType = str
# TODO: Search truth typing of phraser
PhraserType = Any
# %%
def train_model(texts: List[Text],
savedir: PathType) -> None:... | 4,727 | 0 | 155 |
3d6ec1096e7233ab6b713abda6e049695a55caf8 | 236 | py | Python | OOP/Exercises/Static_and_Class_Methods_Excersise/4_gym/project/equipment.py | tankishev/Python | 60e511fc901f136b88c681f77f209fe2f8c46447 | [
"MIT"
] | 2 | 2022-03-04T11:39:03.000Z | 2022-03-13T07:13:23.000Z | OOP/Exercises/Static_and_Class_Methods_Excersise/4_gym/project/equipment.py | tankishev/Python | 60e511fc901f136b88c681f77f209fe2f8c46447 | [
"MIT"
] | null | null | null | OOP/Exercises/Static_and_Class_Methods_Excersise/4_gym/project/equipment.py | tankishev/Python | 60e511fc901f136b88c681f77f209fe2f8c46447 | [
"MIT"
] | null | null | null | from .helper_class import AIBC
| 19.666667 | 51 | 0.605932 | from .helper_class import AIBC
class Equipment(AIBC):
def __init__(self, name: str) -> None:
super().__init__()
self.name = name
def __repr__(self) -> str:
return f"Equipment <{self.id}> {self.name}"
| 126 | 1 | 77 |
6a282ee5ee2a663b0a628eb51b7309527024f500 | 1,586 | py | Python | python/euler113.py | feliposz/project-euler-solutions | 1aec50c4d2d86b515dc8607559575da9e4aecb3a | [
"MIT"
] | null | null | null | python/euler113.py | feliposz/project-euler-solutions | 1aec50c4d2d86b515dc8607559575da9e4aecb3a | [
"MIT"
] | null | null | null | python/euler113.py | feliposz/project-euler-solutions | 1aec50c4d2d86b515dc8607559575da9e4aecb3a | [
"MIT"
] | null | null | null | """Problem 113
10 February 2006
Working from left-to-right if no digit is exceeded by the digit to its
left it is called an increasing number; for example, 134468.
Similarly if no digit is exceeded by the digit to its right it is
called a decreasing number; for example, 66420.
We shall call a positive integer that i... | 36.883721 | 100 | 0.732661 | """Problem 113
10 February 2006
Working from left-to-right if no digit is exceeded by the digit to its
left it is called an increasing number; for example, 134468.
Similarly if no digit is exceeded by the digit to its right it is
called a decreasing number; for example, 66420.
We shall call a positive integer that i... | 586 | 0 | 67 |
cbfe41853248037140350feca255270e604c79c4 | 670 | py | Python | PythonExercicio/ex070.py | fotavio16/PycharmProjects | f5be49db941de69159ec543e8a6dde61f9f94d86 | [
"MIT"
] | null | null | null | PythonExercicio/ex070.py | fotavio16/PycharmProjects | f5be49db941de69159ec543e8a6dde61f9f94d86 | [
"MIT"
] | null | null | null | PythonExercicio/ex070.py | fotavio16/PycharmProjects | f5be49db941de69159ec543e8a6dde61f9f94d86 | [
"MIT"
] | null | null | null | totalGasto = 0
maisdeMil = 0
maisBarato = ['', 1000000.00]
while True:
nome = str(input('nome do produto: '))
preço = float(input('preço do produto: '))
totalGasto += preço
if preço > 1000:
maisdeMil += 1
if preço < maisBarato[1]:
maisBarato[0] = nome
maisBarato[1] = preço
... | 31.904762 | 88 | 0.620896 | totalGasto = 0
maisdeMil = 0
maisBarato = ['', 1000000.00]
while True:
nome = str(input('nome do produto: '))
preço = float(input('preço do produto: '))
totalGasto += preço
if preço > 1000:
maisdeMil += 1
if preço < maisBarato[1]:
maisBarato[0] = nome
maisBarato[1] = preço
... | 0 | 0 | 0 |
ab02eb78de439113207007e00752d544983808e6 | 20,628 | py | Python | lenstronomy/Util/util.py | swagnercarena/lenstronomy | b8df91699b042273b158bd834ab85619229dbc1e | [
"MIT"
] | null | null | null | lenstronomy/Util/util.py | swagnercarena/lenstronomy | b8df91699b042273b158bd834ab85619229dbc1e | [
"MIT"
] | null | null | null | lenstronomy/Util/util.py | swagnercarena/lenstronomy | b8df91699b042273b158bd834ab85619229dbc1e | [
"MIT"
] | null | null | null | __author__ = 'Simon Birrer'
"""
this file contains standard routines
"""
import numpy as np
import mpmath
import itertools
from lenstronomy.Util.numba_util import jit
from lenstronomy.Util.package_util import exporter
export, __all__ = exporter()
@export
def merge_dicts(*dict_args):
"""
Given any number of... | 31.882535 | 131 | 0.594386 | __author__ = 'Simon Birrer'
"""
this file contains standard routines
"""
import numpy as np
import mpmath
import itertools
from lenstronomy.Util.numba_util import jit
from lenstronomy.Util.package_util import exporter
export, __all__ = exporter()
@export
def merge_dicts(*dict_args):
"""
Given any number of... | 471 | 0 | 22 |
71e21afa96b4813cda8720a586f05647618ac39b | 6,468 | py | Python | phoila/voila_handlers.py | datalayer-contrib/phoila | f8ff5f0a1f807829b57deae9f72bed91908258ad | [
"BSD-3-Clause"
] | 10 | 2019-08-09T14:45:49.000Z | 2020-03-30T12:48:05.000Z | phoila/voila_handlers.py | datalayer-contrib/phoila | f8ff5f0a1f807829b57deae9f72bed91908258ad | [
"BSD-3-Clause"
] | 9 | 2019-08-09T17:07:45.000Z | 2019-10-22T18:22:09.000Z | phoila/voila_handlers.py | datalayer-contrib/phoila | f8ff5f0a1f807829b57deae9f72bed91908258ad | [
"BSD-3-Clause"
] | 5 | 2019-08-09T17:57:53.000Z | 2019-10-22T12:14:14.000Z | """
This code is based on code from voila, copied under the following license:
BSD License
Copyright (c) 2018 Voila contributors.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
a. Redistributions o... | 35.344262 | 114 | 0.640693 | """
This code is based on code from voila, copied under the following license:
BSD License
Copyright (c) 2018 Voila contributors.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
a. Redistributions o... | 3,858 | 125 | 46 |
26fec536209173a6fb550e8e582130cba2da6feb | 343 | py | Python | mOe.py | solothinker/statistics-prob | 5da287ff1b6f5a8ad026781b226b1019efaa51f7 | [
"MIT"
] | null | null | null | mOe.py | solothinker/statistics-prob | 5da287ff1b6f5a8ad026781b226b1019efaa51f7 | [
"MIT"
] | null | null | null | mOe.py | solothinker/statistics-prob | 5da287ff1b6f5a8ad026781b226b1019efaa51f7 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (20,10)
from distributionLib import Dist
np.random.seed(404)
N = 1000000
data = np.random.choice([0, 1], size=(N,1), p=[0.57, 0.43])
for sample in range(100,10000,500):
ind = np.random.randint(0,N,[sample,1])
Dist.MOE(data[ind... | 22.866667 | 59 | 0.682216 | import numpy as np
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (20,10)
from distributionLib import Dist
np.random.seed(404)
N = 1000000
data = np.random.choice([0, 1], size=(N,1), p=[0.57, 0.43])
for sample in range(100,10000,500):
ind = np.random.randint(0,N,[sample,1])
Dist.MOE(data[ind... | 0 | 0 | 0 |
18bca2be7ceb1b2eda37a1c34d97a331e4f7cb5b | 1,439 | py | Python | fullstack/forms.py | BuildForSDG/frontend90 | 35b7297341f048b08a5ff02c7a96dad968004010 | [
"MIT"
] | 1 | 2020-11-16T11:54:29.000Z | 2020-11-16T11:54:29.000Z | fullstack/forms.py | BuildForSDG/frontend90 | 35b7297341f048b08a5ff02c7a96dad968004010 | [
"MIT"
] | 11 | 2020-05-17T18:39:21.000Z | 2021-09-22T19:14:28.000Z | fullstack/forms.py | BuildForSDG/frontend90 | 35b7297341f048b08a5ff02c7a96dad968004010 | [
"MIT"
] | 5 | 2020-05-18T11:19:44.000Z | 2020-11-12T14:46:31.000Z | from django import forms
from django.forms import ModelForm
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
# from cities_light.models import Country, Region, City
from .models import (ServiceProvider,
CustomerProfile, RatingAndReview)
class Serv... | 27.673077 | 55 | 0.660876 | from django import forms
from django.forms import ModelForm
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
# from cities_light.models import Country, Region, City
from .models import (ServiceProvider,
CustomerProfile, RatingAndReview)
class Serv... | 0 | 299 | 105 |
c474b8895ac93f17e9a698742f8661a9f83d6775 | 8,298 | py | Python | ibmsecurity/isam/statistics.py | ibm-enio/ibmsecurity | 81f989678642c3b6a49b2a3fbb5d9ca98804ef17 | [
"Apache-2.0"
] | null | null | null | ibmsecurity/isam/statistics.py | ibm-enio/ibmsecurity | 81f989678642c3b6a49b2a3fbb5d9ca98804ef17 | [
"Apache-2.0"
] | null | null | null | ibmsecurity/isam/statistics.py | ibm-enio/ibmsecurity | 81f989678642c3b6a49b2a3fbb5d9ca98804ef17 | [
"Apache-2.0"
] | null | null | null | import logging
from ibmsecurity.utilities import tools
logger = logging.getLogger(__name__)
def get_network(isamAppliance, application_interface, statistics_duration, check_mode=False, force=False):
"""
Retrieving the Application Interface Statistics
"""
return isamAppliance.invoke_get("Retrieving th... | 53.192308 | 127 | 0.536876 | import logging
from ibmsecurity.utilities import tools
logger = logging.getLogger(__name__)
def get_network(isamAppliance, application_interface, statistics_duration, check_mode=False, force=False):
"""
Retrieving the Application Interface Statistics
"""
return isamAppliance.invoke_get("Retrieving th... | 0 | 0 | 0 |
e6bed0fa906c6eccc11bef4a99517d428af459d7 | 3,951 | py | Python | setup.py | ngsimon/web2py | 93297fed8a3a916b45d17f5c4d5d2b80aaf92788 | [
"BSD-3-Clause"
] | 1,573 | 2015-01-01T07:19:06.000Z | 2022-03-30T09:06:06.000Z | setup.py | ngsimon/web2py | 93297fed8a3a916b45d17f5c4d5d2b80aaf92788 | [
"BSD-3-Clause"
] | 1,691 | 2015-01-03T11:03:23.000Z | 2022-03-30T07:27:28.000Z | setup.py | ngsimon/web2py | 93297fed8a3a916b45d17f5c4d5d2b80aaf92788 | [
"BSD-3-Clause"
] | 895 | 2015-01-03T19:56:15.000Z | 2022-03-18T18:30:57.000Z | #!/usr/bin/env python
import setuptools
from setuptools import setup
import tarfile
import os, sys
from setupbase import (
UpdateSubmodules,
check_submodule_status,
update_submodules,
require_clean_submodules
)
#-------------------------------------------------------------------------------
# Make ... | 37.990385 | 94 | 0.576816 | #!/usr/bin/env python
import setuptools
from setuptools import setup
import tarfile
import os, sys
from setupbase import (
UpdateSubmodules,
check_submodule_status,
update_submodules,
require_clean_submodules
)
#-------------------------------------------------------------------------------
# Make ... | 2,561 | 0 | 23 |
29e80741bd747ffc50443880282dcf77ba9e6fe0 | 2,348 | py | Python | get_articles.py | faroit/deep-fireball | b37d08cb5b15359c363e7816fc7c163c1709a5ac | [
"MIT"
] | null | null | null | get_articles.py | faroit/deep-fireball | b37d08cb5b15359c363e7816fc7c163c1709a5ac | [
"MIT"
] | null | null | null | get_articles.py | faroit/deep-fireball | b37d08cb5b15359c363e7816fc7c163c1709a5ac | [
"MIT"
] | null | null | null | import urllib2
from bs4 import BeautifulSoup
from datetime import datetime
import pandas as pd
import argparse
"""Fetch all daringfireball articles since 2002
count the article character length
"""
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description='Fetch all daringfireball art... | 25.521739 | 77 | 0.497445 | import urllib2
from bs4 import BeautifulSoup
from datetime import datetime
import pandas as pd
import argparse
"""Fetch all daringfireball articles since 2002
count the article character length
"""
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description='Fetch all daringfireball art... | 0 | 0 | 0 |
b8acda73b74de4585255ca1a66d34a81ef3df5df | 148 | py | Python | arbitrage/__init__.py | drinksober/arbitrage | 00ba419d84b7182692b62fed3121dd486cb5c2b9 | [
"MIT"
] | 10 | 2018-03-26T02:19:18.000Z | 2019-12-04T12:20:28.000Z | arbitrage/__init__.py | drinks5/arbitrage | 00ba419d84b7182692b62fed3121dd486cb5c2b9 | [
"MIT"
] | null | null | null | arbitrage/__init__.py | drinks5/arbitrage | 00ba419d84b7182692b62fed3121dd486cb5c2b9 | [
"MIT"
] | 1 | 2018-05-05T04:52:23.000Z | 2018-05-05T04:52:23.000Z | # -*- coding: utf-8 -*-
"""Top-level package for cycle-arbitrage."""
__author__ = """drinksober"""
__email__ = 'me@mum5.cn'
__version__ = '0.1.0'
| 18.5 | 44 | 0.628378 | # -*- coding: utf-8 -*-
"""Top-level package for cycle-arbitrage."""
__author__ = """drinksober"""
__email__ = 'me@mum5.cn'
__version__ = '0.1.0'
| 0 | 0 | 0 |
56eedbac6807ea567c580f909cc8f5f2831c4a9e | 2,262 | py | Python | Dig Data Analysis.py | ankurRangi/Apache-Kafka-Twitter-API | ef5931f28ea285177fed4a0487a5fb18c10042a9 | [
"MIT"
] | null | null | null | Dig Data Analysis.py | ankurRangi/Apache-Kafka-Twitter-API | ef5931f28ea285177fed4a0487a5fb18c10042a9 | [
"MIT"
] | null | null | null | Dig Data Analysis.py | ankurRangi/Apache-Kafka-Twitter-API | ef5931f28ea285177fed4a0487a5fb18c10042a9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""BDA_Assignment_04_v2.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1gfYg_0pK4fVIOxYRi9ybLD3ySsqR2cg2
# Streaming Twitter Data Using Kafka
Importing the libraries:
"""
!pip install kafka-python
!pip install python-tw... | 33.264706 | 142 | 0.723254 | # -*- coding: utf-8 -*-
"""BDA_Assignment_04_v2.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1gfYg_0pK4fVIOxYRi9ybLD3ySsqR2cg2
# Streaming Twitter Data Using Kafka
Importing the libraries:
"""
!pip install kafka-python
!pip install python-tw... | 147 | 16 | 75 |
ae772338c0a4862d30d19eda147535981ed7df8f | 8,940 | py | Python | test/test_pyzpl.py | mbarkhau/pyzpl | 4944b948c1c5006b4befe03488e7d34bc06a0ea6 | [
"MIT"
] | 1 | 2016-11-23T09:47:11.000Z | 2016-11-23T09:47:11.000Z | test/test_pyzpl.py | mbarkhau/pyzpl | 4944b948c1c5006b4befe03488e7d34bc06a0ea6 | [
"MIT"
] | 2 | 2019-01-04T00:37:06.000Z | 2019-02-05T08:45:28.000Z | test/test_pyzpl.py | mbarkhau/pyzpl | 4944b948c1c5006b4befe03488e7d34bc06a0ea6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import io
import collections
import functools as ft
import pytest
import pyzpl
import pyzpl2
FIXTURE_1_DATA = b"""
1. ZPL configuration file ex... | 26.294118 | 100 | 0.558501 | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import io
import collections
import functools as ft
import pytest
import pyzpl
import pyzpl2
FIXTURE_1_DATA = b"""
1. ZPL configuration file ex... | 569 | 0 | 45 |
2668cc45daa8b52d31395b8f542fb8a1ba4f26d1 | 3,034 | py | Python | tests/unit/fields/test_collection.py | metabolize-forks/booby | 4e15e4e263dc387420398f808ffb345b760364d4 | [
"Apache-2.0"
] | null | null | null | tests/unit/fields/test_collection.py | metabolize-forks/booby | 4e15e4e263dc387420398f808ffb345b760364d4 | [
"Apache-2.0"
] | null | null | null | tests/unit/fields/test_collection.py | metabolize-forks/booby | 4e15e4e263dc387420398f808ffb345b760364d4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import collections
from expects import *
from booby import Model, fields, errors
from tests.unit._helpers import MyDict
| 32.978261 | 94 | 0.679631 | # -*- coding: utf-8 -*-
import collections
from expects import *
from booby import Model, fields, errors
from tests.unit._helpers import MyDict
class TestSetValueInCollectionField(object):
def test_when_value_is_a_list_of_dicts_then_value_is_a_list_of_models(self):
users = [{'name': 'Foo'}, {'name': 'F... | 2,254 | 119 | 507 |
3b6cda622687c976bfb41c7948bd18e887372a30 | 296 | py | Python | buzzword_counter/counter/models.py | Blueshoe/buzzword-counter | 86e573966741e2839cc58721df384e41ceb56957 | [
"MIT"
] | 1 | 2020-04-27T09:46:27.000Z | 2020-04-27T09:46:27.000Z | buzzword_counter/counter/models.py | Blueshoe/buzzword-counter | 86e573966741e2839cc58721df384e41ceb56957 | [
"MIT"
] | 1 | 2021-11-05T14:42:34.000Z | 2021-11-24T20:02:26.000Z | buzzword_counter/counter/models.py | Blueshoe/buzzword-counter | 86e573966741e2839cc58721df384e41ceb56957 | [
"MIT"
] | 1 | 2021-12-09T13:16:03.000Z | 2021-12-09T13:16:03.000Z | from django.db import models
| 22.769231 | 67 | 0.679054 | from django.db import models
class Buzzword(models.Model):
word = models.CharField(max_length=127, unique=True)
count = models.PositiveSmallIntegerField(blank=True, default=0)
class Meta:
ordering = ["word"]
def __str__(self):
return f'Buzzword "{self.word}"'
| 38 | 205 | 23 |
d8b6dc4a4e6404cbab60209812d49c3cace65d9f | 1,394 | py | Python | rest/karenClient.py | PJBoy/karen | 4cba9641029f79b44e87133588942b1dda6c0488 | [
"0BSD"
] | null | null | null | rest/karenClient.py | PJBoy/karen | 4cba9641029f79b44e87133588942b1dda6c0488 | [
"0BSD"
] | null | null | null | rest/karenClient.py | PJBoy/karen | 4cba9641029f79b44e87133588942b1dda6c0488 | [
"0BSD"
] | null | null | null | import os, subprocess
import requests
url_search = 'http://127.0.0.1:8000/search'
url_image = 'http://127.0.0.1:8000/image'
proxies = {}
while True:
query = input('Query: ')
if not query:
break
results = get_search(query)
if len(results) == 0:
print('No results')
... | 33.190476 | 147 | 0.629842 | import os, subprocess
import requests
url_search = 'http://127.0.0.1:8000/search'
url_image = 'http://127.0.0.1:8000/image'
proxies = {}
def get_search(quote):
r = requests.get(url_search, proxies = proxies, params = {'q': quote})
if not r.ok:
raise RuntimeError(f'{r.status_code} - {r.reason... | 424 | 0 | 50 |
f0e0ad50b19f2d7635e35a86f8f44cf87fea4c25 | 7,582 | py | Python | tests/kafka_cluster_manager/cluster_topology_test.py | dbgrigsby/kafka-utils | 4cf4500d4aeea872846269d410cc7dd70a31e00d | [
"Apache-2.0"
] | 302 | 2016-05-18T02:05:04.000Z | 2022-03-28T21:36:28.000Z | tests/kafka_cluster_manager/cluster_topology_test.py | dbgrigsby/kafka-utils | 4cf4500d4aeea872846269d410cc7dd70a31e00d | [
"Apache-2.0"
] | 135 | 2016-05-17T23:15:16.000Z | 2021-11-04T13:35:51.000Z | tests/kafka_cluster_manager/cluster_topology_test.py | dbgrigsby/kafka-utils | 4cf4500d4aeea872846269d410cc7dd70a31e00d | [
"Apache-2.0"
] | 133 | 2016-05-18T10:23:05.000Z | 2022-01-29T17:24:17.000Z | # -*- coding: utf-8 -*-
# Copyright 2016 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 34.307692 | 86 | 0.575574 | # -*- coding: utf-8 -*-
# Copyright 2016 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 5,453 | 1,222 | 23 |
9b96f6f8b09755ce868105970073970c1689b848 | 10,890 | py | Python | pyaz/apim/api/__init__.py | py-az-cli/py-az-cli | 9a7dc44e360c096a5a2f15595353e9dad88a9792 | [
"MIT"
] | null | null | null | pyaz/apim/api/__init__.py | py-az-cli/py-az-cli | 9a7dc44e360c096a5a2f15595353e9dad88a9792 | [
"MIT"
] | null | null | null | pyaz/apim/api/__init__.py | py-az-cli/py-az-cli | 9a7dc44e360c096a5a2f15595353e9dad88a9792 | [
"MIT"
] | 1 | 2022-02-03T09:12:01.000Z | 2022-02-03T09:12:01.000Z | '''
Manage Azure API Management API's.
'''
from ... pyaz_utils import _call_az
from . import operation, release, revision, versionset
def import_(path, resource_group, service_name, specification_format, api_id=None, api_revision=None, api_type=None, api_version=None, api_version_set_id=None, description=None, displa... | 65.60241 | 466 | 0.744812 | '''
Manage Azure API Management API's.
'''
from ... pyaz_utils import _call_az
from . import operation, release, revision, versionset
def import_(path, resource_group, service_name, specification_format, api_id=None, api_revision=None, api_type=None, api_version=None, api_version_set_id=None, description=None, displa... | 0 | 0 | 0 |
63493727dd45db169ea27ed46baaad598056183c | 3,602 | py | Python | examples/flim/plot_resolution_frc.py | Fluorescence-Tools/tttrlib | 891db80ddc5e6a1098faa62bd336df11b060e041 | [
"BSD-3-Clause"
] | 9 | 2019-11-27T13:00:54.000Z | 2022-03-31T15:37:29.000Z | examples/flim/plot_resolution_frc.py | Fluorescence-Tools/tttrlib | 891db80ddc5e6a1098faa62bd336df11b060e041 | [
"BSD-3-Clause"
] | 6 | 2019-10-31T23:59:56.000Z | 2022-03-31T15:33:06.000Z | examples/flim/plot_resolution_frc.py | Fluorescence-Tools/tttrlib | 891db80ddc5e6a1098faa62bd336df11b060e041 | [
"BSD-3-Clause"
] | 1 | 2019-07-28T20:21:43.000Z | 2019-07-28T20:21:43.000Z | """
==================================
Fourier ring correlation of images
==================================
Estimation of the image resolution
----------------------------------
In electron microscopy the Fourier Ring Correlation (FRC) is widely used as a
measure for the resolution of an image. This very practical ap... | 30.786325 | 103 | 0.649917 | """
==================================
Fourier ring correlation of images
==================================
Estimation of the image resolution
----------------------------------
In electron microscopy the Fourier Ring Correlation (FRC) is widely used as a
measure for the resolution of an image. This very practical ap... | 0 | 0 | 0 |
a7bd0e6b4553d3bd1b91eeeee2ae8c238bbd9776 | 17,156 | py | Python | PyEngine3D/ResourceManager/DDSLoader.py | ubuntunux/PyEngine3D | e5542b5b185e8b9b56fc4669a6f22eb06c386c4f | [
"BSD-2-Clause"
] | 121 | 2017-06-07T19:42:30.000Z | 2022-03-31T04:42:29.000Z | PyEngine3D/ResourceManager/DDSLoader.py | MatthewPChapdelaine/PyEngine3D | e5542b5b185e8b9b56fc4669a6f22eb06c386c4f | [
"BSD-2-Clause"
] | 16 | 2015-12-21T16:57:55.000Z | 2017-03-06T15:22:37.000Z | PyEngine3D/ResourceManager/DDSLoader.py | ubuntunux/GuineaPig | f32852ecbfa3ebdbba00afc466719fc78e37361c | [
"BSD-2-Clause"
] | 16 | 2018-01-15T03:12:13.000Z | 2022-03-31T04:42:41.000Z | import ctypes
import os
import struct
import numpy as np
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GL.shaders import *
from OpenGL.arrays.arraydatatype import *
from OpenGL.raw.GL.EXT.texture_compression_s3tc import *
from PyEngine3D.Common import logger
dxgi_pixel_or_block_size = [
0,
16, 16, ... | 37.376906 | 160 | 0.626137 | import ctypes
import os
import struct
import numpy as np
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GL.shaders import *
from OpenGL.arrays.arraydatatype import *
from OpenGL.raw.GL.EXT.texture_compression_s3tc import *
from PyEngine3D.Common import logger
dxgi_pixel_or_block_size = [
0,
16, 16, ... | 9,612 | 3,920 | 296 |
281699015f27285cfae3d08e0f3fa877689fa64f | 10,402 | py | Python | vaspy/eigenval.py | arafune/vaspy | 36342eb9b2523fc5c878db5e269e77a51352364c | [
"BSD-3-Clause"
] | 10 | 2018-01-15T10:41:00.000Z | 2021-03-31T05:53:50.000Z | vaspy/eigenval.py | arafune/vaspy | 36342eb9b2523fc5c878db5e269e77a51352364c | [
"BSD-3-Clause"
] | null | null | null | vaspy/eigenval.py | arafune/vaspy | 36342eb9b2523fc5c878db5e269e77a51352364c | [
"BSD-3-Clause"
] | 3 | 2019-08-13T16:34:56.000Z | 2021-06-05T15:39:37.000Z | """This module provides EIGENVAL."""
from __future__ import division, print_function
import csv
import sys
from pathlib import Path
from logging import DEBUG, INFO, Formatter, StreamHandler, getLogger
import numpy as np
from typing import Dict, Optional, Sequence, Tuple, List, IO, Union
from vaspy.tools import open_... | 29.635328 | 88 | 0.538262 | """This module provides EIGENVAL."""
from __future__ import division, print_function
import csv
import sys
from pathlib import Path
from logging import DEBUG, INFO, Formatter, StreamHandler, getLogger
import numpy as np
from typing import Dict, Optional, Sequence, Tuple, List, IO, Union
from vaspy.tools import open_... | 0 | 0 | 0 |
0faaba0738146766d716e2a88ee682f316f0e9b6 | 1,494 | py | Python | python_scripts/twitch.py | LucaKaufmann/HomeAssistant-Config | 3be0ab0a91a2ff188abf1e0a9d0dd4dea7d30d45 | [
"MIT"
] | 6 | 2018-09-10T21:49:43.000Z | 2020-08-16T13:11:07.000Z | python_scripts/twitch.py | LucaKaufmann/HomeAssistant-Config | 3be0ab0a91a2ff188abf1e0a9d0dd4dea7d30d45 | [
"MIT"
] | null | null | null | python_scripts/twitch.py | LucaKaufmann/HomeAssistant-Config | 3be0ab0a91a2ff188abf1e0a9d0dd4dea7d30d45 | [
"MIT"
] | null | null | null | streamInput = data.get('stream_name').lower()
chromecastInput = data.get('media_player')
chromecast = chromecastInput
streams = {
"overwatchleague": "overwatchleague",
"overwatch league": "overwatchleague",
"owl": "overwatchleague",
"lcs": "riotgames",
"ninja": "ninja",
"lupo": "drlupo",
"d... | 29.88 | 151 | 0.672691 | streamInput = data.get('stream_name').lower()
chromecastInput = data.get('media_player')
chromecast = chromecastInput
streams = {
"overwatchleague": "overwatchleague",
"overwatch league": "overwatchleague",
"owl": "overwatchleague",
"lcs": "riotgames",
"ninja": "ninja",
"lupo": "drlupo",
"d... | 0 | 0 | 0 |
b39c43d0021d178a258b637ee9621caf69f2c4a1 | 230 | py | Python | nsot/util/__init__.py | BunkersCo/nsot | fd45bdf63794aa3015a87855f4d7b03663fd5396 | [
"Apache-2.0"
] | null | null | null | nsot/util/__init__.py | BunkersCo/nsot | fd45bdf63794aa3015a87855f4d7b03663fd5396 | [
"Apache-2.0"
] | null | null | null | nsot/util/__init__.py | BunkersCo/nsot | fd45bdf63794aa3015a87855f4d7b03663fd5396 | [
"Apache-2.0"
] | null | null | null | """
Utilities used across the project.
"""
# Core
from . import core
from .core import * # noqa
# Stats
from . import stats
from .stats import * # noqa
__all__ = []
__all__.extend(core.__all__)
__all__.extend(stats.__all__)
| 13.529412 | 34 | 0.695652 | """
Utilities used across the project.
"""
# Core
from . import core
from .core import * # noqa
# Stats
from . import stats
from .stats import * # noqa
__all__ = []
__all__.extend(core.__all__)
__all__.extend(stats.__all__)
| 0 | 0 | 0 |
cedd6d6527b7f694d3fdb56293b13a8778113d04 | 2,582 | py | Python | src/services/prediction_analysis_service.py | DrewStern/election-analysis | 24b3c29146673379745332bc9a7afc87d7a44312 | [
"MIT"
] | null | null | null | src/services/prediction_analysis_service.py | DrewStern/election-analysis | 24b3c29146673379745332bc9a7afc87d7a44312 | [
"MIT"
] | 6 | 2021-06-20T20:28:28.000Z | 2021-07-06T02:21:51.000Z | src/services/prediction_analysis_service.py | DrewStern/election-analysis | 24b3c29146673379745332bc9a7afc87d7a44312 | [
"MIT"
] | null | null | null | from src.data.models.election_event import ElectionEvent
from src.services.election_history_service import ElectionHistoryService
| 62.97561 | 132 | 0.78079 | from src.data.models.election_event import ElectionEvent
from src.services.election_history_service import ElectionHistoryService
class PredictionAnalysisService:
def __init__(self, election_history_service: ElectionHistoryService):
self.election_history_service = election_history_service
self.ele... | 2,256 | 11 | 184 |
33b59a94683e9233731ae17d913d467f1d11a562 | 1,126 | py | Python | day4/concurrency/collateral/network_threads.py | twin-bridges/pyplus-ons | 348ba1cb761a627ef5c6731ef4b99c6fd82ab055 | [
"Apache-2.0"
] | null | null | null | day4/concurrency/collateral/network_threads.py | twin-bridges/pyplus-ons | 348ba1cb761a627ef5c6731ef4b99c6fd82ab055 | [
"Apache-2.0"
] | null | null | null | day4/concurrency/collateral/network_threads.py | twin-bridges/pyplus-ons | 348ba1cb761a627ef5c6731ef4b99c6fd82ab055 | [
"Apache-2.0"
] | 5 | 2019-11-19T18:41:41.000Z | 2020-06-18T14:58:09.000Z | import yaml
from getpass import getpass
from concurrent.futures import ThreadPoolExecutor, wait
from netmiko import ConnectHandler
MAX_WORKERS = 3
if __name__ == "__main__":
main()
| 23.458333 | 56 | 0.634991 | import yaml
from getpass import getpass
from concurrent.futures import ThreadPoolExecutor, wait
from netmiko import ConnectHandler
MAX_WORKERS = 3
def load_devices():
with open("netmiko.yml") as f:
devices = yaml.load(f)
return devices
def ssh_task(device):
print(f"Thread Started: {device['hos... | 865 | 0 | 69 |
02b72c0eef797e7638e1fd1ca6357d3fd7691590 | 2,476 | py | Python | screenpy/questions/text.py | Z-Brueske/screenpy | 1c852a49eb3821727662458fd707b9bcf48bb8cf | [
"MIT"
] | null | null | null | screenpy/questions/text.py | Z-Brueske/screenpy | 1c852a49eb3821727662458fd707b9bcf48bb8cf | [
"MIT"
] | null | null | null | screenpy/questions/text.py | Z-Brueske/screenpy | 1c852a49eb3821727662458fd707b9bcf48bb8cf | [
"MIT"
] | null | null | null | """
A question to discover the text of an element or many elements. Questions
must be asked with an expected resolution, like so:
the_actor.should_see_the(
(Text.of_the(WELCOME_BANNER), ReadsExactly("Welcome!")),
)
"""
from typing import List, Union
from ..actor import Actor
from ..pacing import bea... | 27.820225 | 73 | 0.623586 | """
A question to discover the text of an element or many elements. Questions
must be asked with an expected resolution, like so:
the_actor.should_see_the(
(Text.of_the(WELCOME_BANNER), ReadsExactly("Welcome!")),
)
"""
from typing import List, Union
from ..actor import Actor
from ..pacing import bea... | 99 | 0 | 27 |
1a0cd259979075716eb3c375559753039807ee38 | 289 | py | Python | src/look_and_say.py | chris-kuo/elements_of_programming_interview | 8947980fdf60dfbb577600052b33d37f782216b5 | [
"MIT"
] | null | null | null | src/look_and_say.py | chris-kuo/elements_of_programming_interview | 8947980fdf60dfbb577600052b33d37f782216b5 | [
"MIT"
] | null | null | null | src/look_and_say.py | chris-kuo/elements_of_programming_interview | 8947980fdf60dfbb577600052b33d37f782216b5 | [
"MIT"
] | null | null | null | import itertools
print(look_and_say(8)) | 20.642857 | 78 | 0.678201 | import itertools
def look_and_say(n):
def next_number(nums):
curr = nums[-1]
groups = itertools.groupby(curr)
nums.append(''.join([str(len(list(group))) + key for key, group in groups]))
nums = ['1']
for _ in range(1, n):
next_number(nums)
return nums
print(look_and_say(8)) | 226 | 0 | 23 |
a19e8082e4417ddac2e193306ed2af6ceabeef4b | 3,115 | py | Python | tests/test_xref.py | odidev/fastobo-py | ab593954b448956e7baced876f24ee20230e74f7 | [
"MIT"
] | 20 | 2019-05-10T22:48:42.000Z | 2022-03-27T19:26:50.000Z | tests/test_xref.py | odidev/fastobo-py | ab593954b448956e7baced876f24ee20230e74f7 | [
"MIT"
] | 271 | 2019-05-15T22:05:40.000Z | 2022-03-29T09:54:03.000Z | tests/test_xref.py | odidev/fastobo-py | ab593954b448956e7baced876f24ee20230e74f7 | [
"MIT"
] | 3 | 2020-12-03T21:51:19.000Z | 2021-08-17T06:25:35.000Z | # coding: utf-8
import datetime
import unittest
import fastobo
| 33.494624 | 94 | 0.589406 | # coding: utf-8
import datetime
import unittest
import fastobo
class TestXref(unittest.TestCase):
type = fastobo.xref.Xref
def test_init(self):
id = fastobo.id.PrefixedIdent('ISBN', '0321842685')
try:
xref = self.type(id)
except Exception:
self.fail("could n... | 2,665 | 337 | 46 |
74b1ce6d711d987c051da3de9da3b12c183c4c0f | 607 | py | Python | ex076.py | amandagsilveira/Exercicios_cursoemvideo_Python | 9055d24d44d8e195df1691767a635b0b54357672 | [
"MIT"
] | null | null | null | ex076.py | amandagsilveira/Exercicios_cursoemvideo_Python | 9055d24d44d8e195df1691767a635b0b54357672 | [
"MIT"
] | null | null | null | ex076.py | amandagsilveira/Exercicios_cursoemvideo_Python | 9055d24d44d8e195df1691767a635b0b54357672 | [
"MIT"
] | null | null | null | '''Crie um programa que tenha uma tupla única com nomes de produtos e seus respectivos preços,
na sequência. No final, mostre uma listagem de preços, organizando os dados em forma tabular.'''
lista = ('Lápis', 1.5,
'Borracha', 1.75,
'Caneta', 2.5,
'Corretivo', 3.5,
'estojo', 15.50,
... | 30.35 | 96 | 0.558484 | '''Crie um programa que tenha uma tupla única com nomes de produtos e seus respectivos preços,
na sequência. No final, mostre uma listagem de preços, organizando os dados em forma tabular.'''
lista = ('Lápis', 1.5,
'Borracha', 1.75,
'Caneta', 2.5,
'Corretivo', 3.5,
'estojo', 15.50,
... | 0 | 0 | 0 |
080d826a1bb3c5d99a2ea7d0035597d6138e5aaf | 639 | py | Python | python3/compile.py | abarker/cyfolds | 746ec63074495f875848226a298dd7d148828a53 | [
"MIT"
] | 10 | 2019-09-15T19:11:16.000Z | 2022-03-29T21:14:41.000Z | python3/compile.py | abarker/cyfolds | 746ec63074495f875848226a298dd7d148828a53 | [
"MIT"
] | 2 | 2020-02-02T12:57:32.000Z | 2020-03-16T06:51:27.000Z | python3/compile.py | abarker/cyfolds | 746ec63074495f875848226a298dd7d148828a53 | [
"MIT"
] | 1 | 2020-03-15T05:02:11.000Z | 2020-03-15T05:02:11.000Z | #!/usr/bin/env python3
"""
Run the command to compile cyfolds, optionally removing unneeded files.
Note this command also works (but doesn't set compiler options):
cythonize -a -i cyfolds.pyx
"""
import sys, os
python_executable = sys.executable
compile_command = python_executable + " setup.py build_ext --inpla... | 24.576923 | 71 | 0.682316 | #!/usr/bin/env python3
"""
Run the command to compile cyfolds, optionally removing unneeded files.
Note this command also works (but doesn't set compiler options):
cythonize -a -i cyfolds.pyx
"""
import sys, os
python_executable = sys.executable
compile_command = python_executable + " setup.py build_ext --inpla... | 0 | 0 | 0 |
e6d2c89ba842143106ca9bea8e29e1292c6b780c | 756 | py | Python | accounts/managers.py | MrRezoo/django-online-shop | 2b0044ed41fe1b89c5fd2c2ea73822c6f43b5f6e | [
"MIT"
] | 1 | 2021-09-14T14:54:16.000Z | 2021-09-14T14:54:16.000Z | accounts/managers.py | MrRezoo/django-online-shop | 2b0044ed41fe1b89c5fd2c2ea73822c6f43b5f6e | [
"MIT"
] | 1 | 2022-01-18T07:20:57.000Z | 2022-01-18T07:20:57.000Z | accounts/managers.py | MrRezoo/django-online-shop | 2b0044ed41fe1b89c5fd2c2ea73822c6f43b5f6e | [
"MIT"
] | null | null | null | from django.contrib.auth.models import BaseUserManager
| 36 | 108 | 0.687831 | from django.contrib.auth.models import BaseUserManager
class MyUserManager(BaseUserManager):
def create_user(self, email, full_name, phone_number, password):
if not email:
raise ValueError('users must have Email')
if not full_name:
raise ValueError('users must have Full Nam... | 608 | 16 | 76 |
578be65cd859287fa3d8164435441b5bfe8dbcd2 | 1,827 | py | Python | packages/cal3d/package.py | hlrs-vis/spack-hlrs-vis | 33c07e362e2b8f3a69dd255a5626cca49c08a29b | [
"ECL-2.0",
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 1 | 2021-08-03T14:14:17.000Z | 2021-08-03T14:14:17.000Z | packages/cal3d/package.py | hlrs-vis/spack-hlrs-vis | 33c07e362e2b8f3a69dd255a5626cca49c08a29b | [
"ECL-2.0",
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | null | null | null | packages/cal3d/package.py | hlrs-vis/spack-hlrs-vis | 33c07e362e2b8f3a69dd255a5626cca49c08a29b | [
"ECL-2.0",
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | null | null | null | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Cal3d(AutotoolsPackage):
"""Skeletal 3D character animation library written in C++"""
... | 33.218182 | 119 | 0.657909 | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Cal3d(AutotoolsPackage):
"""Skeletal 3D character animation library written in C++"""
... | 280 | 0 | 27 |
2b1831ad832f78ebe79cb52d348571395d855bbd | 5,673 | py | Python | old-metadata/explode.py | eliagbayani/local_reference_taxonomy | 5bdb2c6e3b5b158bee72a9eade64a595d1e595fb | [
"BSD-2-Clause"
] | 8 | 2017-05-20T07:53:09.000Z | 2021-08-16T03:30:59.000Z | old-metadata/explode.py | eliagbayani/local_reference_taxonomy | 5bdb2c6e3b5b158bee72a9eade64a595d1e595fb | [
"BSD-2-Clause"
] | 257 | 2015-01-11T12:05:12.000Z | 2021-11-04T17:26:02.000Z | old-metadata/explode.py | eliagbayani/local_reference_taxonomy | 5bdb2c6e3b5b158bee72a9eade64a595d1e595fb | [
"BSD-2-Clause"
] | 4 | 2015-10-23T13:45:23.000Z | 2021-03-12T17:28:53.000Z | # This script is responsible for changing the older metadata format
# (files resources.json and captures.json stored in the resources/
# directory) to the newer format (a properties.json file stored with
# every artifact archive).
import json, os, subprocess, argparse
res = {}
cap = {}
# Read old resources and captu... | 32.791908 | 93 | 0.56813 | # This script is responsible for changing the older metadata format
# (files resources.json and captures.json stored in the resources/
# directory) to the newer format (a properties.json file stored with
# every artifact archive).
import json, os, subprocess, argparse
res = {}
cap = {}
# Read old resources and captu... | 4,431 | 0 | 137 |
6982dce8eae0fd2fb4bd13abe2c0d3b758323c34 | 9,920 | py | Python | examples/e3sm_diags_for_cmip/cmip6_comparison.py | ACME-Climate/acme_diags | f0ba7f24167301c7b92061dacbf2e2b0fe7f334f | [
"BSD-3-Clause"
] | 3 | 2017-07-12T23:19:15.000Z | 2018-01-02T22:49:17.000Z | examples/e3sm_diags_for_cmip/cmip6_comparison.py | ACME-Climate/acme_diags | f0ba7f24167301c7b92061dacbf2e2b0fe7f334f | [
"BSD-3-Clause"
] | 109 | 2017-07-07T18:51:07.000Z | 2018-04-17T04:16:31.000Z | examples/e3sm_diags_for_cmip/cmip6_comparison.py | ACME-Climate/acme_diags | f0ba7f24167301c7b92061dacbf2e2b0fe7f334f | [
"BSD-3-Clause"
] | 3 | 2017-07-03T23:30:29.000Z | 2018-01-02T19:34:12.000Z | # Script to perform comparison with CMIP6 models
# On NERSC
"""
source /global/common/software/e3sm/anaconda_envs/load_latest_e3sm_unified_cori-haswell.sh
"""
import glob
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
import matplotlib.transforms as mtransforms
import numpy as np
import numpy.ma as ... | 33.066667 | 148 | 0.64375 | # Script to perform comparison with CMIP6 models
# On NERSC
"""
source /global/common/software/e3sm/anaconda_envs/load_latest_e3sm_unified_cori-haswell.sh
"""
import glob
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
import matplotlib.transforms as mtransforms
import numpy as np
import numpy.ma as ... | 2,834 | 0 | 44 |
3489f6a2e3a4409adc639b2b529e4829846e7660 | 893 | py | Python | train/exemplar_strategies/herding.py | srvCodes/continual-learning-benchmark | faa074bd241a5929ca1d5ae185f67e62945b6180 | [
"MIT"
] | 40 | 2020-08-28T10:47:12.000Z | 2022-03-25T02:02:38.000Z | train/exemplar_strategies/herding.py | srvCodes/continual-learning-benchmark | faa074bd241a5929ca1d5ae185f67e62945b6180 | [
"MIT"
] | 1 | 2020-08-01T15:18:39.000Z | 2020-08-01T15:18:39.000Z | train/exemplar_strategies/herding.py | srvCodes/continual-learning-benchmark | faa074bd241a5929ca1d5ae185f67e62945b6180 | [
"MIT"
] | 8 | 2020-08-01T16:55:35.000Z | 2022-03-21T06:05:17.000Z | import numpy as np
def herding_selection(x, m, mean_=None):
"""
Source: https://github.com/PatrickZH/End-to-End-Incremental-Learning/blob/39d6f4e594e805a713aa7a1deedbcb03d1f2c9cc/utils.py#L176
Parameters
----------
x: the features, n * dimension
m: the number of selected exe... | 29.766667 | 136 | 0.538634 | import numpy as np
def herding_selection(x, m, mean_=None):
"""
Source: https://github.com/PatrickZH/End-to-End-Incremental-Learning/blob/39d6f4e594e805a713aa7a1deedbcb03d1f2c9cc/utils.py#L176
Parameters
----------
x: the features, n * dimension
m: the number of selected exe... | 0 | 0 | 0 |
36cf65e98908555cb1d2cdf5aa8d088a0773bb29 | 2,023 | py | Python | witchcraft/connection.py | trackingwire/witchcraft | 58fa9dc20383e04ed5dc53d64f3d0744cbda7683 | [
"MIT"
] | null | null | null | witchcraft/connection.py | trackingwire/witchcraft | 58fa9dc20383e04ed5dc53d64f3d0744cbda7683 | [
"MIT"
] | null | null | null | witchcraft/connection.py | trackingwire/witchcraft | 58fa9dc20383e04ed5dc53d64f3d0744cbda7683 | [
"MIT"
] | null | null | null | import sqlalchemy
| 26.618421 | 79 | 0.547207 | import sqlalchemy
class Connection(object):
def __init__(self, auth):
url = self._build_url(auth)
self.engine = sqlalchemy.create_engine(url, convert_unicode=True)
self.connection = None
self.transaction = None
def connect(self):
self.connection = self.engine.conn... | 1,756 | 4 | 243 |
3d446d66401b69aa86264b9c5f0739148f4c66fb | 11,854 | py | Python | yt_dlp/extractor/netdna.py | atgarcia78/yt-dlp | 70e59f1456b244e549bcd9f39744c70fb53b6cbb | [
"Unlicense"
] | null | null | null | yt_dlp/extractor/netdna.py | atgarcia78/yt-dlp | 70e59f1456b244e549bcd9f39744c70fb53b6cbb | [
"Unlicense"
] | null | null | null | yt_dlp/extractor/netdna.py | atgarcia78/yt-dlp | 70e59f1456b244e549bcd9f39744c70fb53b6cbb | [
"Unlicense"
] | 1 | 2022-03-25T21:51:45.000Z | 2022-03-25T21:51:45.000Z | # coding: utf-8
from __future__ import unicode_literals
import re
from .commonwebdriver import SeleniumInfoExtractor
from ..utils import (
ExtractorError,
sanitize_filename,
)
import hashlib
import sys
import traceback
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver... | 42.949275 | 164 | 0.450734 | # coding: utf-8
from __future__ import unicode_literals
import re
from .commonwebdriver import SeleniumInfoExtractor
from ..utils import (
ExtractorError,
sanitize_filename,
)
import hashlib
import sys
import traceback
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver... | 10,485 | 813 | 77 |
f30808e6e08cddc4f2175de816503590fcd89759 | 432 | py | Python | 08-classes/class_with_behaviour.py | johnehunt/PythonIntroDS | 7e9d5c5494191cd68bc71e140df5fb30290a8da6 | [
"Apache-2.0"
] | 1 | 2021-09-20T11:22:47.000Z | 2021-09-20T11:22:47.000Z | 08-classes/class_with_behaviour.py | johnehunt/PythonIntroDS | 7e9d5c5494191cd68bc71e140df5fb30290a8da6 | [
"Apache-2.0"
] | null | null | null | 08-classes/class_with_behaviour.py | johnehunt/PythonIntroDS | 7e9d5c5494191cd68bc71e140df5fb30290a8da6 | [
"Apache-2.0"
] | null | null | null | # Definition of a class with some basic behaviour
class Person:
""" An example class to hold a persons name and age"""
p3 = Person('Adam', 21)
print(p3)
p3.birthday()
print(p3)
| 18.782609 | 55 | 0.664352 | # Definition of a class with some basic behaviour
class Person:
""" An example class to hold a persons name and age"""
def __init__(self, name, age):
self.name = name
self.age = age
def __str__(self):
return self.name + ' is ' + str(self.age)
def birthday(self):
print ('Happy birthday you were', self.ag... | 179 | 0 | 72 |
78517c7a97c5595be7ebc2e8680a88b70f222293 | 8,050 | py | Python | compose/model.py | katetolstaya/kernelrl | 963d72a4912faffeaab2627f16e6c103a7678fc4 | [
"MIT"
] | null | null | null | compose/model.py | katetolstaya/kernelrl | 963d72a4912faffeaab2627f16e6c103a7678fc4 | [
"MIT"
] | null | null | null | compose/model.py | katetolstaya/kernelrl | 963d72a4912faffeaab2627f16e6c103a7678fc4 | [
"MIT"
] | null | null | null | import copy, json, random
import numpy as np
from corerl.core import ScheduledParameter
from corerl.function import KernelRepresentation
import pdb
import pickle
import csv
import matplotlib.pyplot as plt
from enum import Enum
try:
from configparser import ConfigParser
except ImportError:
from ConfigParser imp... | 37.268519 | 152 | 0.514658 | import copy, json, random
import numpy as np
from corerl.core import ScheduledParameter
from corerl.function import KernelRepresentation
import pdb
import pickle
import csv
import matplotlib.pyplot as plt
from enum import Enum
try:
from configparser import ConfigParser
except ImportError:
from ConfigParser imp... | 6,762 | 470 | 467 |
1ccd509736b730bad48cf395742dfd23ec7d2d55 | 5,178 | py | Python | python_prototype/inc.py | kamranshamaei/tarsim | dcb0f28f7b1422ba125c85cd53a1420d69d466eb | [
"Apache-2.0"
] | 22 | 2019-03-01T01:41:53.000Z | 2022-02-28T03:57:40.000Z | python_prototype/inc.py | kamranshamaei/tarsim | dcb0f28f7b1422ba125c85cd53a1420d69d466eb | [
"Apache-2.0"
] | 5 | 2020-01-08T19:21:48.000Z | 2021-07-15T20:39:17.000Z | python_prototype/inc.py | kamranshamaei/tarsim | dcb0f28f7b1422ba125c85cd53a1420d69d466eb | [
"Apache-2.0"
] | 7 | 2019-03-01T02:59:11.000Z | 2022-02-17T14:08:11.000Z | """"@package config
Contains all config files necessary for simulator
Rignumber body configuration data
"""
import copy
import time
import inspect
from config.protobuf import *
import math
IS_ACCURATE_TIMER = False
U_X = np.array([1, 0, 0])
U_Y = np.array([0, 1, 0])
U_Z = np.array([0, 0, 1])
| 36.985714 | 103 | 0.614716 | """"@package config
Contains all config files necessary for simulator
Rignumber body configuration data
"""
import copy
import time
import inspect
from config.protobuf import *
import math
def set_inter_thread_data(new_data, data, data_lock):
data_lock.acquire()
if len(new_data) is len(data):
for i i... | 4,615 | -11 | 267 |
28957ed5554cd5923f9eb74785fe166a20979eb6 | 1,597 | py | Python | mtp_noms_ops/apps/security/constants.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-noms-ops | eb537fb8a8e3adc588d50af1b000402c957b32a7 | [
"MIT"
] | null | null | null | mtp_noms_ops/apps/security/constants.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-noms-ops | eb537fb8a8e3adc588d50af1b000402c957b32a7 | [
"MIT"
] | null | null | null | mtp_noms_ops/apps/security/constants.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-noms-ops | eb537fb8a8e3adc588d50af1b000402c957b32a7 | [
"MIT"
] | null | null | null | from django.utils.translation import gettext_lazy as _
CHECK_REJECTION_CATEGORY_TEXT_MAPPING = {
'fiu_investigation_id': _('Associated FIU investigation'),
'intelligence_report_id': _('Associated intelligence report (IR)'),
'other_reason': _('Other reason'),
}
CHECK_REJECTION_CATEGORY_BOOLEAN_MAPPING = {
... | 45.628571 | 118 | 0.786475 | from django.utils.translation import gettext_lazy as _
CHECK_REJECTION_CATEGORY_TEXT_MAPPING = {
'fiu_investigation_id': _('Associated FIU investigation'),
'intelligence_report_id': _('Associated intelligence report (IR)'),
'other_reason': _('Other reason'),
}
CHECK_REJECTION_CATEGORY_BOOLEAN_MAPPING = {
... | 0 | 0 | 0 |
c7a38210aaeed7cc0418ae9c6abb65464e467600 | 5,376 | py | Python | 2017/19_a_series_of_tubes.py | pchudzik/adventofcode | e1d6521621f6ca90f9dc53cf3d1ed5b8c5c2b7d1 | [
"MIT"
] | null | null | null | 2017/19_a_series_of_tubes.py | pchudzik/adventofcode | e1d6521621f6ca90f9dc53cf3d1ed5b8c5c2b7d1 | [
"MIT"
] | null | null | null | 2017/19_a_series_of_tubes.py | pchudzik/adventofcode | e1d6521621f6ca90f9dc53cf3d1ed5b8c5c2b7d1 | [
"MIT"
] | null | null | null | """
--- Day 19: A Series of Tubes ---
Somehow, a network packet got lost and ended up here. It's trying to follow a routing diagram (your puzzle input), but
it's confused about where to go.
Its starting point is just off the top of the diagram. Lines (drawn with |, -, and +) show the path it needs to take,
starting b... | 29.701657 | 120 | 0.641927 | """
--- Day 19: A Series of Tubes ---
Somehow, a network packet got lost and ended up here. It's trying to follow a routing diagram (your puzzle input), but
it's confused about where to go.
Its starting point is just off the top of the diagram. Lines (drawn with |, -, and +) show the path it needs to take,
starting b... | 2,519 | 0 | 207 |
67a27f2d48c56fdc3fbbeca6de33ee4fba108e63 | 701 | py | Python | tsl/__init__.py | TorchSpatiotemporal/tsl | da13493b0cf83826bf41fe78a67e8d4ce1d7a8a0 | [
"MIT"
] | 4 | 2022-03-21T09:16:33.000Z | 2022-03-30T12:24:30.000Z | tsl/__init__.py | TorchSpatiotemporal/tsl | da13493b0cf83826bf41fe78a67e8d4ce1d7a8a0 | [
"MIT"
] | null | null | null | tsl/__init__.py | TorchSpatiotemporal/tsl | da13493b0cf83826bf41fe78a67e8d4ce1d7a8a0 | [
"MIT"
] | null | null | null | import os
import tsl.global_scope
from tsl.global_scope import *
data = LazyLoader('data', globals(), 'tsl.data')
datasets = LazyLoader('datasets', globals(), 'tsl.datasets')
nn = LazyLoader('nn', globals(), 'tsl.nn')
predictors = LazyLoader('predictors', globals(), 'tsl.predictors')
imputers = LazyLoader('imputers',... | 21.242424 | 66 | 0.663338 | import os
import tsl.global_scope
from tsl.global_scope import *
data = LazyLoader('data', globals(), 'tsl.data')
datasets = LazyLoader('datasets', globals(), 'tsl.datasets')
nn = LazyLoader('nn', globals(), 'tsl.nn')
predictors = LazyLoader('predictors', globals(), 'tsl.predictors')
imputers = LazyLoader('imputers',... | 0 | 0 | 0 |
f5f10f3f42d6eb4924884b44cfea70bd48335be4 | 8,643 | py | Python | src/elarian/utils/helpers.py | ElarianLtd/python-sdk | f603688dffba4b46c5a9f208a75b3dc3d75ed565 | [
"MIT"
] | 4 | 2021-05-27T23:15:21.000Z | 2021-12-29T11:40:02.000Z | src/elarian/utils/helpers.py | ElarianLtd/python-sdk | f603688dffba4b46c5a9f208a75b3dc3d75ed565 | [
"MIT"
] | 2 | 2021-05-20T05:51:02.000Z | 2021-07-13T11:25:54.000Z | src/elarian/utils/helpers.py | ElarianLtd/python-sdk | f603688dffba4b46c5a9f208a75b3dc3d75ed565 | [
"MIT"
] | null | null | null | from .generated.common_model_pb2 import (
CustomerNumber,
MediaType,
)
from .generated.messaging_model_pb2 import (
OutboundMessage,
VoiceCallAction,
RecordSessionCallAction,
RejectCallAction,
PromptMessageReplyAction,
PromptMessageMenuItemBody,
TextToSpeechVoice,
MessagingChanne... | 43.432161 | 112 | 0.586023 | from .generated.common_model_pb2 import (
CustomerNumber,
MediaType,
)
from .generated.messaging_model_pb2 import (
OutboundMessage,
VoiceCallAction,
RecordSessionCallAction,
RejectCallAction,
PromptMessageReplyAction,
PromptMessageMenuItemBody,
TextToSpeechVoice,
MessagingChanne... | 7,470 | 0 | 46 |
0a90fedf85ef7d2f156a5e61bf7b8f36d7e04b7f | 13,977 | py | Python | mindarmour/natural_robustness/transform/image/transformation.py | hboshnak/mindarmour | 0609a4eaea875a84667bed279add9305752880cc | [
"Apache-2.0"
] | null | null | null | mindarmour/natural_robustness/transform/image/transformation.py | hboshnak/mindarmour | 0609a4eaea875a84667bed279add9305752880cc | [
"Apache-2.0"
] | null | null | null | mindarmour/natural_robustness/transform/image/transformation.py | hboshnak/mindarmour | 0609a4eaea875a84667bed279add9305752880cc | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 38.188525 | 119 | 0.595407 | # Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 3,522 | 0 | 216 |
c2b061571641b102a28a466a27cccb90ff2a8f36 | 4,847 | py | Python | tests/fugue/workflow/test_workflow.py | WangCHX/fugue | bb9758d23b0041d4ed00f6195f317d097a9dd683 | [
"Apache-2.0"
] | null | null | null | tests/fugue/workflow/test_workflow.py | WangCHX/fugue | bb9758d23b0041d4ed00f6195f317d097a9dd683 | [
"Apache-2.0"
] | null | null | null | tests/fugue/workflow/test_workflow.py | WangCHX/fugue | bb9758d23b0041d4ed00f6195f317d097a9dd683 | [
"Apache-2.0"
] | null | null | null | import copy
from random import randint, seed
from typing import Any, Dict, Iterable, List
from adagio.instances import WorkflowContext, WorkflowResultCache
from fugue.collections.partition import PartitionSpec
from fugue.dataframe import DataFrame
from fugue.dataframe.array_dataframe import ArrayDataFrame
from fugue.d... | 30.872611 | 86 | 0.632763 | import copy
from random import randint, seed
from typing import Any, Dict, Iterable, List
from adagio.instances import WorkflowContext, WorkflowResultCache
from fugue.collections.partition import PartitionSpec
from fugue.dataframe import DataFrame
from fugue.dataframe.array_dataframe import ArrayDataFrame
from fugue.d... | 3,650 | 16 | 266 |
c6ccf5e371d3bf7c6aebf63a67c96884ff07f5b2 | 38,850 | py | Python | src/lib/detectors/base_detector.py | hz-ants/CenterPose- | a92d93b09660e266a43533a0dc722445873829ea | [
"BSD-Source-Code"
] | 96 | 2021-11-17T20:19:20.000Z | 2022-03-23T07:12:06.000Z | src/lib/detectors/base_detector.py | hz-ants/CenterPose- | a92d93b09660e266a43533a0dc722445873829ea | [
"BSD-Source-Code"
] | 2 | 2022-01-04T11:16:27.000Z | 2022-01-06T05:33:58.000Z | src/lib/detectors/base_detector.py | hz-ants/CenterPose- | a92d93b09660e266a43533a0dc722445873829ea | [
"BSD-Source-Code"
] | 13 | 2021-11-17T21:29:42.000Z | 2022-03-04T22:47:38.000Z | # Copyright (c) 2021 NVIDIA Corporation. All rights reserved.
# This work is licensed under the NVIDIA Source Code License - Non-commercial.
# Full text can be found in LICENSE.md
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cv2
import copy
import... | 50 | 123 | 0.486512 | # Copyright (c) 2021 NVIDIA Corporation. All rights reserved.
# This work is licensed under the NVIDIA Source Code License - Non-commercial.
# Full text can be found in LICENSE.md
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cv2
import copy
import... | 19,339 | 18,648 | 23 |
774c23c9071d54311613c8b17c76c40bdf103116 | 13,583 | py | Python | pyEpiabm/pyEpiabm/sweep/host_progression_sweep.py | SABS-R3-Epidemiology/epiabm | 8eb83fd2de84104f6f77929e3771095f7b033ddc | [
"BSD-3-Clause"
] | 11 | 2021-12-02T15:24:02.000Z | 2022-03-10T14:02:13.000Z | pyEpiabm/pyEpiabm/sweep/host_progression_sweep.py | SABS-R3-Epidemiology/epiabm | 8eb83fd2de84104f6f77929e3771095f7b033ddc | [
"BSD-3-Clause"
] | 119 | 2021-11-24T13:56:48.000Z | 2022-03-30T11:52:07.000Z | pyEpiabm/pyEpiabm/sweep/host_progression_sweep.py | SABS-R3-Epidemiology/epiabm | 8eb83fd2de84104f6f77929e3771095f7b033ddc | [
"BSD-3-Clause"
] | 3 | 2022-01-13T03:05:19.000Z | 2022-03-11T22:00:17.000Z | #
# Progression of infection within individuals
#
import random
import numpy as np
from collections import defaultdict
import pyEpiabm as pe
from pyEpiabm.core import Parameters, Person
from pyEpiabm.property import InfectionStatus
from pyEpiabm.utility import StateTransitionMatrix, TransitionTimeMatrix
from .abstra... | 47 | 79 | 0.638445 | #
# Progression of infection within individuals
#
import random
import numpy as np
from collections import defaultdict
import pyEpiabm as pe
from pyEpiabm.core import Parameters, Person
from pyEpiabm.property import InfectionStatus
from pyEpiabm.utility import StateTransitionMatrix, TransitionTimeMatrix
from .abstra... | 0 | 0 | 0 |
2bc5bc50e13deb69a93ba1bf4f7acdaadbf960d0 | 172 | py | Python | Unit 3/3.5/3.5.8 Rectangle Pt3.py | shashwat73/cse | 60e49307e57105cf9916c7329f53f891c5e81fdb | [
"MIT"
] | 1 | 2021-04-08T14:02:49.000Z | 2021-04-08T14:02:49.000Z | Unit 3/3.5/3.5.8 Rectangle Pt3.py | shashwat73/cse | 60e49307e57105cf9916c7329f53f891c5e81fdb | [
"MIT"
] | null | null | null | Unit 3/3.5/3.5.8 Rectangle Pt3.py | shashwat73/cse | 60e49307e57105cf9916c7329f53f891c5e81fdb | [
"MIT"
] | null | null | null | length = int(input("Do"))
width = int(input("Doer"))
area = length*width
perimeter = 2* (length+width)
print "Area: " + str(area)
print "Perimeter:" + str(perimeter)
| 24.571429 | 36 | 0.645349 | length = int(input("Do"))
width = int(input("Doer"))
area = length*width
perimeter = 2* (length+width)
print "Area: " + str(area)
print "Perimeter:" + str(perimeter)
| 0 | 0 | 0 |
9b6bfbc5066ef87b9ffc1d37e6b8b4a721e1ff59 | 556 | py | Python | telemetry/telemetry/benchmark_runner.py | brave-experiments/catapult | 0d8246fe06fb598577f2344efcbc4b4e5b3aa323 | [
"BSD-3-Clause"
] | null | null | null | telemetry/telemetry/benchmark_runner.py | brave-experiments/catapult | 0d8246fe06fb598577f2344efcbc4b4e5b3aa323 | [
"BSD-3-Clause"
] | 1 | 2022-03-02T13:24:12.000Z | 2022-03-02T13:24:12.000Z | telemetry/telemetry/benchmark_runner.py | brave-experiments/catapult | 0d8246fe06fb598577f2344efcbc4b4e5b3aa323 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Parses the command line, discovers the appropriate benchmarks, and runs them.
Handles benchmark configuration, but all the logic for
actually running the ... | 37.066667 | 80 | 0.794964 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Parses the command line, discovers the appropriate benchmarks, and runs them.
Handles benchmark configuration, but all the logic for
actually running the ... | 0 | 0 | 0 |
dc0e2c117180508edd3b69dc989126477e2b53ea | 3,077 | py | Python | processor/utils/anchor_generator_builder.py | laobadao/TF_VS_Caffe | 943b47daefa42f07db285a331647d09669085f9f | [
"MIT"
] | null | null | null | processor/utils/anchor_generator_builder.py | laobadao/TF_VS_Caffe | 943b47daefa42f07db285a331647d09669085f9f | [
"MIT"
] | null | null | null | processor/utils/anchor_generator_builder.py | laobadao/TF_VS_Caffe | 943b47daefa42f07db285a331647d09669085f9f | [
"MIT"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 32.734043 | 80 | 0.61586 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 0 | 0 | 0 |
c3687aae935ca5d0854c37a44135d3eea1093c4e | 3,766 | py | Python | mcsniperpy/util/offset_calculator.py | tropicbliss/MCsniperPY | ad0337fb10f90e18b5a648a150c2179d12048522 | [
"MIT"
] | 1 | 2021-08-15T13:04:49.000Z | 2021-08-15T13:04:49.000Z | mcsniperpy/util/offset_calculator.py | coolkidmacho/MCsniperPY | 6f404a3e664d34ae4b1f6ebae96213adbbd0c09d | [
"MIT"
] | null | null | null | mcsniperpy/util/offset_calculator.py | coolkidmacho/MCsniperPY | 6f404a3e664d34ae4b1f6ebae96213adbbd0c09d | [
"MIT"
] | 1 | 2021-09-04T13:58:37.000Z | 2021-09-04T13:58:37.000Z | import asyncio
import math
import time
from statistics import mean
import aiohttp
from mcsniperpy.util import request_manager
from mcsniperpy.util import utils as util
from mcsniperpy.util.logs_manager import Color as color
from mcsniperpy.util.logs_manager import Logger as log
| 31.123967 | 89 | 0.572756 | import asyncio
import math
import time
from statistics import mean
import aiohttp
from mcsniperpy.util import request_manager
from mcsniperpy.util import utils as util
from mcsniperpy.util.logs_manager import Color as color
from mcsniperpy.util.logs_manager import Logger as log
class OffsetCalculator:
def __init... | 3,353 | 2 | 130 |
f0e49787dd63e951ab1ffa7166e70b92aef62474 | 2,106 | py | Python | src/waldur_slurm/migrations/0003_allocationusage.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 26 | 2017-10-18T13:49:58.000Z | 2021-09-19T04:44:09.000Z | src/waldur_slurm/migrations/0003_allocationusage.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 14 | 2018-12-10T14:14:51.000Z | 2021-06-07T10:33:39.000Z | src/waldur_slurm/migrations/0003_allocationusage.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 32 | 2017-09-24T03:10:45.000Z | 2021-10-16T16:41:09.000Z | # Generated by Django 1.11.1 on 2017-10-16 15:16
import django.core.validators
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
| 33.967742 | 73 | 0.441595 | # Generated by Django 1.11.1 on 2017-10-16 15:16
import django.core.validators
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | 0 | 1,896 | 23 |
9ec68c35470453c120f08bcd5fe13d3711408435 | 325 | py | Python | site_scons/site_tools/xcode.py | danx0r/mongo | 70d4944c235bcdf7fbbc63971099563d2af72956 | [
"Apache-2.0"
] | 72 | 2020-06-12T06:33:41.000Z | 2021-03-22T03:15:56.000Z | site_scons/site_tools/xcode.py | danx0r/mongo | 70d4944c235bcdf7fbbc63971099563d2af72956 | [
"Apache-2.0"
] | 9 | 2020-07-02T09:36:49.000Z | 2021-03-25T23:54:00.000Z | site_scons/site_tools/xcode.py | danx0r/mongo | 70d4944c235bcdf7fbbc63971099563d2af72956 | [
"Apache-2.0"
] | 14 | 2020-06-12T03:08:03.000Z | 2021-02-03T11:43:09.000Z | import os
| 25 | 101 | 0.676923 | import os
def exists(env):
return env.Detect('xcrun')
def generate(env):
if not exists(env):
return
if 'DEVELOPER_DIR' in os.environ:
env['ENV']['DEVELOPER_DIR'] = os.environ['DEVELOPER_DIR']
print "NOTE: Xcode detected; propagating DEVELOPER_DIR from shell environment to subcomma... | 269 | 0 | 46 |
4ec71318987d768d39dee6432be0dc3482308e0e | 107 | py | Python | auth/__init__.py | Stickyamp11/easyfruitApi | a5ab56d53866e8e592e2dd6730b82dca1cdeacfa | [
"MIT"
] | null | null | null | auth/__init__.py | Stickyamp11/easyfruitApi | a5ab56d53866e8e592e2dd6730b82dca1cdeacfa | [
"MIT"
] | null | null | null | auth/__init__.py | Stickyamp11/easyfruitApi | a5ab56d53866e8e592e2dd6730b82dca1cdeacfa | [
"MIT"
] | null | null | null | from flask import Blueprint
auth = Blueprint('auth', __name__, url_prefix='/auth')
from . import rest-api
| 21.4 | 54 | 0.747664 | from flask import Blueprint
auth = Blueprint('auth', __name__, url_prefix='/auth')
from . import rest-api
| 0 | 0 | 0 |
2bfc7ea0a884bf177b80413224d1b790c01aaf23 | 1,453 | py | Python | Excel/experiments/openpyxl-exprt.py | 2amitprakash/Python_Codes | c7e915c0da87fb7438777be5945f81d4126fea42 | [
"MIT"
] | null | null | null | Excel/experiments/openpyxl-exprt.py | 2amitprakash/Python_Codes | c7e915c0da87fb7438777be5945f81d4126fea42 | [
"MIT"
] | null | null | null | Excel/experiments/openpyxl-exprt.py | 2amitprakash/Python_Codes | c7e915c0da87fb7438777be5945f81d4126fea42 | [
"MIT"
] | null | null | null | from openpyxl import Workbook
from openpyxl import load_workbook
# Import necessary style classes
from openpyxl.styles import Font, Color, Alignment, Border, Side, colors
wb = Workbook()
# grab the active worksheet
ws = wb.active
# Data can be assigned directly to cells
ws['A1'] = 42
# Rows can also... | 29.06 | 73 | 0.690984 | from openpyxl import Workbook
from openpyxl import load_workbook
# Import necessary style classes
from openpyxl.styles import Font, Color, Alignment, Border, Side, colors
wb = Workbook()
# grab the active worksheet
ws = wb.active
# Data can be assigned directly to cells
ws['A1'] = 42
# Rows can also... | 0 | 0 | 0 |
e782629c0fa79a5a86edb99cc20c6f7250375b97 | 3,409 | py | Python | src/benchsuite/core/model/provider.py | benchmarking-suite/benchmarking-common | 97a075cc353e5237d0f1507d339a49e8c8afe9ac | [
"Apache-2.0"
] | 1 | 2018-07-05T09:15:54.000Z | 2018-07-05T09:15:54.000Z | src/benchsuite/core/model/provider.py | benchmarking-suite/benchmarking-common | 97a075cc353e5237d0f1507d339a49e8c8afe9ac | [
"Apache-2.0"
] | 1 | 2018-06-06T09:00:17.000Z | 2018-06-06T09:00:17.000Z | src/benchsuite/core/model/provider.py | benchmarking-suite/benchsuite-core | 97a075cc353e5237d0f1507d339a49e8c8afe9ac | [
"Apache-2.0"
] | null | null | null | # Benchmarking Suite
# Copyright 2014-2017 Engineering Ingegneria Informatica S.p.A.
#
# 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 ... | 33.097087 | 129 | 0.727779 | # Benchmarking Suite
# Copyright 2014-2017 Engineering Ingegneria Informatica S.p.A.
#
# 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 ... | 1,919 | 366 | 92 |
95fb25b7119ba5651617aa8abf9f611fc2231876 | 1,565 | py | Python | src/Sephrasto/Objekte.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | 15 | 2017-11-09T12:49:52.000Z | 2022-03-06T12:18:48.000Z | src/Sephrasto/Objekte.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | 40 | 2018-02-01T21:32:01.000Z | 2022-03-22T11:35:28.000Z | src/Sephrasto/Objekte.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | 13 | 2018-03-12T17:50:42.000Z | 2022-03-06T12:21:41.000Z | '''
In dieser Datei werden Waffen und Rüstungen definiert.
''' | 24.453125 | 58 | 0.553994 | '''
In dieser Datei werden Waffen und Rüstungen definiert.
'''
class Objekt():
def __init__(self):
self.name = ''
self.text = ''
self.isUserAdded = True
def __eq__(self, other) :
if self.__class__ != other.__class__: return False
return self.__dict__ == other.__dict__
... | 1,075 | 13 | 415 |
5422ea5c8be30c75b18ea55f1820135ad38c8e25 | 2,496 | py | Python | neutron_lbaas/agent/agent_device_driver.py | 2020human/neutron-lbaas | c5acb45ff6a8c2c41b84bdb2406450731491cad8 | [
"Apache-2.0"
] | null | null | null | neutron_lbaas/agent/agent_device_driver.py | 2020human/neutron-lbaas | c5acb45ff6a8c2c41b84bdb2406450731491cad8 | [
"Apache-2.0"
] | null | null | null | neutron_lbaas/agent/agent_device_driver.py | 2020human/neutron-lbaas | c5acb45ff6a8c2c41b84bdb2406450731491cad8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 OpenStack Foundation. All rights reserved
# Copyright 2015 Rackspace
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICE... | 22.899083 | 78 | 0.685497 | # Copyright 2013 OpenStack Foundation. All rights reserved
# Copyright 2015 Rackspace
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICE... | 359 | 365 | 321 |
d92c641f3a9e1f71efb7801019ea8bb6113d0c68 | 1,626 | py | Python | main.py | carlfarterson/LTC_signal | e6f66dc292bacb8eb3bbf1a09138c9204a29431d | [
"MIT"
] | 1 | 2021-04-10T10:52:16.000Z | 2021-04-10T10:52:16.000Z | main.py | carlfarterson/LTC_signal | e6f66dc292bacb8eb3bbf1a09138c9204a29431d | [
"MIT"
] | null | null | null | main.py | carlfarterson/LTC_signal | e6f66dc292bacb8eb3bbf1a09138c9204a29431d | [
"MIT"
] | 3 | 2020-04-28T17:44:50.000Z | 2021-04-10T10:52:09.000Z | import ccxt
import pandas as pd
from itertools import combinations
from twilio.rest import Client
from api import *
avg_pairs = list(combinations(averages, 2))
message = ''
for coin in coins:
ticker, data = fetch_data(coin)
df = pd.DataFrame(
columns=['timestamp','open', 'high', 'low', 'close', 'vol... | 27.1 | 75 | 0.597171 | import ccxt
import pandas as pd
from itertools import combinations
from twilio.rest import Client
from api import *
avg_pairs = list(combinations(averages, 2))
message = ''
def fetch_data(coin):
binance = ccxt.binance()
try:
ticker = coin + '/USDT'
data = binance.fetch_ohlcv(ticker, '1h')
... | 235 | 0 | 23 |
4bda540bbc9e154e47c6b5bacbd9c15a47a644a2 | 949 | py | Python | hail_scripts/v01/utils/add_primate_ai.py | NLSVTN/hail-elasticsearch-pipelines | 8b895a2e46a33d347dd2a1024101a6d515027a03 | [
"MIT"
] | null | null | null | hail_scripts/v01/utils/add_primate_ai.py | NLSVTN/hail-elasticsearch-pipelines | 8b895a2e46a33d347dd2a1024101a6d515027a03 | [
"MIT"
] | null | null | null | hail_scripts/v01/utils/add_primate_ai.py | NLSVTN/hail-elasticsearch-pipelines | 8b895a2e46a33d347dd2a1024101a6d515027a03 | [
"MIT"
] | null | null | null | import hail
PRIMATE_AI_VDS_PATHS = {
'37': 'gs://seqr-reference-data/GRCh37/primate_ai/PrimateAI_scores_v0.2.vds',
'38': 'gs://seqr-reference-data/GRCh38/primate_ai/PrimateAI_scores_v0.2.liftover_grch38.vds',
}
| 33.892857 | 110 | 0.752371 | import hail
PRIMATE_AI_VDS_PATHS = {
'37': 'gs://seqr-reference-data/GRCh37/primate_ai/PrimateAI_scores_v0.2.vds',
'38': 'gs://seqr-reference-data/GRCh38/primate_ai/PrimateAI_scores_v0.2.liftover_grch38.vds',
}
def read_primate_ai_vds(hail_context, genome_version, subset=None):
if genome_version not in [... | 681 | 0 | 46 |
5c46099f9839b26ea341c22d56b4afd57fc37f25 | 20,742 | py | Python | openmixup/models/backbones/vision_transformer.py | Westlake-AI/openmixup | ea81250819e740dd823e30cb7ce382d14a3c1b91 | [
"Apache-2.0"
] | 10 | 2021-12-30T10:22:27.000Z | 2022-03-30T02:31:38.000Z | openmixup/models/backbones/vision_transformer.py | Westlake-AI/openmixup | ea81250819e740dd823e30cb7ce382d14a3c1b91 | [
"Apache-2.0"
] | 3 | 2022-01-20T21:02:48.000Z | 2022-03-19T13:49:45.000Z | openmixup/models/backbones/vision_transformer.py | Westlake-AI/openmixup | ea81250819e740dd823e30cb7ce382d14a3c1b91 | [
"Apache-2.0"
] | null | null | null | # Reference: https://github.com/open-mmlab/mmclassification/tree/master/mmcls/models/backbone/vision_transformer.py
import math
from typing import Sequence
from functools import reduce
from operator import mul
import numpy as np
import torch
import torch.nn as nn
from mmcv.cnn import build_norm_layer
from mmcv.cnn.bri... | 40.275728 | 115 | 0.561759 | # Reference: https://github.com/open-mmlab/mmclassification/tree/master/mmcls/models/backbone/vision_transformer.py
import math
from typing import Sequence
from functools import reduce
from operator import mul
import numpy as np
import torch
import torch.nn as nn
from mmcv.cnn import build_norm_layer
from mmcv.cnn.bri... | 13,060 | 0 | 306 |
869bbb3d23c932d2e6343cda63acd1e4e75a660b | 12,875 | py | Python | jip/maven.py | mhmgad/jip | cd333883cda5dcb448e7c98b1e83560c378daf41 | [
"MIT"
] | null | null | null | jip/maven.py | mhmgad/jip | cd333883cda5dcb448e7c98b1e83560c378daf41 | [
"MIT"
] | null | null | null | jip/maven.py | mhmgad/jip | cd333883cda5dcb448e7c98b1e83560c378daf41 | [
"MIT"
] | null | null | null | #! /usr/bin/env jython
# -
# Copyright (C) 2011 Sun Ning<classicning@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
... | 41.938111 | 122 | 0.625786 | #! /usr/bin/env jython
# -
# Copyright (C) 2011 Sun Ning<classicning@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
... | 10,878 | 387 | 311 |
ae9233f9035251f15d739d1260f42733eb3a68b9 | 296 | py | Python | final_videolink/check50/__init__.py | rongxin-liu/checks | 5bc0bd5a2fcaa4b31a6bc4d5a157273d42d68069 | [
"MIT"
] | null | null | null | final_videolink/check50/__init__.py | rongxin-liu/checks | 5bc0bd5a2fcaa4b31a6bc4d5a157273d42d68069 | [
"MIT"
] | null | null | null | final_videolink/check50/__init__.py | rongxin-liu/checks | 5bc0bd5a2fcaa4b31a6bc4d5a157273d42d68069 | [
"MIT"
] | null | null | null | from check50 import *
import os
| 24.666667 | 79 | 0.628378 | from check50 import *
import os
class FinalVideo(Checks):
@check()
def submitted(self):
"""You submitted 'Final Video Link'"""
files = os.listdir()
if not any(filename.startswith("final_project") for filename in files):
raise Error("File not found")
| 0 | 241 | 23 |
9f059f23cda24fbb0e84c19258cfa0c73d8d0944 | 6,662 | py | Python | fermipy/jobs/name_policy.py | jefemagril/fermipy | ff67ba87516be1a31d1ad12b900f19bc7f1e2406 | [
"BSD-3-Clause"
] | null | null | null | fermipy/jobs/name_policy.py | jefemagril/fermipy | ff67ba87516be1a31d1ad12b900f19bc7f1e2406 | [
"BSD-3-Clause"
] | null | null | null | fermipy/jobs/name_policy.py | jefemagril/fermipy | ff67ba87516be1a31d1ad12b900f19bc7f1e2406 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Handle the naming conventions for DM pipeline analysis
"""
from __future__ import absolute_import, division, print_function
import sys
import yaml
from fermipy.jobs.utils import is_null, is_not_null
class NameFactory(object):
""" Helper class to... | 36.80663 | 100 | 0.65746 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Handle the naming conventions for DM pipeline analysis
"""
from __future__ import absolute_import, division, print_function
import sys
import yaml
from fermipy.jobs.utils import is_null, is_not_null
class NameFactory(object):
""" Helper class to... | 0 | 0 | 0 |
48381b85d56a121cc0da84e1e47baafd21119fc6 | 11,817 | py | Python | tests/functional/driver.py | labotsuchinoko/slackbot | 88c79f67486c8bfc34214d68c34ce9011f221c7d | [
"MIT"
] | 1,238 | 2015-02-24T13:17:12.000Z | 2021-01-27T10:38:52.000Z | tests/functional/driver.py | labotsuchinoko/slackbot | 88c79f67486c8bfc34214d68c34ce9011f221c7d | [
"MIT"
] | 181 | 2015-02-26T03:21:25.000Z | 2020-12-14T14:58:47.000Z | tests/functional/driver.py | labotsuchinoko/slackbot | 88c79f67486c8bfc34214d68c34ce9011f221c7d | [
"MIT"
] | 501 | 2015-02-26T03:19:45.000Z | 2020-12-19T03:24:59.000Z | import threading
import json
import re
import time
import slacker
import websocket
import six
from six.moves import _thread, range
class Driver(object):
"""Functional tests driver. It handles the communication with slack api, so that
the tests code can concentrate on higher level logic.
"""
def _webs... | 40.608247 | 120 | 0.611407 | import threading
import json
import re
import time
import slacker
import websocket
import six
from six.moves import _thread, range
class Driver(object):
"""Functional tests driver. It handles the communication with slack api, so that
the tests code can concentrate on higher level logic.
"""
def __init... | 10,007 | 0 | 971 |
a18ce9b28d47d2b0f8739a73af4aadcdae3e7d12 | 2,498 | py | Python | live/views.py | austinhartzheim/madhacks-live | ec572d124350f91fd5afa2d20a6ed556b3f15863 | [
"MIT"
] | null | null | null | live/views.py | austinhartzheim/madhacks-live | ec572d124350f91fd5afa2d20a6ed556b3f15863 | [
"MIT"
] | null | null | null | live/views.py | austinhartzheim/madhacks-live | ec572d124350f91fd5afa2d20a6ed556b3f15863 | [
"MIT"
] | null | null | null | from django.http import HttpResponseRedirect
from django.shortcuts import render, render_to_response
from django.contrib.auth.models import User
from django.forms.formsets import formset_factory
from django.template import RequestContext
from vote.models import *
from vote.forms import *
from live.models import *
im... | 33.306667 | 149 | 0.639712 | from django.http import HttpResponseRedirect
from django.shortcuts import render, render_to_response
from django.contrib.auth.models import User
from django.forms.formsets import formset_factory
from django.template import RequestContext
from vote.models import *
from vote.forms import *
from live.models import *
im... | 0 | 0 | 0 |
2206722d432355835754f173ff74ab26d15fcf02 | 1,016 | py | Python | pyll/utils/timer.py | manuflores/hti-cnn | b862446ab5f7477c5f2586b1d061c615997646cd | [
"BSD-2-Clause"
] | 7 | 2019-05-16T07:56:17.000Z | 2021-09-01T08:12:37.000Z | pyll/utils/timer.py | manuflores/hti-cnn | b862446ab5f7477c5f2586b1d061c615997646cd | [
"BSD-2-Clause"
] | 1 | 2019-04-19T06:25:28.000Z | 2019-04-19T06:25:28.000Z | pyll/utils/timer.py | manuflores/hti-cnn | b862446ab5f7477c5f2586b1d061c615997646cd | [
"BSD-2-Clause"
] | 3 | 2019-04-05T17:05:40.000Z | 2021-08-15T11:37:56.000Z | # -*- coding: utf-8 -*-
"""
© Michael Widrich, Markus Hofmarcher, 2017
"""
import time
| 23.627907 | 74 | 0.533465 | # -*- coding: utf-8 -*-
"""
© Michael Widrich, Markus Hofmarcher, 2017
"""
import time
class Timer(object):
def __init__(self, name="", verbose=True, precision='msec'):
self.verbose = verbose
self.name = name
self.precision = precision
self.restart()
def __enter__(self):
... | 744 | -1 | 184 |
6db64ea2455fb28c765958d2607a2da4968f6e4d | 183 | py | Python | models/__init__.py | mochell/stormy_forerunners | 6ae19e14acded94638578ceeea53ef6ef1bf5198 | [
"MIT"
] | null | null | null | models/__init__.py | mochell/stormy_forerunners | 6ae19e14acded94638578ceeea53ef6ef1bf5198 | [
"MIT"
] | null | null | null | models/__init__.py | mochell/stormy_forerunners | 6ae19e14acded94638578ceeea53ef6ef1bf5198 | [
"MIT"
] | null | null | null | __all__ = ["JONSWAP_gamma", "gaussian_gamma", "JONSWAP_gamma", "shape_models"]
#import stormrecon as stormrecon
#import tools as tools
#import io as io
#import plotters as plotters
| 26.142857 | 79 | 0.770492 | __all__ = ["JONSWAP_gamma", "gaussian_gamma", "JONSWAP_gamma", "shape_models"]
#import stormrecon as stormrecon
#import tools as tools
#import io as io
#import plotters as plotters
| 0 | 0 | 0 |
b124279246da1bd02ffca3d4d5578aa16d4a139f | 1,763 | py | Python | aoc2021/day12/solution.py | jschmidtnj/competitive | cb16f285f1022d9d16e654b755d89a1b0e53deeb | [
"MIT"
] | null | null | null | aoc2021/day12/solution.py | jschmidtnj/competitive | cb16f285f1022d9d16e654b755d89a1b0e53deeb | [
"MIT"
] | null | null | null | aoc2021/day12/solution.py | jschmidtnj/competitive | cb16f285f1022d9d16e654b755d89a1b0e53deeb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from collections import defaultdict, deque
if __name__ == '__main__':
print(part_1())
print(part_2())
| 28.901639 | 63 | 0.522405 | #!/usr/bin/env python3
from collections import defaultdict, deque
def part_1() -> int:
graph = defaultdict(list)
with open('input.txt', 'r') as f:
for line in f:
line = line.strip()
parent, child = line.split('-')
graph[parent].append(child)
graph[child... | 1,581 | 0 | 46 |
b209683ca5102578ed36168742d7edeba2399a8a | 1,105 | py | Python | tello-command.py | doffing81/tello | 820cf9e6ec86632d626569e34157397f054c6921 | [
"MIT"
] | null | null | null | tello-command.py | doffing81/tello | 820cf9e6ec86632d626569e34157397f054c6921 | [
"MIT"
] | null | null | null | tello-command.py | doffing81/tello | 820cf9e6ec86632d626569e34157397f054c6921 | [
"MIT"
] | null | null | null | """
This will prompt a user to enter a command for a Tello drone.
Tello SDK v1.0.0 commands = "https://dl-cdn.ryzerobotics.com/downloads/tello/0228/Tello+SDK+Readme.pdf"
Tello SDK v1.3.0 commands = "https://terra-1-g.djicdn.com/2d4dce68897a46b19fc717f3576b7c6a/Tello%20编程相关/For%20Tello/Tello%20SDK%20Documentation%20EN_... | 33.484848 | 162 | 0.661538 | """
This will prompt a user to enter a command for a Tello drone.
Tello SDK v1.0.0 commands = "https://dl-cdn.ryzerobotics.com/downloads/tello/0228/Tello+SDK+Readme.pdf"
Tello SDK v1.3.0 commands = "https://terra-1-g.djicdn.com/2d4dce68897a46b19fc717f3576b7c6a/Tello%20编程相关/For%20Tello/Tello%20SDK%20Documentation%20EN_... | 0 | 0 | 0 |
d4a40ca412b0fcb9469040f1dc23033fa04a9808 | 5,530 | py | Python | tfx_bsl/sketches/misragries_sketch_test.py | meixinzhang/tfx-bsl | ff40846050827175b419b7b12c16a3f5b276a20d | [
"Apache-2.0"
] | null | null | null | tfx_bsl/sketches/misragries_sketch_test.py | meixinzhang/tfx-bsl | ff40846050827175b419b7b12c16a3f5b276a20d | [
"Apache-2.0"
] | null | null | null | tfx_bsl/sketches/misragries_sketch_test.py | meixinzhang/tfx-bsl | ff40846050827175b419b7b12c16a3f5b276a20d | [
"Apache-2.0"
] | null | null | null | # 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 29.572193 | 80 | 0.611935 | # 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 3,521 | 936 | 46 |
2d28d8db30bec21bab634c5fd1baea0e0e58f504 | 420 | py | Python | models/__init__.py | billhepeng/wx_tools | 64369531bd76a935eff547c50ff68150a240849d | [
"Apache-2.0"
] | 1 | 2021-01-19T02:49:14.000Z | 2021-01-19T02:49:14.000Z | models/__init__.py | billhepeng/wx_tools | 64369531bd76a935eff547c50ff68150a240849d | [
"Apache-2.0"
] | null | null | null | models/__init__.py | billhepeng/wx_tools | 64369531bd76a935eff547c50ff68150a240849d | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
from . import livechat_channel
from . import reply_about_models
from . import menu_about_models
from . import wx_user
from . import wx_corpuser
from . import wx_autoreply_model
from . import wx_config_model
from . import res_partner
from . import wxuser_uuid
from . import corpuser_uuid
from . import wx_... | 24.705882 | 32 | 0.819048 | # coding=utf-8
from . import livechat_channel
from . import reply_about_models
from . import menu_about_models
from . import wx_user
from . import wx_corpuser
from . import wx_autoreply_model
from . import wx_config_model
from . import res_partner
from . import wxuser_uuid
from . import corpuser_uuid
from . import wx_... | 0 | 0 | 0 |
6d38fb0514b998a41a767af95b2b6602201018ec | 2,995 | py | Python | custom_components/senseme/config_flow.py | OzGav/senseme-hacs | ff9b9a450be37e80ddb6380a4730c4526bb14c28 | [
"MIT"
] | 27 | 2017-02-20T17:49:32.000Z | 2021-12-22T08:58:46.000Z | custom_components/senseme/config_flow.py | OzGav/senseme-hacs | ff9b9a450be37e80ddb6380a4730c4526bb14c28 | [
"MIT"
] | 66 | 2017-02-22T16:01:20.000Z | 2022-03-05T15:09:56.000Z | custom_components/senseme/config_flow.py | OzGav/senseme-hacs | ff9b9a450be37e80ddb6380a4730c4526bb14c28 | [
"MIT"
] | 13 | 2020-02-09T22:42:38.000Z | 2022-03-19T06:48:07.000Z | """Config flow for SenseME."""
import ipaddress
import voluptuous as vol
from aiosenseme import async_get_device_by_ip_address, discover_all
from homeassistant import config_entries
from homeassistant.const import CONF_HOST
from .const import CONF_HOST_MANUAL, CONF_INFO, DOMAIN
DISCOVER_TIMEOUT = 5
class SensemeFl... | 32.912088 | 81 | 0.620033 | """Config flow for SenseME."""
import ipaddress
import voluptuous as vol
from aiosenseme import async_get_device_by_ip_address, discover_all
from homeassistant import config_entries
from homeassistant.const import CONF_HOST
from .const import CONF_HOST_MANUAL, CONF_INFO, DOMAIN
DISCOVER_TIMEOUT = 5
class SensemeFl... | 0 | 0 | 0 |
c1d6b2ea181d5cf65ca588471ecc83582d54b2a5 | 807 | py | Python | Image/resizeimg.py | LC-Duarte/pytil | 271b4e8dee408b586fbd741511116726e10d1fc0 | [
"MIT"
] | null | null | null | Image/resizeimg.py | LC-Duarte/pytil | 271b4e8dee408b586fbd741511116726e10d1fc0 | [
"MIT"
] | null | null | null | Image/resizeimg.py | LC-Duarte/pytil | 271b4e8dee408b586fbd741511116726e10d1fc0 | [
"MIT"
] | null | null | null | import cv2
import sys
print("Hello")
target_path = '/Users/Leonardo/Desktop/logo-coritiba.jpg'
reduce_by = 11
img = cv2.imread(target_path)
shape = img.shape
new0 = int(shape[0]/reduce_by)
new1 = int(shape[1]/reduce_by)
print(f"Orginal Shape = {shape}; New Shape ({new0}, {new1}, {shape[2]})")
try:
redu = cv2.re... | 25.21875 | 79 | 0.700124 | import cv2
import sys
print("Hello")
target_path = '/Users/Leonardo/Desktop/logo-coritiba.jpg'
reduce_by = 11
img = cv2.imread(target_path)
shape = img.shape
new0 = int(shape[0]/reduce_by)
new1 = int(shape[1]/reduce_by)
print(f"Orginal Shape = {shape}; New Shape ({new0}, {new1}, {shape[2]})")
try:
redu = cv2.re... | 0 | 0 | 0 |
b98a847aac7bc5cee71bca689f5bd185a3819b77 | 5,750 | py | Python | lenstronomy/PointSource/Types/lensed_position.py | heather999/lenstronomy | 8102fe026c1f3ba6e81d8a1f59cceb90e68430b4 | [
"MIT"
] | null | null | null | lenstronomy/PointSource/Types/lensed_position.py | heather999/lenstronomy | 8102fe026c1f3ba6e81d8a1f59cceb90e68430b4 | [
"MIT"
] | null | null | null | lenstronomy/PointSource/Types/lensed_position.py | heather999/lenstronomy | 8102fe026c1f3ba6e81d8a1f59cceb90e68430b4 | [
"MIT"
] | null | null | null | import numpy as np
from lenstronomy.PointSource.Types.base_ps import PSBase, _expand_to_array
__all__ = ['LensedPositions']
class LensedPositions(PSBase):
"""
class of a a lensed point source parameterized as the (multiple) observed image positions
Name within the PointSource module: 'LENSED_POSITION'
... | 52.752294 | 119 | 0.658435 | import numpy as np
from lenstronomy.PointSource.Types.base_ps import PSBase, _expand_to_array
__all__ = ['LensedPositions']
class LensedPositions(PSBase):
"""
class of a a lensed point source parameterized as the (multiple) observed image positions
Name within the PointSource module: 'LENSED_POSITION'
... | 0 | 0 | 0 |