hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c31532d53a5dec8ec7bf5845fff2a2d684ac5b39 | 21,648 | py | Python | ivy/functional/ivy/linear_algebra.py | arv0804/ivy | a394229bc580fdb14f7907b69cb74db83cc73679 | [
"Apache-2.0"
] | null | null | null | ivy/functional/ivy/linear_algebra.py | arv0804/ivy | a394229bc580fdb14f7907b69cb74db83cc73679 | [
"Apache-2.0"
] | 1 | 2022-03-08T13:29:20.000Z | 2022-03-08T13:29:20.000Z | ivy/functional/ivy/linear_algebra.py | arv0804/ivy | a394229bc580fdb14f7907b69cb74db83cc73679 | [
"Apache-2.0"
] | null | null | null | # global
from typing import Union, Optional, Tuple, Literal
from collections import namedtuple
# local
import ivy
from ivy.framework_handler import current_framework as _cur_framework
inf = float('inf')
# Array API Standard #
# -------------------#
def eigh(x: Union[ivy.Array, ivy.NativeArray])\
->... | 46.655172 | 706 | 0.614653 |
4b3a78e5da6a549f7d0bd7c0b99c04db9e8e7b8a | 3,280 | py | Python | zc.recipe.egg_/setup.py | perrinjerome/buildout | 2dfe7daaba0ca3d1dec7d57d38890bd6cf71ca8d | [
"ZPL-2.1"
] | 426 | 2015-01-06T06:29:16.000Z | 2022-03-31T23:21:21.000Z | zc.recipe.egg_/setup.py | perrinjerome/buildout | 2dfe7daaba0ca3d1dec7d57d38890bd6cf71ca8d | [
"ZPL-2.1"
] | 408 | 2015-01-05T16:18:17.000Z | 2022-03-31T05:56:12.000Z | zc.recipe.egg_/setup.py | perrinjerome/buildout | 2dfe7daaba0ca3d1dec7d57d38890bd6cf71ca8d | [
"ZPL-2.1"
] | 141 | 2015-01-05T17:25:48.000Z | 2021-08-06T04:27:36.000Z | ##############################################################################
#
# Copyright (c) 2007 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | 36.043956 | 79 | 0.517073 |
163e8b459f7f33a2746bfd79dc324cb0b3f8d261 | 1,426 | py | Python | 10xGenomics/scvi_impute.py | JunLiuLab/SIMPLEs2020 | 90e6aa1e254b81fd81f2211b3fdfb552270d76fe | [
"MIT"
] | null | null | null | 10xGenomics/scvi_impute.py | JunLiuLab/SIMPLEs2020 | 90e6aa1e254b81fd81f2211b3fdfb552270d76fe | [
"MIT"
] | 1 | 2020-06-28T03:16:17.000Z | 2020-07-11T22:58:39.000Z | 10xGenomics/scvi_impute.py | JunLiuLab/SIMPLEs2020 | 90e6aa1e254b81fd81f2211b3fdfb552270d76fe | [
"MIT"
] | null | null | null | import argparse
import torch
import numpy as np
import pandas as pd
from pyprojroot import here
from pathlib import PosixPath
from scvi.dataset import CsvDataset
from scvi.models import VAE
from scvi import set_seed
from scvi.inference import UnsupervisedTrainer, load_posterior
# * commons
set_seed(0)
# ** data
nce... | 25.017544 | 76 | 0.632539 |
809402f5316992d94c383bae6dc674c9d1806886 | 1,283 | py | Python | scoap3/modules/analysis/alembic/a324b85f764e_create_analysis_branch.py | Lilykos/scoap3-next | b779b8c32504e09b2c5330aa6a18e1e1c9affd33 | [
"CC-BY-4.0"
] | 1 | 2021-08-04T09:48:38.000Z | 2021-08-04T09:48:38.000Z | scoap3/modules/analysis/alembic/a324b85f764e_create_analysis_branch.py | Lilykos/scoap3-next | b779b8c32504e09b2c5330aa6a18e1e1c9affd33 | [
"CC-BY-4.0"
] | 158 | 2018-09-10T07:31:14.000Z | 2022-03-30T07:18:51.000Z | scoap3/modules/analysis/alembic/a324b85f764e_create_analysis_branch.py | Lilykos/scoap3-next | b779b8c32504e09b2c5330aa6a18e1e1c9affd33 | [
"CC-BY-4.0"
] | 9 | 2015-04-28T11:55:04.000Z | 2021-09-28T12:14:53.000Z | #
# This file is part of Invenio.
# Copyright (C) 2016 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# Invenio is... | 28.511111 | 76 | 0.745908 |
c1cd1a2e40c0b838d93378702f6cfe24adf3a704 | 3,336 | py | Python | pypureclient/flasharray/FA_2_7/models/certificate_signing_request.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_7/models/certificate_signing_request.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_7/models/certificate_signing_request.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.7
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... | 29.785714 | 105 | 0.571942 |
6a8dfa07d5b068048b6a17f253ecb212d4d6d81f | 12,400 | py | Python | sklearn_porter/estimator/classifier/AdaBoostClassifier/__init__.py | hylomorph-solutions/sklearn-porter | 982cb02a8ac0cb98789c43842ea4a1258eb90f34 | [
"MIT"
] | null | null | null | sklearn_porter/estimator/classifier/AdaBoostClassifier/__init__.py | hylomorph-solutions/sklearn-porter | 982cb02a8ac0cb98789c43842ea4a1258eb90f34 | [
"MIT"
] | null | null | null | sklearn_porter/estimator/classifier/AdaBoostClassifier/__init__.py | hylomorph-solutions/sklearn-porter | 982cb02a8ac0cb98789c43842ea4a1258eb90f34 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from json import encoder
from json import dumps
from sklearn.tree import DecisionTreeClassifier
from sklearn_porter.estimator.classifier.Classifier import Classifier
class AdaBoostClassifier(Classifier):
"""
See also
--------
sklearn.ensemble.AdaBoostClassifier
... | 36.046512 | 80 | 0.534435 |
392618250f2fb519c2fb19ae9afce04666edf866 | 3,000 | py | Python | tests/mocks/test_provider.py | denibertovic/stormpath-sdk-python | e594a1bb48de3fa8eff26558bf4f72bb056e9d00 | [
"Apache-2.0"
] | null | null | null | tests/mocks/test_provider.py | denibertovic/stormpath-sdk-python | e594a1bb48de3fa8eff26558bf4f72bb056e9d00 | [
"Apache-2.0"
] | null | null | null | tests/mocks/test_provider.py | denibertovic/stormpath-sdk-python | e594a1bb48de3fa8eff26558bf4f72bb056e9d00 | [
"Apache-2.0"
] | null | null | null | """"
Integration tests for various pieces involved in external provider support.
"""
from unittest import TestCase, main
try:
from mock import MagicMock
except ImportError:
from unittest.mock import MagicMock
from stormpath.resources.account import Account
from stormpath.resources.application import Applicati... | 30.30303 | 76 | 0.589333 |
11a618f11b6fac52f4355fdfd119636e79cd945a | 1,415 | py | Python | pset_pandas_ext/101problems/solutions/p65.py | mottaquikarim/pydev-psets | 9749e0d216ee0a5c586d0d3013ef481cc21dee27 | [
"MIT"
] | 5 | 2019-04-08T20:05:37.000Z | 2019-12-04T20:48:45.000Z | pset_pandas_ext/101problems/solutions/p65.py | mottaquikarim/pydev-psets | 9749e0d216ee0a5c586d0d3013ef481cc21dee27 | [
"MIT"
] | 8 | 2019-04-15T15:16:05.000Z | 2022-02-12T10:33:32.000Z | pset_pandas_ext/101problems/solutions/p65.py | mottaquikarim/pydev-psets | 9749e0d216ee0a5c586d0d3013ef481cc21dee27 | [
"MIT"
] | 2 | 2019-04-10T00:14:42.000Z | 2020-02-26T20:35:21.000Z | """
66. How to replace both the diagonals of dataframe with 0?
"""
"""
Difficulty Level: L2
"""
"""
Replace both values in both diagonals of df with 0.
"""
"""
Input
"""
"""
df = pd.DataFrame(np.random.randint(1,100, 100).reshape(10, -1))
df
# 0 1 2 3 4 5 6 7 8 9
# 0 11 46 26 44 11 62 18 7... | 27.745098 | 64 | 0.477032 |
00dafeabdaade7420e9d2003cb2c78cf35c9d06c | 2,421 | py | Python | api/weather/yandex/yandex.py | artslob/artslob-bot | 41c8b7f7f37e60369a3fa219db665de7d3e52ece | [
"MIT"
] | null | null | null | api/weather/yandex/yandex.py | artslob/artslob-bot | 41c8b7f7f37e60369a3fa219db665de7d3e52ece | [
"MIT"
] | null | null | null | api/weather/yandex/yandex.py | artslob/artslob-bot | 41c8b7f7f37e60369a3fa219db665de7d3e52ece | [
"MIT"
] | null | null | null | import aiohttp
import config
from api.weather.yandex.exceptions import ForbiddenRequestError, UnknownRequestError
from utils.redis import redis_cache
class YandexWeather:
prec_type = {
0: 'no precipitation',
1: 'rain',
2: 'rain with snow',
3: 'snow',
}
prec_strength = {
... | 29.168675 | 118 | 0.557621 |
59df8758693a49a26e057dbdad909b47cba7fe77 | 1,790 | py | Python | examples/readme_long_example.py | awesome-archive/baikal | c44b4f1b0f7a01ca5d41762043723aeeb5a130c9 | [
"BSD-3-Clause"
] | 1 | 2019-11-18T23:12:22.000Z | 2019-11-18T23:12:22.000Z | examples/readme_long_example.py | awesome-archive/baikal | c44b4f1b0f7a01ca5d41762043723aeeb5a130c9 | [
"BSD-3-Clause"
] | null | null | null | examples/readme_long_example.py | awesome-archive/baikal | c44b4f1b0f7a01ca5d41762043723aeeb5a130c9 | [
"BSD-3-Clause"
] | 1 | 2020-04-19T12:16:15.000Z | 2020-04-19T12:16:15.000Z | import sklearn.decomposition
import sklearn.ensemble
import sklearn.linear_model
import sklearn.preprocessing
import sklearn.svm
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from baikal import Input, Model, make_step
from baikal.plot import plot_model
from baikal... | 29.344262 | 80 | 0.77095 |
07f2beb463df2622a8aca136a15a25bb5e9eb12c | 1,805 | py | Python | nbasalaryscraper.py | pysiakk/NBA-Salary-Scraper | bdeb4bc2e845901f569fbc872e8cf76d1a81eabb | [
"MIT"
] | 1 | 2020-05-10T16:59:28.000Z | 2020-05-10T16:59:28.000Z | nbasalaryscraper.py | pysiakk/NBA-Salary-Scraper | bdeb4bc2e845901f569fbc872e8cf76d1a81eabb | [
"MIT"
] | null | null | null | nbasalaryscraper.py | pysiakk/NBA-Salary-Scraper | bdeb4bc2e845901f569fbc872e8cf76d1a81eabb | [
"MIT"
] | null | null | null | from urllib.request import urlopen
from bs4 import BeautifulSoup
import pandas as pd
import numpy as np
import re
def salary_scrape(year):
src = "http://www.espn.com/nba/salaries/_/year/" + str(year+1) + "/page/"
data = None
for k in range(1, 20):
url = src + str(k)
html = urlope... | 44.02439 | 122 | 0.536288 |
b1c25083f96a679d6be93cd1c48591ad4769c5c1 | 5,234 | py | Python | python/onshape_client/oas/models/bt_list_response_bt_revision_info.py | toebes/onshape-clients | a26cf6a77cfc7901321e603d5a097e23eb51e35c | [
"MIT"
] | 14 | 2019-06-23T08:47:41.000Z | 2021-11-29T16:28:45.000Z | python/onshape_client/oas/models/bt_list_response_bt_revision_info.py | toebes/onshape-clients | a26cf6a77cfc7901321e603d5a097e23eb51e35c | [
"MIT"
] | 40 | 2019-05-22T14:39:46.000Z | 2022-03-10T10:36:17.000Z | python/onshape_client/oas/models/bt_list_response_bt_revision_info.py | toebes/onshape-clients | a26cf6a77cfc7901321e603d5a097e23eb51e35c | [
"MIT"
] | 24 | 2019-06-02T01:03:41.000Z | 2022-03-29T13:25:36.000Z | # coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | 33.126582 | 102 | 0.598968 |
cbc582a52826231bf59539294b1c0e9592218292 | 3,486 | py | Python | tests/integration/modules/test_config.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-03-31T22:51:16.000Z | 2020-03-31T22:51:16.000Z | tests/integration/modules/test_config.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/integration/modules/test_config.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-09-30T07:00:01.000Z | 2021-09-30T07:00:01.000Z | # -*- coding: utf-8 -*-
'''
Validate the config system
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from tests.support.case import ModuleCase
class ConfigTest(ModuleCase):
'''
Test config routines
'''
def test_valid_file_proto(self):
'''
... | 32.277778 | 74 | 0.528399 |
a840ae0430925c79b01f9e4bf8dcba44f54c4190 | 2,628 | py | Python | xfel/command_line/trumpet_plots.py | Anthchirp/cctbx | b8064f755b1dbadf05b8fbf806b7d50d73ef69bf | [
"BSD-3-Clause-LBNL"
] | null | null | null | xfel/command_line/trumpet_plots.py | Anthchirp/cctbx | b8064f755b1dbadf05b8fbf806b7d50d73ef69bf | [
"BSD-3-Clause-LBNL"
] | null | null | null | xfel/command_line/trumpet_plots.py | Anthchirp/cctbx | b8064f755b1dbadf05b8fbf806b7d50d73ef69bf | [
"BSD-3-Clause-LBNL"
] | null | null | null | # -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# LIBTBX_SET_DISPATCHER_NAME cctbx.xfel.trumpet_plots
#
from __future__ import absolute_import, division, print_function
from dials.util import show_mail_on_error
from matplotlib import pyplot as plt
from libtbx.phil import parse
from six.moves import zip
help_message = ... | 30.55814 | 120 | 0.714231 |
3e6dab50c4b43290cd8d5eaa076e6981c13d315d | 4,905 | py | Python | scene_generation/test.py | LUGUANSONG/i2g2i | ec532f2e128301472478c3d8fe4c72929e2967a4 | [
"MIT"
] | null | null | null | scene_generation/test.py | LUGUANSONG/i2g2i | ec532f2e128301472478c3d8fe4c72929e2967a4 | [
"MIT"
] | 3 | 2021-06-08T21:42:14.000Z | 2022-01-13T02:48:20.000Z | scene_generation/test.py | LUGUANSONG/i2g2i | ec532f2e128301472478c3d8fe4c72929e2967a4 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import os
import json
from collections import defaultdict
import torch
from scene_generation.args import get_args
from combine_sg2im_neural_motifs.bbox_feature_dataset.bbox_feature_dataset import VG, VGDataLoader
from torchvision import transforms
from scene_generation.trainer import Trainer
from sce... | 35.28777 | 105 | 0.593272 |
dd01927712477e884a6df9f8f9cd59703f6f5957 | 792 | py | Python | assignment3/join.py | federicobozzini/coursera-data-science | 554d0a5cda58b27604bf20e190f2e3c495f102d1 | [
"MIT"
] | null | null | null | assignment3/join.py | federicobozzini/coursera-data-science | 554d0a5cda58b27604bf20e190f2e3c495f102d1 | [
"MIT"
] | null | null | null | assignment3/join.py | federicobozzini/coursera-data-science | 554d0a5cda58b27604bf20e190f2e3c495f102d1 | [
"MIT"
] | null | null | null | import MapReduce
import sys
"""
Word Count Example in the Simple Python MapReduce Framework
"""
mr = MapReduce.MapReduce()
# =============================
# Do not modify above this line
def mapper(record):
# key: document identifier
# value: document contents
key = record[1]
value = record
mr.e... | 24 | 70 | 0.626263 |
62aaca7381c7564db4b495ded8bcdde57f768e8e | 9,445 | py | Python | cross_sections.py | kahlhoefer/CLASSICS | b50ca67918a0a8e17b1a5b48fac8b1586d4ed8ad | [
"BSD-3-Clause"
] | null | null | null | cross_sections.py | kahlhoefer/CLASSICS | b50ca67918a0a8e17b1a5b48fac8b1586d4ed8ad | [
"BSD-3-Clause"
] | null | null | null | cross_sections.py | kahlhoefer/CLASSICS | b50ca67918a0a8e17b1a5b48fac8b1586d4ed8ad | [
"BSD-3-Clause"
] | null | null | null | #####################################################################################
# CLASSICS - CalcuLAtionS of Self Interaction Cross Sections #
# by Brian Colquhoun, Saniya Heeba, Felix Kahlhoefer, Laura Sagunski and Sean Tulin #
##############################################################... | 45.628019 | 190 | 0.663949 |
645d4d0ecaa40061da26798c5a6a05f34f3a6544 | 190 | py | Python | utils/indigo-service/service/v2/celery_app.py | f1nzer/Indigo | 59efbd0be0b42f449f706c3a3c8d094e483e5ef4 | [
"Apache-2.0"
] | null | null | null | utils/indigo-service/service/v2/celery_app.py | f1nzer/Indigo | 59efbd0be0b42f449f706c3a3c8d094e483e5ef4 | [
"Apache-2.0"
] | null | null | null | utils/indigo-service/service/v2/celery_app.py | f1nzer/Indigo | 59efbd0be0b42f449f706c3a3c8d094e483e5ef4 | [
"Apache-2.0"
] | null | null | null | from celery import Celery
import config
celery = Celery(
__name__,
broker="redis://localhost:6379/0",
backend="redis://localhost:6379/0",
)
celery.conf.update(config.__dict__)
| 17.272727 | 39 | 0.710526 |
e455fc99643f50429152ade441aad9ca32398e25 | 15,701 | py | Python | prototype/c2dn/script/deploy/scriptcore/awsVMs.py | Thesys-lab/C2DN | 55aa7fc1cd13ab0c80a9c25aa0288b454616d83c | [
"Apache-2.0"
] | null | null | null | prototype/c2dn/script/deploy/scriptcore/awsVMs.py | Thesys-lab/C2DN | 55aa7fc1cd13ab0c80a9c25aa0288b454616d83c | [
"Apache-2.0"
] | null | null | null | prototype/c2dn/script/deploy/scriptcore/awsVMs.py | Thesys-lab/C2DN | 55aa7fc1cd13ab0c80a9c25aa0288b454616d83c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os, sys, time, glob, subprocess, logging, math
import yaml
from threading import Thread
from pprint import pprint
from copy import copy
sys.path.append("../")
from pylib.ec2 import *
# from pylib.sshRunner import SshRunner... | 42.320755 | 146 | 0.609643 |
e8d377dfc67b54c845835b476546e6b37c045111 | 912 | py | Python | tools/pretty-printers/gdb/cista_string.py | mayhemheroes/cista | c889baf253081571913b88b26ad30be0104a82cd | [
"MIT"
] | null | null | null | tools/pretty-printers/gdb/cista_string.py | mayhemheroes/cista | c889baf253081571913b88b26ad30be0104a82cd | [
"MIT"
] | null | null | null | tools/pretty-printers/gdb/cista_string.py | mayhemheroes/cista | c889baf253081571913b88b26ad30be0104a82cd | [
"MIT"
] | null | null | null | import re
class CistaString:
def __init__(self, val):
self.val = val
self.GDB_CHAR_PTR = gdb.lookup_type("char*")
def is_short(self):
return self.val['s_']['is_short_']
def data(self):
return self.val['s_']['s_'] if self.is_short() else self.val['h_']['ptr_']
def str(... | 24.648649 | 82 | 0.631579 |
4c805a40cc21b72b2d9ab66f00fe275889d4daa3 | 9,102 | py | Python | src/azure-cli/azure/cli/command_modules/storage/util.py | heaths/azure-cli | baae1d17ffc4f3abfeccea17116bfd61de5770f1 | [
"MIT"
] | 1 | 2019-11-15T17:28:05.000Z | 2019-11-15T17:28:05.000Z | src/azure-cli/azure/cli/command_modules/storage/util.py | heaths/azure-cli | baae1d17ffc4f3abfeccea17116bfd61de5770f1 | [
"MIT"
] | 1 | 2021-06-02T03:05:20.000Z | 2021-06-02T03:05:20.000Z | src/azure-cli/azure/cli/command_modules/storage/util.py | heaths/azure-cli | baae1d17ffc4f3abfeccea17116bfd61de5770f1 | [
"MIT"
] | 1 | 2019-12-11T06:00:10.000Z | 2019-12-11T06:00:10.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 39.746725 | 120 | 0.686333 |
5d538f63ecc326780c8d97c827a7a89b4aac5783 | 12,480 | py | Python | pydriller/repository.py | software-improvement-group-research/pydriller | 58ae15ef457e83c7ac4f07be54f9065ac37abd33 | [
"Apache-2.0"
] | null | null | null | pydriller/repository.py | software-improvement-group-research/pydriller | 58ae15ef457e83c7ac4f07be54f9065ac37abd33 | [
"Apache-2.0"
] | null | null | null | pydriller/repository.py | software-improvement-group-research/pydriller | 58ae15ef457e83c7ac4f07be54f9065ac37abd33 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Davide Spadini
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 43.333333 | 136 | 0.628686 |
5ff8bb11af14fae3dae0479543fcb17a40c1399e | 3,546 | py | Python | dvc/repo/metrics/show.py | daavoo/dvc | 04349a50eb638f3684e486cdf72bcb1c1e25613d | [
"Apache-2.0"
] | 1 | 2019-10-04T13:46:03.000Z | 2019-10-04T13:46:03.000Z | dvc/repo/metrics/show.py | Indraji-Ushantha/dvc | cfcb7e12942d826c0c84c01966c0a47483b1d618 | [
"Apache-2.0"
] | 69 | 2021-04-28T13:33:02.000Z | 2022-03-30T23:14:34.000Z | dvc/repo/metrics/show.py | Indraji-Ushantha/dvc | cfcb7e12942d826c0c84c01966c0a47483b1d618 | [
"Apache-2.0"
] | null | null | null | import logging
from typing import List
from dvc.exceptions import (
MetricDoesNotExistError,
NoMetricsFoundError,
NoMetricsParsedError,
)
from dvc.fs.repo import RepoFileSystem
from dvc.output import Output
from dvc.path_info import PathInfo
from dvc.repo import locked
from dvc.repo.collect import collect
... | 24.455172 | 73 | 0.598703 |
a350854e089433ada500cf0d0a04d6590b5346bb | 2,596 | py | Python | python/pycylon/test/test_cylon_table_conversion.py | chathurawidanage/cylon | ac61b7a50880138fe67de21adee208016a94979a | [
"Apache-2.0"
] | null | null | null | python/pycylon/test/test_cylon_table_conversion.py | chathurawidanage/cylon | ac61b7a50880138fe67de21adee208016a94979a | [
"Apache-2.0"
] | null | null | null | python/pycylon/test/test_cylon_table_conversion.py | chathurawidanage/cylon | ac61b7a50880138fe67de21adee208016a94979a | [
"Apache-2.0"
] | null | null | null | ##
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | 35.081081 | 99 | 0.713405 |
9e565a4eec21a7fa6c70f58c4108c9023d8264b2 | 11,611 | py | Python | python_modules/dagster/dagster/core/definitions/decorators/op.py | roeap/dagster | a0b36f2a9d9e64c40182403782488da0ac24be83 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/definitions/decorators/op.py | roeap/dagster | a0b36f2a9d9e64c40182403782488da0ac24be83 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/definitions/decorators/op.py | roeap/dagster | a0b36f2a9d9e64c40182403782488da0ac24be83 | [
"Apache-2.0"
] | null | null | null | from functools import update_wrapper
from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Union
from dagster import check
from dagster.core.decorator_utils import format_docstring_for_description
from ....seven.typing import get_origin
from ...errors import DagsterInvariantViolationError
from ..infe... | 41.766187 | 111 | 0.656102 |
ab8ed8c88068b717ccda11d63fc19fb225578c26 | 4,983 | py | Python | asposeslidescloud/models/graphical_object.py | aspose-slides-cloud/aspose-slides-cloud-python | 3ee53c11a22c7efc8aaf8377bc72b41102821ca2 | [
"MIT"
] | null | null | null | asposeslidescloud/models/graphical_object.py | aspose-slides-cloud/aspose-slides-cloud-python | 3ee53c11a22c7efc8aaf8377bc72b41102821ca2 | [
"MIT"
] | null | null | null | asposeslidescloud/models/graphical_object.py | aspose-slides-cloud/aspose-slides-cloud-python | 3ee53c11a22c7efc8aaf8377bc72b41102821ca2 | [
"MIT"
] | 1 | 2020-12-25T16:28:49.000Z | 2020-12-25T16:28:49.000Z | # coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose">
# Copyright (c) 2018 Aspose.Slides for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associa... | 37.186567 | 307 | 0.59422 |
dd1c4b7deab7eaade9c71acf20bf5c4904108640 | 14,984 | py | Python | cnmodel/cells/cartwheel.py | pbmanis/cnmodel | eee593c673752c19137658d5b9a381ea9ad4580f | [
"BSD-3-Clause"
] | null | null | null | cnmodel/cells/cartwheel.py | pbmanis/cnmodel | eee593c673752c19137658d5b9a381ea9ad4580f | [
"BSD-3-Clause"
] | null | null | null | cnmodel/cells/cartwheel.py | pbmanis/cnmodel | eee593c673752c19137658d5b9a381ea9ad4580f | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
from neuron import h
from ..util import nstomho
from ..util import Params
import numpy as np
from .cell import Cell
from .. import data
from .. import synapses
__all__ = ['Cartwheel', 'CartwheelDefault']
class Cartwheel(Cell):
celltype = 'cartwheel'
scaled = False
... | 45.268882 | 118 | 0.582822 |
d369f81b7b00821c42a1307a1eec12af99c5278e | 117 | py | Python | primaryschool/subjects/english/__init__.py | larryw3i/primaryschool | ca2b1f2dfa042a31c2119a5098a87c441fbbbbbe | [
"MIT"
] | null | null | null | primaryschool/subjects/english/__init__.py | larryw3i/primaryschool | ca2b1f2dfa042a31c2119a5098a87c441fbbbbbe | [
"MIT"
] | null | null | null | primaryschool/subjects/english/__init__.py | larryw3i/primaryschool | ca2b1f2dfa042a31c2119a5098a87c441fbbbbbe | [
"MIT"
] | null | null | null | import os
import sys
from primaryschool.locale import _
from primaryschool.subjects import *
name_t = _("English")
| 14.625 | 36 | 0.786325 |
ef6c1ca6146b835479429ee82d5170d809c6729c | 2,509 | py | Python | wgan-gp-master/mygan.py | GlitterMcGurk/GAN-Pytorch | b50a3e8f195ebf0c2d7067307c777b254d09b742 | [
"MIT"
] | 1 | 2019-02-07T13:33:46.000Z | 2019-02-07T13:33:46.000Z | wgan-gp-master/mygan.py | GlitterMcGurk/GAN-Pytorch | b50a3e8f195ebf0c2d7067307c777b254d09b742 | [
"MIT"
] | null | null | null | wgan-gp-master/mygan.py | GlitterMcGurk/GAN-Pytorch | b50a3e8f195ebf0c2d7067307c777b254d09b742 | [
"MIT"
] | 1 | 2019-02-07T13:33:21.000Z | 2019-02-07T13:33:21.000Z | # -*- coding: utf-8 -*-
import torch
import os
import imageio
from torch.utils.data import Dataset, DataLoader
from models import Generator, Discriminator
from training import Trainer
from dataloaders import get_mnist_dataloaders
from torchvision import transforms, utils
class NatureDataset(Dataset):
def __in... | 27.271739 | 85 | 0.629334 |
1f6233b860988041031a38d9760146d56282e151 | 5,028 | py | Python | Products/CMFDefault/browser/membership/tests/test_members.py | zopefoundation/Products.CMFDefault | a176d9aac5a7e04725dbd0f7b76c6ac357062139 | [
"ZPL-2.1"
] | null | null | null | Products/CMFDefault/browser/membership/tests/test_members.py | zopefoundation/Products.CMFDefault | a176d9aac5a7e04725dbd0f7b76c6ac357062139 | [
"ZPL-2.1"
] | 5 | 2017-07-13T00:51:25.000Z | 2021-02-04T15:08:39.000Z | Products/CMFDefault/browser/membership/tests/test_members.py | zopefoundation/Products.CMFDefault | a176d9aac5a7e04725dbd0f7b76c6ac357062139 | [
"ZPL-2.1"
] | 3 | 2017-07-08T03:22:35.000Z | 2018-05-20T06:42:03.000Z | ##############################################################################
#
# Copyright (c) 2008 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | 34.916667 | 79 | 0.664678 |
be2b024e420ded8ad6b9c4781c047da40752a7a8 | 221 | py | Python | divide_conquer/core/entity/user.py | thepabloaguilar/divide-and-conquer-talk | 0a9ea30814cf3383da56af20710300a9b8c89caa | [
"MIT"
] | 1 | 2020-10-02T18:43:40.000Z | 2020-10-02T18:43:40.000Z | divide_conquer/core/entity/user.py | thepabloaguilar/divide-and-conquer-talk | 0a9ea30814cf3383da56af20710300a9b8c89caa | [
"MIT"
] | 2 | 2020-09-13T05:03:02.000Z | 2020-12-04T21:38:17.000Z | divide_conquer/core/entity/user.py | thepabloaguilar/divide-and-conquer-talk | 0a9ea30814cf3383da56af20710300a9b8c89caa | [
"MIT"
] | null | null | null | from datetime import date, datetime
from uuid import UUID
from pydantic.dataclasses import dataclass
@dataclass
class User:
user_id: UUID
name: str
nickname: str
birthday: date
created_at: datetime
| 15.785714 | 42 | 0.737557 |
241a12a7ded87b2298b0ca92013e150e76864a00 | 500 | py | Python | databin/parsers/simple.py | pudo/databin | d650e88db934083ba39d22302fa0aec5997d71d9 | [
"MIT"
] | 20 | 2015-02-22T16:21:36.000Z | 2020-12-08T06:24:32.000Z | databin/parsers/simple.py | pudo/databin | d650e88db934083ba39d22302fa0aec5997d71d9 | [
"MIT"
] | 1 | 2015-12-24T17:14:18.000Z | 2015-12-24T17:14:18.000Z | databin/parsers/simple.py | pudo/databin | d650e88db934083ba39d22302fa0aec5997d71d9 | [
"MIT"
] | 9 | 2015-01-06T17:48:25.000Z | 2018-09-27T15:47:42.000Z | from StringIO import StringIO
import csv
def parse_cell(cell):
try:
return cell.decode('utf-8')
except:
return cell
def parse_csv(data, delimiter=','):
databuf = StringIO(data.encode('utf-8'))
rows = []
for row in csv.reader(databuf, delimiter=delimiter):
rows.append([par... | 19.230769 | 56 | 0.65 |
01feed6b40b43709f3336c16104f08a0a572be45 | 4,817 | py | Python | app/routes.py | dimobelov/boogle-search | 9dd3490df991d254f21397c071a9b0bb868b4d5f | [
"MIT"
] | null | null | null | app/routes.py | dimobelov/boogle-search | 9dd3490df991d254f21397c071a9b0bb868b4d5f | [
"MIT"
] | null | null | null | app/routes.py | dimobelov/boogle-search | 9dd3490df991d254f21397c071a9b0bb868b4d5f | [
"MIT"
] | null | null | null | from app import app
from app.filter import Filter
from app.request import Request, gen_query
import argparse
from bs4 import BeautifulSoup
from cryptography.fernet import Fernet, InvalidToken
from flask import g, make_response, request, redirect, render_template, send_file
import io
import json
import os
import urllib.... | 32.113333 | 104 | 0.668673 |
af010573e5b30abf1f1a3d027bc4c9b985bb051a | 2,717 | py | Python | timm/models/layers/conv_bn_act.py | xuritian317/pytorch-image-models | 034139e4871cddd0f6c24931b6ac380ba9f28711 | [
"Apache-2.0"
] | 2 | 2021-10-12T05:31:10.000Z | 2022-02-14T09:16:27.000Z | timm/models/layers/conv_bn_act.py | xuritian317/pytorch-image-models | 034139e4871cddd0f6c24931b6ac380ba9f28711 | [
"Apache-2.0"
] | null | null | null | timm/models/layers/conv_bn_act.py | xuritian317/pytorch-image-models | 034139e4871cddd0f6c24931b6ac380ba9f28711 | [
"Apache-2.0"
] | null | null | null | """ Conv2d + BN + Act
Hacked together by / Copyright 2020 Ross Wightman
"""
from torch import nn as nn
from .create_conv2d import create_conv2d
from .create_norm_act import get_norm_act_layer
class ConvNormAct(nn.Module):
def __init__(
self, in_channels, out_channels, kernel_size=1, stride=1, paddin... | 36.716216 | 118 | 0.680898 |
ab2fec039a397f19e0462d431e4fefe0b97bde70 | 871 | py | Python | lib/d3m_ta2/api_v2/data_ext.py | stevencdang/AutoML-DS-Components | b0490262d3db5307c37f82c92e25cd938dd3a242 | [
"Apache-2.0"
] | null | null | null | lib/d3m_ta2/api_v2/data_ext.py | stevencdang/AutoML-DS-Components | b0490262d3db5307c37f82c92e25cd938dd3a242 | [
"Apache-2.0"
] | 8 | 2020-09-04T17:39:26.000Z | 2022-03-02T03:28:38.000Z | lib/d3m_ta2/api_v2/data_ext.py | stevencdang/AutoML-DS-Components | b0490262d3db5307c37f82c92e25cd938dd3a242 | [
"Apache-2.0"
] | null | null | null | import proto.core_pb2 as core_pb2
import proto.data_ext_pb2_grpc as data_ext_pb2_grpc
from common import logger
class DataExt(data_ext_pb2_grpc.DataExtServicer):
def AddFeatures(self, request, context):
sessioncontext = request.context
logger.info("Got AddFeatures request, session=%s",
... | 28.096774 | 58 | 0.614237 |
56fe7edf77ceccfe91908812aea0ed8c82476a9b | 11,169 | py | Python | mirdata/rwc_jazz.py | marypilataki/mirdata | 78981e1f1e7b8661e2d04de0dd5640981bbb1881 | [
"BSD-3-Clause"
] | null | null | null | mirdata/rwc_jazz.py | marypilataki/mirdata | 78981e1f1e7b8661e2d04de0dd5640981bbb1881 | [
"BSD-3-Clause"
] | null | null | null | mirdata/rwc_jazz.py | marypilataki/mirdata | 78981e1f1e7b8661e2d04de0dd5640981bbb1881 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""RWC Jazz Dataset Loader.
The Jazz Music Database consists of 50 pieces:
* Instrumentation variations: 35 pieces (5 pieces × 7 instrumentations).
The instrumentation-variation pieces were recorded to obtain different versions
of the same piece; i.e., different arrangements performed by diffe... | 33.340299 | 101 | 0.649297 |
58abbebe9e8860a5c6e37d6357bb947091acfc47 | 630 | py | Python | synlib/descriptions/OAI221X2.py | vhnatyk/vlsistuff | 0981097bd19a0c482728dcc5048a3615ac9a9a90 | [
"MIT"
] | 26 | 2018-03-17T18:14:22.000Z | 2022-03-14T07:23:13.000Z | synlib/descriptions/OAI221X2.py | psumesh/vlsistuff | 1fe64b093d0581d99c7d826b74c31b8655fa0b31 | [
"MIT"
] | 1 | 2019-10-16T10:31:11.000Z | 2019-10-17T04:14:53.000Z | synlib/descriptions/OAI221X2.py | psumesh/vlsistuff | 1fe64b093d0581d99c7d826b74c31b8655fa0b31 | [
"MIT"
] | 7 | 2018-07-16T07:51:25.000Z | 2022-02-15T14:22:54.000Z | Desc = cellDescClass("OAI221X2")
Desc.properties["cell_footprint"] = "oai221"
Desc.properties["area"] = "43.243200"
Desc.properties["cell_leakage_power"] = "871.964514"
Desc.pinOrder = ['A0', 'A1', 'B0', 'B1', 'C0', 'Y']
Desc.add_arc("A0","Y","combi")
Desc.add_arc("A1","Y","combi")
Desc.add_arc("B0","Y","combi")
Desc.a... | 31.5 | 52 | 0.666667 |
4c069c57bab050eccbf03cf973368378149cdf32 | 5,034 | py | Python | pyegt.py | juliangarcia/pyegt | 02793a374aa50bec8c3779c0db34c64749ab5ff6 | [
"MIT"
] | 1 | 2021-09-03T02:35:00.000Z | 2021-09-03T02:35:00.000Z | pyegt.py | juliangarcia/pyegt | 02793a374aa50bec8c3779c0db34c64749ab5ff6 | [
"MIT"
] | null | null | null | pyegt.py | juliangarcia/pyegt | 02793a374aa50bec8c3779c0db34c64749ab5ff6 | [
"MIT"
] | 1 | 2021-09-03T02:35:16.000Z | 2021-09-03T02:35:16.000Z | import math
import numpy as np
from operator import itemgetter
from pyegt_cython import _fixation_probability_matrix
from pyegt_cython import _fixation_probability_pfunction
class MoranProcess:
"""
Moran Process
"""
def __init__(self, intensity_of_selection, population_size, mutation_probability, pay... | 41.603306 | 115 | 0.637068 |
957d7db51ae4c0c782dc37213c225093ffae8058 | 565 | py | Python | demo-temp.py | tonyslick/demo-temp | 48fc59f490d54d56b4639193ba356a70dd36714d | [
"MIT"
] | null | null | null | demo-temp.py | tonyslick/demo-temp | 48fc59f490d54d56b4639193ba356a70dd36714d | [
"MIT"
] | null | null | null | demo-temp.py | tonyslick/demo-temp | 48fc59f490d54d56b4639193ba356a70dd36714d | [
"MIT"
] | null | null | null | from gpiozero import CPUTemperature
from time import sleep, strftime, time
import matplotlib.pyplot as plt
cpu = CPUTemperature()
print(cpu.temperature)
plt.ion()
x = []
y = []
with open("/home/pi/cpu_temp.csv", "a") as log:
while True:
temp = cpu.temperature
print(temp)
#log.write("{0},... | 20.925926 | 80 | 0.548673 |
7caabed21522b7d2e041d8cd4e9116b4171b1845 | 2,204 | py | Python | unittests/test_GP_active.py | tsilifis/quinoa | cc01e942e0453ad4ec21da6223731745ec543371 | [
"MIT"
] | 1 | 2020-01-31T02:42:20.000Z | 2020-01-31T02:42:20.000Z | unittests/test_GP_active.py | tsilifis/quinoa | cc01e942e0453ad4ec21da6223731745ec543371 | [
"MIT"
] | null | null | null | unittests/test_GP_active.py | tsilifis/quinoa | cc01e942e0453ad4ec21da6223731745ec543371 | [
"MIT"
] | null | null | null | import numpy as np
import quinoa as qu
import matplotlib.pyplot as plt
import GPy as gpy
from scipy import linalg
#np.random.seed(31051985)
X = np.random.normal(scale = 1, size = (2,1))
Y = np.sin(X) + 0.005 * np.random.normal(size = (2,1))
kern = qu.RBF(1, 1, 1)
ker = gpy.kern.RBF(1, 1, 1)
m = gpy.models.GPRegre... | 25.333333 | 125 | 0.624319 |
4259e441963a25cd414e54447eb81ac9a3e49ea1 | 1,122 | py | Python | rb/complexity/word/wd_avg_depth_hypernym_tree.py | readerbench/ReaderBench | f0588a9a63ba21e3b8c2e5e5bc474904c07f6897 | [
"Apache-2.0"
] | null | null | null | rb/complexity/word/wd_avg_depth_hypernym_tree.py | readerbench/ReaderBench | f0588a9a63ba21e3b8c2e5e5bc474904c07f6897 | [
"Apache-2.0"
] | 2 | 2021-10-17T14:00:52.000Z | 2021-10-17T14:00:52.000Z | rb/complexity/word/wd_avg_depth_hypernym_tree.py | readerbench/ReaderBench | f0588a9a63ba21e3b8c2e5e5bc474904c07f6897 | [
"Apache-2.0"
] | null | null | null | from statistics import mean
from rb.complexity.complexity_index import ComplexityIndex
from rb.core.lang import Lang
from rb.core.text_element import TextElement
from rb.complexity.index_category import IndexCategory
from rb.complexity.measure_function import MeasureFunction
from rb.core.text_element_type import TextEl... | 38.689655 | 83 | 0.728164 |
6b36e47b9bc0268c12bd41bc50f36522f4d846f2 | 10,682 | py | Python | tests/test_onnxml_decision_tree_converter.py | gwd666/hummingbird | a39f0fbf4016754f8301dbaf54b0291b6a2e02e0 | [
"MIT"
] | null | null | null | tests/test_onnxml_decision_tree_converter.py | gwd666/hummingbird | a39f0fbf4016754f8301dbaf54b0291b6a2e02e0 | [
"MIT"
] | null | null | null | tests/test_onnxml_decision_tree_converter.py | gwd666/hummingbird | a39f0fbf4016754f8301dbaf54b0291b6a2e02e0 | [
"MIT"
] | null | null | null | """
Tests lightgbm->onnxmltools->hb conversion for lightgbm models.
"""
import unittest
import warnings
import sys
import os
import pickle
import numpy as np
from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
from onnxconver... | 39.128205 | 135 | 0.652031 |
8aef1935a11c685fe15b37b09d6e1657e628f868 | 20,460 | py | Python | Packs/ApiModules/Scripts/CSVFeedApiModule/CSVFeedApiModule.py | ANT1OFF/content | e5bab6df77be465b99829dcee933d8b00b4581a9 | [
"MIT"
] | null | null | null | Packs/ApiModules/Scripts/CSVFeedApiModule/CSVFeedApiModule.py | ANT1OFF/content | e5bab6df77be465b99829dcee933d8b00b4581a9 | [
"MIT"
] | null | null | null | Packs/ApiModules/Scripts/CSVFeedApiModule/CSVFeedApiModule.py | ANT1OFF/content | e5bab6df77be465b99829dcee933d8b00b4581a9 | [
"MIT"
] | null | null | null | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import csv
import gzip
import urllib3
from typing import Optional, Pattern, Dict, Any, Tuple, Union, List
# disable insecure warnings
urllib3.disable_warnings()
# Globals
DATE_FORMAT = '%Y-%m-%dT%H:%M:... | 44.868421 | 120 | 0.605034 |
84ccb6437d4e5804c02506ced1d1d2d18ce21e94 | 3,310 | py | Python | test/sagemaker_tests/mxnet/training/integration/local/test_horovod.py | Elizaaaaa/deep-learning-containers | 6274ecb264645070d11b27e5c7e60d2e4110537d | [
"Apache-2.0"
] | 1 | 2021-07-14T20:13:12.000Z | 2021-07-14T20:13:12.000Z | test/sagemaker_tests/mxnet/training/integration/local/test_horovod.py | Elizaaaaa/deep-learning-containers | 6274ecb264645070d11b27e5c7e60d2e4110537d | [
"Apache-2.0"
] | null | null | null | test/sagemaker_tests/mxnet/training/integration/local/test_horovod.py | Elizaaaaa/deep-learning-containers | 6274ecb264645070d11b27e5c7e60d2e4110537d | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-2020 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | 34.123711 | 100 | 0.710574 |
50b1035750b0f774a124ca20028c1cc88f1cee28 | 136 | py | Python | main.py | deeper-x/webonitor | cc1380dc4381a3e69702eda31e56f5ec42faab4e | [
"MIT"
] | null | null | null | main.py | deeper-x/webonitor | cc1380dc4381a3e69702eda31e56f5ec42faab4e | [
"MIT"
] | 1 | 2020-03-03T00:15:04.000Z | 2020-03-03T11:53:26.000Z | main.py | deeper-x/webonitor | cc1380dc4381a3e69702eda31e56f5ec42faab4e | [
"MIT"
] | null | null | null | from listener import Listen
from configuration import bucket
if __name__ == '__main__':
a = Listen()
a.observe(bucket, 'add')
| 17 | 32 | 0.698529 |
02d853bc9340fc7385f2e0a741d675e70d2797d1 | 3,605 | py | Python | src/riotwatcher/Handlers/RateLimit/HeaderBasedLimiter.py | TheBoringBakery/Riot-Watcher | 6e05fffe127530a75fd63e67da37ba81489fd4fe | [
"MIT"
] | 489 | 2015-01-04T22:49:51.000Z | 2022-03-28T03:15:54.000Z | src/riotwatcher/Handlers/RateLimit/HeaderBasedLimiter.py | TheBoringBakery/Riot-Watcher | 6e05fffe127530a75fd63e67da37ba81489fd4fe | [
"MIT"
] | 162 | 2015-02-09T22:10:40.000Z | 2022-02-22T13:48:50.000Z | src/riotwatcher/Handlers/RateLimit/HeaderBasedLimiter.py | TheBoringBakery/Riot-Watcher | 6e05fffe127530a75fd63e67da37ba81489fd4fe | [
"MIT"
] | 221 | 2015-01-07T18:01:57.000Z | 2022-03-26T21:18:48.000Z | import datetime
import logging
import threading
from typing import Dict, List, Optional
from .Limits import LimitCollection, RawLimit
log = logging.getLogger(__name__)
class HeaderBasedLimiter:
def __init__(self, limit_header: str, count_header: str, friendly_name: str = None):
self._limit_header = lim... | 30.550847 | 94 | 0.595284 |
0610e348ae08e249dc10f1ef26da14b9a7e00362 | 3,226 | py | Python | Jinja_code/Indivo_jsontoxml.py | backup1-technicise/Python-Training | 35d773b529bd6f3961787c9ddb54c4a1e8cc227a | [
"MIT"
] | 1 | 2018-01-19T09:54:22.000Z | 2018-01-19T09:54:22.000Z | Jinja_code/Indivo_jsontoxml.py | backup1-technicise/Python-Training | 35d773b529bd6f3961787c9ddb54c4a1e8cc227a | [
"MIT"
] | 3 | 2017-06-16T07:01:57.000Z | 2017-06-16T07:31:05.000Z | Jinja_code/Indivo_jsontoxml.py | backup1-technicise/Python-Training | 35d773b529bd6f3961787c9ddb54c4a1e8cc227a | [
"MIT"
] | null | null | null | import json # For handling JSON data from given JSON file
import sys # For handling command line arguments
import jinja2 # To create Controller for our template (template/jsontoxml_template.xml) to impart changes
import datetime # To estimate time duration
import time
def create_Dynamic_xml_dict(Object_dict... | 55.62069 | 200 | 0.758215 |
3170f2c837afc596836e8f4b931f19ad1637966c | 343 | py | Python | tests/test_checksums.py | thesynman/pybricksdev | 6f34cfb7a5f26628fe3cedae1ce51ee6024f57b9 | [
"MIT"
] | 25 | 2020-06-15T07:24:33.000Z | 2022-03-12T16:10:02.000Z | tests/test_checksums.py | thesynman/pybricksdev | 6f34cfb7a5f26628fe3cedae1ce51ee6024f57b9 | [
"MIT"
] | 29 | 2020-06-18T19:55:51.000Z | 2022-03-01T21:50:38.000Z | tests/test_checksums.py | thesynman/pybricksdev | 6f34cfb7a5f26628fe3cedae1ce51ee6024f57b9 | [
"MIT"
] | 12 | 2020-06-16T04:38:16.000Z | 2022-02-23T09:15:36.000Z | from pybricksdev.tools.checksum import xor_bytes
def test_xor_bytes():
assert xor_bytes(b"\x00") == 0xFF ^ 0x00
assert xor_bytes(b"\x00", 0x00) == 0x00 ^ 0x00
assert xor_bytes(b"\xFF") == 0xFF ^ 0xFF
assert xor_bytes(b"\xFF", 0x00) == 0x00 ^ 0xFF
assert xor_bytes(b"\x01\x02\x03\x04") == 0xFF ^ 0x0... | 34.3 | 77 | 0.653061 |
4f29774431e43ad8c8c6b59a6871ef4c86a35c1f | 1,141 | py | Python | app/__init__.py | kevin3708/blogposter | b72616a712e2a3c9d6577fab10d75fa4a0c26d13 | [
"MIT"
] | null | null | null | app/__init__.py | kevin3708/blogposter | b72616a712e2a3c9d6577fab10d75fa4a0c26d13 | [
"MIT"
] | null | null | null | app/__init__.py | kevin3708/blogposter | b72616a712e2a3c9d6577fab10d75fa4a0c26d13 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_bootstrap import Bootstrap
from flask_sqlalchemy import SQLAlchemy
from flask_simplemde import SimpleMDE
from config import config_options
from flask_login import LoginManager
from flask_uploads import UploadSet,configure_uploads,IMAGES
login_manager = LoginManager()
login_manager.... | 25.355556 | 71 | 0.775635 |
bde2402e155d309bb0ef0546283f47a709d664eb | 382 | py | Python | DMOJ/CCC/tournament selection.py | eddiegz/Personal-C | f7869826216e5c665f8f646502141f0dc680e545 | [
"MIT"
] | 3 | 2021-05-15T08:18:09.000Z | 2021-05-17T04:41:57.000Z | DMOJ/CCC/tournament selection.py | eddiegz/Personal-C | f7869826216e5c665f8f646502141f0dc680e545 | [
"MIT"
] | null | null | null | DMOJ/CCC/tournament selection.py | eddiegz/Personal-C | f7869826216e5c665f8f646502141f0dc680e545 | [
"MIT"
] | null | null | null | number=0
list1=[]
wnumber=0
lnumber=0
while number<7:
winnumber=input().upper()
number+=1
list1.append(winnumber)
for i in list1:
if 'W' == i:
wnumber+=1
else:
lnumber+=1
if wnumber>=5:
print('1')
elif wnumber<=4 and wnumber>=3:
print('2')
elif wnum... | 17.363636 | 32 | 0.536649 |
9aa960d4bdc97d06022118022e1ce8a8b80cbee5 | 903 | py | Python | 01 - Basics/45-datatypes-iterator-sets.py | python-demo-codes/basics | 2a151bbff4b528cefd52978829c632fd087c8f20 | [
"DOC"
] | 2 | 2019-08-23T06:05:55.000Z | 2019-08-26T03:56:07.000Z | 01 - Basics/45-datatypes-iterator-sets.py | python-lang-codes/basics | 2a151bbff4b528cefd52978829c632fd087c8f20 | [
"DOC"
] | null | null | null | 01 - Basics/45-datatypes-iterator-sets.py | python-lang-codes/basics | 2a151bbff4b528cefd52978829c632fd087c8f20 | [
"DOC"
] | 4 | 2020-10-01T07:16:07.000Z | 2021-07-17T07:55:08.000Z | # HEAD
# Python Basics - Sets Data Types
# DESCRIPTION
# Describes how
# - sets are created
# - set function is used to create a set
#
# RESOURCES
#
# # NON-SEQUENCE ITERATORS
# Sequence based Iterators allow identification or reference
# of every loop-able item with an KEY or NO REFERENCE/KEY/INDEX... | 22.575 | 69 | 0.653378 |
a451fd4a511951bdda203ac04145609669b1463e | 217 | py | Python | amadeus/query/qreason.py | basic60/BOP2017_QualificationRound | 77a6b026ef066f9734c3b0d23c97eb6feb03d010 | [
"MIT"
] | null | null | null | amadeus/query/qreason.py | basic60/BOP2017_QualificationRound | 77a6b026ef066f9734c3b0d23c97eb6feb03d010 | [
"MIT"
] | null | null | null | amadeus/query/qreason.py | basic60/BOP2017_QualificationRound | 77a6b026ef066f9734c3b0d23c97eb6feb03d010 | [
"MIT"
] | null | null | null | _query_reason_word=['为什么','为何']
_answer_word=['因为']
def isqreason(word):
return word in _query_reason_word
def hasanswer(s):
for j in _answer_word:
if j in s:
return True
return False
| 19.727273 | 37 | 0.64977 |
20faba5017703641b4f235e86bc827534ef8ef40 | 325 | py | Python | python/python_version.py | ysoftman/test_code | 4c71cc7c6a17d73cc84298e3a44051d3ab9d40f8 | [
"MIT"
] | 3 | 2017-12-07T04:29:36.000Z | 2022-01-11T10:58:14.000Z | python/python_version.py | ysoftman/test_code | 4c71cc7c6a17d73cc84298e3a44051d3ab9d40f8 | [
"MIT"
] | 14 | 2018-07-17T05:16:42.000Z | 2022-03-22T00:43:47.000Z | python/python_version.py | ysoftman/test_code | 4c71cc7c6a17d73cc84298e3a44051d3ab9d40f8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# author: ysoftman
# python version : 2.x 3.x
# desc : python 2/3 버전 체크해 분기
import imp
import sys
print (sys.version_info)
python_major_version = sys.version_info[0]
# 3.x 버전대
if python_major_version >= 3:
print ("python", python_major_version)
else:
print ("python", python_major_vers... | 19.117647 | 42 | 0.701538 |
2642b3e5bc47f9a483e178b108ee4f03a3e7a88b | 215 | py | Python | backend/common/models.py | Beomjun/django-backend | 91c7ea4a1a3da68f0ed5ab5b3d1d66befbd64f16 | [
"MIT"
] | 2 | 2021-05-19T05:44:39.000Z | 2021-07-13T11:25:50.000Z | backend/common/models.py | Beomjun/django-backend | 91c7ea4a1a3da68f0ed5ab5b3d1d66befbd64f16 | [
"MIT"
] | 2 | 2021-07-24T01:26:27.000Z | 2022-02-10T11:55:36.000Z | backend/common/models.py | Beomjun/django-backend | 91c7ea4a1a3da68f0ed5ab5b3d1d66befbd64f16 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import uuid
from django.db import models
class UUIDModel(models.Model):
uuid = models.UUIDField(unique=True, default=uuid.uuid4, editable=False)
class Meta:
abstract = True
| 17.916667 | 76 | 0.711628 |
a5eaab7a2881c7c85e08020a373b1be0dfb6610d | 1,241 | py | Python | profiles/migrations/New folder/0038_user.py | Rxavio/link | a0aa34b89a769cfaa20a92a04980e142e42eaa10 | [
"MIT"
] | null | null | null | profiles/migrations/New folder/0038_user.py | Rxavio/link | a0aa34b89a769cfaa20a92a04980e142e42eaa10 | [
"MIT"
] | null | null | null | profiles/migrations/New folder/0038_user.py | Rxavio/link | a0aa34b89a769cfaa20a92a04980e142e42eaa10 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-11-03 05:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0037_contact'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', mo... | 38.78125 | 114 | 0.580983 |
f7c97fa0471e26b2c84190883191f9ed159a2f4f | 3,788 | py | Python | pystatreduce/doc/plot/plot_hadamard/run_hadamard_eigen_accuracy.py | OptimalDesignLab/pyStatReduce | 9ea128409b91dd582e574e2e1cc153572b6c60a4 | [
"MIT"
] | null | null | null | pystatreduce/doc/plot/plot_hadamard/run_hadamard_eigen_accuracy.py | OptimalDesignLab/pyStatReduce | 9ea128409b91dd582e574e2e1cc153572b6c60a4 | [
"MIT"
] | null | null | null | pystatreduce/doc/plot/plot_hadamard/run_hadamard_eigen_accuracy.py | OptimalDesignLab/pyStatReduce | 9ea128409b91dd582e574e2e1cc153572b6c60a4 | [
"MIT"
] | null | null | null | # run_hadamard_eigen_accuracy
import os
import sys
import errno
import numpy as np
import chaospy as cp
from pystatreduce.stochastic_collocation import StochasticCollocation
from pystatreduce.quantity_of_interest import QuantityOfInterest
from pystatreduce.dimension_reduction import DimensionReduction
import pystatre... | 42.088889 | 111 | 0.674234 |
6b6ac90bced58fd60bfb006b073806035152e7ae | 50 | py | Python | publicserver.py | kylemarsh/coldframe-monitor | 00251a83fc8ea63017a554718ed98505fe0e5b1a | [
"MIT"
] | null | null | null | publicserver.py | kylemarsh/coldframe-monitor | 00251a83fc8ea63017a554718ed98505fe0e5b1a | [
"MIT"
] | null | null | null | publicserver.py | kylemarsh/coldframe-monitor | 00251a83fc8ea63017a554718ed98505fe0e5b1a | [
"MIT"
] | null | null | null | from coldframe import app
app.run(host='0.0.0.0')
| 16.666667 | 25 | 0.72 |
60e72df771a7e9a4ad6da65b7e22b7de9534127a | 613 | py | Python | home/migrations/0001_initial.py | Sandaru95/onlinesystem | dc5cfac26a21583f3554fae085c1a0d6dd5589ad | [
"Apache-2.0"
] | null | null | null | home/migrations/0001_initial.py | Sandaru95/onlinesystem | dc5cfac26a21583f3554fae085c1a0d6dd5589ad | [
"Apache-2.0"
] | null | null | null | home/migrations/0001_initial.py | Sandaru95/onlinesystem | dc5cfac26a21583f3554fae085c1a0d6dd5589ad | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2.6 on 2019-10-29 16:04
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Message',
fields=[
('id', models.AutoField(... | 25.541667 | 114 | 0.570962 |
56567b2fe3824edddda30237435da66452f83a9a | 286 | py | Python | saleor/product/migrations/0122_merge_20200818_1700.py | nlkhagva/saleor | 0d75807d08ac49afcc904733724ac870e8359c10 | [
"CC-BY-4.0"
] | null | null | null | saleor/product/migrations/0122_merge_20200818_1700.py | nlkhagva/saleor | 0d75807d08ac49afcc904733724ac870e8359c10 | [
"CC-BY-4.0"
] | 1 | 2022-02-15T03:31:12.000Z | 2022-02-15T03:31:12.000Z | saleor/product/migrations/0122_merge_20200818_1700.py | nlkhagva/ushop | abf637eb6f7224e2d65d62d72a0c15139c64bb39 | [
"CC-BY-4.0"
] | null | null | null | # Generated by Django 3.1 on 2020-08-18 09:00
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('product', '0121_merge_20200806_1909'),
('product', '0121_auto_20200810_1415'),
]
operations = [
]
| 19.066667 | 49 | 0.618881 |
4906e918ed34d1146769cc3fea3f0b37e7396c5a | 1,064 | py | Python | leetcode_python/Stack/validate-stack-sequences.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 18 | 2019-08-01T07:45:02.000Z | 2022-03-31T18:05:44.000Z | leetcode_python/Stack/validate-stack-sequences.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Stack/validate-stack-sequences.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 15 | 2019-12-29T08:46:20.000Z | 2022-03-08T14:14:05.000Z | # V0
# V1
# https://blog.csdn.net/fuxuemingzhu/article/details/84495797
class Solution(object):
def validateStackSequences(self, pushed, popped):
"""
:type pushed: List[int]
:type popped: List[int]
:rtype: bool
"""
stack = []
N = len(pushed)
pi = 0
... | 25.333333 | 63 | 0.452068 |
619e42bd589c635a95a9746022904dfa797cc9e4 | 2,152 | py | Python | Advance_Python/Tree/Binary_Heap.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | Advance_Python/Tree/Binary_Heap.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | Advance_Python/Tree/Binary_Heap.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | # Python program to implement binary heap
class Binary_Heap:
def __init__(self):
self.item = []
def size(self): # size of heap
return len(self.item)
def parent(self, i): # parent node of heap
return (i - 1)//2
def left(self, i): # left child of hea... | 27.589744 | 68 | 0.498141 |
f5b72f836f10e0c6b7223bdeddd5c55693cf33e8 | 1,175 | py | Python | qiita_db/__init__.py | charles-cowart/qiita | 328e986a9dc3d7caa2e33afacd61e6aae9abed85 | [
"BSD-3-Clause"
] | 96 | 2015-01-10T23:40:03.000Z | 2021-01-04T09:07:16.000Z | qiita_db/__init__.py | charles-cowart/qiita | 328e986a9dc3d7caa2e33afacd61e6aae9abed85 | [
"BSD-3-Clause"
] | 2,304 | 2015-01-01T17:46:14.000Z | 2021-01-07T02:38:52.000Z | qiita_db/__init__.py | antgonza/qiita | 714f3589ae1699317ad3a314653913f453d347d2 | [
"BSD-3-Clause"
] | 68 | 2015-02-18T21:42:31.000Z | 2020-12-01T19:08:57.000Z | # -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | 31.756757 | 79 | 0.619574 |
dcd35c5b03a3932d2a2b7950c124dfe4a123785a | 2,374 | py | Python | MoveDataSGBD.py | Brwnb/sdbdMigration | fa4c856485197c316a5fc493c24706548345d3c5 | [
"MIT"
] | null | null | null | MoveDataSGBD.py | Brwnb/sdbdMigration | fa4c856485197c316a5fc493c24706548345d3c5 | [
"MIT"
] | null | null | null | MoveDataSGBD.py | Brwnb/sdbdMigration | fa4c856485197c316a5fc493c24706548345d3c5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Esse script visa buscar informações em um sistema Windows com MSSQL,
# para um sistema Linux com MySQL ou Mariadb.
# O objetivo é usar determinados campos para usuário e senha
# em um Freeradius.
# Criei várias versões desse escript porque
# conforme o projeto avançava, vi a necessidade
# ... | 30.831169 | 100 | 0.642376 |
626ff6ca58cefa3543344bfb230dff8cab13a570 | 125,159 | py | Python | cinder/tests/unit/test_dellsc.py | HybridF5/cinder | dbbe27f850b7a5ec8e614401442a28ee67bdad0c | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/test_dellsc.py | HybridF5/cinder | dbbe27f850b7a5ec8e614401442a28ee67bdad0c | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/test_dellsc.py | HybridF5/cinder | dbbe27f850b7a5ec8e614401442a28ee67bdad0c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 Dell 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 a... | 49.844285 | 79 | 0.508697 |
0091b448ceb5a25e9ee96500c93c0d6a0cfd0058 | 2,598 | py | Python | matplotlib/komand_matplotlib/actions/create_pair_plot/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | matplotlib/komand_matplotlib/actions/create_pair_plot/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | matplotlib/komand_matplotlib/actions/create_pair_plot/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Input:
COLOR_PALETTE = "color_palette"
CSV_DATA = "csv_data"
HUE = "hue"
KIND = "kind"
MARGIN_STYLE = "margin_style"
class Output:
CSV = "csv"
PLOT = "plot"
class CreatePairPlotInput(komand.Input):
sche... | 20.296875 | 82 | 0.50154 |
6bc2d5de4b8312ec68f6775e6101a9c7cdcda997 | 24,068 | py | Python | sphinx_gallery/gen_gallery.py | drammock/sphinx-gallery | 373df6521524575b417c5b9f7c37bfcd4f55167e | [
"BSD-3-Clause"
] | null | null | null | sphinx_gallery/gen_gallery.py | drammock/sphinx-gallery | 373df6521524575b417c5b9f7c37bfcd4f55167e | [
"BSD-3-Clause"
] | null | null | null | sphinx_gallery/gen_gallery.py | drammock/sphinx-gallery | 373df6521524575b417c5b9f7c37bfcd4f55167e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Author: Óscar Nájera
# License: 3-clause BSD
"""
Sphinx-Gallery Generator
========================
Attaches Sphinx-Gallery to Sphinx in order to generate the galleries
when building the documentation.
"""
from __future__ import division, print_function, absolute_import
import codecs
import ... | 39.520525 | 99 | 0.63358 |
f80d1d92307bd76378f8ea370444628be6974198 | 4,133 | py | Python | extra/unused/season.py | whyjz/CARST | 875c915e835b0e09a7eccb58833719bbfc85b635 | [
"MIT"
] | 10 | 2018-01-02T18:03:07.000Z | 2022-01-25T05:36:21.000Z | extra/unused/season.py | whyjz/CARST | 875c915e835b0e09a7eccb58833719bbfc85b635 | [
"MIT"
] | 1 | 2020-04-14T16:57:15.000Z | 2020-05-15T16:10:17.000Z | extra/unused/season.py | whyjz/CARST | 875c915e835b0e09a7eccb58833719bbfc85b635 | [
"MIT"
] | 4 | 2016-08-12T15:06:48.000Z | 2019-11-27T05:33:50.000Z | #!/usr/bin/python
# season.py
# Author: Andrew Kenneth Melkonian
# All rights reserved
# Description
# ***********
# Reads filenames that contain dates, returns later date, earlier date, interval in days an mean date
# Usage
# *****
# python /path/to/filelist.txt
# Input
# *****
# /path/to/filelist.txt - One-col... | 32.543307 | 141 | 0.638761 |
2d318a9def0e244080775d85abf804c4fca536da | 577 | py | Python | homeassistant/util/yaml/objects.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | homeassistant/util/yaml/objects.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/util/yaml/objects.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Custom yaml object types."""
from __future__ import annotations
from dataclasses import dataclass
import yaml
class NodeListClass(list):
"""Wrapper class to be able to add attributes on a list."""
class NodeStrClass(str):
"""Wrapper class to be able to add attributes on a string."""
@dataclass(frozen... | 21.37037 | 76 | 0.686308 |
299f8907fc234bd6cc4a4f700658464e1c460092 | 1,865 | py | Python | markov.py | Robo-Dave/Markov | e2384340250cf99d82295fcb56f165bd6d43d76b | [
"MIT"
] | 1 | 2016-04-21T18:13:49.000Z | 2016-04-21T18:13:49.000Z | markov.py | Robo-Dave/Markov | e2384340250cf99d82295fcb56f165bd6d43d76b | [
"MIT"
] | null | null | null | markov.py | Robo-Dave/Markov | e2384340250cf99d82295fcb56f165bd6d43d76b | [
"MIT"
] | null | null | null | #!/usr/bin/python
# coding=utf-8
#
# markov.py
#
# Author: David Rottenfusser
# Date: 5 Apr 2014
#
# Builds a hidden Markov model of Lorem Ipsum, then executes the model to
# generate a pseudorandom sequence of characters in the same style.
#
# The model has one-letter memory, and chooses the next letter based on the
#... | 24.866667 | 80 | 0.631099 |
3bae672de54dac330334b58ead48b002095c8bb9 | 4,943 | py | Python | RRT.py | Shaswat2001/Motion_planning_of_Robots | d9231fd755f8e316c89c3b5d5922d15bc816ce20 | [
"MIT"
] | 1 | 2021-06-28T20:53:30.000Z | 2021-06-28T20:53:30.000Z | RRT.py | Shaswat2001/Motion_planning_of_Robots | d9231fd755f8e316c89c3b5d5922d15bc816ce20 | [
"MIT"
] | null | null | null | RRT.py | Shaswat2001/Motion_planning_of_Robots | d9231fd755f8e316c89c3b5d5922d15bc816ce20 | [
"MIT"
] | null | null | null | import random
import copy
import math
from graph import check_edge_CollisionFree,same_node_graph,graph_conv
import cv2
from map import load_map
from Visualize import generate_video
from Nodes import Node,start,goal,check_nodes,check_NodeIn_list,calculate_distance
def check_Node_goalRadius(goal_node,new_node):
'''
... | 30.325153 | 114 | 0.657293 |
06c8315a6d06caa7fd880a429195fe39a0cde7a4 | 2,114 | py | Python | src/seq_len_dis.py | ansijing/pyfastqc | cf2d3f44fedca79be9a15ba71c2f0451ba83778b | [
"Apache-2.0"
] | null | null | null | src/seq_len_dis.py | ansijing/pyfastqc | cf2d3f44fedca79be9a15ba71c2f0451ba83778b | [
"Apache-2.0"
] | null | null | null | src/seq_len_dis.py | ansijing/pyfastqc | cf2d3f44fedca79be9a15ba71c2f0451ba83778b | [
"Apache-2.0"
] | null | null | null | import gzip
import os
import collections
import operator
import matplotlib.pyplot as plt
def seq_len_distribut(file_path):
if not os.path.exists(file_path):
print('file not exists! Please check')
return
#print('Input file: ', file_path)
if file_path.endswith('.gz'):
my_open = ... | 34.096774 | 100 | 0.600284 |
6c5daad097f53ade2cf9cb568eae77cbb1db6c5d | 4,578 | py | Python | controllers/district_controller.py | samuelcouch/the-blue-alliance | 8c7977071dbe9d9745ffdfbb03e37bd016792511 | [
"MIT"
] | null | null | null | controllers/district_controller.py | samuelcouch/the-blue-alliance | 8c7977071dbe9d9745ffdfbb03e37bd016792511 | [
"MIT"
] | null | null | null | controllers/district_controller.py | samuelcouch/the-blue-alliance | 8c7977071dbe9d9745ffdfbb03e37bd016792511 | [
"MIT"
] | null | null | null | import datetime
import logging
import os
from google.appengine.ext import ndb
from google.appengine.ext.webapp import template
from controllers.base_controller import CacheableHandler
from consts.district_type import DistrictType
from consts.event_type import EventType
from database.team_query import DistrictTeamsQ... | 40.875 | 179 | 0.691568 |
43b5ec7b40ab2229ba90f210ced733791d7df89e | 5,139 | py | Python | pypytorch/nn/modules/module.py | dark-ai/pypytorch | d28e0f858ad7c33a14e4bb71dc68ae56ba97c5cf | [
"MIT"
] | 10 | 2019-08-13T10:29:14.000Z | 2022-02-21T01:57:33.000Z | pypytorch/nn/modules/module.py | dark-ai/pypytorch | d28e0f858ad7c33a14e4bb71dc68ae56ba97c5cf | [
"MIT"
] | 1 | 2019-10-25T02:26:45.000Z | 2019-10-25T11:15:10.000Z | pypytorch/nn/modules/module.py | dark-ai/pypytorch | d28e0f858ad7c33a14e4bb71dc68ae56ba97c5cf | [
"MIT"
] | 2 | 2019-08-17T00:48:37.000Z | 2019-10-24T09:22:37.000Z | # -*- coding: utf-8 -*-
import os
import time
from collections import OrderedDict
import json
import pypytorch as t
def extract_modules(o):
named_moudles = OrderedDict()
for key in o.__dict__:
if key in ['weight', 'bias']:
continue
value = o.__dict__[key]
if isinstance(val... | 31.919255 | 124 | 0.591944 |
e3b6ad44a57b6a67686c99e6a9ed337d48c1a116 | 3,927 | py | Python | dags/utils/balances/dai.py | makerdao-data/airflow-docker-image | 498b8ff83c0e9651c3fd36a91a516ea80f32e8a7 | [
"Apache-2.0"
] | null | null | null | dags/utils/balances/dai.py | makerdao-data/airflow-docker-image | 498b8ff83c0e9651c3fd36a91a516ea80f32e8a7 | [
"Apache-2.0"
] | 1 | 2022-03-22T13:57:44.000Z | 2022-03-22T13:57:44.000Z | dags/utils/balances/dai.py | makerdao-data/airflow-docker-image | 498b8ff83c0e9651c3fd36a91a516ea80f32e8a7 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime, timedelta
from airflow.exceptions import AirflowFailException
import sys
sys.path.append('/opt/airflow/')
from dags.connectors.sf import sf
from dags.connectors.sf import _write_to_stage, _write_to_table, _clear_stage
# get balances
def get_dai_balances(date):
query = f"""
... | 27.65493 | 93 | 0.600458 |
64df9f734aa6ab9d2df085914aeb2c5da8b048ee | 9,442 | py | Python | hoomd/md/pair/aniso.py | XT-Lee/hoomd-blue | 0188f56f32c4a3efe0e74a3dc27397d6ec3469b0 | [
"BSD-3-Clause"
] | null | null | null | hoomd/md/pair/aniso.py | XT-Lee/hoomd-blue | 0188f56f32c4a3efe0e74a3dc27397d6ec3469b0 | [
"BSD-3-Clause"
] | null | null | null | hoomd/md/pair/aniso.py | XT-Lee/hoomd-blue | 0188f56f32c4a3efe0e74a3dc27397d6ec3469b0 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2009-2021 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
"""Anisotropic potentials."""
import json
from hoomd import md
from hoomd.md.pair.pair import Pair
from hoomd.logging import log
from hoomd.data.parameterdicts... | 37.61753 | 80 | 0.615124 |
6f822efa2a873043b59ddf08270494693e34af12 | 6,800 | py | Python | flexget/plugins/urlrewrite_torrentleech.py | RSully/flexget-flexget | ab36590e569511a43c1e35b1dfae9b7fb8db1535 | [
"MIT"
] | null | null | null | flexget/plugins/urlrewrite_torrentleech.py | RSully/flexget-flexget | ab36590e569511a43c1e35b1dfae9b7fb8db1535 | [
"MIT"
] | null | null | null | flexget/plugins/urlrewrite_torrentleech.py | RSully/flexget-flexget | ab36590e569511a43c1e35b1dfae9b7fb8db1535 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
import re
import urllib
import logging
from flexget import plugin
from flexget.config_schema import one_or_more
from flexget.entry import Entry
from flexget.event import event
from flexget.plugins.plugin_urlrewriting import UrlRewritingError
from flexg... | 39.766082 | 129 | 0.555294 |
273b3c229d7e8d9065887ae605362ad6d142829b | 4,595 | py | Python | opsgenie_swagger/models/alert_action_payload.py | Logicworks/opsgenie-python-sdk | 244c4c40ddcc25e70df5ba4425ab8d7c8da59c18 | [
"Apache-2.0"
] | null | null | null | opsgenie_swagger/models/alert_action_payload.py | Logicworks/opsgenie-python-sdk | 244c4c40ddcc25e70df5ba4425ab8d7c8da59c18 | [
"Apache-2.0"
] | null | null | null | opsgenie_swagger/models/alert_action_payload.py | Logicworks/opsgenie-python-sdk | 244c4c40ddcc25e70df5ba4425ab8d7c8da59c18 | [
"Apache-2.0"
] | 1 | 2020-11-07T11:27:13.000Z | 2020-11-07T11:27:13.000Z | # coding: utf-8
"""
OpsGenie REST API
OpsGenie OpenAPI Specification # noqa: E501
OpenAPI spec version: 2.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class AlertActionPayload(object):
"""NOTE: This class is a... | 26.871345 | 100 | 0.563003 |
5b2a20c3ae8141a064829ff4bbab698dd670e961 | 3,341 | py | Python | backend/core/models.py | IceKhan13/QiskitFlow | ec9a403a04145454c35b21bdfb26e893f52a428f | [
"Apache-2.0"
] | 7 | 2020-10-21T20:51:00.000Z | 2021-08-24T14:21:35.000Z | backend/core/models.py | IceKhan13/QiskitFlow | ec9a403a04145454c35b21bdfb26e893f52a428f | [
"Apache-2.0"
] | 11 | 2020-10-22T03:24:54.000Z | 2021-02-13T02:41:06.000Z | backend/core/models.py | IceKhan13/QiskitFlow | ec9a403a04145454c35b21bdfb26e893f52a428f | [
"Apache-2.0"
] | 5 | 2020-10-08T17:24:59.000Z | 2022-01-30T16:27:03.000Z | from django.contrib.auth.models import User
from django.db import models
class Experiment(models.Model):
""" Base class for experiments. """
name = models.CharField(max_length=255)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
archive = mod... | 29.830357 | 62 | 0.600419 |
56e7709999f1a1e42f1fcecdc9b8ed1a48f98fef | 5,507 | py | Python | tests/utils/test_namespaces.py | pashashocky/xsdata | 1cd681598d2235626d0e21716fc9fb885d26e351 | [
"MIT"
] | null | null | null | tests/utils/test_namespaces.py | pashashocky/xsdata | 1cd681598d2235626d0e21716fc9fb885d26e351 | [
"MIT"
] | null | null | null | tests/utils/test_namespaces.py | pashashocky/xsdata | 1cd681598d2235626d0e21716fc9fb885d26e351 | [
"MIT"
] | null | null | null | from typing import Dict
from unittest import TestCase
from xsdata.models.enums import Namespace
from xsdata.utils.namespaces import build_qname
from xsdata.utils.namespaces import clean_prefixes
from xsdata.utils.namespaces import clean_uri
from xsdata.utils.namespaces import generate_prefix
from xsdata.utils.namespac... | 39.905797 | 85 | 0.606319 |
32f06afb97bece1ff0b32a99fe5f77902dc2355a | 2,453 | py | Python | docker/docker-integration/prototype/egodocker/ego-docker/egodocker/i18n.py | gyliu513/work | 4ba70e1ca1c0e19a0fe0c9833d4cd6d859137a57 | [
"Apache-2.0"
] | 6 | 2018-04-24T16:08:12.000Z | 2019-10-22T05:49:12.000Z | docker/docker-integration/prototype/egodocker/ego-docker/egodocker/i18n.py | jay-lau/jay-work | 4ba70e1ca1c0e19a0fe0c9833d4cd6d859137a57 | [
"Apache-2.0"
] | 21 | 2020-02-26T07:58:27.000Z | 2022-03-19T02:46:28.000Z | docker/docker-integration/prototype/egodocker/ego-docker/egodocker/i18n.py | jay-lau/jay-work | 4ba70e1ca1c0e19a0fe0c9833d4cd6d859137a57 | [
"Apache-2.0"
] | 8 | 2018-07-26T17:22:46.000Z | 2019-04-14T19:34:42.000Z | # Copyright 2014 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 29.914634 | 78 | 0.751733 |
8bc2d43a9220f25b18d19834da9a958d4fbf35a3 | 436 | py | Python | study/test/descripter/Tracer2.py | chozee/pytest | 58206f99bd74ce7a266191036b14deff86848645 | [
"MIT"
] | null | null | null | study/test/descripter/Tracer2.py | chozee/pytest | 58206f99bd74ce7a266191036b14deff86848645 | [
"MIT"
] | null | null | null | study/test/descripter/Tracer2.py | chozee/pytest | 58206f99bd74ce7a266191036b14deff86848645 | [
"MIT"
] | null | null | null |
class tracer(object):
def __init__(self, func):
self.calls = 0
self.func = func
def __call__(self, *args, **kwargs):
self.calls += 1
print('call %s to %s ' % (self.calls, self.func.__name__))
return self.func(*args, **kwargs)
def __get__(self, instance, owner):
... | 18.956522 | 66 | 0.557339 |
75ed7f4a14c439156d6bf6e835d5eafc71e9ceab | 2,700 | py | Python | DSA/stack/two_stacks_in_an_array.py | RohanMiraje/DSAwithPython | ea4884afcac9d6cc2817a93e918c829dd10cef5d | [
"MIT"
] | 2 | 2020-02-12T03:00:03.000Z | 2020-07-06T17:27:03.000Z | DSA/stack/two_stacks_in_an_array.py | RohanMiraje/DSAwithPython | ea4884afcac9d6cc2817a93e918c829dd10cef5d | [
"MIT"
] | null | null | null | DSA/stack/two_stacks_in_an_array.py | RohanMiraje/DSAwithPython | ea4884afcac9d6cc2817a93e918c829dd10cef5d | [
"MIT"
] | null | null | null | class TwoStackArray:
"""
This implementation uses stack size efficiently
Idea is to start two stacks tops from most left and most right side
"""
def __init__(self, capacity):
self.capacity = capacity
self.stack = [0] * self.capacity
self.top_1 = -1
self.top_2 = self.... | 27.55102 | 79 | 0.540741 |
c36c56819aebe7f9d2f75e9e708f2cc666df9522 | 4,853 | py | Python | app/payment/models.py | newer027/hlf_backend | d309faf12edf16dec986b1dc5b0b006deeaa3222 | [
"MIT"
] | null | null | null | app/payment/models.py | newer027/hlf_backend | d309faf12edf16dec986b1dc5b0b006deeaa3222 | [
"MIT"
] | 5 | 2020-06-06T01:40:57.000Z | 2022-02-10T09:27:26.000Z | app/payment/models.py | newer027/hlf_backend | d309faf12edf16dec986b1dc5b0b006deeaa3222 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.db import models
import django.db.models.deletion
from contract.models import OrderStart
class UpperPayment(models.Model):
serial_id = models.CharField(max_length = 100,primary_key=True)
create_time = models.DateTimeField(blank=True, null=True)
invoice_org = models.Cha... | 43.720721 | 142 | 0.742427 |
96137f5ee88e7443a7e0ec3f40a1d65fa220e88e | 827 | py | Python | EGGS_labrad/scripts/other/pm100d_measure.py | EGGS-Experiment/EGGS_Control | c29b3ab0e30dcb6e01d1ca3212ac64ad1506143b | [
"MIT"
] | 2 | 2021-12-26T05:00:54.000Z | 2021-12-30T17:15:49.000Z | EGGS_labrad/scripts/other/pm100d_measure.py | EGGS-Experiment/EGGS_Control | c29b3ab0e30dcb6e01d1ca3212ac64ad1506143b | [
"MIT"
] | null | null | null | EGGS_labrad/scripts/other/pm100d_measure.py | EGGS-Experiment/EGGS_Control | c29b3ab0e30dcb6e01d1ca3212ac64ad1506143b | [
"MIT"
] | null | null | null | import labrad
from time import time, sleep
from datetime import datetime
# connect to eggs labrad
cxn = labrad.connect('localhost', password='lab')
dv = cxn.data_vault
pm = cxn.pm100d_server
cr_dv = cxn.context()
# create dataset
date = datetime.now()
year = str(date.year)
month = '{:02d}'.format(date.month)
trunk1 =... | 25.84375 | 88 | 0.678356 |
8222047e7c82049231ca4eda65bff08a1e971982 | 1,836 | py | Python | user_test.py | ppolle/password-locker | 4ada00afe9f684b1f6b582da75d9979526069609 | [
"MIT"
] | null | null | null | user_test.py | ppolle/password-locker | 4ada00afe9f684b1f6b582da75d9979526069609 | [
"MIT"
] | null | null | null | user_test.py | ppolle/password-locker | 4ada00afe9f684b1f6b582da75d9979526069609 | [
"MIT"
] | null | null | null | import unittest
from user import User
class TestUser(unittest.TestCase):
'''
Test class that defines test cases for our accounts class behaviours.
Args:
unittest.TestCase: Testcase class that helps in creating test cases
'''
def setUp(self):
'''
set up method to clear before each test case.
... | 27.818182 | 81 | 0.71024 |
1a2301bfe6bb483a4539d2aeaad4e4cdac2657c0 | 2,252 | py | Python | nlu/model.py | SATIROVinicius/poli | 85d33fc433c0499c02fe6d7a96e0b55ab6792321 | [
"MIT"
] | null | null | null | nlu/model.py | SATIROVinicius/poli | 85d33fc433c0499c02fe6d7a96e0b55ab6792321 | [
"MIT"
] | null | null | null | nlu/model.py | SATIROVinicius/poli | 85d33fc433c0499c02fe6d7a96e0b55ab6792321 | [
"MIT"
] | null | null | null | import yaml
import numpy as np
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import LSTM, Dense, Embedding
from tensorflow.keras.utils import to_categorical
data = yaml.safe_load(open('nlu\\train.yml', 'r', encoding='utf-8').read())
inputs, outputs = [], []
for c... | 24.747253 | 81 | 0.686501 |
87b0ce34750ac38fd6fdddc28ad8484b071e1c81 | 752 | py | Python | examples/slidebar_eg.py | SpongeBobBang/OCT-Segmentation-by-Logic | c7dad3f1f64ad86d84d94291bbd14cc1e9b4aca3 | [
"MIT"
] | 2 | 2019-07-23T05:49:15.000Z | 2019-11-05T21:39:10.000Z | examples/slidebar_eg.py | StefanHeng/OCT-Segmentation-by-Logic | c7dad3f1f64ad86d84d94291bbd14cc1e9b4aca3 | [
"MIT"
] | null | null | null | examples/slidebar_eg.py | StefanHeng/OCT-Segmentation-by-Logic | c7dad3f1f64ad86d84d94291bbd14cc1e9b4aca3 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider
def main():
TWOPI = 2*np.pi
fig, ax = plt.subplots()
t = np.arange(0.0, TWOPI, 0.001)
initial_amp = .5
s = initial_amp*np.sin(t)
l, = plt.plot(t, s, lw=2)
ax = plt.axis([0, TWOPI, -1, 1])
axamp ... | 22.117647 | 58 | 0.591755 |
77fdd353bb279ef1d3ccae6b91a8dd7e59a157d9 | 6,729 | py | Python | tests/test_random_imputer.py | byu-dml/d3m-primitives | f25d5d2572d0e7f29ecf2bef98ac2fc0613eb053 | [
"MIT"
] | 4 | 2018-04-13T21:27:58.000Z | 2020-10-08T00:46:19.000Z | tests/test_random_imputer.py | byu-dml/d3m-primitives | f25d5d2572d0e7f29ecf2bef98ac2fc0613eb053 | [
"MIT"
] | 62 | 2018-05-05T20:47:08.000Z | 2022-02-10T16:54:10.000Z | tests/test_random_imputer.py | byu-dml/d3m-primitives | f25d5d2572d0e7f29ecf2bef98ac2fc0613eb053 | [
"MIT"
] | 2 | 2020-02-07T03:31:11.000Z | 2021-03-18T19:22:20.000Z | import os
import unittest
import d3m
from d3m import index, container
from d3m.metadata import base as metadata_base
from byudml.imputer.random_sampling_imputer import Hyperparams, RandomSamplingImputer
from tests import utils, config
PIPELINES_BASE_DIR = 'submission/pipelines'
PIPELINES_DIR = os.path.join(PIPELINE... | 38.895954 | 116 | 0.688067 |
931bfac8e92b487869aecae4e298b01de020fef5 | 621 | py | Python | Problem127.py | Cleancode404/ProjectEuler | 2f93b256b107bfb6a395b8aa197cfeacc599b00b | [
"MIT"
] | null | null | null | Problem127.py | Cleancode404/ProjectEuler | 2f93b256b107bfb6a395b8aa197cfeacc599b00b | [
"MIT"
] | null | null | null | Problem127.py | Cleancode404/ProjectEuler | 2f93b256b107bfb6a395b8aa197cfeacc599b00b | [
"MIT"
] | null | null | null | """
abc-hits
"""
import math
def cal():
LIMIT = 120000
# Modification of the sieve of Eratosthenes
rads = [0] + [1] * (LIMIT - 1)
for i in range(2, len(rads)):
if rads[i] == 1:
for j in range(i, len(rads), i):
rads[j] *= i
sortedrads = sorted((rad, n) for (n, rad) in enumerate(rads))
sortedrads = sor... | 20.032258 | 62 | 0.561997 |
6f005880b9f8f72ea130cbbe01ab308d5aeb5de0 | 7,007 | py | Python | sdk/python/pulumi_azure_native/kusto/v20200215/get_read_write_database.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/kusto/v20200215/get_read_write_database.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/kusto/v20200215/get_read_write_database.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 37.271277 | 193 | 0.654774 |
d6648cf354f9f2d21e2ff567774d4056257b0637 | 787 | py | Python | research/syntaxnet/syntaxnet/syntaxnet_ops.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | research/syntaxnet/syntaxnet/syntaxnet_ops.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | research/syntaxnet/syntaxnet/syntaxnet_ops.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 37.47619 | 80 | 0.682338 |
cb9ee76c396e6bccc4cae744b689187c218476f6 | 402 | py | Python | ion_functions/test/base_test.py | steinermg/ion-functions | cea532ad9af51e86768572c8deb48547d99567c5 | [
"Apache-2.0"
] | 10 | 2015-04-03T15:32:21.000Z | 2018-11-21T11:57:26.000Z | ion_functions/test/base_test.py | steinermg/ion-functions | cea532ad9af51e86768572c8deb48547d99567c5 | [
"Apache-2.0"
] | 8 | 2015-01-07T15:19:22.000Z | 2015-12-08T18:14:04.000Z | ion_functions/test/base_test.py | steinermg/ion-functions | cea532ad9af51e86768572c8deb48547d99567c5 | [
"Apache-2.0"
] | 17 | 2015-01-14T16:23:00.000Z | 2021-07-19T08:26:52.000Z | #!/usr/bin/env python
"""
@package
@file base_test_cases
@author Christopher Mueller
@brief
"""
from unittest import TestCase
class BaseUnitTestCase(TestCase):
# Prevent test docstring from printing - uses test name instead
# @see
# http://www.saltycrane.com/blog/2012/07/how-prevent-nose-unittest-usi... | 21.157895 | 104 | 0.726368 |
56702e7178d0b08fcbf62a3b2c2f78ce9eec4a11 | 513 | py | Python | ex17.py | WarWarMyint/Python_exercises | 8823eee6936dece6032c4c5c65f88fb778b7cb94 | [
"MIT"
] | null | null | null | ex17.py | WarWarMyint/Python_exercises | 8823eee6936dece6032c4c5c65f88fb778b7cb94 | [
"MIT"
] | null | null | null | ex17.py | WarWarMyint/Python_exercises | 8823eee6936dece6032c4c5c65f88fb778b7cb94 | [
"MIT"
] | null | null | null | from sys import argv
from os.path import exists
script, from_file, to_file = argv
print(f"Copying from {from_file} to {to_file}")
# we could do these two on one line, how?
in_file = open(from_file)
indata = in_file.read( )
print(f"The input file is {len(indata)} bytes long")
print(f"Does the output file exists? {exists... | 30.176471 | 56 | 0.729045 |
6bcda2165246b30470cc1e3ab03637fcfed15b9c | 543 | py | Python | common/schedule_util.py | CJuanvip/RecommendationSystem-forMovies | a49d4d9126cd7848a9bc34a22144d279ad33d668 | [
"MIT"
] | 3 | 2020-03-01T14:52:38.000Z | 2020-09-29T02:33:25.000Z | common/schedule_util.py | perveil/recsys_core | 189845f2d0bdbe7ff717045ba4d1722c02200019 | [
"MIT"
] | null | null | null | common/schedule_util.py | perveil/recsys_core | 189845f2d0bdbe7ff717045ba4d1722c02200019 | [
"MIT"
] | 1 | 2019-11-06T10:00:11.000Z | 2019-11-06T10:00:11.000Z | import time
import os
import sched
import psutil
import json
import logging
import re
from logging.handlers import RotatingFileHandler
schedule = sched.scheduler(time.time, time.sleep)
def enter_(inc, task):
task()
schedule.enter(inc, 0, enter_, [inc, task])
def task():
print('test task function')
de... | 18.1 | 55 | 0.707182 |
5d4b1b17796d4101b0605e79c681de427f1caba9 | 300 | py | Python | chapter04-strings/teleportInput.py | t04glovern/pyCraft | 1cfe088e68c2c0d8fe4ff2e9dfbc9caafc46dee0 | [
"MIT"
] | null | null | null | chapter04-strings/teleportInput.py | t04glovern/pyCraft | 1cfe088e68c2c0d8fe4ff2e9dfbc9caafc46dee0 | [
"MIT"
] | 1 | 2016-06-23T00:47:43.000Z | 2016-06-28T12:39:43.000Z | chapter04-strings/teleportInput.py | t04glovern/pyCraft | 1cfe088e68c2c0d8fe4ff2e9dfbc9caafc46dee0 | [
"MIT"
] | null | null | null | from mcpi.minecraft import Minecraft
mc = Minecraft.create()
x_cord = int(input("Enter X: "))
y_cord = int(input("Enter Y: "))
z_cord = int(input("Enter Z: "))
blockType = int(input("Enter Block ID: "))
mc.player.setTilePos(x_cord + 1, y_cord, z_cord)
mc.setBlock(x_cord, y_cord, z_cord, blockType) | 30 | 48 | 0.706667 |
be434fbc1f7f3836af0e469be4303cb5f246ed7b | 8,660 | py | Python | src/rostest.py | wangx1996/CenterPillarNet | 4be3d53265b8ecb1f9572612fa87f7acd8c57669 | [
"MIT"
] | 22 | 2021-03-19T03:13:16.000Z | 2022-03-31T03:05:07.000Z | src/rostest.py | wangx1996/CenterPillarNet | 4be3d53265b8ecb1f9572612fa87f7acd8c57669 | [
"MIT"
] | 4 | 2021-04-18T02:23:13.000Z | 2021-08-25T13:21:08.000Z | src/rostest.py | wangx1996/CenterPillarNet | 4be3d53265b8ecb1f9572612fa87f7acd8c57669 | [
"MIT"
] | 7 | 2021-06-04T06:54:21.000Z | 2022-01-17T09:18:50.000Z | """
# -*- coding: utf-8 -*-
-----------------------------------------------------------------------------------
# Author: Wang Xu
# email: wangxubit@foxmail.com
# DoC: 2021.03.10
-----------------------------------------------------------------------------------
# Description: ROS Test script
"""
#!/usr/bin/env python3... | 42.038835 | 114 | 0.618822 |
8573378e247000c427911eb4edaf79053e1079ac | 1,317 | py | Python | fro/_implementation/iters.py | ethantkoenig/fro | ccfa02be3cf501b6175935008f3380c1f1797109 | [
"MIT"
] | null | null | null | fro/_implementation/iters.py | ethantkoenig/fro | ccfa02be3cf501b6175935008f3380c1f1797109 | [
"MIT"
] | 1 | 2016-07-18T06:08:26.000Z | 2016-07-18T06:08:26.000Z | fro/_implementation/iters.py | ethantkoenig/fro | ccfa02be3cf501b6175935008f3380c1f1797109 | [
"MIT"
] | null | null | null | from builtins import object
class CheckableIterator(object):
def __init__(self, container):
self._iterator = iter(container)
self._current_value = None
self._peeked_value = None
self._peeked_value_valid = False
self._at_end = False
self._peek()
def __iter__(se... | 23.945455 | 53 | 0.59833 |
834de81c04adf05b941b49d7d17e6f8619a591d5 | 533 | py | Python | demo3.py | Kahsius/timebudget | e58b7121aa5846db784fb80ab6b8dfffdcc8fae5 | [
"Apache-2.0"
] | 145 | 2019-10-22T21:45:53.000Z | 2022-03-12T02:15:55.000Z | demo3.py | Kahsius/timebudget | e58b7121aa5846db784fb80ab6b8dfffdcc8fae5 | [
"Apache-2.0"
] | 13 | 2019-10-23T15:15:20.000Z | 2021-02-10T00:12:36.000Z | demo3.py | Kahsius/timebudget | e58b7121aa5846db784fb80ab6b8dfffdcc8fae5 | [
"Apache-2.0"
] | 9 | 2019-10-25T00:44:25.000Z | 2020-09-23T11:54:17.000Z | import random
import time
from timebudget import timebudget
# More or less what's in the README for loops
# but 10x faster so we can test it 100x and get the averages about right.
@timebudget
def possibly_slow():
time.sleep(0.03)
def sometimes():
return random.random() < 0.6
@timebudget
def should_be_fast()... | 17.766667 | 73 | 0.707317 |
3934b2e645a35b05fda63b0c2c6d2baf9974908e | 14,466 | py | Python | dojo/importers/importer/importer.py | christophe226/django-DefectDojo | 0ea0a59526ee9169dce29777288cf9dba0c44263 | [
"BSD-3-Clause"
] | null | null | null | dojo/importers/importer/importer.py | christophe226/django-DefectDojo | 0ea0a59526ee9169dce29777288cf9dba0c44263 | [
"BSD-3-Clause"
] | 150 | 2021-05-21T06:59:31.000Z | 2022-03-28T23:07:26.000Z | dojo/importers/importer/importer.py | christophe226/django-DefectDojo | 0ea0a59526ee9169dce29777288cf9dba0c44263 | [
"BSD-3-Clause"
] | null | null | null | import datetime
from dojo.importers import utils as importer_utils
from dojo.models import Test, Finding, \
Test_Type, \
BurpRawRequestResponse, \
Endpoint_Status, \
Test_Import
from dojo.endpoint.utils import endpoint_get_or_create
from dojo.utils import get_current_user, max_safe
from django.core.ex... | 45.065421 | 134 | 0.588414 |
74cd996a7c9ff092d46008a0677100f789265870 | 8,411 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/modules/network/aci/aci_vmm_credential.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/venv/lib/python2.7/site-packages/ansible/modules/network/aci/aci_vmm_credential.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | ansible/venv/lib/python2.7/site-packages/ansible/modules/network/aci/aci_vmm_credential.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | 27.220065 | 141 | 0.633456 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.