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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
16138ebb66f71a1ba74488c79a21d75c0a6f9ad7 | 204 | py | Python | Python3/1427-Perform-String-Shifts/soln.py | wyaadarsh/LeetCode-Solutions | 3719f5cb059eefd66b83eb8ae990652f4b7fd124 | [
"MIT"
] | 5 | 2020-07-24T17:48:59.000Z | 2020-12-21T05:56:00.000Z | Python3/1427-Perform-String-Shifts/soln.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | null | null | null | Python3/1427-Perform-String-Shifts/soln.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | 2 | 2020-07-24T17:49:01.000Z | 2020-08-31T19:57:35.000Z | class Solution:
def stringShift(self, s: str, shift: List[List[int]]) -> str:
left_shift = sum((v if d == 0 else -v) for d, v in shift) % len(s)
return s[left_shift:] + s[:left_shift]
| 40.8 | 74 | 0.593137 |
39463c306d4828363c3654c646b42363b79283f7 | 88 | wsgi | Python | wsgi/apache/libcloud_rest.wsgi | islamgulov/libcloud.rest | f76e3c013cf10d64e0b7e9090db4224405a1aeb8 | [
"Apache-2.0"
] | 5 | 2015-03-20T16:43:26.000Z | 2017-11-22T04:19:50.000Z | wsgi/apache/libcloud_rest.wsgi | coyo8/libcloud.rest | 07e662eceeb18e6659dffb0d1073adbb0b960efe | [
"Apache-2.0"
] | 2 | 2018-02-16T03:18:29.000Z | 2020-05-13T12:37:28.000Z | wsgi/apache/libcloud_rest.wsgi | coyo8/libcloud.rest | 07e662eceeb18e6659dffb0d1073adbb0b960efe | [
"Apache-2.0"
] | 5 | 2015-11-04T08:24:15.000Z | 2020-04-17T21:54:55.000Z | from libcloud_rest.application import LibcloudRestApp
application = LibcloudRestApp()
| 17.6 | 53 | 0.852273 |
6c31b0b5ba5b49f228c665a561d3ea44d3a33591 | 1,161 | py | Python | oeml-sdk/python/test/test_reject_reason.py | AllSafeCybercurity/coinapi-sdk | 013afdeba75f8ba849cbb8d25245535f483cba76 | [
"MIT"
] | 357 | 2017-05-29T15:09:19.000Z | 2022-03-30T15:34:10.000Z | oeml-sdk/python/test/test_reject_reason.py | AllSafeCybercurity/coinapi-sdk | 013afdeba75f8ba849cbb8d25245535f483cba76 | [
"MIT"
] | 68 | 2017-12-15T15:39:14.000Z | 2022-02-11T11:28:17.000Z | oeml-sdk/python/test/test_reject_reason.py | AllSafeCybercurity/coinapi-sdk | 013afdeba75f8ba849cbb8d25245535f483cba76 | [
"MIT"
] | 199 | 2017-06-01T07:51:14.000Z | 2022-03-25T11:52:28.000Z | """
OEML - REST API
This section will provide necessary information about the `CoinAPI OEML REST API` protocol. <br/> This API is also available in the Postman application: <a href=\"https://postman.coinapi.io/\" target=\"_blank\">https://postman.coinapi.io/</a> <br/><br/> Implemented Standards: * [HTT... | 31.378378 | 482 | 0.687339 |
1583ecf7d60235ceeff2fce9fd3557780aac564a | 22,542 | py | Python | roles/lib_openshift/src/class/oc_adm_router.py | rashmi7321/openshift | 068ec3dbb209592b052426ca3e573904f3df5613 | [
"Apache-2.0"
] | null | null | null | roles/lib_openshift/src/class/oc_adm_router.py | rashmi7321/openshift | 068ec3dbb209592b052426ca3e573904f3df5613 | [
"Apache-2.0"
] | null | null | null | roles/lib_openshift/src/class/oc_adm_router.py | rashmi7321/openshift | 068ec3dbb209592b052426ca3e573904f3df5613 | [
"Apache-2.0"
] | null | null | null | # pylint: skip-file
# flake8: noqa
class RouterException(Exception):
''' Router exception'''
pass
class RouterConfig(OpenShiftCLIConfig):
''' RouterConfig is a DTO for the router. '''
def __init__(self, rname, namespace, kubeconfig, router_options):
super(RouterConfig, self).__init__(rname,... | 43.433526 | 114 | 0.530432 |
adfe4768c4fe385c589bf7acb04da5acb9e84a2c | 913 | py | Python | PythonExercicios/ex041.py | GabrielProdi/Python_CursoEmVideo | 8bfff1b9a73d09c8f42dc3778f895525f1bc946d | [
"MIT"
] | null | null | null | PythonExercicios/ex041.py | GabrielProdi/Python_CursoEmVideo | 8bfff1b9a73d09c8f42dc3778f895525f1bc946d | [
"MIT"
] | null | null | null | PythonExercicios/ex041.py | GabrielProdi/Python_CursoEmVideo | 8bfff1b9a73d09c8f42dc3778f895525f1bc946d | [
"MIT"
] | null | null | null | '''
A Confederação Nacional de Natação precisa de um programa que leia o ano de nascimento de um atleta e mostre sua categoria, de acordo com a idade:
- Até 9 anos: MIRIM
- Até 14 anos: INFANTIL
- Até 19 anos: JÚNIOR
- Até 25 anos: SÊNIOR
- Acima de 25 anos: MASTER
'''
from datetime import date
titulo = str( 'CATEGOR... | 25.361111 | 146 | 0.631982 |
be235a0380eef6ea0457c33c8a2c3ad432ea550f | 2,091 | py | Python | listings/views.py | michaelDropship/btre_project | c2cfcd77459bc732bfa0b1bb1fc84bb7f8c2956f | [
"bzip2-1.0.6"
] | null | null | null | listings/views.py | michaelDropship/btre_project | c2cfcd77459bc732bfa0b1bb1fc84bb7f8c2956f | [
"bzip2-1.0.6"
] | 2 | 2020-07-18T01:21:12.000Z | 2021-05-10T08:48:33.000Z | listings/views.py | michaelDropship/btre_project | c2cfcd77459bc732bfa0b1bb1fc84bb7f8c2956f | [
"bzip2-1.0.6"
] | null | null | null | from django.shortcuts import render, get_object_or_404
from .models import Listing
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from listings.choices import price_choices, bedroom_choices, state_choices
def index(request):
listings = Listing.objects.order_by('-list_date').filter(is_publ... | 30.75 | 84 | 0.66571 |
5bf3907ebba97233efe2f2dc3173e1e4a95fe48f | 1,652 | py | Python | esphomeyaml/components/sensor/max6675.py | Bierchermuesli/esphomeyaml | f087e313d4ca5370b14f7e8173c8f1719e90dfa6 | [
"MIT"
] | null | null | null | esphomeyaml/components/sensor/max6675.py | Bierchermuesli/esphomeyaml | f087e313d4ca5370b14f7e8173c8f1719e90dfa6 | [
"MIT"
] | null | null | null | esphomeyaml/components/sensor/max6675.py | Bierchermuesli/esphomeyaml | f087e313d4ca5370b14f7e8173c8f1719e90dfa6 | [
"MIT"
] | null | null | null | import voluptuous as vol
import esphomeyaml.config_validation as cv
from esphomeyaml import pins
from esphomeyaml.components import sensor, spi
from esphomeyaml.components.spi import SPIComponent
from esphomeyaml.const import CONF_CS_PIN, CONF_MAKE_ID, CONF_NAME, CONF_SPI_ID, \
CONF_UPDATE_INTERVAL
from esphomeyam... | 38.418605 | 93 | 0.757869 |
943ccfdbbfe654be3634ca1b83bf396b575e546d | 114 | py | Python | disease/apps.py | PetHospital/PetHospitalBackend | b5f15293a7aea46b78a554146878ef00c4a55a17 | [
"MIT"
] | null | null | null | disease/apps.py | PetHospital/PetHospitalBackend | b5f15293a7aea46b78a554146878ef00c4a55a17 | [
"MIT"
] | null | null | null | disease/apps.py | PetHospital/PetHospitalBackend | b5f15293a7aea46b78a554146878ef00c4a55a17 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class DiseaseConfig(AppConfig):
name = 'disease'
verbose_name = '病历系统' | 19 | 33 | 0.72807 |
553e98f1c067ea1e32132c6b2a1b7a734fa989ff | 9,663 | py | Python | methods_exploration/functions/data_exploration_functions.py | galengorski/drb-estuary-salinity-ml | 2d46f0b09acf473ca55e4c02a18141cd10dbd8cd | [
"CC0-1.0"
] | null | null | null | methods_exploration/functions/data_exploration_functions.py | galengorski/drb-estuary-salinity-ml | 2d46f0b09acf473ca55e4c02a18141cd10dbd8cd | [
"CC0-1.0"
] | 38 | 2021-11-09T23:39:05.000Z | 2022-03-30T23:06:39.000Z | methods_exploration/functions/data_exploration_functions.py | galengorski/drb-estuary-salinity-ml | 2d46f0b09acf473ca55e4c02a18141cd10dbd8cd | [
"CC0-1.0"
] | 2 | 2021-11-10T22:18:01.000Z | 2021-11-29T01:47:51.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 25 10:01:14 2022
@author: ggorski
"""
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import plotly.express as px
import seaborn as sns
import TEpython_ParallelNAN2
def lag_sources_df(n_lags, srcs_df):
n_lags_int = int(n_lags)
'''Takes in ... | 40.944915 | 182 | 0.682397 |
bb8973a6be12126d8a3878bfcc16cf4135140fc7 | 16,188 | py | Python | maKG.py | RaulAstudillo/bocf | cd84eab2d1b4ea5a4bdeeb452df92296afbafb87 | [
"BSD-3-Clause"
] | null | null | null | maKG.py | RaulAstudillo/bocf | cd84eab2d1b4ea5a4bdeeb452df92296afbafb87 | [
"BSD-3-Clause"
] | null | null | null | maKG.py | RaulAstudillo/bocf | cd84eab2d1b4ea5a4bdeeb452df92296afbafb87 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2018, Raul Astudillo
import numpy as np
from GPyOpt.acquisitions.base import AcquisitionBase
from GPyOpt.core.task.cost import constant_cost_withGradients
from pathos.multiprocessing import ProcessingPool as Pool
class maKG(AcquisitionBase):
"""
Multi-attribute knowledge gradient acquisition ... | 55.628866 | 200 | 0.590499 |
74c8423c9f1fe13759d86f1701a9cc0a068213f5 | 2,182 | py | Python | geodjango/world/migrations/0002_auto_20220225_1845.py | thiggimajig/geodjango_tut | 8ff8a2009ab299b5eb793f7291d6d593d292b209 | [
"MIT"
] | null | null | null | geodjango/world/migrations/0002_auto_20220225_1845.py | thiggimajig/geodjango_tut | 8ff8a2009ab299b5eb793f7291d6d593d292b209 | [
"MIT"
] | null | null | null | geodjango/world/migrations/0002_auto_20220225_1845.py | thiggimajig/geodjango_tut | 8ff8a2009ab299b5eb793f7291d6d593d292b209 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.7 on 2022-02-25 18:45
import django.contrib.gis.db.models.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('world', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='AirbnbListing... | 43.64 | 91 | 0.567828 |
e90e784cf5801654332c751b797f7d46995e1aa7 | 588 | py | Python | config.py | KK4TEE/kFlightPanel | 5231c9859b88d0322b1e7233839cf4b00b1ceb20 | [
"MIT"
] | null | null | null | config.py | KK4TEE/kFlightPanel | 5231c9859b88d0322b1e7233839cf4b00b1ceb20 | [
"MIT"
] | null | null | null | config.py | KK4TEE/kFlightPanel | 5231c9859b88d0322b1e7233839cf4b00b1ceb20 | [
"MIT"
] | null | null | null | '''Configuration file for kFlight'''
#URL = 'http://127.0.0.1:8085/telemachus/datalink?'
URL = 'http://192.168.0.183:8085/telemachus/datalink?'
#URL = 'http://192.168.1.11:8085/telemachus/datalink?'
# This is the URL that Telemachus can be found at.
# Adjust it based on your firewall settings.
#GoFullscreen = False
G... | 29.4 | 70 | 0.75 |
5f8313396da54000eaa4808dd0b47db4d7b15698 | 2,467 | py | Python | utils/getJenkinsVersion.py | oleg-nenashev/release | 5c260d84e3b2f797e4596569285e55db08dc34b9 | [
"MIT"
] | null | null | null | utils/getJenkinsVersion.py | oleg-nenashev/release | 5c260d84e3b2f797e4596569285e55db08dc34b9 | [
"MIT"
] | null | null | null | utils/getJenkinsVersion.py | oleg-nenashev/release | 5c260d84e3b2f797e4596569285e55db08dc34b9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
import urllib2
import xml.etree.ElementTree as ET
import os
def getJenkinsVersion(metadataUrl, version):
try:
url = metadataUrl
tree = ET.parse(urllib2.urlopen(url))
root = tree.getroot()
# Search in Maven repository for latest version of Jenkins
# ... | 29.023529 | 138 | 0.622213 |
b615c58a81b9d1d7b9015eee19bad9ce3a47252b | 14,635 | py | Python | src/azure-cli-core/azure/cli/core/util.py | tariq1890/azure-cli | bab87d1db43642abcb27bffde5b60fcc9ea7e334 | [
"MIT"
] | null | null | null | src/azure-cli-core/azure/cli/core/util.py | tariq1890/azure-cli | bab87d1db43642abcb27bffde5b60fcc9ea7e334 | [
"MIT"
] | null | null | null | src/azure-cli-core/azure/cli/core/util.py | tariq1890/azure-cli | bab87d1db43642abcb27bffde5b60fcc9ea7e334 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 34.845238 | 119 | 0.65316 |
1eec93d275b548e77628d616ee8e99fddbf743e9 | 4,075 | py | Python | deli_counter/http/mounts/root/routes/v1/auth/n/service_accounts.py | sandwichcloud/deli-counter | e72ee3966f4457ffbd1d432b3516965075c7c86e | [
"MIT"
] | 1 | 2017-10-19T09:25:29.000Z | 2017-10-19T09:25:29.000Z | deli_counter/http/mounts/root/routes/v1/auth/n/service_accounts.py | sandwichcloud/deli-counter | e72ee3966f4457ffbd1d432b3516965075c7c86e | [
"MIT"
] | null | null | null | deli_counter/http/mounts/root/routes/v1/auth/n/service_accounts.py | sandwichcloud/deli-counter | e72ee3966f4457ffbd1d432b3516965075c7c86e | [
"MIT"
] | null | null | null | import uuid
import cherrypy
from sqlalchemy.orm import Query
from deli_counter.http.mounts.root.routes.v1.auth.n.validation_models.service_accounts import \
RequestCreateServiceAccount, ResponseServiceAccount, ParamsServiceAccount, ParamsListServiceAccount
from ingredients_db.models.authn import AuthNServiceAccou... | 45.786517 | 120 | 0.735951 |
dc7f28071d0546d87ba9879eb9bd118103991766 | 7,681 | py | Python | earasm/pegasus.py | kjcolley7/PEGASUS | a1dceb52f51192f028672055958666a1ac65a15a | [
"MIT"
] | 1 | 2020-11-13T02:29:05.000Z | 2020-11-13T02:29:05.000Z | earasm/pegasus.py | kjcolley7/PEGASUS | a1dceb52f51192f028672055958666a1ac65a15a | [
"MIT"
] | null | null | null | earasm/pegasus.py | kjcolley7/PEGASUS | a1dceb52f51192f028672055958666a1ac65a15a | [
"MIT"
] | null | null | null | from .geometry import *
from .isa import *
EAR_PROT_READ = 1 << 0
EAR_PROT_WRITE = 1 << 1
EAR_PROT_EXECUTE = 1 << 2
def decode_prot(prot):
if not isinstance(prot, str):
return prot
ret = 0
for c in prot:
ret |= 1 << "rwx".index(c.lower())
return ret
class Pegasus_Filepart(object):
def __init__(self, foff... | 20.537433 | 88 | 0.672959 |
a225f21b6619ac21e665bd47991ad619dd0be315 | 250 | py | Python | codeforces.com/785A/solution.py | zubtsov/competitive-programming | 919d63130144347d7f6eddcf8f5bc2afb85fddf3 | [
"MIT"
] | null | null | null | codeforces.com/785A/solution.py | zubtsov/competitive-programming | 919d63130144347d7f6eddcf8f5bc2afb85fddf3 | [
"MIT"
] | null | null | null | codeforces.com/785A/solution.py | zubtsov/competitive-programming | 919d63130144347d7f6eddcf8f5bc2afb85fddf3 | [
"MIT"
] | null | null | null | number_of_polyhedrons = int(input())
polyhedrons_faces = {
'Tetrahedron': 4,
'Cube': 6,
'Octahedron': 8,
'Dodecahedron': 12,
'Icosahedron': 20
}
print(sum([polyhedrons_faces.get(input()) for i in range(number_of_polyhedrons)]))
| 20.833333 | 82 | 0.664 |
1be50032a4d497acab65e2e9085da45b215192fe | 388 | py | Python | corefacility/authorizations/cookie/entity/cookie_set.py | serik1987/corefacility | 78d84e19403361e83ef562e738473849f9133bef | [
"RSA-MD"
] | null | null | null | corefacility/authorizations/cookie/entity/cookie_set.py | serik1987/corefacility | 78d84e19403361e83ef562e738473849f9133bef | [
"RSA-MD"
] | null | null | null | corefacility/authorizations/cookie/entity/cookie_set.py | serik1987/corefacility | 78d84e19403361e83ef562e738473849f9133bef | [
"RSA-MD"
] | null | null | null | from core.entity.entity_sets.entity_set import EntitySet
from .cookie_reader import CookieReader
class CookieSet(EntitySet):
"""
Defines the cookie set and help to find a particular cookie in the database
"""
_entity_name = "Cookie info"
_entity_class = "authorizations.cookie.entity.Cookie"
... | 21.555556 | 79 | 0.742268 |
dc33687e53061d4325b62ef406e7749573021146 | 526 | py | Python | tests/integration/conftest.py | kiwicom/crane | 36f20ae0302f40b9970bf2d968ff3e76c9b21ad0 | [
"MIT"
] | 102 | 2017-10-16T08:51:34.000Z | 2021-05-31T20:17:11.000Z | tests/integration/conftest.py | kiwicom/crane | 36f20ae0302f40b9970bf2d968ff3e76c9b21ad0 | [
"MIT"
] | 127 | 2017-10-13T14:34:09.000Z | 2021-08-01T04:15:10.000Z | tests/integration/conftest.py | kiwicom/crane | 36f20ae0302f40b9970bf2d968ff3e76c9b21ad0 | [
"MIT"
] | 15 | 2017-10-13T14:07:55.000Z | 2022-02-23T05:17:38.000Z | import os
import shutil
import git
import pytest
import tempfile
from crane import deployment
@pytest.fixture(autouse=True)
def gitlab_ci_env(monkeypatch):
monkeypatch.setenv("GITLAB_USER_EMAIL", "picky@kiwi.com")
monkeypatch.setenv("CI_PROJECT_PATH", "foo/bar")
monkeypatch.setenv("CI_PROJECT_URL", "http... | 29.222222 | 75 | 0.756654 |
f00e57449a0f4d3feb1bfdaae32d5308d7c1269e | 6,049 | py | Python | distributed/protocol/utils.py | crusaderky/distributed | d1cf1d452aece30b75adaf7f73f7cfdc69a63c4a | [
"BSD-3-Clause"
] | 1,358 | 2016-02-09T21:25:27.000Z | 2022-03-30T08:06:36.000Z | distributed/protocol/utils.py | crusaderky/distributed | d1cf1d452aece30b75adaf7f73f7cfdc69a63c4a | [
"BSD-3-Clause"
] | 4,789 | 2016-02-10T00:13:43.000Z | 2022-03-31T23:56:27.000Z | distributed/protocol/utils.py | crusaderky/distributed | d1cf1d452aece30b75adaf7f73f7cfdc69a63c4a | [
"BSD-3-Clause"
] | 791 | 2016-02-19T04:34:38.000Z | 2022-03-31T16:26:38.000Z | from __future__ import annotations
import ctypes
import struct
from collections.abc import Sequence
import dask
from ..utils import nbytes
BIG_BYTES_SHARD_SIZE = dask.utils.parse_bytes(dask.config.get("distributed.comm.shard"))
msgpack_opts = {
("max_%s_len" % x): 2 ** 31 - 1 for x in ["str", "bin", "array", ... | 30.094527 | 100 | 0.643908 |
bc93077a6e29214715353eda51ea8f890f4f3fc9 | 6,144 | py | Python | tests/test_search.py | job/peeringdb | 0bdc803e1478dbfae15e9989babef31db31bf0bb | [
"BSD-2-Clause"
] | null | null | null | tests/test_search.py | job/peeringdb | 0bdc803e1478dbfae15e9989babef31db31bf0bb | [
"BSD-2-Clause"
] | null | null | null | tests/test_search.py | job/peeringdb | 0bdc803e1478dbfae15e9989babef31db31bf0bb | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Unit-tests for quick search functionality - note that advanced search is not
tested here as that is using the PDB API entirely.
"""
import re
import datetime
import pytest
import unidecode
from django.test import TestCase, RequestFactory
import peeringdb_server.search as search
import pee... | 33.944751 | 91 | 0.57666 |
198e86afc609ba64b63b54e6aec31373048c53b5 | 1,763 | py | Python | src/server/main.py | jakubzolkos/recog | 42310cbfbf232dfbc7ff8f6b2c96f8c651e8001d | [
"MIT"
] | 1 | 2021-11-15T19:46:11.000Z | 2021-11-15T19:46:11.000Z | src/server/main.py | jakubzolkos/recog | 42310cbfbf232dfbc7ff8f6b2c96f8c651e8001d | [
"MIT"
] | null | null | null | src/server/main.py | jakubzolkos/recog | 42310cbfbf232dfbc7ff8f6b2c96f8c651e8001d | [
"MIT"
] | 3 | 2021-11-15T20:02:32.000Z | 2021-12-10T07:05:34.000Z | from time import sleep, time
from flask import Flask, request
import base64
import Object
from betterImage import enhance
def main(path):
#Enhance the image
enhance(path)
#Get objects in the image
objects = Object.GetObjects(path)
#Create string that will be sent to the client
output = ""
... | 26.313433 | 73 | 0.607487 |
1f37dfea41a90fbb1aaa83594a202655604ba055 | 1,446 | py | Python | src/programy/dynamic/sets/set.py | NeolithEra/program-y | 8c2396611f30c8095e98ff02988223a641c1a3be | [
"MIT"
] | null | null | null | src/programy/dynamic/sets/set.py | NeolithEra/program-y | 8c2396611f30c8095e98ff02988223a641c1a3be | [
"MIT"
] | null | null | null | src/programy/dynamic/sets/set.py | NeolithEra/program-y | 8c2396611f30c8095e98ff02988223a641c1a3be | [
"MIT"
] | null | null | null | """
Copyright (c) 2016-2019 Keith Sterling http://www.keithsterling.com
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, copy, m... | 43.818182 | 120 | 0.773167 |
48c603c5dd134dc992bac71e105a966aa84a923c | 440 | py | Python | setup.py | kevinyamauchi/unet_segmentation_metrics | 7fda00e50e69f7115b31ca66cb6f4395901248a4 | [
"MIT"
] | 25 | 2019-12-02T11:24:27.000Z | 2022-03-27T22:56:31.000Z | setup.py | kevinyamauchi/unet_segmentation_metrics | 7fda00e50e69f7115b31ca66cb6f4395901248a4 | [
"MIT"
] | 2 | 2020-05-01T10:27:12.000Z | 2021-09-01T09:39:00.000Z | setup.py | kevinyamauchi/unet_segmentation_metrics | 7fda00e50e69f7115b31ca66cb6f4395901248a4 | [
"MIT"
] | 8 | 2020-02-19T14:33:22.000Z | 2021-12-26T11:08:06.000Z | #!/usr/bin/env python
from setuptools import setup
setup(name='unet_segmentation_metrics',
version='0.1',
description='Segmentation performance metrics',
author='Alan R. Lowe',
author_email='a.lowe@ucl.ac.uk',
url='https://github.com/quantumjot/unet_segmentation_metrics',
packages=[... | 31.428571 | 69 | 0.670455 |
e1cd3c240236e629ee834871d676ccaa1564b057 | 1,317 | py | Python | camera.py | lectorvin/rpg | 29513e6675f0ce9d1ec36992a4aaf9574e203632 | [
"MIT"
] | null | null | null | camera.py | lectorvin/rpg | 29513e6675f0ce9d1ec36992a4aaf9574e203632 | [
"MIT"
] | null | null | null | camera.py | lectorvin/rpg | 29513e6675f0ce9d1ec36992a4aaf9574e203632 | [
"MIT"
] | null | null | null | """This module descibe camera as class Camera. Camera is used
for showing world around hero, if this world is larger, than
(SCREENWIDHT, SCREENHEIGHT). Also, here you can find class BackImage,
which is used for showing background image
"""
import pygame
pygame.init()
SCREENWIDTH = 900
SCREENHEIGHT = 600
class Came... | 28.630435 | 69 | 0.654518 |
815bec791ea5175670d99ab89fc7f426b8ec0c3d | 394 | py | Python | snackbar/wsgi.py | SujoyDU/SnackBar | 4046ca99bbe0fc4d208f39df8b0c911f05dac092 | [
"MIT"
] | null | null | null | snackbar/wsgi.py | SujoyDU/SnackBar | 4046ca99bbe0fc4d208f39df8b0c911f05dac092 | [
"MIT"
] | null | null | null | snackbar/wsgi.py | SujoyDU/SnackBar | 4046ca99bbe0fc4d208f39df8b0c911f05dac092 | [
"MIT"
] | null | null | null | """
WSGI config for snackbar project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SET... | 23.176471 | 78 | 0.786802 |
f32f7fb33214ebeb3672f622664bafcaf5c241cd | 972 | py | Python | pyleecan/Methods/Simulation/MagElmer/get_path_save_fea.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 95 | 2019-01-23T04:19:45.000Z | 2022-03-17T18:22:10.000Z | pyleecan/Methods/Simulation/MagElmer/get_path_save_fea.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 366 | 2019-02-20T07:15:08.000Z | 2022-03-31T13:37:23.000Z | pyleecan/Methods/Simulation/MagElmer/get_path_save_fea.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 74 | 2019-01-24T01:47:31.000Z | 2022-02-25T05:44:42.000Z | # -*- coding: utf-8 -*-
import os
from os.path import join, isdir
def get_path_save_fea(self, output):
"""Return the path to save the Elmer simulation
Parameters
----------
self : MagElmer
a MagElmer object
output : Output
an Output object
Returns
-------
save_pa... | 24.923077 | 61 | 0.579218 |
21bf0da7a292cdec748a05d5f3220ac1735a1019 | 22,116 | py | Python | schema_salad/python_codegen_support.py | pr80ik/schema_salad | 3cf7fafbdd07ecb448c32c939aca860173e598cf | [
"Apache-2.0"
] | null | null | null | schema_salad/python_codegen_support.py | pr80ik/schema_salad | 3cf7fafbdd07ecb448c32c939aca860173e598cf | [
"Apache-2.0"
] | null | null | null | schema_salad/python_codegen_support.py | pr80ik/schema_salad | 3cf7fafbdd07ecb448c32c939aca860173e598cf | [
"Apache-2.0"
] | null | null | null | import copy
import os
import re
import uuid as _uuid__ # pylint: disable=unused-import # noqa: F401
from io import StringIO
from typing import (
Any,
Dict,
List,
MutableMapping,
MutableSequence,
Optional,
Sequence,
Tuple,
Type,
Union,
)
from urllib.parse import quote, urlsplit, ... | 34.610329 | 96 | 0.539835 |
d272b0cbb6cddd108193634fe2a399655ee827b9 | 1,524 | py | Python | utils/faceobj.py | jinglingzhua/blinkblink | 1975be380ef08f895af4c1c07992efaed7af49e9 | [
"MIT"
] | 4 | 2021-05-24T10:59:06.000Z | 2022-03-14T01:25:54.000Z | utils/faceobj.py | jinglingzhua/blinkblink | 1975be380ef08f895af4c1c07992efaed7af49e9 | [
"MIT"
] | null | null | null | utils/faceobj.py | jinglingzhua/blinkblink | 1975be380ef08f895af4c1c07992efaed7af49e9 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
class FaceObj:
def __init__(self, bbox, landmark):
self.bbox, self.landmark = bbox, landmark
def xy_shift(self, left, top):
self.bbox += (left, top, left, top)
self.landmark += (left, top)
def draw_on(self, bgr, color=(0,255,0), thickn... | 27.709091 | 72 | 0.568241 |
0212581bd3e94a6b169413970af1c1b0125342b0 | 2,049 | py | Python | tcex/app_config/models/job_json_model.py | GShepherdTC/tcex | 70b1199b8bb9e63f53e2ba792489267108c909cd | [
"Apache-2.0"
] | null | null | null | tcex/app_config/models/job_json_model.py | GShepherdTC/tcex | 70b1199b8bb9e63f53e2ba792489267108c909cd | [
"Apache-2.0"
] | null | null | null | tcex/app_config/models/job_json_model.py | GShepherdTC/tcex | 70b1199b8bb9e63f53e2ba792489267108c909cd | [
"Apache-2.0"
] | null | null | null | """TcEx JSON Model"""
# pylint: disable=no-self-argument,no-self-use; noqa: N805
# standard library
from typing import List, Optional, Union
# third-party
from pydantic import BaseModel, validator
from semantic_version import Version
__all__ = ['JobJsonModel']
def snake_to_camel(snake_string: str) -> str:
"""Co... | 25.936709 | 89 | 0.674475 |
37d14db1adfa02da702b3ecb5e13052bb9a6bfab | 3,967 | py | Python | mayan/apps/checkouts/widgets.py | camerondphillips/MAYAN | b8cd44af50f0b2f2b59286d9c88e2f7aa573a93f | [
"Apache-2.0"
] | null | null | null | mayan/apps/checkouts/widgets.py | camerondphillips/MAYAN | b8cd44af50f0b2f2b59286d9c88e2f7aa573a93f | [
"Apache-2.0"
] | 1 | 2022-03-12T01:03:39.000Z | 2022-03-12T01:03:39.000Z | mayan/apps/checkouts/widgets.py | camerondphillips/MAYAN | b8cd44af50f0b2f2b59286d9c88e2f7aa573a93f | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import datetime
from django import forms
from django.core import validators
from django.utils.timezone import now
from django.utils.translation import ugettext_lazy as _
class SplitDeltaWidget(forms.widgets.MultiWidget):
"""
A Widget that splits a timedelta input into... | 40.479592 | 144 | 0.629191 |
4ef07168d96e6f98c26a78009ec719c508b4a13d | 21,440 | py | Python | ecdsa/test_pyecdsa.py | vbuterin/ngcccbase | c7c2b90627b99c3c1cd3526ff3986ee50745ea72 | [
"MIT"
] | 5 | 2016-01-07T13:48:42.000Z | 2022-01-16T22:54:12.000Z | ecdsa/test_pyecdsa.py | vbuterin/ngcccbase | c7c2b90627b99c3c1cd3526ff3986ee50745ea72 | [
"MIT"
] | null | null | null | ecdsa/test_pyecdsa.py | vbuterin/ngcccbase | c7c2b90627b99c3c1cd3526ff3986ee50745ea72 | [
"MIT"
] | null | null | null | import unittest
import os
import time
import shutil
import subprocess
from binascii import hexlify, unhexlify
from hashlib import sha1, sha256
from keys import SigningKey, VerifyingKey
from keys import BadSignatureError
import util
from util import sigencode_der, sigencode_strings
from util import sigdecode_der, sigde... | 44.024641 | 118 | 0.631297 |
2add75abd727262849f27bc08e6b13fd1a55339e | 5,139 | py | Python | coover/replayparser.py | coverosu/coover | 3ed295a1e3bde9091f506bc8835faf9d12ec1176 | [
"MIT"
] | null | null | null | coover/replayparser.py | coverosu/coover | 3ed295a1e3bde9091f506bc8835faf9d12ec1176 | [
"MIT"
] | null | null | null | coover/replayparser.py | coverosu/coover | 3ed295a1e3bde9091f506bc8835faf9d12ec1176 | [
"MIT"
] | 1 | 2020-10-22T09:48:20.000Z | 2020-10-22T09:48:20.000Z | import struct
import lzma
from enum import Enum, IntFlag, unique
@unique
class GameMode(Enum):
Standard = 0
Taiko = 1
CatchTheBeat = 2
Osumania = 3
@unique
class Mods(IntFlag):
NOMOD = 0
NOFAIL = 1 << 0
EASY = 1 << 1
TOUCHSCREEN = 1 << 2 # old: 'NOVIDEO'
HIDDEN ... | 28.55 | 134 | 0.637284 |
f7fdf079db52e320528a5a9fbc15b538be3b2556 | 2,918 | py | Python | huaweicloud-sdk-mrs/huaweicloudsdkmrs/v1/model/create_cluster_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-mrs/huaweicloudsdkmrs/v1/model/create_cluster_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-mrs/huaweicloudsdkmrs/v1/model/create_cluster_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class CreateClusterRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The k... | 25.823009 | 79 | 0.540439 |
00a43f5129a8f99a0e917609cb04f87d1027ec7f | 633 | py | Python | graph/numTreesInForest.py | chinchponkli/pyalgorithms | a6049bef779550c4814769fe58eeaa54f56cd4ca | [
"Apache-2.0"
] | null | null | null | graph/numTreesInForest.py | chinchponkli/pyalgorithms | a6049bef779550c4814769fe58eeaa54f56cd4ca | [
"Apache-2.0"
] | null | null | null | graph/numTreesInForest.py | chinchponkli/pyalgorithms | a6049bef779550c4814769fe58eeaa54f56cd4ca | [
"Apache-2.0"
] | null | null | null | '''
Given n nodes of a forest (collection of trees), find the number of trees in the forest.
'''
from undirectedgraph import Graph
def dfs(graph, vertex, visited):
visited[vertex] = True
for i in graph.graph[vertex]:
if not visited[i]:
dfs(graph, i, visited)
def numTrees(graph):
visit... | 21.827586 | 88 | 0.617694 |
21fd3084552d80180d2cafca33b2077218b07dbd | 3,777 | py | Python | imdb_sentiment/dataset.py | shazi4399/machine-learning-example | 0e332bc53ff85a11887012f7d5b09be9597bb4ef | [
"Apache-2.0"
] | 16 | 2021-07-09T08:40:50.000Z | 2022-03-29T03:21:18.000Z | imdb_sentiment/dataset.py | shazi4399/machine-learning-example | 0e332bc53ff85a11887012f7d5b09be9597bb4ef | [
"Apache-2.0"
] | null | null | null | imdb_sentiment/dataset.py | shazi4399/machine-learning-example | 0e332bc53ff85a11887012f7d5b09be9597bb4ef | [
"Apache-2.0"
] | 15 | 2021-06-07T11:20:38.000Z | 2022-03-08T15:48:50.000Z | # -*-coding:utf-8-*-
import os
import pickle
import re
import zipfile
from torch.utils.data import Dataset, DataLoader
from tqdm import tqdm
class ImdbDataset(Dataset):
def __init__(self, train=True):
# super(ImdbDataset,self).__init__()
if not os.path.exists("./data/download"):
... | 32.560345 | 144 | 0.548054 |
bba46c7d3165bb7f0a125fdba279a820de839234 | 2,024 | py | Python | sandbox/simstream/example/logfile_checker/log_consumer.py | docquantum/airavata | 4ec5fa0aab1b75ca1e98a16648c57cd8abdb4b9c | [
"ECL-2.0",
"Apache-2.0"
] | 74 | 2015-04-10T02:57:26.000Z | 2022-02-28T16:10:03.000Z | sandbox/simstream/example/logfile_checker/log_consumer.py | docquantum/airavata | 4ec5fa0aab1b75ca1e98a16648c57cd8abdb4b9c | [
"ECL-2.0",
"Apache-2.0"
] | 126 | 2015-04-26T02:55:26.000Z | 2022-02-16T22:43:28.000Z | sandbox/simstream/example/logfile_checker/log_consumer.py | docquantum/airavata | 4ec5fa0aab1b75ca1e98a16648c57cd8abdb4b9c | [
"ECL-2.0",
"Apache-2.0"
] | 163 | 2015-01-22T14:05:24.000Z | 2022-03-17T12:24:34.000Z | #
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may n... | 31.625 | 80 | 0.62253 |
7848c94b72817e9e62402491769927442ec558c5 | 724 | py | Python | nff/train/transfer.py | torchmd/mdgrad | 77bd7685b74b41acf54a9483546e1e8cb545eb01 | [
"MIT"
] | 54 | 2021-03-10T18:35:49.000Z | 2022-03-28T13:54:47.000Z | nff/train/transfer.py | wwang2/torchmd | 77bd7685b74b41acf54a9483546e1e8cb545eb01 | [
"MIT"
] | 1 | 2021-03-17T07:01:02.000Z | 2021-03-17T07:01:02.000Z | nff/train/transfer.py | torchmd/mdgrad | 77bd7685b74b41acf54a9483546e1e8cb545eb01 | [
"MIT"
] | 5 | 2021-06-08T02:44:35.000Z | 2021-12-17T11:50:08.000Z | """
The transfer learning module provides functions to fine tune
a pretrained model with a new given dataloader. It relies
on pretrained models, which can be loaded from checkpoints
or best models using the Trainer class.
"""
import torch
def freeze_parameters(model):
"""
Freezes all parameters f... | 21.294118 | 62 | 0.674033 |
838c4cd7bf9e9f357405a8dc97cac29f49b3b250 | 6,014 | py | Python | python/utir/ast/nodes.py | ChanTsune/Unit-Test-IR | 201b5171b6abe600d4f6acf869fbe02ee6e18a3d | [
"MIT"
] | 2 | 2021-01-21T05:57:07.000Z | 2021-03-08T15:18:21.000Z | python/utir/ast/nodes.py | ChanTsune/Unit-Test-IR | 201b5171b6abe600d4f6acf869fbe02ee6e18a3d | [
"MIT"
] | 2 | 2020-11-18T07:53:30.000Z | 2020-12-28T08:40:18.000Z | python/utir/ast/nodes.py | ChanTsune/Unit-Test-IR | 201b5171b6abe600d4f6acf869fbe02ee6e18a3d | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from typing import Any, List, Optional
from enum import Enum
from .base import AST
class Node(AST):
pass
@dataclass
class File(Node):
body: List[Node]
def serialize(self):
return {
'Node': 'File',
'Body': [i.serialize() for i in self.bo... | 18.447853 | 80 | 0.501995 |
5320b578857ab5c3da76a43799b38203ee65a96b | 151 | py | Python | xlsxplt_pandas/__init__.py | dieterv77/xlsxplt_pandas | 7bc6a2dd3d486ba36823de6ae2c1080d42698688 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2020-03-26T21:25:00.000Z | 2020-03-26T21:25:00.000Z | xlsxplt_pandas/__init__.py | dieterv77/xlsxplt_pandas | 7bc6a2dd3d486ba36823de6ae2c1080d42698688 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxplt_pandas/__init__.py | dieterv77/xlsxplt_pandas | 7bc6a2dd3d486ba36823de6ae2c1080d42698688 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | from .plotdf import getWorkbook, writeData, addSeries, plotBarChart, plotColumnChart, plotLineChart, addScatterSeries, plotScatterChart, plotHistogram
| 75.5 | 150 | 0.860927 |
5a8d2d91fa45eee15135c6c1f151de9b0bcf68a2 | 256 | py | Python | djangocms_forms/apps.py | ivarsg/djangocms-forms | a8eddec82ee7ae09d63d60fc5801edf0b639438a | [
"BSD-3-Clause"
] | 3 | 2020-08-14T08:35:43.000Z | 2020-08-26T09:01:43.000Z | djangocms_forms/apps.py | ivarsg/djangocms-forms | a8eddec82ee7ae09d63d60fc5801edf0b639438a | [
"BSD-3-Clause"
] | 4 | 2020-08-31T19:05:38.000Z | 2020-11-09T15:49:03.000Z | djangocms_forms/apps.py | ivarsg/djangocms-forms | a8eddec82ee7ae09d63d60fc5801edf0b639438a | [
"BSD-3-Clause"
] | 8 | 2019-12-02T19:04:39.000Z | 2022-02-08T06:58:18.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class DjangoCMSFormsConfig(AppConfig):
name = "djangocms_forms"
verbose_name = _("Forms")
| 21.333333 | 55 | 0.757813 |
f48df0e21bf524dd6496958d3fcfa9528cd177ab | 4,606 | py | Python | dataset_converters/COCO2TDGConverter.py | igiloh/Dataset-Converters | 0b007c452895680b78cb31283801011967e94e3d | [
"MIT"
] | 48 | 2019-01-29T10:53:26.000Z | 2022-02-22T06:42:43.000Z | dataset_converters/COCO2TDGConverter.py | igiloh/Dataset-Converters | 0b007c452895680b78cb31283801011967e94e3d | [
"MIT"
] | 2 | 2019-05-05T08:27:10.000Z | 2021-08-20T14:27:58.000Z | dataset_converters/COCO2TDGConverter.py | igiloh/Dataset-Converters | 0b007c452895680b78cb31283801011967e94e3d | [
"MIT"
] | 15 | 2019-02-03T12:16:48.000Z | 2022-03-17T06:31:11.000Z | from itertools import groupby
import json
import os
import re
from dataset_converters.ConverterBase import ConverterBase
def numeric_order(string):
return int(re.match('[0-9]+', string).group(0))
class COCO2TDGConverter(ConverterBase):
formats = ['COCO2TDG', 'COCO2TDGSEGM']
def __init__(self, copy_fn... | 39.706897 | 119 | 0.592922 |
0b4a2ecb951ab0f9f3b5a54edd450df1753c8cc9 | 146 | py | Python | likeapp/apps.py | verhovensky/likeapprestapi | 4a87690a37568041d5498c8b94259704af080af1 | [
"MIT"
] | null | null | null | likeapp/apps.py | verhovensky/likeapprestapi | 4a87690a37568041d5498c8b94259704af080af1 | [
"MIT"
] | null | null | null | likeapp/apps.py | verhovensky/likeapprestapi | 4a87690a37568041d5498c8b94259704af080af1 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class LikeappConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'likeapp'
| 20.857143 | 56 | 0.760274 |
846ac3671b365f285d213d7d0867ce4da90eb26d | 636 | py | Python | var/spack/repos/builtin/packages/py-pytest-isort/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/py-pytest-isort/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/py-pytest-isort/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyPytestIsort(PythonPackage):
"""py.test plugin to check import ordering using isort"""
... | 33.473684 | 95 | 0.720126 |
6ed9a1f79ece03fd26b26c10e71e5bcade1f6899 | 6,017 | py | Python | selfdrive/car/modules/UIBT_module.py | cron410/openpilot | 9d1201882fd9b97341de736a6f931b0caf50aeb5 | [
"MIT"
] | null | null | null | selfdrive/car/modules/UIBT_module.py | cron410/openpilot | 9d1201882fd9b97341de736a6f931b0caf50aeb5 | [
"MIT"
] | null | null | null | selfdrive/car/modules/UIBT_module.py | cron410/openpilot | 9d1201882fd9b97341de736a6f931b0caf50aeb5 | [
"MIT"
] | null | null | null | #library to work with buttons and ui.c via buttons.msg file
import struct
#from ctypes import create_string_buffer
import os
from datetime import datetime
from common.basedir import BASEDIR
buttons_file_rw = "wb"
buttons_file_r = "rb"
btn_msg_len = 23
btn_msg_struct = "6s6s11s" #name=5 char string, label = 5 char str... | 38.324841 | 110 | 0.604122 |
1c24d7d75a65ffcbf8e0f69661b386d2f710a0e0 | 2,307 | py | Python | hub_module/tests/unittests/test_mobilenet_v1.py | 18621579069/PaddleHub-yu | 15e8bcef2addf239081e235bdcfd039de12330e0 | [
"Apache-2.0"
] | 4 | 2021-02-25T03:27:38.000Z | 2021-05-15T03:20:23.000Z | hub_module/tests/unittests/test_mobilenet_v1.py | 18621579069/PaddleHub-yu | 15e8bcef2addf239081e235bdcfd039de12330e0 | [
"Apache-2.0"
] | null | null | null | hub_module/tests/unittests/test_mobilenet_v1.py | 18621579069/PaddleHub-yu | 15e8bcef2addf239081e235bdcfd039de12330e0 | [
"Apache-2.0"
] | 2 | 2021-03-01T07:04:01.000Z | 2021-05-14T05:54:18.000Z | # coding=utf-8
import os
import unittest
import cv2
import numpy as np
import paddle.fluid as fluid
import paddlehub as hub
class TestMobileNetV1(unittest.TestCase):
@classmethod
def setUpClass(self):
"""Prepare the environment once before execution of all tests."""
# self.mobilenet_v1 = hub.... | 33.926471 | 73 | 0.601214 |
97ce47c6c355097d363409f06ea8de8128c62289 | 787 | py | Python | tools/testSympy.py | SubwayScientist/c2B_exercise1 | fb80b7e361b8afd7229f3d3415decd0bec616ccb | [
"MIT"
] | null | null | null | tools/testSympy.py | SubwayScientist/c2B_exercise1 | fb80b7e361b8afd7229f3d3415decd0bec616ccb | [
"MIT"
] | null | null | null | tools/testSympy.py | SubwayScientist/c2B_exercise1 | fb80b7e361b8afd7229f3d3415decd0bec616ccb | [
"MIT"
] | null | null | null | import sympy as sy
kx, ky = sy.symbols("k_x k_y")
Kx, Ky = sy.symbols("K_x K_y")
t, tp, tpp, mu = sy.symbols("t tp tpp mu")
# choose the right Rx, Ry
Rx = -1
Ry = -1
Kx = [0,sy.pi,0,sy.pi]
Ky = [0,0,sy.pi,sy.pi]
term = 0
for i in range(4):
exp1 = sy.sympify('exp(I*(Kx*Rx+Ky*Ry))',locals={'Rx':Rx,'Ry':Ry,'Kx':Kx[... | 29.148148 | 139 | 0.454892 |
476f100769e1e720c8e9034826fde157b9f3e55f | 8,950 | py | Python | src/experiments/baseline_config_fine_tune.py | LeanderLXZ/capsule-tf | 9b6a82c06027743062578b7f4f463cc3edf2395e | [
"Apache-2.0"
] | null | null | null | src/experiments/baseline_config_fine_tune.py | LeanderLXZ/capsule-tf | 9b6a82c06027743062578b7f4f463cc3edf2395e | [
"Apache-2.0"
] | null | null | null | src/experiments/baseline_config_fine_tune.py | LeanderLXZ/capsule-tf | 9b6a82c06027743062578b7f4f463cc3edf2395e | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from easydict import EasyDict
# Auto-pipeline version
def _auto_version(c):
_version = c['DATABASE_NAME']
if c['WITH_REC']:
_version += '_{}_{}'.format(c['DECODER_TYPE'], c['REC_LOSS'])
else:
_v... | 24.930362 | 75 | 0.637318 |
ba82147d558f5ddfba9d59c7c702ee28f08d0f12 | 80 | py | Python | enthought/chaco/label.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 3 | 2016-12-09T06:05:18.000Z | 2018-03-01T13:00:29.000Z | enthought/chaco/label.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 1 | 2020-12-02T00:51:32.000Z | 2020-12-02T08:48:55.000Z | enthought/chaco/label.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | null | null | null | # proxy module
from __future__ import absolute_import
from chaco.label import *
| 20 | 38 | 0.825 |
d54f7624253e9be384759338e9dc1a0c930db8f6 | 6,513 | bzl | Python | antlir/bzl/image_source.bzl | facebookincubator/fs_image | 3515a24bb0e93176a5584bdc8839464fa28390d7 | [
"MIT"
] | 9 | 2019-12-02T20:17:35.000Z | 2020-06-13T16:34:25.000Z | antlir/bzl/image_source.bzl | facebookincubator/fs_image | 3515a24bb0e93176a5584bdc8839464fa28390d7 | [
"MIT"
] | 19 | 2019-11-22T23:30:04.000Z | 2020-07-16T18:05:48.000Z | antlir/bzl/image_source.bzl | facebookincubator/fs_image | 3515a24bb0e93176a5584bdc8839464fa28390d7 | [
"MIT"
] | 4 | 2019-12-04T19:03:28.000Z | 2020-06-13T16:34:29.000Z | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("@bazel_skylib//lib:types.bzl", "types")
load("//antlir/bzl:shape.bzl", "shape")
load(":image_source.shape.bzl", "image_source_t")
load... | 50.488372 | 85 | 0.654844 |
5a1e480a2db3bc1727afd49c9715d954e43ad548 | 22 | py | Python | next/broker/__init__.py | erinzm/NEXT-chemistry | d6ca0a80640937b36f9cafb5ead371e7a8677734 | [
"Apache-2.0"
] | 155 | 2015-11-01T17:48:41.000Z | 2022-02-06T21:37:41.000Z | next/broker/__init__.py | erinzm/NEXT-chemistry | d6ca0a80640937b36f9cafb5ead371e7a8677734 | [
"Apache-2.0"
] | 193 | 2015-09-29T21:40:31.000Z | 2020-04-21T15:09:13.000Z | next/broker/__init__.py | erinzm/NEXT-chemistry | d6ca0a80640937b36f9cafb5ead371e7a8677734 | [
"Apache-2.0"
] | 54 | 2015-09-30T15:51:05.000Z | 2022-02-13T05:26:20.000Z | from .broker import *
| 11 | 21 | 0.727273 |
cfdb4319b8d699b5fba7770dd93d194088c21dc6 | 5,855 | py | Python | modules/logs.py | MrSpaar/Dpy-PolyBot | 7eb46ddd6fc63f46365a2c7b1cf6eb623b30877d | [
"BSD-3-Clause"
] | 1 | 2021-06-29T23:47:48.000Z | 2021-06-29T23:47:48.000Z | modules/logs.py | MrSpaar/polybot | 7eb46ddd6fc63f46365a2c7b1cf6eb623b30877d | [
"BSD-3-Clause"
] | null | null | null | modules/logs.py | MrSpaar/polybot | 7eb46ddd6fc63f46365a2c7b1cf6eb623b30877d | [
"BSD-3-Clause"
] | 1 | 2022-01-16T21:41:24.000Z | 2022-01-16T21:41:24.000Z | from discord import Embed, Member, Guild, User, Message, Invite
from discord.ext.commands import Context
from discord.ext import commands
from discord.utils import get
from core.cls import Bot
from core.tools import now
from datetime import timedelta
from time import mktime
class Logs(commands.Cog):
def __init__... | 44.022556 | 157 | 0.635184 |
6740294ba54152d82730a08c3d0f1d63532811ee | 263 | py | Python | python/text_translator.py | dewansh3255k/java-html-5-new-project | f9c9ec61e315daba92388e29c4f4a1f0fc57f2ab | [
"MIT"
] | null | null | null | python/text_translator.py | dewansh3255k/java-html-5-new-project | f9c9ec61e315daba92388e29c4f4a1f0fc57f2ab | [
"MIT"
] | null | null | null | python/text_translator.py | dewansh3255k/java-html-5-new-project | f9c9ec61e315daba92388e29c4f4a1f0fc57f2ab | [
"MIT"
] | 1 | 2021-10-31T13:03:39.000Z | 2021-10-31T13:03:39.000Z | from translate import Translator
translator = Translator(to_lang="zh")
cmd = input("Enter text that to be translated : ")
try:
translation = translator.translate(cmd)
print(translation)
except Exception as e:
print("An Error Found\n")
raise e
| 18.785714 | 50 | 0.711027 |
c7736adcd207c42c5d6b60e68222c855d73b79ae | 3,424 | py | Python | slixmpp/plugins/__init__.py | cnngimenez/slixmpp | bb61f0f39dfba205282dab50c0f3a47b26145c74 | [
"BSD-3-Clause"
] | null | null | null | slixmpp/plugins/__init__.py | cnngimenez/slixmpp | bb61f0f39dfba205282dab50c0f3a47b26145c74 | [
"BSD-3-Clause"
] | null | null | null | slixmpp/plugins/__init__.py | cnngimenez/slixmpp | bb61f0f39dfba205282dab50c0f3a47b26145c74 | [
"BSD-3-Clause"
] | null | null | null | """
Slixmpp: The Slick XMPP Library
Copyright (C) 2010 Nathanael C. Fritz
This file is part of Slixmpp.
See the file LICENSE for copying permission.
"""
from slixmpp.plugins.base import PluginManager, PluginNotFound, BasePlugin
from slixmpp.plugins.base import register_plugin, load_plugin
__all__ = ... | 37.217391 | 74 | 0.659463 |
6f72ab957037fc0ed40bd2fdaf65a5b040673df8 | 4,656 | py | Python | service/util/pay/alipay/alipayf2f.py | Ecalose/faka | 5193923ba99950d6e9cd2ee03ee2f7afe37a7c3b | [
"MIT"
] | null | null | null | service/util/pay/alipay/alipayf2f.py | Ecalose/faka | 5193923ba99950d6e9cd2ee03ee2f7afe37a7c3b | [
"MIT"
] | null | null | null | service/util/pay/alipay/alipayf2f.py | Ecalose/faka | 5193923ba99950d6e9cd2ee03ee2f7afe37a7c3b | [
"MIT"
] | null | null | null | from alipay import AliPay
from alipay.utils import AliPayConfig
# app_private_key_string = open("/path/to/your/private/key.pem").read()
# alipay_public_key_string = open("/path/to/alipay/public/key.pem").read()
class AlipayF2F:
def __init__(self):
from service.util.pay.pay_config import get_config
... | 60.467532 | 1,723 | 0.773196 |
588f628f22b3e6976028fc08562a150ff551ca9b | 501 | py | Python | views/about.py | MatthewKosloski/student-information-system | a3469647298d62c45c793e70a3ac70c0524340e2 | [
"CECILL-B"
] | null | null | null | views/about.py | MatthewKosloski/student-information-system | a3469647298d62c45c793e70a3ac70c0524340e2 | [
"CECILL-B"
] | null | null | null | views/about.py | MatthewKosloski/student-information-system | a3469647298d62c45c793e70a3ac70c0524340e2 | [
"CECILL-B"
] | null | null | null | from .base import BaseView
class AboutView(BaseView):
def __init__(self, controller):
super().__init__(controller)
self.set_choices([
'Back'
])
def render(self, payload):
self.print_title('About')
print('This Student Information System is made by Logan Miller,\n' +
'Matthew Kosloski, and Paul ... | 23.857143 | 70 | 0.712575 |
2467ad38a8a27173adc4734166acadce99e6a8e0 | 15,181 | py | Python | xhtml2pdf/default.py | sbarysiuk/xhtml2pdf | 92ce878efa9b6571ef86ffb654c137bb86355dd1 | [
"Apache-2.0"
] | 1 | 2020-06-23T18:13:31.000Z | 2020-06-23T18:13:31.000Z | xhtml2pdf/default.py | Goldmund-Wyldebeast-Wunderliebe/xhtml2pdf-legacy | 6f29c8521d1f8e6461745686f26f84dbfdcc8b02 | [
"Apache-2.0"
] | null | null | null | xhtml2pdf/default.py | Goldmund-Wyldebeast-Wunderliebe/xhtml2pdf-legacy | 6f29c8521d1f8e6461745686f26f84dbfdcc8b02 | [
"Apache-2.0"
] | 1 | 2020-06-23T18:10:48.000Z | 2020-06-23T18:10:48.000Z | # -*- coding: utf-8 -*-
from reportlab.lib.pagesizes import (A0, A1, A2, A3, A4, A5, A6, B0, B1, B2, B3,
B4, B5, B6, LETTER, LEGAL, ELEVENSEVENTEEN)
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... | 23.646417 | 89 | 0.379488 |
32774b178f8ae7e1545be3ca8a08bc2156c4c202 | 1,103 | py | Python | practiceCRUD/employeeRegister/views.py | faisaladisoe/learn-python-rest-API | d597f38eea4aff54889c241303df5136dc9278ae | [
"MIT"
] | null | null | null | practiceCRUD/employeeRegister/views.py | faisaladisoe/learn-python-rest-API | d597f38eea4aff54889c241303df5136dc9278ae | [
"MIT"
] | null | null | null | practiceCRUD/employeeRegister/views.py | faisaladisoe/learn-python-rest-API | d597f38eea4aff54889c241303df5136dc9278ae | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from .forms import EmployeeForm, PositionForm
from .models import Employee, Position
# Create your views here.
def employee_list(request):
content = {
'employeeList' : Employee.objects.all()
}
return render(request, 'employeeRegister/employeeLi... | 31.514286 | 78 | 0.575703 |
c9de8128e4f7540c752848feacc925c78418dfb3 | 3,108 | py | Python | setup.py | Alzpeta/testinvenio | 210e4b6ce6b1edcb2ce9ded1bc683745e7eb421a | [
"MIT"
] | null | null | null | setup.py | Alzpeta/testinvenio | 210e4b6ce6b1edcb2ce9ded1bc683745e7eb421a | [
"MIT"
] | null | null | null | setup.py | Alzpeta/testinvenio | 210e4b6ce6b1edcb2ce9ded1bc683745e7eb421a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 alzp.
#
# testInvenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Invenio digital library framework."""
import os
import invenio_oaiserver.minters
from setuptools import find_packa... | 32.715789 | 72 | 0.617761 |
46e5762eb593988a3f01c46dce790ebe3b77514a | 789 | py | Python | src/rnn_predict.py | tomoino/GagRocket | 1f0bbef1a48cc12774d11bc380f0b72b9ffaf9f1 | [
"MIT"
] | null | null | null | src/rnn_predict.py | tomoino/GagRocket | 1f0bbef1a48cc12774d11bc380f0b72b9ffaf9f1 | [
"MIT"
] | 19 | 2020-10-11T04:21:22.000Z | 2020-11-05T15:04:28.000Z | src/rnn_predict.py | tomoino/GagRocket | 1f0bbef1a48cc12774d11bc380f0b72b9ffaf9f1 | [
"MIT"
] | null | null | null | import numpy as np
from keras.models import load_model
def predict(gags, model_filepath="model/rnn_model.h5"):
model = load_model(model_filepath)
ret = model.predict(gags)
return ret
def load_word_index(filepath):
word_index = {}
with open(filepath,'r') as f:
for l in f:
row =... | 29.222222 | 93 | 0.634981 |
12ed4fcf4ebc0c9b08f93561eb6cd4895aaa3d6a | 14,240 | py | Python | pygsm/optimizers/_linesearch.py | shihchengli/pyGSM | b3bbfe86c9d9e68a82fd85cd1650cd0bd4e49406 | [
"MIT"
] | 27 | 2019-09-11T15:20:46.000Z | 2022-03-07T22:41:58.000Z | pygsm/optimizers/_linesearch.py | shihchengli/pyGSM | b3bbfe86c9d9e68a82fd85cd1650cd0bd4e49406 | [
"MIT"
] | 27 | 2018-12-03T20:48:11.000Z | 2022-03-17T05:38:49.000Z | pygsm/optimizers/_linesearch.py | shihchengli/pyGSM | b3bbfe86c9d9e68a82fd85cd1650cd0bd4e49406 | [
"MIT"
] | 18 | 2019-12-24T08:05:31.000Z | 2022-03-01T19:11:23.000Z | import sys
import numpy as np
from utilities import *
#TODO remove unecessary arguments: nconstraints, xp, ,...
def NoLineSearch(n, x, fx, g, d, step, xp, constraint_step, parameters, molecule, verbose=False):
x = x + d * step + constraint_step #
xyz = molecule.coord_obj.newCartesian(molecule.xyz, x-xp, ... | 31.365639 | 154 | 0.561447 |
d1e95630bd000ff01ba941f200560b52a31db9cf | 5,158 | py | Python | src/transformers/models/visual_bert/convert_visual_bert_original_pytorch_checkpoint_to_pytorch.py | liminghao1630/transformers | 207594be81b8e5a8589c8b11c3b236924555d806 | [
"Apache-2.0"
] | 50,404 | 2019-09-26T09:55:55.000Z | 2022-03-31T23:07:49.000Z | src/transformers/models/visual_bert/convert_visual_bert_original_pytorch_checkpoint_to_pytorch.py | liminghao1630/transformers | 207594be81b8e5a8589c8b11c3b236924555d806 | [
"Apache-2.0"
] | 13,179 | 2019-09-26T10:10:57.000Z | 2022-03-31T23:17:08.000Z | src/transformers/models/visual_bert/convert_visual_bert_original_pytorch_checkpoint_to_pytorch.py | liminghao1630/transformers | 207594be81b8e5a8589c8b11c3b236924555d806 | [
"Apache-2.0"
] | 13,337 | 2019-09-26T10:49:38.000Z | 2022-03-31T23:06:17.000Z | # coding=utf-8
# Copyright 2021 The HuggingFace Inc. 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... | 34.15894 | 111 | 0.688445 |
61e6b5d37fe04b0cb83b8090bef9dc29bbd444fa | 7,190 | py | Python | database/common_models.py | jakehemmerle/beiwe-backend | fd7765a348a0d497341cf084bb4da0c0805748bd | [
"BSD-3-Clause"
] | null | null | null | database/common_models.py | jakehemmerle/beiwe-backend | fd7765a348a0d497341cf084bb4da0c0805748bd | [
"BSD-3-Clause"
] | 67 | 2020-05-22T20:34:52.000Z | 2021-07-28T14:26:57.000Z | database/common_models.py | tx-covid19/beiwe-backend-serverless | b154110c8543e4317d3295c0e8225e9a97b1aad4 | [
"BSD-3-Clause"
] | 2 | 2020-04-03T23:24:56.000Z | 2020-04-13T14:29:02.000Z | import json
from random import choice as random_choice
from django.db import models
from django.db.models.fields.related import RelatedField
from config.study_constants import OBJECT_ID_ALLOWED_CHARS
class ObjectIdError(Exception): pass
class JSONTextField(models.TextField):
"""
A TextField for holding JS... | 41.085714 | 107 | 0.645063 |
3ad58c36f377c6d5df3c706166e005b991124331 | 18,412 | py | Python | tweet_stream.py | djunehor/twitter-blocker | 661c798a050face2c7538eb9f4e5935d597df569 | [
"MIT"
] | 2 | 2021-01-11T23:50:02.000Z | 2022-01-14T02:34:34.000Z | tweet_stream.py | djunehor/twitter-blocker | 661c798a050face2c7538eb9f4e5935d597df569 | [
"MIT"
] | null | null | null | tweet_stream.py | djunehor/twitter-blocker | 661c798a050face2c7538eb9f4e5935d597df569 | [
"MIT"
] | 1 | 2022-03-10T17:28:39.000Z | 2022-03-10T17:28:39.000Z | from tweepy import API, OAuthHandler, Stream, StreamListener
from time import sleep
from dotenv import load_dotenv
from threading import Thread
import os
import mysql.connector
import random
load_dotenv('.env')
# Go to http://apps.twitter.com and create an app.
# The consumer key and secret will be generated for you ... | 31.744828 | 175 | 0.57229 |
cdd2ade2cdc8306ad783446dc0430cb7ab1bb2a4 | 1,049 | py | Python | complete/21 - 30/Problem24/main.py | this-jacob/project-euler | 8f9e700e2875e84d081eade44fd2107db0a0ae12 | [
"MIT"
] | null | null | null | complete/21 - 30/Problem24/main.py | this-jacob/project-euler | 8f9e700e2875e84d081eade44fd2107db0a0ae12 | [
"MIT"
] | null | null | null | complete/21 - 30/Problem24/main.py | this-jacob/project-euler | 8f9e700e2875e84d081eade44fd2107db0a0ae12 | [
"MIT"
] | null | null | null | import time
global bump
bump = 1
def main():
start_time = time.time()
number = [0, 1, 2, 3]
i = 0
while i < 100:
number = nextOrder(number)
print number
i += 1
print number
print time.time() - start_time
def nextOrder(n):
#global bump
strNum = ''
int... | 15.893939 | 47 | 0.438513 |
d1588057790b7fbc7e53dd1e4363ccf5375897dc | 607 | py | Python | celery_task/task.py | Misschl/FreshMalls | 928eb27648d8805a031290e9184f21fcbaf142f8 | [
"BSD-2-Clause"
] | 1 | 2021-09-08T03:27:08.000Z | 2021-09-08T03:27:08.000Z | celery_task/task.py | Misschl/FreshMalls | 928eb27648d8805a031290e9184f21fcbaf142f8 | [
"BSD-2-Clause"
] | null | null | null | celery_task/task.py | Misschl/FreshMalls | 928eb27648d8805a031290e9184f21fcbaf142f8 | [
"BSD-2-Clause"
] | null | null | null | from celery import Celery
from django.conf import settings
from django.core.mail import send_mail
broker = settings.REDIS_URL.format(3)
app = Celery('celery_task.task', broker=broker)
@app.task
def send_register_active_mail(to_email, username, token):
subject = '生鲜商城欢迎信息'
message = ''
sender = settings.... | 31.947368 | 95 | 0.724876 |
32986070f2397032e999dcd670eb24a61c59236d | 1,051 | py | Python | tests/upgrade_dat/custom_extension/sunk_costs.py | DesmondZhong/switch | 88abc164128b6a7345c7aa8806e2b37f74de54fa | [
"ECL-2.0",
"Apache-2.0"
] | 100 | 2015-06-30T02:33:39.000Z | 2022-02-07T17:28:10.000Z | tests/upgrade_dat/custom_extension/sunk_costs.py | DesmondZhong/switch | 88abc164128b6a7345c7aa8806e2b37f74de54fa | [
"ECL-2.0",
"Apache-2.0"
] | 117 | 2015-07-07T00:45:01.000Z | 2021-05-29T18:55:06.000Z | tests/upgrade_dat/custom_extension/sunk_costs.py | DesmondZhong/switch | 88abc164128b6a7345c7aa8806e2b37f74de54fa | [
"ECL-2.0",
"Apache-2.0"
] | 70 | 2015-06-30T02:36:05.000Z | 2022-03-08T00:15:32.000Z | # Copyright 2015 The Switch Authors. All rights reserved.
# Licensed under the Apache License, Version 2, which is in the LICENSE file.
"""
Add custom components to the Switch model to describe fixed system
costs that are needed to accurately calculate electricity costs. This
mimics the convention of switch modules t... | 30.911765 | 77 | 0.794481 |
645d17e37c79950bde3ba90cbadcdfdfeb490bc1 | 196 | py | Python | json2html/__init__.py | mkoderer/json2html | e1feea273b210d11e4b2e59b9778a0bb4845fbd4 | [
"MIT"
] | 236 | 2015-01-23T16:21:30.000Z | 2022-03-30T14:13:55.000Z | json2html/__init__.py | mkoderer/json2html | e1feea273b210d11e4b2e59b9778a0bb4845fbd4 | [
"MIT"
] | 46 | 2015-01-31T21:08:07.000Z | 2021-06-30T16:53:34.000Z | json2html/__init__.py | mkoderer/json2html | e1feea273b210d11e4b2e59b9778a0bb4845fbd4 | [
"MIT"
] | 89 | 2015-01-31T06:47:49.000Z | 2022-03-30T14:14:25.000Z | '''
python wrapper for JSON to HTML-Table convertor
(c) 2013-2021 Varun Malhotra. MIT License
'''
from .jsonconv import *
__author__ = 'Varun Malhotra'
__version__ = '1.3.0'
__license__ = 'MIT'
| 17.818182 | 47 | 0.719388 |
b45ee4c41272169c19341ef5e1b8b6aa5d832bc6 | 86 | py | Python | slide/snippet/map_identity.py | TomohikoK/PyCat | d36632a6a348c1cdad8ba0594a7600e350c72f7c | [
"Apache-2.0"
] | null | null | null | slide/snippet/map_identity.py | TomohikoK/PyCat | d36632a6a348c1cdad8ba0594a7600e350c72f7c | [
"Apache-2.0"
] | 6 | 2018-04-13T11:27:00.000Z | 2018-05-11T11:57:57.000Z | slide/snippet/map_identity.py | TomohikoK/PyCat | d36632a6a348c1cdad8ba0594a7600e350c72f7c | [
"Apache-2.0"
] | null | null | null | from typing import List
x: List[str] = ['a', 'b']
assert x == list(map(identity, x))
| 17.2 | 34 | 0.616279 |
bc622d92462c4aa99ccd5fb1510af67c14267719 | 758 | py | Python | cpdb/trr/migrations/0013_trrattachmentrequest_added_to_foia_airtable_and_timestamp.py | invinst/CPDBv2_backend | b4e96d620ff7a437500f525f7e911651e4a18ef9 | [
"Apache-2.0"
] | 25 | 2018-07-20T22:31:40.000Z | 2021-07-15T16:58:41.000Z | cpdb/trr/migrations/0013_trrattachmentrequest_added_to_foia_airtable_and_timestamp.py | invinst/CPDBv2_backend | b4e96d620ff7a437500f525f7e911651e4a18ef9 | [
"Apache-2.0"
] | 13 | 2018-06-18T23:08:47.000Z | 2022-02-10T07:38:25.000Z | cpdb/trr/migrations/0013_trrattachmentrequest_added_to_foia_airtable_and_timestamp.py | invinst/CPDBv2_backend | b4e96d620ff7a437500f525f7e911651e4a18ef9 | [
"Apache-2.0"
] | 6 | 2018-05-17T21:59:43.000Z | 2020-11-17T00:30:26.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-10-01 04:38
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('trr', '0012_trr_attachment_request'),
]
operations = [... | 27.071429 | 93 | 0.639842 |
354c3f301869efe1da083d87601f47bb593af8b4 | 4,188 | py | Python | release/long_running_distributed_tests/workloads/pytorch_pbt_failure.py | jamesanto/ray | f640758c852b9eece756d3d2a562af78273a9f36 | [
"Apache-2.0"
] | 3 | 2021-08-29T20:41:21.000Z | 2022-01-31T18:47:51.000Z | release/long_running_distributed_tests/workloads/pytorch_pbt_failure.py | QPC-database/amazon-ray | 55aa4cac02a412b96252aea4e8c3f177a28324a1 | [
"Apache-2.0"
] | 70 | 2021-01-13T04:28:37.000Z | 2022-03-12T08:03:17.000Z | release/long_running_distributed_tests/workloads/pytorch_pbt_failure.py | majacQ/ray | bc08c6cdcc7ddf4da751ca2a972defd3db509061 | [
"Apache-2.0"
] | 1 | 2020-01-16T20:52:25.000Z | 2020-01-16T20:52:25.000Z | import argparse
import numpy as np
import os
import torch
import torch.nn as nn
from torch.utils.data import DataLoader, Subset
from torchvision.datasets import CIFAR10
import torchvision.transforms as transforms
import ray
from ray import tune
from ray.tune import CLIReporter
from ray.tune.schedulers import Populatio... | 31.969466 | 77 | 0.702006 |
ee423f8cd87d90b97a3eff773901fd8c6fee744c | 1,201 | py | Python | lagou/lagou/middlewares.py | zymtech/Scrapiders | 2a63c1ce6324d4e719275e675f991f253bb9f4fb | [
"MIT"
] | null | null | null | lagou/lagou/middlewares.py | zymtech/Scrapiders | 2a63c1ce6324d4e719275e675f991f253bb9f4fb | [
"MIT"
] | null | null | null | lagou/lagou/middlewares.py | zymtech/Scrapiders | 2a63c1ce6324d4e719275e675f991f253bb9f4fb | [
"MIT"
] | null | null | null | # encoding = utf-8
import random
import base64
from settings import PROXIES
class RandomUserAgent(object):
"""Randomly rotate user agents based on a list of predefined ones"""
def __init__(self, agents):
self.agents = agents
@classmethod
def from_crawler(cls, crawler):
return cls(cr... | 37.53125 | 90 | 0.609492 |
24191bf3ab38664dca74eaac63a1c318c7657abf | 121,303 | py | Python | toontown/toon/Toon.py | SuperM0use24/TT-CL-Edition | fdad8394f0656ae122b687d603f72afafd220c65 | [
"MIT"
] | null | null | null | toontown/toon/Toon.py | SuperM0use24/TT-CL-Edition | fdad8394f0656ae122b687d603f72afafd220c65 | [
"MIT"
] | 1 | 2021-06-08T17:16:48.000Z | 2021-06-08T17:16:48.000Z | toontown/toon/Toon.py | SuperM0use24/TT-CL-Edition | fdad8394f0656ae122b687d603f72afafd220c65 | [
"MIT"
] | 3 | 2021-06-03T05:36:36.000Z | 2021-06-22T15:07:31.000Z | from otp.avatar import Avatar
from otp.avatar.Avatar import teleportNotify
import ToonDNA
from direct.task.Task import Task
from toontown.suit import SuitDNA
from direct.actor import Actor
import string
from ToonHead import *
from panda3d.core import *
from panda3d.direct import *
from libotp import *
from direct.inter... | 39.104771 | 459 | 0.595904 |
af8ef2aa7a2607dd0d305451ad9cb1bcbbec86c0 | 5,592 | py | Python | funds/scrap/company_info_w_historical_metrics.py | thorwhalen/funds | 9fe62daf9a808da96ab21e3d9a4b45b641b55585 | [
"Apache-2.0"
] | 1 | 2022-01-19T13:15:20.000Z | 2022-01-19T13:15:20.000Z | funds/scrap/company_info_w_historical_metrics.py | thorwhalen/funds | 9fe62daf9a808da96ab21e3d9a4b45b641b55585 | [
"Apache-2.0"
] | null | null | null | funds/scrap/company_info_w_historical_metrics.py | thorwhalen/funds | 9fe62daf9a808da96ab21e3d9a4b45b641b55585 | [
"Apache-2.0"
] | null | null | null | """Get company info joined with historical metrics and save to jsons"""
# TODO: Can do better by using merge/join in various places (instead of loops)
from dol import KvReader
from functools import cached_property, lru_cache
from io import BytesIO
import pandas as pd
from py2store import FilesOfZip, wrap_kvs, filt_it... | 28.530612 | 85 | 0.660944 |
c6be5f137109b5e3cc8e99cdf1daa8ffd877a49a | 1,757 | py | Python | tests/integration/conftest.py | MGough/flask-microservice-sqlalchemy-marshmallow | 3c615c49d0abab2d3e931bc254023cd1fc480f2d | [
"MIT"
] | 3 | 2020-09-17T14:34:37.000Z | 2022-03-17T09:46:46.000Z | tests/integration/conftest.py | MGough/flask-microservice-sqlalchemy-marshmallow | 3c615c49d0abab2d3e931bc254023cd1fc480f2d | [
"MIT"
] | 13 | 2020-04-26T14:53:41.000Z | 2020-05-12T10:25:59.000Z | tests/integration/conftest.py | MGough/flask-microservice-sqlalchemy-marshmallow | 3c615c49d0abab2d3e931bc254023cd1fc480f2d | [
"MIT"
] | null | null | null | import time
import docker
import pytest
import requests
APPLICATION_PORT = 8000
@pytest.fixture(scope="session")
def docker_client():
return docker.from_env()
@pytest.fixture(scope="session")
def application_image(docker_client):
image, logs = docker_client.images.build(path="./", pull=True)
for log i... | 28.33871 | 77 | 0.681844 |
5bd70b88bfce22dac61b3a2107610d4b1849e595 | 576 | py | Python | setup.py | professorplumb/django-validajax | 8bf806c850adfc707b9b50b8e7095071602c0b90 | [
"MIT"
] | null | null | null | setup.py | professorplumb/django-validajax | 8bf806c850adfc707b9b50b8e7095071602c0b90 | [
"MIT"
] | null | null | null | setup.py | professorplumb/django-validajax | 8bf806c850adfc707b9b50b8e7095071602c0b90 | [
"MIT"
] | null | null | null | import django_validajax
from setuptools import setup, find_packages
setup(
name='django-validajax',
version=django_validajax.__version__,
description="Real-time form validation with Django",
long_description=open('README.md').read(),
classifiers=[
# TODO
],
keywords=['django', 'for... | 27.428571 | 61 | 0.689236 |
dc44fe4060e0365e9e20eec886b62c3836db2c0d | 9,636 | py | Python | src/pyatmo/auth.py | piitaya/netatmo-api-python | e4bba55c6f0b08a9a6559658bc836731d1c08ed9 | [
"MIT"
] | null | null | null | src/pyatmo/auth.py | piitaya/netatmo-api-python | e4bba55c6f0b08a9a6559658bc836731d1c08ed9 | [
"MIT"
] | null | null | null | src/pyatmo/auth.py | piitaya/netatmo-api-python | e4bba55c6f0b08a9a6559658bc836731d1c08ed9 | [
"MIT"
] | null | null | null | import logging
from json import JSONDecodeError
from time import sleep
from typing import Callable, Dict, Optional, Tuple, Union
import requests
from oauthlib.oauth2 import LegacyApplicationClient, TokenExpiredError
from requests_oauthlib import OAuth2Session
from .exceptions import ApiError
from .helpers import _BAS... | 38.698795 | 132 | 0.611353 |
2df2abfe8aac189ac992d33fe12b07c3c6d8f5bd | 19,577 | py | Python | certbot/interfaces.py | XieXianbin/ssl-api | c1fcdab581b75d39d579b0fbf8d9560e16ebffa9 | [
"Apache-2.0"
] | null | null | null | certbot/interfaces.py | XieXianbin/ssl-api | c1fcdab581b75d39d579b0fbf8d9560e16ebffa9 | [
"Apache-2.0"
] | null | null | null | certbot/interfaces.py | XieXianbin/ssl-api | c1fcdab581b75d39d579b0fbf8d9560e16ebffa9 | [
"Apache-2.0"
] | 1 | 2021-12-02T08:42:28.000Z | 2021-12-02T08:42:28.000Z | """Certbot client interfaces."""
import abc
import zope.interface
# pylint: disable=no-self-argument,no-method-argument,no-init,inherit-non-class
# pylint: disable=too-few-public-methods
class AccountStorage(object):
"""Accounts storage interface."""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
... | 33.987847 | 94 | 0.653573 |
c938caa32ff1cd4f2a112ee670a451dd302b9b99 | 12,423 | py | Python | logmapperui/figures/plots.py | abaena78/logmapper-ui | a1aa13809ceb50a1774bf471ac9c6744cbe28293 | [
"MIT"
] | null | null | null | logmapperui/figures/plots.py | abaena78/logmapper-ui | a1aa13809ceb50a1774bf471ac9c6744cbe28293 | [
"MIT"
] | null | null | null | logmapperui/figures/plots.py | abaena78/logmapper-ui | a1aa13809ceb50a1774bf471ac9c6744cbe28293 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Feb 17 09:10:10 2018
@author: abaena
"""
"""
https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.plot.html
"""
#******************************************************************************
#Add logmapper-agent directory to python path for module exec... | 30.523342 | 148 | 0.53087 |
13688a6af63b0de85b620939dd795f778ba21cdd | 2,986 | py | Python | src/host/server.py | leolani/cltl-backend | 4ecc6227f9d48e40b9f59e6d78e0fcee9cdadbd4 | [
"MIT"
] | null | null | null | src/host/server.py | leolani/cltl-backend | 4ecc6227f9d48e40b9f59e6d78e0fcee9cdadbd4 | [
"MIT"
] | null | null | null | src/host/server.py | leolani/cltl-backend | 4ecc6227f9d48e40b9f59e6d78e0fcee9cdadbd4 | [
"MIT"
] | null | null | null | import logging
import flask
import numpy as np
from emissor.representation.scenario import Modality
from flask import Flask, Response, stream_with_context, json, jsonify
from flask import g as app_context
from flask.json import JSONEncoder
from cltl.backend.api.camera import CameraResolution
from cltl.backend.source.... | 32.456522 | 122 | 0.650703 |
1580fa29b4947bd96be59ae62ef7f2dd68b6ee05 | 2,083 | py | Python | graph_pagerank_ada_plan_2.py | MadsJensen/RP_scripts | b3f7afb27b6346ee209e4bfcd7d52049d69d2eaf | [
"BSD-3-Clause"
] | null | null | null | graph_pagerank_ada_plan_2.py | MadsJensen/RP_scripts | b3f7afb27b6346ee209e4bfcd7d52049d69d2eaf | [
"BSD-3-Clause"
] | null | null | null | graph_pagerank_ada_plan_2.py | MadsJensen/RP_scripts | b3f7afb27b6346ee209e4bfcd7d52049d69d2eaf | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import bct
from sklearn.externals import joblib
from my_settings import (bands, source_folder)
from sklearn.ensemble import AdaBoostClassifier
from sklearn.cross_validation import (StratifiedKFold, cross_val_score)
from sklearn.grid_search import GridSearchCV
subjects = [
"0008", "0009", "0010"... | 26.367089 | 75 | 0.615458 |
e9a864f1cc53ad39bd3400a51b01796c98d0a646 | 4,566 | py | Python | dev/vis_tv_field_digicam.py | danforthcenter/plantcv-dev-scripts | 57ebc9a031b7141b8965c927c3b7b01ba6504dc1 | [
"MIT"
] | null | null | null | dev/vis_tv_field_digicam.py | danforthcenter/plantcv-dev-scripts | 57ebc9a031b7141b8965c927c3b7b01ba6504dc1 | [
"MIT"
] | null | null | null | dev/vis_tv_field_digicam.py | danforthcenter/plantcv-dev-scripts | 57ebc9a031b7141b8965c927c3b7b01ba6504dc1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys, traceback
import cv2
import numpy as np
import argparse
import string
import plantcv as pcv
### Parse command-line arguments
def options():
parser = argparse.ArgumentParser(description="Imaging processing with opencv")
parser.add_argument("-i", "--image", help="Input image file.",... | 42.277778 | 167 | 0.718353 |
eab56702af2ff758f058abd56f460f2e2de7392d | 4,955 | py | Python | tatsu/objectmodel.py | Victorious3/TatSu | aec01f6478a37c69612d09050d7228ca3c7141bd | [
"BSD-2-Clause"
] | null | null | null | tatsu/objectmodel.py | Victorious3/TatSu | aec01f6478a37c69612d09050d7228ca3c7141bd | [
"BSD-2-Clause"
] | null | null | null | tatsu/objectmodel.py | Victorious3/TatSu | aec01f6478a37c69612d09050d7228ca3c7141bd | [
"BSD-2-Clause"
] | null | null | null | from __future__ import annotations
from collections.abc import Mapping, MutableMapping
from tatsu.util import asjson, asjsons
from tatsu.infos import CommentInfo
from tatsu.ast import AST
# TODO: from tatsu.exceptions import NoParseInfo
BASE_CLASS_TOKEN = '::'
class Node(object):
def __init__(self, ctx=None, ... | 26.356383 | 73 | 0.587487 |
a2ea9cfa0b6a7e8146fcbd5cabdd9e4157a0a46d | 3,619 | py | Python | tests/flask/test_database.py | schireson/strapp | b3288d0a46c465b20a72917e2270563162c981a7 | [
"MIT"
] | 2 | 2022-03-09T16:55:38.000Z | 2022-03-20T04:06:12.000Z | tests/flask/test_database.py | schireson/strapp | b3288d0a46c465b20a72917e2270563162c981a7 | [
"MIT"
] | null | null | null | tests/flask/test_database.py | schireson/strapp | b3288d0a46c465b20a72917e2270563162c981a7 | [
"MIT"
] | null | null | null | from strapp.flask import (
callback_factory,
create_app,
inject,
inject_db,
json_response,
manage_session,
Route,
sqlalchemy_database,
)
config = {
"drivername": "sqlite",
}
def test_database_injection():
@json_response
@inject_db
def view(db):
return db.execut... | 26.807407 | 95 | 0.629732 |
6bd52a1bc49e8663cc8e848aaeafa2f1da6661c1 | 8,961 | py | Python | slackbotExercise.py | jesseract/slackbot_exercise_bot | 12d95df5ff65b754bee84f399140e26da231fdd2 | [
"MIT"
] | null | null | null | slackbotExercise.py | jesseract/slackbot_exercise_bot | 12d95df5ff65b754bee84f399140e26da231fdd2 | [
"MIT"
] | null | null | null | slackbotExercise.py | jesseract/slackbot_exercise_bot | 12d95df5ff65b754bee84f399140e26da231fdd2 | [
"MIT"
] | null | null | null | import random
import time
import requests
import json
import csv
import os
from random import shuffle
import pickle
import os.path
import time
from datetime import datetime
from User import User
# Environment variables must be set with your tokens
USER_TOKEN_STRING = os.environ['SLACK_USER_TOKEN_STRING']
URL_TOKEN_S... | 31.552817 | 162 | 0.631291 |
e69c4d23fcc5f34418c7c60c90b06a5c8050a9ee | 2,774 | py | Python | plugins/pco/pcocheckins.py | afoster757/pcobot | 72b42d42ab53613fd45e2267d83c278372bb48ea | [
"MIT"
] | 10 | 2018-07-05T14:41:46.000Z | 2020-09-18T16:27:27.000Z | plugins/pco/pcocheckins.py | afoster757/pcobot | 72b42d42ab53613fd45e2267d83c278372bb48ea | [
"MIT"
] | 82 | 2018-07-05T05:42:12.000Z | 2021-02-17T19:15:01.000Z | plugins/pco/pcocheckins.py | afoster757/pcobot | 72b42d42ab53613fd45e2267d83c278372bb48ea | [
"MIT"
] | 18 | 2018-07-13T16:13:03.000Z | 2021-02-15T19:34:01.000Z | from will.plugin import WillPlugin
from will.decorators import respond_to, periodic, hear, randomly, route, rendered_template, require_settings
from plugins.pco import birthday, address, phone_numbers, checkins, msg_attachment, authenticate
from will.mixins.slackwhitelist import wl_chan_id
# You need to put your Perso... | 53.346154 | 117 | 0.563446 |
b4a0c122c6d9da36077dae82640c91a6fa3ba934 | 2,594 | py | Python | cryptarithm/problem.py | masu-mi/cryptarithm-solver | ca6f398f60be7495b1c9c65ce1655afafdeba75c | [
"MIT"
] | null | null | null | cryptarithm/problem.py | masu-mi/cryptarithm-solver | ca6f398f60be7495b1c9c65ce1655afafdeba75c | [
"MIT"
] | 9 | 2021-08-23T20:57:14.000Z | 2022-02-03T01:47:38.000Z | cryptarithm/problem.py | masu-mi/cryptarithm-solver | ca6f398f60be7495b1c9c65ce1655afafdeba75c | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import print_function
from ortools.sat.python import cp_model
from node import Op,EqExp,Var
from callbacks import VarArraySolutionPrinter
class Problem:
def __init__(self, eqExp, base = 10):
self.base = base
self.ast = eqExp
vals = analyze_values(eqExp)
... | 27.595745 | 70 | 0.565921 |
33b22472d8e32ef2d2205f97ba29dc252bd06031 | 1,784 | py | Python | bidirection_streaming/client/client.py | tuix/tutorials | 733d35a8a39df079e8c2432c441b70785ab08440 | [
"Apache-2.0"
] | 8 | 2020-04-21T13:29:04.000Z | 2021-12-13T08:59:09.000Z | bidirection_streaming/client/client.py | tuix/tutorials | 733d35a8a39df079e8c2432c441b70785ab08440 | [
"Apache-2.0"
] | 3 | 2021-04-27T11:03:04.000Z | 2021-05-24T18:22:57.000Z | bidirection_streaming/client/client.py | tuix/tutorials | 733d35a8a39df079e8c2432c441b70785ab08440 | [
"Apache-2.0"
] | 6 | 2020-07-06T08:23:25.000Z | 2021-11-24T10:39:34.000Z | import os
import time
import csv
import grpc
from databroker_pb2 import BrokerRequest
from databroker_pb2_grpc import BrokerServiceStub
import config
class Client():
"""
Client streams rows from a CSV file to the server and receives the response stream.
"""
def __init__(self, port, credentials):
... | 32.436364 | 87 | 0.598655 |
78a6be842a04fc400c062f1ffb6aeeeff543a894 | 1,860 | py | Python | new_code/predict.py | Cozyzheng/RS_DL_Junyi | c2c894ee9a2c6d4d5ffba6504c3c5f55ffda03d3 | [
"MIT"
] | null | null | null | new_code/predict.py | Cozyzheng/RS_DL_Junyi | c2c894ee9a2c6d4d5ffba6504c3c5f55ffda03d3 | [
"MIT"
] | null | null | null | new_code/predict.py | Cozyzheng/RS_DL_Junyi | c2c894ee9a2c6d4d5ffba6504c3c5f55ffda03d3 | [
"MIT"
] | null | null | null |
def predict(args):
# load the trained convolutional neural network
print("[INFO] loading network...")
model = load_model(args["model"])
stride = args['stride']
for n in range(len(TEST_SET)):
path = TEST_SET[n]
# load the image
image = cv2.imread('./test/' + path)
# p... | 44.285714 | 111 | 0.536022 |
8ad65f3412429343f7c250a09d60a6d55aacc40c | 45,533 | py | Python | test/test_bson.py | blink1073/mongo-python-driver | 98d393336411b7cd5ad4e184ca45192f76fb48e8 | [
"Apache-2.0"
] | null | null | null | test/test_bson.py | blink1073/mongo-python-driver | 98d393336411b7cd5ad4e184ca45192f76fb48e8 | [
"Apache-2.0"
] | null | null | null | test/test_bson.py | blink1073/mongo-python-driver | 98d393336411b7cd5ad4e184ca45192f76fb48e8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2009-present MongoDB, 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 applicab... | 39.697472 | 123 | 0.595063 |
03e76d51e81a420064ebcba93588c8eae2df27b0 | 1,708 | py | Python | No_0705_Design HashSet/design_hash_set_by_bytearray.py | coderMaruf/leetcode-1 | 20ffe26e43999e44c8acf9800acb371a49bb5853 | [
"MIT"
] | 32 | 2020-01-05T13:37:16.000Z | 2022-03-26T07:27:09.000Z | No_0705_Design HashSet/design_hash_set_by_bytearray.py | coderMaruf/leetcode-1 | 20ffe26e43999e44c8acf9800acb371a49bb5853 | [
"MIT"
] | null | null | null | No_0705_Design HashSet/design_hash_set_by_bytearray.py | coderMaruf/leetcode-1 | 20ffe26e43999e44c8acf9800acb371a49bb5853 | [
"MIT"
] | 8 | 2020-06-18T16:17:27.000Z | 2022-03-15T23:58:18.000Z | '''
Description:
Design a HashSet without using any built-in hash table libraries.
To be specific, your design should include these functions:
add(value): Insert a value into the HashSet.
contains(value) : Return whether the value exists in the HashSet or not.
remove(value): Remove a value in the HashSet. If the v... | 23.722222 | 101 | 0.612412 |
fc100d0eabd0c790c4fa65040f90b2681a37bc0a | 7,452 | py | Python | jwt/api_jwt.py | jitendra29mishra/pyjwt | e38c40f243e18c84a1f3558e44feb4fe91a5de95 | [
"MIT"
] | null | null | null | jwt/api_jwt.py | jitendra29mishra/pyjwt | e38c40f243e18c84a1f3558e44feb4fe91a5de95 | [
"MIT"
] | null | null | null | jwt/api_jwt.py | jitendra29mishra/pyjwt | e38c40f243e18c84a1f3558e44feb4fe91a5de95 | [
"MIT"
] | null | null | null | import json
from calendar import timegm
from collections.abc import Iterable, Mapping
from datetime import datetime, timedelta, timezone
from typing import Any, Dict, List, Optional, Type, Union
from . import api_jws
from .exceptions import (
DecodeError,
ExpiredSignatureError,
ImmatureSignatureError,
... | 33.267857 | 110 | 0.601047 |
6293a4c400539df7ea108e93bba4c42055653d77 | 3,284 | py | Python | core/views.py | rozap/aircooledrescue | 95c0fec2a8452205019db7e721a7da1fcc4d5507 | [
"MIT"
] | null | null | null | core/views.py | rozap/aircooledrescue | 95c0fec2a8452205019db7e721a7da1fcc4d5507 | [
"MIT"
] | 2 | 2017-04-22T23:23:58.000Z | 2017-04-22T23:24:19.000Z | core/views.py | rozap/aircooledrescue | 95c0fec2a8452205019db7e721a7da1fcc4d5507 | [
"MIT"
] | null | null | null | from django.shortcuts import render_to_response
from django.template.loader import render_to_string
from django.template import RequestContext
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden
from buspeople.decorators import json_view
from models import Person, Service, Activation
from ... | 27.366667 | 95 | 0.72503 |
a2f3f6c8142dd08854baded65a0c600a567a4b29 | 1,586 | py | Python | tests/core/test_scenarios.py | luigiberducci/Scenic | ca705612eccde86fed26e5c87e0e14e67c66e22e | [
"BSD-3-Clause"
] | null | null | null | tests/core/test_scenarios.py | luigiberducci/Scenic | ca705612eccde86fed26e5c87e0e14e67c66e22e | [
"BSD-3-Clause"
] | null | null | null | tests/core/test_scenarios.py | luigiberducci/Scenic | ca705612eccde86fed26e5c87e0e14e67c66e22e | [
"BSD-3-Clause"
] | null | null | null |
import pytest
from scenic.core.distributions import Range
from tests.utils import compileScenic
def test_nonexistent_scenario_local_1():
scenario = compileScenic('ego = Object')
with pytest.raises(AttributeError):
scenario.dynamicScenario.blah
def test_nonexistent_scenario_local_2():
scenario =... | 31.098039 | 79 | 0.660151 |
ff0ecf1746791d2f7e5e4ff4f5839258b059557d | 1,680 | py | Python | django_react_templatetags/ssr/hypernova.py | comoteshsd/django-react-templatetags | 2519fe31b66151ccf7e7ce8014c5ba3231c9d339 | [
"MIT"
] | 408 | 2016-05-26T16:00:41.000Z | 2022-03-05T15:09:52.000Z | django_react_templatetags/ssr/hypernova.py | comoteshsd/django-react-templatetags | 2519fe31b66151ccf7e7ce8014c5ba3231c9d339 | [
"MIT"
] | 63 | 2015-12-16T07:28:29.000Z | 2022-02-16T07:56:27.000Z | django_react_templatetags/ssr/hypernova.py | comoteshsd/django-react-templatetags | 2519fe31b66151ccf7e7ce8014c5ba3231c9d339 | [
"MIT"
] | 40 | 2016-10-30T21:04:36.000Z | 2022-02-15T16:50:13.000Z | import logging
import json
import re
from django.conf import settings
import hypernova
logger = logging.getLogger(__name__)
hypernova_id_re = re.compile(r"data-hypernova-id=\"([\w\-]*)\"")
hypernova_key_re = re.compile(r"data-hypernova-key=\"([\w\-]*)\"")
class HypernovaService:
def load_or_empty(self, compone... | 28.965517 | 86 | 0.606548 |
e52defae88f28de723090ad9c709f768fd42f153 | 993 | py | Python | pytos/models/media_item.py | thewisenerd/pytos | e350f679257791b563e8e02e109b158f5250e4a2 | [
"MIT"
] | null | null | null | pytos/models/media_item.py | thewisenerd/pytos | e350f679257791b563e8e02e109b158f5250e4a2 | [
"MIT"
] | null | null | null | pytos/models/media_item.py | thewisenerd/pytos | e350f679257791b563e8e02e109b158f5250e4a2 | [
"MIT"
] | null | null | null | import json
class MediaItem:
def __init__(self, _id, description, base_url, product_url, mime_type, media_meta_data, filename, raw):
self.id = _id
self.description = description
self.base_url = base_url
self.product_url = product_url
self.filename = filename
self.mi... | 28.371429 | 108 | 0.620342 |
7409480d3159a0a9222d6468b52c2fd941a2ff15 | 1,529 | py | Python | djangosige/apps/fiscal/migrations/0004_auto_20210603_1632.py | wfoschiera/djangoSIGE | ff3309b2c604219dcf92c63e837262db0e8da774 | [
"MIT"
] | null | null | null | djangosige/apps/fiscal/migrations/0004_auto_20210603_1632.py | wfoschiera/djangoSIGE | ff3309b2c604219dcf92c63e837262db0e8da774 | [
"MIT"
] | 12 | 2021-05-30T03:07:44.000Z | 2021-06-11T17:16:44.000Z | djangosige/apps/fiscal/migrations/0004_auto_20210603_1632.py | wfoschiera/djangoSIGE | ff3309b2c604219dcf92c63e837262db0e8da774 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.8 on 2021-06-03 19:32
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('fiscal', '0003_auto_20170915_0904'),
]
operations = [
migrations.AlterModelOptions(
name='configuracaonotafiscal',
options={... | 44.970588 | 527 | 0.647482 |
0085bda0ea80181553eb986132f64ef15d15f02a | 15,635 | py | Python | modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py | Rubtsowa/modin | 6550939753c76e896ef2bfd65bb9468d6ad161d7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py | Rubtsowa/modin | 6550939753c76e896ef2bfd65bb9468d6ad161d7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | modin/core/execution/ray/implementations/pandas_on_ray/partitioning/partition.py | Rubtsowa/modin | 6550939753c76e896ef2bfd65bb9468d6ad161d7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... | 31.778455 | 102 | 0.60064 |
da8767a8f8ba24bdd7c92ff96ef13933954c3b10 | 72,541 | py | Python | tests/extractcode/test_patch.py | chetanya-shrimali/scancode-toolkit | a1a22fb225cbeb211bd6f92272a46f1351f57d6b | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | tests/extractcode/test_patch.py | chetanya-shrimali/scancode-toolkit | a1a22fb225cbeb211bd6f92272a46f1351f57d6b | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | tests/extractcode/test_patch.py | chetanya-shrimali/scancode-toolkit | a1a22fb225cbeb211bd6f92272a46f1351f57d6b | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | #
# Copyright (c) 2017 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... | 67.985942 | 156 | 0.789112 |
59bd0c212b1460c36d3a921211faa0223b690825 | 1,976 | py | Python | azure-servicefabric/azure/servicefabric/models/property_batch_operation.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-servicefabric/azure/servicefabric/models/property_batch_operation.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-servicefabric/azure/servicefabric/models/property_batch_operation.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-10-16T13:08:23.000Z | 2018-10-16T13:08:23.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 ... | 38.745098 | 288 | 0.660425 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.