hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d84e5b1e84e339c738c6715276cfc4602317308a | 317 | py | Python | venv/lib/python3.8/site-packages/songpal/__init__.py | vsevolodpohvalenko/home-assistant | 4ae19b7d5d843c65ba700922c1814755257eb4e0 | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/songpal/__init__.py | vsevolodpohvalenko/home-assistant | 4ae19b7d5d843c65ba700922c1814755257eb4e0 | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/songpal/__init__.py | vsevolodpohvalenko/home-assistant | 4ae19b7d5d843c65ba700922c1814755257eb4e0 | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
from importlib_metadata import version # type: ignore
__version__ = version("python-songpal")
| 22.642857 | 54 | 0.769716 | # flake8: noqa
from importlib_metadata import version # type: ignore
from songpal.common import SongpalException
from songpal.device import Device
from songpal.notification import (
ConnectChange,
ContentChange,
Notification,
PowerChange,
VolumeChange,
)
__version__ = version("python-songpal")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 140 | 66 |
9fdbf1fc42ece41e217bfd55e5aff5e2209c5666 | 1,343 | py | Python | torch_rl/envs/__init__.py | JimmyMVP/plain_rl | 4780f05fffb62533a339197b49de487cdc9d9954 | [
"MIT"
] | 10 | 2018-03-18T21:27:59.000Z | 2020-08-13T20:15:05.000Z | torch_rl/envs/__init__.py | JimmyMVP/plain_rl | 4780f05fffb62533a339197b49de487cdc9d9954 | [
"MIT"
] | 1 | 2018-03-19T09:51:04.000Z | 2018-03-19T10:11:02.000Z | torch_rl/envs/__init__.py | JimmyMVP/plain_rl | 4780f05fffb62533a339197b49de487cdc9d9954 | [
"MIT"
] | 3 | 2018-03-10T09:17:10.000Z | 2019-12-17T20:19:56.000Z | from gym.envs.registration import register
register(
id='BanditsX2-v0',
kwargs = {'num_bandits' : 2},
entry_point='torch_rl.envs:BanditEnv',
)
register(
id='BanditsX4-v0',
kwargs = {'num_bandits' : 4},
entry_point='torch_rl.envs:BanditEnv',
)
register(
id='BanditsX8-v0',
kwargs = {'n... | 17.671053 | 60 | 0.613552 | from gym.envs.registration import register
from .wrappers import *
from .logger import *
from .envs import *
register(
id='BanditsX2-v0',
kwargs = {'num_bandits' : 2},
entry_point='torch_rl.envs:BanditEnv',
)
register(
id='BanditsX4-v0',
kwargs = {'num_bandits' : 4},
entry_point='torch_rl.env... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 119 |
e6eff242e63560ac48a84867e188b0929841ee24 | 1,883 | py | Python | dash_app/predict.py | zeyu2001/ICT1002-Python | 76a2c8ad3e3c4a3c873a9259e2a11488c33f2bf7 | [
"MIT"
] | 1 | 2020-10-31T06:57:01.000Z | 2020-10-31T06:57:01.000Z | dash_app/predict.py | zeyu2001/ICT1002-Python | 76a2c8ad3e3c4a3c873a9259e2a11488c33f2bf7 | [
"MIT"
] | null | null | null | dash_app/predict.py | zeyu2001/ICT1002-Python | 76a2c8ad3e3c4a3c873a9259e2a11488c33f2bf7 | [
"MIT"
] | 1 | 2021-12-04T10:02:16.000Z | 2021-12-04T10:02:16.000Z | import dash_html_components as html
import dash_core_components as dcc
import dash_table as dt
import pandas as pd
heading_2 = html.Header(
html.H2(
"Classify Emails (Spam or Ham)",
style={
"text-align": "center",
"margin": "10px",
"font-weight": "lighter",
... | 19.821053 | 82 | 0.548593 | import dash_html_components as html
import dash_core_components as dcc
import dash_table as dt
import pandas as pd
heading_2 = html.Header(
html.H2(
"Classify Emails (Spam or Ham)",
style={
"text-align": "center",
"margin": "10px",
"font-weight": "lighter",
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f63e6de423ae23e53a526db48daf20e265d3c7e9 | 2,144 | py | Python | utils/visualization.py | bhpfelix/NDDR-CNN-PyTorch | 8c45f444093934831c83c5e2d592db962b300272 | [
"Apache-2.0"
] | 9 | 2020-04-03T02:44:33.000Z | 2021-12-21T01:53:39.000Z | utils/visualization.py | bhpfelix/NDDR-CNN-PyTorch | 8c45f444093934831c83c5e2d592db962b300272 | [
"Apache-2.0"
] | null | null | null | utils/visualization.py | bhpfelix/NDDR-CNN-PyTorch | 8c45f444093934831c83c5e2d592db962b300272 | [
"Apache-2.0"
] | 2 | 2020-05-22T11:58:01.000Z | 2020-08-06T08:02:43.000Z |
label_colours = [(178, 45, 45), (153, 115, 115), (64, 36, 32), (255, 68, 0), (89, 24, 0), (191, 121, 96), (191, 102, 0),
(76, 41, 0), (153, 115, 38), (102, 94, 77), (242, 194, 0), (191, 188, 143), (226, 242, 0),
(119, 128, 0), (59, 64, 0), (105, 191, 48), (81, 128, 64), (0, 255, 0), ... | 43.755102 | 120 | 0.527519 | from PIL import Image
import numpy as np
label_colours = [(178, 45, 45), (153, 115, 115), (64, 36, 32), (255, 68, 0), (89, 24, 0), (191, 121, 96), (191, 102, 0),
(76, 41, 0), (153, 115, 38), (102, 94, 77), (242, 194, 0), (191, 188, 143), (226, 242, 0),
(119, 128, 0), (59, 64, 0), (10... | 0 | 0 | 0 | 0 | 0 | 1,210 | 0 | -3 | 136 |
13e64fee553d5f2cf24434a7a7f137f544379377 | 209 | py | Python | UVa 12004 - Bubble Sort/sample/main1.py | tadvi/uva | 0ac0cbdf593879b4fb02a3efc09adbb031cb47d5 | [
"MIT"
] | 1 | 2020-11-24T03:17:21.000Z | 2020-11-24T03:17:21.000Z | UVa 12004 - Bubble Sort/sample/main1.py | tadvi/uva | 0ac0cbdf593879b4fb02a3efc09adbb031cb47d5 | [
"MIT"
] | null | null | null | UVa 12004 - Bubble Sort/sample/main1.py | tadvi/uva | 0ac0cbdf593879b4fb02a3efc09adbb031cb47d5 | [
"MIT"
] | 1 | 2021-04-11T16:22:31.000Z | 2021-04-11T16:22:31.000Z | import sys
sys.stdin = open('input.txt')
numTest = int(input())
for itertest in range(numTest):
n = int(input())
print 'Case %d: %s' % (itertest + 1, Fraction(n * (n - 1), 4))
| 23.222222 | 66 | 0.617225 | import sys
from fractions import *
sys.stdin = open('input.txt')
numTest = int(input())
for itertest in range(numTest):
n = int(input())
print 'Case %d: %s' % (itertest + 1, Fraction(n * (n - 1), 4))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 22 |
2caefcd75c993da7fc3a0bc51c96f9a90de0d590 | 2,016 | py | Python | regression-tests/sparktkregtests/testcases/scoretests/lda.py | lewisc/spark-tk | 5548fc925b5c278263cbdebbd9e8c7593320c2f4 | [
"ECL-2.0",
"Apache-2.0"
] | 34 | 2016-05-20T22:26:05.000Z | 2022-01-21T12:55:13.000Z | regression-tests/sparktkregtests/testcases/scoretests/lda.py | lewisc/spark-tk | 5548fc925b5c278263cbdebbd9e8c7593320c2f4 | [
"ECL-2.0",
"Apache-2.0"
] | 70 | 2016-06-28T01:11:21.000Z | 2021-03-15T21:40:01.000Z | regression-tests/sparktkregtests/testcases/scoretests/lda.py | lewisc/spark-tk | 5548fc925b5c278263cbdebbd9e8c7593320c2f4 | [
"ECL-2.0",
"Apache-2.0"
] | 34 | 2016-04-21T22:25:22.000Z | 2020-10-06T09:23:43.000Z | # vim: set encoding=utf-8
# Copyright(c)2016 IntelCorporation
#
# LicensedundertheApacheLicense,Version2.0(the"License");
# youmaynotusethisfileexceptincompliancewiththeLicense.
# YoumayobtainacopyoftheLicenseat
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unlessrequiredbyapplicablelaworagreedtoinwriting,s... | 33.6 | 98 | 0.636905 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 require... | 156 | 0 | 0 | 1,156 | 0 | 0 | 0 | 35 | 89 |
e010a27a8bef3db333bf29794eb1567b3fd118cb | 978 | py | Python | src/models/downsamples/linear.py | takedarts/skipresnet | d6f1e16042f8433a287355009e17e4e5768ad319 | [
"MIT"
] | 3 | 2022-02-03T13:25:12.000Z | 2022-02-04T16:12:23.000Z | src/models/downsamples/linear.py | takedarts/skipresnet | d6f1e16042f8433a287355009e17e4e5768ad319 | [
"MIT"
] | null | null | null | src/models/downsamples/linear.py | takedarts/skipresnet | d6f1e16042f8433a287355009e17e4e5768ad319 | [
"MIT"
] | 1 | 2022-02-04T12:28:02.000Z | 2022-02-04T12:28:02.000Z |
import torch.nn as nn
| 26.432432 | 65 | 0.563395 | import collections
from typing import Callable
import torch.nn as nn
from ..modules import DropBlock
class LinearDownsample(nn.Sequential):
'''
Downsample class with linear mapping.
This is a default donwsample mudule for ResNets.
'''
def __init__(
self,
in_channels: int,
... | 0 | 0 | 0 | 851 | 0 | 0 | 0 | 13 | 90 |
55620ff3bb7d277fbbafa5914f90a695c8f4cae6 | 3,908 | py | Python | rmssl.py | rmayherr/python | 830aec82e3ab155b66d01032eac71bbe6f961fce | [
"MIT"
] | null | null | null | rmssl.py | rmayherr/python | 830aec82e3ab155b66d01032eac71bbe6f961fce | [
"MIT"
] | null | null | null | rmssl.py | rmayherr/python | 830aec82e3ab155b66d01032eac71bbe6f961fce | [
"MIT"
] | null | null | null | Cellname="???rk"
NodeName="???dea"
#Que... | 102.842105 | 106 | 0.141505 | Cellname="???rk"
NodeName="???dea"
def Query():
#a... | 0 | 0 | 0 | 0 | 0 | 2,337 | 0 | 0 | 613 |
08e0e943768cfcd3df2ba44b3fb53d2e9556f4bb | 13,881 | py | Python | article/src/scripts/Canaries/eval_without_and_with_output_transforms.py | yardencsGitHub/tweetynet | 281f8876726359a298a2c387c7b4c2e40ac61c91 | [
"BSD-3-Clause"
] | 28 | 2018-11-14T08:18:15.000Z | 2022-03-25T13:31:08.000Z | article/src/scripts/Canaries/eval_without_and_with_output_transforms.py | yardencsGitHub/tweetynet | 281f8876726359a298a2c387c7b4c2e40ac61c91 | [
"BSD-3-Clause"
] | 116 | 2018-11-06T02:53:18.000Z | 2022-03-23T20:57:37.000Z | article/src/scripts/Canaries/eval_without_and_with_output_transforms.py | yardencsGitHub/tweetynet | 281f8876726359a298a2c387c7b4c2e40ac61c91 | [
"BSD-3-Clause"
] | 6 | 2019-03-11T16:41:54.000Z | 2021-11-10T20:47:01.000Z | # This script is identical to the on for BFSongRepository but with canaries
from collections import defaultdict
import json
from pathlib import Path
import numpy as np
import pandas as pd
import torch
from tqdm import tqdm
import vak.device
import vak.files
from vak.labeled_timebins import lbl_tb2segments, majority_vo... | 46.89527 | 116 | 0.568403 | # This script is identical to the on for BFSongRepository but with canaries
from collections import defaultdict
import json
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import torch
from tqdm import tqdm
import vak.device
import vak.files
from vak.labeled_timebins im... | 0 | 0 | 0 | 0 | 0 | 1,058 | 0 | 16 | 46 |
502607423aa216fcab835f6de138bf34f5b7a3a2 | 666 | py | Python | UTFPR/Prova.while -2.py | MateusCohuzer/Algoritmos-UTFPR-M31-de-2020 | 2dde62311eaaebbc30ca48b24261e68c4cb65777 | [
"MIT"
] | null | null | null | UTFPR/Prova.while -2.py | MateusCohuzer/Algoritmos-UTFPR-M31-de-2020 | 2dde62311eaaebbc30ca48b24261e68c4cb65777 | [
"MIT"
] | null | null | null | UTFPR/Prova.while -2.py | MateusCohuzer/Algoritmos-UTFPR-M31-de-2020 | 2dde62311eaaebbc30ca48b24261e68c4cb65777 | [
"MIT"
] | null | null | null | txt = str('S')
desconto = int(0)
while txt == 'S':
valor = float(input('Insira o valor do carro (sem desconto): '))
ano = int(input('Insira o ano de fabricao do veculo: '))
if ano <= 2010:
desconto = float(valor * 0.2)
elif ano <= 2020:
desconto = float(valor * 0.15)
elif ano > 2020... | 39.176471 | 97 | 0.591592 | txt = str('S')
desconto = int(0)
while txt == 'S':
valor = float(input('Insira o valor do carro (sem desconto): '))
ano = int(input('Insira o ano de fabricação do veículo: '))
if ano <= 2010:
desconto = float(valor * 0.2)
elif ano <= 2020:
desconto = float(valor * 0.15)
elif ano > 2... | 12 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
43872271e85ec59e40c6326c549a7f0d1fabccac | 1,108 | py | Python | DLtorch/dataset/base.py | A-LinCui/DLtorch | 27bfe18d9298fad99d6eda4508afa707e35b898f | [
"MIT"
] | 3 | 2020-08-28T15:43:48.000Z | 2020-08-29T11:34:42.000Z | DLtorch/dataset/base.py | zhaojb17/DLtorch | 27bfe18d9298fad99d6eda4508afa707e35b898f | [
"MIT"
] | null | null | null | DLtorch/dataset/base.py | zhaojb17/DLtorch | 27bfe18d9298fad99d6eda4508afa707e35b898f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import torchvision.transforms as transforms
| 33.575758 | 147 | 0.668773 | # -*- coding: utf-8 -*-
import abc
import os
import torchvision.transforms as transforms
from DLtorch.base import BaseComponent
class BaseDataset(BaseComponent):
def __init__(self, path: str):
super(BaseDataset, self).__init__()
self.path = path
self.datasets = {}
self.logger.in... | 0 | 0 | 0 | 930 | 0 | 0 | 0 | -6 | 114 |
3b5df536910fdac79072a757f041676d0d7ac5cc | 1,028 | py | Python | mandelbrot/naive.py | kidmose/python-course-mini-project | d8ebcc2f5e79f84ce350f2eafbc6c6e572d71584 | [
"MIT"
] | null | null | null | mandelbrot/naive.py | kidmose/python-course-mini-project | d8ebcc2f5e79f84ce350f2eafbc6c6e572d71584 | [
"MIT"
] | null | null | null | mandelbrot/naive.py | kidmose/python-course-mini-project | d8ebcc2f5e79f84ce350f2eafbc6c6e572d71584 | [
"MIT"
] | null | null | null | from __future__ import division
"""Implementation of naive and inefficient mandelbrot calculator."""
import mandelbrot
logger = mandelbrot.get_logger(__name__)
| 27.052632 | 68 | 0.550584 | from __future__ import division
"""Implementation of naive and inefficient mandelbrot calculator."""
import mandelbrot
import math
logger = mandelbrot.get_logger(__name__)
class NaiveCalculator(mandelbrot.MandelbrotCalculator):
"""See parrent."""
file_name_data = "naive_data.csv"
file_name_plot = "naive... | 0 | 0 | 0 | 830 | 0 | 0 | 0 | -10 | 45 |
114113c2327e984853bcfe3d2bdb8fbe4a9538bc | 4,149 | py | Python | tests/test_lookups.py | gluk-w/python-tuple-lookup | b0c44bb8fb9c94925c97b54b02ffc8abeb570914 | [
"MIT"
] | null | null | null | tests/test_lookups.py | gluk-w/python-tuple-lookup | b0c44bb8fb9c94925c97b54b02ffc8abeb570914 | [
"MIT"
] | null | null | null | tests/test_lookups.py | gluk-w/python-tuple-lookup | b0c44bb8fb9c94925c97b54b02ffc8abeb570914 | [
"MIT"
] | null | null | null |
from listlookup import ListLookup
sample_list = [
{"id": 1, "country": "us", "name": "Atlanta"},
{"id": 2, "country": "us", "name": "Miami"},
{"id": 3, "country": "uk", "name": "Britain"},
{"id": 5, "country": "uk", "name": "Bermingham"},
{"id": 4, "country": "ca", "name": "Barrie"},
]
def... | 31.195489 | 114 | 0.614124 | import pytest
from listlookup import ListLookup
sample_list = [
{"id": 1, "country": "us", "name": "Atlanta"},
{"id": 2, "country": "us", "name": "Miami"},
{"id": 3, "country": "uk", "name": "Britain"},
{"id": 5, "country": "uk", "name": "Bermingham"},
{"id": 4, "country": "ca", "name": "Barrie"},... | 0 | 0 | 0 | 0 | 0 | 3,216 | 0 | -8 | 183 |
f0f3d2a9d3148588926e7346929e0dafccfb068f | 7,143 | py | Python | spectral_analysis/classifiers/neural_network/cnn.py | csepreghy/spectral_analysis | 1cbd9770347a71721164a7daf7b133ad0eeba8e4 | [
"MIT"
] | 5 | 2019-05-29T07:16:27.000Z | 2019-08-20T07:15:54.000Z | spectral_analysis/classifiers/neural_network/cnn.py | csepreghy/spectral-analysis | 1cbd9770347a71721164a7daf7b133ad0eeba8e4 | [
"MIT"
] | 19 | 2020-02-20T09:48:46.000Z | 2020-02-24T11:42:54.000Z | spectral_analysis/classifiers/neural_network/cnn.py | csepreghy/spectral_analysis | 1cbd9770347a71721164a7daf7b133ad0eeba8e4 | [
"MIT"
] | null | null | null |
import time
LOG_DIR = f"{int(time.time())}"
if __name__ == "__main__":
main()
| 41.289017 | 111 | 0.576648 | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from tensorflow.keras.optimizers import SGD, Adam
from tensorflow.keras.callbacks import History, EarlyStopping
from tensorflow.keras.layers import Dense, Dropout, Flatten, Conv... | 0 | 0 | 0 | 6,079 | 0 | 379 | 0 | 309 | 291 |
d2bc237a95b3258f1a7bede6065ddf5da53dcd8a | 413 | py | Python | tests/test_colmet_collector.py | oar-team/colmet-collector | b962a84574093adfd4a1c1877277b96119d5fe77 | [
"BSD-3-Clause"
] | null | null | null | tests/test_colmet_collector.py | oar-team/colmet-collector | b962a84574093adfd4a1c1877277b96119d5fe77 | [
"BSD-3-Clause"
] | null | null | null | tests/test_colmet_collector.py | oar-team/colmet-collector | b962a84574093adfd4a1c1877277b96119d5fe77 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_colmet_collector
----------------------------------
Tests for `colmet_collector` module.
"""
| 14.241379 | 45 | 0.615012 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_colmet_collector
----------------------------------
Tests for `colmet_collector` module.
"""
import unittest
from colmet_collector import colmet_collector
class TestColmetCollector(object):
@classmethod
def setup_class(cls):
pass
def te... | 0 | 63 | 0 | 111 | 0 | 0 | 0 | 18 | 69 |
3ae829e90b7c9ef052514f4aefcb4694ee18d845 | 26,355 | py | Python | bin/Python27/Lib/site-packages/omniORBpy-4.2.0/lib/python/omniORB/COS/CosNaming_idl.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | bin/Python27/Lib/site-packages/omniORBpy-4.2.0/lib/python/omniORB/COS/CosNaming_idl.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | bin/Python27/Lib/site-packages/omniORBpy-4.2.0/lib/python/omniORB/COS/CosNaming_idl.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | # Python stubs generated by omniidl from ..\..\..\..\..\idl\COS\CosNaming.idl
# DO NOT EDIT THIS FILE!
import omniORB, _omnipy
from omniORB import CORBA, PortableServer
_0_CORBA = CORBA
_omnipy.checkVersion(4,2, __file__, 1)
try:
property
except NameError:
#
# Start of module "CosNaming"
#
_... | 59.358108 | 576 | 0.782053 | # Python stubs generated by omniidl from ..\..\..\..\..\idl\COS\CosNaming.idl
# DO NOT EDIT THIS FILE!
import omniORB, _omnipy
from omniORB import CORBA, PortableServer
_0_CORBA = CORBA
_omnipy.checkVersion(4,2, __file__, 1)
try:
property
except NameError:
def property(*args):
return N... | 0 | 0 | 0 | 12,386 | 0 | 20 | 0 | 0 | 349 |
60d991e2a6a2caab3b549170e63eb1abc3587e40 | 41,359 | py | Python | source/objects/waveClass.py | THREDgroup/WEC-Sim-Python | c04ef42724cbf72419713970bf9ae63658a4d1b3 | [
"Apache-2.0"
] | 2 | 2020-12-15T08:42:05.000Z | 2021-09-14T08:28:17.000Z | tests/test_objects/test_waveclass/waveclass/__init__.py | THREDgroup/WEC-Sim-Python | c04ef42724cbf72419713970bf9ae63658a4d1b3 | [
"Apache-2.0"
] | 1 | 2020-09-14T03:08:46.000Z | 2020-10-19T05:47:42.000Z | tests/test_objects/test_waveclass/waveclass/__init__.py | THREDgroup/WEC-Sim-Python | c04ef42724cbf72419713970bf9ae63658a4d1b3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 3 07:52:07 2020
@author: SungJun Won
This code is written based on WEC-sim.
wonsungjun0000@gmail.com
Note: readData method is included to import data type of both .txt and .mat
Note: irregularWaveSpectrum method has been modified for the faster computation.
The or... | 52.686624 | 218 | 0.567615 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 3 07:52:07 2020
@author: SungJun Won
This code is written based on WEC-sim.
wonsungjun0000@gmail.com
Note: readData method is included to import data type of both .txt and .mat
Note: irregularWaveSpectrum method has been modified for the faster computation.
The or... | 0 | 0 | 0 | 39,873 | 0 | 0 | 0 | 11 | 111 |
05943b7cd700824a3706bc635056b541dae70aac | 632 | py | Python | day1.py | Arrain/Advent-of-Code-2020 | db41301ba39b6315a40704bc26b89e00a4bb4940 | [
"Unlicense"
] | null | null | null | day1.py | Arrain/Advent-of-Code-2020 | db41301ba39b6315a40704bc26b89e00a4bb4940 | [
"Unlicense"
] | null | null | null | day1.py | Arrain/Advent-of-Code-2020 | db41301ba39b6315a40704bc26b89e00a4bb4940 | [
"Unlicense"
] | null | null | null | """
AOC2020 - day1
"""
import sys;
FILEPATH = "./day1.txt";
with open(FILEPATH) as fp:
lines = fp.readlines();
EXISTING = [];
for line in lines:
val = int(line);
## part 1
# for i in EXISTING:
# if val + i == 2020:
# print(val * i);
... | 21.066667 | 49 | 0.419304 | """
AOC2020 - day1
"""
import sys;
FILEPATH = "./day1.txt";
with open(FILEPATH) as fp:
lines = fp.readlines();
EXISTING = [];
for line in lines:
val = int(line);
## part 1
# for i in EXISTING:
# if val + i == 2020:
# print(val * i);
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7cc0f26d7e7eb64f945903a377d48acf02309297 | 25,275 | py | Python | cirq-core/cirq/_compat.py | melonwater211/Cirq | e9ec70d3ed7e7e4dbc36418743faba170e488364 | [
"Apache-2.0"
] | null | null | null | cirq-core/cirq/_compat.py | melonwater211/Cirq | e9ec70d3ed7e7e4dbc36418743faba170e488364 | [
"Apache-2.0"
] | null | null | null | cirq-core/cirq/_compat.py | melonwater211/Cirq | e9ec70d3ed7e7e4dbc36418743faba170e488364 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 38.179758 | 105 | 0.63545 | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 0 | 929 | 0 | 9,644 | 0 | 4,050 | 0 | -28 | 427 |
d3df745d68f0c8483badccb255fdb37c09a3cf9f | 10,777 | py | Python | slowfast/datasets/epickitchens.py | dylan-campbell/Motionformer | 6c860614a3b252c6163971ba20e61ea3184d5291 | [
"Apache-2.0"
] | 153 | 2021-06-10T14:00:22.000Z | 2022-03-31T04:12:54.000Z | slowfast/datasets/epickitchens.py | dylan-campbell/Motionformer | 6c860614a3b252c6163971ba20e61ea3184d5291 | [
"Apache-2.0"
] | 10 | 2021-06-30T04:48:50.000Z | 2022-03-11T15:51:05.000Z | slowfast/datasets/epickitchens.py | dylan-campbell/Motionformer | 6c860614a3b252c6163971ba20e61ea3184d5291 | [
"Apache-2.0"
] | 22 | 2021-06-11T13:10:05.000Z | 2022-03-28T03:42:39.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
import slowfast.utils.logging as logging
from . import autoaugment as autoaugment
from . import transform as transform
from . import utils as utils
logger = logging.get_logger(__name__)
| 41.133588 | 131 | 0.593857 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import numpy as np
import random
import os
import pandas as pd
import torch
import torch.utils.data
from torchvision import transforms
import slowfast.utils.logging as logging
from .build import DATASET_REGISTRY
from .epic... | 0 | 10,188 | 0 | 0 | 0 | 0 | 0 | 69 | 223 |
c5fda76eda5749a6451e2494fedda422ecadeadf | 2,184 | py | Python | kingbird/tests/unit/objects/test_base.py | starlingx-staging/stx-kingbird | 9869ad4640e76384fa14f031a59134cd439929a8 | [
"Apache-2.0"
] | null | null | null | kingbird/tests/unit/objects/test_base.py | starlingx-staging/stx-kingbird | 9869ad4640e76384fa14f031a59134cd439929a8 | [
"Apache-2.0"
] | null | null | null | kingbird/tests/unit/objects/test_base.py | starlingx-staging/stx-kingbird | 9869ad4640e76384fa14f031a59134cd439929a8 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 Ericsson AB.
# 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 applicab... | 35.803279 | 75 | 0.668498 | # Copyright (c) 2015 Ericsson AB.
# 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 applicab... | 0 | 823 | 0 | 582 | 0 | 0 | 0 | 57 | 114 |
41ef0551465c518220c7a9780b2ba081205812fd | 1,550 | py | Python | tests/test_config.py | BenjaminNMitchell/alias-cd | 253ec6714674eb00171f60e4219a57033734bc68 | [
"MIT"
] | null | null | null | tests/test_config.py | BenjaminNMitchell/alias-cd | 253ec6714674eb00171f60e4219a57033734bc68 | [
"MIT"
] | null | null | null | tests/test_config.py | BenjaminNMitchell/alias-cd | 253ec6714674eb00171f60e4219a57033734bc68 | [
"MIT"
] | null | null | null | """This module tests config.py."""
from alias_cd import config
def test_yaml_parsing(config_data, config_yaml):
"""Test that the config_data fixture matches the config_yaml fixture."""
assert config._load_yaml(config_data) == config_yaml
def test_config_parsing(config_yaml, config_obj):
"""Test that... | 23.134328 | 81 | 0.604516 | """This module tests config.py."""
from typing import Dict
import pytest
from alias_cd import config
@pytest.fixture
def config_data() -> str:
"""Sample config data in yaml format."""
return """---
"~":
_alias: root
my_long_directory_1:
_alias: d1
my_sub_directory_1:
_alias: ... | 0 | 995 | 0 | 0 | 0 | 0 | 0 | -6 | 114 |
ac9f73c642523112474bd5926f7d7437d66a04f6 | 318 | py | Python | code/List/all_unique.py | jumploop/30-seconds-of-python | bfcc5a35d9bd0bba67e81de5715dba21e1ba43be | [
"CC0-1.0"
] | null | null | null | code/List/all_unique.py | jumploop/30-seconds-of-python | bfcc5a35d9bd0bba67e81de5715dba21e1ba43be | [
"CC0-1.0"
] | null | null | null | code/List/all_unique.py | jumploop/30-seconds-of-python | bfcc5a35d9bd0bba67e81de5715dba21e1ba43be | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
set()
len()
"""
# Examples
x = [1, 2, 3, 4, 5, 6]
y = [1, 2, 2, 3, 4, 5]
print(all_unique(x))
print(all_unique(y))
# output:
# True
# False
| 12.72 | 36 | 0.610063 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
功能实现:检查列表中的所有值是否都是唯一的。
解读:
在给定的列表中使用set()来保持唯一的出现。
使用len()将唯一值的长度与原始列表进行比较。
"""
def all_unique(lst):
return len(lst) == len(set(lst))
# Examples
x = [1, 2, 3, 4, 5, 6]
y = [1, 2, 2, 3, 4, 5]
print(all_unique(x))
print(all_unique(y))
# output:
# True
# False
| 186 | 0 | 0 | 0 | 0 | 36 | 0 | 0 | 23 |
3a42abb5968dc7ddee6b6d6d527b50ae9dad8f7d | 92 | py | Python | output/models/ms_data/regex/specials_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/ms_data/regex/specials_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/ms_data/regex/specials_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.ms_data.regex.specials_xsd.specials import Doc
__all__ = [
"Doc",
]
| 15.333333 | 65 | 0.728261 | from output.models.ms_data.regex.specials_xsd.specials import Doc
__all__ = [
"Doc",
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a9574398a0f9ac6f8bf6506334a684f1b1d58870 | 927 | py | Python | taiga/files/celery.py | tcpcloud/salt-formula-taiga | eb6fd3e438f830bb69adc24efe10ebd21e7d4e1e | [
"Apache-2.0"
] | 2 | 2017-08-21T23:29:20.000Z | 2018-02-28T12:06:09.000Z | taiga/files/celery.py | tcpcloud/salt-formula-taiga | eb6fd3e438f830bb69adc24efe10ebd21e7d4e1e | [
"Apache-2.0"
] | 2 | 2018-02-28T21:34:12.000Z | 2018-03-05T13:53:17.000Z | taiga/files/celery.py | tcpcloud/salt-formula-taiga | eb6fd3e438f830bb69adc24efe10ebd21e7d4e1e | [
"Apache-2.0"
] | 4 | 2017-05-29T08:52:57.000Z | 2020-06-30T23:52:48.000Z | {%- from "taiga/map.jinja" import server with context -%}
# -*- coding: utf-8 -*-
from kombu import Queue
broker_url = 'amqp{% if server.message_queue.get('ssl', False) %}s{% endif %}://{{ server.message_queue.user }}:{{ server.message_queue.password }}@{{ server.message_queue.host }}:{{ server.message_queue.get('por... | 34.333333 | 277 | 0.695793 | {%- from "taiga/map.jinja" import server with context -%}
# -*- coding: utf-8 -*-
from kombu import Queue
broker_url = 'amqp{% if server.message_queue.get('ssl', False) %}s{% endif %}://{{ server.message_queue.user }}:{{ server.message_queue.password }}@{{ server.message_queue.host }}:{{ server.message_queue.get('por... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
07957b053e02713a96c02e7f857f5413a35e652a | 5,776 | py | Python | The container /Robotic Arm/craves.ai-master/unreal/virtual_db/vdb.py | ReEn-Neom/ReEn.Neom-source-code- | 11ec834d5eac5a5a63c71f6b41107769dafc591c | [
"MIT"
] | null | null | null | The container /Robotic Arm/craves.ai-master/unreal/virtual_db/vdb.py | ReEn-Neom/ReEn.Neom-source-code- | 11ec834d5eac5a5a63c71f6b41107769dafc591c | [
"MIT"
] | null | null | null | The container /Robotic Arm/craves.ai-master/unreal/virtual_db/vdb.py | ReEn-Neom/ReEn.Neom-source-code- | 11ec834d5eac5a5a63c71f6b41107769dafc591c | [
"MIT"
] | null | null | null | import logging
import numpy as np
logger = logging.Logger("vdb")
def seg2bb(obj_mask):
''' Convert binary seg mask of object to bouding box, (x0, y0, x1, y1) format '''
y, x = np.where(obj_mask == True)
bb = [x.min(), x.max(), y.min(), y.max()]
return bb
def get_obj_mask(seg_im, color):
''' Get ... | 40.391608 | 139 | 0.571676 | import glob, os, json
import logging
import numpy as np
logger = logging.Logger("vdb")
class Dataset:
def __init__(self, db_root_dir):
self.db_root_dir = db_root_dir
pass
def get_ids(self):
''' Get frame ids of this dataset '''
filenames = glob.glob(os.path.join(self.db_root_d... | 0 | 0 | 0 | 5,033 | 0 | 0 | 0 | 0 | 45 |
cb9495c8b2d34d527e8e56500e484dc76cd595ea | 15,092 | py | Python | sample_code/stockdatawork.py | yunfeiz/py_learnt | d4134d8e9f1caed2db2848f19474c15c1b36557e | [
"Apache-2.0"
] | null | null | null | sample_code/stockdatawork.py | yunfeiz/py_learnt | d4134d8e9f1caed2db2848f19474c15c1b36557e | [
"Apache-2.0"
] | null | null | null | sample_code/stockdatawork.py | yunfeiz/py_learnt | d4134d8e9f1caed2db2848f19474c15c1b36557e | [
"Apache-2.0"
] | null | null | null | import sys
stockBasicInfo=None
myG={}
workingStock=[]
blackList=["000033"]
lastTradeDay=""
last2TradeDay=""
todayData=None
#getStockInfo("600848")
if __name__=="__main__" :
print(sys.argv)
if len(sys.argv)==2:
workType=sys.argv[1]
print(workType)
if workType=="get... | 27.291139 | 182 | 0.601378 | import tushare as ts
import matplotlib.pyplot as plt
import matplotlib.finance as mpf
from matplotlib.pylab import date2num
import datetime
import time
import os
import pandas as pd
import sys
from multiprocessing.dummy import Pool as ThreadPool
stockBasicInfo=None
myG={}
workingStock=[]
blackList=["000033"]
lastTrad... | 153 | 0 | 0 | 0 | 0 | 12,983 | 0 | 37 | 964 |
9000070b2550faa1d17f57c00a6b8e20ec634906 | 8,214 | py | Python | Source/cameras/cameras.py | Neseebits/SpaceGrantMachineVision | 451244e05354abd8c866b6560b105b62c404896e | [
"MIT"
] | 1 | 2022-02-09T05:16:10.000Z | 2022-02-09T05:16:10.000Z | Source/cameras/cameras.py | Neseebits/SpaceGrantMachineVision | 451244e05354abd8c866b6560b105b62c404896e | [
"MIT"
] | null | null | null | Source/cameras/cameras.py | Neseebits/SpaceGrantMachineVision | 451244e05354abd8c866b6560b105b62c404896e | [
"MIT"
] | null | null | null | # Built in python libs
# Additional libs
# Custom imports
try:
from logger.logger import Logger
from cameras.CaptureManager import CaptureManager, createCaptureSourceData
from cameras.DisplayManager import DisplayManager, createDisplaySourceData
from utilities.exceptions import CameraReadError
except... | 45.381215 | 145 | 0.72206 | # Built in python libs
import os
import time
# Additional libs
import numpy as np
import cv2
from numba import jit
# Custom imports
try:
from logger.logger import Logger
import utilities.exceptions
from cameras.CaptureManager import CaptureManager, createCaptureSourceData
from cameras.DisplayManager ... | 0 | 626 | 0 | 0 | 0 | 2,384 | 0 | 160 | 442 |
10bef9b5a34167ab75d179d166d27707e36a3c8a | 435 | py | Python | desafios/desafio 033a.py | juaoantonio/curso_video_python | 7520223d8647929530a1cd96f7c7d8c8f264ba1e | [
"MIT"
] | null | null | null | desafios/desafio 033a.py | juaoantonio/curso_video_python | 7520223d8647929530a1cd96f7c7d8c8f264ba1e | [
"MIT"
] | null | null | null | desafios/desafio 033a.py | juaoantonio/curso_video_python | 7520223d8647929530a1cd96f7c7d8c8f264ba1e | [
"MIT"
] | null | null | null | num1 = float(input('Digite o primeiro nmero: '))
num2 = float(input('Digite o segundo: '))
num3 = float(input('Digite o terceiro: '))
# Para descobrir qual o maior:
maior = num1
if num2 > maior:
maior = num2
if num3 > maior:
maior = num3
print(f'O maior nmero {maior}')
# Para descobrir qual o menor:
menor =... | 19.772727 | 49 | 0.655172 | num1 = float(input('Digite o primeiro número: '))
num2 = float(input('Digite o segundo: '))
num3 = float(input('Digite o terceiro: '))
# Para descobrir qual o maior:
maior = num1
if num2 > maior:
maior = num2
if num3 > maior:
maior = num3
print(f'O maior número é {maior}')
# Para descobrir qual o menor:
meno... | 10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1d2e3d2efff8dbcfc5dbf7a2395c42c519c52312 | 1,487 | py | Python | 7/Lab7.py | aravindsuresh98/ML_LAB | 2dbd8075a2119c02ce31de4325763058e41b592c | [
"MIT"
] | 3 | 2018-12-26T18:03:56.000Z | 2019-08-28T09:09:02.000Z | 7/Lab7.py | aravindsuresh98/ML_LAB | 2dbd8075a2119c02ce31de4325763058e41b592c | [
"MIT"
] | null | null | null | 7/Lab7.py | aravindsuresh98/ML_LAB | 2dbd8075a2119c02ce31de4325763058e41b592c | [
"MIT"
] | 2 | 2018-12-09T17:40:12.000Z | 2019-10-01T04:08:10.000Z | """
Write a program to construct aBayesian network considering medical data. Use this model to demonstrate the diagnosis of heart patients using standard Heart Disease Data Set. You can use Java/Python ML library classes/API.
"""
import numpy as np
import pandas as pd
import csv
from pgmpy.estimators import Maximu... | 33.795455 | 222 | 0.752522 | """
Write a program to construct aBayesian network considering medical data. Use this model to demonstrate the diagnosis of heart patients using standard Heart Disease Data Set. You can use Java/Python ML library classes/API.
"""
import numpy as np
import pandas as pd
import csv
from pgmpy.estimators import Maximu... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3d200ae33250c404db7e4e3699ca0722880f653b | 2,310 | py | Python | opencv.py | Kratos-is-here/Sign-Language-Recognition-CNNs | 4b7f4d726d111b80ca299c4ee0d6cb0cc9fe7a45 | [
"MIT"
] | 26 | 2020-07-22T09:55:51.000Z | 2022-03-31T14:36:10.000Z | opencv.py | Kratos-is-here/Sign-Language-Recognition-CNNs | 4b7f4d726d111b80ca299c4ee0d6cb0cc9fe7a45 | [
"MIT"
] | 1 | 2019-03-04T13:00:56.000Z | 2019-03-09T14:17:50.000Z | opencv.py | Kratos-is-here/Sign-Language-Recognition-CNNs | 4b7f4d726d111b80ca299c4ee0d6cb0cc9fe7a45 | [
"MIT"
] | 23 | 2019-03-17T21:00:19.000Z | 2020-05-18T07:04:34.000Z | import cv2
from keras.models import load_model
model = load_model('model.h5')
while True:
cam_capture = cv2.VideoCapture(0)
_, image_frame = cam_capture.read()
# Select ROI
im2 = crop_image(image_frame, 300,300,300,300)
image_grayscale = cv2.cvtColor(im2, cv2.COLOR_BGR2GRAY)
image_grays... | 25.955056 | 106 | 0.662338 | import cv2
import numpy as np
from keras.models import load_model
from skimage.transform import resize, pyramid_reduce
model = load_model('model.h5')
def get_square(image, square_size):
height, width = image.shape
if(height > width):
differ = height
else:
differ = width
differ += ... | 0 | 0 | 0 | 0 | 0 | 1,063 | 0 | 28 | 136 |
fbad7ab50f7c085f8d3fdacc6e39664949cd6fcb | 2,116 | py | Python | portfolio/Python/scrapy/naturebest/simplysupplements.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | null | null | null | portfolio/Python/scrapy/naturebest/simplysupplements.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | null | null | null | portfolio/Python/scrapy/naturebest/simplysupplements.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | 5 | 2016-03-22T07:40:46.000Z | 2021-05-30T16:12:21.000Z | import os
from product_spiders.items import ProductLoaderWithNameStrip\
as ProductLoader
HERE = os.path.abspath(os.path.dirname(__file__)) | 36.482759 | 80 | 0.634216 | import re
import os
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, HtmlResponse
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from urllib import urlencode
import hashlib
import csv
from product_spiders.item... | 0 | 0 | 0 | 1,608 | 0 | 0 | 0 | 94 | 245 |
0c16d56ca458115c2cc33d34e677bdd46dc3ff7f | 638 | py | Python | codeforces_api.py | belkka/codeforces-command-line-tool | 7882159cd5b7719ad747d3fa3bb5747899a93356 | [
"MIT"
] | null | null | null | codeforces_api.py | belkka/codeforces-command-line-tool | 7882159cd5b7719ad747d3fa3bb5747899a93356 | [
"MIT"
] | null | null | null | codeforces_api.py | belkka/codeforces-command-line-tool | 7882159cd5b7719ad747d3fa3bb5747899a93356 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
BASE_URL = 'http://codeforces.com/api/'
contest_standings = method('contest.standings')
user_info = method('user.info')
| 23.62963 | 73 | 0.601881 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import requests
BASE_URL = 'http://codeforces.com/api/'
def method(name):
def cf_api_method(**kwargs):
headers = { 'Accept-Language': 'ru,en;q=0.9' }
r = requests.get(BASE_URL + name, params=kwargs, headers=headers)
r.raise_for_status()
... | 0 | 0 | 0 | 0 | 0 | 427 | 0 | -6 | 45 |
aed730d21c0dbd6241b25e15d565858ffbdcb8b8 | 8,238 | py | Python | ModularER_2D/Encodings/Network_Encoding.py | FrankVeenstra/gym_rem2D | ea295e6398054c023c88df88d9c70f5486061207 | [
"MIT"
] | 27 | 2020-07-15T10:43:02.000Z | 2021-04-15T15:01:12.000Z | ModularER_2D/Encodings/Network_Encoding.py | FrankVeenstra/gym_rem2D | ea295e6398054c023c88df88d9c70f5486061207 | [
"MIT"
] | 3 | 2021-06-08T22:44:19.000Z | 2021-09-15T08:50:44.000Z | ModularER_2D/Encodings/Network_Encoding.py | FrankVeenstra/gym_rem2D | ea295e6398054c023c88df88d9c70f5486061207 | [
"MIT"
] | 6 | 2020-07-22T01:25:49.000Z | 2021-09-21T12:07:31.000Z | """
This encoding is an interface between neural networks and the robot blueprint
It is used to create a 'tree' structure that is interpreted as a robot.
"""
MAX_MODULES = 20
"""
Container Module : This is used to store arbitrary information of the module
which the L-System uses as a placeholder to create the tree ... | 36.776786 | 155 | 0.721413 | """
This encoding is an interface between neural networks and the robot blueprint
It is used to create a 'tree' structure that is interpreted as a robot.
"""
import numpy as np
import copy
import random
from Encodings import abstract_encoding as enc
import Tree as tree_structure
from NeuralNetwork import NEAT_NN
fro... | 0 | 0 | 0 | 7,509 | 0 | 0 | 0 | 42 | 246 |
c5b3b4160db42472260a053d6fa5098fe5dd5e7d | 2,029 | py | Python | sparrow_cloud/message_service/sender.py | ArcturusMensk/sparrow_cloud | 0ae75716de23b97366c2e2ac6c08e9850291c95d | [
"MIT"
] | null | null | null | sparrow_cloud/message_service/sender.py | ArcturusMensk/sparrow_cloud | 0ae75716de23b97366c2e2ac6c08e9850291c95d | [
"MIT"
] | null | null | null | sparrow_cloud/message_service/sender.py | ArcturusMensk/sparrow_cloud | 0ae75716de23b97366c2e2ac6c08e9850291c95d | [
"MIT"
] | null | null | null | from django.conf import settings
from .sender_controller import TaskSender
from sparrow_cloud.registry.service_discovery import consul_service
import time
#
# @lru_cache(maxsize=None)
# def get_tasks_sender_object(message_backend):
# task_sender = TaskSender(message_backend)
# return task_senderml
def get_set... | 32.206349 | 83 | 0.622474 | from django.conf import settings
from .sender_controller import TaskSender
from sparrow_cloud.registry.service_discovery import consul_service
from sparrow_cloud.restclient.exception import HTTPException
from functools import lru_cache
import time
#
# @lru_cache(maxsize=None)
# def get_tasks_sender_object(message_back... | 246 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 45 |
71a12dda1e6b4be8bc190b978385d5bf130b11eb | 32,955 | py | Python | pyloxi/loxi/of14/port_desc_prop.py | floodlight/loxigen-artifacts | 1822ec984cb6da342bbaa381677071cbbe53cee6 | [
"Apache-2.0"
] | 1 | 2017-06-01T09:41:07.000Z | 2017-06-01T09:41:07.000Z | pyloxi/loxi/of14/port_desc_prop.py | floodlight/loxigen-artifacts | 1822ec984cb6da342bbaa381677071cbbe53cee6 | [
"Apache-2.0"
] | 2 | 2017-07-03T08:50:56.000Z | 2018-03-12T16:16:19.000Z | pyloxi/loxi/of14/port_desc_prop.py | floodlight/loxigen-artifacts | 1822ec984cb6da342bbaa381677071cbbe53cee6 | [
"Apache-2.0"
] | 20 | 2015-02-16T15:23:04.000Z | 2022-03-15T20:06:10.000Z | # Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from ... | 33.593272 | 213 | 0.557123 | # Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from ... | 0 | 7,099 | 0 | 24,553 | 0 | 0 | 0 | -8 | 389 |
975822ef99828677846ed604310f8a03f9902b3c | 11,061 | py | Python | appearance_optimization/train_sim_corners.py | hietalajulius/clothmanip | ec2ee1177d5cf31ee2367c2576c34b9cf3691501 | [
"MIT"
] | null | null | null | appearance_optimization/train_sim_corners.py | hietalajulius/clothmanip | ec2ee1177d5cf31ee2367c2576c34b9cf3691501 | [
"MIT"
] | null | null | null | appearance_optimization/train_sim_corners.py | hietalajulius/clothmanip | ec2ee1177d5cf31ee2367c2576c34b9cf3691501 | [
"MIT"
] | null | null | null | import argparse
import cv2
if __name__ == "__main__":
parser = argparse.ArgumentParser("Parser")
parser.add_argument('folder', type=str)
parser.add_argument('frame_stack_size', type=int)
parser.add_argument('save_every_epoch', type=int)
args = parser.parse_args()
main(args) | 40.076087 | 144 | 0.596962 | from rlkit.torch.sac.policies import ScriptPolicy
import argparse
import json
import torch
from torch.utils.data import Dataset, DataLoader
import os
import pandas as pd
import numpy as np
from collections import deque
import cv2
import albumentations as A
import copy
from clothmanip.envs.template_renderer import Templ... | 0 | 0 | 0 | 5,443 | 0 | 4,809 | 0 | 54 | 444 |
77fec9c48291d0fcce36ad25599e588513744ea2 | 578 | py | Python | python/code_advent/year_2015/day_04.py | fdm1/advent_of_code | a1e91d847fd8fd9f6b2f48333203729b9d64fd80 | [
"MIT"
] | null | null | null | python/code_advent/year_2015/day_04.py | fdm1/advent_of_code | a1e91d847fd8fd9f6b2f48333203729b9d64fd80 | [
"MIT"
] | null | null | null | python/code_advent/year_2015/day_04.py | fdm1/advent_of_code | a1e91d847fd8fd9f6b2f48333203729b9d64fd80 | [
"MIT"
] | 1 | 2018-12-02T20:30:23.000Z | 2018-12-02T20:30:23.000Z | """ http://adventofcode.com/2015/day/4 """
from hashlib import md5
# pylint: disable=inconsistent-return-statements
def validate_hash(input_str, num_zeros):
"""Check if hex md5 starts with '00000'"""
if md5(input_str.encode('utf-8')).hexdigest().startswith('0'*num_zeros):
return input_str
def find_m... | 30.421053 | 76 | 0.679931 | """ http://adventofcode.com/2015/day/4 """
from hashlib import md5
# pylint: disable=inconsistent-return-statements
def validate_hash(input_str, num_zeros):
"""Check if hex md5 starts with '00000'"""
if md5(input_str.encode('utf-8')).hexdigest().startswith('0'*num_zeros):
return input_str
def find_m... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2748d48d24b53792d2e6016abf84bed1b3c6d82c | 7,227 | py | Python | scores/database.py | zesk06/scores | b1142d9630fcf6b5a969847ff4ef6856e08652ce | [
"MIT"
] | null | null | null | scores/database.py | zesk06/scores | b1142d9630fcf6b5a969847ff4ef6856e08652ce | [
"MIT"
] | null | null | null | scores/database.py | zesk06/scores | b1142d9630fcf6b5a969847ff4ef6856e08652ce | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
The database connection management
"""
from __future__ import print_function
| 33.613953 | 78 | 0.582399 | #!/usr/bin/env python
# encoding: utf-8
"""
The database connection management
"""
from __future__ import print_function
import datetime
import json
import logging
import os
import re
import subprocess
import tempfile
from mongokit import Connection
from .common import hash_password
from .play import Play, PlayMigr... | 0 | 1,528 | 0 | 5,325 | 0 | 0 | 0 | -17 | 268 |
15ed83d04674561587a56bf1fdc574c07867e3de | 1,481 | py | Python | catkin_ws/src:/opt/ros/kinetic/lib/python2.7/dist-packages:/home/bala/duckietown/catkin_ws/src:/home/bala/duckietown/catkin_ws/src/lib/python2.7/site-packages/geometry/manifolds/euclidean.py | johnson880319/Software | 045894227f359e0a3a3ec5b7a53f8d1ebc06acdd | [
"CC-BY-2.0"
] | null | null | null | catkin_ws/src:/opt/ros/kinetic/lib/python2.7/dist-packages:/home/bala/duckietown/catkin_ws/src:/home/bala/duckietown/catkin_ws/src/lib/python2.7/site-packages/geometry/manifolds/euclidean.py | johnson880319/Software | 045894227f359e0a3a3ec5b7a53f8d1ebc06acdd | [
"CC-BY-2.0"
] | null | null | null | catkin_ws/src:/opt/ros/kinetic/lib/python2.7/dist-packages:/home/bala/duckietown/catkin_ws/src:/home/bala/duckietown/catkin_ws/src/lib/python2.7/site-packages/geometry/manifolds/euclidean.py | johnson880319/Software | 045894227f359e0a3a3ec5b7a53f8d1ebc06acdd | [
"CC-BY-2.0"
] | null | null | null | # coding=utf-8
__all__ = ['Euclidean', 'R', 'R1', 'R2', 'R3']
R1 = Euclidean(1)
R2 = Euclidean(2)
R3 = Euclidean(3)
R = {1: R1, 2: R2, 3: R3}
| 25.534483 | 68 | 0.636057 | # coding=utf-8
from contracts import contract
from geometry.utils import assert_allclose
import numpy as np
from .matrix_linear_space import MatrixLinearSpace
__all__ = ['Euclidean', 'R', 'R1', 'R2', 'R3']
class Euclidean(MatrixLinearSpace):
'''
This is the usual Euclidean space of finite dimension;
... | 0 | 218 | 0 | 949 | 0 | 0 | 0 | 56 | 112 |
e6b656f7e2f5daf8de206906f2a56c825acac06a | 967 | py | Python | foodshering/mainapp/urls.py | malfin/silvehanger | c71a936a0c59c5a6fb909861cf2197b72782642d | [
"Apache-2.0"
] | null | null | null | foodshering/mainapp/urls.py | malfin/silvehanger | c71a936a0c59c5a6fb909861cf2197b72782642d | [
"Apache-2.0"
] | null | null | null | foodshering/mainapp/urls.py | malfin/silvehanger | c71a936a0c59c5a6fb909861cf2197b72782642d | [
"Apache-2.0"
] | null | null | null | from django.urls import path
import mainapp.views as mainapp
app_name = 'mainapp'
urlpatterns = [
path('', mainapp.index, name='index'),
path('cabinet/', mainapp.cabinet, name='cabinet'),
path('cabinet/profile/', mainapp.profile, name='profile'),
path('cabinet/profile/edit/', mainapp.edit_profile, ... | 37.192308 | 99 | 0.706308 | from django.urls import path
import mainapp.views as mainapp
app_name = 'mainapp'
urlpatterns = [
path('', mainapp.index, name='index'),
path('cabinet/', mainapp.cabinet, name='cabinet'),
path('cabinet/profile/', mainapp.profile, name='profile'),
path('cabinet/profile/edit/', mainapp.edit_profile, ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
893cab2c61ac550985eb0e17a32ce132b5022cd3 | 3,401 | py | Python | code/blackjack_doc.py | garyjames/building-skills-oo-design-book | e4deecfbef871983e9993ad4128ef1112ac0954a | [
"MIT"
] | 32 | 2019-11-02T20:05:47.000Z | 2022-03-24T21:34:56.000Z | code/blackjack_doc.py | garyjames/building-skills-oo-design-book | e4deecfbef871983e9993ad4128ef1112ac0954a | [
"MIT"
] | 5 | 2019-11-01T23:01:41.000Z | 2021-12-10T13:16:17.000Z | code/blackjack_doc.py | garyjames/building-skills-oo-design-book | e4deecfbef871983e9993ad4128ef1112ac0954a | [
"MIT"
] | 12 | 2019-11-05T04:04:30.000Z | 2021-12-10T12:59:22.000Z | #!/usr/bin/env python3
"""
Building Skills in Object-Oriented Design V4
The blackjack module includes the Suit class and Card class hierarchy.
:author: S. Lott
:license: http://creativecommons.org/licenses/by-nc-nd/3.0/us/
"""
| 26.364341 | 83 | 0.580712 | #!/usr/bin/env python3
"""
Building Skills in Object-Oriented Design V4
The blackjack module includes the Suit class and Card class hierarchy.
:author: S. Lott
:license: http://creativecommons.org/licenses/by-nc-nd/3.0/us/
"""
from typing import Any
import enum
class Suit(enum.Enum):
"""Enumerated suit names an... | 6 | 0 | 0 | 3,087 | 0 | 0 | 0 | -9 | 90 |
431ed5c4f7cfe1dec9f3003f9bf4c54d46e15e68 | 14,347 | py | Python | kerrlib.py | XanaduAI/kerr-squeezing | 633db9d39f0943d8a8b7431c8d87a9d1147ba32d | [
"Apache-2.0"
] | 1 | 2021-01-13T02:02:43.000Z | 2021-01-13T02:02:43.000Z | kerrlib.py | XanaduAI/kerr-squeezing | 633db9d39f0943d8a8b7431c8d87a9d1147ba32d | [
"Apache-2.0"
] | null | null | null | kerrlib.py | XanaduAI/kerr-squeezing | 633db9d39f0943d8a8b7431c8d87a9d1147ba32d | [
"Apache-2.0"
] | 5 | 2020-02-27T00:58:05.000Z | 2022-02-10T15:10:19.000Z | # Copyright 2019 Xanadu Quantum Technologies 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 agre... | 34.159524 | 100 | 0.596989 | # Copyright 2019 Xanadu Quantum Technologies 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 agre... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
16cc86fad7a7172c7c782122f5ad65bb2e4e6377 | 1,226 | py | Python | Python/counting_and_celebrating_fizzbuzz.py | RDxR10/Hacktoberfest-2020-FizzBuzz | c9a8e3a0ac1ff9886c013a6b5628b7f64eb0d342 | [
"Unlicense"
] | 80 | 2020-10-01T00:32:34.000Z | 2021-01-08T21:56:09.000Z | Python/counting_and_celebrating_fizzbuzz.py | RDxR10/Hacktoberfest-2020-FizzBuzz | c9a8e3a0ac1ff9886c013a6b5628b7f64eb0d342 | [
"Unlicense"
] | 672 | 2020-09-30T22:53:47.000Z | 2020-11-01T12:39:59.000Z | Python/counting_and_celebrating_fizzbuzz.py | RDxR10/Hacktoberfest-2020-FizzBuzz | c9a8e3a0ac1ff9886c013a6b5628b7f64eb0d342 | [
"Unlicense"
] | 618 | 2020-09-30T22:21:12.000Z | 2020-10-31T21:28:06.000Z | # This solution counts how many times the words "fizz" and "buzz" appear in a range provided by the user
# The input has to be a valid positive integer
# The current count of the word is shown each time the word appears, and a random expression for FizzBuzz
# Author: @moisesjsalmeida
import random
fizz = 0
buzz = 0
... | 24.039216 | 105 | 0.576672 | # This solution counts how many times the words "fizz" and "buzz" appear in a range provided by the user
# The input has to be a valid positive integer
# The current count of the word is shown each time the word appears, and a random expression for FizzBuzz
# Author: @moisesjsalmeida
import random
fizz = 0
buzz = 0
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
22c9b3edccaf1b55549a0d75ac9ddb40a856d3e2 | 5,449 | pyw | Python | examples/ctrltestjson/gui/gui.pyw | MrLeeh/pidctrl | 2e09eeb3fc5cf5cd72c69bf208c44b86e8d3f729 | [
"MIT"
] | 1 | 2018-03-04T06:13:49.000Z | 2018-03-04T06:13:49.000Z | examples/ctrltestjson/gui/gui.pyw | MrLeeh/pidctrl | 2e09eeb3fc5cf5cd72c69bf208c44b86e8d3f729 | [
"MIT"
] | null | null | null | examples/ctrltestjson/gui/gui.pyw | MrLeeh/pidctrl | 2e09eeb3fc5cf5cd72c69bf208c44b86e8d3f729 | [
"MIT"
] | 1 | 2018-07-17T11:58:59.000Z | 2018-07-17T11:58:59.000Z | #! python3
import sys
from PyQt5.QtWidgets import QApplication
COMPORT = "/dev/cu.usbmodemfd121"
if __name__ == "__main__":
app = QApplication(sys.argv)
w = CtrlTestGui()
w.show()
app.exec_()
| 29.93956 | 70 | 0.591485 | #! python3
import sys
import json
import serial
from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QSpinBox, \
QGridLayout, QPushButton, QGroupBox, QVBoxLayout
from PyQt5.QtCore import QTimer
COMPORT = "/dev/cu.usbmodemfd121"
class MySpinBox(QSpinBox):
def __init__(self, parent=None):
super(... | 0 | 0 | 0 | 5,048 | 0 | 0 | 0 | 75 | 112 |
d10c481606909bb2fa1e303b6d6b2e830bddf544 | 12,306 | py | Python | tests/test_ts_dweepy.py | jeffskinnerbox/ts_dweepy | 9b6de51e145979a61a9be295e91d70db199b61f4 | [
"MIT"
] | null | null | null | tests/test_ts_dweepy.py | jeffskinnerbox/ts_dweepy | 9b6de51e145979a61a9be295e91d70db199b61f4 | [
"MIT"
] | null | null | null | tests/test_ts_dweepy.py | jeffskinnerbox/ts_dweepy | 9b6de51e145979a61a9be295e91d70db199b61f4 | [
"MIT"
] | null | null | null | """A port of dweetio-client's (the official javascript one, to python)
"""
# stdlib imports
import os
# local imports
test_data = {
'hello': "world",
'somenum': 6816513845,
}
test_lock = os.environ.get('DWEET_LOCK')
test_key = os.environ.get('DWEET_KEY')
test_alert_condition = "if(dweet.alertValue > 10) ret... | 34.470588 | 143 | 0.638388 | """A port of dweetio-client's (the official javascript one, to python)
"""
# stdlib imports
import os
import subprocess
import unittest
import uuid
# local imports
import ts_dweepy
test_data = {
'hello': "world",
'somenum': 6816513845,
}
test_lock = os.environ.get('DWEET_LOCK')
test_key = os.environ.get('DW... | 0 | 0 | 0 | 11,150 | 0 | 448 | 0 | -25 | 318 |
5560185c50cf1a154a62e288d5ae7d5ec860334c | 101 | py | Python | HighSchool/Python/DoNow1.02/code.py | SomeAspy/SchoolRepos | 57a45a8dfae19fda604d1a68f716f6b8da4fb614 | [
"MIT"
] | null | null | null | HighSchool/Python/DoNow1.02/code.py | SomeAspy/SchoolRepos | 57a45a8dfae19fda604d1a68f716f6b8da4fb614 | [
"MIT"
] | null | null | null | HighSchool/Python/DoNow1.02/code.py | SomeAspy/SchoolRepos | 57a45a8dfae19fda604d1a68f716f6b8da4fb614 | [
"MIT"
] | null | null | null | # Baker, Aiden
# 2/10/2021
# DoNow1.2
print("Sensei, I am ready for the next stage in my training!") | 20.2 | 62 | 0.693069 | # Baker, Aiden
# 2/10/2021
# DoNow1.2
print("Sensei, I am ready for the next stage in my training!") | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4d95f30293af967cda96102dcc32dcb0a991adee | 11,286 | py | Python | landshark/featurewrite.py | basaks/landshark | 87ec1fada74addd58f37bdaf3b1adbc10b1544b2 | [
"Apache-2.0"
] | null | null | null | landshark/featurewrite.py | basaks/landshark | 87ec1fada74addd58f37bdaf3b1adbc10b1544b2 | [
"Apache-2.0"
] | null | null | null | landshark/featurewrite.py | basaks/landshark | 87ec1fada74addd58f37bdaf3b1adbc10b1544b2 | [
"Apache-2.0"
] | null | null | null | """Importing routines for tif data."""
# Copyright 2019 CSIRO (Data61)
#
# 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 b... | 35.37931 | 87 | 0.710881 | """Importing routines for tif data."""
# Copyright 2019 CSIRO (Data61)
#
# 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 b... | 0 | 0 | 0 | 0 | 0 | 9,437 | 0 | 407 | 706 |
bd03439b02c98195c005e44d40314c0550e419b7 | 73 | py | Python | topcoder/shoppingSurvey.py | leetcode-notes/daily-algorithms-practice | 2a03499ed0b403d79f6c8451c9a839991b23e188 | [
"Unlicense"
] | null | null | null | topcoder/shoppingSurvey.py | leetcode-notes/daily-algorithms-practice | 2a03499ed0b403d79f6c8451c9a839991b23e188 | [
"Unlicense"
] | null | null | null | topcoder/shoppingSurvey.py | leetcode-notes/daily-algorithms-practice | 2a03499ed0b403d79f6c8451c9a839991b23e188 | [
"Unlicense"
] | null | null | null | '''
https://community.topcoder.com/stat?c=problem_statement&pm=13458
'''
| 18.25 | 64 | 0.739726 | '''
https://community.topcoder.com/stat?c=problem_statement&pm=13458
'''
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2cd41a78a13cac1862d1a1ad5988a82485acbc67 | 787 | py | Python | Another Card Game Problem.py | ganeshbs17/PythonAndCPP-Programs | 7a00c3fad84dc2e721e29732f998e151bd122213 | [
"MIT"
] | null | null | null | Another Card Game Problem.py | ganeshbs17/PythonAndCPP-Programs | 7a00c3fad84dc2e721e29732f998e151bd122213 | [
"MIT"
] | null | null | null | Another Card Game Problem.py | ganeshbs17/PythonAndCPP-Programs | 7a00c3fad84dc2e721e29732f998e151bd122213 | [
"MIT"
] | 3 | 2019-10-23T05:23:20.000Z | 2020-10-04T16:47:45.000Z | T = int(input())
lst = []
while T>0:
l = [0,0]
a,b = input().split()
Pc, Pr = int(a), int(b)
Pcs = str(Pc)
Prs = str(Pr)
if len(Pcs)==1:
cdigit = 1
else:
if Pc%9==0:
cdigit = Pc//9
else:
cdigit = Pc//9 +1
if len(Prs) == 1:
rdigit = ... | 19.195122 | 36 | 0.402795 | T = int(input())
lst = []
while T>0:
l = [0,0]
a,b = input().split()
Pc, Pr = int(a), int(b)
Pcs = str(Pc)
Prs = str(Pr)
if len(Pcs)==1:
cdigit = 1
else:
if Pc%9==0:
cdigit = Pc//9
else:
cdigit = Pc//9 +1
if len(Prs) == 1:
rdigit = ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2c4ec8eb7d9bd3bb334effc2bc7734617aee7ee7 | 14,995 | py | Python | tensorflow_lattice/python/estimators/calibrated_etl_test.py | agiledots/study-lattice | 7653b3565e4b4c72def59c7f3608cddfc9e80fe2 | [
"Apache-2.0"
] | null | null | null | tensorflow_lattice/python/estimators/calibrated_etl_test.py | agiledots/study-lattice | 7653b3565e4b4c72def59c7f3608cddfc9e80fe2 | [
"Apache-2.0"
] | null | null | null | tensorflow_lattice/python/estimators/calibrated_etl_test.py | agiledots/study-lattice | 7653b3565e4b4c72def59c7f3608cddfc9e80fe2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Lattice Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 38.84715 | 80 | 0.707436 | # Copyright 2017 The TensorFlow Lattice Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 0 | 0 | 0 | 13,717 | 0 | 0 | 0 | 240 | 203 |
abf8fffa0a014cabc8796701056b992fa5fe0748 | 717 | py | Python | 2805/solution.py | bossm0n5t3r/BOJ | 03132388a0c76ef66d6b0dec2053aeca65c4aee6 | [
"MIT"
] | 2 | 2020-01-14T07:27:25.000Z | 2020-02-12T07:49:58.000Z | 2805/solution.py | bossm0n5t3r/BOJ | 03132388a0c76ef66d6b0dec2053aeca65c4aee6 | [
"MIT"
] | 1 | 2020-01-14T07:29:30.000Z | 2021-11-28T11:29:08.000Z | 2805/solution.py | bossm0n5t3r/BOJ | 03132388a0c76ef66d6b0dec2053aeca65c4aee6 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
sol()
| 22.40625 | 83 | 0.507671 | import sys
def sol():
input = sys.stdin.readline
_, M = map(int, input().split())
trees = list(map(int, input().split()))
trees_count = dict()
for tree in trees:
if tree not in trees_count:
trees_count[tree] = 0
trees_count[tree] += 1
trees_set = set(trees)
low ... | 0 | 0 | 0 | 0 | 0 | 643 | 0 | -11 | 45 |
93b740132d591f6b898088a73051cbbfe27be76e | 3,762 | py | Python | bin/cov-report.py | ben-marshall/riscv-multi-cycle | 9e0295e05cb0334a7349c82b3cd4dc89732621bb | [
"MIT"
] | 3 | 2020-07-11T14:47:44.000Z | 2020-10-25T10:11:52.000Z | bin/cov-report.py | ben-marshall/riscv-multi-cycle | 9e0295e05cb0334a7349c82b3cd4dc89732621bb | [
"MIT"
] | 4 | 2017-09-30T11:08:58.000Z | 2017-10-01T11:07:10.000Z | bin/cov-report.py | ben-marshall/riscv-multi-cycle | 9e0295e05cb0334a7349c82b3cd4dc89732621bb | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
Post processes the line and toggle coverage reports from verilator into
something which is easier to read and review.
"""
import os
import sys
import argparse
import jinja2
def parseargs():
"""
Parses and returns all command line arguments to the program.
"""
parser = a... | 25.418919 | 74 | 0.567783 | #!/usr/bin/python3
"""
Post processes the line and toggle coverage reports from verilator into
something which is easier to read and review.
"""
import os
import re
import sys
import yaml
import argparse
import jinja2
class AnnotatedFile(object):
"""
Describes a single annotated file.
"""
def __in... | 0 | 0 | 0 | 2,022 | 0 | 0 | 0 | -22 | 67 |
19cba88efb532cb217760e9f1d9de3fd077eba5c | 5,860 | py | Python | repsim/geometry/manifold.py | wrongu/representational-similarity | adca614053973def176044437e6a064c04943ce0 | [
"MIT"
] | 2 | 2022-03-23T21:24:21.000Z | 2022-03-24T04:18:30.000Z | repsim/geometry/manifold.py | wrongu/representational-similarity | adca614053973def176044437e6a064c04943ce0 | [
"MIT"
] | 3 | 2022-03-23T19:35:58.000Z | 2022-03-24T04:20:29.000Z | repsim/geometry/manifold.py | wrongu/representational-similarity | adca614053973def176044437e6a064c04943ce0 | [
"MIT"
] | 1 | 2022-03-23T19:16:19.000Z | 2022-03-23T19:16:19.000Z | import torch
# Typing hints: a Point is a tensor with some shape, and a scalar is, well, a single-element tensor
Point = torch.Tensor
Scalar = torch.Tensor
__all__ = ['Point', 'Scalar', 'Manifold', 'HyperSphere', 'Matrix', 'SPDMatrix', 'DistMatrix']
| 40.979021 | 150 | 0.642491 | import torch
import warnings
from typing import Callable
# Typing hints: a Point is a tensor with some shape, and a scalar is, well, a single-element tensor
Point = torch.Tensor
Scalar = torch.Tensor
class Manifold(object):
"""Base class for Manifolds with an associated length(). In other words, a Length Space
... | 0 | 0 | 0 | 5,394 | 0 | 0 | 0 | 0 | 205 |
310d03a2a06ea0330c44ddbf4414a9bc415e020d | 6,116 | py | Python | plot_precip_freq.py | quantheory/E3SMTimestepStudy | 63b5517c2a92dfae7af0cd7aa0eb39058967ed06 | [
"BSD-3-Clause"
] | null | null | null | plot_precip_freq.py | quantheory/E3SMTimestepStudy | 63b5517c2a92dfae7af0cd7aa0eb39058967ed06 | [
"BSD-3-Clause"
] | null | null | null | plot_precip_freq.py | quantheory/E3SMTimestepStudy | 63b5517c2a92dfae7af0cd7aa0eb39058967ed06 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from os.path import join
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import netCDF4 as nc4
from e3sm_case_output import day_str
REF_CASE_NAME = "timestep_ctrl"
TEST_CASE_NAME = "timestep_all_10s"
OUTPUT_DIR = "/p/lustre2/santos36/timestep_precip/"... | 32.705882 | 102 | 0.648136 | #!/usr/bin/env python
from os.path import join
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import netCDF4 as nc4
from e3sm_case_output import day_str
REF_CASE_NAME = "timestep_ctrl"
TEST_CASE_NAME = "timestep_all_10s"
OUTPUT_DIR = "/p/lustre2/santos36/timestep_precip/"... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
85c011d5fd1f1068fadaa8f517a5575e97abe328 | 2,618 | py | Python | misc_base/models.py | BlackWizard/django-misc-base | 892752f4c4553e2b936b8be861639f2d8141b57e | [
"BSD-2-Clause"
] | null | null | null | misc_base/models.py | BlackWizard/django-misc-base | 892752f4c4553e2b936b8be861639f2d8141b57e | [
"BSD-2-Clause"
] | null | null | null | misc_base/models.py | BlackWizard/django-misc-base | 892752f4c4553e2b936b8be861639f2d8141b57e | [
"BSD-2-Clause"
] | null | null | null | # coding=utf-8
from django.utils.translation import ugettext_lazy as _
STATUS = (
(0, _(u'Active')),
(1, _(u'Editing')),
(127, _(u'Deleted')),
)
| 25.666667 | 106 | 0.673415 | # coding=utf-8
from django.db import models
from django.utils.translation import ugettext_lazy as _
from positions.fields import PositionField
from .utils import slugify
class SlugNameMixin(object):
def get_slug_name(self):
return slugify(self.name or 'xxx')
class BaseModel(models.Model):
id = m... | 0 | 0 | 0 | 1,813 | 0 | 265 | 0 | 33 | 345 |
6a22db10765e458b572b2d7d29224f15f4ab8bac | 12,254 | py | Python | monai/transforms/transform.py | zomglings/MONAI | ba127a2077b1a5d8aed01bc98a6f9550cc191c2b | [
"Apache-2.0"
] | 1 | 2022-01-04T21:38:23.000Z | 2022-01-04T21:38:23.000Z | monai/transforms/transform.py | zomglings/MONAI | ba127a2077b1a5d8aed01bc98a6f9550cc191c2b | [
"Apache-2.0"
] | null | null | null | monai/transforms/transform.py | zomglings/MONAI | ba127a2077b1a5d8aed01bc98a6f9550cc191c2b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 - 2021 MONAI Consortium
# 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 wri... | 40.576159 | 116 | 0.641342 | # Copyright 2020 - 2021 MONAI Consortium
# 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 wri... | 0 | 2,662 | 0 | 6,488 | 0 | 423 | 0 | 110 | 239 |
a604bcc2feb54145cd7e314879b51b49335aca5d | 332 | py | Python | bin/wiki_entity_linking/__init__.py | jaydeepborkar/spaCy | 16aa092fb5cffb5ec7079951ea0c04cb96733b3e | [
"MIT"
] | 1 | 2020-04-13T09:54:11.000Z | 2020-04-13T09:54:11.000Z | bin/wiki_entity_linking/__init__.py | jaydeepborkar/spaCy | 16aa092fb5cffb5ec7079951ea0c04cb96733b3e | [
"MIT"
] | 1 | 2021-08-16T13:39:17.000Z | 2021-08-16T13:39:40.000Z | bin/wiki_entity_linking/__init__.py | jaydeepborkar/spaCy | 16aa092fb5cffb5ec7079951ea0c04cb96733b3e | [
"MIT"
] | null | null | null | TRAINING_DATA_FILE = "gold_entities.jsonl"
KB_FILE = "kb"
KB_MODEL_DIR = "nlp_kb"
OUTPUT_MODEL_DIR = "nlp"
PRIOR_PROB_PATH = "prior_prob.csv"
ENTITY_DEFS_PATH = "entity_defs.csv"
ENTITY_FREQ_PATH = "entity_freq.csv"
ENTITY_DESCR_PATH = "entity_descriptions.csv"
LOG_FORMAT = '%(asctime)s - %(levelname)s - %(name)s - %... | 27.666667 | 67 | 0.753012 | TRAINING_DATA_FILE = "gold_entities.jsonl"
KB_FILE = "kb"
KB_MODEL_DIR = "nlp_kb"
OUTPUT_MODEL_DIR = "nlp"
PRIOR_PROB_PATH = "prior_prob.csv"
ENTITY_DEFS_PATH = "entity_defs.csv"
ENTITY_FREQ_PATH = "entity_freq.csv"
ENTITY_DESCR_PATH = "entity_descriptions.csv"
LOG_FORMAT = '%(asctime)s - %(levelname)s - %(name)s - %... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f0d861f6d094f9a75ab941324978b9c519a79719 | 1,959 | py | Python | tools/hyphy/hyphy_dnds_wrapper.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | 2 | 2016-02-23T00:09:14.000Z | 2019-02-11T07:48:44.000Z | tools/hyphy/hyphy_dnds_wrapper.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | null | null | null | tools/hyphy/hyphy_dnds_wrapper.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | 6 | 2015-05-27T13:09:50.000Z | 2019-02-11T07:48:46.000Z | #Guru
#takes fasta alignments, a distance metric and builds neighbor joining trees
import os, sys
from galaxy import eggs
from galaxy.tools.util import hyphy_util
#Retrieve hyphy path, this will need to be the same across the cluster
tool_data = sys.argv.pop()
HYPHY_PATH = os.path.join( tool_data, "HYPHY" )
H... | 34.982143 | 185 | 0.749872 | #Guru
#takes fasta alignments, a distance metric and builds neighbor joining trees
import os, sys
from galaxy import eggs
from galaxy.tools.util import hyphy_util
#Retrieve hyphy path, this will need to be the same across the cluster
tool_data = sys.argv.pop()
HYPHY_PATH = os.path.join( tool_data, "HYPHY" )
H... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8125151defc927e2468ec42eb02ccff4539de78e | 7,086 | py | Python | libcloud/dns/drivers/nfsn.py | rgharris/libcloud | 90971e17bfd7b6bb97b2489986472c531cc8e140 | [
"Apache-2.0"
] | null | null | null | libcloud/dns/drivers/nfsn.py | rgharris/libcloud | 90971e17bfd7b6bb97b2489986472c531cc8e140 | [
"Apache-2.0"
] | 1 | 2021-12-06T12:29:13.000Z | 2021-12-06T12:29:13.000Z | libcloud/dns/drivers/nfsn.py | rgharris/libcloud | 90971e17bfd7b6bb97b2489986472c531cc8e140 | [
"Apache-2.0"
] | 1 | 2019-08-05T10:12:02.000Z | 2019-08-05T10:12:02.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 use ... | 35.43 | 88 | 0.61304 | # 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 use ... | 0 | 0 | 0 | 5,312 | 0 | 0 | 0 | 214 | 200 |
1e371328c8cf302eacc938b92f76d89402befdf2 | 5,823 | py | Python | jelly_api_2/collated.py | chalbersma/manowar | 023a696f7ea0458e1c2ae9a18e40a9d09e824cc4 | [
"BSD-2-Clause"
] | 3 | 2019-02-16T03:14:11.000Z | 2020-05-28T23:14:23.000Z | jelly_api_2/collated.py | chalbersma/manowar | 023a696f7ea0458e1c2ae9a18e40a9d09e824cc4 | [
"BSD-2-Clause"
] | 4 | 2018-08-09T22:39:59.000Z | 2020-02-12T00:36:47.000Z | jelly_api_2/collated.py | chalbersma/manowar | 023a696f7ea0458e1c2ae9a18e40a9d09e824cc4 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
'''
Copyright 2018, VDMS
Licensed under the terms of the BSD 2-clause license. See LICENSE file for terms.
/collated endpoints. Designed to return info about audit by audit, pop & srvtype.
Accepts a regex filter for the main name
```swagger-yaml
/collated/{collatedType}/ :
get:
descripti... | 40.158621 | 130 | 0.541645 | #!/usr/bin/env python3
'''
Copyright 2018, VDMS
Licensed under the terms of the BSD 2-clause license. See LICENSE file for terms.
/collated endpoints. Designed to return info about audit by audit, pop & srvtype.
Accepts a regex filter for the main name
```swagger-yaml
/collated/{collatedType}/ :
get:
descripti... | 0 | 3,673 | 0 | 0 | 0 | 0 | 0 | 6 | 157 |
9f88efaf4ff38b554053dcc696d1d7d52cbd31ab | 1,511 | py | Python | src/Instructions/add.py | martydill/PyCIL | 7f9db640e921bfc61dcedd1cbd217b61d107afb8 | [
"BSD-2-Clause"
] | 3 | 2016-09-05T18:37:15.000Z | 2021-12-24T02:22:06.000Z | src/Instructions/add.py | martydill/PyCIL | 7f9db640e921bfc61dcedd1cbd217b61d107afb8 | [
"BSD-2-Clause"
] | null | null | null | src/Instructions/add.py | martydill/PyCIL | 7f9db640e921bfc61dcedd1cbd217b61d107afb8 | [
"BSD-2-Clause"
] | 1 | 2018-11-28T16:57:41.000Z | 2018-11-28T16:57:41.000Z | # add.py
# The CIL add instruction
# Copyright 2010 Marty Dill - see LICENSE for details
from Instructions.Instruction import register
register('add', add)
| 24.770492 | 71 | 0.618134 | # add.py
# The CIL add instruction
# Copyright 2010 Marty Dill - see LICENSE for details
from Instruction import Instruction
import unittest
from Stack import StackStateException
from Instructions.Instruction import register
from Variable import Variable
class add(Instruction):
def __init__(self, arguments):
... | 0 | 0 | 0 | 1,185 | 0 | 0 | 0 | 32 | 135 |
f3752141bb1c3e9db433c81b4841a4b0d6c506f1 | 193 | py | Python | python/demo-django/env/bin/django-admin.py | denisroldan/talentum-2015-examples | 4980f49dca56a55d26722f4f6d1fdd88e06f38dd | [
"MIT"
] | null | null | null | python/demo-django/env/bin/django-admin.py | denisroldan/talentum-2015-examples | 4980f49dca56a55d26722f4f6d1fdd88e06f38dd | [
"MIT"
] | null | null | null | python/demo-django/env/bin/django-admin.py | denisroldan/talentum-2015-examples | 4980f49dca56a55d26722f4f6d1fdd88e06f38dd | [
"MIT"
] | null | null | null | #!/Users/denisroldan/Projects/talentum-2015-examples/python/demo-django/env/bin/python
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 32.166667 | 86 | 0.803109 | #!/Users/denisroldan/Projects/talentum-2015-examples/python/demo-django/env/bin/python
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c01037bf169e5627f48aedb675f699cbe211bc34 | 559 | py | Python | django_reusable/settings/dev.py | Gaurav-Zaiswal/django-reusable | 8444964c12ed44aa351b85869f5335442aa66112 | [
"MIT"
] | null | null | null | django_reusable/settings/dev.py | Gaurav-Zaiswal/django-reusable | 8444964c12ed44aa351b85869f5335442aa66112 | [
"MIT"
] | 4 | 2021-03-30T13:57:58.000Z | 2021-06-10T19:52:43.000Z | django_reusable/settings/dev.py | Gaurav-Zaiswal/django-reusable | 8444964c12ed44aa351b85869f5335442aa66112 | [
"MIT"
] | null | null | null | # this file contains only those settings which are used in developing phase
# and extends base.py settings, which has all the default settings
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases... | 24.304348 | 75 | 0.719141 | # this file contains only those settings which are used in developing phase
# and extends base.py settings, which has all the default settings
from django_reusable.settings.base import *
from django_reusable.settings.third_party import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 51 | 45 |
7c5b3918b27f7ea335c7cdecec8a7299e58e7ecd | 7,399 | py | Python | lingvo/core/gpipe_test.py | zh794390558/lingvo | ecdf678179018ca07f4f52d065b9bf3fe2dc7c5a | [
"Apache-2.0"
] | null | null | null | lingvo/core/gpipe_test.py | zh794390558/lingvo | ecdf678179018ca07f4f52d065b9bf3fe2dc7c5a | [
"Apache-2.0"
] | null | null | null | lingvo/core/gpipe_test.py | zh794390558/lingvo | ecdf678179018ca07f4f52d065b9bf3fe2dc7c5a | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2019 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
#
... | 34.25463 | 80 | 0.682795 | # Lint as: python2, python3
# Copyright 2019 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
#
... | 0 | 610 | 0 | 3,411 | 0 | 209 | 0 | 110 | 224 |
9762b54562918486894c34db65409bf6cafb0c48 | 1,984 | py | Python | astoria/common/ipc/manager_messages.py | trickeydan/astoria | ef08ed4be4d5997751846b0cadce9aa8261ae151 | [
"MIT"
] | null | null | null | astoria/common/ipc/manager_messages.py | trickeydan/astoria | ef08ed4be4d5997751846b0cadce9aa8261ae151 | [
"MIT"
] | 7 | 2020-11-29T13:03:10.000Z | 2020-12-09T17:20:25.000Z | astoria/common/ipc/manager_messages.py | trickeydan/astoria | ef08ed4be4d5997751846b0cadce9aa8261ae151 | [
"MIT"
] | null | null | null | """Manager Messages."""
| 25.113924 | 82 | 0.676915 | """Manager Messages."""
from enum import Enum
from pathlib import Path
from typing import Dict, Optional
from pydantic import BaseModel
from astoria import __version__
from astoria.common.code_status import CodeStatus
from astoria.common.disks import DiskInfo, DiskTypeCalculator, DiskUUID
from astoria.common.metadata... | 0 | 0 | 0 | 1,551 | 0 | 0 | 0 | 135 | 270 |
2c47a06edef748d2550206e58519c69a3d30383a | 361 | py | Python | python__advanced/06.multidimensional_lists_exercise/01.diagonal_difference.py | EmilianStoyanov/Projects-in-SoftUni | e83996670fe00424a158905d537a7bbbeee8fb59 | [
"MIT"
] | 1 | 2020-07-14T12:32:47.000Z | 2020-07-14T12:32:47.000Z | python__advanced/06.multidimensional_lists_exercise/01.diagonal_difference.py | EmilianStoyanov/Projects-in-SoftUni | e83996670fe00424a158905d537a7bbbeee8fb59 | [
"MIT"
] | null | null | null | python__advanced/06.multidimensional_lists_exercise/01.diagonal_difference.py | EmilianStoyanov/Projects-in-SoftUni | e83996670fe00424a158905d537a7bbbeee8fb59 | [
"MIT"
] | null | null | null | size = int(input())
matrix = []
for _ in range(size):
matrix.append([int(x) for x in input().split()])
primary_diagonal_sum = 0
secondary_diagonal_sum = 0
for i in range(len(matrix)):
primary_diagonal_sum += matrix[i][i]
secondary_diagonal_sum += matrix[i][size - i - 1]
total = abs(primary_diagonal_sum... | 20.055556 | 58 | 0.698061 | size = int(input())
matrix = []
for _ in range(size):
matrix.append([int(x) for x in input().split()])
primary_diagonal_sum = 0
secondary_diagonal_sum = 0
for i in range(len(matrix)):
primary_diagonal_sum += matrix[i][i]
secondary_diagonal_sum += matrix[i][size - i - 1]
total = abs(primary_diagonal_sum... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
087469a2e7af55aa32f7a246ba541e7cd74014c4 | 165 | py | Python | zvt/recorders/eastmoney/trading/__init__.py | h521822/zvt | c6bcc2b340406da55d920a411f59ab8d4cc7e76d | [
"MIT"
] | 22 | 2020-10-22T14:24:32.000Z | 2022-03-30T22:19:14.000Z | zvt/recorders/eastmoney/trading/__init__.py | h521822/zvt | c6bcc2b340406da55d920a411f59ab8d4cc7e76d | [
"MIT"
] | 2 | 2019-12-20T13:12:30.000Z | 2020-01-03T06:24:30.000Z | zvt/recorders/eastmoney/trading/__init__.py | h521822/zvt | c6bcc2b340406da55d920a411f59ab8d4cc7e76d | [
"MIT"
] | 6 | 2021-01-14T20:50:06.000Z | 2022-01-11T23:12:43.000Z | # -*- coding: utf-8 -*-
| 41.25 | 70 | 0.806061 | # -*- coding: utf-8 -*-
from zvt.recorders.eastmoney.trading.holder_trading_recorder import *
from zvt.recorders.eastmoney.trading.manager_trading_recorder import *
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 97 | 44 |
bf29b24d082fbb7129c2bab18736d49934635b11 | 5,518 | py | Python | vae/train_vae.py | mazrk7/tf_playground | 81ad741f2bfe439bab85783ccf82d4715a3adef6 | [
"MIT"
] | null | null | null | vae/train_vae.py | mazrk7/tf_playground | 81ad741f2bfe439bab85783ccf82d4715a3adef6 | [
"MIT"
] | null | null | null | vae/train_vae.py | mazrk7/tf_playground | 81ad741f2bfe439bab85783ccf82d4715a3adef6 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import sys
import tensorflow as tf
IMAGE_SIZE = 28
IMAGE_PIXELS = IMAGE_SIZE * IMAGE_SIZE
# Define the VAE network architecture
if __name__ == '__main__':
parser = argparse.Argumen... | 45.229508 | 153 | 0.677419 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import sys
import tensorflow as tf
from dataset import load_data
from vae import VAE
from conv_vae import ConvVAE
IMAGE_SIZE = 28
IMAGE_PIXELS = IMAGE_SIZE * IMAGE_SIZE
# Define the VAE netw... | 0 | 0 | 0 | 0 | 0 | 3,562 | 0 | 13 | 112 |
d20aa03a15a837c91185bec2a28b723f48ec4b9e | 923 | py | Python | app/handler.py | developmentseed/cogeo-watchbot | ef1f859c0d02c5e27d97b9ac407b3a13a0d7a57a | [
"MIT"
] | 2 | 2019-10-09T11:28:32.000Z | 2019-11-06T16:52:50.000Z | app/handler.py | developmentseed/cogeo-watchbot | ef1f859c0d02c5e27d97b9ac407b3a13a0d7a57a | [
"MIT"
] | 4 | 2019-09-11T14:52:57.000Z | 2020-02-28T15:15:32.000Z | app/handler.py | developmentseed/cogeo-watchbot | ef1f859c0d02c5e27d97b9ac407b3a13a0d7a57a | [
"MIT"
] | null | null | null | """public facing api."""
from lambda_proxy.proxy import API
app = API(name="cogeo-watchbot-api", debug=True)
| 25.638889 | 68 | 0.690141 | """public facing api."""
from typing import Dict, Tuple
import os
import json
import base64
from . import version as app_version
from cogeo_mosaic.utils import get_hash, _aws_put_data
from lambda_proxy.proxy import API
app = API(name="cogeo-watchbot-api", debug=True)
@app.route("/upload", methods=["POST"], cors=... | 0 | 626 | 0 | 0 | 0 | 0 | 0 | 27 | 158 |
a617790f4aa4b00c7b1d77ae07d523b65d4fa7dd | 1,091 | py | Python | config/settings/development.py | rublixdev/hedge-legacy | 35d4ed73e6cdbf06bbbfa70e64ec8ef33b48d07c | [
"MIT"
] | null | null | null | config/settings/development.py | rublixdev/hedge-legacy | 35d4ed73e6cdbf06bbbfa70e64ec8ef33b48d07c | [
"MIT"
] | null | null | null | config/settings/development.py | rublixdev/hedge-legacy | 35d4ed73e6cdbf06bbbfa70e64ec8ef33b48d07c | [
"MIT"
] | null | null | null |
# DEBUG
# ------------------------------------------------------------------------------
DEBUG = True
# SECRET CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
# Note: This key only used for development and testing.
# -----------------------------------------------------------------... | 32.088235 | 80 | 0.482126 | import os
from .base import *
# DEBUG
# ------------------------------------------------------------------------------
DEBUG = True
# SECRET CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
# Note: This key only used for development and testing.
# -----------------------------------... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -14 | 44 |
ab014d49236b3ce9b9b968d882b5aee69a5f7ad5 | 416 | py | Python | pandas/arrays/__init__.py | ivary43/pandas | 46adc5b1c2aacb312d72729af72bc0ad600917c0 | [
"BSD-3-Clause"
] | null | null | null | pandas/arrays/__init__.py | ivary43/pandas | 46adc5b1c2aacb312d72729af72bc0ad600917c0 | [
"BSD-3-Clause"
] | null | null | null | pandas/arrays/__init__.py | ivary43/pandas | 46adc5b1c2aacb312d72729af72bc0ad600917c0 | [
"BSD-3-Clause"
] | null | null | null | """
All of pandas' ExtensionArrays.
See :ref:`extending.extension-types` for more.
"""
from pandas.core.arrays import (Categorical, DatetimeArray, IntegerArray, IntervalArray, PandasArray, PeriodArray, SparseArray, TimedeltaArray)
__all__ = [
'Categorical',
'DatetimeArray',
'IntegerArray',
'IntervalAr... | 20.8 | 73 | 0.689904 | """
All of pandas' ExtensionArrays.
See :ref:`extending.extension-types` for more.
"""
from pandas.core.arrays import (
Categorical, DatetimeArray, IntegerArray, IntervalArray, PandasArray,
PeriodArray, SparseArray, TimedeltaArray)
__all__ = [
'Categorical',
'DatetimeArray',
'IntegerArray',
'I... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 0 |
8f83a29f0ea87aa40b25da66d5f88ab1ef2c9f61 | 8,381 | py | Python | timespent.py | xuthus/gitlab-timespent | 5f193116effac31f90acf1402b41c8bfa2a27280 | [
"Apache-2.0"
] | null | null | null | timespent.py | xuthus/gitlab-timespent | 5f193116effac31f90acf1402b41c8bfa2a27280 | [
"Apache-2.0"
] | null | null | null | timespent.py | xuthus/gitlab-timespent | 5f193116effac31f90acf1402b41c8bfa2a27280 | [
"Apache-2.0"
] | null | null | null | import os
from multiprocessing.dummy import Pool as ThreadPool
import requests
import xlsxwriter
from pyslurpers import JsonSlurper
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
if __name__ == "__main__":
total_seconds = 0
config = JsonSlurper.create(
file_n... | 37.415179 | 140 | 0.571412 | import os
from multiprocessing.dummy import Pool as ThreadPool
import requests
import xlsxwriter
from pyslurpers import JsonSlurper
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
class TicketInfo:
def __init__(self, number: int, project_id: int, dates: set):
self.dates = d... | 0 | 0 | 0 | 155 | 0 | 4,667 | 0 | 0 | 184 |
d2ab4d184d7cb428bace8678f984c0cda57a4300 | 8,731 | py | Python | tests/kafkatest/tests/streams/streams_broker_compatibility_test.py | heyingquan13/kafka | 620ada9888f82756d6ed0eabe96bb9b54518b378 | [
"Apache-2.0"
] | null | null | null | tests/kafkatest/tests/streams/streams_broker_compatibility_test.py | heyingquan13/kafka | 620ada9888f82756d6ed0eabe96bb9b54518b378 | [
"Apache-2.0"
] | null | null | null | tests/kafkatest/tests/streams/streams_broker_compatibility_test.py | heyingquan13/kafka | 620ada9888f82756d6ed0eabe96bb9b54518b378 | [
"Apache-2.0"
] | 1 | 2020-05-19T21:36:49.000Z | 2020-05-19T21:36:49.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 use ... | 47.710383 | 282 | 0.686634 | # 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 use ... | 0 | 5,451 | 0 | 1,816 | 0 | 0 | 0 | 461 | 222 |
e696f12e73b99c5a1f19fec44f4628ac5951f422 | 2,997 | py | Python | fate_flow/tests/api_tests/job_operation_test.py | haozheng95/FATE | 524296b6bc39609fc7f09951ef74d4129130b809 | [
"Apache-2.0"
] | 1 | 2021-05-31T16:39:30.000Z | 2021-05-31T16:39:30.000Z | fate_flow/tests/api_tests/job_operation_test.py | haozheng95/FATE | 524296b6bc39609fc7f09951ef74d4129130b809 | [
"Apache-2.0"
] | null | null | null | fate_flow/tests/api_tests/job_operation_test.py | haozheng95/FATE | 524296b6bc39609fc7f09951ef74d4129130b809 | [
"Apache-2.0"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 41.054795 | 188 | 0.61695 | import json
import os
import time
import unittest
from contextlib import closing
import requests
from arch.api.utils import file_utils
from fate_flow.settings import HTTP_PORT, API_VERSION
class TestJobOperation(unittest.TestCase):
def setUp(self):
self.dsl_path = 'fate_flow/examples/test_hetero_lr_job_... | 0 | 0 | 0 | 2,731 | 0 | 0 | 0 | 19 | 179 |
71baf8fe49286122599d8c817c8beb7c5dea128f | 166 | py | Python | projects/urls.py | MaTachi/hydra | ac8539a5872900557c71bd5099a88ae6a96db14f | [
"MIT"
] | 1 | 2015-10-03T03:36:19.000Z | 2015-10-03T03:36:19.000Z | projects/urls.py | MaTachi/hydra | ac8539a5872900557c71bd5099a88ae6a96db14f | [
"MIT"
] | null | null | null | projects/urls.py | MaTachi/hydra | ac8539a5872900557c71bd5099a88ae6a96db14f | [
"MIT"
] | 1 | 2015-10-03T03:36:24.000Z | 2015-10-03T03:36:24.000Z | from django.conf.urls import patterns, url
from projects.views import ProjectsView
urlpatterns = patterns('',
url(r'^$', ProjectsView.as_view(), name='list'),
)
| 23.714286 | 52 | 0.722892 | from django.conf.urls import patterns, url
from projects.views import ProjectsView
urlpatterns = patterns('',
url(r'^$', ProjectsView.as_view(), name='list'),
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1e0c1a69eeab9284cd175da2473f20a513e2cfd1 | 1,956 | py | Python | venv/Lib/site-packages/dataframe/_dataframe_column.py | kavanAdeshara/Expense_Tracker | b3e4810e858a7786e05cda6b91ba674b73b87981 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/dataframe/_dataframe_column.py | kavanAdeshara/Expense_Tracker | b3e4810e858a7786e05cda6b91ba674b73b87981 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/dataframe/_dataframe_column.py | kavanAdeshara/Expense_Tracker | b3e4810e858a7786e05cda6b91ba674b73b87981 | [
"Apache-2.0"
] | null | null | null | # dataframe: a data-frame implementation using method piping
#
# Copyright (C) 2016 Simon Dirmeier
#
# This file is part of dataframe.
#
# dataframe is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either versi... | 27.549296 | 70 | 0.648262 | # dataframe: a data-frame implementation using method piping
#
# Copyright (C) 2016 Simon Dirmeier
#
# This file is part of dataframe.
#
# dataframe is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either versi... | 0 | 293 | 0 | 808 | 0 | 0 | 0 | 0 | 23 |
0452b344607a7b7bb2700fb6817bcedf4cc66951 | 92 | py | Python | ex/24 (5).py | Time2003/lr7 | b47edaf11ced014022764b6c5edef34e4c107c0b | [
"MIT"
] | null | null | null | ex/24 (5).py | Time2003/lr7 | b47edaf11ced014022764b6c5edef34e4c107c0b | [
"MIT"
] | null | null | null | ex/24 (5).py | Time2003/lr7 | b47edaf11ced014022764b6c5edef34e4c107c0b | [
"MIT"
] | null | null | null | my_list = ['Monty', 'Python']
delimiter = ' '
output = delimiter.join(my_list)
print(output) | 23 | 32 | 0.695652 | my_list = ['Monty', 'Python']
delimiter = ' '
output = delimiter.join(my_list)
print(output) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f27c1cf0757bbaf1afb3e77263c6c90d54dbcac6 | 6,686 | py | Python | contrib/compile_topic_icons_test.py | csilvers/kake | 51465b12d267a629dd61778918d83a2a134ec3b2 | [
"MIT"
] | null | null | null | contrib/compile_topic_icons_test.py | csilvers/kake | 51465b12d267a629dd61778918d83a2a134ec3b2 | [
"MIT"
] | null | null | null | contrib/compile_topic_icons_test.py | csilvers/kake | 51465b12d267a629dd61778918d83a2a134ec3b2 | [
"MIT"
] | null | null | null | # TODO(colin): fix these lint errors (http://pep8.readthedocs.io/en/release-1.7.x/intro.html#error-codes)
# pep8-disable:E128
"""Tests for compile_topic_icons.py"""
from __future__ import absolute_import
from topic_icons import icon_util
FAKE_HEAD = 'a4fe8ce585e1ddfdf179a77641fa6a2709eff22b'
icon_manifest = {
'... | 35.189474 | 105 | 0.649417 | # TODO(colin): fix these lint errors (http://pep8.readthedocs.io/en/release-1.7.x/intro.html#error-codes)
# pep8-disable:E128
"""Tests for compile_topic_icons.py"""
from __future__ import absolute_import
import cStringIO
import json
import os
import shutil
import PIL.Image
from shared.testutil import testsize
from ... | 0 | 4,050 | 0 | 1,161 | 0 | 129 | 0 | -10 | 293 |
d3bfb5381022b4d821ccc6559f7c401313d99f7b | 1,307 | py | Python | home/bin/copy-dir.py | xfoobar/scripts | 970f248b01ba012b4aa086ec666965c4917a0554 | [
"MIT"
] | null | null | null | home/bin/copy-dir.py | xfoobar/scripts | 970f248b01ba012b4aa086ec666965c4917a0554 | [
"MIT"
] | null | null | null | home/bin/copy-dir.py | xfoobar/scripts | 970f248b01ba012b4aa086ec666965c4917a0554 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
if __name__ == '__main__':
main()
| 28.413043 | 74 | 0.670237 | #!/usr/bin/env python3
import sys
from common import eprint
from pathlib import Path
import argparse
import pathlib
def args_init():
parser = argparse.ArgumentParser(description='just copy directory')
parser.add_argument('src_dir', type=str, help='source directory')
parser.add_argument('des_dir', type=str... | 0 | 0 | 0 | 0 | 0 | 1,078 | 0 | -17 | 179 |
4d5f7e045a1872678b25267759e0aba5579d16fb | 287 | py | Python | tests/test_math_fact.py | StevenKangWei/learning-algorithm | fa2a32c3a650f1a95c75f82750b07de444c4bbfa | [
"MIT"
] | null | null | null | tests/test_math_fact.py | StevenKangWei/learning-algorithm | fa2a32c3a650f1a95c75f82750b07de444c4bbfa | [
"MIT"
] | null | null | null | tests/test_math_fact.py | StevenKangWei/learning-algorithm | fa2a32c3a650f1a95c75f82750b07de444c4bbfa | [
"MIT"
] | null | null | null | # coding=utf-8
if __name__ == '__main__':
TestCase.main()
| 16.882353 | 43 | 0.672474 | # coding=utf-8
from test_base import BaseTestCase
class TestCase(BaseTestCase):
def test_fact(self):
from algorithm.math import fact
self.assertEqual(fact.fact(5), 120)
self.assertEqual(fact.fact(6), 720)
if __name__ == '__main__':
TestCase.main()
| 0 | 0 | 0 | 163 | 0 | 0 | 0 | 13 | 46 |
6d90262f3fb32f6ed6e6cd552b8e459d5bcd8d3d | 4,306 | py | Python | Hough_Line_And_Circle_Detector/code/utils.py | dasdristanta13/Computer-vision | 2fe99066c33f822772ae252f489728b8fff68399 | [
"Unlicense"
] | null | null | null | Hough_Line_And_Circle_Detector/code/utils.py | dasdristanta13/Computer-vision | 2fe99066c33f822772ae252f489728b8fff68399 | [
"Unlicense"
] | null | null | null | Hough_Line_And_Circle_Detector/code/utils.py | dasdristanta13/Computer-vision | 2fe99066c33f822772ae252f489728b8fff68399 | [
"Unlicense"
] | 1 | 2021-11-03T08:17:37.000Z | 2021-11-03T08:17:37.000Z | import cv2
import numpy as np
def preprocess(image, erodeK, blurK, blurSigma, lowT, upT):
"""
Preprocess an image by eroding (opt.), blurring (opt.), and then applying
Canny edge detector.
Args
- image: numpy nd-array of dim (m, n, c)
- erodeK: size of kernal for erode operation. D... | 26.417178 | 91 | 0.60915 | import cv2
import numpy as np
import matplotlib.pyplot as plt
def clip(idx):
return int(max(idx,0))
def preprocess(image, erodeK, blurK, blurSigma, lowT, upT):
"""
Preprocess an image by eroding (opt.), blurring (opt.), and then applying
Canny edge detector.
Args
- image: numpy nd-a... | 0 | 0 | 0 | 0 | 0 | 606 | 0 | 10 | 229 |
d3183950d7dd416a386c9abd7c72f0256f52c4fa | 691 | py | Python | pclib/ifcs/__init__.py | belang/pymtl | 4a96738724b007cbd684753aed0ac3de5b5dbebb | [
"BSD-3-Clause"
] | 206 | 2015-01-05T21:53:56.000Z | 2022-03-14T08:04:49.000Z | pclib/ifcs/__init__.py | belang/pymtl | 4a96738724b007cbd684753aed0ac3de5b5dbebb | [
"BSD-3-Clause"
] | 84 | 2015-01-25T19:57:33.000Z | 2021-05-11T15:46:56.000Z | pclib/ifcs/__init__.py | belang/pymtl | 4a96738724b007cbd684753aed0ac3de5b5dbebb | [
"BSD-3-Clause"
] | 99 | 2015-02-17T17:43:44.000Z | 2022-02-14T17:58:18.000Z | #=========================================================================
# __init__
#=========================================================================
| 38.388889 | 74 | 0.53835 | #=========================================================================
# __init__
#=========================================================================
from ValRdyBundle import InValRdyBundle, OutValRdyBundle
from ParentChildBundle import ParentReqRespBundle, ChildReqRespBundle
from NetMsg ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 327 | 202 |
6332b291564ea6a8507d0e8b308d5c04e2983184 | 1,810 | py | Python | Ago-Dic-2019/JOSE ONOFRE/PRACTICAS/Practica1/Shrinking.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 41 | 2017-09-26T09:36:32.000Z | 2022-03-19T18:05:25.000Z | Ago-Dic-2019/JOSE ONOFRE/PRACTICAS/Practica1/Shrinking.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 67 | 2017-09-11T05:06:12.000Z | 2022-02-14T04:44:04.000Z | Ago-Dic-2019/JOSE ONOFRE/PRACTICAS/Practica1/Shrinking.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 210 | 2017-09-01T00:10:08.000Z | 2022-03-19T18:05:12.000Z | guest=['Alberto','Miguel','Jose','Luis']
print('Hola '+guest[0]+', te gustara cenar esta noche?')
print('Hola '+guest[1]+', te gustara cenar esta noche?')
print('Hola '+guest[2]+', te gustara cenar esta noche?')
print('Hola '+guest[3]+', te gustara cenar esta noche?')
print()
print(guest[1])
guest[1] = 'Eduardo'
print... | 30.166667 | 85 | 0.69558 | guest=['Alberto','Miguel','Jose','Luis']
print('Hola '+guest[0]+', te gustaría cenar esta noche?')
print('Hola '+guest[1]+', te gustaría cenar esta noche?')
print('Hola '+guest[2]+', te gustaría cenar esta noche?')
print('Hola '+guest[3]+', te gustaría cenar esta noche?')
print()
print(guest[1])
guest[1] = 'Eduardo'
p... | 28 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
abe05c4e2072cac9bfc33631e66c0f975671c9ac | 619 | py | Python | appname/roles.py | Dnida/Ignite | 38ac6042c9b16cdccf5ef066a1ee80b741b51a37 | [
"BSD-2-Clause"
] | 53 | 2017-12-12T06:58:25.000Z | 2022-03-24T17:58:37.000Z | appname/roles.py | Dnida/Ignite | 38ac6042c9b16cdccf5ef066a1ee80b741b51a37 | [
"BSD-2-Clause"
] | 144 | 2018-01-22T15:15:41.000Z | 2022-03-28T09:02:00.000Z | appname/roles.py | Dnida/Ignite | 38ac6042c9b16cdccf5ef066a1ee80b741b51a37 | [
"BSD-2-Clause"
] | 19 | 2017-12-12T07:04:14.000Z | 2022-03-23T00:20:00.000Z | """ This file defines utilities used to enforce user roles. """
| 24.76 | 63 | 0.596123 | """ This file defines utilities used to enforce user roles. """
from flask import current_user
from functools import wraps
from enum import Enum
class Roles(Enum):
GUEST = 'guest'
USER = 'user'
ADMIN = 'admin'
def requires_roles(*roles):
def wrapper(f):
def get_user_role():
if curr... | 0 | 131 | 0 | 55 | 0 | 242 | 0 | 15 | 112 |
f72b433198e89063d5e6f1584dc14c04ef6a68fb | 2,261 | py | Python | tests/test_mixture_transitions.py | probcomp/cgpm2 | 280ab5bf3dd0d7c61196deaff7cb590692fc412a | [
"Apache-2.0"
] | 3 | 2019-01-20T08:55:06.000Z | 2019-12-02T05:59:26.000Z | tests/test_mixture_transitions.py | probcomp/cgpm2 | 280ab5bf3dd0d7c61196deaff7cb590692fc412a | [
"Apache-2.0"
] | null | null | null | tests/test_mixture_transitions.py | probcomp/cgpm2 | 280ab5bf3dd0d7c61196deaff7cb590692fc412a | [
"Apache-2.0"
] | 3 | 2019-08-06T07:27:34.000Z | 2019-09-28T23:26:57.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2018 MIT Probabilistic Computing Project.
# Released under Apache 2.0; refer to LICENSE.txt.
| 37.065574 | 80 | 0.689518 | # -*- coding: utf-8 -*-
# Copyright (c) 2018 MIT Probabilistic Computing Project.
# Released under Apache 2.0; refer to LICENSE.txt.
from collections import Counter
import numpy as np
from cgpm.utils.general import get_prng
from cgpm2.crp import CRP
from cgpm2.normal import Normal
from cgpm2.flexible_rowmix impor... | 0 | 0 | 0 | 0 | 0 | 1,682 | 0 | 195 | 250 |
af6cc4c9a3ffeabb765d5498521e8de72dabb2d2 | 4,546 | py | Python | src/camguard/__init__.py | matt-hires/camguard | dde59289b8af105b8ed7ef1d8619747528c5b0a3 | [
"MIT"
] | 3 | 2021-12-06T18:26:12.000Z | 2022-01-14T10:22:12.000Z | src/camguard/__init__.py | matt-hires/camguard | dde59289b8af105b8ed7ef1d8619747528c5b0a3 | [
"MIT"
] | null | null | null | src/camguard/__init__.py | matt-hires/camguard | dde59289b8af105b8ed7ef1d8619747528c5b0a3 | [
"MIT"
] | null | null | null | import logging
__version__ = "1.1.0"
LOGGER = logging.getLogger(__name__)
| 36.95935 | 116 | 0.635724 | import logging
import time
from sys import stderr, stdout, exit
from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser, Namespace
from signal import SIGINT, SIGTERM, Signals, sigwait
from typing import Any, Dict, Optional
from daemon.daemon import DaemonContext # type: ignore[reportMissingTypeStubs]
from ... | 0 | 0 | 0 | 0 | 0 | 3,938 | 0 | 129 | 396 |
797920cbcb09ba515dad2c02cacbbd78069bda7b | 8,787 | py | Python | moler/util/moler_test.py | nokia/moler | 13cb3d1329a8904ac074f269b8c9ec1955e3ae30 | [
"BSD-3-Clause"
] | 57 | 2018-02-20T08:16:47.000Z | 2022-03-28T10:36:57.000Z | moler/util/moler_test.py | nokia/moler | 13cb3d1329a8904ac074f269b8c9ec1955e3ae30 | [
"BSD-3-Clause"
] | 377 | 2018-07-19T11:56:27.000Z | 2021-07-09T13:08:12.000Z | moler/util/moler_test.py | nokia/moler | 13cb3d1329a8904ac074f269b8c9ec1955e3ae30 | [
"BSD-3-Clause"
] | 24 | 2018-04-14T20:49:40.000Z | 2022-03-29T10:44:26.000Z | # -*- coding: utf-8 -*-
"""
Utility/common code of library.
"""
__author__ = 'Grzegorz Latuszek, Marcin Usielski, Michal Ernst, Tomasz Krol'
__copyright__ = 'Copyright (C) 2018-2021, Nokia'
__email__ = 'grzegorz.latuszek@nokia.com, marcin.usielski@nokia.com, michal.ernst@nokia.com, tomasz.krol@nokia.com'
| 33.796154 | 117 | 0.610333 | # -*- coding: utf-8 -*-
"""
Utility/common code of library.
"""
__author__ = 'Grzegorz Latuszek, Marcin Usielski, Michal Ernst, Tomasz Krol'
__copyright__ = 'Copyright (C) 2018-2021, Nokia'
__email__ = 'grzegorz.latuszek@nokia.com, marcin.usielski@nokia.com, michal.ernst@nokia.com, tomasz.krol@nokia.com'
import loggi... | 0 | 7,486 | 0 | 626 | 0 | 0 | 0 | 56 | 311 |
94b462f0a33c4783349048cce16cb8c7eba581b0 | 7,744 | py | Python | lib/python/lib/python3.6/site-packages/sshuttle-0.78.5.dev35+gaaa6684-py3.6.egg/sshuttle/hostwatch.py | wmantly/sshuttle-gui | 13a5c02474b51949ffddcf6da2f4b039757d7bc1 | [
"MIT"
] | 2 | 2020-01-27T18:59:59.000Z | 2020-09-14T19:04:13.000Z | lib/python/lib/python3.6/site-packages/sshuttle-0.78.5.dev35+gaaa6684-py3.6.egg/sshuttle/hostwatch.py | wmantly/sshuttle-gui | 13a5c02474b51949ffddcf6da2f4b039757d7bc1 | [
"MIT"
] | 1 | 2020-09-14T19:05:35.000Z | 2020-09-17T05:06:31.000Z | lib/python/lib/python3.6/site-packages/sshuttle-0.78.5.dev35+gaaa6684-py3.6.egg/sshuttle/hostwatch.py | wmantly/sshuttle-gui | 13a5c02474b51949ffddcf6da2f4b039757d7bc1 | [
"MIT"
] | 2 | 2020-09-17T04:24:23.000Z | 2021-02-15T19:43:16.000Z | import os
import sys
import sshuttle.helpers as helpers
from sshuttle.helpers import log
POLL_TIME = 60 * 15
NETSTAT_POLL_TIME = 30
CACHEFILE = os.path.expanduser('~/.sshuttle.hosts')
_nmb_ok = True
_smb_ok = True
hostnames = {}
queue = {}
try:
null = open('/dev/null', 'wb')
except IOError:
_, e = sys.exc_in... | 25.557756 | 73 | 0.521436 | import time
import socket
import re
import select
import errno
import os
import sys
import platform
import subprocess as ssubprocess
import sshuttle.helpers as helpers
from sshuttle.helpers import log, debug1, debug2, debug3
POLL_TIME = 60 * 15
NETSTAT_POLL_TIME = 30
CACHEFILE = os.path.expanduser('~/.sshuttle.hosts'... | 0 | 0 | 0 | 0 | 0 | 6,821 | 0 | -18 | 500 |
329ab261bcddd08532dd426509b98997f8267b7b | 823 | py | Python | main.py | omerferhatt/mont-crime-pat-search | 5dfccbf48a55907c586ae31e5254b64601c8e386 | [
"MIT"
] | null | null | null | main.py | omerferhatt/mont-crime-pat-search | 5dfccbf48a55907c586ae31e5254b64601c8e386 | [
"MIT"
] | null | null | null | main.py | omerferhatt/mont-crime-pat-search | 5dfccbf48a55907c586ae31e5254b64601c8e386 | [
"MIT"
] | null | null | null | # Library imports
import numpy as np
# User defined library imports
from file_read import read_shp, get_values
from grid import create_grid
from a_star import search
from prompt_read import read_search_prompt, read_grid_prompt
# Locate file pats
path = "shape/crime_dt"
# Get data's into data frame
df, bbox = read_sh... | 29.392857 | 94 | 0.771567 | # Library imports
import sys
import numpy as np
# User defined library imports
from file_read import read_shp, get_values
from grid import create_grid
from a_star import search
from prompt_read import read_search_prompt, read_grid_prompt
# Locate file pats
path = "shape/crime_dt"
# Get data's into data frame
df, bbo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 22 |
49fad5c41c2602daea48b0a3b5cb63525138aabe | 5,463 | py | Python | agent.py | cihatceliker/TetrisAI-LSTM | 158fa1703e0baa8cad85803b9e5975f5b018a201 | [
"Apache-2.0"
] | null | null | null | agent.py | cihatceliker/TetrisAI-LSTM | 158fa1703e0baa8cad85803b9e5975f5b018a201 | [
"Apache-2.0"
] | null | null | null | agent.py | cihatceliker/TetrisAI-LSTM | 158fa1703e0baa8cad85803b9e5975f5b018a201 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.optim as optim
import torch.nn as nn
device = "cuda" if torch.cuda.is_available() else "cpu"
| 37.9375 | 125 | 0.581183 | import torch
import torch.optim as optim
import torch.nn as nn
import numpy as np
import pickle
device = "cuda" if torch.cuda.is_available() else "cpu"
class Network(nn.Module):
def __init__(self, n_actions):
super(Network, self).__init__()
self.cnn = CNN(n_actions)
self.rnn = nn.LSTM(14... | 0 | 0 | 0 | 5,094 | 0 | 120 | 0 | -11 | 136 |
11abe604f0160b86b71880ab20db1655dac6ef87 | 32,900 | py | Python | experiments/thesis/langmodtrans_hyperpar.py | mtanti/mtanti-phd | d915b6f96f1bae1a7f517eb1dbd9d4a88ca56576 | [
"MIT"
] | 6 | 2019-05-20T06:48:37.000Z | 2021-01-03T05:43:47.000Z | experiments/thesis/langmodtrans_hyperpar.py | mtanti/mtanti-phd | d915b6f96f1bae1a7f517eb1dbd9d4a88ca56576 | [
"MIT"
] | 1 | 2019-01-17T03:17:10.000Z | 2019-02-23T17:31:41.000Z | experiments/thesis/langmodtrans_hyperpar.py | mtanti/mtanti-phd | d915b6f96f1bae1a7f517eb1dbd9d4a88ca56576 | [
"MIT"
] | null | null | null | import skopt
import os
import shutil
import sys
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
from framework import lib
from framework import model_neural_trad
from framework import data
from framework import config
########################################################################################
#########... | 44.761905 | 266 | 0.541337 | import skopt
import os
import numpy as np
import shutil
import sys
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
from framework import lib
from framework import model_neural_trad
from framework import evaluation
from framework import data
from framework import config
#######################################################... | 0 | 0 | 0 | 107 | 0 | 5,715 | 0 | 8 | 164 |
65aa1339949e649c39ced9706f12c27dd95fd15e | 1,426 | py | Python | CondCore/EcalPlugins/test/inspect.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | CondCore/EcalPlugins/test/inspect.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | CondCore/EcalPlugins/test/inspect.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | from __future__ import print_function
#
# I should write a decent test of the python binding...
#
import sys, os, DLFCN
sys.setdlopenflags(DLFCN.RTLD_GLOBAL+DLFCN.RTLD_LAZY)
a = FWIncantation()
os.putenv("CORAL_AUTH_PATH","/afs/cern.ch/cms/DB/conddb")
rdbms = RDBMS()
dbName = "sqlite_file:testExample.db"
# dbName ... | 25.017544 | 60 | 0.596073 | from __future__ import print_function
#
# I should write a decent test of the python binding...
#
def dumpSummaries(dbname):
db = rdbms.getDB(dbName)
tags = db.allTags()
for tag in tags.split() :
try :
# log = db.lastLogEntry(tag)
# print log.getState()
... | 0 | 0 | 0 | 0 | 0 | 787 | 0 | 49 | 90 |
0dbcd7bc0b1ae25a52c30f226724a06826b1432c | 605 | py | Python | xor.py | joelgrus/joelnet | 65cbc3ff169855d801416d629d290c44c95d001d | [
"MIT"
] | 312 | 2017-11-23T15:33:55.000Z | 2022-03-17T19:57:17.000Z | xor.py | joelgrus/joelnet | 65cbc3ff169855d801416d629d290c44c95d001d | [
"MIT"
] | 1 | 2017-12-25T09:29:02.000Z | 2017-12-25T09:29:02.000Z | xor.py | joelgrus/joelnet | 65cbc3ff169855d801416d629d290c44c95d001d | [
"MIT"
] | 77 | 2017-12-05T13:47:47.000Z | 2022-02-23T04:35:37.000Z | """
The canonical example of a function that can't be
learned with a simple linear model is XOR
"""
import numpy as np
from joelnet.train import train
from joelnet.nn import NeuralNet
from joelnet.layers import Linear, Tanh
inputs = np.array([
[0, 0],
[1, 0],
[0, 1],
[1, 1]
])
targets = np.array([
... | 16.805556 | 49 | 0.618182 | """
The canonical example of a function that can't be
learned with a simple linear model is XOR
"""
import numpy as np
from joelnet.train import train
from joelnet.nn import NeuralNet
from joelnet.layers import Linear, Tanh
inputs = np.array([
[0, 0],
[1, 0],
[0, 1],
[1, 1]
])
targets = np.array([
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0943663373248c3d894f2f0398227572a2cbb1c8 | 2,784 | py | Python | seqtools/format/bed.py | jason-weirather/py-seq-tools | f642c2c73ffef2acc83656a78059a476fc734ca1 | [
"Apache-2.0"
] | 1 | 2018-01-08T15:18:22.000Z | 2018-01-08T15:18:22.000Z | seqtools/format/bed.py | jason-weirather/py-seq-tools | f642c2c73ffef2acc83656a78059a476fc734ca1 | [
"Apache-2.0"
] | 1 | 2017-09-08T15:02:31.000Z | 2017-09-08T15:02:31.000Z | seqtools/format/bed.py | jason-weirather/py-seq-tools | f642c2c73ffef2acc83656a78059a476fc734ca1 | [
"Apache-2.0"
] | null | null | null | from collections import namedtuple
Bed12Options = namedtuple('Bed12Options',
['sequence',
'ref',
'gene_name',
'payload'])
Bed12Fields = namedtuple('Bed12Fields',
[
'chrom',
'chromStart',
'chromEnd',
'name',
'score',
'strand',
'thickStart',
'thickEnd',
'itemRgb',
... | 25.309091 | 91 | 0.595905 | import sys, uuid
from collections import namedtuple
import seqtools.structure.transcript
from seqtools.range import GenomicRange
Bed12Options = namedtuple('Bed12Options',
['sequence',
'ref',
'gene_name',
'payload'])
Bed12Fields = namedtuple('Bed12Fields',
[
'chrom',
'chromStart',
'chromE... | 0 | 522 | 0 | 1,769 | 0 | 0 | 0 | 28 | 89 |
546edefa2858b6d9968b6c8574df68150306e29b | 3,285 | py | Python | examples/CooperativeSearch/psaltlib/LMCP/py/uxas/messages/task/AssignmentCoordinatorTask.py | GaloisInc/salty | f410659b3399ad7c527513e67b06dff0332d823e | [
"BSD-3-Clause"
] | 13 | 2017-02-15T21:56:46.000Z | 2022-03-23T12:59:26.000Z | examples/VIP-Escort/lmcp/py/uxas/messages/task/AssignmentCoordinatorTask.py | GaloisInc/salty | f410659b3399ad7c527513e67b06dff0332d823e | [
"BSD-3-Clause"
] | 17 | 2016-07-21T10:47:23.000Z | 2020-08-07T13:26:21.000Z | examples/CooperativeSearch/psaltlib/LMCP/py/uxas/messages/task/AssignmentCoordinatorTask.py | GaloisInc/salty | f410659b3399ad7c527513e67b06dff0332d823e | [
"BSD-3-Clause"
] | 2 | 2019-06-11T11:59:40.000Z | 2022-02-09T12:48:39.000Z | #! /usr/bin/python
## ===============================================================================
## Authors: AFRL/RQQA
## Organization: Air Force Research Laboratory, Aerospace Systems Directorate, Power and Control Division
##
## Copyright (c) 2017 Government of the United State of America, as represented by
##... | 28.076923 | 105 | 0.592998 | #! /usr/bin/python
import sys, struct
import xml.dom.minidom
from lmcp import LMCPObject
## ===============================================================================
## Authors: AFRL/RQQA
## Organization: Air Force Research Laboratory, Aerospace Systems Directorate, Power and Control Division
##
## Copyright (... | 0 | 0 | 0 | 2,534 | 0 | 0 | 0 | 10 | 113 |
e8c7ec0c8ada193ea596076a88c58cc3b815188c | 900 | py | Python | src/config.py | arunderwood/ESP8266_temp_sensor | f30dc3d209c37ef3da5cb5faf4e0e63b9394c3cd | [
"MIT"
] | 6 | 2018-01-23T16:03:51.000Z | 2018-08-24T10:50:42.000Z | src/config.py | arunderwood/ESP8266_temp_sensor | f30dc3d209c37ef3da5cb5faf4e0e63b9394c3cd | [
"MIT"
] | 1 | 2018-02-21T04:30:12.000Z | 2018-02-21T04:30:12.000Z | src/config.py | arunderwood/ESP8266_temp_sensor | f30dc3d209c37ef3da5cb5faf4e0e63b9394c3cd | [
"MIT"
] | null | null | null | import machine
import ubinascii
# These defaults are overwritten with the contents of /config.json by
# load_config()
CONFIG = {
"broker": "192.168.1.19",
"sensor_pin": 0,
"led_pin": 2,
"client_id": b"esp8266_" + ubinascii.hexlify(machine.unique_id()),
"topic": b"home",
"sleep_seconds": 60,
... | 23.076923 | 70 | 0.588889 | import machine
import ubinascii
# These defaults are overwritten with the contents of /config.json by
# load_config()
CONFIG = {
"broker": "192.168.1.19",
"sensor_pin": 0,
"led_pin": 2,
"client_id": b"esp8266_" + ubinascii.hexlify(machine.unique_id()),
"topic": b"home",
"sleep_seconds": 60,
... | 0 | 0 | 0 | 0 | 0 | 441 | 0 | 0 | 46 |
43adddc985cb4eb4a91c38e1742ea5f0b3edd50f | 739 | py | Python | confoo-2012/pace_example/ecg.py | andymckay/presentations | 19e485f0ad5ca5e56779475659f31b6682e8016e | [
"CC-BY-3.0"
] | 3 | 2015-08-05T23:04:10.000Z | 2022-01-24T20:01:33.000Z | confoo-2012/pace_example/ecg.py | andymckay/presentations | 19e485f0ad5ca5e56779475659f31b6682e8016e | [
"CC-BY-3.0"
] | null | null | null | confoo-2012/pace_example/ecg.py | andymckay/presentations | 19e485f0ad5ca5e56779475659f31b6682e8016e | [
"CC-BY-3.0"
] | 4 | 2015-06-28T19:02:49.000Z | 2021-10-29T19:28:39.000Z | import time
import redis
import csv
import sys
import os
conn = redis.Redis()
filename = sys.argv[1]
lines = []
read = csv.reader(open(filename))
lines = [l for l in read]
nice = os.path.splitext(os.path.basename(filename))[0]
# We are doing True so that we'll have a continual flow of data from
# our sample data.
... | 23.83871 | 75 | 0.610284 | import time
import redis
import csv
import sys
import os
conn = redis.Redis()
filename = sys.argv[1]
lines = []
read = csv.reader(open(filename))
lines = [l for l in read]
nice = os.path.splitext(os.path.basename(filename))[0]
# We are doing True so that we'll have a continual flow of data from
# our sample data.
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4fa8d6ef6f1013a44218a63e6eda655d26229ed6 | 18,950 | py | Python | glance/tests/functional/v2/test_metadef_objects.py | Steap/glance | 4ee7799aa7f6a7172e361392ebb8d3da03e0bf7f | [
"Apache-2.0"
] | 309 | 2015-01-01T17:49:09.000Z | 2022-03-29T14:56:31.000Z | glance/tests/functional/v2/test_metadef_objects.py | Steap/glance | 4ee7799aa7f6a7172e361392ebb8d3da03e0bf7f | [
"Apache-2.0"
] | 8 | 2015-11-04T21:53:48.000Z | 2020-12-15T05:36:35.000Z | glance/tests/functional/v2/test_metadef_objects.py | Steap/glance | 4ee7799aa7f6a7172e361392ebb8d3da03e0bf7f | [
"Apache-2.0"
] | 409 | 2015-01-01T11:28:26.000Z | 2022-03-29T14:56:41.000Z | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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... | 44.172494 | 79 | 0.544116 | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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 | 18,163 | 0 | 0 | 0 | 63 | 113 |
492d4476a817825b0dd32eefe67369d890d4b48b | 2,280 | py | Python | script.py | discdiver/gendertxt | 573d794463cd0bcc98ed524f79146f8d934ff65e | [
"MIT"
] | null | null | null | script.py | discdiver/gendertxt | 573d794463cd0bcc98ed524f79146f8d934ff65e | [
"MIT"
] | 1 | 2018-01-31T18:11:48.000Z | 2018-01-31T18:11:48.000Z | script.py | discdiver/gendertxt | 573d794463cd0bcc98ed524f79146f8d934ff65e | [
"MIT"
] | null | null | null | # main script
# read in list of gendered words from genderwords
# switch them through an intermediary step
import csv
import re
with open ('./data/genderwords.csv') as words:
reader = csv.reader(words)
mydict = {row[0]: row[1] for row in reader}
with open('./data/Harry.txt', 'r') as f1:
with open... | 30.4 | 115 | 0.572368 | # main script
# read in list of gendered words from genderwords
# switch them through an intermediary step
import csv
import re
with open ('./data/genderwords.csv') as words:
reader = csv.reader(words)
mydict = {row[0]: row[1] for row in reader}
with open('./data/Harry.txt', 'r') as f1:
with open... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |