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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
197c8a45230f1f466486c34b41334a8935dbae24 | 870 | py | Python | isi_sdk_8_2_0/test/test_smb_openfile.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_2_0/test/test_smb_openfile.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_2_0/test/test_smb_openfile.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 7
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_2_0
from i... | 21.219512 | 79 | 0.694253 |
80b17954065cdf5a96ff9e820d8391c3e9ec1bca | 18,312 | py | Python | hvad/models.py | spectras/django-hvad | da1cbe8736154270935e0b18528041a2f06ed670 | [
"BSD-3-Clause"
] | null | null | null | hvad/models.py | spectras/django-hvad | da1cbe8736154270935e0b18528041a2f06ed670 | [
"BSD-3-Clause"
] | null | null | null | hvad/models.py | spectras/django-hvad | da1cbe8736154270935e0b18528041a2f06ed670 | [
"BSD-3-Clause"
] | 2 | 2017-12-28T02:34:41.000Z | 2018-05-07T14:39:50.000Z | """ Translatable models, the main hvad API.
"""
import django
from django.core import checks
from django.core.exceptions import ImproperlyConfigured
from django.db import models, router, transaction
from django.db.models.base import ModelBase
from django.db.models.fields import FieldDoesNotExist
from django.db.models.m... | 43.29078 | 106 | 0.608399 |
6e6d6767fb15d4631d8f8c5381ec4e072337733f | 21,809 | py | Python | src/awkward/_v2/_typetracer.py | scikit-hep/awkward-1.0 | a440328f8097d22c2ba053fd117fed543829afc0 | [
"BSD-3-Clause"
] | 519 | 2019-10-17T12:36:22.000Z | 2022-03-26T23:28:19.000Z | src/awkward/_v2/_typetracer.py | scikit-hep/awkward-1.0 | a440328f8097d22c2ba053fd117fed543829afc0 | [
"BSD-3-Clause"
] | 924 | 2019-11-03T21:05:01.000Z | 2022-03-31T22:44:30.000Z | src/awkward/_v2/_typetracer.py | scikit-hep/awkward-1.0 | a440328f8097d22c2ba053fd117fed543829afc0 | [
"BSD-3-Clause"
] | 56 | 2019-12-17T15:49:22.000Z | 2022-03-09T20:34:06.000Z | # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
from __future__ import absolute_import
import numbers
import numpy
import awkward.nplike
import awkward._util
import awkward as ak
np = ak.nplike.NumpyMetadata.instance()
class NoError(object):
str = None
filename = N... | 28.323377 | 92 | 0.552983 |
b206ff04f10560eeee30108beaebde6afb398205 | 473 | py | Python | Python/Mundo01/Exercicios/ex026.py | eStev4m/CursoPython | 8b52a618e67c80d66518ef91c1d4596a2bfddc22 | [
"MIT"
] | null | null | null | Python/Mundo01/Exercicios/ex026.py | eStev4m/CursoPython | 8b52a618e67c80d66518ef91c1d4596a2bfddc22 | [
"MIT"
] | null | null | null | Python/Mundo01/Exercicios/ex026.py | eStev4m/CursoPython | 8b52a618e67c80d66518ef91c1d4596a2bfddc22 | [
"MIT"
] | null | null | null | '''Faça um programa que leia uma frase pelo teclado e mostre quantas vezes aparece a letra “A”,
em que posição ela aparece a primeira vez e em que posição ela aparece a última vez.'''
frase = str(input('Digite uma frase: ')).strip().upper()
print('A letra A aparece {} vezes na frase.' .format(frase.count('A')))
print(... | 59.125 | 95 | 0.701903 |
ee8516340ad12c7584cb7d28ef40561f70feee83 | 13,144 | py | Python | seaborn/tests/test_utils.py | luzpaz/seaborn | ad0240a867bb1622c79abac850e1dc30cb4b3be1 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | seaborn/tests/test_utils.py | luzpaz/seaborn | ad0240a867bb1622c79abac850e1dc30cb4b3be1 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | seaborn/tests/test_utils.py | luzpaz/seaborn | ad0240a867bb1622c79abac850e1dc30cb4b3be1 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | """Tests for seaborn utility functions."""
import tempfile
from urllib.request import urlopen
from http.client import HTTPException
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from cycler import cycler
import pytest
from numpy.testing import (
assert_array_equal... | 27.440501 | 78 | 0.601339 |
2d889b2baa4df074a8e517df5d50809000252903 | 401 | py | Python | hothouse/cli.py | langmm/hothouse | 6b201b65df7cdaaf6535db988ac765a4ad3218ac | [
"MIT"
] | null | null | null | hothouse/cli.py | langmm/hothouse | 6b201b65df7cdaaf6535db988ac765a4ad3218ac | [
"MIT"
] | 1 | 2020-02-21T19:25:53.000Z | 2020-03-04T23:07:21.000Z | hothouse/cli.py | langmm/hothouse | 6b201b65df7cdaaf6535db988ac765a4ad3218ac | [
"MIT"
] | 3 | 2020-02-20T02:26:26.000Z | 2020-06-30T23:41:37.000Z | # -*- coding: utf-8 -*-
"""Console script for hothouse."""
import sys
import click
@click.command()
def main(args=None):
"""Console script for hothouse."""
click.echo("Replace this message by putting your code into " "hothouse.cli.main")
click.echo("See click documentation at http://click.pocoo.org/")
... | 22.277778 | 85 | 0.663342 |
722ea7949a60af8181e21f6e1b969dc6b430daeb | 1,709 | py | Python | app/core/migrations/0001_initial.py | cgustave/recipe-app-api | 0b367f52c4fdc1167b9f89ef8d40c45a0d17d570 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | cgustave/recipe-app-api | 0b367f52c4fdc1167b9f89ef8d40c45a0d17d570 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | cgustave/recipe-app-api | 0b367f52c4fdc1167b9f89ef8d40c45a0d17d570 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2020-09-15 16:03
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
... | 50.264706 | 266 | 0.63897 |
c34046c9ef9b5388edcd094bb3012f22a89695ff | 729 | py | Python | flexget/plugins/metainfo/torrent_size.py | Konubinix/Flexget | 1379e346370ef144b9a02f761fc187497b6097e2 | [
"MIT"
] | 1 | 2017-08-25T07:17:04.000Z | 2017-08-25T07:17:04.000Z | flexget/plugins/metainfo/torrent_size.py | Konubinix/Flexget | 1379e346370ef144b9a02f761fc187497b6097e2 | [
"MIT"
] | 1 | 2015-11-10T01:07:54.000Z | 2015-11-10T01:07:54.000Z | flexget/plugins/metainfo/torrent_size.py | Konubinix/Flexget | 1379e346370ef144b9a02f761fc187497b6097e2 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('torrent_size')
class TorrentSize(object):
"""
Provides file size information when dealing with torrents
"""
@plugin.priority(200)
... | 27 | 73 | 0.66118 |
09ab7b0cbe146d7320215d4913c0983cfaf3d430 | 83,461 | py | Python | lib/python3.8/site-packages/ansible_collections/google/cloud/plugins/modules/gcp_compute_region_url_map_info.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | 5 | 2020-12-16T21:42:09.000Z | 2022-03-28T16:04:32.000Z | .ansible/collections/ansible_collections/google/cloud/plugins/modules/gcp_compute_region_url_map_info.py | chronicc/proving-ground | 3e392122a05fb8383a3700954baebb0df330e9e3 | [
"MIT"
] | null | null | null | .ansible/collections/ansible_collections/google/cloud/plugins/modules/gcp_compute_region_url_map_info.py | chronicc/proving-ground | 3e392122a05fb8383a3700954baebb0df330e9e3 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | 50.308017 | 133 | 0.515187 |
7398ab03ee87188a3221ddcd76288ae87020ce2d | 1,798 | py | Python | pdm/installers/manager.py | pawamoy/pdm | 34e9ef0918f8d31e193de1cd8727dd04f3acbbe9 | [
"MIT"
] | 1 | 2022-02-21T05:55:21.000Z | 2022-02-21T05:55:21.000Z | pdm/installers/manager.py | pawamoy/pdm | 34e9ef0918f8d31e193de1cd8727dd04f3acbbe9 | [
"MIT"
] | null | null | null | pdm/installers/manager.py | pawamoy/pdm | 34e9ef0918f8d31e193de1cd8727dd04f3acbbe9 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import TYPE_CHECKING
from pdm import termui
from pdm.exceptions import UninstallError
from pdm.installers.installers import install_wheel, install_wheel_with_cache
from pdm.installers.uninstallers import BaseRemovePaths, StashedRemovePaths
if TYPE_CHECKING:
from pdm... | 36.693878 | 82 | 0.700222 |
7721ce20b3b19f79976c37f403c408e5c40fac4f | 38,088 | py | Python | python/mxnet/model.py | jrosebr1/mxnet | f2b7e0522c099d14f9f5a46c354fe0971db47d97 | [
"Apache-2.0"
] | 5 | 2017-01-21T08:53:55.000Z | 2021-08-20T13:06:43.000Z | python/mxnet/model.py | jrosebr1/mxnet | f2b7e0522c099d14f9f5a46c354fe0971db47d97 | [
"Apache-2.0"
] | null | null | null | python/mxnet/model.py | jrosebr1/mxnet | f2b7e0522c099d14f9f5a46c354fe0971db47d97 | [
"Apache-2.0"
] | 5 | 2017-02-20T18:55:16.000Z | 2020-04-17T21:34:22.000Z | # pylint: disable=fixme, invalid-name, too-many-arguments, too-many-locals, too-many-lines
# pylint: disable=too-many-branches, too-many-statements
"""MXNet model module"""
from __future__ import absolute_import
import time
import logging
from collections import namedtuple
import numpy as np
from . import io
from . i... | 40.735829 | 98 | 0.590081 |
e3c5143b8951b1de04bc6b9ff68b0c90a7578814 | 12,227 | py | Python | cctbx/regression/tst_xray_derivatives.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | cctbx/regression/tst_xray_derivatives.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | cctbx/regression/tst_xray_derivatives.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | from __future__ import division
from cctbx import xray
from cctbx.development import random_structure
from cctbx.development import debug_utils
from cctbx.array_family import flex
import random
import math
import sys
from cctbx import adptbx
def finite_differences_site(cartesian_flag, target_ftor, structure,
... | 43.824373 | 95 | 0.66345 |
11d852fe9e1d441a8822e38413e87835388f4810 | 5,961 | py | Python | excel_text/visitor.py | AutoActuary/excel-text | b25ec52d74cac54de480b67a4b9db5bac618606e | [
"MIT"
] | null | null | null | excel_text/visitor.py | AutoActuary/excel-text | b25ec52d74cac54de480b67a4b9db5bac618606e | [
"MIT"
] | 4 | 2021-10-20T09:58:41.000Z | 2021-11-30T12:12:10.000Z | excel_text/visitor.py | AutoActuary/excel-text | b25ec52d74cac54de480b67a4b9db5bac618606e | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from typing import Any, List, Generator
from parsimonious import NodeVisitor
from parsimonious.nodes import Node
from excel_text.condition import Condition
from excel_text.tokens import (
YearToken,
MonthOrMinuteToken,
FormatStringToken,
DayToken,
HourToken,
S... | 24.330612 | 102 | 0.564335 |
9761a760dd98eca14de68d0726e13cd82e46c432 | 507 | py | Python | quickstats/migrations/0004_waypoint_states.py | kfdm/django-simplestats | f3aa26329af56cbb910d86d450ea129a54b271ef | [
"MIT"
] | 1 | 2019-06-07T04:55:55.000Z | 2019-06-07T04:55:55.000Z | quickstats/migrations/0004_waypoint_states.py | kfdm/django-simplestats | f3aa26329af56cbb910d86d450ea129a54b271ef | [
"MIT"
] | 31 | 2016-02-02T22:19:09.000Z | 2018-05-08T09:52:54.000Z | quickstats/migrations/0004_waypoint_states.py | kfdm/django-simplestats | f3aa26329af56cbb910d86d450ea129a54b271ef | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2019-11-07 11:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('quickstats', '0003_widget_body_optional'),
]
operations = [
migrations.AlterField(
model_name='waypoint',
name='stat... | 26.684211 | 165 | 0.601578 |
bd0d5a91b6e4ed79f0921f1895ec2d3f808dc496 | 372 | py | Python | SchoolSystem/pupils/migrations/0002_auto_20201204_1049.py | fallprojects/SchoolSystem | e3c2b6ec53a843b3d471faaf16ee42040a336d53 | [
"MIT"
] | null | null | null | SchoolSystem/pupils/migrations/0002_auto_20201204_1049.py | fallprojects/SchoolSystem | e3c2b6ec53a843b3d471faaf16ee42040a336d53 | [
"MIT"
] | null | null | null | SchoolSystem/pupils/migrations/0002_auto_20201204_1049.py | fallprojects/SchoolSystem | e3c2b6ec53a843b3d471faaf16ee42040a336d53 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2020-12-04 10:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pupils', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='pupils',
name='date_of_birth',
... | 19.578947 | 47 | 0.586022 |
91ea62dce28ac52dd5cb0aa0748740542ab436d5 | 1,232 | py | Python | ex113-Validando entrada de dados em Python 2.0.py | portelaoliveira/Exercises | d6691abb129ea435c7986ab532117c765c72201e | [
"MIT"
] | 1 | 2020-05-17T00:03:42.000Z | 2020-05-17T00:03:42.000Z | ex113-Validando entrada de dados em Python 2.0.py | portelaoliveira/Exercises | d6691abb129ea435c7986ab532117c765c72201e | [
"MIT"
] | null | null | null | ex113-Validando entrada de dados em Python 2.0.py | portelaoliveira/Exercises | d6691abb129ea435c7986ab532117c765c72201e | [
"MIT"
] | null | null | null | """
Exercício 113
Problema: Reencreva a função leiaInt() que fizemos no desafio 104, incluindo agora
a possibilidade da digitação de um número de tipo inválido.
Aproveite e crie também uma função leiaFloat() com a mesma funcionalidade.
Resolução do problema:
"""
def leiaInt(msg):
while True:
... | 31.589744 | 102 | 0.636364 |
c5e2501ef4e25f603f5a0f47fcf221c57dec597c | 13,618 | py | Python | 2021-12-01/retailer_stats_illinois.py | cannlytics/cannabis-data-science | 8ff11330692d3c5a39e3a9f9843af917caf1a720 | [
"MIT"
] | 6 | 2021-02-17T02:27:28.000Z | 2022-02-21T20:35:39.000Z | 2021/2021-12-01/retailer_stats_illinois.py | GrahamAnto/cannabis-data-science | 1d5f3085e7b2858b6791840b90335be4669268b3 | [
"MIT"
] | null | null | null | 2021/2021-12-01/retailer_stats_illinois.py | GrahamAnto/cannabis-data-science | 1d5f3085e7b2858b6791840b90335be4669268b3 | [
"MIT"
] | 2 | 2021-12-22T17:18:18.000Z | 2022-03-10T17:36:17.000Z | """
Get Retailer Statistics for Illinois
Cannabis Data Science Meetup Group
Saturday Morning Statistics
Copyright (c) 2021 Cannlytics
Authors: Keegan Skeate <keegan@cannlytics.com>
Created: 11/17/2021
Updated: 11/27/2021
License: MIT License <https://opensource.org/licenses/MIT>
Data Sources:
- Licensed Adul... | 32.814458 | 115 | 0.657072 |
34a483371b3b75d4b7c152ad5a3e73ff2d53da9e | 10,881 | py | Python | orc8r/gateway/python/magma/magmad/main.py | nitinneet/test23 | c44df1a3290195cd3fc59d3483ef640ca8aaeb1e | [
"BSD-3-Clause"
] | null | null | null | orc8r/gateway/python/magma/magmad/main.py | nitinneet/test23 | c44df1a3290195cd3fc59d3483ef640ca8aaeb1e | [
"BSD-3-Clause"
] | 1 | 2022-02-27T18:57:16.000Z | 2022-02-27T18:57:16.000Z | orc8r/gateway/python/magma/magmad/main.py | hixio-mh/magma | 2602de5cecd590c1f30a1c798feb2e78b58f5de7 | [
"BSD-3-Clause"
] | 2 | 2021-05-27T18:15:16.000Z | 2021-05-27T18:41:39.000Z | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 34.433544 | 77 | 0.714273 |
a884257c8bb5e50bf66b778c7eaa1139d8cabeff | 402 | py | Python | settings.py | link1345/BFV_PlayerName_OCR | b94b16bb4fcc4d961a4d7aef89058f6d145703c9 | [
"MIT"
] | null | null | null | settings.py | link1345/BFV_PlayerName_OCR | b94b16bb4fcc4d961a4d7aef89058f6d145703c9 | [
"MIT"
] | null | null | null | settings.py | link1345/BFV_PlayerName_OCR | b94b16bb4fcc4d961a4d7aef89058f6d145703c9 | [
"MIT"
] | null | null | null | import settings
# BAN対象者のマッチ処理の類似度
SearchMatchNumber = 75
# Tessractのパス
Tesseract_path = 'C:\\Program Files\\Tesseract-OCR'
# Tessractのtessdataパス
Tesseract_tesspath = 'C:\\Program Files\\Tesseract-OCR\\tessdata'
# 画像切り取りポイントとサイズ
## 0 = StartPointX , 1 = StartPointY , 2 = SizeX , 3 = SizeY
## 注意 : 1ドットでもミスると、うまく取れません... | 23.647059 | 65 | 0.726368 |
8af462ad66150c1142a80b94ab45f1b92a2bb4cc | 4,765 | py | Python | Assignments/hw8/svm_classify.py | spacemanidol/CLMS572 | f0380de9912c984ec21607cdb3b1f190853c5ca8 | [
"MIT"
] | null | null | null | Assignments/hw8/svm_classify.py | spacemanidol/CLMS572 | f0380de9912c984ec21607cdb3b1f190853c5ca8 | [
"MIT"
] | null | null | null | Assignments/hw8/svm_classify.py | spacemanidol/CLMS572 | f0380de9912c984ec21607cdb3b1f190853c5ca8 | [
"MIT"
] | 1 | 2020-12-26T01:28:41.000Z | 2020-12-26T01:28:41.000Z | import sys
import numpy as np
from math import exp
from math import tanh
def readModel(filename):
#Read model in from trained model file.
weights, supportVectors, svmType, kernelType, gamma, coef, degree, nrClass, totalSV, rho, labels, nrSV, allFeatures = [],[], '','','','','','','','','','',set()
with ope... | 44.95283 | 206 | 0.526338 |
308eedb31f603cf01b56d88759063479359a6215 | 1,111 | py | Python | src/sma/parseHeu.py | LukeHealy/AMI-Assignment | 25dd4d8c074ac1c3b563a96db8d3f7f62e00c8a8 | [
"MIT"
] | null | null | null | src/sma/parseHeu.py | LukeHealy/AMI-Assignment | 25dd4d8c074ac1c3b563a96db8d3f7f62e00c8a8 | [
"MIT"
] | null | null | null | src/sma/parseHeu.py | LukeHealy/AMI-Assignment | 25dd4d8c074ac1c3b563a96db8d3f7f62e00c8a8 | [
"MIT"
] | null | null | null | import sys
##
# Reads a heuristic file and stores them in each node.
#
def get_heuristics(filename, graph, src, dst):
try:
f = open(filename, "r")
contents = f.read()
f.close()
heu = {}
heu[dst.name] = 0
check_file(contents, graph)
for l in content... | 25.25 | 68 | 0.510351 |
74e0d2e157ae269d34bb95ee318221c0ec5d91ec | 947 | py | Python | 221_max_square.py | xinming365/LeetCode | e56097a60ddd1b5ddba7f15a726661c2aa6633e7 | [
"Apache-2.0"
] | null | null | null | 221_max_square.py | xinming365/LeetCode | e56097a60ddd1b5ddba7f15a726661c2aa6633e7 | [
"Apache-2.0"
] | null | null | null | 221_max_square.py | xinming365/LeetCode | e56097a60ddd1b5ddba7f15a726661c2aa6633e7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2022/3/26 11:06 下午
# @Author : xinming
# @File : 221_max_square.py
from typing import List
class Solution:
def maximalSquare(self, matrix: List[List[str]]) -> int:
rows = len(matrix)
cols = len(matrix[0])
dp = [[0 for i in range... | 31.566667 | 76 | 0.474129 |
8358de04609481076ea6da7f98bd066e05bc3bf1 | 4,592 | py | Python | models/unet/unet_model.py | vaibhavsaxena11/fastMRI | 9e1f1574ce25ee56e4c4e35c3b916119d4259ec5 | [
"MIT"
] | null | null | null | models/unet/unet_model.py | vaibhavsaxena11/fastMRI | 9e1f1574ce25ee56e4c4e35c3b916119d4259ec5 | [
"MIT"
] | null | null | null | models/unet/unet_model.py | vaibhavsaxena11/fastMRI | 9e1f1574ce25ee56e4c4e35c3b916119d4259ec5 | [
"MIT"
] | null | null | null | """
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
import torch
from torch import nn
from torch.nn import functional as F
class ConvBlock(nn.Module):
"""
A Convolutional Block that c... | 33.764706 | 98 | 0.611063 |
ba66ca13779f78a4431e3595b2daa4ca64a62213 | 256 | py | Python | tests/conftest.py | yhttp/yhttp-rabbitmq | 2dbbced1cae608cd7f34539480ea5b68a81ebfe8 | [
"MIT"
] | 1 | 2020-01-30T16:23:17.000Z | 2020-01-30T16:23:17.000Z | tests/conftest.py | yhttp/yhttp-auth | 95bda107ef21102b7ddf7f54e802081f2e3dfc0f | [
"MIT"
] | null | null | null | tests/conftest.py | yhttp/yhttp-auth | 95bda107ef21102b7ddf7f54e802081f2e3dfc0f | [
"MIT"
] | null | null | null | import functools
import bddrest
import pytest
from yhttp_devutils.fixtures import redis
from yhttp import Application
@pytest.fixture
def app():
return Application()
@pytest.fixture
def Given(app):
return functools.partial(bddrest.Given, app)
| 15.058824 | 48 | 0.78125 |
dda2ffc1492a4cc986dc901be543d6d81e039ccc | 798 | py | Python | dzTraficoBackend/dzTrafico/BusinessEntities/EdgeState.py | DZAymen/dz-Trafico | 74ff9caf9e3845d8af977c46b04a2d3421a0661b | [
"MIT"
] | null | null | null | dzTraficoBackend/dzTrafico/BusinessEntities/EdgeState.py | DZAymen/dz-Trafico | 74ff9caf9e3845d8af977c46b04a2d3421a0661b | [
"MIT"
] | null | null | null | dzTraficoBackend/dzTrafico/BusinessEntities/EdgeState.py | DZAymen/dz-Trafico | 74ff9caf9e3845d8af977c46b04a2d3421a0661b | [
"MIT"
] | null | null | null | from rest_framework import serializers
class EdgeState(object):
def __init__(self,edge_id, edge_coords, current_speed, max_speed, density, vsl_state, congestion_detected):
self.edge_id = edge_id
self.edge_coords = edge_coords
self.current_speed = current_speed
self.max_speed = max_s... | 39.9 | 111 | 0.741855 |
261d3a239aa4a58e9290bc17d057260f8613724b | 2,099 | py | Python | config.py | Jason0917/differnet_submit1 | 1e2d5b9ff98a4354de7d853cafd1b99ebe299c00 | [
"MIT"
] | 1 | 2022-03-07T05:24:33.000Z | 2022-03-07T05:24:33.000Z | config.py | Jason0917/differnet_submit1 | 1e2d5b9ff98a4354de7d853cafd1b99ebe299c00 | [
"MIT"
] | null | null | null | config.py | Jason0917/differnet_submit1 | 1e2d5b9ff98a4354de7d853cafd1b99ebe299c00 | [
"MIT"
] | null | null | null | '''This file configures the training procedure because handling arguments in every single function is so exhaustive for
research purposes. Don't try this code if you are a software engineer.'''
# data extraction settings
num_videos = 21
save_cropped_image_to = "dataset/black-without-logo-cropped/"
# device set... | 30.867647 | 120 | 0.743687 |
3a8fa966bae8165813c5a743479197f064a497c8 | 1,428 | py | Python | packages/blueking/component/collections.py | kellyyk/work-sops | b114db1b21c14b8454c34dff0453cb4fd8885c2e | [
"Apache-2.0"
] | null | null | null | packages/blueking/component/collections.py | kellyyk/work-sops | b114db1b21c14b8454c34dff0453cb4fd8885c2e | [
"Apache-2.0"
] | 5 | 2020-02-12T02:55:56.000Z | 2021-06-10T22:57:10.000Z | packages/blueking/component/collections.py | kellyyk/work-sops | b114db1b21c14b8454c34dff0453cb4fd8885c2e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 38.594595 | 115 | 0.780812 |
351dc2210394ae45e68f8419fdb867be0356f715 | 2,321 | py | Python | python3/koans/about_comprehension.py | sokampdx/python_koans | 8e403b2b749bd03c623d8f22074901ca3748eb86 | [
"MIT"
] | null | null | null | python3/koans/about_comprehension.py | sokampdx/python_koans | 8e403b2b749bd03c623d8f22074901ca3748eb86 | [
"MIT"
] | null | null | null | python3/koans/about_comprehension.py | sokampdx/python_koans | 8e403b2b749bd03c623d8f22074901ca3748eb86 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutComprehension(Koan):
def test_creating_lists_with_list_comprehensions(self):
feast = ['lambs', 'sloths', 'orangutans', 'breakfast cereals',
'fruit bats']
comprehension = [delicacy.capitalize() for de... | 37.435484 | 108 | 0.654459 |
2e944cbdd96f5dd53cf623120bb31f8d2556a89a | 4,593 | py | Python | tensorflow/contrib/estimator/python/estimator/extenders.py | tianhm/tensorflow | e55574f28257bdacd744dcdba86c839e661b1b2a | [
"Apache-2.0"
] | 47 | 2017-03-08T20:58:54.000Z | 2021-06-24T07:07:49.000Z | tensorflow/contrib/estimator/python/estimator/extenders.py | genSud/tensorflow | ec8216568d8cd9810004067558041c11a8356685 | [
"Apache-2.0"
] | 1 | 2019-07-11T16:29:54.000Z | 2019-07-11T16:29:54.000Z | tensorflow/contrib/estimator/python/estimator/extenders.py | genSud/tensorflow | ec8216568d8cd9810004067558041c11a8356685 | [
"Apache-2.0"
] | 19 | 2017-04-17T01:28:40.000Z | 2020-08-15T13:01:33.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.275 | 80 | 0.699761 |
aad4b6ed0598c069e58c3ea4c6beda0c99cd1fdb | 7,860 | py | Python | fetch_jira_bugs/find_bug_fixes.py | clowee/SZZUnleashed | 466716dfd80bcb282f9375d500dd6641f13d1100 | [
"MIT"
] | null | null | null | fetch_jira_bugs/find_bug_fixes.py | clowee/SZZUnleashed | 466716dfd80bcb282f9375d500dd6641f13d1100 | [
"MIT"
] | null | null | null | fetch_jira_bugs/find_bug_fixes.py | clowee/SZZUnleashed | 466716dfd80bcb282f9375d500dd6641f13d1100 | [
"MIT"
] | null | null | null | """ Identify bugfixes in Jenkins repository given a list of issues """
__author__ = "Kristian Berg"
__copyright__ = "Copyright (c) 2018 Axis Communications AB"
__license__ = "MIT"
import os
import json
import re
import argparse
def find_bug_fixes(issue_path, gitlog_path, gitlog_pattern, save_path=None):
""" Ident... | 40.9375 | 147 | 0.52799 |
f49268400eb762d240df8b628c01f771ef8e2374 | 983 | py | Python | acquisition/tests/mock/tiltseries/writer.py | sankhesh/tomviz | 7116f4eb75b30534a24462f4ddfb1694fe41c308 | [
"BSD-3-Clause"
] | 284 | 2015-01-05T08:53:20.000Z | 2022-03-31T07:35:16.000Z | acquisition/tests/mock/tiltseries/writer.py | sankhesh/tomviz | 7116f4eb75b30534a24462f4ddfb1694fe41c308 | [
"BSD-3-Clause"
] | 1,579 | 2015-03-19T15:56:44.000Z | 2022-03-21T11:29:04.000Z | acquisition/tests/mock/tiltseries/writer.py | sankhesh/tomviz | 7116f4eb75b30534a24462f4ddfb1694fe41c308 | [
"BSD-3-Clause"
] | 74 | 2015-01-29T16:24:32.000Z | 2022-03-07T21:52:29.000Z | #
# Simulates writing a series of images to a directory forming a tilt
# series. Used to test passive acquisition by watching a directory.
# It uses a tilt series downloaded from data.kitware.com
from . import TIFFWriter, DM3Writer
import argparse
_writer_map = {
'tiff': TIFFWriter,
'dm3': DM3Writer
}
def ... | 28.085714 | 75 | 0.634791 |
0509353a85a48d69a54c965e0ab616543edeaa33 | 4,640 | py | Python | test/unit/test_local_file_handler.py | AstroImages/astroimages-file-drivers | d81a260378c521663901dac6880271035819e845 | [
"MIT"
] | null | null | null | test/unit/test_local_file_handler.py | AstroImages/astroimages-file-drivers | d81a260378c521663901dac6880271035819e845 | [
"MIT"
] | 4 | 2020-03-28T14:51:04.000Z | 2020-03-31T22:20:24.000Z | test/unit/test_local_file_handler.py | AstroImages/astroimages-file-drivers | d81a260378c521663901dac6880271035819e845 | [
"MIT"
] | null | null | null | import unittest
from unittest import mock
import astroimages_file_drivers.drivers.local_file_driver as local_file_driver
import astroimages_file_drivers.factory as factory
import astroimages_file_drivers.handler_enums as handler_enums
temp_files = [
'/tmp/tmpjor7_dvt/SAMPLE_9.fits',
'/tmp/tmpjor7_dvt... | 35.968992 | 93 | 0.688362 |
c7d38b82e9d8b7dc72da609ad87a291bec976c76 | 4,716 | py | Python | code/register/register_model.py | leolorenzoluis/MLOpsPython | 156f615dbe89a44d143a613d8e610e58e2812696 | [
"MIT"
] | 1 | 2019-07-16T23:57:32.000Z | 2019-07-16T23:57:32.000Z | code/register/register_model.py | leolorenzoluis/MLOpsPython | 156f615dbe89a44d143a613d8e610e58e2812696 | [
"MIT"
] | null | null | null | code/register/register_model.py | leolorenzoluis/MLOpsPython | 156f615dbe89a44d143a613d8e610e58e2812696 | [
"MIT"
] | null | null | null | """
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft Corporation (“Microsoft”) grants you a nonexclusive, perpetual,
royalty-free right to use, copy, and modify the software code provided by us
("Software Code"). You may not sublicense the Software Code or any use of it
(except to your affiliates... | 36.84375 | 86 | 0.758694 |
f11a6a028e82798bf3696bab17c4d3cecc76fb81 | 38,674 | py | Python | psutil/tests/__init__.py | hadren/psutil | 1b5f8d55d22167d640eeb52d0b82f69dec83d210 | [
"BSD-3-Clause"
] | 34 | 2018-07-13T11:30:46.000Z | 2022-01-05T13:48:10.000Z | venv/lib/python3.6/site-packages/psutil/tests/__init__.py | HeyWeiPan/vnpy_crypto | 844381797a475a01c05a4e162592a5a6e3a48032 | [
"MIT"
] | 5 | 2020-02-26T20:10:50.000Z | 2021-09-23T23:23:18.000Z | venv/lib/python3.6/site-packages/psutil/tests/__init__.py | HeyWeiPan/vnpy_crypto | 844381797a475a01c05a4e162592a5a6e3a48032 | [
"MIT"
] | 22 | 2018-07-13T11:30:48.000Z | 2021-09-25T13:30:08.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Test utilities.
"""
from __future__ import print_function
import atexit
import contextlib
import ctypes
import errno
import ... | 31.570612 | 79 | 0.583338 |
62ddde2863097dce818da296adb3257e452f8028 | 1,209 | py | Python | pydrobert/torch/__init__.py | acha21/pydrobert-pytorch | ea612617c5896d38dfd15b9e6b65bdd1669bda53 | [
"Apache-2.0"
] | null | null | null | pydrobert/torch/__init__.py | acha21/pydrobert-pytorch | ea612617c5896d38dfd15b9e6b65bdd1669bda53 | [
"Apache-2.0"
] | null | null | null | pydrobert/torch/__init__.py | acha21/pydrobert-pytorch | ea612617c5896d38dfd15b9e6b65bdd1669bda53 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Sean Robertson
# 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... | 30.225 | 76 | 0.745244 |
cfe58083def0cd819ef681ac0bf1a981defe87a7 | 3,685 | py | Python | microsoft_atp/komand_microsoft_atp/actions/isolate_machine/schema.py | emartin-merrill-r7/insightconnect-plugins | a589745dbcc9f01d3e601431e77ab7221a84c117 | [
"MIT"
] | 1 | 2020-03-18T09:14:55.000Z | 2020-03-18T09:14:55.000Z | microsoft_atp/komand_microsoft_atp/actions/isolate_machine/schema.py | OSSSP/insightconnect-plugins | 846758dab745170cf1a8c146211a8bea9592e8ff | [
"MIT"
] | null | null | null | microsoft_atp/komand_microsoft_atp/actions/isolate_machine/schema.py | OSSSP/insightconnect-plugins | 846758dab745170cf1a8c146211a8bea9592e8ff | [
"MIT"
] | null | null | null | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "Isolate a machine from the network, but keep the connection to Windows ATP open"
class Input:
COMMENT = "comment"
ISOLATION_TYPE = "isolation_type"
MACHINE_ID = "machine_id"
class Output:
MACH... | 24.566667 | 126 | 0.51886 |
caa10944e60db565177c5befadd79fe73d4230ed | 24,137 | py | Python | game.py | remcoeijsackers/GridGame | b9945e609155ffe09dbc711df9e5c056449b0def | [
"MIT"
] | 1 | 2021-11-03T16:39:55.000Z | 2021-11-03T16:39:55.000Z | game.py | remcoeijsackers/GridGame | b9945e609155ffe09dbc711df9e5c056449b0def | [
"MIT"
] | null | null | null | game.py | remcoeijsackers/GridGame | b9945e609155ffe09dbc711df9e5c056449b0def | [
"MIT"
] | null | null | null | from turtle import back
import numpy as np
import random
import tkinter as tk
from tkinter.colorchooser import askcolor
from tkinter.filedialog import askopenfilename
from src.unitgen import unitgenerator
from src.manager import manager, unitcontroller, placement
from src.util import placeip
from src.state import sta... | 44.698148 | 154 | 0.6379 |
68871519328e55ce8c1d35146a6b7369fdaa24a8 | 432 | py | Python | stubs/m5stack_flowui-1_4_0-beta/network.py | RonaldHiemstra/micropython-stubs | d97f879b01f6687baaebef1c7e26a80909c3cff3 | [
"MIT"
] | 38 | 2020-10-18T21:59:44.000Z | 2022-03-17T03:03:28.000Z | stubs/m5stack_flowui-1_4_0-beta/network.py | RonaldHiemstra/micropython-stubs | d97f879b01f6687baaebef1c7e26a80909c3cff3 | [
"MIT"
] | 176 | 2020-10-18T14:31:03.000Z | 2022-03-30T23:22:39.000Z | stubs/m5stack_flowui-1_4_0-beta/network.py | RonaldHiemstra/micropython-stubs | d97f879b01f6687baaebef1c7e26a80909c3cff3 | [
"MIT"
] | 6 | 2019-10-08T05:31:21.000Z | 2021-04-22T10:21:01.000Z | """
Module: 'network' on M5 FlowUI v1.4.0-beta
"""
# MCU: (sysname='esp32', nodename='esp32', release='1.11.0', version='v1.11-284-g5d8e1c867 on 2019-08-30', machine='ESP32 module with ESP32')
# Stubber: 1.3.1
AP_IF = 1
AUTH_OPEN = 0
AUTH_WEP = 1
AUTH_WPA2_PSK = 3
AUTH_WPA_PSK = 2
AUTH_WPA_WPA2_PSK = 4
MODE_11B = 1
MOD... | 17.28 | 141 | 0.671296 |
9ef06ccd7e9469aa43ba7e134d4c457e6fcf5beb | 898 | py | Python | xlsxwriter/test/comparison/test_button08.py | eddiechapman/XlsxWriter | c636117ab30e64e4b7b824c9105595c42887c2c9 | [
"BSD-2-Clause-FreeBSD"
] | 2,766 | 2015-01-02T17:36:42.000Z | 2022-03-31T09:23:30.000Z | xlsxwriter/test/comparison/test_button08.py | xiaolanmeng86/XlsxWriter | 6c3ea23a410e8216eab8f5751e5544ffb444b3da | [
"BSD-2-Clause-FreeBSD"
] | 683 | 2015-01-03T09:55:02.000Z | 2022-03-31T07:18:15.000Z | xlsxwriter/test/comparison/test_button08.py | xiaolanmeng86/XlsxWriter | 6c3ea23a410e8216eab8f5751e5544ffb444b3da | [
"BSD-2-Clause-FreeBSD"
] | 636 | 2015-01-05T01:57:08.000Z | 2022-03-25T18:42:41.000Z | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2021, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | 23.025641 | 79 | 0.613586 |
50c7ad8ff13fdcf37cf115352b761ab21351b9ea | 406 | py | Python | parkings/api/enforcement/permissions.py | klemmari1/parkkihubi | 93218c6046c0910e8a4c723dc7128c6eec085b8c | [
"MIT"
] | 12 | 2016-11-29T15:13:10.000Z | 2021-06-12T06:45:38.000Z | parkings/api/enforcement/permissions.py | niuzhipeng123/parkkihubi | 93218c6046c0910e8a4c723dc7128c6eec085b8c | [
"MIT"
] | 154 | 2016-11-30T09:07:58.000Z | 2022-02-12T08:29:36.000Z | parkings/api/enforcement/permissions.py | niuzhipeng123/parkkihubi | 93218c6046c0910e8a4c723dc7128c6eec085b8c | [
"MIT"
] | 15 | 2016-11-29T19:32:48.000Z | 2022-01-05T11:31:39.000Z | from rest_framework.permissions import BasePermission
from parkings.models import Enforcer
class IsEnforcer(BasePermission):
def has_permission(self, request, view):
user = request.user
if not user.is_authenticated:
return False
try:
user.enforcer
ret... | 20.3 | 53 | 0.637931 |
14c43560a70f7effcb12076386e432932fb2bbdb | 32,398 | py | Python | basic_samples/SDS/Python/SDSPy/Python3/program.py | osi-awoodall/OSI-Samples-OCS | 1995ccda20e4fe2ae66f3b67afbc1127d638a6fc | [
"Apache-2.0"
] | null | null | null | basic_samples/SDS/Python/SDSPy/Python3/program.py | osi-awoodall/OSI-Samples-OCS | 1995ccda20e4fe2ae66f3b67afbc1127d638a6fc | [
"Apache-2.0"
] | null | null | null | basic_samples/SDS/Python/SDSPy/Python3/program.py | osi-awoodall/OSI-Samples-OCS | 1995ccda20e4fe2ae66f3b67afbc1127d638a6fc | [
"Apache-2.0"
] | null | null | null | # program.py
#
# version 0.0.2
import configparser
import inspect
import math
from ocs_sample_library_preview import (SdsType, SdsTypeCode, SdsTypeProperty,
OCSClient, SdsStream, SdsBoundaryType,
SdsStreamPropertyOverride,
... | 36.984018 | 79 | 0.60087 |
07c7423fa0d48391c7cbc99bf0d665de4f34a66b | 10,873 | py | Python | lib/custom_fields_search_engine.py | mavlyutovrus/light_search | 6b0d2d78de99820ca366c6c1bd8efce93a789100 | [
"MIT"
] | null | null | null | lib/custom_fields_search_engine.py | mavlyutovrus/light_search | 6b0d2d78de99820ca366c6c1bd8efce93a789100 | [
"MIT"
] | null | null | null | lib/custom_fields_search_engine.py | mavlyutovrus/light_search | 6b0d2d78de99820ca366c6c1bd8efce93a789100 | [
"MIT"
] | null | null | null | #-*- coding:utf8 -*-
from parsers import TParsersBundle
from ling_utils import TTokenMatch
from ling_utils import CASE_UPPER, CASE_TITLE, CASE_LOWER
from ling_utils import span_tokenize_windows1251, unify_word
from segments_index import TSegmentIndexReader
from crawler import *
from collections import namedtuple
impo... | 38.150877 | 150 | 0.565345 |
fa89bcf4530d1ee9b0117aaf9fb5926f4f3b5341 | 800 | py | Python | models/oauth/google/google_scope.py | Lulla-App/data_access | c8ebe473465d91d70f70ed2151e3ec7fa4ac5b0c | [
"MIT"
] | null | null | null | models/oauth/google/google_scope.py | Lulla-App/data_access | c8ebe473465d91d70f70ed2151e3ec7fa4ac5b0c | [
"MIT"
] | null | null | null | models/oauth/google/google_scope.py | Lulla-App/data_access | c8ebe473465d91d70f70ed2151e3ec7fa4ac5b0c | [
"MIT"
] | null | null | null | from sqlalchemy import Column, String, Integer
from sqlalchemy.orm import relationship
from ... import Base
from .google_oauth_token_scope_correlation import (
google_oauth_token_scope_correlation,
)
from .google_scope_uri_correlation import google_scope_uri_correlation
class GoogleScope(Base):
__tablename__ ... | 30.769231 | 70 | 0.7375 |
380638c6ac4485da8df3173a197e3b9ebf729843 | 451 | py | Python | src/graphs/topological_sort.py | ChrisKalahiki/python-algorithms | 53f206ca18de63941ad22e6249ec651ecf598062 | [
"MIT"
] | null | null | null | src/graphs/topological_sort.py | ChrisKalahiki/python-algorithms | 53f206ca18de63941ad22e6249ec651ecf598062 | [
"MIT"
] | null | null | null | src/graphs/topological_sort.py | ChrisKalahiki/python-algorithms | 53f206ca18de63941ad22e6249ec651ecf598062 | [
"MIT"
] | null | null | null | def topological_sort(graph):
"""
Topological sort of a directed acyclic graph.
"""
# Initialize the stack.
stack = []
# Initialize the visited set.
visited = set()
# Iterate over the vertices.
for vertex in graph:
# Check if the vertex is not visited.
if vertex not in... | 28.1875 | 49 | 0.600887 |
23c2944a26e3b639dcff7f80aee020ea85f6a9fe | 1,535 | py | Python | day21/rpg_buster.py | JulienCote/advent_of_code_2015 | 567a589c6b1c161ebfba8dcf1b9f3bc1bf6e0d00 | [
"MIT"
] | null | null | null | day21/rpg_buster.py | JulienCote/advent_of_code_2015 | 567a589c6b1c161ebfba8dcf1b9f3bc1bf6e0d00 | [
"MIT"
] | null | null | null | day21/rpg_buster.py | JulienCote/advent_of_code_2015 | 567a589c6b1c161ebfba8dcf1b9f3bc1bf6e0d00 | [
"MIT"
] | null | null | null | import re
import copy
boss_stats = [] #hitpoint, damage, armor
player_stats = [100, 0 , 0]
# price, attack, defense
weapons = [[8,4,0], [10,5,0], [25,6,0], [40,7,0], [74,8,0]]
armors = [[0,0,0],[13,0,1],[31,0,2],[53,0,3],[75,0,4],[102,0,5]]
rings = [[0,0,0],[0,0,0],[25, 1, 0], [50, 2, 0], [100, 3, 0], [20, 0, 1], [40... | 30.7 | 97 | 0.611075 |
d9b8c5de8560470b17545f7f7bfe6a624a3ba234 | 3,563 | py | Python | pyautoTest/test_dir/billing/test_create_paylink.py | dob730/WebUI-Automation-Frame | 6d170477717ea8a7dd4db2539d3382c3e82e25b9 | [
"Apache-2.0"
] | null | null | null | pyautoTest/test_dir/billing/test_create_paylink.py | dob730/WebUI-Automation-Frame | 6d170477717ea8a7dd4db2539d3382c3e82e25b9 | [
"Apache-2.0"
] | null | null | null | pyautoTest/test_dir/billing/test_create_paylink.py | dob730/WebUI-Automation-Frame | 6d170477717ea8a7dd4db2539d3382c3e82e25b9 | [
"Apache-2.0"
] | null | null | null | """
page object model
Using the poium Library
https://github.com/SeldomQA/poium
```
> pip install poum
```
"""
import seldom
from seldom import Seldom, excel_to_list, data
from poium import PageWait
from pyautoTest.page.ServicePage import ServicePage
from pyautoTest.page.BillingPage import BillingPage
import os
file_... | 37.904255 | 115 | 0.627561 |
c5e1daa249ebb1ca549c76ac4c63b817c9bc6dff | 291 | py | Python | MIT MOOC/ps2p1.py | agustashd/Learning-Python | b54e3c4a0a6e10bbb0dab396a4cd20ac454ea5be | [
"MIT"
] | null | null | null | MIT MOOC/ps2p1.py | agustashd/Learning-Python | b54e3c4a0a6e10bbb0dab396a4cd20ac454ea5be | [
"MIT"
] | null | null | null | MIT MOOC/ps2p1.py | agustashd/Learning-Python | b54e3c4a0a6e10bbb0dab396a4cd20ac454ea5be | [
"MIT"
] | null | null | null | #balance = 484
#annualInterestRate = 0.2
#monthlyPaymentRate = 0.04
unPaidBalance = 0
for __ in range(12):
unPaidBalance = balance - monthlyPaymentRate*balance
balance = unPaidBalance + (annualInterestRate/12)*unPaidBalance
print("Remaining balance:", round(balance, 2))
| 26.454545 | 68 | 0.725086 |
e079ad6ff154435ed0e4b16ed77558ae5f974fc9 | 5,869 | py | Python | Devices/GatewayConnectedDevices/Hydrology/SensorAgent.py | Brianmanden/connectthedots | 66fdee070b854504eab961b84c998ba42b4f5fc2 | [
"MIT"
] | 235 | 2015-08-30T18:13:58.000Z | 2022-03-08T03:40:31.000Z | Devices/GatewayConnectedDevices/Hydrology/SensorAgent.py | Brianmanden/connectthedots | 66fdee070b854504eab961b84c998ba42b4f5fc2 | [
"MIT"
] | 84 | 2015-08-26T20:38:38.000Z | 2020-12-18T10:59:37.000Z | Devices/GatewayConnectedDevices/Hydrology/SensorAgent.py | Brianmanden/connectthedots | 66fdee070b854504eab961b84c998ba42b4f5fc2 | [
"MIT"
] | 178 | 2015-08-26T17:15:31.000Z | 2022-01-05T09:22:48.000Z | '''
Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitat... | 42.528986 | 294 | 0.601976 |
47b664315c7a4b5f73bc600efb4823bbc4a975ca | 66 | py | Python | aqua_test/pr_commit_vulns.py | behara/AquaIntegration | 6fb8efefbd3d4f46354b12e28ef18f7eae259226 | [
"MIT"
] | null | null | null | aqua_test/pr_commit_vulns.py | behara/AquaIntegration | 6fb8efefbd3d4f46354b12e28ef18f7eae259226 | [
"MIT"
] | null | null | null | aqua_test/pr_commit_vulns.py | behara/AquaIntegration | 6fb8efefbd3d4f46354b12e28ef18f7eae259226 | [
"MIT"
] | 1 | 2020-03-18T16:01:42.000Z | 2020-03-18T16:01:42.000Z | branch created from master
this will have vulns in pr and commit.
| 22 | 38 | 0.80303 |
01134d0d750a859bed2d56af19978e763aa478cc | 773 | py | Python | api/save_containers_stats_job.py | NathanReis/BaleiaAzul | 7a5b8da1d52b61dbcc133ea9ce6cf1758754a27d | [
"MIT"
] | 1 | 2021-11-12T23:23:25.000Z | 2021-11-12T23:23:25.000Z | api/save_containers_stats_job.py | NathanReis/BaleiaAzul | 7a5b8da1d52b61dbcc133ea9ce6cf1758754a27d | [
"MIT"
] | null | null | null | api/save_containers_stats_job.py | NathanReis/BaleiaAzul | 7a5b8da1d52b61dbcc133ea9ce6cf1758754a27d | [
"MIT"
] | null | null | null | from datetime import datetime
from src.database.connection import DBConnection
from src.helpers.docker_helper import extract_stats_container_data
from src.services import container_service
import schedule
import time
def save_containers_stats():
db_connection = DBConnection()
db = db_connection.get_database()... | 25.766667 | 67 | 0.77749 |
df93fa372865ff362823cef02fc238b43f88ad28 | 191,160 | py | Python | saas/models.py | gikoluo/djaodjin-saas | badd7894ac327191008a1b3a0ebd0d07b55908c3 | [
"BSD-2-Clause"
] | null | null | null | saas/models.py | gikoluo/djaodjin-saas | badd7894ac327191008a1b3a0ebd0d07b55908c3 | [
"BSD-2-Clause"
] | null | null | null | saas/models.py | gikoluo/djaodjin-saas | badd7894ac327191008a1b3a0ebd0d07b55908c3 | [
"BSD-2-Clause"
] | null | null | null | #pylint: disable=too-many-lines
# Copyright (c) 2020, DjaoDjin inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
#... | 43.131769 | 80 | 0.60396 |
d4e33e44af79ee14118fb88b60814a98a35e590d | 346 | py | Python | azure-mgmt-media/azure/mgmt/media/version.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | null | null | null | azure-mgmt-media/azure/mgmt/media/version.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | null | null | null | azure-mgmt-media/azure/mgmt/media/version.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------... | 34.6 | 76 | 0.410405 |
f1a5e91c89ef87c29502a8f7c5a1ff36e66e549e | 63,818 | py | Python | tensorflow/python/eager/context.py | ocjosen/tensorflow | ada0605591911094c142d39cbd87294ed2716e8b | [
"Apache-2.0"
] | 2 | 2019-08-04T20:28:14.000Z | 2019-10-27T23:26:42.000Z | tensorflow/python/eager/context.py | ocjosen/tensorflow | ada0605591911094c142d39cbd87294ed2716e8b | [
"Apache-2.0"
] | 1 | 2019-08-19T08:03:52.000Z | 2019-08-19T08:03:52.000Z | tensorflow/python/eager/context.py | ocjosen/tensorflow | ada0605591911094c142d39cbd87294ed2716e8b | [
"Apache-2.0"
] | 1 | 2020-01-19T16:33:55.000Z | 2020-01-19T16:33:55.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.588421 | 89 | 0.722351 |
3195ad85bf054e77cf7251418a48a0d534bbd8bc | 2,870 | py | Python | querybook/server/lib/query_executor/clients/trino.py | froukees/querybook | 8db8ac7e39cd33bbbe3953c0107b0a4ca8472c07 | [
"Apache-2.0"
] | null | null | null | querybook/server/lib/query_executor/clients/trino.py | froukees/querybook | 8db8ac7e39cd33bbbe3953c0107b0a4ca8472c07 | [
"Apache-2.0"
] | null | null | null | querybook/server/lib/query_executor/clients/trino.py | froukees/querybook | 8db8ac7e39cd33bbbe3953c0107b0a4ca8472c07 | [
"Apache-2.0"
] | null | null | null | import trino
from lib.query_executor.base_client import ClientBaseClass, CursorBaseClass
from lib.query_executor.connection_string.trino import get_trino_connection_conf
class TrinoClient(ClientBaseClass):
def __init__(
self, connection_string, username=None, proxy_user=None, *args, **kwargs
):
... | 30.531915 | 148 | 0.650871 |
de16b649d756a34e75d2602302557857251e3874 | 379 | py | Python | examples/user/database-model/model.py | bobrock/AuthKit | ba82501d9dff699be9eef33266aecd03d016cec2 | [
"MIT"
] | null | null | null | examples/user/database-model/model.py | bobrock/AuthKit | ba82501d9dff699be9eef33266aecd03d016cec2 | [
"MIT"
] | null | null | null | examples/user/database-model/model.py | bobrock/AuthKit | ba82501d9dff699be9eef33266aecd03d016cec2 | [
"MIT"
] | 1 | 2020-06-24T19:20:13.000Z | 2020-06-24T19:20:13.000Z | import sqlalchemy as sa
import datetime
from sqlalchemy import orm
from sqlalchemy import schema, types
import sqlalchemy
import meta
def init_model(engine):
"""Call me before using any of the tables or classes in the model."""
sm = orm.sessionmaker(autoflush=True, transactional=True, bind=engine)
meta.e... | 22.294118 | 74 | 0.754617 |
2e59dd664a4a1c18e3174a17640e9cddec1a5ab7 | 1,415 | py | Python | paddle_quantum/GIBBS/HGenerator.py | xinwang1/Quantum | 0f56e36e9e6111547547ae1b6cd5df307b41c1ac | [
"Apache-2.0"
] | null | null | null | paddle_quantum/GIBBS/HGenerator.py | xinwang1/Quantum | 0f56e36e9e6111547547ae1b6cd5df307b41c1ac | [
"Apache-2.0"
] | null | null | null | paddle_quantum/GIBBS/HGenerator.py | xinwang1/Quantum | 0f56e36e9e6111547547ae1b6cd5df307b41c1ac | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 Institute for Quantum Computing, Baidu 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
#
# Un... | 31.444444 | 109 | 0.712367 |
ae44316efd580c18345b6261f6e19f513b214488 | 1,868 | py | Python | setup.py | fsbraun/djangocms-attributes-field | 5df7a3e207a73de71cf15730f4f43ba1187a5f51 | [
"BSD-3-Clause"
] | null | null | null | setup.py | fsbraun/djangocms-attributes-field | 5df7a3e207a73de71cf15730f4f43ba1187a5f51 | [
"BSD-3-Clause"
] | null | null | null | setup.py | fsbraun/djangocms-attributes-field | 5df7a3e207a73de71cf15730f4f43ba1187a5f51 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from setuptools import find_packages, setup
from djangocms_attributes_field import __version__
REQUIREMENTS = [
'django-cms>=3.7',
'django-treebeard>=4.3,<4.5',
]
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Intended Aud... | 30.622951 | 68 | 0.642398 |
f01509abe72d70a79e4fe4f84956e32b293dc42d | 600 | py | Python | adminmgr/media/code/python/map1/BD_0970_1370_1384_mapper.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 9 | 2019-11-08T02:05:27.000Z | 2021-12-13T12:06:35.000Z | adminmgr/media/code/python/map1/BD_0970_1370_1384_mapper.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 6 | 2019-11-27T03:23:16.000Z | 2021-06-10T19:15:13.000Z | adminmgr/media/code/python/map1/BD_0970_1370_1384_mapper.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 4 | 2019-11-26T17:04:27.000Z | 2021-12-13T11:57:03.000Z | #!/usr/bin/python3
import sys
wickets={}
for line in sys.stdin:
line = line.strip()
line = line.split(",")
if(line[0]=='ball'):
if len(line)>=8:
bat_bowl=line[4]+"/"+line[6]
if bat_bowl not in wickets:
wickets[bat_bowl] = [0,1]
if len(line[9])>2 and line[9] != "run out" and line[9]!="retired hur... | 19.354839 | 76 | 0.565 |
63e975cc64b320753c7fef053def0b48ad8a3083 | 844 | py | Python | unit_tests/builders/create_cast.py | jaredlunde/cargo-orm | 1d5524d359bd52a991edc738982b7df2149d9c69 | [
"MIT"
] | 3 | 2017-02-10T08:03:21.000Z | 2017-02-25T04:55:48.000Z | unit_tests/builders/create_cast.py | jaredlunde/cargo-orm | 1d5524d359bd52a991edc738982b7df2149d9c69 | [
"MIT"
] | null | null | null | unit_tests/builders/create_cast.py | jaredlunde/cargo-orm | 1d5524d359bd52a991edc738982b7df2149d9c69 | [
"MIT"
] | null | null | null | #!/usr/bin/python3 -S
# -*- coding: utf-8 -*-
"""
`Unit tests for cargo.builder.create_user`
--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--
2016 Jared Lunde © The MIT License (MIT)
http://github.com/jaredlunde
"""
from cargo.builder import create_cast
from cargo.builder.casts... | 27.225806 | 80 | 0.612559 |
61abcdabeef11982ed0ec27d1da076300e6c7b8c | 627 | py | Python | Documents/Django/dentistsite/dentist/manage.py | franklinokech/telusko | e240c77427e5cb8520e64e1e50a61fb7b965b1a9 | [
"MIT"
] | null | null | null | Documents/Django/dentistsite/dentist/manage.py | franklinokech/telusko | e240c77427e5cb8520e64e1e50a61fb7b965b1a9 | [
"MIT"
] | null | null | null | Documents/Django/dentistsite/dentist/manage.py | franklinokech/telusko | e240c77427e5cb8520e64e1e50a61fb7b965b1a9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dentist.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Import... | 28.5 | 73 | 0.682616 |
89d1f2133f77ace21bcaf8c55c58ab6b2796d901 | 6,319 | py | Python | crabageprediction/venv/Lib/site-packages/pandas/core/computation/parsing.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 28,899 | 2016-10-13T03:32:12.000Z | 2022-03-31T21:39:05.000Z | crabageprediction/venv/Lib/site-packages/pandas/core/computation/parsing.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 31,004 | 2016-10-12T23:22:27.000Z | 2022-03-31T23:17:38.000Z | crabageprediction/venv/Lib/site-packages/pandas/core/computation/parsing.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 15,149 | 2016-10-13T03:21:31.000Z | 2022-03-31T18:46:47.000Z | """
:func:`~pandas.eval` source string parsing functions
"""
from __future__ import annotations
from io import StringIO
from keyword import iskeyword
import token
import tokenize
from typing import (
Hashable,
Iterator,
)
# A token value Python's tokenizer probably will never use.
BACKTICK_QUOTED_STRING = 100... | 32.239796 | 88 | 0.654534 |
ec6543108a0e75959f5c15aec9db25e6622fceed | 25,854 | py | Python | tests/core/test_farmer_harvester_rpc.py | Stor-Network/stor-blockchain | 3c3cd1a3b99592e88160107ca5b81afc0937b992 | [
"Apache-2.0"
] | 19 | 2021-06-29T20:06:09.000Z | 2022-02-09T04:33:00.000Z | tests/core/test_farmer_harvester_rpc.py | Stor-Network/stor-blockchain | 3c3cd1a3b99592e88160107ca5b81afc0937b992 | [
"Apache-2.0"
] | 8 | 2021-07-04T03:21:51.000Z | 2021-12-27T07:56:09.000Z | tests/core/test_farmer_harvester_rpc.py | Stor-Network/stor-blockchain | 3c3cd1a3b99592e88160107ca5b81afc0937b992 | [
"Apache-2.0"
] | 6 | 2021-10-04T17:15:30.000Z | 2022-03-15T08:40:01.000Z | import logging
from os import unlink
from pathlib import Path
from secrets import token_bytes
from shutil import copy, move
import time
import pytest
from blspy import AugSchemeMPL
from chiapos import DiskPlotter
from stor.consensus.coinbase import create_puzzlehash_for_pk
from stor.plotting.util import stream_plot_i... | 47.265082 | 147 | 0.615495 |
efb838bf6d589d016a790a5a00e1f924c63182d2 | 32,816 | py | Python | Lib/site-packages/twisted/test/test_application.py | eliasmaia/scrappy-tutorial | 87db4bcb0a2f5b04fb8fc1978b0dcc1ec1c8819d | [
"bzip2-1.0.6"
] | 32 | 2019-11-14T07:49:33.000Z | 2022-02-16T00:49:22.000Z | twisted/test/test_application.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 9 | 2019-09-06T18:21:59.000Z | 2022-01-13T03:04:11.000Z | twisted/test/test_application.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 16 | 2019-06-25T13:26:43.000Z | 2022-03-07T07:29:12.000Z | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.application} and its interaction with
L{twisted.persisted.sob}.
"""
from __future__ import absolute_import, division
import copy
import os
import pickle
try:
import asyncio
except ImportError:
asyncio = None
fro... | 33.830928 | 84 | 0.621526 |
7a3144d6f0cad6f6bda05e56e55e8df861b0d653 | 3,136 | py | Python | api/models/dataset.py | adinawilliams/dynabench | 4b4dd9cb83d69aa3a7cc25832e3ccc0bdcaf646f | [
"MIT"
] | 15 | 2021-09-24T00:46:04.000Z | 2022-03-16T13:24:56.000Z | api/models/dataset.py | adinawilliams/dynabench | 4b4dd9cb83d69aa3a7cc25832e3ccc0bdcaf646f | [
"MIT"
] | 98 | 2021-09-22T12:33:21.000Z | 2022-03-21T22:23:52.000Z | api/models/dataset.py | adinawilliams/dynabench | 4b4dd9cb83d69aa3a7cc25832e3ccc0bdcaf646f | [
"MIT"
] | 12 | 2021-09-25T05:08:18.000Z | 2022-02-28T21:02:20.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import enum
import sqlalchemy as db
from .base import Base, BaseModel
class AccessTypeEnum(enum.Enum):
scoring = "scoring"
standard =... | 29.308411 | 88 | 0.600128 |
f2e2e3de993ca0216b5f238ee34d3ceed639c85e | 9,359 | py | Python | csv_eval.py | dreamway/pytorch-retinanet-1 | 8bd4d92feb912261263f4a1c18811f0423476ba0 | [
"Apache-2.0"
] | null | null | null | csv_eval.py | dreamway/pytorch-retinanet-1 | 8bd4d92feb912261263f4a1c18811f0423476ba0 | [
"Apache-2.0"
] | null | null | null | csv_eval.py | dreamway/pytorch-retinanet-1 | 8bd4d92feb912261263f4a1c18811f0423476ba0 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import numpy as np
import json
import os
import torch
from PRCurvePlot import *
def compute_overlap(a, b):
"""
Parameters
----------
a: (N, 4) ndarray of float
b: (K, 4) ndarray of float
Returns
-------
overlaps: (N, K) ndarray of overlap between... | 38.514403 | 148 | 0.612138 |
5998ff4d14e113f0ad4f206cbadfcf074db9d3d4 | 481 | py | Python | adventure/migrations/0064_auto_20200529_0136.py | kdechant/eamon | 5a8eb37be3b4c2f558acbe2c72286e96550b8168 | [
"MIT"
] | 22 | 2016-03-22T07:28:42.000Z | 2022-02-12T16:03:17.000Z | adventure/migrations/0064_auto_20200529_0136.py | kdechant/eamon | 5a8eb37be3b4c2f558acbe2c72286e96550b8168 | [
"MIT"
] | 103 | 2017-04-14T23:19:19.000Z | 2022-01-27T03:05:36.000Z | adventure/migrations/0064_auto_20200529_0136.py | kdechant/eamon | 5a8eb37be3b4c2f558acbe2c72286e96550b8168 | [
"MIT"
] | 7 | 2019-04-09T16:12:10.000Z | 2021-12-15T17:09:32.000Z | # Generated by Django 3.0.5 on 2020-05-29 08:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('adventure', '0063_monster_combat_verbs'),
]
operations = [
migrations.AlterField(
model_name='monster',
name='gender... | 25.315789 | 140 | 0.596674 |
8f26116b7bb103634d87b7178ca798e7d61fc016 | 665 | py | Python | var/spack/repos/builtin/packages/py-multipledispatch/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-multipledispatch/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-multipledispatch/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyMultipledispatch(PythonPackage):
"""A relatively sane approach to multiple dispatch in P... | 35 | 95 | 0.736842 |
fcb3349435ab346c11d0c7ef62d4c5a6dfe8d179 | 302 | py | Python | src/python/pants/rules/core/register.py | fhaque/pants | cf74d6b788e28305fe342234a07ec5359ccbf2ce | [
"Apache-2.0"
] | null | null | null | src/python/pants/rules/core/register.py | fhaque/pants | cf74d6b788e28305fe342234a07ec5359ccbf2ce | [
"Apache-2.0"
] | null | null | null | src/python/pants/rules/core/register.py | fhaque/pants | cf74d6b788e28305fe342234a07ec5359ccbf2ce | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.rules.core import filedeps, list_roots, list_targets, test
def rules():
return list_roots.rules() + list_targets.rules() + filedeps.rules() + test.rules()
| 33.555556 | 84 | 0.754967 |
e81d3e8471eb50af9d86bced21470519da2aefe6 | 4,229 | py | Python | dense_correspondence/training/training_script.py | jankopanski/general-dense-object-nets | 60fc5a133d3224c9a5e0db85c9b34aa74ef50dbc | [
"BSD-3-Clause"
] | 520 | 2018-06-25T00:46:38.000Z | 2022-03-27T11:01:07.000Z | dense_correspondence/training/training_script.py | mmichelis/dense-object-nets-python3 | c77cac0271219cd11940004e910951cdf4765e51 | [
"BSD-3-Clause"
] | 66 | 2018-07-23T15:16:04.000Z | 2021-08-10T13:40:25.000Z | dense_correspondence/training/training_script.py | mmichelis/dense-object-nets-python3 | c77cac0271219cd11940004e910951cdf4765e51 | [
"BSD-3-Clause"
] | 121 | 2018-06-26T13:52:03.000Z | 2022-03-27T11:00:45.000Z | import dense_correspondence_manipulation.utils.utils as utils
utils.add_dense_correspondence_to_python_path()
from dense_correspondence.training.training import *
import sys
import logging
#utils.set_default_cuda_visible_devices()
# utils.set_cuda_visible_devices([0]) # use this to manually set CUDA_VISIBLE_DEVICES
f... | 42.29 | 108 | 0.763537 |
c54eef8e63408727d63a2c2e5734ed6672b3666c | 4,076 | py | Python | astropy/conftest.py | nksaunders/astropy | 842cc5aaac9162a261a787f2337d4adc580e9410 | [
"BSD-3-Clause"
] | 1 | 2020-05-10T21:17:24.000Z | 2020-05-10T21:17:24.000Z | astropy/conftest.py | nksaunders/astropy | 842cc5aaac9162a261a787f2337d4adc580e9410 | [
"BSD-3-Clause"
] | 1 | 2016-06-17T15:17:33.000Z | 2016-06-22T18:40:35.000Z | astropy/conftest.py | nksaunders/astropy | 842cc5aaac9162a261a787f2337d4adc580e9410 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This file contains pytest configuration settings that are astropy-specific
(i.e. those that would not necessarily be shared by affiliated packages
making use of astropy's test runner).
"""
import os
import builtins
import tempfile
import warnings
try... | 33.68595 | 78 | 0.723258 |
68ada5556ac0fbad5a15cbe1745624ee8e558e2e | 2,534 | py | Python | tresonator/coaxial.py | jhillairet/tresonator | 39a74f809cdd9ed7ad9cc44795c4dc4aff7b8460 | [
"CECILL-B"
] | null | null | null | tresonator/coaxial.py | jhillairet/tresonator | 39a74f809cdd9ed7ad9cc44795c4dc4aff7b8460 | [
"CECILL-B"
] | null | null | null | tresonator/coaxial.py | jhillairet/tresonator | 39a74f809cdd9ed7ad9cc44795c4dc4aff7b8460 | [
"CECILL-B"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Coaxial Class
"""
import numpy as np
from . constants import *
class Coax(object):
"""
Coaxial Line transmission line
"""
def __init__(self, L, Dint, Dout, eps_r=1, sigma=conductivity_Cu):
"""
Coax transmission line.
Args
----
... | 27.846154 | 101 | 0.512234 |
c66d1cc93eb16d5e47c1452ebb6d4c07ed24a5a0 | 2,987 | py | Python | multipledispatch/tests/test_annotations.py | LowinData/multipledispatch | b95a5fc39435a70b114aacacde83750147081f94 | [
"BSD-3-Clause"
] | 1 | 2015-02-06T06:16:52.000Z | 2015-02-06T06:16:52.000Z | multipledispatch/tests/test_annotations.py | LowinData/multipledispatch | b95a5fc39435a70b114aacacde83750147081f94 | [
"BSD-3-Clause"
] | null | null | null | multipledispatch/tests/test_annotations.py | LowinData/multipledispatch | b95a5fc39435a70b114aacacde83750147081f94 | [
"BSD-3-Clause"
] | null | null | null | from multipledispatch import dispatch
from multipledispatch.compatibility import raises
def test_singledispatch():
@dispatch
def f(x: int):
return x + 1
@dispatch
def g(x: int):
return x + 2
@dispatch
def f(x: float):
return x - 1
assert f(1) == 2
assert g(1)... | 16.233696 | 59 | 0.497824 |
36b41276f978fd885a469080728a2436376dbc63 | 1,995 | py | Python | tools/perf/page_sets/tough_filters_cases.py | google-ar/chromium | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 777 | 2017-08-29T15:15:32.000Z | 2022-03-21T05:29:41.000Z | tools/perf/page_sets/tough_filters_cases.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 66 | 2017-08-30T18:31:18.000Z | 2021-08-02T10:59:35.000Z | tools/perf/page_sets/tough_filters_cases.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 123 | 2017-08-30T01:19:34.000Z | 2022-03-17T22:55:31.000Z | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page as page_module
from telemetry import story
class ToughFiltersCasesPage(page_module.Page):
def __init__(self, url, page_se... | 38.365385 | 318 | 0.754386 |
157aa5d0e83d99764622b2c2cab6683c8b4ae118 | 995 | py | Python | tests/test_functor.py | sobolevn/python-typeclasses | 5052a4ecc729a43ae010689575c147dd91b4d397 | [
"ISC"
] | 51 | 2019-07-03T17:17:49.000Z | 2022-01-09T16:24:29.000Z | tests/test_functor.py | sobolevn/python-typeclasses | 5052a4ecc729a43ae010689575c147dd91b4d397 | [
"ISC"
] | 5 | 2019-07-04T09:41:19.000Z | 2020-01-19T17:19:40.000Z | tests/test_functor.py | sobolevn/python-typeclasses | 5052a4ecc729a43ae010689575c147dd91b4d397 | [
"ISC"
] | 2 | 2019-07-04T09:41:26.000Z | 2019-07-18T16:31:39.000Z | """Test synchronous functor."""
import typing as t
from typeclasses.functor import fmap
def times2(x): # pylint: disable=invalid-name
return x * 2
def test_fmap_str():
assert fmap(times2, 'test') == 'tteesstt'
def test_fmap_btes():
assert fmap(times2, bytes([1, 2, 3])) == bytes([2, 4, 6])
def tes... | 19.9 | 77 | 0.58392 |
ece7aa7c9ef3901344121e5c543d7aae82db9b41 | 1,030 | py | Python | adl-lem/competencies/lib/parse-mom.py | adlnet/tla | 17bc5117270b91a6b159a1985fd630fcb965d590 | [
"Unlicense"
] | 3 | 2021-03-26T14:10:19.000Z | 2022-03-04T19:09:30.000Z | adl-lem/competencies/lib/parse-mom.py | adlnet/tla | 17bc5117270b91a6b159a1985fd630fcb965d590 | [
"Unlicense"
] | 1 | 2021-03-29T21:41:55.000Z | 2021-03-29T21:41:55.000Z | adl-lem/competencies/lib/parse-mom.py | adlnet/tla | 17bc5117270b91a6b159a1985fd630fcb965d590 | [
"Unlicense"
] | 2 | 2021-06-04T15:55:11.000Z | 2022-01-07T10:30:01.000Z | import json
lines = []
with open ("./lib/scratch.txt", "r") as fp:
lines = fp.readlines()
next_verb = None
passing = True
verbs = {}
print("\n\n")
for line in lines:
if line.startswith("Object") or line == "\n":
next_verb = None
passing = True
if line.startswith("Verb"):
pa... | 21.914894 | 68 | 0.526214 |
4e085a610391e45ff9d03a3219c465ef2f842753 | 7,120 | py | Python | tests/test_json/test_json.py | andriyor/xlwings | aae991b901a2329a2f6df849ed9b4d0319c50f2b | [
"BSD-3-Clause"
] | null | null | null | tests/test_json/test_json.py | andriyor/xlwings | aae991b901a2329a2f6df849ed9b4d0319c50f2b | [
"BSD-3-Clause"
] | null | null | null | tests/test_json/test_json.py | andriyor/xlwings | aae991b901a2329a2f6df849ed9b4d0319c50f2b | [
"BSD-3-Clause"
] | null | null | null | # Activate one of the following two lines to run the tests with the respective engine
engine = "json"
# engine = 'excel'
from pathlib import Path
import datetime as dt
import json
import pytest
import numpy as np
import pandas as pd
from dateutil import tz
import xlwings as xw
this_dir = Path(__file__).resolve().pa... | 28.031496 | 87 | 0.537219 |
1986887ef674086f57d21bffeb1c36a992b7973c | 4,121 | py | Python | torch_geometric/nn/conv/hetero_conv.py | xiejiahao33/pytorch_geometric | 278a25362131069fe3ec403318fbe7930a8fedf5 | [
"MIT"
] | null | null | null | torch_geometric/nn/conv/hetero_conv.py | xiejiahao33/pytorch_geometric | 278a25362131069fe3ec403318fbe7930a8fedf5 | [
"MIT"
] | null | null | null | torch_geometric/nn/conv/hetero_conv.py | xiejiahao33/pytorch_geometric | 278a25362131069fe3ec403318fbe7930a8fedf5 | [
"MIT"
] | null | null | null | from typing import Dict, Union, Optional
from torch_geometric.typing import NodeType, EdgeType
from collections import defaultdict
from torch import Tensor
from torch.nn import Module, ModuleDict
from torch_geometric.nn.conv.hgt_conv import group
class HeteroConv(Module):
r"""A generic wrapper for computing gra... | 39.625 | 79 | 0.60762 |
84fa41c9f7158e7ec32a3a13bd0879f530f05ef9 | 405 | wsgi | Python | iec/iec/production.wsgi | divinedeveloper/iec-web-service | 0d5e7a05356cc8d88372a559bd5df787d8dc1f75 | [
"MIT"
] | null | null | null | iec/iec/production.wsgi | divinedeveloper/iec-web-service | 0d5e7a05356cc8d88372a559bd5df787d8dc1f75 | [
"MIT"
] | null | null | null | iec/iec/production.wsgi | divinedeveloper/iec-web-service | 0d5e7a05356cc8d88372a559bd5df787d8dc1f75 | [
"MIT"
] | null | null | null | """
WSGI config for iec project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os, sys ,site
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANG... | 23.823529 | 78 | 0.780247 |
ceea5507b5ecdb2ac9e3c9ea7094284d1831fc80 | 691 | py | Python | src/groupspkg/linearalg/gl.py | MrCamoga/Finite-Groups-2 | 5e52102a423a8ff4eed0cbf59617b6fe999e7ef3 | [
"MIT"
] | 2 | 2020-05-01T21:48:46.000Z | 2021-07-15T13:54:37.000Z | src/groupspkg/linearalg/gl.py | MrCamoga/Finite-Groups-2 | 5e52102a423a8ff4eed0cbf59617b6fe999e7ef3 | [
"MIT"
] | null | null | null | src/groupspkg/linearalg/gl.py | MrCamoga/Finite-Groups-2 | 5e52102a423a8ff4eed0cbf59617b6fe999e7ef3 | [
"MIT"
] | null | null | null | from functools import reduce
from groups import Group, Cyclic, Direct, Aut2
class GL(Group):
"""
GL(n,k): Aut((Z/kZ)^n)
"""
def __init__(self, n, k):
G = Aut2(Cyclic(k)**n)
assert(G.card == reduce(lambda a, b: a*b, [pow(k, n)-pow(k, i) for i in range(n)]))
self.card = G.card... | 26.576923 | 91 | 0.52822 |
ab8066ce55a8f659c7ceb1055dcf246b47bf9b91 | 441 | py | Python | custom/icds_reports/migrations/0013_change_training_indicator.py | dannyroberts/commcare-hq | 4b0b8ecbe851e46307d3a0e635d6d5d6e31c3598 | [
"BSD-3-Clause"
] | null | null | null | custom/icds_reports/migrations/0013_change_training_indicator.py | dannyroberts/commcare-hq | 4b0b8ecbe851e46307d3a0e635d6d5d6e31c3598 | [
"BSD-3-Clause"
] | null | null | null | custom/icds_reports/migrations/0013_change_training_indicator.py | dannyroberts/commcare-hq | 4b0b8ecbe851e46307d3a0e635d6d5d6e31c3598 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations, models
from corehq.sql_db.operations import RawSQLMigration
migrator = RawSQLMigration(('custom', 'icds_reports', 'migrations', 'sql_templates'))
class Migration(migrations.Migrat... | 23.210526 | 85 | 0.734694 |
4aa853d77074975c48da9edd10ee278990a9bbc0 | 166,668 | py | Python | corporate/tests/test_stripe.py | Signior-X/zulip | 7f0381d4c7f17706e7840ca54c171db940f0d885 | [
"Apache-2.0"
] | 1 | 2020-07-07T05:28:25.000Z | 2020-07-07T05:28:25.000Z | corporate/tests/test_stripe.py | Signior-X/zulip | 7f0381d4c7f17706e7840ca54c171db940f0d885 | [
"Apache-2.0"
] | 10 | 2018-11-26T23:16:45.000Z | 2019-02-18T23:17:03.000Z | corporate/tests/test_stripe.py | Signior-X/zulip | 7f0381d4c7f17706e7840ca54c171db940f0d885 | [
"Apache-2.0"
] | 2 | 2017-08-22T12:52:22.000Z | 2019-03-29T05:20:32.000Z | import json
import operator
import os
import random
import re
import sys
from dataclasses import dataclass
from datetime import datetime, timedelta, timezone
from decimal import Decimal
from functools import wraps
from typing import (
Any,
Callable,
Dict,
List,
Mapping,
Optional,
Sequence,
... | 45.587527 | 198 | 0.636667 |
36c16365a5c9b807fcc5c9ffac7bc4ce5a3cc8a6 | 4,138 | py | Python | yolo_model.py | darkhunterLearning/Research_Demo_with_YOLOV3 | 2d08ea2bf4e5a657464dbd18a60a51f5e19e3515 | [
"MIT"
] | null | null | null | yolo_model.py | darkhunterLearning/Research_Demo_with_YOLOV3 | 2d08ea2bf4e5a657464dbd18a60a51f5e19e3515 | [
"MIT"
] | null | null | null | yolo_model.py | darkhunterLearning/Research_Demo_with_YOLOV3 | 2d08ea2bf4e5a657464dbd18a60a51f5e19e3515 | [
"MIT"
] | null | null | null | import os
import cv2
from utils.utils import get_yolo_boxes, makedirs
from utils.bbox import draw_boxes
from tensorflow.keras.models import load_model
import numpy as np
from PIL import Image
class YoloModel:
def __init__(self):
self.net_h = 416
self.net_w = 416
self.anchors = [17,40, 23,53, 23,39, 26,73, 31,... | 38.672897 | 166 | 0.665056 |
4d0cc5524cf22a7ba3bedb8d47bb0277266e87ce | 586 | py | Python | tests/data/test_rats.py | RaphaelOlivier/pyaudlib | 6c9321550e3e1a74081699a8d0770f986647206c | [
"MIT"
] | 26 | 2020-11-19T01:22:58.000Z | 2021-11-09T08:22:54.000Z | tests/data/test_rats.py | RaphaelOlivier/pyaudlib | 6c9321550e3e1a74081699a8d0770f986647206c | [
"MIT"
] | 1 | 2021-04-20T21:14:15.000Z | 2021-04-20T21:14:15.000Z | tests/data/test_rats.py | RaphaelOlivier/pyaudlib | 6c9321550e3e1a74081699a8d0770f986647206c | [
"MIT"
] | 4 | 2020-11-03T14:29:41.000Z | 2021-02-04T21:31:33.000Z | """Test suite for RATS dataset."""
import os
import pytest
from audlib.data.rats import SERATS_SAD, RATS_SAD
@pytest.mark.skipif('RATS_SAD_ROOT' not in os.environ,
reason='ENV $RATS_SAD_ROOT unspecified.')
def test_SERATS_SAD():
dataset = SERATS_SAD(os.environ['RATS_SAD_ROOT'], channels='AH')
... | 30.842105 | 68 | 0.686007 |
7e04c4fc7de2b81d26e20a76fe104cde2d6df170 | 2,754 | py | Python | wardrobe.py | ericawesome/BCG_IOT_smart_travel_system | f7bffb2c581685ff9175c1fb458d9c3ccb32314e | [
"MIT"
] | 1 | 2019-07-17T10:39:08.000Z | 2019-07-17T10:39:08.000Z | wardrobe.py | ericawesome/BCG_IOT_smart_travel_system | f7bffb2c581685ff9175c1fb458d9c3ccb32314e | [
"MIT"
] | null | null | null | wardrobe.py | ericawesome/BCG_IOT_smart_travel_system | f7bffb2c581685ff9175c1fb458d9c3ccb32314e | [
"MIT"
] | null | null | null | #!/usr/bin/python
import piUSBReader
import time
import time
import os
import logging
import json
from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient
import datetime
## Custom pi packages
import pimqtt
card1 = "001277"
card2 = "001349"
card3 = "001168"
card4 = "003940"
card5 = "00116... | 26.480769 | 95 | 0.660131 |
aa271f9a920017832c949cad5b235238e1e3806c | 4,432 | py | Python | test/py/test_migration.py | nutanix/libvfio-user | 7fd786fa7f0023e7bf74618c6ebc3999f5736bc6 | [
"BSD-3-Clause"
] | 40 | 2021-01-22T16:08:27.000Z | 2022-03-08T13:57:47.000Z | test/py/test_migration.py | nutanix/libvfio-user | 7fd786fa7f0023e7bf74618c6ebc3999f5736bc6 | [
"BSD-3-Clause"
] | 273 | 2020-11-27T15:57:33.000Z | 2022-03-29T05:18:59.000Z | test/py/test_migration.py | nutanix/libvfio-user | 7fd786fa7f0023e7bf74618c6ebc3999f5736bc6 | [
"BSD-3-Clause"
] | 12 | 2021-02-18T08:25:22.000Z | 2022-03-01T03:18:49.000Z | #
# Copyright (c) 2021 Nutanix Inc. All rights reserved.
#
# Authors: Thanos Makatos <thanos@nutanix.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above c... | 30.565517 | 79 | 0.712771 |
4d8f25a090b8a10ae8bcb112b3c8e6d45b2ff58c | 7,160 | py | Python | pixel_classification/util/datasetGenerator.py | alfonso-vizcaino/hipp_pixel_classification | c28c5f2bb0d17453d6e5f66a42c5bf1061ab779a | [
"MIT"
] | null | null | null | pixel_classification/util/datasetGenerator.py | alfonso-vizcaino/hipp_pixel_classification | c28c5f2bb0d17453d6e5f66a42c5bf1061ab779a | [
"MIT"
] | null | null | null | pixel_classification/util/datasetGenerator.py | alfonso-vizcaino/hipp_pixel_classification | c28c5f2bb0d17453d6e5f66a42c5bf1061ab779a | [
"MIT"
] | null | null | null | import os
import sys
module_path = os.path.abspath(os.path.join('.'))
if module_path not in sys.path:
sys.path.append(module_path)
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
hippocampusAreas = {
'CA1' : 1,
'CA2' : 2,
'CA3' : 3,
'DG' : 4,
'Outer' : 0
}
def load... | 38.702703 | 140 | 0.668994 |
cf162ef9d12c2fc46d1dee8672e3743128a4206d | 440 | py | Python | tests/test_dataset.py | Quansight/lsst_dashboard | 837cc271ae7d590efa93f37c2f5108ba1af6e8c8 | [
"BSD-3-Clause"
] | 6 | 2019-12-08T21:20:33.000Z | 2020-09-18T15:05:38.000Z | tests/test_dataset.py | Quansight/lsst_dashboard | 837cc271ae7d590efa93f37c2f5108ba1af6e8c8 | [
"BSD-3-Clause"
] | 142 | 2019-07-08T17:47:19.000Z | 2020-05-20T13:46:22.000Z | tests/test_dataset.py | Quansight/lsst_dashboard | 837cc271ae7d590efa93f37c2f5108ba1af6e8c8 | [
"BSD-3-Clause"
] | 4 | 2019-10-09T07:58:47.000Z | 2021-04-17T15:24:07.000Z | import pytest
import os
from pathlib import Path
from lsst_dashboard.dataset import Dataset
@pytest.fixture()
def dataset():
"""
Dataset object fixture
"""
path = os.path.join(os.path.dirname(__file__), "data", "RC2_v18")
d = Dataset(path=path)
return d
def test_dataset_object():
path = ... | 20.952381 | 69 | 0.679545 |
3b1c999381b24ce7fa678f67543536204df3b3a2 | 13,862 | py | Python | src/gluonts/model/san/_network.py | Xiaoxiong-Liu/gluon-ts | 097c492769258dd70b7f223f826b17b0051ceee9 | [
"Apache-2.0"
] | 2,648 | 2019-06-03T17:18:27.000Z | 2022-03-31T08:29:22.000Z | src/gluonts/model/san/_network.py | Xiaoxiong-Liu/gluon-ts | 097c492769258dd70b7f223f826b17b0051ceee9 | [
"Apache-2.0"
] | 1,220 | 2019-06-04T09:00:14.000Z | 2022-03-31T10:45:43.000Z | src/gluonts/model/san/_network.py | Xiaoxiong-Liu/gluon-ts | 097c492769258dd70b7f223f826b17b0051ceee9 | [
"Apache-2.0"
] | 595 | 2019-06-04T01:04:31.000Z | 2022-03-30T10:40:26.000Z | # Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 32.013857 | 78 | 0.545953 |
7099ebcbe626ab185fa97af422439d6e52692b5b | 4,270 | py | Python | old/linux/ads.py | majunze2001/auto-daily-screener | 0d90ab72053740052c8ae1e20c3acd3282f4a649 | [
"MIT"
] | 5 | 2021-09-06T02:00:47.000Z | 2021-09-29T23:59:32.000Z | old/linux/ads.py | majunze2001/auto-daily-screener | 0d90ab72053740052c8ae1e20c3acd3282f4a649 | [
"MIT"
] | 2 | 2021-09-21T05:51:39.000Z | 2021-11-16T04:13:02.000Z | old/linux/ads.py | majunze2001/auto-daily-screener | 0d90ab72053740052c8ae1e20c3acd3282f4a649 | [
"MIT"
] | 3 | 2021-09-19T05:19:31.000Z | 2021-09-19T15:28:41.000Z | #Heavily trimmed down version of the script for use on a pi
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.ui import WebDriverWait
import time
import pyotp
import json
import requests
import base64
#... | 41.057692 | 98 | 0.723185 |
91be7682abd9ef6798ccde585a81c4a3dc33523d | 7,354 | py | Python | tests/ut/python/parallel/test_loss_and_optimizer.py | i4oolish/mindspore | dac3be31d0f2c0a3516200f47af30980e566601b | [
"Apache-2.0"
] | 1 | 2020-08-10T12:06:22.000Z | 2020-08-10T12:06:22.000Z | tests/ut/python/parallel/test_loss_and_optimizer.py | dilingsong/mindspore | 4276050f2494cfbf8682560a1647576f859991e8 | [
"Apache-2.0"
] | null | null | null | tests/ut/python/parallel/test_loss_and_optimizer.py | dilingsong/mindspore | 4276050f2494cfbf8682560a1647576f859991e8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 34.204651 | 97 | 0.656921 |
0f7c471e04250e64e1a7d75fbe16c239a2e3977c | 149 | py | Python | main.py | nachotp/ntfy-middleman | 57ddd84180cd1f389fdb23eab03248365e67f6f8 | [
"MIT"
] | null | null | null | main.py | nachotp/ntfy-middleman | 57ddd84180cd1f389fdb23eab03248365e67f6f8 | [
"MIT"
] | null | null | null | main.py | nachotp/ntfy-middleman | 57ddd84180cd1f389fdb23eab03248365e67f6f8 | [
"MIT"
] | null | null | null |
from ntfy_wrapper import NtfyPublisher
from secrets import *
ntfy = NtfyPublisher(NTFY_DOMAIN, NTFY_TOPIC, NTFY_USER, NTFY_PASS)
ntfy.post("hola") | 21.285714 | 67 | 0.805369 |
fdb0c36d86a247b8efd178a3471a6e6dd4b048b5 | 3,808 | py | Python | test/functional/wallet_multiwallet.py | cryptomiles/cryptomiles | d3815eaf7716fbca9459f4162ae7ba4714298d27 | [
"MIT"
] | null | null | null | test/functional/wallet_multiwallet.py | cryptomiles/cryptomiles | d3815eaf7716fbca9459f4162ae7ba4714298d27 | [
"MIT"
] | null | null | null | test/functional/wallet_multiwallet.py | cryptomiles/cryptomiles | d3815eaf7716fbca9459f4162ae7ba4714298d27 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Copyright (c) 2017-2018 The Cryptomiles Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiwallet.
Verify that a cryptomilesd node... | 41.391304 | 142 | 0.667805 |
052dc4775c696907cc05a6426fda81e3de858c90 | 10,018 | py | Python | citrination_client/search/pif/query/core/reference_query.py | matSciMalcolm/python-citrination-client | a59a2ddd49b3a4323a3393ce13c81172c9b1b645 | [
"Apache-2.0"
] | 20 | 2016-06-15T18:40:50.000Z | 2022-03-21T11:59:13.000Z | citrination_client/search/pif/query/core/reference_query.py | matSciMalcolm/python-citrination-client | a59a2ddd49b3a4323a3393ce13c81172c9b1b645 | [
"Apache-2.0"
] | 91 | 2015-12-23T18:13:43.000Z | 2020-07-21T21:33:13.000Z | citrination_client/search/pif/query/core/reference_query.py | matSciMalcolm/python-citrination-client | a59a2ddd49b3a4323a3393ce13c81172c9b1b645 | [
"Apache-2.0"
] | 18 | 2016-07-19T15:33:18.000Z | 2022-03-02T19:42:24.000Z | from citrination_client.search.pif.query.core.base_object_query import BaseObjectQuery
from citrination_client.search.pif.query.core.display_item_query import DisplayItemQuery
from citrination_client.search.pif.query.core.field_query import FieldQuery
from citrination_client.search.pif.query.core.name_query import Name... | 31.208723 | 199 | 0.659114 |
e858ed53a1ef89b9c2a368d603b73d73ea4bd134 | 8,600 | py | Python | web/registry/models.py | andyk/agentos | 2f5fc5443bfae586c3a9fc7c5bffcca860a0d878 | [
"Apache-2.0"
] | 1 | 2021-10-04T19:32:31.000Z | 2021-10-04T19:32:31.000Z | web/registry/models.py | andyk/agentos | 2f5fc5443bfae586c3a9fc7c5bffcca860a0d878 | [
"Apache-2.0"
] | null | null | null | web/registry/models.py | andyk/agentos | 2f5fc5443bfae586c3a9fc7c5bffcca860a0d878 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from rest_framework.exceptions import ValidationError
from typing import Dict, List
from agentos.component import Component as CLI_Component
class TimeStampedModel(models.Model):
created = models.DateTimeField(auto_now_add=True, editable=False)
updated = models.DateTimeField(auto_... | 34.4 | 79 | 0.606977 |
0b73388eed31dd490875b84aa2ada93926e39e81 | 4,734 | py | Python | collage_maker.py | Jitesh17/collage_maker | ddc3374865859a65438584999cc3ea6ba83eb492 | [
"MIT"
] | null | null | null | collage_maker.py | Jitesh17/collage_maker | ddc3374865859a65438584999cc3ea6ba83eb492 | [
"MIT"
] | null | null | null | collage_maker.py | Jitesh17/collage_maker | ddc3374865859a65438584999cc3ea6ba83eb492 | [
"MIT"
] | 1 | 2020-05-24T14:28:42.000Z | 2020-05-24T14:28:42.000Z | # -*- coding: utf-8 -*-
"""
Collage maker - tool to create picture collages
Author: Delimitry
"""
import argparse
import os
import random
from PIL import Image
def make_collage(images, filename, width=2000, init_height=250, fin_width=1920, fin_height=1080):
"""
Make a collage image with a width equal to `wid... | 36.697674 | 118 | 0.584706 |
514377d158fe22b4592a01604d41e6def2f3ee2b | 969 | py | Python | TempDataProcess/ComputeMonthAvg.py | jmcgra1/Global-Warming-Visualization | 793513c3076679053b4999be9fe100339e78686b | [
"MIT"
] | null | null | null | TempDataProcess/ComputeMonthAvg.py | jmcgra1/Global-Warming-Visualization | 793513c3076679053b4999be9fe100339e78686b | [
"MIT"
] | null | null | null | TempDataProcess/ComputeMonthAvg.py | jmcgra1/Global-Warming-Visualization | 793513c3076679053b4999be9fe100339e78686b | [
"MIT"
] | null | null | null | import psycopg2
#Connects to db
con = psycopg2.connect(
host = "localhost",
database = "tempdata",
user = "jack",
password = "lozfiresword")
#Create Cursor
cur = con.cursor()
#Execute Query
cur.execute("select distinct(country) from temperatures;")
#Catch all results as... | 25.5 | 105 | 0.644995 |
3cb54cefce5f842fb76dba72476e775c894e8354 | 913 | py | Python | submit/bot_submission.py | ABCDa102030/GoBigger-Challenge-2021 | e2765ea316274a12e30fd747cb2260796e272e37 | [
"Apache-2.0"
] | 121 | 2021-11-01T01:24:31.000Z | 2022-03-31T10:53:47.000Z | submit/bot_submission.py | ABCDa102030/GoBigger-Challenge-2021 | e2765ea316274a12e30fd747cb2260796e272e37 | [
"Apache-2.0"
] | 2 | 2021-11-06T14:13:00.000Z | 2022-01-25T09:19:41.000Z | submit/bot_submission.py | ABCDa102030/GoBigger-Challenge-2021 | e2765ea316274a12e30fd747cb2260796e272e37 | [
"Apache-2.0"
] | 39 | 2021-11-01T12:48:19.000Z | 2022-03-01T11:23:38.000Z | from gobigger.agents import BotAgent
class BaseSubmission:
def __init__(self, team_name, player_names):
self.team_name = team_name
self.player_names = player_names
def get_actions(self, obs):
'''
Overview:
You must implement this function.
'''
rais... | 27.666667 | 68 | 0.647317 |
4a839cd3e96b6d529ecd8bc443b45d351c8c90e9 | 4,233 | py | Python | openshift/test/test_v1_tag_reference.py | TristanCacqueray/openshift-restclient-python | 7758cde7a8094acb279904f15c29e5fe3e9f7d33 | [
"Apache-2.0"
] | null | null | null | openshift/test/test_v1_tag_reference.py | TristanCacqueray/openshift-restclient-python | 7758cde7a8094acb279904f15c29e5fe3e9f7d33 | [
"Apache-2.0"
] | null | null | null | openshift/test/test_v1_tag_reference.py | TristanCacqueray/openshift-restclient-python | 7758cde7a8094acb279904f15c29e5fe3e9f7d33 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
OpenShift API (with Kubernetes)
OpenShift provides builds, application lifecycle, image content management, and administrative policy on top of Kubernetes. The API allows consistent management of those objects. All API operations are authenticated via an Authorization bearer token that is... | 94.066667 | 3,375 | 0.786204 |
a972442527fd918fff52ce6e5841cb91960b802f | 3,596 | py | Python | python/phevaluator/table_tests/test_dptables.py | dNhunter3107/PokerHandEvaluator | 6bcdc3f4f3b25343b583c76c305b398d7bd89755 | [
"Apache-2.0"
] | null | null | null | python/phevaluator/table_tests/test_dptables.py | dNhunter3107/PokerHandEvaluator | 6bcdc3f4f3b25343b583c76c305b398d7bd89755 | [
"Apache-2.0"
] | null | null | null | python/phevaluator/table_tests/test_dptables.py | dNhunter3107/PokerHandEvaluator | 6bcdc3f4f3b25343b583c76c305b398d7bd89755 | [
"Apache-2.0"
] | null | null | null | import unittest
from itertools import combinations_with_replacement
from evaluator.dptables import CHOOSE, DP, SUITS
class TestSuitsTable(unittest.TestCase):
DP = [0] * len(SUITS)
@classmethod
def setUpClass(cls):
for k in [5, 6, 7, 8, 9]:
cls.update_k(cls.DP, k)
@staticmethod
... | 31 | 88 | 0.478865 |
f0e531350430d484bd5fa14db11a93afeda89908 | 17,044 | py | Python | dataprep/connector/connector.py | devinllu/dataprep | d56861e5bed3c608cace74983f797dc729072d0a | [
"MIT"
] | 1,229 | 2019-12-21T02:58:59.000Z | 2022-03-30T08:12:33.000Z | dataprep/connector/connector.py | devinllu/dataprep | d56861e5bed3c608cace74983f797dc729072d0a | [
"MIT"
] | 680 | 2019-12-19T06:09:23.000Z | 2022-03-31T04:15:25.000Z | dataprep/connector/connector.py | devinllu/dataprep | d56861e5bed3c608cace74983f797dc729072d0a | [
"MIT"
] | 170 | 2020-01-08T03:27:26.000Z | 2022-03-20T20:42:55.000Z | """
This module contains the Connector class.
Every data fetching action should begin with instantiating this Connector class.
"""
import math
import sys
from asyncio import as_completed
from typing import Any, Awaitable, Dict, Optional, Set, Tuple, Union
from warnings import warn
import pandas as pd
from aiohttp impo... | 35.508333 | 98 | 0.537843 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.