hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
01ce6d6100e46a2adfec35c9179bd9156caaa1f9 | 2,133 | py | Python | fixture/user.py | planofmind/python_training | 3b8f9a44b5760e3b9b18abc2b8f1441fff982b43 | [
"Apache-2.0"
] | null | null | null | fixture/user.py | planofmind/python_training | 3b8f9a44b5760e3b9b18abc2b8f1441fff982b43 | [
"Apache-2.0"
] | null | null | null | fixture/user.py | planofmind/python_training | 3b8f9a44b5760e3b9b18abc2b8f1441fff982b43 | [
"Apache-2.0"
] | null | null | null | from selenium.webdriver.support.select import Select
class UserHelper:
def __init__(self, app):
self.app = app
def create(self, user):
wd = self.app.wd
wd.find_element_by_link_text("add new").click()
wd.find_element_by_name("firstname").send_keys(user.firstname)
wd.fin... | 52.02439 | 85 | 0.7173 |
99aed854872f094624965bf09910d0b6c855543c | 63 | py | Python | test/fixtures/python/corpus/list-comprehension.B.py | matsubara0507/semantic | 67899f701abc0f1f0cb4374d8d3c249afc33a272 | [
"MIT"
] | 8,844 | 2019-05-31T15:47:12.000Z | 2022-03-31T18:33:51.000Z | test/fixtures/python/corpus/list-comprehension.B.py | matsubara0507/semantic | 67899f701abc0f1f0cb4374d8d3c249afc33a272 | [
"MIT"
] | 401 | 2019-05-31T18:30:26.000Z | 2022-03-31T16:32:29.000Z | test/fixtures/python/corpus/list-comprehension.B.py | matsubara0507/semantic | 67899f701abc0f1f0cb4374d8d3c249afc33a272 | [
"MIT"
] | 504 | 2019-05-31T17:55:03.000Z | 2022-03-30T04:15:04.000Z | [ f for e in d if f() for g in h if g() ]
[ c + 1 for b in a ]
| 21 | 41 | 0.47619 |
9232384305ab33d604e55b1c7a1051885431894c | 24,337 | py | Python | src/oci/data_integration/models/update_task_from_rest_task.py | pabs3/oci-python-sdk | 437ba18ce39af2d1090e277c4bb8750c89f83021 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/data_integration/models/update_task_from_rest_task.py | pabs3/oci-python-sdk | 437ba18ce39af2d1090e277c4bb8750c89f83021 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/data_integration/models/update_task_from_rest_task.py | pabs3/oci-python-sdk | 437ba18ce39af2d1090e277c4bb8750c89f83021 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 38.691574 | 245 | 0.677692 |
dd7328ee221733720f8504161cc6fb9069ac8d5c | 7,680 | py | Python | h/presenters/document_html.py | julien-cheng/h | 36c8ec044725720cf36f0986cdf025395aca8929 | [
"BSD-2-Clause"
] | 2 | 2019-08-04T07:22:11.000Z | 2020-07-17T05:01:41.000Z | h/presenters/document_html.py | 11-eleven-11/h | 91c7a4504ad7471ed3e30246763a03e6c1cc531b | [
"BSD-2-Clause"
] | null | null | null | h/presenters/document_html.py | 11-eleven-11/h | 91c7a4504ad7471ed3e30246763a03e6c1cc531b | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import jinja2
from h._compat import text_type, urlparse, url_unquote
class DocumentHTMLPresenter(object):
"""Wraps Document model objects and adds some HTML properties."""
def __init__(self, document):
self.document = document
@p... | 32.133891 | 87 | 0.61862 |
6ad185d08e311da32bd614a9c3f19eac735d45dc | 17,672 | py | Python | jupyter_pyfilesystem/contents.py | manics/jupyter-pyfilesystem | b5124aa894e075b5f3954ea80ea0a5e8691ce5cc | [
"MIT"
] | 5 | 2020-01-29T19:40:52.000Z | 2020-05-20T07:19:54.000Z | jupyter_pyfilesystem/contents.py | manics/jupyter-pyfilesystem | b5124aa894e075b5f3954ea80ea0a5e8691ce5cc | [
"MIT"
] | null | null | null | jupyter_pyfilesystem/contents.py | manics/jupyter-pyfilesystem | b5124aa894e075b5f3954ea80ea0a5e8691ce5cc | [
"MIT"
] | null | null | null | from notebook.services.contents.manager import ContentsManager
from notebook.services.contents.checkpoints import (
Checkpoints,
GenericCheckpointsMixin,
)
from traitlets import (
Bool,
default,
Instance,
Int,
TraitError,
Unicode,
)
from traitlets.config.configurable import LoggingConfig... | 35.629032 | 121 | 0.605534 |
05587fa9096f3e1a1fad48f1ad0a31f5095a1d5a | 8,905 | py | Python | autotest/gdrivers/wcs.py | HongqiangWei/gdal | f7c427926438cc39d31e4459fa6401321f8e62f0 | [
"MIT"
] | null | null | null | autotest/gdrivers/wcs.py | HongqiangWei/gdal | f7c427926438cc39d31e4459fa6401321f8e62f0 | [
"MIT"
] | null | null | null | autotest/gdrivers/wcs.py | HongqiangWei/gdal | f7c427926438cc39d31e4459fa6401321f8e62f0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test WCS client support.
# Author: Frank Warmerdam <warmerdam@pobox.com>
#
###############################################################... | 29.196721 | 170 | 0.571926 |
76dd7157723a2dc005196e2cad8ac4312a5c62b7 | 3,579 | py | Python | data/results/help.py | ksboy/finance_negative_entity | 926200dda0f56380b6a6eb42afb3b616e4498d12 | [
"MIT"
] | null | null | null | data/results/help.py | ksboy/finance_negative_entity | 926200dda0f56380b6a6eb42afb3b616e4498d12 | [
"MIT"
] | null | null | null | data/results/help.py | ksboy/finance_negative_entity | 926200dda0f56380b6a6eb42afb3b616e4498d12 | [
"MIT"
] | null | null | null | # encoding: utf-8
"""
@author: banifeng
@contact: banifeng@126.com
@version: 1.0
@file: help.py
@time: 2019-08-18 09:22
这一行开始写关于本文件的说明与解释
"""
from collections import defaultdict
def func():
datas = open('result_test.csv').read().splitlines()[1:]
output = []
for data in datas:
split_data = data.s... | 34.085714 | 100 | 0.578933 |
73bc9dcafb57f31bcdfe1915f1b05c3aef5a85fb | 3,734 | py | Python | py365/auth/msal_connection.py | dudil/py365 | 5f350470e3930ff1c1ae09e8cea917fee17836fa | [
"MIT"
] | 1 | 2020-04-16T13:28:29.000Z | 2020-04-16T13:28:29.000Z | py365/auth/msal_connection.py | dudil/py365 | 5f350470e3930ff1c1ae09e8cea917fee17836fa | [
"MIT"
] | 4 | 2020-03-24T17:00:21.000Z | 2021-02-11T09:16:22.000Z | py365/auth/msal_connection.py | dudil/py365 | 5f350470e3930ff1c1ae09e8cea917fee17836fa | [
"MIT"
] | null | null | null | import logging
from typing import Optional
from msal import ConfidentialClientApplication, PublicClientApplication
from .app_connection import AppConnection
DEFAULT_API_VER = "v1.0"
DEFAULT_RESOURCE = "https://graph.microsoft.com/"
DEFAULT_SCOPES = ["https://graph.microsoft.com/.default"]
class MsalConnection(AppCon... | 41.032967 | 108 | 0.654794 |
a8569dface172c145c3ffa996774800922c2b7a6 | 3,734 | py | Python | nanobrok/tests/test_deviceInfo_model.py | retr0-13/nanobroK | 6e01e385c6c0c7c231609faedb76c0337de90dc0 | [
"Apache-2.0"
] | 142 | 2021-09-18T11:25:28.000Z | 2022-03-30T13:44:58.000Z | nanobrok/tests/test_deviceInfo_model.py | retr0-13/nanobroK | 6e01e385c6c0c7c231609faedb76c0337de90dc0 | [
"Apache-2.0"
] | 1 | 2021-09-19T14:31:17.000Z | 2021-09-21T00:47:04.000Z | nanobrok/tests/test_deviceInfo_model.py | retr0-13/nanobroK | 6e01e385c6c0c7c231609faedb76c0337de90dc0 | [
"Apache-2.0"
] | 31 | 2021-09-19T03:52:13.000Z | 2022-03-31T14:19:12.000Z | import unittest, json
from nanobrok.models import (
DeviceInfo,
DeviceInfoSchema,
PacketType,
PacketDataSchema,
PacketData,
Event,
)
from pprint import pprint
from marshmallow import ValidationError
from nanobrok.ext.database import db
from datetime import datetime
from nanobrok.blueprints.webui... | 39.305263 | 91 | 0.687467 |
3dbf4dad3446e51da65796c8b59a3629c530a11d | 2,067 | py | Python | Python/phonenumbers/data/region_TW.py | skykisl/uberbruns2 | 26933efce04dba700d93cc75c7b74e069fb02d26 | [
"Unlicense"
] | 5 | 2015-04-27T20:10:56.000Z | 2018-06-14T18:19:09.000Z | python/phonenumbers/data/region_TW.py | vemel/python-phonenumbers | 595c322bf12106a3b95e3f202e948a7c6b6c15b8 | [
"Apache-2.0"
] | 2 | 2017-06-08T16:11:13.000Z | 2018-05-07T11:50:13.000Z | python/phonenumbers/data/region_TW.py | vemel/python-phonenumbers | 595c322bf12106a3b95e3f202e948a7c6b6c15b8 | [
"Apache-2.0"
] | 6 | 2015-02-19T11:11:04.000Z | 2022-03-15T19:38:31.000Z | """Auto-generated file, do not edit by hand. TW metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_TW = PhoneMetadata(id='TW', country_code=886, international_prefix='0(?:0[25679]|19)',
general_desc=PhoneNumberDesc(national_number_pattern='[2-9]\\d{7,8}', possible_n... | 89.869565 | 174 | 0.752298 |
f62632a41ab0fec5c2f2c0a26b2f0c25482f576e | 38,719 | py | Python | readthedocs/builds/models.py | comradekingu/readthedocs.org | b657dd5bc721db7357b71363494cf814b1a4785a | [
"MIT"
] | null | null | null | readthedocs/builds/models.py | comradekingu/readthedocs.org | b657dd5bc721db7357b71363494cf814b1a4785a | [
"MIT"
] | null | null | null | readthedocs/builds/models.py | comradekingu/readthedocs.org | b657dd5bc721db7357b71363494cf814b1a4785a | [
"MIT"
] | null | null | null | """Models for the builds app."""
import datetime
import logging
import os.path
import re
from shutil import rmtree
import regex
from django.conf import settings
from django.db import models
from django.db.models import F
from django.urls import reverse
from django.utils import timezone
from django.utils.translation i... | 31.736885 | 90 | 0.584545 |
2a06ca4b909d5dc2b9b674bcec3bbf7873e7812f | 2,831 | py | Python | tools/build/v2/test/build_dir.py | juslee/boost-svn | 6d5a03c1f5ed3e2b23bd0f3ad98d13ff33d4dcbb | [
"BSL-1.0"
] | 1 | 2018-12-15T19:55:56.000Z | 2018-12-15T19:55:56.000Z | tools/build/v2/test/build_dir.py | smart-make/boost | 46509a094f8a844eefd5bb8a0030b739a04d79e1 | [
"BSL-1.0"
] | null | null | null | tools/build/v2/test/build_dir.py | smart-make/boost | 46509a094f8a844eefd5bb8a0030b739a04d79e1 | [
"BSL-1.0"
] | null | null | null | #!/usr/bin/python
# Copyright 2003 Dave Abrahams
# Copyright 2002, 2003, 2005 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test that we can change build directory using the 'build-dir' project
# attribute... | 26.457944 | 81 | 0.653833 |
f75a05cfb70187274d9492393de25937bbfe2bc0 | 12,228 | py | Python | zaza/openstack/utilities/openstack_upgrade.py | freyes/zaza-openstack-tests | c9834315f996966aaedd95d712a991df7a449eb8 | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2019-08-09T02:39:12.000Z | 2021-05-18T14:19:51.000Z | zaza/openstack/utilities/openstack_upgrade.py | freyes/zaza-openstack-tests | c9834315f996966aaedd95d712a991df7a449eb8 | [
"ECL-2.0",
"Apache-2.0"
] | 350 | 2019-05-13T10:28:33.000Z | 2022-03-30T13:35:16.000Z | zaza/openstack/utilities/openstack_upgrade.py | freyes/zaza-openstack-tests | c9834315f996966aaedd95d712a991df7a449eb8 | [
"ECL-2.0",
"Apache-2.0"
] | 72 | 2019-04-18T06:05:01.000Z | 2022-03-29T05:41:40.000Z | # Copyright 2019 Canonical 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 in writin... | 34.44507 | 79 | 0.680651 |
431acfda8e8b6596b6264025d1cf502a925de516 | 13,924 | py | Python | src/pytorch-project/siamese/siamese_baseline.py | kaderghal/ADNI_Data_processing | 454462d3913d77e3bc4de2b9725b456301c7b351 | [
"MIT"
] | 5 | 2021-01-07T10:11:57.000Z | 2022-01-16T04:57:51.000Z | src/pytorch-project/siamese/siamese_baseline.py | kaderghal/ADNI_Data_processing | 454462d3913d77e3bc4de2b9725b456301c7b351 | [
"MIT"
] | null | null | null | src/pytorch-project/siamese/siamese_baseline.py | kaderghal/ADNI_Data_processing | 454462d3913d77e3bc4de2b9725b456301c7b351 | [
"MIT"
] | 1 | 2021-08-05T07:34:16.000Z | 2021-08-05T07:34:16.000Z | import os
import sys
import errno
import random
import pickle
import numpy as np
from PIL import Image
import torch
import torchvision
from torch.utils.data.dataset import Dataset
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.sampler import BatchSampler
from torchvision.datasets import Datase... | 30.669604 | 127 | 0.547328 |
c0a66e9df2fd8a4d9079af4c55679416055b602d | 4,396 | py | Python | tests/test_dataloaders.py | McMasterAI/RadiologyandAI-MedicalZooPytorch | 606a1654f08b8bae7c265608694d55fecc1001ed | [
"MIT"
] | 995 | 2019-07-23T11:34:22.000Z | 2022-03-30T21:10:52.000Z | tests/test_dataloaders.py | pyushkevich/MedicalZooPytorch | c6831d8ddebfbc1b33c04f8cec0d01c2ceb828f6 | [
"MIT"
] | 18 | 2020-04-27T03:38:22.000Z | 2022-01-18T20:55:20.000Z | tests/test_dataloaders.py | pyushkevich/MedicalZooPytorch | c6831d8ddebfbc1b33c04f8cec0d01c2ceb828f6 | [
"MIT"
] | 209 | 2019-08-21T13:41:13.000Z | 2022-03-30T08:01:52.000Z | # Python libraries
import argparse
# Lib files
import lib.utils as utils
import lib.medloaders as medical_loaders
class TestDataLoaders:
def __init__(self, batch=1, dim=64, classes=10):
self.batch = batch
self.dim = dim
self.classes = classes
self.binary_classes = 2
self.a... | 43.524752 | 120 | 0.579618 |
030b11c9438dfe15669ab07d72fabd0d755d1ee8 | 3,540 | py | Python | bindings/python/ensmallen/datasets/string/vavraiaculicissubspfloridensis.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/vavraiaculicissubspfloridensis.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/vavraiaculicissubspfloridensis.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Vavraia culicis subsp. floridensis.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: prot... | 33.714286 | 223 | 0.681356 |
392c01cc9ccc3844d7865b0fa269068bd077b337 | 9,338 | py | Python | sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_sql_pool_schemas_operations.py | RAY-316/azure-sdk-for-python | 4f7790deaf46c6f4e965f099f36eb73a7954ad5b | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_sql_pool_schemas_operations.py | RSidea/azure-sdk-for-python | 8f691b2c95ee0fc53b12d08bd83e3f134d9cf0ef | [
"MIT"
] | null | null | null | sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_sql_pool_schemas_operations.py | RSidea/azure-sdk-for-python | 8f691b2c95ee0fc53b12d08bd83e3f134d9cf0ef | [
"MIT"
] | 1 | 2021-12-18T20:01:22.000Z | 2021-12-18T20:01:22.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.134021 | 211 | 0.658171 |
12e5dddd5dedcc55c1d4e66dba281afe2f3aa92b | 2,841 | py | Python | TrialPathfinder/shapley_computation.py | cshukai/TrialPathfinder | c46b7652171f5abb535d06c3a0276e6b891bae02 | [
"MIT"
] | 27 | 2021-04-07T16:53:10.000Z | 2022-03-02T19:55:49.000Z | TrialPathfinder/shapley_computation.py | AprilCCC/TrialPathfinder | 61649369b99e7d43afdadebf4c36753b62010a7f | [
"MIT"
] | null | null | null | TrialPathfinder/shapley_computation.py | AprilCCC/TrialPathfinder | 61649369b99e7d43afdadebf4c36753b62010a7f | [
"MIT"
] | 13 | 2021-04-20T22:26:10.000Z | 2022-03-29T17:18:04.000Z | from .utils import *
def shapley_computation(cohort, features, drug_treatment, drug_control, name_rules, tolerance=0.001, iter_max=1000, covariates_cont=[], covariates_cat=[], thresh_censor=None, name_DrugName='DrugName', name_StartDate='StartDate', name_OutcomeDate='OutcomeDate', name_LastVisitDate='LastVisitDate... | 45.822581 | 352 | 0.611756 |
ad395a27912ae38cf68c862babe432a3c0548dfa | 16,349 | py | Python | third_party/logilab/astroid/brain/brain_stdlib.py | stdft112/depot_tools | 52c7211807930272424213ff6127c209de790eca | [
"BSD-3-Clause"
] | 35 | 2016-09-22T22:53:14.000Z | 2020-02-13T15:12:21.000Z | third_party/logilab/astroid/brain/brain_stdlib.py | stdft112/depot_tools | 52c7211807930272424213ff6127c209de790eca | [
"BSD-3-Clause"
] | 28 | 2020-03-04T22:01:48.000Z | 2022-03-12T00:59:47.000Z | third_party/logilab/astroid/brain/brain_stdlib.py | stdft112/depot_tools | 52c7211807930272424213ff6127c209de790eca | [
"BSD-3-Clause"
] | 88 | 2016-11-27T02:16:11.000Z | 2020-02-28T05:10:26.000Z |
"""Astroid hooks for the Python 2 standard library.
Currently help understanding of :
* hashlib.md5 and hashlib.sha1
"""
import functools
import sys
from textwrap import dedent
from astroid import (
MANAGER, UseInferenceDefault, inference_tip, BoundMethod,
InferenceError, register_module_extender)
from ast... | 34.491561 | 82 | 0.614472 |
329e56d98585b04d5e78583f1b8d8d96fef74504 | 14,503 | py | Python | resnet/ADV_ResNet.py | tropicalwzc/ice_sudoku.github.io | 5dddc1b49c1090aec211b6c4e08a771be54deefe | [
"MIT"
] | 73 | 2019-11-27T08:10:32.000Z | 2022-03-25T07:12:47.000Z | resnet/ADV_ResNet.py | tropicalwzc/ice_sudoku.github.io | 5dddc1b49c1090aec211b6c4e08a771be54deefe | [
"MIT"
] | 7 | 2020-06-27T09:46:27.000Z | 2022-03-31T02:54:35.000Z | resnet/ADV_ResNet.py | tropicalwzc/ice_sudoku.github.io | 5dddc1b49c1090aec211b6c4e08a771be54deefe | [
"MIT"
] | 13 | 2020-08-24T04:47:57.000Z | 2022-01-05T01:02:44.000Z | import torch
import torch.nn as nn
from torch.utils.model_zoo import load_url
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnext50_32x4d', 'resnext101_32x8d',
'wide_resnet50_2', 'wide_resnet101_2']
model_urls = {
'resnet18': 'https://download.pytor... | 40.853521 | 107 | 0.6338 |
96219f3cc021ad526eabcd2fc3b8224f87b3cdbc | 220 | py | Python | kdezero/datasets/__init__.py | kotabrog/K_DeZero | e8145a539874956bc235d4577fa38211c01c30ea | [
"MIT"
] | null | null | null | kdezero/datasets/__init__.py | kotabrog/K_DeZero | e8145a539874956bc235d4577fa38211c01c30ea | [
"MIT"
] | null | null | null | kdezero/datasets/__init__.py | kotabrog/K_DeZero | e8145a539874956bc235d4577fa38211c01c30ea | [
"MIT"
] | null | null | null | from kdezero.datasets.core import Dataset
from kdezero.datasets.imagenet import ImageNet
from kdezero.datasets.mnist import MNIST
from kdezero.datasets.sincurve import SinCurve
from kdezero.datasets.spiral import Spiral
| 36.666667 | 46 | 0.863636 |
f61420fbca467ad030e0228f3d5b60fdabdc5837 | 5,788 | py | Python | trivia_game.py | amm042/pytrivia-server | 7ae295899d23d1140a2649d8aff4e1859813f34f | [
"MIT"
] | null | null | null | trivia_game.py | amm042/pytrivia-server | 7ae295899d23d1140a2649d8aff4e1859813f34f | [
"MIT"
] | null | null | null | trivia_game.py | amm042/pytrivia-server | 7ae295899d23d1140a2649d8aff4e1859813f34f | [
"MIT"
] | null | null | null | import os
import random
import json
import datetime
import string
import logging
import os.path
import json
from Crypto.PublicKey import RSA
log = logging.getLogger(__name__)
def cleanstr(s, n=20):
"clean string to printable chars with max length n"
if s == None:
return "NONE"
try:
s = ... | 31.977901 | 82 | 0.521596 |
da4096cf718cb81a7f147d72d0e5fdce7b3487fb | 5,845 | py | Python | grr/test_lib/fixture_test_lib.py | Onager/grr | 646196bbfb332e4cb546b6d0fe1c09b57c675f7d | [
"Apache-2.0"
] | null | null | null | grr/test_lib/fixture_test_lib.py | Onager/grr | 646196bbfb332e4cb546b6d0fe1c09b57c675f7d | [
"Apache-2.0"
] | null | null | null | grr/test_lib/fixture_test_lib.py | Onager/grr | 646196bbfb332e4cb546b6d0fe1c09b57c675f7d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Client fixture-related test classes."""
from grr.lib import rdfvalue
from grr.lib import utils
from grr.lib.rdfvalues import client as rdf_client
from grr.lib.rdfvalues import paths as rdf_paths
from grr.lib.rdfvalues import protodict as rdf_protodict
from grr.lib.rdfvalues import structs as r... | 40.310345 | 79 | 0.679555 |
4e927233ae938e935d8b769b60e381946466051a | 310 | py | Python | Exercícios/Ex.49.py | mattheuslima/Projetos-Curso_Python | ab4cab98fe69b70245b5bcf41edd0febe823ac6a | [
"MIT"
] | null | null | null | Exercícios/Ex.49.py | mattheuslima/Projetos-Curso_Python | ab4cab98fe69b70245b5bcf41edd0febe823ac6a | [
"MIT"
] | null | null | null | Exercícios/Ex.49.py | mattheuslima/Projetos-Curso_Python | ab4cab98fe69b70245b5bcf41edd0febe823ac6a | [
"MIT"
] | null | null | null | #Refaça o desafio 9 mostrando a tabuada que o usuário escolher utilizando um laço for
print('-='*10)
print('{:=^20}'.format('Desafio 49'))
print('-='*10)
num=int(input('Qual número deseja fazer a tabuada? '))
for c in range (1,11):
multi=num*c
print('{} x {} = {}'.format(num,c,multi))
print('Fim') | 23.846154 | 85 | 0.63871 |
1ce8193af3aec26d79b3c2ed8d72fb1bd574795e | 501 | py | Python | 0674_longest_continuous_increasing_subsequence.py | subwaymatch/leetcode | 2592ba2e55682fd54d0060c5b1ff1b8469ba7916 | [
"MIT"
] | null | null | null | 0674_longest_continuous_increasing_subsequence.py | subwaymatch/leetcode | 2592ba2e55682fd54d0060c5b1ff1b8469ba7916 | [
"MIT"
] | null | null | null | 0674_longest_continuous_increasing_subsequence.py | subwaymatch/leetcode | 2592ba2e55682fd54d0060c5b1ff1b8469ba7916 | [
"MIT"
] | null | null | null | class Solution:
def findLengthOfLCIS(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if len(nums) == 0:
return 0
LCIS = 1
current_max = 1
for index, num in enumerate(nums[1:]):
if num > nums[index]:
... | 22.772727 | 46 | 0.39521 |
7bb45017fcb5e8bbcc78a244559d6370f2680dcf | 880 | py | Python | redisun/models/setmodel.py | limen/pyredisun | 11b9590968a18abbc15a4195737077360c638241 | [
"MIT"
] | null | null | null | redisun/models/setmodel.py | limen/pyredisun | 11b9590968a18abbc15a4195737077360c638241 | [
"MIT"
] | null | null | null | redisun/models/setmodel.py | limen/pyredisun | 11b9590968a18abbc15a4195737077360c638241 | [
"MIT"
] | null | null | null | from redisun.models.vectormodel import VectorModel
from redisun.querybuilder import QueryBuilder
class SetModel(VectorModel):
def _init_query_builder(self):
self._query_builder = QueryBuilder(('class', 'id', 'members'), ('id',), ':')
def create_xx(self, value, ttl=0):
pass
... | 20.952381 | 84 | 0.582955 |
1841e80f6cf04f3c4bc3402fe09228d6e1a812c7 | 673 | py | Python | manage.py | stephken/Hierarchical_assessment | 537219903357d97d1354a8f262badba9729fb5e0 | [
"MIT"
] | null | null | null | manage.py | stephken/Hierarchical_assessment | 537219903357d97d1354a8f262badba9729fb5e0 | [
"MIT"
] | null | null | null | manage.py | stephken/Hierarchical_assessment | 537219903357d97d1354a8f262badba9729fb5e0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'hierarchical_data.settings')
try:
from django.core.management import execute_from_command_line
e... | 29.26087 | 81 | 0.683507 |
7dee89e99216208cb78b402042807b0ea516db08 | 25,974 | py | Python | scripts/automation/trex_control_plane/server/trex_server.py | git-root/trex-core | 82280f7c87fabed60d83643bd9ec2c79cac34668 | [
"Apache-2.0"
] | null | null | null | scripts/automation/trex_control_plane/server/trex_server.py | git-root/trex-core | 82280f7c87fabed60d83643bd9ec2c79cac34668 | [
"Apache-2.0"
] | null | null | null | scripts/automation/trex_control_plane/server/trex_server.py | git-root/trex-core | 82280f7c87fabed60d83643bd9ec2c79cac34668 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import os
import stat
import sys
import time
import outer_packages
import zmq
from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCServer
import jsonrpclib
from jsonrpclib import Fault
import binascii
import socket
import errno
import signal
import binascii
from common.trex_status_e import TRexSt... | 49.66348 | 236 | 0.625356 |
3be979445dd55b7ed8473ed0bdf2eb3c9fd14076 | 1,644 | py | Python | src/codemetrics_report/cli.py | lpereira95/codemetrics-report | 8061f7da060c618a8e1347bd4325cd664163230d | [
"MIT"
] | null | null | null | src/codemetrics_report/cli.py | lpereira95/codemetrics-report | 8061f7da060c618a8e1347bd4325cd664163230d | [
"MIT"
] | null | null | null | src/codemetrics_report/cli.py | lpereira95/codemetrics-report | 8061f7da060c618a8e1347bd4325cd664163230d | [
"MIT"
] | null | null | null | from pathlib import Path
import click
import codemetrics as cm
from codemetrics_report.report import gather_report_info
from codemetrics_report.report import create_html_report
from codemetrics_report.report import altair2json
from codemetrics_report.vis import create_loc_chart
from codemetrics_report.vis import crea... | 28.842105 | 68 | 0.72871 |
e1b6ebd37b97bc9b109f511037c684ea5fa2de9b | 225 | py | Python | events/defaults.py | bozbalci/cython-experiments | a675571e09297e3cda9154e8b611562bb8b14f7e | [
"Unlicense"
] | 1 | 2018-06-23T17:52:20.000Z | 2018-06-23T17:52:20.000Z | events/defaults.py | bozbalci/cython-experiments | a675571e09297e3cda9154e8b611562bb8b14f7e | [
"Unlicense"
] | null | null | null | events/defaults.py | bozbalci/cython-experiments | a675571e09297e3cda9154e8b611562bb8b14f7e | [
"Unlicense"
] | null | null | null | # defaults.py: contains the built-in variables, events and methods
# used for scripting the C program
import event
events = {}
_event_names = ["on_start", "on_exit"]
for evt in _event_names:
events[evt] = event.Event()
| 22.5 | 66 | 0.724444 |
8ff48bed0ffe3bbd9640f35051ef3e5e06f97cb6 | 1,682 | py | Python | model/train-model.py | axiom-data-science/coral-spawning-detector | 2672a978a3e9bdb38565eec9fdf70a63c5b4e15a | [
"MIT"
] | 1 | 2021-06-14T18:55:41.000Z | 2021-06-14T18:55:41.000Z | model/train-model.py | axiom-data-science/coral-spawning-detector | 2672a978a3e9bdb38565eec9fdf70a63c5b4e15a | [
"MIT"
] | null | null | null | model/train-model.py | axiom-data-science/coral-spawning-detector | 2672a978a3e9bdb38565eec9fdf70a63c5b4e15a | [
"MIT"
] | null | null | null | #!python
"""Build coral spawning detection model.
Script to recreate, or train, another coral detection model that is derived
from the notebook used to create the original model used in the FWC Coral Spawning
project.
"""
import fastai.vision.all as fai_vision
def prepare_data_loader(image_dir):
"""Given path to... | 25.104478 | 82 | 0.677765 |
16c45aba544e037254d08d858c5dd2c2d0df9fe7 | 9,590 | py | Python | tensorflow/python/ops/sparse_grad.py | sachinpro/sachinpro.github.io | c3bbd8d89818f5d8bb7296c851ed5e52c19728e3 | [
"Apache-2.0"
] | 1 | 2018-01-24T12:57:47.000Z | 2018-01-24T12:57:47.000Z | tensorflow/python/ops/sparse_grad.py | sachinpro/sachinpro.github.io | c3bbd8d89818f5d8bb7296c851ed5e52c19728e3 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/sparse_grad.py | sachinpro/sachinpro.github.io | c3bbd8d89818f5d8bb7296c851ed5e52c19728e3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 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... | 36.884615 | 80 | 0.704901 |
d7ad07e8956eb58f888824957c5b1a8f74578720 | 12,321 | py | Python | ludopy/player.py | Larook/DRL_LUDO | 93e81b45d69de369efd199095bb891aef2c390e7 | [
"MIT"
] | 4 | 2020-03-29T12:12:53.000Z | 2020-08-12T14:29:25.000Z | ludopy/player.py | Larook/DRL_LUDO | 93e81b45d69de369efd199095bb891aef2c390e7 | [
"MIT"
] | null | null | null | ludopy/player.py | Larook/DRL_LUDO | 93e81b45d69de369efd199095bb891aef2c390e7 | [
"MIT"
] | 6 | 2020-09-14T15:14:41.000Z | 2021-06-14T02:35:04.000Z | import numpy as np
TOTAL_NUMBER_OF_TAILES = 60
DICE_MOVE_OUT_OF_HOME = 6
NO_ENEMY = -1
# This roule is that if, there are two pieces on the field, the last one has to return is to start
PLAY_WITH_RULE_A = True
TAILE_FREE = 0
TAILE_HOME = 1
TAILE_START = 2
TAILE_GLOB = 3
TAILE_GOAL_AREAL = 4
TAILE_STAR = 5
TAILE_GOAL... | 37.111446 | 120 | 0.627952 |
069977843cf445131a548187d37ab6c4ed815858 | 2,090 | py | Python | deep_continuation/utils.py | simonverret/deep_continuation | 986bfba7f6806dc4869a023ff1fc1d0d18324b25 | [
"MIT"
] | null | null | null | deep_continuation/utils.py | simonverret/deep_continuation | 986bfba7f6806dc4869a023ff1fc1d0d18324b25 | [
"MIT"
] | null | null | null | deep_continuation/utils.py | simonverret/deep_continuation | 986bfba7f6806dc4869a023ff1fc1d0d18324b25 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import sys
import json
import argparse
def parse_file_and_command(default_dict,
help_dict=None,
description=None,
usage=None,
argv=sys.argv,
out_dict=False,
):
parser = argparse.ArgumentParser(description=description, usage=usage)
params_dict = {}
... | 33.174603 | 120 | 0.617703 |
7882af3fe33d7dea4a705657c4cea2bcdeded95d | 2,001 | py | Python | migrations/versions/13241b3d4bfb_a_init.py | futheads/flask-restful | 56e9a12b7a9133504ee16a7f75d4c995c137b981 | [
"Apache-2.0"
] | 10 | 2019-05-23T15:18:15.000Z | 2020-02-26T03:52:29.000Z | migrations/versions/13241b3d4bfb_a_init.py | rymmx-gls/flask-restful | 56e9a12b7a9133504ee16a7f75d4c995c137b981 | [
"Apache-2.0"
] | null | null | null | migrations/versions/13241b3d4bfb_a_init.py | rymmx-gls/flask-restful | 56e9a12b7a9133504ee16a7f75d4c995c137b981 | [
"Apache-2.0"
] | 2 | 2019-07-26T02:17:08.000Z | 2019-09-29T12:10:13.000Z | """【A】init
Revision ID: 13241b3d4bfb
Revises:
Create Date: 2019-05-21 17:52:43.088951
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '13241b3d4bfb'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated ... | 33.35 | 97 | 0.676662 |
33a7340d74aa09827b2cc23d352cb61a00699f44 | 8,972 | py | Python | weasyprint/layout/float.py | mousetail/WeasyPrint | 9e82904ceb8b5c60331d0ce2b1d23aa48b54b514 | [
"BSD-3-Clause"
] | null | null | null | weasyprint/layout/float.py | mousetail/WeasyPrint | 9e82904ceb8b5c60331d0ce2b1d23aa48b54b514 | [
"BSD-3-Clause"
] | null | null | null | weasyprint/layout/float.py | mousetail/WeasyPrint | 9e82904ceb8b5c60331d0ce2b1d23aa48b54b514 | [
"BSD-3-Clause"
] | null | null | null | """
weasyprint.float
----------------
Layout for floating boxes.
"""
from ..formatting_structure import boxes
from .min_max import handle_min_max_width
from .percentages import resolve_percentages, resolve_position_percentages
from .preferred import shrink_to_fit
from .tables import table_wrapper_width
... | 39.699115 | 126 | 0.644338 |
7d563cae7c4ced07ca8c8ce57f219596c27493bc | 811 | py | Python | homeassistant/components/local_ip/config_flow.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 6 | 2016-11-25T06:36:27.000Z | 2021-11-16T11:20:23.000Z | homeassistant/components/local_ip/config_flow.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 60 | 2020-07-06T15:10:30.000Z | 2022-03-31T06:01:46.000Z | homeassistant/components/local_ip/config_flow.py | klauern/home-assistant-core | c18ba6aec0627e6afb6442c678edb5ff2bb17db6 | [
"Apache-2.0"
] | 14 | 2018-08-19T16:28:26.000Z | 2021-09-02T18:26:53.000Z | """Config flow for local_ip."""
from homeassistant import config_entries
from .const import DOMAIN
class SimpleConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
"""Handle a config flow for local_ip."""
VERSION = 1
CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_POLL
async def async_step_use... | 28.964286 | 69 | 0.710234 |
9fe972172373209f12cc00a1f15baa8ea58c9aa5 | 7,704 | py | Python | idataapi_transform/DataProcess/DataWriter/MySQLWriter.py | markqiu/idataapi-transform | f02008745331c58f85bb1b9073aa49da25c41467 | [
"MIT"
] | 41 | 2018-01-08T07:11:04.000Z | 2021-03-23T03:56:53.000Z | idataapi_transform/DataProcess/DataWriter/MySQLWriter.py | baifengbai/idataapi-transform | 537a5998e6c089bc4d71be492ea3b963cc2662d8 | [
"MIT"
] | 4 | 2019-04-04T12:23:00.000Z | 2021-07-23T06:13:58.000Z | idataapi_transform/DataProcess/DataWriter/MySQLWriter.py | baifengbai/idataapi-transform | 537a5998e6c089bc4d71be492ea3b963cc2662d8 | [
"MIT"
] | 15 | 2019-03-06T02:48:14.000Z | 2021-12-16T11:29:40.000Z | import json
import asyncio
import random
import logging
import traceback
from .BaseWriter import BaseWriter
class MySQLWriter(BaseWriter):
def __init__(self, config):
super().__init__()
self.config = config
self.total_miss_count = 0
self.success_count = 0
self.table_checked... | 39.507692 | 131 | 0.535177 |
ca5fd3530f13674255e6be70e2ff86f7fe4d2184 | 1,468 | py | Python | src/dissues.py | MorganShorter/drop | a6aef148fd6a99b6380535882fd8bd20a844468f | [
"BSD-2-Clause"
] | 5 | 2015-11-07T03:03:48.000Z | 2020-06-27T00:43:38.000Z | src/dissues.py | MorganShorter/drop | a6aef148fd6a99b6380535882fd8bd20a844468f | [
"BSD-2-Clause"
] | 7 | 2015-04-03T00:04:20.000Z | 2021-07-08T19:40:00.000Z | src/dissues.py | MorganShorter/drop | a6aef148fd6a99b6380535882fd8bd20a844468f | [
"BSD-2-Clause"
] | 9 | 2015-04-02T22:52:26.000Z | 2020-06-27T00:43:43.000Z | #!/usr/bin/env python
#
# Copyright (c) 2019, 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,
# this ... | 45.875 | 78 | 0.77248 |
8ef0e6ad76d2d04974ed4f25d94cbe0d5a18224c | 6,030 | py | Python | apprest/plugins/icat/services/ICAT.py | dario-palmisano/calipsoplus-backend | 9872b6fb4fc089fc6c0879491703bd611c245369 | [
"MIT"
] | null | null | null | apprest/plugins/icat/services/ICAT.py | dario-palmisano/calipsoplus-backend | 9872b6fb4fc089fc6c0879491703bd611c245369 | [
"MIT"
] | null | null | null | apprest/plugins/icat/services/ICAT.py | dario-palmisano/calipsoplus-backend | 9872b6fb4fc089fc6c0879491703bd611c245369 | [
"MIT"
] | null | null | null | import requests
import json
import dateutil.parser
from apprest.plugins.icat.models.calipso_experiment import CalipsoExperiment
from apprest.plugins.icat.models.calipso_session import CalipsoSession
from apprest.plugins.icat.models.calipso_investigation_user import CalipsoInvestigationUser
from calipsoplus.settings_c... | 45 | 116 | 0.648093 |
6d284b0ccdec1af20f39ccbddb7c0daec090a3e0 | 48 | py | Python | main.py | Vasili999/data-science-from-scratch | 8ce5685a68acd50aecbee924069679c5faa4da18 | [
"MIT"
] | null | null | null | main.py | Vasili999/data-science-from-scratch | 8ce5685a68acd50aecbee924069679c5faa4da18 | [
"MIT"
] | null | null | null | main.py | Vasili999/data-science-from-scratch | 8ce5685a68acd50aecbee924069679c5faa4da18 | [
"MIT"
] | null | null | null | import scratch.linear_algebra as ln
print(ln.B) | 16 | 35 | 0.8125 |
ad4f0bbf85ce20b7158f88350fac475cd31df8ac | 6,611 | py | Python | freeipa/komand_freeipa/actions/find_user/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | freeipa/komand_freeipa/actions/find_user/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | freeipa/komand_freeipa/actions/find_user/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Input:
SEARCH_PARAMETERS = "search_parameters"
class Output:
FULL_MESSAGE = "full_message"
USERS = "users"
class FindUserInput(komand.Input):
schema = json.loads("""
{
"type": "object",
"title": "Variables",
"... | 23.610714 | 129 | 0.399486 |
94d235ab6305d1cda15a93984502b88d935c2a2d | 740 | py | Python | workflow/scripts/split_haplotagged_bam.py | dancooke/syntumorsizer | c3c4e278796efced2afc1bf3e6bf27948d6d42e0 | [
"MIT"
] | null | null | null | workflow/scripts/split_haplotagged_bam.py | dancooke/syntumorsizer | c3c4e278796efced2afc1bf3e6bf27948d6d42e0 | [
"MIT"
] | null | null | null | workflow/scripts/split_haplotagged_bam.py | dancooke/syntumorsizer | c3c4e278796efced2afc1bf3e6bf27948d6d42e0 | [
"MIT"
] | null | null | null | from pathlib import Path
import numpy as np
import pysam as ps
def get_haplotype_ids(read):
try:
return tuple([int(id) for id in read.get_tag('HP').split(',')])
except KeyError:
return None
def split_bam(in_bam_path, out_bam_paths):
in_bam = ps.AlignmentFile(in_bam_path)
out_bams = [ps... | 30.833333 | 86 | 0.678378 |
258a51f083823aebc2e2f6f66a3cc35f7e16d6a3 | 542 | py | Python | Registration system.py | mdhasan8/Problem_Solving | ac18f30ecc7d1baa4cea382c53aec16a544530be | [
"MIT"
] | null | null | null | Registration system.py | mdhasan8/Problem_Solving | ac18f30ecc7d1baa4cea382c53aec16a544530be | [
"MIT"
] | null | null | null | Registration system.py | mdhasan8/Problem_Solving | ac18f30ecc7d1baa4cea382c53aec16a544530be | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Aug 17 12:00:12 2021
@author: Easin
"""
in1 = input()
in1 = int(in1)
list1 = []
for elem in range(in1):
in2 = input()
if in2 not in list1:
print("OK")
else:
count = list1.count(in2)
var = in2+ (str(count))
... | 16.424242 | 36 | 0.416974 |
3644e6482d732c07f3ab7e319365f64d51a11a9a | 1,024 | py | Python | webpage/management/commands/delete_migrations.py | csae8092/djtranskribus | efd73f5ad5752201da4df9020043db020e942e85 | [
"MIT"
] | 2 | 2021-06-02T11:27:54.000Z | 2021-08-25T10:29:04.000Z | webpage/management/commands/delete_migrations.py | csae8092/djtranskribus | efd73f5ad5752201da4df9020043db020e942e85 | [
"MIT"
] | 86 | 2021-01-29T12:31:34.000Z | 2022-03-28T11:41:04.000Z | webpage/management/commands/delete_migrations.py | acdh-oeaw/nabucco | 37286484cc512c4f738db34a47c8ae5fb1c555d2 | [
"MIT"
] | 2 | 2020-09-03T14:49:42.000Z | 2021-02-25T10:02:55.000Z | import os
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
cwd = settings.BASE_DIR
class Command(BaseCommand):
# Show this when the user types help
help = "Deletes all migration files of the current project"
# A command must define handle()
def handl... | 36.571429 | 97 | 0.574219 |
f0fa542f14f23b66c0a747573f308672c37a3467 | 19,497 | py | Python | ObitSystem/ObitSD/python/CleanOTF.py | sarrvesh/Obit | e4ce6029e9beb2a8c0316ee81ea710b66b2b7986 | [
"Linux-OpenIB"
] | 5 | 2019-08-26T06:53:08.000Z | 2020-10-20T01:08:59.000Z | ObitSystem/ObitSD/python/CleanOTF.py | sarrvesh/Obit | e4ce6029e9beb2a8c0316ee81ea710b66b2b7986 | [
"Linux-OpenIB"
] | null | null | null | ObitSystem/ObitSD/python/CleanOTF.py | sarrvesh/Obit | e4ce6029e9beb2a8c0316ee81ea710b66b2b7986 | [
"Linux-OpenIB"
] | 8 | 2017-08-29T15:12:32.000Z | 2022-03-31T12:16:08.000Z | """ This class is for performing CLEAN on images.
This implements an OTF image plane CLEAN
It is mostly appropriate for single dish images where the support of
the dirty beam is extremely limited.
There are no restrictions on the relative sizes of the dirty image and beam.
Arguments to the constructor:
name - Name ... | 34.630551 | 104 | 0.569113 |
949308565bd51f9ab949ff3b4ad199287a216473 | 121 | py | Python | Code/Fig3d/RunDesignC.py | DMREF-Hydrogel-actuated-soft-robotics/sponges | a27c45dbed59efb5f79318beee1b72bba7adbd91 | [
"MIT"
] | 4 | 2020-11-09T07:20:36.000Z | 2022-01-11T13:19:03.000Z | Code/Fig3d/RunDesignC.py | guojiyu/sponge-lattice | acd046dbe69b1eb3882016d533006926219a2393 | [
"MIT"
] | null | null | null | Code/Fig3d/RunDesignC.py | guojiyu/sponge-lattice | acd046dbe69b1eb3882016d533006926219a2393 | [
"MIT"
] | 2 | 2021-01-14T12:41:40.000Z | 2021-01-14T13:21:17.000Z | import numpy as np
DesignB=False
DesignA=False
DesignC=True
allAngles=np.linspace(0,45,46)
execfile('Analysis.py')
| 9.307692 | 30 | 0.760331 |
9c80c3f62d56850e1374c9eaf22a7cb30576892c | 11,260 | py | Python | betdaq/resources/marketdataresources.py | ScoreX/betdaq | 408ccb6f2e3ebf9acc4dc585d6b9092d6ae615f0 | [
"MIT"
] | 13 | 2017-07-17T22:57:09.000Z | 2022-03-25T05:19:04.000Z | betdaq/resources/marketdataresources.py | liampauling/betdaq | 4b09c4b979665e1841de42ee3c4fe154ba3e3966 | [
"MIT"
] | 10 | 2017-07-25T12:01:30.000Z | 2021-08-03T15:17:03.000Z | betdaq/resources/marketdataresources.py | liampauling/betdaq | 4b09c4b979665e1841de42ee3c4fe154ba3e3966 | [
"MIT"
] | 11 | 2017-09-04T18:30:48.000Z | 2021-07-26T09:04:50.000Z |
import bisect
from betdaq.utils import make_tz_naive, price_side_map, floatify
from betdaq.enums import MarketType, MarketStatus, SelectionStatus, Polarity
def parse_deep_markets(sports):
markets = []
for sport in sports:
events = sport.get('EventClassifiers')
sub_events = []
while e... | 51.889401 | 118 | 0.585524 |
bfe18c5e041fa7a5c0199b471c04d7d57323655a | 64 | py | Python | osm/__init__.py | dcopm999/django-osm | 7a5d87a4e64292b7726d4401f529020ead732c77 | [
"MIT"
] | 7 | 2021-08-19T07:18:21.000Z | 2021-09-13T19:39:18.000Z | osm/__init__.py | dcopm999/django-osm | 7a5d87a4e64292b7726d4401f529020ead732c77 | [
"MIT"
] | 5 | 2021-04-22T06:42:42.000Z | 2021-09-11T15:21:22.000Z | osm/__init__.py | dcopm999/django-osm | 7a5d87a4e64292b7726d4401f529020ead732c77 | [
"MIT"
] | null | null | null | __version__ = "0.1.0"
default_app_config = "osm.apps.OsmConfig"
| 21.333333 | 41 | 0.75 |
016e92b2ae7af156c6a1f0e7172f4512ff9944ef | 3,333 | py | Python | metashare/repository/editor/forms.py | zeehio/META-SHARE | b796769629734353a63d98db72c84617f725e544 | [
"BSD-3-Clause"
] | 11 | 2015-07-13T13:36:44.000Z | 2021-11-15T08:07:25.000Z | metashare/repository/editor/forms.py | zeehio/META-SHARE | b796769629734353a63d98db72c84617f725e544 | [
"BSD-3-Clause"
] | 13 | 2015-03-21T14:08:31.000Z | 2021-05-18T18:47:58.000Z | metashare/repository/editor/forms.py | zeehio/META-SHARE | b796769629734353a63d98db72c84617f725e544 | [
"BSD-3-Clause"
] | 12 | 2015-01-07T02:16:50.000Z | 2021-05-18T08:25:31.000Z | import logging
from xml.etree.ElementTree import fromstring
from django import forms
from django.core.exceptions import ValidationError
from metashare.storage.models import ALLOWED_ARCHIVE_EXTENSIONS
from metashare.settings import LOG_HANDLER, MAXIMUM_UPLOAD_SIZE
from zipfile import is_zipfile
# Setup logging suppor... | 33.666667 | 84 | 0.680768 |
09dcce2dab4bedc4c1b8ba5e41b6059e598c792a | 549 | py | Python | sample/Test_Sample3.py | BlueYangDroid/test-python-appium-android | 1a5fac08ddc8c8738092ae7ee341c29bdfd63da2 | [
"MIT"
] | 1 | 2018-08-30T06:59:00.000Z | 2018-08-30T06:59:00.000Z | sample/Test_Sample3.py | BlueYangDroid/test-python-appium-android | 1a5fac08ddc8c8738092ae7ee341c29bdfd63da2 | [
"MIT"
] | null | null | null | sample/Test_Sample3.py | BlueYangDroid/test-python-appium-android | 1a5fac08ddc8c8738092ae7ee341c29bdfd63da2 | [
"MIT"
] | 1 | 2020-01-08T14:10:43.000Z | 2020-01-08T14:10:43.000Z | #!/usr/bin/env python
# _*_ coding:utf-8 _*_
import pytest
from sample.Test_Sample0 import TestSample0
class TestSample3(TestSample0):
# def test_answer1(self, fixtrue_env):
# print('test_answer2.1: get fixtrue_env %s' % fixtrue_env)
# assert fixtrue_env == 10
#
# def test_answer_2(self... | 24.954545 | 67 | 0.657559 |
4503488d95a1128d215e90ff2279a862e5423434 | 17,706 | py | Python | cinder/volume/drivers/netapp/api.py | cloudbau/cinder | 3179f2f42ae940a08b910e326a809556689864d8 | [
"Apache-2.0"
] | null | null | null | cinder/volume/drivers/netapp/api.py | cloudbau/cinder | 3179f2f42ae940a08b910e326a809556689864d8 | [
"Apache-2.0"
] | null | null | null | cinder/volume/drivers/netapp/api.py | cloudbau/cinder | 3179f2f42ae940a08b910e326a809556689864d8 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 NetApp, Inc.
# Copyright (c) 2012 OpenStack Foundation
# 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 L... | 36.73444 | 79 | 0.606687 |
ebdfb8d8a38bd2977bbdcf3a231728fbb918a6ab | 1,209 | py | Python | config.py | Lechatelia/video_feature_extractor | 6530c530cfc0f13b3d64e9fa7fbe9f6068545bfd | [
"MIT"
] | 56 | 2019-07-02T01:30:48.000Z | 2022-03-31T03:13:20.000Z | torchOnVideo/cleanup/pytorch-video-feature-extractor/config.py | torchOnVideo/torchOnVideo | aa07d5661f772eca027ecc6b79e14bd68a515aa1 | [
"MIT"
] | 8 | 2019-10-12T11:25:26.000Z | 2021-10-15T14:28:13.000Z | config.py | chldydgh4687/pytorch-video-feature-extractor | 1128768ae7c113286b664340c45c6e85a8560027 | [
"MIT"
] | 17 | 2019-10-12T11:12:21.000Z | 2022-03-31T14:22:45.000Z | from abc import ABC
from collections import defaultdict
class AbstractConfig(ABC):
@property
def checkpoint_path(self):
raise NotImplementedError("You should defined 'checkpoint_path'.")
@property
def mean(self):
raise NotImplementedError("You should defined 'mean'.")
@property
... | 22.388889 | 74 | 0.636063 |
b1bd65516fa34944b643afc693e4908210cc742c | 3,858 | py | Python | test/test_errorcode.py | maxhgerlach/mpi4py | 4cebe0d45ee60bc7198dedc425adffee3e86bc7b | [
"BSD-2-Clause"
] | 533 | 2015-03-02T05:16:27.000Z | 2022-03-28T09:44:37.000Z | test/test_errorcode.py | maxhgerlach/mpi4py | 4cebe0d45ee60bc7198dedc425adffee3e86bc7b | [
"BSD-2-Clause"
] | 105 | 2017-09-17T07:50:33.000Z | 2022-03-29T17:27:43.000Z | test/test_errorcode.py | maxhgerlach/mpi4py | 4cebe0d45ee60bc7198dedc425adffee3e86bc7b | [
"BSD-2-Clause"
] | 98 | 2015-02-03T03:17:52.000Z | 2022-03-23T02:03:11.000Z | from mpi4py import MPI
import mpiunittest as unittest
class TestErrorCode(unittest.TestCase):
errorclasses = [item[1] for item in vars(MPI).items()
if item[0].startswith('ERR_')]
errorclasses.insert(0, MPI.SUCCESS)
errorclasses.remove(MPI.ERR_LASTCODE)
def testGetErrorClass(self)... | 40.610526 | 72 | 0.632193 |
210d98f96b464f9dca7c11e38c77e2858f99cab2 | 4,452 | py | Python | tests/unit/unit_test_retry.py | kellrott/synapsePythonClient | 8af4b89a95140fafca2e98af2768423c3ea949fc | [
"Apache-2.0"
] | null | null | null | tests/unit/unit_test_retry.py | kellrott/synapsePythonClient | 8af4b89a95140fafca2e98af2768423c3ea949fc | [
"Apache-2.0"
] | null | null | null | tests/unit/unit_test_retry.py | kellrott/synapsePythonClient | 8af4b89a95140fafca2e98af2768423c3ea949fc | [
"Apache-2.0"
] | null | null | null | import filecmp
import tempfile
import os
from nose.tools import assert_raises
from synapseclient.retry import RetryRequest
from synapseclient.dict_object import DictObject
def setup():
print '\n'
print '~' * 60
print os.path.basename(__file__)
print '~' * 60
class MyException(Exception):
"""Mock... | 31.132867 | 114 | 0.641509 |
b78e8c254b776841ad02ffdfe9f9d510645c0ecb | 26,715 | py | Python | wsgidav/server/server_cli.py | zouquan741/wsgidav | 6fcdf7d8cb2951c1f651ee695feb866ef4cf0683 | [
"MIT"
] | null | null | null | wsgidav/server/server_cli.py | zouquan741/wsgidav | 6fcdf7d8cb2951c1f651ee695feb866ef4cf0683 | [
"MIT"
] | null | null | null | wsgidav/server/server_cli.py | zouquan741/wsgidav | 6fcdf7d8cb2951c1f651ee695feb866ef4cf0683 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
server_cli
==========
:Author: Martin Wendt
:Copyright: Licensed under the MIT license, see LICENSE file in this package.
Standalone server that runs WsgiDAV.
These tasks are performed:
- Set up the configuration from defaults, configuration file, and command line
options.
... | 32.186747 | 102 | 0.619727 |
8d73ceb6277f3a5ca9727d2ac29fb3c17eca8152 | 12,741 | py | Python | tools/pull_api.py | munoztd0/IQMGraphs | 492d5c828b9b5e6ffe9639f1c099eb1297b303b3 | [
"MIT"
] | 2 | 2020-11-05T11:12:29.000Z | 2021-09-28T18:02:58.000Z | BIDS/MRIQC/tools/pull_api.py | munoztd0/OBIWAN | f0301e8ae972d75bfb96a7b7f6b9672201b621ee | [
"CC0-1.0"
] | null | null | null | BIDS/MRIQC/tools/pull_api.py | munoztd0/OBIWAN | f0301e8ae972d75bfb96a7b7f6b9672201b621ee | [
"CC0-1.0"
] | null | null | null | import json
import requests
import re
import pandas as pd
import dateparser
from urllib.request import urlopen
from pandas.io.json import json_normalize
def backend_query_api(stype, filters):
""" Query the MRIQC API using 3 element conditional statement.
Args:
stype (string): Scan type. Supported: ... | 31.69403 | 221 | 0.591241 |
2c31aa9c12e7d42b14f4f8ed5b37e9c011cc847f | 2,744 | py | Python | src/sentry/api/endpoints/project_rule_details.py | apragacz/sf-sentry | 2fdd6c1195c29a1d401d1cd538c22ea68556699a | [
"BSD-3-Clause"
] | 1 | 2018-03-05T15:40:12.000Z | 2018-03-05T15:40:12.000Z | src/sentry/api/endpoints/project_rule_details.py | pkaminski/sentry | 27e948283e27d93ca5192ca7b580830e092c25c7 | [
"BSD-3-Clause"
] | 5 | 2020-07-17T11:20:41.000Z | 2021-05-09T12:16:53.000Z | src/sentry/api/endpoints/project_rule_details.py | zaasmi/codeerrorhelp | 1ab8d3e314386b9b2d58dad9df45355bf6014ac9 | [
"BSD-3-Clause"
] | 2 | 2021-01-26T09:53:39.000Z | 2022-03-22T09:01:47.000Z | from __future__ import absolute_import
from rest_framework import status
from rest_framework.response import Response
from sentry.api.bases.project import ProjectEndpoint, ProjectSettingPermission
from sentry.api.serializers import serialize
from sentry.api.serializers.rest_framework import RuleSerializer
from sentry... | 29.505376 | 90 | 0.587464 |
7e7615c3932225cadf7e6d5c9d4ac6c4a7abd714 | 2,030 | py | Python | 2_DeepLearning-Keras/01_Keras_Boston_Dataset_Regression/network.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 2_DeepLearning-Keras/01_Keras_Boston_Dataset_Regression/network.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 2_DeepLearning-Keras/01_Keras_Boston_Dataset_Regression/network.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | import os
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.keras.datasets import boston_housing
from tensorflow.keras.layers import *
from tensorflow.keras.activations import *
from tensorflow.keras.models import *
from tensorflow.keras.optimizers import *
from tensorflow.ker... | 29.42029 | 108 | 0.757635 |
0e0a060c49cbcaa9245b858ddbeeb88f20fba6e8 | 2,059 | py | Python | homeassistant/util/distance.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 6 | 2017-08-02T19:26:39.000Z | 2020-03-14T22:47:41.000Z | homeassistant/util/distance.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 58 | 2020-08-03T07:33:02.000Z | 2022-03-31T06:02:05.000Z | homeassistant/util/distance.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 14 | 2018-08-19T16:28:26.000Z | 2021-09-02T18:26:53.000Z | """Distance util functions."""
from numbers import Number
from typing import Callable, Dict
from homeassistant.const import (
LENGTH,
LENGTH_CENTIMETERS,
LENGTH_FEET,
LENGTH_INCHES,
LENGTH_KILOMETERS,
LENGTH_METERS,
LENGTH_MILES,
LENGTH_MILLIMETERS,
LENGTH_YARD,
UNIT_NOT_RECOGNI... | 30.279412 | 77 | 0.71151 |
fc9b11d0b00cef74b0cd59b2601562a1a9b2c117 | 608 | py | Python | env/lib/python3.8/site-packages/plotly/validators/choropleth/colorbar/_tickmode.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/choropleth/colorbar/_tickmode.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/choropleth/colorbar/_tickmode.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class TickmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="tickmode", parent_name="choropleth.colorbar", **kwargs
):
super(TickmodeValidator, self).__init__(
plotly_name=plotly_name,
pa... | 35.764706 | 81 | 0.628289 |
a97e8c65d0664ba462bef59b6b9b1c171bdefb52 | 12,176 | py | Python | training/training_code/deeplab/vis.py | yil532/MAX-Image-Segmenter | a9e51645061f15b49b71bf1d7c6682c59843517b | [
"Apache-2.0"
] | 34 | 2018-07-11T23:38:45.000Z | 2022-03-29T03:06:26.000Z | training/training_code/deeplab/vis.py | yil532/MAX-Image-Segmenter | a9e51645061f15b49b71bf1d7c6682c59843517b | [
"Apache-2.0"
] | 48 | 2018-07-30T19:15:49.000Z | 2022-03-11T23:59:24.000Z | training/training_code/deeplab/vis.py | yil532/MAX-Image-Segmenter | a9e51645061f15b49b71bf1d7c6682c59843517b | [
"Apache-2.0"
] | 23 | 2018-07-30T20:29:26.000Z | 2021-12-27T08:21:12.000Z | # Copyright 2018 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 applicab... | 38.900958 | 80 | 0.687582 |
18ab570289aa5e765be96a05a2bb697f8e8139c8 | 3,720 | py | Python | Bio/SCOP/Dom.py | barwil/biopython | 477a5efc1325d5158ac1d7bbd11adcb8efe9ed5e | [
"PostgreSQL"
] | 1 | 2016-05-09T08:14:49.000Z | 2016-05-09T08:14:49.000Z | Bio/SCOP/Dom.py | barwil/biopython | 477a5efc1325d5158ac1d7bbd11adcb8efe9ed5e | [
"PostgreSQL"
] | null | null | null | Bio/SCOP/Dom.py | barwil/biopython | 477a5efc1325d5158ac1d7bbd11adcb8efe9ed5e | [
"PostgreSQL"
] | 6 | 2020-02-26T16:34:20.000Z | 2020-03-04T15:34:00.000Z | # Copyright 2000 by Jeffrey Chang. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
# Gavin E. Crooks 2001-11-07 :
# Interface and comments modified to reflect changes to the... | 30.243902 | 122 | 0.607527 |
a3da2b9d3e5d066dc5249b2b87a3ad92a434bfcf | 12,422 | py | Python | ui/app/base/routes.py | ccamacho/kubeinit | d9098b6545627074cf83f5c9a56ad752995dea30 | [
"Apache-2.0"
] | 36 | 2020-08-01T07:31:15.000Z | 2020-09-04T05:39:32.000Z | ui/app/base/routes.py | ccamacho/kubeinit | d9098b6545627074cf83f5c9a56ad752995dea30 | [
"Apache-2.0"
] | 9 | 2020-08-03T17:07:29.000Z | 2020-08-28T14:26:53.000Z | ui/app/base/routes.py | ccamacho/kubeinit | d9098b6545627074cf83f5c9a56ad752995dea30 | [
"Apache-2.0"
] | 14 | 2020-08-02T01:07:37.000Z | 2020-08-25T13:14:02.000Z | #!/usr/bin/env python
"""
Copyright kubeinit contributors.
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 ... | 28.360731 | 109 | 0.636612 |
5701fc98039f80a6a91273b94ae5eea8fb43af1e | 21,003 | py | Python | research/object_detection/data_decoders/tf_example_decoder.py | taegoobot/models | 2c54560546b17d3766a12f248e5a57f5e65995a8 | [
"Apache-2.0"
] | null | null | null | research/object_detection/data_decoders/tf_example_decoder.py | taegoobot/models | 2c54560546b17d3766a12f248e5a57f5e65995a8 | [
"Apache-2.0"
] | null | null | null | research/object_detection/data_decoders/tf_example_decoder.py | taegoobot/models | 2c54560546b17d3766a12f248e5a57f5e65995a8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 44.216842 | 80 | 0.681236 |
67400ce0472de79088f7836ac4dd8ba84158a812 | 27,252 | py | Python | pytorch_lightning/loops/epoch/training_epoch_loop.py | caillonantoine/pytorch-lightning | 8676d8026480b55ab8aa343a80e237c5de0a7802 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/loops/epoch/training_epoch_loop.py | caillonantoine/pytorch-lightning | 8676d8026480b55ab8aa343a80e237c5de0a7802 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/loops/epoch/training_epoch_loop.py | caillonantoine/pytorch-lightning | 8676d8026480b55ab8aa343a80e237c5de0a7802 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# 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 i... | 45.495826 | 120 | 0.663804 |
b00e67aa53174756381a2d974545f8c2c7d3fb18 | 802 | py | Python | oo/pessoa.py | Cleiton2308/pythonbirds | a9fd2238f28572bb76794244d36ca44c2b39b1fd | [
"MIT"
] | null | null | null | oo/pessoa.py | Cleiton2308/pythonbirds | a9fd2238f28572bb76794244d36ca44c2b39b1fd | [
"MIT"
] | null | null | null | oo/pessoa.py | Cleiton2308/pythonbirds | a9fd2238f28572bb76794244d36ca44c2b39b1fd | [
"MIT"
] | null | null | null | class Pessoa:
olhos = 2
def __init__(self, *filhos, nome = None, idade = 33):
self.idade = idade
self.nome = nome
self.filhos = list(filhos)
def cumprimentar(self):
return f'Olá {id(self)}'
if __name__ == '__main__':
cleiton = Pessoa(nome = 'Cleiton')
renzo = Pess... | 21.675676 | 63 | 0.63217 |
25507d28c9498680dafca216a70ee9de671a8e9f | 2,046 | py | Python | azure-common/setup.py | SUSE/azure-sdk-for-python | 324f99d26dd6f4ee9793b9bf1d4d5f928e4b6c2f | [
"MIT"
] | 2 | 2020-07-29T14:22:17.000Z | 2020-11-06T18:47:40.000Z | azure-common/setup.py | SUSE/azure-sdk-for-python | 324f99d26dd6f4ee9793b9bf1d4d5f928e4b6c2f | [
"MIT"
] | 1 | 2016-08-01T07:37:04.000Z | 2016-08-01T07:37:04.000Z | azure-common/setup.py | SUSE/azure-sdk-for-python | 324f99d26dd6f4ee9793b9bf1d4d5f928e4b6c2f | [
"MIT"
] | 1 | 2020-12-12T21:04:41.000Z | 2020-12-12T21:04:41.000Z | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------... | 30.537313 | 75 | 0.581623 |
0615cb45c8eb25e167781401939256a746c545e2 | 9,021 | py | Python | vumi/demos/tests/test_hangman.py | rapidsms/vumi | f15c101b599cc1283c84592e8707b6a929f67cbd | [
"BSD-3-Clause"
] | null | null | null | vumi/demos/tests/test_hangman.py | rapidsms/vumi | f15c101b599cc1283c84592e8707b6a929f67cbd | [
"BSD-3-Clause"
] | null | null | null | vumi/demos/tests/test_hangman.py | rapidsms/vumi | f15c101b599cc1283c84592e8707b6a929f67cbd | [
"BSD-3-Clause"
] | 2 | 2018-03-05T18:01:45.000Z | 2019-11-02T19:34:18.000Z | # -*- encoding: utf-8 -*-
"""Tests for vumi.demos.hangman."""
from twisted.trial import unittest
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.internet import reactor
from twisted.web.server import Site
from twisted.web.resource import Resource
from twisted.web.static import Data
from ... | 35.376471 | 78 | 0.594834 |
8604f5df6a1fe1e070933d7e6ac53d16097d4185 | 393 | py | Python | subjects/models.py | unt-libraries/django-subjects | 96f00a3d7aebf1554359cf8ab151b163c52a9ad1 | [
"BSD-3-Clause"
] | null | null | null | subjects/models.py | unt-libraries/django-subjects | 96f00a3d7aebf1554359cf8ab151b163c52a9ad1 | [
"BSD-3-Clause"
] | 9 | 2018-10-17T18:16:44.000Z | 2020-11-30T20:16:39.000Z | subjects/models.py | unt-libraries/django-subjects | 96f00a3d7aebf1554359cf8ab151b163c52a9ad1 | [
"BSD-3-Clause"
] | 2 | 2018-10-30T21:10:50.000Z | 2018-10-30T21:14:20.000Z | from django.db import models
# subjects Model
class Subject(models.Model):
name = models.TextField(editable=False)
parent = models.IntegerField(editable=False, default=0)
lft = models.IntegerField('left Traversal')
rght = models.IntegerField('right Traversal')
keywords = models.TextField()
not... | 26.2 | 59 | 0.707379 |
e20e4bcf0840e89d7b7278eb31123aecc743c906 | 11,198 | py | Python | redun/backends/db/alembic/versions/806f5dcb11bf_initial_schema.py | cclauss/redun | 55792921b42b430571eafc30ab21eb50eb4f64b3 | [
"Apache-2.0"
] | 303 | 2021-11-04T00:19:48.000Z | 2022-03-31T18:44:02.000Z | redun/backends/db/alembic/versions/806f5dcb11bf_initial_schema.py | cclauss/redun | 55792921b42b430571eafc30ab21eb50eb4f64b3 | [
"Apache-2.0"
] | 16 | 2021-11-05T20:30:48.000Z | 2022-03-30T22:21:19.000Z | redun/backends/db/alembic/versions/806f5dcb11bf_initial_schema.py | cclauss/redun | 55792921b42b430571eafc30ab21eb50eb4f64b3 | [
"Apache-2.0"
] | 14 | 2021-11-04T19:56:57.000Z | 2022-02-20T16:23:19.000Z | """initial schema
Revision ID: 806f5dcb11bf
Revises:
Create Date: 2020-05-01 10:10:30.843894
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "806f5dcb11bf"
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gener... | 40.136201 | 97 | 0.623236 |
cc863906effbf7ff091c4777e15d349679c97080 | 2,289 | py | Python | tests/functional/pages/profile/case_study_basic.py | mayank-sfdc/directory-tests | 6e978bc1a27c19389e99e454143122aa27e47b85 | [
"MIT"
] | 4 | 2017-06-02T09:09:10.000Z | 2018-01-25T19:06:12.000Z | tests/functional/pages/profile/case_study_basic.py | mayank-sfdc/directory-tests | 6e978bc1a27c19389e99e454143122aa27e47b85 | [
"MIT"
] | 53 | 2016-10-27T22:31:03.000Z | 2022-03-07T11:18:25.000Z | tests/functional/pages/profile/case_study_basic.py | mayank-sfdc/directory-tests | 6e978bc1a27c19389e99e454143122aa27e47b85 | [
"MIT"
] | 3 | 2017-11-22T11:42:40.000Z | 2022-02-21T01:20:04.000Z | # -*- coding: utf-8 -*-
"""Profile - Add Case Study - Basics details page"""
import logging
from requests import Response, Session
from directory_tests_shared import PageType, Service, URLs
from tests.functional.utils.context_utils import CaseStudy
from tests.functional.utils.request import Method, check_response, ma... | 35.765625 | 84 | 0.714723 |
e02944ff9ede745b9816c5794f8ae0b853eaa7df | 751 | py | Python | pip_api/_hash.py | sugatoray/pip-api | dec3a5e30c911b794763483ed985960a6732a40e | [
"Apache-2.0"
] | 81 | 2018-03-21T02:09:38.000Z | 2022-02-11T09:30:13.000Z | pip_api/_hash.py | sugatoray/pip-api | dec3a5e30c911b794763483ed985960a6732a40e | [
"Apache-2.0"
] | 67 | 2018-09-27T16:03:02.000Z | 2022-03-11T20:05:37.000Z | pip_api/_hash.py | sugatoray/pip-api | dec3a5e30c911b794763483ed985960a6732a40e | [
"Apache-2.0"
] | 15 | 2018-03-31T01:15:18.000Z | 2022-03-10T08:13:23.000Z | import os
from pip_api._vendor.packaging.version import Version # type: ignore
import pip_api
from pip_api._call import call
from pip_api.exceptions import Incompatible, InvalidArguments
incompatible = pip_api.PIP_VERSION < Version("8.0.0")
def hash(filename: os.PathLike, algorithm: str = "sha256") -> str:
""... | 27.814815 | 78 | 0.683089 |
4a136cfb44b6e5433294f2d54f886b3cedb65a0c | 2,953 | py | Python | tests/test_config.py | admdev8/darglint | d2d0f45861cfe7ed8d0a916eca181b144ed77cba | [
"MIT"
] | 1 | 2020-08-30T11:18:40.000Z | 2020-08-30T11:18:40.000Z | tests/test_config.py | admdev8/darglint | d2d0f45861cfe7ed8d0a916eca181b144ed77cba | [
"MIT"
] | 4 | 2020-08-30T11:18:52.000Z | 2020-08-30T12:18:17.000Z | tests/test_config.py | Smirenost/darglint | d2d0f45861cfe7ed8d0a916eca181b144ed77cba | [
"MIT"
] | null | null | null | """Tests configuration scripts."""
from random import (
choice,
randint,
)
from string import ascii_letters
from unittest import (
mock,
TestCase,
)
from darglint.config import (
walk_path,
POSSIBLE_CONFIG_FILENAMES,
find_config_file_in_path,
get_logger,
LogLevel,
)
from .utils imp... | 28.669903 | 78 | 0.608534 |
ddd32321d270aecd4ff03d0cf551220f76f0da3f | 1,448 | py | Python | lib/python/treadmill/tests/spawn/tree_test.py | vrautela/treadmill | 05e47fa8acdf8bad7af78e737efb26ea6488de82 | [
"Apache-2.0"
] | 133 | 2016-09-15T13:36:12.000Z | 2021-01-18T06:29:13.000Z | lib/python/treadmill/tests/spawn/tree_test.py | vrautela/treadmill | 05e47fa8acdf8bad7af78e737efb26ea6488de82 | [
"Apache-2.0"
] | 108 | 2016-12-28T23:41:27.000Z | 2020-03-05T21:20:37.000Z | lib/python/treadmill/tests/spawn/tree_test.py | evreng/treadmill | 05e47fa8acdf8bad7af78e737efb26ea6488de82 | [
"Apache-2.0"
] | 69 | 2016-09-23T20:38:58.000Z | 2020-11-11T02:31:21.000Z | """Unit test for treadmill.spawn.tree.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import shutil
import unittest
import mock
# Disable W0611: Unused import
import treadmill.tests.treadmill_test_ski... | 28.96 | 76 | 0.71616 |
301abb7ac4fe4f26fae1c98f228a02bf2cdf8e92 | 5,163 | py | Python | modules/preprocessing/text/NeMo/nemo_text_processing/text_normalization/ar/taggers/time.py | serkhanekarim/AI | 0a13880ae8e608cd00fa819dc590097abdb7ae6e | [
"Apache-2.0"
] | null | null | null | modules/preprocessing/text/NeMo/nemo_text_processing/text_normalization/ar/taggers/time.py | serkhanekarim/AI | 0a13880ae8e608cd00fa819dc590097abdb7ae6e | [
"Apache-2.0"
] | null | null | null | modules/preprocessing/text/NeMo/nemo_text_processing/text_normalization/ar/taggers/time.py | serkhanekarim/AI | 0a13880ae8e608cd00fa819dc590097abdb7ae6e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
# Copyright 2015 and onwards Google, 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/license... | 38.819549 | 106 | 0.617277 |
2cdd588701a0bdac9dd8e327abf0ccdde6afeb5c | 1,072 | py | Python | runtests.py | violuke/django-readonly-field | ac6a3824e56e5e17492951aaf6deec8e5e3274d9 | [
"MIT"
] | 12 | 2018-02-24T21:25:46.000Z | 2021-02-01T06:19:26.000Z | runtests.py | violuke/django-readonly-field | ac6a3824e56e5e17492951aaf6deec8e5e3274d9 | [
"MIT"
] | 6 | 2018-03-01T16:19:40.000Z | 2022-01-17T15:08:05.000Z | runtests.py | violuke/django-readonly-field | ac6a3824e56e5e17492951aaf6deec8e5e3274d9 | [
"MIT"
] | 6 | 2018-03-01T15:10:28.000Z | 2021-12-16T21:18:01.000Z | #!/usr/bin/env python
import sys
import os
import contextlib
@contextlib.contextmanager
def cover():
do_coverage = "COVERAGE" in os.environ
if do_coverage:
import coverage
cov = coverage.Coverage(source=["django_readonly_field"])
cov.start()
print("Coverage will be generated")... | 22.808511 | 68 | 0.596082 |
97034963e94ade02f5a804f39b5b0df02cc5c058 | 14,561 | py | Python | sncosmo/spectral.py | sofiatti/sncosmo | ed0e231b5cff08ad24e420a43ba99c93c59722ca | [
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | sncosmo/spectral.py | sofiatti/sncosmo | ed0e231b5cff08ad24e420a43ba99c93c59722ca | [
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | sncosmo/spectral.py | sofiatti/sncosmo | ed0e231b5cff08ad24e420a43ba99c93c59722ca | [
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import abc
import math
from copy import deepcopy
import numpy as np
from astropy.utils import OrderedDict, lazyproperty
from astropy.io import ascii
import astropy.units as u
import astropy.constants as const
from astropy import cosmology
from . import... | 31.313978 | 79 | 0.573518 |
fefe7e8c0c3536cbd5d88a1ad3e8d7dfa3ff17f0 | 5,782 | py | Python | train-model.py | TanakitInt/FSRCNN-anime | 51028294f0fdfefb84bc1118a0ecf7e27e8f42e5 | [
"MIT"
] | null | null | null | train-model.py | TanakitInt/FSRCNN-anime | 51028294f0fdfefb84bc1118a0ecf7e27e8f42e5 | [
"MIT"
] | null | null | null | train-model.py | TanakitInt/FSRCNN-anime | 51028294f0fdfefb84bc1118a0ecf7e27e8f42e5 | [
"MIT"
] | null | null | null | # import library
import sys
import keras
import tensorflow as tf
print("Python version : " + sys.version)
print("Keras version : " + keras.__version__)
# import model packages
from keras.models import Sequential
from keras.layers import Conv2D, Conv2DTranspose, Input, Activation, LeakyReLU
from keras.optimizers imp... | 33.421965 | 171 | 0.689727 |
fd8112e7e5a14a0fbe90d6dc695b4413f99e12a3 | 360 | py | Python | eLegislative/elegislative_app/migrations/0033_remove_olddocumentsmodel_last_modified_date.py | lloydgarcia77/eLMS_San_Pedro_Laguna | dd6b59ba971301a8af40f262db1f651b7a7a6e0f | [
"MIT"
] | null | null | null | eLegislative/elegislative_app/migrations/0033_remove_olddocumentsmodel_last_modified_date.py | lloydgarcia77/eLMS_San_Pedro_Laguna | dd6b59ba971301a8af40f262db1f651b7a7a6e0f | [
"MIT"
] | null | null | null | eLegislative/elegislative_app/migrations/0033_remove_olddocumentsmodel_last_modified_date.py | lloydgarcia77/eLMS_San_Pedro_Laguna | dd6b59ba971301a8af40f262db1f651b7a7a6e0f | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-02-11 21:32
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('elegislative_app', '0032_auto_20210211_2018'),
]
operations = [
migrations.RemoveField(
model_name='olddocumentsmodel',
name... | 20 | 56 | 0.627778 |
86080a57a063a6316ad05479509eec3fb043dbf3 | 6,196 | py | Python | kubernetes_asyncio/client/api/apiregistration_api.py | tomplus/kubernetes-asyncio | 11c3eb4d50ae822545572aa7b8c15f7153f65a1c | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/api/apiregistration_api.py | tomplus/kubernetes-asyncio | 11c3eb4d50ae822545572aa7b8c15f7153f65a1c | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/api/apiregistration_api.py | tomplus/kubernetes-asyncio | 11c3eb4d50ae822545572aa7b8c15f7153f65a1c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.23.6
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # ... | 37.325301 | 124 | 0.599096 |
f3a345e3ceb2fa198283370ff3ae6bed5aa9fcf9 | 1,718 | py | Python | tests/core/test_container.py | tim-sueberkrueb/grout | b19bce094e97464087390206eabbc5e770d61799 | [
"MIT"
] | null | null | null | tests/core/test_container.py | tim-sueberkrueb/grout | b19bce094e97464087390206eabbc5e770d61799 | [
"MIT"
] | 12 | 2017-03-28T11:22:40.000Z | 2017-06-14T12:39:21.000Z | tests/core/test_container.py | tim-sueberkrueb/baka | b19bce094e97464087390206eabbc5e770d61799 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os.path
import pytest
from baka.core import Project
from baka.core import Container, NotReadyError
class TestContainer:
_test_backend_options = {
'name': 'test-case-container'
}
_temp_dir = os.path.join('/tmp', 'baka-tests')
def test_options(self):
p =... | 26.84375 | 72 | 0.563446 |
ad675f3e92b942dae14db67efd73c7954439ad26 | 5,647 | py | Python | basicsr/models/archs/dfdnet_util.py | My-Zhu/BasicSR | c26dd943191a3c2528e1b924c366acb221ead86f | [
"Apache-2.0"
] | 1,421 | 2019-04-10T14:38:55.000Z | 2022-03-28T02:32:17.000Z | basicsr/models/archs/dfdnet_util.py | My-Zhu/BasicSR | c26dd943191a3c2528e1b924c366acb221ead86f | [
"Apache-2.0"
] | 198 | 2019-05-20T06:34:21.000Z | 2022-01-28T13:06:47.000Z | basicsr/models/archs/dfdnet_util.py | My-Zhu/BasicSR | c26dd943191a3c2528e1b924c366acb221ead86f | [
"Apache-2.0"
] | 353 | 2019-05-11T16:07:34.000Z | 2022-03-29T12:01:34.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.utils.spectral_norm as SpectralNorm
from torch.autograd import Function
class BlurFunctionBackward(Function):
@staticmethod
def forward(ctx, grad_output, kernel, kernel_flip):
ctx.save_for_backward(kernel, kernel_flip)... | 30.197861 | 77 | 0.571808 |
c098ddb2123bc32c9ffaf98cd013b18e416f068c | 797 | py | Python | phr/models.py | kwzofc/phr | 04e87daf182783c99191a320c3d83f5abdd60da1 | [
"MIT"
] | null | null | null | phr/models.py | kwzofc/phr | 04e87daf182783c99191a320c3d83f5abdd60da1 | [
"MIT"
] | null | null | null | phr/models.py | kwzofc/phr | 04e87daf182783c99191a320c3d83f5abdd60da1 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class PHR(models.Model):
user_name = models.ForeignKey(User, on_delete=models.CASCADE)
first_name = models.CharField(max_length=30, blank=False)
last_name = models.CharField(max_length=30, blank=False)
e... | 46.882353 | 65 | 0.761606 |
aad870ce4120c080fe6a89202f35eb5ed995c76a | 4,277 | py | Python | metrics/bleurt/bleurt.py | yashmaherwal/datasets | fe52b678819d1f41a4ff4b5994c9ff53324bf4fe | [
"Apache-2.0"
] | 7 | 2021-01-04T22:18:26.000Z | 2021-07-10T09:13:29.000Z | metrics/bleurt/bleurt.py | yashmaherwal/datasets | fe52b678819d1f41a4ff4b5994c9ff53324bf4fe | [
"Apache-2.0"
] | null | null | null | metrics/bleurt/bleurt.py | yashmaherwal/datasets | fe52b678819d1f41a4ff4b5994c9ff53324bf4fe | [
"Apache-2.0"
] | 3 | 2021-09-19T08:20:42.000Z | 2022-02-19T16:32:40.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 39.971963 | 180 | 0.695815 |
4a71483e17ff91093b8af7655b7679eba3dc4743 | 2,366 | py | Python | web/apps/admin/mail.py | JW709/zoom | 3b26a22e569bf44a9856b587771589413b52e81b | [
"MIT"
] | null | null | null | web/apps/admin/mail.py | JW709/zoom | 3b26a22e569bf44a9856b587771589413b52e81b | [
"MIT"
] | null | null | null | web/apps/admin/mail.py | JW709/zoom | 3b26a22e569bf44a9856b587771589413b52e81b | [
"MIT"
] | 1 | 2019-02-06T16:10:56.000Z | 2019-02-06T16:10:56.000Z | """
admin.mail
mail queue viewer
"""
import uuid
import zoom
from zoom.context import context
from zoom.mvc import View, Controller
from zoom.mail import get_mail_store, send, Attachment
from zoom.browse import browse
import zoom.fields as f
from zoom.forms import Form
from zoom.components import success
fro... | 29.949367 | 92 | 0.565089 |
3311e73e3186d8ad8606863ecb7b939622cdd3d0 | 370 | py | Python | AdvancedPythonObjectsandDataStructures/advanced_dictonaries.py | theprogrammingthinker/Python-practice | fef11a7fbd5082a0614b01f88a13ea29d68860bf | [
"Unlicense"
] | 1 | 2017-05-02T10:28:36.000Z | 2017-05-02T10:28:36.000Z | AdvancedPythonObjectsandDataStructures/advanced_dictonaries.py | theprogrammingthinker/Python-practice | fef11a7fbd5082a0614b01f88a13ea29d68860bf | [
"Unlicense"
] | null | null | null | AdvancedPythonObjectsandDataStructures/advanced_dictonaries.py | theprogrammingthinker/Python-practice | fef11a7fbd5082a0614b01f88a13ea29d68860bf | [
"Unlicense"
] | null | null | null | d = {"k": 1, "k2": 2}
print({x: x ** 2 for x in range(10)})
# {0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64, 9: 81}
var = {k: v ** 2 for k, v in zip(['a', 'b', 'c'], range(10))}
print(var)
# {'a': 0, 'b': 1}
for k in d.items():
print(k)
for k in d.keys():
print(k)
for k in d.values():
prin... | 16.086957 | 68 | 0.467568 |
d1923b1d1375f7198d2174f2de3050d89dcf29f4 | 870 | py | Python | app/models/constants.py | cmd-ntrf/mc-hub | a636c9019d2af29727c95f5a13ade83f89de3821 | [
"BSD-3-Clause"
] | null | null | null | app/models/constants.py | cmd-ntrf/mc-hub | a636c9019d2af29727c95f5a13ade83f89de3821 | [
"BSD-3-Clause"
] | null | null | null | app/models/constants.py | cmd-ntrf/mc-hub | a636c9019d2af29727c95f5a13ade83f89de3821 | [
"BSD-3-Clause"
] | null | null | null | from os import path, environ
# Regular constants
INSTANCE_CATEGORIES = ["mgmt", "login", "node"]
STORAGE_SPACES = ["home", "project", "scratch"]
AUTO_ALLOCATED_IP_LABEL = "Automatic allocation"
# Magic Castle
MAGIC_CASTLE_MODULE_SOURCE = "git::https://github.com/ComputeCanada/magic_castle.git"
MAGIC_CASTLE_PUPPET_CON... | 37.826087 | 85 | 0.765517 |
c0265f2e2fbbe36f26504539e7373d4d76447e4a | 1,889 | py | Python | rest_api_framework/models/validators.py | boblefrag/python-rest-api-framework | 0caf33e4b07dbcce3a1cd891c64fdb359d88eb33 | [
"MIT"
] | 7 | 2015-05-31T08:35:24.000Z | 2022-01-29T21:09:19.000Z | rest_api_framework/models/validators.py | boblefrag/python-rest-api-framework | 0caf33e4b07dbcce3a1cd891c64fdb359d88eb33 | [
"MIT"
] | 1 | 2017-05-24T11:56:46.000Z | 2017-05-24T11:56:46.000Z | rest_api_framework/models/validators.py | boblefrag/python-rest-api-framework | 0caf33e4b07dbcce3a1cd891c64fdb359d88eb33 | [
"MIT"
] | 13 | 2015-07-15T06:29:53.000Z | 2022-03-28T17:54:39.000Z | """
Validators to check the values of Fields instances
"""
from abc import ABCMeta, abstractmethod
class Validator(object):
"""
Base Validator class
Used to validate data format
"""
__metaclass__ = ABCMeta
@abstractmethod
def validate(self, field, *args):
"""
Method to val... | 22.759036 | 73 | 0.592906 |
85bc38de8ebd16eeacb3db8743290425cf927488 | 11,696 | py | Python | api/tests.py | hyusuf4/FriendZone2 | 342a2f86295341ea98bbb9dd596ef823eb509962 | [
"Apache-2.0"
] | null | null | null | api/tests.py | hyusuf4/FriendZone2 | 342a2f86295341ea98bbb9dd596ef823eb509962 | [
"Apache-2.0"
] | null | null | null | api/tests.py | hyusuf4/FriendZone2 | 342a2f86295341ea98bbb9dd596ef823eb509962 | [
"Apache-2.0"
] | null | null | null | from django.test import TestCase
from django.utils import timezone
from .models import Author, FriendRequest, Friends,Post,Comment, Following
from django.test import Client
from django.urls import reverse
from django.db.models import Q
import json
""""""
from api.models import Author, FriendRequest, Friends,Post,Commen... | 38.473684 | 142 | 0.606703 |
f271ddf0a45b041befe73de8c05292229fb25154 | 917 | py | Python | people/migrations/0002_ormlogintoken.py | jordifierro/pachatary-api | c03ad67ceb856068daa6d082091372eb1ed3d009 | [
"MIT"
] | 3 | 2018-12-05T16:44:59.000Z | 2020-08-01T14:12:32.000Z | people/migrations/0002_ormlogintoken.py | jordifierro/pachatary-api | c03ad67ceb856068daa6d082091372eb1ed3d009 | [
"MIT"
] | 6 | 2020-06-03T15:56:59.000Z | 2022-02-10T07:23:55.000Z | people/migrations/0002_ormlogintoken.py | jordifierro/pachatary-api | c03ad67ceb856068daa6d082091372eb1ed3d009 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.1 on 2018-05-03 14:30
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
('people', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='ORMLoginTo... | 31.62069 | 114 | 0.589967 |
e35836ed9d2673c66208949f4bf1b88d95e3b110 | 2,224 | py | Python | backend/backend/settings.py | berserg2010/test_vk_api | c7a3814dd3cdb18d11527a2b8613b77a0ace6e37 | [
"Apache-2.0"
] | null | null | null | backend/backend/settings.py | berserg2010/test_vk_api | c7a3814dd3cdb18d11527a2b8613b77a0ace6e37 | [
"Apache-2.0"
] | 4 | 2021-06-04T23:51:35.000Z | 2021-09-22T19:33:33.000Z | backend/backend/settings.py | berserg2010/test_vk_api | c7a3814dd3cdb18d11527a2b8613b77a0ace6e37 | [
"Apache-2.0"
] | null | null | null | import os
ACCESS_TOKEN_VK = os.getenv('ACCESS_TOKEN_VK')
SECRET_KEY = os.getenv('DJANGO_SECRET_KEY', 'SECRET')
DEBUG = os.getenv('DJANGO_DEBUG', False)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
ALLOWED_HOSTS = [
'0.0.0.0',
'localhost',
'127.0.0.1',
'vk-api.ddns.net',
]
... | 25.272727 | 91 | 0.661421 |
974f4fa73c4006566f5ac31223586880ae1b7d25 | 13,874 | py | Python | hwt/hdl/ifContainter.py | mgielda/hwt | e6c699fb154f93ac03523bfe40a3d4fc1912d28b | [
"MIT"
] | null | null | null | hwt/hdl/ifContainter.py | mgielda/hwt | e6c699fb154f93ac03523bfe40a3d4fc1912d28b | [
"MIT"
] | null | null | null | hwt/hdl/ifContainter.py | mgielda/hwt | e6c699fb154f93ac03523bfe40a3d4fc1912d28b | [
"MIT"
] | null | null | null |
from functools import reduce
from itertools import compress
from operator import and_
from typing import List, Tuple, Dict, Union
from hwt.hdl.sensitivityCtx import SensitivityCtx
from hwt.hdl.statementUtils import fill_stm_list_with_enclosure
from hwt.hdl.statements import HdlStatement, statementsAreSame,\
isSa... | 33.033333 | 99 | 0.570419 |
bafb1c0e7a78ed44e7a6028354ea078c2ecf70e8 | 1,161 | py | Python | shop/migrations/0004_billitemstest.py | abhishekmandloi/django-product-management-system | e89138e77c53b2ed51599e43e5d74bdf8671ae9e | [
"MIT"
] | null | null | null | shop/migrations/0004_billitemstest.py | abhishekmandloi/django-product-management-system | e89138e77c53b2ed51599e43e5d74bdf8671ae9e | [
"MIT"
] | null | null | null | shop/migrations/0004_billitemstest.py | abhishekmandloi/django-product-management-system | e89138e77c53b2ed51599e43e5d74bdf8671ae9e | [
"MIT"
] | 1 | 2021-07-02T04:18:17.000Z | 2021-07-02T04:18:17.000Z | # Generated by Django 3.1 on 2020-08-11 08:13
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('shop', '0003_auto_20200811_1337'),
]
operations = [
migrations.CreateModel(
name='B... | 41.464286 | 150 | 0.611542 |
d1a356237e86102a1bd68d491a667abe77f97096 | 9,646 | py | Python | test/test_live_auth.py | ubragg/endpoints-python | 1ca9b366d75644787a57b21942f77797a1b96667 | [
"Apache-2.0"
] | null | null | null | test/test_live_auth.py | ubragg/endpoints-python | 1ca9b366d75644787a57b21942f77797a1b96667 | [
"Apache-2.0"
] | null | null | null | test/test_live_auth.py | ubragg/endpoints-python | 1ca9b366d75644787a57b21942f77797a1b96667 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
# 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
#
# ... | 41.222222 | 179 | 0.690234 |
1402d01f4809c17edfca62de955ba1ba342a55a7 | 13,668 | py | Python | medicalai/chief/networks.py | gitter-badger/medicalAI | 5892003489d62a0cb74486add6afc37485e8967c | [
"Apache-2.0"
] | null | null | null | medicalai/chief/networks.py | gitter-badger/medicalAI | 5892003489d62a0cb74486add6afc37485e8967c | [
"Apache-2.0"
] | null | null | null | medicalai/chief/networks.py | gitter-badger/medicalAI | 5892003489d62a0cb74486add6afc37485e8967c | [
"Apache-2.0"
] | null | null | null | # Copyright 2020-2022 AIBharata Emerging Technologies Pvt. 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 re... | 45.258278 | 226 | 0.65657 |
52d85a81f779fc64d1efa05cc37fbad3f65ec362 | 1,161 | py | Python | awwwards/urls.py | james-muriithi/awards | 01c34d516b36def2589ac88c815b022a408cff62 | [
"Unlicense"
] | null | null | null | awwwards/urls.py | james-muriithi/awards | 01c34d516b36def2589ac88c815b022a408cff62 | [
"Unlicense"
] | null | null | null | awwwards/urls.py | james-muriithi/awards | 01c34d516b36def2589ac88c815b022a408cff62 | [
"Unlicense"
] | null | null | null | """awwwards URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... | 38.7 | 81 | 0.723514 |
6ef32a9962d561347a2679054bd1378d1fdee006 | 36 | py | Python | workers/__init__.py | oliverroyknox/rvdl | bdf0bc2fea9f9dd9820759a4595cc8285ec8b2fc | [
"MIT"
] | null | null | null | workers/__init__.py | oliverroyknox/rvdl | bdf0bc2fea9f9dd9820759a4595cc8285ec8b2fc | [
"MIT"
] | null | null | null | workers/__init__.py | oliverroyknox/rvdl | bdf0bc2fea9f9dd9820759a4595cc8285ec8b2fc | [
"MIT"
] | null | null | null | from .download import DownloadWorker | 36 | 36 | 0.888889 |
e47732cebadf2991007e5fb04074afe04309e5ca | 808 | py | Python | test_projects.py | botasakhi/applied_ds | b70cf83b2fbaf78664950d990555a22e3e286f0d | [
"BSD-3-Clause"
] | null | null | null | test_projects.py | botasakhi/applied_ds | b70cf83b2fbaf78664950d990555a22e3e286f0d | [
"BSD-3-Clause"
] | null | null | null | test_projects.py | botasakhi/applied_ds | b70cf83b2fbaf78664950d990555a22e3e286f0d | [
"BSD-3-Clause"
] | null | null | null | import pytest
import os
import papermill as pm
import glob
@pytest.mark.parametrize('folder', [x[0] for x in os.walk(os.getcwd())\
if (len(x[0].split('/'))\
== len(os.getcwd().split('/'))+1\
and x[0].spl... | 33.666667 | 87 | 0.486386 |
0868bb16aa281c16b89b76eb86dae4632851ce39 | 5,152 | py | Python | SimpleHTMLExtractor.py | jesh-anand/Tools | 4b6ffc96492d49ea1b20cad2f65d8da8b2ff2ab1 | [
"MIT"
] | null | null | null | SimpleHTMLExtractor.py | jesh-anand/Tools | 4b6ffc96492d49ea1b20cad2f65d8da8b2ff2ab1 | [
"MIT"
] | null | null | null | SimpleHTMLExtractor.py | jesh-anand/Tools | 4b6ffc96492d49ea1b20cad2f65d8da8b2ff2ab1 | [
"MIT"
] | null | null | null | from html.parser import HTMLParser
"""SimpleHTMLExtractor.py: A HTML parser that extracts text and outputs to file
"""
__author__ = "Prajesh Ananthan"
__copyright__ = "Copyright 2016, Python"
__license__ = "GPL"
class MyHTMLParser(HTMLParser):
# def handle_starttag(self, tag, attrs):
# print("Encountere... | 135.578947 | 4,194 | 0.734278 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.