hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 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 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a0b6b45f4a6883fea068dcd1e7fc20d152be13e | 37,474 | py | Python | django/test/client.py | martinsvoboda/django | c51bf80d56cbcdbec1b243b8db086f35b4598947 | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 4 | 2021-07-02T08:22:36.000Z | 2021-07-05T20:31:51.000Z | django/test/client.py | FutureSenzhong/django | 1bbb98d9a4b7d83e422b14ae2429cb368eff5a13 | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | null | null | null | django/test/client.py | FutureSenzhong/django | 1bbb98d9a4b7d83e422b14ae2429cb368eff5a13 | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | null | null | null | import json
import mimetypes
import os
import sys
from copy import copy
from functools import partial
from http import HTTPStatus
from importlib import import_module
from io import BytesIO
from urllib.parse import unquote_to_bytes, urljoin, urlparse, urlsplit
from asgiref.sync import sync_to_async
from django.conf im... | 40.165059 | 112 | 0.626381 |
4a0b6b4a3ecaf41490e5d2426ce74ac604d41103 | 5,757 | py | Python | contrib/seeds/makeseeds.py | fartonium/fartonium | 0d454e4368356eb2ea40b6ade622f8f6089488f7 | [
"MIT"
] | null | null | null | contrib/seeds/makeseeds.py | fartonium/fartonium | 0d454e4368356eb2ea40b6ade622f8f6089488f7 | [
"MIT"
] | null | null | null | contrib/seeds/makeseeds.py | fartonium/fartonium | 0d454e4368356eb2ea40b6ade622f8f6089488f7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2013-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Generate seeds.txt from Pieter's DNS seeder
#
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 337600
#... | 33.277457 | 186 | 0.570262 |
4a0b6be79eded706f5d09dea2afa98509198bf49 | 5,753 | py | Python | geotag/exif.py | puigfp/geotag | 840cd7166bafc8bc649f5a34d302811a1d707f6c | [
"MIT"
] | null | null | null | geotag/exif.py | puigfp/geotag | 840cd7166bafc8bc649f5a34d302811a1d707f6c | [
"MIT"
] | 1 | 2021-09-10T18:01:16.000Z | 2021-09-10T18:02:37.000Z | geotag/exif.py | puigfp/geotag | 840cd7166bafc8bc649f5a34d302811a1d707f6c | [
"MIT"
] | 4 | 2020-04-29T08:47:34.000Z | 2021-12-24T14:30:20.000Z | import bisect
import json
import os
import re
import subprocess
from datetime import datetime, timedelta, timezone
from typing import List, Optional
import pytz
from .location_history import Location
from .log import log
from .timezone import gps_coords_to_utc_offset
def read_exif(root: str) -> List[dict]:
log.... | 34.244048 | 88 | 0.63167 |
4a0b6c011167158925934dfc24520a48af74627f | 346 | py | Python | src/pico_code/pico/resistomatic/raw-resisitance.py | romilly/pico-code | 57bbc14e0a5c3e874162fcfb1fcd7cca3a838cce | [
"MIT"
] | 15 | 2021-02-04T02:38:23.000Z | 2022-01-20T17:55:15.000Z | src/pico_code/pico/resistomatic/raw-resisitance.py | romilly/pico-code | 57bbc14e0a5c3e874162fcfb1fcd7cca3a838cce | [
"MIT"
] | 1 | 2021-05-06T10:09:51.000Z | 2021-05-06T10:09:51.000Z | src/pico_code/pico/resistomatic/raw-resisitance.py | romilly/pico-code | 57bbc14e0a5c3e874162fcfb1fcd7cca3a838cce | [
"MIT"
] | 2 | 2021-02-04T20:09:01.000Z | 2021-02-18T16:16:22.000Z | import machine
import time
potentiometer = machine.ADC(26)
def run():
while True:
raw_v = potentiometer.read_u16()
voltage = 3.3 * raw_v / 65535.0
r_fixed = 1000 # Ohms
try:
r = r_fixed * voltage/(3.3 - voltage)
print(r)
except:
pass
... | 19.222222 | 49 | 0.523121 |
4a0b6cfaa6a6bebaaa2eaebb08de085305f82026 | 7,652 | py | Python | recipes/sentry-crashpad/all/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 1 | 2020-01-31T22:47:14.000Z | 2020-01-31T22:47:14.000Z | recipes/sentry-crashpad/all/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 3 | 2020-05-05T11:27:44.000Z | 2022-02-28T20:19:50.000Z | recipes/sentry-crashpad/all/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 1 | 2020-10-12T10:45:13.000Z | 2020-10-12T10:45:13.000Z | import os
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
required_conan_version = ">=1.28.0"
class SentryCrashpadConan(ConanFile):
name = "sentry-crashpad"
description = "Crashpad is a crash-reporting system."
url = "https://github.com/conan-io/conan-center... | 46.096386 | 147 | 0.643361 |
4a0b712c839885f9afd428c3963565850a5b9e6d | 330 | py | Python | app/base/routes.py | YaPunk/bokunosite | 30884700cb059645a573ef6396051638ab66adb4 | [
"MIT"
] | null | null | null | app/base/routes.py | YaPunk/bokunosite | 30884700cb059645a573ef6396051638ab66adb4 | [
"MIT"
] | null | null | null | app/base/routes.py | YaPunk/bokunosite | 30884700cb059645a573ef6396051638ab66adb4 | [
"MIT"
] | null | null | null | from flask import render_template, url_for
from flask_login import current_user, login_required
from app.base import base
from app.models import Section
@base.route('/')
@base.route('/index')
def index():
return render_template(
"index.html",
title="Index Page",
sections=Section.query.all... | 20.625 | 52 | 0.693939 |
4a0b713bf259d60804b7a1402e883987767f0eec | 2,783 | py | Python | mapElites/createChildren.py | Sascha0912/SAIL | 5dfb8d0b925d5e61933bf10591d959433fffaf26 | [
"MIT"
] | 2 | 2019-03-12T10:21:54.000Z | 2019-07-17T14:56:33.000Z | mapElites/createChildren.py | Sascha0912/SAIL | 5dfb8d0b925d5e61933bf10591d959433fffaf26 | [
"MIT"
] | null | null | null | mapElites/createChildren.py | Sascha0912/SAIL | 5dfb8d0b925d5e61933bf10591d959433fffaf26 | [
"MIT"
] | 1 | 2020-08-31T07:22:09.000Z | 2020-08-31T07:22:09.000Z | import numpy as np
import pandas as pd
def createChildren(map, nChildren, p, d):
# Remove empty bins from parent pool
if (isinstance(map,tuple)):
if (isinstance(map[0],tuple)):
map = map[0][0]
else:
map = map[0]
# print("map.genes") # map.genes enthält nur in den er... | 35.227848 | 127 | 0.617319 |
4a0b715e9d2f3d455218814e913960590720f3a7 | 123 | py | Python | view.py | LunexCoding/EasyGeometry | 93bde6294403e7a6d58694c759e64f6b8829347d | [
"Apache-2.0"
] | null | null | null | view.py | LunexCoding/EasyGeometry | 93bde6294403e7a6d58694c759e64f6b8829347d | [
"Apache-2.0"
] | null | null | null | view.py | LunexCoding/EasyGeometry | 93bde6294403e7a6d58694c759e64f6b8829347d | [
"Apache-2.0"
] | null | null | null | class _View:
def showMessage(self, msg):
print(msg)
def requestInput(self, msg):
return msg
g_view = _View()
| 13.666667 | 30 | 0.658537 |
4a0b729e80a51eeba71b2ee4be33e203e00ed348 | 3,432 | py | Python | gc_win.py | lauren-lopez/learning_python | c91bcf2e6468a3dd0f4e8a928d2c0de1e5706ade | [
"MIT"
] | null | null | null | gc_win.py | lauren-lopez/learning_python | c91bcf2e6468a3dd0f4e8a928d2c0de1e5706ade | [
"MIT"
] | null | null | null | gc_win.py | lauren-lopez/learning_python | c91bcf2e6468a3dd0f4e8a928d2c0de1e5706ade | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Write a program that computes the GC fraction of a DNA sequence in a window
# Window size is 11 nt
# Output with 4 significant figures using whichever method you prefer
seq = 'ACGACGCAGGAGGAGAGTTTCAGAGATCACGAATACATCCATATTACCCAGAGAGAG'
w = 11
s = 0 #start position
gc_count = 0
for i in range(... | 30.371681 | 84 | 0.623543 |
4a0b72af24f04ace53d3d7ad7d97cc5957363430 | 95 | py | Python | feedback-collector/main.py | mertmsrli/astair | fef832473884196025e727dd4d91e3b841d1eb92 | [
"Apache-2.0"
] | 7 | 2019-08-20T12:14:12.000Z | 2021-09-13T11:19:48.000Z | feedback-collector/main.py | mertmsrli/astair | fef832473884196025e727dd4d91e3b841d1eb92 | [
"Apache-2.0"
] | 7 | 2020-03-01T07:44:10.000Z | 2022-02-26T16:48:36.000Z | feedback-collector/main.py | mertmsrli/astair | fef832473884196025e727dd4d91e3b841d1eb92 | [
"Apache-2.0"
] | 9 | 2019-06-25T04:45:00.000Z | 2020-05-15T22:48:15.000Z | import os
from app import app
if __name__ == '__main__':
app.debug = True
app.run()
| 10.555556 | 26 | 0.631579 |
4a0b749e3c03a81de39b3f7ccdee6dfecb8e95ac | 188 | py | Python | {{cookiecutter.project_slug}}/{{cookiecutter.app_name_slug}}/apps.py | Alurith/django-cookiecutter | ce969b48c5d1b40bbcd3de6b6f286cb6a3c3a9d0 | [
"MIT"
] | 1 | 2022-03-30T08:05:35.000Z | 2022-03-30T08:05:35.000Z | {{cookiecutter.project_slug}}/{{cookiecutter.app_name_slug}}/apps.py | Alurith/django-cookiecutter | ce969b48c5d1b40bbcd3de6b6f286cb6a3c3a9d0 | [
"MIT"
] | 2 | 2022-03-25T20:51:13.000Z | 2022-03-25T20:56:41.000Z | {{cookiecutter.project_slug}}/{{cookiecutter.app_name_slug}}/apps.py | Alurith/django-cookiecutter | ce969b48c5d1b40bbcd3de6b6f286cb6a3c3a9d0 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class {{cookiecutter.app_class}}Config(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = '{{cookiecutter.app_name_slug}}'
| 26.857143 | 56 | 0.760638 |
4a0b74f010b680591dda530941936fb13f788128 | 11,195 | py | Python | codehint/tests/test_codehint.py | ipazc/codehint | 47399f46986b3bacc573a188028b4dc6c234d42a | [
"MIT"
] | 1 | 2017-11-13T16:15:17.000Z | 2017-11-13T16:15:17.000Z | codehint/tests/test_codehint.py | ipazc/codehint | 47399f46986b3bacc573a188028b4dc6c234d42a | [
"MIT"
] | null | null | null | codehint/tests/test_codehint.py | ipazc/codehint | 47399f46986b3bacc573a188028b4dc6c234d42a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
#MIT License
#
#Copyright (c) 2017 Iván de Paz Centeno
#
#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 l... | 30.504087 | 114 | 0.556498 |
4a0b756a59ec4549912a06d942d592e56afe11bc | 24,600 | py | Python | milvus_cli/utils.py | shiyu22/milvus_cli | cd38ad46f187e07490c0949fb94d1704e5dfb1b9 | [
"Apache-2.0"
] | 18 | 2021-08-20T10:15:08.000Z | 2022-03-26T06:40:24.000Z | milvus_cli/utils.py | shiyu22/milvus_cli | cd38ad46f187e07490c0949fb94d1704e5dfb1b9 | [
"Apache-2.0"
] | 25 | 2021-08-23T02:02:32.000Z | 2021-12-13T07:18:54.000Z | milvus_cli/utils.py | shiyu22/milvus_cli | cd38ad46f187e07490c0949fb94d1704e5dfb1b9 | [
"Apache-2.0"
] | 12 | 2021-08-25T12:04:04.000Z | 2022-01-30T14:56:20.000Z | from tabulate import tabulate
import readline
import re
import os
from functools import reduce
from Types import DataTypeByNum
from Types import ParameterException, ConnectException
from time import time
def getPackageVersion():
import pkg_resources # part of setuptools
try:
version = pkg_resources.... | 38.021638 | 136 | 0.601179 |
4a0b760b321c880e815e6c5ad003f4fc984b1c11 | 775 | py | Python | basic/37-charm.fi/scripts/print_price.py | yingjingyang/Dapp-Learning | 5bf10a02932926e429c1a61704d9a9dfee3a13ea | [
"MIT"
] | 987 | 2021-12-19T09:57:18.000Z | 2022-03-31T15:39:45.000Z | basic/37-charm.fi/scripts/print_price.py | yingjingyang/Dapp-Learning | 5bf10a02932926e429c1a61704d9a9dfee3a13ea | [
"MIT"
] | 73 | 2021-07-04T03:53:57.000Z | 2021-12-18T06:17:13.000Z | basic/37-charm.fi/scripts/print_price.py | yingjingyang/Dapp-Learning | 5bf10a02932926e429c1a61704d9a9dfee3a13ea | [
"MIT"
] | 263 | 2021-06-28T15:26:56.000Z | 2021-12-19T08:14:37.000Z | from brownie import accounts, project
import time
POOL = "0x7858e59e0c01ea06df3af3d20ac7b0003275d4bf" # USDC / USDT / 0.05%
POOL = "0x6c6bc977e13df9b0de53b251522280bb72383700" # DAI / USDC / 0.05%
# POOL = "0x6f48eca74b38d2936b02ab603ff4e36a6c0e3a77" # DAI / USDT / 0.05%
SECONDS_AGO = 60
def main():
Uniswap... | 28.703704 | 75 | 0.652903 |
4a0b76adbb7381da124cc5227a35b02ce530af81 | 3,787 | py | Python | nova/network/neutronv2/__init__.py | vasart/nova | bca5004d367e0418e35f8a72fe0f2e106e977ab0 | [
"Apache-2.0"
] | 1 | 2021-09-10T15:29:02.000Z | 2021-09-10T15:29:02.000Z | nova/network/neutronv2/__init__.py | PFZheng/nova | 84be8abbccb5ddc2d7c5a7db59019ed1edb19e7f | [
"Apache-2.0"
] | null | null | null | nova/network/neutronv2/__init__.py | PFZheng/nova | 84be8abbccb5ddc2d7c5a7db59019ed1edb19e7f | [
"Apache-2.0"
] | null | null | null | # Copyright 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 33.219298 | 78 | 0.684183 |
4a0b76dd505f31467e5ae4c32bf513145b1bbfc4 | 2,208 | py | Python | task_server/lib/passwd.py | ipeterov/convenient-rpc | e0e7bb2a6fa99848fe319cf26e34d2ebf8558b2e | [
"MIT"
] | null | null | null | task_server/lib/passwd.py | ipeterov/convenient-rpc | e0e7bb2a6fa99848fe319cf26e34d2ebf8558b2e | [
"MIT"
] | 19 | 2016-04-19T20:18:50.000Z | 2016-05-04T20:55:53.000Z | task_server/lib/passwd.py | ipeterov/convenient-rpc | e0e7bb2a6fa99848fe319cf26e34d2ebf8558b2e | [
"MIT"
] | null | null | null | import sqlite3
import uuid
import hashlib
from functools import wraps
from flask import request, Response
class PasswordManager:
def __init__(self, dbfile='rpc-passwords.db', sha256_rounds=1000000, pepper='2fde251d-33fd-42c8-bdd9-8ac7788d5f5a'):
self.sha256_rounds = sha256_rounds
self.pepper = p... | 36.196721 | 129 | 0.643569 |
4a0b76ebfb66c9a5df286de26096619a4acd1392 | 3,471 | py | Python | pesto-cli/pesto/cli/app.py | fchouteau/pesto | 32cac6658cfe0fe0db636b2d9e75b10a05282bca | [
"Apache-2.0"
] | null | null | null | pesto-cli/pesto/cli/app.py | fchouteau/pesto | 32cac6658cfe0fe0db636b2d9e75b10a05282bca | [
"Apache-2.0"
] | null | null | null | pesto-cli/pesto/cli/app.py | fchouteau/pesto | 32cac6658cfe0fe0db636b2d9e75b10a05282bca | [
"Apache-2.0"
] | null | null | null | import argparse
import os
from typing import Any
import pkg_resources
from pkg_resources import resource_string
from pesto.common.pesto import PESTO_WORKSPACE
from pesto.cli import build, init, list as list_builds, test
from pesto.cli.core.utils import PESTO_LOG
from pesto.version import PESTO_VERSION
ALGO_TEMPLATE_... | 38.142857 | 116 | 0.689139 |
4a0b778155f6fc8adf0d1e8b8d76ae9f609803cb | 3,785 | py | Python | dhis2_core/src/dhis2/code_list/svcm_resources.py | dhis2/dhis2-python-cli | d5ec976a5c04e6897756e3be14924ec74a4456fd | [
"BSD-3-Clause"
] | 7 | 2020-10-15T08:54:50.000Z | 2021-12-19T14:37:49.000Z | dhis2_core/src/dhis2/code_list/svcm_resources.py | dhis2/dhis2-python-cli | d5ec976a5c04e6897756e3be14924ec74a4456fd | [
"BSD-3-Clause"
] | 3 | 2016-08-12T14:11:14.000Z | 2021-03-08T17:06:29.000Z | dhis2_core/src/dhis2/code_list/svcm_resources.py | dhis2/dhis2-python-cli | d5ec976a5c04e6897756e3be14924ec74a4456fd | [
"BSD-3-Clause"
] | 4 | 2016-02-10T23:03:08.000Z | 2020-12-28T13:18:49.000Z | import logging
from typing import List
from fhir.resources.bundle import Bundle, BundleEntry, BundleEntryRequest
from fhir.resources.codesystem import CodeSystem, CodeSystemConcept
from fhir.resources.identifier import Identifier
from fhir.resources.valueset import ValueSet, ValueSetCompose, ValueSetComposeInclude
fr... | 32.350427 | 101 | 0.720211 |
4a0b77dbbceea169a61a692692b2468bca97f522 | 539 | py | Python | Abstraction/Demo1.py | poojavaibhavsahu/Pooja_Python | 58122bfa8586883145042b11fe1cc013c803ab4f | [
"bzip2-1.0.6"
] | null | null | null | Abstraction/Demo1.py | poojavaibhavsahu/Pooja_Python | 58122bfa8586883145042b11fe1cc013c803ab4f | [
"bzip2-1.0.6"
] | null | null | null | Abstraction/Demo1.py | poojavaibhavsahu/Pooja_Python | 58122bfa8586883145042b11fe1cc013c803ab4f | [
"bzip2-1.0.6"
] | null | null | null | from abc import ABC,abstractmethod
class A(ABC):#makes a class abstract
@abstractmethod
def msg(self):
pass
def display(self):#non abstarct method
print("Hello display method")
class B(A):
def msg(self):
print("Hello msg called")
obj=B()
obj.msg()
obj.display()
... | 10.365385 | 42 | 0.576994 |
4a0b78124d5eadccb0a305f5e73f88ee0c17ed40 | 180 | py | Python | EasyVision/vision/exceptions.py | foxis/EasyVision | ffb2ce1a93fdace39c6bcc13c8ae518cec76919e | [
"MIT",
"BSD-3-Clause"
] | 7 | 2018-12-27T07:45:31.000Z | 2021-06-17T03:49:15.000Z | EasyVision/vision/exceptions.py | itohio/EasyVision | de6a4bb9160cd08278ae9c5738497132a4cd3202 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | EasyVision/vision/exceptions.py | itohio/EasyVision | de6a4bb9160cd08278ae9c5738497132a4cd3202 | [
"MIT",
"BSD-3-Clause"
] | 3 | 2019-08-21T03:36:56.000Z | 2021-10-08T16:12:53.000Z | # -*- coding: utf-8 -*-
"""Exceptions used for Vision capturing adapters.
"""
from EasyVision.exceptions import EasyVisionError
class DeviceNotFound(EasyVisionError):
pass
| 16.363636 | 49 | 0.738889 |
4a0b78ebd87be2f7414033047c09a1453033c1e7 | 1,381 | py | Python | firmware/uvc_controller/mbed-os/tools/host_tests/serial_complete_auto.py | davewhiiite/uvc | fd45223097eed5a824294db975b3c74aa5f5cc8f | [
"MIT"
] | 1 | 2021-06-12T14:54:07.000Z | 2021-06-12T14:54:07.000Z | firmware/uvc_controller/mbed-os/tools/host_tests/serial_complete_auto.py | davewhiiite/uvc | fd45223097eed5a824294db975b3c74aa5f5cc8f | [
"MIT"
] | null | null | null | firmware/uvc_controller/mbed-os/tools/host_tests/serial_complete_auto.py | davewhiiite/uvc | fd45223097eed5a824294db975b3c74aa5f5cc8f | [
"MIT"
] | null | null | null | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
SPDX-License-Identifier: Apache-2.0
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
Unles... | 30.688889 | 115 | 0.692252 |
4a0b790ae1e8b24632de8359ec773d6ef6a85a81 | 657 | py | Python | LeetCode_problems/count-good-triplets/Solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | LeetCode_problems/count-good-triplets/Solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | LeetCode_problems/count-good-triplets/Solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 5 2020
@author: Shrey1608
"""
# Approach : 1) using 3 loops for checking the condition(Time complexity O(n^3)| space complexity O(1))
# Solution:(Approach 1)
class Solution:
def countGoodTriplets(self, arr: List[int], a: int, b: int, c: int) -> int:
n=len(... | 28.565217 | 103 | 0.493151 |
4a0b79f38746c8e72d3db11000eee4ac7555117b | 162 | py | Python | scripts/hello.py | martimfj/dev_aberto_package | 4ec26b16bdfdafc5fe7359376d26edf88512554e | [
"MIT"
] | null | null | null | scripts/hello.py | martimfj/dev_aberto_package | 4ec26b16bdfdafc5fe7359376d26edf88512554e | [
"MIT"
] | null | null | null | scripts/hello.py | martimfj/dev_aberto_package | 4ec26b16bdfdafc5fe7359376d26edf88512554e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from dev_aberto import hello
if __name__ == "__main__":
date, name = hello()
print(f"Último commit feito em: {date} por {name}")
| 20.25 | 55 | 0.666667 |
4a0b7b2ead8b00d3425b03d5c9d04902ab01c20f | 6,195 | py | Python | account/api/serializers.py | Shubhamag19/Login-SignUp-DRF | 49a698f834b731964fa17ef7d1a2b4e10dcba892 | [
"Apache-2.0"
] | null | null | null | account/api/serializers.py | Shubhamag19/Login-SignUp-DRF | 49a698f834b731964fa17ef7d1a2b4e10dcba892 | [
"Apache-2.0"
] | null | null | null | account/api/serializers.py | Shubhamag19/Login-SignUp-DRF | 49a698f834b731964fa17ef7d1a2b4e10dcba892 | [
"Apache-2.0"
] | null | null | null | from django.contrib.auth import get_user_model
from django.db.models import Q
from rest_framework import serializers
from .. import models
from rest_framework.serializers import (
ModelSerializer,
ValidationError,
)
# User = get_user_model()
class StuCreateSerializer(ModelSerializer):
email = serial... | 36.441176 | 114 | 0.611461 |
4a0b7b61dd427edf9e6e8e43034bf7c9c4d55d65 | 4,734 | py | Python | homeassistant/components/upnp/device.py | andiwand/home-assistant | eb584a26e29c3b7998f2ef89a1dcd8bd41e9bb21 | [
"Apache-2.0"
] | 4 | 2019-01-10T14:47:54.000Z | 2021-04-22T02:06:27.000Z | homeassistant/components/upnp/device.py | au190/home-assistant | e87ecbd5007acad7468d7118d02b21f6d783c8bc | [
"Apache-2.0"
] | 5 | 2021-02-08T20:50:07.000Z | 2022-03-12T00:39:31.000Z | homeassistant/components/upnp/device.py | au190/home-assistant | e87ecbd5007acad7468d7118d02b21f6d783c8bc | [
"Apache-2.0"
] | 3 | 2018-08-29T19:26:20.000Z | 2020-01-19T11:58:22.000Z | """Hass representation of an UPnP/IGD."""
import asyncio
from ipaddress import IPv4Address
import aiohttp
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.typing import HomeAssistantType
from .const import LOGGER as _LOGGER
class Device:
"""Hass representation... | 36.697674 | 73 | 0.619772 |
4a0b7d227e301a548c50367abf12a3c206c84b35 | 2,055 | py | Python | migrations/env.py | tbsschroeder/dbas | 9c86eccde65cd64bc5719573b3b8449d8f333e08 | [
"MIT"
] | 23 | 2017-05-18T13:33:51.000Z | 2021-12-26T18:04:09.000Z | migrations/env.py | tbsschroeder/dbas | 9c86eccde65cd64bc5719573b3b8449d8f333e08 | [
"MIT"
] | 8 | 2019-12-26T17:19:44.000Z | 2020-05-28T15:38:31.000Z | migrations/env.py | tbsschroeder/dbas | 9c86eccde65cd64bc5719573b3b8449d8f333e08 | [
"MIT"
] | 7 | 2017-09-27T11:15:42.000Z | 2021-12-26T18:12:38.000Z | """Pylons bootstrap environment.
Place 'pylons_config_file' into alembic.ini, and the application will
be loaded from there.
"""
import os
from alembic import context
from sqlalchemy import engine_from_config
from dbas.database import get_db_environs, DiscussionBase
# customize this section for non-standard engine... | 27.4 | 87 | 0.716302 |
4a0b7e00c57e7fc8b68782db9e635d23a9811244 | 4,728 | py | Python | Evo_Path_min.py | oossparsa/country-tour | 7bf900f52b507b792094423f180318807759d23e | [
"MIT"
] | null | null | null | Evo_Path_min.py | oossparsa/country-tour | 7bf900f52b507b792094423f180318807759d23e | [
"MIT"
] | null | null | null | Evo_Path_min.py | oossparsa/country-tour | 7bf900f52b507b792094423f180318807759d23e | [
"MIT"
] | null | null | null | #parsa badiei
import random
path = './'
positions = []
def start():
global positions
positions = get_positions(path+"Positions_(cities).txt")
p= int (input('population ? '))
u= int (input('number of parents ? '))
l = p-u
preparefile()
fitness=[20000]
iteration = 0
... | 27.488372 | 147 | 0.577411 |
4a0b7e0ff5288c03300fa120cf9be0ed2bc74a87 | 1,528 | py | Python | src/applications/blog/models.py | Cheshir-wrr/TMSZ37 | da807c939c5898b92032076c480137da44112b07 | [
"MIT"
] | null | null | null | src/applications/blog/models.py | Cheshir-wrr/TMSZ37 | da807c939c5898b92032076c480137da44112b07 | [
"MIT"
] | 7 | 2021-04-06T18:19:48.000Z | 2021-09-22T19:43:54.000Z | src/applications/blog/models.py | Cheshir-wrr/TMSZ37 | da807c939c5898b92032076c480137da44112b07 | [
"MIT"
] | null | null | null | import delorean
from django.contrib.auth import get_user_model
from django.db import models
from django.db.models import Manager
from django.urls import reverse_lazy
User = get_user_model()
def _now():
return delorean.utcnow().datetime
class PostManager(Manager):
pass
class Post(models.Model):
object... | 26.344828 | 81 | 0.689136 |
4a0b7ed73ee162d9a45fd760877953a4f54987d8 | 5,882 | py | Python | trafaret_config/simple.py | phipleg/trafaret-config | 0063a5027e7db015e0b0b0dafd8159df409121f2 | [
"Apache-2.0",
"MIT"
] | 26 | 2016-12-07T16:40:44.000Z | 2020-11-09T03:27:23.000Z | trafaret_config/simple.py | phipleg/trafaret-config | 0063a5027e7db015e0b0b0dafd8159df409121f2 | [
"Apache-2.0",
"MIT"
] | 6 | 2017-10-27T13:50:21.000Z | 2020-09-24T17:08:48.000Z | trafaret_config/simple.py | phipleg/trafaret-config | 0063a5027e7db015e0b0b0dafd8159df409121f2 | [
"Apache-2.0",
"MIT"
] | 5 | 2016-12-05T10:23:29.000Z | 2020-06-05T15:31:24.000Z | import os
import re
from weakref import WeakKeyDictionary
from io import StringIO
import trafaret as _trafaret
from yaml import load, dump, ScalarNode
from yaml.scanner import ScannerError
try:
from yaml import CSafeLoader as SafeLoader
except ImportError:
from yaml import SafeLoader
from .error import Config... | 30.164103 | 77 | 0.591125 |
4a0b7ed7e6003314fc9ff03b24c9b17f61e6d483 | 3,314 | py | Python | vnpy/trader/vtFunction.py | alonemelive/vnpy | be2122f88fb2319d2b9dd6d787efbed00655daaa | [
"MIT"
] | null | null | null | vnpy/trader/vtFunction.py | alonemelive/vnpy | be2122f88fb2319d2b9dd6d787efbed00655daaa | [
"MIT"
] | null | null | null | vnpy/trader/vtFunction.py | alonemelive/vnpy | be2122f88fb2319d2b9dd6d787efbed00655daaa | [
"MIT"
] | null | null | null | # encoding: UTF-8
"""
包含一些开发中常用的函数
"""
import os
import decimal
import json
import traceback
from datetime import datetime
from math import isnan
#----------------------------------------------------------------------
def safeUnicode(value):
"""检查接口数据潜在的错误,保证转化为的字符串正确"""
# 检查是数字接近0时会出现的浮点数上限
if type(val... | 26.512 | 80 | 0.562161 |
4a0b7f7535bd79fa9908f85dea394de249ae409b | 37,210 | py | Python | benchmarks/tpch/modin_queries.py | qinxuye/dataframe-benchmarks | 0452afa161af3a6ac01e1a43efc7d0fad74c73c2 | [
"Apache-2.0"
] | null | null | null | benchmarks/tpch/modin_queries.py | qinxuye/dataframe-benchmarks | 0452afa161af3a6ac01e1a43efc7d0fad74c73c2 | [
"Apache-2.0"
] | null | null | null | benchmarks/tpch/modin_queries.py | qinxuye/dataframe-benchmarks | 0452afa161af3a6ac01e1a43efc7d0fad74c73c2 | [
"Apache-2.0"
] | null | null | null | """
This code is adapted from
https://github.com/Bodo-inc/Bodo-examples/blob/master/examples/tpch/ray_queries.py
"""
import argparse
import time
import ray
import modin.pandas as pd
def load_lineitem(data_folder):
data_path = data_folder + "/lineitem.pq"
df = pd.read_parquet(
data_path,
)
r... | 34.613953 | 113 | 0.603225 |
4a0b80f7159be69aa7cdd2616a0f226abe08f9b5 | 3,833 | py | Python | dev/circuitpython/examples/rfm69_rpi_interrupt.py | scripsi/picodeebee | 0ec77e92f09fa8711705623482e57a5e0b702696 | [
"MIT"
] | 7 | 2021-03-15T10:06:20.000Z | 2022-03-23T02:53:15.000Z | Lights/adafruit-circuitpython-bundle-6.x-mpy-20210310/examples/rfm69_rpi_interrupt.py | IanSMoyes/SpiderPi | cc3469980ae87b92d0dc43c05dbd579f0fa8c4b1 | [
"Apache-2.0"
] | 5 | 2021-04-27T18:21:11.000Z | 2021-05-02T14:17:14.000Z | Lights/adafruit-circuitpython-bundle-6.x-mpy-20210310/examples/rfm69_rpi_interrupt.py | IanSMoyes/SpiderPi | cc3469980ae87b92d0dc43c05dbd579f0fa8c4b1 | [
"Apache-2.0"
] | null | null | null | # SPDX-FileCopyrightText: 2020 Tony DiCola, Jerry Needell for Adafruit Industries
# SPDX-License-Identifier: MIT
# Example using Interrupts to send a message and then wait indefinitely for messages
# to be received. Interrupts are used only for receive. sending is done with polling.
# This example is for systems ... | 41.215054 | 97 | 0.715106 |
4a0b81235c2a09c734ab00ab068170212a6a89ab | 10,054 | py | Python | print_results.py | jooooohannes/h2-mapping | 362324a02feaa9a439c4b1240367288b3a4aca46 | [
"MIT"
] | null | null | null | print_results.py | jooooohannes/h2-mapping | 362324a02feaa9a439c4b1240367288b3a4aca46 | [
"MIT"
] | null | null | null | print_results.py | jooooohannes/h2-mapping | 362324a02feaa9a439c4b1240367288b3a4aca46 | [
"MIT"
] | null | null | null | import pandas as pd
from Transport_cost_functions import *
from geo_path import *
import plotly.graph_objects as go
def print_basic_results(df):
"""Prints the important results from the input dataframe."""
min_cost = min(df['Total Cost per kg H2'])
mindex = df.index.values[df['Total Cost per kg H... | 47.649289 | 128 | 0.647603 |
4a0b81c67aee59e123c7813b5f7173af2e915ecf | 1,273 | py | Python | commlit/up_scale.py | robert-manolache/kaggle-commlit | 7d377d43559c19915158230e4ac5f5a5d2a308bf | [
"MIT"
] | null | null | null | commlit/up_scale.py | robert-manolache/kaggle-commlit | 7d377d43559c19915158230e4ac5f5a5d2a308bf | [
"MIT"
] | null | null | null | commlit/up_scale.py | robert-manolache/kaggle-commlit | 7d377d43559c19915158230e4ac5f5a5d2a308bf | [
"MIT"
] | null | null | null |
# -------------------------- # -------------------------- #
# Upscaling data size module # -------------------------- #
# -------------------------- # -------------------------- #
import numpy as np
import pandas as pd
def upscale_targets(df, n=10):
"""
"""
og_cols = df.columns
if n > 1:
... | 28.288889 | 62 | 0.427337 |
4a0b8204a20ec640a161ca686e82095226ee656a | 11,841 | py | Python | djangosige/apps/fiscal/models/nota_fiscal.py | felipealbuquerq/djangoSIGE | 2af100fa23b60a1b0d489d511e92e7fde52e214a | [
"MIT"
] | 1 | 2018-08-24T01:29:49.000Z | 2018-08-24T01:29:49.000Z | djangosige/apps/fiscal/models/nota_fiscal.py | felipealbuquerq/djangoSIGE | 2af100fa23b60a1b0d489d511e92e7fde52e214a | [
"MIT"
] | null | null | null | djangosige/apps/fiscal/models/nota_fiscal.py | felipealbuquerq/djangoSIGE | 2af100fa23b60a1b0d489d511e92e7fde52e214a | [
"MIT"
] | 1 | 2020-07-30T00:03:48.000Z | 2020-07-30T00:03:48.000Z | # -*- coding: utf-8 -*-
from django.db import models
from django.core.validators import RegexValidator, MinValueValidator
from django.template.defaultfilters import date
from decimal import Decimal
import os
import re
from djangosige.configs.settings import MEDIA_ROOT, APP_ROOT
IND_PAG_ESCOLHAS = (
(u'0', u'Pa... | 34.929204 | 113 | 0.638544 |
4a0b8213f39a268ec4669c50d1e2a67c7a592920 | 1,216 | py | Python | chapter_01/p06_string_compression.py | efecini/cracking-the-code-interview | 488b46a6f66184e28f88cd459be427e8a31e77f4 | [
"MIT"
] | null | null | null | chapter_01/p06_string_compression.py | efecini/cracking-the-code-interview | 488b46a6f66184e28f88cd459be427e8a31e77f4 | [
"MIT"
] | null | null | null | chapter_01/p06_string_compression.py | efecini/cracking-the-code-interview | 488b46a6f66184e28f88cd459be427e8a31e77f4 | [
"MIT"
] | null | null | null | import time
import unittest
def compress_string(string):
compressed = []
counter = 0
for i in range(len(string)): # noqa
if i != 0 and string[i] != string[i - 1]:
compressed.append(string[i - 1] + str(counter))
counter = 0
counter += 1
# add last repeated cha... | 25.333333 | 64 | 0.555099 |
4a0b831669978d66ee48a67c9073f513129e9221 | 775 | py | Python | sklvq/distances/tests/test_euclidean.py | rickvanveen/LVQLib | 4fba52a14ed37b0444becb96ef09c40d38d263ff | [
"BSD-3-Clause"
] | 44 | 2020-10-21T19:54:29.000Z | 2022-03-23T15:43:52.000Z | sklvq/distances/tests/test_euclidean.py | rickvanveen/LVQLib | 4fba52a14ed37b0444becb96ef09c40d38d263ff | [
"BSD-3-Clause"
] | 40 | 2020-10-30T13:34:23.000Z | 2021-06-30T09:32:59.000Z | sklvq/distances/tests/test_euclidean.py | rickvanveen/LVQLib | 4fba52a14ed37b0444becb96ef09c40d38d263ff | [
"BSD-3-Clause"
] | 5 | 2021-03-15T13:10:03.000Z | 2021-06-22T16:32:38.000Z | import numpy as np
from .test_common import check_distance
from .test_common import check_init_distance
from sklvq.models import GLVQ
def test_euclidean():
check_init_distance("euclidean")
data = np.array([[1, 2, 3], [-1, -2, -3], [0, 0, 0]], dtype="float64")
p = np.array([[1, 2, 3], [-1, -2, -3], [0,... | 24.21875 | 74 | 0.650323 |
4a0b83ac4ac42ec6cc437a1a5de66d18953e9d3a | 931 | bzl | Python | third_party/llvm/workspace.bzl | glarik/tensorflow | 0022bdd0838cc3783c60804ba0bdeebf3d51df21 | [
"Apache-2.0"
] | 1 | 2021-12-15T18:26:58.000Z | 2021-12-15T18:26:58.000Z | third_party/llvm/workspace.bzl | glarik/tensorflow | 0022bdd0838cc3783c60804ba0bdeebf3d51df21 | [
"Apache-2.0"
] | null | null | null | third_party/llvm/workspace.bzl | glarik/tensorflow | 0022bdd0838cc3783c60804ba0bdeebf3d51df21 | [
"Apache-2.0"
] | null | null | null | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "df6d0579e18e868ef4b6e97794eacd5af86e1b8a"
LLVM_SHA256 = "badaf6e0e5331669a7d572e0c45f2ed611629e9340a0212e891acbd29730f069"
tf_http_archive(
... | 38.791667 | 149 | 0.646617 |
4a0b847d2faeaba392f9f41a482c20b0ed243ebe | 1,381 | py | Python | Scripts/allocationcheck.py | mrbinx/mrbinx_python | abc14762f6afd4e23ccd95cecd59a637ced20d89 | [
"MIT"
] | null | null | null | Scripts/allocationcheck.py | mrbinx/mrbinx_python | abc14762f6afd4e23ccd95cecd59a637ced20d89 | [
"MIT"
] | null | null | null | Scripts/allocationcheck.py | mrbinx/mrbinx_python | abc14762f6afd4e23ccd95cecd59a637ced20d89 | [
"MIT"
] | null | null | null |
inp = str("X = alloc(regA, regB, regA, regC, regA) ;\
X = alloc(regA, regB, regA, regC, regB) ;\
X = alloc(regA, regB, regC, regA, regB) ;\
X = alloc(regA, regB, regC, regA, regC) ;\
X = alloc(regA, regC, regA, regB, regA) ;\
X = alloc(regA, regC, regA, regB, regC) ;\
X = alloc(regA, regC, regB, regA, regB) ;\
X = all... | 28.183673 | 53 | 0.57929 |
4a0b8503fed2bba423cb0c1d9b961292728e789a | 6,010 | py | Python | lib/python/treadmill/dnsctx.py | krcooke/treadmill | 613008fee88a150f983ab12d8ef2e118fb77bb51 | [
"Apache-2.0"
] | 133 | 2016-09-15T13:36:12.000Z | 2021-01-18T06:29:13.000Z | lib/python/treadmill/dnsctx.py | krcooke/treadmill | 613008fee88a150f983ab12d8ef2e118fb77bb51 | [
"Apache-2.0"
] | 108 | 2016-12-28T23:41:27.000Z | 2020-03-05T21:20:37.000Z | lib/python/treadmill/dnsctx.py | krcooke/treadmill | 613008fee88a150f983ab12d8ef2e118fb77bb51 | [
"Apache-2.0"
] | 69 | 2016-09-23T20:38:58.000Z | 2020-11-11T02:31:21.000Z | """DNS Context.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import os
import random
from treadmill import dnsutils
from treadmill import context
_LOGGER = logging.getLogger(__name__)
def _r... | 26.359649 | 75 | 0.63411 |
4a0b853f3997dbeb60a732fbce26af498a89c9e3 | 24,311 | py | Python | test/aqua/test_amplitude_estimation_circuitfactory.py | MartenSkogh/qiskit-aqua | 4a997e6328e06e250212ef82c9414ad16834b7c6 | [
"Apache-2.0"
] | 1 | 2020-10-02T15:35:03.000Z | 2020-10-02T15:35:03.000Z | test/aqua/test_amplitude_estimation_circuitfactory.py | MartenSkogh/qiskit-aqua | 4a997e6328e06e250212ef82c9414ad16834b7c6 | [
"Apache-2.0"
] | null | null | null | test/aqua/test_amplitude_estimation_circuitfactory.py | MartenSkogh/qiskit-aqua | 4a997e6328e06e250212ef82c9414ad16834b7c6 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 38.959936 | 100 | 0.629879 |
4a0b857f7481f6f4728b557d7dce976aa52cdf93 | 2,765 | py | Python | arsenal/tests/unit/external/test_ironic_client_wrapper.py | rackerlabs/arsenal | 39b7a35a9af9dbfd05897c64b2971fcbd219ccdb | [
"Apache-2.0"
] | 5 | 2015-04-21T20:46:47.000Z | 2021-02-21T20:54:49.000Z | arsenal/tests/unit/external/test_ironic_client_wrapper.py | rackerlabs/arsenal | 39b7a35a9af9dbfd05897c64b2971fcbd219ccdb | [
"Apache-2.0"
] | 69 | 2015-02-12T19:50:17.000Z | 2017-01-11T20:20:49.000Z | arsenal/tests/unit/external/test_ironic_client_wrapper.py | rackerlabs/onmetal-image-scheduler | 39b7a35a9af9dbfd05897c64b2971fcbd219ccdb | [
"Apache-2.0"
] | 3 | 2015-08-25T21:39:24.000Z | 2017-03-13T17:41:04.000Z | # Copyright 2014 Red Hat, 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... | 41.268657 | 78 | 0.682459 |
4a0b8606e8316eab7dd6055007760cc0fb4e57de | 2,039 | py | Python | envs/__init__.py | bjinwright/env | 68bee09ef3224c2d7d94467f65173fbc1ae782bc | [
"Apache-2.0"
] | 23 | 2017-03-28T20:09:28.000Z | 2020-11-05T13:01:29.000Z | envs/__init__.py | bjinwright/env | 68bee09ef3224c2d7d94467f65173fbc1ae782bc | [
"Apache-2.0"
] | 14 | 2017-09-07T02:58:40.000Z | 2022-02-07T18:36:21.000Z | envs/__init__.py | bjinwright/env | 68bee09ef3224c2d7d94467f65173fbc1ae782bc | [
"Apache-2.0"
] | 8 | 2017-09-07T03:08:37.000Z | 2019-08-13T23:56:12.000Z | import ast
import json
import os
import sys
from decimal import Decimal
from .exceptions import EnvsValueException
_envs_list = []
class CLIArguments():
LIST_ENVS = 'list-envs'
CHECK_ENVS = 'check-envs'
CONVERT_SETTINGS = 'convert-settings'
ARGUMENTS = CLIArguments()
ENVS_RESULT_FILENAME = '.envs_resul... | 28.319444 | 109 | 0.600785 |
4a0b8663fad39445fa1c2d77c879aab1eb9e4e3c | 1,729 | py | Python | app/user/serializers.py | engr-mudassar/recipe-app-api | 83a16aaa4d1b1b8c25d3783a08b1c07b696a0947 | [
"MIT"
] | null | null | null | app/user/serializers.py | engr-mudassar/recipe-app-api | 83a16aaa4d1b1b8c25d3783a08b1c07b696a0947 | [
"MIT"
] | null | null | null | app/user/serializers.py | engr-mudassar/recipe-app-api | 83a16aaa4d1b1b8c25d3783a08b1c07b696a0947 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model, authenticate
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
class UserSerializer(serializers.ModelSerializer):
"""Serializer for the users objects"""
class Meta:
model = get_user_model()
fields = ... | 30.875 | 74 | 0.646038 |
4a0b86641855b96c325baa6b1838e46caf06af5b | 374 | py | Python | modoboa/dnstools/factories.py | Arvedui/modoboa | 404f4bc0f544506d23ac534ff02ae6c6e3b6558c | [
"ISC"
] | 2 | 2021-04-20T19:40:09.000Z | 2021-04-20T20:23:57.000Z | modoboa/dnstools/factories.py | vavilon/modoboa | 9fcd133bc883a94cbf66c5bc9687787caadc8ca2 | [
"0BSD"
] | 19 | 2021-05-05T03:31:52.000Z | 2021-12-11T09:58:52.000Z | modoboa/dnstools/factories.py | vavilon/modoboa | 9fcd133bc883a94cbf66c5bc9687787caadc8ca2 | [
"0BSD"
] | 1 | 2020-01-10T11:43:00.000Z | 2020-01-10T11:43:00.000Z | """App related factories."""
from __future__ import unicode_literals
import factory
from modoboa.admin import factories as admin_factories
from . import models
class DNSRecordFactory(factory.django.DjangoModelFactory):
"""Factory for dns records."""
class Meta:
model = models.DNSRecord
domai... | 19.684211 | 62 | 0.759358 |
4a0b87c5523556bf87d62178987918e532f9d133 | 1,630 | py | Python | unittests/declaration_files_tester.py | mamoll/pygccxml | 91348c3e56ec891496c00bc7771e647791114c7d | [
"BSL-1.0"
] | null | null | null | unittests/declaration_files_tester.py | mamoll/pygccxml | 91348c3e56ec891496c00bc7771e647791114c7d | [
"BSL-1.0"
] | null | null | null | unittests/declaration_files_tester.py | mamoll/pygccxml | 91348c3e56ec891496c00bc7771e647791114c7d | [
"BSL-1.0"
] | null | null | null | # Copyright 2014-2016 Insight Software Consortium.
# Copyright 2004-2008 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
import os
import unittest
import parser_test_case
from pygccxml import parser
from pygccxml import declarations
class teste... | 30.185185 | 65 | 0.669939 |
4a0b886fedfbd42b40be1f2a23010b9f3aec0f5b | 332 | py | Python | api/tests/health.py | DarkbordermanTemplate/fastapi-redis-sqlalchemy | 80fbdc419b19592b08bc2227c9d7c2925b7b91e2 | [
"BSD-2-Clause"
] | 5 | 2021-02-08T06:37:48.000Z | 2021-09-12T14:55:34.000Z | api/tests/test_endpoint/health.py | DarkbordermanTemplate/fastapi-redis-linebot | 36a5a945c9f38dfccfe4a7b5e507db6dd82a6768 | [
"BSD-2-Clause"
] | null | null | null | api/tests/test_endpoint/health.py | DarkbordermanTemplate/fastapi-redis-linebot | 36a5a945c9f38dfccfe4a7b5e507db6dd82a6768 | [
"BSD-2-Clause"
] | null | null | null | import pytest
from tests import APITestcase, AssertRequest, AssertResponse
ROUTE = "/health"
CASES = [
APITestcase(
"ok", AssertRequest("GET", ROUTE, None, None), AssertResponse("OK", 200)
)
]
@pytest.mark.parametrize("case", CASES, ids=[case.name for case in CASES])
def test(case: APITestcase):
... | 20.75 | 80 | 0.680723 |
4a0b88dab2daf4cf75516a094936b2dc39fa93d4 | 14,134 | py | Python | test/functional/p2p_unrequested_blocks.py | qtumcashproject/qtumcash | 4f095de839e524c4d43a861769695d199bfd7544 | [
"MIT"
] | 2 | 2020-04-30T09:41:04.000Z | 2020-05-08T12:03:21.000Z | test/functional/p2p_unrequested_blocks.py | qtumcashproject/qtumcash | 4f095de839e524c4d43a861769695d199bfd7544 | [
"MIT"
] | null | null | null | test/functional/p2p_unrequested_blocks.py | qtumcashproject/qtumcash | 4f095de839e524c4d43a861769695d199bfd7544 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test processing of unrequested blocks.
Setup: two nodes, node0+node1, not connected to each other. Nod... | 44.446541 | 113 | 0.681902 |
4a0b89c24e2965e8b78647be24aa02954a5a7154 | 4,326 | py | Python | clippercard/client.py | goldengate88/clippercard-python | adf4548fc61b848b625d0547ba512f12a2a1d615 | [
"MIT"
] | null | null | null | clippercard/client.py | goldengate88/clippercard-python | adf4548fc61b848b625d0547ba512f12a2a1d615 | [
"MIT"
] | null | null | null | clippercard/client.py | goldengate88/clippercard-python | adf4548fc61b848b625d0547ba512f12a2a1d615 | [
"MIT"
] | null | null | null | """
Copyright (c) 2012-2021 (https://github.com/clippercard/clippercard-python)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use,... | 33.276923 | 80 | 0.661812 |
4a0b8aa172d699d5be86361d3461c9b6503c610f | 92 | py | Python | test/basic/store.py | eseunghwan/brue | 0a8b856cb610c51f6386c074a96add9a1a5d40d7 | [
"MIT"
] | 1 | 2021-11-15T15:02:47.000Z | 2021-11-15T15:02:47.000Z | test/basic/store.py | eseunghwan/brue | 0a8b856cb610c51f6386c074a96add9a1a5d40d7 | [
"MIT"
] | null | null | null | test/basic/store.py | eseunghwan/brue | 0a8b856cb610c51f6386c074a96add9a1a5d40d7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from brue import brueStore
store = brueStore(
count_num = 1
)
| 11.5 | 26 | 0.619565 |
4a0b8aea196d76615c0dcb4567e6c2448df2028e | 1,369 | py | Python | extensions/setup.py | Wintakeb/mypy | fc4ad4db1a0e070d719e0844d35ef4f144cc24e0 | [
"PSF-2.0"
] | null | null | null | extensions/setup.py | Wintakeb/mypy | fc4ad4db1a0e070d719e0844d35ef4f144cc24e0 | [
"PSF-2.0"
] | null | null | null | extensions/setup.py | Wintakeb/mypy | fc4ad4db1a0e070d719e0844d35ef4f144cc24e0 | [
"PSF-2.0"
] | 1 | 2019-02-13T04:45:01.000Z | 2019-02-13T04:45:01.000Z | # NOTE: This package must support Python 2.7 in addition to Python 3.x
from setuptools import setup
version = '0.4.0-dev'
description = 'Experimental type system extensions for programs checked with the mypy typechecker.'
long_description = '''
Mypy Extensions
===============
The "mypy_extensions" module defines exp... | 30.422222 | 99 | 0.669832 |
4a0b8c041e2f2ab1e0a62d716d8cb0b86ceb22e9 | 2,008 | py | Python | examples/example_parametric_reactors/make_animation.py | PullRequest-Agent/paramak | f807d88098458d1975dd1a4a47dcea22d9f74785 | [
"MIT"
] | 1 | 2020-11-25T10:46:32.000Z | 2020-11-25T10:46:32.000Z | examples/example_parametric_reactors/make_animation.py | PullRequest-Agent/paramak | f807d88098458d1975dd1a4a47dcea22d9f74785 | [
"MIT"
] | null | null | null | examples/example_parametric_reactors/make_animation.py | PullRequest-Agent/paramak | f807d88098458d1975dd1a4a47dcea22d9f74785 | [
"MIT"
] | null | null | null | __doc__ = """ Creates a series of images of a ball reactor images and
combines them into gif animations using the command line tool convert,
part of the imagemagick suite """
import argparse
import os
import uuid
import numpy as np
import paramak
from tqdm import tqdm
parser = argparse.ArgumentParser()
parser.add_a... | 34.62069 | 73 | 0.72261 |
4a0b8cf0670b20997b5b07e86eb9e2095c08cffb | 489 | py | Python | api/src/handlers/status.py | vai0/Citizen-Center | 77fd113d2dc8af3e2436c1a94c0b0f75ad3fab59 | [
"MIT"
] | null | null | null | api/src/handlers/status.py | vai0/Citizen-Center | 77fd113d2dc8af3e2436c1a94c0b0f75ad3fab59 | [
"MIT"
] | null | null | null | api/src/handlers/status.py | vai0/Citizen-Center | 77fd113d2dc8af3e2436c1a94c0b0f75ad3fab59 | [
"MIT"
] | null | null | null | import logging
import azure.functions as func
import simplejson as json
from os import environ
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
version = '0.0.0'
if (environ["CP_VERSION"]):
version = environ["CP_VERSION"]
... | 21.26087 | 97 | 0.672802 |
4a0b8d801de90ba05298d774df75e3b866b94c15 | 7,898 | py | Python | dlp/synth.py | hzyi-google/google-cloud-python | aa3c3ca303b385a6b118204ce91fa803c1d001b9 | [
"Apache-2.0"
] | 1 | 2020-01-09T14:42:37.000Z | 2020-01-09T14:42:37.000Z | dlp/synth.py | hzyi-google/google-cloud-python | aa3c3ca303b385a6b118204ce91fa803c1d001b9 | [
"Apache-2.0"
] | 6 | 2019-05-27T22:05:58.000Z | 2019-08-05T16:46:16.000Z | dlp/synth.py | hzyi-google/google-cloud-python | aa3c3ca303b385a6b118204ce91fa803c1d001b9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 30.494208 | 87 | 0.582299 |
4a0b8feabde7e95e353640e11f8f53d7d3c9d6db | 412 | py | Python | tpvenv/Scripts/pip-script.py | fgetwewr/tphone | 434b7088c33ac9ea4992d30ff59a853e7e2b3188 | [
"MIT"
] | null | null | null | tpvenv/Scripts/pip-script.py | fgetwewr/tphone | 434b7088c33ac9ea4992d30ff59a853e7e2b3188 | [
"MIT"
] | null | null | null | tpvenv/Scripts/pip-script.py | fgetwewr/tphone | 434b7088c33ac9ea4992d30ff59a853e7e2b3188 | [
"MIT"
] | null | null | null | #!C:\Users\shuai\Desktop\project\tphone\tpvenv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip'
__requires__ = 'pip==10.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[... | 31.692308 | 69 | 0.667476 |
4a0b9011cac0f8e452055e0d5ca5c467f84265eb | 19,884 | py | Python | Bio/Align/Applications/_Mafft.py | bioinf-mcb/biopython | 1a1f4a7ee4e0efba517d3d607c56c27e72e399cc | [
"BSD-3-Clause"
] | 5 | 2015-06-14T17:01:57.000Z | 2020-10-05T03:27:56.000Z | Bio/Align/Applications/_Mafft.py | uci-ics-32/biopython | ff7d3703d442192a1f6d84c52e028d566d44ff1c | [
"BSD-3-Clause"
] | 14 | 2021-03-26T20:54:22.000Z | 2021-04-06T17:18:53.000Z | Bio/Align/Applications/_Mafft.py | uci-ics-32/biopython | ff7d3703d442192a1f6d84c52e028d566d44ff1c | [
"BSD-3-Clause"
] | 8 | 2016-02-20T22:53:21.000Z | 2022-02-04T06:10:23.000Z | # Copyright 2009 by Cymon J. Cox. All rights reserved.
#
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included as part of this
# package.
"""Command line wrapper fo... | 45.605505 | 87 | 0.550795 |
4a0b9260713374341ea40cddf439cd5e6917effe | 1,372 | py | Python | tests/test_modelling.py | dennisbrookner/pymol-psico | 3c7730882e879fe5d23e57dd808b9642a4413b0e | [
"BSD-2-Clause"
] | null | null | null | tests/test_modelling.py | dennisbrookner/pymol-psico | 3c7730882e879fe5d23e57dd808b9642a4413b0e | [
"BSD-2-Clause"
] | null | null | null | tests/test_modelling.py | dennisbrookner/pymol-psico | 3c7730882e879fe5d23e57dd808b9642a4413b0e | [
"BSD-2-Clause"
] | 1 | 2021-12-27T14:25:52.000Z | 2021-12-27T14:25:52.000Z | import psico.modelling
from pymol import cmd
from pathlib import Path
DATA_PATH = Path(__file__).resolve().parent / 'data'
def test_mutate():
cmd.reinitialize()
cmd.load(DATA_PATH / '2x19-frag-mse.pdb')
psico.modelling.mutate("resi 134", "K", inplace=1)
assert psico.modelling.get_seq("all") == "LSKMP... | 29.826087 | 66 | 0.672012 |
4a0b935510aec2ba7a413a526862bc3b48785362 | 982 | py | Python | docs/examples/lib/gui-qt.py | ivanov/ipython | 62cc379d3b454923cb48e94663f385f54ec806cc | [
"BSD-3-Clause-Clear"
] | 2 | 2015-04-21T12:12:43.000Z | 2015-04-21T12:12:54.000Z | docs/examples/lib/gui-qt.py | 08saikiranreddy/ipython | 3498382180ad409592f46a9dd0d190ca917bfbff | [
"BSD-3-Clause-Clear"
] | 1 | 2015-07-16T22:26:53.000Z | 2015-07-16T22:26:53.000Z | docs/examples/lib/gui-qt.py | 08saikiranreddy/ipython | 3498382180ad409592f46a9dd0d190ca917bfbff | [
"BSD-3-Clause-Clear"
] | null | null | null | #!/usr/bin/env python
"""Simple Qt4 example to manually test event loop integration.
This is meant to run tests manually in ipython as:
In [5]: %gui qt
In [6]: %run gui-qt.py
Ref: Modified from http://zetcode.com/tutorials/pyqt4/firstprograms/
"""
import sys
from PyQt4 import QtGui, QtCore
class SimpleWindow(QtGu... | 23.95122 | 68 | 0.645621 |
4a0b94139858bea57c03fd3396c4679677d92ada | 737 | py | Python | setup.py | laurentb/confman | 1f8d05f494a8b3c8fbf89a477b2bd67bc60dbac7 | [
"MIT"
] | null | null | null | setup.py | laurentb/confman | 1f8d05f494a8b3c8fbf89a477b2bd67bc60dbac7 | [
"MIT"
] | null | null | null | setup.py | laurentb/confman | 1f8d05f494a8b3c8fbf89a477b2bd67bc60dbac7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='confman',
version='0.3.1',
description='Lazy, rootless, yet powerful config file management mostly using symlinks',
long_description=open('README').read(),
author='Laurent Bachelier',
author_email='laurent@... | 30.708333 | 92 | 0.618725 |
4a0b945d7da4ac9d1d92a815f134a7a7d2790fb7 | 2,348 | py | Python | LeetCodeSolutions/LeetCode_0428.py | lih627/python-algorithm-templates | a61fd583e33a769b44ab758990625d3381793768 | [
"MIT"
] | 24 | 2020-03-28T06:10:25.000Z | 2021-11-23T05:01:29.000Z | LeetCodeSolutions/LeetCode_0428.py | lih627/python-algorithm-templates | a61fd583e33a769b44ab758990625d3381793768 | [
"MIT"
] | null | null | null | LeetCodeSolutions/LeetCode_0428.py | lih627/python-algorithm-templates | a61fd583e33a769b44ab758990625d3381793768 | [
"MIT"
] | 8 | 2020-05-18T02:43:16.000Z | 2021-05-24T18:11:38.000Z | """
# Definition for a Node.
class Node(object):
def __init__(self, val=None, children=None):
self.val = val
self.children = children
"""
class Codec:
def serialize(self, root: 'Node') -> str:
"""Encodes a tree to a single string.
:type root: Node
:rtype: str
"... | 27.623529 | 90 | 0.456985 |
4a0b94acaa55e9beb1a8b120291042a77eb23b64 | 5,940 | py | Python | pymatgen/symmetry/tests/test_settings.py | naik-aakash/pymatgen | 394e0d71bf1d1025fcf75498cbb16aa3f41ce78c | [
"MIT"
] | 1 | 2022-03-24T04:12:16.000Z | 2022-03-24T04:12:16.000Z | pymatgen/symmetry/tests/test_settings.py | naik-aakash/pymatgen | 394e0d71bf1d1025fcf75498cbb16aa3f41ce78c | [
"MIT"
] | null | null | null | pymatgen/symmetry/tests/test_settings.py | naik-aakash/pymatgen | 394e0d71bf1d1025fcf75498cbb16aa3f41ce78c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import unittest
import numpy as np
from pymatgen.symmetry.settings import JonesFaithfulTransformation, Lattice, SymmOp
__author__ = "Matthew Horton"
__copyright__ = "Copyright 2017, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Matthew Horton"
__email__ = "mkhorton@lbl.gov"
__st... | 30.306122 | 102 | 0.561111 |
4a0b956e639f4ab782a41258db5781282ba11b73 | 1,765 | py | Python | src/models/methods/_area.py | gayashiva/air_model | fb6fb02b866a821ee8a83551be78c25bdb7da7c9 | [
"FTL"
] | 3 | 2021-12-23T18:12:40.000Z | 2022-01-12T10:48:21.000Z | src/models/methods/_area.py | Gayashiva/AIR_model | fb6fb02b866a821ee8a83551be78c25bdb7da7c9 | [
"FTL"
] | 1 | 2022-01-31T15:59:08.000Z | 2022-01-31T15:59:08.000Z | src/models/methods/_area.py | gayashiva/air_model | fb6fb02b866a821ee8a83551be78c25bdb7da7c9 | [
"FTL"
] | null | null | null | """Icestupa class function that calculates surface area, ice radius and height
"""
import pandas as pd
import math
import numpy as np
from functools import lru_cache
import logging
logger = logging.getLogger("__main__")
def get_area(self, i):
if (self.df.j_cone[i]> 0) & (
self.df.loc[i - 1, "r_cone"] >= ... | 28.467742 | 86 | 0.503116 |
4a0b95f53edbf0d297051471f1fc396cc0964007 | 2,237 | py | Python | model-optimizer/mo/front/kaldi/extractors/splice_component_ext.py | Dimitri1/openvino | 05d97220d21a2ed91377524883485fdadf660761 | [
"Apache-2.0"
] | 3 | 2020-02-09T23:25:37.000Z | 2021-01-19T09:44:12.000Z | model-optimizer/mo/front/kaldi/extractors/splice_component_ext.py | Dimitri1/openvino | 05d97220d21a2ed91377524883485fdadf660761 | [
"Apache-2.0"
] | null | null | null | model-optimizer/mo/front/kaldi/extractors/splice_component_ext.py | Dimitri1/openvino | 05d97220d21a2ed91377524883485fdadf660761 | [
"Apache-2.0"
] | 2 | 2020-04-18T16:24:39.000Z | 2021-01-19T09:42:19.000Z | """
Copyright (c) 2018-2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | 36.672131 | 103 | 0.671882 |
4a0b96850419e38fee6bfe26bfbe4655f62fd857 | 184 | py | Python | src/poms/msauth.py | lauro-cesar/poms | bbaa3c875d07ef041f429af074b4be9414abc8cb | [
"Apache-2.0"
] | 1 | 2021-07-31T21:12:03.000Z | 2021-07-31T21:12:03.000Z | src/poms/msauth.py | lauro-cesar/poms | bbaa3c875d07ef041f429af074b4be9414abc8cb | [
"Apache-2.0"
] | null | null | null | src/poms/msauth.py | lauro-cesar/poms | bbaa3c875d07ef041f429af074b4be9414abc8cb | [
"Apache-2.0"
] | null | null | null | import asyncio
import os
import ast
import signal
import sys
import threading
import websockets
class MsAuth():
def __init__(*args,**kwargs):
pass
def autotest():
return True | 12.266667 | 30 | 0.755435 |
4a0b96b3fad01c900abde76717842a65d3dc1ff4 | 1,136 | py | Python | datamgt/helpers/getRating.py | CareHomeHub/CareHomePlatform | d811084bb72810fc0c35c6ccab18745480aefb3d | [
"MIT"
] | 1 | 2021-02-16T00:41:40.000Z | 2021-02-16T00:41:40.000Z | datamgt/helpers/getRating.py | CareHomeHub/CareHomePlatform | d811084bb72810fc0c35c6ccab18745480aefb3d | [
"MIT"
] | 15 | 2021-02-16T00:34:01.000Z | 2021-04-07T23:33:21.000Z | datamgt/helpers/getRating.py | CareHomeHub/CareHomePlatform | d811084bb72810fc0c35c6ccab18745480aefb3d | [
"MIT"
] | null | null | null |
def getRatings(cqc_data):
cnt = 0
# count = len(cqc_data)
# print(count)
result = []
for element in cqc_data:
cnt += 1
doc={}
if 'currentRatings' in element['loc']:
doc["loc"] = element['loc']['locationId']
doc["overall"] = element['loc']['currentRat... | 43.692308 | 110 | 0.575704 |
4a0b97c467b1e130937780ac289f9a53f764cb05 | 2,555 | py | Python | examples/Python/ReconstructionSystem/integrate_scene.py | dmontagu/Open3D | 0667179c2d69f3e191104b6f70378b4dee6f406a | [
"MIT"
] | null | null | null | examples/Python/ReconstructionSystem/integrate_scene.py | dmontagu/Open3D | 0667179c2d69f3e191104b6f70378b4dee6f406a | [
"MIT"
] | 1 | 2021-01-21T13:43:32.000Z | 2021-01-21T13:43:32.000Z | examples/Python/ReconstructionSystem/integrate_scene.py | Surfndez/Open3D | 59c0645a169c589345a1b04753d5afdb5800b349 | [
"MIT"
] | 1 | 2019-09-20T22:26:49.000Z | 2019-09-20T22:26:49.000Z | # Open3D: www.open3d.org
# The MIT License (MIT)
# See license file or visit www.open3d.org for details
# examples/Python/Tutorial/ReconstructionSystem/integrate_scene.py
import numpy as np
import math
import sys
from open3d import *
sys.path.append("../Utility")
from file import *
def scalable_integrate_rgb_frames... | 41.209677 | 79 | 0.68728 |
4a0b97d766b23d42d47feface588f635c3a0b2f3 | 5,010 | py | Python | push_and_test/dependency_manager.py | dvnstrcklnd/pfish-tools | 605e0babaf526241c0b39c26617397380822e6b7 | [
"MIT"
] | null | null | null | push_and_test/dependency_manager.py | dvnstrcklnd/pfish-tools | 605e0babaf526241c0b39c26617397380822e6b7 | [
"MIT"
] | null | null | null | push_and_test/dependency_manager.py | dvnstrcklnd/pfish-tools | 605e0babaf526241c0b39c26617397380822e6b7 | [
"MIT"
] | null | null | null | import os
import glob
import re
import json
import subprocess
import time
import pathlib
class DependencyManager():
PFISH_CMD = "python3 ../script/pyfish.py"
NEWLINE = "\n"
def __init__(self, category, operation_type, dependencies_file, definitions):
self.operation_type_category = category
... | 37.954545 | 98 | 0.656287 |
4a0b97dd07f7f33a79771b4e9ca3680d7300b00e | 36,924 | py | Python | typhos/widgets.py | ronpandolfi/typhos | 2a92d895438d3b0fc41ad51dd5b7f783ca306cf1 | [
"BSD-3-Clause-LBNL"
] | null | null | null | typhos/widgets.py | ronpandolfi/typhos | 2a92d895438d3b0fc41ad51dd5b7f783ca306cf1 | [
"BSD-3-Clause-LBNL"
] | null | null | null | typhos/widgets.py | ronpandolfi/typhos | 2a92d895438d3b0fc41ad51dd5b7f783ca306cf1 | [
"BSD-3-Clause-LBNL"
] | null | null | null | """
Typhos widgets and related utilities.
"""
import collections
import datetime
import inspect
import logging
import numpy as np
import pydm
import pydm.widgets
import pydm.widgets.base
import pydm.widgets.byte
import pydm.widgets.enum_button
import qtawesome as qta
from ophyd.signal import EpicsSignalBase
from pydm... | 31.451448 | 79 | 0.631053 |
4a0b99db21c7acd63905dc5e9519ad2255d3a3c4 | 2,375 | py | Python | aegnn/utils/bounding_box.py | uzh-rpg/aegnn | d96e13b2f80f3c7515a65baf966544e0914d068d | [
"MIT"
] | null | null | null | aegnn/utils/bounding_box.py | uzh-rpg/aegnn | d96e13b2f80f3c7515a65baf966544e0914d068d | [
"MIT"
] | null | null | null | aegnn/utils/bounding_box.py | uzh-rpg/aegnn | d96e13b2f80f3c7515a65baf966544e0914d068d | [
"MIT"
] | null | null | null | import torch
import torchvision
from typing import Tuple, Union
def crop_to_frame(bbox: torch.Tensor, image_shape: Union[torch.Tensor, Tuple[int, int]]) -> torch.Tensor:
"""Checks if bounding boxes are inside the image frame of given shape. If not crop it to its border.
:param bbox: bounding box to check (x,... | 43.981481 | 108 | 0.632842 |
4a0b9c470e707f8cd4edfaa87a9d679286c7977a | 405 | py | Python | tools/stntools/stnmisc.py | HEATlab/durability | 85e53f497dfa609f76b5cbf7f5c9ee19deeb2755 | [
"MIT"
] | null | null | null | tools/stntools/stnmisc.py | HEATlab/durability | 85e53f497dfa609f76b5cbf7f5c9ee19deeb2755 | [
"MIT"
] | null | null | null | tools/stntools/stnmisc.py | HEATlab/durability | 85e53f497dfa609f76b5cbf7f5c9ee19deeb2755 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
## \fn replaceReceivedTimepoints(STN_1,STN_2)
# \brief modifies the zero timepoint bounds of the received timepoints
# of STN_2 so that they are the same as STN_1
def replaceReceivedTimepoints(STN_1, STN_2):
for timepoint in STN_1.receivedTimepoints:
STN_2.verts[timepoint] = STN_1.verts[... | 40.5 | 71 | 0.760494 |
4a0b9caabca07a0bdd98cfa7bdf2a16600d1d550 | 1,109 | py | Python | src/genie/libs/parser/iosxr/tests/ShowMsdpSummary/cli/equal/golden_output_1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 204 | 2018-06-27T00:55:27.000Z | 2022-03-06T21:12:18.000Z | src/genie/libs/parser/iosxr/tests/ShowMsdpSummary/cli/equal/golden_output_1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 468 | 2018-06-19T00:33:18.000Z | 2022-03-31T23:23:35.000Z | src/genie/libs/parser/iosxr/tests/ShowMsdpSummary/cli/equal/golden_output_1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 309 | 2019-01-16T20:21:07.000Z | 2022-03-30T12:56:41.000Z |
expected_output = {
'vrf': {
'VRF1': {
'current_external_active_sa': 0,
'maximum_external_sa_global': 20000,
'peer_address': {
'10.4.1.1': {
'active_sa_cnt': 0,
'as': 0,
'cfg_max_ext_sas': 0,
... | 28.435897 | 50 | 0.272317 |
4a0b9cc133aa65d7c937e6137c4061addf838b25 | 7,903 | py | Python | tests/test_sample_database.py | dm03514/piicatcher | c9c30d2dbda4d8c3d0e0d48e66dc282a22503b54 | [
"Apache-2.0"
] | null | null | null | tests/test_sample_database.py | dm03514/piicatcher | c9c30d2dbda4d8c3d0e0d48e66dc282a22503b54 | [
"Apache-2.0"
] | 1 | 2020-12-18T05:01:38.000Z | 2020-12-18T05:01:38.000Z | tests/test_sample_database.py | grofers/piicatcher | 181d008ba0aea4d7101fa83ddc075e9106164106 | [
"Apache-2.0"
] | null | null | null | import csv
from abc import ABC, abstractmethod
from argparse import Namespace
from unittest import TestCase
import psycopg2
import pymysql
import pytest
from piicatcher.explorer.databases import MySQLExplorer, PostgreSQLExplorer
def load_sample_data(connection):
create_table = """
CREATE TABLE SAMPLE(
... | 31.612 | 118 | 0.544224 |
4a0b9d374caa6e5304eb3661910731013974081d | 832 | py | Python | src/basic/010_buildins/use_htmlparser1.py | hbulpf/pydemo | 2989cc50781230718e46dcac5dc0ca70630ebffe | [
"Apache-2.0"
] | 6 | 2020-03-24T15:58:42.000Z | 2020-04-18T13:32:41.000Z | src/basic/010_buildins/use_htmlparser1.py | hbulpf/pydemo | 2989cc50781230718e46dcac5dc0ca70630ebffe | [
"Apache-2.0"
] | 1 | 2022-01-13T03:51:17.000Z | 2022-01-13T03:51:17.000Z | src/basic/010_buildins/use_htmlparser1.py | hbulpf/pydemo | 2989cc50781230718e46dcac5dc0ca70630ebffe | [
"Apache-2.0"
] | 1 | 2020-02-01T09:36:05.000Z | 2020-02-01T09:36:05.000Z | from html.parser import HTMLParser
from html.entities import name2codepoint
class MyHTMLParser(HTMLParser):
def handle_starttag(self, tag, attrs):
print('starttag: <%s>' % tag)
def handle_endtag(self, tag):
print('endtag:</%s>' % tag)
# def handle_startendtag(self, tag, attrs):
# ... | 25.212121 | 74 | 0.582933 |
4a0b9e616046210791c2258d23a8776590431bcc | 1,536 | py | Python | PostFeedbackHttpTrigger/tests/test_sanitise_input.py | office-for-students/feedback-api | 6f58d7c8de135dc71e5500fcaab71660ca6d7632 | [
"MIT"
] | null | null | null | PostFeedbackHttpTrigger/tests/test_sanitise_input.py | office-for-students/feedback-api | 6f58d7c8de135dc71e5500fcaab71660ca6d7632 | [
"MIT"
] | null | null | null | PostFeedbackHttpTrigger/tests/test_sanitise_input.py | office-for-students/feedback-api | 6f58d7c8de135dc71e5500fcaab71660ca6d7632 | [
"MIT"
] | 1 | 2019-09-29T07:04:44.000Z | 2019-09-29T07:04:44.000Z | import unittest
from SharedCode.utils import sanitise_url_string, sanitise_question_string
class TestSanitiseUrlString(unittest.TestCase):
def test_with_permitted_url(self):
input_url = (
"https://prod-discover-uni.azurewebsites.net/course-finder/"
"results/?subject_query=%22Artif... | 36.571429 | 84 | 0.725911 |
4a0b9ee96d9cd6133443bb700b398728debdfbae | 930 | py | Python | leetcode/704/main.py | shankar-shiv/CS1010E_Kattis_practice | 9a8597b7ab61d5afa108a8b943ca2bb3603180c6 | [
"MIT"
] | null | null | null | leetcode/704/main.py | shankar-shiv/CS1010E_Kattis_practice | 9a8597b7ab61d5afa108a8b943ca2bb3603180c6 | [
"MIT"
] | null | null | null | leetcode/704/main.py | shankar-shiv/CS1010E_Kattis_practice | 9a8597b7ab61d5afa108a8b943ca2bb3603180c6 | [
"MIT"
] | null | null | null | # You must write an algorithm with O(log n) runtime complexity.
# mid = L + (R-L) // 2
class Solution:
def search(self, nums: list[int], target: int) -> int:
if nums == []:
return -1
mid = len(nums) // 2 # or mid = lo + (high - lo) // 2
if target == nums[mid]:
retur... | 24.473684 | 63 | 0.512903 |
4a0b9f43885597fed018651c82384a78c8ce6f22 | 17,614 | py | Python | game_agent.py | nbclsc/AIND-Isolation-master | 11b20f5e52fa45f420d3f30b511578e17abedf09 | [
"MIT"
] | null | null | null | game_agent.py | nbclsc/AIND-Isolation-master | 11b20f5e52fa45f420d3f30b511578e17abedf09 | [
"MIT"
] | null | null | null | game_agent.py | nbclsc/AIND-Isolation-master | 11b20f5e52fa45f420d3f30b511578e17abedf09 | [
"MIT"
] | null | null | null | """Finish all TODO items in this file to complete the isolation project, then
test your agent's strength against a set of known agents using tournament.py
and include the results in your report.
"""
import random
class SearchTimeout(Exception):
"""Subclass base exception for code clarity. """
pass
def custom... | 36.849372 | 87 | 0.602021 |
4a0b9f9675fb114608861f3200ce890d4ef6eec9 | 3,471 | py | Python | tests/components/epson/test_config_flow.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 6 | 2017-08-02T19:26:39.000Z | 2020-03-14T22:47:41.000Z | tests/components/epson/test_config_flow.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 60 | 2020-07-06T15:10:30.000Z | 2022-03-31T06:01:46.000Z | tests/components/epson/test_config_flow.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 14 | 2018-08-19T16:28:26.000Z | 2021-09-02T18:26:53.000Z | """Test the epson config flow."""
from unittest.mock import patch
from homeassistant import config_entries, setup
from homeassistant.components.epson.const import DOMAIN
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT, STATE_UNAVAILABLE
async def test_form(hass):
"""Test we get the form."""
a... | 36.536842 | 85 | 0.659464 |
4a0ba0664ecfd878d30689b1365698b4f4a3b0bb | 24,976 | py | Python | python/venv/lib/python2.7/site-packages/openstackclient/tests/identity/v3/test_role.py | sjsucohort6/openstack | 8471e6e599c3f52319926a582358358ef84cbadb | [
"MIT"
] | null | null | null | python/venv/lib/python2.7/site-packages/openstackclient/tests/identity/v3/test_role.py | sjsucohort6/openstack | 8471e6e599c3f52319926a582358358ef84cbadb | [
"MIT"
] | null | null | null | python/venv/lib/python2.7/site-packages/openstackclient/tests/identity/v3/test_role.py | sjsucohort6/openstack | 8471e6e599c3f52319926a582358358ef84cbadb | [
"MIT"
] | null | null | null | # Copyright 2013 Nebula Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 31.695431 | 78 | 0.586083 |
4a0ba073a16b0bb01226fb6a115eddea0317400b | 2,987 | py | Python | configs/_base_/models/maskflownet.py | hologerry/mmflow | 40caf064851bd95317424e31cc137c0007a2bece | [
"Apache-2.0"
] | 481 | 2021-11-16T07:04:23.000Z | 2022-03-31T22:21:21.000Z | configs/_base_/models/maskflownet.py | hologerry/mmflow | 40caf064851bd95317424e31cc137c0007a2bece | [
"Apache-2.0"
] | 72 | 2021-11-16T12:25:55.000Z | 2022-03-28T13:10:45.000Z | configs/_base_/models/maskflownet.py | hologerry/mmflow | 40caf064851bd95317424e31cc137c0007a2bece | [
"Apache-2.0"
] | 48 | 2021-11-16T06:48:46.000Z | 2022-03-30T12:46:40.000Z | MaskflownetS_checkpoint = 'https://download.openmmlab.com/mmflow/maskflownet/maskflownets_8x1_sfine_flyingthings3d_subset_384x768.pth' # noqa
model = dict(
type='MaskFlowNet',
maskflownetS=dict(
type='MaskFlowNetS',
freeze_net=True,
encoder=dict(
type='PWCNetEncoder',
... | 38.792208 | 142 | 0.555072 |
4a0ba076d3a9576af25df3edbbb91f697a9f0d65 | 641 | py | Python | test/test_noise2.py | fsgeek/tikzplotlib | aee7a4ff145159476a7d07248f4b93c2372e73e7 | [
"MIT"
] | null | null | null | test/test_noise2.py | fsgeek/tikzplotlib | aee7a4ff145159476a7d07248f4b93c2372e73e7 | [
"MIT"
] | null | null | null | test/test_noise2.py | fsgeek/tikzplotlib | aee7a4ff145159476a7d07248f4b93c2372e73e7 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
from helpers import assert_equality
def plot():
# Make plot with horizontal colorbar
fig = plt.figure()
ax = fig.add_subplot(111)
np.random.seed(123)
data = np.clip(np.random.randn(250, 250), -1, 1)
cax = ax.imshow(data, interpolation="near... | 23.740741 | 72 | 0.672387 |
4a0ba36714cb28942aa89b0ed52d3204c2ba8541 | 533 | py | Python | define2-1-to-xlsx/documents.py | swhume/odmlib_examples | 7b1b38c9951b8c3b9f5673db6d7ccd2bbe2f49de | [
"MIT"
] | 4 | 2021-08-04T01:40:34.000Z | 2022-03-28T10:23:44.000Z | define2xls/documents.py | swhume/odmlib_examples | 7b1b38c9951b8c3b9f5673db6d7ccd2bbe2f49de | [
"MIT"
] | 1 | 2022-03-19T13:14:28.000Z | 2022-03-31T19:00:30.000Z | define2-1-to-xlsx/documents.py | swhume/odmlib_examples | 7b1b38c9951b8c3b9f5673db6d7ccd2bbe2f49de | [
"MIT"
] | 1 | 2021-12-10T14:31:55.000Z | 2021-12-10T14:31:55.000Z | import csv
import os
class Documents:
HEADERS = ["ID", "Title", "Href"]
def __init__(self, odmlib_mdv, data_path):
self.mdv = odmlib_mdv
self.path = data_path
self.file_name = os.path.join(self.path, "documents.csv")
def extract(self):
with open(self.file_name, 'w', newli... | 28.052632 | 68 | 0.592871 |
4a0ba39dc396fa6cdd579b8f71634a8cf20edc6b | 632 | py | Python | manage.py | rgrlinux/bps | a8e6c15efed4bddc6372e5498b3615aeb1daf021 | [
"MIT"
] | null | null | null | manage.py | rgrlinux/bps | a8e6c15efed4bddc6372e5498b3615aeb1daf021 | [
"MIT"
] | 5 | 2021-03-30T14:05:15.000Z | 2021-09-22T19:29:45.000Z | manage.py | rgrlinux/bps | a8e6c15efed4bddc6372e5498b3615aeb1daf021 | [
"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', 'bichanopreto.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise I... | 28.727273 | 76 | 0.685127 |
4a0ba4da391948660b8e9371a3c92e5d5b4bb5fb | 2,319 | py | Python | tests/on_wlm/test_simple_base_settings_on_wlm.py | neuralvis/SmartSim | 0248ffe8a61be58afe376c5c363172f3e91d227b | [
"BSD-2-Clause"
] | null | null | null | tests/on_wlm/test_simple_base_settings_on_wlm.py | neuralvis/SmartSim | 0248ffe8a61be58afe376c5c363172f3e91d227b | [
"BSD-2-Clause"
] | null | null | null | tests/on_wlm/test_simple_base_settings_on_wlm.py | neuralvis/SmartSim | 0248ffe8a61be58afe376c5c363172f3e91d227b | [
"BSD-2-Clause"
] | null | null | null | import time
import pytest
from smartsim import Experiment, constants
from smartsim.settings.settings import RunSettings
"""
Test the launch and stop of simple models and ensembles that use base
RunSettings while on WLM that do not include a run command
These tests will execute code (very light scripts) on the head ... | 36.809524 | 85 | 0.736524 |
4a0ba7065bcedec4affc7df295820e2f48d7b10e | 7,445 | py | Python | app/main/views/organisations.py | karlchillmaid/notifications-admin | 9ef6da4ef9e2fa97b7debb4b573cb035a5cb8880 | [
"MIT"
] | null | null | null | app/main/views/organisations.py | karlchillmaid/notifications-admin | 9ef6da4ef9e2fa97b7debb4b573cb035a5cb8880 | [
"MIT"
] | null | null | null | app/main/views/organisations.py | karlchillmaid/notifications-admin | 9ef6da4ef9e2fa97b7debb4b573cb035a5cb8880 | [
"MIT"
] | null | null | null | from flask import flash, redirect, render_template, request, session, url_for
from flask_login import current_user, login_required
from notifications_python_client.errors import HTTPError
from werkzeug.exceptions import abort
from app import (
current_organisation,
org_invite_api_client,
organisations_clie... | 32.797357 | 111 | 0.694426 |
4a0ba87f979b67b7a8bb27eabf870bdab3cd0fcf | 3,663 | py | Python | docs/target/sphinx/docutils/parsers/rst/languages/fr.py | SergeyParamoshkin/sqoop2 | 504ad690617d570483e5693464e73aa641f61fb0 | [
"Apache-2.0"
] | 1 | 2015-03-22T16:49:07.000Z | 2015-03-22T16:49:07.000Z | docs/target/sphinx/docutils/parsers/rst/languages/fr.py | SergeyParamoshkin/sqoop2 | 504ad690617d570483e5693464e73aa641f61fb0 | [
"Apache-2.0"
] | null | null | null | docs/target/sphinx/docutils/parsers/rst/languages/fr.py | SergeyParamoshkin/sqoop2 | 504ad690617d570483e5693464e73aa641f61fb0 | [
"Apache-2.0"
] | null | null | null | # $Id: fr.py 6460 2010-10-29 22:18:44Z milde $
# Authors: David Goodger <goodger@python.org>; William Dode
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be... | 35.911765 | 77 | 0.621895 |
4a0ba89e8a788aec30d28516cd78942ca8902868 | 3,186 | py | Python | chromagnon/SuperFastHash.py | arsinclair/Chromagnon | 3cab2736b5ad33f991a25bbe4b4d6d1bb91c9fed | [
"BSD-3-Clause"
] | 211 | 2015-02-10T11:28:50.000Z | 2022-03-24T20:36:16.000Z | chromagnon/SuperFastHash.py | arsinclair/Chromagnon | 3cab2736b5ad33f991a25bbe4b4d6d1bb91c9fed | [
"BSD-3-Clause"
] | 17 | 2015-02-06T16:47:50.000Z | 2020-12-02T15:16:04.000Z | chromagnon/SuperFastHash.py | arsinclair/Chromagnon | 3cab2736b5ad33f991a25bbe4b4d6d1bb91c9fed | [
"BSD-3-Clause"
] | 49 | 2016-01-25T11:49:28.000Z | 2021-10-20T12:56:29.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2012, Jean-Rémy Bancel <jean-remy.bancel@telecom-paristech.org>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions o... | 36.204545 | 80 | 0.663214 |
4a0ba8a907b8dd5d13ea188a7a2e26f9ba72a911 | 4,172 | py | Python | server/woker.py | felipeaq/trab1_redes | 69b102a5509ff8edfabc47ee70a82fb2a5ecd06f | [
"Apache-2.0"
] | null | null | null | server/woker.py | felipeaq/trab1_redes | 69b102a5509ff8edfabc47ee70a82fb2a5ecd06f | [
"Apache-2.0"
] | null | null | null | server/woker.py | felipeaq/trab1_redes | 69b102a5509ff8edfabc47ee70a82fb2a5ecd06f | [
"Apache-2.0"
] | null | null | null | import random
import json
import socket
from http_request import HttpRequest
class ExternalFiles: # classe que contém links externos
def __init__(self,book_file,dollar_server,dollar_link,stock_link,stock_server):
self.book_file=book_file
self.dollar_server=dollar_server
self.dollar_link=dol... | 43.458333 | 132 | 0.630393 |
4a0ba8efd418f3fbc22cf4780fdbdbf41d62eaf1 | 6,207 | py | Python | autogluon/task/object_detection/dataset/voc.py | CharlotteSean/autogluon | 58c51d4fd5c8abe3db5c509ac94064111cf1198d | [
"Apache-2.0"
] | 1 | 2020-01-13T06:17:29.000Z | 2020-01-13T06:17:29.000Z | autogluon/task/object_detection/dataset/voc.py | CharlotteSean/autogluon | 58c51d4fd5c8abe3db5c509ac94064111cf1198d | [
"Apache-2.0"
] | null | null | null | autogluon/task/object_detection/dataset/voc.py | CharlotteSean/autogluon | 58c51d4fd5c8abe3db5c509ac94064111cf1198d | [
"Apache-2.0"
] | null | null | null | """Pascal VOC object detection dataset."""
from __future__ import absolute_import
from __future__ import division
import os
import warnings
import numpy as np
import glob
try:
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
import mxnet as mx
from gluoncv.data.base imp... | 39.535032 | 118 | 0.588207 |
4a0ba92f65375fa3d074defe7768f00fa675dc21 | 2,705 | py | Python | ebl/tests/transliteration/test_markup.py | ElectronicBabylonianLiterature/ebl-api | aef627b81abdcc6bca62c394096f3055c5a8de83 | [
"MIT"
] | 4 | 2020-04-12T14:24:51.000Z | 2020-10-15T15:48:15.000Z | ebl/tests/transliteration/test_markup.py | ElectronicBabylonianLiterature/ebl-api | aef627b81abdcc6bca62c394096f3055c5a8de83 | [
"MIT"
] | 200 | 2019-12-04T09:53:20.000Z | 2022-03-30T20:11:31.000Z | ebl/tests/transliteration/test_markup.py | ElectronicBabylonianLiterature/ebl-api | aef627b81abdcc6bca62c394096f3055c5a8de83 | [
"MIT"
] | 1 | 2021-09-06T16:22:39.000Z | 2021-09-06T16:22:39.000Z | from typing import Sequence
import pytest
from ebl.bibliography.domain.reference import Reference, ReferenceType, BibliographyId
from ebl.transliteration.domain.language import Language
from ebl.transliteration.domain.markup import (
BibliographyPart,
EmphasisPart,
LanguagePart,
MarkupPart,
String... | 26.782178 | 86 | 0.634011 |
4a0ba98bc34623694e532c8beec5bbc165a8fccb | 1,179 | py | Python | Cantmera/screen.py | ullrichd21/CantmeraOS | d17a6e918132e7f19045e710d1b278779fd22c42 | [
"MIT"
] | null | null | null | Cantmera/screen.py | ullrichd21/CantmeraOS | d17a6e918132e7f19045e710d1b278779fd22c42 | [
"MIT"
] | null | null | null | Cantmera/screen.py | ullrichd21/CantmeraOS | d17a6e918132e7f19045e710d1b278779fd22c42 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import board as board
import busio
import digitalio
# Import the SSD1306 module.
import adafruit_ssd1306
import time
class Screen():
def __init__(self):
time.sleep(5) # Sleep and wait for screen to be ready!
# init SPI
spi = busio.SPI(board.SCLK, MOSI=board.MOSI)
... | 25.630435 | 95 | 0.610687 |
4a0baa007762c7d6d59f8b431fc7502b144564b2 | 3,527 | py | Python | bot_vk.py | Sam1808/Quiz-bots | 105295619af9f4c83bdeed24879714c8a7070c83 | [
"MIT"
] | null | null | null | bot_vk.py | Sam1808/Quiz-bots | 105295619af9f4c83bdeed24879714c8a7070c83 | [
"MIT"
] | null | null | null | bot_vk.py | Sam1808/Quiz-bots | 105295619af9f4c83bdeed24879714c8a7070c83 | [
"MIT"
] | null | null | null | import logging
import os
import random
import redis
import vk_api as vk
from bot_utils import get_arguments
from bot_utils import get_quiz_qa
from dotenv import load_dotenv
from vk_api.keyboard import VkKeyboard, VkKeyboardColor
from vk_api.longpoll import VkLongPoll, VkEventType
from vk_api.utils import get_random_id... | 32.962617 | 75 | 0.681316 |
4a0baa40b18851f8ab9e7aaec14e9d891789369f | 101 | py | Python | 9.py | tarandeepgill2002/pythonAcadview | 0f1be688a7588b518fe52a05dd1b9ec78b46bb83 | [
"MIT"
] | null | null | null | 9.py | tarandeepgill2002/pythonAcadview | 0f1be688a7588b518fe52a05dd1b9ec78b46bb83 | [
"MIT"
] | null | null | null | 9.py | tarandeepgill2002/pythonAcadview | 0f1be688a7588b518fe52a05dd1b9ec78b46bb83 | [
"MIT"
] | null | null | null | name=input("enter the name:")
age=int(input("enter the age:"))
print("name:",name)
print("age:",age)
| 20.2 | 32 | 0.663366 |
4a0baaca98c56228b1b228c954682a863557e36c | 1,819 | py | Python | common/common_pytorch/model/srnet_utils/group_index.py | ailingzengzzz/Split-and-Recombine-Net | 1b6285c9f5b46140832e7e4d24e8e5a7dbb24234 | [
"Apache-2.0"
] | 8 | 2021-07-28T06:57:08.000Z | 2022-02-17T11:54:10.000Z | common/common_pytorch/model/srnet_utils/group_index.py | ailingzengzzz/Split-and-Recombine-Net | 1b6285c9f5b46140832e7e4d24e8e5a7dbb24234 | [
"Apache-2.0"
] | 4 | 2021-10-09T03:13:46.000Z | 2021-12-28T06:38:52.000Z | common/common_pytorch/model/srnet_utils/group_index.py | ailingzengzzz/Split-and-Recombine-Net | 1b6285c9f5b46140832e7e4d24e8e5a7dbb24234 | [
"Apache-2.0"
] | null | null | null | import torch
def get_input(group):
if group == 2:
print('Now group is:', group)
conv_seq = [range(0, 16), [0, 1, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]]
final_outc = 55
elif group == 3:
print('Now group is:', group)
conv_seq = [range(0, 1... | 39.543478 | 204 | 0.502474 |
4a0bab0d05f61561c91f92cc447608dc8bd2170b | 2,273 | py | Python | src/py/flwr/server/strategy/fast_and_slow_test.py | sandracl72/flower | bb7f6e2e1f52753820784d262618113b4e7ebc42 | [
"Apache-2.0"
] | null | null | null | src/py/flwr/server/strategy/fast_and_slow_test.py | sandracl72/flower | bb7f6e2e1f52753820784d262618113b4e7ebc42 | [
"Apache-2.0"
] | null | null | null | src/py/flwr/server/strategy/fast_and_slow_test.py | sandracl72/flower | bb7f6e2e1f52753820784d262618113b4e7ebc42 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Adap GmbH. 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 ag... | 30.716216 | 80 | 0.527497 |
4a0bab4a0c246080e3222d0fb70a551eee1fbdac | 10,361 | py | Python | python_modules/dagster/dagster/utils/test/schedule_storage.py | basilvetas/dagster | b08f5534a0b0277dab38cb7b6a46d324e94b8940 | [
"Apache-2.0"
] | 2 | 2021-06-21T17:50:26.000Z | 2021-06-21T19:14:23.000Z | python_modules/dagster/dagster/utils/test/schedule_storage.py | basilvetas/dagster | b08f5534a0b0277dab38cb7b6a46d324e94b8940 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/utils/test/schedule_storage.py | basilvetas/dagster | b08f5534a0b0277dab38cb7b6a46d324e94b8940 | [
"Apache-2.0"
] | 1 | 2021-08-18T17:21:57.000Z | 2021-08-18T17:21:57.000Z | import sys
import time
import pytest
from dagster import DagsterInvariantViolationError
from dagster.core.code_pointer import ModuleCodePointer
from dagster.core.origin import RepositoryPythonOrigin, SchedulePythonOrigin
from dagster.core.scheduler import ScheduleState, ScheduleStatus
from dagster.core.scheduler.sched... | 36.227273 | 103 | 0.676383 |
4a0bada2fbe2392bda5d2388a8ad3a7459de7d0d | 3,431 | py | Python | src/md_docs/plugins/nav_plugins.py | TroyWilliams3687/md_docs | f26d440fb77e1e06bb9a3845a3bf75f8ba979a4d | [
"MIT"
] | null | null | null | src/md_docs/plugins/nav_plugins.py | TroyWilliams3687/md_docs | f26d440fb77e1e06bb9a3845a3bf75f8ba979a4d | [
"MIT"
] | null | null | null | src/md_docs/plugins/nav_plugins.py | TroyWilliams3687/md_docs | f26d440fb77e1e06bb9a3845a3bf75f8ba979a4d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# -----------
# SPDX-License-Identifier: MIT
# Copyright (c) 2021 Troy Williams
# uuid: 52b7bf58-ceb3-11eb-9734-2d229bf17d60
# author: Troy Williams
# email: troy.williams@bluebill.net
# date: 2021-06-16
# -----------
"""
Define the default Navigation plugins includ... | 25.227941 | 105 | 0.582629 |
4a0bae2d4f176adc16a28fbf4e54b28eeb6d0607 | 4,716 | py | Python | src/sentry/integrations/jira_server/client.py | conan25216/sentry | fe38ab19fb096688140b2065da0e45fa26762200 | [
"BSD-3-Clause"
] | 1 | 2018-12-04T12:57:00.000Z | 2018-12-04T12:57:00.000Z | src/sentry/integrations/jira_server/client.py | conan25216/sentry | fe38ab19fb096688140b2065da0e45fa26762200 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/integrations/jira_server/client.py | conan25216/sentry | fe38ab19fb096688140b2065da0e45fa26762200 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import jwt
from django.core.urlresolvers import reverse
from oauthlib.oauth1 import SIGNATURE_RSA
from requests_oauthlib import OAuth1
from six.moves.urllib.parse import parse_qsl
from sentry.integrations.client import ApiClient, ApiError
from sentry.utils.http import absolute_... | 35.727273 | 85 | 0.634012 |
4a0bae8e8115c5648e562ca45338a61300be4e73 | 513 | py | Python | confirmation/management/commands/cleanupconfirmation.py | dehnert/zulip | f5935e81c7cf2f11ff4ccfcd31d2a1061b8d7ff5 | [
"Apache-2.0"
] | 1 | 2017-07-27T19:49:12.000Z | 2017-07-27T19:49:12.000Z | confirmation/management/commands/cleanupconfirmation.py | dehnert/zulip | f5935e81c7cf2f11ff4ccfcd31d2a1061b8d7ff5 | [
"Apache-2.0"
] | 9 | 2021-02-08T20:22:36.000Z | 2022-03-11T23:22:45.000Z | confirmation/management/commands/cleanupconfirmation.py | tobby2002/zulip | 66e7c455759f9368bae16b9a604cf63f8e3524cd | [
"Apache-2.0"
] | 1 | 2021-04-09T05:50:23.000Z | 2021-04-09T05:50:23.000Z | # -*- coding: utf-8 -*-
# Copyright: (c) 2008, Jarek Zgoda <jarek.zgoda@gmail.com>
__revision__ = '$Id: cleanupconfirmation.py 5 2008-11-18 09:10:12Z jarek.zgoda $'
from typing import Any
from django.core.management.base import NoArgsCommand
from confirmation.models import Confirmation
class Command(NoArgsComman... | 25.65 | 81 | 0.723197 |
4a0bae9f39e2d50681dd4a143bde93fac8483002 | 799 | py | Python | pedantic/decorators/fn_deco_deprecated.py | LostInDarkMath/Pedantic-python-decorators | 32ed54c9593e80f63c0499093cb07847d8a5e1df | [
"Apache-2.0"
] | 15 | 2020-09-10T13:06:53.000Z | 2021-12-21T12:39:18.000Z | pedantic/decorators/fn_deco_deprecated.py | LostInDarkMath/Pedantic-python-decorators | 32ed54c9593e80f63c0499093cb07847d8a5e1df | [
"Apache-2.0"
] | 39 | 2020-08-12T12:38:03.000Z | 2022-03-22T18:09:48.000Z | pedantic/decorators/fn_deco_deprecated.py | LostInDarkMath/pedantic-python-decorators | 66865a958a36440b48e790f22ea42d2beb725b16 | [
"Apache-2.0"
] | null | null | null | from functools import wraps
from typing import Any
from pedantic.constants import F, ReturnType
from pedantic.helper_methods import _raise_warning
def deprecated(func: F) -> F:
"""
Use this decorator to mark a function as deprecated. It will raise a warning when the function is called.
Example:
... | 26.633333 | 113 | 0.660826 |
4a0baf3f69fb6c6d859f1c2ecc89d4c8b0f89c73 | 8,444 | py | Python | examples/contrib/gp/sv-dkl.py | ciguaran/pyro | 2dfa8da0dd400c3712768385d8306848e93dab9a | [
"Apache-2.0"
] | 1 | 2020-10-02T20:17:38.000Z | 2020-10-02T20:17:38.000Z | examples/contrib/gp/sv-dkl.py | Ezecc/pyro | 11a96cde05756def826c232d76f9cff66f6e6d4f | [
"Apache-2.0"
] | 1 | 2020-05-12T16:26:21.000Z | 2020-05-12T17:23:13.000Z | examples/contrib/gp/sv-dkl.py | Ezecc/pyro | 11a96cde05756def826c232d76f9cff66f6e6d4f | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
"""
An example to use Pyro Gaussian Process module to classify MNIST and binary MNIST.
Follow the idea from reference [1], we will combine a convolutional neural network
(CNN) with a RBF kernel to create a "deep" kernel:
>>> ... | 42.432161 | 99 | 0.625651 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.